dsh-open-artifact 0.14.2 → 0.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/lib/client.js +1 -1
- package/lib/index.js +3 -3
- package/package.json +1 -1
- package/skills/open-artifact/SKILL.md +1 -1
- package/vendor/open-artifact.mjs +27 -16
- package/vendor/runtime.json +1 -1
- package/vendor/shell/assets/{index-BX3e8IQV.js → index-yS15KRJ8.js} +4 -4
- package/vendor/shell/index.html +1 -1
- package/vendor/type-server/cli.mjs +40 -20
- package/vendor/type-server/editors/data/assets/{index-Dy-b-2Fk.js → index-CelumSdk.js} +47 -47
- package/vendor/type-server/editors/data/index.html +1 -1
- package/vendor/type-server/editors/design/assets/{index-CE4i9MNf.js → index-BrdhJyzS.js} +19 -19
- package/vendor/type-server/editors/design/index.html +1 -1
- package/vendor/type-server/editors/design-system/assets/{index-CF8_SYR3.js → index-CzmxC323.js} +15 -15
- package/vendor/type-server/editors/design-system/index.html +1 -1
- package/vendor/type-server/editors/docs/assets/{abnfDiagram-WEYOIA3C-BG-j2AXL.js → abnfDiagram-WEYOIA3C-Dv154SrF.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{architectureDiagram-ZHVYKT53-Vqu2pae_.js → architectureDiagram-ZHVYKT53-DyZHuLhJ.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{blockDiagram-RJAE7QA3-CwGvMIxW.js → blockDiagram-RJAE7QA3-BVzElt5r.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{c4Diagram-XDPPPE54-n0jdpDKq.js → c4Diagram-XDPPPE54-CZt_JzyM.js} +1 -1
- package/vendor/type-server/editors/docs/assets/channel-wcQnbnDl.js +1 -0
- package/vendor/type-server/editors/docs/assets/{chunk-2E7WHVMD-Bmc6NazT.js → chunk-2E7WHVMD-B9sK7gtB.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-2Q5K7J3B-mCbtiqgW.js → chunk-2Q5K7J3B-0sEzcfME.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-4EMNKR2T-x2QF33QY.js → chunk-4EMNKR2T-C_Z99jKO.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-55XCU76K-DOnHp0lb.js → chunk-55XCU76K-CTJ_yvnE.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-5VM5RSS4-3rEfMH5a.js → chunk-5VM5RSS4-BVUngG1n.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-JWPE2WC7-VCWr0yc3.js → chunk-JWPE2WC7-BG8q643y.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-VQ5W62QI-CYUpRyMu.js → chunk-VQ5W62QI-DM3WoZ2q.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-XXDRQBXY-CLxbhwTC.js → chunk-XXDRQBXY-C00q7Mab.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-ZCHMQSOR-BbW_fsc9.js → chunk-ZCHMQSOR-D4maMLQe.js} +2 -2
- package/vendor/type-server/editors/docs/assets/{classDiagram-v2-4MYWR3UA-8DExXnrI.js → classDiagram-v2-4MYWR3UA-Bp5cp9Vf.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{core-IXjFYrPN.js → core-B_ycqU5t.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{cose-bilkent-JH36ORCC-DeUP3SFO.js → cose-bilkent-JH36ORCC-DkfTi_Mh.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{cynefin-EF2NZ3EQ-DwGvjuCu.js → cynefin-EF2NZ3EQ-BAO9xuAp.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{cynefinDiagram-WF24UDRP-CAjvh3Rh.js → cynefinDiagram-WF24UDRP-Dg1Wkac0.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{dagre-NK4GIZVX-DQvyrw7W.js → dagre-NK4GIZVX-CfNALyX0.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{diagram-CBK3MWTC-BqauVVqW.js → diagram-CBK3MWTC-DgJwZ6YO.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{diagram-I5XIIV2D-C2EbWIaZ.js → diagram-I5XIIV2D-DfXCPCo3.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{diagram-ODIL2UCW-CI444MZH.js → diagram-ODIL2UCW-CS08zfFl.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{diagram-PFBEJUXE-6gN57Cw1.js → diagram-PFBEJUXE-AiRj8OJ_.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{diagram-RJA3I4VV-DquglZAe.js → diagram-RJA3I4VV-sPxKazJU.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{diagram-TYUNFSNR-D0gMZqLC.js → diagram-TYUNFSNR-BTGn9TFm.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{ebnfDiagram-V4P3TTPT-LdMjJc-D.js → ebnfDiagram-V4P3TTPT-BPbh_BoA.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{elk-QONTBCTQ-Rx_sWhs5.js → elk-QONTBCTQ-D7zmcVsR.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{erDiagram-KYQIGQAA-Dtc7WR2K.js → erDiagram-KYQIGQAA-q-bPsv5E.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{flowDiagram-IUGLLWBU-B56V7sO7.js → flowDiagram-IUGLLWBU-C_zjPe4l.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{ganttDiagram-R7GPNTJY-DukbWqGl.js → ganttDiagram-R7GPNTJY-DDpOC6aJ.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{gitGraphDiagram-PDYL7XHY-CgUGMuv3.js → gitGraphDiagram-PDYL7XHY-BU1msmkW.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{index-BvuYV_FZ.js → index-qJ3X4MC1.js} +5 -5
- package/vendor/type-server/editors/docs/assets/{infoDiagram-MVDRKAX5-D7OWIS2p.js → infoDiagram-MVDRKAX5-B0LtNVGB.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{ishikawaDiagram-HPEHV2GE-9IJkT-L2.js → ishikawaDiagram-HPEHV2GE-BhviCdhI.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{journeyDiagram-BOSHW7O7-CUXsvfta.js → journeyDiagram-BOSHW7O7-BTSz6EUz.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{kanban-definition-FNSA4HC5-DzhZ-jCE.js → kanban-definition-FNSA4HC5-CswepIc1.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{mermaid.core-BBRc2-gW.js → mermaid.core-CP2KJVd4.js} +4 -4
- package/vendor/type-server/editors/docs/assets/{mindmap-definition-6OY57UG3-HEmWWn1M.js → mindmap-definition-6OY57UG3-B8dzRim4.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{pegDiagram-ECIUJNBX-WW65pDqs.js → pegDiagram-ECIUJNBX-B7V2uqYh.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{pieDiagram-GNMPY74T-E8YMsPwZ.js → pieDiagram-GNMPY74T-h2YV0--u.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{quadrantDiagram-D57K4MC3-DVhjEGHu.js → quadrantDiagram-D57K4MC3-BDrvmUiS.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{railroadDiagram-Y72NRBL7-CjY1VtnU.js → railroadDiagram-Y72NRBL7-CBc2jbav.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{requirementDiagram-EQYSW5RA-0dZZgDEa.js → requirementDiagram-EQYSW5RA-2vzlnjD8.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{sankeyDiagram-SY24JHO5-DBPOsesB.js → sankeyDiagram-SY24JHO5-ChkHrWqS.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{sequenceDiagram-BLEHNHQU-LSs7qw_D.js → sequenceDiagram-BLEHNHQU-x-fxt2Mo.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{sizeCapture-INFHLROL-Bofo-6QF.js → sizeCapture-INFHLROL-CGjaw82k.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{stateDiagram-v2-A6IESKWZ-DjZbSUVa.js → stateDiagram-v2-A6IESKWZ-DOK0Upui.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{swimlanes-B3ENRKFQ-DifxCy8G.js → swimlanes-B3ENRKFQ-D5eScFWA.js} +1 -1
- package/vendor/type-server/editors/docs/assets/swimlanesDiagram-AYQRV4AK-C21UYBd-.js +8 -0
- package/vendor/type-server/editors/docs/assets/{timeline-definition-JXYKGLGB-Drw89BHm.js → timeline-definition-JXYKGLGB-W55YrrVw.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{usecaseDiagram-WPOLBNNX-C7AKvNqa.js → usecaseDiagram-WPOLBNNX-tABT6ize.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{vennDiagram-Q3Y3IDCW-D__xbJ1Z.js → vennDiagram-Q3Y3IDCW-BWt2GhcT.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{wardleyDiagram-IVAIDKWA-EaWls8np.js → wardleyDiagram-IVAIDKWA-fvuZtRA5.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{xychartDiagram-4URNHDU4-BooBX84y.js → xychartDiagram-4URNHDU4-DcwGParI.js} +1 -1
- package/vendor/type-server/editors/docs/index.html +1 -1
- package/vendor/type-server/editors/motion/assets/{gif-jobs-BzGj5rGu.js → gif-jobs-D3frbcNq.js} +1 -1
- package/vendor/type-server/editors/motion/assets/index-SWgAM2I3.js +213 -0
- package/vendor/type-server/editors/motion/assets/{src-0s-j4Jwn.js → src-D5Za67Y-.js} +1 -1
- package/vendor/type-server/editors/motion/index.html +1 -1
- package/vendor/type-server/editors/sheets/assets/{index-Dc9wNP6r.js → index-rCtPaKgo.js} +37 -37
- package/vendor/type-server/editors/sheets/index.html +1 -1
- package/vendor/type-server/editors/slides/assets/{index-Ces62f2e.js → index-DjcMrs2F.js} +9 -9
- package/vendor/type-server/editors/slides/assets/{src-DE4bzDk6.js → src-Bd7LdOFl.js} +1 -1
- package/vendor/type-server/editors/slides/index.html +1 -1
- package/vendor/type-server/editors/whiteboard/assets/{index-DAkcWFLi.js → index-nmJr9plT.js} +84 -84
- package/vendor/type-server/editors/whiteboard/index.html +1 -1
- package/vendor/type-server/shell/assets/{index-BX3e8IQV.js → index-yS15KRJ8.js} +4 -4
- package/vendor/type-server/shell/index.html +1 -1
- package/vendor/type-server/editors/docs/assets/channel-Da8uoER0.js +0 -1
- package/vendor/type-server/editors/docs/assets/swimlanesDiagram-AYQRV4AK-CPSGKqTh.js +0 -8
- package/vendor/type-server/editors/motion/assets/index-Bn5z9Iwg.js +0 -213
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
function PR(t,o){for(var a=0;a<o.length;a++){const r=o[a];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in t)){const c=Object.getOwnPropertyDescriptor(r,l);c&&Object.defineProperty(t,l,c.get?c:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function a(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=a(l);fetch(l.href,c)}})();function IR(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kp={exports:{}},Mi={};var Zv;function HR(){if(Zv)return Mi;Zv=1;var t=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function a(r,l,c){var d=null;if(c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),"key"in l){c={};for(var g in l)g!=="key"&&(c[g]=l[g])}else c=l;return l=c.ref,{$$typeof:t,type:r,key:d,ref:l!==void 0?l:null,props:c}}return Mi.Fragment=o,Mi.jsx=a,Mi.jsxs=a,Mi}var Jv;function UR(){return Jv||(Jv=1,kp.exports=HR()),kp.exports}var p=UR(),Mp={exports:{}},Xe={};var ex;function BR(){if(ex)return Xe;ex=1;var t=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),S=Symbol.iterator;function w(N){return N===null||typeof N!="object"?null:(N=S&&N[S]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,A={};function C(N,V,J){this.props=N,this.context=V,this.refs=A,this.updater=J||T}C.prototype.isReactComponent={},C.prototype.setState=function(N,V){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,V,"setState")},C.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function _(){}_.prototype=C.prototype;function k(N,V,J){this.props=N,this.context=V,this.refs=A,this.updater=J||T}var M=k.prototype=new _;M.constructor=k,O(M,C.prototype),M.isPureReactComponent=!0;var z=Array.isArray;function D(){}var L={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function Y(N,V,J){var K=J.ref;return{$$typeof:t,type:N,key:V,ref:K!==void 0?K:null,props:J}}function H(N,V){return Y(N.type,V,N.props)}function I(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function j(N){var V={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(J){return V[J]})}var U=/\/+/g;function te(N,V){return typeof N=="object"&&N!==null&&N.key!=null?j(""+N.key):V.toString(36)}function $(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(V){N.status==="pending"&&(N.status="fulfilled",N.value=V)},function(V){N.status==="pending"&&(N.status="rejected",N.reason=V)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function P(N,V,J,K,se){var re=typeof N;(re==="undefined"||re==="boolean")&&(N=null);var me=!1;if(N===null)me=!0;else switch(re){case"bigint":case"string":case"number":me=!0;break;case"object":switch(N.$$typeof){case t:case o:me=!0;break;case y:return me=N._init,P(me(N._payload),V,J,K,se)}}if(me)return se=se(N),me=K===""?"."+te(N,0):K,z(se)?(J="",me!=null&&(J=me.replace(U,"$&/")+"/"),P(se,V,J,"",function(Ce){return Ce})):se!=null&&(I(se)&&(se=H(se,J+(se.key==null||N&&N.key===se.key?"":(""+se.key).replace(U,"$&/")+"/")+me)),V.push(se)),1;me=0;var pe=K===""?".":K+":";if(z(N))for(var be=0;be<N.length;be++)K=N[be],re=pe+te(K,be),me+=P(K,V,J,re,se);else if(be=w(N),typeof be=="function")for(N=be.call(N),be=0;!(K=N.next()).done;)K=K.value,re=pe+te(K,be++),me+=P(K,V,J,re,se);else if(re==="object"){if(typeof N.then=="function")return P($(N),V,J,K,se);throw V=String(N),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return me}function q(N,V,J){if(N==null)return N;var K=[],se=0;return P(N,K,"","",function(re){return V.call(J,re,se++)}),K}function X(N){if(N._status===-1){var V=N._result;V=V(),V.then(function(J){(N._status===0||N._status===-1)&&(N._status=1,N._result=J)},function(J){(N._status===0||N._status===-1)&&(N._status=2,N._result=J)}),N._status===-1&&(N._status=0,N._result=V)}if(N._status===1)return N._result.default;throw N._result}var Z=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=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(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},W={map:q,forEach:function(N,V,J){q(N,function(){V.apply(this,arguments)},J)},count:function(N){var V=0;return q(N,function(){V++}),V},toArray:function(N){return q(N,function(V){return V})||[]},only:function(N){if(!I(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Xe.Activity=v,Xe.Children=W,Xe.Component=C,Xe.Fragment=a,Xe.Profiler=l,Xe.PureComponent=k,Xe.StrictMode=r,Xe.Suspense=m,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return L.H.useMemoCache(N)}},Xe.cache=function(N){return function(){return N.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(N,V,J){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var K=O({},N.props),se=N.key;if(V!=null)for(re in V.key!==void 0&&(se=""+V.key),V)!B.call(V,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&V.ref===void 0||(K[re]=V[re]);var re=arguments.length-2;if(re===1)K.children=J;else if(1<re){for(var me=Array(re),pe=0;pe<re;pe++)me[pe]=arguments[pe+2];K.children=me}return Y(N.type,se,K)},Xe.createContext=function(N){return N={$$typeof:d,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:c,_context:N},N},Xe.createElement=function(N,V,J){var K,se={},re=null;if(V!=null)for(K in V.key!==void 0&&(re=""+V.key),V)B.call(V,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(se[K]=V[K]);var me=arguments.length-2;if(me===1)se.children=J;else if(1<me){for(var pe=Array(me),be=0;be<me;be++)pe[be]=arguments[be+2];se.children=pe}if(N&&N.defaultProps)for(K in me=N.defaultProps,me)se[K]===void 0&&(se[K]=me[K]);return Y(N,re,se)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(N){return{$$typeof:g,render:N}},Xe.isValidElement=I,Xe.lazy=function(N){return{$$typeof:y,_payload:{_status:-1,_result:N},_init:X}},Xe.memo=function(N,V){return{$$typeof:h,type:N,compare:V===void 0?null:V}},Xe.startTransition=function(N){var V=L.T,J={};L.T=J;try{var K=N(),se=L.S;se!==null&&se(J,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(D,Z)}catch(re){Z(re)}finally{V!==null&&J.types!==null&&(V.types=J.types),L.T=V}},Xe.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Xe.use=function(N){return L.H.use(N)},Xe.useActionState=function(N,V,J){return L.H.useActionState(N,V,J)},Xe.useCallback=function(N,V){return L.H.useCallback(N,V)},Xe.useContext=function(N){return L.H.useContext(N)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(N,V){return L.H.useDeferredValue(N,V)},Xe.useEffect=function(N,V){return L.H.useEffect(N,V)},Xe.useEffectEvent=function(N){return L.H.useEffectEvent(N)},Xe.useId=function(){return L.H.useId()},Xe.useImperativeHandle=function(N,V,J){return L.H.useImperativeHandle(N,V,J)},Xe.useInsertionEffect=function(N,V){return L.H.useInsertionEffect(N,V)},Xe.useLayoutEffect=function(N,V){return L.H.useLayoutEffect(N,V)},Xe.useMemo=function(N,V){return L.H.useMemo(N,V)},Xe.useOptimistic=function(N,V){return L.H.useOptimistic(N,V)},Xe.useReducer=function(N,V,J){return L.H.useReducer(N,V,J)},Xe.useRef=function(N){return L.H.useRef(N)},Xe.useState=function(N){return L.H.useState(N)},Xe.useSyncExternalStore=function(N,V,J){return L.H.useSyncExternalStore(N,V,J)},Xe.useTransition=function(){return L.H.useTransition()},Xe.version="19.2.4",Xe}var tx;function rl(){return tx||(tx=1,Mp.exports=BR()),Mp.exports}var b=rl();const Pi=IR(b),VR=PR({__proto__:null,default:Pi},[b]);var jp={exports:{}},ji={},_p={exports:{}},Dp={};var nx;function FR(){return nx||(nx=1,(function(t){function o(P,q){var X=P.length;P.push(q);e:for(;0<X;){var Z=X-1>>>1,W=P[Z];if(0<l(W,q))P[Z]=q,P[X]=W,X=Z;else break e}}function a(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var q=P[0],X=P.pop();if(X!==q){P[0]=X;e:for(var Z=0,W=P.length,N=W>>>1;Z<N;){var V=2*(Z+1)-1,J=P[V],K=V+1,se=P[K];if(0>l(J,X))K<W&&0>l(se,J)?(P[Z]=se,P[K]=X,Z=K):(P[Z]=J,P[V]=X,Z=V);else if(K<W&&0>l(se,X))P[Z]=se,P[K]=X,Z=K;else break e}}return q}function l(P,q){var X=P.sortIndex-q.sortIndex;return X!==0?X:P.id-q.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,g=d.now();t.unstable_now=function(){return d.now()-g}}var m=[],h=[],y=1,v=null,S=3,w=!1,T=!1,O=!1,A=!1,C=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function M(P){for(var q=a(h);q!==null;){if(q.callback===null)r(h);else if(q.startTime<=P)r(h),q.sortIndex=q.expirationTime,o(m,q);else break;q=a(h)}}function z(P){if(O=!1,M(P),!T)if(a(m)!==null)T=!0,D||(D=!0,j());else{var q=a(h);q!==null&&$(z,q.startTime-P)}}var D=!1,L=-1,B=5,Y=-1;function H(){return A?!0:!(t.unstable_now()-Y<B)}function I(){if(A=!1,D){var P=t.unstable_now();Y=P;var q=!0;try{e:{T=!1,O&&(O=!1,_(L),L=-1),w=!0;var X=S;try{t:{for(M(P),v=a(m);v!==null&&!(v.expirationTime>P&&H());){var Z=v.callback;if(typeof Z=="function"){v.callback=null,S=v.priorityLevel;var W=Z(v.expirationTime<=P);if(P=t.unstable_now(),typeof W=="function"){v.callback=W,M(P),q=!0;break t}v===a(m)&&r(m),M(P)}else r(m);v=a(m)}if(v!==null)q=!0;else{var N=a(h);N!==null&&$(z,N.startTime-P),q=!1}}break e}finally{v=null,S=X,w=!1}q=void 0}}finally{q?j():D=!1}}}var j;if(typeof k=="function")j=function(){k(I)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,te=U.port2;U.port1.onmessage=I,j=function(){te.postMessage(null)}}else j=function(){C(I,0)};function $(P,q){L=C(function(){P(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(P){P.callback=null},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_next=function(P){switch(S){case 1:case 2:case 3:var q=3;break;default:q=S}var X=S;S=q;try{return P()}finally{S=X}},t.unstable_requestPaint=function(){A=!0},t.unstable_runWithPriority=function(P,q){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var X=S;S=P;try{return q()}finally{S=X}},t.unstable_scheduleCallback=function(P,q,X){var Z=t.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?Z+X:Z):X=Z,P){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=X+W,P={id:y++,callback:q,priorityLevel:P,startTime:X,expirationTime:W,sortIndex:-1},X>Z?(P.sortIndex=X,o(h,P),a(m)===null&&P===a(h)&&(O?(_(L),L=-1):O=!0,$(z,X-Z))):(P.sortIndex=W,o(m,P),T||w||(T=!0,D||(D=!0,j()))),P},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(P){var q=S;return function(){var X=S;S=q;try{return P.apply(this,arguments)}finally{S=X}}}})(Dp)),Dp}var ox;function YR(){return ox||(ox=1,_p.exports=FR()),_p.exports}var zp={exports:{}},gn={};var sx;function qR(){if(sx)return gn;sx=1;var t=rl();function o(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(o(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},l=Symbol.for("react.portal");function c(m,h,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:""+v,children:m,containerInfo:h,implementation:y}}var d=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,gn.createPortal=function(m,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(o(299));return c(m,h,null,y)},gn.flushSync=function(m){var h=d.T,y=r.p;try{if(d.T=null,r.p=2,m)return m()}finally{d.T=h,r.p=y,r.d.f()}},gn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(m,h))},gn.prefetchDNS=function(m){typeof m=="string"&&r.d.D(m)},gn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var y=h.as,v=g(y,h.crossOrigin),S=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?r.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:v,integrity:S,fetchPriority:w}):y==="script"&&r.d.X(m,{crossOrigin:v,integrity:S,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},gn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=g(h.as,h.crossOrigin);r.d.M(m,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(m)},gn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,v=g(y,h.crossOrigin);r.d.L(m,y,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},gn.preloadModule=function(m,h){if(typeof m=="string")if(h){var y=g(h.as,h.crossOrigin);r.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(m)},gn.requestFormReset=function(m){r.d.r(m)},gn.unstable_batchedUpdates=function(m,h){return m(h)},gn.useFormState=function(m,h,y){return d.H.useFormState(m,h,y)},gn.useFormStatus=function(){return d.H.useHostTransitionStatus()},gn.version="19.2.4",gn}var ax;function nS(){if(ax)return zp.exports;ax=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(o){console.error(o)}}return t(),zp.exports=qR(),zp.exports}var rx;function GR(){if(rx)return ji;rx=1;var t=YR(),o=rl(),a=nS();function r(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var n=e,s=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(s=n.return),e=n.return;while(e)}return n.tag===3?s:null}function d(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(c(e)!==e)throw Error(r(188))}function h(e){var n=e.alternate;if(!n){if(n=c(e),n===null)throw Error(r(188));return n!==e?null:e}for(var s=e,i=n;;){var u=s.return;if(u===null)break;var f=u.alternate;if(f===null){if(i=u.return,i!==null){s=i;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===s)return m(u),e;if(f===i)return m(u),n;f=f.sibling}throw Error(r(188))}if(s.return!==i.return)s=u,i=f;else{for(var x=!1,R=u.child;R;){if(R===s){x=!0,s=u,i=f;break}if(R===i){x=!0,i=u,s=f;break}R=R.sibling}if(!x){for(R=f.child;R;){if(R===s){x=!0,s=f,i=u;break}if(R===i){x=!0,i=f,s=u;break}R=R.sibling}if(!x)throw Error(r(189))}}if(s.alternate!==i)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?e:n}function y(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=y(e),n!==null)return n;e=e.sibling}return null}var v=Object.assign,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),k=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function j(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var U=Symbol.for("react.client.reference");function te(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===U?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case C:return"Profiler";case A:return"StrictMode";case z:return"Suspense";case D:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case k:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case M:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return n=e.displayName||null,n!==null?n:te(e.type)||"Memo";case B:n=e._payload,e=e._init;try{return te(e(n))}catch{}}return null}var $=Array.isArray,P=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},Z=[],W=-1;function N(e){return{current:e}}function V(e){0>W||(e.current=Z[W],Z[W]=null,W--)}function J(e,n){W++,Z[W]=e.current,e.current=n}var K=N(null),se=N(null),re=N(null),me=N(null);function pe(e,n){switch(J(re,n),J(se,e),J(K,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Sv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Sv(n),e=wv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(K),J(K,e)}function be(){V(K),V(se),V(re)}function Ce(e){e.memoizedState!==null&&J(me,e);var n=K.current,s=wv(n,e.type);n!==s&&(J(se,e),J(K,s))}function Me(e){se.current===e&&(V(K),V(se)),me.current===e&&(V(me),Oi._currentValue=X)}var ye,ge;function Te(e){if(ye===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);ye=n&&n[1]||"",ge=-1<s.stack.indexOf(`
|
|
1
|
+
function PR(t,o){for(var a=0;a<o.length;a++){const r=o[a];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in t)){const c=Object.getOwnPropertyDescriptor(r,l);c&&Object.defineProperty(t,l,c.get?c:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function a(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=a(l);fetch(l.href,c)}})();function IR(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kp={exports:{}},Mi={};var Zv;function HR(){if(Zv)return Mi;Zv=1;var t=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function a(r,l,c){var d=null;if(c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),"key"in l){c={};for(var g in l)g!=="key"&&(c[g]=l[g])}else c=l;return l=c.ref,{$$typeof:t,type:r,key:d,ref:l!==void 0?l:null,props:c}}return Mi.Fragment=o,Mi.jsx=a,Mi.jsxs=a,Mi}var Jv;function UR(){return Jv||(Jv=1,kp.exports=HR()),kp.exports}var p=UR(),Mp={exports:{}},Xe={};var ex;function BR(){if(ex)return Xe;ex=1;var t=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),S=Symbol.iterator;function w(N){return N===null||typeof N!="object"?null:(N=S&&N[S]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,A={};function C(N,V,J){this.props=N,this.context=V,this.refs=A,this.updater=J||T}C.prototype.isReactComponent={},C.prototype.setState=function(N,V){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,V,"setState")},C.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function _(){}_.prototype=C.prototype;function k(N,V,J){this.props=N,this.context=V,this.refs=A,this.updater=J||T}var j=k.prototype=new _;j.constructor=k,O(j,C.prototype),j.isPureReactComponent=!0;var z=Array.isArray;function D(){}var L={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function Y(N,V,J){var $=J.ref;return{$$typeof:t,type:N,key:V,ref:$!==void 0?$:null,props:J}}function U(N,V){return Y(N.type,V,N.props)}function I(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function M(N){var V={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(J){return V[J]})}var H=/\/+/g;function ee(N,V){return typeof N=="object"&&N!==null&&N.key!=null?M(""+N.key):V.toString(36)}function K(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(V){N.status==="pending"&&(N.status="fulfilled",N.value=V)},function(V){N.status==="pending"&&(N.status="rejected",N.reason=V)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function P(N,V,J,$,se){var re=typeof N;(re==="undefined"||re==="boolean")&&(N=null);var me=!1;if(N===null)me=!0;else switch(re){case"bigint":case"string":case"number":me=!0;break;case"object":switch(N.$$typeof){case t:case o:me=!0;break;case y:return me=N._init,P(me(N._payload),V,J,$,se)}}if(me)return se=se(N),me=$===""?"."+ee(N,0):$,z(se)?(J="",me!=null&&(J=me.replace(H,"$&/")+"/"),P(se,V,J,"",function(Ce){return Ce})):se!=null&&(I(se)&&(se=U(se,J+(se.key==null||N&&N.key===se.key?"":(""+se.key).replace(H,"$&/")+"/")+me)),V.push(se)),1;me=0;var pe=$===""?".":$+":";if(z(N))for(var be=0;be<N.length;be++)$=N[be],re=pe+ee($,be),me+=P($,V,J,re,se);else if(be=w(N),typeof be=="function")for(N=be.call(N),be=0;!($=N.next()).done;)$=$.value,re=pe+ee($,be++),me+=P($,V,J,re,se);else if(re==="object"){if(typeof N.then=="function")return P(K(N),V,J,$,se);throw V=String(N),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return me}function q(N,V,J){if(N==null)return N;var $=[],se=0;return P(N,$,"","",function(re){return V.call(J,re,se++)}),$}function X(N){if(N._status===-1){var V=N._result;V=V(),V.then(function(J){(N._status===0||N._status===-1)&&(N._status=1,N._result=J)},function(J){(N._status===0||N._status===-1)&&(N._status=2,N._result=J)}),N._status===-1&&(N._status=0,N._result=V)}if(N._status===1)return N._result.default;throw N._result}var Z=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=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(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},W={map:q,forEach:function(N,V,J){q(N,function(){V.apply(this,arguments)},J)},count:function(N){var V=0;return q(N,function(){V++}),V},toArray:function(N){return q(N,function(V){return V})||[]},only:function(N){if(!I(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Xe.Activity=v,Xe.Children=W,Xe.Component=C,Xe.Fragment=a,Xe.Profiler=l,Xe.PureComponent=k,Xe.StrictMode=r,Xe.Suspense=m,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return L.H.useMemoCache(N)}},Xe.cache=function(N){return function(){return N.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(N,V,J){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var $=O({},N.props),se=N.key;if(V!=null)for(re in V.key!==void 0&&(se=""+V.key),V)!B.call(V,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&V.ref===void 0||($[re]=V[re]);var re=arguments.length-2;if(re===1)$.children=J;else if(1<re){for(var me=Array(re),pe=0;pe<re;pe++)me[pe]=arguments[pe+2];$.children=me}return Y(N.type,se,$)},Xe.createContext=function(N){return N={$$typeof:d,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:c,_context:N},N},Xe.createElement=function(N,V,J){var $,se={},re=null;if(V!=null)for($ in V.key!==void 0&&(re=""+V.key),V)B.call(V,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(se[$]=V[$]);var me=arguments.length-2;if(me===1)se.children=J;else if(1<me){for(var pe=Array(me),be=0;be<me;be++)pe[be]=arguments[be+2];se.children=pe}if(N&&N.defaultProps)for($ in me=N.defaultProps,me)se[$]===void 0&&(se[$]=me[$]);return Y(N,re,se)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(N){return{$$typeof:g,render:N}},Xe.isValidElement=I,Xe.lazy=function(N){return{$$typeof:y,_payload:{_status:-1,_result:N},_init:X}},Xe.memo=function(N,V){return{$$typeof:h,type:N,compare:V===void 0?null:V}},Xe.startTransition=function(N){var V=L.T,J={};L.T=J;try{var $=N(),se=L.S;se!==null&&se(J,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(D,Z)}catch(re){Z(re)}finally{V!==null&&J.types!==null&&(V.types=J.types),L.T=V}},Xe.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Xe.use=function(N){return L.H.use(N)},Xe.useActionState=function(N,V,J){return L.H.useActionState(N,V,J)},Xe.useCallback=function(N,V){return L.H.useCallback(N,V)},Xe.useContext=function(N){return L.H.useContext(N)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(N,V){return L.H.useDeferredValue(N,V)},Xe.useEffect=function(N,V){return L.H.useEffect(N,V)},Xe.useEffectEvent=function(N){return L.H.useEffectEvent(N)},Xe.useId=function(){return L.H.useId()},Xe.useImperativeHandle=function(N,V,J){return L.H.useImperativeHandle(N,V,J)},Xe.useInsertionEffect=function(N,V){return L.H.useInsertionEffect(N,V)},Xe.useLayoutEffect=function(N,V){return L.H.useLayoutEffect(N,V)},Xe.useMemo=function(N,V){return L.H.useMemo(N,V)},Xe.useOptimistic=function(N,V){return L.H.useOptimistic(N,V)},Xe.useReducer=function(N,V,J){return L.H.useReducer(N,V,J)},Xe.useRef=function(N){return L.H.useRef(N)},Xe.useState=function(N){return L.H.useState(N)},Xe.useSyncExternalStore=function(N,V,J){return L.H.useSyncExternalStore(N,V,J)},Xe.useTransition=function(){return L.H.useTransition()},Xe.version="19.2.4",Xe}var tx;function rl(){return tx||(tx=1,Mp.exports=BR()),Mp.exports}var b=rl();const Pi=IR(b),VR=PR({__proto__:null,default:Pi},[b]);var jp={exports:{}},ji={},_p={exports:{}},Dp={};var nx;function FR(){return nx||(nx=1,(function(t){function o(P,q){var X=P.length;P.push(q);e:for(;0<X;){var Z=X-1>>>1,W=P[Z];if(0<l(W,q))P[Z]=q,P[X]=W,X=Z;else break e}}function a(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var q=P[0],X=P.pop();if(X!==q){P[0]=X;e:for(var Z=0,W=P.length,N=W>>>1;Z<N;){var V=2*(Z+1)-1,J=P[V],$=V+1,se=P[$];if(0>l(J,X))$<W&&0>l(se,J)?(P[Z]=se,P[$]=X,Z=$):(P[Z]=J,P[V]=X,Z=V);else if($<W&&0>l(se,X))P[Z]=se,P[$]=X,Z=$;else break e}}return q}function l(P,q){var X=P.sortIndex-q.sortIndex;return X!==0?X:P.id-q.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,g=d.now();t.unstable_now=function(){return d.now()-g}}var m=[],h=[],y=1,v=null,S=3,w=!1,T=!1,O=!1,A=!1,C=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function j(P){for(var q=a(h);q!==null;){if(q.callback===null)r(h);else if(q.startTime<=P)r(h),q.sortIndex=q.expirationTime,o(m,q);else break;q=a(h)}}function z(P){if(O=!1,j(P),!T)if(a(m)!==null)T=!0,D||(D=!0,M());else{var q=a(h);q!==null&&K(z,q.startTime-P)}}var D=!1,L=-1,B=5,Y=-1;function U(){return A?!0:!(t.unstable_now()-Y<B)}function I(){if(A=!1,D){var P=t.unstable_now();Y=P;var q=!0;try{e:{T=!1,O&&(O=!1,_(L),L=-1),w=!0;var X=S;try{t:{for(j(P),v=a(m);v!==null&&!(v.expirationTime>P&&U());){var Z=v.callback;if(typeof Z=="function"){v.callback=null,S=v.priorityLevel;var W=Z(v.expirationTime<=P);if(P=t.unstable_now(),typeof W=="function"){v.callback=W,j(P),q=!0;break t}v===a(m)&&r(m),j(P)}else r(m);v=a(m)}if(v!==null)q=!0;else{var N=a(h);N!==null&&K(z,N.startTime-P),q=!1}}break e}finally{v=null,S=X,w=!1}q=void 0}}finally{q?M():D=!1}}}var M;if(typeof k=="function")M=function(){k(I)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,ee=H.port2;H.port1.onmessage=I,M=function(){ee.postMessage(null)}}else M=function(){C(I,0)};function K(P,q){L=C(function(){P(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(P){P.callback=null},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_next=function(P){switch(S){case 1:case 2:case 3:var q=3;break;default:q=S}var X=S;S=q;try{return P()}finally{S=X}},t.unstable_requestPaint=function(){A=!0},t.unstable_runWithPriority=function(P,q){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var X=S;S=P;try{return q()}finally{S=X}},t.unstable_scheduleCallback=function(P,q,X){var Z=t.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?Z+X:Z):X=Z,P){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=X+W,P={id:y++,callback:q,priorityLevel:P,startTime:X,expirationTime:W,sortIndex:-1},X>Z?(P.sortIndex=X,o(h,P),a(m)===null&&P===a(h)&&(O?(_(L),L=-1):O=!0,K(z,X-Z))):(P.sortIndex=W,o(m,P),T||w||(T=!0,D||(D=!0,M()))),P},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(P){var q=S;return function(){var X=S;S=q;try{return P.apply(this,arguments)}finally{S=X}}}})(Dp)),Dp}var ox;function YR(){return ox||(ox=1,_p.exports=FR()),_p.exports}var zp={exports:{}},gn={};var sx;function qR(){if(sx)return gn;sx=1;var t=rl();function o(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(o(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},l=Symbol.for("react.portal");function c(m,h,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:""+v,children:m,containerInfo:h,implementation:y}}var d=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,gn.createPortal=function(m,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(o(299));return c(m,h,null,y)},gn.flushSync=function(m){var h=d.T,y=r.p;try{if(d.T=null,r.p=2,m)return m()}finally{d.T=h,r.p=y,r.d.f()}},gn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(m,h))},gn.prefetchDNS=function(m){typeof m=="string"&&r.d.D(m)},gn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var y=h.as,v=g(y,h.crossOrigin),S=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?r.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:v,integrity:S,fetchPriority:w}):y==="script"&&r.d.X(m,{crossOrigin:v,integrity:S,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},gn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=g(h.as,h.crossOrigin);r.d.M(m,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(m)},gn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,v=g(y,h.crossOrigin);r.d.L(m,y,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},gn.preloadModule=function(m,h){if(typeof m=="string")if(h){var y=g(h.as,h.crossOrigin);r.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(m)},gn.requestFormReset=function(m){r.d.r(m)},gn.unstable_batchedUpdates=function(m,h){return m(h)},gn.useFormState=function(m,h,y){return d.H.useFormState(m,h,y)},gn.useFormStatus=function(){return d.H.useHostTransitionStatus()},gn.version="19.2.4",gn}var ax;function nS(){if(ax)return zp.exports;ax=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(o){console.error(o)}}return t(),zp.exports=qR(),zp.exports}var rx;function GR(){if(rx)return ji;rx=1;var t=YR(),o=rl(),a=nS();function r(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var n=e,s=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(s=n.return),e=n.return;while(e)}return n.tag===3?s:null}function d(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(c(e)!==e)throw Error(r(188))}function h(e){var n=e.alternate;if(!n){if(n=c(e),n===null)throw Error(r(188));return n!==e?null:e}for(var s=e,i=n;;){var u=s.return;if(u===null)break;var f=u.alternate;if(f===null){if(i=u.return,i!==null){s=i;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===s)return m(u),e;if(f===i)return m(u),n;f=f.sibling}throw Error(r(188))}if(s.return!==i.return)s=u,i=f;else{for(var x=!1,R=u.child;R;){if(R===s){x=!0,s=u,i=f;break}if(R===i){x=!0,i=u,s=f;break}R=R.sibling}if(!x){for(R=f.child;R;){if(R===s){x=!0,s=f,i=u;break}if(R===i){x=!0,i=f,s=u;break}R=R.sibling}if(!x)throw Error(r(189))}}if(s.alternate!==i)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?e:n}function y(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=y(e),n!==null)return n;e=e.sibling}return null}var v=Object.assign,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),k=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function M(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var H=Symbol.for("react.client.reference");function ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===H?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case C:return"Profiler";case A:return"StrictMode";case z:return"Suspense";case D:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case k:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case j:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return n=e.displayName||null,n!==null?n:ee(e.type)||"Memo";case B:n=e._payload,e=e._init;try{return ee(e(n))}catch{}}return null}var K=Array.isArray,P=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},Z=[],W=-1;function N(e){return{current:e}}function V(e){0>W||(e.current=Z[W],Z[W]=null,W--)}function J(e,n){W++,Z[W]=e.current,e.current=n}var $=N(null),se=N(null),re=N(null),me=N(null);function pe(e,n){switch(J(re,n),J(se,e),J($,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Sv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Sv(n),e=wv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V($),J($,e)}function be(){V($),V(se),V(re)}function Ce(e){e.memoizedState!==null&&J(me,e);var n=$.current,s=wv(n,e.type);n!==s&&(J(se,e),J($,s))}function Me(e){se.current===e&&(V($),V(se)),me.current===e&&(V(me),Oi._currentValue=X)}var ye,ge;function Te(e){if(ye===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);ye=n&&n[1]||"",ge=-1<s.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
3
|
`+ye+e+ge}var Ae=!1;function Ue(e,n){if(!e||Ae)return"";Ae=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(n){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ie){var ae=ie}Reflect.construct(e,[],de)}else{try{de.call()}catch(ie){ae=ie}e.call(de.prototype)}}else{try{throw Error()}catch(ie){ae=ie}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ie){if(ie&&ae&&typeof ie.stack=="string")return[ie.stack,ae.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),x=f[0],R=f[1];if(x&&R){var F=x.split(`
|
|
4
4
|
`),oe=R.split(`
|
|
5
5
|
`);for(u=i=0;i<F.length&&!F[i].includes("DetermineComponentFrameRoot");)i++;for(;u<oe.length&&!oe[u].includes("DetermineComponentFrameRoot");)u++;if(i===F.length||u===oe.length)for(i=F.length-1,u=oe.length-1;1<=i&&0<=u&&F[i]!==oe[u];)u--;for(;1<=i&&0<=u;i--,u--)if(F[i]!==oe[u]){if(i!==1||u!==1)do if(i--,u--,0>u||F[i]!==oe[u]){var ue=`
|
|
6
6
|
`+F[i].replace(" at new "," at ");return e.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",e.displayName)),ue}while(1<=i&&0<=u);break}}}finally{Ae=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Te(s):""}function Ee(e,n){switch(e.tag){case 26:case 27:case 5:return Te(e.type);case 16:return Te("Lazy");case 13:return e.child!==n&&n!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return Ue(e.type,!1);case 11:return Ue(e.type.render,!1);case 1:return Ue(e.type,!0);case 31:return Te("Activity");default:return""}}function Le(e){try{var n="",s=null;do n+=Ee(e,s),s=e,e=e.return;while(e);return n}catch(i){return`
|
|
7
7
|
Error generating stack: `+i.message+`
|
|
8
|
-
`+i.stack}}var Se=Object.prototype.hasOwnProperty,Re=t.unstable_scheduleCallback,Ne=t.unstable_cancelCallback,Ie=t.unstable_shouldYield,je=t.unstable_requestPaint,le=t.unstable_now,ve=t.unstable_getCurrentPriorityLevel,he=t.unstable_ImmediatePriority,ce=t.unstable_UserBlockingPriority,xe=t.unstable_NormalPriority,He=t.unstable_LowPriority,Lt=t.unstable_IdlePriority,Ft=t.log,ut=t.unstable_setDisableYieldValue,Oe=null,Ye=null;function Qe(e){if(typeof Ft=="function"&&ut(e),Ye&&typeof Ye.setStrictMode=="function")try{Ye.setStrictMode(Oe,e)}catch{}}var ct=Math.clz32?Math.clz32:hn,Jt=Math.log,rn=Math.LN2;function hn(e){return e>>>=0,e===0?32:31-(Jt(e)/rn|0)|0}var bt=256,jt=262144,Fe=4194304;function ft(e){var n=e&42;if(n!==0)return n;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&261888;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 _t(e,n,s){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var R=i&134217727;return R!==0?(i=R&~f,i!==0?u=ft(i):(x&=R,x!==0?u=ft(x):s||(s=R&~e,s!==0&&(u=ft(s))))):(R=i&~f,R!==0?u=ft(R):x!==0?u=ft(x):s||(s=i&~e,s!==0&&(u=ft(s)))),u===0?0:n!==0&&n!==u&&(n&f)===0&&(f=u&-u,s=n&-n,f>=s||f===32&&(s&4194048)!==0)?n:u}function Pt(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Nn(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 ln(){var e=Fe;return Fe<<=1,(Fe&62914560)===0&&(Fe=4194304),e}function yo(e){for(var n=[],s=0;31>s;s++)n.push(e);return n}function vn(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ro(e,n,s,i,u,f){var x=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var R=e.entanglements,F=e.expirationTimes,oe=e.hiddenUpdates;for(s=x&~s;0<s;){var ue=31-ct(s),de=1<<ue;R[ue]=0,F[ue]=-1;var ae=oe[ue];if(ae!==null)for(oe[ue]=null,ue=0;ue<ae.length;ue++){var ie=ae[ue];ie!==null&&(ie.lane&=-536870913)}s&=~de}i!==0&&kn(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(x&~n))}function kn(e,n,s){e.pendingLanes|=n,e.suspendedLanes&=~n;var i=31-ct(n);e.entangledLanes|=n,e.entanglements[i]=e.entanglements[i]|1073741824|s&261930}function Ze(e,n){var s=e.entangledLanes|=n;for(e=e.entanglements;s;){var i=31-ct(s),u=1<<i;u&n|e[i]&n&&(e[i]|=n),s&=~u}}function Rt(e,n){var s=n&-n;return s=(s&42)!==0?1:Mn(s),(s&(e.suspendedLanes|n))!==0?0:s}function Mn(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 ao(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function bo(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:qv(e.type))}function ps(e,n){var s=q.p;try{return q.p=e,n()}finally{q.p=s}}var ro=Math.random().toString(36).slice(2),Yt="__reactFiber$"+ro,mn="__reactProps$"+ro,Oo="__reactContainer$"+ro,Sf="__reactEvents$"+ro,RE="__reactListeners$"+ro,OE="__reactHandles$"+ro,lg="__reactResources$"+ro,Vr="__reactMarker$"+ro;function wf(e){delete e[Yt],delete e[mn],delete e[Sf],delete e[RE],delete e[OE]}function Ua(e){var n=e[Yt];if(n)return n;for(var s=e.parentNode;s;){if(n=s[Oo]||s[Yt]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=Nv(e);e!==null;){if(s=e[Yt])return s;e=Nv(e)}return n}e=s,s=e.parentNode}return null}function Ba(e){if(e=e[Yt]||e[Oo]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Fr(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(r(33))}function Va(e){var n=e[lg];return n||(n=e[lg]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function on(e){e[Vr]=!0}var cg=new Set,ug={};function Zs(e,n){Fa(e,n),Fa(e+"Capture",n)}function Fa(e,n){for(ug[e]=n,e=0;e<n.length;e++)cg.add(n[e])}var AE=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]*$"),fg={},dg={};function NE(e){return Se.call(dg,e)?!0:Se.call(fg,e)?!1:AE.test(e)?dg[e]=!0:(fg[e]=!0,!1)}function Cl(e,n,s){if(NE(n))if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var i=n.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+s)}}function Rl(e,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+s)}}function Ao(e,n,s,i){if(i===null)e.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(n,s,""+i)}}function Yn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pg(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function kE(e,n,s){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,f=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return u.call(this)},set:function(x){s=""+x,f.call(this,x)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(x){s=""+x},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Tf(e){if(!e._valueTracker){var n=pg(e)?"checked":"value";e._valueTracker=kE(e,n,""+e[n])}}function hg(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),i="";return e&&(i=pg(e)?e.checked?"true":"false":e.value),e=i,e!==s?(n.setValue(e),!0):!1}function Ol(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}}var ME=/[\n"\\]/g;function qn(e){return e.replace(ME,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Ef(e,n,s,i,u,f,x,R){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),n!=null?x==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Yn(n)):e.value!==""+Yn(n)&&(e.value=""+Yn(n)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),n!=null?Cf(e,x,Yn(n)):s!=null?Cf(e,x,Yn(s)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+Yn(R):e.removeAttribute("name")}function mg(e,n,s,i,u,f,x,R){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),n!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){Tf(e);return}s=s!=null?""+Yn(s):"",n=n!=null?""+Yn(n):s,R||n===e.value||(e.value=n),e.defaultValue=n}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=R?e.checked:!!i,e.defaultChecked=!!i,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Tf(e)}function Cf(e,n,s){n==="number"&&Ol(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Ya(e,n,s,i){if(e=e.options,n){n={};for(var u=0;u<s.length;u++)n["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=n.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&i&&(e[s].defaultSelected=!0)}else{for(s=""+Yn(s),n=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}n!==null||e[u].disabled||(n=e[u])}n!==null&&(n.selected=!0)}}function gg(e,n,s){if(n!=null&&(n=""+Yn(n),n!==e.value&&(e.value=n),s==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=s!=null?""+Yn(s):""}function yg(e,n,s,i){if(n==null){if(i!=null){if(s!=null)throw Error(r(92));if($(i)){if(1<i.length)throw Error(r(93));i=i[0]}s=i}s==null&&(s=""),n=s}s=Yn(n),e.defaultValue=s,i=e.textContent,i===s&&i!==""&&i!==null&&(e.value=i),Tf(e)}function qa(e,n){if(n){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=n;return}}e.textContent=n}var jE=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 bg(e,n,s){var i=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?i?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":i?e.setProperty(n,s):typeof s!="number"||s===0||jE.has(n)?n==="float"?e.cssFloat=s:e[n]=(""+s).trim():e[n]=s+"px"}function vg(e,n,s){if(n!=null&&typeof n!="object")throw Error(r(62));if(e=e.style,s!=null){for(var i in s)!s.hasOwnProperty(i)||n!=null&&n.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var u in n)i=n[u],n.hasOwnProperty(u)&&s[u]!==i&&bg(e,u,i)}else for(var f in n)n.hasOwnProperty(f)&&bg(e,f,n[f])}function Rf(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 _E=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"],["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"]]),DE=/^[\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 Al(e){return DE.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function No(){}var Of=null;function Af(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ga=null,Xa=null;function xg(e){var n=Ba(e);if(n&&(e=n.stateNode)){var s=e[mn]||null;e:switch(e=n.stateNode,n.type){case"input":if(Ef(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+qn(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var i=s[n];if(i!==e&&i.form===e.form){var u=i[mn]||null;if(!u)throw Error(r(90));Ef(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(n=0;n<s.length;n++)i=s[n],i.form===e.form&&hg(i)}break e;case"textarea":gg(e,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&Ya(e,!!s.multiple,n,!1)}}}var Nf=!1;function Sg(e,n,s){if(Nf)return e(n,s);Nf=!0;try{var i=e(n);return i}finally{if(Nf=!1,(Ga!==null||Xa!==null)&&(mc(),Ga&&(n=Ga,e=Xa,Xa=Ga=null,xg(n),e)))for(n=0;n<e.length;n++)xg(e[n])}}function Yr(e,n){var s=e.stateNode;if(s===null)return null;var i=s[mn]||null;if(i===null)return null;s=i[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(r(231,n,typeof s));return s}var ko=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kf=!1;if(ko)try{var qr={};Object.defineProperty(qr,"passive",{get:function(){kf=!0}}),window.addEventListener("test",qr,qr),window.removeEventListener("test",qr,qr)}catch{kf=!1}var hs=null,Mf=null,Nl=null;function wg(){if(Nl)return Nl;var e,n=Mf,s=n.length,i,u="value"in hs?hs.value:hs.textContent,f=u.length;for(e=0;e<s&&n[e]===u[e];e++);var x=s-e;for(i=1;i<=x&&n[s-i]===u[f-i];i++);return Nl=u.slice(e,1<i?1-i:void 0)}function kl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ml(){return!0}function Tg(){return!1}function xn(e){function n(s,i,u,f,x){this._reactName=s,this._targetInst=u,this.type=i,this.nativeEvent=f,this.target=x,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(s=e[R],this[R]=s?s(f):f[R]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Ml:Tg,this.isPropagationStopped=Tg,this}return v(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ml)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ml)},persist:function(){},isPersistent:Ml}),n}var Js={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jl=xn(Js),Gr=v({},Js,{view:0,detail:0}),zE=xn(Gr),jf,_f,Xr,_l=v({},Gr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zf,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!==Xr&&(Xr&&e.type==="mousemove"?(jf=e.screenX-Xr.screenX,_f=e.screenY-Xr.screenY):_f=jf=0,Xr=e),jf)},movementY:function(e){return"movementY"in e?e.movementY:_f}}),Eg=xn(_l),LE=v({},_l,{dataTransfer:0}),PE=xn(LE),IE=v({},Gr,{relatedTarget:0}),Df=xn(IE),HE=v({},Js,{animationName:0,elapsedTime:0,pseudoElement:0}),UE=xn(HE),BE=v({},Js,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),VE=xn(BE),FE=v({},Js,{data:0}),Cg=xn(FE),YE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qE={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"},GE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function XE(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=GE[e])?!!n[e]:!1}function zf(){return XE}var KE=v({},Gr,{key:function(e){if(e.key){var n=YE[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=kl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zf,charCode:function(e){return e.type==="keypress"?kl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?kl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$E=xn(KE),WE=v({},_l,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rg=xn(WE),QE=v({},Gr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zf}),ZE=xn(QE),JE=v({},Js,{propertyName:0,elapsedTime:0,pseudoElement:0}),eC=xn(JE),tC=v({},_l,{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}),nC=xn(tC),oC=v({},Js,{newState:0,oldState:0}),sC=xn(oC),aC=[9,13,27,32],Lf=ko&&"CompositionEvent"in window,Kr=null;ko&&"documentMode"in document&&(Kr=document.documentMode);var rC=ko&&"TextEvent"in window&&!Kr,Og=ko&&(!Lf||Kr&&8<Kr&&11>=Kr),Ag=" ",Ng=!1;function kg(e,n){switch(e){case"keyup":return aC.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ka=!1;function iC(e,n){switch(e){case"compositionend":return Mg(n);case"keypress":return n.which!==32?null:(Ng=!0,Ag);case"textInput":return e=n.data,e===Ag&&Ng?null:e;default:return null}}function lC(e,n){if(Ka)return e==="compositionend"||!Lf&&kg(e,n)?(e=wg(),Nl=Mf=hs=null,Ka=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Og&&n.locale!=="ko"?null:n.data;default:return null}}var cC={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 jg(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!cC[e.type]:n==="textarea"}function _g(e,n,s,i){Ga?Xa?Xa.push(i):Xa=[i]:Ga=i,n=wc(n,"onChange"),0<n.length&&(s=new jl("onChange","change",null,s,i),e.push({event:s,listeners:n}))}var $r=null,Wr=null;function uC(e){mv(e,0)}function Dl(e){var n=Fr(e);if(hg(n))return e}function Dg(e,n){if(e==="change")return n}var zg=!1;if(ko){var Pf;if(ko){var If="oninput"in document;if(!If){var Lg=document.createElement("div");Lg.setAttribute("oninput","return;"),If=typeof Lg.oninput=="function"}Pf=If}else Pf=!1;zg=Pf&&(!document.documentMode||9<document.documentMode)}function Pg(){$r&&($r.detachEvent("onpropertychange",Ig),Wr=$r=null)}function Ig(e){if(e.propertyName==="value"&&Dl(Wr)){var n=[];_g(n,Wr,e,Af(e)),Sg(uC,n)}}function fC(e,n,s){e==="focusin"?(Pg(),$r=n,Wr=s,$r.attachEvent("onpropertychange",Ig)):e==="focusout"&&Pg()}function dC(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Dl(Wr)}function pC(e,n){if(e==="click")return Dl(n)}function hC(e,n){if(e==="input"||e==="change")return Dl(n)}function mC(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var jn=typeof Object.is=="function"?Object.is:mC;function Qr(e,n){if(jn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var s=Object.keys(e),i=Object.keys(n);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var u=s[i];if(!Se.call(n,u)||!jn(e[u],n[u]))return!1}return!0}function Hg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ug(e,n){var s=Hg(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=n&&i>=n)return{node:s,offset:n-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Hg(s)}}function Bg(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Bg(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Vg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Ol(e.document);n instanceof e.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)e=n.contentWindow;else break;n=Ol(e.document)}return n}function Hf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var gC=ko&&"documentMode"in document&&11>=document.documentMode,$a=null,Uf=null,Zr=null,Bf=!1;function Fg(e,n,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Bf||$a==null||$a!==Ol(i)||(i=$a,"selectionStart"in i&&Hf(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Zr&&Qr(Zr,i)||(Zr=i,i=wc(Uf,"onSelect"),0<i.length&&(n=new jl("onSelect","select",null,n,s),e.push({event:n,listeners:i}),n.target=$a)))}function ea(e,n){var s={};return s[e.toLowerCase()]=n.toLowerCase(),s["Webkit"+e]="webkit"+n,s["Moz"+e]="moz"+n,s}var Wa={animationend:ea("Animation","AnimationEnd"),animationiteration:ea("Animation","AnimationIteration"),animationstart:ea("Animation","AnimationStart"),transitionrun:ea("Transition","TransitionRun"),transitionstart:ea("Transition","TransitionStart"),transitioncancel:ea("Transition","TransitionCancel"),transitionend:ea("Transition","TransitionEnd")},Vf={},Yg={};ko&&(Yg=document.createElement("div").style,"AnimationEvent"in window||(delete Wa.animationend.animation,delete Wa.animationiteration.animation,delete Wa.animationstart.animation),"TransitionEvent"in window||delete Wa.transitionend.transition);function ta(e){if(Vf[e])return Vf[e];if(!Wa[e])return e;var n=Wa[e],s;for(s in n)if(n.hasOwnProperty(s)&&s in Yg)return Vf[e]=n[s];return e}var qg=ta("animationend"),Gg=ta("animationiteration"),Xg=ta("animationstart"),yC=ta("transitionrun"),bC=ta("transitionstart"),vC=ta("transitioncancel"),Kg=ta("transitionend"),$g=new Map,Ff="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ff.push("scrollEnd");function io(e,n){$g.set(e,n),Zs(n,[e])}var zl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Gn=[],Qa=0,Yf=0;function Ll(){for(var e=Qa,n=Yf=Qa=0;n<e;){var s=Gn[n];Gn[n++]=null;var i=Gn[n];Gn[n++]=null;var u=Gn[n];Gn[n++]=null;var f=Gn[n];if(Gn[n++]=null,i!==null&&u!==null){var x=i.pending;x===null?u.next=u:(u.next=x.next,x.next=u),i.pending=u}f!==0&&Wg(s,u,f)}}function Pl(e,n,s,i){Gn[Qa++]=e,Gn[Qa++]=n,Gn[Qa++]=s,Gn[Qa++]=i,Yf|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function qf(e,n,s,i){return Pl(e,n,s,i),Il(e)}function na(e,n){return Pl(e,null,null,n),Il(e)}function Wg(e,n,s){e.lanes|=s;var i=e.alternate;i!==null&&(i.lanes|=s);for(var u=!1,f=e.return;f!==null;)f.childLanes|=s,i=f.alternate,i!==null&&(i.childLanes|=s),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&n!==null&&(u=31-ct(s),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[n]:i.push(n),n.lane=s|536870912),f):null}function Il(e){if(50<xi)throw xi=0,ep=null,Error(r(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Za={};function xC(e,n,s,i){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _n(e,n,s,i){return new xC(e,n,s,i)}function Gf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mo(e,n){var s=e.alternate;return s===null?(s=_n(e.tag,n,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=n,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,n=e.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Qg(e,n){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,n=s.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Hl(e,n,s,i,u,f){var x=0;if(i=e,typeof e=="function")Gf(e)&&(x=1);else if(typeof e=="string")x=CR(e,s,K.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Y:return e=_n(31,s,n,u),e.elementType=Y,e.lanes=f,e;case O:return oa(s.children,u,f,n);case A:x=8,u|=24;break;case C:return e=_n(12,s,n,u|2),e.elementType=C,e.lanes=f,e;case z:return e=_n(13,s,n,u),e.elementType=z,e.lanes=f,e;case D:return e=_n(19,s,n,u),e.elementType=D,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case k:x=10;break e;case _:x=9;break e;case M:x=11;break e;case L:x=14;break e;case B:x=16,i=null;break e}x=29,s=Error(r(130,e===null?"null":typeof e,"")),i=null}return n=_n(x,s,n,u),n.elementType=e,n.type=i,n.lanes=f,n}function oa(e,n,s,i){return e=_n(7,e,i,n),e.lanes=s,e}function Xf(e,n,s){return e=_n(6,e,null,n),e.lanes=s,e}function Zg(e){var n=_n(18,null,null,0);return n.stateNode=e,n}function Kf(e,n,s){return n=_n(4,e.children!==null?e.children:[],e.key,n),n.lanes=s,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Jg=new WeakMap;function Xn(e,n){if(typeof e=="object"&&e!==null){var s=Jg.get(e);return s!==void 0?s:(n={value:e,source:n,stack:Le(n)},Jg.set(e,n),n)}return{value:e,source:n,stack:Le(n)}}var Ja=[],er=0,Ul=null,Jr=0,Kn=[],$n=0,ms=null,vo=1,xo="";function jo(e,n){Ja[er++]=Jr,Ja[er++]=Ul,Ul=e,Jr=n}function ey(e,n,s){Kn[$n++]=vo,Kn[$n++]=xo,Kn[$n++]=ms,ms=e;var i=vo;e=xo;var u=32-ct(i)-1;i&=~(1<<u),s+=1;var f=32-ct(n)+u;if(30<f){var x=u-u%5;f=(i&(1<<x)-1).toString(32),i>>=x,u-=x,vo=1<<32-ct(n)+u|s<<u|i,xo=f+e}else vo=1<<f|s<<u|i,xo=e}function $f(e){e.return!==null&&(jo(e,1),ey(e,1,0))}function Wf(e){for(;e===Ul;)Ul=Ja[--er],Ja[er]=null,Jr=Ja[--er],Ja[er]=null;for(;e===ms;)ms=Kn[--$n],Kn[$n]=null,xo=Kn[--$n],Kn[$n]=null,vo=Kn[--$n],Kn[$n]=null}function ty(e,n){Kn[$n++]=vo,Kn[$n++]=xo,Kn[$n++]=ms,vo=n.id,xo=n.overflow,ms=e}var cn=null,kt=null,rt=!1,gs=null,Wn=!1,Qf=Error(r(519));function ys(e){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ei(Xn(n,e)),Qf}function ny(e){var n=e.stateNode,s=e.type,i=e.memoizedProps;switch(n[Yt]=e,n[mn]=i,s){case"dialog":nt("cancel",n),nt("close",n);break;case"iframe":case"object":case"embed":nt("load",n);break;case"video":case"audio":for(s=0;s<wi.length;s++)nt(wi[s],n);break;case"source":nt("error",n);break;case"img":case"image":case"link":nt("error",n),nt("load",n);break;case"details":nt("toggle",n);break;case"input":nt("invalid",n),mg(n,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":nt("invalid",n);break;case"textarea":nt("invalid",n),yg(n,i.value,i.defaultValue,i.children)}s=i.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||i.suppressHydrationWarning===!0||vv(n.textContent,s)?(i.popover!=null&&(nt("beforetoggle",n),nt("toggle",n)),i.onScroll!=null&&nt("scroll",n),i.onScrollEnd!=null&&nt("scrollend",n),i.onClick!=null&&(n.onclick=No),n=!0):n=!1,n||ys(e,!0)}function oy(e){for(cn=e.return;cn;)switch(cn.tag){case 5:case 31:case 13:Wn=!1;return;case 27:case 3:Wn=!0;return;default:cn=cn.return}}function tr(e){if(e!==cn)return!1;if(!rt)return oy(e),rt=!0,!1;var n=e.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||mp(e.type,e.memoizedProps)),s=!s),s&&kt&&ys(e),oy(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));kt=Av(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));kt=Av(e)}else n===27?(n=kt,Ms(e.type)?(e=xp,xp=null,kt=e):kt=n):kt=cn?Zn(e.stateNode.nextSibling):null;return!0}function sa(){kt=cn=null,rt=!1}function Zf(){var e=gs;return e!==null&&(En===null?En=e:En.push.apply(En,e),gs=null),e}function ei(e){gs===null?gs=[e]:gs.push(e)}var Jf=N(null),aa=null,_o=null;function bs(e,n,s){J(Jf,n._currentValue),n._currentValue=s}function Do(e){e._currentValue=Jf.current,V(Jf)}function ed(e,n,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,i!==null&&(i.childLanes|=n)):i!==null&&(i.childLanes&n)!==n&&(i.childLanes|=n),e===s)break;e=e.return}}function td(e,n,s,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var x=u.child;f=f.firstContext;e:for(;f!==null;){var R=f;f=u;for(var F=0;F<n.length;F++)if(R.context===n[F]){f.lanes|=s,R=f.alternate,R!==null&&(R.lanes|=s),ed(f.return,s,e),i||(x=null);break e}f=R.next}}else if(u.tag===18){if(x=u.return,x===null)throw Error(r(341));x.lanes|=s,f=x.alternate,f!==null&&(f.lanes|=s),ed(x,s,e),x=null}else x=u.child;if(x!==null)x.return=u;else for(x=u;x!==null;){if(x===e){x=null;break}if(u=x.sibling,u!==null){u.return=x.return,x=u;break}x=x.return}u=x}}function nr(e,n,s,i){e=null;for(var u=n,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var x=u.alternate;if(x===null)throw Error(r(387));if(x=x.memoizedProps,x!==null){var R=u.type;jn(u.pendingProps.value,x.value)||(e!==null?e.push(R):e=[R])}}else if(u===me.current){if(x=u.alternate,x===null)throw Error(r(387));x.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Oi):e=[Oi])}u=u.return}e!==null&&td(n,e,s,i),n.flags|=262144}function Bl(e){for(e=e.firstContext;e!==null;){if(!jn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){aa=e,_o=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function un(e){return sy(aa,e)}function Vl(e,n){return aa===null&&ra(e),sy(e,n)}function sy(e,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},_o===null){if(e===null)throw Error(r(308));_o=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else _o=_o.next=n;return s}var SC=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(s,i){e.push(i)}};this.abort=function(){n.aborted=!0,e.forEach(function(s){return s()})}},wC=t.unstable_scheduleCallback,TC=t.unstable_NormalPriority,Xt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nd(){return{controller:new SC,data:new Map,refCount:0}}function ti(e){e.refCount--,e.refCount===0&&wC(TC,function(){e.controller.abort()})}var ni=null,od=0,or=0,sr=null;function EC(e,n){if(ni===null){var s=ni=[];od=0,or=rp(),sr={status:"pending",value:void 0,then:function(i){s.push(i)}}}return od++,n.then(ay,ay),n}function ay(){if(--od===0&&ni!==null){sr!==null&&(sr.status="fulfilled");var e=ni;ni=null,or=0,sr=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function CC(e,n){var s=[],i={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){i.status="fulfilled",i.value=n;for(var u=0;u<s.length;u++)(0,s[u])(n)},function(u){for(i.status="rejected",i.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),i}var ry=P.S;P.S=function(e,n){Fb=le(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&EC(e,n),ry!==null&&ry(e,n)};var ia=N(null);function sd(){var e=ia.current;return e!==null?e:Ot.pooledCache}function Fl(e,n){n===null?J(ia,ia.current):J(ia,n.pool)}function iy(){var e=sd();return e===null?null:{parent:Xt._currentValue,pool:e}}var ar=Error(r(460)),ad=Error(r(474)),Yl=Error(r(542)),ql={then:function(){}};function ly(e){return e=e.status,e==="fulfilled"||e==="rejected"}function cy(e,n,s){switch(s=e[s],s===void 0?e.push(n):s!==n&&(n.then(No,No),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,fy(e),e;default:if(typeof n.status=="string")n.then(No,No);else{if(e=Ot,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=n,e.status="pending",e.then(function(i){if(n.status==="pending"){var u=n;u.status="fulfilled",u.value=i}},function(i){if(n.status==="pending"){var u=n;u.status="rejected",u.reason=i}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,fy(e),e}throw ca=n,ar}}function la(e){try{var n=e._init;return n(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ca=s,ar):s}}var ca=null;function uy(){if(ca===null)throw Error(r(459));var e=ca;return ca=null,e}function fy(e){if(e===ar||e===Yl)throw Error(r(483))}var rr=null,oi=0;function Gl(e){var n=oi;return oi+=1,rr===null&&(rr=[]),cy(rr,e,n)}function si(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Xl(e,n){throw n.$$typeof===S?Error(r(525)):(e=Object.prototype.toString.call(n),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function dy(e){function n(ee,G){if(e){var ne=ee.deletions;ne===null?(ee.deletions=[G],ee.flags|=16):ne.push(G)}}function s(ee,G){if(!e)return null;for(;G!==null;)n(ee,G),G=G.sibling;return null}function i(ee){for(var G=new Map;ee!==null;)ee.key!==null?G.set(ee.key,ee):G.set(ee.index,ee),ee=ee.sibling;return G}function u(ee,G){return ee=Mo(ee,G),ee.index=0,ee.sibling=null,ee}function f(ee,G,ne){return ee.index=ne,e?(ne=ee.alternate,ne!==null?(ne=ne.index,ne<G?(ee.flags|=67108866,G):ne):(ee.flags|=67108866,G)):(ee.flags|=1048576,G)}function x(ee){return e&&ee.alternate===null&&(ee.flags|=67108866),ee}function R(ee,G,ne,fe){return G===null||G.tag!==6?(G=Xf(ne,ee.mode,fe),G.return=ee,G):(G=u(G,ne),G.return=ee,G)}function F(ee,G,ne,fe){var Pe=ne.type;return Pe===O?ue(ee,G,ne.props.children,fe,ne.key):G!==null&&(G.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===B&&la(Pe)===G.type)?(G=u(G,ne.props),si(G,ne),G.return=ee,G):(G=Hl(ne.type,ne.key,ne.props,null,ee.mode,fe),si(G,ne),G.return=ee,G)}function oe(ee,G,ne,fe){return G===null||G.tag!==4||G.stateNode.containerInfo!==ne.containerInfo||G.stateNode.implementation!==ne.implementation?(G=Kf(ne,ee.mode,fe),G.return=ee,G):(G=u(G,ne.children||[]),G.return=ee,G)}function ue(ee,G,ne,fe,Pe){return G===null||G.tag!==7?(G=oa(ne,ee.mode,fe,Pe),G.return=ee,G):(G=u(G,ne),G.return=ee,G)}function de(ee,G,ne){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Xf(""+G,ee.mode,ne),G.return=ee,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case w:return ne=Hl(G.type,G.key,G.props,null,ee.mode,ne),si(ne,G),ne.return=ee,ne;case T:return G=Kf(G,ee.mode,ne),G.return=ee,G;case B:return G=la(G),de(ee,G,ne)}if($(G)||j(G))return G=oa(G,ee.mode,ne,null),G.return=ee,G;if(typeof G.then=="function")return de(ee,Gl(G),ne);if(G.$$typeof===k)return de(ee,Vl(ee,G),ne);Xl(ee,G)}return null}function ae(ee,G,ne,fe){var Pe=G!==null?G.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Pe!==null?null:R(ee,G,""+ne,fe);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:return ne.key===Pe?F(ee,G,ne,fe):null;case T:return ne.key===Pe?oe(ee,G,ne,fe):null;case B:return ne=la(ne),ae(ee,G,ne,fe)}if($(ne)||j(ne))return Pe!==null?null:ue(ee,G,ne,fe,null);if(typeof ne.then=="function")return ae(ee,G,Gl(ne),fe);if(ne.$$typeof===k)return ae(ee,G,Vl(ee,ne),fe);Xl(ee,ne)}return null}function ie(ee,G,ne,fe,Pe){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return ee=ee.get(ne)||null,R(G,ee,""+fe,Pe);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case w:return ee=ee.get(fe.key===null?ne:fe.key)||null,F(G,ee,fe,Pe);case T:return ee=ee.get(fe.key===null?ne:fe.key)||null,oe(G,ee,fe,Pe);case B:return fe=la(fe),ie(ee,G,ne,fe,Pe)}if($(fe)||j(fe))return ee=ee.get(ne)||null,ue(G,ee,fe,Pe,null);if(typeof fe.then=="function")return ie(ee,G,ne,Gl(fe),Pe);if(fe.$$typeof===k)return ie(ee,G,ne,Vl(G,fe),Pe);Xl(G,fe)}return null}function _e(ee,G,ne,fe){for(var Pe=null,dt=null,ze=G,$e=G=0,at=null;ze!==null&&$e<ne.length;$e++){ze.index>$e?(at=ze,ze=null):at=ze.sibling;var pt=ae(ee,ze,ne[$e],fe);if(pt===null){ze===null&&(ze=at);break}e&&ze&&pt.alternate===null&&n(ee,ze),G=f(pt,G,$e),dt===null?Pe=pt:dt.sibling=pt,dt=pt,ze=at}if($e===ne.length)return s(ee,ze),rt&&jo(ee,$e),Pe;if(ze===null){for(;$e<ne.length;$e++)ze=de(ee,ne[$e],fe),ze!==null&&(G=f(ze,G,$e),dt===null?Pe=ze:dt.sibling=ze,dt=ze);return rt&&jo(ee,$e),Pe}for(ze=i(ze);$e<ne.length;$e++)at=ie(ze,ee,$e,ne[$e],fe),at!==null&&(e&&at.alternate!==null&&ze.delete(at.key===null?$e:at.key),G=f(at,G,$e),dt===null?Pe=at:dt.sibling=at,dt=at);return e&&ze.forEach(function(Ls){return n(ee,Ls)}),rt&&jo(ee,$e),Pe}function Be(ee,G,ne,fe){if(ne==null)throw Error(r(151));for(var Pe=null,dt=null,ze=G,$e=G=0,at=null,pt=ne.next();ze!==null&&!pt.done;$e++,pt=ne.next()){ze.index>$e?(at=ze,ze=null):at=ze.sibling;var Ls=ae(ee,ze,pt.value,fe);if(Ls===null){ze===null&&(ze=at);break}e&&ze&&Ls.alternate===null&&n(ee,ze),G=f(Ls,G,$e),dt===null?Pe=Ls:dt.sibling=Ls,dt=Ls,ze=at}if(pt.done)return s(ee,ze),rt&&jo(ee,$e),Pe;if(ze===null){for(;!pt.done;$e++,pt=ne.next())pt=de(ee,pt.value,fe),pt!==null&&(G=f(pt,G,$e),dt===null?Pe=pt:dt.sibling=pt,dt=pt);return rt&&jo(ee,$e),Pe}for(ze=i(ze);!pt.done;$e++,pt=ne.next())pt=ie(ze,ee,$e,pt.value,fe),pt!==null&&(e&&pt.alternate!==null&&ze.delete(pt.key===null?$e:pt.key),G=f(pt,G,$e),dt===null?Pe=pt:dt.sibling=pt,dt=pt);return e&&ze.forEach(function(LR){return n(ee,LR)}),rt&&jo(ee,$e),Pe}function St(ee,G,ne,fe){if(typeof ne=="object"&&ne!==null&&ne.type===O&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:e:{for(var Pe=ne.key;G!==null;){if(G.key===Pe){if(Pe=ne.type,Pe===O){if(G.tag===7){s(ee,G.sibling),fe=u(G,ne.props.children),fe.return=ee,ee=fe;break e}}else if(G.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===B&&la(Pe)===G.type){s(ee,G.sibling),fe=u(G,ne.props),si(fe,ne),fe.return=ee,ee=fe;break e}s(ee,G);break}else n(ee,G);G=G.sibling}ne.type===O?(fe=oa(ne.props.children,ee.mode,fe,ne.key),fe.return=ee,ee=fe):(fe=Hl(ne.type,ne.key,ne.props,null,ee.mode,fe),si(fe,ne),fe.return=ee,ee=fe)}return x(ee);case T:e:{for(Pe=ne.key;G!==null;){if(G.key===Pe)if(G.tag===4&&G.stateNode.containerInfo===ne.containerInfo&&G.stateNode.implementation===ne.implementation){s(ee,G.sibling),fe=u(G,ne.children||[]),fe.return=ee,ee=fe;break e}else{s(ee,G);break}else n(ee,G);G=G.sibling}fe=Kf(ne,ee.mode,fe),fe.return=ee,ee=fe}return x(ee);case B:return ne=la(ne),St(ee,G,ne,fe)}if($(ne))return _e(ee,G,ne,fe);if(j(ne)){if(Pe=j(ne),typeof Pe!="function")throw Error(r(150));return ne=Pe.call(ne),Be(ee,G,ne,fe)}if(typeof ne.then=="function")return St(ee,G,Gl(ne),fe);if(ne.$$typeof===k)return St(ee,G,Vl(ee,ne),fe);Xl(ee,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,G!==null&&G.tag===6?(s(ee,G.sibling),fe=u(G,ne),fe.return=ee,ee=fe):(s(ee,G),fe=Xf(ne,ee.mode,fe),fe.return=ee,ee=fe),x(ee)):s(ee,G)}return function(ee,G,ne,fe){try{oi=0;var Pe=St(ee,G,ne,fe);return rr=null,Pe}catch(ze){if(ze===ar||ze===Yl)throw ze;var dt=_n(29,ze,null,ee.mode);return dt.lanes=fe,dt.return=ee,dt}}}var ua=dy(!0),py=dy(!1),vs=!1;function rd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function id(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function xs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ss(e,n,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(ht&2)!==0){var u=i.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),i.pending=n,n=Il(e),Wg(e,null,s),n}return Pl(e,i,n,s),Il(e)}function ai(e,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var i=n.lanes;i&=e.pendingLanes,s|=i,n.lanes=s,Ze(e,s)}}function ld(e,n){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var u=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var x={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?u=f=x:f=f.next=x,s=s.next}while(s!==null);f===null?u=f=n:f=f.next=n}else u=f=n;s={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=n:e.next=n,s.lastBaseUpdate=n}var cd=!1;function ri(){if(cd){var e=sr;if(e!==null)throw e}}function ii(e,n,s,i){cd=!1;var u=e.updateQueue;vs=!1;var f=u.firstBaseUpdate,x=u.lastBaseUpdate,R=u.shared.pending;if(R!==null){u.shared.pending=null;var F=R,oe=F.next;F.next=null,x===null?f=oe:x.next=oe,x=F;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,R=ue.lastBaseUpdate,R!==x&&(R===null?ue.firstBaseUpdate=oe:R.next=oe,ue.lastBaseUpdate=F))}if(f!==null){var de=u.baseState;x=0,ue=oe=F=null,R=f;do{var ae=R.lane&-536870913,ie=ae!==R.lane;if(ie?(st&ae)===ae:(i&ae)===ae){ae!==0&&ae===or&&(cd=!0),ue!==null&&(ue=ue.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var _e=e,Be=R;ae=n;var St=s;switch(Be.tag){case 1:if(_e=Be.payload,typeof _e=="function"){de=_e.call(St,de,ae);break e}de=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Be.payload,ae=typeof _e=="function"?_e.call(St,de,ae):_e,ae==null)break e;de=v({},de,ae);break e;case 2:vs=!0}}ae=R.callback,ae!==null&&(e.flags|=64,ie&&(e.flags|=8192),ie=u.callbacks,ie===null?u.callbacks=[ae]:ie.push(ae))}else ie={lane:ae,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ue===null?(oe=ue=ie,F=de):ue=ue.next=ie,x|=ae;if(R=R.next,R===null){if(R=u.shared.pending,R===null)break;ie=R,R=ie.next,ie.next=null,u.lastBaseUpdate=ie,u.shared.pending=null}}while(!0);ue===null&&(F=de),u.baseState=F,u.firstBaseUpdate=oe,u.lastBaseUpdate=ue,f===null&&(u.shared.lanes=0),Rs|=x,e.lanes=x,e.memoizedState=de}}function hy(e,n){if(typeof e!="function")throw Error(r(191,e));e.call(n)}function my(e,n){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)hy(s[e],n)}var ir=N(null),Kl=N(0);function gy(e,n){e=Fo,J(Kl,e),J(ir,n),Fo=e|n.baseLanes}function ud(){J(Kl,Fo),J(ir,ir.current)}function fd(){Fo=Kl.current,V(ir),V(Kl)}var Dn=N(null),Qn=null;function ws(e){var n=e.alternate;J(qt,qt.current&1),J(Dn,e),Qn===null&&(n===null||ir.current!==null||n.memoizedState!==null)&&(Qn=e)}function dd(e){J(qt,qt.current),J(Dn,e),Qn===null&&(Qn=e)}function yy(e){e.tag===22?(J(qt,qt.current),J(Dn,e),Qn===null&&(Qn=e)):Ts()}function Ts(){J(qt,qt.current),J(Dn,Dn.current)}function zn(e){V(Dn),Qn===e&&(Qn=null),V(qt)}var qt=N(0);function $l(e){for(var n=e;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||bp(s)||vp(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var zo=0,Ke=null,vt=null,Kt=null,Wl=!1,lr=!1,fa=!1,Ql=0,li=0,cr=null,RC=0;function Ht(){throw Error(r(321))}function pd(e,n){if(n===null)return!1;for(var s=0;s<n.length&&s<e.length;s++)if(!jn(e[s],n[s]))return!1;return!0}function hd(e,n,s,i,u,f){return zo=f,Ke=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,P.H=e===null||e.memoizedState===null?eb:Nd,fa=!1,f=s(i,u),fa=!1,lr&&(f=vy(n,s,i,u)),by(e),f}function by(e){P.H=fi;var n=vt!==null&&vt.next!==null;if(zo=0,Kt=vt=Ke=null,Wl=!1,li=0,cr=null,n)throw Error(r(300));e===null||$t||(e=e.dependencies,e!==null&&Bl(e)&&($t=!0))}function vy(e,n,s,i){Ke=e;var u=0;do{if(lr&&(cr=null),li=0,lr=!1,25<=u)throw Error(r(301));if(u+=1,Kt=vt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}P.H=tb,f=n(s,i)}while(lr);return f}function OC(){var e=P.H,n=e.useState()[0];return n=typeof n.then=="function"?ci(n):n,e=e.useState()[0],(vt!==null?vt.memoizedState:null)!==e&&(Ke.flags|=1024),n}function md(){var e=Ql!==0;return Ql=0,e}function gd(e,n,s){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~s}function yd(e){if(Wl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Wl=!1}zo=0,Kt=vt=Ke=null,lr=!1,li=Ql=0,cr=null}function yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?Ke.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function Gt(){if(vt===null){var e=Ke.alternate;e=e!==null?e.memoizedState:null}else e=vt.next;var n=Kt===null?Ke.memoizedState:Kt.next;if(n!==null)Kt=n,vt=e;else{if(e===null)throw Ke.alternate===null?Error(r(467)):Error(r(310));vt=e,e={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Kt===null?Ke.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function Zl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ci(e){var n=li;return li+=1,cr===null&&(cr=[]),e=cy(cr,e,n),n=Ke,(Kt===null?n.memoizedState:Kt.next)===null&&(n=n.alternate,P.H=n===null||n.memoizedState===null?eb:Nd),e}function Jl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ci(e);if(e.$$typeof===k)return un(e)}throw Error(r(438,String(e)))}function bd(e){var n=null,s=Ke.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var i=Ke.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(n={data:i.data.map(function(u){return u.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=Zl(),Ke.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(e),i=0;i<e;i++)s[i]=H;return n.index++,s}function Lo(e,n){return typeof n=="function"?n(e):n}function ec(e){var n=Gt();return vd(n,vt,e)}function vd(e,n,s){var i=e.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=s;var u=e.baseQueue,f=i.pending;if(f!==null){if(u!==null){var x=u.next;u.next=f.next,f.next=x}n.baseQueue=u=f,i.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{n=u.next;var R=x=null,F=null,oe=n,ue=!1;do{var de=oe.lane&-536870913;if(de!==oe.lane?(st&de)===de:(zo&de)===de){var ae=oe.revertLane;if(ae===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),de===or&&(ue=!0);else if((zo&ae)===ae){oe=oe.next,ae===or&&(ue=!0);continue}else de={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},F===null?(R=F=de,x=f):F=F.next=de,Ke.lanes|=ae,Rs|=ae;de=oe.action,fa&&s(f,de),f=oe.hasEagerState?oe.eagerState:s(f,de)}else ae={lane:de,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},F===null?(R=F=ae,x=f):F=F.next=ae,Ke.lanes|=de,Rs|=de;oe=oe.next}while(oe!==null&&oe!==n);if(F===null?x=f:F.next=R,!jn(f,e.memoizedState)&&($t=!0,ue&&(s=sr,s!==null)))throw s;e.memoizedState=f,e.baseState=x,e.baseQueue=F,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function xd(e){var n=Gt(),s=n.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=e;var i=s.dispatch,u=s.pending,f=n.memoizedState;if(u!==null){s.pending=null;var x=u=u.next;do f=e(f,x.action),x=x.next;while(x!==u);jn(f,n.memoizedState)||($t=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),s.lastRenderedState=f}return[f,i]}function xy(e,n,s){var i=Ke,u=Gt(),f=rt;if(f){if(s===void 0)throw Error(r(407));s=s()}else s=n();var x=!jn((vt||u).memoizedState,s);if(x&&(u.memoizedState=s,$t=!0),u=u.queue,Td(Ty.bind(null,i,u,e),[e]),u.getSnapshot!==n||x||Kt!==null&&Kt.memoizedState.tag&1){if(i.flags|=2048,ur(9,{destroy:void 0},wy.bind(null,i,u,s,n),null),Ot===null)throw Error(r(349));f||(zo&127)!==0||Sy(i,n,s)}return s}function Sy(e,n,s){e.flags|=16384,e={getSnapshot:n,value:s},n=Ke.updateQueue,n===null?(n=Zl(),Ke.updateQueue=n,n.stores=[e]):(s=n.stores,s===null?n.stores=[e]:s.push(e))}function wy(e,n,s,i){n.value=s,n.getSnapshot=i,Ey(n)&&Cy(e)}function Ty(e,n,s){return s(function(){Ey(n)&&Cy(e)})}function Ey(e){var n=e.getSnapshot;e=e.value;try{var s=n();return!jn(e,s)}catch{return!0}}function Cy(e){var n=na(e,2);n!==null&&Cn(n,e,2)}function Sd(e){var n=yn();if(typeof e=="function"){var s=e;if(e=s(),fa){Qe(!0);try{s()}finally{Qe(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:e},n}function Ry(e,n,s,i){return e.baseState=s,vd(e,vt,typeof i=="function"?i:Lo)}function AC(e,n,s,i,u){if(oc(e))throw Error(r(485));if(e=n.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){f.listeners.push(x)}};P.T!==null?s(!0):f.isTransition=!1,i(f),s=n.pending,s===null?(f.next=n.pending=f,Oy(n,f)):(f.next=s.next,n.pending=s.next=f)}}function Oy(e,n){var s=n.action,i=n.payload,u=e.state;if(n.isTransition){var f=P.T,x={};P.T=x;try{var R=s(u,i),F=P.S;F!==null&&F(x,R),Ay(e,n,R)}catch(oe){wd(e,n,oe)}finally{f!==null&&x.types!==null&&(f.types=x.types),P.T=f}}else try{f=s(u,i),Ay(e,n,f)}catch(oe){wd(e,n,oe)}}function Ay(e,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){Ny(e,n,i)},function(i){return wd(e,n,i)}):Ny(e,n,s)}function Ny(e,n,s){n.status="fulfilled",n.value=s,ky(n),e.state=s,n=e.pending,n!==null&&(s=n.next,s===n?e.pending=null:(s=s.next,n.next=s,Oy(e,s)))}function wd(e,n,s){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do n.status="rejected",n.reason=s,ky(n),n=n.next;while(n!==i)}e.action=null}function ky(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function My(e,n){return n}function jy(e,n){if(rt){var s=Ot.formState;if(s!==null){e:{var i=Ke;if(rt){if(kt){t:{for(var u=kt,f=Wn;u.nodeType!==8;){if(!f){u=null;break t}if(u=Zn(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){kt=Zn(u.nextSibling),i=u.data==="F!";break e}}ys(i)}i=!1}i&&(n=s[0])}}return s=yn(),s.memoizedState=s.baseState=n,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:My,lastRenderedState:n},s.queue=i,s=Qy.bind(null,Ke,i),i.dispatch=s,i=Sd(!1),f=Ad.bind(null,Ke,!1,i.queue),i=yn(),u={state:n,dispatch:null,action:e,pending:null},i.queue=u,s=AC.bind(null,Ke,u,f,s),u.dispatch=s,i.memoizedState=e,[n,s,!1]}function _y(e){var n=Gt();return Dy(n,vt,e)}function Dy(e,n,s){if(n=vd(e,n,My)[0],e=ec(Lo)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var i=ci(n)}catch(x){throw x===ar?Yl:x}else i=n;n=Gt();var u=n.queue,f=u.dispatch;return s!==n.memoizedState&&(Ke.flags|=2048,ur(9,{destroy:void 0},NC.bind(null,u,s),null)),[i,f,e]}function NC(e,n){e.action=n}function zy(e){var n=Gt(),s=vt;if(s!==null)return Dy(n,s,e);Gt(),n=n.memoizedState,s=Gt();var i=s.queue.dispatch;return s.memoizedState=e,[n,i,!1]}function ur(e,n,s,i){return e={tag:e,create:s,deps:i,inst:n,next:null},n=Ke.updateQueue,n===null&&(n=Zl(),Ke.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,n.lastEffect=e),e}function Ly(){return Gt().memoizedState}function tc(e,n,s,i){var u=yn();Ke.flags|=e,u.memoizedState=ur(1|n,{destroy:void 0},s,i===void 0?null:i)}function nc(e,n,s,i){var u=Gt();i=i===void 0?null:i;var f=u.memoizedState.inst;vt!==null&&i!==null&&pd(i,vt.memoizedState.deps)?u.memoizedState=ur(n,f,s,i):(Ke.flags|=e,u.memoizedState=ur(1|n,f,s,i))}function Py(e,n){tc(8390656,8,e,n)}function Td(e,n){nc(2048,8,e,n)}function kC(e){Ke.flags|=4;var n=Ke.updateQueue;if(n===null)n=Zl(),Ke.updateQueue=n,n.events=[e];else{var s=n.events;s===null?n.events=[e]:s.push(e)}}function Iy(e){var n=Gt().memoizedState;return kC({ref:n,nextImpl:e}),function(){if((ht&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function Hy(e,n){return nc(4,2,e,n)}function Uy(e,n){return nc(4,4,e,n)}function By(e,n){if(typeof n=="function"){e=e();var s=n(e);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Vy(e,n,s){s=s!=null?s.concat([e]):null,nc(4,4,By.bind(null,n,e),s)}function Ed(){}function Fy(e,n){var s=Gt();n=n===void 0?null:n;var i=s.memoizedState;return n!==null&&pd(n,i[1])?i[0]:(s.memoizedState=[e,n],e)}function Yy(e,n){var s=Gt();n=n===void 0?null:n;var i=s.memoizedState;if(n!==null&&pd(n,i[1]))return i[0];if(i=e(),fa){Qe(!0);try{e()}finally{Qe(!1)}}return s.memoizedState=[i,n],i}function Cd(e,n,s){return s===void 0||(zo&1073741824)!==0&&(st&261930)===0?e.memoizedState=n:(e.memoizedState=s,e=qb(),Ke.lanes|=e,Rs|=e,s)}function qy(e,n,s,i){return jn(s,n)?s:ir.current!==null?(e=Cd(e,s,i),jn(e,n)||($t=!0),e):(zo&42)===0||(zo&1073741824)!==0&&(st&261930)===0?($t=!0,e.memoizedState=s):(e=qb(),Ke.lanes|=e,Rs|=e,n)}function Gy(e,n,s,i,u){var f=q.p;q.p=f!==0&&8>f?f:8;var x=P.T,R={};P.T=R,Ad(e,!1,n,s);try{var F=u(),oe=P.S;if(oe!==null&&oe(R,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var ue=CC(F,i);ui(e,n,ue,In(e))}else ui(e,n,i,In(e))}catch(de){ui(e,n,{then:function(){},status:"rejected",reason:de},In())}finally{q.p=f,x!==null&&R.types!==null&&(x.types=R.types),P.T=x}}function MC(){}function Rd(e,n,s,i){if(e.tag!==5)throw Error(r(476));var u=Xy(e).queue;Gy(e,u,n,X,s===null?MC:function(){return Ky(e),s(i)})}function Xy(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:X},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:s},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Ky(e){var n=Xy(e);n.next===null&&(n=e.alternate.memoizedState),ui(e,n.next.queue,{},In())}function Od(){return un(Oi)}function $y(){return Gt().memoizedState}function Wy(){return Gt().memoizedState}function jC(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var s=In();e=xs(s);var i=Ss(n,e,s);i!==null&&(Cn(i,n,s),ai(i,n,s)),n={cache:nd()},e.payload=n;return}n=n.return}}function _C(e,n,s){var i=In();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},oc(e)?Zy(n,s):(s=qf(e,n,s,i),s!==null&&(Cn(s,e,i),Jy(s,n,i)))}function Qy(e,n,s){var i=In();ui(e,n,s,i)}function ui(e,n,s,i){var u={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(oc(e))Zy(n,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var x=n.lastRenderedState,R=f(x,s);if(u.hasEagerState=!0,u.eagerState=R,jn(R,x))return Pl(e,n,u,0),Ot===null&&Ll(),!1}catch{}if(s=qf(e,n,u,i),s!==null)return Cn(s,e,i),Jy(s,n,i),!0}return!1}function Ad(e,n,s,i){if(i={lane:2,revertLane:rp(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},oc(e)){if(n)throw Error(r(479))}else n=qf(e,s,i,2),n!==null&&Cn(n,e,2)}function oc(e){var n=e.alternate;return e===Ke||n!==null&&n===Ke}function Zy(e,n){lr=Wl=!0;var s=e.pending;s===null?n.next=n:(n.next=s.next,s.next=n),e.pending=n}function Jy(e,n,s){if((s&4194048)!==0){var i=n.lanes;i&=e.pendingLanes,s|=i,n.lanes=s,Ze(e,s)}}var fi={readContext:un,use:Jl,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};fi.useEffectEvent=Ht;var eb={readContext:un,use:Jl,useCallback:function(e,n){return yn().memoizedState=[e,n===void 0?null:n],e},useContext:un,useEffect:Py,useImperativeHandle:function(e,n,s){s=s!=null?s.concat([e]):null,tc(4194308,4,By.bind(null,n,e),s)},useLayoutEffect:function(e,n){return tc(4194308,4,e,n)},useInsertionEffect:function(e,n){tc(4,2,e,n)},useMemo:function(e,n){var s=yn();n=n===void 0?null:n;var i=e();if(fa){Qe(!0);try{e()}finally{Qe(!1)}}return s.memoizedState=[i,n],i},useReducer:function(e,n,s){var i=yn();if(s!==void 0){var u=s(n);if(fa){Qe(!0);try{s(n)}finally{Qe(!1)}}}else u=n;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=_C.bind(null,Ke,e),[i.memoizedState,e]},useRef:function(e){var n=yn();return e={current:e},n.memoizedState=e},useState:function(e){e=Sd(e);var n=e.queue,s=Qy.bind(null,Ke,n);return n.dispatch=s,[e.memoizedState,s]},useDebugValue:Ed,useDeferredValue:function(e,n){var s=yn();return Cd(s,e,n)},useTransition:function(){var e=Sd(!1);return e=Gy.bind(null,Ke,e.queue,!0,!1),yn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,s){var i=Ke,u=yn();if(rt){if(s===void 0)throw Error(r(407));s=s()}else{if(s=n(),Ot===null)throw Error(r(349));(st&127)!==0||Sy(i,n,s)}u.memoizedState=s;var f={value:s,getSnapshot:n};return u.queue=f,Py(Ty.bind(null,i,f,e),[e]),i.flags|=2048,ur(9,{destroy:void 0},wy.bind(null,i,f,s,n),null),s},useId:function(){var e=yn(),n=Ot.identifierPrefix;if(rt){var s=xo,i=vo;s=(i&~(1<<32-ct(i)-1)).toString(32)+s,n="_"+n+"R_"+s,s=Ql++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=RC++,n="_"+n+"r_"+s.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Od,useFormState:jy,useActionState:jy,useOptimistic:function(e){var n=yn();n.memoizedState=n.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=Ad.bind(null,Ke,!0,s),s.dispatch=n,[e,n]},useMemoCache:bd,useCacheRefresh:function(){return yn().memoizedState=jC.bind(null,Ke)},useEffectEvent:function(e){var n=yn(),s={impl:e};return n.memoizedState=s,function(){if((ht&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},Nd={readContext:un,use:Jl,useCallback:Fy,useContext:un,useEffect:Td,useImperativeHandle:Vy,useInsertionEffect:Hy,useLayoutEffect:Uy,useMemo:Yy,useReducer:ec,useRef:Ly,useState:function(){return ec(Lo)},useDebugValue:Ed,useDeferredValue:function(e,n){var s=Gt();return qy(s,vt.memoizedState,e,n)},useTransition:function(){var e=ec(Lo)[0],n=Gt().memoizedState;return[typeof e=="boolean"?e:ci(e),n]},useSyncExternalStore:xy,useId:$y,useHostTransitionStatus:Od,useFormState:_y,useActionState:_y,useOptimistic:function(e,n){var s=Gt();return Ry(s,vt,e,n)},useMemoCache:bd,useCacheRefresh:Wy};Nd.useEffectEvent=Iy;var tb={readContext:un,use:Jl,useCallback:Fy,useContext:un,useEffect:Td,useImperativeHandle:Vy,useInsertionEffect:Hy,useLayoutEffect:Uy,useMemo:Yy,useReducer:xd,useRef:Ly,useState:function(){return xd(Lo)},useDebugValue:Ed,useDeferredValue:function(e,n){var s=Gt();return vt===null?Cd(s,e,n):qy(s,vt.memoizedState,e,n)},useTransition:function(){var e=xd(Lo)[0],n=Gt().memoizedState;return[typeof e=="boolean"?e:ci(e),n]},useSyncExternalStore:xy,useId:$y,useHostTransitionStatus:Od,useFormState:zy,useActionState:zy,useOptimistic:function(e,n){var s=Gt();return vt!==null?Ry(s,vt,e,n):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:bd,useCacheRefresh:Wy};tb.useEffectEvent=Iy;function kd(e,n,s,i){n=e.memoizedState,s=s(i,n),s=s==null?n:v({},n,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Md={enqueueSetState:function(e,n,s){e=e._reactInternals;var i=In(),u=xs(i);u.payload=n,s!=null&&(u.callback=s),n=Ss(e,u,i),n!==null&&(Cn(n,e,i),ai(n,e,i))},enqueueReplaceState:function(e,n,s){e=e._reactInternals;var i=In(),u=xs(i);u.tag=1,u.payload=n,s!=null&&(u.callback=s),n=Ss(e,u,i),n!==null&&(Cn(n,e,i),ai(n,e,i))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var s=In(),i=xs(s);i.tag=2,n!=null&&(i.callback=n),n=Ss(e,i,s),n!==null&&(Cn(n,e,s),ai(n,e,s))}};function nb(e,n,s,i,u,f,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,x):n.prototype&&n.prototype.isPureReactComponent?!Qr(s,i)||!Qr(u,f):!0}function ob(e,n,s,i){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,i),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,i),n.state!==e&&Md.enqueueReplaceState(n,n.state,null)}function da(e,n){var s=n;if("ref"in n){s={};for(var i in n)i!=="ref"&&(s[i]=n[i])}if(e=e.defaultProps){s===n&&(s=v({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function sb(e){zl(e)}function ab(e){console.error(e)}function rb(e){zl(e)}function sc(e,n){try{var s=e.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(i){setTimeout(function(){throw i})}}function ib(e,n,s){try{var i=e.onCaughtError;i(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function jd(e,n,s){return s=xs(s),s.tag=3,s.payload={element:null},s.callback=function(){sc(e,n)},s}function lb(e){return e=xs(e),e.tag=3,e}function cb(e,n,s,i){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){ib(n,s,i)}}var x=s.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){ib(n,s,i),typeof u!="function"&&(Os===null?Os=new Set([this]):Os.add(this));var R=i.stack;this.componentDidCatch(i.value,{componentStack:R!==null?R:""})})}function DC(e,n,s,i,u){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(n=s.alternate,n!==null&&nr(n,s,u,!0),s=Dn.current,s!==null){switch(s.tag){case 31:case 13:return Qn===null?gc():s.alternate===null&&Ut===0&&(Ut=3),s.flags&=-257,s.flags|=65536,s.lanes=u,i===ql?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([i]):n.add(i),op(e,i,u)),!1;case 22:return s.flags|=65536,i===ql?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([i])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([i]):s.add(i)),op(e,i,u)),!1}throw Error(r(435,s.tag))}return op(e,i,u),gc(),!1}if(rt)return n=Dn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=u,i!==Qf&&(e=Error(r(422),{cause:i}),ei(Xn(e,s)))):(i!==Qf&&(n=Error(r(423),{cause:i}),ei(Xn(n,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Xn(i,s),u=jd(e.stateNode,i,u),ld(e,u),Ut!==4&&(Ut=2)),!1;var f=Error(r(520),{cause:i});if(f=Xn(f,s),vi===null?vi=[f]:vi.push(f),Ut!==4&&(Ut=2),n===null)return!0;i=Xn(i,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=jd(s.stateNode,i,e),ld(s,e),!1;case 1:if(n=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Os===null||!Os.has(f))))return s.flags|=65536,u&=-u,s.lanes|=u,u=lb(u),cb(u,e,s,i),ld(s,u),!1}s=s.return}while(s!==null);return!1}var _d=Error(r(461)),$t=!1;function fn(e,n,s,i){n.child=e===null?py(n,null,s,i):ua(n,e.child,s,i)}function ub(e,n,s,i,u){s=s.render;var f=n.ref;if("ref"in i){var x={};for(var R in i)R!=="ref"&&(x[R]=i[R])}else x=i;return ra(n),i=hd(e,n,s,x,f,u),R=md(),e!==null&&!$t?(gd(e,n,u),Po(e,n,u)):(rt&&R&&$f(n),n.flags|=1,fn(e,n,i,u),n.child)}function fb(e,n,s,i,u){if(e===null){var f=s.type;return typeof f=="function"&&!Gf(f)&&f.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=f,db(e,n,f,i,u)):(e=Hl(s.type,null,i,n,n.mode,u),e.ref=n.ref,e.return=n,n.child=e)}if(f=e.child,!Bd(e,u)){var x=f.memoizedProps;if(s=s.compare,s=s!==null?s:Qr,s(x,i)&&e.ref===n.ref)return Po(e,n,u)}return n.flags|=1,e=Mo(f,i),e.ref=n.ref,e.return=n,n.child=e}function db(e,n,s,i,u){if(e!==null){var f=e.memoizedProps;if(Qr(f,i)&&e.ref===n.ref)if($t=!1,n.pendingProps=i=f,Bd(e,u))(e.flags&131072)!==0&&($t=!0);else return n.lanes=e.lanes,Po(e,n,u)}return Dd(e,n,s,i,u)}function pb(e,n,s,i){var u=i.children,f=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((n.flags&128)!==0){if(f=f!==null?f.baseLanes|s:s,e!==null){for(i=n.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~f}else i=0,n.child=null;return hb(e,n,f,s,i)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fl(n,f!==null?f.cachePool:null),f!==null?gy(n,f):ud(),yy(n);else return i=n.lanes=536870912,hb(e,n,f!==null?f.baseLanes|s:s,s,i)}else f!==null?(Fl(n,f.cachePool),gy(n,f),Ts(),n.memoizedState=null):(e!==null&&Fl(n,null),ud(),Ts());return fn(e,n,u,s),n.child}function di(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function hb(e,n,s,i,u){var f=sd();return f=f===null?null:{parent:Xt._currentValue,pool:f},n.memoizedState={baseLanes:s,cachePool:f},e!==null&&Fl(n,null),ud(),yy(n),e!==null&&nr(e,n,i,!0),n.childLanes=u,null}function ac(e,n){return n=ic({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function mb(e,n,s){return ua(n,e.child,null,s),e=ac(n,n.pendingProps),e.flags|=2,zn(n),n.memoizedState=null,e}function zC(e,n,s){var i=n.pendingProps,u=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(rt){if(i.mode==="hidden")return e=ac(n,i),n.lanes=536870912,di(null,e);if(dd(n),(e=kt)?(e=Ov(e,Wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ms!==null?{id:vo,overflow:xo}:null,retryLane:536870912,hydrationErrors:null},s=Zg(e),s.return=n,n.child=s,cn=n,kt=null)):e=null,e===null)throw ys(n);return n.lanes=536870912,null}return ac(n,i)}var f=e.memoizedState;if(f!==null){var x=f.dehydrated;if(dd(n),u)if(n.flags&256)n.flags&=-257,n=mb(e,n,s);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(r(558));else if($t||nr(e,n,s,!1),u=(s&e.childLanes)!==0,$t||u){if(i=Ot,i!==null&&(x=Rt(i,s),x!==0&&x!==f.retryLane))throw f.retryLane=x,na(e,x),Cn(i,e,x),_d;gc(),n=mb(e,n,s)}else e=f.treeContext,kt=Zn(x.nextSibling),cn=n,rt=!0,gs=null,Wn=!1,e!==null&&ty(n,e),n=ac(n,i),n.flags|=4096;return n}return e=Mo(e.child,{mode:i.mode,children:i.children}),e.ref=n.ref,n.child=e,e.return=n,e}function rc(e,n){var s=n.ref;if(s===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(r(284));(e===null||e.ref!==s)&&(n.flags|=4194816)}}function Dd(e,n,s,i,u){return ra(n),s=hd(e,n,s,i,void 0,u),i=md(),e!==null&&!$t?(gd(e,n,u),Po(e,n,u)):(rt&&i&&$f(n),n.flags|=1,fn(e,n,s,u),n.child)}function gb(e,n,s,i,u,f){return ra(n),n.updateQueue=null,s=vy(n,i,s,u),by(e),i=md(),e!==null&&!$t?(gd(e,n,f),Po(e,n,f)):(rt&&i&&$f(n),n.flags|=1,fn(e,n,s,f),n.child)}function yb(e,n,s,i,u){if(ra(n),n.stateNode===null){var f=Za,x=s.contextType;typeof x=="object"&&x!==null&&(f=un(x)),f=new s(i,f),n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Md,n.stateNode=f,f._reactInternals=n,f=n.stateNode,f.props=i,f.state=n.memoizedState,f.refs={},rd(n),x=s.contextType,f.context=typeof x=="object"&&x!==null?un(x):Za,f.state=n.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&(kd(n,s,x,i),f.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(x=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),x!==f.state&&Md.enqueueReplaceState(f,f.state,null),ii(n,i,f,u),ri(),f.state=n.memoizedState),typeof f.componentDidMount=="function"&&(n.flags|=4194308),i=!0}else if(e===null){f=n.stateNode;var R=n.memoizedProps,F=da(s,R);f.props=F;var oe=f.context,ue=s.contextType;x=Za,typeof ue=="object"&&ue!==null&&(x=un(ue));var de=s.getDerivedStateFromProps;ue=typeof de=="function"||typeof f.getSnapshotBeforeUpdate=="function",R=n.pendingProps!==R,ue||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(R||oe!==x)&&ob(n,f,i,x),vs=!1;var ae=n.memoizedState;f.state=ae,ii(n,i,f,u),ri(),oe=n.memoizedState,R||ae!==oe||vs?(typeof de=="function"&&(kd(n,s,de,i),oe=n.memoizedState),(F=vs||nb(n,s,F,i,ae,oe,x))?(ue||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(n.flags|=4194308)):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=i,n.memoizedState=oe),f.props=i,f.state=oe,f.context=x,i=F):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),i=!1)}else{f=n.stateNode,id(e,n),x=n.memoizedProps,ue=da(s,x),f.props=ue,de=n.pendingProps,ae=f.context,oe=s.contextType,F=Za,typeof oe=="object"&&oe!==null&&(F=un(oe)),R=s.getDerivedStateFromProps,(oe=typeof R=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==de||ae!==F)&&ob(n,f,i,F),vs=!1,ae=n.memoizedState,f.state=ae,ii(n,i,f,u),ri();var ie=n.memoizedState;x!==de||ae!==ie||vs||e!==null&&e.dependencies!==null&&Bl(e.dependencies)?(typeof R=="function"&&(kd(n,s,R,i),ie=n.memoizedState),(ue=vs||nb(n,s,ue,i,ae,ie,F)||e!==null&&e.dependencies!==null&&Bl(e.dependencies))?(oe||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,ie,F),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,ie,F)),typeof f.componentDidUpdate=="function"&&(n.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&ae===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&ae===e.memoizedState||(n.flags|=1024),n.memoizedProps=i,n.memoizedState=ie),f.props=i,f.state=ie,f.context=F,i=ue):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&ae===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&ae===e.memoizedState||(n.flags|=1024),i=!1)}return f=i,rc(e,n),i=(n.flags&128)!==0,f||i?(f=n.stateNode,s=i&&typeof s.getDerivedStateFromError!="function"?null:f.render(),n.flags|=1,e!==null&&i?(n.child=ua(n,e.child,null,u),n.child=ua(n,null,s,u)):fn(e,n,s,u),n.memoizedState=f.state,e=n.child):e=Po(e,n,u),e}function bb(e,n,s,i){return sa(),n.flags|=256,fn(e,n,s,i),n.child}var zd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ld(e){return{baseLanes:e,cachePool:iy()}}function Pd(e,n,s){return e=e!==null?e.childLanes&~s:0,n&&(e|=Pn),e}function vb(e,n,s){var i=n.pendingProps,u=!1,f=(n.flags&128)!==0,x;if((x=f)||(x=e!==null&&e.memoizedState===null?!1:(qt.current&2)!==0),x&&(u=!0,n.flags&=-129),x=(n.flags&32)!==0,n.flags&=-33,e===null){if(rt){if(u?ws(n):Ts(),(e=kt)?(e=Ov(e,Wn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ms!==null?{id:vo,overflow:xo}:null,retryLane:536870912,hydrationErrors:null},s=Zg(e),s.return=n,n.child=s,cn=n,kt=null)):e=null,e===null)throw ys(n);return vp(e)?n.lanes=32:n.lanes=536870912,null}var R=i.children;return i=i.fallback,u?(Ts(),u=n.mode,R=ic({mode:"hidden",children:R},u),i=oa(i,u,s,null),R.return=n,i.return=n,R.sibling=i,n.child=R,i=n.child,i.memoizedState=Ld(s),i.childLanes=Pd(e,x,s),n.memoizedState=zd,di(null,i)):(ws(n),Id(n,R))}var F=e.memoizedState;if(F!==null&&(R=F.dehydrated,R!==null)){if(f)n.flags&256?(ws(n),n.flags&=-257,n=Hd(e,n,s)):n.memoizedState!==null?(Ts(),n.child=e.child,n.flags|=128,n=null):(Ts(),R=i.fallback,u=n.mode,i=ic({mode:"visible",children:i.children},u),R=oa(R,u,s,null),R.flags|=2,i.return=n,R.return=n,i.sibling=R,n.child=i,ua(n,e.child,null,s),i=n.child,i.memoizedState=Ld(s),i.childLanes=Pd(e,x,s),n.memoizedState=zd,n=di(null,i));else if(ws(n),vp(R)){if(x=R.nextSibling&&R.nextSibling.dataset,x)var oe=x.dgst;x=oe,i=Error(r(419)),i.stack="",i.digest=x,ei({value:i,source:null,stack:null}),n=Hd(e,n,s)}else if($t||nr(e,n,s,!1),x=(s&e.childLanes)!==0,$t||x){if(x=Ot,x!==null&&(i=Rt(x,s),i!==0&&i!==F.retryLane))throw F.retryLane=i,na(e,i),Cn(x,e,i),_d;bp(R)||gc(),n=Hd(e,n,s)}else bp(R)?(n.flags|=192,n.child=e.child,n=null):(e=F.treeContext,kt=Zn(R.nextSibling),cn=n,rt=!0,gs=null,Wn=!1,e!==null&&ty(n,e),n=Id(n,i.children),n.flags|=4096);return n}return u?(Ts(),R=i.fallback,u=n.mode,F=e.child,oe=F.sibling,i=Mo(F,{mode:"hidden",children:i.children}),i.subtreeFlags=F.subtreeFlags&65011712,oe!==null?R=Mo(oe,R):(R=oa(R,u,s,null),R.flags|=2),R.return=n,i.return=n,i.sibling=R,n.child=i,di(null,i),i=n.child,R=e.child.memoizedState,R===null?R=Ld(s):(u=R.cachePool,u!==null?(F=Xt._currentValue,u=u.parent!==F?{parent:F,pool:F}:u):u=iy(),R={baseLanes:R.baseLanes|s,cachePool:u}),i.memoizedState=R,i.childLanes=Pd(e,x,s),n.memoizedState=zd,di(e.child,i)):(ws(n),s=e.child,e=s.sibling,s=Mo(s,{mode:"visible",children:i.children}),s.return=n,s.sibling=null,e!==null&&(x=n.deletions,x===null?(n.deletions=[e],n.flags|=16):x.push(e)),n.child=s,n.memoizedState=null,s)}function Id(e,n){return n=ic({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function ic(e,n){return e=_n(22,e,null,n),e.lanes=0,e}function Hd(e,n,s){return ua(n,e.child,null,s),e=Id(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function xb(e,n,s){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n),ed(e.return,n,s)}function Ud(e,n,s,i,u,f){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:u,treeForkCount:f}:(x.isBackwards=n,x.rendering=null,x.renderingStartTime=0,x.last=i,x.tail=s,x.tailMode=u,x.treeForkCount=f)}function Sb(e,n,s){var i=n.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var x=qt.current,R=(x&2)!==0;if(R?(x=x&1|2,n.flags|=128):x&=1,J(qt,x),fn(e,n,i,s),i=rt?Jr:0,!R&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xb(e,s,n);else if(e.tag===19)xb(e,s,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(s=n.child,u=null;s!==null;)e=s.alternate,e!==null&&$l(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=n.child,n.child=null):(u=s.sibling,s.sibling=null),Ud(n,!1,u,s,f,i);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=n.child,n.child=null;u!==null;){if(e=u.alternate,e!==null&&$l(e)===null){n.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Ud(n,!0,s,null,f,i);break;case"together":Ud(n,!1,null,null,void 0,i);break;default:n.memoizedState=null}return n.child}function Po(e,n,s){if(e!==null&&(n.dependencies=e.dependencies),Rs|=n.lanes,(s&n.childLanes)===0)if(e!==null){if(nr(e,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(r(153));if(n.child!==null){for(e=n.child,s=Mo(e,e.pendingProps),n.child=s,s.return=n;e.sibling!==null;)e=e.sibling,s=s.sibling=Mo(e,e.pendingProps),s.return=n;s.sibling=null}return n.child}function Bd(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Bl(e)))}function LC(e,n,s){switch(n.tag){case 3:pe(n,n.stateNode.containerInfo),bs(n,Xt,e.memoizedState.cache),sa();break;case 27:case 5:Ce(n);break;case 4:pe(n,n.stateNode.containerInfo);break;case 10:bs(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,dd(n),null;break;case 13:var i=n.memoizedState;if(i!==null)return i.dehydrated!==null?(ws(n),n.flags|=128,null):(s&n.child.childLanes)!==0?vb(e,n,s):(ws(n),e=Po(e,n,s),e!==null?e.sibling:null);ws(n);break;case 19:var u=(e.flags&128)!==0;if(i=(s&n.childLanes)!==0,i||(nr(e,n,s,!1),i=(s&n.childLanes)!==0),u){if(i)return Sb(e,n,s);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),J(qt,qt.current),i)break;return null;case 22:return n.lanes=0,pb(e,n,s,n.pendingProps);case 24:bs(n,Xt,e.memoizedState.cache)}return Po(e,n,s)}function wb(e,n,s){if(e!==null)if(e.memoizedProps!==n.pendingProps)$t=!0;else{if(!Bd(e,s)&&(n.flags&128)===0)return $t=!1,LC(e,n,s);$t=(e.flags&131072)!==0}else $t=!1,rt&&(n.flags&1048576)!==0&&ey(n,Jr,n.index);switch(n.lanes=0,n.tag){case 16:e:{var i=n.pendingProps;if(e=la(n.elementType),n.type=e,typeof e=="function")Gf(e)?(i=da(e,i),n.tag=1,n=yb(null,n,e,i,s)):(n.tag=0,n=Dd(null,n,e,i,s));else{if(e!=null){var u=e.$$typeof;if(u===M){n.tag=11,n=ub(null,n,e,i,s);break e}else if(u===L){n.tag=14,n=fb(null,n,e,i,s);break e}}throw n=te(e)||e,Error(r(306,n,""))}}return n;case 0:return Dd(e,n,n.type,n.pendingProps,s);case 1:return i=n.type,u=da(i,n.pendingProps),yb(e,n,i,u,s);case 3:e:{if(pe(n,n.stateNode.containerInfo),e===null)throw Error(r(387));i=n.pendingProps;var f=n.memoizedState;u=f.element,id(e,n),ii(n,i,null,s);var x=n.memoizedState;if(i=x.cache,bs(n,Xt,i),i!==f.cache&&td(n,[Xt],s,!0),ri(),i=x.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:x.cache},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){n=bb(e,n,i,s);break e}else if(i!==u){u=Xn(Error(r(424)),n),ei(u),n=bb(e,n,i,s);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,kt=Zn(e.firstChild),cn=n,rt=!0,gs=null,Wn=!0,s=py(n,null,i,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(sa(),i===u){n=Po(e,n,s);break e}fn(e,n,i,s)}n=n.child}return n;case 26:return rc(e,n),e===null?(s=_v(n.type,null,n.pendingProps,null))?n.memoizedState=s:rt||(s=n.type,e=n.pendingProps,i=Tc(re.current).createElement(s),i[Yt]=n,i[mn]=e,dn(i,s,e),on(i),n.stateNode=i):n.memoizedState=_v(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Ce(n),e===null&&rt&&(i=n.stateNode=kv(n.type,n.pendingProps,re.current),cn=n,Wn=!0,u=kt,Ms(n.type)?(xp=u,kt=Zn(i.firstChild)):kt=u),fn(e,n,n.pendingProps.children,s),rc(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&rt&&((u=i=kt)&&(i=dR(i,n.type,n.pendingProps,Wn),i!==null?(n.stateNode=i,cn=n,kt=Zn(i.firstChild),Wn=!1,u=!0):u=!1),u||ys(n)),Ce(n),u=n.type,f=n.pendingProps,x=e!==null?e.memoizedProps:null,i=f.children,mp(u,f)?i=null:x!==null&&mp(u,x)&&(n.flags|=32),n.memoizedState!==null&&(u=hd(e,n,OC,null,null,s),Oi._currentValue=u),rc(e,n),fn(e,n,i,s),n.child;case 6:return e===null&&rt&&((e=s=kt)&&(s=pR(s,n.pendingProps,Wn),s!==null?(n.stateNode=s,cn=n,kt=null,e=!0):e=!1),e||ys(n)),null;case 13:return vb(e,n,s);case 4:return pe(n,n.stateNode.containerInfo),i=n.pendingProps,e===null?n.child=ua(n,null,i,s):fn(e,n,i,s),n.child;case 11:return ub(e,n,n.type,n.pendingProps,s);case 7:return fn(e,n,n.pendingProps,s),n.child;case 8:return fn(e,n,n.pendingProps.children,s),n.child;case 12:return fn(e,n,n.pendingProps.children,s),n.child;case 10:return i=n.pendingProps,bs(n,n.type,i.value),fn(e,n,i.children,s),n.child;case 9:return u=n.type._context,i=n.pendingProps.children,ra(n),u=un(u),i=i(u),n.flags|=1,fn(e,n,i,s),n.child;case 14:return fb(e,n,n.type,n.pendingProps,s);case 15:return db(e,n,n.type,n.pendingProps,s);case 19:return Sb(e,n,s);case 31:return zC(e,n,s);case 22:return pb(e,n,s,n.pendingProps);case 24:return ra(n),i=un(Xt),e===null?(u=sd(),u===null&&(u=Ot,f=nd(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=s),u=f),n.memoizedState={parent:i,cache:u},rd(n),bs(n,Xt,u)):((e.lanes&s)!==0&&(id(e,n),ii(n,null,null,s),ri()),u=e.memoizedState,f=n.memoizedState,u.parent!==i?(u={parent:i,cache:i},n.memoizedState=u,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=u),bs(n,Xt,i)):(i=f.cache,bs(n,Xt,i),i!==u.cache&&td(n,[Xt],s,!0))),fn(e,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function Io(e){e.flags|=4}function Vd(e,n,s,i,u){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if($b())e.flags|=8192;else throw ca=ql,ad}else e.flags&=-16777217}function Tb(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Iv(n))if($b())e.flags|=8192;else throw ca=ql,ad}function lc(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?ln():536870912,e.lanes|=n,hr|=n)}function pi(e,n){if(!rt)switch(e.tailMode){case"hidden":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Mt(e){var n=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(n)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags&65011712,i|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=s,n}function PC(e,n,s){var i=n.pendingProps;switch(Wf(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(n),null;case 1:return Mt(n),null;case 3:return s=n.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),Do(Xt),be(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(tr(n)?Io(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Zf())),Mt(n),null;case 26:var u=n.type,f=n.memoizedState;return e===null?(Io(n),f!==null?(Mt(n),Tb(n,f)):(Mt(n),Vd(n,u,null,i,s))):f?f!==e.memoizedState?(Io(n),Mt(n),Tb(n,f)):(Mt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==i&&Io(n),Mt(n),Vd(n,u,e,i,s)),null;case 27:if(Me(n),s=re.current,u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==i&&Io(n);else{if(!i){if(n.stateNode===null)throw Error(r(166));return Mt(n),null}e=K.current,tr(n)?ny(n):(e=kv(u,i,s),n.stateNode=e,Io(n))}return Mt(n),null;case 5:if(Me(n),u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==i&&Io(n);else{if(!i){if(n.stateNode===null)throw Error(r(166));return Mt(n),null}if(f=K.current,tr(n))ny(n);else{var x=Tc(re.current);switch(f){case 1:f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=x.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?x.createElement("select",{is:i.is}):x.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?x.createElement(u,{is:i.is}):x.createElement(u)}}f[Yt]=n,f[mn]=i;e:for(x=n.child;x!==null;){if(x.tag===5||x.tag===6)f.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===n)break e;for(;x.sibling===null;){if(x.return===null||x.return===n)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}n.stateNode=f;e:switch(dn(f,u,i),u){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Io(n)}}return Mt(n),Vd(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,s),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==i&&Io(n);else{if(typeof i!="string"&&n.stateNode===null)throw Error(r(166));if(e=re.current,tr(n)){if(e=n.stateNode,s=n.memoizedProps,i=null,u=cn,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[Yt]=n,e=!!(e.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||vv(e.nodeValue,s)),e||ys(n,!0)}else e=Tc(e).createTextNode(i),e[Yt]=n,n.stateNode=e}return Mt(n),null;case 31:if(s=n.memoizedState,e===null||e.memoizedState!==null){if(i=tr(n),s!==null){if(e===null){if(!i)throw Error(r(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Yt]=n}else sa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Mt(n),e=!1}else s=Zf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return n.flags&256?(zn(n),n):(zn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return Mt(n),null;case 13:if(i=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=tr(n),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(r(318));if(u=n.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));u[Yt]=n}else sa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Mt(n),u=!1}else u=Zf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return n.flags&256?(zn(n),n):(zn(n),null)}return zn(n),(n.flags&128)!==0?(n.lanes=s,n):(s=i!==null,e=e!==null&&e.memoizedState!==null,s&&(i=n.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048)),s!==e&&s&&(n.child.flags|=8192),lc(n,n.updateQueue),Mt(n),null);case 4:return be(),e===null&&up(n.stateNode.containerInfo),Mt(n),null;case 10:return Do(n.type),Mt(n),null;case 19:if(V(qt),i=n.memoizedState,i===null)return Mt(n),null;if(u=(n.flags&128)!==0,f=i.rendering,f===null)if(u)pi(i,!1);else{if(Ut!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(f=$l(e),f!==null){for(n.flags|=128,pi(i,!1),e=f.updateQueue,n.updateQueue=e,lc(n,e),n.subtreeFlags=0,e=s,s=n.child;s!==null;)Qg(s,e),s=s.sibling;return J(qt,qt.current&1|2),rt&&jo(n,i.treeForkCount),n.child}e=e.sibling}i.tail!==null&&le()>pc&&(n.flags|=128,u=!0,pi(i,!1),n.lanes=4194304)}else{if(!u)if(e=$l(f),e!==null){if(n.flags|=128,u=!0,e=e.updateQueue,n.updateQueue=e,lc(n,e),pi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!rt)return Mt(n),null}else 2*le()-i.renderingStartTime>pc&&s!==536870912&&(n.flags|=128,u=!0,pi(i,!1),n.lanes=4194304);i.isBackwards?(f.sibling=n.child,n.child=f):(e=i.last,e!==null?e.sibling=f:n.child=f,i.last=f)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=le(),e.sibling=null,s=qt.current,J(qt,u?s&1|2:s&1),rt&&jo(n,i.treeForkCount),e):(Mt(n),null);case 22:case 23:return zn(n),fd(),i=n.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(n.flags|=8192):i&&(n.flags|=8192),i?(s&536870912)!==0&&(n.flags&128)===0&&(Mt(n),n.subtreeFlags&6&&(n.flags|=8192)):Mt(n),s=n.updateQueue,s!==null&&lc(n,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==s&&(n.flags|=2048),e!==null&&V(ia),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Do(Xt),Mt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function IC(e,n){switch(Wf(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Do(Xt),be(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Me(n),null;case 31:if(n.memoizedState!==null){if(zn(n),n.alternate===null)throw Error(r(340));sa()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(zn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));sa()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return V(qt),null;case 4:return be(),null;case 10:return Do(n.type),null;case 22:case 23:return zn(n),fd(),e!==null&&V(ia),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Do(Xt),null;case 25:return null;default:return null}}function Eb(e,n){switch(Wf(n),n.tag){case 3:Do(Xt),be();break;case 26:case 27:case 5:Me(n);break;case 4:be();break;case 31:n.memoizedState!==null&&zn(n);break;case 13:zn(n);break;case 19:V(qt);break;case 10:Do(n.type);break;case 22:case 23:zn(n),fd(),e!==null&&V(ia);break;case 24:Do(Xt)}}function hi(e,n){try{var s=n.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var u=i.next;s=u;do{if((s.tag&e)===e){i=void 0;var f=s.create,x=s.inst;i=f(),x.destroy=i}s=s.next}while(s!==u)}}catch(R){gt(n,n.return,R)}}function Es(e,n,s){try{var i=n.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var f=u.next;i=f;do{if((i.tag&e)===e){var x=i.inst,R=x.destroy;if(R!==void 0){x.destroy=void 0,u=n;var F=s,oe=R;try{oe()}catch(ue){gt(u,F,ue)}}}i=i.next}while(i!==f)}}catch(ue){gt(n,n.return,ue)}}function Cb(e){var n=e.updateQueue;if(n!==null){var s=e.stateNode;try{my(n,s)}catch(i){gt(e,e.return,i)}}}function Rb(e,n,s){s.props=da(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(i){gt(e,n,i)}}function mi(e,n){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof s=="function"?e.refCleanup=s(i):s.current=i}}catch(u){gt(e,n,u)}}function So(e,n){var s=e.ref,i=e.refCleanup;if(s!==null)if(typeof i=="function")try{i()}catch(u){gt(e,n,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){gt(e,n,u)}else s.current=null}function Ob(e){var n=e.type,s=e.memoizedProps,i=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&i.focus();break e;case"img":s.src?i.src=s.src:s.srcSet&&(i.srcset=s.srcSet)}}catch(u){gt(e,e.return,u)}}function Fd(e,n,s){try{var i=e.stateNode;rR(i,e.type,s,n),i[mn]=n}catch(u){gt(e,e.return,u)}}function Ab(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ms(e.type)||e.tag===4}function Yd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ab(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&&Ms(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 qd(e,n,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(e),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=No));else if(i!==4&&(i===27&&Ms(e.type)&&(s=e.stateNode,n=null),e=e.child,e!==null))for(qd(e,n,s),e=e.sibling;e!==null;)qd(e,n,s),e=e.sibling}function cc(e,n,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?s.insertBefore(e,n):s.appendChild(e);else if(i!==4&&(i===27&&Ms(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(cc(e,n,s),e=e.sibling;e!==null;)cc(e,n,s),e=e.sibling}function Nb(e){var n=e.stateNode,s=e.memoizedProps;try{for(var i=e.type,u=n.attributes;u.length;)n.removeAttributeNode(u[0]);dn(n,i,s),n[Yt]=e,n[mn]=s}catch(f){gt(e,e.return,f)}}var Ho=!1,Wt=!1,Gd=!1,kb=typeof WeakSet=="function"?WeakSet:Set,sn=null;function HC(e,n){if(e=e.containerInfo,pp=kc,e=Vg(e),Hf(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var u=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break e}var x=0,R=-1,F=-1,oe=0,ue=0,de=e,ae=null;t:for(;;){for(var ie;de!==s||u!==0&&de.nodeType!==3||(R=x+u),de!==f||i!==0&&de.nodeType!==3||(F=x+i),de.nodeType===3&&(x+=de.nodeValue.length),(ie=de.firstChild)!==null;)ae=de,de=ie;for(;;){if(de===e)break t;if(ae===s&&++oe===u&&(R=x),ae===f&&++ue===i&&(F=x),(ie=de.nextSibling)!==null)break;de=ae,ae=de.parentNode}de=ie}s=R===-1||F===-1?null:{start:R,end:F}}else s=null}s=s||{start:0,end:0}}else s=null;for(hp={focusedElem:e,selectionRange:s},kc=!1,sn=n;sn!==null;)if(n=sn,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,sn=e;else for(;sn!==null;){switch(n=sn,f=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)u=e[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,s=n,u=f.memoizedProps,f=f.memoizedState,i=s.stateNode;try{var _e=da(s.type,u);e=i.getSnapshotBeforeUpdate(_e,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(Be){gt(s,s.return,Be)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,s=e.nodeType,s===9)yp(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":yp(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=n.sibling,e!==null){e.return=n.return,sn=e;break}sn=n.return}}function Mb(e,n,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:Bo(e,s),i&4&&hi(5,s);break;case 1:if(Bo(e,s),i&4)if(e=s.stateNode,n===null)try{e.componentDidMount()}catch(x){gt(s,s.return,x)}else{var u=da(s.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(u,n,e.__reactInternalSnapshotBeforeUpdate)}catch(x){gt(s,s.return,x)}}i&64&&Cb(s),i&512&&mi(s,s.return);break;case 3:if(Bo(e,s),i&64&&(e=s.updateQueue,e!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{my(e,n)}catch(x){gt(s,s.return,x)}}break;case 27:n===null&&i&4&&Nb(s);case 26:case 5:Bo(e,s),n===null&&i&4&&Ob(s),i&512&&mi(s,s.return);break;case 12:Bo(e,s);break;case 31:Bo(e,s),i&4&&Db(e,s);break;case 13:Bo(e,s),i&4&&zb(e,s),i&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=KC.bind(null,s),hR(e,s))));break;case 22:if(i=s.memoizedState!==null||Ho,!i){n=n!==null&&n.memoizedState!==null||Wt,u=Ho;var f=Wt;Ho=i,(Wt=n)&&!f?Vo(e,s,(s.subtreeFlags&8772)!==0):Bo(e,s),Ho=u,Wt=f}break;case 30:break;default:Bo(e,s)}}function jb(e){var n=e.alternate;n!==null&&(e.alternate=null,jb(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&wf(n)),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 Dt=null,Sn=!1;function Uo(e,n,s){for(s=s.child;s!==null;)_b(e,n,s),s=s.sibling}function _b(e,n,s){if(Ye&&typeof Ye.onCommitFiberUnmount=="function")try{Ye.onCommitFiberUnmount(Oe,s)}catch{}switch(s.tag){case 26:Wt||So(s,n),Uo(e,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Wt||So(s,n);var i=Dt,u=Sn;Ms(s.type)&&(Dt=s.stateNode,Sn=!1),Uo(e,n,s),Ei(s.stateNode),Dt=i,Sn=u;break;case 5:Wt||So(s,n);case 6:if(i=Dt,u=Sn,Dt=null,Uo(e,n,s),Dt=i,Sn=u,Dt!==null)if(Sn)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(s.stateNode)}catch(f){gt(s,n,f)}else try{Dt.removeChild(s.stateNode)}catch(f){gt(s,n,f)}break;case 18:Dt!==null&&(Sn?(e=Dt,Cv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),wr(e)):Cv(Dt,s.stateNode));break;case 4:i=Dt,u=Sn,Dt=s.stateNode.containerInfo,Sn=!0,Uo(e,n,s),Dt=i,Sn=u;break;case 0:case 11:case 14:case 15:Es(2,s,n),Wt||Es(4,s,n),Uo(e,n,s);break;case 1:Wt||(So(s,n),i=s.stateNode,typeof i.componentWillUnmount=="function"&&Rb(s,n,i)),Uo(e,n,s);break;case 21:Uo(e,n,s);break;case 22:Wt=(i=Wt)||s.memoizedState!==null,Uo(e,n,s),Wt=i;break;default:Uo(e,n,s)}}function Db(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{wr(e)}catch(s){gt(n,n.return,s)}}}function zb(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{wr(e)}catch(s){gt(n,n.return,s)}}function UC(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new kb),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new kb),n;default:throw Error(r(435,e.tag))}}function uc(e,n){var s=UC(e);n.forEach(function(i){if(!s.has(i)){s.add(i);var u=$C.bind(null,e,i);i.then(u,u)}})}function wn(e,n){var s=n.deletions;if(s!==null)for(var i=0;i<s.length;i++){var u=s[i],f=e,x=n,R=x;e:for(;R!==null;){switch(R.tag){case 27:if(Ms(R.type)){Dt=R.stateNode,Sn=!1;break e}break;case 5:Dt=R.stateNode,Sn=!1;break e;case 3:case 4:Dt=R.stateNode.containerInfo,Sn=!0;break e}R=R.return}if(Dt===null)throw Error(r(160));_b(f,x,u),Dt=null,Sn=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Lb(n,e),n=n.sibling}var lo=null;function Lb(e,n){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:wn(n,e),Tn(e),i&4&&(Es(3,e,e.return),hi(3,e),Es(5,e,e.return));break;case 1:wn(n,e),Tn(e),i&512&&(Wt||s===null||So(s,s.return)),i&64&&Ho&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?i:s.concat(i))));break;case 26:var u=lo;if(wn(n,e),Tn(e),i&512&&(Wt||s===null||So(s,s.return)),i&4){var f=s!==null?s.memoizedState:null;if(i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null){e:{i=e.type,s=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Vr]||f[Yt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(i),u.head.insertBefore(f,u.querySelector("head > title"))),dn(f,i,s),f[Yt]=e,on(f),i=f;break e;case"link":var x=Lv("link","href",u).get(i+(s.href||""));if(x){for(var R=0;R<x.length;R++)if(f=x[R],f.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&f.getAttribute("rel")===(s.rel==null?null:s.rel)&&f.getAttribute("title")===(s.title==null?null:s.title)&&f.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){x.splice(R,1);break t}}f=u.createElement(i),dn(f,i,s),u.head.appendChild(f);break;case"meta":if(x=Lv("meta","content",u).get(i+(s.content||""))){for(R=0;R<x.length;R++)if(f=x[R],f.getAttribute("content")===(s.content==null?null:""+s.content)&&f.getAttribute("name")===(s.name==null?null:s.name)&&f.getAttribute("property")===(s.property==null?null:s.property)&&f.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&f.getAttribute("charset")===(s.charSet==null?null:s.charSet)){x.splice(R,1);break t}}f=u.createElement(i),dn(f,i,s),u.head.appendChild(f);break;default:throw Error(r(468,i))}f[Yt]=e,on(f),i=f}e.stateNode=i}else Pv(u,e.type,e.stateNode);else e.stateNode=zv(u,i,e.memoizedProps);else f!==i?(f===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):f.count--,i===null?Pv(u,e.type,e.stateNode):zv(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Fd(e,e.memoizedProps,s.memoizedProps)}break;case 27:wn(n,e),Tn(e),i&512&&(Wt||s===null||So(s,s.return)),s!==null&&i&4&&Fd(e,e.memoizedProps,s.memoizedProps);break;case 5:if(wn(n,e),Tn(e),i&512&&(Wt||s===null||So(s,s.return)),e.flags&32){u=e.stateNode;try{qa(u,"")}catch(_e){gt(e,e.return,_e)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,Fd(e,u,s!==null?s.memoizedProps:u)),i&1024&&(Gd=!0);break;case 6:if(wn(n,e),Tn(e),i&4){if(e.stateNode===null)throw Error(r(162));i=e.memoizedProps,s=e.stateNode;try{s.nodeValue=i}catch(_e){gt(e,e.return,_e)}}break;case 3:if(Rc=null,u=lo,lo=Ec(n.containerInfo),wn(n,e),lo=u,Tn(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{wr(n.containerInfo)}catch(_e){gt(e,e.return,_e)}Gd&&(Gd=!1,Pb(e));break;case 4:i=lo,lo=Ec(e.stateNode.containerInfo),wn(n,e),Tn(e),lo=i;break;case 12:wn(n,e),Tn(e);break;case 31:wn(n,e),Tn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 13:wn(n,e),Tn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(dc=le()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 22:u=e.memoizedState!==null;var F=s!==null&&s.memoizedState!==null,oe=Ho,ue=Wt;if(Ho=oe||u,Wt=ue||F,wn(n,e),Wt=ue,Ho=oe,Tn(e),i&8192)e:for(n=e.stateNode,n._visibility=u?n._visibility&-2:n._visibility|1,u&&(s===null||F||Ho||Wt||pa(e)),s=null,n=e;;){if(n.tag===5||n.tag===26){if(s===null){F=s=n;try{if(f=F.stateNode,u)x=f.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{R=F.stateNode;var de=F.memoizedProps.style,ae=de!=null&&de.hasOwnProperty("display")?de.display:null;R.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(_e){gt(F,F.return,_e)}}}else if(n.tag===6){if(s===null){F=n;try{F.stateNode.nodeValue=u?"":F.memoizedProps}catch(_e){gt(F,F.return,_e)}}}else if(n.tag===18){if(s===null){F=n;try{var ie=F.stateNode;u?Rv(ie,!0):Rv(F.stateNode,!1)}catch(_e){gt(F,F.return,_e)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}i&4&&(i=e.updateQueue,i!==null&&(s=i.retryQueue,s!==null&&(i.retryQueue=null,uc(e,s))));break;case 19:wn(n,e),Tn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 30:break;case 21:break;default:wn(n,e),Tn(e)}}function Tn(e){var n=e.flags;if(n&2){try{for(var s,i=e.return;i!==null;){if(Ab(i)){s=i;break}i=i.return}if(s==null)throw Error(r(160));switch(s.tag){case 27:var u=s.stateNode,f=Yd(e);cc(e,f,u);break;case 5:var x=s.stateNode;s.flags&32&&(qa(x,""),s.flags&=-33);var R=Yd(e);cc(e,R,x);break;case 3:case 4:var F=s.stateNode.containerInfo,oe=Yd(e);qd(e,oe,F);break;default:throw Error(r(161))}}catch(ue){gt(e,e.return,ue)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Pb(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Pb(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Bo(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Mb(e,n.alternate,n),n=n.sibling}function pa(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Es(4,n,n.return),pa(n);break;case 1:So(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&Rb(n,n.return,s),pa(n);break;case 27:Ei(n.stateNode);case 26:case 5:So(n,n.return),pa(n);break;case 22:n.memoizedState===null&&pa(n);break;case 30:pa(n);break;default:pa(n)}e=e.sibling}}function Vo(e,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var i=n.alternate,u=e,f=n,x=f.flags;switch(f.tag){case 0:case 11:case 15:Vo(u,f,s),hi(4,f);break;case 1:if(Vo(u,f,s),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(oe){gt(i,i.return,oe)}if(i=f,u=i.updateQueue,u!==null){var R=i.stateNode;try{var F=u.shared.hiddenCallbacks;if(F!==null)for(u.shared.hiddenCallbacks=null,u=0;u<F.length;u++)hy(F[u],R)}catch(oe){gt(i,i.return,oe)}}s&&x&64&&Cb(f),mi(f,f.return);break;case 27:Nb(f);case 26:case 5:Vo(u,f,s),s&&i===null&&x&4&&Ob(f),mi(f,f.return);break;case 12:Vo(u,f,s);break;case 31:Vo(u,f,s),s&&x&4&&Db(u,f);break;case 13:Vo(u,f,s),s&&x&4&&zb(u,f);break;case 22:f.memoizedState===null&&Vo(u,f,s),mi(f,f.return);break;case 30:break;default:Vo(u,f,s)}n=n.sibling}}function Xd(e,n){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&ti(s))}function Kd(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ti(e))}function co(e,n,s,i){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Ib(e,n,s,i),n=n.sibling}function Ib(e,n,s,i){var u=n.flags;switch(n.tag){case 0:case 11:case 15:co(e,n,s,i),u&2048&&hi(9,n);break;case 1:co(e,n,s,i);break;case 3:co(e,n,s,i),u&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ti(e)));break;case 12:if(u&2048){co(e,n,s,i),e=n.stateNode;try{var f=n.memoizedProps,x=f.id,R=f.onPostCommit;typeof R=="function"&&R(x,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(F){gt(n,n.return,F)}}else co(e,n,s,i);break;case 31:co(e,n,s,i);break;case 13:co(e,n,s,i);break;case 23:break;case 22:f=n.stateNode,x=n.alternate,n.memoizedState!==null?f._visibility&2?co(e,n,s,i):gi(e,n):f._visibility&2?co(e,n,s,i):(f._visibility|=2,fr(e,n,s,i,(n.subtreeFlags&10256)!==0||!1)),u&2048&&Xd(x,n);break;case 24:co(e,n,s,i),u&2048&&Kd(n.alternate,n);break;default:co(e,n,s,i)}}function fr(e,n,s,i,u){for(u=u&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var f=e,x=n,R=s,F=i,oe=x.flags;switch(x.tag){case 0:case 11:case 15:fr(f,x,R,F,u),hi(8,x);break;case 23:break;case 22:var ue=x.stateNode;x.memoizedState!==null?ue._visibility&2?fr(f,x,R,F,u):gi(f,x):(ue._visibility|=2,fr(f,x,R,F,u)),u&&oe&2048&&Xd(x.alternate,x);break;case 24:fr(f,x,R,F,u),u&&oe&2048&&Kd(x.alternate,x);break;default:fr(f,x,R,F,u)}n=n.sibling}}function gi(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=e,i=n,u=i.flags;switch(i.tag){case 22:gi(s,i),u&2048&&Xd(i.alternate,i);break;case 24:gi(s,i),u&2048&&Kd(i.alternate,i);break;default:gi(s,i)}n=n.sibling}}var yi=8192;function dr(e,n,s){if(e.subtreeFlags&yi)for(e=e.child;e!==null;)Hb(e,n,s),e=e.sibling}function Hb(e,n,s){switch(e.tag){case 26:dr(e,n,s),e.flags&yi&&e.memoizedState!==null&&RR(s,lo,e.memoizedState,e.memoizedProps);break;case 5:dr(e,n,s);break;case 3:case 4:var i=lo;lo=Ec(e.stateNode.containerInfo),dr(e,n,s),lo=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=yi,yi=16777216,dr(e,n,s),yi=i):dr(e,n,s));break;default:dr(e,n,s)}}function Ub(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function bi(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];sn=i,Vb(i,e)}Ub(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bb(e),e=e.sibling}function Bb(e){switch(e.tag){case 0:case 11:case 15:bi(e),e.flags&2048&&Es(9,e,e.return);break;case 3:bi(e);break;case 12:bi(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,fc(e)):bi(e);break;default:bi(e)}}function fc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];sn=i,Vb(i,e)}Ub(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Es(8,n,n.return),fc(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,fc(n));break;default:fc(n)}e=e.sibling}}function Vb(e,n){for(;sn!==null;){var s=sn;switch(s.tag){case 0:case 11:case 15:Es(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var i=s.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:ti(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,sn=i;else e:for(s=e;sn!==null;){i=sn;var u=i.sibling,f=i.return;if(jb(i),i===s){sn=null;break e}if(u!==null){u.return=f,sn=u;break e}sn=f}}}var BC={getCacheForType:function(e){var n=un(Xt),s=n.data.get(e);return s===void 0&&(s=e(),n.data.set(e,s)),s},cacheSignal:function(){return un(Xt).controller.signal}},VC=typeof WeakMap=="function"?WeakMap:Map,ht=0,Ot=null,tt=null,st=0,mt=0,Ln=null,Cs=!1,pr=!1,$d=!1,Fo=0,Ut=0,Rs=0,ha=0,Wd=0,Pn=0,hr=0,vi=null,En=null,Qd=!1,dc=0,Fb=0,pc=1/0,hc=null,Os=null,en=0,As=null,mr=null,Yo=0,Zd=0,Jd=null,Yb=null,xi=0,ep=null;function In(){return(ht&2)!==0&&st!==0?st&-st:P.T!==null?rp():bo()}function qb(){if(Pn===0)if((st&536870912)===0||rt){var e=jt;jt<<=1,(jt&3932160)===0&&(jt=262144),Pn=e}else Pn=536870912;return e=Dn.current,e!==null&&(e.flags|=32),Pn}function Cn(e,n,s){(e===Ot&&(mt===2||mt===9)||e.cancelPendingCommit!==null)&&(gr(e,0),Ns(e,st,Pn,!1)),vn(e,s),((ht&2)===0||e!==Ot)&&(e===Ot&&((ht&2)===0&&(ha|=s),Ut===4&&Ns(e,st,Pn,!1)),wo(e))}function Gb(e,n,s){if((ht&6)!==0)throw Error(r(327));var i=!s&&(n&127)===0&&(n&e.expiredLanes)===0||Pt(e,n),u=i?qC(e,n):np(e,n,!0),f=i;do{if(u===0){pr&&!i&&Ns(e,n,0,!1);break}else{if(s=e.current.alternate,f&&!FC(s)){u=np(e,n,!1),f=!1;continue}if(u===2){if(f=n,e.errorRecoveryDisabledLanes&f)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){n=x;e:{var R=e;u=vi;var F=R.current.memoizedState.isDehydrated;if(F&&(gr(R,x).flags|=256),x=np(R,x,!1),x!==2){if($d&&!F){R.errorRecoveryDisabledLanes|=f,ha|=f,u=4;break e}f=En,En=u,f!==null&&(En===null?En=f:En.push.apply(En,f))}u=x}if(f=!1,u!==2)continue}}if(u===1){gr(e,0),Ns(e,n,0,!0);break}e:{switch(i=e,f=u,f){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:Ns(i,n,Pn,!Cs);break e;case 2:En=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(u=dc+300-le(),10<u)){if(Ns(i,n,Pn,!Cs),_t(i,0,!0)!==0)break e;Yo=n,i.timeoutHandle=Tv(Xb.bind(null,i,s,En,hc,Qd,n,Pn,ha,hr,Cs,f,"Throttled",-0,0),u);break e}Xb(i,s,En,hc,Qd,n,Pn,ha,hr,Cs,f,null,-0,0)}}break}while(!0);wo(e)}function Xb(e,n,s,i,u,f,x,R,F,oe,ue,de,ae,ie){if(e.timeoutHandle=-1,de=n.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:No},Hb(n,f,de);var _e=(f&62914560)===f?dc-le():(f&4194048)===f?Fb-le():0;if(_e=OR(de,_e),_e!==null){Yo=f,e.cancelPendingCommit=_e(tv.bind(null,e,n,f,s,i,u,x,R,F,ue,de,null,ae,ie)),Ns(e,f,x,!oe);return}}tv(e,n,f,s,i,u,x,R,F)}function FC(e){for(var n=e;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var i=0;i<s.length;i++){var u=s[i],f=u.getSnapshot;u=u.value;try{if(!jn(f(),u))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Ns(e,n,s,i){n&=~Wd,n&=~ha,e.suspendedLanes|=n,e.pingedLanes&=~n,i&&(e.warmLanes|=n),i=e.expirationTimes;for(var u=n;0<u;){var f=31-ct(u),x=1<<f;i[f]=-1,u&=~x}s!==0&&kn(e,s,n)}function mc(){return(ht&6)===0?(Si(0),!1):!0}function tp(){if(tt!==null){if(mt===0)var e=tt.return;else e=tt,_o=aa=null,yd(e),rr=null,oi=0,e=tt;for(;e!==null;)Eb(e.alternate,e),e=e.return;tt=null}}function gr(e,n){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,cR(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Yo=0,tp(),Ot=e,tt=s=Mo(e.current,null),st=n,mt=0,Ln=null,Cs=!1,pr=Pt(e,n),$d=!1,hr=Pn=Wd=ha=Rs=Ut=0,En=vi=null,Qd=!1,(n&8)!==0&&(n|=n&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=n;0<i;){var u=31-ct(i),f=1<<u;n|=e[u],i&=~f}return Fo=n,Ll(),s}function Kb(e,n){Ke=null,P.H=fi,n===ar||n===Yl?(n=uy(),mt=3):n===ad?(n=uy(),mt=4):mt=n===_d?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Ln=n,tt===null&&(Ut=1,sc(e,Xn(n,e.current)))}function $b(){var e=Dn.current;return e===null?!0:(st&4194048)===st?Qn===null:(st&62914560)===st||(st&536870912)!==0?e===Qn:!1}function Wb(){var e=P.H;return P.H=fi,e===null?fi:e}function Qb(){var e=P.A;return P.A=BC,e}function gc(){Ut=4,Cs||(st&4194048)!==st&&Dn.current!==null||(pr=!0),(Rs&134217727)===0&&(ha&134217727)===0||Ot===null||Ns(Ot,st,Pn,!1)}function np(e,n,s){var i=ht;ht|=2;var u=Wb(),f=Qb();(Ot!==e||st!==n)&&(hc=null,gr(e,n)),n=!1;var x=Ut;e:do try{if(mt!==0&&tt!==null){var R=tt,F=Ln;switch(mt){case 8:tp(),x=6;break e;case 3:case 2:case 9:case 6:Dn.current===null&&(n=!0);var oe=mt;if(mt=0,Ln=null,yr(e,R,F,oe),s&&pr){x=0;break e}break;default:oe=mt,mt=0,Ln=null,yr(e,R,F,oe)}}YC(),x=Ut;break}catch(ue){Kb(e,ue)}while(!0);return n&&e.shellSuspendCounter++,_o=aa=null,ht=i,P.H=u,P.A=f,tt===null&&(Ot=null,st=0,Ll()),x}function YC(){for(;tt!==null;)Zb(tt)}function qC(e,n){var s=ht;ht|=2;var i=Wb(),u=Qb();Ot!==e||st!==n?(hc=null,pc=le()+500,gr(e,n)):pr=Pt(e,n);e:do try{if(mt!==0&&tt!==null){n=tt;var f=Ln;t:switch(mt){case 1:mt=0,Ln=null,yr(e,n,f,1);break;case 2:case 9:if(ly(f)){mt=0,Ln=null,Jb(n);break}n=function(){mt!==2&&mt!==9||Ot!==e||(mt=7),wo(e)},f.then(n,n);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:ly(f)?(mt=0,Ln=null,Jb(n)):(mt=0,Ln=null,yr(e,n,f,7));break;case 5:var x=null;switch(tt.tag){case 26:x=tt.memoizedState;case 5:case 27:var R=tt;if(x?Iv(x):R.stateNode.complete){mt=0,Ln=null;var F=R.sibling;if(F!==null)tt=F;else{var oe=R.return;oe!==null?(tt=oe,yc(oe)):tt=null}break t}}mt=0,Ln=null,yr(e,n,f,5);break;case 6:mt=0,Ln=null,yr(e,n,f,6);break;case 8:tp(),Ut=6;break e;default:throw Error(r(462))}}GC();break}catch(ue){Kb(e,ue)}while(!0);return _o=aa=null,P.H=i,P.A=u,ht=s,tt!==null?0:(Ot=null,st=0,Ll(),Ut)}function GC(){for(;tt!==null&&!Ie();)Zb(tt)}function Zb(e){var n=wb(e.alternate,e,Fo);e.memoizedProps=e.pendingProps,n===null?yc(e):tt=n}function Jb(e){var n=e,s=n.alternate;switch(n.tag){case 15:case 0:n=gb(s,n,n.pendingProps,n.type,void 0,st);break;case 11:n=gb(s,n,n.pendingProps,n.type.render,n.ref,st);break;case 5:yd(n);default:Eb(s,n),n=tt=Qg(n,Fo),n=wb(s,n,Fo)}e.memoizedProps=e.pendingProps,n===null?yc(e):tt=n}function yr(e,n,s,i){_o=aa=null,yd(n),rr=null,oi=0;var u=n.return;try{if(DC(e,u,n,s,st)){Ut=1,sc(e,Xn(s,e.current)),tt=null;return}}catch(f){if(u!==null)throw tt=u,f;Ut=1,sc(e,Xn(s,e.current)),tt=null;return}n.flags&32768?(rt||i===1?e=!0:pr||(st&536870912)!==0?e=!1:(Cs=e=!0,(i===2||i===9||i===3||i===6)&&(i=Dn.current,i!==null&&i.tag===13&&(i.flags|=16384))),ev(n,e)):yc(n)}function yc(e){var n=e;do{if((n.flags&32768)!==0){ev(n,Cs);return}e=n.return;var s=PC(n.alternate,n,Fo);if(s!==null){tt=s;return}if(n=n.sibling,n!==null){tt=n;return}tt=n=e}while(n!==null);Ut===0&&(Ut=5)}function ev(e,n){do{var s=IC(e.alternate,e);if(s!==null){s.flags&=32767,tt=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(e=e.sibling,e!==null)){tt=e;return}tt=e=s}while(e!==null);Ut=6,tt=null}function tv(e,n,s,i,u,f,x,R,F){e.cancelPendingCommit=null;do bc();while(en!==0);if((ht&6)!==0)throw Error(r(327));if(n!==null){if(n===e.current)throw Error(r(177));if(f=n.lanes|n.childLanes,f|=Yf,Ro(e,s,f,x,R,F),e===Ot&&(tt=Ot=null,st=0),mr=n,As=e,Yo=s,Zd=f,Jd=u,Yb=i,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,WC(xe,function(){return rv(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||i){i=P.T,P.T=null,u=q.p,q.p=2,x=ht,ht|=4;try{HC(e,n,s)}finally{ht=x,q.p=u,P.T=i}}en=1,nv(),ov(),sv()}}function nv(){if(en===1){en=0;var e=As,n=mr,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=P.T,P.T=null;var i=q.p;q.p=2;var u=ht;ht|=4;try{Lb(n,e);var f=hp,x=Vg(e.containerInfo),R=f.focusedElem,F=f.selectionRange;if(x!==R&&R&&R.ownerDocument&&Bg(R.ownerDocument.documentElement,R)){if(F!==null&&Hf(R)){var oe=F.start,ue=F.end;if(ue===void 0&&(ue=oe),"selectionStart"in R)R.selectionStart=oe,R.selectionEnd=Math.min(ue,R.value.length);else{var de=R.ownerDocument||document,ae=de&&de.defaultView||window;if(ae.getSelection){var ie=ae.getSelection(),_e=R.textContent.length,Be=Math.min(F.start,_e),St=F.end===void 0?Be:Math.min(F.end,_e);!ie.extend&&Be>St&&(x=St,St=Be,Be=x);var ee=Ug(R,Be),G=Ug(R,St);if(ee&&G&&(ie.rangeCount!==1||ie.anchorNode!==ee.node||ie.anchorOffset!==ee.offset||ie.focusNode!==G.node||ie.focusOffset!==G.offset)){var ne=de.createRange();ne.setStart(ee.node,ee.offset),ie.removeAllRanges(),Be>St?(ie.addRange(ne),ie.extend(G.node,G.offset)):(ne.setEnd(G.node,G.offset),ie.addRange(ne))}}}}for(de=[],ie=R;ie=ie.parentNode;)ie.nodeType===1&&de.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<de.length;R++){var fe=de[R];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}kc=!!pp,hp=pp=null}finally{ht=u,q.p=i,P.T=s}}e.current=n,en=2}}function ov(){if(en===2){en=0;var e=As,n=mr,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=P.T,P.T=null;var i=q.p;q.p=2;var u=ht;ht|=4;try{Mb(e,n.alternate,n)}finally{ht=u,q.p=i,P.T=s}}en=3}}function sv(){if(en===4||en===3){en=0,je();var e=As,n=mr,s=Yo,i=Yb;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?en=5:(en=0,mr=As=null,av(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Os=null),ao(s),n=n.stateNode,Ye&&typeof Ye.onCommitFiberRoot=="function")try{Ye.onCommitFiberRoot(Oe,n,void 0,(n.current.flags&128)===128)}catch{}if(i!==null){n=P.T,u=q.p,q.p=2,P.T=null;try{for(var f=e.onRecoverableError,x=0;x<i.length;x++){var R=i[x];f(R.value,{componentStack:R.stack})}}finally{P.T=n,q.p=u}}(Yo&3)!==0&&bc(),wo(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===ep?xi++:(xi=0,ep=e):xi=0,Si(0)}}function av(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,ti(n)))}function bc(){return nv(),ov(),sv(),rv()}function rv(){if(en!==5)return!1;var e=As,n=Zd;Zd=0;var s=ao(Yo),i=P.T,u=q.p;try{q.p=32>s?32:s,P.T=null,s=Jd,Jd=null;var f=As,x=Yo;if(en=0,mr=As=null,Yo=0,(ht&6)!==0)throw Error(r(331));var R=ht;if(ht|=4,Bb(f.current),Ib(f,f.current,x,s),ht=R,Si(0,!1),Ye&&typeof Ye.onPostCommitFiberRoot=="function")try{Ye.onPostCommitFiberRoot(Oe,f)}catch{}return!0}finally{q.p=u,P.T=i,av(e,n)}}function iv(e,n,s){n=Xn(s,n),n=jd(e.stateNode,n,2),e=Ss(e,n,2),e!==null&&(vn(e,2),wo(e))}function gt(e,n,s){if(e.tag===3)iv(e,e,s);else for(;n!==null;){if(n.tag===3){iv(n,e,s);break}else if(n.tag===1){var i=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Os===null||!Os.has(i))){e=Xn(s,e),s=lb(2),i=Ss(n,s,2),i!==null&&(cb(s,i,n,e),vn(i,2),wo(i));break}}n=n.return}}function op(e,n,s){var i=e.pingCache;if(i===null){i=e.pingCache=new VC;var u=new Set;i.set(n,u)}else u=i.get(n),u===void 0&&(u=new Set,i.set(n,u));u.has(s)||($d=!0,u.add(s),e=XC.bind(null,e,n,s),n.then(e,e))}function XC(e,n,s){var i=e.pingCache;i!==null&&i.delete(n),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Ot===e&&(st&s)===s&&(Ut===4||Ut===3&&(st&62914560)===st&&300>le()-dc?(ht&2)===0&&gr(e,0):Wd|=s,hr===st&&(hr=0)),wo(e)}function lv(e,n){n===0&&(n=ln()),e=na(e,n),e!==null&&(vn(e,n),wo(e))}function KC(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),lv(e,s)}function $C(e,n){var s=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(r(314))}i!==null&&i.delete(n),lv(e,s)}function WC(e,n){return Re(e,n)}var vc=null,br=null,sp=!1,xc=!1,ap=!1,ks=0;function wo(e){e!==br&&e.next===null&&(br===null?vc=br=e:br=br.next=e),xc=!0,sp||(sp=!0,ZC())}function Si(e,n){if(!ap&&xc){ap=!0;do for(var s=!1,i=vc;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var x=i.suspendedLanes,R=i.pingedLanes;f=(1<<31-ct(42|e)+1)-1,f&=u&~(x&~R),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,dv(i,f))}else f=st,f=_t(i,i===Ot?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||Pt(i,f)||(s=!0,dv(i,f));i=i.next}while(s);ap=!1}}function QC(){cv()}function cv(){xc=sp=!1;var e=0;ks!==0&&lR()&&(e=ks);for(var n=le(),s=null,i=vc;i!==null;){var u=i.next,f=uv(i,n);f===0?(i.next=null,s===null?vc=u:s.next=u,u===null&&(br=s)):(s=i,(e!==0||(f&3)!==0)&&(xc=!0)),i=u}en!==0&&en!==5||Si(e),ks!==0&&(ks=0)}function uv(e,n){for(var s=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var x=31-ct(f),R=1<<x,F=u[x];F===-1?((R&s)===0||(R&i)!==0)&&(u[x]=Nn(R,n)):F<=n&&(e.expiredLanes|=R),f&=~R}if(n=Ot,s=st,s=_t(e,e===n?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,s===0||e===n&&(mt===2||mt===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Ne(i),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Pt(e,s)){if(n=s&-s,n===e.callbackPriority)return n;switch(i!==null&&Ne(i),ao(s)){case 2:case 8:s=ce;break;case 32:s=xe;break;case 268435456:s=Lt;break;default:s=xe}return i=fv.bind(null,e),s=Re(s,i),e.callbackPriority=n,e.callbackNode=s,n}return i!==null&&i!==null&&Ne(i),e.callbackPriority=2,e.callbackNode=null,2}function fv(e,n){if(en!==0&&en!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(bc()&&e.callbackNode!==s)return null;var i=st;return i=_t(e,e===Ot?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Gb(e,i,n),uv(e,le()),e.callbackNode!=null&&e.callbackNode===s?fv.bind(null,e):null)}function dv(e,n){if(bc())return null;Gb(e,n,!0)}function ZC(){uR(function(){(ht&6)!==0?Re(he,QC):cv()})}function rp(){if(ks===0){var e=or;e===0&&(e=bt,bt<<=1,(bt&261888)===0&&(bt=256)),ks=e}return ks}function pv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Al(""+e)}function hv(e,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,e.id&&s.setAttribute("form",e.id),n.parentNode.insertBefore(s,n),e=new FormData(e),s.parentNode.removeChild(s),e}function JC(e,n,s,i,u){if(n==="submit"&&s&&s.stateNode===u){var f=pv((u[mn]||null).action),x=i.submitter;x&&(n=(n=x[mn]||null)?pv(n.formAction):x.getAttribute("formAction"),n!==null&&(f=n,x=null));var R=new jl("action","action",null,i,u);e.push({event:R,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(ks!==0){var F=x?hv(u,x):new FormData(u);Rd(s,{pending:!0,data:F,method:u.method,action:f},null,F)}}else typeof f=="function"&&(R.preventDefault(),F=x?hv(u,x):new FormData(u),Rd(s,{pending:!0,data:F,method:u.method,action:f},f,F))},currentTarget:u}]})}}for(var ip=0;ip<Ff.length;ip++){var lp=Ff[ip],eR=lp.toLowerCase(),tR=lp[0].toUpperCase()+lp.slice(1);io(eR,"on"+tR)}io(qg,"onAnimationEnd"),io(Gg,"onAnimationIteration"),io(Xg,"onAnimationStart"),io("dblclick","onDoubleClick"),io("focusin","onFocus"),io("focusout","onBlur"),io(yC,"onTransitionRun"),io(bC,"onTransitionStart"),io(vC,"onTransitionCancel"),io(Kg,"onTransitionEnd"),Fa("onMouseEnter",["mouseout","mouseover"]),Fa("onMouseLeave",["mouseout","mouseover"]),Fa("onPointerEnter",["pointerout","pointerover"]),Fa("onPointerLeave",["pointerout","pointerover"]),Zs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wi="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(" "),nR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wi));function mv(e,n){n=(n&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],u=i.event;i=i.listeners;e:{var f=void 0;if(n)for(var x=i.length-1;0<=x;x--){var R=i[x],F=R.instance,oe=R.currentTarget;if(R=R.listener,F!==f&&u.isPropagationStopped())break e;f=R,u.currentTarget=oe;try{f(u)}catch(ue){zl(ue)}u.currentTarget=null,f=F}else for(x=0;x<i.length;x++){if(R=i[x],F=R.instance,oe=R.currentTarget,R=R.listener,F!==f&&u.isPropagationStopped())break e;f=R,u.currentTarget=oe;try{f(u)}catch(ue){zl(ue)}u.currentTarget=null,f=F}}}}function nt(e,n){var s=n[Sf];s===void 0&&(s=n[Sf]=new Set);var i=e+"__bubble";s.has(i)||(gv(n,e,2,!1),s.add(i))}function cp(e,n,s){var i=0;n&&(i|=4),gv(s,e,i,n)}var Sc="_reactListening"+Math.random().toString(36).slice(2);function up(e){if(!e[Sc]){e[Sc]=!0,cg.forEach(function(s){s!=="selectionchange"&&(nR.has(s)||cp(s,!1,e),cp(s,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Sc]||(n[Sc]=!0,cp("selectionchange",!1,n))}}function gv(e,n,s,i){switch(qv(n)){case 2:var u=kR;break;case 8:u=MR;break;default:u=Cp}s=u.bind(null,n,s,e),u=void 0,!kf||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(n,s,{capture:!0,passive:u}):e.addEventListener(n,s,!0):u!==void 0?e.addEventListener(n,s,{passive:u}):e.addEventListener(n,s,!1)}function fp(e,n,s,i,u){var f=i;if((n&1)===0&&(n&2)===0&&i!==null)e:for(;;){if(i===null)return;var x=i.tag;if(x===3||x===4){var R=i.stateNode.containerInfo;if(R===u)break;if(x===4)for(x=i.return;x!==null;){var F=x.tag;if((F===3||F===4)&&x.stateNode.containerInfo===u)return;x=x.return}for(;R!==null;){if(x=Ua(R),x===null)return;if(F=x.tag,F===5||F===6||F===26||F===27){i=f=x;continue e}R=R.parentNode}}i=i.return}Sg(function(){var oe=f,ue=Af(s),de=[];e:{var ae=$g.get(e);if(ae!==void 0){var ie=jl,_e=e;switch(e){case"keypress":if(kl(s)===0)break e;case"keydown":case"keyup":ie=$E;break;case"focusin":_e="focus",ie=Df;break;case"focusout":_e="blur",ie=Df;break;case"beforeblur":case"afterblur":ie=Df;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Eg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=PE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=ZE;break;case qg:case Gg:case Xg:ie=UE;break;case Kg:ie=eC;break;case"scroll":case"scrollend":ie=zE;break;case"wheel":ie=nC;break;case"copy":case"cut":case"paste":ie=VE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Rg;break;case"toggle":case"beforetoggle":ie=sC}var Be=(n&4)!==0,St=!Be&&(e==="scroll"||e==="scrollend"),ee=Be?ae!==null?ae+"Capture":null:ae;Be=[];for(var G=oe,ne;G!==null;){var fe=G;if(ne=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||ne===null||ee===null||(fe=Yr(G,ee),fe!=null&&Be.push(Ti(G,fe,ne))),St)break;G=G.return}0<Be.length&&(ae=new ie(ae,_e,null,s,ue),de.push({event:ae,listeners:Be}))}}if((n&7)===0){e:{if(ae=e==="mouseover"||e==="pointerover",ie=e==="mouseout"||e==="pointerout",ae&&s!==Of&&(_e=s.relatedTarget||s.fromElement)&&(Ua(_e)||_e[Oo]))break e;if((ie||ae)&&(ae=ue.window===ue?ue:(ae=ue.ownerDocument)?ae.defaultView||ae.parentWindow:window,ie?(_e=s.relatedTarget||s.toElement,ie=oe,_e=_e?Ua(_e):null,_e!==null&&(St=c(_e),Be=_e.tag,_e!==St||Be!==5&&Be!==27&&Be!==6)&&(_e=null)):(ie=null,_e=oe),ie!==_e)){if(Be=Eg,fe="onMouseLeave",ee="onMouseEnter",G="mouse",(e==="pointerout"||e==="pointerover")&&(Be=Rg,fe="onPointerLeave",ee="onPointerEnter",G="pointer"),St=ie==null?ae:Fr(ie),ne=_e==null?ae:Fr(_e),ae=new Be(fe,G+"leave",ie,s,ue),ae.target=St,ae.relatedTarget=ne,fe=null,Ua(ue)===oe&&(Be=new Be(ee,G+"enter",_e,s,ue),Be.target=ne,Be.relatedTarget=St,fe=Be),St=fe,ie&&_e)t:{for(Be=oR,ee=ie,G=_e,ne=0,fe=ee;fe;fe=Be(fe))ne++;fe=0;for(var Pe=G;Pe;Pe=Be(Pe))fe++;for(;0<ne-fe;)ee=Be(ee),ne--;for(;0<fe-ne;)G=Be(G),fe--;for(;ne--;){if(ee===G||G!==null&&ee===G.alternate){Be=ee;break t}ee=Be(ee),G=Be(G)}Be=null}else Be=null;ie!==null&&yv(de,ae,ie,Be,!1),_e!==null&&St!==null&&yv(de,St,_e,Be,!0)}}e:{if(ae=oe?Fr(oe):window,ie=ae.nodeName&&ae.nodeName.toLowerCase(),ie==="select"||ie==="input"&&ae.type==="file")var dt=Dg;else if(jg(ae))if(zg)dt=hC;else{dt=dC;var ze=fC}else ie=ae.nodeName,!ie||ie.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?oe&&Rf(oe.elementType)&&(dt=Dg):dt=pC;if(dt&&(dt=dt(e,oe))){_g(de,dt,s,ue);break e}ze&&ze(e,ae,oe),e==="focusout"&&oe&&ae.type==="number"&&oe.memoizedProps.value!=null&&Cf(ae,"number",ae.value)}switch(ze=oe?Fr(oe):window,e){case"focusin":(jg(ze)||ze.contentEditable==="true")&&($a=ze,Uf=oe,Zr=null);break;case"focusout":Zr=Uf=$a=null;break;case"mousedown":Bf=!0;break;case"contextmenu":case"mouseup":case"dragend":Bf=!1,Fg(de,s,ue);break;case"selectionchange":if(gC)break;case"keydown":case"keyup":Fg(de,s,ue)}var $e;if(Lf)e:{switch(e){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else Ka?kg(e,s)&&(at="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(at="onCompositionStart");at&&(Og&&s.locale!=="ko"&&(Ka||at!=="onCompositionStart"?at==="onCompositionEnd"&&Ka&&($e=wg()):(hs=ue,Mf="value"in hs?hs.value:hs.textContent,Ka=!0)),ze=wc(oe,at),0<ze.length&&(at=new Cg(at,e,null,s,ue),de.push({event:at,listeners:ze}),$e?at.data=$e:($e=Mg(s),$e!==null&&(at.data=$e)))),($e=rC?iC(e,s):lC(e,s))&&(at=wc(oe,"onBeforeInput"),0<at.length&&(ze=new Cg("onBeforeInput","beforeinput",null,s,ue),de.push({event:ze,listeners:at}),ze.data=$e)),JC(de,e,oe,s,ue)}mv(de,n)})}function Ti(e,n,s){return{instance:e,listener:n,currentTarget:s}}function wc(e,n){for(var s=n+"Capture",i=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Yr(e,s),u!=null&&i.unshift(Ti(e,u,f)),u=Yr(e,n),u!=null&&i.push(Ti(e,u,f))),e.tag===3)return i;e=e.return}return[]}function oR(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function yv(e,n,s,i,u){for(var f=n._reactName,x=[];s!==null&&s!==i;){var R=s,F=R.alternate,oe=R.stateNode;if(R=R.tag,F!==null&&F===i)break;R!==5&&R!==26&&R!==27||oe===null||(F=oe,u?(oe=Yr(s,f),oe!=null&&x.unshift(Ti(s,oe,F))):u||(oe=Yr(s,f),oe!=null&&x.push(Ti(s,oe,F)))),s=s.return}x.length!==0&&e.push({event:n,listeners:x})}var sR=/\r\n?/g,aR=/\u0000|\uFFFD/g;function bv(e){return(typeof e=="string"?e:""+e).replace(sR,`
|
|
9
|
-
`).replace(aR,"")}function vv(e,n){return n=bv(n),bv(e)===n}function xt(e,n,s,i,u,f){switch(s){case"children":typeof i=="string"?n==="body"||n==="textarea"&&i===""||qa(e,i):(typeof i=="number"||typeof i=="bigint")&&n!=="body"&&qa(e,""+i);break;case"className":Rl(e,"class",i);break;case"tabIndex":Rl(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Rl(e,s,i);break;case"style":vg(e,i,f);break;case"data":if(n!=="object"){Rl(e,"data",i);break}case"src":case"href":if(i===""&&(n!=="a"||s!=="href")){e.removeAttribute(s);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Al(""+i),e.setAttribute(s,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(s,"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 f=="function"&&(s==="formAction"?(n!=="input"&&xt(e,n,"name",u.name,u,null),xt(e,n,"formEncType",u.formEncType,u,null),xt(e,n,"formMethod",u.formMethod,u,null),xt(e,n,"formTarget",u.formTarget,u,null)):(xt(e,n,"encType",u.encType,u,null),xt(e,n,"method",u.method,u,null),xt(e,n,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Al(""+i),e.setAttribute(s,i);break;case"onClick":i!=null&&(e.onclick=No);break;case"onScroll":i!=null&&nt("scroll",e);break;case"onScrollEnd":i!=null&&nt("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(r(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=s}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}s=Al(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""+i):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":i===!0?e.setAttribute(s,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(s,i):e.removeAttribute(s);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(s):e.setAttribute(s,i);break;case"popover":nt("beforetoggle",e),nt("toggle",e),Cl(e,"popover",i);break;case"xlinkActuate":Ao(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Ao(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Ao(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Ao(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Ao(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Ao(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Ao(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Ao(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Ao(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Cl(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=_E.get(s)||s,Cl(e,s,i))}}function dp(e,n,s,i,u,f){switch(s){case"style":vg(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(r(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=s}}break;case"children":typeof i=="string"?qa(e,i):(typeof i=="number"||typeof i=="bigint")&&qa(e,""+i);break;case"onScroll":i!=null&&nt("scroll",e);break;case"onScrollEnd":i!=null&&nt("scrollend",e);break;case"onClick":i!=null&&(e.onclick=No);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ug.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),n=s.slice(2,u?s.length-7:void 0),f=e[mn]||null,f=f!=null?f[s]:null,typeof f=="function"&&e.removeEventListener(n,f,u),typeof i=="function")){typeof f!="function"&&f!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(n,i,u);break e}s in e?e[s]=i:i===!0?e.setAttribute(s,""):Cl(e,s,i)}}}function dn(e,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",e),nt("load",e);var i=!1,u=!1,f;for(f in s)if(s.hasOwnProperty(f)){var x=s[f];if(x!=null)switch(f){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:xt(e,n,f,x,s,null)}}u&&xt(e,n,"srcSet",s.srcSet,s,null),i&&xt(e,n,"src",s.src,s,null);return;case"input":nt("invalid",e);var R=f=x=u=null,F=null,oe=null;for(i in s)if(s.hasOwnProperty(i)){var ue=s[i];if(ue!=null)switch(i){case"name":u=ue;break;case"type":x=ue;break;case"checked":F=ue;break;case"defaultChecked":oe=ue;break;case"value":f=ue;break;case"defaultValue":R=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,n));break;default:xt(e,n,i,ue,s,null)}}mg(e,f,R,F,oe,x,u,!1);return;case"select":nt("invalid",e),i=x=f=null;for(u in s)if(s.hasOwnProperty(u)&&(R=s[u],R!=null))switch(u){case"value":f=R;break;case"defaultValue":x=R;break;case"multiple":i=R;default:xt(e,n,u,R,s,null)}n=f,s=x,e.multiple=!!i,n!=null?Ya(e,!!i,n,!1):s!=null&&Ya(e,!!i,s,!0);return;case"textarea":nt("invalid",e),f=u=i=null;for(x in s)if(s.hasOwnProperty(x)&&(R=s[x],R!=null))switch(x){case"value":i=R;break;case"defaultValue":u=R;break;case"children":f=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(r(91));break;default:xt(e,n,x,R,s,null)}yg(e,i,u,f);return;case"option":for(F in s)s.hasOwnProperty(F)&&(i=s[F],i!=null)&&(F==="selected"?e.selected=i&&typeof i!="function"&&typeof i!="symbol":xt(e,n,F,i,s,null));return;case"dialog":nt("beforetoggle",e),nt("toggle",e),nt("cancel",e),nt("close",e);break;case"iframe":case"object":nt("load",e);break;case"video":case"audio":for(i=0;i<wi.length;i++)nt(wi[i],e);break;case"image":nt("error",e),nt("load",e);break;case"details":nt("toggle",e);break;case"embed":case"source":case"link":nt("error",e),nt("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(oe in s)if(s.hasOwnProperty(oe)&&(i=s[oe],i!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:xt(e,n,oe,i,s,null)}return;default:if(Rf(n)){for(ue in s)s.hasOwnProperty(ue)&&(i=s[ue],i!==void 0&&dp(e,n,ue,i,s,void 0));return}}for(R in s)s.hasOwnProperty(R)&&(i=s[R],i!=null&&xt(e,n,R,i,s,null))}function rR(e,n,s,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,x=null,R=null,F=null,oe=null,ue=null;for(ie in s){var de=s[ie];if(s.hasOwnProperty(ie)&&de!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":F=de;default:i.hasOwnProperty(ie)||xt(e,n,ie,null,i,de)}}for(var ae in i){var ie=i[ae];if(de=s[ae],i.hasOwnProperty(ae)&&(ie!=null||de!=null))switch(ae){case"type":f=ie;break;case"name":u=ie;break;case"checked":oe=ie;break;case"defaultChecked":ue=ie;break;case"value":x=ie;break;case"defaultValue":R=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,n));break;default:ie!==de&&xt(e,n,ae,ie,i,de)}}Ef(e,x,R,F,oe,ue,f,u);return;case"select":ie=x=R=ae=null;for(f in s)if(F=s[f],s.hasOwnProperty(f)&&F!=null)switch(f){case"value":break;case"multiple":ie=F;default:i.hasOwnProperty(f)||xt(e,n,f,null,i,F)}for(u in i)if(f=i[u],F=s[u],i.hasOwnProperty(u)&&(f!=null||F!=null))switch(u){case"value":ae=f;break;case"defaultValue":R=f;break;case"multiple":x=f;default:f!==F&&xt(e,n,u,f,i,F)}n=R,s=x,i=ie,ae!=null?Ya(e,!!s,ae,!1):!!i!=!!s&&(n!=null?Ya(e,!!s,n,!0):Ya(e,!!s,s?[]:"",!1));return;case"textarea":ie=ae=null;for(R in s)if(u=s[R],s.hasOwnProperty(R)&&u!=null&&!i.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:xt(e,n,R,null,i,u)}for(x in i)if(u=i[x],f=s[x],i.hasOwnProperty(x)&&(u!=null||f!=null))switch(x){case"value":ae=u;break;case"defaultValue":ie=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(r(91));break;default:u!==f&&xt(e,n,x,u,i,f)}gg(e,ae,ie);return;case"option":for(var _e in s)ae=s[_e],s.hasOwnProperty(_e)&&ae!=null&&!i.hasOwnProperty(_e)&&(_e==="selected"?e.selected=!1:xt(e,n,_e,null,i,ae));for(F in i)ae=i[F],ie=s[F],i.hasOwnProperty(F)&&ae!==ie&&(ae!=null||ie!=null)&&(F==="selected"?e.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":xt(e,n,F,ae,i,ie));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 Be in s)ae=s[Be],s.hasOwnProperty(Be)&&ae!=null&&!i.hasOwnProperty(Be)&&xt(e,n,Be,null,i,ae);for(oe in i)if(ae=i[oe],ie=s[oe],i.hasOwnProperty(oe)&&ae!==ie&&(ae!=null||ie!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,n));break;default:xt(e,n,oe,ae,i,ie)}return;default:if(Rf(n)){for(var St in s)ae=s[St],s.hasOwnProperty(St)&&ae!==void 0&&!i.hasOwnProperty(St)&&dp(e,n,St,void 0,i,ae);for(ue in i)ae=i[ue],ie=s[ue],!i.hasOwnProperty(ue)||ae===ie||ae===void 0&&ie===void 0||dp(e,n,ue,ae,i,ie);return}}for(var ee in s)ae=s[ee],s.hasOwnProperty(ee)&&ae!=null&&!i.hasOwnProperty(ee)&&xt(e,n,ee,null,i,ae);for(de in i)ae=i[de],ie=s[de],!i.hasOwnProperty(de)||ae===ie||ae==null&&ie==null||xt(e,n,de,ae,i,ie)}function xv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iR(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,s=performance.getEntriesByType("resource"),i=0;i<s.length;i++){var u=s[i],f=u.transferSize,x=u.initiatorType,R=u.duration;if(f&&R&&xv(x)){for(x=0,R=u.responseEnd,i+=1;i<s.length;i++){var F=s[i],oe=F.startTime;if(oe>R)break;var ue=F.transferSize,de=F.initiatorType;ue&&xv(de)&&(F=F.responseEnd,x+=ue*(F<R?1:(R-oe)/(F-oe)))}if(--i,n+=8*(f+x)/(u.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var pp=null,hp=null;function Tc(e){return e.nodeType===9?e:e.ownerDocument}function Sv(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 wv(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function mp(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var gp=null;function lR(){var e=window.event;return e&&e.type==="popstate"?e===gp?!1:(gp=e,!0):(gp=null,!1)}var Tv=typeof setTimeout=="function"?setTimeout:void 0,cR=typeof clearTimeout=="function"?clearTimeout:void 0,Ev=typeof Promise=="function"?Promise:void 0,uR=typeof queueMicrotask=="function"?queueMicrotask:typeof Ev<"u"?function(e){return Ev.resolve(null).then(e).catch(fR)}:Tv;function fR(e){setTimeout(function(){throw e})}function Ms(e){return e==="head"}function Cv(e,n){var s=n,i=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(i===0){e.removeChild(u),wr(n);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")Ei(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Ei(s);for(var f=s.firstChild;f;){var x=f.nextSibling,R=f.nodeName;f[Vr]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=x}}else s==="body"&&Ei(e.ownerDocument.body);s=u}while(s);wr(n)}function Rv(e,n){var s=e;e=0;do{var i=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),i&&i.nodeType===8)if(s=i.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=i}while(s)}function yp(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":yp(s),wf(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function dR(e,n,s,i){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Vr])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Zn(e.nextSibling),e===null)break}return null}function pR(e,n,s){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Zn(e.nextSibling),e===null))return null;return e}function Ov(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Zn(e.nextSibling),e===null))return null;return e}function bp(e){return e.data==="$?"||e.data==="$~"}function vp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function hR(e,n){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||s.readyState!=="loading")n();else{var i=function(){n(),s.removeEventListener("DOMContentLoaded",i)};s.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Zn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var xp=null;function Av(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(n===0)return Zn(e.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}e=e.nextSibling}return null}function Nv(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return e;n--}else s!=="/$"&&s!=="/&"||n++}e=e.previousSibling}return null}function kv(e,n,s){switch(n=Tc(s),e){case"html":if(e=n.documentElement,!e)throw Error(r(452));return e;case"head":if(e=n.head,!e)throw Error(r(453));return e;case"body":if(e=n.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function Ei(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);wf(e)}var Jn=new Map,Mv=new Set;function Ec(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var qo=q.d;q.d={f:mR,r:gR,D:yR,C:bR,L:vR,m:xR,X:wR,S:SR,M:TR};function mR(){var e=qo.f(),n=mc();return e||n}function gR(e){var n=Ba(e);n!==null&&n.tag===5&&n.type==="form"?Ky(n):qo.r(e)}var vr=typeof document>"u"?null:document;function jv(e,n,s){var i=vr;if(i&&typeof n=="string"&&n){var u=qn(n);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),Mv.has(u)||(Mv.add(u),e={rel:e,crossOrigin:s,href:n},i.querySelector(u)===null&&(n=i.createElement("link"),dn(n,"link",e),on(n),i.head.appendChild(n)))}}function yR(e){qo.D(e),jv("dns-prefetch",e,null)}function bR(e,n){qo.C(e,n),jv("preconnect",e,n)}function vR(e,n,s){qo.L(e,n,s);var i=vr;if(i&&e&&n){var u='link[rel="preload"][as="'+qn(n)+'"]';n==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+qn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+qn(s.imageSizes)+'"]')):u+='[href="'+qn(e)+'"]';var f=u;switch(n){case"style":f=xr(e);break;case"script":f=Sr(e)}Jn.has(f)||(e=v({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:e,as:n},s),Jn.set(f,e),i.querySelector(u)!==null||n==="style"&&i.querySelector(Ci(f))||n==="script"&&i.querySelector(Ri(f))||(n=i.createElement("link"),dn(n,"link",e),on(n),i.head.appendChild(n)))}}function xR(e,n){qo.m(e,n);var s=vr;if(s&&e){var i=n&&typeof n.as=="string"?n.as:"script",u='link[rel="modulepreload"][as="'+qn(i)+'"][href="'+qn(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Sr(e)}if(!Jn.has(f)&&(e=v({rel:"modulepreload",href:e},n),Jn.set(f,e),s.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Ri(f)))return}i=s.createElement("link"),dn(i,"link",e),on(i),s.head.appendChild(i)}}}function SR(e,n,s){qo.S(e,n,s);var i=vr;if(i&&e){var u=Va(i).hoistableStyles,f=xr(e);n=n||"default";var x=u.get(f);if(!x){var R={loading:0,preload:null};if(x=i.querySelector(Ci(f)))R.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":n},s),(s=Jn.get(f))&&Sp(e,s);var F=x=i.createElement("link");on(F),dn(F,"link",e),F._p=new Promise(function(oe,ue){F.onload=oe,F.onerror=ue}),F.addEventListener("load",function(){R.loading|=1}),F.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Cc(x,n,i)}x={type:"stylesheet",instance:x,count:1,state:R},u.set(f,x)}}}function wR(e,n){qo.X(e,n);var s=vr;if(s&&e){var i=Va(s).hoistableScripts,u=Sr(e),f=i.get(u);f||(f=s.querySelector(Ri(u)),f||(e=v({src:e,async:!0},n),(n=Jn.get(u))&&wp(e,n),f=s.createElement("script"),on(f),dn(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function TR(e,n){qo.M(e,n);var s=vr;if(s&&e){var i=Va(s).hoistableScripts,u=Sr(e),f=i.get(u);f||(f=s.querySelector(Ri(u)),f||(e=v({src:e,async:!0,type:"module"},n),(n=Jn.get(u))&&wp(e,n),f=s.createElement("script"),on(f),dn(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function _v(e,n,s,i){var u=(u=re.current)?Ec(u):null;if(!u)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=xr(s.href),s=Va(u).hoistableStyles,i=s.get(n),i||(i={type:"style",instance:null,count:0,state:null},s.set(n,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=xr(s.href);var f=Va(u).hoistableStyles,x=f.get(e);if(x||(u=u.ownerDocument||u,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,x),(f=u.querySelector(Ci(e)))&&!f._p&&(x.instance=f,x.state.loading=5),Jn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Jn.set(e,s),f||ER(u,e,s,x.state))),n&&i===null)throw Error(r(528,""));return x}if(n&&i!==null)throw Error(r(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Sr(s),s=Va(u).hoistableScripts,i=s.get(n),i||(i={type:"script",instance:null,count:0,state:null},s.set(n,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function xr(e){return'href="'+qn(e)+'"'}function Ci(e){return'link[rel="stylesheet"]['+e+"]"}function Dv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function ER(e,n,s,i){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?i.loading=1:(n=e.createElement("link"),i.preload=n,n.addEventListener("load",function(){return i.loading|=1}),n.addEventListener("error",function(){return i.loading|=2}),dn(n,"link",s),on(n),e.head.appendChild(n))}function Sr(e){return'[src="'+qn(e)+'"]'}function Ri(e){return"script[async]"+e}function zv(e,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var i=e.querySelector('style[data-href~="'+qn(s.href)+'"]');if(i)return n.instance=i,on(i),i;var u=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),on(i),dn(i,"style",u),Cc(i,s.precedence,e),n.instance=i;case"stylesheet":u=xr(s.href);var f=e.querySelector(Ci(u));if(f)return n.state.loading|=4,n.instance=f,on(f),f;i=Dv(s),(u=Jn.get(u))&&Sp(i,u),f=(e.ownerDocument||e).createElement("link"),on(f);var x=f;return x._p=new Promise(function(R,F){x.onload=R,x.onerror=F}),dn(f,"link",i),n.state.loading|=4,Cc(f,s.precedence,e),n.instance=f;case"script":return f=Sr(s.src),(u=e.querySelector(Ri(f)))?(n.instance=u,on(u),u):(i=s,(u=Jn.get(f))&&(i=v({},s),wp(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),on(u),dn(u,"link",i),e.head.appendChild(u),n.instance=u);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(i=n.instance,n.state.loading|=4,Cc(i,s.precedence,e));return n.instance}function Cc(e,n,s){for(var i=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,f=u,x=0;x<i.length;x++){var R=i[x];if(R.dataset.precedence===n)f=R;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(e,n.firstChild))}function Sp(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function wp(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Rc=null;function Lv(e,n,s){if(Rc===null){var i=new Map,u=Rc=new Map;u.set(s,i)}else u=Rc,i=u.get(s),i||(i=new Map,u.set(s,i));if(i.has(e))return i;for(i.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var f=s[u];if(!(f[Vr]||f[Yt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var x=f.getAttribute(n)||"";x=e+x;var R=i.get(x);R?R.push(f):i.set(x,[f])}}return i}function Pv(e,n,s){e=e.ownerDocument||e,e.head.insertBefore(s,n==="title"?e.querySelector("head > title"):null)}function CR(e,n,s){if(s===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Iv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function RR(e,n,s,i){if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=xr(i.href),f=n.querySelector(Ci(u));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Oc.bind(e),n.then(e,e)),s.state.loading|=4,s.instance=f,on(f);return}f=n.ownerDocument||n,i=Dv(i),(u=Jn.get(u))&&Sp(i,u),f=f.createElement("link"),on(f);var x=f;x._p=new Promise(function(R,F){x.onload=R,x.onerror=F}),dn(f,"link",i),s.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Oc.bind(e),n.addEventListener("load",s),n.addEventListener("error",s))}}var Tp=0;function OR(e,n){return e.stylesheets&&e.count===0&&Nc(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var i=setTimeout(function(){if(e.stylesheets&&Nc(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+n);0<e.imgBytes&&Tp===0&&(Tp=62500*iR());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Nc(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Tp?50:800)+n);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function Oc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ac=null;function Nc(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ac=new Map,n.forEach(AR,e),Ac=null,Oc.call(e))}function AR(e,n){if(!(n.state.loading&4)){var s=Ac.get(e);if(s)var i=s.get(null);else{s=new Map,Ac.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var x=u[f];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(s.set(x.dataset.precedence,x),i=x)}i&&s.set(null,i)}u=n.instance,x=u.getAttribute("data-precedence"),f=s.get(x)||i,f===i&&s.set(null,u),s.set(x,u),this.count++,i=Oc.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),n.state.loading|=4}}var Oi={$$typeof:k,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function NR(e,n,s,i,u,f,x,R,F){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=yo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yo(0),this.hiddenUpdates=yo(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function Hv(e,n,s,i,u,f,x,R,F,oe,ue,de){return e=new NR(e,n,s,x,F,oe,ue,de,R),n=1,f===!0&&(n|=24),f=_n(3,null,null,n),e.current=f,f.stateNode=e,n=nd(),n.refCount++,e.pooledCache=n,n.refCount++,f.memoizedState={element:i,isDehydrated:s,cache:n},rd(f),e}function Uv(e){return e?(e=Za,e):Za}function Bv(e,n,s,i,u,f){u=Uv(u),i.context===null?i.context=u:i.pendingContext=u,i=xs(n),i.payload={element:s},f=f===void 0?null:f,f!==null&&(i.callback=f),s=Ss(e,i,n),s!==null&&(Cn(s,e,n),ai(s,e,n))}function Vv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<n?s:n}}function Ep(e,n){Vv(e,n),(e=e.alternate)&&Vv(e,n)}function Fv(e){if(e.tag===13||e.tag===31){var n=na(e,67108864);n!==null&&Cn(n,e,67108864),Ep(e,67108864)}}function Yv(e){if(e.tag===13||e.tag===31){var n=In();n=Mn(n);var s=na(e,n);s!==null&&Cn(s,e,n),Ep(e,n)}}var kc=!0;function kR(e,n,s,i){var u=P.T;P.T=null;var f=q.p;try{q.p=2,Cp(e,n,s,i)}finally{q.p=f,P.T=u}}function MR(e,n,s,i){var u=P.T;P.T=null;var f=q.p;try{q.p=8,Cp(e,n,s,i)}finally{q.p=f,P.T=u}}function Cp(e,n,s,i){if(kc){var u=Rp(i);if(u===null)fp(e,n,i,Mc,s),Gv(e,i);else if(_R(u,e,n,s,i))i.stopPropagation();else if(Gv(e,i),n&4&&-1<jR.indexOf(e)){for(;u!==null;){var f=Ba(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var x=ft(f.pendingLanes);if(x!==0){var R=f;for(R.pendingLanes|=2,R.entangledLanes|=2;x;){var F=1<<31-ct(x);R.entanglements[1]|=F,x&=~F}wo(f),(ht&6)===0&&(pc=le()+500,Si(0))}}break;case 31:case 13:R=na(f,2),R!==null&&Cn(R,f,2),mc(),Ep(f,2)}if(f=Rp(i),f===null&&fp(e,n,i,Mc,s),f===u)break;u=f}u!==null&&i.stopPropagation()}else fp(e,n,i,null,s)}}function Rp(e){return e=Af(e),Op(e)}var Mc=null;function Op(e){if(Mc=null,e=Ua(e),e!==null){var n=c(e);if(n===null)e=null;else{var s=n.tag;if(s===13){if(e=d(n),e!==null)return e;e=null}else if(s===31){if(e=g(n),e!==null)return e;e=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Mc=e,null}function qv(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"resize":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"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"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ve()){case he:return 2;case ce:return 8;case xe:case He:return 32;case Lt:return 268435456;default:return 32}default:return 32}}var Ap=!1,js=null,_s=null,Ds=null,Ai=new Map,Ni=new Map,zs=[],jR="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 Gv(e,n){switch(e){case"focusin":case"focusout":js=null;break;case"dragenter":case"dragleave":_s=null;break;case"mouseover":case"mouseout":Ds=null;break;case"pointerover":case"pointerout":Ai.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ni.delete(n.pointerId)}}function ki(e,n,s,i,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:n,domEventName:s,eventSystemFlags:i,nativeEvent:f,targetContainers:[u]},n!==null&&(n=Ba(n),n!==null&&Fv(n)),e):(e.eventSystemFlags|=i,n=e.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),e)}function _R(e,n,s,i,u){switch(n){case"focusin":return js=ki(js,e,n,s,i,u),!0;case"dragenter":return _s=ki(_s,e,n,s,i,u),!0;case"mouseover":return Ds=ki(Ds,e,n,s,i,u),!0;case"pointerover":var f=u.pointerId;return Ai.set(f,ki(Ai.get(f)||null,e,n,s,i,u)),!0;case"gotpointercapture":return f=u.pointerId,Ni.set(f,ki(Ni.get(f)||null,e,n,s,i,u)),!0}return!1}function Xv(e){var n=Ua(e.target);if(n!==null){var s=c(n);if(s!==null){if(n=s.tag,n===13){if(n=d(s),n!==null){e.blockedOn=n,ps(e.priority,function(){Yv(s)});return}}else if(n===31){if(n=g(s),n!==null){e.blockedOn=n,ps(e.priority,function(){Yv(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var s=Rp(e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);Of=i,s.target.dispatchEvent(i),Of=null}else return n=Ba(s),n!==null&&Fv(n),e.blockedOn=s,!1;n.shift()}return!0}function Kv(e,n,s){jc(e)&&s.delete(n)}function DR(){Ap=!1,js!==null&&jc(js)&&(js=null),_s!==null&&jc(_s)&&(_s=null),Ds!==null&&jc(Ds)&&(Ds=null),Ai.forEach(Kv),Ni.forEach(Kv)}function _c(e,n){e.blockedOn===n&&(e.blockedOn=null,Ap||(Ap=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,DR)))}var Dc=null;function $v(e){Dc!==e&&(Dc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Dc===e&&(Dc=null);for(var n=0;n<e.length;n+=3){var s=e[n],i=e[n+1],u=e[n+2];if(typeof i!="function"){if(Op(i||s)===null)continue;break}var f=Ba(s);f!==null&&(e.splice(n,3),n-=3,Rd(f,{pending:!0,data:u,method:s.method,action:i},i,u))}}))}function wr(e){function n(F){return _c(F,e)}js!==null&&_c(js,e),_s!==null&&_c(_s,e),Ds!==null&&_c(Ds,e),Ai.forEach(n),Ni.forEach(n);for(var s=0;s<zs.length;s++){var i=zs[s];i.blockedOn===e&&(i.blockedOn=null)}for(;0<zs.length&&(s=zs[0],s.blockedOn===null);)Xv(s),s.blockedOn===null&&zs.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(i=0;i<s.length;i+=3){var u=s[i],f=s[i+1],x=u[mn]||null;if(typeof f=="function")x||$v(s);else if(x){var R=null;if(f&&f.hasAttribute("formAction")){if(u=f,x=f[mn]||null)R=x.formAction;else if(Op(u)!==null)continue}else R=x.action;typeof R=="function"?s[i+1]=R:(s.splice(i,3),i-=3),$v(s)}}}function Wv(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(x){return u=x})},focusReset:"manual",scroll:"manual"})}function n(){u!==null&&(u(),u=null),i||setTimeout(s,20)}function s(){if(!i&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),u!==null&&(u(),u=null)}}}function Np(e){this._internalRoot=e}zc.prototype.render=Np.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));var s=n.current,i=In();Bv(s,i,e,n,null,null)},zc.prototype.unmount=Np.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Bv(e.current,2,null,e,null,null),mc(),n[Oo]=null}};function zc(e){this._internalRoot=e}zc.prototype.unstable_scheduleHydration=function(e){if(e){var n=bo();e={blockedOn:null,target:e,priority:n};for(var s=0;s<zs.length&&n!==0&&n<zs[s].priority;s++);zs.splice(s,0,e),s===0&&Xv(e)}};var Qv=o.version;if(Qv!=="19.2.4")throw Error(r(527,Qv,"19.2.4"));q.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=h(n),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var zR={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lc.isDisabled&&Lc.supportsFiber)try{Oe=Lc.inject(zR),Ye=Lc}catch{}}return ji.createRoot=function(e,n){if(!l(e))throw Error(r(299));var s=!1,i="",u=sb,f=ab,x=rb;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError)),n=Hv(e,1,!1,null,null,s,i,null,u,f,x,Wv),e[Oo]=n.current,up(e),new Np(n)},ji.hydrateRoot=function(e,n,s){if(!l(e))throw Error(r(299));var i=!1,u="",f=sb,x=ab,R=rb,F=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(R=s.onRecoverableError),s.formState!==void 0&&(F=s.formState)),n=Hv(e,1,!0,n,s??null,i,u,F,f,x,R,Wv),n.context=Uv(null),s=n.current,i=In(),i=Mn(i),u=xs(i),u.callback=null,Ss(s,u,i),s=i,n.current.lanes=s,vn(n,s),wo(n),e[Oo]=n.current,up(e),new zc(n)},ji.version="19.2.4",ji}var ix;function XR(){if(ix)return jp.exports;ix=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(o){console.error(o)}}return t(),jp.exports=GR(),jp.exports}var KR=XR();function oS(t){var o,a,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var l=t.length;for(o=0;o<l;o++)t[o]&&(a=oS(t[o]))&&(r&&(r+=" "),r+=a)}else for(a in t)t[a]&&(r&&(r+=" "),r+=a);return r}function $R(){for(var t,o,a=0,r="",l=arguments.length;a<l;a++)(t=arguments[a])&&(o=oS(t))&&(r&&(r+=" "),r+=o);return r}function lt(...t){return $R(t)}const lx={};function Qt(t,o){const a=b.useRef(lx);return a.current===lx&&(a.current=t(o)),a}const uh=[];let fh;function WR(){return fh}function QR(t){uh.push(t)}function il(t){const o=(a,r)=>{const l=Qt(ZR).current;let c;try{fh=l;for(const d of uh)d.before(l);c=t(a,r);for(const d of uh)d.after(l);l.didInitialize=!0}finally{fh=void 0}return c};return o.displayName=t.displayName||t.name,o}function Fh(t){return b.forwardRef(il(t))}function ZR(){return{didInitialize:!1}}function It(){}const po=Object.freeze([]),Tt=Object.freeze({}),JR=()=>{},we=typeof document<"u"?b.useLayoutEffect:JR;function eO(t,o){return function(r,...l){const c=new URL(t);return c.searchParams.set("code",r.toString()),l.forEach(d=>c.searchParams.append("args[]",d)),`${o} error #${r}; visit ${c} for the full message.`}}const At=eO("https://base-ui.com/production-error","Base UI"),sS=b.createContext(void 0);function Tu(t){const o=b.useContext(sS);if(o===void 0&&!t)throw new Error(At(72));return o}function Eu(t){b.useEffect(t,po)}const _i=0;class An{static create(){return new An}currentId=_i;start(o,a){this.clear(),this.currentId=setTimeout(()=>{this.currentId=_i,a()},o)}isStarted(){return this.currentId!==_i}clear=()=>{this.currentId!==_i&&(clearTimeout(this.currentId),this.currentId=_i)};disposeEffect=()=>this.clear}function nn(){const t=Qt(An.create).current;return Eu(t.disposeEffect),t}function tO(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:nO,platform:oO,maxTouchPoints:sO}=tO(),Cu=nO.toLowerCase(),$i=oO.toLowerCase(),Ru=/^i(os$|p)/.test($i)||$i==="macintel"&&sO>1,cx="android",dh=$i===cx||Cu.includes(cx),Yh=!Ru&&$i.startsWith("mac");$i.startsWith("win");const aO=Yh||Ru,cs=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!cs&&Cu.includes("firefox");!cs&&Cu.includes("chrom");const aS=aO,qh=/jsdom|happydom/.test(Cu);function To(t){t.preventDefault(),t.stopPropagation()}function rO(t){return"nativeEvent"in t}function Ou(t){return t.pointerType===""&&t.isTrusted?!0:dh&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Gh(t){return qh?!1:!dh&&t.width===0&&t.height===0||dh&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function Bs(t,o){const a=["mouse","pen"];return o||a.push("",void 0),a.includes(t)}function iO(t){const o=t.type;return o==="click"||o==="mousedown"||o==="keydown"||o==="keyup"}function Au(){return typeof window<"u"}function pn(t){return Xh(t)?(t.nodeName||"").toLowerCase():"#document"}function Et(t){var o;return(t==null||(o=t.ownerDocument)==null?void 0:o.defaultView)||window}function us(t){var o;return(o=(Xh(t)?t.ownerDocument:t.document)||window.document)==null?void 0:o.documentElement}function Xh(t){return Au()?t instanceof Node||t instanceof Et(t).Node:!1}function Je(t){return Au()?t instanceof Element||t instanceof Et(t).Element:!1}function yt(t){return Au()?t instanceof HTMLElement||t instanceof Et(t).HTMLElement:!1}function Nr(t){return!Au()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Et(t).ShadowRoot}function ll(t){const{overflow:o,overflowX:a,overflowY:r,display:l}=Un(t);return/auto|scroll|overlay|hidden|clip/.test(o+r+a)&&l!=="inline"&&l!=="contents"}function lO(t){return/^(table|td|th)$/.test(pn(t))}function Nu(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const cO=/transform|translate|scale|rotate|perspective|filter/,uO=/paint|layout|strict|content/,ma=t=>!!t&&t!=="none";let Lp;function Kh(t){const o=Je(t)?Un(t):t;return ma(o.transform)||ma(o.translate)||ma(o.scale)||ma(o.rotate)||ma(o.perspective)||!$h()&&(ma(o.backdropFilter)||ma(o.filter))||cO.test(o.willChange||"")||uO.test(o.contain||"")}function fO(t){let o=ts(t);for(;yt(o)&&!Wo(o);){if(Kh(o))return o;if(Nu(o))return null;o=ts(o)}return null}function $h(){return Lp==null&&(Lp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Lp}function Wo(t){return/^(html|body|#document)$/.test(pn(t))}function Un(t){return Et(t).getComputedStyle(t)}function ku(t){return Je(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ts(t){if(pn(t)==="html")return t;const o=t.assignedSlot||t.parentNode||Nr(t)&&t.host||us(t);return Nr(o)?o.host:o}function rS(t){const o=ts(t);return Wo(o)?(t.ownerDocument||t).body:yt(o)&&ll(o)?o:rS(o)}function Wi(t,o,a){var r;o===void 0&&(o=[]),a===void 0&&(a=!0);const l=rS(t),c=l===((r=t.ownerDocument)==null?void 0:r.body),d=Et(l);if(c){const g=ph(d);return o.concat(d,d.visualViewport||[],ll(l)?l:[],g&&a?Wi(g):[])}else return o.concat(l,Wi(l,[],a))}function ph(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function tn(t){let o=t.activeElement;for(;o?.shadowRoot?.activeElement!=null;)o=o.shadowRoot.activeElement;return o}function De(t,o){if(!t||!o)return!1;const a=o.getRootNode?.();if(t.contains(o))return!0;if(a&&Nr(a)){let r=o;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function zt(t){return"composedPath"in t?t.composedPath()[0]??t.target:t.target}const hh="data-base-ui-focusable",iS="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Mu="ArrowLeft",ju="ArrowRight",lS="ArrowUp",Wh="ArrowDown",cS="data-starting-style",dO="data-ending-style",pO={[cS]:""},hO={[dO]:""},cl={transitionStatus(t){return t==="starting"?pO:t==="ending"?hO:null}},mO="data-open",gO="data-closed",yO="data-anchor-hidden",uS="data-popup-open",bO="data-pressed",vO={[uS]:""},xO={[uS]:"",[bO]:""},SO={[mO]:""},wO={[gO]:""},TO={[yO]:""},_u={open(t){return t?vO:null}},nu={open(t){return t?xO:null}},ul={open(t){return t?SO:wO},anchorHidden(t){return t?TO:null}},Du={...ul,...cl},mh="data-trigger-disabled";function ou(t,o){if(!Je(t))return!1;const a=t;if(o.hasElement(a))return!a.hasAttribute(mh);for(const[,r]of o.entries())if(De(r,a))return!r.hasAttribute(mh);return!1}function Pp(t,o){if(o==null)return!1;if("composedPath"in t)return t.composedPath().includes(o);const a=t;return a.target!=null&&o.contains(a.target)}function EO(t){return t.matches("html,body")}function zu(t){return yt(t)&&t.matches(iS)}function CO(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${iS}`)!=null}function gh(t){return t?t.getAttribute("role")==="combobox"&&zu(t):!1}function su(t){if(!t||qh)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function au(t){return t?t.hasAttribute(hh)?t:t.querySelector(`[${hh}]`)||t:null}function RO(t,o){return o!=null&&!Bs(o)?0:typeof t=="function"?t():t}function Ra(t,o,a){const r=RO(t,a);return typeof r=="number"?r:r?.[o]}function ux(t){return typeof t=="function"?t():t}function fS(t,o){return o||t==="click"||t==="mousedown"}function OO(t){return t?.includes("mouse")&&t!=="mousedown"}const ns="none",os="trigger-press",Bt="trigger-hover",Er="trigger-focus",Lu="outside-press",Fi="item-press",dS="close-press",Fs="focus-out",fl="escape-key",ru="list-navigation",pS="cancel-open",Ii="sibling-open",AO="disabled",Pu="imperative-action",NO="window-resize";function qe(t,o,a,r){let l=!1,c=!1;const d=Tt;return{reason:t,event:o??new Event("base-ui"),cancel(){l=!0},allowPropagation(){c=!0},get isCanceled(){return l},get isPropagationAllowed(){return c},trigger:a,...d}}const hS=b.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new An,currentIdRef:{current:null},currentContextRef:{current:null}});function kO(t,o){t.current=o.current}function MO(t){const{children:o,delay:a,timeoutMs:r=0}=t,l=b.useRef(a),c=b.useRef(a),d=b.useRef(null),g=b.useRef(null),m=nn();return we(()=>{if(c.current=a,!d.current){l.current=a;return}l.current={open:Ra(l.current,"open"),close:Ra(a,"close")}},[a,d,l,c]),p.jsx(hS.Provider,{value:b.useMemo(()=>({hasProvider:!0,delayRef:l,initialDelayRef:c,currentIdRef:d,timeoutMs:r,currentContextRef:g,timeout:m}),[r,m]),children:o})}function jO(t,o={open:!1}){const{open:a}=o,r="rootStore"in t?t.rootStore:t,l=r.useState("floatingId"),c=b.useContext(hS),{currentIdRef:d,delayRef:g,timeoutMs:m,initialDelayRef:h,currentContextRef:y,hasProvider:v,timeout:S}=c,[w,T]=b.useState(!1),O=b.useRef(a);return we(()=>{O.current=a},[a]),we(()=>{function A(){y.current?.setIsInstantPhase(!1),d.current=null,y.current=null,g.current=h.current,S.clear()}if(d.current&&!a&&d.current===l){if(T(!1),m){const C=l;return S.start(m,()=>{r.select("open")||d.current&&d.current!==C||A()}),()=>{(O.current||d.current!==C)&&S.clear()}}A()}},[a,l,d,g,m,h,y,S,r]),we(()=>{if(!a)return;const A=y.current,C=d.current;S.clear(),y.current={onOpenChange:r.setOpen,setIsInstantPhase:T},d.current=l,g.current={open:0,close:Ra(h.current,"close")},C!==null&&C!==l?(T(!0),A?.setIsInstantPhase(!0),A?.onOpenChange(!1,qe(ns))):(T(!1),A?.setIsInstantPhase(!1))},[a,l,r,d,g,h,y,S]),we(()=>()=>{if(d.current===l){if(y.current=null,!O.current)return;d.current=null,kO(g,h),S.clear()}},[y,d,g,l,h,S]),b.useMemo(()=>({activeIdRef:d,hasProvider:v,delayRef:g,isInstantPhase:w}),[d,v,g,w])}function Ge(t,o,a,r){return t.addEventListener(o,a,r),()=>{t.removeEventListener(o,a,r)}}function fo(...t){return()=>{for(let o=0;o<t.length;o+=1){const a=t[o];a&&a()}}}function ss(t,o,a,r){const l=Qt(mS).current;return DO(l,t,o,a,r)&&gS(l,[t,o,a,r]),l.callback}function _O(t){const o=Qt(mS).current;return zO(o,t)&&gS(o,t),o.callback}function mS(){return{callback:null,cleanup:null,refs:[]}}function DO(t,o,a,r,l){return t.refs[0]!==o||t.refs[1]!==a||t.refs[2]!==r||t.refs[3]!==l}function zO(t,o){return t.refs.length!==o.length||t.refs.some((a,r)=>a!==o[r])}function gS(t,o){if(t.refs=o,o.every(a=>a==null)){t.callback=null;return}t.callback=a=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),a!=null){const r=Array(o.length).fill(null);for(let l=0;l<o.length;l+=1){const c=o[l];if(c!=null)switch(typeof c){case"function":{const d=c(a);typeof d=="function"&&(r[l]=d);break}case"object":{c.current=a;break}}}t.cleanup=()=>{for(let l=0;l<o.length;l+=1){const c=o[l];if(c!=null)switch(typeof c){case"function":{const d=r[l];typeof d=="function"?d():c(null);break}case"object":{c.current=null;break}}}}}}}function Vt(t){const o=Qt(LO,t).current;return o.next=t,we(o.effect),o}function LO(t){const o={current:t,next:t,effect:()=>{o.current=o.next}};return o}const Qh={...VR},Ip=Qh.useInsertionEffect,PO=Ip&&Ip!==Qh.useLayoutEffect?Ip:t=>t();function ke(t){const o=Qt(IO).current;return o.next=t,PO(o.effect),o.trampoline}function IO(){const t={next:void 0,callback:HO,trampoline:(...o)=>t.callback?.(...o),effect:()=>{t.callback=t.next}};return t}function HO(){}const Pc=null;class UO{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=o=>{this.isScheduled=!1;const a=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let l=0;l<a.length;l+=1)a[l]?.(o)};request(o){const a=this.nextId;return this.nextId+=1,this.callbacks.push(o),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),a}cancel(o){const a=o-this.startId;a<0||a>=this.callbacks.length||this.callbacks[a]!==null&&(this.callbacks[a]=null,this.callbacksCount-=1)}}let Ic=new UO;class Eo{static create(){return new Eo}static request(o){return Ic.request(o)}static cancel(o){return Ic.cancel(o)}currentId=Pc;request(o){this.cancel(),this.currentId=Ic.request(()=>{this.currentId=Pc,o()})}cancel=()=>{this.currentId!==Pc&&(Ic.cancel(this.currentId),this.currentId=Pc)};disposeEffect=()=>this.cancel}function kr(){const t=Qt(Eo.create).current;return Eu(t.disposeEffect),t}function We(t){return t?.ownerDocument||document}const yS={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Iu={...yS,position:"fixed",top:0,left:0},bS={...yS,position:"absolute"},as=b.forwardRef(function(o,a){const[r,l]=b.useState();we(()=>{aS&&cs&&l("button")},[]);const c={tabIndex:0,role:r};return p.jsx("span",{...o,ref:a,style:Iu,"aria-hidden":r?void 0:!0,...c,"data-base-ui-focus-guard":""})}),Mr=Math.min,Qo=Math.max,iu=Math.round,Hc=Math.floor,Zo=t=>({x:t,y:t}),BO={left:"right",right:"left",bottom:"top",top:"bottom"};function vS(t,o,a){return Qo(t,Mr(o,a))}function Ys(t,o){return typeof t=="function"?t(o):t}function to(t){return t.split("-")[0]}function rs(t){return t.split("-")[1]}function Zh(t){return t==="x"?"y":"x"}function Jh(t){return t==="y"?"height":"width"}function eo(t){const o=t[0];return o==="t"||o==="b"?"y":"x"}function em(t){return Zh(eo(t))}function VO(t,o,a){a===void 0&&(a=!1);const r=rs(t),l=em(t),c=Jh(l);let d=l==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return o.reference[c]>o.floating[c]&&(d=lu(d)),[d,lu(d)]}function FO(t){const o=lu(t);return[yh(t),o,yh(o)]}function yh(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const fx=["left","right"],dx=["right","left"],YO=["top","bottom"],qO=["bottom","top"];function GO(t,o,a){switch(t){case"top":case"bottom":return a?o?dx:fx:o?fx:dx;case"left":case"right":return o?YO:qO;default:return[]}}function XO(t,o,a,r){const l=rs(t);let c=GO(to(t),a==="start",r);return l&&(c=c.map(d=>d+"-"+l),o&&(c=c.concat(c.map(yh)))),c}function lu(t){const o=to(t);return BO[o]+t.slice(o.length)}function KO(t){var o,a,r,l;return{top:(o=t.top)!=null?o:0,right:(a=t.right)!=null?a:0,bottom:(r=t.bottom)!=null?r:0,left:(l=t.left)!=null?l:0}}function xS(t){return typeof t!="number"?KO(t):{top:t,right:t,bottom:t,left:t}}function Qi(t){const{x:o,y:a,width:r,height:l}=t;return{width:r,height:l,top:a,left:o,right:o+r,bottom:a+l,x:o,y:a}}function Yi(t,o){return o<0||o>=t.length}function Zc(t,o){return $o(t.current,{disabledIndices:o})}function bh(t,o){return $o(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:o})}function $o(t,{startingIndex:o=-1,decrement:a=!1,disabledIndices:r,amount:l=1}={}){let c=o;do c+=a?-l:l;while(c>=0&&c<=t.length-1&&Cr(t,c,r));return c}function Cr(t,o,a){if(typeof a=="function"?a(o):a?.includes(o)??!1)return!0;const l=t[o];return l?!Hu(l)||l.matches(":disabled")?!0:!a&&(l.hasAttribute("disabled")||l.getAttribute("aria-disabled")==="true"):!1}function $O(t){return t.visibility==="hidden"||t.visibility==="collapse"}function Hu(t,o=t?Un(t):null){return!t||!t.isConnected||!o||$O(o)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():o.display!=="none"&&o.display!=="contents"}const WO='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function QO(t){const o=t.assignedSlot;if(o)return o;if(t.parentElement)return t.parentElement;const a=t.getRootNode();return Nr(a)?a.host:null}function vh(t){for(const o of Array.from(t.children))if(pn(o)==="summary")return o;return null}function ZO(t,o){const a=vh(o);return!!a&&(t===a||De(a,t))}function SS(t){const o=t?pn(t):"";return t!=null&&t.matches(WO)&&(o!=="summary"||t.parentElement!=null&&pn(t.parentElement)==="details"&&vh(t.parentElement)===t)&&(o!=="details"||vh(t)==null)&&(o!=="input"||t.type!=="hidden")}function wS(t){if(!SS(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let o=t;o;o=QO(o)){const a=o!==t,r=pn(o)==="slot";if(o.hasAttribute("inert")||a&&pn(o)==="details"&&!o.open&&!ZO(t,o)||o.hasAttribute("hidden")||!r&&!JO(o,a))return!1}return!0}function JO(t,o){const a=Un(t);return o?a.display!=="none":Hu(t,a)}function TS(t){const o=t.tabIndex;if(o<0){const a=pn(t);if(a==="details"||a==="audio"||a==="video"||yt(t)&&t.isContentEditable)return 0}return o}function Hp(t){if(pn(t)!=="input")return null;const o=t;return o.type==="radio"&&o.name!==""?o:null}function eA(t,o){const a=Hp(t);if(!a)return!0;const r=o.find(l=>{const c=Hp(l);return c?.name===a.name&&c.form===a.form&&c.checked});return r?r===a:o.find(l=>{const c=Hp(l);return c?.name===a.name&&c.form===a.form})===a}function ES(t){if(yt(t)&&pn(t)==="slot"){const o=t.assignedElements({flatten:!0});if(o.length>0)return o}return yt(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function CS(t,o){ES(t).forEach(a=>{SS(a)&&o.push(a),CS(a,o)})}function RS(t,o,a){ES(t).forEach(r=>{yt(r)&&r.matches(o)&&a.push(r),RS(r,o,a)})}function tm(t){return wS(t)&&TS(t)>=0}function OS(t){const o=[];return CS(t,o),o.filter(wS)}function dl(t){const o=OS(t);return o.filter(a=>TS(a)>=0&&eA(a,o))}function AS(t,o){const a=dl(t),r=a.length;if(r===0)return;const l=tn(We(t)),c=a.indexOf(l),d=c===-1?o===1?0:r-1:c+o;return a[d]}function nm(t){return AS(We(t).body,1)||t}function NS(t){return AS(We(t).body,-1)||t}function kS(t,o){if(!t)return null;const a=dl(We(t).body),r=a.length;if(r===0)return null;const l=a.indexOf(t);if(l===-1)return null;const c=(l+o+r)%r;return a[c]}function tA(t){return kS(t,1)}function nA(t){return kS(t,-1)}function Rr(t,o){const a=o||t.currentTarget,r=t.relatedTarget;return!r||!De(a,r)}function oA(t){dl(t).forEach(a=>{a.dataset.tabindex=a.getAttribute("tabindex")||"",a.setAttribute("tabindex","-1")})}function px(t){const o=[];RS(t,"[data-tabindex]",o),o.forEach(a=>{const r=a.dataset.tabindex;delete a.dataset.tabindex,r?a.setAttribute("tabindex",r):a.removeAttribute("tabindex")})}function qs(t,o,a=!0){return t.filter(l=>l.parentId===o).flatMap(l=>[...!a||l.context?.open?[l]:[],...qs(t,l.id,a)])}function hx(t,o){let a=[],r=t.find(l=>l.id===o)?.parentId;for(;r;){const l=t.find(c=>c.id===r);r=l?.parentId,l&&(a=a.concat(l))}return a}function Zi(t){return`data-base-ui-${t}`}let Uc=0;function Jc(t,o={}){const{preventScroll:a=!1,sync:r=!1,shouldFocus:l}=o;cancelAnimationFrame(Uc);function c(){l&&!l()||t?.focus({preventScroll:a})}if(r)return c(),It;const d=requestAnimationFrame(c);return Uc=d,()=>{Uc===d&&(cancelAnimationFrame(d),Uc=0)}}const Up={inert:new WeakMap,"aria-hidden":new WeakMap},mx="data-base-ui-inert",xh={inert:new WeakSet,"aria-hidden":new WeakSet};let Di=new WeakMap,Bp=0;function sA(t){return xh[t]}function MS(t){return t?Nr(t)?t.host:MS(t.parentNode):null}const gx=(t,o)=>o.map(a=>{if(t.contains(a))return a;const r=MS(a);return t.contains(r)?r:null}).filter(a=>a!=null),yx=t=>{const o=new Set;return t.forEach(a=>{let r=a;for(;r&&!o.has(r);)o.add(r),r=r.parentNode}),o},bx=(t,o,a)=>{const r=[],l=c=>{!c||a.has(c)||Array.from(c.children).forEach(d=>{pn(d)!=="script"&&(o.has(d)?l(d):r.push(d))})};return l(t),r};function aA(t,o,a,r,{mark:l=!0}){let c=null;r?c="inert":a&&(c="aria-hidden");let d=null,g=null;const m=gx(o,t),h=l?bx(o,yx(m),new Set(m)):[],y=[],v=[];if(c){const S=Up[c],w=sA(c);g=w,d=S;const T=gx(o,Array.from(o.querySelectorAll("[aria-live]"))),O=m.concat(T);bx(o,yx(O),new Set(O)).forEach(C=>{const _=C.getAttribute(c),k=_!==null&&_!=="false",M=(S.get(C)||0)+1;S.set(C,M),y.push(C),M===1&&k&&w.add(C),k||C.setAttribute(c,c==="inert"?"":"true")})}return l&&h.forEach(S=>{const w=(Di.get(S)||0)+1;Di.set(S,w),v.push(S),w===1&&S.setAttribute(mx,"")}),Bp+=1,()=>{d&&y.forEach(S=>{const T=(d.get(S)||0)-1;d.set(S,T),T||(!g?.has(S)&&c&&S.removeAttribute(c),g?.delete(S))}),l&&v.forEach(S=>{const w=(Di.get(S)||0)-1;Di.set(S,w),w||S.removeAttribute(mx)}),Bp-=1,Bp||(Up.inert=new WeakMap,Up["aria-hidden"]=new WeakMap,xh.inert=new WeakSet,xh["aria-hidden"]=new WeakSet,Di=new WeakMap)}}function vx(t,o={}){const{ariaHidden:a=!1,inert:r=!1,mark:l=!0}=o,c=We(t[0]).body;return aA(t,c,a,r,{mark:l})}var oo=nS();let xx=0;function rA(t,o="mui"){const[a,r]=b.useState(t),l=t||a;return b.useEffect(()=>{a==null&&(xx+=1,r(`${o}-${xx}`))},[a,o]),l}const Sx=Qh.useId;function Gs(t,o){if(Sx!==void 0){const a=Sx();return t??(o?`${o}-${a}`:a)}return rA(t,o)}const iA=parseInt(b.version,10);function om(t){return iA>=t}function wx(t){if(!b.isValidElement(t))return null;const o=t,a=o.props;return(om(19)?a?.ref:o.ref)??null}function Sh(t,o){if(t&&!o)return t;if(!t&&o)return o;if(t||o)return{...t,...o}}function lA(t,o){const a={};for(const r in t){const l=t[r];if(o?.hasOwnProperty(r)){const c=o[r](l);c!=null&&Object.assign(a,c);continue}l===!0?a[`data-${r.toLowerCase()}`]="":l&&(a[`data-${r.toLowerCase()}`]=l.toString())}return a}function cA(t,o){return typeof t=="function"?t(o):t}function uA(t,o){return typeof t=="function"?t(o):t}const sm={};function no(t,o,a,r,l){if(!a&&!r&&!l&&!t)return cu(o);let c=cu(t);return o&&(c=Hi(c,o)),a&&(c=Hi(c,a)),r&&(c=Hi(c,r)),l&&(c=Hi(c,l)),c}function fA(t){if(t.length===0)return sm;if(t.length===1)return cu(t[0]);let o=cu(t[0]);for(let a=1;a<t.length;a+=1)o=Hi(o,t[a]);return o}function cu(t){return am(t)?{..._S(t,sm)}:dA(t)}function Hi(t,o){return am(o)?_S(o,t):pA(t,o)}function dA(t){const o={...t};for(const a in o){const r=o[a];jS(a,r)&&(o[a]=DS(r))}return o}function pA(t,o){if(!o)return t;for(const a in o){const r=o[a];switch(a){case"style":{t[a]=Sh(t.style,r);break}case"className":{t[a]=zS(t.className,r);break}default:jS(a,r)?t[a]=hA(t[a],r):t[a]=r}}return t}function jS(t,o){const a=t.charCodeAt(0),r=t.charCodeAt(1),l=t.charCodeAt(2);return a===111&&r===110&&l>=65&&l<=90&&(typeof o=="function"||typeof o>"u")}function am(t){return typeof t=="function"}function _S(t,o){return am(t)?t(o):t??sm}function hA(t,o){return o?t?(...a)=>{const r=a[0];if(LS(r)){const c=r;uu(c);const d=o(...a);return c.baseUIHandlerPrevented||t?.(...a),d}const l=o(...a);return t?.(...a),l}:DS(o):t}function DS(t){return t&&((...o)=>{const a=o[0];return LS(a)&&uu(a),t(...o)})}function uu(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function zS(t,o){return o?t?o+" "+t:o:t}function LS(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function et(t,o,a={}){let r=o.render;a.enabled!==!1&&(r=bA(r));const l=mA(o,a,r);if(a.enabled===!1)return null;const c=a.state??Tt;return vA(t,r,l,c)}function mA(t,o,a){const{className:r,style:l}=t,{state:c=Tt,ref:d,props:g,stateAttributesMapping:m,enabled:h=!0}=o,y=h?cA(r,c):void 0,v=h?uA(l,c):void 0,S=h?lA(c,m):Tt,w=h&&g?gA(g):void 0,T=h?Sh(S,w)??{}:Tt;return typeof document<"u"&&(h?Array.isArray(d)?T.ref=_O([T.ref,wx(a),...d]):T.ref=ss(T.ref,wx(a),d):ss(null,null)),h?(y!==void 0&&(T.className=zS(T.className,y)),v!==void 0&&(T.style=Sh(T.style,v)),T):Tt}function gA(t){return Array.isArray(t)?fA(t):no(void 0,t)}const yA=Symbol.for("react.lazy");function bA(t){if(t?.$$typeof!==yA)return t;const o=b.Children.toArray(t)[0];return b.isValidElement(o)?o:t}function vA(t,o,a,r){if(o){if(typeof o=="function")return o(a,r);const l=no(a,o.props);return l.ref=a.ref,b.cloneElement(o,l)}if(t&&typeof t=="string")return xA(t,a);throw new Error(At(8))}function xA(t,o){return t==="button"?b.createElement("button",{type:"button",...o,key:o.key}):t==="img"?b.createElement("img",{alt:"",...o,key:o.key}):b.createElement(t,o)}const SA=500,PS=500,wA={style:{transition:"none"}},IS="data-base-ui-click-trigger",TA="data-base-ui-swipe-ignore",EA="data-swipe-ignore",CA=`[${TA}]`,RA=`[${EA}]`,HS={fallbackAxisSide:"none"},rm={fallbackAxisSide:"end"},OA={clipPath:"inset(50%)",position:"fixed",top:0,left:0},US=b.createContext(null),BS=()=>b.useContext(US),AA=Zi("portal");function VS(t={}){const{ref:o,container:a,componentProps:r=Tt,elementProps:l}=t,c=Gs(),g=BS()?.portalNode,[m,h]=b.useState(null),[y,v]=b.useState(null),S=ke(A=>{A!==null&&v(A)}),w=b.useRef(null);we(()=>{if(a===null){w.current&&(w.current=null,v(null),h(null));return}const A=(a&&(Xh(a)?a:a.current))??g??document.body;if(A==null){w.current&&(w.current=null,v(null),h(null));return}w.current!==A&&(w.current=A,v(null),h(A))},[a,g]);const T=et("div",r,{ref:[o,S],props:[{id:c,[AA]:""},l]}),O=m&&T?oo.createPortal(T,m):null;return{node:y,nodeId:b.isValidElement(T)?T.props.id:void 0,subtree:O}}const Uu=b.forwardRef(function(o,a){const{render:r,className:l,style:c,children:d,container:g,portalOwnerRole:m,...h}=o,{node:y,nodeId:v,subtree:S}=VS({container:g,ref:a,componentProps:o,elementProps:h}),w=b.useRef(null),T=b.useRef(null),O=b.useRef(null),A=b.useRef(null),[C,_]=b.useState(null),k=b.useRef(!1),M=C?.modal,z=C?.open,D=!!C&&!C.modal&&C.open&&!!y;b.useEffect(()=>{if(!y||M)return;function B(Y){y&&Y.relatedTarget&&Rr(Y)&&(Y.type==="focusin"?k.current&&(px(y),k.current=!1):(oA(y),k.current=!0))}return fo(Ge(y,"focusin",B,!0),Ge(y,"focusout",B,!0))},[y,M]),we(()=>{!y||z!==!0||!k.current||(px(y),k.current=!1)},[z,y]);const L=b.useMemo(()=>({beforeOutsideRef:w,afterOutsideRef:T,beforeInsideRef:O,afterInsideRef:A,portalNode:y,setFocusManagerState:_}),[y]);return p.jsxs(b.Fragment,{children:[S,p.jsxs(US.Provider,{value:L,children:[D&&y&&p.jsx(as,{"data-type":"outside",ref:w,onFocus:B=>{if(Rr(B,y))O.current?.focus();else{const Y=C?C.domReference:null;NS(Y)?.focus()}}}),D&&y&&p.jsx("span",{role:m,"aria-owns":v,style:OA}),y&&oo.createPortal(d,y),D&&y&&p.jsx(as,{"data-type":"outside",ref:T,onFocus:B=>{if(Rr(B,y))A.current?.focus();else{const Y=C?C.domReference:null;nm(Y)?.focus(),C?.closeOnFocusOut&&C?.onOpenChange(!1,qe(Fs,B.nativeEvent))}}})]})]})});function FS(){const t=new Map;return{emit(o,a){t.get(o)?.forEach(r=>r(a))},on(o,a){t.has(o)||t.set(o,new Set),t.get(o).add(a)},off(o,a){t.get(o)?.delete(a)}}}class im{nodesRef={current:[]};events=FS();addNode(o){this.nodesRef.current.push(o)}removeNode(o){const a=this.nodesRef.current.findIndex(r=>r===o);a!==-1&&this.nodesRef.current.splice(a,1)}}const YS=b.createContext(null),qS=b.createContext(null),Xs=()=>b.useContext(YS)?.id||null,Ks=t=>{const o=b.useContext(qS);return t??o};function lm(t){const o=Gs(),a=Ks(t),r=Xs();return we(()=>{if(!o)return;const l={id:o,parentId:r};return a?.addNode(l),()=>{a?.removeNode(l)}},[a,o,r]),o}function GS(t){const{children:o,id:a}=t,r=Xs();return p.jsx(YS.Provider,{value:b.useMemo(()=>({id:a,parentId:r}),[a,r]),children:o})}function XS(t){const{children:o,externalTree:a}=t,r=Qt(()=>a??new im).current;return p.jsx(qS.Provider,{value:r,children:o})}function Go(t){return t==null?t:"current"in t?t.current:t}function NA(t,o){const a=Et(zt(t));return t instanceof a.KeyboardEvent?"keyboard":t instanceof a.FocusEvent?o||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof a.MouseEvent?o||(t.detail===0?"keyboard":"mouse"):""}const Tx=20;let Us=[];function cm(){Us=Us.filter(t=>t.deref()?.isConnected)}function Ex(t){cm(),t&&pn(t)!=="body"&&(Us.push(new WeakRef(t)),Us.length>Tx&&(Us=Us.slice(-Tx)))}function Cx(){return cm(),Us[Us.length-1]?.deref()}function kA(t){return t?tm(t)?t:dl(t)[0]||t:null}function Rx(t){if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!t.getAttribute("role")?.includes("dialog"))return;const a=OS(t).filter(l=>{const c=l.getAttribute("data-tabindex")||"";return tm(l)||l.hasAttribute("data-tabindex")&&!c.startsWith("-")}),r=t.getAttribute("tabindex");a.length===0?r!=="0"&&(t.setAttribute("tabindex","0"),t.setAttribute("data-tabindex","0")):(r!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function Bu(t){const{context:o,children:a,disabled:r=!1,initialFocus:l=!0,returnFocus:c=!0,restoreFocus:d=!1,modal:g=!0,closeOnFocusOut:m=!0,openInteractionType:h="",nextFocusableElement:y,previousFocusableElement:v,beforeContentFocusGuardRef:S,externalTree:w,getInsideElements:T}=t,O="rootStore"in o?o.rootStore:o,A=O.useState("open"),C=O.useState("domReferenceElement"),_=O.useState("floatingElement"),{events:k,dataRef:M}=O.context,z=ke(()=>M.current.floatingContext?.nodeId),D=l===!1,L=gh(C)&&D,B=Vt(l),Y=Vt(c),H=Vt(h),I=Vt(A),j=Ks(w),U=BS(),te=b.useRef(!1),$=b.useRef(!1),P=b.useRef(!1),q=b.useRef(null),X=b.useRef(""),Z=b.useRef(""),W=b.useRef(null),N=b.useRef(null),V=ss(W,S,U?.beforeInsideRef),J=ss(N,U?.afterInsideRef),K=nn(),se=nn(),re=kr(),me=U!=null,pe=au(_),be=ke((ye=pe)=>ye?dl(ye):[]),Ce=ke(()=>T?.().filter(ye=>ye!=null)??[]);b.useEffect(()=>{if(r||!g)return;function ye(Te){Te.key==="Tab"&&De(pe,tn(We(pe)))&&be().length===0&&!L&&To(Te)}const ge=We(pe);return Ge(ge,"keydown",ye)},[r,pe,g,L,be]),b.useEffect(()=>{if(r||!A)return;const ye=We(pe);function ge(){P.current=!1}function Te(Ue){const Ee=zt(Ue),Le=Ce(),Se=De(_,Ee)||De(C,Ee)||De(U?.portalNode,Ee)||Le.some(Re=>Re===Ee||De(Re,Ee));P.current=!Se,Z.current=Ue.pointerType||"keyboard",Ee?.closest(`[${IS}]`)&&($.current=!0,se.start(0,()=>{$.current=!1}))}function Ae(){Z.current="keyboard"}return fo(Ge(ye,"pointerdown",Te,!0),Ge(ye,"pointerup",ge,!0),Ge(ye,"pointercancel",ge,!0),Ge(ye,"keydown",Ae,!0),ge)},[r,_,C,pe,A,U,se,Ce]),b.useEffect(()=>{if(r||!m)return;const ye=We(pe);function ge(){$.current=!0,se.start(0,()=>{$.current=!1})}function Te(Le){const Se=zt(Le);tm(Se)&&(q.current=Se)}function Ae(Le){const Se=Le.relatedTarget,Re=Le.currentTarget,Ne=zt(Le);g&&Se==null&&Ne!=null&&De(_,Ne)&&Ex(Ne),queueMicrotask(()=>{const Ie=z(),je=O.context.triggerElements,le=Ce(),ve=Se?.hasAttribute(Zi("focus-guard"))&&[W.current,N.current,U?.beforeInsideRef.current,U?.afterInsideRef.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,Go(v),Go(y)].includes(Se),he=!(De(C,Se)||De(_,Se)||De(Se,_)||De(U?.portalNode,Se)||le.some(ce=>ce===Se||De(ce,Se))||je.hasMatchingElement(ce=>De(ce,Se))||ve||j&&(qs(j.nodesRef.current,Ie).find(ce=>De(ce.context?.elements.floating,Se)||De(ce.context?.elements.domReference,Se))||hx(j.nodesRef.current,Ie).find(ce=>[ce.context?.elements.floating,au(ce.context?.elements.floating)].includes(Se)||ce.context?.elements.domReference===Se)));if(Re===C&&pe&&Rx(pe),d&&Re!==C&&!Hu(Ne)&&tn(ye)===ye.body){if(yt(pe)&&(pe.focus(),d==="popup")){re.request(()=>{pe.focus()});return}const ce=be(),xe=q.current,He=(xe&&ce.includes(xe)?xe:null)||ce[ce.length-1]||pe;yt(He)&&He.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}(L||!g)&&Se&&he&&!$.current&&(L||Se!==Cx())&&(te.current=!0,O.setOpen(!1,qe(Fs,Le)))})}function Ue(){P.current||(M.current.insideReactTree=!0,K.start(0,()=>{M.current.insideReactTree=!1}))}const Ee=yt(C)?C:null;if(!(!_&&!Ee))return fo(Ee&&Ge(Ee,"focusout",Ae),Ee&&Ge(Ee,"pointerdown",ge),_&&Ge(_,"focusin",Te),_&&Ge(_,"focusout",Ae),_&&U&&Ge(_,"focusout",Ue,!0))},[r,C,_,pe,g,j,U,O,m,d,be,L,z,M,K,se,re,y,v,Ce]),b.useEffect(()=>{if(r||!_||!A)return;const ye=Array.from(U?.portalNode?.querySelectorAll(`[${Zi("portal")}]`)||[]),Te=(j?hx(j.nodesRef.current,z()):[]).find(Re=>gh(Re.context?.elements.domReference||null))?.context?.elements.domReference,Ue=[...[_,...ye,W.current,N.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,...Ce()],Te,Go(v),Go(y),L?C:null].filter(Re=>Re!=null),Ee=vx(Ue,{ariaHidden:g||L,mark:!1}),Le=[_,...ye].filter(Re=>Re!=null),Se=vx(Le);return()=>{Se(),Ee()}},[A,r,C,_,g,U,L,j,z,y,v,Ce]),we(()=>{if(!A||r||!yt(pe))return;X.current="",Z.current="";const ye=We(pe),ge=tn(ye);queueMicrotask(()=>{const Te=B.current,Ae=typeof Te=="function"?Te(H.current||""):Te;if(Ae===void 0||Ae===!1||De(pe,ge))return;let Ee=null;const Le=()=>(Ee==null&&(Ee=be(pe)),Ee[0]||pe);let Se;Ae===!0||Ae===null?Se=Le():Se=Go(Ae),Se=Se||Le();const Re=De(pe,tn(ye));Jc(Se,{preventScroll:Se===pe,shouldFocus(){if(!I.current)return!1;if(Re)return!0;const Ne=tn(ye);return!(Ne!==Se&&De(pe,Ne))}})})},[r,A,pe,be,B,H,I]),we(()=>{if(r||!pe)return;const ye=We(pe),ge=tn(ye),Te=H.current==null;Ex(ge);function Ae(Ee){if(Ee.open||(X.current=NA(Ee.nativeEvent,Z.current)),Ee.reason===Bt&&Ee.nativeEvent.type==="mouseleave"&&(te.current=!0),Ee.reason===Lu)if(Ee.nested)te.current=!1;else if(Ou(Ee.nativeEvent)||Gh(Ee.nativeEvent))te.current=!1;else{let Le=!1;We(pe).createElement("div").focus({get preventScroll(){return Le=!0,!1}}),Le?te.current=!1:te.current=!0}}k.on("openchange",Ae);function Ue(Ee){const Le=Y.current;let Se=typeof Le=="function"?Le(Ee):Le;if(Se===void 0||Se===!1)return null;Se===null&&(Se=!0);const Re=C?.isConnected?C:null,Ne=ge?.isConnected&&pn(ge)!=="body"?ge:null;let Ie=Te?Ne||Re:Re||Ne;return Ie||(Ie=Cx()||null),typeof Se=="boolean"?Ie:Go(Se)||Ie||null}return()=>{k.off("openchange",Ae);const Ee=tn(ye),Le=Ce(),Se=De(_,Ee)||Le.some(je=>je===Ee||De(je,Ee))||j&&qs(j.nodesRef.current,z(),!1).some(je=>De(je.context?.elements.floating,Ee)),Re=Y.current,Ne=X.current,Ie=Ue(Ne);queueMicrotask(()=>{const je=kA(Ie),le=typeof Re!="boolean";if(Re&&!te.current&&yt(je)&&(!(!le&&je!==Ee&&Ee!==ye.body)||Se)){const ve={preventScroll:!0};Ne==="keyboard"&&(ve.focusVisible=!0),je.focus(ve)}te.current=!1})}},[r,_,pe,Y,H,k,j,C,z,Ce]),we(()=>{if(!cs||A||!_)return;const ye=tn(We(_));!yt(ye)||!zu(ye)||De(_,ye)&&ye.blur()},[A,_]),we(()=>{if(!(r||!U))return U.setFocusManagerState({modal:g,closeOnFocusOut:m,open:A,onOpenChange:O.setOpen,domReference:C}),()=>{U.setFocusManagerState(null)}},[r,U,g,A,O,m,C]),we(()=>{if(!(r||!pe))return Rx(pe),()=>{queueMicrotask(cm)}},[r,pe]);const Me=!r&&(g?!L:!0)&&(me||g);return p.jsxs(b.Fragment,{children:[Me&&p.jsx(as,{"data-type":"inside",ref:V,onFocus:ye=>{if(g){const ge=be();Jc(ge[ge.length-1])}else U?.portalNode&&(te.current=!1,Rr(ye,U.portalNode)?nm(C)?.focus():Go(v??U.beforeOutsideRef)?.focus())}}),a,Me&&p.jsx(as,{"data-type":"inside",ref:J,onFocus:ye=>{g?Jc(be()[0]):U?.portalNode&&(m&&(te.current=!0),Rr(ye,U.portalNode)?NS(C)?.focus():Go(y??U.afterOutsideRef)?.focus())}})]})}function Vu(t,o={}){const{enabled:a=!0,event:r="click",toggle:l=!0,ignoreMouse:c=!1,stickIfOpen:d=!0,touchOpenDelay:g=0,reason:m=os}=o,h="rootStore"in t?t.rootStore:t,y=h.context.dataRef,v=b.useRef(void 0),S=kr(),w=nn(),T=b.useMemo(()=>{function O(C,_,k,M){const z=qe(m,_,k);C&&M==="touch"&&g>0?w.start(g,()=>{h.setOpen(!0,z)}):h.setOpen(C,z)}function A(C,_,k){const M=y.current.openEvent,z=h.select("domReferenceElement")!==_;return C&&z||!C||!l?!0:M&&d?!k(M.type):!1}return{onPointerDown(C){v.current=Bs(C.pointerType,!0)&&Gh(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const _=v.current,k=C.nativeEvent,M=h.select("open");if(C.button!==0||r==="click"||Bs(_,!0)&&c)return;const z=A(M,C.currentTarget,B=>B==="click"||B==="mousedown"),D=zt(k);if(zu(D)){O(z,k,D,_);return}const L=C.currentTarget;S.request(()=>{O(z,k,L,_)})},onClick(C){if(r==="mousedown-only")return;const _=v.current;if(r==="mousedown"&&_){v.current=void 0;return}if(Bs(_,!0)&&c)return;const k=h.select("open"),M=A(k,C.currentTarget,z=>z==="click"||z==="mousedown"||z==="keydown"||z==="keyup");O(M,C.nativeEvent,C.currentTarget,_)},onKeyDown(){v.current=void 0}}},[y,r,c,m,h,d,l,S,w,g]);return b.useMemo(()=>a?{reference:T}:Tt,[a,T])}function MA(t,o){let a=null,r=null,l=!1;return{contextElement:t||void 0,getBoundingClientRect(){const c=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},d=o.axis==="x"||o.axis==="both",g=o.axis==="y"||o.axis==="both",m=["mouseenter","mousemove"].includes(o.dataRef.current.openEvent?.type||"")&&o.pointerType!=="touch";let h=c.width,y=c.height,v=c.x,S=c.y;return a==null&&o.x&&d&&(a=c.x-o.x),r==null&&o.y&&g&&(r=c.y-o.y),v-=a||0,S-=r||0,h=0,y=0,!l||m?(h=o.axis==="y"?c.width:0,y=o.axis==="x"?c.height:0,v=d&&o.x!=null?o.x:v,S=g&&o.y!=null?o.y:S):l&&!m&&(y=o.axis==="x"?c.height:y,h=o.axis==="y"?c.width:h),l=!0,{width:h,height:y,x:v,y:S,top:S,right:v+h,bottom:S+y,left:v}}}}function Ox(t){return t!=null&&t.clientX!=null}function jA(t,o={}){const{enabled:a=!0,axis:r="both"}=o,l="rootStore"in t?t.rootStore:t,c=l.useState("open"),d=l.useState("floatingElement"),g=l.useState("domReferenceElement"),m=l.context.dataRef,h=b.useRef(!1),y=b.useRef(null),[v,S]=b.useState(),[w,T]=b.useState([]),O=ke(M=>{l.set("positionReference",M)}),A=ke((M,z,D)=>{h.current||m.current.openEvent&&!Ox(m.current.openEvent)||l.set("positionReference",MA(D??g,{x:M,y:z,axis:r,dataRef:m,pointerType:v}))}),C=ke(M=>{c?y.current||(A(M.clientX,M.clientY,M.currentTarget),T([])):A(M.clientX,M.clientY,M.currentTarget)}),_=Bs(v)?d:c;b.useEffect(()=>{if(!a){O(g);return}if(!_)return;function M(){y.current?.(),y.current=null}const z=Et(d);function D(L){const B=zt(L);De(d,B)?M():A(L.clientX,L.clientY)}return!m.current.openEvent||Ox(m.current.openEvent)?y.current=Ge(z,"mousemove",D):O(g),M},[_,a,d,m,g,l,A,O,w]),b.useEffect(()=>()=>{l.set("positionReference",null)},[l]),b.useEffect(()=>{a&&!d&&(h.current=!1)},[a,d]),b.useEffect(()=>{!a&&c&&(h.current=!0)},[a,c]);const k=b.useMemo(()=>{function M(z){S(z.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:C,onMouseEnter:C}},[C]);return b.useMemo(()=>a?{reference:k,trigger:k}:{},[a,k])}function _A(){return!1}function DA(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function pl(t,o={}){const{enabled:a=!0,escapeKey:r=!0,outsidePress:l=!0,outsidePressEvent:c="sloppy",referencePress:d=_A,bubbles:g,externalTree:m}=o,h="rootStore"in t?t.rootStore:t,y=h.useState("open"),v=h.useState("floatingElement"),{dataRef:S,events:w}=h.context,T=Ks(m),O=ke(typeof l=="function"?l:()=>!1),A=typeof l=="function"?O:l,C=A!==!1,_=ke(()=>c),{escapeKey:k,outsidePress:M}=DA(g),z=b.useRef(!1),D=b.useRef(!1),L=b.useRef(!1),B=b.useRef(!1),Y=b.useRef(!1),H=b.useRef(""),I=b.useRef(null),j=nn(),U=nn(),te=ke(()=>{U.clear(),S.current.insideReactTree=!1}),$=ke(K=>{const se=S.current.floatingContext?.nodeId;return(T?qs(T.nodesRef.current,se):[]).some(me=>me.context?.open&&!me.context.dataRef.current[K])}),P=ke(K=>Pp(K,h.select("floatingElement"))||Pp(K,h.select("domReferenceElement"))),q=ke(K=>{d()&&h.setOpen(!1,qe(os,K.nativeEvent))}),X=ke(K=>{if(!y||!a||!r||K.key!=="Escape"||Y.current||!k&&$("__escapeKeyBubbles"))return;const se=rO(K)?K.nativeEvent:K,re=qe(fl,se);h.setOpen(!1,re),re.isCanceled||K.preventDefault(),!k&&!re.isPropagationAllowed&&K.stopPropagation()}),Z=ke(()=>{S.current.insideReactTree=!0,U.start(0,te)}),W=ke(K=>{if(!y||!a||K.button!==0)return;const se=zt(K.nativeEvent);De(h.select("floatingElement"),se)&&(z.current||(z.current=!0,D.current=!1))}),N=ke(K=>{!y||!a||(K.defaultPrevented||K.nativeEvent.defaultPrevented)&&z.current&&(D.current=!0)});b.useEffect(()=>{function K(se){se.open||(B.current=!1)}return w.on("openchange",K),()=>{w.off("openchange",K)}},[w]),b.useEffect(()=>{if(!y||!a)return y||(B.current=!1),te;S.current.__escapeKeyBubbles=k,S.current.__outsidePressBubbles=M;const K=new An,se=new An,re=We(v);function me(){K.clear(),Y.current=!0}function pe(){K.start(cs?5:0,()=>{Y.current=!1})}function be(){L.current=!0,se.start(0,()=>{L.current=!1})}function Ce(){z.current=!1,D.current=!1}function Me(){const he=H.current,ce=he==="pen"||!he?"mouse":he,xe=_(),He=typeof xe=="function"?xe():xe;return typeof He=="string"?He:He[ce]}function ye(he){const ce=Me();return ce==="intentional"&&he.type!=="click"||ce==="sloppy"&&he.type==="click"}function ge(he){const ce=S.current.floatingContext?.nodeId,xe=T&&qs(T.nodesRef.current,ce).some(He=>Pp(he,He.context?.elements.floating));return P(he)||xe}function Te(he){if(ye(he)){he.type!=="click"&&!P(he)&&(se.clear(),L.current=!1),te();return}if(S.current.insideReactTree){te();return}const ce=zt(he),xe=`[${Zi("inert")}]`,He=Je(ce)?ce.getRootNode():null,Lt=Array.from((Nr(He)?He:We(h.select("floatingElement"))).querySelectorAll(xe)),Ft=h.context.triggerElements;if(ce&&(Ft.hasElement(ce)||Ft.hasMatchingElement(Oe=>De(Oe,ce))))return;let ut=Je(ce)?ce:null;for(;ut&&!Wo(ut);){const Oe=ts(ut);if(Wo(Oe)||!Je(Oe))break;ut=Oe}if(!(Lt.length&&Je(ce)&&!EO(ce)&&!De(ce,h.select("floatingElement"))&&Lt.every(Oe=>!De(ut,Oe)))){if(yt(ce)&&!("touches"in he)){const Oe=Wo(ce),Ye=Un(ce),Qe=/auto|scroll/,ct=Oe||Qe.test(Ye.overflowX),Jt=Oe||Qe.test(Ye.overflowY),rn=ct&&ce.clientWidth>0&&ce.scrollWidth>ce.clientWidth,hn=Jt&&ce.clientHeight>0&&ce.scrollHeight>ce.clientHeight,bt=Ye.direction==="rtl",jt=hn&&(bt?he.offsetX<=ce.offsetWidth-ce.clientWidth:he.offsetX>ce.clientWidth),Fe=rn&&he.offsetY>ce.clientHeight;if(jt||Fe)return}if(!ge(he)){if(Me()==="intentional"){if(he.detail!==0&&!Ou(he)&&!B.current)return;if(L.current){se.clear(),L.current=!1;return}}typeof A=="function"&&!A(he)||$("__outsidePressBubbles")||(h.setOpen(!1,qe(Lu,he)),te())}}}function Ae(he){Me()!=="sloppy"||he.pointerType==="touch"||!h.select("open")||!a||P(he)||Te(he)}function Ue(he){if(Me()!=="sloppy"||!h.select("open")||!a||P(he))return;const ce=he.touches[0];ce&&(I.current={startTime:Date.now(),startX:ce.clientX,startY:ce.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},j.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function Ee(he,ce){const xe=zt(he);if(!xe)return;const He=Ge(xe,he.type,()=>{ce(he),He()})}function Le(he){H.current="touch",Ee(he,Ue)}function Se(he){j.clear(),he.type==="pointerdown"&&(he.button===0&&(B.current=!0),H.current=he.pointerType),!(he.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)&&Ee(he,ce=>{ce.type==="pointerdown"?Ae(ce):Te(ce)})}function Re(he){if(he.type==="pointercancel"&&(B.current=!1),!z.current)return;const ce=D.current;if(Ce(),Me()==="intentional"){if(he.type==="pointercancel"){ce&&be();return}if(!ge(he)){if(ce){be();return}typeof A=="function"&&!A(he)||(se.clear(),L.current=!0,te())}}}function Ne(he){if(Me()!=="sloppy"||!I.current||P(he))return;const ce=he.touches[0];if(!ce)return;const xe=Math.abs(ce.clientX-I.current.startX),He=Math.abs(ce.clientY-I.current.startY),Lt=Math.sqrt(xe*xe+He*He);Lt>5&&(I.current.dismissOnTouchEnd=!0),Lt>10&&(Te(he),j.clear(),I.current=null)}function Ie(he){Ee(he,Ne)}function je(he){Me()!=="sloppy"||!I.current||P(he)||(I.current.dismissOnTouchEnd&&Te(he),j.clear(),I.current=null)}function le(he){Ee(he,je)}const ve=fo(r&&fo(Ge(re,"keydown",X),Ge(re,"compositionstart",me),Ge(re,"compositionend",pe)),C&&fo(Ge(re,"click",Se,!0),Ge(re,"pointerdown",Se,!0),Ge(re,"pointerup",Re,!0),Ge(re,"pointercancel",Re,!0),Ge(re,"mousedown",Se,!0),Ge(re,"mouseup",Re,!0),Ge(re,"touchstart",Le,{capture:!0,passive:!0}),Ge(re,"touchmove",Ie,{capture:!0,passive:!0}),Ge(re,"touchend",le,{capture:!0,passive:!0})));return()=>{ve(),K.clear(),se.clear(),Ce(),L.current=!1,te()}},[S,v,r,C,A,y,a,k,M,X,te,_,$,P,T,h,j]);const V=b.useMemo(()=>({onKeyDown:X,onPointerDown:q,onClick:q}),[X,q]),J=b.useMemo(()=>({onKeyDown:X,onPointerDown:N,onMouseDown:N,onClickCapture:Z,onMouseDownCapture(K){Z(),W(K)},onPointerDownCapture(K){Z(),W(K)},onMouseUpCapture:Z,onTouchEndCapture:Z,onTouchMoveCapture:Z}),[X,Z,W,N]);return b.useMemo(()=>a?{reference:V,floating:J,trigger:V}:{},[a,V,J])}function Ax(t,o,a){let{reference:r,floating:l}=t;const c=eo(o),d=em(o),g=Jh(d),m=to(o),h=c==="y",y=r.x+r.width/2-l.width/2,v=r.y+r.height/2-l.height/2,S=r[g]/2-l[g]/2;let w;switch(m){case"top":w={x:y,y:r.y-l.height};break;case"bottom":w={x:y,y:r.y+r.height};break;case"right":w={x:r.x+r.width,y:v};break;case"left":w={x:r.x-l.width,y:v};break;default:w={x:r.x,y:r.y}}const T=rs(o);return T&&(w[d]+=S*(T==="end"?1:-1)*(a&&h?-1:1)),w}async function zA(t,o){var a;o===void 0&&(o={});const{x:r,y:l,platform:c,rects:d,elements:g,strategy:m}=t,{boundary:h="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:S=!1,padding:w=0}=Ys(o,t),T=xS(w),A=g[S?v==="floating"?"reference":"floating":v],C=Qi(await c.getClippingRect({element:(a=await(c.isElement==null?void 0:c.isElement(A)))==null||a?A:A.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(g.floating)),boundary:h,rootBoundary:y,strategy:m})),_=v==="floating"?{x:r,y:l,width:d.floating.width,height:d.floating.height}:d.reference,k=await(c.getOffsetParent==null?void 0:c.getOffsetParent(g.floating)),M=await(c.isElement==null?void 0:c.isElement(k))&&await(c.getScale==null?void 0:c.getScale(k))||{x:1,y:1},z=Qi(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:g,rect:_,offsetParent:k,strategy:m}):_);return{top:(C.top-z.top+T.top)/M.y,bottom:(z.bottom-C.bottom+T.bottom)/M.y,left:(C.left-z.left+T.left)/M.x,right:(z.right-C.right+T.right)/M.x}}const LA=50,PA=async(t,o,a)=>{const{placement:r="bottom",strategy:l="absolute",middleware:c=[],platform:d}=a,g=d.detectOverflow?d:{...d,detectOverflow:zA},m=await(d.isRTL==null?void 0:d.isRTL(o));let h=await d.getElementRects({reference:t,floating:o,strategy:l}),{x:y,y:v}=Ax(h,r,m),S=r,w=0;const T={};for(let O=0;O<c.length;O++){const A=c[O];if(!A)continue;const{name:C,fn:_}=A,{x:k,y:M,data:z,reset:D}=await _({x:y,y:v,initialPlacement:r,placement:S,strategy:l,middlewareData:T,rects:h,platform:g,elements:{reference:t,floating:o}});y=k??y,v=M??v,T[C]={...T[C],...z},D&&w<LA&&(w++,typeof D=="object"&&(D.placement&&(S=D.placement),D.rects&&(h=D.rects===!0?await d.getElementRects({reference:t,floating:o,strategy:l}):D.rects),{x:y,y:v}=Ax(h,S,m)),O=-1)}return{x:y,y:v,placement:S,strategy:l,middlewareData:T}},IA=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(o){var a,r;const{placement:l,middlewareData:c,rects:d,initialPlacement:g,platform:m,elements:h}=o,{mainAxis:y=!0,crossAxis:v=!0,fallbackPlacements:S,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:O=!0,...A}=Ys(t,o);if((a=c.arrow)!=null&&a.alignmentOffset)return{};const C=to(l),_=eo(g),k=to(g)===g,M=await(m.isRTL==null?void 0:m.isRTL(h.floating)),z=S||(k||!O?[lu(g)]:FO(g)),D=T!=="none";!S&&D&&z.push(...XO(g,O,T,M));const L=[g,...z],B=await m.detectOverflow(o,A),Y=[];let H=((r=c.flip)==null?void 0:r.overflows)||[];if(y&&Y.push(B[C]),v){const te=VO(l,d,M);Y.push(B[te[0]],B[te[1]])}if(H=[...H,{placement:l,overflows:Y}],!Y.every(te=>te<=0)){var I,j;const te=(((I=c.flip)==null?void 0:I.index)||0)+1,$=L[te];if($&&(!(v==="alignment"?_!==eo($):!1)||H.every(X=>eo(X.placement)===_?X.overflows[0]>0:!0)))return{data:{index:te,overflows:H},reset:{placement:$}};let P=(j=H.filter(q=>q.overflows[0]<=0).sort((q,X)=>q.overflows[1]-X.overflows[1])[0])==null?void 0:j.placement;if(!P)switch(w){case"bestFit":{var U;const q=(U=H.filter(X=>{if(D){const Z=eo(X.placement);return Z===_||Z==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(Z=>Z>0).reduce((Z,W)=>Z+W,0)]).sort((X,Z)=>X[1]-Z[1])[0])==null?void 0:U[0];q&&(P=q);break}case"initialPlacement":P=g;break}if(l!==P)return{reset:{placement:P}}}return{}}}},KS=new Set(["left","top"]);async function HA(t,o){const{placement:a,platform:r,elements:l}=t,c=await(r.isRTL==null?void 0:r.isRTL(l.floating)),d=to(a),g=rs(a),m=eo(a)==="y",h=KS.has(d)?-1:1,y=c&&m?-1:1,v=Ys(o,t);let{mainAxis:S,crossAxis:w,alignmentAxis:T}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return g&&typeof T=="number"&&(w=g==="end"?T*-1:T),m?{x:w*y,y:S*h}:{x:S*h,y:w*y}}const UA=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(o){var a,r;const{x:l,y:c,placement:d,middlewareData:g}=o,m=await HA(o,t);return d===((a=g.offset)==null?void 0:a.placement)&&(r=g.arrow)!=null&&r.alignmentOffset?{}:{x:l+m.x,y:c+m.y,data:{...m,placement:d}}}}},BA=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(o){const{x:a,y:r,placement:l,platform:c}=o,{mainAxis:d=!0,crossAxis:g=!1,limiter:m={fn:_=>{let{x:k,y:M}=_;return{x:k,y:M}}},...h}=Ys(t,o),y={x:a,y:r},v=await c.detectOverflow(o,h),S=eo(l),w=Zh(S);let T=y[w],O=y[S];const A=(_,k)=>vS(k+v[_==="y"?"top":"left"],k,k-v[_==="y"?"bottom":"right"]);d&&(T=A(w,T)),g&&(O=A(S,O));const C=m.fn({...o,[w]:T,[S]:O});return{...C,data:{x:C.x-a,y:C.y-r,enabled:{[w]:d,[S]:g}}}}}},VA=function(t){return t===void 0&&(t={}),{options:t,fn(o){var a,r;const{x:l,y:c,placement:d,rects:g,middlewareData:m}=o,{offset:h=0,mainAxis:y=!0,crossAxis:v=!0}=Ys(t,o),S={x:l,y:c},w=eo(d),T=Zh(w);let O=S[T],A=S[w];const C=Ys(h,o),_=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(a=C.mainAxis)!=null?a:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(y){const z=T==="y"?"height":"width",D=g.reference[T]-g.floating[z]+_.mainAxis,L=g.reference[T]+g.reference[z]-_.mainAxis;O<D?O=D:O>L&&(O=L)}if(v){var k,M;const z=T==="y"?"width":"height",D=KS.has(to(d)),L=g.reference[w]-g.floating[z]+(D&&((k=m.offset)==null?void 0:k[w])||0)+(D?0:_.crossAxis),B=g.reference[w]+g.reference[z]+(D?0:((M=m.offset)==null?void 0:M[w])||0)-(D?_.crossAxis:0);A<L?A=L:A>B&&(A=B)}return{[T]:O,[w]:A}}}},FA=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(o){const{placement:a,rects:r,platform:l,elements:c}=o,{apply:d=()=>{},...g}=Ys(t,o),m=await l.detectOverflow(o,g),h=to(a),y=rs(a),v=eo(a)==="y",{width:S,height:w}=r.floating;let T,O;h==="top"||h==="bottom"?(T=h,O=y===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(O=h,T=y==="end"?"top":"bottom");const A=w-m.top-m.bottom,C=S-m.left-m.right,_=Mr(w-m[T],A),k=Mr(S-m[O],C),M=o.middlewareData.shift,z=!M;let D=_,L=k;M!=null&&M.enabled.x&&(L=C),M!=null&&M.enabled.y&&(D=A),z&&!y&&(v?L=S-2*Qo(m.left,m.right):D=w-2*Qo(m.top,m.bottom)),await d({...o,availableWidth:L,availableHeight:D});const B=await l.getDimensions(c.floating);return S!==B.width||w!==B.height?{reset:{rects:!0}}:{}}}};function $S(t){const o=Un(t);let a=parseFloat(o.width)||0,r=parseFloat(o.height)||0;const l=yt(t),c=l?t.offsetWidth:a,d=l?t.offsetHeight:r,g=iu(a)!==c||iu(r)!==d;return g&&(a=c,r=d),{width:a,height:r,$:g}}function um(t){return Je(t)?t:t.contextElement}function Or(t){const o=um(t);if(!yt(o))return Zo(1);const a=o.getBoundingClientRect(),{width:r,height:l,$:c}=$S(o);let d=(c?iu(a.width):a.width)/r,g=(c?iu(a.height):a.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!g||!Number.isFinite(g))&&(g=1),{x:d,y:g}}const YA=Zo(0);function WS(t){const o=Et(t);return!$h()||!o.visualViewport?YA:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function qA(t,o,a){return o===void 0&&(o=!1),!!a&&o&&a===Et(t)}function Oa(t,o,a,r){o===void 0&&(o=!1),a===void 0&&(a=!1);const l=t.getBoundingClientRect(),c=um(t);let d=Zo(1);o&&(r?Je(r)&&(d=Or(r)):d=Or(t));const g=qA(c,a,r)?WS(c):Zo(0);let m=(l.left+g.x)/d.x,h=(l.top+g.y)/d.y,y=l.width/d.x,v=l.height/d.y;if(c&&r){const S=Et(c),w=Je(r)?Et(r):r;let T=S,O=ph(T);for(;O&&w!==T;){const A=Or(O),C=O.getBoundingClientRect(),_=Un(O),k=C.left+(O.clientLeft+parseFloat(_.paddingLeft))*A.x,M=C.top+(O.clientTop+parseFloat(_.paddingTop))*A.y;m*=A.x,h*=A.y,y*=A.x,v*=A.y,m+=k,h+=M,T=Et(O),O=ph(T)}}return Qi({width:y,height:v,x:m,y:h})}function Fu(t,o){const a=ku(t).scrollLeft;return o?o.left+a:Oa(us(t)).left+a}function QS(t,o){const a=t.getBoundingClientRect(),r=a.left+o.scrollLeft-Fu(t,a),l=a.top+o.scrollTop;return{x:r,y:l}}function GA(t){let{elements:o,rect:a,offsetParent:r,strategy:l}=t;const c=l==="fixed",d=us(r),g=o?Nu(o.floating):!1;if(r===d||g&&c)return a;let m={scrollLeft:0,scrollTop:0},h=Zo(1);const y=Zo(0),v=yt(r);if((v||!c)&&((pn(r)!=="body"||ll(d))&&(m=ku(r)),v)){const w=Oa(r);h=Or(r),y.x=w.x+r.clientLeft,y.y=w.y+r.clientTop}const S=d&&!v&&!c?QS(d,m):Zo(0);return{width:a.width*h.x,height:a.height*h.y,x:a.x*h.x-m.scrollLeft*h.x+y.x+S.x,y:a.y*h.y-m.scrollTop*h.y+y.y+S.y}}function XA(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function KA(t){const o=ku(t),a=t.ownerDocument.body,r=Qo(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),l=Qo(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let c=-o.scrollLeft+Fu(t);const d=-o.scrollTop;return Un(a).direction==="rtl"&&(c+=Qo(t.clientWidth,a.clientWidth)-r),{width:r,height:l,x:c,y:d}}const $A=25;function WA(t,o,a){a===void 0&&(a="viewport");const r=a==="layoutViewport",l=Et(t),c=us(t),d=l.visualViewport;let g=c.clientWidth,m=c.clientHeight,h=0,y=0;if(d){const S=!$h()||o==="fixed";r?S||(h=-d.offsetLeft,y=-d.offsetTop):(g=d.width,m=d.height,S&&(h=d.offsetLeft,y=d.offsetTop))}if(Fu(c)<=0){const S=c.ownerDocument,w=S.body,T=getComputedStyle(w),O=S.compatMode==="CSS1Compat"&&parseFloat(T.marginLeft)+parseFloat(T.marginRight)||0,A=Math.abs(c.clientWidth-w.clientWidth-O),C=getComputedStyle(c).scrollbarGutter==="stable both-edges"?A/2:A;C<=$A&&(g-=C)}return{width:g,height:m,x:h,y}}function QA(t,o){const a=Oa(t,!0,o==="fixed"),r=a.top+t.clientTop,l=a.left+t.clientLeft,c=Or(t),d=t.clientWidth*c.x,g=t.clientHeight*c.y,m=l*c.x,h=r*c.y;return{width:d,height:g,x:m,y:h}}function Nx(t,o,a){let r;if(o==="viewport"||o==="layoutViewport")r=WA(t,a,o);else if(o==="document")r=KA(us(t));else if(Je(o))r=QA(o,a);else{const l=WS(t);r={x:o.x-l.x,y:o.y-l.y,width:o.width,height:o.height}}return Qi(r)}function ZA(t,o){const a=o.get(t);if(a)return a;let r=Wi(t,[],!1).filter(g=>Je(g)&&pn(g)!=="body"),l=null;const c=Un(t).position==="fixed";let d=c?ts(t):t;for(;Je(d)&&!Wo(d);){const g=Un(d),m=Kh(d),h=l?l.position:c?"fixed":"";!m&&(h==="fixed"||h==="absolute"&&g.position==="static")?r=r.filter(v=>v!==d):l=g,d=ts(d)}return o.set(t,r),r}function JA(t){let{element:o,boundary:a,rootBoundary:r,strategy:l}=t;const d=[...a==="clippingAncestors"?Nu(o)?[]:ZA(o,this._c):[].concat(a),r],g=Nx(o,d[0],l);let m=g.top,h=g.right,y=g.bottom,v=g.left;for(let S=1;S<d.length;S++){const w=Nx(o,d[S],l);m=Qo(w.top,m),h=Mr(w.right,h),y=Mr(w.bottom,y),v=Qo(w.left,v)}return{width:h-v,height:y-m,x:v,y:m}}function e2(t){const{width:o,height:a}=$S(t);return{width:o,height:a}}function t2(t,o,a){const r=yt(o),l=us(o),c=a==="fixed",d=Oa(t,!0,c,o);let g={scrollLeft:0,scrollTop:0};const m=Zo(0);if((r||!c)&&((pn(o)!=="body"||ll(l))&&(g=ku(o)),r)){const S=Oa(o,!0,c,o);m.x=S.x+o.clientLeft,m.y=S.y+o.clientTop}!r&&l&&(m.x=Fu(l));const h=l&&!r&&!c?QS(l,g):Zo(0),y=d.left+g.scrollLeft-m.x-h.x,v=d.top+g.scrollTop-m.y-h.y;return{x:y,y:v,width:d.width,height:d.height}}function Vp(t){return Un(t).position==="static"}function kx(t,o){if(!yt(t)||Un(t).position==="fixed")return null;if(o)return o(t);let a=t.offsetParent;return us(t)===a&&(a=a.ownerDocument.body),a}function ZS(t,o){const a=Et(t);if(Nu(t))return a;if(!yt(t)){let l=ts(t);for(;l&&!Wo(l);){if(Je(l)&&!Vp(l))return l;l=ts(l)}return a}let r=kx(t,o);for(;r&&lO(r)&&Vp(r);)r=kx(r,o);return r&&Wo(r)&&Vp(r)&&!Kh(r)?a:r||fO(t)||a}const n2=async function(t){const o=this.getOffsetParent||ZS,a=this.getDimensions,r=await a(t.floating);return{reference:t2(t.reference,await o(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function o2(t){return Un(t).direction==="rtl"}const JS={convertOffsetParentRelativeRectToViewportRelativeRect:GA,getDocumentElement:us,getClippingRect:JA,getOffsetParent:ZS,getElementRects:n2,getClientRects:XA,getDimensions:e2,getScale:Or,isElement:Je,isRTL:o2};function e1(t,o){return t.x===o.x&&t.y===o.y&&t.width===o.width&&t.height===o.height}function s2(t,o,a){let r=null,l;const c=us(t);function d(){var y;clearTimeout(l),(y=r)==null||y.disconnect(),r=null}function g(y,v){y===void 0&&(y=!1),v===void 0&&(v=1),d();const S=t.getBoundingClientRect(),{left:w,top:T,width:O,height:A}=S;if(y||o(),!O||!A)return;const C=Hc(T),_=Hc(c.clientWidth-(w+O)),k=Hc(c.clientHeight-(T+A)),M=Hc(w),D={rootMargin:-C+"px "+-_+"px "+-k+"px "+-M+"px",threshold:Qo(0,Mr(1,v))||1};let L=!0;function B(Y){const H=Y[0].intersectionRatio;if(!e1(S,t.getBoundingClientRect()))return g();if(H!==v){if(!L)return g();H?g(!1,H):l=setTimeout(()=>{g(!1,1e-7)},1e3)}L=!1}try{r=new IntersectionObserver(B,{...D,root:c.ownerDocument})}catch{r=new IntersectionObserver(B,D)}r.observe(t)}const m=Et(t),h=()=>g(a);return m.addEventListener("resize",h),g(!0),()=>{m.removeEventListener("resize",h),d()}}function Mx(t,o,a,r){r===void 0&&(r={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:g=typeof IntersectionObserver=="function",animationFrame:m=!1}=r,h=um(t),y=l||c?[...h?Wi(h):[],...o?Wi(o):[]]:[];y.forEach(C=>{l&&C.addEventListener("scroll",a),c&&C.addEventListener("resize",a)});const v=h&&g?s2(h,a,c):null;let S=-1,w=null;d&&(w=new ResizeObserver(C=>{let[_]=C;_&&_.target===h&&w&&o&&(w.unobserve(o),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var k;(k=w)==null||k.observe(o)})),a()}),h&&!m&&w.observe(h),o&&w.observe(o));let T,O=m?Oa(t):null;m&&A();function A(){const C=Oa(t);O&&!e1(O,C)&&a(),O=C,T=requestAnimationFrame(A)}return a(),()=>{var C;y.forEach(_=>{l&&_.removeEventListener("scroll",a),c&&_.removeEventListener("resize",a)}),v?.(),(C=w)==null||C.disconnect(),w=null,m&&cancelAnimationFrame(T)}}const a2=UA,r2=BA,i2=IA,l2=FA,c2=VA,u2=(t,o,a)=>{const r=new Map,l=a??{},c={...JS,...l.platform,_c:r};return PA(t,o,{...l,platform:c})};var f2=typeof document<"u",d2=function(){},eu=f2?b.useLayoutEffect:d2;function fu(t,o){if(t===o)return!0;if(typeof t!=typeof o)return!1;if(typeof t=="function"&&t.toString()===o.toString())return!0;let a,r,l;if(t&&o&&typeof t=="object"){if(Array.isArray(t)){if(a=t.length,a!==o.length)return!1;for(r=a;r--!==0;)if(!fu(t[r],o[r]))return!1;return!0}if(l=Object.keys(t),a=l.length,a!==Object.keys(o).length)return!1;for(r=a;r--!==0;)if(!{}.hasOwnProperty.call(o,l[r]))return!1;for(r=a;r--!==0;){const c=l[r];if(!(c==="_owner"&&t.$$typeof)&&!fu(t[c],o[c]))return!1}return!0}return t!==t&&o!==o}function t1(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function jx(t,o){const a=t1(t);return Math.round(o*a)/a}function Fp(t){const o=b.useRef(t);return eu(()=>{o.current=t}),o}function p2(t){t===void 0&&(t={});const{placement:o="bottom",strategy:a="absolute",middleware:r=[],platform:l,elements:{reference:c,floating:d}={},transform:g=!0,whileElementsMounted:m,open:h}=t,[y,v]=b.useState({x:0,y:0,strategy:a,placement:o,middlewareData:{},isPositioned:!1}),[S,w]=b.useState(r);fu(S,r)||w(r);const[T,O]=b.useState(null),[A,C]=b.useState(null),_=b.useCallback(X=>{X!==D.current&&(D.current=X,O(X))},[]),k=b.useCallback(X=>{X!==L.current&&(L.current=X,C(X))},[]),M=c||T,z=d||A,D=b.useRef(null),L=b.useRef(null),B=b.useRef(y),Y=m!=null,H=Fp(m),I=Fp(l),j=Fp(h),U=b.useCallback(()=>{if(!D.current||!L.current)return;const X={placement:o,strategy:a,middleware:S};I.current&&(X.platform=I.current),u2(D.current,L.current,X).then(Z=>{const W={...Z,isPositioned:j.current!==!1};te.current&&!fu(B.current,W)&&(B.current=W,oo.flushSync(()=>{v(W)}))})},[S,o,a,I,j]);eu(()=>{h===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,v(X=>({...X,isPositioned:!1})))},[h]);const te=b.useRef(!1);eu(()=>(te.current=!0,()=>{te.current=!1}),[]),eu(()=>{if(M&&(D.current=M),z&&(L.current=z),M&&z){if(H.current)return H.current(M,z,U);U()}},[M,z,U,H,Y]);const $=b.useMemo(()=>({reference:D,floating:L,setReference:_,setFloating:k}),[_,k]),P=b.useMemo(()=>({reference:M,floating:z}),[M,z]),q=b.useMemo(()=>{const X={position:a,left:0,top:0};if(!P.floating)return X;const Z=jx(P.floating,y.x),W=jx(P.floating,y.y);return g?{...X,transform:"translate("+Z+"px, "+W+"px)",...t1(P.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:Z,top:W}},[a,g,P.floating,y.x,y.y]);return b.useMemo(()=>({...y,update:U,refs:$,elements:P,floatingStyles:q}),[y,U,$,P,q])}const h2=(t,o)=>{const a=a2(t);return{name:a.name,fn:a.fn,options:[t,o]}},m2=(t,o)=>{const a=r2(t);return{name:a.name,fn:a.fn,options:[t,o]}},g2=(t,o)=>({fn:c2(t).fn,options:[t,o]}),y2=(t,o)=>{const a=i2(t);return{name:a.name,fn:a.fn,options:[t,o]}},b2=(t,o)=>{const a=l2(t);return{name:a.name,fn:a.fn,options:[t,o]}};var Yp={exports:{}},qp={};var _x;function v2(){if(_x)return qp;_x=1;var t=rl();function o(v,S){return v===S&&(v!==0||1/v===1/S)||v!==v&&S!==S}var a=typeof Object.is=="function"?Object.is:o,r=t.useState,l=t.useEffect,c=t.useLayoutEffect,d=t.useDebugValue;function g(v,S){var w=S(),T=r({inst:{value:w,getSnapshot:S}}),O=T[0].inst,A=T[1];return c(function(){O.value=w,O.getSnapshot=S,m(O)&&A({inst:O})},[v,w,S]),l(function(){return m(O)&&A({inst:O}),v(function(){m(O)&&A({inst:O})})},[v]),d(w),w}function m(v){var S=v.getSnapshot;v=v.value;try{var w=S();return!a(v,w)}catch{return!0}}function h(v,S){return S()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:g;return qp.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y,qp}var Dx;function n1(){return Dx||(Dx=1,Yp.exports=v2()),Yp.exports}var fm=n1(),Gp={exports:{}},Xp={};var zx;function x2(){if(zx)return Xp;zx=1;var t=rl(),o=n1();function a(h,y){return h===y&&(h!==0||1/h===1/y)||h!==h&&y!==y}var r=typeof Object.is=="function"?Object.is:a,l=o.useSyncExternalStore,c=t.useRef,d=t.useEffect,g=t.useMemo,m=t.useDebugValue;return Xp.useSyncExternalStoreWithSelector=function(h,y,v,S,w){var T=c(null);if(T.current===null){var O={hasValue:!1,value:null};T.current=O}else O=T.current;T=g(function(){function C(D){if(!_){if(_=!0,k=D,D=S(D),w!==void 0&&O.hasValue){var L=O.value;if(w(L,D))return M=L}return M=D}if(L=M,r(k,D))return L;var B=S(D);return w!==void 0&&w(L,B)?(k=D,L):(k=D,M=B)}var _=!1,k,M,z=v===void 0?null:v;return[function(){return C(y())},z===null?void 0:function(){return C(z())}]},[y,v,S,w]);var A=l(h,T[0],T[1]);return d(function(){O.hasValue=!0,O.value=A},[A]),m(A),A},Xp}var Lx;function S2(){return Lx||(Lx=1,Gp.exports=x2()),Gp.exports}var w2=S2();const T2=om(19),E2=T2?R2:O2;function o1(t,o,a,r,l){return E2(t,o,a,r,l)}function C2(t,o,a,r,l){const c=b.useCallback(()=>o(t.getSnapshot(),a,r,l),[t,o,a,r,l]);return fm.useSyncExternalStore(t.subscribe,c,c)}QR({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let o=!1;for(let a=0;a<t.syncHooks.length;a+=1){const r=t.syncHooks[a],l=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,l)||(o=!0,r.value=l)}return o&&(t.syncTick+=1),t.syncTick})},after(t){t.syncHooks.length>0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=o=>{const a=new Set;for(const l of t.syncHooks)a.add(l.store);const r=[];for(const l of a)r.push(l.subscribe(o));return()=>{for(const l of r)l()}}),fm.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function R2(t,o,a,r,l){const c=WR();if(!c)return C2(t,o,a,r,l);const d=c.syncIndex;c.syncIndex+=1;let g;return c.didInitialize?(g=c.syncHooks[d],(g.store!==t||g.selector!==o||!Object.is(g.a1,a)||!Object.is(g.a2,r)||!Object.is(g.a3,l))&&(g.store!==t&&(c.didChangeStore=!0),g.store=t,g.selector=o,g.a1=a,g.a2=r,g.a3=l,g.value=o(t.getSnapshot(),a,r,l))):(g={store:t,selector:o,a1:a,a2:r,a3:l,value:o(t.getSnapshot(),a,r,l)},c.syncHooks.push(g)),g.value}function O2(t,o,a,r,l){return w2.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,c=>o(c,a,r,l))}class A2{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 a=this.updateTick;for(const r of this.listeners){if(a!==this.updateTick)return;r(o)}}update(o){for(const a in o)if(!Object.is(this.state[a],o[a])){this.setState({...this.state,...o});return}}set(o,a){Object.is(this.state[o],a)||this.setState({...this.state,[o]:a})}notifyAll(){const o={...this.state};this.setState(o)}use(o,a,r,l){return o1(this,o,a,r,l)}}class Da extends A2{constructor(o,a={},r){super(o),this.context=a,this.selectors=r}useSyncedValue(o,a){b.useDebugValue(o);const r=this;we(()=>{r.state[o]!==a&&r.set(o,a)},[r,o,a])}useSyncedValueWithCleanup(o,a){const r=this;we(()=>(r.state[o]!==a&&r.set(o,a),()=>{r.set(o,void 0)}),[r,o,a])}useSyncedValues(o){const a=this,r=Object.values(o);we(()=>{a.update(o)},[a,...r])}useControlledProp(o,a){b.useDebugValue(o);const r=this,l=a!==void 0;we(()=>{l&&!Object.is(r.state[o],a)&&r.setState({...r.state,[o]:a})},[r,o,a,l])}select(o,a,r,l){const c=this.selectors[o];return c(this.state,a,r,l)}useState(o,a,r,l){return b.useDebugValue(o),o1(this,this.selectors[o],a,r,l)}useContextCallback(o,a){b.useDebugValue(o);const r=ke(a??It);this.context[o]=r}useStateSetter(o){const a=b.useRef(void 0);return a.current===void 0&&(a.current=r=>{this.set(o,r)}),a.current}observe(o,a){let r;typeof o=="function"?r=o:r=this.selectors[o];let l=r(this.state);return a(l,l,this),this.subscribe(c=>{const d=r(c);if(!Object.is(l,d)){const g=l;l=d,a(d,g,this)}})}}const N2={open:t=>t.open,transitionStatus:t=>t.transitionStatus,domReferenceElement:t=>t.domReferenceElement,referenceElement:t=>t.positionReference??t.referenceElement,floatingElement:t=>t.floatingElement,floatingId:t=>t.floatingId};class dm extends Da{constructor(o){const{syncOnly:a,nested:r,onOpenChange:l,triggerElements:c,...d}=o;super({...d,positionReference:d.referenceElement,domReferenceElement:d.referenceElement},{onOpenChange:l,dataRef:{current:{}},events:FS(),nested:r,triggerElements:c},N2),this.syncOnly=a}syncOpenEvent=(o,a)=>{(!o||!this.state.open||a!=null&&iO(a))&&(this.context.dataRef.current.openEvent=o?a:void 0)};dispatchOpenChange=(o,a)=>{this.syncOpenEvent(o,a.event);const r={open:o,reason:a.reason,nativeEvent:a.event,nested:this.context.nested,triggerElement:a.trigger};this.context.events.emit("openchange",r)};setOpen=(o,a)=>{if(this.syncOnly){this.context.onOpenChange?.(o,a);return}this.dispatchOpenChange(o,a),this.context.onOpenChange?.(o,a)}}function s1(t){const{popupStore:o,treatPopupAsFloatingElement:a=!1,floatingRootContext:r,floatingId:l,nested:c,onOpenChange:d}=t,g=o.useState("open"),m=o.useState("activeTriggerElement"),h=o.useState(a?"popupElement":"positionerElement"),y=o.context.triggerElements,v=d,S=b.useRef(null);r===void 0&&S.current===null&&(S.current=new dm({open:g,transitionStatus:void 0,referenceElement:m,floatingElement:h,triggerElements:y,onOpenChange:v,floatingId:l,syncOnly:!0,nested:c}));const w=r??S.current;return o.useSyncedValue("floatingId",l),we(()=>{const T={open:g,floatingId:l,referenceElement:m,floatingElement:h};Je(m)&&(T.domReferenceElement=m),w.state.positionReference===w.state.referenceElement&&(T.positionReference=m),w.update(T)},[g,l,m,h,w]),w.context.onOpenChange=v,w.context.nested=c,w}function pm(t,o=!1,a=!1,r=!1){const[l,c]=b.useState(t&&o?"idle":void 0),[d,g]=b.useState(t&&!r);return t&&!d&&(g(!0),c("starting")),!t&&d&&l!=="ending"&&!a&&c("ending"),!t&&!d&&l==="ending"&&c(void 0),we(()=>{if(!t&&d&&l!=="ending"&&a){const m=Eo.request(()=>{c("ending")});return()=>{Eo.cancel(m)}}},[t,d,l,a]),we(()=>{if(!t||o)return;const m=Eo.request(()=>{c(void 0)});return()=>{Eo.cancel(m)}},[o,t]),we(()=>{if(!t||!o)return;t&&d&&l!=="idle"&&c("starting");const m=Eo.request(()=>{c("idle")});return()=>{Eo.cancel(m)}},[o,t,d,l]),{mounted:d,setMounted:g,transitionStatus:l}}let Bc=null;function k2(t){if(!Bc){const o=[];Bc=o,queueMicrotask(()=>{Bc=null,oo.flushSync(()=>{for(const a of o)a()})})}Bc.push(t)}function Yu(t,o=!1,a=!1){const r=kr();return ke((l,c=null)=>{r.cancel();const d=Go(t);if(d==null)return;const g=d,m=()=>{if(!a){oo.flushSync(l);return}k2(()=>{c?.aborted||l()})};if(typeof g.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){l();return}function h(){Promise.all(g.getAnimations().map(y=>y.finished)).then(()=>{c?.aborted||m()},()=>{if(c?.aborted)return;if(g.getAnimations().some(v=>v.pending||v.playState!=="finished")){h();return}m()})}if(o){const y=cS;if(!g.hasAttribute(y)){r.request(h);return}const v=new MutationObserver(()=>{g.hasAttribute(y)||(v.disconnect(),h())});v.observe(g,{attributes:!0,attributeFilter:[y]}),c?.addEventListener("abort",()=>v.disconnect(),{once:!0});return}r.request(h)})}function fs(t){const{enabled:o=!0,open:a,ref:r,batch:l=!1,onComplete:c}=t,d=ke(c),g=Yu(r,a,l);b.useEffect(()=>{if(!o)return;const m=new AbortController;return g(d,m.signal),()=>{m.abort()}},[o,a,d,g])}const hl={tabIndex:-1,[hh]:""};function a1(t){return o=>o==="touch"?t.current:!0}function hm(t,o=!1){const a=Gs(),r=Xs()!=null,l=Qt(()=>t(a,r)).current;return s1({popupStore:l,treatPopupAsFloatingElement:o,floatingRootContext:l.state.floatingRootContext,floatingId:a,nested:r,onOpenChange:l.setOpen}),l}function qu({handle:t,store:o}){return we(()=>t.attachStore(o),[t,o]),null}function Px(t){const o=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==o&&t.set("triggerCount",o)}function r1(t,o){const a=b.useRef(null);return ke(r=>{const l=a.current;if(l!==null){if(l.element===r&&l.store===o&&l.id===t)return;a.current=null;const c=l.store;c.context.triggerElements.getById(l.id)===l.element&&(c.context.triggerElements.delete(l.id),Px(c))}r!==null&&t!==void 0&&(a.current={store:o,id:t,element:r},o.context.triggerElements.add(t,r),Px(o))})}function Gu(t,o,a,r=!1){let l=t.preventUnmountingOnClose;o?l=!1:r&&(l=!0);const c=a?.id??null;let d=t.activeTriggerId,g=t.activeTriggerElement;return(c||o)&&(d=c,g=a??null),{open:o,preventUnmountingOnClose:l,activeTriggerId:d,activeTriggerElement:g}}function mm(t){let o=!1;return t.preventUnmountOnClose=()=>{o=!0},()=>o}function M2(t,o,a,r={}){const l=a.reason,c=l===Bt,d=o&&l===Er,g=!o&&(l===os||l===fl),m=mm(a);if(t.context.onOpenChange?.(o,a),a.isCanceled)return;r.onBeforeDispatch?.(),t.state.floatingRootContext.dispatchOpenChange(o,a);const h=()=>{const y=Gu(t.state,o,a.trigger,m()),v={...r.extraState,...y};d?v.instantType="focus":g?v.instantType="dismiss":c&&(v.instantType=void 0),t.update(v)};c?oo.flushSync(h):h()}function gm(t,o,a,r){const l=a.useState("isMountedByTrigger",t),c=r1(t,a),d=ke(m=>{const h=a.select("open"),y=a.select("activeTriggerId");if(y===t){const v={activeTriggerElement:m,...h?r:null};a.update(v);return}if(y==null&&h){const v={activeTriggerId:t??null,activeTriggerElement:m,...r};a.update(v)}}),g=ke(m=>{c(m),m&&d(m)});return we(()=>(g(o.current),()=>g(null)),[g,o,a,t]),we(()=>{if(l){const m={activeTriggerElement:o.current,...r};a.update(m)}},[l,a,o,...Object.values(r)]),{registerTrigger:g,isMountedByThisTrigger:l}}function Xu(t,o={}){const{closeOnActiveTriggerUnmount:a=!1}=o,r=b.useRef(null),l=t.useState("open"),c=t.useState("triggerCount"),d=t.useState("activeTriggerId"),g=t.useState("activeTriggerElement");we(()=>{if(!l){r.current=null,t.state.triggerCount!==0&&t.set("triggerCount",0);return}const m=t.context.triggerElements.size,h={};t.state.triggerCount!==m&&(h.triggerCount=m);const y=t.select("activeTriggerId");let v=null;if(y){const S=t.context.triggerElements.getById(y);if(S)r.current=y,S!==t.state.activeTriggerElement&&(h.activeTriggerElement=S);else{for(const[w,T]of t.context.triggerElements.entries())if(T===t.state.activeTriggerElement){h.activeTriggerId=w,h.activeTriggerElement=T,r.current=w;break}h.activeTriggerId===void 0&&(r.current===y?v=y:r.current=null)}}else r.current=null;if(!v&&!y&&m===1){const S=t.context.triggerElements.entries().next();if(!S.done){const[w,T]=S.value;h.activeTriggerId=w,h.activeTriggerElement=T,r.current=w}}(h.triggerCount!==void 0||h.activeTriggerId!==void 0||h.activeTriggerElement!==void 0)&&t.update(h),v&&a&&queueMicrotask(()=>{if(t.select("open")&&t.select("activeTriggerId")===v&&!t.context.triggerElements.getById(v)){const S=qe(ns);t.setOpen(!1,S),S.isCanceled||t.update({activeTriggerId:null,activeTriggerElement:null})}})},[l,t,c,d,g,a])}function Ku(t,o,a,r){const{mounted:l,setMounted:c,transitionStatus:d}=pm(t,!1,!1,r),g=o.useState("preventUnmountingOnClose"),m=t?!1:g;o.useSyncedValues({mounted:l,transitionStatus:d,preventUnmountingOnClose:m});const h=ke(()=>{c(!1),o.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),a?.(),o.context.onOpenChangeComplete?.(!1)});return fs({enabled:l&&!t&&!m,open:t,ref:o.context.popupRef,onComplete(){t||h()}}),{forceUnmount:h,transitionStatus:d}}function $u(t,o){t.useSyncedValues(o),we(()=>()=>{t.update({activeTriggerProps:Tt,inactiveTriggerProps:Tt,popupProps:Tt})},[t])}function i1(t,o){we(()=>{!o&&t.state.openMethod!==null&&t.set("openMethod",null)},[o,t]),we(()=>()=>{t.state.openMethod!==null&&t.set("openMethod",null)},[t])}class ml{constructor(){this.idMap=new Map}add(o,a){this.idMap.set(o,a)}delete(o){this.idMap.delete(o)}hasElement(o){for(const a of this.idMap.values())if(a===o)return!0;return!1}hasMatchingElement(o){for(const a of this.idMap.values())if(o(a))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}}function Wu(t,o,a=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new dm({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:t,floatingId:o,syncOnly:!0,nested:a,onOpenChange:void 0}),floatingId:o,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Tt,inactiveTriggerProps:Tt,popupProps:Tt}}const qi=t=>t.triggerIdProp??t.activeTriggerId,ym=t=>t.openProp??t.open,Ix=t=>(t.popupElement?.id??t.floatingId)||void 0;function l1(t,o){return o!==void 0&&ym(t)&&qi(t)===o}function j2(t,o){return l1(t,o)?!0:o!==void 0&&ym(t)&&qi(t)==null&&t.triggerCount===1}const Qu={open:ym,mounted:t=>t.mounted,transitionStatus:t=>t.transitionStatus,floatingRootContext:t=>t.floatingRootContext,triggerCount:t=>t.triggerCount,preventUnmountingOnClose:t=>t.preventUnmountingOnClose,payload:t=>t.payload,activeTriggerId:qi,activeTriggerElement:t=>t.mounted?t.activeTriggerElement:null,popupId:Ix,isTriggerActive:(t,o)=>o!==void 0&&qi(t)===o,isOpenedByTrigger:(t,o)=>l1(t,o),isMountedByTrigger:(t,o)=>o!==void 0&&qi(t)===o&&t.mounted,triggerProps:(t,o)=>o?t.activeTriggerProps:t.inactiveTriggerProps,triggerPopupId:(t,o)=>j2(t,o)?Ix(t):void 0,popupProps:t=>t.popupProps,popupElement:t=>t.popupElement,positionerElement:t=>t.positionerElement};function bm(t){const o=b.useCallback(r=>t===void 0?It:t.subscribeStore(r),[t]),a=b.useCallback(()=>t===void 0?void 0:t.store,[t]);return fm.useSyncExternalStore(o,a,()=>t?.serverStore)}function _2(t){const{open:o=!1,onOpenChange:a,elements:r={}}=t,l=Gs(),c=Xs()!=null,d=Qt(()=>new dm({open:o,transitionStatus:void 0,onOpenChange:a,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new ml,floatingId:l,syncOnly:!1,nested:c})).current;return we(()=>{const g={open:o,floatingId:l};r.reference!==void 0&&(g.referenceElement=r.reference,g.domReferenceElement=Je(r.reference)?r.reference:null),r.floating!==void 0&&(g.floatingElement=r.floating),d.update(g)},[o,l,r.reference,r.floating,d]),d.context.onOpenChange=a,d.context.nested=c,d}function D2(t){return z2(t,t.rootContext)}function z2(t,o){const{nodeId:a,externalTree:r}=t,l=o.useState("referenceElement"),c=o.useState("floatingElement"),d=o.useState("domReferenceElement"),g=o.useState("open"),m=o.useState("floatingId"),[h,y]=b.useState(null),[v,S]=b.useState(void 0),[w,T]=b.useState(void 0),O=b.useRef(null),A=Ks(r),C=b.useMemo(()=>({reference:l,floating:c,domReference:d}),[l,c,d]),_=p2({...t,elements:{...C,...h&&{reference:h}}}),k=Je(v)?v:null,M=w===void 0?o.state.floatingElement:w;o.useSyncedValue("referenceElement",v??null),o.useSyncedValue("domReferenceElement",v===void 0?d:k),o.useSyncedValue("floatingElement",M);const z=b.useCallback(I=>{const j=Je(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),getClientRects:()=>I.getClientRects(),contextElement:I}:I;y(j),_.refs.setReference(j)},[_.refs]),D=b.useCallback(I=>{(Je(I)||I===null)&&(O.current=I,S(I)),(Je(_.refs.reference.current)||_.refs.reference.current===null||I!==null&&!Je(I))&&_.refs.setReference(I)},[_.refs,S]),L=b.useCallback(I=>{T(I),_.refs.setFloating(I)},[_.refs]),B=b.useMemo(()=>({..._.refs,setReference:D,setFloating:L,setPositionReference:z,domReference:O}),[_.refs,D,L,z]),Y=b.useMemo(()=>({..._.elements,domReference:d}),[_.elements,d]),H=b.useMemo(()=>({..._,dataRef:o.context.dataRef,open:g,onOpenChange:o.setOpen,events:o.context.events,floatingId:m,refs:B,elements:Y,nodeId:a,rootStore:o}),[_,B,Y,a,o,g,m]);return we(()=>{d&&(O.current=d)},[d]),we(()=>{o.context.dataRef.current.floatingContext=H;const I=A?.nodesRef.current.find(j=>j.id===a);I&&(I.context=H)}),b.useMemo(()=>({..._,context:H,refs:B,elements:Y,rootStore:o}),[_,B,Y,H,o])}const Kp=Yh&&cs;function c1(t,o={}){const{enabled:a=!0,delay:r}=o,l="rootStore"in t?t.rootStore:t,{events:c,dataRef:d}=l.context,g=b.useRef(!1),m=b.useRef(null),h=b.useRef(!0),y=nn();b.useEffect(()=>{const S=l.select("domReferenceElement");if(!a)return;const w=Et(S);function T(){const C=l.select("domReferenceElement");!l.select("open")&&yt(C)&&C===tn(We(C))&&(g.current=!0,m.current=C)}function O(){h.current=!0}function A(){h.current=!1}return fo(Ge(w,"blur",T),Kp&&Ge(w,"keydown",O,!0),Kp&&Ge(w,"pointerdown",A,!0))},[l,a]),b.useEffect(()=>{if(!a)return;function S(w){if(w.reason===os||w.reason===fl){const T=l.select("domReferenceElement");Je(T)&&(m.current=T,g.current=!0)}}return c.on("openchange",S),()=>{c.off("openchange",S)}},[c,a,l]);const v=b.useMemo(()=>{function S(){g.current=!1,m.current=null}return{onMouseLeave(){S()},onFocus(w){const T=w.currentTarget;if(g.current){if(m.current===T)return;S()}const O=zt(w.nativeEvent);if(Je(O)){if(Kp&&!w.relatedTarget){if(!h.current&&!zu(O))return}else if(!su(O))return}const A=ou(w.relatedTarget,l.context.triggerElements),{nativeEvent:C,currentTarget:_}=w,k=typeof r=="function"?r():r;if(l.select("open")&&A||k===0||k===void 0){l.setOpen(!0,qe(Er,C,_));return}y.start(k,()=>{g.current||l.setOpen(!0,qe(Er,C,_))})},onBlur(w){S();const T=w.relatedTarget,O=w.nativeEvent,A=Je(T)&&T.hasAttribute(Zi("focus-guard"))&&T.getAttribute("data-type")==="outside";y.start(0,()=>{const C=l.select("domReferenceElement"),_=tn(We(C));!T&&_===C||De(d.current.floatingContext?.refs.floating.current,_)||De(C,_)||A||ou(T??_,l.context.triggerElements)||l.setOpen(!1,qe(Er,O))})}}},[d,r,l,y]);return b.useMemo(()=>a?{reference:v,trigger:v}:{},[a,v])}class vm{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new An,this.restTimeout=new An,this.handleCloseOptions=void 0}static create(){return new vm}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const du=new WeakMap;function pu(t){if(!t.performedPointerEventsMutation)return;const o=t.pointerEventsScopeElement;o&&du.get(o)===t&&(t.pointerEventsScopeElement?.style.removeProperty("pointer-events"),t.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),t.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),du.delete(o)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function u1(t,o){const{scopeElement:a,referenceElement:r,floatingElement:l}=o,c=du.get(a);c&&c!==t&&pu(c),pu(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=a,t.pointerEventsReferenceElement=r,t.pointerEventsFloatingElement=l,du.set(a,t),a.style.pointerEvents="none",r.style.pointerEvents="auto",l.style.pointerEvents="auto"}function xm(t){const o=t.context.dataRef.current,a=Qt(()=>o.hoverInteractionState??vm.create()).current;return o.hoverInteractionState||(o.hoverInteractionState=a),Eu(o.hoverInteractionState.disposeEffect),o.hoverInteractionState}function Sm(t,o={}){const{enabled:a=!0,closeDelay:r=0,nodeId:l}=o,c="rootStore"in t?t.rootStore:t,d=c.useState("open"),g=c.useState("floatingElement"),m=c.useState("domReferenceElement"),{dataRef:h}=c.context,y=Ks(),v=Xs(),S=xm(c),w=nn(),T=ke(()=>fS(h.current.openEvent?.type,S.interactedInside)),O=ke(()=>OO(h.current.openEvent?.type)),A=ke(()=>{pu(S)});we(()=>{d||(S.pointerType=void 0,S.restTimeoutPending=!1,S.interactedInside=!1,A())},[d,S,A]),b.useEffect(()=>A,[A]),we(()=>{if(a&&d&&S.handleCloseOptions?.blockPointerEvents&&O()&&Je(m)&&g){const C=m,_=g,k=We(g),M=y?.nodesRef.current.find(B=>B.id===v)?.context?.elements.floating;M&&(M.style.pointerEvents="");const z=S.pointerEventsScopeElement!==_?S.pointerEventsScopeElement:null,D=M!==_?M:null,L=S.handleCloseOptions?.getScope?.()??z??D??C.closest("[data-rootownerid]")??k.body;return u1(S,{scopeElement:L,referenceElement:C,floatingElement:_}),()=>{A()}}},[a,d,m,g,S,O,y,v,A]),b.useEffect(()=>{if(!a)return;function C(){return!!(y&&v&&qs(y.nodesRef.current,v).length>0)}function _(B){const Y=Ra(r,"close",S.pointerType),H=()=>{c.setOpen(!1,qe(Bt,B)),y?.events.emit("floating.closed",B)};Y?S.openChangeTimeout.start(Y,H):(S.openChangeTimeout.clear(),H())}function k(B){const Y=zt(B);if(!CO(Y)){S.interactedInside=!1;return}S.interactedInside=Y?.closest("[aria-haspopup]")!=null}function M(){S.openChangeTimeout.clear(),w.clear(),y?.events.off("floating.closed",D),A()}function z(B){if(C()&&y){y.events.on("floating.closed",D);return}if(ou(B.relatedTarget,c.context.triggerElements))return;const Y=h.current.floatingContext?.nodeId??l,H=B.relatedTarget;if(!(y&&Y&&Je(H)&&qs(y.nodesRef.current,Y,!1).some(j=>De(j.context?.elements.floating,H)))){if(S.handler){S.handler(B);return}A(),O()&&!T()&&_(B)}}function D(B){!y||!v||C()||w.start(0,()=>{y.events.off("floating.closed",D),c.setOpen(!1,qe(Bt,B)),y.events.emit("floating.closed",B)})}const L=g;return fo(L&&Ge(L,"mouseenter",M),L&&Ge(L,"mouseleave",z),L&&Ge(L,"pointerdown",k,!0),()=>{y?.events.off("floating.closed",D)})},[a,g,c,h,r,l,O,T,A,S,y,v,w])}const L2={current:null};function Zu(t,o={}){const{enabled:a=!0,delay:r=0,handleClose:l=null,mouseOnly:c=!1,restMs:d=0,move:g=!0,triggerElementRef:m=L2,externalTree:h,isActiveTrigger:y=!0,getHandleCloseContext:v,isClosing:S,shouldOpen:w,guardStaleOpen:T=!1}=o,O="rootStore"in t?t.rootStore:t,{dataRef:A,events:C}=O.context,_=Ks(h),k=xm(O),M=b.useRef(!1),z=Vt(l),D=Vt(r),L=Vt(d),B=Vt(a),Y=Vt(w),H=Vt(S),I=ke(()=>fS(A.current.openEvent?.type,k.interactedInside)),j=ke(()=>Y.current?.()!==!1),U=ke((P,q,X)=>{const Z=O.context.triggerElements;if(Z.hasElement(q))return!P||!De(P,q);if(!Je(X))return!1;const W=X;return Z.hasMatchingElement(N=>De(N,W))&&(!P||!De(P,W))}),te=ke(()=>{if(!k.handler)return;We(O.select("domReferenceElement")).removeEventListener("mousemove",k.handler),k.handler=void 0}),$=ke(()=>{pu(k)});return y&&(k.handleCloseOptions=l?.__options),b.useEffect(()=>te,[te]),b.useEffect(()=>{if(!a)return;function P(q){q.open?M.current=!1:(M.current=q.reason===Bt,te(),k.openChangeTimeout.clear(),k.restTimeout.clear(),k.blockMouseMove=!0,k.restTimeoutPending=!1)}return C.on("openchange",P),()=>{C.off("openchange",P)}},[a,C,k,te]),b.useEffect(()=>{if(!a)return;function P(V,J=!0){const K=Ra(D.current,"close",k.pointerType);K?k.openChangeTimeout.start(K,()=>{O.setOpen(!1,qe(Bt,V)),_?.events.emit("floating.closed",V)}):J&&(k.openChangeTimeout.clear(),O.setOpen(!1,qe(Bt,V)),_?.events.emit("floating.closed",V))}const q=m.current??(y?O.select("domReferenceElement"):null);if(!Je(q))return;function X(V){if(k.openChangeTimeout.clear(),k.blockMouseMove=!1,c&&!Bs(k.pointerType))return;const J=ux(L.current),K=Ra(D.current,"open",k.pointerType),se=zt(V),re=V.currentTarget??null,me=O.select("domReferenceElement");let pe=re;if(Je(se)&&!O.context.triggerElements.hasElement(se)){for(const Ee of O.context.triggerElements.elements())if(De(Ee,se)){pe=Ee;break}}Je(re)&&Je(me)&&!O.context.triggerElements.hasElement(re)&&De(re,me)&&(pe=me);const be=pe==null?!1:U(me,pe,se),Ce=O.select("open"),Me=H.current?.()??O.select("transitionStatus")==="ending",ye=!Ce&&Me&&M.current,ge=!be&&Je(pe)&&Je(me)&&De(me,pe)&&ye,Te=J>0&&!K,Ae=be&&(Ce||ye)||ge,Ue=!Ce||be;if(Ae){j()&&O.setOpen(!0,qe(Bt,V,pe));return}Te||(K?k.openChangeTimeout.start(K,()=>{Ue&&j()&&O.setOpen(!0,qe(Bt,V,pe))}):Ue&&j()&&O.setOpen(!0,qe(Bt,V,pe)))}function Z(V){if(I()){$();return}te();const J=O.select("domReferenceElement"),K=We(J);k.restTimeout.clear(),k.restTimeoutPending=!1;const se=A.current.floatingContext??v?.();if(ou(V.relatedTarget,O.context.triggerElements))return;if(z.current&&se){O.select("open")||k.openChangeTimeout.clear();const me=m.current;k.handler=z.current({...se,tree:_,x:V.clientX,y:V.clientY,onClose(){$(),te(),B.current&&!I()&&me===O.select("domReferenceElement")&&P(V,!0)}}),K.addEventListener("mousemove",k.handler),k.handler(V);return}(k.pointerType!=="touch"||!De(O.select("floatingElement"),V.relatedTarget))&&P(V)}function W(V){De(q,V.relatedTarget)||(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1)}const N=T?Ge(q,"mouseout",W):void 0;return g?fo(Ge(q,"mousemove",X,{once:!0}),Ge(q,"mouseenter",X),Ge(q,"mouseleave",Z),N):fo(Ge(q,"mouseenter",X),Ge(q,"mouseleave",Z),N)},[te,$,A,D,O,a,z,k,y,U,I,c,g,L,m,_,B,v,H,j,T]),b.useMemo(()=>{if(!a)return;function P(q){k.pointerType=q.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(q){const{nativeEvent:X}=q,Z=q.currentTarget,W=O.select("domReferenceElement"),N=O.select("open"),V=U(W,Z,q.target);if(c&&!Bs(k.pointerType))return;if(N&&V&&k.handleCloseOptions?.blockPointerEvents){const se=O.select("floatingElement");if(se){const re=k.handleCloseOptions?.getScope?.()??Z.ownerDocument.body;u1(k,{scopeElement:re,referenceElement:Z,floatingElement:se})}}const J=ux(L.current);if(N&&!V||J===0||!V&&k.restTimeoutPending&&q.movementX**2+q.movementY**2<2)return;k.restTimeout.clear();function K(){if(k.restTimeoutPending=!1,I())return;const se=O.select("open");!k.blockMouseMove&&(!se||V)&&j()&&O.setOpen(!0,qe(Bt,X,Z))}k.pointerType==="touch"?oo.flushSync(()=>{K()}):V&&N?K():(k.restTimeoutPending=!0,k.restTimeout.start(J,K))}}},[a,k,I,U,c,O,L,j])}const P2="Escape";function Hx(t){return cs&&t.movementX===0&&t.movementY===0}function Ju(t,o,a){switch(t){case"vertical":return o;case"horizontal":return a;default:return o||a}}function Vc(t,o){return Ju(o,t===lS||t===Wh,t===Mu||t===ju)}function $p(t,o,a){return Ju(o,t===Wh,a?t===Mu:t===ju)||t==="Enter"||t===" "||t===""}function I2(t,o,a){return Ju(o,a?t===Mu:t===ju,t===Wh)}function H2(t,o,a,r){const l=a?t===ju:t===Mu,c=t===lS;return o==="both"||o==="horizontal"&&r?t===P2:Ju(o,l,c)}function f1(t,o){const{listRef:a,activeIndex:r,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:d=null,allowEscape:g=!1,loopFocus:m=!1,nested:h=!1,rtl:y=!1,virtual:v=!1,focusItemOnOpen:S="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:T=!0,disabledIndices:O=void 0,orientation:A="vertical",parentOrientation:C,id:_,resetOnPointerLeave:k=!0,externalTree:M,grid:z}=o,D=z!=null,L="rootStore"in t?t.rootStore:t,B=L.useState("open"),Y=L.useState("floatingElement"),H=L.useState("domReferenceElement"),I=L.context.dataRef,j=au(Y),U=gh(H),te=Vt(j),$=Xs(),P=Ks(M),q=b.useRef(S),X=b.useRef(d??-1),Z=b.useRef(null),W=b.useRef(!0),N=ke(le=>{l(X.current===-1?null:X.current,le)}),V=b.useRef(!!Y),J=b.useRef(B),K=b.useRef(!1),se=b.useRef(!1),re=b.useRef(null),me=Vt(O),pe=Vt(B),be=Vt(d),Ce=Vt(k),Me=kr(),ye=kr(),ge=ke(()=>{function le(xe){v?P?.events.emit("virtualfocus",xe):re.current=Jc(xe,{sync:K.current,preventScroll:!0})}const ve=a.current[X.current],he=se.current;ve&&le(ve),(K.current?xe=>xe():xe=>Me.request(xe))(()=>{const xe=a.current[X.current]||ve;if(!xe)return;ve||le(xe),Se&&(he||!W.current)&&xe.scrollIntoView?.({block:"nearest",inline:"nearest"})})});we(()=>{I.current.orientation=A},[I,A]),we(()=>{c&&(B&&Y?(X.current=d??-1,q.current&&d!=null&&(se.current=!0,N())):V.current&&(X.current=-1,N()))},[c,B,Y,d,N]),we(()=>{if(c){if(!B){K.current=!1;return}if(Y)if(r==null){if(K.current=!1,be.current!=null)return;if(V.current&&(X.current=-1,ge()),(!J.current||!V.current)&&q.current&&(Z.current!=null||q.current===!0&&Z.current==null)){let le=0;const ve=()=>{a.current[0]==null?(le<2&&(le?ce=>ye.request(ce):queueMicrotask)(ve),le+=1):(X.current=Z.current==null||$p(Z.current,A,y)||h?Zc(a):bh(a),Z.current=null,N())};ve()}}else Yi(a.current,r)||(X.current=r,ge(),se.current=!1)}},[c,B,Y,r,be,h,a,A,y,N,ge,ye]),we(()=>{if(!c||Y||!P||v||!V.current)return;const le=P.nodesRef.current,ve=le.find(xe=>xe.id===$)?.context?.elements.floating,he=tn(We(H??ve??null)),ce=le.some(xe=>xe.context&&De(xe.context.elements.floating,he));ve&&!ce&&W.current&&ve.focus({preventScroll:!0})},[c,Y,H,P,$,v]),we(()=>{J.current=B,V.current=!!Y}),we(()=>{B||(Z.current=null,q.current=S)},[B,S]);const Te=r!=null,Ae=ke(le=>{if(!pe.current)return;const ve=a.current.indexOf(le.currentTarget);ve!==-1&&(X.current!==ve||r!==ve)&&(X.current=ve,N(le))}),Ue=ke(()=>C??P?.nodesRef.current.find(le=>le.id===$)?.context?.dataRef?.current.orientation),Ee=ke(()=>Zc(a,me.current)),Le=ke(le=>{if(W.current=!1,K.current=!0,le.which===229||!pe.current&&le.currentTarget===te.current)return;if(h&&H2(le.key,A,y,D)){Vc(le.key,Ue())||To(le),L.setOpen(!1,qe(ru,le.nativeEvent)),yt(H)&&(v?P?.events.emit("virtualfocus",H):H.focus());return}const ve=X.current,he=Zc(a,O),ce=bh(a,O);if(U||(le.key==="Home"&&(To(le),X.current=he,N(le)),le.key==="End"&&(To(le),X.current=ce,N(le))),z!=null){const xe=z(le,X.current,a,A,m,y,O,he,ce);if(xe!=null&&(X.current=xe,N(le)),A==="both")return}if(Vc(le.key,A)){if(To(le),B&&!v&&tn(le.currentTarget.ownerDocument)===le.currentTarget){X.current=$p(le.key,A,y)?he:ce,N(le);return}$p(le.key,A,y)?m?ve>=ce?g&&ve!==a.current.length?X.current=-1:(K.current=!1,X.current=he):X.current=$o(a.current,{startingIndex:ve,disabledIndices:O}):X.current=Math.min(ce,$o(a.current,{startingIndex:ve,disabledIndices:O})):m?ve<=he?g&&ve!==-1?X.current=a.current.length:(K.current=!1,X.current=ce):X.current=$o(a.current,{startingIndex:ve,decrement:!0,disabledIndices:O}):X.current=Math.max(he,$o(a.current,{startingIndex:ve,decrement:!0,disabledIndices:O})),Yi(a.current,X.current)&&(X.current=-1),N(le)}}),Se=b.useMemo(()=>({onFocus(ve){K.current=!0,Ae(ve)},onClick:({currentTarget:ve})=>ve.focus({preventScroll:!0}),onMouseMove(ve){Hx(ve)||(K.current=!0,se.current=!1,w&&Ae(ve))},onPointerLeave(ve){if(!pe.current||!W.current||ve.pointerType==="touch")return;K.current=!0;const he=ve.relatedTarget;if(!(!w||a.current.includes(he))&&Ce.current&&(re.current?.(),re.current=null,X.current=-1,N(ve),!v)){const ce=te.current,xe=tn(We(ce));ce&&De(ce,xe)&&ce.focus({preventScroll:!0})}}}),[Ae,pe,te,w,a,N,Ce,v]),Re=b.useMemo(()=>v&&B&&Te&&{"aria-activedescendant":`${_}-${r}`},[v,B,Te,_,r]),Ne=b.useMemo(()=>({...U?{}:Re,onKeyDown(le){if(le.key==="Tab"&&le.shiftKey&&B&&!v){const ve=zt(le.nativeEvent);if(ve&&!De(te.current,ve))return;To(le),L.setOpen(!1,qe(Fs,le.nativeEvent)),yt(H)&&H.focus();return}Le(le)},onPointerMove(le){Hx(le)||(W.current=!0)}}),[Re,Le,te,U,L,B,v,H]),Ie=b.useMemo(()=>{function le(ce){L.setOpen(!0,qe(ru,ce.nativeEvent,ce.currentTarget))}function ve(ce){S==="auto"&&Ou(ce.nativeEvent)&&(q.current=!v)}function he(ce){q.current=S,S==="auto"&&Gh(ce.nativeEvent)&&(q.current=!0)}return{onKeyDown(ce){const xe=L.select("open");W.current=!1;const He=ce.key.startsWith("Arrow"),Lt=I2(ce.key,Ue(),y),Ft=Vc(ce.key,A),ut=(h?Lt:Ft)||ce.key==="Enter"||ce.key.trim()==="";if(v&&xe)return Le(ce);if(!(!xe&&!T&&He)){if(ut){const Oe=Vc(ce.key,Ue());Z.current=h&&Oe?null:ce.key}if(h){Lt&&(To(ce),xe?(X.current=Ee(),N(ce)):le(ce));return}Ft&&(be.current!=null&&(X.current=be.current),To(ce),!xe&&T?le(ce):Le(ce),xe&&N(ce))}},onFocus(ce){L.select("open")&&!v&&(X.current=-1,N(ce))},onPointerDown:he,onPointerEnter:he,onMouseDown:ve,onClick:ve}},[Le,S,Ee,h,N,L,T,A,Ue,y,be,v]),je=b.useMemo(()=>({...Re,...Ie}),[Re,Ie]);return b.useMemo(()=>c?{reference:je,floating:Ne,item:Se,trigger:Ie}:{},[c,je,Ne,Ie,Se])}function d1(t,o){const{listRef:a,elementsRef:r,activeIndex:l,onMatch:c,disabledIndices:d,onTyping:g,enabled:m=!0,resetMs:h=750,selectedIndex:y=null}=o,v="rootStore"in t?t.rootStore:t,S=v.useState("open"),w=nn(),T=b.useRef(""),O=b.useRef(y??l??-1),A=b.useRef(null),C=ke(M=>{function z(te){return r?.current[te]}function D(te){const $=z(te);return $&&!Hu($)||$?.matches(":disabled")?!1:d==null||!Cr(po,te,d)}function L(te,$,P=0){if(te.length===0)return-1;const q=(P%te.length+te.length)%te.length,X=$.toLowerCase();for(let Z=0;Z<te.length;Z+=1){const W=(q+Z)%te.length;if(!(!te[W]?.toLowerCase().startsWith(X)||!D(W)))return W}return-1}const B=a.current;if(T.current.length>0&&M.key===" "&&(To(M),g?.(!0)),T.current.length>0&&T.current[0]!==" "&&L(B,T.current)===-1&&M.key!==" "&&g?.(!1),B==null||M.key.length!==1||M.ctrlKey||M.metaKey||M.altKey)return;S&&M.key!==" "&&(To(M),g?.(!0));const Y=T.current==="";Y&&(O.current=y??l??-1),B.every((te,$)=>te&&D($)?te[0]?.toLowerCase()!==te[1]?.toLowerCase():!0)&&T.current===M.key&&(T.current="",O.current=A.current),T.current+=M.key,w.start(h,()=>{T.current="",O.current=A.current,g?.(!1)});const j=((Y?y??l??-1:O.current)??0)+1,U=L(B,T.current,j);U!==-1?(c?.(U),A.current=U):M.key!==" "&&(T.current="",g?.(!1))}),_=ke(M=>{const z=M.relatedTarget,D=v.select("domReferenceElement"),L=v.select("floatingElement");De(D,z)||De(L,z)||(w.clear(),T.current="",O.current=A.current,g?.(!1))});we(()=>{!S&&y!==null||(w.clear(),A.current=null,T.current!==""&&(T.current=""))},[S,y,w]);const k=b.useMemo(()=>({onKeyDown:C,onBlur:_}),[C,_]);return b.useMemo(()=>m?{reference:k,floating:k}:{},[m,k])}const Ux=.1,U2=Ux*Ux,wt=.5;function Fc(t,o,a,r,l,c){return r>=o!=c>=o&&t<=(l-a)*(o-r)/(c-r)+a}function Yc(t,o,a,r,l,c,d,g,m,h){let y=!1;return Fc(t,o,a,r,l,c)&&(y=!y),Fc(t,o,l,c,d,g)&&(y=!y),Fc(t,o,d,g,m,h)&&(y=!y),Fc(t,o,m,h,a,r)&&(y=!y),y}function B2(t,o,a){return t>=a.x&&t<=a.x+a.width&&o>=a.y&&o<=a.y+a.height}function qc(t,o,a,r,l,c){const d=Math.min(a,l),g=Math.max(a,l),m=Math.min(r,c),h=Math.max(r,c);return t>=d&&t<=g&&o>=m&&o<=h}function ef(t={}){const{blockPointerEvents:o=!1}=t,a=new An,r=({x:l,y:c,placement:d,elements:g,onClose:m,nodeId:h,tree:y})=>{const v=d?.split("-")[0];let S=!1,w=null,T=null,O=typeof performance<"u"?performance.now():0;function A(_,k){const M=performance.now(),z=M-O;if(w===null||T===null||z===0)return w=_,T=k,O=M,!1;const D=_-w,L=k-T,B=D*D+L*L,Y=z*z*U2;return w=_,T=k,O=M,B<Y}function C(){a.clear(),m()}return function(k){a.clear();const M=g.domReference,z=g.floating;if(!M||!z||v==null||l==null||c==null)return;const{clientX:D,clientY:L}=k,B=zt(k),Y=k.type==="mouseleave",H=De(z,B),I=De(M,B);if(H&&(S=!0,!Y))return;if(I&&(S=!1,!Y)){S=!0;return}if(Y&&Je(k.relatedTarget)&&De(z,k.relatedTarget))return;function j(){return!!(y&&qs(y.nodesRef.current,h).length>0)}function U(){j()||C()}if(j())return;const te=M.getBoundingClientRect(),$=z.getBoundingClientRect(),P=l>$.right-$.width/2,q=c>$.bottom-$.height/2,X=$.width>te.width,Z=$.height>te.height,W=(X?te:$).left,N=(X?te:$).right,V=(Z?te:$).top,J=(Z?te:$).bottom;if(v==="top"&&c>=te.bottom-1||v==="bottom"&&c<=te.top+1||v==="left"&&l>=te.right-1||v==="right"&&l<=te.left+1){U();return}let K=!1;switch(v){case"top":K=qc(D,L,W,te.top+1,N,$.bottom-1);break;case"bottom":K=qc(D,L,W,$.top+1,N,te.bottom-1);break;case"left":K=qc(D,L,$.right-1,J,te.left+1,V);break;case"right":K=qc(D,L,te.right-1,J,$.left+1,V);break}if(K)return;if(S&&!B2(D,L,te)){U();return}if(!Y&&A(D,L)){U();return}let se=!1;switch(v){case"top":{const re=X?wt/2:wt*4,me=X||P?l+re:l-re,pe=X?l-re:P?l+re:l-re,be=c+wt+1,Ce=P||X?$.bottom-wt:$.top,Me=P?X?$.bottom-wt:$.top:$.bottom-wt;se=Yc(D,L,me,be,pe,be,$.left,Ce,$.right,Me);break}case"bottom":{const re=X?wt/2:wt*4,me=X||P?l+re:l-re,pe=X?l-re:P?l+re:l-re,be=c-wt,Ce=P||X?$.top+wt:$.bottom,Me=P?X?$.top+wt:$.bottom:$.top+wt;se=Yc(D,L,me,be,pe,be,$.left,Ce,$.right,Me);break}case"left":{const re=Z?wt/2:wt*4,me=Z||q?c+re:c-re,pe=Z?c-re:q?c+re:c-re,be=l+wt+1,Ce=q||Z?$.right-wt:$.left,Me=q?Z?$.right-wt:$.left:$.right-wt;se=Yc(D,L,Ce,$.top,Me,$.bottom,be,me,be,pe);break}case"right":{const re=Z?wt/2:wt*4,me=Z||q?c+re:c-re,pe=Z?c-re:q?c+re:c-re,be=l-wt,Ce=q||Z?$.left+wt:$.right,Me=q?Z?$.left+wt:$.right:$.left+wt;se=Yc(D,L,be,me,be,pe,Ce,$.top,Me,$.bottom);break}}se?S||a.start(40,U):U()}};return r.__options={...t,blockPointerEvents:o},r}const V2={...Qu,disabled:t=>t.disabled,instantType:t=>t.instantType,isInstantPhase:t=>t.isInstantPhase,trackCursorAxis:t=>t.trackCursorAxis,disableHoverablePopup:t=>t.disableHoverablePopup,lastOpenChangeReason:t=>t.openChangeReason,closeOnClick:t=>t.closeOnClick,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class F2 extends Da{constructor(o,a,r){const l=new ml;super(Y2(o,l,a,r),q2(l),V2)}setOpen=(o,a)=>{M2(this,o,a,{extraState:{openChangeReason:a.reason}})};cancelPendingOpen(o){this.state.floatingRootContext.dispatchOpenChange(!1,qe(os,o))}}function Y2(t,o,a,r=!1){return{...Wu(o,a,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t}}function q2(t){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const G2=il(function(o){const{disabled:a=!1,defaultOpen:r=!1,open:l,disableHoverablePopup:c=!1,trackCursorAxis:d="none",actionsRef:g,onOpenChange:m,onOpenChangeComplete:h,handle:y,triggerId:v,defaultTriggerId:S=null,children:w}=o,T=hm((I,j)=>new F2({open:r,openProp:l,activeTriggerId:S,triggerIdProp:v},I,j));T.useControlledProp("openProp",l),T.useControlledProp("triggerIdProp",v),T.useContextCallback("onOpenChange",m),T.useContextCallback("onOpenChangeComplete",h);const O=T.useState("open"),A=!a&&O,C=T.useState("activeTriggerId"),_=T.useState("mounted"),k=T.useState("payload");T.useSyncedValues({trackCursorAxis:d,disableHoverablePopup:c,disabled:a}),Xu(T,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:M,transitionStatus:z}=Ku(A,T),D=T.useState("isInstantPhase"),L=T.useState("instantType"),B=T.useState("lastOpenChangeReason"),Y=b.useRef(null);we(()=>{O&&a&&T.setOpen(!1,qe(AO))},[O,a,T]),we(()=>{z==="ending"&&B===ns||z!=="ending"&&D?(L!=="delay"&&(Y.current=L),T.set("instantType","delay")):Y.current!==null&&(T.set("instantType",Y.current),Y.current=null)},[z,D,B,L,T]),we(()=>{A&&C==null&&T.set("payload",void 0)},[T,C,A]),b.useImperativeHandle(g,()=>({unmount:M,close:()=>T.setOpen(!1,qe(Pu))}),[M,T]);const H=A||_||!a&&d!=="none";return p.jsxs(sS.Provider,{value:T,children:[y&&p.jsx(qu,{handle:y,store:T}),H&&p.jsx(X2,{store:T,disabled:a,trackCursorAxis:d}),typeof w=="function"?w({payload:k}):w]})});function X2({store:t,disabled:o,trackCursorAxis:a}){const r=t.useState("floatingRootContext"),l=pl(r,{enabled:!o,referencePress:()=>t.select("closeOnClick")}),c=jA(r,{enabled:!o&&a!=="none",axis:a==="none"?void 0:a}),d=b.useMemo(()=>no(c.reference,l.reference),[c.reference,l.reference]);return $u(t,{activeTriggerProps:d,inactiveTriggerProps:d,popupProps:l.floating??Tt}),null}function mo(t){return Gs(t,"base-ui")}const p1=b.createContext(void 0);function K2(){return b.useContext(p1)}const $2=600,h1="data-base-ui-tooltip-trigger";function Bx(t){if("composedPath"in t){const a=t.composedPath();for(let r=0;r<a.length;r+=1){const l=a[r];if(Je(l))return l}}const o=t.target;return Je(o)?o:null}function W2(t){let o=t;for(;o;){const a=o.closest(`[${h1}]`);if(a)return a;const r=o.getRootNode();o="host"in r&&Je(r.host)?r.host:null}return null}const Q2=Fh(function(o,a){const{render:r,className:l,style:c,handle:d,payload:g,disabled:m,delay:h,closeOnClick:y=!0,closeDelay:v,id:S,...w}=o,T=Tu(!0),A=bm(d)??T;if(!A)throw new Error(At(82));const C=mo(S),_=A.useState("isTriggerActive",C),k=A.useState("isOpenedByTrigger",C),M=A.useState("floatingRootContext"),z=b.useRef(null),D=v??0,{registerTrigger:L,isMountedByThisTrigger:B}=gm(C,z,A,{payload:g,closeOnClick:y,closeDelay:D}),Y=K2(),{activeIdRef:H,delayRef:I,isInstantPhase:j,hasProvider:U}=jO(M,{open:k}),te=xm(M);A.useSyncedValue("isInstantPhase",j);const $=A.useState("disabled"),P=m??$,q=Vt(P),X=A.useState("trackCursorAxis"),Z=A.useState("disableHoverablePopup"),W=b.useRef(!1),N=nn(),V=b.useRef(void 0);function J(){return U&&H.current!=null?0:h??Y??$2}function K(ge){const Te=z.current;if(!Te||!ge)return!1;const Ae=W2(ge);return Ae!==null&&Ae!==Te&&De(Te,Ae)}function se(ge){const Te=K(ge);return W.current=Te,Te&&(te.openChangeTimeout.clear(),te.restTimeout.clear(),te.restTimeoutPending=!1,N.clear()),Te}const re=Zu(M,{enabled:!P,mouseOnly:!0,move:!1,handleClose:!Z&&X!=="both"?ef():null,restMs:J,delay(){return v==null&&U?{close:Ra(I.current,"close")}:{close:D}},triggerElementRef:z,isActiveTrigger:_,isClosing:()=>A.select("transitionStatus")==="ending",shouldOpen(){return!W.current}}),me=c1(M,{enabled:!P}).reference,pe=ge=>{const Te=W.current,Ae=Bx(ge),Ue=se(Ae),Ee=z.current,Le=Ee&&Ae&&De(Ee,Ae);if(Ue&&A.select("open")&&A.select("lastOpenChangeReason")===Bt){A.setOpen(!1,qe(Bt,ge));return}if(Te&&!Ue&&Le&&!q.current&&!A.select("open")&&Ee&&Bs(V.current)){const Se=()=>{!W.current&&!q.current&&!A.select("open")&&A.setOpen(!0,qe(Bt,ge,Ee))},Re=J();Re===0?(N.clear(),Se()):N.start(Re,Se)}},be=A.useState("triggerProps",B);return et("button",o,{state:{open:k},ref:[a,L,z],props:[re,me,B||X!=="none"?be:void 0,{onMouseOver(ge){pe(ge.nativeEvent)},onFocus(ge){K(Bx(ge.nativeEvent))&&ge.preventBaseUIHandler()},onMouseLeave(){W.current=!1,N.clear(),V.current=void 0},onPointerEnter(ge){V.current=ge.pointerType},onPointerDown(ge){V.current=ge.pointerType,A.set("closeOnClick",y),y&&!A.select("open")&&A.cancelPendingOpen(ge.nativeEvent)},onClick(ge){y&&!A.select("open")&&A.cancelPendingOpen(ge.nativeEvent)},id:C,[mh]:P?"":void 0,[h1]:P?void 0:""},w],stateAttributesMapping:_u})}),m1=b.createContext(void 0);function Z2(){const t=b.useContext(m1);if(t===void 0)throw new Error(At(70));return t}const g1=b.forwardRef(function(o,a){const{children:r,container:l,className:c,render:d,style:g,...m}=o,{node:h,subtree:y}=VS({container:l,ref:a,componentProps:o,elementProps:m});return!y&&!h?null:p.jsxs(b.Fragment,{children:[y,h&&oo.createPortal(r,h)]})}),J2=b.forwardRef(function(o,a){const{keepMounted:r=!1,...l}=o;return Tu().useState("mounted")||r?p.jsx(m1.Provider,{value:r,children:p.jsx(g1,{ref:a,...l})}):null}),y1=b.createContext(void 0);function eN(){const t=b.useContext(y1);if(t===void 0)throw new Error(At(71));return t}const tN=b.createContext(void 0);function tf(){return b.useContext(tN)?.direction??"ltr"}const nN=t=>({name:"arrow",options:t,async fn(o){const{x:a,y:r,placement:l,rects:c,platform:d,elements:g,middlewareData:m}=o,{element:h,padding:y=0,offsetParent:v="real"}=Ys(t,o)||{};if(h==null)return{};const S=xS(y),w={x:a,y:r},T=em(l),O=Jh(T),A=await d.getDimensions(h),C=T==="y",_=C?"top":"left",k=C?"bottom":"right",M=C?"clientHeight":"clientWidth",z=c.reference[O]+c.reference[T]-w[T]-c.floating[O],D=w[T]-c.reference[T],L=v==="real"?await d.getOffsetParent?.(h):g.floating;let B=g.floating[M]||c.floating[O];(!B||!await d.isElement?.(L))&&(B=g.floating[M]||c.floating[O]);const Y=z/2-D/2,H=B/2-A[O]/2-1,I=Math.min(S[_],H),j=Math.min(S[k],H),U=I,te=B-A[O]-j,$=B/2-A[O]/2+Y,P=vS(U,$,te),q=!m.arrow&&rs(l)!=null&&$!==P&&c.reference[O]/2-($<U?I:j)-A[O]/2<0,X=q?$<U?$-U:$-te:0;return{[T]:w[T]+X,data:{[T]:P,centerOffset:$-P-X,...q&&{alignmentOffset:X}},reset:q}}}),oN=(t,o)=>{const{name:a,fn:r}=nN(t);return{name:a,fn:r,options:[t,o]}},sN={name:"hide",async fn(t){const{width:o,height:a,x:r,y:l}=t.rects.reference,c=o===0&&a===0&&r===0&&l===0,d=await t.platform.detectOverflow(t,{elementContext:"reference"});return{data:{referenceHidden:d.top-a>=0||d.right-o>=0||d.bottom-a>=0||d.left-o>=0||c}}}},aN={sideX:"left",sideY:"top"},rN="--available-width",iN="--available-height",lN="--anchor-width",cN="--anchor-height",uN="--transform-origin",Vx=rN,Fx=iN;function b1(t,o,a){const r=t==="inline-start"||t==="inline-end";return{top:"top",right:r?a?"inline-start":"inline-end":"right",bottom:"bottom",left:r?a?"inline-end":"inline-start":"left"}[o]}function Yx(t,o,a){const{rects:r,placement:l}=t;return{side:b1(o,to(l),a),align:rs(l)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function nf(t){return fN(t,D2)}function fN(t,o){const{anchor:a,positionMethod:r="absolute",side:l="bottom",sideOffset:c=0,align:d="center",alignOffset:g=0,collisionBoundary:m,collisionPadding:h=5,sticky:y=!1,arrowPadding:v=5,disableAnchorTracking:S=!1,inline:w,keepMounted:T=!1,floatingRootContext:O,mounted:A,collisionAvoidance:C,shift:_,nodeId:k,adaptiveOrigin:M,lazyFlip:z=!1,externalTree:D}=t,[L,B]=b.useState(null);!A&&L!==null&&B(null);const Y=C.side||"flip",H=C.align||"flip",I=C.fallbackAxisSide||"end",j=_?.crossAxis??!1,U=_?.rootBoundary,te=typeof a=="function"?a:void 0,$=ke(te),P=te?$:a,q=Vt(a),X=Vt(A),W=tf()==="rtl",N=L||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":W?"left":"right","inline-start":W?"right":"left"}[l],V=d==="center"?N:`${N}-${d}`;let J=h;typeof J=="number"?J={top:J,right:J,bottom:J,left:J}:J&&(J={top:J.top||0,right:J.right||0,bottom:J.bottom||0,left:J.left||0});const K=1,se=l==="bottom"?K:0,re=l==="top"?K:0,me=l==="right"?K:0,pe=l==="left"?K:0,be={boundary:m==="clipping-ancestors"?"clippingAncestors":m,padding:J},Ce=b.useRef(null),Me=Vt(c),ye=Vt(g),ge=typeof c!="function"?c:0,Te=typeof g!="function"?g:0,Ae=[];w&&Ae.push(w),Ae.push(h2(Fe=>{const ft=Yx(Fe,l,W),_t=typeof Me.current=="function"?Me.current(ft):Me.current,Pt=typeof ye.current=="function"?ye.current(ft):ye.current;return{mainAxis:_t,crossAxis:Pt,alignmentAxis:Pt}},[ge,Te,W,l]));const Ue=H==="none"&&Y!=="shift",Ee=!Ue&&(y||j||Y==="shift"),Le=Y==="none"?null:y2({...be,padding:{top:J.top+K+se,right:J.right+K+pe,bottom:J.bottom+K+re,left:J.left+K+me},mainAxis:!j&&Y==="flip",crossAxis:H==="flip"?"alignment":!1,fallbackAxisSideDirection:I}),Se=Ue?null:m2({...be,rootBoundary:U,mainAxis:H!=="none",crossAxis:Ee,limiter:y||j?void 0:g2(Fe=>{if(!Ce.current)return{};const{width:ft,height:_t}=Ce.current.getBoundingClientRect(),Pt=eo(to(Fe.placement)),Nn=Pt==="y"?ft:_t,ln=Pt==="y"?J.left+J.right:J.top+J.bottom;return{offset:Nn/2+ln/2}})},[be,y,j,U,J,H]);Y==="shift"||H==="shift"||d==="center"?Ae.push(Se,Le):Ae.push(Le,Se),Ae.push(b2({...be,apply({elements:{floating:Fe},availableWidth:ft,availableHeight:_t,rects:Pt}){if(!X.current)return;const Nn=Fe.style;Nn.setProperty(Vx,`${ft}px`),Nn.setProperty(Fx,`${_t}px`);const ln=Et(Fe).devicePixelRatio||1,{x:yo,y:vn,width:Ro,height:kn}=Pt.reference,Ze=(Math.round((yo+Ro)*ln)-Math.round(yo*ln))/ln,Rt=(Math.round((vn+kn)*ln)-Math.round(vn*ln))/ln;Nn.setProperty(lN,`${Ze}px`),Nn.setProperty(cN,`${Rt}px`)}}),oN(Fe=>({element:Ce.current||We(Fe.elements.floating).createElement("div"),padding:Ce.current?v:0,offsetParent:"floating"}),[v]),{name:"transformOrigin",fn(Fe){const{elements:{floating:ft},middlewareData:_t,placement:Pt,platform:Nn,rects:ln,y:yo}=Fe,vn=to(Pt),Ro=rs(Pt),kn=eo(vn)==="y",Ze=Ce.current,Rt=typeof c=="function"?c(Yx(Fe,l,W)):c;let Mn;if(!Ze&&Ro&&Math.abs(kn?_t.shift?.x||0:_t.shift?.y||0)<=1)Mn=Ro==="start"===(kn&&Nn.isRTL?.(ft)===!0)?"100%":"0%";else{const bo=kn?_t.arrow?.x||0:_t.arrow?.y||0,ps=kn?Ze?.clientWidth||0:Ze?.clientHeight||0;Mn=`${bo+ps/2}px`}let ao=vn==="top"||vn==="left"?`calc(100% + ${Rt}px)`:`${-Rt}px`;return Ee&&kn&&Math.abs(_t.shift?.y||0)>Rt&&(ao=`${ln.reference.y+ln.reference.height/2-yo}px`),ft.style.setProperty(uN,kn?`${Mn} ${ao}`:`${ao} ${Mn}`),{}}},sN,M),we(()=>{!A&&O&&O.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[A,O]);const Re=b.useMemo(()=>({ancestorScroll:!S,elementResize:!S&&typeof ResizeObserver<"u",layoutShift:!S&&typeof IntersectionObserver<"u"}),[S]),{refs:Ne,elements:Ie,x:je,y:le,middlewareData:ve,update:he,placement:ce,context:xe,isPositioned:He,floatingStyles:Lt}=o({rootContext:O,open:T?A:void 0,placement:V,middleware:Ae,strategy:r,whileElementsMounted:T?void 0:(...Fe)=>Mx(...Fe,Re),nodeId:k,externalTree:D}),{sideX:Ft,sideY:ut}=ve.adaptiveOrigin||aN,Oe=He?r:"fixed",Ye=b.useMemo(()=>{let Fe;return He?M?Fe={position:Oe,[Ft]:je,[ut]:le}:Fe={...Lt,position:Oe}:Fe={position:Oe,top:0,left:0},Fe[Vx]="100vw",Fe[Fx]="100vh",He||(Fe.opacity=0),Fe},[M,Oe,Ft,je,ut,le,Lt,He]),Qe=b.useRef(null);we(()=>{if(!A)return;const Fe=q.current,ft=typeof Fe=="function"?Fe():Fe,Pt=(qx(ft)?ft.current:ft)||null||null;Pt!==Qe.current&&(Ne.setPositionReference(Pt),Qe.current=Pt)},[A,Ne,P,q]),b.useEffect(()=>{if(!A)return;const Fe=q.current;typeof Fe!="function"&&qx(Fe)&&Fe.current!==Qe.current&&(Ne.setPositionReference(Fe.current),Qe.current=Fe.current)},[A,Ne,P,q]),b.useEffect(()=>{if(T&&A&&Ie.reference&&Ie.floating)return Mx(Ie.reference,Ie.floating,he,Re)},[T,A,Ie,he,Re]);const ct=to(ce),Jt=b1(l,ct,W),rn=rs(ce)||"center",hn=!!ve.hide?.referenceHidden;we(()=>{z&&A&&He&&ct!==N&&B(ct)},[z,A,He,ct,N]);const bt=b.useMemo(()=>({position:"absolute",top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),jt=ve.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:Ye,arrowStyles:bt,arrowRef:Ce,arrowUncentered:jt,side:Jt,align:rn,physicalSide:ct,anchorHidden:hn,refs:Ne,context:xe,isPositioned:He,update:he}),[Ye,bt,Ce,jt,Jt,rn,ct,hn,Ne,xe,He,he])}function qx(t){return t!=null&&"current"in t}function gl(t){return t==="starting"?wA:Tt}function of(t,o,{styles:a,transitionStatus:r,props:l,refs:c,hidden:d,inert:g=!1}){const m={...a};return g&&(m.pointerEvents="none"),et("div",t,{state:o,ref:c,props:[{role:"presentation",hidden:d,style:m},gl(r),l],stateAttributesMapping:ul})}const dN=b.forwardRef(function(o,a){const{render:r,className:l,anchor:c,positionMethod:d="absolute",side:g="top",align:m="center",sideOffset:h=0,alignOffset:y=0,collisionBoundary:v="clipping-ancestors",collisionPadding:S=5,arrowPadding:w=5,sticky:T=!1,disableAnchorTracking:O=!1,collisionAvoidance:A=rm,style:C,..._}=o,k=Tu(),M=Z2(),z=k.useState("open"),D=k.useState("mounted"),L=k.useState("trackCursorAxis"),B=k.useState("disableHoverablePopup"),Y=k.useState("floatingRootContext"),H=k.useState("instantType"),I=k.useState("transitionStatus"),j=k.useState("adaptiveOrigin"),U=nf({anchor:c,positionMethod:d,floatingRootContext:Y,mounted:D,side:g,sideOffset:h,align:m,alignOffset:y,collisionBoundary:v,collisionPadding:S,sticky:T,arrowPadding:w,disableAnchorTracking:O,keepMounted:M,collisionAvoidance:A,adaptiveOrigin:j}),te=b.useMemo(()=>({open:z,side:U.side,align:U.align,anchorHidden:U.anchorHidden,instant:L!=="none"?"tracking-cursor":H}),[z,U.side,U.align,U.anchorHidden,L,H]),$=of(o,te,{styles:U.positionerStyles,transitionStatus:I,props:_,refs:[a,k.useStateSetter("positionerElement")],hidden:!D,inert:!z||L==="both"||B});return p.jsx(y1.Provider,{value:U,children:$})}),pN=b.forwardRef(function(o,a){const{render:r,className:l,style:c,...d}=o,g=Tu(),{side:m,align:h}=eN(),y=g.useState("open"),v=g.useState("instantType"),S=g.useState("transitionStatus"),w=g.useState("popupProps"),T=g.useState("floatingRootContext"),O=g.useState("disabled"),A=g.useState("closeDelay");fs({open:y,ref:g.context.popupRef,onComplete(){y&&g.context.onOpenChangeComplete?.(!0)}}),Sm(T,{enabled:!O,closeDelay:A});const C=g.useStateSetter("popupElement");return et("div",o,{state:{open:y,side:m,align:h,instant:v,transitionStatus:S},ref:[a,g.context.popupRef,C],props:[hl,w,gl(S),d],stateAttributesMapping:Du})}),hN=function(o){const{delay:a,closeDelay:r,timeout:l=400}=o,c=b.useMemo(()=>({open:a,close:r}),[a,r]);return p.jsx(p1.Provider,{value:a,children:p.jsx(MO,{delay:c,timeoutMs:l,children:o.children})})};function yl(t){return om(19)?t:t?"true":void 0}function mN(t){const[o,a]=b.useState({current:t,previous:null});return Object.is(t,o.current)||a({current:t,previous:o.current}),o.previous}function v1({label:t,shortcut:o,side:a="bottom",children:r}){return p.jsxs(G2,{children:[p.jsx(Q2,{render:r}),p.jsx(J2,{children:p.jsx(dN,{side:a,sideOffset:6,className:"z-[1000]",children:p.jsxs(pN,{className:"rounded-md bg-fg px-2 py-1 text-xs text-surface shadow-popup data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 transition-opacity",children:[t,o?p.jsx("span",{className:"ml-2 opacity-60",children:o}):null]})})})]})}function gN({children:t}){return p.jsx(hN,{delay:500,closeDelay:0,children:t})}function yN(t){return t.repeat&&(t.key==="Enter"||t.key===" ")}function jr(t){yN(t)&&t.target===t.currentTarget&&t.preventDefault()}function x1(t){return t?o=>{jr(o),t(o)}:jr}const bN=200,vN=2e3;function xN(t,o,a){let r=null,l=!1;const c=()=>{l||(l=!0,t.removeEventListener("keydown",d,!0),t.removeEventListener("keyup",d,!0),t.clearTimeout(g),r!==null&&t.clearTimeout(r))},d=m=>{const h=m.key==="Enter"||m.key===" ";if(m.type==="keyup"){m.key===" "&&!a(m.target)&&m.preventDefault(),m.key===o&&r===null&&(r=t.setTimeout(c,bN));return}h&&!a(m.target)&&(m.preventDefault(),m.stopImmediatePropagation())},g=t.setTimeout(c,vN);return t.addEventListener("keydown",d,!0),t.addEventListener("keyup",d,!0),c}const SN={primary:"bg-accent text-accent-fg hover:brightness-110 active:brightness-95",secondary:"bg-surface text-fg border border-line hover:bg-hover",ghost:"bg-transparent text-fg hover:bg-hover",danger:"bg-danger text-white hover:brightness-110"},wN={sm:"h-6 px-2 text-xs gap-1",md:"h-7 px-2.5 text-[13px] gap-1.5",lg:"h-8 px-3 text-[13px] gap-2"},it=b.forwardRef(function({variant:o="secondary",size:a="md",icon:r,className:l,children:c,type:d="button",onKeyDown:g,...m},h){return p.jsxs("button",{ref:h,type:d,className:lt("inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-control font-medium transition-[background,filter]","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent","disabled:pointer-events-none disabled:opacity-45",SN[o],wN[a],l),...m,onKeyDown:x1(g),children:[r,c]})}),TN={sm:"size-6",md:"size-7",lg:"size-8"},za=b.forwardRef(function({label:o,icon:a,shortcut:r,active:l,size:c="md",noTooltip:d,className:g,type:m="button",onKeyDown:h,...y},v){const S=p.jsx("button",{ref:v,type:m,"aria-label":o,"aria-pressed":l===void 0?void 0:l,className:lt("inline-flex shrink-0 items-center justify-center rounded-control text-fg-muted transition-colors","hover:bg-hover hover:text-fg focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent","disabled:pointer-events-none disabled:opacity-40",l&&"bg-accent-soft text-accent hover:bg-accent-soft hover:text-accent",TN[c],g),...y,onKeyDown:x1(h),children:a});return d?S:p.jsx(v1,{label:o,shortcut:r,children:S})}),S1=b.createContext(void 0);function wm(t){const o=b.useContext(S1);if(o===void 0&&!t)throw new Error(At(33));return o}const w1=b.createContext(void 0);function $s(t){const o=b.useContext(w1);if(o===void 0&&!t)throw new Error(At(36));return o}const EN=b.createContext(void 0);function Tm(t=!0){const o=b.useContext(EN);if(o===void 0&&!t)throw new Error(At(25));return o}function Ji({controlled:t,default:o,name:a,state:r="value"}){const{current:l}=b.useRef(t!==void 0),[c,d]=b.useState(o),g=l&&t!==void 0?t:c,m=b.useCallback(h=>{l||d(h)},[]);return[g,m]}const T1=b.createContext(void 0);function Em(t=!1){const o=b.useContext(T1);if(o===void 0&&!t)throw new Error(At(16));return o}function CN(t){const{focusableWhenDisabled:o,disabled:a,composite:r=!1,tabIndex:l=0,isNativeButton:c}=t,d=r&&o!==!1,g=r&&o===!1;return{props:b.useMemo(()=>{const h={onKeyDown(y){a&&o&&y.key!=="Tab"&&y.preventDefault()}};return r||(h.tabIndex=l,!c&&a&&(h.tabIndex=o?l:-1)),(c&&(o||d)||!c&&a)&&(h["aria-disabled"]=a),c&&(!o||g)&&(h.disabled=a),h},[r,a,o,d,g,c,l])}}function Gi(t,o,{detail:a=0}={}){t.dispatchEvent(new(Et(t)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:a,shiftKey:o.shiftKey,ctrlKey:o.ctrlKey,altKey:o.altKey,metaKey:o.metaKey}))}function Co(t={}){const{disabled:o=!1,focusableWhenDisabled:a,tabIndex:r=0,native:l=!0,composite:c}=t,d=b.useRef(null),g=Em(!0),m=c??g!==void 0,{props:h}=CN({focusableWhenDisabled:a,disabled:o,composite:m,tabIndex:r,isNativeButton:l}),y=b.useCallback(()=>{const w=d.current;Wp(w)&&m&&o&&h.disabled===void 0&&w.disabled&&(w.disabled=!1)},[o,h.disabled,m]);we(y,[y]);const v=b.useCallback((w={})=>{const{onClick:T,onMouseDown:O,onKeyUp:A,onKeyDown:C,onPointerDown:_,...k}=w;return no({onClick(M){if(o){M.preventDefault();return}T?.(M)},onMouseDown(M){o||O?.(M)},onKeyDown(M){if(o||(uu(M),C?.(M),M.baseUIHandlerPrevented))return;const z=M.target===M.currentTarget,D=M.currentTarget,L=Wp(D),B=!l&&RN(D),Y=z&&(l?L:!B),H=M.key==="Enter",I=M.key===" ",j=D.getAttribute("role"),U=j?.startsWith("menuitem")||j==="option"||j==="gridcell";if(z&&m&&I){if(M.defaultPrevented&&U)return;M.preventDefault(),(!l||L)&&(M.preventBaseUIHandler(),Gi(D,M));return}if(!Y||l||!I&&!H){z&&B&&I&&M.preventDefault();return}M.defaultPrevented||(M.preventDefault(),H&&(M.preventBaseUIHandler(),Gi(D,M)))},onKeyUp(M){if(!o){if(uu(M),A?.(M),M.target===M.currentTarget&&l&&m&&Wp(M.currentTarget)&&M.key===" "){M.preventDefault();return}M.baseUIHandlerPrevented||M.target===M.currentTarget&&!l&&!m&&!M.defaultPrevented&&M.key===" "&&(M.preventBaseUIHandler(),Gi(M.currentTarget,M))}},onPointerDown(M){if(o){M.preventDefault();return}_?.(M)}},l?{type:"button"}:{role:"button"},h,k)},[o,h,m,l]),S=ke(w=>{d.current=w,y()});return{getButtonProps:v,buttonRef:S}}function Wp(t){return yt(t)&&t.tagName==="BUTTON"}function RN(t){return yt(t)&&t.tagName==="A"&&!!t.href}function ON(t){const{closeOnClick:o,highlighted:a,id:r,nodeId:l,store:c,typingRef:d,itemRef:g,itemMetadata:m}=t,{events:h}=c.useState("floatingTreeRoot"),y=c.useState("open"),v=Tm(!0),S=v!==void 0;return b.useMemo(()=>({id:r,role:"menuitem",tabIndex:y&&a?0:-1,onKeyDown(w){w.key===" "&&d?.current&&w.preventDefault()},onMouseMove(w){l&&h.emit("itemhover",{nodeId:l,target:w.currentTarget})},onClick(w){o&&h.emit("close",{domEvent:w,reason:Fi})},onMouseUp(w){if(v){const T=v.initialCursorPointRef.current;if(v.initialCursorPointRef.current=null,S&&T&&Math.abs(w.clientX-T.x)<=1&&Math.abs(w.clientY-T.y)<=1||S&&!Yh&&w.button===2)return}g.current&&c.context.allowMouseUpTriggerRef.current&&(!S||w.button===2)&&m.type==="regular-item"&&Gi(g.current,w,{detail:1})}}),[o,a,r,h,l,y,c,d,g,v,S,m])}const AN={type:"regular-item"};function E1(t){const{closeOnClick:o,disabled:a,highlighted:r,id:l,store:c,typingRef:d=c.context.typingRef,nativeButton:g,itemMetadata:m,nodeId:h}=t,y=b.useRef(null),{getButtonProps:v,buttonRef:S}=Co({disabled:a,focusableWhenDisabled:!0,native:g,composite:!0}),w=ON({closeOnClick:o,highlighted:r,id:l,nodeId:h,store:c,typingRef:d,itemRef:y,itemMetadata:m}),T=b.useCallback(A=>no(w,{onMouseEnter(){m.type==="submenu-trigger"&&m.setActive()}},A,v),[w,v,m]),O=ss(y,S);return b.useMemo(()=>({getItemProps:T,itemRef:O}),[T,O])}const C1=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function NN(){return b.useContext(C1)}function sf(t={}){const{guess:o,label:a,metadata:r,textRef:l,index:c}=t,{register:d,unregister:g,subscribeMapChange:m,nextIndexRef:h}=NN(),y=b.useRef(-1),[v,S]=b.useState(c==null&&o?()=>{if(y.current===-1){const A=h.current;h.current+=1,y.current=A}return y.current}:-1),w=c??v,T=b.useRef(null),O=b.useCallback(A=>{const C=T.current;C&&g(C),T.current=A,A&&d(A,{metadata:r??null,index:c??null,label:a,textRef:l})},[c,d,g,r,a,l]);return we(()=>{if(c==null)return m(A=>{const C=T.current?A.get(T.current)?.index:null;C!=null&&S(C)})},[c,m]),{ref:O,index:w}}const R1=b.forwardRef(function(o,a){const{render:r,className:l,id:c,label:d,nativeButton:g=!1,disabled:m=!1,closeOnClick:h=!0,style:y,...v}=o,S=sf({guess:!0,label:d}),w=wm(!0),T=mo(c),{store:O}=$s(),A=O.useState("disabled"),C=m||A,_=O.useState("isActive",S.index),k=O.useState("itemProps"),{getItemProps:M,itemRef:z}=E1({closeOnClick:h,disabled:C,highlighted:_,id:T,store:O,nativeButton:g,nodeId:w?.context.nodeId,itemMetadata:AN});return et("div",o,{state:{disabled:C,highlighted:_},props:[k,v,M],ref:[z,a,S.ref]})}),kN=b.createContext(void 0);function af(t){return b.useContext(kN)}const wh="ArrowUp",Th="ArrowDown",Eh="ArrowLeft",Ch="ArrowRight",Rh="Home",Oh="End",bl=new Set([wh,Th,Eh,Ch,Rh,Oh]),MN="Shift",jN=[MN,"Control","Alt","Meta"];function _N(t){return yt(t)&&t.tagName==="INPUT"}function Gx(t){return!!(_N(t)&&t.selectionStart!=null||yt(t)&&t.tagName==="TEXTAREA")}function Xx(t,o,a,r){if(!t||!o||!o.scrollTo)return;let l=t.scrollLeft,c=t.scrollTop;const d=t.clientWidth<t.scrollWidth,g=t.clientHeight<t.scrollHeight;if(d&&r!=="vertical"){const m=Kx(t,o,"left"),h=Gc(t),y=Gc(o);a==="ltr"&&(m+o.offsetWidth+y.scrollMarginRight>t.scrollLeft+t.clientWidth-h.scrollPaddingRight?l=m+o.offsetWidth+y.scrollMarginRight-t.clientWidth+h.scrollPaddingRight:m-y.scrollMarginLeft<t.scrollLeft+h.scrollPaddingLeft&&(l=m-y.scrollMarginLeft-h.scrollPaddingLeft)),a==="rtl"&&(m-y.scrollMarginLeft<t.scrollLeft+h.scrollPaddingLeft?l=m-y.scrollMarginLeft-h.scrollPaddingLeft:m+o.offsetWidth+y.scrollMarginRight>t.scrollLeft+t.clientWidth-h.scrollPaddingRight&&(l=m+o.offsetWidth+y.scrollMarginRight-t.clientWidth+h.scrollPaddingRight))}if(g&&r!=="horizontal"){const m=Kx(t,o,"top"),h=Gc(t),y=Gc(o);m-y.scrollMarginTop<t.scrollTop+h.scrollPaddingTop?c=m-y.scrollMarginTop-h.scrollPaddingTop:m+o.offsetHeight+y.scrollMarginBottom>t.scrollTop+t.clientHeight-h.scrollPaddingBottom&&(c=m+o.offsetHeight+y.scrollMarginBottom-t.clientHeight+h.scrollPaddingBottom)}t.scrollTo({left:l,top:c,behavior:"auto"})}function Kx(t,o,a){const r=a==="left"?"offsetLeft":"offsetTop";let l=0;for(;o.offsetParent&&(l+=o[r],o.offsetParent!==t);)o=o.offsetParent;return l}function Gc(t){const o=getComputedStyle(t);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 Cm=b.forwardRef(function(o,a){const{render:r,className:l,style:c,finalFocus:d,...g}=o,{store:m}=$s(),{side:h,align:y}=wm(),v=af()!=null,S=m.useState("open"),w=m.useState("transitionStatus"),T=m.useState("popupProps"),O=m.useState("mounted"),A=m.useState("instantType"),C=m.useState("activeTriggerElement"),_=m.useState("parent"),k=m.useState("lastOpenChangeReason"),M=m.useState("rootId"),z=m.useState("floatingRootContext"),D=m.useState("floatingTreeRoot"),L=m.useState("closeDelay"),B=m.useState("hoverEnabled"),Y=m.useState("disabled"),H=m.useState("openMethod"),I=_.type==="context-menu";fs({open:S,ref:m.context.popupRef,onComplete(){S&&m.context.onOpenChangeComplete?.(!0)}}),b.useEffect(()=>{function P(q){m.setOpen(!1,qe(q.reason,q.domEvent))}return D.events.on("close",P),()=>{D.events.off("close",P)}},[D.events,m]),Sm(z,{enabled:B&&!Y&&!I&&_.type!=="menubar",closeDelay:L});const j=m.useStateSetter("popupElement"),U={transitionStatus:w,side:h,align:y,open:S,nested:_.type==="menu",instant:A},te=et("div",o,{state:U,ref:[a,m.context.popupRef,j],stateAttributesMapping:Du,props:[T,{onKeyDown(P){v&&bl.has(P.key)&&P.stopPropagation()}},gl(w),g,{"data-rootownerid":M}]});let $=_.type===void 0||I;return(C||_.type==="menubar"&&k!==Lu)&&($=!0),p.jsx(Bu,{context:z,openInteractionType:H,modal:I,disabled:!O,returnFocus:d===void 0?$:d,initialFocus:_.type!=="menu",restoreFocus:!0,externalTree:_.type!=="menubar"?D:void 0,previousFocusableElement:C,nextFocusableElement:_.type===void 0?m.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?m.context.beforeContentFocusGuardRef:void 0,children:te})}),O1=b.createContext(void 0);function DN(){const t=b.useContext(O1);if(t===void 0)throw new Error(At(32));return t}const Rm=b.forwardRef(function(o,a){const{keepMounted:r=!1,...l}=o,{store:c,parent:d}=$s();if(!(c.useState("mounted")||r))return null;const h=d.type==="menu"||d.type==="menubar"?"group":void 0;return p.jsx(O1.Provider,{value:r,children:p.jsx(Uu,{ref:a,...l,portalOwnerRole:h})})});function Om(t){const{children:o,elementsRef:a,labelsRef:r,onMapChange:l}=t,c=ke(l),[,d]=b.useState(!1),g=Qt(LN).current,m=Qt(zN).current,h=b.useRef(0),y=b.useRef(!0),v=b.useRef(null),S=b.useRef(null),w=ke(()=>{y.current||(y.current=!0,d(z=>!z))}),T=ke((z,D)=>{m.set(z,D),w()}),O=ke(z=>{m.delete(z),w()}),A=ke(z=>{const D=new Map;return a.current.length=0,r&&(r.current.length=0),z.forEach(L=>{D.set(L.element,{...L.registration.metadata??{},index:L.index}),a.current[L.index]=L.element,r&&(r.current[L.index]=L.registration.label!==void 0?L.registration.label:L.registration.textRef?.current?.textContent??L.element.textContent)}),h.current=a.current.length,D});function C(z){if(S.current?.disconnect(),S.current=null,typeof MutationObserver!="function"||z.length<2)return;const D=new MutationObserver(B=>{if(!HN(B))return;let Y=null;for(const H of z)if(H.isConnected){if(Y&&A1(Y,H)>0){D.disconnect(),w();return}Y=H}});S.current=D;const L=new Set;for(let B=1;B<z.length;B+=1){const Y=IN(z[B-1],z[B]);Y&&L.add(Y)}L.forEach(B=>D.observe(B,{childList:!0}))}const _=ke(()=>{const[z,D]=PN(m),L=A(z),B=v.current,Y=!B||B.length!==z.length||z.some((H,I)=>{const j=B[I];return H.index!==j.index||H.element!==j.element||H.registration.index!==j.registration.index||H.registration.metadata!==j.registration.metadata});C(D),v.current=z,y.current=!1,Y&&(g.forEach(H=>H(L)),c(L))});we(()=>(!y.current&&v.current&&A(v.current),()=>{a.current=[],r&&(r.current=[])}),[a,r,A]),we(()=>{y.current&&_()}),we(()=>()=>{S.current?.disconnect(),y.current=!0},[]);const k=ke(z=>(g.add(z),()=>{g.delete(z)})),M=b.useMemo(()=>({register:T,unregister:O,subscribeMapChange:k,nextIndexRef:h}),[T,O,k,h]);return p.jsx(C1.Provider,{value:M,children:o})}function zN(){return new Map}function LN(){return new Set}function PN(t){const o=new Set,a=[],r=[];t.forEach((c,d)=>{if(!d.isConnected)return;const g=c.index,m={index:g??-1,element:d,registration:c};g===null?r.push(m):g>=0&&(o.add(g),a.push(m))});let l=0;return r.sort((c,d)=>A1(c.element,d.element)),r.forEach(c=>{for(;o.has(l);)l+=1;c.index=l,a.push(c),l+=1}),o.size>0&&a.sort((c,d)=>c.index-d.index),[a,r.map(c=>c.element)]}function IN(t,o){let a=t.parentElement;for(;a&&!a.contains(o);)a=a.parentElement;return a}function HN(t){for(const o of t)for(let a=0;a<o.removedNodes.length;a+=1)if(o.removedNodes[a].isConnected)return!0;return!1}function A1(t,o){return t.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const rf=b.forwardRef(function(o,a){const{cutout:r,...l}=o;let c;if(r){const d=r.getBoundingClientRect();c=`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 p.jsx("div",{ref:a,role:"presentation","data-base-ui-inert":"",...l,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:c}})});let $x={},Wx={},Qx="";function lf(t,o){return ll(t)?t:o}function Zx(t,o,a){return/hidden|clip/.test(t.getComputedStyle(lf(o,a)).overflowY)}function UN(t){if(typeof document>"u")return!1;const o=We(t);return Et(o).innerWidth-o.documentElement.clientWidth>0}function BN(t){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const a=We(t),r=a.documentElement,l=a.body,c=lf(r,l),d=c.style.overflowY,g=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",c.style.overflowY="scroll";const m=c.offsetWidth;c.style.overflowY="hidden";const h=c.offsetWidth;return c.style.overflowY=d,r.style.scrollbarGutter=g,m===h}function VN(t){const o=We(t),a=o.documentElement,r=o.body,l=lf(a,r),c={overflowY:l.style.overflowY,overflowX:l.style.overflowX};return Object.assign(l.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(l.style,c)}}function FN(t){const o=We(t),a=o.documentElement,r=o.body,l=Et(a);let c=0,d=0,g=!1;const m=Eo.create();if(cs&&(l.visualViewport?.scale??1)!==1)return()=>{};function h(){const w=l.getComputedStyle(a),T=l.getComputedStyle(r),C=(w.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";c=a.scrollTop,d=a.scrollLeft,$x={scrollbarGutter:a.style.scrollbarGutter,overflowY:a.style.overflowY,overflowX:a.style.overflowX},Qx=a.style.scrollBehavior,Wx={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const _=a.scrollHeight>a.clientHeight,k=a.scrollWidth>a.clientWidth,M=w.overflowY==="scroll"||T.overflowY==="scroll",z=w.overflowX==="scroll"||T.overflowX==="scroll",D=Math.max(0,l.innerWidth-r.clientWidth),L=Math.max(0,l.innerHeight-r.clientHeight),B=parseFloat(T.marginTop)+parseFloat(T.marginBottom),Y=parseFloat(T.marginLeft)+parseFloat(T.marginRight),H=lf(a,r);if(g=BN(t),g){a.style.scrollbarGutter=C,H.style.overflowY="hidden",H.style.overflowX="hidden";return}Object.assign(a.style,{scrollbarGutter:C,overflowY:"hidden",overflowX:"hidden"}),(_||M)&&(a.style.overflowY="scroll"),(k||z)&&(a.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:B||L?`calc(100dvh - ${B+L}px)`:"100dvh",width:Y||D?`calc(100vw - ${Y+D}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=c,r.scrollLeft=d,a.setAttribute("data-base-ui-scroll-locked",""),a.style.scrollBehavior="unset"}function y(){Object.assign(a.style,$x),Object.assign(r.style,Wx),g||(a.scrollTop=c,a.scrollLeft=d,a.removeAttribute("data-base-ui-scroll-locked"),a.style.scrollBehavior=Qx)}function v(){y(),m.request(h)}h();const S=Ge(l,"resize",v);return()=>{m.cancel(),y(),typeof l.removeEventListener=="function"&&S()}}class YN{lockCount=0;restore=null;timeoutLock=An.create();timeoutUnlock=An.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 a=We(o),r=a.documentElement,l=a.body,c=Et(r);if(Zx(c,r,l)){const g=new c.MutationObserver(()=>{Zx(c,r,l)||(g.disconnect(),this.restore=null,this.lock(o))}),m={attributes:!0};g.observe(r,m),g.observe(l,m),this.restore=()=>g.disconnect();return}const d=Ru||!UN(o);this.restore=d?VN(o):FN(o)}}const qN=new YN;function N1(t=!0,o=null){we(()=>{if(t)return qN.acquire(o)},[t,o])}const GN=20;function Am(t,o,a,r){const[l,c]=b.useState(!1);we(()=>{if(!t||!o||a==null){c(!1);return}const d=We(a).documentElement.clientWidth,g=a.offsetWidth;c(d>0&&g>0&&g>=d-GN)},[t,o,a]),N1(t&&(!o||l),r)}const Nm=b.forwardRef(function(o,a){const{anchor:r,positionMethod:l="absolute",className:c,render:d,side:g,align:m,sideOffset:h=0,alignOffset:y=0,collisionBoundary:v="clipping-ancestors",collisionPadding:S=5,arrowPadding:w=5,sticky:T=!1,disableAnchorTracking:O=!1,collisionAvoidance:A=HS,style:C,..._}=o,{store:k}=$s(),M=DN(),z=Tm(!0),D=k.useState("parent"),L=k.useState("floatingRootContext"),B=k.useState("floatingTreeRoot"),Y=k.useState("mounted"),H=k.useState("open"),I=k.useState("modal"),j=k.useState("openMethod"),U=k.useState("activeTriggerElement"),te=k.useState("transitionStatus"),$=k.useState("positionerElement"),P=k.useState("instantType"),q=k.useState("adaptiveOrigin"),X=k.useState("lastOpenChangeReason"),Z=k.useState("floatingNodeId"),W=k.useState("floatingParentNodeId"),N=L.useState("domReferenceElement"),V=b.useRef(null),J=Yu($);let K=r,se=h,re=y,me=m,pe=A;D.type==="context-menu"&&(K=r??D.context?.anchor,me=me??"start",!g&&me!=="center"&&(re=o.alignOffset??2,se=o.sideOffset??-5));let be=g,Ce=me;D.type==="menu"?(be=be??"inline-end",Ce=Ce??"start",pe=o.collisionAvoidance??rm):D.type==="menubar"&&(be=be??(D.context.orientation==="vertical"?"inline-end":"bottom"),Ce=Ce??"start");const Me=D.type==="context-menu",ye=nf({anchor:K,floatingRootContext:L,positionMethod:z?"fixed":l,mounted:Y,side:be,sideOffset:se,align:Ce,alignOffset:re,arrowPadding:Me?0:w,collisionBoundary:v,collisionPadding:S,sticky:T,nodeId:Z,keepMounted:M,disableAnchorTracking:O,collisionAvoidance:pe,shift:Me?{crossAxis:!("side"in pe&&pe.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:B,adaptiveOrigin:q});b.useEffect(()=>{function Re(Ne){Ne.open&&(Ne.parentNodeId===Z&&k.set("hoverEnabled",!1),Ne.nodeId!==Z&&Ne.parentNodeId===k.select("floatingParentNodeId")&&k.setOpen(!1,qe(Ii)))}return B.events.on("menuopenchange",Re),()=>{B.events.off("menuopenchange",Re)}},[k,B.events,Z]),b.useEffect(()=>{if(k.select("floatingParentNodeId")==null)return;function Re(Ne){if(Ne.open||Ne.nodeId!==k.select("floatingParentNodeId"))return;const Ie=Ne.reason??Ii;k.setOpen(!1,qe(Ie))}return B.events.on("menuopenchange",Re),()=>{B.events.off("menuopenchange",Re)}},[B.events,k]);const ge=nn();b.useEffect(()=>{H||ge.clear()},[H,ge]),b.useEffect(()=>{function Re(Ne){if(!(!H||Ne.nodeId!==k.select("floatingParentNodeId")))if(Ne.target&&U&&U!==Ne.target){const Ie=k.select("closeDelay");Ie>0?ge.isStarted()||ge.start(Ie,()=>{k.setOpen(!1,qe(Ii))}):k.setOpen(!1,qe(Ii))}else ge.clear()}return B.events.on("itemhover",Re),()=>{B.events.off("itemhover",Re)}},[B.events,H,U,k,ge]),b.useEffect(()=>{const Re={open:H,nodeId:Z,parentNodeId:W,reason:k.select("lastOpenChangeReason")};B.events.emit("menuopenchange",Re)},[B.events,H,k,Z,W]),we(()=>{const Re=N,Ne=V.current;if(Re&&(V.current=Re),Ne&&Re&&Re!==Ne){k.set("instantType",void 0);const Ie=new AbortController;return J(()=>{k.set("instantType","trigger-change")},Ie.signal),()=>{Ie.abort()}}},[N,J,k]);const Te={open:H,side:ye.side,align:ye.align,anchorHidden:ye.anchorHidden,nested:D.type==="menu",instant:P},Ae=D.type==="menubar"&&D.context.modal;Am(H&&(Ae||I&&X!==Bt),j==="touch",$,U);const Ee=of(o,Te,{styles:ye.positionerStyles,transitionStatus:te,props:_,refs:[a,k.useStateSetter("positionerElement")],hidden:!Y,inert:!H}),Le=Y&&D.type!=="menu"&&(D.type!=="menubar"&&I&&X!==Bt||D.type==="menubar"&&D.context.modal);let Se=null;return D.type==="menubar"?Se=D.context.contentElement:D.type===void 0&&(Se=U),p.jsxs(S1.Provider,{value:ye,children:[Le&&p.jsx(rf,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:yl(!H),cutout:Se}),p.jsx(GS,{id:Z,children:p.jsx(Om,{elementsRef:k.context.itemDomElements,labelsRef:k.context.itemLabels,children:Ee})})]})}),XN=b.createContext(null);function k1(t){return b.useContext(XN)}function KN(t){const o=b.useRef(""),a=b.useCallback(l=>{l.defaultPrevented||(o.current=l.pointerType,t(l,l.pointerType))},[t]);return{onClick:b.useCallback(l=>{if(l.detail===0){t(l,"keyboard");return}"pointerType"in l?t(l,l.pointerType):t(l,o.current),o.current=""},[t]),onPointerDown:a}}function km(t,o){const a=b.useRef(t),r=ke(o);we(()=>{a.current!==t&&r(a.current),a.current=t},[t,r])}function M1(t,o){const a=ke((c,d)=>{(typeof t=="function"?t():t)||o(d||(Ru?"touch":""))}),{onClick:r,onPointerDown:l}=KN(a);return b.useMemo(()=>({onClick:r,onPointerDown:l}),[r,l])}function j1(t){const[o,a]=b.useState(null),r=M1(t,a);return km(t,l=>{l&&!t&&a(null)}),b.useMemo(()=>({openMethod:o,triggerProps:r}),[o,r])}const $N={...Qu,disabled:t=>t.parent.type==="menubar"&&t.parent.context.disabled||t.disabled,modal:t=>(t.parent.type===void 0||t.parent.type==="context-menu")&&(t.modal??!0),openMethod:t=>t.openMethod,allowMouseEnter:t=>t.allowMouseEnter,highlightItemOnHover:t=>t.highlightItemOnHover,parent:t=>t.parent,rootId:t=>t.parent.type==="menu"?t.parent.store.select("rootId"):t.parent.type!==void 0?t.parent.context.rootId:t.rootId,activeIndex:t=>t.activeIndex,isActive:(t,o)=>t.activeIndex===o,hoverEnabled:t=>t.hoverEnabled,instantType:t=>t.instantType,lastOpenChangeReason:t=>t.openChangeReason,floatingTreeRoot:t=>t.parent.type==="menu"?t.parent.store.select("floatingTreeRoot"):t.floatingTreeRoot,floatingNodeId:t=>t.floatingNodeId,floatingParentNodeId:t=>t.floatingParentNodeId,itemProps:t=>t.itemProps,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin,keyboardEventRelay:t=>{if(t.keyboardEventRelay)return t.keyboardEventRelay;if(t.parent.type==="menu")return t.parent.store.select("keyboardEventRelay")}};class WN extends Da{constructor(o,a,r=!1){const l=new ml,c=ZN(l,a,r,o);super(c,QN(l),$N),this.unsubscribeParentListener=this.observe("parent",d=>{if(this.unsubscribeParentListener?.(),d.type==="menu"){let g=d.store.select("rootId"),m=d.store.select("floatingTreeRoot"),h=d.store.select("keyboardEventRelay");this.unsubscribeParentListener=d.store.subscribe(()=>{const y=d.store.select("rootId"),v=d.store.select("floatingTreeRoot"),S=d.store.select("keyboardEventRelay");g===y&&m===v&&h===S||(g=y,m=v,h=S,this.notifyAll())}),this.context.allowMouseUpTriggerRef=d.store.context.allowMouseUpTriggerRef;return}d.type!==void 0&&(this.context.allowMouseUpTriggerRef=d.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(o,a){this.state.floatingRootContext.context.events.emit("setOpen",{open:o,eventDetails:a})}unsubscribeParentListener=null}function QN(t){return{positionerRef:b.createRef(),popupRef:b.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),onOpenChangeComplete:void 0,triggerElements:t}}function ZN(t,o,a=!1,r){return{...Wu(t,o,a),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new im,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Tt,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}const _1=b.createContext(void 0);function D1(){return b.useContext(_1)}const Mm=il(function(o){const{children:a,open:r,onOpenChange:l,onOpenChangeComplete:c,defaultOpen:d=!1,disabled:g=!1,modal:m,loopFocus:h=!0,orientation:y="vertical",actionsRef:v,closeParentOnEsc:S=!1,handle:w,triggerId:T,defaultTriggerId:O=null,highlightItemOnHover:A=!0}=o,C=Tm(!0),_=$s(!0),k=k1(!0),M=D1(),z=b.useMemo(()=>M&&_?{type:"menu",store:_.store}:k?{type:"menubar",context:k}:C&&!_?{type:"context-menu",context:C}:{type:void 0},[C,_,k,M]),D=Gs(),L=Gs(),B=Xs(),Y=z.type==="menu"?z.store:void 0,H=(r??d)&&Y?.state.transitionStatus==="starting",I=Qt(()=>H?Y?.state.instantType:void 0).current,j=JN({open:d,openProp:r,activeTriggerId:O,triggerIdProp:T,parent:z,disabled:g,highlightItemOnHover:A,modal:z.type===void 0?m:void 0,rootId:D,instantType:I},L,B!=null);j.useControlledProp("openProp",r),j.useControlledProp("triggerIdProp",T),j.useContextCallback("onOpenChangeComplete",c);const U=j.useState("floatingTreeRoot"),te=lm(U),$=j.useState("open"),P=j.useState("activeTriggerElement"),q=j.useState("positionerElement"),X=j.useState("hoverEnabled"),Z=j.useState("disabled"),W=j.useState("lastOpenChangeReason"),N=j.useState("parent"),V=j.useState("activeIndex"),J=j.useState("payload"),K=j.useState("floatingParentNodeId"),se=b.useRef(null),re=b.useRef(N.type!=="context-menu"),me=nn(),pe=b.useRef(!0),be=nn(),Ce=K!=null,{openMethod:Me,triggerProps:ye}=j1($);j.useSyncedValues({disabled:g,highlightItemOnHover:A,modal:N.type===void 0?m:void 0,openMethod:Me,rootId:D}),Xu(j);const{forceUnmount:ge,transitionStatus:Te}=Ku($,j,()=>{j.set("allowMouseEnter",!1)},H),Ae=Yu(j.context.popupRef);b.useEffect(()=>{if(I===void 0)return;const Oe=()=>{j.state.instantType===I&&j.set("instantType",void 0)};if(!$){Oe();return}if(Te!==void 0)return;if(j.context.popupRef.current==null){Oe();return}const Ye=new AbortController;return Ae(Oe,Ye.signal),()=>{Ye.abort()}},[I,$,Te,Ae,j]),we(()=>{C&&!_?j.update({parent:{type:"context-menu",context:C},floatingNodeId:te,floatingParentNodeId:B}):_&&j.update({floatingNodeId:te,floatingParentNodeId:B})},[C,_,te,B,j]),b.useEffect(()=>{if($||(se.current=null),N.type==="context-menu"){if(!$){me.clear(),re.current=!1;return}me.start(500,()=>{re.current=!0})}},[me,$,N.type]),we(()=>{!$&&!X&&j.set("hoverEnabled",!0)},[$,X,j]);const Ue=ke((Oe,Ye)=>{const Qe=Ye.reason;if(!Oe&&!j.select("open")||$===Oe&&Ye.trigger===P&&W===Qe)return;const ct=mm(Ye);if(!Oe&&Ye.trigger==null&&(Ye.trigger=P??void 0),l?.(Oe,Ye),Ye.isCanceled)return;j.state.floatingRootContext.dispatchOpenChange(Oe,Ye);const Jt=Ye.event;if(Oe===!1&&Jt?.type==="click"&&Jt.pointerType==="touch"&&!pe.current)return;Oe&&Qe===Er?(pe.current=!1,be.start(300,()=>{pe.current=!0})):(pe.current=!0,be.clear());const rn=(Qe===os||Qe===Fi)&&Jt.detail===0,hn=!Oe&&(Qe===fl||Qe==null);se.current=Ye.event;const bt=Gu(j.state,Oe,Ye.trigger,ct());bt.openChangeReason=Qe,N.type==="menubar"&&(Qe===Er||Qe===Fs||Qe===Bt||Qe===ru||Qe===Ii)?bt.instantType="group":rn||hn?bt.instantType=rn?"click":"dismiss":bt.instantType=void 0,j.update(bt)}),Ee=s1({popupStore:j,floatingRootContext:j.state.floatingRootContext,floatingId:L,nested:B!=null,onOpenChange:Ue}),Le=Ee.context.events;we(()=>{const Oe=({open:Ye,eventDetails:Qe})=>Ue(Ye,Qe);return Le.on("setOpen",Oe),()=>{Le?.off("setOpen",Oe)}},[Le,Ue]);const Se=b.useCallback(()=>{j.setOpen(!1,qe(Pu))},[j]);b.useImperativeHandle(v,()=>({unmount:ge,close:Se}),[ge,Se]);let Re;N.type==="context-menu"&&(Re=N.context),b.useImperativeHandle(Re?.positionerRef,()=>q,[q]),b.useImperativeHandle(Re?.actionsRef,()=>({setOpen:Ue}),[Ue]);const Ne=pl(Ee,{enabled:!Z,bubbles:{escapeKey:S&&N.type==="menu"},outsidePress(){return N.type!=="context-menu"||se.current?.type==="contextmenu"?!0:re.current},externalTree:Ce?U:void 0}),Ie=tf(),je=b.useCallback(Oe=>{j.select("activeIndex")!==Oe&&j.set("activeIndex",Oe)},[j]),le=f1(Ee,{enabled:!Z,listRef:j.context.itemDomElements,activeIndex:V,nested:N.type!==void 0,loopFocus:h,orientation:y,parentOrientation:N.type==="menubar"?N.context.orientation:void 0,rtl:Ie==="rtl",disabledIndices:po,onNavigate:je,openOnArrowKeyDown:N.type!=="context-menu",externalTree:Ce?U:void 0,focusItemOnHover:A}),ve=b.useCallback(Oe=>{j.context.typingRef.current=Oe},[j]),he=d1(Ee,{enabled:!Z,listRef:j.context.itemLabels,elementsRef:j.context.itemDomElements,activeIndex:V,resetMs:SA,onMatch:Oe=>{$&&Oe!==V&&j.set("activeIndex",Oe)},onTyping:ve}),ce=b.useMemo(()=>{const Oe=no(he.reference,le.reference,Ne.reference,{onMouseMove(){j.set("allowMouseEnter",!0)}},ye);return Oe["aria-haspopup"]="menu",Oe["aria-expanded"]=$,Oe},[j,he.reference,le.reference,Ne.reference,ye,$]),xe=b.useMemo(()=>{const Oe=no(le.trigger,Ne.trigger,ye);return Oe["aria-haspopup"]="menu",Oe["aria-expanded"]=!1,Oe},[le.trigger,Ne.trigger,ye]);Qt(()=>(j.update({inactiveTriggerProps:xe}),null));const He=b.useMemo(()=>no(hl,{id:L,role:"menu","aria-orientation":y==="horizontal"?"horizontal":void 0,"aria-labelledby":P?.id,onMouseMove(){j.set("allowMouseEnter",!0),N.type==="menu"&&j.set("hoverEnabled",!1)},onClick(){j.select("hoverEnabled")&&j.set("hoverEnabled",!1)},onKeyDown(Oe){const Ye=j.select("keyboardEventRelay");Ye&&!Oe.isPropagationStopped()&&Ye(Oe)}},he.floating,le.floating,Ne.floating),[P,L,y,N.type,j,he.floating,le.floating,Ne.floating]),Lt=le.item??Tt;$u(j,{floatingRootContext:Ee,activeTriggerProps:ce,inactiveTriggerProps:xe,popupProps:He,itemProps:Lt});const Ft=b.useMemo(()=>({store:j,parent:z}),[j,z]),ut=p.jsxs(w1.Provider,{value:Ft,children:[w&&p.jsx(qu,{handle:w,store:j}),typeof a=="function"?a({payload:J}):a]});return N.type===void 0||N.type==="context-menu"?p.jsx(XS,{externalTree:U,children:ut}):ut});function JN(t,o,a){return Qt(()=>new WN(t,o,a)).current}function ek(t){const o=$s().store,a=b.useMemo(()=>({parentMenu:o}),[o]);return p.jsx(_1.Provider,{value:a,children:p.jsx(Mm,{...t})})}const Xc=5;function z1(t,o){const a=tk(o);return t.clientX>=a.left-Xc&&t.clientX<=a.right+Xc&&t.clientY>=a.top-Xc&&t.clientY<=a.bottom+Xc}function tk(t){const o=t.getBoundingClientRect(),a=Et(t);if(qh)return o;const r=a.getComputedStyle(t,"::before"),l=a.getComputedStyle(t,"::after");if(!(r.content!=="none"||l.content!=="none"))return o;const d=parseFloat(r.width)||0,g=parseFloat(r.height)||0,m=parseFloat(l.width)||0,h=parseFloat(l.height)||0,y=Math.max(o.width,d,m),v=Math.max(o.height,g,h),S=y-o.width,w=v-o.height;return{left:o.left-S/2,right:o.right+S/2,top:o.top-w/2,bottom:o.bottom+w/2}}function nk(t={}){const{highlightItemOnHover:o,highlightedIndex:a,onHighlightedIndexChange:r}=Em(),{ref:l,index:c}=sf(t),d=a===c,g=b.useRef(null),m=ss(l,g);return{compositeProps:{tabIndex:d?0:-1,onFocus(){r(c)},onMouseMove(){const y=g.current;if(!o||!y)return;const v=y.hasAttribute("disabled")||y.ariaDisabled==="true";!d&&!v&&y.focus()}},compositeRef:m,index:c}}function L1(t){const{render:o,className:a,style:r,state:l=Tt,props:c=po,refs:d=po,metadata:g,stateAttributesMapping:m,tag:h="div",...y}=t,{compositeProps:v,compositeRef:S}=nk({metadata:g});return et(h,t,{state:l,ref:[S,...d],props:[v,...c,y],stateAttributesMapping:m})}function P1(t){if(yt(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid");if(!Wo(t))return P1(ts(t))}function I1(t,o){const a=b.useRef(null);function r(c){oo.flushSync(()=>{t.setOpen(!1,qe(Fs,c.nativeEvent,c.currentTarget))}),nA(a.current)?.focus()}function l(c){const d=t.select("positionerElement");if(d&&Rr(c,d))t.context.beforeContentFocusGuardRef.current?.focus();else{oo.flushSync(()=>{t.setOpen(!1,qe(Fs,c.nativeEvent,c.currentTarget))});let g=tA(t.context.triggerFocusTargetRef.current||o.current);for(;g!==null&&De(d,g);){const m=g;if(g=nm(g),g===m)break}g?.focus()}}return{preFocusGuardRef:a,handlePreFocusGuardFocus:r,handleFocusTargetFocus:l}}function ok(t){const{enabled:o=!0,mouseDownAction:a,open:r}=t,l=b.useRef(!1);return b.useMemo(()=>o?{onMouseDown:c=>{(a==="open"&&!r||a==="close"&&r)&&(l.current=!0,We(c.currentTarget).addEventListener("click",()=>{l.current=!1},{once:!0}))},onClick:c=>{l.current&&(l.current=!1,c.preventBaseUIHandler())}}:Tt,[o,a,r])}const H1=Fh(function(o,a){const{render:r,className:l,style:c,disabled:d=!1,nativeButton:g=!0,id:m,openOnHover:h,delay:y=100,closeDelay:v=0,handle:S,payload:w,...T}=o,O=$s(!0),C=bm(S)??O?.store;if(!C)throw new Error(At(85));const _=mo(m),k=C.useState("isTriggerActive",_),M=C.useState("floatingRootContext"),z=C.useState("isOpenedByTrigger",_),D=C.useState("triggerPopupId",_),L=b.useRef(null),B=ak(),Y=Em(!0),H=Ks(),I=b.useMemo(()=>H??new im,[H]),j=lm(I),U=Xs(),{registerTrigger:te,isMountedByThisTrigger:$}=gm(_,L,C,{payload:w,closeDelay:v,parent:B,floatingTreeRoot:I,floatingNodeId:j,floatingParentNodeId:U,keyboardEventRelay:Y?.relayKeyboardEvent}),P=B.type==="menubar",q=C.useState("disabled"),X=d||q||P&&B.context.disabled,{getButtonProps:Z,buttonRef:W}=Co({disabled:X,native:g});b.useEffect(()=>{!z&&B.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,z,B.type]);const N=b.useRef(null),V=nn(),J=ke(Re=>{if(!N.current)return;V.clear(),C.context.allowMouseUpTriggerRef.current=!1;const Ne=Re.target;De(N.current,Ne)||De(C.select("positionerElement"),Ne)||Ne===N.current||Ne!=null&&P1(Ne)===C.select("rootId")||z1(Re,N.current)||I.events.emit("close",{domEvent:Re,reason:pS})});b.useEffect(()=>{z&&C.select("lastOpenChangeReason")===Bt&&We(N.current).addEventListener("mouseup",J,{once:!0})},[z,J,C]);const K=P&&B.context.hasSubmenuOpen,re=Zu(M,{enabled:(h??K)&&!X&&(!P||K&&!$),handleClose:ef({blockPointerEvents:!P}),mouseOnly:!0,move:!1,restMs:B.type===void 0?y:void 0,delay:{close:v},triggerElementRef:L,externalTree:I,isActiveTrigger:k,isClosing:()=>C.select("transitionStatus")==="ending"}),me=sk(z,C.select("lastOpenChangeReason")),pe=Vu(M,{enabled:!X,event:z&&P?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:B.type===void 0?me:!1}),be=c1(M,{enabled:!X&&K}),Ce=ok({open:z,enabled:P,mouseDownAction:"open"}),Me=b.useMemo(()=>no(be.reference,pe.reference),[be.reference,pe.reference]),ye=C.useState("triggerProps",$),{preFocusGuardRef:ge,handlePreFocusGuardFocus:Te,handleFocusTargetFocus:Ae}=I1(C,L),Ue={disabled:X,open:z},Ee=[N,a,W,te,L],Le=[Me,re??Tt,ye,{"aria-haspopup":"menu","aria-controls":D,id:_,onMouseDown:Re=>{if(C.select("open"))return;V.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),We(Re.currentTarget).addEventListener("mouseup",J,{once:!0})}},P?{role:"menuitem"}:{},Ce,T,Z],Se=et("button",o,{enabled:!P,stateAttributesMapping:nu,state:Ue,ref:Ee,props:Le});return P?p.jsx(L1,{tag:"button",render:r,className:l,style:c,state:Ue,refs:Ee,props:Le,stateAttributesMapping:nu}):z?p.jsxs(b.Fragment,{children:[p.jsx(as,{ref:ge,onFocus:Te},`${_}-pre-focus-guard`),p.jsx(b.Fragment,{children:Se},_),p.jsx(as,{ref:C.context.triggerFocusTargetRef,onFocus:Ae},`${_}-post-focus-guard`)]}):p.jsx(b.Fragment,{children:Se},_)});function sk(t,o){const a=nn(),[r,l]=b.useState(!1);return we(()=>{t&&o===Bt?(l(!0),a.start(PS,()=>{l(!1)})):t||(a.clear(),l(!1))},[t,o,a]),r}function ak(){const t=k1();return b.useMemo(()=>t?{type:"menubar",context:t}:{type:void 0},[t])}const rk=b.forwardRef(function(o,a){const{className:r,render:l,orientation:c="horizontal",style:d,...g}=o;return et("div",o,{state:{orientation:c},ref:a,props:[{role:"separator","aria-orientation":c},g]})});function U1(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}const ik={"aria-expanded":void 0},lk=b.forwardRef(function(o,a){const{render:r,className:l,style:c,label:d,id:g,nativeButton:m=!1,openOnHover:h=!0,delay:y=100,closeDelay:v=0,disabled:S=!1,...w}=o,T=D1();if(!T?.parentMenu)throw new Error(At(37));const O=sf({guess:!0,label:d}),A=wm(),{store:C}=$s(),_=mo(g),k=C.useState("open"),M=C.useState("floatingRootContext"),z=C.useState("floatingTreeRoot"),D=C.useState("triggerPopupId",_),L=r1(_,C),B=ke(Me=>{L(Me),Me!==null&&C.select("open")&&C.select("activeTriggerId")==null&&C.update({activeTriggerId:_??null,activeTriggerElement:Me,closeDelay:v})}),Y=b.useRef(null),H=b.useCallback(Me=>{Y.current=Me,C.set("activeTriggerElement",Me)},[C]);we(()=>(B(Y.current),()=>B(null)),[B,_,C]),C.useSyncedValue("closeDelay",v);const I=T.parentMenu,j=C.useState("disabled"),U=I.useState("disabled"),te=S||j||U,$=I.useState("itemProps"),P=I.useState("isActive",O.index),q=b.useMemo(()=>({type:"submenu-trigger",setActive(){I.select("highlightItemOnHover")&&I.set("activeIndex",O.index)}}),[I,O.index]),{getItemProps:X,itemRef:Z}=E1({closeOnClick:!1,disabled:te,highlighted:P,id:_,store:C,typingRef:I.context.typingRef,nativeButton:m,itemMetadata:q,nodeId:A?.context.nodeId}),W=C.useState("hoverEnabled"),N=Zu(M,{enabled:W&&h&&!te,handleClose:ef({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:y,delay:{open:y,close:v},shouldOpen:y>0?()=>I.select("allowMouseEnter"):void 0,triggerElementRef:Y,externalTree:z,isClosing:()=>C.select("transitionStatus")==="ending",guardStaleOpen:!0}),J=Vu(M,{enabled:!te,event:"mousedown",toggle:!h,ignoreMouse:h,stickIfOpen:!1}).reference??Tt,K=C.useState("triggerProps",!0);delete K.id;const se={disabled:te,highlighted:P,open:k},re=C.useState("openMethod"),pe=C.useState("lastOpenChangeReason")===ru||re==="keyboard";return et("div",o,{state:se,stateAttributesMapping:_u,props:[J,N,K,$,k&&pe&&aS?ik:void 0,{"aria-controls":D,tabIndex:k||P?0:-1,onBlur(){P&&I.set("activeIndex",null)}},w,X],ref:[a,O.ref,Z,B,H]})});const ck=t=>t?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function uk(t,o,a=[]){if(o==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:ck(t),size:24,node:o,...a.length>0?{aliases:a}:{}}}const fk=t=>{let o="",a=!1;for(const r of t){if(r==="-"||r==="_"||r<=" "){a=o.length>0;continue}o.length===0?o+=r.toLowerCase():o+=a?r.toUpperCase():r,a=!1}return o};const dk=t=>{const o=fk(t);return o.charAt(0).toUpperCase()+o.slice(1)};const Ah=(...t)=>t.filter((o,a,r)=>!!o&&o.trim()!==""&&r.indexOf(o)===a).join(" ").trim();const ga={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 Qp(t){return t!=null}function pk(t,o={}){const a=o.attributeNames??{},r=S=>a[S]??S,l=t.size??t.width??ga.width,c=t.size??t.height??ga.height,d=t.aliases?.filter(S=>typeof S=="string"&&S.trim()!=="").map(S=>`lucide-${S}`)??[],g=[...t.name?[`lucide-${t.name}`]:[],...d],m=o.className?.split(" ").filter(Boolean)??[],h=o.includeDefaultClasses===!1?Ah(...m):Ah("lucide",...g,...m),y=o.absoluteStrokeWidth?Number(o.strokeWidth??ga["stroke-width"])*Number(t.size??t.width??ga.width)/Number(o.size??o.width??ga.width):o.strokeWidth??ga["stroke-width"];return["svg",{...Object.entries(ga).reduce((S,[w,T])=>(S[r(w)]=T,S),{}),..."color"in o&&o.color&&{[r("stroke")]:o.color},..."size"in o&&Qp(o.size)&&{[r("width")]:o.size,[r("height")]:o.size},..."width"in o&&Qp(o.width)&&{[r("width")]:o.width},..."height"in o&&Qp(o.height)&&{[r("height")]:o.height},[r("stroke-width")]:y,...h&&{[r("class")]:h},[r("viewBox")]:`0 0 ${l} ${c}`,...o.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in o&&o.attributes},t.node.map(S=>{const[w,T,O]=S,A=o.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...T}:T;return O?[w,A,O]:[w,A]})]}function hk(t,o={}){return pk(t,{...o,attributeNames:{...o.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const mk=t=>{for(const o in t)if(o.startsWith("aria-")||o==="role"||o==="title")return!0;return!1},gk=b.createContext({}),yk=()=>b.useContext(gk),bk=b.forwardRef(({color:t,size:o,width:a,height:r,strokeWidth:l,absoluteStrokeWidth:c,nonScalingStroke:d,className:g="",children:m,iconNode:h=[],icon:y={node:h,aliases:[],size:24},...v},S)=>{const{size:w=24,strokeWidth:T=2,absoluteStrokeWidth:O=!1,nonScalingStroke:A=!1,color:C="currentColor",className:_=""}=yk()??{},k=!!m||mk(v),[M,z,D=[]]=hk(y,{color:t??C,width:a??o??w,height:r??o??w,strokeWidth:l??T,absoluteStrokeWidth:c??O,nonScalingStroke:d??A,className:Ah(_,g),hasA11yProp:k,attributes:v});return b.createElement(M,{ref:S,...z},[...D.map(([L,B])=>b.createElement(L,B)),...Array.isArray(m)?m:[m]])});function Ve(t,o=[],a=[]){const r=typeof t=="string"?uk(t,o,a):t,l=b.forwardRef(({className:c,...d},g)=>b.createElement(bk,{ref:g,icon:r,className:c,...d}));return r.name&&(l.displayName=dk(r.name)),l}const B1={name:"building-complex",size:24,node:[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],aliases:["building-2"]};B1.node;const vk=Ve(B1);const V1={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};V1.node;const Pr=Ve(V1);const F1={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};F1.node;const Aa=Ve(F1);const Y1={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};Y1.node;const jm=Ve(Y1);const q1={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};q1.node;const xk=Ve(q1);const G1={name:"cloud-alert",size:24,node:[["path",{d:"M12 12v4",key:"tww15h"}],["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642",key:"1namsd"}]]};G1.node;const Sk=Ve(G1);const X1={name:"cloud-off",size:24,node:[["path",{d:"M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057",key:"1uxyv8"}],["path",{d:"M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78",key:"99tcn7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};X1.node;const _m=Ve(X1);const K1={name:"cloud",size:24,node:[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]};K1.node;const $1=Ve(K1);const W1={name:"code",size:24,node:[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]};W1.node;const Q1=Ve(W1);const Z1={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};Z1.node;const hu=Ve(Z1);const J1={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};J1.node;const wk=Ve(J1);const ew={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};ew.node;const tw=Ve(ew);const nw={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};nw.node;const Tk=Ve(nw);const ow={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"}]]};ow.node;const vl=Ve(ow);const sw={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};sw.node;const Ek=Ve(sw);const aw={name:"file-text",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"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};aw.node;const Ck=Ve(aw);const rw={name:"file",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"}]]};rw.node;const Rk=Ve(rw);const iw={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};iw.node;const lw=Ve(iw);const cw={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};cw.node;const Dm=Ve(cw);const uw={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};uw.node;const Ok=Ve(uw);const fw={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};fw.node;const dw=Ve(fw);const pw={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};pw.node;const zm=Ve(pw);const hw={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};hw.node;const Ak=Ve(hw);const mw={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};mw.node;const so=Ve(mw);const gw={name:"log-in",size:24,node:[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]};gw.node;const Nk=Ve(gw);const yw={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};yw.node;const cf=Ve(yw);const bw={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"}]]};bw.node;const kk=Ve(bw);const vw={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};vw.node;const Lm=Ve(vw);const xw={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};xw.node;const Pm=Ve(xw);const Sw={name:"network",size:24,node:[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]};Sw.node;const Mk=Ve(Sw);const ww={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};ww.node;const jk=Ve(ww);const Tw={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};Tw.node;const Im=Ve(Tw);const Ew={name:"pin-off",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]};Ew.node;const _k=Ve(Ew);const Cw={name:"pin",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]};Cw.node;const Dk=Ve(Cw);const Rw={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"}]]};Rw.node;const zk=Ve(Rw);const Ow={name:"presentation",size:24,node:[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]};Ow.node;const Lk=Ve(Ow);const Aw={name:"redo-2",size:24,node:[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]};Aw.node;const Pk=Ve(Aw);const Nw={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"}]]};Nw.node;const Ik=Ve(Nw);const kw={name:"rotate-ccw-clock",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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],aliases:["history"]};kw.node;const Mw=Ve(kw);const jw={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};jw.node;const _w=Ve(jw);const Dw={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};Dw.node;const Hk=Ve(Dw);const zw={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};zw.node;const Uk=Ve(zw);const Lw={name:"send",size:24,node:[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]};Lw.node;const Bk=Ve(Lw);const Pw={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};Pw.node;const Vk=Ve(Pw);const Iw={name:"share",size:24,node:[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]]};Iw.node;const Fk=Ve(Iw);const Hw={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"]};Hw.node;const Uw=Ve(Hw);const Bw={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};Bw.node;const xl=Ve(Bw);const Vw={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};Vw.node;const Yk=Ve(Vw);const Fw={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};Fw.node;const Ui=Ve(Fw);const Yw={name:"video",size:24,node:[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]};Yw.node;const qk=Ve(Yw);const qw={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};qw.node;const Sl=Ve(qw),Nh=500,Gk=8;function Xk(t,o,a){return a<t.at||a-t.at>Nh?!1:Math.hypot(o.clientX-t.x,o.clientY-t.y)<=Gk}const Jx=["pointerdown","mousedown","pointerup","mouseup","click","dblclick"];function Kk(t,o,a=Date.now){let r=!1,l=!1,c=0;const d=()=>{if(!l){l=!0,t.clearTimeout(c);for(const h of Jx)t.removeEventListener(h,m,!0)}},g=()=>{r?c=t.setTimeout(g,Nh):d()},m=h=>{const y=h.type==="pointerdown"||h.type==="mousedown";!(r&&!y)&&!Xk(o,h,a())||(h.preventDefault(),h.stopImmediatePropagation(),y?r=!0:(h.type==="click"||h.type==="dblclick")&&(r=!1))};for(const h of Jx)t.addEventListener(h,m,!0);return c=t.setTimeout(g,Math.max(0,Nh-(a()-o.at))),d}function $k(t){t.detail<1||!t.view||Kk(t.view,{x:t.clientX,y:t.clientY,at:Date.now()})}const Hm="rounded-lg bg-surface p-1 text-[13px] text-fg shadow-popup outline-none origin-[var(--transform-origin)] transition-[opacity,transform] duration-100 data-[starting-style]:opacity-0 data-[starting-style]:scale-95 data-[ending-style]:opacity-0",Gw="flex h-7 min-w-40 cursor-default select-none items-center gap-2 rounded-md px-2 outline-none data-[highlighted]:bg-hover data-[disabled]:opacity-40";function el({trigger:t,children:o,side:a="bottom",align:r="start",open:l,onOpenChange:c}){return p.jsxs(Mm,{open:l,onOpenChange:c?d=>c(d):void 0,children:[p.jsx(H1,{render:t,onKeyDown:jr}),p.jsx(Rm,{children:p.jsx(Nm,{side:a,align:r,sideOffset:6,className:"z-[1000]",children:p.jsx(Cm,{className:Hm,children:o})})})]})}function Nt({children:t,onSelect:o,icon:a,shortcut:r,disabled:l,danger:c}){return p.jsxs(R1,{className:lt(Gw,c&&"text-danger"),disabled:l,onClick:d=>{$k(d.nativeEvent),o?.()},onKeyDown:jr,children:[p.jsx("span",{className:"flex size-4 items-center justify-center text-fg-muted",children:a}),p.jsx("span",{className:"flex-1",children:t}),r?p.jsx("span",{className:"ml-4 text-xs text-fg-subtle",children:r}):null]})}function Ko(){return p.jsx(rk,{className:"mx-1 my-1 h-px bg-line"})}function _r({children:t}){return p.jsx("div",{className:"px-2 py-1 text-xs text-fg-subtle",children:t})}function e0({label:t,icon:o,children:a}){return p.jsxs(ek,{children:[p.jsxs(lk,{className:Gw,onKeyDown:jr,children:[p.jsx("span",{className:"flex size-4 items-center justify-center text-fg-muted",children:o}),p.jsx("span",{className:"flex-1",children:t}),p.jsx(jm,{className:"size-3.5 text-fg-subtle"})]}),p.jsx(Rm,{children:p.jsx(Nm,{sideOffset:4,className:"z-[1000]",children:p.jsx(Cm,{className:Hm,children:a})})})]})}const Xw=b.createContext(void 0);function La(t){const o=b.useContext(Xw);if(!t&&o===void 0)throw new Error(At(27));return o}const Wk=b.forwardRef(function(o,a){const{render:r,className:l,style:c,forceRender:d=!1,...g}=o,m=La(),h=m.useState("open"),y=m.useState("nested"),v=m.useState("mounted"),S=m.useState("transitionStatus");return et("div",o,{state:{open:h,transitionStatus:S},ref:[m.context.backdropRef,a],stateAttributesMapping:Du,props:[{role:"presentation",hidden:!v,style:{userSelect:"none",WebkitUserSelect:"none"}},g],enabled:d||!y})}),Qk=b.forwardRef(function(o,a){const{render:r,className:l,style:c,disabled:d=!1,nativeButton:g=!0,...m}=o,h=La(),y=h.useState("open"),{getButtonProps:v,buttonRef:S}=Co({disabled:d,native:g}),w={disabled:d};function T(O){y&&h.setOpen(!1,qe(dS,O.nativeEvent))}return et("button",o,{state:w,ref:[a,S],props:[{onClick:T},m,v]})}),Zk=b.forwardRef(function(o,a){const{render:r,className:l,style:c,id:d,...g}=o,m=La(),h=mo(d);return m.useSyncedValueWithCleanup("descriptionElementId",h),et("p",o,{ref:a,props:[{id:h},g]})}),Kw=b.createContext(void 0);function Jk(){const t=b.useContext(Kw);if(t===void 0)throw new Error(At(26));return t}const eM="--nested-dialogs",tM="data-nested-dialog-open",nM={...ul,...cl,nestedDialogOpen(t){return t?{[tM]:""}:null}},oM=b.forwardRef(function(o,a){const{render:r,className:l,style:c,finalFocus:d,initialFocus:g,...m}=o,h=La(),y=h.useState("descriptionElementId"),v=h.useState("disablePointerDismissal"),S=h.useState("floatingRootContext"),w=h.useState("popupProps"),T=h.useState("modal"),O=h.useState("mounted"),A=h.useState("nested"),C=h.useState("nestedOpenDialogCount"),_=h.useState("open"),k=h.useState("openMethod"),M=h.useState("titleElementId"),z=h.useState("transitionStatus"),D=h.useState("role"),L=S.useState("floatingId");Jk(),fs({open:_,ref:h.context.popupRef,onComplete(){_&&h.context.onOpenChangeComplete?.(!0)}});const B=g===void 0?a1(h.context.popupRef):g,Y=C>0,H=h.useStateSetter("popupElement"),j=et("div",o,{state:{open:_,nested:A,transitionStatus:z,nestedDialogOpen:Y},props:[w,{id:L,"aria-labelledby":M,"aria-describedby":y,role:D,...hl,hidden:!O,onKeyDown(U){bl.has(U.key)&&U.stopPropagation()},style:{[eM]:C}},m],ref:[a,h.context.popupRef,H],stateAttributesMapping:nM});return p.jsx(Bu,{context:S,openInteractionType:k,disabled:!O,closeOnFocusOut:!v,initialFocus:B,returnFocus:d,modal:T!==!1,restoreFocus:"popup",children:j})}),sM=b.forwardRef(function(o,a){const{keepMounted:r=!1,...l}=o,c=La(),d=c.useState("mounted"),g=c.useState("modal"),m=c.useState("open");return d||r?p.jsx(Kw.Provider,{value:r,children:p.jsxs(Uu,{ref:a,...l,children:[d&&g===!0&&p.jsx(rf,{ref:c.context.internalBackdropRef,inert:yl(!m)}),o.children]})}):null});function aM({store:t,parentContext:o,isDrawer:a}){const r=t.useState("open"),l=t.useState("disablePointerDismissal"),c=t.useState("modal"),d=t.useState("popupElement"),g=t.useState("floatingRootContext"),[m,h]=b.useState(0),[y,v]=b.useState(0),S=m===0,w=pl(g,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:c==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(T){if(!t.context.outsidePressEnabledRef.current||"button"in T&&T.button!==0)return!1;if("touches"in T){if(T.type==="touchend"){if(T.changedTouches.length!==1||T.touches.length!==0)return!1}else if(T.touches.length!==1)return!1}const O=zt(T);if(S&&!l){if(c){const A=t.context.internalBackdropRef.current,C=t.context.backdropRef.current;return A||C?A===O||C===O||De(O,d)&&!O?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:S});return N1(r&&c===!0,d),t.useContextCallback("onNestedDialogOpen",(T,O)=>{h(T),v(O)}),we(()=>(o?.onNestedDialogOpen&&(r?o.onNestedDialogOpen(m+1,y+(a?1:0)):o.onNestedDialogOpen(0,0)),()=>{o?.onNestedDialogOpen&&r&&o.onNestedDialogOpen(0,0)}),[a,r,m,y,o]),$u(t,{activeTriggerProps:w.reference,inactiveTriggerProps:w.trigger,popupProps:w.floating,nestedOpenDialogCount:m,nestedOpenDrawerCount:y}),null}const rM={...Qu,modal:t=>t.modal,nested:t=>t.nested,nestedOpenDialogCount:t=>t.nestedOpenDialogCount,nestedOpenDrawerCount:t=>t.nestedOpenDrawerCount,disablePointerDismissal:t=>t.disablePointerDismissal,openMethod:t=>t.openMethod,descriptionElementId:t=>t.descriptionElementId,titleElementId:t=>t.titleElementId,viewportElement:t=>t.viewportElement,role:t=>t.role};class iM extends Da{constructor(o,a,r){const l=new ml,c=lM(o,l,a,r);super(c,cM(l),rM)}setOpen=(o,a)=>{a.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!o&&a.trigger==null&&this.state.activeTriggerId!=null&&(a.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(o,a),!a.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(o,a),this.update(Gu(this.state,o,a.trigger)))}}function lM(t,o,a,r=!1){return{...Wu(o,a,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t}}function cM(t){return{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:t,onOpenChange:void 0,onOpenChangeComplete:void 0}}function uM(t,o){const{children:a,open:r,defaultOpen:l=!1,onOpenChange:c,onOpenChangeComplete:d,disablePointerDismissal:g=!1,modal:m=!0,actionsRef:h,handle:y,triggerId:v,defaultTriggerId:S=null}=o,w=t==="drawer",T=m,O=g,A="dialog",C=La(!0),_=C!=null,k={modal:T,disablePointerDismissal:O,nested:_,role:A},M=hm((H,I)=>new iM({open:l,openProp:r,activeTriggerId:S,triggerIdProp:v,...k},H,I),!0);M.useControlledProp("openProp",r),M.useControlledProp("triggerIdProp",v),M.useSyncedValues(k),M.useContextCallback("onOpenChange",c),M.useContextCallback("onOpenChangeComplete",d);const z=M.useState("open"),D=M.useState("mounted"),L=M.useState("payload");i1(M,z),Xu(M);const{forceUnmount:B}=Ku(z,M);b.useImperativeHandle(h,()=>({unmount:B,close:()=>M.setOpen(!1,qe(Pu))}),[B,M]);const Y=z||D;return p.jsxs(Xw.Provider,{value:M,children:[y&&p.jsx(qu,{handle:y,store:M}),Y&&p.jsx(aM,{store:M,parentContext:C?.context,isDrawer:w}),typeof a=="function"?a({payload:L}):a]})}const fM=il(function(o){return uM("dialog",o)}),dM=b.forwardRef(function(o,a){const{render:r,className:l,style:c,id:d,...g}=o,m=La(),h=mo(d);return m.useSyncedValueWithCleanup("titleElementId",h),et("h2",o,{ref:a,props:[{id:h},g]})}),$w=b.createContext(void 0);function Ir(t){const o=b.useContext($w);if(o===void 0&&!t)throw new Error(At(47));return o}const pM={...Qu,disabled:t=>t.disabled,instantType:t=>t.instantType,openMethod:t=>t.openMethod,openChangeReason:t=>t.openChangeReason,modal:t=>t.modal,focusManagerModal:t=>t.focusManagerModal,stickIfOpen:t=>t.stickIfOpen,titleElementId:t=>t.titleElementId,descriptionElementId:t=>t.descriptionElementId,openOnHover:t=>t.openOnHover,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class hM extends Da{constructor(o,a,r){const l=new ml;super(mM(o,l,a,r),gM(l),pM)}setOpen=(o,a)=>{const r=a.reason===Bt,l=a.reason===os&&a.event.detail===0,c=!o&&(a.reason===fl||a.reason==null),d=mm(a),g=this.select("activeTriggerId");if(!o&&a.reason===dS&&a.trigger==null&&g!=null&&(a.trigger=this.context.triggerElements.getById(g)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(o,a),a.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(o,a);const m=()=>{const y=Gu(this.state,o,a.trigger,d());y.openChangeReason=a.reason,this.update(y)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(PS,()=>{this.set("stickIfOpen",!1)}),oo.flushSync(m)):m();let h;l?h="click":c?h="dismiss":a.reason===Fs&&(h="focus"),this.set("instantType",h)}}function mM(t,o,a,r=!1){const l={...Wu(o,a,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...t};return l.open&&t?.mounted===void 0&&(l.mounted=!0),l}function gM(t){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),stickIfOpenTimeout:new An,triggerElements:t}}const t0=il(function({props:o}){const{children:a,open:r,defaultOpen:l=!1,onOpenChange:c,onOpenChangeComplete:d,modal:g=!1,handle:m,triggerId:h,defaultTriggerId:y=null}=o,v=bM(m,{modal:g,open:l,openProp:r,activeTriggerId:y,triggerIdProp:h});v.useControlledProp("openProp",r),v.useControlledProp("triggerIdProp",h);const S=v.useState("open"),w=v.useState("mounted"),T=v.useState("payload");v.useContextCallback("onOpenChange",c),v.useContextCallback("onOpenChangeComplete",d),i1(v,S),Xu(v);const{forceUnmount:O}=Ku(S,v,()=>{v.update({stickIfOpen:!0,openChangeReason:null})});v.useSyncedValues({modal:g}),b.useEffect(()=>{S||v.context.stickIfOpenTimeout.clear()},[v,S]),b.useImperativeHandle(o.actionsRef,()=>({unmount:O,close:()=>v.setOpen(!1,qe(Pu))}),[O,v]);const A=S||w;return p.jsxs($w.Provider,{value:v,children:[m&&p.jsx(qu,{handle:m,store:v}),A&&p.jsx(vM,{store:v,modal:g}),typeof a=="function"?a({payload:T}):a]})});function yM(t){return Ir(!0)?p.jsx(t0,{props:t}):p.jsx(XS,{children:p.jsx(t0,{props:t})})}function bM(t,o){const a=hm((r,l)=>new hM(o,r,l));return b.useEffect(()=>a.context.stickIfOpenTimeout.disposeEffect(),[a]),a}function vM({store:t,modal:o}){const a=t.useState("floatingRootContext"),r=pl(a,{outsidePressEvent:{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),l=r.reference,c=r.floating;return $u(t,{activeTriggerProps:l,inactiveTriggerProps:l,popupProps:c}),null}const xM=300,SM=Fh(function(o,a){const{render:r,className:l,style:c,disabled:d=!1,nativeButton:g=!0,handle:m,payload:h,openOnHover:y=!1,delay:v=xM,closeDelay:S=0,id:w,...T}=o,O=Ir(!0),C=bm(m)??O;if(!C)throw new Error(At(74));const _=mo(w),k=C.useState("isTriggerActive",_),M=C.useState("floatingRootContext"),z=C.useState("isOpenedByTrigger",_),D=C.useState("triggerPopupId",_),L=b.useRef(null),{registerTrigger:B,isMountedByThisTrigger:Y}=gm(_,L,C,{payload:h,disabled:d,openOnHover:y,closeDelay:S}),H=C.useState("openChangeReason"),I=C.useState("stickIfOpen"),j=C.useState("openMethod"),U=C.useState("focusManagerModal"),te=Zu(M,{enabled:!d&&y&&(j!=="touch"||H!==os),mouseOnly:!0,move:!1,handleClose:ef(),restMs:v,delay:{close:S},triggerElementRef:L,isActiveTrigger:k,isClosing:()=>C.select("transitionStatus")==="ending"}),$=Vu(M,{stickIfOpen:I}),P=M1(()=>C.select("open"),me=>{C.set("openMethod",me)}),q=C.useState("triggerProps",Y),{getButtonProps:X,buttonRef:Z}=Co({disabled:d,native:g}),W={open(me){return me&&H===os?nu.open(me):_u.open(me)}},{preFocusGuardRef:N,handlePreFocusGuardFocus:V,handleFocusTargetFocus:J}=I1(C,L),se=et("button",o,{state:{disabled:d,open:z},ref:[Z,a,B,L],props:[$.reference,te,q,P,{[IS]:"",id:_,"aria-haspopup":"dialog","aria-expanded":z,"aria-controls":D},T,X],stateAttributesMapping:W}),re=p.jsx(b.Fragment,{children:se},_);return Y&&!U?p.jsxs(b.Fragment,{children:[p.jsx(as,{ref:N,onFocus:V}),re,p.jsx(as,{ref:C.context.triggerFocusTargetRef,onFocus:J})]}):re}),Ww=b.createContext(void 0);function wM(){const t=b.useContext(Ww);if(t===void 0)throw new Error(At(45));return t}const TM=b.forwardRef(function(o,a){const{keepMounted:r=!1,...l}=o;return Ir().useState("mounted")||r?p.jsx(Ww.Provider,{value:r,children:p.jsx(Uu,{ref:a,...l})}):null}),Qw=b.createContext(void 0);function Zw(){const t=b.useContext(Qw);if(!t)throw new Error(At(46));return t}const EM=b.forwardRef(function(o,a){const{render:r,className:l,style:c,anchor:d,positionMethod:g,side:m,align:h,sideOffset:y,alignOffset:v,collisionBoundary:S="clipping-ancestors",collisionPadding:w,arrowPadding:T,sticky:O,disableAnchorTracking:A=!1,collisionAvoidance:C=rm,..._}=o,k=Ir(),M=wM(),z=lm(),D=k.useState("floatingRootContext"),L=k.useState("mounted"),B=k.useState("open"),Y=k.useState("openChangeReason"),H=k.useState("activeTriggerElement"),I=k.useState("modal"),j=k.useState("openMethod"),U=k.useState("positionerElement"),te=k.useState("instantType"),$=k.useState("transitionStatus"),P=k.useState("adaptiveOrigin"),q=b.useRef(null),X=Yu(U),Z=nf({anchor:d,floatingRootContext:D,positionMethod:g,mounted:L,side:m,sideOffset:y,align:h,alignOffset:v,arrowPadding:T,collisionBoundary:S,collisionPadding:w,sticky:O,disableAnchorTracking:A,keepMounted:M,nodeId:z,collisionAvoidance:C,adaptiveOrigin:P}),W=D.useState("domReferenceElement");we(()=>{const se=W,re=q.current;if(se&&(q.current=se),re&&se&&se!==re){k.set("instantType",void 0);const me=new AbortController;return X(()=>{k.set("instantType","trigger-change")},me.signal),()=>{me.abort()}}},[W,X,k]);const N=I===!0&&Y!==Bt;Am(B&&N,j==="touch",U,H);const V=k.useStateSetter("positionerElement"),J={open:B,side:Z.side,align:Z.align,anchorHidden:Z.anchorHidden,instant:te},K=of(o,J,{styles:Z.positionerStyles,transitionStatus:$,props:_,refs:[a,V],hidden:!L,inert:!B});return p.jsxs(Qw.Provider,{value:Z,children:[L&&N&&p.jsx(rf,{inert:yl(!B),cutout:H}),p.jsx(GS,{id:z,children:K})]})}),CM=b.createContext(void 0);function RM(){const[t,o]=b.useState(0),a=ke(()=>(o(l=>l+1),()=>{o(l=>Math.max(0,l-1))}));return{context:b.useMemo(()=>({register:a}),[a]),hasClosePart:t>0}}const OM=b.forwardRef(function(o,a){const{render:r,className:l,style:c,initialFocus:d,finalFocus:g,...m}=o,h=Ir(),y=Zw(),v=af()!=null,{context:S,hasClosePart:w}=RM(),T=h.useState("open"),O=h.useState("openMethod"),A=h.useState("instantType"),C=h.useState("transitionStatus"),_=h.useState("popupProps"),k=h.useState("titleElementId"),M=h.useState("descriptionElementId"),z=h.useState("modal"),D=h.useState("mounted"),L=h.useState("openChangeReason"),B=h.useState("activeTriggerElement"),Y=h.useState("floatingRootContext"),H=Y.useState("floatingId"),I=h.useState("disabled"),j=h.useState("openOnHover"),U=h.useState("closeDelay");fs({open:T,ref:h.context.popupRef,onComplete(){T&&h.context.onOpenChangeComplete?.(!0)}}),Sm(Y,{enabled:j&&!I,closeDelay:U});const te=d===void 0?a1(h.context.popupRef):d,$=z!==!1&&w;h.useSyncedValue("focusManagerModal",$);const P=h.useStateSetter("popupElement"),q={open:T,side:y.side,align:y.align,instant:A,transitionStatus:C},X=et("div",o,{state:q,ref:[a,h.context.popupRef,P],props:[_,{id:H,role:"dialog",...hl,"aria-labelledby":k,"aria-describedby":M,onKeyDown(Z){v&&bl.has(Z.key)&&Z.stopPropagation()}},gl(C),m],stateAttributesMapping:Du});return p.jsx(Bu,{context:Y,openInteractionType:O,modal:$,disabled:!D||L===Bt,initialFocus:te,returnFocus:g,restoreFocus:"popup",previousFocusableElement:yt(B)?B:void 0,nextFocusableElement:h.context.triggerFocusTargetRef,beforeContentFocusGuardRef:h.context.beforeContentFocusGuardRef,children:p.jsx(CM.Provider,{value:S,children:X})})}),AM=b.forwardRef(function(o,a){const{render:r,className:l,style:c,...d}=o,m=Ir().useState("open"),{arrowRef:h,side:y,align:v,arrowUncentered:S,arrowStyles:w}=Zw();return et("div",o,{state:{open:m,side:y,align:v,uncentered:S},ref:[a,h],props:[{style:w,"aria-hidden":!0},d],stateAttributesMapping:ul})});function Jw({open:t,onOpenChange:o,title:a,description:r,children:l,footer:c,className:d}){return p.jsx(fM,{open:t,onOpenChange:g=>o(g),children:p.jsxs(sM,{children:[p.jsx(Wk,{className:"fixed inset-0 z-[900] bg-black/30 transition-opacity data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"}),p.jsxs(oM,{className:lt("fixed left-1/2 top-1/2 z-[901] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-xl bg-surface p-5 text-fg shadow-popup outline-none","transition-[opacity,transform] data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",d),children:[p.jsxs("div",{className:"mb-3 flex items-start gap-3",children:[p.jsxs("div",{className:"flex-1",children:[p.jsx(dM,{className:"text-[15px] font-semibold",children:a}),r?p.jsx(Zk,{className:"mt-1 text-fg-muted",children:r}):null]}),p.jsx(Qk,{"aria-label":"Close",className:"rounded-md p-1 text-fg-muted hover:bg-hover",children:p.jsx(Sl,{className:"size-4"})})]}),l,c?p.jsx("div",{className:"mt-4 flex justify-end gap-2",children:c}):null]})]})})}function NM({open:t,onOpenChange:o,title:a,description:r,confirmLabel:l="Confirm",danger:c,onConfirm:d}){return p.jsx(Jw,{open:t,onOpenChange:o,title:a,description:r,footer:p.jsxs(p.Fragment,{children:[p.jsx(it,{onClick:()=>o(!1),children:"Cancel"}),p.jsx(it,{variant:c?"danger":"primary",onClick:()=>{d(),o(!1)},children:l})]})})}const kM="data-valid",MM="data-invalid",jM={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},_M={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},DM={disabled:!1,..._M},eT={valid(t){return t===null?null:t?{[kM]:""}:{[MM]:""}}},zM={invalid:void 0,name:void 0,validityData:{state:jM,errors:[],error:"",value:"",initialValue:null},setValidityData:It,disabled:void 0,setTouched:It,setDirty:It,setFilled:It,setFocused:It,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:DM,registerFieldControl:It,validation:{getValidationProps:(t,o=Tt)=>o,inputRef:{current:null},registeredInputs:new Map,registerInput:It,getInputControl:()=>null,commit:async()=>{},change:It}},LM=b.createContext(zM);function uf(t=!0){const o=b.useContext(LM);if(o.setValidityData===It&&!t)throw new Error(At(28));return o}const PM=b.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:It,validationMode:"onSubmit",submitCountRef:{current:0}});function tT(){return b.useContext(PM)}const IM=b.createContext({controlId:void 0,registerControlId:It,resetControlId:It,labelId:void 0,setLabelId:It,messageIds:[],setMessageIds:It,getDescriptionProps:t=>t});function Um(){return b.useContext(IM)}function Bm(t={}){const{id:o,enabled:a=!0}=t,{controlId:r,registerControlId:l,resetControlId:c}=Um(),d=mo(),g=Qt(()=>Symbol()),m=b.useRef(!1),h=b.useRef(!1),y=ke(()=>{!m.current||l===It||(m.current=!1,l(g.current,void 0))});return we(()=>{if(!a||l===It){y();return}let v;if(o!==void 0)h.current=!0,v=o;else if(h.current)v=d;else{c();return}if(v===void 0){y();return}m.current=!0,l(g.current,v)},[o,a,l,c,d,g,y]),we(()=>y,[y]),(a?r:void 0)??o??d}function Bi(t,o=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER){return Math.max(o,Math.min(t,a))}function nT(t,o,a,r,l=!0,c){const{registerFieldControl:d}=uf(),g=Qt(()=>Symbol());we(()=>{const m=g.current;if(!l){d(m,void 0);return}d(m,{controlRef:t,getValue:r,id:o,name:c,value:a})},[t,l,r,o,c,d,g,a]),we(()=>{const m=g.current;return()=>{d(m,void 0)}},[d,g])}function HM(t){const o=b.useRef(!0);o.current&&(o.current=!1,t())}const oT=b.createContext(void 0),sT=b.createContext(void 0),aT=b.createContext(void 0);function ds(){const t=b.useContext(oT);if(t===void 0)throw new Error(At(60));return t}function ff(){const t=b.useContext(sT);if(t===void 0)throw new Error(At(101));return t}function rT(){const t=b.useContext(aT);if(t===void 0)throw new Error(At(61));return t}function UM(t,o,a=Object.is){const{length:r}=t;if(r!==o.length)return!1;for(let l=0;l<r;l+=1)if(!a(t[l],o[l]))return!1;return!0}const iT=(t,o)=>Object.is(t,o);function Na(t,o,a){return t==null||o==null?Object.is(t,o):a(t,o)}function BM(t,o,a){return Array.isArray(t)&&Array.isArray(o)?!UM(t,o,(r,l)=>Na(r,l,a)):t!==o}function kh(t,o,a){return t?t.some(r=>r===void 0?!1:Na(o,r,a)):!1}function tu(t,o,a){return t?t.findIndex(r=>r===void 0?!1:Na(r,o,a)):-1}function VM(t,o){if(o!==iT)return r=>kh(t,r,o);const a=new Set(t);return a.delete(void 0),r=>a.has(r)&&(r!==0||t.some(l=>Object.is(r,l)))}function lT(t,o,a,r){const l=r&&Array.isArray(o)?t.findIndex(VM(o,a)):tu(t,o,a);return l===-1?null:l}function FM(t,o,a,r,l,c){return kh(r,o,l)?c!=null&&t>c&&kh(r,a[c],l)?c:t:t===c?lT(a,r,l,!0):c}function YM(t,o,a){return t.filter(r=>!Na(o,r,a))}function Mh(t){if(t==null)return"";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function qM(t){return typeof t=="object"&&t!=null&&Array.isArray(t.items)}function cT(t){return qM(t?.[0])}function GM(t){return cT(t)?t.flatMap(o=>o.items):t}function XM(t){if(!Array.isArray(t))return t!=null&&"null"in t;const o=t;if(cT(o)){for(const a of o)for(const r of a.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const a of o)if(a&&a.value==null&&a.label!=null)return!0;return!1}function uT(t,o){if(o&&t!=null)return o(t)??"";if(t&&typeof t=="object"){if("label"in t&&t.label!=null)return String(t.label);if("value"in t)return String(t.value)}return Mh(t)}function Tr(t,o){return o&&t!=null?o(t)??"":t&&typeof t=="object"&&"value"in t&&"label"in t?Mh(t.value):Mh(t)}function fT(t,o,a){function r(){return uT(t,a)}if(a&&t!=null)return a(t);if(t&&typeof t=="object"&&"label"in t&&t.label!=null)return t.label;if(o&&!Array.isArray(o))return(Object.hasOwn(o,t)?o[t]:void 0)??r();if(Array.isArray(o)){const c=GM(o);if(t==null||typeof t!="object"){const d=c.find(g=>g.value===t);return d&&d.label!=null?d.label:r()}if("value"in t){const d=c.find(g=>g&&g.value===t.value);if(d&&d.label!=null)return d.label}}return r()}function KM(t,o,a){return t.reduce((r,l,c)=>(c>0&&r.push(", "),r.push(p.jsx(b.Fragment,{children:fT(l,o,a)},c)),r),[])}const $M={id:t=>t.id,labelId:t=>t.labelId,modal:t=>t.modal,items:t=>t.items,itemToStringLabel:t=>t.itemToStringLabel,isItemEqualToValue:t=>t.isItemEqualToValue,value:t=>t.value,hasSelectedValue:t=>{const{value:o,multiple:a,itemToStringValue:r}=t;return o==null?!1:a&&Array.isArray(o)?o.length>0:Tr(o,r)!==""},hasNullItemLabel:(t,o)=>o?XM(t.items):!1,open:t=>t.open,mounted:t=>t.mounted,forceMount:t=>t.forceMount,transitionStatus:t=>t.transitionStatus,openMethod:t=>t.openMethod,activeIndex:t=>t.activeIndex,selectedIndex:t=>t.selectedIndex,isActive:(t,o)=>t.activeIndex===o,isSelected:(t,o)=>{const a=t.isItemEqualToValue,r=t.value;return t.multiple?Array.isArray(r)&&r.some(l=>Na(o,l,a)):Na(o,r,a)},isSelectedByFocus:(t,o)=>t.selectedIndex===o,popupProps:t=>t.popupProps,triggerProps:t=>t.triggerProps,triggerElement:t=>t.triggerElement,positionerElement:t=>t.positionerElement,listElement:t=>t.listElement,popupSide:t=>t.popupSide,scrollUpArrowVisible:t=>t.scrollUpArrowVisible,scrollDownArrowVisible:t=>t.scrollDownArrowVisible,hasScrollArrows:t=>t.hasScrollArrows},Xo=1;function dT(t,o){return Math.max(0,t-o)}function WM(t,o){if(o<=0)return 0;const a=Bi(t,0,o),r=a,l=o-a,c=r<=Xo,d=l<=Xo;return c&&d?r<=l?0:o:c?0:d?o:a}function QM(t){const{id:o,value:a,defaultValue:r=null,onValueChange:l,open:c,defaultOpen:d=!1,onOpenChange:g,name:m,form:h,autoComplete:y,disabled:v=!1,readOnly:S=!1,required:w=!1,modal:T=!0,actionsRef:O,inputRef:A,onOpenChangeComplete:C,items:_,multiple:k=!1,itemToStringLabel:M,itemToStringValue:z,isItemEqualToValue:D=iT,highlightItemOnHover:L=!0,children:B}=t,{clearErrors:Y}=tT(),{setDirty:H,setTouched:I,setFocused:j,validityData:U,setFilled:te,name:$,disabled:P,validation:q,validationMode:X}=uf(),Z=Bm({id:o}),W=P||v,N=$??m,[V,J]=Ji({controlled:a,default:k?r??po:r,name:"Select",state:"value"}),[K,se]=Ji({controlled:c,default:d,name:"Select",state:"open"}),re=b.useRef([]),me=b.useRef([]),pe=b.useRef(null),be=b.useRef(null),Ce=b.useRef(0),Me=b.useRef(null),ye=b.useRef([]),ge=b.useRef(!1),Te=b.useRef(null),Ae=b.useRef(null),Ue=b.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Ee=b.useRef(!1),Le=b.useRef(V),{mounted:Se,setMounted:Re,transitionStatus:Ne}=pm(K),{openMethod:Ie,triggerProps:je}=j1(K),le=Qt(()=>new Da({id:Z,labelId:void 0,modal:T,multiple:k,itemToStringLabel:M,itemToStringValue:z,isItemEqualToValue:D,value:V,open:K,mounted:Se,transitionStatus:Ne,items:_,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:Tt,triggerProps:Tt,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:It,setOpen:It,handleScrollArrowVisibility:It,onOpenChangeComplete:It,listRef:re,popupRef:pe,scrollHandlerRef:be,scrollArrowsMountedCountRef:Ce,valueRef:Me,valuesRef:ye,labelsRef:me,typingRef:ge,selectionRef:Ue,firstItemTextRef:Te,selectedItemTextRef:Ae,alignItemWithTriggerActiveRef:Ee,initialValueRef:Le},$M)).current,ve=le.useState("activeIndex"),he=le.useState("selectedIndex"),ce=le.useState("triggerElement"),xe=le.useState("positionerElement"),He=mN(Ie),Lt=Ie??He,Ft=b.useMemo(()=>k?"":Tr(V,z),[k,V,z]),ut=b.useMemo(()=>k&&Array.isArray(V)?V.map(Ze=>Tr(Ze,z)):Tr(V,z),[k,V,z]),Oe=Vt(ce),Ye=ke(()=>ut);nT(Oe,Z,V,Ye,!W,m);const Qe=k?Array.isArray(V)&&V.length>0:V!=null&&Ft!=="";we(()=>{te(Qe)},[Qe,te]),we(function(){const Rt=lT(ye.current,V,D,k);Rt===null&&(Ae.current=null),!K&&le.set("selectedIndex",Rt)},[k,K,V,D,le]),km(V,()=>{Y(N),H(BM(V,U.initialValue,D)),q.change(V)});const ct=ke((Ze,Rt)=>{g?.(Ze,Rt),!Rt.isCanceled&&(se(Ze),!Ze&&(Rt.reason===Fs||Rt.reason===Lu)&&(I(!0),j(!1),X==="onBlur"&&q.commit(V)))}),Jt=ke(()=>{Re(!1),le.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),C?.(!1)});fs({enabled:!O,open:K,ref:pe,onComplete(){K||Jt()}}),b.useImperativeHandle(O,()=>({unmount:Jt}),[Jt]);const rn=ke((Ze,Rt)=>{l?.(Ze,Rt),!Rt.isCanceled&&J(Ze)}),hn=ke(Ze=>{const Rt=dT(Ze.scrollHeight,Ze.clientHeight),Mn=WM(Ze.scrollTop,Rt),ao=Mn>0,bo=Mn<Rt;le.set("scrollUpArrowVisible",ao),le.set("scrollDownArrowVisible",bo)}),bt=_2({open:K,onOpenChange:ct,elements:{reference:ce,floating:xe}}),jt=Vu(bt,{enabled:!W,event:"mousedown"}),Fe=pl(bt),ft=f1(bt,{enabled:!W,listRef:re,activeIndex:ve,selectedIndex:he,disabledIndices:po,onNavigate(Ze){Ze===null&&!K||le.set("activeIndex",Ze)},focusItemOnHover:L}),_t=d1(bt,{enabled:!W&&(K||!S&&!k),listRef:me,activeIndex:ve,selectedIndex:he,disabledIndices:Ze=>U1(re.current[Ze]),onMatch(Ze){K?le.set("activeIndex",Ze):rn(ye.current[Ze],qe(ns))},onTyping(Ze){ge.current=Ze}}),Pt=b.useMemo(()=>no(_t.reference,ft.reference,Fe.reference,jt.reference,je),[jt.reference,_t.reference,ft.reference,Fe.reference,je]),Nn=b.useMemo(()=>no(hl,_t.floating,ft.floating,Fe.floating),[_t.floating,ft.floating,Fe.floating]),ln=ft.item??Tt;le.useContextCallback("setValue",rn),le.useContextCallback("setOpen",ct),le.useContextCallback("handleScrollArrowVisibility",hn),le.useContextCallback("onOpenChangeComplete",C),HM(()=>{le.update({popupProps:Nn,triggerProps:Pt})}),le.useSyncedValues({id:Z,modal:T,multiple:k,value:V,open:K,mounted:Se,transitionStatus:Ne,popupProps:Nn,triggerProps:Pt,items:_,itemToStringLabel:M,itemToStringValue:z,isItemEqualToValue:D,openMethod:Lt});const yo=b.useMemo(()=>({disabled:W,readOnly:S,required:w,multiple:k,highlightItemOnHover:L,itemProps:ln}),[W,S,w,k,L,ln]),vn=ss(A,q.inputRef),Ro=k?void 0:N,kn=b.useMemo(()=>!k||!Array.isArray(V)||!N?null:V.map(Ze=>{const Rt=Tr(Ze,z);return p.jsx("input",{type:"hidden",form:h,name:N,value:Rt,disabled:W},Rt)}),[k,V,h,N,z,W]);return p.jsxs(oT.Provider,{value:le,children:[p.jsx(sT.Provider,{value:yo,children:p.jsx(aT.Provider,{value:bt,children:B})}),p.jsx("input",{...q.getValidationProps(W,{onFocus(){le.state.triggerElement?.focus({focusVisible:!0})},onChange(Ze){if(Ze.nativeEvent.defaultPrevented||W||S)return;const Rt=Ze.currentTarget.value,Mn=qe(ns,Ze.nativeEvent);function ao(){if(k)return;const bo=Rt.toLowerCase();let ps=ye.current.findIndex(Yt=>Tr(Yt,z).toLowerCase()===bo||uT(Yt,M).toLowerCase()===bo);ps===-1&&(ps=ye.current.findIndex((Yt,mn)=>{const Oo=me.current[mn];return Oo!=null&&Oo.toLowerCase()===bo}));const ro=ye.current[ps];ro!=null&&rn(ro,Mn)}le.set("forceMount",!0),queueMicrotask(ao)}}),id:Z&&Ro==null?`${Z}-hidden-input`:void 0,form:h,name:Ro,autoComplete:y,value:Ft,disabled:W,required:w&&!(k&&Qe),readOnly:S,ref:vn,style:N?bS:Iu,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),kn]})}function ZM(t,o){return t??o}const JM="data-popup-side",ej=400,tj={...nu,...eT,popupSide:t=>t?{[JM]:t}:null,value:()=>null},nj=b.forwardRef(function(o,a){const{render:r,className:l,id:c,disabled:d=!1,nativeButton:g=!0,style:m,...h}=o,{setTouched:y,setFocused:v,validationMode:S,validation:w,state:T,disabled:O}=uf(),{labelId:A}=Um(),C=ds(),{readOnly:_,required:k,disabled:M}=ff(),z=O||M||d,D=C.useState("open"),L=C.useState("mounted"),B=C.useState("value"),Y=C.useState("triggerProps"),H=C.useState("positionerElement"),I=C.useState("listElement"),j=C.useState("popupSide"),U=C.useState("id"),te=C.useState("labelId"),$=C.useState("hasSelectedValue"),P=L&&H?j:null,q=c??U,X=ZM(A,te);Bm({id:c});const Z=Vt(H),W=b.useRef(null),{getButtonProps:N,buttonRef:V}=Co({disabled:z,native:g}),J=C.useStateSetter("triggerElement"),K=nn(),se=nn(),re=nn();b.useEffect(()=>{if(D)return re.start(ej,()=>{C.context.selectionRef.current.allowUnselectedMouseUp=!0,C.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{re.clear()};C.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},se.clear()},[D,C,se,re]);const me=no(Y,{id:q,role:"combobox","aria-expanded":D,"aria-haspopup":"listbox","aria-controls":D?I?.id??au(H)?.id:void 0,"aria-labelledby":X,"aria-readonly":_||void 0,"aria-required":k||void 0,tabIndex:z?-1:0,onFocus(Ce){v(!0),D&&C.context.alignItemWithTriggerActiveRef.current&&C.context.setOpen(!1,qe(ns,Ce.nativeEvent)),K.start(0,()=>{C.set("forceMount",!0)})},onBlur(Ce){De(H,Ce.relatedTarget)||(y(!0),v(!1),S==="onBlur"&&w.commit(B))},onMouseDown(Ce){if(D)return;const Me=We(Ce.currentTarget);function ye(ge){if(!W.current)return;const Te=ge.target;De(W.current,Te)||De(Z.current,Te)||z1(ge,W.current)||C.context.setOpen(!1,qe(pS,ge))}se.start(0,()=>{Me.addEventListener("mouseup",ye,{once:!0})})}},h,N),pe=w.getValidationProps(z,me);pe.role="combobox";const be={...T,open:D,disabled:z,value:B,readOnly:_,popupSide:P,placeholder:!$};return et("button",o,{ref:[a,W,V,J],state:be,stateAttributesMapping:tj,props:pe})}),oj={value:()=>null},sj=b.forwardRef(function(o,a){const{className:r,render:l,children:c,placeholder:d,style:g,...m}=o,h=ds(),y=h.useState("value"),v=h.useState("items"),S=h.useState("itemToStringLabel"),w=h.useState("hasSelectedValue"),T=!w&&d!=null&&c==null,O=h.useState("hasNullItemLabel",T),A={value:y,placeholder:!w};let C=null;return typeof c=="function"?C=c(y):c!=null?C=c:T&&!O?C=d:Array.isArray(y)?C=KM(y,v,S):C=fT(y,v,S),et("span",o,{state:A,ref:[a,h.context.valueRef],props:[{children:C},m],stateAttributesMapping:oj})}),aj=b.forwardRef(function(o,a){const{render:r,className:l,style:c,...d}=o,h={open:ds().useState("open")};return et("span",o,{state:h,ref:a,props:[{"aria-hidden":!0,children:"▼"},d],stateAttributesMapping:_u})}),rj=b.forwardRef(function(o,a){const r=ds(),l=r.useState("mounted"),c=r.useState("forceMount");return l||c?p.jsx(Uu,{ref:a,...o}):null}),pT=b.createContext(void 0);function hT(){const t=b.useContext(pT);if(!t)throw new Error(At(59));return t}function mu(t,o){t&&Object.assign(t.style,o)}const mT={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},ij={position:"fixed"},lj=b.forwardRef(function(o,a){const{anchor:r,className:l,render:c,positionMethod:d,side:g,align:m,sideOffset:h,alignOffset:y,collisionBoundary:v="clipping-ancestors",collisionPadding:S,arrowPadding:w,sticky:T,disableAnchorTracking:O,alignItemWithTrigger:A=!0,collisionAvoidance:C=HS,style:_,...k}=o,M=ds(),z=rT(),D=M.useState("open"),L=M.useState("mounted"),B=M.useState("modal"),Y=M.useState("value"),H=M.useState("openMethod"),I=M.useState("positionerElement"),j=M.useState("triggerElement"),U=M.useState("isItemEqualToValue"),te=M.useState("transitionStatus"),$=b.useRef(null),P=b.useRef(null),[q,X]=b.useState(A),Z=L&&q&&H!=="touch";!L&&q!==A&&X(A),b.useImperativeHandle(M.context.alignItemWithTriggerActiveRef,()=>Z),Am((Z||B)&&D,H==="touch",I,j);const W=nf({anchor:r,floatingRootContext:z,positionMethod:d,mounted:L,side:g,sideOffset:h,align:m,alignOffset:y,arrowPadding:w,collisionBoundary:v,collisionPadding:S,sticky:T,disableAnchorTracking:O??Z,collisionAvoidance:C,keepMounted:!0}),N=Z?"none":W.side,V=Z?ij:W.positionerStyles,J={open:D,side:N,align:W.align,anchorHidden:W.anchorHidden};we(()=>{M.set("popupSide",W.side)},[M,W.side]);const K=M.useStateSetter("positionerElement"),se=of(o,J,{styles:V,transitionStatus:te,props:k,refs:[a,K],hidden:!L,inert:!D}),re=b.useRef(0),me=ke(be=>{if(M.context.valuesRef.current.length===0)return;const Ce=re.current;re.current=be.size;const Me=qe(ns);if(Ce!==0&&!M.state.multiple&&Y!==null&&tu(M.context.valuesRef.current,Y,U)===-1){const ge=M.context.initialValueRef.current,Ae=ge!=null&&tu(M.context.valuesRef.current,ge,U)!==-1?ge:null;M.context.setValue(Ae,Me),Ae===null&&(M.set("selectedIndex",null),M.context.selectedItemTextRef.current=null)}if(Ce!==0&&M.state.multiple&&Array.isArray(Y)){const ye=Y.filter(ge=>tu(M.context.valuesRef.current,ge,U)!==-1);ye.length!==Y.length&&(M.context.setValue(ye,Me),ye.length===0&&(M.set("selectedIndex",null),M.context.selectedItemTextRef.current=null))}if(D&&Z){M.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const ye={height:""};mu(I,ye),mu(M.context.popupRef.current,ye)}}),pe=b.useMemo(()=>({...W,side:N,alignItemWithTriggerActive:Z,setControlledAlignItemWithTrigger:X,scrollUpArrowRef:$,scrollDownArrowRef:P}),[W,N,Z,X]);return p.jsx(Om,{elementsRef:M.context.listRef,labelsRef:M.context.labelsRef,onMapChange:me,children:p.jsxs(pT.Provider,{value:pe,children:[L&&B&&p.jsx(rf,{inert:yl(!D),cutout:j}),se]})})}),Kc="base-ui-disable-scrollbar",jh={className:Kc,getElement(t){return p.jsx("style",{nonce:t,href:Kc,precedence:"base-ui:low",children:`.${Kc}{scrollbar-width:none}.${Kc}::-webkit-scrollbar{display:none}`})}},cj=b.createContext(void 0),uj={disableStyleElements:!1};function fj(){return b.useContext(cj)??uj}const n0="--transform-origin",dj={...ul,...cl},pj=b.forwardRef(function(o,a){const{render:r,className:l,style:c,finalFocus:d,...g}=o,m=ds(),{multiple:h,readOnly:y,highlightItemOnHover:v}=ff(),S=rT(),{side:w,align:T,alignItemWithTriggerActive:O,isPositioned:A,setControlledAlignItemWithTrigger:C}=hT(),_=af()!=null,k=tf(),{nonce:M,disableStyleElements:z}=fj(),D=m.useState("id"),L=m.useState("open"),B=m.useState("openMethod"),Y=m.useState("mounted"),H=m.useState("popupProps"),I=m.useState("transitionStatus"),j=m.useState("triggerElement"),U=m.useState("positionerElement"),te=m.useState("listElement"),$=b.useRef(!1),P=b.useRef(!1),q=b.useRef({}),X=kr(),Z=ke(J=>{if(!U||!m.context.popupRef.current||!P.current)return;const K=U.style.top==="0px",se=U.style.bottom==="0px";if($.current||!O||!K&&!se){m.context.handleScrollArrowVisibility(J);return}const re=s0(U),me=Vi(U.getBoundingClientRect().height,"y",re),pe=We(U),be=Et(U),Ce=be.getComputedStyle(U),Me=parseFloat(Ce.marginTop),ye=parseFloat(Ce.marginBottom),ge=o0(be.getComputedStyle(m.context.popupRef.current)),Te=Math.min(pe.documentElement.clientHeight-Me-ye,ge),Ae=J.scrollTop,Ue=$c(J);let Ee=null;const Le=Ie=>{U.style.height=`${Ie}px`},Se=K?Ue-Ae:Ae,Re=Math.min(me+Se,Te);if(Se<=Xo){const Ie=Bi(Se,0,Te-me);Ie>0&&Le(me+Ie),J.scrollTop=K?Ue:0,Te-(me+Ie)<=Xo&&($.current=!0),m.context.handleScrollArrowVisibility(J);return}if(Te-Re>Xo)Ee=K?1/0:0;else if(se&&Ae<Ue){const Ie=me+Se-Te;Ee=Ae-(Se-Ie)}const Ne=Math.ceil(Re);if(Ne!==0&&Le(Ne),Ee!=null){const Ie=Bi(Ee,0,$c(J));Math.abs(J.scrollTop-Ie)>Xo&&(J.scrollTop=Ie)}Ne>=Te-Xo&&($.current=!0),m.context.handleScrollArrowVisibility(J)});b.useImperativeHandle(m.context.scrollHandlerRef,()=>Z,[Z]),fs({open:L,ref:m.context.popupRef,onComplete(){L&&m.context.onOpenChangeComplete(!0)}});const W={open:L,transitionStatus:I,side:w,align:T};we(()=>{!U||!m.context.popupRef.current||Object.keys(q.current).length||(q.current={top:U.style.top||"0",left:U.style.left||"0",right:U.style.right,height:U.style.height,bottom:U.style.bottom,minHeight:U.style.minHeight,maxHeight:U.style.maxHeight,marginTop:U.style.marginTop,marginBottom:U.style.marginBottom})},[m,U]),we(()=>{L||O||(P.current=!1,$.current=!1,mu(U,q.current))},[L,O,U]),we(()=>{const J=m.context.popupRef.current;if(!L||!j||!U||!J||O&&!A||m.state.transitionStatus==="ending")return;if(P.current=!0,J.style.removeProperty(n0),!O){X.request(()=>m.context.handleScrollArrowVisibility(te||J));return}const K=hj(J);try{let se=m.context.selectedItemTextRef.current;se?.isConnected||(se=!m.select("hasSelectedValue")&&m.context.firstItemTextRef.current?.isConnected?m.context.firstItemTextRef.current:null);const re=m.context.valueRef.current,me=Et(U),pe=me.getComputedStyle(U),be=me.getComputedStyle(J),Ce=We(j),Me=s0(j),ye=Wc(j.getBoundingClientRect(),Me),ge=Wc(U.getBoundingClientRect(),Me),Te=ye.height,Ae=te||J,Ue=Ae.scrollHeight,Ee=parseFloat(be.borderBottomWidth),Le=parseFloat(pe.marginTop)||10,Se=parseFloat(pe.marginBottom)||10,Re=parseFloat(pe.minHeight)||100,Ne=o0(be),Ie=5,je=5,le=20,ve=Ce.documentElement.clientHeight-Le-Se,he=Ce.documentElement.clientWidth,ce=ve-ye.bottom+Te;let xe,He=k==="rtl"?ye.right-ge.width:ye.left,Lt=0;if(se&&re){const jt=Wc(re.getBoundingClientRect(),Me);xe=Wc(se.getBoundingClientRect(),Me),He=ge.left+(k==="rtl"?jt.right-xe.right:jt.left-xe.left);const Fe=jt.top-ye.top+jt.height/2;Lt=xe.top-ge.top+xe.height/2-Fe}const Ft=ce+Lt+Se+Ee;let ut=Math.min(ve,Ft);const Oe=ve-Le-Se,Ye=Ft-ut,Qe=he-je;U.style.left=`${Bi(He,Ie,Qe-ge.width)}px`,U.style.height=`${ut}px`,U.style.maxHeight="none",U.style.marginTop=`${Le}px`,U.style.marginBottom=`${Se}px`,J.style.height="100%";const ct=$c(Ae),Jt=Ye>=ct-Xo;Jt&&(ut=Math.min(ve,ge.height)-(Ye-ct));const rn=ye.top<le||ye.bottom>ve-le||Math.ceil(ut)+Xo<Math.min(Ue,Re),hn=(me.visualViewport?.scale??1)!==1&&cs;if(rn||hn){mu(U,q.current),C(!1);return}const bt=Math.max(Re,ut);if(Jt){const jt=Math.max(0,ve-Ft);U.style.top=ge.height>=Oe?"0":`${jt}px`,U.style.height=`${ut}px`,Ae.scrollTop=$c(Ae)}else U.style.bottom="0",Ae.scrollTop=Ye;if(xe){const jt=ge.top,Fe=ge.height,ft=xe.top+xe.height/2,_t=Bi(Fe>0?(ft-jt)/Fe*100:50,0,100);J.style.setProperty(n0,`50% ${_t}%`)}(bt===ve||ut>=Ne)&&($.current=!0),m.context.handleScrollArrowVisibility(Ae),v&&m.state.selectedIndex===null&&m.state.activeIndex===null&&m.context.listRef.current[0]!=null&&m.set("activeIndex",0)}finally{K()}},[m,L,U,j,O,C,X,te,v,k,A]),b.useEffect(()=>{if(!O||!U||!L)return;const J=Et(U);function K(se){m.context.setOpen(!1,qe(NO,se))}return Ge(J,"resize",K)},[m,O,U,L]);const N={...te?{role:"presentation"}:{role:"listbox","aria-multiselectable":h||void 0,"aria-readonly":y||void 0,id:`${D}-list`},onKeyDown(J){_&&bl.has(J.key)&&J.stopPropagation()},onScroll(J){te||Z(J.currentTarget)},...O&&{style:te?{height:"100%"}:mT},className:!te&&O?jh.className:void 0},V=et("div",o,{ref:[a,m.context.popupRef],state:W,stateAttributesMapping:dj,props:[H,N,gl(I),g]});return p.jsxs(b.Fragment,{children:[!z&&jh.getElement(M),p.jsx(Bu,{context:S,modal:!1,disabled:!Y,openInteractionType:B,returnFocus:d,restoreFocus:!0,children:V})]})});function o0(t){const o=t.maxHeight;return o.endsWith("px")&&parseFloat(o)||1/0}function $c(t){return dT(t.scrollHeight,t.clientHeight)}function s0(t){return JS.getScale(t)}function Vi(t,o,a){return t/a[o]}function Wc(t,o){return Qi({x:Vi(t.x,"x",o),y:Vi(t.y,"y",o),width:Vi(t.width,"x",o),height:Vi(t.height,"y",o)})}const a0=[["transform","none"],["scale","1"],["translate","0 0"]];function hj(t){const{style:o}=t,a={};for(const[r,l]of a0)a[r]=o.getPropertyValue(r),o.setProperty(r,l,"important");return()=>{for(const[r]of a0){const l=a[r];l?o.setProperty(r,l):o.removeProperty(r)}}}const mj=b.forwardRef(function(o,a){const{render:r,className:l,style:c,...d}=o,g=ds(),{multiple:m,readOnly:h}=ff(),{alignItemWithTriggerActive:y}=hT(),v=g.useState("hasScrollArrows"),S=g.useState("openMethod"),T={id:`${g.useState("id")}-list`,role:"listbox","aria-multiselectable":m||void 0,"aria-readonly":h||void 0,onScroll(A){g.context.scrollHandlerRef.current?.(A.currentTarget)},...y&&{style:mT},className:v&&S!=="touch"?jh.className:void 0},O=g.useStateSetter("listElement");return et("div",o,{ref:[a,O],props:[T,d]})}),gT=b.createContext(void 0);function Vm(){const t=b.useContext(gT);if(!t)throw new Error(At(57));return t}const gj=b.memo(b.forwardRef(function(o,a){const{render:r,className:l,style:c,value:d=null,label:g,disabled:m=!1,nativeButton:h=!1,...y}=o,v=b.useRef(null),S=sf({guess:!0,label:g,textRef:v}),w=ds(),{itemProps:T,multiple:O,disabled:A,readOnly:C}=ff(),_=A||m,k=w.useState("isActive",S.index),M=w.useState("open"),z=w.useState("isSelected",d),D=w.useState("isSelectedByFocus",S.index),L=w.useState("isItemEqualToValue"),B=S.index,Y=b.useRef(null);we(()=>{const W=w.context.valuesRef.current;return W[B]=d,()=>{delete W[B]}},[B,d,w]),we(()=>{const W=w.state.value,N=w.state.selectedIndex;let V=N,J;O&&Array.isArray(W)?(V=FM(B,d,w.context.valuesRef.current,W,L,N),J=V===B,B===N&&!J&&(w.context.selectedItemTextRef.current=null)):(J=W!==void 0&&Na(d,W,L),J&&(V=B)),w.set("selectedIndex",V),J&&v.current&&(w.context.selectedItemTextRef.current=v.current)},[B,O,L,w,d]);const H=b.useRef("mouse"),I=b.useRef(!1),{getButtonProps:j,buttonRef:U}=Co({disabled:_,focusableWhenDisabled:!0,native:h,composite:!0}),te={disabled:_,selected:z,highlighted:k};function $(W){if(A||C)return;const N=w.state.value;if(O){const V=Array.isArray(N)?N:[],J=z?YM(V,d,L):[...V,d];w.context.setValue(J,qe(Fi,W))}else w.context.setValue(d,qe(Fi,W)),w.context.setOpen(!1,qe(Fi,W))}function P(){w.context.selectionRef.current.dragY=0}const q={role:"option","aria-selected":z,tabIndex:M&&k?0:-1,onKeyDown(W){w.set("activeIndex",B),W.key===" "&&w.context.typingRef.current&&W.preventDefault()},onClick(W){const N=H.current!=="touch",V=W.nativeEvent.pointerType,J=N&&Ou(W.nativeEvent)&&(V!==void 0||k),K=N&&!J&&!I.current;I.current=!1,!(_||K)&&$(W.nativeEvent)},onPointerEnter(W){H.current=W.pointerType},onPointerMove(W){if(W.pointerType==="mouse"&&W.buttons===1){const N=w.context.selectionRef.current;N.dragY+=W.movementY,N.dragY**2>=64&&(N.allowUnselectedMouseUp=!0)}},onPointerDown(W){H.current=W.pointerType,I.current=!0,P()},onMouseUp(){if(P(),_||H.current==="touch"||I.current)return;const W=!w.context.selectionRef.current.allowSelectedMouseUp&&z,N=!w.context.selectionRef.current.allowUnselectedMouseUp&&!z;W||N||(I.current=!0,Y.current?.click(),I.current=!1)}},X=et("div",o,{ref:[U,a,S.ref,Y],state:te,props:[T,q,y,j]}),Z=b.useMemo(()=>({selected:z,index:B,textRef:v,selectedByFocus:D}),[z,B,v,D]);return p.jsx(gT.Provider,{value:Z,children:X})})),yj=b.forwardRef(function(o,a){const{selected:r}=Vm();return o.keepMounted||r?p.jsx(bj,{...o,ref:a}):null}),bj=b.memo(b.forwardRef((t,o)=>{const{render:a,className:r,style:l,keepMounted:c,...d}=t,{selected:g}=Vm(),m=b.useRef(null),{transitionStatus:h,setMounted:y}=pm(g),S=et("span",t,{ref:[o,m],state:{selected:g,transitionStatus:h},props:[{"aria-hidden":!0,children:"✔️"},d],stateAttributesMapping:cl});return fs({batch:!0,enabled:!g,open:g,ref:m,onComplete(){g||y(!1)}}),S})),vj=b.memo(b.forwardRef(function(o,a){const{index:r,textRef:l,selectedByFocus:c}=Vm(),d=ds(),{render:g,className:m,style:h,...y}=o,v=b.useCallback(w=>{w&&(r===0&&(d.context.firstItemTextRef.current=w),c&&(d.context.selectedItemTextRef.current=w))},[d,r,c]);return et("div",o,{ref:[v,a,l],props:y})})),yT=b.createContext(void 0);function xj(){const t=b.useContext(yT);if(t===void 0)throw new Error(At(63));return t}const Sj="data-checked",wj="data-unchecked",bT={...eT,checked(t){return t?{[Sj]:""}:{[wj]:""}}};function Tj(t,o,a,r=!0,l){const[c,d]=b.useState(),g=mo(l?`${l}-label`:void 0),m=t??o??c;return we(()=>{const h=t||o||!r?void 0:Ej(a.current,g);c!==h&&d(h)}),m}function Ej(t,o){const a=Cj(t);if(a)return!a.id&&o&&(a.id=o),a.id||void 0}function Cj(t){if(!t)return;const o=t.parentElement;if(o&&o.tagName==="LABEL")return o;const a=t.id;if(a){const l=t.nextElementSibling;if(l&&l.htmlFor===a)return l}const r=t.labels;return r&&r[0]}const Rj=b.forwardRef(function(o,a){const{checked:r,className:l,defaultChecked:c,"aria-labelledby":d,form:g,id:m,inputRef:h,name:y,nativeButton:v=!1,onCheckedChange:S,readOnly:w=!1,required:T=!1,disabled:O=!1,render:A,uncheckedValue:C,value:_,style:k,...M}=o,{clearErrors:z}=tT(),{state:D,setTouched:L,setDirty:B,validityData:Y,setFilled:H,setFocused:I,validationMode:j,disabled:U,name:te,validation:$}=uf(),{labelId:P}=Um(),q=U||O,X=te??y,Z=b.useRef(null),W=ss(Z,h,$.inputRef),N=b.useRef(null),V=mo(),J=Bm({id:m}),K=v?void 0:J,[se,re]=Ji({controlled:r,default:!!c,name:"Switch",state:"checked"});nT(N,V,se,void 0,!q,y),we(()=>{H(se)},[se,H]),km(se,()=>{z(X),B(se!==Y.initialValue),$.change(se)});const{getButtonProps:me,buttonRef:pe}=Co({disabled:q,native:v}),be=Tj(d,P,Z,!v,K),Ce={id:v?J:V,role:"switch","aria-checked":se,"aria-readonly":w||void 0,"aria-required":T||void 0,"aria-labelledby":be,onFocus(){q||I(!0)},onBlur(){const Te=Z.current;!Te||q||(L(!0),I(!1),j==="onBlur"&&$.commit(Te.checked))},onClick(Te){if(w||q)return;Te.preventDefault();const Ae=Z.current;Ae&&Gi(Ae,Te)}},Me={...$.getValidationProps(q),checked:se,disabled:q,form:g,id:K,name:X,required:T,style:X?bS:Iu,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:W,onChange(Te){if(Te.nativeEvent.defaultPrevented)return;if(w){Te.preventDefault();return}const Ae=Te.currentTarget.checked,Ue=qe(ns,Te.nativeEvent);S?.(Ae,Ue),!Ue.isCanceled&&re(Ae)},onClick(Te){Te.stopPropagation()},onFocus(){N.current?.focus()},..._!==void 0?{value:_}:Tt},ye=b.useMemo(()=>({...D,checked:se,disabled:q,readOnly:w,required:T}),[D,se,q,w,T]),ge=et("span",o,{state:ye,ref:[a,N,pe],props:[Ce,M,me,Te=>$.getValidationProps(q,Te)],stateAttributesMapping:bT});return p.jsxs(yT.Provider,{value:ye,children:[ge,!se&&X&&C!==void 0&&p.jsx("input",{type:"hidden",form:g,name:X,value:C,disabled:q}),p.jsx("input",{...Me,suppressHydrationWarning:!0})]})}),Oj=b.forwardRef(function(o,a){const{render:r,className:l,style:c,...d}=o,g=xj();return et("span",o,{state:g,ref:a,stateAttributesMapping:bT,props:d})}),vT="data-composite-item-active";function Aj(t){const{loopFocus:o=!0,orientation:a="both",grid:r,onLoop:l,direction:c,highlightedIndex:d,onHighlightedIndexChange:g,rootRef:m,enableHomeAndEndKeys:h=!1,stopEventPropagation:y,disabledIndices:v,modifierKeys:S=po}=t,[w,T]=b.useState(0),O=r!=null,A=b.useRef(null),C=ss(A,m),_=b.useRef([]),k=b.useRef(!1),M=b.useRef(null),z=d??w,D=ke((I,j=!1)=>{if(M.current=_.current[I]??null,(g??T)(I),j){const U=_.current[I];Xx(A.current,U,c,a)}}),L=ke(I=>{if(I.size===0)return;if(k.current){const $=_.current,P=$.indexOf(M.current);if(P===-1){const q=$[z];!q||Cr($,z,v)?D(Nj($,v)):M.current=q}else P!==z&&D(P);return}k.current=!0;const j=Array.from(I.keys()),U=j.find($=>$?.hasAttribute(vT))??null,te=U?I.get(U)?.index??-1:-1;if(te!==-1)D(te);else if(Cr(j,z,v)){const $=$o(j,{disabledIndices:v});Yi(j,$)||D($)}Xx(A.current,U,c,a)});we(()=>{if(v==null||d!=null||!k.current)return;const I=_.current;if(Cr(I,z,v)){const j=$o(I,{disabledIndices:v});Yi(I,j)||D(j)}},[v,d,z,_,D]);const B=ke((I,j,U)=>l?l(I,j,U,_):U),Y=ke(I=>{const j=I.key===Rh||I.key===Oh;if(!bl.has(I.key)||!h&&j||kj(I,S)||!A.current)return;const te=c==="rtl",$=te?Eh:Ch,P=te?Ch:Eh,q=a==="vertical"?Th:$,X=a==="vertical"?wh:P,Z=zt(I.nativeEvent);if(Z!=null&&Gx(Z)&&!U1(Z)){const se=Z.selectionStart,re=Z.selectionEnd,me=Z.value;if(se==null||I.shiftKey||se!==re||I.key!==X&&se<me.length||I.key!==q&&se>0)return}let W=z;const N=Zc(_,v),V=bh(_,v);r!=null&&(W=r({disabledIndices:v,elementsRef:_,event:I,highlightedIndex:z,loopFocus:o,maxIndex:V,minIndex:N,onLoop:B,orientation:a,rtl:te}));const J=a!=="vertical"&&I.key===$||a!=="horizontal"&&I.key===Th,K=a!=="vertical"&&I.key===P||a!=="horizontal"&&I.key===wh;h&&(I.key===Rh?W=N:I.key===Oh&&(W=V)),W===z&&(J||K)&&(o&&W===V&&J?(W=N,l&&(W=l(I,z,W,_))):o&&W===N&&K?(W=V,l&&(W=l(I,z,W,_))):W=$o(_.current,{startingIndex:W,decrement:K,disabledIndices:v})),W!==z&&!Yi(_.current,W)&&(y&&I.stopPropagation(),(O||j||J||K)&&I.preventDefault(),D(W,!0),queueMicrotask(()=>{_.current[W]?.focus()}))});return{props:{ref:C,onFocus(I){const j=A.current,U=zt(I.nativeEvent);!j||U==null||!Gx(U)||U.setSelectionRange(0,U.value.length)},onKeyDown:Y},highlightedIndex:z,onHighlightedIndexChange:D,elementsRef:_,onMapChange:L,relayKeyboardEvent:Y}}function Nj(t,o){let a=-1;for(let r=0;r<t.length;r+=1){const l=t[r];if(!(!l||Cr(t,r,o))){if(l.hasAttribute(vT))return r;a===-1&&(a=r)}}return Math.max(a,0)}function kj(t,o){for(const a of jN)if(!o.includes(a)&&t.getModifierState(a))return!0;return!1}function Mj(t){const{render:o,className:a,style:r,refs:l=po,props:c=po,state:d=Tt,stateAttributesMapping:g,highlightedIndex:m,onHighlightedIndexChange:h,orientation:y,grid:v,loopFocus:S,onLoop:w,enableHomeAndEndKeys:T,onMapChange:O,stopEventPropagation:A=!0,rootRef:C,disabledIndices:_,modifierKeys:k,highlightItemOnHover:M=!1,tag:z="div",...D}=t,L=tf(),{props:B,highlightedIndex:Y,onHighlightedIndexChange:H,elementsRef:I,onMapChange:j,relayKeyboardEvent:U}=Aj({grid:v,loopFocus:S,onLoop:w,orientation:y,highlightedIndex:m,onHighlightedIndexChange:h,rootRef:C,stopEventPropagation:A,enableHomeAndEndKeys:T,direction:L,disabledIndices:_,modifierKeys:k}),te=et(z,t,{state:d,ref:l,props:[B,...c,D],stateAttributesMapping:g}),$=b.useMemo(()=>({highlightedIndex:Y,onHighlightedIndexChange:H,highlightItemOnHover:M,relayKeyboardEvent:U}),[Y,H,M,U]);return p.jsx(T1.Provider,{value:$,children:p.jsx(Om,{elementsRef:I,onMapChange:P=>{O?.(P),j(P)},children:te})})}const jj=b.createContext(void 0);function _j(){return b.useContext(jj)}const xT=b.createContext(void 0);function Dj(){return b.useContext(xT)}const zj=b.forwardRef(function(o,a){const{defaultValue:r,disabled:l=!1,loopFocus:c=!0,onValueChange:d,orientation:g="horizontal",multiple:m=!1,value:h,className:y,render:v,style:S,...w}=o,T=af(),O=_j(),A=r??po,C=h!==void 0||r!==void 0,_=(T?.disabled??!1)||(O?.disabled??!1)||l,[k,M]=Ji({controlled:h,default:A,name:"ToggleGroup",state:"value"}),z=ke((H,I,j)=>{let U;m?(U=k.slice(),I?U.push(H):U.splice(k.indexOf(H),1)):U=I?[H]:[],d?.(U,j),!j.isCanceled&&M(U)}),D={disabled:_,multiple:m,orientation:g},L=b.useMemo(()=>({disabled:_,setGroupValue:z,value:k,isValueInitialized:C}),[_,z,k,C]),B={role:"group"},Y=et("div",o,{enabled:!!T,state:D,ref:a,props:[B,w]});return p.jsx(xT.Provider,{value:L,children:T?Y:p.jsx(Mj,{render:v,className:y,style:S,state:D,refs:[a],props:[B,w],loopFocus:c,enableHomeAndEndKeys:!0,orientation:g})})}),Lj=b.forwardRef(function(o,a){const{className:r,defaultPressed:l=!1,disabled:c=!1,form:d,onPressedChange:g,pressed:m,render:h,type:y,value:v,nativeButton:S=!0,style:w,...T}=o,O=mo(v||void 0),A=Dj(),C=A?.value??[],_=(c||A?.disabled)??!1,[k,M]=Ji({controlled:A?O!==void 0&&C.indexOf(O)>-1:m,default:l,name:"Toggle",state:"pressed"}),{getButtonProps:z,buttonRef:D}=Co({disabled:_,native:S}),L={disabled:_,pressed:k},B=[D,a],Y=[{"aria-pressed":k,onClick(j){const U=!k,te=qe(ns,j.nativeEvent);g?.(U,te),!te.isCanceled&&(O&&A?.setGroupValue?.(O,U,te),!te.isCanceled&&M(U))}},T,z],H=et("button",o,{enabled:!A,state:L,ref:B,props:Y}),I=b.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return A?p.jsx(L1,{tag:"button",render:h,className:r,style:w,metadata:I,state:L,refs:B,props:Y}):H}),ST="h-7 w-full min-w-0 rounded-control border border-line bg-surface-2 px-2 text-[13px] text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:bg-surface",tl=b.forwardRef(function({className:o,...a},r){return p.jsx("input",{ref:r,"data-ui-field":"",className:lt(ST,o),...a})});function Pj({value:t,options:o,onChange:a,placeholder:r="—",className:l,...c}){return p.jsxs(QM,{value:t,onValueChange:d=>d!==null&&a(d),children:[p.jsxs(nj,{"aria-label":c["aria-label"],"data-ui-field":"",className:lt(ST,"flex items-center justify-between gap-1 text-left",l),children:[p.jsx(sj,{children:d=>o.find(g=>g.value===d)?.label??p.jsx("span",{className:"text-fg-subtle",children:r})}),p.jsx(aj,{children:p.jsx(Aa,{className:"size-3.5 text-fg-subtle"})})]}),p.jsx(rj,{children:p.jsx(lj,{sideOffset:4,className:"z-[1000]",alignItemWithTrigger:!1,children:p.jsx(pj,{className:lt(Hm,"max-h-80 overflow-auto"),children:p.jsx(mj,{children:o.map(d=>p.jsxs(gj,{value:d.value,className:"flex h-7 min-w-32 cursor-default select-none items-center gap-2 rounded-md px-2 outline-none data-[highlighted]:bg-hover",children:[p.jsx("span",{className:"flex size-4 items-center justify-center",children:p.jsx(yj,{children:p.jsx(Pr,{className:"size-3.5"})})}),p.jsx(vj,{children:d.label})]},d.value))})})})})]})}function Ij({value:t,options:o,onChange:a,onRepick:r,className:l,...c}){return p.jsx(zj,{value:t===null?[]:[t],onValueChange:d=>{const g=d[0];g!==void 0?a(g):t!==null&&r?.(t)},"aria-label":c["aria-label"],"data-ui-field":"",className:lt("flex h-7 items-center gap-0.5 rounded-control bg-surface-2 p-0.5",l),children:o.map(d=>p.jsx(Lj,{value:d.value,"aria-label":d.title,title:d.title,className:"flex h-full flex-1 items-center justify-center whitespace-nowrap rounded-[4px] px-1.5 text-fg-muted outline-none hover:text-fg data-[pressed]:bg-surface data-[pressed]:text-fg data-[pressed]:shadow-sm focus-visible:outline-2 focus-visible:outline-accent",children:d.label},d.value))})}function wT({checked:t,onChange:o,disabled:a,...r}){return p.jsx(Rj,{checked:t,disabled:a,onCheckedChange:l=>o(l),onKeyDown:jr,"aria-label":r["aria-label"],className:"relative inline-flex h-4 w-7 shrink-0 items-center rounded-full bg-line-strong p-0.5 transition-colors data-[checked]:bg-accent disabled:opacity-40",children:p.jsx(Oj,{className:"size-3 rounded-full bg-white shadow transition-transform data-[checked]:translate-x-3"})})}function Hj(t,o){const a=Et(t).getComputedStyle(t).transform;let r=0,l=0,c=1;if(a&&a!=="none"){const d=a.match(/matrix(?:3d)?\(([^)]+)\)/);if(d){const g=d[1].split(", ").map(parseFloat);g.length===6?(r=g[4],l=g[5],c=Math.sqrt(g[0]*g[0]+g[1]*g[1])):g.length===16&&(r=g[12],l=g[13],c=g[0])}}return{x:r,y:l,scale:c}}const TT=b.createContext(void 0);function df(){const t=b.useContext(TT);if(!t)throw new Error(At(73));return t}let r0=0;function ET(t){return r0+=1,`${t}-${Math.random().toString(36).slice(2,6)}-${r0}`}function Zp(t,o){if(typeof t=="string")return{description:t};if(typeof t=="function"){const a=t(o);return typeof a=="string"?{description:a}:a}return t}function Jp(t){const o=new Map;let a=0,r=0;return t.forEach((l,c)=>{const d=l.transitionStatus==="ending";o.set(l.id,{value:l,domIndex:c,visibleIndex:d?-1:a,offsetY:r}),r+=l.height||0,d||(a+=1)}),o}function eh(t,o){let a=0;return t.map(r=>{if(r.transitionStatus==="ending")return r;const l=a>=o;return a+=1,r.limited===l?r:{...r,limited:l}})}const uo={toasts:t=>t.toasts,isEmpty:t=>t.toasts.length===0,toast:(t,o)=>t.toastMetadata.get(o)?.value,toastIndex:(t,o)=>t.toastMetadata.get(o)?.domIndex??-1,toastOffsetY:(t,o)=>t.toastMetadata.get(o)?.offsetY??0,toastVisibleIndex:(t,o)=>t.toastMetadata.get(o)?.visibleIndex??-1,focused:t=>t.focused,expanded:t=>t.hovering||t.focused,expandedOrOutOfFocus:t=>t.hovering||t.focused||!t.isWindowFocused,prevFocusElement:t=>t.prevFocusElement};class Uj extends Da{timers=new Map;areTimersPaused=!1;constructor(o){super({...o,toastMetadata:Jp(o.toasts)},{},uo)}setViewport=o=>{this.set("viewport",o)};syncProviderProps(o,a){const r=this.state.limit!==a;if(this.state.timeout===o&&!r)return;const l={timeout:o,limit:a};if(r){const c=eh(this.state.toasts,a);l.toasts=c,l.toastMetadata=Jp(c)}this.update(l)}disposeEffect=()=>()=>{this.timers.forEach(o=>{o.timeout?.clear()}),this.timers.clear()};removeToast(o,a=!1){const r=uo.toastIndex(this.state,o);if(r===-1)return;const l=this.state.toasts[r];a||l?.onRemove?.();const c=[...this.state.toasts];c.splice(r,1),this.setToasts(c)}addToast=o=>{const{timeout:a,limit:r}=this.state,l=o.id||ET("toast");if(o.id){const m=uo.toast(this.state,o.id);if(m)if(m.transitionStatus==="ending")this.removeToast(o.id,!0);else{const{id:h,transitionStatus:y,...v}=o;return this.updateToastInternal(o.id,v,!0,!0),o.id}}const c={...o,id:l,updateKey:0,transitionStatus:"starting"},d=[c,...this.state.toasts];this.setToasts(eh(d,r));const g=c.timeout??a;return c.type!=="loading"&&g>0&&this.scheduleTimer(l,g,()=>this.closeToast(l)),uo.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),l};updateToast=(o,a)=>{const r=uo.toast(this.state,o);!r||r.transitionStatus==="ending"||this.updateToastInternal(o,typeof a=="function"?a(r):a,!1,!0)};updateToastInternal=(o,a,r=!1,l=!1)=>{const{timeout:c,toasts:d}=this.state,g=uo.toast(this.state,o);if(!g||g.transitionStatus==="ending")return;const m={...g,...a,...l&&{updateKey:g.updateKey+1}};this.setToasts(d.map(A=>A.id===o?m:A));const h=m.timeout??c,y=g.timeout??c,v=Object.hasOwn(a,"timeout"),S=m.transitionStatus!=="ending"&&m.type!=="loading"&&h>0,w=this.timers.has(o),T=y!==h,O=g.type==="loading";if(!S&&w){this.clearTimer(o);return}S&&(!w||T||v||O||r)&&(this.clearTimer(o),this.scheduleTimer(o,h,()=>this.closeToast(o)),uo.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=o=>{const a=o===void 0,{limit:r,toasts:l}=this.state;let c;if(a)c=l,this.clearTimers();else{const m=uo.toast(this.state,o);if(!m)return;c=[m],this.clearTimer(o)}const d=l.map(m=>a||m.id===o?{...m,transitionStatus:"ending",height:0}:m),g=eh(d,r);this.setToasts(g,!g.some(m=>m.transitionStatus!=="ending")),c.forEach(m=>{m.transitionStatus!=="ending"&&m.onClose?.()}),this.handleFocusManagement(o)};promiseToast=(o,a)=>{const r=Zp(a.loading),l=this.addToast({...r,type:"loading"}),c=o.then(d=>{const g=Zp(a.success,d);return this.updateToast(l,{...g,type:"success",timeout:g.timeout}),d}).catch(d=>{const g=Zp(a.error,d);return this.updateToast(l,{...g,type:"error",timeout:g.timeout}),Promise.reject(d)});return{}.hasOwnProperty.call(a,"setPromise")&&a.setPromise(c),c};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(o=>{o.timeout&&(o.timeout.clear(),o.remaining=Math.max(o.remaining-(Date.now()-o.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((o,a)=>{o.remaining=o.remaining>0?o.remaining:o.delay,o.timeout??=An.create(),o.timeout.start(o.remaining,()=>{this.handleTimerFired(a),o.callback()}),o.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=o=>{if(o.pointerType!=="touch")return;const a=zt(o);De(this.state.viewport,a)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(o,a,r){const l=Date.now(),d=!uo.expandedOrOutOfFocus(this.state)?An.create():void 0;d?.start(a,()=>{this.handleTimerFired(o),r()}),this.timers.set(o,{timeout:d,start:l,delay:a,remaining:a,callback:r})}clearTimers(){this.timers.forEach(o=>{o.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(o){this.timers.get(o)?.timeout?.clear(),this.timers.delete(o),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(o){this.timers.delete(o),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(o,a=o.length===0){const r={toasts:o,toastMetadata:Jp(o)};a&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(o){const a=tn(We(this.state.viewport));if(!this.state.viewport||!De(this.state.viewport,a)||!su(a))return;if(o===void 0){this.restoreFocusToPrevElement();return}const r=uo.toasts(this.state),l=uo.toastIndex(this.state,o),c=(g,m)=>{for(let h=g;h>=0&&h<r.length;h+=m)if(r[h].transitionStatus!=="ending")return r[h];return null},d=c(l+1,1)??c(l-1,-1);d?d.ref?.current?.focus():this.restoreFocusToPrevElement()}}const Bj=function(o){const{children:a,timeout:r=5e3,limit:l=3,toastManager:c}=o,d=Qt(()=>new Uj({timeout:r,limit:l,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Eu(d.disposeEffect),b.useEffect(function(){return c?c[" subscribe"](({action:h,options:y})=>{const v=y.id;h==="promise"&&y.promise?d.promiseToast(y.promise,y):h==="update"&&v?d.updateToast(v,y.updates):h==="close"?d.closeToast(v):d.addToast(y)}):void 0},[d,c]),p.jsxs(TT.Provider,{value:d,children:[p.jsx(Vj,{store:d,timeout:r,limit:l}),a]})};function Vj(t){const{store:o,timeout:a,limit:r}=t;return we(()=>{o.syncProviderProps(a,r)},[o,a,r]),null}const Fj="--toast-frontmost-height",Yj=b.forwardRef(function(o,a){const{render:r,className:l,style:c,children:d,...g}=o,m=df(),h=nn(),y=b.useRef(!1),v=b.useRef(!1),S=b.useRef(!1),w=m.useState("isEmpty"),T=m.useState("toasts"),O=m.useState("focused"),A=m.useState("expanded"),C=m.useState("prevFocusElement"),_=T[0]?.height,k=T.some(Z=>Z.transitionStatus==="ending"),M=T.filter(Z=>Z.priority==="high");b.useEffect(()=>{const Z=m.state.viewport;if(!Z||w)return;const W=Et(Z),N=We(Z);function V(se){se.key==="F6"&&zt(se)!==Z&&(se.preventDefault(),m.set("prevFocusElement",tn(N)),Z?.focus({preventScroll:!0}),m.pauseTimers(),m.set("focused",!0))}function J(se){zt(se)===W&&(m.set("isWindowFocused",!1),m.pauseTimers())}function K(se){if(se.relatedTarget)return;const re=zt(se),me=tn(We(Z));(re===W||!De(Z,re)||!su(me))&&m.resumeTimers(),h.start(0,()=>m.set("isWindowFocused",!0))}return fo(Ge(W,"keydown",V),Ge(W,"blur",J,!0),Ge(W,"focus",K,!0),Ge(N,"pointerdown",m.handleDocumentPointerDown,!0))},[m,h,w]);function z(Z){y.current=!0;const W=Z.relatedTarget===m.state.viewport?T.find(N=>N.transitionStatus!=="ending"&&!N.limited):void 0;W?W.ref?.current?.focus():m.restoreFocusToPrevElement()}function D(Z){Z.key==="Tab"&&Z.shiftKey&&zt(Z.nativeEvent)===m.state.viewport&&(Z.preventDefault(),m.restoreFocusToPrevElement())}function L(){m.state.toasts.some(W=>W.transitionStatus==="ending")||S.current||!v.current||(m.state.isWindowFocused&&m.resumeTimers(),m.set("hovering",!1),v.current=!1)}b.useEffect(L,[k,m]);function B(){m.pauseTimers(),m.set("hovering",!0),v.current=!1}function Y(){m.state.isWindowFocused&&m.resumeTimers()}function H(){v.current=!0,L()}function I(Z){Z.pointerType==="touch"&&(S.current=!0)}function j(Z){Z.pointerType==="touch"&&(S.current=!1,L())}function U(){if(y.current){y.current=!1;return}O||su(tn(We(m.state.viewport)))&&(m.set("focused",!0),m.pauseTimers())}function te(Z){!O||De(m.state.viewport,Z.relatedTarget)||(m.set("focused",!1),Y())}const $={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:B,onMouseMove:B,onMouseLeave:H,onFocus:U,onBlur:te,onKeyDown:D,onClick:U,onPointerDown:I,onPointerUp:j,onPointerCancel:j,style:{[Fj]:_?`${_}px`:void 0}},P={expanded:A},q=!w&&C&&p.jsx(as,{onFocus:z}),X=et("div",o,{ref:[a,m.setViewport],state:P,props:[$,g,{children:p.jsxs(b.Fragment,{children:[q,d,q]})}]});return p.jsxs(b.Fragment,{children:[q,X,!O&&M.length>0&&p.jsx("div",{style:Iu,children:M.map(Z=>p.jsxs("div",{role:"alert","aria-atomic":!0,children:[p.jsx("div",{children:Z.title}),p.jsx("div",{children:Z.description})]},Z.id))})]})}),CT=b.createContext(void 0);function pf(){const t=b.useContext(CT);if(!t)throw new Error(At(66));return t}function th(t,o,a){switch(t){case"up":return-a;case"down":return a;case"left":return-o;case"right":return o;default:return 0}}const qj="--toast-index",Gj="--toast-offset-y",Xj="--toast-height",Kj="--toast-swipe-movement-x",$j="--toast-swipe-movement-y",Wj="data-swipe-direction",Qj={...cl,swipeDirection(t){return t?{[Wj]:t}:null}},i0=40,Zj=10,l0=.5,Jj=1,e_=`${CA},${RA}`,t_=b.forwardRef(function(o,a){const{toast:r,render:l,className:c,swipeDirection:d=["down","right"],style:g,...m}=o,h=r.positionerProps?.anchor!==void 0;let y=[];h||(y=Array.isArray(d)?d:[d]);const v=y.length>0,S=df(),[w,T]=b.useState(void 0),[O,A]=b.useState(!1),[C,_]=b.useState(!1),[k,M]=b.useState({x:0,y:0}),[z,D]=b.useState({x:0,y:0,scale:1}),[L,B]=b.useState(),[Y,H]=b.useState(),[I,j]=b.useState(null),U=b.useRef(null),te=b.useRef(void 0),$=b.useRef({x:0,y:0}),P=b.useRef({x:0,y:0,scale:1}),q=b.useRef(void 0),X=b.useRef(0),Z=b.useRef(!1),W=b.useRef({x:0,y:0}),N=b.useRef(!1),V=b.useRef({x:0,y:0}),J=b.useRef(null),K=b.useRef(null),se=S.useState("toastIndex",r.id),re=S.useState("toastVisibleIndex",r.id),me=S.useState("toastOffsetY",r.id),pe=S.useState("focused"),be=S.useState("expanded");fs({open:r.transitionStatus!=="ending",ref:U,onComplete(){r.transitionStatus==="ending"&&S.removeToast(r.id)}});const Ce=ke((je=!1)=>{const le=U.current;if(!le)return;const ve=le.style.height;le.style.height="auto";const he=le.offsetHeight;le.style.height=ve;function ce(){S.updateToastInternal(r.id,{ref:U,height:he,transitionStatus:void 0})}je?oo.flushSync(ce):ce()});we(()=>{const je=te.current;r.transitionStatus!=="starting"&&je===r.id||(je!==void 0&&(T(void 0),D({x:0,y:0,scale:1}),Me({x:0,y:0})),te.current=r.id,Ce())},[Ce,r.id,r.transitionStatus]);function Me(je){V.current=je,M(je)}we(()=>()=>{K.current?.abort()},[]);function ye(je,le){const ve=xe=>xe>0?xe**l0:-(Math.abs(xe)**l0),he=je>0&&!y.includes("right")||je<0&&!y.includes("left"),ce=le>0&&!y.includes("down")||le<0&&!y.includes("up");return{x:he?ve(je):je,y:ce?ve(le):le}}const ge=ke(je=>{if(je.pointerId!==J.current)return;J.current=null,K.current?.abort(),K.current=null,A(!1),_(!1),j(null);const le=P.current;if(je.type==="pointercancel"||Z.current){Me({x:le.x,y:le.y}),T(void 0);return}const ve=V.current,he=ve.x-le.x,ce=ve.y-le.y;let xe;for(const He of y)if(th(He,he,ce)>i0){xe=He;break}xe?(T(xe),S.closeToast(r.id)):(Me({x:le.x,y:le.y}),T(void 0))});function Te(je){if(je.button!==0||(je.pointerType==="touch"&&S.pauseTimers(),zt(je.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${e_}`)))return;Z.current=!1,q.current=void 0,X.current=0,J.current=je.pointerId,$.current={x:je.clientX,y:je.clientY},W.current=$.current;const he=je.currentTarget,ce=Hj(he);P.current=ce,D(ce),Me({x:ce.x,y:ce.y}),S.set("hovering",!0),A(!0),_(!1),j(null),N.current=!0,K.current?.abort();const xe=new AbortController;K.current=xe;const He=We(he);He.addEventListener("pointerup",ge,{signal:xe.signal}),He.addEventListener("pointercancel",ge,{signal:xe.signal}),he.setPointerCapture?.(je.pointerId)}function Ae(je){if(je.pointerId!==J.current)return;je.preventDefault(),N.current&&($.current={x:je.clientX,y:je.clientY},N.current=!1);const{clientY:le,clientX:ve,movementX:he,movementY:ce}=je;(ce<0&&le>W.current.y||ce>0&&le<W.current.y)&&(W.current={x:W.current.x,y:le}),(he<0&&ve>W.current.x||he>0&&ve<W.current.x)&&(W.current={x:ve,y:W.current.y});const xe=ve-$.current.x,He=le-$.current.y,Lt=le-W.current.y,Ft=ve-W.current.x;let ut=I;if(!C&&Math.sqrt(xe*xe+He*He)>=Jj){_(!0);const bt=y.includes("left")||y.includes("right"),jt=y.includes("up")||y.includes("down");if(bt&&jt){const Fe=Math.abs(xe),ft=Math.abs(He);ut=Fe>ft?"horizontal":"vertical",j(ut)}}let Oe;if(!q.current)ut==="vertical"?He>0?Oe="down":He<0&&(Oe="up"):ut==="horizontal"?xe>0?Oe="right":xe<0&&(Oe="left"):Math.abs(xe)>=Math.abs(He)?Oe=xe>0?"right":"left":Oe=He>0?"down":"up",Oe&&y.includes(Oe)&&(q.current=Oe,X.current=th(Oe,xe,He),T(Oe));else{const hn=q.current,bt=th(hn,Ft,Lt);bt>i0?(Z.current=!1,T(hn)):!(y.includes("left")&&y.includes("right"))&&!(y.includes("up")&&y.includes("down"))&&X.current-bt>=Zj&&(Z.current=!0)}const Ye=ye(xe,He);let Qe=P.current.x,ct=P.current.y;const Jt=y.includes("left")||y.includes("right"),rn=y.includes("up")||y.includes("down");ut!=="vertical"&&Jt&&(Qe+=Ye.x),ut!=="horizontal"&&rn&&(ct+=Ye.y),Me({x:Qe,y:ct})}function Ue(je){if(je.key==="Escape"){if(!U.current||!De(U.current,tn(We(U.current))))return;S.closeToast(r.id)}}b.useEffect(()=>{const je=U.current;if(!v||!je)return;function le(ve){J.current===null||!De(je,zt(ve))||ve.preventDefault()}return Ge(je,"touchmove",le,{passive:!1})},[v]);function Ee(){const je=k.x-z.x,le=k.y-z.y;return{transition:O?"none":void 0,transform:O?`translateX(${k.x}px) translateY(${k.y}px) scale(${z.scale})`:void 0,[Kj]:`${je}px`,[$j]:`${le}px`}}const Le=r.priority==="high",Se={role:Le?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":L,"aria-describedby":Y,"aria-hidden":Le&&!pe?!0:void 0,onPointerDown:v?Te:void 0,onPointerMove:v?Ae:void 0,onPointerUp:v?ge:void 0,onPointerCancel:v?ge:void 0,onKeyDown:Ue,inert:yl(r.limited),style:{...Ee(),[qj]:r.transitionStatus==="ending"?se:re,[Gj]:`${me}px`,[Xj]:r.height?`${r.height}px`:void 0}},Re=b.useMemo(()=>({toast:r,setTitleId:B,setDescriptionId:H,recalculateHeight:Ce,visibleIndex:re,expanded:be}),[r,B,H,Ce,re,be]),Ne={transitionStatus:r.transitionStatus,expanded:be,limited:r.limited||!1,type:r.type,swiping:O,swipeDirection:w},Ie=et("div",o,{ref:[a,U],state:Ne,stateAttributesMapping:Qj,props:[Se,m]});return p.jsx(CT.Provider,{value:Re,children:Ie})}),n_=b.forwardRef(function(o,a){const{render:r,className:l,style:c,...d}=o,{visibleIndex:g,expanded:m,recalculateHeight:h}=pf(),y=b.useRef(null);we(()=>{h();const w=y.current;if(!w||typeof ResizeObserver!="function"||typeof MutationObserver!="function")return;const T=new ResizeObserver(()=>h(!0)),O=new MutationObserver(()=>h(!0));return T.observe(w),O.observe(w,{childList:!0,subtree:!0,characterData:!0}),()=>{T.disconnect(),O.disconnect()}},[h]);const v=g>0;return et("div",o,{ref:[a,y],state:{expanded:m,behind:v},props:d})});function RT(t){return t==null||typeof t=="boolean"||t===""?!1:Array.isArray(t)?t.some(RT):!0}function OT(t){return b.isValidElement(t)&&RT(t.props.children)}function AT(t,o,a){const{toast:r,setTitleId:l,setDescriptionId:c}=pf(),d=a==="title"?l:c,g=o??(a==="title"?r.title:r.description);return{id:Gs(t),children:g,type:r.type,setId:d}}function NT(t,o,a){const r=OT(t);return we(()=>{if(r)return a(o),()=>{a(l=>l===o?void 0:l)}},[r,o,a]),r?t:null}const o_=b.forwardRef(function(o,a){const{render:r,className:l,style:c,id:d,children:g,...m}=o,{id:h,children:y,type:v,setId:S}=AT(d,g,"description"),T=et("p",o,{ref:a,state:{type:v},props:{...m,id:h,children:y}});return NT(T,h,S)}),s_=b.forwardRef(function(o,a){const{render:r,className:l,style:c,id:d,children:g,...m}=o,{id:h,children:y,type:v,setId:S}=AT(d,g,"title"),T=et("h2",o,{ref:a,state:{type:v},props:{...m,id:h,children:y}});return NT(T,h,S)}),a_=b.forwardRef(function(o,a){const{render:r,className:l,style:c,disabled:d,nativeButton:g=!0,...m}=o,h=df(),{toast:y,expanded:v}=pf(),[S,w]=b.useState(!1),{getButtonProps:T,buttonRef:O}=Co({disabled:d,native:g}),A={type:y.type};return et("button",o,{ref:[a,O],state:A,props:[{"aria-hidden":!v&&!S,onClick(){h.closeToast(y.id)},onFocus(){w(!0)},onBlur(){w(!1)}},m,T]})}),r_=b.forwardRef(function(o,a){const{render:r,className:l,style:c,disabled:d,nativeButton:g=!0,...m}=o,{toast:h}=pf(),y=h.actionProps?.children??m.children,{getButtonProps:v,buttonRef:S}=Co({disabled:d,native:g}),w={type:h.type},T=et("button",o,{ref:[a,S],state:w,props:[m,h.actionProps,v,{children:y}]});return OT(T)?T:null}),i_=b.forwardRef(function(o,a){return p.jsx(g1,{ref:a,...o})});function l_(){const t=df(),o=t.useState("toasts");return b.useMemo(()=>({toasts:o,add:t.addToast,close:t.closeToast,update:t.updateToast,promise:t.promiseToast}),[o,t])}function c_(){const t=new Set;function o(a){t.forEach(r=>r(a))}return{" subscribe":function(r){return t.add(r),()=>{t.delete(r)}},add(a){const r=a.id||ET("toast"),l={...a,id:r,transitionStatus:"starting"};return o({action:"add",options:l}),r},close(a){o({action:"close",options:{id:a}})},update(a,r){o({action:"update",options:{id:a,updates:r}})},promise(a,r){let l=a;return o({action:"promise",options:{...r,promise:a,setPromise(c){l=c}}}),l}}}function c0({icon:t,title:o,children:a}){return p.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-8 text-center text-fg-muted",children:[t?p.jsx("div",{className:"text-fg-subtle",children:t}):null,p.jsx("div",{className:"text-[15px] font-semibold text-fg",children:o}),a?p.jsx("div",{className:"max-w-sm",children:a}):null]})}const ka=c_();function u_(t){if(t.repeat||t.key!=="Enter"&&t.key!==" ")return;const o=t.currentTarget.closest("[data-toast]")??t.currentTarget,a=o.ownerDocument.defaultView;a&&xN(a,t.key,r=>r instanceof a.Node&&o.contains(r))}function f_(){const{toasts:t}=l_();return t.map(o=>p.jsxs(t_,{toast:o,"data-toast":"",className:"pointer-events-auto flex w-80 items-start gap-3 rounded-lg bg-surface p-3 text-fg shadow-popup transition-[opacity,transform] data-[starting-style]:translate-y-2 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",children:[p.jsxs(n_,{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[p.jsx(s_,{className:"text-[13px] font-semibold"}),p.jsx(o_,{className:"text-xs text-fg-muted"}),o.actionProps?p.jsx(r_,{className:"mt-1 self-start rounded px-2 py-0.5 text-xs font-medium text-accent hover:bg-hover"}):null]}),p.jsx(a_,{"aria-label":"Dismiss",onKeyDown:u_,className:"rounded p-0.5 text-fg-muted hover:bg-hover",children:p.jsx(Sl,{className:"size-3.5"})})]},o.id))}function d_({children:t}){return p.jsxs(Bj,{toastManager:ka,timeout:4e3,children:[t,p.jsx(i_,{children:p.jsx(Yj,{className:"pointer-events-none fixed bottom-4 right-4 z-[1100] flex flex-col gap-2",children:p.jsx(f_,{})})})]})}const p_=["a[href]","button","iframe","input","select","textarea","summary","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])","[tabindex]"].join(", "),h_="audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function m_(t){return!(t.tabIndex>=0||!t.hasAttribute("tabindex")&&t.matches(h_))||t.getAttribute("aria-hidden")==="true"||t.matches(":disabled")?!1:typeof t.checkVisibility!="function"||t.checkVisibility({visibilityProperty:!0})}function g_(t){return Array.from(t.querySelectorAll(p_)).filter(m_)}function y_(t){const o=a=>!/visible|hidden|clip/.test(a);return t.scrollWidth>t.clientWidth+1&&o(t.overflowX)||t.scrollHeight>t.clientHeight+1&&o(t.overflowY)}function b_(t){const[o,a]=b.useState(!1);return b.useLayoutEffect(()=>{const r=t.current,l=r?.ownerDocument.defaultView;if(!r||!l)return;const c=()=>{const y=l.getComputedStyle(r);a(y_({scrollWidth:r.scrollWidth,clientWidth:r.clientWidth,scrollHeight:r.scrollHeight,clientHeight:r.clientHeight,overflowX:y.overflowX,overflowY:y.overflowY}))};if(c(),typeof l.ResizeObserver!="function")return;const d=new l.ResizeObserver(c),g=new Set,m=y=>{if(y.nodeType!==1)return;const v=y;if(l.getComputedStyle(v).display==="contents"){v.childNodes.forEach(m);return}g.has(v)||(g.add(v),d.observe(v))};d.observe(r),r.childNodes.forEach(m);const h=new l.MutationObserver(y=>{for(const v of y)v.addedNodes.forEach(m);for(const v of g)r.contains(v)||(d.unobserve(v),g.delete(v));c()});return h.observe(r,{childList:!0,subtree:!0,characterData:!0}),()=>{d.disconnect(),h.disconnect()}},[t]),o}b.forwardRef(function({label:o,className:a,...r},l){const c=b.useRef(null),d=b.useCallback(w=>{c.current=w,typeof l=="function"?l(w):l&&(l.current=w)},[l]),g=b_(c),[m,h]=b.useState(!1),[y,v]=b.useState(null);b.useLayoutEffect(()=>{const w=c.current,T=w?.ownerDocument.defaultView;if(!g||!w||!T)return;const O=()=>{h(g_(w).length===0),v(w.closest('[role="dialog"], [role="alertdialog"]')?.getAttribute("aria-labelledby")??null)};O();const A=new T.MutationObserver(O);return A.observe(w,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex","disabled","hidden","href","contenteditable"]}),()=>A.disconnect()},[g]);const S=g&&m;return p.jsx("div",{ref:d,...S?{role:"group",tabIndex:0,"aria-labelledby":o===void 0?y??void 0:void 0,"aria-label":o??(y===null?"Panel content":void 0)}:{},className:lt(S&&"focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent",a),...r})});const v_={blur:{label:"Blur",unit:"px",min:0,max:200,step:1,identity:0,initial:4},brightness:{label:"Brightness",unit:"%",min:0,max:500,step:1,identity:100,initial:120},contrast:{label:"Contrast",unit:"%",min:0,max:500,step:1,identity:100,initial:120},grayscale:{label:"Grayscale",unit:"%",min:0,max:100,step:1,identity:0,initial:100},saturate:{label:"Saturate",unit:"%",min:0,max:500,step:1,identity:100,initial:150},"hue-rotate":{label:"Hue rotate",unit:"deg",min:-360,max:360,step:1,identity:0,initial:90},invert:{label:"Invert",unit:"%",min:0,max:100,step:1,identity:0,initial:100},sepia:{label:"Sepia",unit:"%",min:0,max:100,step:1,identity:0,initial:100},opacity:{label:"Opacity",unit:"%",min:0,max:100,step:1,identity:100,initial:50}};[...Object.keys(v_)];const x_={cancel:"Cancel",close:"Close",copy:"Copy",copied:"Copied",copyLink:"Copy link",loading:"Loading…",justNow:"just now",never:"never",agent:"Agent",delete:"Delete",rename:"Rename",duplicate:"Duplicate",copyName:"Name of the copy",documentTabs:"Document tabs",pin:"Pin",unpin:"Unpin",open:"Open",save:"Save",updated:"Updated {when}",pinned:"Pinned",unpinned:"Unpinned",duplicated:"Duplicated",couldNotPin:"Could not pin: {error}",couldNotUnpin:"Could not unpin: {error}",couldNotRename:"Could not rename: {error}",couldNotDuplicate:"Could not duplicate: {error}",couldNotDelete:"Could not delete: {error}",statusNone:"No session",statusWorking:"Working",statusIdle:"Idle",statusWaiting:"Waiting",statusOffline:"Offline",working:"{agent} is working…",artifactOptions:"Artifact options",artifactName:"Artifact name",comments:"Comments",doneCommenting:"Done commenting",openComment:"1 open comment",openComments:"{count} open comments",commentOptions:"Comment options",showAllComments:"Show all comments",hideComments:"Hide comments",share:"Share",sharedOnNetwork:"Shared with your network",onlyThisComputer:"Only this computer",ask:"Ask {agent}",hideAsk:"Hide",openHarnessSession:"Open the {harness} session",messageAgent:"Message {agent} about this artifact",switchArtifact:"Switch artifact",inThisSession:"In this session",recent:"Recent",allArtifacts:"All artifacts",export:"Export",openSession:"Open session",offline:"offline",versionHistory:"Version history",peopleHere:"Here now",peopleHereNames:"Here now: {names}",peopleMore:"+{count}",youOtherTab:"You, in another tab",yourOtherTab:"your other tab",follow:"Follow",stopFollow:"Stop",followName:"Follow {name}",stopFollowingName:"Stop following {name}",followingName:"Following {name}",followingYou:"Following you",followingToast:"Following {name}. Press Escape to stop.",stoppedFollowingLeft:"Stopped following: {name} left.",openInNewTab:"Open in new tab",refresh:"Refresh",storage:"Storage",inThisFolder:"{size} in this folder",copyPath:"Copy path",linkCopied:"Link copied",pathCopied:"Path copied",deleteTitle:'Delete "{title}"?',deleteBody:"It leaves your artifacts. Its folder stays where it is: {root}",shareTitle:"Share this artifact",peopleWithAccess:"People with access",joinedPeople:"People who joined",noneJoined:"Nobody has joined yet. Send someone a link below.",online:"Online",seenAgo:"Seen {when}",guestPaused:"Link off: no access until it is back on",changeRole:"Change {name}'s role",roleLinkOff:"Link off",remove:"Remove",removeGuest:"Remove {name}",removeTitle:"Remove {name}?",removeBody:"They lose access to this artifact. They can join again with a link.",you:"(you)",thisComputer:"This computer",owner:"Owner",generalAccess:"General access",onLan:"Anyone on your network with a link",onlyHereSub:"Nobody else can open the links.",onLanSub:"People on the same Wi-Fi or LAN open it with a link; the link sets their role.",onNetworkAt:"On this network at {addresses}",onTailnet:"Tailscale: {address}, for people on your tailnet from any network (copy it from a link's More menu)",noAddress:"This computer has no local network address.",whereOff:"Only this computer can open these links for now. Copying one opens this to your network.",inviteLinks:"Invite links",roleEditor:"Editor",roleCommenter:"Commenter",roleViewer:"Viewer",linkEditor:"Can edit",linkCommenter:"Can comment",linkViewer:"Can view",noteEditor:"Edit and comment",noteCommenter:"Comment, no edits",noteViewer:"Read only",linkOff:"Off: nobody can join with it",turnOn:"Turn on",more:"More",moreFor:"More: {role}",copyTailnet:"Copy Tailscale link",copyTailnetNote:"For people on your tailnet, off this network ({address})",turnOnLink:"Turn on link",turnOffLink:"Turn off link",turnOffNote:"Whoever joined with it loses access until it is back on",resetLink:"Reset link",resetNote:"A new address; whoever joined with the old one is removed",resetTitle:'Reset the "{role}" link?',resetBody:"The old link stops working and the people who joined with it lose access.",plainHttp:"This is plain HTTP: others on the network can read what passes. A link is the permission: whoever has it gets its role, so send it only to the people meant to have it, and reset a link that went further.",cannotShare:"{type} pages can't be shared on the network yet: only this computer opens it.",shareError:"Could not do that: {error}",shareNoAnswer:"The sharing settings did not load: the Open Artifact service is not answering. Try again in a moment.",sendingTitle:"Sending this to someone?",sendingBody:"Share the link instead of a file and they will always have the latest changes.",invitePeople:"Invite people",allLinksOff:"All the links are off. Invite people to turn one on.",joinsAs:"People who open this link join as {role}. Invite people to give another role.",standaloneShare:"Manage network sharing in the Open Artifact app or with the share CLI command.",onlyHereLink:"Only this computer can open the link.",nothingToExport:"Nothing to export yet.",exportOptions:"Asks for options first",archiveLabel:"Whole folder (.zip)",destinationDescription:"Asks {agent} to export it there",destinationRequestLabel:"Export to {label}",destinationSent:"Asked {agent} to export to {label}",archiveDescription:"Everything here, to back up or move",archiveStarted:"Downloading {name}",archiveHint:"The whole folder in one zip, to back up, move to another computer or send to someone. Unzip it and open it with the same type to carry on; share links and this computer's server state are left out.",archiveTooLarge:"The folder is over what a zip holds (4 GiB or 65,535 files): copy the folder itself instead.",archiveUnsupported:"{type} folders can't be zipped here: copy the folder itself instead.",archiveFailed:"Could not zip the folder: {error}",exportBusy:"Another export is running. Try {label} again in a moment.",exportUnsupported:"{label} can't be exported right now.",exportFailed:"Could not export {label}.",saving:"Saving…",reconnecting:"Reconnecting…",notSaved:"Not saved",notSavedTitle:"The page could not save its last changes.",saveRetry:"Couldn't save — retry",readOnly:"Read-only",readOnlyTitle:"Nothing can be saved here",leaveLosesWork:"Leave? Changes that are not saved yet will be lost.",actionSaveNow:"Save now",actionOpenFind:"Find",actionUndo:"Undo",actionRedo:"Redo",actionEditPage:"Edit page",actionUsePage:"Use this page",actionCommentSelection:"Comment on selection",actionOpenPageList:"Pages",actionHandOffCode:"Hand off to code",whyOlderVersion:"You are viewing an older version",whyAgentWorking:"{agent} is working",whyDraftOpen:"Close the open draft first",whyCommentsOn:"Turn off comment mode first",whyNeedsAgent:"Needs an agent session",whyUnsaved:"Save first",whyOther:"Not available right now",noOwner:"No session owns this artifact",noOwnerNote:"What you send waits for the next session that works on it.",ownerNote:"Messages go to the {harness} session that made this artifact.",agentIdle:"{agent} is idle",agentWaiting:"{agent} is waiting",sessionOffline:"The session is offline",offlineNote:"{agent} sees what you send the next time the {harness} session works.",askPlaceholder:"What should change?",sendToAgent:"Send to {agent}",sendToConversation:"Put in the {agent} conversation",sending:"Sending…",sent:"Sent.",sentInbox:"{agent} will see it the next time the session works.",sentDrafted:"It is in the {agent} conversation now: send it there.",notDelivered:"Not delivered.",notSent:"Not sent: {error}",viaDelivered:"delivered",viaDrafted:"in the conversation, for you to send",viaInbox:"waiting for the session",viaFailed:"not delivered",askCloudOnline:"{agent} is connected: it gets this now.",askCloudOffline:"{agent} will get this when its computer is back online.",askCloudMcp:"{agent} will see this the next time it works on the artifact.",askCloudNone:"No agent is connected to this site for you. Connect a computer or an MCP client; the request waits until then.",askCloudNoneOther:"The owner has no agent connected to this site. The request waits until they connect one.",sentCloudDelivered:"Delivered: {agent} has it now.",sentCloudOffline:"Sent. {agent} will get it when its computer is back online.",sentCloudMcp:"Sent. {agent} will see it the next time it works on the artifact.",sentCloudNone:"Sent. It waits until an agent is connected.",viaWaitingAgent:"waiting for the agent",statusConnected:"Connected",statusNoAgent:"No agent",emptyTitle:"This artifact is empty",emptyBody:"Nothing of {type} has been written to {root} yet. An agent writes it: send it this.",startSession:"Start a session with {agent}",promptCopied:"Copied: paste it into any agent session that has the Artifact tool.",sentToSession:"Sent to a new session.",problemTitle:"This artifact cannot open here",noPage:"No page.",readOnlyNewer:"Read-only here: {type} {release} wrote this artifact and this computer has {version}. Update Open Artifact (open-artifact runtime update, or update the app it came with) to edit it.",folder:"Folder: {root}",askToLook:"Ask {agent} to look",problemAsk:"The artifact page could not open: {problem}",noBoot:"No artifact to show. Open one from the home page.",tryAgain:"Try again",bootFailed:"The page did not open: {error}",frameNotOpen:"The page is not open any more (its server may have restarted), and opening it again did not work.",frameNotGranted:"This page is not open to you here any more.",homeTitle:"Open Artifact",homeSub:"The artifacts and types every agent on this computer shares.",artifacts:"Artifacts",types:"Types",newArtifact:"New artifact",moreActions:"More actions",backToSession:"Back to session",noArtifacts:"No artifacts yet. Ask an agent to make one with the Artifact tool, or start one here.",pageOpen:"Open now",typeMissing:"Type not installed",deleted:'Deleted "{title}". Its folder stays.',undo:"Undo",restored:"Restored",couldNotRestore:"Could not restore: {error}",couldNotLoad:"Could not load: {error}",typeRoots:"Type roots: {roots}",noTypes:"No types found.",disabled:"Disabled",shadowedBy:"Overridden by {root}",newOf:"New {type}",create:"Create",title:"Title",folderOptional:"Folder (optional)",folderHint:"Default: a new folder in the home workspace",needTitle:"Give it a title first.",couldNotCreate:"Could not create it: {error}",renameArtifact:"Rename artifact",cannotCreateYet:"Only Design artifacts can be made here for now.",cannotShareCloud:"{type} artifacts can't be shared here yet.",signIn:"Sign in",signOut:"Sign out",signOutFailed:"Could not sign out: {error}",accountOf:"Account: {name}",sharedWithOthers:"Shared with others",addPeople:"Add people",addPeoplePlaceholder:"Email, or @domain for everyone there",add:"Add",addInvalid:"Not an email address or @domain: {entries}",roleFor:"Role for the people you add",memberPending:"Invited: has not signed in yet",memberDomain:"Everyone at {domain}",memberGroup:"Group",removeAccess:"Remove access",removeMemberBody:"They lose access to this artifact. You can add them again.",noMembers:"Nobody else is added yet.",accessRestricted:"Restricted",accessRestrictedSub:"Only the people added here can open it.",accessLink:"Anyone with the link",accessLinkSub:"Whoever has one of the links below gets its role.",accessPublic:"Public",accessPublicSub:"Anyone can open it as a viewer; the links below give more.",shareSettings:"Settings",viewersCanExport:"Viewers can download and export",editorsCanAsk:"Editors can ask {agent}",ownedBy:"Owned by {name}",yourRole:"Your role: {role}",onlyOwnerShares:"Only the owner can change who has access.",emptyBodyCloud:"Nothing of {type} has been written yet. An agent writes it: send it this.",homeSubCloud:"Your artifacts and the ones shared with you.",noArtifactsCloud:"No artifacts yet. Publish one from an agent with the Artifact tool, or ask someone to share one with you.",pubTitle:"Publish to the web",pubIntro:"Give it a web address that works even when this computer is off. You choose who can open it there.",pubDataNote:"Publishing this dashboard publishes its data too: this computer runs its live queries and puts the rows on the site, where everyone who can open it sees them.",pubDataPending:"Its live data isn’t on the site yet: the page there shows no figures until you publish the data.",pubDataConfirm:"Publish its data",pubDataAsOf:"Data on the site as of {time}, refreshed from this computer.",pubDataNone:"Its data is published; the first rows are on their way.",pubDataFailed:"The last refresh failed: {reason}",pubDataRefresh:"Refresh now",pubDataRefreshing:"Refreshing…",pubDataStop:"Stop publishing data",pubDataStopTitle:"Stop publishing its data?",pubDataStopBody:"The rows are removed from {host} and this computer stops refreshing them. The dashboard stays published there, with no figures until you publish its data again.",pubConnectSite:"Connect a site…",pubConnectAnother:"Connect another site…",pubAddress:"Site address",pubAddressPlaceholder:"https://artifacts.example.com",pubAddressHint:"The web address of an Open Artifact site you have an account on.",pubName:"Name",pubNameHint:"A short name to tell your sites apart, like work.",pubConnect:"Connect",pubConnecting:"Connecting…",pubCodeTitle:"Approve this computer on {host}",pubCodeBody:"Check that the page shows this code, then approve.",pubCodeOpened:"The approval page opened in your browser. If you don’t see it, open it here:",pubOpenApproval:"Open approval page",pubWaitingApproval:"Waiting for you to approve…",pubConnected:"Connected to {host} as {name}.",pubTryAgain:"Try again",pubSignedInAs:"Signed in as {name}",pubStateConnected:"Connected",pubStateConnecting:"Connecting…",pubStateUnreachable:"Can't be reached",pubStateSignedOut:"Signed out",pubPublish:"Publish",pubPublishing:"Publishing…",pubReconnect:"Connect again",pubPublishedAt:"Published on {host}",pubOpen:"Open",pubManage:"Who can open it is set on its web page: open it and use Share there.",pubManageLink:"Manage access on the web",pubOpensThere:"Opening it on this computer now takes you to its web address while the site can be reached.",pubUnpublish:"Unpublish",pubUnpublishing:"Unpublishing…",unpubTitle:"Unpublish this artifact?",unpubBody:"The web copy goes to the trash on {host} and its web address stops working. This folder stays on this computer, with the latest changes from the web.",pubInSync:"Up to date",pubInSyncAt:"Up to date · synced {when}",pubWaitingOne:"1 change waiting to be sent",pubWaiting:"{count} changes waiting to be sent",pubOffline:"Can't reach {host}: changes are kept here and sent when it is back.",pubSignedOutSync:"Signed out of {host}: changes are kept here. Connect again to send them.",pubSyncFailed:"The last sync failed: {error}",pubCloudMark:"Published to the web",pubCloudAt:"Published at {url}",pubHostEmpty:"Type the site’s address.",pubHostInvalid:"That is not a web address. Type it like https://artifacts.example.com.",pubHostNotHttps:"The address must start with https:// (plain http only works for this computer or a private network, like 192.168.1.20, nas.lan or 192-168-1-20.nip.io).",pubInsecureWarning:"Plain http: what you publish travels unencrypted. Use it only on a network you trust.",pubAutoSwitch:"Publish new artifacts automatically",pubAutoHint:"Artifacts created from now on go to {host} by themselves. Earlier ones stay as they are.",pubAutoNoSite:"Choose a default site to publish to.",pubDefaultSite:"Default site",pubDefaultMark:"default",pubAutoPublishing:"Being published to {host} automatically…",pubAutoSignedOut:"Waiting to be published to {host}: this computer is not signed in there yet.",pubAutoUnreachable:"Waiting to be published: can't reach {host}. It is tried again by itself.",pubAutoFailed:"Not published to {host} yet: {error} It is tried again by itself.",pubApprovalTitle:"Approve this computer on {host}",pubApprovalBody:"This computer was set up to publish to {host}. Open the approval page, check that it shows this code, and approve.",pubCloudSettingsFailed:"Could not change the setting: {error}",pubNameInvalid:"Use letters, digits, - and _ (up to 32), like work.",pubNameTaken:"That name is already used for another site. Choose another name.",pubNoDaemon:"Open Artifact on this computer did not answer. Check that it is running, then try again.",pubConnectDenied:"The connection was refused on {host}. Try again if that was a mistake.",pubConnectExpired:"The code ran out before it was approved. Try again and approve within a few minutes.",pubConnectUnreachable:"Can't reach {host}. Check the address and your connection, then try again.",pubConnectNotHost:"{host} does not look like an Open Artifact site. Check the address.",pubConnectFailed:"Could not connect: {error}",pubIdTaken:"{host} already has an artifact with this one’s id that is still published there (maybe from another computer) or is someone else’s. Unpublish it there first (one you unpublished is replaced when you publish again), or duplicate this artifact and publish the copy.",pubAlreadyElsewhere:"It is already published to another site. Unpublish it there first.",pubTooLarge:"It is too large for {host}. Remove big files from its folder, then try again.",pubSignedOut:"You are signed out of {host}. Connect again, then try again.",pubNotAllowed:"{host} did not allow it: your account there may not be able to publish.",pubUnreachable:"Can't reach {host} right now. Try again once it is back.",pubUnsupported:"{host} cannot take this kind of artifact yet.",pubFailed:"Could not publish: {error}",unpubUnreachable:"Can't reach {host} to bring its latest version here first. Try again once it is back.",unpubFailed:"Could not unpublish: {error}",openOnWeb:"Open on the web",copyWebLink:"Copy web link",webLinkCopied:"Web link copied",signOutAccess:"Sign out, here and of your organisation’s sign-in",upload:"Upload",uploadHint:"Upload an artifact: the .zip from “Whole folder (.zip)” in its Export tab.",uploadDrop:"Drop the .zip to upload it",uploadSending:"Uploading {name}… {percent}%",uploadSendingSize:"Uploading {name}…",uploadChecking:"Checking {name}…",uploadOpening:"Uploaded {name}. Opening it…",uploadNotZip:"That file is not a .zip. Use “Whole folder (.zip)” from an artifact’s Export tab.",uploadNotArtifact:"That zip is not an Open Artifact folder. Use “Whole folder (.zip)” from an artifact’s Export tab.",uploadTooLargeLimit:"That zip is too large: this site takes up to {limit}. Remove big files from the folder, then try again.",uploadTooLarge:"That zip is too large for this site. Remove big files from the folder, then try again.",uploadTooLargeSaid:"That zip is too large for this site: {error} Remove big files from the folder, then try again.",uploadSignedOut:"You are signed out. Sign in again, then upload it.",uploadNotAllowed:"This site does not let you upload artifacts.",uploadConflict:"Something on the site got in the way. Try again.",uploadTypeMissing:"This site cannot open {type} artifacts yet.",uploadBusy:"Too many tries at once. Wait a moment, then try again.",uploadNoAnswer:"The site did not answer. Check your connection, then try again.",uploadFailed:"Could not upload it: {error}",dismiss:"Dismiss",trash:"Trash",trashEmpty:"The trash is empty.",trashNote:"Nobody it was shared with can open an artifact while it is in the trash.",trashedWhen:"Moved to the trash {when}",trashKeptDays:"Deleted for good after {days} days in the trash.",trashKeptOneDay:"Deleted for good after 1 day in the trash.",trashKeptForever:"Kept here until you delete it forever.",restore:"Restore",restoredTitle:'Restored "{title}"',deleteForever:"Delete forever",purgeTitle:'Delete "{title}" forever?',purgeBody:"This cannot be undone. It is removed from this site, and everyone it was shared with loses access to it.",purged:'Deleted "{title}" forever',purgeNotTrashed:"It is not in the trash any more.",purgeGone:"It is already gone.",couldNotPurge:"Could not delete it: {error}",moveToTrash:"Move to trash",movedToTrash:'Moved "{title}" to the trash.',shareOnNetwork:"Share on this network instead",shareOnNetworkSub:"Links from here open this computer’s copy, not the web page."},S_={cancel:"取消",close:"关闭",copy:"复制",copied:"已复制",copyLink:"复制链接",loading:"加载中…",justNow:"刚刚",never:"从未",agent:"Agent",delete:"删除",rename:"重命名",duplicate:"复制一份",copyName:"副本名称",documentTabs:"文档标签页",pin:"置顶",unpin:"取消置顶",open:"打开",save:"保存",updated:"更新于 {when}",pinned:"已置顶",unpinned:"已取消置顶",duplicated:"已复制一份",couldNotPin:"没能置顶:{error}",couldNotUnpin:"没能取消置顶:{error}",couldNotRename:"没能重命名:{error}",couldNotDuplicate:"没能复制:{error}",couldNotDelete:"没能删除:{error}",statusNone:"无会话",statusWorking:"工作中",statusIdle:"空闲",statusWaiting:"等待中",statusOffline:"离线",working:"{agent} 正在工作…",artifactOptions:"作品选项",artifactName:"作品名",comments:"评论",doneCommenting:"结束评论",openComment:"1 条未解决的评论",openComments:"{count} 条未解决的评论",commentOptions:"评论选项",showAllComments:"显示全部评论",hideComments:"隐藏评论",share:"分享",sharedOnNetwork:"已分享到局域网",onlyThisComputer:"仅这台电脑",ask:"问 {agent}",hideAsk:"收起",openHarnessSession:"打开 {harness} 会话",messageAgent:"就这个作品给 {agent} 发消息",switchArtifact:"切换作品",inThisSession:"这个会话里的",recent:"最近",allArtifacts:"所有作品",export:"导出",openSession:"打开会话",offline:"离线",versionHistory:"版本历史",peopleHere:"正在查看",peopleHereNames:"正在查看:{names}",youOtherTab:"你(另一个标签页)",yourOtherTab:"你的另一个标签页",follow:"跟随",stopFollow:"停止",followName:"跟随 {name}",stopFollowingName:"停止跟随 {name}",followingName:"正在跟随 {name}",followingYou:"正在跟随你",followingToast:"正在跟随 {name},按 Esc 停止。",stoppedFollowingLeft:"{name} 已离开,停止跟随。",openInNewTab:"在新标签页打开",refresh:"刷新",storage:"存储",inThisFolder:"这个文件夹 {size}",copyPath:"复制路径",linkCopied:"链接已复制",pathCopied:"路径已复制",deleteTitle:"删除「{title}」?",deleteBody:"它会移出作品列表,文件夹保留在原处:{root}",shareTitle:"分享这份内容",peopleWithAccess:"有权访问的人",joinedPeople:"加入的人",noneJoined:"还没有人加入。把下面的链接发给对方。",online:"在线",seenAgo:"{when}来过",guestPaused:"链接已关闭,暂时无法访问",changeRole:"更改「{name}」的角色",roleLinkOff:"链接已关闭",remove:"移出",removeGuest:"移出 {name}",removeTitle:"移出「{name}」?",removeBody:"对方将无法再访问这份内容,之后仍可以用链接重新加入。",you:"(你)",thisComputer:"这台电脑",owner:"所有者",generalAccess:"一般访问权限",onLan:"同一网络里有链接的人",onlyHereSub:"别人打不开这些链接。",onLanSub:"同一 Wi-Fi 或局域网里的人用链接打开,链接决定角色。",onNetworkAt:"在这个网络上:{addresses}",onTailnet:"Tailscale:{address},同一 tailnet 的人在别的网络也能打开(复制在链接的「更多」里)",noAddress:"这台电脑没有局域网地址。",whereOff:"现在只有这台电脑能打开这些链接。复制链接会顺手分享到局域网。",inviteLinks:"邀请链接",roleEditor:"编辑者",roleCommenter:"评论者",roleViewer:"查看者",linkEditor:"可编辑",linkCommenter:"可评论",linkViewer:"可查看",noteEditor:"编辑和评论",noteCommenter:"只能评论",noteViewer:"只读",linkOff:"已关闭:没人能用它加入",turnOn:"开启",more:"更多",moreFor:"更多:{role}",copyTailnet:"复制 Tailscale 链接",copyTailnetNote:"给同一 tailnet 里不在这个网络的人({address})",turnOnLink:"开启链接",turnOffLink:"关闭链接",turnOffNote:"用它加入的人暂时无法访问",resetLink:"重置链接",resetNote:"换一个新地址,用旧链接加入的人会被移出",resetTitle:"重置「{role}」链接?",resetBody:"旧链接会失效,通过它加入的人也会失去访问权限。",plainHttp:"这是明文 HTTP:同一网络的人能看到传输内容。链接就是权限:拿到链接的人就有对应角色,只发给该有的人;传出去了就重置链接。",cannotShare:"{type} 的页面暂时不能分享到网络:只有这台电脑能打开。",shareError:"没做成:{error}",shareNoAnswer:"分享设置没有加载出来:Open Artifact 服务没有响应,稍后再试。",sendingTitle:"要发给别人?",sendingBody:"发链接而不是文件,对方看到的总是最新版本。",invitePeople:"邀请别人",allLinksOff:"所有链接都关着。去邀请页打开一条。",joinsAs:"用这条链接打开的人以{role}身份加入。要给别的角色,去邀请页。",standaloneShare:"可在 Open Artifact 应用或 CLI 的 share 命令中管理网络分享。",onlyHereLink:"只有这台电脑能打开这个链接。",nothingToExport:"还没有可导出的内容。",exportOptions:"会先询问导出选项",archiveLabel:"整个文件夹(.zip)",destinationDescription:"请 {agent} 导出到这里",destinationRequestLabel:"导出到 {label}",destinationSent:"已请 {agent} 导出到 {label}",archiveDescription:"这里的全部内容,用来备份或搬走",archiveStarted:"开始下载 {name}",archiveHint:"整个文件夹打成了一个 zip,可以备份、换电脑或发给别人。解压后用同一个类型打开就能接着用;分享链接和这台电脑上的服务器状态不在里面。",archiveTooLarge:"文件夹超过了 zip 的上限(4 GiB 或 65535 个文件),请直接复制文件夹。",archiveUnsupported:"{type} 的文件夹在这里打不了包,请直接复制文件夹。",archiveFailed:"没能打包:{error}",exportBusy:"另一个导出正在进行,请稍后再导出 {label}。",exportUnsupported:"现在无法导出 {label}。",exportFailed:"无法导出 {label}。",saving:"正在保存…",reconnecting:"正在重新连接…",notSaved:"未保存",notSavedTitle:"页面没能保存最近的修改。",saveRetry:"保存失败,点击重试",readOnly:"只读",readOnlyTitle:"这里的内容无法保存",leaveLosesWork:"确定离开?尚未保存的修改会丢失。",actionSaveNow:"立即保存",actionOpenFind:"查找",actionUndo:"撤销",actionRedo:"重做",actionEditPage:"编辑页面",actionUsePage:"使用这个页面",actionCommentSelection:"评论选中内容",actionOpenPageList:"页面列表",actionHandOffCode:"交给代码处理",whyOlderVersion:"你正在查看旧版本",whyAgentWorking:"{agent} 正在工作",whyDraftOpen:"请先关闭打开的草稿",whyCommentsOn:"请先退出评论模式",whyNeedsAgent:"需要一个智能体会话",whyUnsaved:"请先保存",whyOther:"暂时不可用",noOwner:"没有会话拥有这个作品",noOwnerNote:"发出的消息会等下一个处理它的会话。",ownerNote:"消息会发给做这个作品的 {harness} 会话。",agentIdle:"{agent} 空闲",agentWaiting:"{agent} 在等待",sessionOffline:"会话离线",offlineNote:"{harness} 会话下次工作时,{agent} 会看到你发的消息。",askPlaceholder:"想改什么?",sendToAgent:"发给 {agent}",sendToConversation:"放进 {agent} 的对话",sending:"发送中…",sent:"已发送。",sentInbox:"会话下次工作时 {agent} 会看到。",sentDrafted:"已放进 {agent} 的对话:到那里发出去。",notDelivered:"没送达。",notSent:"没发出去:{error}",viaDelivered:"已送达",viaDrafted:"在对话里,等你发出",viaInbox:"等会话处理",viaFailed:"没送达",askCloudOnline:"{agent} 已连接:它现在就会收到。",askCloudOffline:"{agent} 所在的电脑重新上线后,它会收到。",askCloudMcp:"{agent} 下次处理这个作品时会看到。",askCloudNone:"这个站点上还没有连接你的 Agent。连接一台电脑或一个 MCP 客户端;在那之前,请求会一直等着。",askCloudNoneOther:"所有者还没有在这个站点上连接 Agent。请求会等到他们连接为止。",sentCloudDelivered:"已送达:{agent} 现在就收到了。",sentCloudOffline:"已发送。{agent} 所在的电脑重新上线后,它会收到。",sentCloudMcp:"已发送。{agent} 下次处理这个作品时会看到。",sentCloudNone:"已发送。会等到有 Agent 连接为止。",viaWaitingAgent:"等 Agent 接收",statusConnected:"已连接",statusNoAgent:"无 Agent",emptyTitle:"这个作品还是空的",emptyBody:"{root} 里还没有写入 {type} 的内容。由 Agent 来写:把下面这段发给它。",startSession:"和 {agent} 开个新会话",promptCopied:"已复制:粘贴到任意装了 Artifact 工具的 Agent 会话里。",sentToSession:"已发到新会话。",problemTitle:"这个作品在这里打不开",noPage:"没有页面。",readOnlyNewer:"在这里只读:这个作品由 {type} {release} 写入,这台电脑上是 {version}。更新 Open Artifact(open-artifact runtime update,或更新附带它的应用)后才能编辑。",folder:"文件夹:{root}",askToLook:"让 {agent} 看看",problemAsk:"作品页打不开:{problem}",noBoot:"没有要显示的作品。从主页打开一个。",tryAgain:"重试",bootFailed:"页面没有打开:{error}",frameNotOpen:"页面已经不在打开状态(它的服务可能重启过),重新打开也没成功。",frameNotGranted:"这个页面在这里已经不对你开放了。",homeTitle:"Open Artifact",homeSub:"本机所有 Agent 共用的作品和类型。",artifacts:"作品",types:"类型",newArtifact:"新建作品",moreActions:"更多操作",backToSession:"回到会话",noArtifacts:"还没有作品。让 Agent 用 Artifact 工具创建一个,或者在这里新建。",pageOpen:"已打开",typeMissing:"类型没有安装",deleted:"已删除「{title}」,文件夹保留。",undo:"撤销",restored:"已恢复",couldNotRestore:"没能恢复:{error}",couldNotLoad:"读取失败:{error}",typeRoots:"类型根目录:{roots}",noTypes:"没有找到类型。",disabled:"已停用",shadowedBy:"被 {root} 覆盖",newOf:"新建 {type}",create:"创建",title:"标题",folderOptional:"文件夹(可不填)",folderHint:"默认:主工作区里新建一个文件夹",needTitle:"先写个标题。",couldNotCreate:"没建成:{error}",renameArtifact:"重命名作品",cannotCreateYet:"目前这里只能新建 Design 作品。",cannotShareCloud:"{type} 作品暂时不能在这里分享。",signIn:"登录",signOut:"退出登录",signOutFailed:"没能退出登录:{error}",accountOf:"账号:{name}",sharedWithOthers:"已分享给他人",addPeople:"添加成员",addPeoplePlaceholder:"邮箱,或 @域名(该域名下所有人)",add:"添加",addInvalid:"不是邮箱地址或 @域名:{entries}",roleFor:"新加成员的角色",memberPending:"已邀请,还没登录过",memberDomain:"{domain} 的所有人",memberGroup:"群组",removeAccess:"移除访问权限",removeMemberBody:"对方将无法再访问这份内容,之后可以再加回来。",noMembers:"还没有添加其他人。",accessRestricted:"受限",accessRestrictedSub:"只有这里添加的人能打开。",accessLink:"知道链接的任何人",accessLinkSub:"拿到下面某条链接的人获得对应角色。",accessPublic:"公开",accessPublicSub:"任何人都能以查看者身份打开;下面的链接可以给更多权限。",shareSettings:"设置",viewersCanExport:"查看者可以下载和导出",editorsCanAsk:"编辑者可以向 {agent} 提需求",ownedBy:"所有者:{name}",yourRole:"你的角色:{role}",onlyOwnerShares:"只有所有者能更改谁可以访问。",emptyBodyCloud:"还没有写入任何 {type} 内容。由 Agent 来写:把下面这段发给它。",homeSubCloud:"你的作品,以及别人分享给你的。",noArtifactsCloud:"还没有作品。让 Agent 用 Artifact 工具发布一个,或者请别人分享给你。",pubTitle:"发布到网上",pubIntro:"给它一个网址,这台电脑关机也能打开。在那边由你决定谁能打开。",pubDataNote:"发布这个仪表盘也会发布它的数据:这台电脑运行它的实时查询,把结果放到站点上,能打开它的人都看得到。",pubDataPending:"它的实时数据还没上站点:在你发布数据之前,那边的页面没有数字。",pubDataConfirm:"发布它的数据",pubDataAsOf:"站点上的数据截至 {time},由这台电脑刷新。",pubDataNone:"它的数据已发布,第一批结果正在上传。",pubDataFailed:"上次刷新失败:{reason}",pubDataRefresh:"现在刷新",pubDataRefreshing:"正在刷新…",pubDataStop:"停止发布数据",pubDataStopTitle:"停止发布它的数据?",pubDataStopBody:"数据会从 {host} 上删掉,这台电脑也不再刷新它们。仪表盘仍发布在那里,只是在你再次发布数据之前没有数字。",pubConnectSite:"连接一个站点…",pubConnectAnother:"再连接一个站点…",pubAddress:"站点地址",pubAddressPlaceholder:"https://artifacts.example.com",pubAddressHint:"你有账号的 Open Artifact 站点的网址。",pubName:"名称",pubNameHint:"用来区分不同站点的简短名字,比如 work。",pubConnect:"连接",pubConnecting:"正在连接…",pubCodeTitle:"在 {host} 上批准这台电脑",pubCodeBody:"确认页面上显示的是这个代码,然后点批准。",pubCodeOpened:"已在浏览器里打开批准页面。没看到的话,从这里打开:",pubOpenApproval:"打开批准页面",pubWaitingApproval:"等你批准…",pubConnected:"已连接到 {host},账号 {name}。",pubTryAgain:"重试",pubSignedInAs:"账号:{name}",pubStateConnected:"已连接",pubStateConnecting:"正在连接…",pubStateUnreachable:"连不上",pubStateSignedOut:"已退出登录",pubPublish:"发布",pubPublishing:"正在发布…",pubReconnect:"重新连接",pubPublishedAt:"已发布到 {host}",pubOpen:"打开",pubManage:"谁能打开,在它的网页上设置:打开后点那里的“分享”。",pubManageLink:"到网上管理访问权限",pubOpensThere:"站点连得上时,在这台电脑上打开它会直接跳到网址。",pubUnpublish:"取消发布",pubUnpublishing:"正在取消发布…",unpubTitle:"取消发布这份内容?",unpubBody:"网上那份会移到 {host} 的回收站,网址随之失效。这个文件夹留在这台电脑上,并带上网上的最新改动。",pubInSync:"已同步",pubInSyncAt:"已同步 · {when}",pubWaitingOne:"有 1 处改动等待发送",pubWaiting:"有 {count} 处改动等待发送",pubOffline:"连不上 {host}:改动先保存在这里,恢复后自动发送。",pubSignedOutSync:"已退出 {host} 的登录:改动先保存在这里,重新连接后发送。",pubSyncFailed:"上次同步失败:{error}",pubCloudMark:"已发布到网上",pubCloudAt:"已发布:{url}",pubHostEmpty:"请填写站点地址。",pubHostInvalid:"这不是网址。请按 https://artifacts.example.com 这样填写。",pubHostNotHttps:"地址必须以 https:// 开头(http 只能用于本机或内网地址,比如 192.168.1.20、nas.lan、192-168-1-20.nip.io)。",pubInsecureWarning:"这是明文 http:发布的内容不加密传输。只在你信任的网络里使用。",pubAutoSwitch:"自动发布新建的作品",pubAutoHint:"从现在起新建的作品会自动发布到 {host},之前的保持不变。",pubAutoNoSite:"先选一个默认站点。",pubDefaultSite:"默认站点",pubDefaultMark:"默认",pubAutoPublishing:"正在自动发布到 {host}…",pubAutoSignedOut:"等待发布到 {host}:这台电脑还没在那边登录。",pubAutoUnreachable:"等待发布:连不上 {host},稍后会自动重试。",pubAutoFailed:"还没发布到 {host}:{error} 稍后会自动重试。",pubApprovalTitle:"在 {host} 上批准这台电脑",pubApprovalBody:"这台电脑已设置为发布到 {host}。打开批准页面,确认显示的是这个代码,然后批准。",pubCloudSettingsFailed:"没能修改设置:{error}",pubNameInvalid:"只能用字母、数字、- 和 _(最多 32 个),比如 work。",pubNameTaken:"这个名称已经用于另一个站点,换一个名称。",pubNoDaemon:"这台电脑上的 Open Artifact 没有响应。确认它在运行后再试。",pubConnectDenied:"{host} 拒绝了这次连接。如果是误操作,再试一次。",pubConnectExpired:"代码在批准前过期了。请重试,并在几分钟内批准。",pubConnectUnreachable:"连不上 {host}。检查地址和网络后再试。",pubConnectNotHost:"{host} 看起来不是 Open Artifact 站点,请检查地址。",pubConnectFailed:"连接失败:{error}",pubIdTaken:"{host} 上已经有一份同样 id 的作品,它仍在那边发布着(可能是从另一台电脑发布的),或者属于别人。先在那边取消发布(你取消发布过的作品,再次发布时会被替换),或者复制这份作品后发布副本。",pubAlreadyElsewhere:"它已经发布到另一个站点了,先在那边取消发布。",pubTooLarge:"它对 {host} 来说太大了。把文件夹里的大文件移走后再试。",pubSignedOut:"你已退出 {host} 的登录。重新连接后再试。",pubNotAllowed:"{host} 不允许这样做:你在那边的账号可能没有发布权限。",pubUnreachable:"暂时连不上 {host},恢复后再试。",pubUnsupported:"{host} 暂时不支持这类作品。",pubFailed:"发布失败:{error}",unpubUnreachable:"连不上 {host},没法先把网上的最新版本取回来。恢复后再试。",unpubFailed:"取消发布失败:{error}",openOnWeb:"在网上打开",copyWebLink:"复制网址",webLinkCopied:"网址已复制",signOutAccess:"退出登录(同时退出组织的统一登录)",upload:"上传",uploadHint:"上传一个作品:在它的“导出”里选“整个文件夹(.zip)”得到的 .zip。",uploadDrop:"松开即可上传这个 .zip",uploadSending:"正在上传 {name}… {percent}%",uploadSendingSize:"正在上传 {name}…",uploadChecking:"正在检查 {name}…",uploadOpening:"{name} 已上传,正在打开…",uploadNotZip:"这不是 .zip 文件。请在作品的“导出”里选“整个文件夹(.zip)”。",uploadNotArtifact:"这个 zip 不是 Open Artifact 作品文件夹。请在作品的“导出”里选“整个文件夹(.zip)”。",uploadTooLargeLimit:"这个 zip 太大了:这个站点最多接收 {limit}。把文件夹里的大文件删掉后再试。",uploadTooLarge:"这个 zip 对这个站点来说太大了。把文件夹里的大文件删掉后再试。",uploadTooLargeSaid:"这个 zip 对这个站点来说太大了:{error} 把文件夹里的大文件删掉后再试。",uploadSignedOut:"你已退出登录。重新登录后再上传。",uploadNotAllowed:"这个站点不允许你上传作品。",uploadConflict:"站点那边出了点冲突,再试一次。",uploadTypeMissing:"这个站点暂时打不开 {type} 作品。",uploadBusy:"尝试太频繁了,稍等一会儿再试。",uploadNoAnswer:"站点没有响应。检查网络后再试。",uploadFailed:"没能上传:{error}",dismiss:"关闭",trash:"回收站",trashEmpty:"回收站是空的。",trashNote:"作品在回收站里时,分享过的人都打不开它。",trashedWhen:"{when}移到回收站",trashKeptDays:"在回收站里放满 {days} 天后会被永久删除。",trashKeptOneDay:"在回收站里放满 1 天后会被永久删除。",trashKeptForever:"会一直留在这里,直到你永久删除。",restore:"恢复",restoredTitle:"已恢复「{title}」",deleteForever:"永久删除",purgeTitle:"永久删除「{title}」?",purgeBody:"删除后无法撤销。它会从这个站点上移除,分享过的人也都无法再打开。",purged:"已永久删除「{title}」",purgeNotTrashed:"它已经不在回收站里了。",purgeGone:"它已经不存在了。",couldNotPurge:"没能删除:{error}",moveToTrash:"移到回收站",movedToTrash:"已把「{title}」移到回收站。",shareOnNetwork:"改为在本地网络里分享",shareOnNetworkSub:"这里的链接打开的是这台电脑上的副本,不是网页版。"};function w_(t){return t&&/^zh\b/i.test(t)?"zh-CN":"en"}const Fm=w_(typeof navigator>"u"?void 0:navigator.language);function T_(t,o){return o?t.replace(/\{(\w+)\}/g,(a,r)=>r in o?String(o[r]):a):t}function E_(t,o,a){return T_((t==="zh-CN"?S_[o]:void 0)??x_[o],a)}function E(t,o){return E_(Fm,t,o)}const C_=/^art_[0-9a-z]{10,40}$/;function R_(t){if(typeof t!="string")return null;const o=/^open-artifact:\/\/artifact\/([^/?#]+)/.exec(t.trim()),a=o?o[1]:t.trim();return C_.test(a)?a:null}const an={artifacts:"artifacts",artifact:"artifact",types:"types",harnesses:"harnesses",events:"events",share:"artifact.share",archive:"artifact.archive",thumbnail:"artifacts.thumbnail",restore:"artifacts.restore",open:"artifacts.open",boot:"artifacts.boot",preview:"artifacts.preview",create:"artifacts.create",update:"artifacts.update",duplicate:"artifacts.duplicate",delete:"artifacts.delete",ask:"artifacts.ask",adopt:"artifacts.adopt",tools:"tools",embed:"embed",view:"view"},O_="[Artifact comment sent to agent]",A_="[Artifact edit request sent to agent]",N_="[Artifact task finished]",k_="open-artifact-shell",xa={shell:"open_artifact_shell",id:"open_artifact_id",comment:"comment",panel:"panel"},Ma=/^#slide-(?:~[A-Za-z0-9_-]{1,64}(?:\.only(?:\.[0-9]{1,4}\.[0-9]{1,4})?)?|[0-9]{1,4})$/,M_="#view-inline",hf=/^#[0-9a-f]{8}-[0-9a-f]{4}(?:\.[^\s#]{1,500})?$/,j_=["not_open","not_granted"],kT=1e4,__=["saved","actions","formats","shareNotice","peers"],MT=/^[A-Za-z0-9_.:-]{1,128}$/,D_=24,z_=["text/plain","text/html","image/png","image/svg+xml"],L_=/^[A-Za-z0-9_-]{1,64}$/,P_=64*1024*1024,I_=1,H_=/^[a-z][a-z0-9]{0,23}$/,u0="not run: the artifact was updated",U_=1,B_=8,V_=8e3,f0="oa_view",F_=(t,o=V_)=>typeof t=="string"?t.slice(0,o):"",zi=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function Y_(t){if(!zi(t))return null;if(t.openArtifact==="goto"){const r=F_(t.hash,2e3);return r?{openArtifact:"goto",hash:r}:null}if(t.openArtifact!=="host_hello")return null;const o=zi(t.caps)?t.caps:{},a={openArtifact:"host_hello",caps:{...o.sessions===!0?{sessions:!0}:{},...o.toolbar===!0?{toolbar:!0}:{},...o.artifacts===!0?{artifacts:!0}:{}}};if(typeof t.agentName=="string"&&t.agentName.trim()&&(a.agentName=t.agentName.trim().slice(0,80)),typeof t.harness=="string"&&t.harness&&(a.harness=t.harness.slice(0,64)),Number.isInteger(t.protocol)&&(a.protocol=t.protocol),zi(t.theme)&&(t.theme.scheme==="light"||t.theme.scheme==="dark")&&(a.theme={scheme:t.theme.scheme,...typeof t.theme.accent=="string"&&/^#[0-9a-f]{6}$/i.test(t.theme.accent)?{accent:t.theme.accent}:{}}),Array.isArray(t.destinations)&&(a.destinations=t.destinations.filter(r=>zi(r)&&typeof r.id=="string"&&!!r.id&&typeof r.label=="string"&&!!r.label.trim()).slice(0,B_).map(r=>({id:r.id.slice(0,64),label:r.label.trim().slice(0,80)}))),zi(t.library)){const r={};typeof t.library.harness=="string"&&t.library.harness&&(r.harness=t.library.harness.slice(0,64)),typeof t.library.workspace=="string"&&t.library.workspace&&(r.workspace=t.library.workspace.slice(0,4096)),(r.harness||r.workspace)&&(a.library=r)}return a}function jT(t){return!!t&&typeof t=="object"&&typeof t.openArtifact=="string"}const q_=["quickstart","list","publish","read","open","call","adopt","delete","share"],G_=["get","list","query","set","update","delete","str_replace","batch"],X_=["read","reply","resolve","reopen","wait"],K_=["share","export"],$_={type:"object",properties:{action:{type:"string",enum:q_,description:"What to do. Omitted: publish."},intent:{type:"string",description:"quickstart: what is being made (design, design-system, slides, whiteboard, document, data, sheets, motion, other), or a few words about it."},scope:{type:"string",enum:["types","mine","all"],description:"list: the installed types, this session's and this workspace's artifacts (default), or every artifact."},type:{type:"string",description:"list: only artifacts of this type (an id, or open-artifact://type/<id>). quickstart: the type already chosen (an id), to get its create call and steps without matching."},query:{type:"string",description:"list: only artifacts whose title contains this text."},limit:{type:"integer",description:"list: how many to return (default 50, at most 200)."},cursor:{type:"string",description:"list: the next_cursor of the previous page."},type_url:{type:"string",description:"publish without url: the type to create from (open-artifact://type/<id>, from quickstart). read without url: the type to describe."},title:{type:"string",description:"publish without url: the new artifact's name. quickstart: the name it will have, to find similar ones."},folder:{type:"string",description:"publish without url, or adopt: where the artifact's folder goes (absolute, or relative to the workspace). Default <workspace>/artifacts/<slug>."},url:{type:"string",description:"An artifact: open-artifact://artifact/<id>, as publish returned it."},files:{type:"object",additionalProperties:!0,description:'publish with url: files to write under the artifact root, as {"rel/path": "text"} or {"rel/path": {"content": "...", "encoding": "base64"}}; null deletes.'},if_match:{type:"object",additionalProperties:!0,description:'publish with url: {"rel/path": sha256 | null | "*"}. Write only while the file still has the sha256 you read, does not exist (null), or anyway ("*"). One mismatch writes nothing and returns the current versions.'},check:{type:"boolean",description:"publish with url: run the type's check action after writing; its result comes back as check."},open:{type:"string",enum:["after_first_write","now","never"],description:"publish without url: after_first_write (the default) opens the page in your app once your first write lands; now opens it at once; never leaves it closed. Where your app cannot show pages by itself the result says so: open view_url in your app's built-in browser, if you have one."},related:{type:"boolean",description:"quickstart: list existing artifacts the recommended type can build on, such as design systems (default true)."},path:{type:"string",description:"read: one file or folder under the root (omitted: the record and the file list)."},paths:{type:"array",items:{type:"string"},description:"read: several files under the root at once."},name:{type:"string",description:"call: the action's name (check, upload, ...; read with url lists them)."},args:{type:"object",additionalProperties:!0,description:"call: the action's arguments. upload: {file: absolute path, name?, group?}."},panel:{type:"string",enum:K_,description:"open: also open the page's Share panel (share), for the person to share it on the network, or its Export tab (export), for them to download a file."},cloud:{type:"string",description:"share: publish the artifact to this cloud remote (its name, as `open-artifact remote list` shows it). It works only on a remote the person set up and let agents publish to (agentMayPublish); otherwise the person publishes it, from the Share panel or with `open-artifact publish <id> --remote <name>`."}}},W_={type:"object",properties:{action:{type:"string",enum:G_},url:{type:"string",description:"The artifact (open-artifact://artifact/<id>)."},collection:{type:"string"},doc_id:{type:"string"},path:{type:"string",description:"collection/doc_id, instead of the two."},data:{type:"object",additionalProperties:!0,description:"set / update: the document's fields."},file_path:{type:"string",description:"set / update: a JSON file holding the fields, instead of data."},if_match:{description:'set / update / delete / str_replace: the sha256 get returned (write only if unchanged), null (only if it does not exist) or "*" (replace whatever is there).'},field:{type:"string",description:"str_replace: the text field, as a dot path (body, notes.text)."},old:{type:"string",description:"str_replace: the passage to replace; it must occur exactly once."},new:{type:"string",description:"str_replace: the passage that replaces it."},where:{type:"array",items:{type:"object",additionalProperties:!0},description:"query: [{field, op, value}], all must hold. op: ==, !=, <, <=, >, >=, in, not-in (up to 30 values), array-contains."},order_by:{type:"object",additionalProperties:!0,description:'query: {field, dir: "asc" | "desc"}.'},limit:{type:"integer",description:"list / query: how many documents (default 100, at most 1000)."},cursor:{type:"string",description:"list / query: the next_cursor of the previous page."},out_file:{type:"string",description:"get / list / query: write the result to this JSON file (absolute, or relative to the workspace) and return only its path and counts."},writes:{type:"array",items:{type:"object",additionalProperties:!0},description:"batch: [{op: set|update|delete|str_replace, path | collection+doc_id, data | file_path, if_match?, field?, old?, new?}], at most 500."}},required:["action","url"]},Q_={type:"object",properties:{action:{type:"string",enum:X_},url:{type:"string",description:"The artifact (open-artifact://artifact/<id>). wait: optional."},thread_id:{type:"string",description:'reply / resolve / reopen: the thread (after ";thread=" in the message).'},text:{type:"string",description:"reply: the answer."},resolve:{type:"boolean",description:"reply: resolve the thread too."},all:{type:"boolean",description:"read: resolved threads too."},since:{type:"string",description:"read: only threads with a message at or after this time (ISO 8601)."},acknowledge_duplicate:{type:"boolean",description:"reply: send the same text as your last reply in this thread again, on purpose."},timeout_ms:{type:"number",description:"wait: how long (default 600000)."}},required:["action"]},d0={Artifact:$_,ArtifactData:W_,ArtifactComments:Q_},Z_={Artifact:["Make and change artifacts: typed folders of files that open as live pages the person can view, edit, comment on and export. Actions:","- quickstart {intent, type?}: call first for a new artifact; recommends a type (or takes the one given) and returns the call that creates it, the steps for this app and similar artifacts that already exist.",'- list {scope: "mine" | "all" | "types", type?, query?}: find existing artifacts, or the installed types.',"- publish {type_url, title, folder?, open?}: create an artifact; the result carries its root folder and the type's instructions. publish {url, files, if_match?, check?}: write files when you have no file tools of your own.","- read {url, path? | paths?}: the artifact's record, files and actions, or some of its files with their sha256. read {type_url}: a type's instructions, before creating.",`- open {url, panel?}: show it to the person in the computer's browser (or the app, when it shows pages), once its content is written. When your app has a built-in browser, open view_url there instead. panel "share" or "export" opens its Share panel or Export tab for them.`,"- call {url, name, args?}: run one of the type's actions (check, upload, ...). A long one answers {task, pending: true}; its result comes later as a message.","- adopt {url | folder}: take over an artifact, or add an existing folder. Only when the person asks.","- share {url}: whether it is shared on the local network, and its links. Only the person changes that, in the page's Share panel.","- delete {url}: forget an artifact; its folder stays. Only when the person asks."].join(`
|
|
8
|
+
`+i.stack}}var Se=Object.prototype.hasOwnProperty,Re=t.unstable_scheduleCallback,Ne=t.unstable_cancelCallback,Ie=t.unstable_shouldYield,je=t.unstable_requestPaint,le=t.unstable_now,ve=t.unstable_getCurrentPriorityLevel,he=t.unstable_ImmediatePriority,ce=t.unstable_UserBlockingPriority,xe=t.unstable_NormalPriority,He=t.unstable_LowPriority,Lt=t.unstable_IdlePriority,Ft=t.log,ut=t.unstable_setDisableYieldValue,Oe=null,Ye=null;function Qe(e){if(typeof Ft=="function"&&ut(e),Ye&&typeof Ye.setStrictMode=="function")try{Ye.setStrictMode(Oe,e)}catch{}}var ct=Math.clz32?Math.clz32:hn,Jt=Math.log,rn=Math.LN2;function hn(e){return e>>>=0,e===0?32:31-(Jt(e)/rn|0)|0}var bt=256,jt=262144,Fe=4194304;function ft(e){var n=e&42;if(n!==0)return n;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&261888;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 _t(e,n,s){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var R=i&134217727;return R!==0?(i=R&~f,i!==0?u=ft(i):(x&=R,x!==0?u=ft(x):s||(s=R&~e,s!==0&&(u=ft(s))))):(R=i&~f,R!==0?u=ft(R):x!==0?u=ft(x):s||(s=i&~e,s!==0&&(u=ft(s)))),u===0?0:n!==0&&n!==u&&(n&f)===0&&(f=u&-u,s=n&-n,f>=s||f===32&&(s&4194048)!==0)?n:u}function Pt(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Nn(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 ln(){var e=Fe;return Fe<<=1,(Fe&62914560)===0&&(Fe=4194304),e}function yo(e){for(var n=[],s=0;31>s;s++)n.push(e);return n}function vn(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ro(e,n,s,i,u,f){var x=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var R=e.entanglements,F=e.expirationTimes,oe=e.hiddenUpdates;for(s=x&~s;0<s;){var ue=31-ct(s),de=1<<ue;R[ue]=0,F[ue]=-1;var ae=oe[ue];if(ae!==null)for(oe[ue]=null,ue=0;ue<ae.length;ue++){var ie=ae[ue];ie!==null&&(ie.lane&=-536870913)}s&=~de}i!==0&&kn(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(x&~n))}function kn(e,n,s){e.pendingLanes|=n,e.suspendedLanes&=~n;var i=31-ct(n);e.entangledLanes|=n,e.entanglements[i]=e.entanglements[i]|1073741824|s&261930}function Ze(e,n){var s=e.entangledLanes|=n;for(e=e.entanglements;s;){var i=31-ct(s),u=1<<i;u&n|e[i]&n&&(e[i]|=n),s&=~u}}function Rt(e,n){var s=n&-n;return s=(s&42)!==0?1:Mn(s),(s&(e.suspendedLanes|n))!==0?0:s}function Mn(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 ao(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function bo(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:qv(e.type))}function ps(e,n){var s=q.p;try{return q.p=e,n()}finally{q.p=s}}var ro=Math.random().toString(36).slice(2),Yt="__reactFiber$"+ro,mn="__reactProps$"+ro,Oo="__reactContainer$"+ro,Sf="__reactEvents$"+ro,RE="__reactListeners$"+ro,OE="__reactHandles$"+ro,lg="__reactResources$"+ro,Vr="__reactMarker$"+ro;function wf(e){delete e[Yt],delete e[mn],delete e[Sf],delete e[RE],delete e[OE]}function Ua(e){var n=e[Yt];if(n)return n;for(var s=e.parentNode;s;){if(n=s[Oo]||s[Yt]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=Nv(e);e!==null;){if(s=e[Yt])return s;e=Nv(e)}return n}e=s,s=e.parentNode}return null}function Ba(e){if(e=e[Yt]||e[Oo]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Fr(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(r(33))}function Va(e){var n=e[lg];return n||(n=e[lg]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function on(e){e[Vr]=!0}var cg=new Set,ug={};function Zs(e,n){Fa(e,n),Fa(e+"Capture",n)}function Fa(e,n){for(ug[e]=n,e=0;e<n.length;e++)cg.add(n[e])}var AE=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]*$"),fg={},dg={};function NE(e){return Se.call(dg,e)?!0:Se.call(fg,e)?!1:AE.test(e)?dg[e]=!0:(fg[e]=!0,!1)}function Cl(e,n,s){if(NE(n))if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var i=n.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+s)}}function Rl(e,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+s)}}function Ao(e,n,s,i){if(i===null)e.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(n,s,""+i)}}function Yn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pg(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function kE(e,n,s){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,f=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return u.call(this)},set:function(x){s=""+x,f.call(this,x)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(x){s=""+x},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Tf(e){if(!e._valueTracker){var n=pg(e)?"checked":"value";e._valueTracker=kE(e,n,""+e[n])}}function hg(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),i="";return e&&(i=pg(e)?e.checked?"true":"false":e.value),e=i,e!==s?(n.setValue(e),!0):!1}function Ol(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}}var ME=/[\n"\\]/g;function qn(e){return e.replace(ME,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Ef(e,n,s,i,u,f,x,R){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),n!=null?x==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Yn(n)):e.value!==""+Yn(n)&&(e.value=""+Yn(n)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),n!=null?Cf(e,x,Yn(n)):s!=null?Cf(e,x,Yn(s)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+Yn(R):e.removeAttribute("name")}function mg(e,n,s,i,u,f,x,R){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),n!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){Tf(e);return}s=s!=null?""+Yn(s):"",n=n!=null?""+Yn(n):s,R||n===e.value||(e.value=n),e.defaultValue=n}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=R?e.checked:!!i,e.defaultChecked=!!i,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Tf(e)}function Cf(e,n,s){n==="number"&&Ol(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Ya(e,n,s,i){if(e=e.options,n){n={};for(var u=0;u<s.length;u++)n["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=n.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&i&&(e[s].defaultSelected=!0)}else{for(s=""+Yn(s),n=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}n!==null||e[u].disabled||(n=e[u])}n!==null&&(n.selected=!0)}}function gg(e,n,s){if(n!=null&&(n=""+Yn(n),n!==e.value&&(e.value=n),s==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=s!=null?""+Yn(s):""}function yg(e,n,s,i){if(n==null){if(i!=null){if(s!=null)throw Error(r(92));if(K(i)){if(1<i.length)throw Error(r(93));i=i[0]}s=i}s==null&&(s=""),n=s}s=Yn(n),e.defaultValue=s,i=e.textContent,i===s&&i!==""&&i!==null&&(e.value=i),Tf(e)}function qa(e,n){if(n){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=n;return}}e.textContent=n}var jE=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 bg(e,n,s){var i=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?i?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":i?e.setProperty(n,s):typeof s!="number"||s===0||jE.has(n)?n==="float"?e.cssFloat=s:e[n]=(""+s).trim():e[n]=s+"px"}function vg(e,n,s){if(n!=null&&typeof n!="object")throw Error(r(62));if(e=e.style,s!=null){for(var i in s)!s.hasOwnProperty(i)||n!=null&&n.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var u in n)i=n[u],n.hasOwnProperty(u)&&s[u]!==i&&bg(e,u,i)}else for(var f in n)n.hasOwnProperty(f)&&bg(e,f,n[f])}function Rf(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 _E=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"],["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"]]),DE=/^[\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 Al(e){return DE.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function No(){}var Of=null;function Af(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ga=null,Xa=null;function xg(e){var n=Ba(e);if(n&&(e=n.stateNode)){var s=e[mn]||null;e:switch(e=n.stateNode,n.type){case"input":if(Ef(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+qn(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var i=s[n];if(i!==e&&i.form===e.form){var u=i[mn]||null;if(!u)throw Error(r(90));Ef(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(n=0;n<s.length;n++)i=s[n],i.form===e.form&&hg(i)}break e;case"textarea":gg(e,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&Ya(e,!!s.multiple,n,!1)}}}var Nf=!1;function Sg(e,n,s){if(Nf)return e(n,s);Nf=!0;try{var i=e(n);return i}finally{if(Nf=!1,(Ga!==null||Xa!==null)&&(mc(),Ga&&(n=Ga,e=Xa,Xa=Ga=null,xg(n),e)))for(n=0;n<e.length;n++)xg(e[n])}}function Yr(e,n){var s=e.stateNode;if(s===null)return null;var i=s[mn]||null;if(i===null)return null;s=i[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(r(231,n,typeof s));return s}var ko=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kf=!1;if(ko)try{var qr={};Object.defineProperty(qr,"passive",{get:function(){kf=!0}}),window.addEventListener("test",qr,qr),window.removeEventListener("test",qr,qr)}catch{kf=!1}var hs=null,Mf=null,Nl=null;function wg(){if(Nl)return Nl;var e,n=Mf,s=n.length,i,u="value"in hs?hs.value:hs.textContent,f=u.length;for(e=0;e<s&&n[e]===u[e];e++);var x=s-e;for(i=1;i<=x&&n[s-i]===u[f-i];i++);return Nl=u.slice(e,1<i?1-i:void 0)}function kl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ml(){return!0}function Tg(){return!1}function xn(e){function n(s,i,u,f,x){this._reactName=s,this._targetInst=u,this.type=i,this.nativeEvent=f,this.target=x,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(s=e[R],this[R]=s?s(f):f[R]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Ml:Tg,this.isPropagationStopped=Tg,this}return v(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ml)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ml)},persist:function(){},isPersistent:Ml}),n}var Js={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jl=xn(Js),Gr=v({},Js,{view:0,detail:0}),zE=xn(Gr),jf,_f,Xr,_l=v({},Gr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zf,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!==Xr&&(Xr&&e.type==="mousemove"?(jf=e.screenX-Xr.screenX,_f=e.screenY-Xr.screenY):_f=jf=0,Xr=e),jf)},movementY:function(e){return"movementY"in e?e.movementY:_f}}),Eg=xn(_l),LE=v({},_l,{dataTransfer:0}),PE=xn(LE),IE=v({},Gr,{relatedTarget:0}),Df=xn(IE),HE=v({},Js,{animationName:0,elapsedTime:0,pseudoElement:0}),UE=xn(HE),BE=v({},Js,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),VE=xn(BE),FE=v({},Js,{data:0}),Cg=xn(FE),YE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qE={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"},GE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function XE(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=GE[e])?!!n[e]:!1}function zf(){return XE}var KE=v({},Gr,{key:function(e){if(e.key){var n=YE[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=kl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zf,charCode:function(e){return e.type==="keypress"?kl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?kl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$E=xn(KE),WE=v({},_l,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rg=xn(WE),QE=v({},Gr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zf}),ZE=xn(QE),JE=v({},Js,{propertyName:0,elapsedTime:0,pseudoElement:0}),eC=xn(JE),tC=v({},_l,{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}),nC=xn(tC),oC=v({},Js,{newState:0,oldState:0}),sC=xn(oC),aC=[9,13,27,32],Lf=ko&&"CompositionEvent"in window,Kr=null;ko&&"documentMode"in document&&(Kr=document.documentMode);var rC=ko&&"TextEvent"in window&&!Kr,Og=ko&&(!Lf||Kr&&8<Kr&&11>=Kr),Ag=" ",Ng=!1;function kg(e,n){switch(e){case"keyup":return aC.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ka=!1;function iC(e,n){switch(e){case"compositionend":return Mg(n);case"keypress":return n.which!==32?null:(Ng=!0,Ag);case"textInput":return e=n.data,e===Ag&&Ng?null:e;default:return null}}function lC(e,n){if(Ka)return e==="compositionend"||!Lf&&kg(e,n)?(e=wg(),Nl=Mf=hs=null,Ka=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Og&&n.locale!=="ko"?null:n.data;default:return null}}var cC={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 jg(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!cC[e.type]:n==="textarea"}function _g(e,n,s,i){Ga?Xa?Xa.push(i):Xa=[i]:Ga=i,n=wc(n,"onChange"),0<n.length&&(s=new jl("onChange","change",null,s,i),e.push({event:s,listeners:n}))}var $r=null,Wr=null;function uC(e){mv(e,0)}function Dl(e){var n=Fr(e);if(hg(n))return e}function Dg(e,n){if(e==="change")return n}var zg=!1;if(ko){var Pf;if(ko){var If="oninput"in document;if(!If){var Lg=document.createElement("div");Lg.setAttribute("oninput","return;"),If=typeof Lg.oninput=="function"}Pf=If}else Pf=!1;zg=Pf&&(!document.documentMode||9<document.documentMode)}function Pg(){$r&&($r.detachEvent("onpropertychange",Ig),Wr=$r=null)}function Ig(e){if(e.propertyName==="value"&&Dl(Wr)){var n=[];_g(n,Wr,e,Af(e)),Sg(uC,n)}}function fC(e,n,s){e==="focusin"?(Pg(),$r=n,Wr=s,$r.attachEvent("onpropertychange",Ig)):e==="focusout"&&Pg()}function dC(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Dl(Wr)}function pC(e,n){if(e==="click")return Dl(n)}function hC(e,n){if(e==="input"||e==="change")return Dl(n)}function mC(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var jn=typeof Object.is=="function"?Object.is:mC;function Qr(e,n){if(jn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var s=Object.keys(e),i=Object.keys(n);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var u=s[i];if(!Se.call(n,u)||!jn(e[u],n[u]))return!1}return!0}function Hg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ug(e,n){var s=Hg(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=n&&i>=n)return{node:s,offset:n-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Hg(s)}}function Bg(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Bg(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Vg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Ol(e.document);n instanceof e.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)e=n.contentWindow;else break;n=Ol(e.document)}return n}function Hf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var gC=ko&&"documentMode"in document&&11>=document.documentMode,$a=null,Uf=null,Zr=null,Bf=!1;function Fg(e,n,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Bf||$a==null||$a!==Ol(i)||(i=$a,"selectionStart"in i&&Hf(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Zr&&Qr(Zr,i)||(Zr=i,i=wc(Uf,"onSelect"),0<i.length&&(n=new jl("onSelect","select",null,n,s),e.push({event:n,listeners:i}),n.target=$a)))}function ea(e,n){var s={};return s[e.toLowerCase()]=n.toLowerCase(),s["Webkit"+e]="webkit"+n,s["Moz"+e]="moz"+n,s}var Wa={animationend:ea("Animation","AnimationEnd"),animationiteration:ea("Animation","AnimationIteration"),animationstart:ea("Animation","AnimationStart"),transitionrun:ea("Transition","TransitionRun"),transitionstart:ea("Transition","TransitionStart"),transitioncancel:ea("Transition","TransitionCancel"),transitionend:ea("Transition","TransitionEnd")},Vf={},Yg={};ko&&(Yg=document.createElement("div").style,"AnimationEvent"in window||(delete Wa.animationend.animation,delete Wa.animationiteration.animation,delete Wa.animationstart.animation),"TransitionEvent"in window||delete Wa.transitionend.transition);function ta(e){if(Vf[e])return Vf[e];if(!Wa[e])return e;var n=Wa[e],s;for(s in n)if(n.hasOwnProperty(s)&&s in Yg)return Vf[e]=n[s];return e}var qg=ta("animationend"),Gg=ta("animationiteration"),Xg=ta("animationstart"),yC=ta("transitionrun"),bC=ta("transitionstart"),vC=ta("transitioncancel"),Kg=ta("transitionend"),$g=new Map,Ff="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ff.push("scrollEnd");function io(e,n){$g.set(e,n),Zs(n,[e])}var zl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Gn=[],Qa=0,Yf=0;function Ll(){for(var e=Qa,n=Yf=Qa=0;n<e;){var s=Gn[n];Gn[n++]=null;var i=Gn[n];Gn[n++]=null;var u=Gn[n];Gn[n++]=null;var f=Gn[n];if(Gn[n++]=null,i!==null&&u!==null){var x=i.pending;x===null?u.next=u:(u.next=x.next,x.next=u),i.pending=u}f!==0&&Wg(s,u,f)}}function Pl(e,n,s,i){Gn[Qa++]=e,Gn[Qa++]=n,Gn[Qa++]=s,Gn[Qa++]=i,Yf|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function qf(e,n,s,i){return Pl(e,n,s,i),Il(e)}function na(e,n){return Pl(e,null,null,n),Il(e)}function Wg(e,n,s){e.lanes|=s;var i=e.alternate;i!==null&&(i.lanes|=s);for(var u=!1,f=e.return;f!==null;)f.childLanes|=s,i=f.alternate,i!==null&&(i.childLanes|=s),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&n!==null&&(u=31-ct(s),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[n]:i.push(n),n.lane=s|536870912),f):null}function Il(e){if(50<xi)throw xi=0,ep=null,Error(r(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Za={};function xC(e,n,s,i){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _n(e,n,s,i){return new xC(e,n,s,i)}function Gf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mo(e,n){var s=e.alternate;return s===null?(s=_n(e.tag,n,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=n,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,n=e.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Qg(e,n){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,n=s.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Hl(e,n,s,i,u,f){var x=0;if(i=e,typeof e=="function")Gf(e)&&(x=1);else if(typeof e=="string")x=CR(e,s,$.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Y:return e=_n(31,s,n,u),e.elementType=Y,e.lanes=f,e;case O:return oa(s.children,u,f,n);case A:x=8,u|=24;break;case C:return e=_n(12,s,n,u|2),e.elementType=C,e.lanes=f,e;case z:return e=_n(13,s,n,u),e.elementType=z,e.lanes=f,e;case D:return e=_n(19,s,n,u),e.elementType=D,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case k:x=10;break e;case _:x=9;break e;case j:x=11;break e;case L:x=14;break e;case B:x=16,i=null;break e}x=29,s=Error(r(130,e===null?"null":typeof e,"")),i=null}return n=_n(x,s,n,u),n.elementType=e,n.type=i,n.lanes=f,n}function oa(e,n,s,i){return e=_n(7,e,i,n),e.lanes=s,e}function Xf(e,n,s){return e=_n(6,e,null,n),e.lanes=s,e}function Zg(e){var n=_n(18,null,null,0);return n.stateNode=e,n}function Kf(e,n,s){return n=_n(4,e.children!==null?e.children:[],e.key,n),n.lanes=s,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Jg=new WeakMap;function Xn(e,n){if(typeof e=="object"&&e!==null){var s=Jg.get(e);return s!==void 0?s:(n={value:e,source:n,stack:Le(n)},Jg.set(e,n),n)}return{value:e,source:n,stack:Le(n)}}var Ja=[],er=0,Ul=null,Jr=0,Kn=[],$n=0,ms=null,vo=1,xo="";function jo(e,n){Ja[er++]=Jr,Ja[er++]=Ul,Ul=e,Jr=n}function ey(e,n,s){Kn[$n++]=vo,Kn[$n++]=xo,Kn[$n++]=ms,ms=e;var i=vo;e=xo;var u=32-ct(i)-1;i&=~(1<<u),s+=1;var f=32-ct(n)+u;if(30<f){var x=u-u%5;f=(i&(1<<x)-1).toString(32),i>>=x,u-=x,vo=1<<32-ct(n)+u|s<<u|i,xo=f+e}else vo=1<<f|s<<u|i,xo=e}function $f(e){e.return!==null&&(jo(e,1),ey(e,1,0))}function Wf(e){for(;e===Ul;)Ul=Ja[--er],Ja[er]=null,Jr=Ja[--er],Ja[er]=null;for(;e===ms;)ms=Kn[--$n],Kn[$n]=null,xo=Kn[--$n],Kn[$n]=null,vo=Kn[--$n],Kn[$n]=null}function ty(e,n){Kn[$n++]=vo,Kn[$n++]=xo,Kn[$n++]=ms,vo=n.id,xo=n.overflow,ms=e}var cn=null,kt=null,rt=!1,gs=null,Wn=!1,Qf=Error(r(519));function ys(e){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ei(Xn(n,e)),Qf}function ny(e){var n=e.stateNode,s=e.type,i=e.memoizedProps;switch(n[Yt]=e,n[mn]=i,s){case"dialog":ot("cancel",n),ot("close",n);break;case"iframe":case"object":case"embed":ot("load",n);break;case"video":case"audio":for(s=0;s<wi.length;s++)ot(wi[s],n);break;case"source":ot("error",n);break;case"img":case"image":case"link":ot("error",n),ot("load",n);break;case"details":ot("toggle",n);break;case"input":ot("invalid",n),mg(n,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":ot("invalid",n);break;case"textarea":ot("invalid",n),yg(n,i.value,i.defaultValue,i.children)}s=i.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||i.suppressHydrationWarning===!0||vv(n.textContent,s)?(i.popover!=null&&(ot("beforetoggle",n),ot("toggle",n)),i.onScroll!=null&&ot("scroll",n),i.onScrollEnd!=null&&ot("scrollend",n),i.onClick!=null&&(n.onclick=No),n=!0):n=!1,n||ys(e,!0)}function oy(e){for(cn=e.return;cn;)switch(cn.tag){case 5:case 31:case 13:Wn=!1;return;case 27:case 3:Wn=!0;return;default:cn=cn.return}}function tr(e){if(e!==cn)return!1;if(!rt)return oy(e),rt=!0,!1;var n=e.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||mp(e.type,e.memoizedProps)),s=!s),s&&kt&&ys(e),oy(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));kt=Av(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));kt=Av(e)}else n===27?(n=kt,Ms(e.type)?(e=xp,xp=null,kt=e):kt=n):kt=cn?Zn(e.stateNode.nextSibling):null;return!0}function sa(){kt=cn=null,rt=!1}function Zf(){var e=gs;return e!==null&&(En===null?En=e:En.push.apply(En,e),gs=null),e}function ei(e){gs===null?gs=[e]:gs.push(e)}var Jf=N(null),aa=null,_o=null;function bs(e,n,s){J(Jf,n._currentValue),n._currentValue=s}function Do(e){e._currentValue=Jf.current,V(Jf)}function ed(e,n,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,i!==null&&(i.childLanes|=n)):i!==null&&(i.childLanes&n)!==n&&(i.childLanes|=n),e===s)break;e=e.return}}function td(e,n,s,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var x=u.child;f=f.firstContext;e:for(;f!==null;){var R=f;f=u;for(var F=0;F<n.length;F++)if(R.context===n[F]){f.lanes|=s,R=f.alternate,R!==null&&(R.lanes|=s),ed(f.return,s,e),i||(x=null);break e}f=R.next}}else if(u.tag===18){if(x=u.return,x===null)throw Error(r(341));x.lanes|=s,f=x.alternate,f!==null&&(f.lanes|=s),ed(x,s,e),x=null}else x=u.child;if(x!==null)x.return=u;else for(x=u;x!==null;){if(x===e){x=null;break}if(u=x.sibling,u!==null){u.return=x.return,x=u;break}x=x.return}u=x}}function nr(e,n,s,i){e=null;for(var u=n,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var x=u.alternate;if(x===null)throw Error(r(387));if(x=x.memoizedProps,x!==null){var R=u.type;jn(u.pendingProps.value,x.value)||(e!==null?e.push(R):e=[R])}}else if(u===me.current){if(x=u.alternate,x===null)throw Error(r(387));x.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Oi):e=[Oi])}u=u.return}e!==null&&td(n,e,s,i),n.flags|=262144}function Bl(e){for(e=e.firstContext;e!==null;){if(!jn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){aa=e,_o=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function un(e){return sy(aa,e)}function Vl(e,n){return aa===null&&ra(e),sy(e,n)}function sy(e,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},_o===null){if(e===null)throw Error(r(308));_o=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else _o=_o.next=n;return s}var SC=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(s,i){e.push(i)}};this.abort=function(){n.aborted=!0,e.forEach(function(s){return s()})}},wC=t.unstable_scheduleCallback,TC=t.unstable_NormalPriority,Xt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nd(){return{controller:new SC,data:new Map,refCount:0}}function ti(e){e.refCount--,e.refCount===0&&wC(TC,function(){e.controller.abort()})}var ni=null,od=0,or=0,sr=null;function EC(e,n){if(ni===null){var s=ni=[];od=0,or=rp(),sr={status:"pending",value:void 0,then:function(i){s.push(i)}}}return od++,n.then(ay,ay),n}function ay(){if(--od===0&&ni!==null){sr!==null&&(sr.status="fulfilled");var e=ni;ni=null,or=0,sr=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function CC(e,n){var s=[],i={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){i.status="fulfilled",i.value=n;for(var u=0;u<s.length;u++)(0,s[u])(n)},function(u){for(i.status="rejected",i.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),i}var ry=P.S;P.S=function(e,n){Fb=le(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&EC(e,n),ry!==null&&ry(e,n)};var ia=N(null);function sd(){var e=ia.current;return e!==null?e:Ot.pooledCache}function Fl(e,n){n===null?J(ia,ia.current):J(ia,n.pool)}function iy(){var e=sd();return e===null?null:{parent:Xt._currentValue,pool:e}}var ar=Error(r(460)),ad=Error(r(474)),Yl=Error(r(542)),ql={then:function(){}};function ly(e){return e=e.status,e==="fulfilled"||e==="rejected"}function cy(e,n,s){switch(s=e[s],s===void 0?e.push(n):s!==n&&(n.then(No,No),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,fy(e),e;default:if(typeof n.status=="string")n.then(No,No);else{if(e=Ot,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=n,e.status="pending",e.then(function(i){if(n.status==="pending"){var u=n;u.status="fulfilled",u.value=i}},function(i){if(n.status==="pending"){var u=n;u.status="rejected",u.reason=i}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,fy(e),e}throw ca=n,ar}}function la(e){try{var n=e._init;return n(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ca=s,ar):s}}var ca=null;function uy(){if(ca===null)throw Error(r(459));var e=ca;return ca=null,e}function fy(e){if(e===ar||e===Yl)throw Error(r(483))}var rr=null,oi=0;function Gl(e){var n=oi;return oi+=1,rr===null&&(rr=[]),cy(rr,e,n)}function si(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Xl(e,n){throw n.$$typeof===S?Error(r(525)):(e=Object.prototype.toString.call(n),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function dy(e){function n(te,G){if(e){var ne=te.deletions;ne===null?(te.deletions=[G],te.flags|=16):ne.push(G)}}function s(te,G){if(!e)return null;for(;G!==null;)n(te,G),G=G.sibling;return null}function i(te){for(var G=new Map;te!==null;)te.key!==null?G.set(te.key,te):G.set(te.index,te),te=te.sibling;return G}function u(te,G){return te=Mo(te,G),te.index=0,te.sibling=null,te}function f(te,G,ne){return te.index=ne,e?(ne=te.alternate,ne!==null?(ne=ne.index,ne<G?(te.flags|=67108866,G):ne):(te.flags|=67108866,G)):(te.flags|=1048576,G)}function x(te){return e&&te.alternate===null&&(te.flags|=67108866),te}function R(te,G,ne,fe){return G===null||G.tag!==6?(G=Xf(ne,te.mode,fe),G.return=te,G):(G=u(G,ne),G.return=te,G)}function F(te,G,ne,fe){var Pe=ne.type;return Pe===O?ue(te,G,ne.props.children,fe,ne.key):G!==null&&(G.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===B&&la(Pe)===G.type)?(G=u(G,ne.props),si(G,ne),G.return=te,G):(G=Hl(ne.type,ne.key,ne.props,null,te.mode,fe),si(G,ne),G.return=te,G)}function oe(te,G,ne,fe){return G===null||G.tag!==4||G.stateNode.containerInfo!==ne.containerInfo||G.stateNode.implementation!==ne.implementation?(G=Kf(ne,te.mode,fe),G.return=te,G):(G=u(G,ne.children||[]),G.return=te,G)}function ue(te,G,ne,fe,Pe){return G===null||G.tag!==7?(G=oa(ne,te.mode,fe,Pe),G.return=te,G):(G=u(G,ne),G.return=te,G)}function de(te,G,ne){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Xf(""+G,te.mode,ne),G.return=te,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case w:return ne=Hl(G.type,G.key,G.props,null,te.mode,ne),si(ne,G),ne.return=te,ne;case T:return G=Kf(G,te.mode,ne),G.return=te,G;case B:return G=la(G),de(te,G,ne)}if(K(G)||M(G))return G=oa(G,te.mode,ne,null),G.return=te,G;if(typeof G.then=="function")return de(te,Gl(G),ne);if(G.$$typeof===k)return de(te,Vl(te,G),ne);Xl(te,G)}return null}function ae(te,G,ne,fe){var Pe=G!==null?G.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Pe!==null?null:R(te,G,""+ne,fe);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:return ne.key===Pe?F(te,G,ne,fe):null;case T:return ne.key===Pe?oe(te,G,ne,fe):null;case B:return ne=la(ne),ae(te,G,ne,fe)}if(K(ne)||M(ne))return Pe!==null?null:ue(te,G,ne,fe,null);if(typeof ne.then=="function")return ae(te,G,Gl(ne),fe);if(ne.$$typeof===k)return ae(te,G,Vl(te,ne),fe);Xl(te,ne)}return null}function ie(te,G,ne,fe,Pe){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return te=te.get(ne)||null,R(G,te,""+fe,Pe);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case w:return te=te.get(fe.key===null?ne:fe.key)||null,F(G,te,fe,Pe);case T:return te=te.get(fe.key===null?ne:fe.key)||null,oe(G,te,fe,Pe);case B:return fe=la(fe),ie(te,G,ne,fe,Pe)}if(K(fe)||M(fe))return te=te.get(ne)||null,ue(G,te,fe,Pe,null);if(typeof fe.then=="function")return ie(te,G,ne,Gl(fe),Pe);if(fe.$$typeof===k)return ie(te,G,ne,Vl(G,fe),Pe);Xl(G,fe)}return null}function _e(te,G,ne,fe){for(var Pe=null,dt=null,ze=G,$e=G=0,at=null;ze!==null&&$e<ne.length;$e++){ze.index>$e?(at=ze,ze=null):at=ze.sibling;var pt=ae(te,ze,ne[$e],fe);if(pt===null){ze===null&&(ze=at);break}e&&ze&&pt.alternate===null&&n(te,ze),G=f(pt,G,$e),dt===null?Pe=pt:dt.sibling=pt,dt=pt,ze=at}if($e===ne.length)return s(te,ze),rt&&jo(te,$e),Pe;if(ze===null){for(;$e<ne.length;$e++)ze=de(te,ne[$e],fe),ze!==null&&(G=f(ze,G,$e),dt===null?Pe=ze:dt.sibling=ze,dt=ze);return rt&&jo(te,$e),Pe}for(ze=i(ze);$e<ne.length;$e++)at=ie(ze,te,$e,ne[$e],fe),at!==null&&(e&&at.alternate!==null&&ze.delete(at.key===null?$e:at.key),G=f(at,G,$e),dt===null?Pe=at:dt.sibling=at,dt=at);return e&&ze.forEach(function(Ls){return n(te,Ls)}),rt&&jo(te,$e),Pe}function Be(te,G,ne,fe){if(ne==null)throw Error(r(151));for(var Pe=null,dt=null,ze=G,$e=G=0,at=null,pt=ne.next();ze!==null&&!pt.done;$e++,pt=ne.next()){ze.index>$e?(at=ze,ze=null):at=ze.sibling;var Ls=ae(te,ze,pt.value,fe);if(Ls===null){ze===null&&(ze=at);break}e&&ze&&Ls.alternate===null&&n(te,ze),G=f(Ls,G,$e),dt===null?Pe=Ls:dt.sibling=Ls,dt=Ls,ze=at}if(pt.done)return s(te,ze),rt&&jo(te,$e),Pe;if(ze===null){for(;!pt.done;$e++,pt=ne.next())pt=de(te,pt.value,fe),pt!==null&&(G=f(pt,G,$e),dt===null?Pe=pt:dt.sibling=pt,dt=pt);return rt&&jo(te,$e),Pe}for(ze=i(ze);!pt.done;$e++,pt=ne.next())pt=ie(ze,te,$e,pt.value,fe),pt!==null&&(e&&pt.alternate!==null&&ze.delete(pt.key===null?$e:pt.key),G=f(pt,G,$e),dt===null?Pe=pt:dt.sibling=pt,dt=pt);return e&&ze.forEach(function(LR){return n(te,LR)}),rt&&jo(te,$e),Pe}function St(te,G,ne,fe){if(typeof ne=="object"&&ne!==null&&ne.type===O&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:e:{for(var Pe=ne.key;G!==null;){if(G.key===Pe){if(Pe=ne.type,Pe===O){if(G.tag===7){s(te,G.sibling),fe=u(G,ne.props.children),fe.return=te,te=fe;break e}}else if(G.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===B&&la(Pe)===G.type){s(te,G.sibling),fe=u(G,ne.props),si(fe,ne),fe.return=te,te=fe;break e}s(te,G);break}else n(te,G);G=G.sibling}ne.type===O?(fe=oa(ne.props.children,te.mode,fe,ne.key),fe.return=te,te=fe):(fe=Hl(ne.type,ne.key,ne.props,null,te.mode,fe),si(fe,ne),fe.return=te,te=fe)}return x(te);case T:e:{for(Pe=ne.key;G!==null;){if(G.key===Pe)if(G.tag===4&&G.stateNode.containerInfo===ne.containerInfo&&G.stateNode.implementation===ne.implementation){s(te,G.sibling),fe=u(G,ne.children||[]),fe.return=te,te=fe;break e}else{s(te,G);break}else n(te,G);G=G.sibling}fe=Kf(ne,te.mode,fe),fe.return=te,te=fe}return x(te);case B:return ne=la(ne),St(te,G,ne,fe)}if(K(ne))return _e(te,G,ne,fe);if(M(ne)){if(Pe=M(ne),typeof Pe!="function")throw Error(r(150));return ne=Pe.call(ne),Be(te,G,ne,fe)}if(typeof ne.then=="function")return St(te,G,Gl(ne),fe);if(ne.$$typeof===k)return St(te,G,Vl(te,ne),fe);Xl(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,G!==null&&G.tag===6?(s(te,G.sibling),fe=u(G,ne),fe.return=te,te=fe):(s(te,G),fe=Xf(ne,te.mode,fe),fe.return=te,te=fe),x(te)):s(te,G)}return function(te,G,ne,fe){try{oi=0;var Pe=St(te,G,ne,fe);return rr=null,Pe}catch(ze){if(ze===ar||ze===Yl)throw ze;var dt=_n(29,ze,null,te.mode);return dt.lanes=fe,dt.return=te,dt}}}var ua=dy(!0),py=dy(!1),vs=!1;function rd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function id(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function xs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ss(e,n,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(ht&2)!==0){var u=i.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),i.pending=n,n=Il(e),Wg(e,null,s),n}return Pl(e,i,n,s),Il(e)}function ai(e,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var i=n.lanes;i&=e.pendingLanes,s|=i,n.lanes=s,Ze(e,s)}}function ld(e,n){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var u=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var x={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?u=f=x:f=f.next=x,s=s.next}while(s!==null);f===null?u=f=n:f=f.next=n}else u=f=n;s={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=n:e.next=n,s.lastBaseUpdate=n}var cd=!1;function ri(){if(cd){var e=sr;if(e!==null)throw e}}function ii(e,n,s,i){cd=!1;var u=e.updateQueue;vs=!1;var f=u.firstBaseUpdate,x=u.lastBaseUpdate,R=u.shared.pending;if(R!==null){u.shared.pending=null;var F=R,oe=F.next;F.next=null,x===null?f=oe:x.next=oe,x=F;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,R=ue.lastBaseUpdate,R!==x&&(R===null?ue.firstBaseUpdate=oe:R.next=oe,ue.lastBaseUpdate=F))}if(f!==null){var de=u.baseState;x=0,ue=oe=F=null,R=f;do{var ae=R.lane&-536870913,ie=ae!==R.lane;if(ie?(st&ae)===ae:(i&ae)===ae){ae!==0&&ae===or&&(cd=!0),ue!==null&&(ue=ue.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var _e=e,Be=R;ae=n;var St=s;switch(Be.tag){case 1:if(_e=Be.payload,typeof _e=="function"){de=_e.call(St,de,ae);break e}de=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Be.payload,ae=typeof _e=="function"?_e.call(St,de,ae):_e,ae==null)break e;de=v({},de,ae);break e;case 2:vs=!0}}ae=R.callback,ae!==null&&(e.flags|=64,ie&&(e.flags|=8192),ie=u.callbacks,ie===null?u.callbacks=[ae]:ie.push(ae))}else ie={lane:ae,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ue===null?(oe=ue=ie,F=de):ue=ue.next=ie,x|=ae;if(R=R.next,R===null){if(R=u.shared.pending,R===null)break;ie=R,R=ie.next,ie.next=null,u.lastBaseUpdate=ie,u.shared.pending=null}}while(!0);ue===null&&(F=de),u.baseState=F,u.firstBaseUpdate=oe,u.lastBaseUpdate=ue,f===null&&(u.shared.lanes=0),Rs|=x,e.lanes=x,e.memoizedState=de}}function hy(e,n){if(typeof e!="function")throw Error(r(191,e));e.call(n)}function my(e,n){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)hy(s[e],n)}var ir=N(null),Kl=N(0);function gy(e,n){e=Fo,J(Kl,e),J(ir,n),Fo=e|n.baseLanes}function ud(){J(Kl,Fo),J(ir,ir.current)}function fd(){Fo=Kl.current,V(ir),V(Kl)}var Dn=N(null),Qn=null;function ws(e){var n=e.alternate;J(qt,qt.current&1),J(Dn,e),Qn===null&&(n===null||ir.current!==null||n.memoizedState!==null)&&(Qn=e)}function dd(e){J(qt,qt.current),J(Dn,e),Qn===null&&(Qn=e)}function yy(e){e.tag===22?(J(qt,qt.current),J(Dn,e),Qn===null&&(Qn=e)):Ts()}function Ts(){J(qt,qt.current),J(Dn,Dn.current)}function zn(e){V(Dn),Qn===e&&(Qn=null),V(qt)}var qt=N(0);function $l(e){for(var n=e;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||bp(s)||vp(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var zo=0,Ke=null,vt=null,Kt=null,Wl=!1,lr=!1,fa=!1,Ql=0,li=0,cr=null,RC=0;function Ht(){throw Error(r(321))}function pd(e,n){if(n===null)return!1;for(var s=0;s<n.length&&s<e.length;s++)if(!jn(e[s],n[s]))return!1;return!0}function hd(e,n,s,i,u,f){return zo=f,Ke=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,P.H=e===null||e.memoizedState===null?eb:Nd,fa=!1,f=s(i,u),fa=!1,lr&&(f=vy(n,s,i,u)),by(e),f}function by(e){P.H=fi;var n=vt!==null&&vt.next!==null;if(zo=0,Kt=vt=Ke=null,Wl=!1,li=0,cr=null,n)throw Error(r(300));e===null||$t||(e=e.dependencies,e!==null&&Bl(e)&&($t=!0))}function vy(e,n,s,i){Ke=e;var u=0;do{if(lr&&(cr=null),li=0,lr=!1,25<=u)throw Error(r(301));if(u+=1,Kt=vt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}P.H=tb,f=n(s,i)}while(lr);return f}function OC(){var e=P.H,n=e.useState()[0];return n=typeof n.then=="function"?ci(n):n,e=e.useState()[0],(vt!==null?vt.memoizedState:null)!==e&&(Ke.flags|=1024),n}function md(){var e=Ql!==0;return Ql=0,e}function gd(e,n,s){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~s}function yd(e){if(Wl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Wl=!1}zo=0,Kt=vt=Ke=null,lr=!1,li=Ql=0,cr=null}function yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?Ke.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function Gt(){if(vt===null){var e=Ke.alternate;e=e!==null?e.memoizedState:null}else e=vt.next;var n=Kt===null?Ke.memoizedState:Kt.next;if(n!==null)Kt=n,vt=e;else{if(e===null)throw Ke.alternate===null?Error(r(467)):Error(r(310));vt=e,e={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Kt===null?Ke.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function Zl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ci(e){var n=li;return li+=1,cr===null&&(cr=[]),e=cy(cr,e,n),n=Ke,(Kt===null?n.memoizedState:Kt.next)===null&&(n=n.alternate,P.H=n===null||n.memoizedState===null?eb:Nd),e}function Jl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ci(e);if(e.$$typeof===k)return un(e)}throw Error(r(438,String(e)))}function bd(e){var n=null,s=Ke.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var i=Ke.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(n={data:i.data.map(function(u){return u.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=Zl(),Ke.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(e),i=0;i<e;i++)s[i]=U;return n.index++,s}function Lo(e,n){return typeof n=="function"?n(e):n}function ec(e){var n=Gt();return vd(n,vt,e)}function vd(e,n,s){var i=e.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=s;var u=e.baseQueue,f=i.pending;if(f!==null){if(u!==null){var x=u.next;u.next=f.next,f.next=x}n.baseQueue=u=f,i.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{n=u.next;var R=x=null,F=null,oe=n,ue=!1;do{var de=oe.lane&-536870913;if(de!==oe.lane?(st&de)===de:(zo&de)===de){var ae=oe.revertLane;if(ae===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),de===or&&(ue=!0);else if((zo&ae)===ae){oe=oe.next,ae===or&&(ue=!0);continue}else de={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},F===null?(R=F=de,x=f):F=F.next=de,Ke.lanes|=ae,Rs|=ae;de=oe.action,fa&&s(f,de),f=oe.hasEagerState?oe.eagerState:s(f,de)}else ae={lane:de,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},F===null?(R=F=ae,x=f):F=F.next=ae,Ke.lanes|=de,Rs|=de;oe=oe.next}while(oe!==null&&oe!==n);if(F===null?x=f:F.next=R,!jn(f,e.memoizedState)&&($t=!0,ue&&(s=sr,s!==null)))throw s;e.memoizedState=f,e.baseState=x,e.baseQueue=F,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function xd(e){var n=Gt(),s=n.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=e;var i=s.dispatch,u=s.pending,f=n.memoizedState;if(u!==null){s.pending=null;var x=u=u.next;do f=e(f,x.action),x=x.next;while(x!==u);jn(f,n.memoizedState)||($t=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),s.lastRenderedState=f}return[f,i]}function xy(e,n,s){var i=Ke,u=Gt(),f=rt;if(f){if(s===void 0)throw Error(r(407));s=s()}else s=n();var x=!jn((vt||u).memoizedState,s);if(x&&(u.memoizedState=s,$t=!0),u=u.queue,Td(Ty.bind(null,i,u,e),[e]),u.getSnapshot!==n||x||Kt!==null&&Kt.memoizedState.tag&1){if(i.flags|=2048,ur(9,{destroy:void 0},wy.bind(null,i,u,s,n),null),Ot===null)throw Error(r(349));f||(zo&127)!==0||Sy(i,n,s)}return s}function Sy(e,n,s){e.flags|=16384,e={getSnapshot:n,value:s},n=Ke.updateQueue,n===null?(n=Zl(),Ke.updateQueue=n,n.stores=[e]):(s=n.stores,s===null?n.stores=[e]:s.push(e))}function wy(e,n,s,i){n.value=s,n.getSnapshot=i,Ey(n)&&Cy(e)}function Ty(e,n,s){return s(function(){Ey(n)&&Cy(e)})}function Ey(e){var n=e.getSnapshot;e=e.value;try{var s=n();return!jn(e,s)}catch{return!0}}function Cy(e){var n=na(e,2);n!==null&&Cn(n,e,2)}function Sd(e){var n=yn();if(typeof e=="function"){var s=e;if(e=s(),fa){Qe(!0);try{s()}finally{Qe(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:e},n}function Ry(e,n,s,i){return e.baseState=s,vd(e,vt,typeof i=="function"?i:Lo)}function AC(e,n,s,i,u){if(oc(e))throw Error(r(485));if(e=n.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){f.listeners.push(x)}};P.T!==null?s(!0):f.isTransition=!1,i(f),s=n.pending,s===null?(f.next=n.pending=f,Oy(n,f)):(f.next=s.next,n.pending=s.next=f)}}function Oy(e,n){var s=n.action,i=n.payload,u=e.state;if(n.isTransition){var f=P.T,x={};P.T=x;try{var R=s(u,i),F=P.S;F!==null&&F(x,R),Ay(e,n,R)}catch(oe){wd(e,n,oe)}finally{f!==null&&x.types!==null&&(f.types=x.types),P.T=f}}else try{f=s(u,i),Ay(e,n,f)}catch(oe){wd(e,n,oe)}}function Ay(e,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){Ny(e,n,i)},function(i){return wd(e,n,i)}):Ny(e,n,s)}function Ny(e,n,s){n.status="fulfilled",n.value=s,ky(n),e.state=s,n=e.pending,n!==null&&(s=n.next,s===n?e.pending=null:(s=s.next,n.next=s,Oy(e,s)))}function wd(e,n,s){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do n.status="rejected",n.reason=s,ky(n),n=n.next;while(n!==i)}e.action=null}function ky(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function My(e,n){return n}function jy(e,n){if(rt){var s=Ot.formState;if(s!==null){e:{var i=Ke;if(rt){if(kt){t:{for(var u=kt,f=Wn;u.nodeType!==8;){if(!f){u=null;break t}if(u=Zn(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){kt=Zn(u.nextSibling),i=u.data==="F!";break e}}ys(i)}i=!1}i&&(n=s[0])}}return s=yn(),s.memoizedState=s.baseState=n,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:My,lastRenderedState:n},s.queue=i,s=Qy.bind(null,Ke,i),i.dispatch=s,i=Sd(!1),f=Ad.bind(null,Ke,!1,i.queue),i=yn(),u={state:n,dispatch:null,action:e,pending:null},i.queue=u,s=AC.bind(null,Ke,u,f,s),u.dispatch=s,i.memoizedState=e,[n,s,!1]}function _y(e){var n=Gt();return Dy(n,vt,e)}function Dy(e,n,s){if(n=vd(e,n,My)[0],e=ec(Lo)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var i=ci(n)}catch(x){throw x===ar?Yl:x}else i=n;n=Gt();var u=n.queue,f=u.dispatch;return s!==n.memoizedState&&(Ke.flags|=2048,ur(9,{destroy:void 0},NC.bind(null,u,s),null)),[i,f,e]}function NC(e,n){e.action=n}function zy(e){var n=Gt(),s=vt;if(s!==null)return Dy(n,s,e);Gt(),n=n.memoizedState,s=Gt();var i=s.queue.dispatch;return s.memoizedState=e,[n,i,!1]}function ur(e,n,s,i){return e={tag:e,create:s,deps:i,inst:n,next:null},n=Ke.updateQueue,n===null&&(n=Zl(),Ke.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,n.lastEffect=e),e}function Ly(){return Gt().memoizedState}function tc(e,n,s,i){var u=yn();Ke.flags|=e,u.memoizedState=ur(1|n,{destroy:void 0},s,i===void 0?null:i)}function nc(e,n,s,i){var u=Gt();i=i===void 0?null:i;var f=u.memoizedState.inst;vt!==null&&i!==null&&pd(i,vt.memoizedState.deps)?u.memoizedState=ur(n,f,s,i):(Ke.flags|=e,u.memoizedState=ur(1|n,f,s,i))}function Py(e,n){tc(8390656,8,e,n)}function Td(e,n){nc(2048,8,e,n)}function kC(e){Ke.flags|=4;var n=Ke.updateQueue;if(n===null)n=Zl(),Ke.updateQueue=n,n.events=[e];else{var s=n.events;s===null?n.events=[e]:s.push(e)}}function Iy(e){var n=Gt().memoizedState;return kC({ref:n,nextImpl:e}),function(){if((ht&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function Hy(e,n){return nc(4,2,e,n)}function Uy(e,n){return nc(4,4,e,n)}function By(e,n){if(typeof n=="function"){e=e();var s=n(e);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Vy(e,n,s){s=s!=null?s.concat([e]):null,nc(4,4,By.bind(null,n,e),s)}function Ed(){}function Fy(e,n){var s=Gt();n=n===void 0?null:n;var i=s.memoizedState;return n!==null&&pd(n,i[1])?i[0]:(s.memoizedState=[e,n],e)}function Yy(e,n){var s=Gt();n=n===void 0?null:n;var i=s.memoizedState;if(n!==null&&pd(n,i[1]))return i[0];if(i=e(),fa){Qe(!0);try{e()}finally{Qe(!1)}}return s.memoizedState=[i,n],i}function Cd(e,n,s){return s===void 0||(zo&1073741824)!==0&&(st&261930)===0?e.memoizedState=n:(e.memoizedState=s,e=qb(),Ke.lanes|=e,Rs|=e,s)}function qy(e,n,s,i){return jn(s,n)?s:ir.current!==null?(e=Cd(e,s,i),jn(e,n)||($t=!0),e):(zo&42)===0||(zo&1073741824)!==0&&(st&261930)===0?($t=!0,e.memoizedState=s):(e=qb(),Ke.lanes|=e,Rs|=e,n)}function Gy(e,n,s,i,u){var f=q.p;q.p=f!==0&&8>f?f:8;var x=P.T,R={};P.T=R,Ad(e,!1,n,s);try{var F=u(),oe=P.S;if(oe!==null&&oe(R,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var ue=CC(F,i);ui(e,n,ue,In(e))}else ui(e,n,i,In(e))}catch(de){ui(e,n,{then:function(){},status:"rejected",reason:de},In())}finally{q.p=f,x!==null&&R.types!==null&&(x.types=R.types),P.T=x}}function MC(){}function Rd(e,n,s,i){if(e.tag!==5)throw Error(r(476));var u=Xy(e).queue;Gy(e,u,n,X,s===null?MC:function(){return Ky(e),s(i)})}function Xy(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:X},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:s},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Ky(e){var n=Xy(e);n.next===null&&(n=e.alternate.memoizedState),ui(e,n.next.queue,{},In())}function Od(){return un(Oi)}function $y(){return Gt().memoizedState}function Wy(){return Gt().memoizedState}function jC(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var s=In();e=xs(s);var i=Ss(n,e,s);i!==null&&(Cn(i,n,s),ai(i,n,s)),n={cache:nd()},e.payload=n;return}n=n.return}}function _C(e,n,s){var i=In();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},oc(e)?Zy(n,s):(s=qf(e,n,s,i),s!==null&&(Cn(s,e,i),Jy(s,n,i)))}function Qy(e,n,s){var i=In();ui(e,n,s,i)}function ui(e,n,s,i){var u={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(oc(e))Zy(n,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var x=n.lastRenderedState,R=f(x,s);if(u.hasEagerState=!0,u.eagerState=R,jn(R,x))return Pl(e,n,u,0),Ot===null&&Ll(),!1}catch{}if(s=qf(e,n,u,i),s!==null)return Cn(s,e,i),Jy(s,n,i),!0}return!1}function Ad(e,n,s,i){if(i={lane:2,revertLane:rp(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},oc(e)){if(n)throw Error(r(479))}else n=qf(e,s,i,2),n!==null&&Cn(n,e,2)}function oc(e){var n=e.alternate;return e===Ke||n!==null&&n===Ke}function Zy(e,n){lr=Wl=!0;var s=e.pending;s===null?n.next=n:(n.next=s.next,s.next=n),e.pending=n}function Jy(e,n,s){if((s&4194048)!==0){var i=n.lanes;i&=e.pendingLanes,s|=i,n.lanes=s,Ze(e,s)}}var fi={readContext:un,use:Jl,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};fi.useEffectEvent=Ht;var eb={readContext:un,use:Jl,useCallback:function(e,n){return yn().memoizedState=[e,n===void 0?null:n],e},useContext:un,useEffect:Py,useImperativeHandle:function(e,n,s){s=s!=null?s.concat([e]):null,tc(4194308,4,By.bind(null,n,e),s)},useLayoutEffect:function(e,n){return tc(4194308,4,e,n)},useInsertionEffect:function(e,n){tc(4,2,e,n)},useMemo:function(e,n){var s=yn();n=n===void 0?null:n;var i=e();if(fa){Qe(!0);try{e()}finally{Qe(!1)}}return s.memoizedState=[i,n],i},useReducer:function(e,n,s){var i=yn();if(s!==void 0){var u=s(n);if(fa){Qe(!0);try{s(n)}finally{Qe(!1)}}}else u=n;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=_C.bind(null,Ke,e),[i.memoizedState,e]},useRef:function(e){var n=yn();return e={current:e},n.memoizedState=e},useState:function(e){e=Sd(e);var n=e.queue,s=Qy.bind(null,Ke,n);return n.dispatch=s,[e.memoizedState,s]},useDebugValue:Ed,useDeferredValue:function(e,n){var s=yn();return Cd(s,e,n)},useTransition:function(){var e=Sd(!1);return e=Gy.bind(null,Ke,e.queue,!0,!1),yn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,s){var i=Ke,u=yn();if(rt){if(s===void 0)throw Error(r(407));s=s()}else{if(s=n(),Ot===null)throw Error(r(349));(st&127)!==0||Sy(i,n,s)}u.memoizedState=s;var f={value:s,getSnapshot:n};return u.queue=f,Py(Ty.bind(null,i,f,e),[e]),i.flags|=2048,ur(9,{destroy:void 0},wy.bind(null,i,f,s,n),null),s},useId:function(){var e=yn(),n=Ot.identifierPrefix;if(rt){var s=xo,i=vo;s=(i&~(1<<32-ct(i)-1)).toString(32)+s,n="_"+n+"R_"+s,s=Ql++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=RC++,n="_"+n+"r_"+s.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Od,useFormState:jy,useActionState:jy,useOptimistic:function(e){var n=yn();n.memoizedState=n.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=Ad.bind(null,Ke,!0,s),s.dispatch=n,[e,n]},useMemoCache:bd,useCacheRefresh:function(){return yn().memoizedState=jC.bind(null,Ke)},useEffectEvent:function(e){var n=yn(),s={impl:e};return n.memoizedState=s,function(){if((ht&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},Nd={readContext:un,use:Jl,useCallback:Fy,useContext:un,useEffect:Td,useImperativeHandle:Vy,useInsertionEffect:Hy,useLayoutEffect:Uy,useMemo:Yy,useReducer:ec,useRef:Ly,useState:function(){return ec(Lo)},useDebugValue:Ed,useDeferredValue:function(e,n){var s=Gt();return qy(s,vt.memoizedState,e,n)},useTransition:function(){var e=ec(Lo)[0],n=Gt().memoizedState;return[typeof e=="boolean"?e:ci(e),n]},useSyncExternalStore:xy,useId:$y,useHostTransitionStatus:Od,useFormState:_y,useActionState:_y,useOptimistic:function(e,n){var s=Gt();return Ry(s,vt,e,n)},useMemoCache:bd,useCacheRefresh:Wy};Nd.useEffectEvent=Iy;var tb={readContext:un,use:Jl,useCallback:Fy,useContext:un,useEffect:Td,useImperativeHandle:Vy,useInsertionEffect:Hy,useLayoutEffect:Uy,useMemo:Yy,useReducer:xd,useRef:Ly,useState:function(){return xd(Lo)},useDebugValue:Ed,useDeferredValue:function(e,n){var s=Gt();return vt===null?Cd(s,e,n):qy(s,vt.memoizedState,e,n)},useTransition:function(){var e=xd(Lo)[0],n=Gt().memoizedState;return[typeof e=="boolean"?e:ci(e),n]},useSyncExternalStore:xy,useId:$y,useHostTransitionStatus:Od,useFormState:zy,useActionState:zy,useOptimistic:function(e,n){var s=Gt();return vt!==null?Ry(s,vt,e,n):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:bd,useCacheRefresh:Wy};tb.useEffectEvent=Iy;function kd(e,n,s,i){n=e.memoizedState,s=s(i,n),s=s==null?n:v({},n,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Md={enqueueSetState:function(e,n,s){e=e._reactInternals;var i=In(),u=xs(i);u.payload=n,s!=null&&(u.callback=s),n=Ss(e,u,i),n!==null&&(Cn(n,e,i),ai(n,e,i))},enqueueReplaceState:function(e,n,s){e=e._reactInternals;var i=In(),u=xs(i);u.tag=1,u.payload=n,s!=null&&(u.callback=s),n=Ss(e,u,i),n!==null&&(Cn(n,e,i),ai(n,e,i))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var s=In(),i=xs(s);i.tag=2,n!=null&&(i.callback=n),n=Ss(e,i,s),n!==null&&(Cn(n,e,s),ai(n,e,s))}};function nb(e,n,s,i,u,f,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,x):n.prototype&&n.prototype.isPureReactComponent?!Qr(s,i)||!Qr(u,f):!0}function ob(e,n,s,i){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,i),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,i),n.state!==e&&Md.enqueueReplaceState(n,n.state,null)}function da(e,n){var s=n;if("ref"in n){s={};for(var i in n)i!=="ref"&&(s[i]=n[i])}if(e=e.defaultProps){s===n&&(s=v({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function sb(e){zl(e)}function ab(e){console.error(e)}function rb(e){zl(e)}function sc(e,n){try{var s=e.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(i){setTimeout(function(){throw i})}}function ib(e,n,s){try{var i=e.onCaughtError;i(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function jd(e,n,s){return s=xs(s),s.tag=3,s.payload={element:null},s.callback=function(){sc(e,n)},s}function lb(e){return e=xs(e),e.tag=3,e}function cb(e,n,s,i){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){ib(n,s,i)}}var x=s.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){ib(n,s,i),typeof u!="function"&&(Os===null?Os=new Set([this]):Os.add(this));var R=i.stack;this.componentDidCatch(i.value,{componentStack:R!==null?R:""})})}function DC(e,n,s,i,u){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(n=s.alternate,n!==null&&nr(n,s,u,!0),s=Dn.current,s!==null){switch(s.tag){case 31:case 13:return Qn===null?gc():s.alternate===null&&Ut===0&&(Ut=3),s.flags&=-257,s.flags|=65536,s.lanes=u,i===ql?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([i]):n.add(i),op(e,i,u)),!1;case 22:return s.flags|=65536,i===ql?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([i])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([i]):s.add(i)),op(e,i,u)),!1}throw Error(r(435,s.tag))}return op(e,i,u),gc(),!1}if(rt)return n=Dn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=u,i!==Qf&&(e=Error(r(422),{cause:i}),ei(Xn(e,s)))):(i!==Qf&&(n=Error(r(423),{cause:i}),ei(Xn(n,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Xn(i,s),u=jd(e.stateNode,i,u),ld(e,u),Ut!==4&&(Ut=2)),!1;var f=Error(r(520),{cause:i});if(f=Xn(f,s),vi===null?vi=[f]:vi.push(f),Ut!==4&&(Ut=2),n===null)return!0;i=Xn(i,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=jd(s.stateNode,i,e),ld(s,e),!1;case 1:if(n=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Os===null||!Os.has(f))))return s.flags|=65536,u&=-u,s.lanes|=u,u=lb(u),cb(u,e,s,i),ld(s,u),!1}s=s.return}while(s!==null);return!1}var _d=Error(r(461)),$t=!1;function fn(e,n,s,i){n.child=e===null?py(n,null,s,i):ua(n,e.child,s,i)}function ub(e,n,s,i,u){s=s.render;var f=n.ref;if("ref"in i){var x={};for(var R in i)R!=="ref"&&(x[R]=i[R])}else x=i;return ra(n),i=hd(e,n,s,x,f,u),R=md(),e!==null&&!$t?(gd(e,n,u),Po(e,n,u)):(rt&&R&&$f(n),n.flags|=1,fn(e,n,i,u),n.child)}function fb(e,n,s,i,u){if(e===null){var f=s.type;return typeof f=="function"&&!Gf(f)&&f.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=f,db(e,n,f,i,u)):(e=Hl(s.type,null,i,n,n.mode,u),e.ref=n.ref,e.return=n,n.child=e)}if(f=e.child,!Bd(e,u)){var x=f.memoizedProps;if(s=s.compare,s=s!==null?s:Qr,s(x,i)&&e.ref===n.ref)return Po(e,n,u)}return n.flags|=1,e=Mo(f,i),e.ref=n.ref,e.return=n,n.child=e}function db(e,n,s,i,u){if(e!==null){var f=e.memoizedProps;if(Qr(f,i)&&e.ref===n.ref)if($t=!1,n.pendingProps=i=f,Bd(e,u))(e.flags&131072)!==0&&($t=!0);else return n.lanes=e.lanes,Po(e,n,u)}return Dd(e,n,s,i,u)}function pb(e,n,s,i){var u=i.children,f=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((n.flags&128)!==0){if(f=f!==null?f.baseLanes|s:s,e!==null){for(i=n.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~f}else i=0,n.child=null;return hb(e,n,f,s,i)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fl(n,f!==null?f.cachePool:null),f!==null?gy(n,f):ud(),yy(n);else return i=n.lanes=536870912,hb(e,n,f!==null?f.baseLanes|s:s,s,i)}else f!==null?(Fl(n,f.cachePool),gy(n,f),Ts(),n.memoizedState=null):(e!==null&&Fl(n,null),ud(),Ts());return fn(e,n,u,s),n.child}function di(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function hb(e,n,s,i,u){var f=sd();return f=f===null?null:{parent:Xt._currentValue,pool:f},n.memoizedState={baseLanes:s,cachePool:f},e!==null&&Fl(n,null),ud(),yy(n),e!==null&&nr(e,n,i,!0),n.childLanes=u,null}function ac(e,n){return n=ic({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function mb(e,n,s){return ua(n,e.child,null,s),e=ac(n,n.pendingProps),e.flags|=2,zn(n),n.memoizedState=null,e}function zC(e,n,s){var i=n.pendingProps,u=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(rt){if(i.mode==="hidden")return e=ac(n,i),n.lanes=536870912,di(null,e);if(dd(n),(e=kt)?(e=Ov(e,Wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ms!==null?{id:vo,overflow:xo}:null,retryLane:536870912,hydrationErrors:null},s=Zg(e),s.return=n,n.child=s,cn=n,kt=null)):e=null,e===null)throw ys(n);return n.lanes=536870912,null}return ac(n,i)}var f=e.memoizedState;if(f!==null){var x=f.dehydrated;if(dd(n),u)if(n.flags&256)n.flags&=-257,n=mb(e,n,s);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(r(558));else if($t||nr(e,n,s,!1),u=(s&e.childLanes)!==0,$t||u){if(i=Ot,i!==null&&(x=Rt(i,s),x!==0&&x!==f.retryLane))throw f.retryLane=x,na(e,x),Cn(i,e,x),_d;gc(),n=mb(e,n,s)}else e=f.treeContext,kt=Zn(x.nextSibling),cn=n,rt=!0,gs=null,Wn=!1,e!==null&&ty(n,e),n=ac(n,i),n.flags|=4096;return n}return e=Mo(e.child,{mode:i.mode,children:i.children}),e.ref=n.ref,n.child=e,e.return=n,e}function rc(e,n){var s=n.ref;if(s===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(r(284));(e===null||e.ref!==s)&&(n.flags|=4194816)}}function Dd(e,n,s,i,u){return ra(n),s=hd(e,n,s,i,void 0,u),i=md(),e!==null&&!$t?(gd(e,n,u),Po(e,n,u)):(rt&&i&&$f(n),n.flags|=1,fn(e,n,s,u),n.child)}function gb(e,n,s,i,u,f){return ra(n),n.updateQueue=null,s=vy(n,i,s,u),by(e),i=md(),e!==null&&!$t?(gd(e,n,f),Po(e,n,f)):(rt&&i&&$f(n),n.flags|=1,fn(e,n,s,f),n.child)}function yb(e,n,s,i,u){if(ra(n),n.stateNode===null){var f=Za,x=s.contextType;typeof x=="object"&&x!==null&&(f=un(x)),f=new s(i,f),n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Md,n.stateNode=f,f._reactInternals=n,f=n.stateNode,f.props=i,f.state=n.memoizedState,f.refs={},rd(n),x=s.contextType,f.context=typeof x=="object"&&x!==null?un(x):Za,f.state=n.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&(kd(n,s,x,i),f.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(x=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),x!==f.state&&Md.enqueueReplaceState(f,f.state,null),ii(n,i,f,u),ri(),f.state=n.memoizedState),typeof f.componentDidMount=="function"&&(n.flags|=4194308),i=!0}else if(e===null){f=n.stateNode;var R=n.memoizedProps,F=da(s,R);f.props=F;var oe=f.context,ue=s.contextType;x=Za,typeof ue=="object"&&ue!==null&&(x=un(ue));var de=s.getDerivedStateFromProps;ue=typeof de=="function"||typeof f.getSnapshotBeforeUpdate=="function",R=n.pendingProps!==R,ue||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(R||oe!==x)&&ob(n,f,i,x),vs=!1;var ae=n.memoizedState;f.state=ae,ii(n,i,f,u),ri(),oe=n.memoizedState,R||ae!==oe||vs?(typeof de=="function"&&(kd(n,s,de,i),oe=n.memoizedState),(F=vs||nb(n,s,F,i,ae,oe,x))?(ue||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(n.flags|=4194308)):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=i,n.memoizedState=oe),f.props=i,f.state=oe,f.context=x,i=F):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),i=!1)}else{f=n.stateNode,id(e,n),x=n.memoizedProps,ue=da(s,x),f.props=ue,de=n.pendingProps,ae=f.context,oe=s.contextType,F=Za,typeof oe=="object"&&oe!==null&&(F=un(oe)),R=s.getDerivedStateFromProps,(oe=typeof R=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==de||ae!==F)&&ob(n,f,i,F),vs=!1,ae=n.memoizedState,f.state=ae,ii(n,i,f,u),ri();var ie=n.memoizedState;x!==de||ae!==ie||vs||e!==null&&e.dependencies!==null&&Bl(e.dependencies)?(typeof R=="function"&&(kd(n,s,R,i),ie=n.memoizedState),(ue=vs||nb(n,s,ue,i,ae,ie,F)||e!==null&&e.dependencies!==null&&Bl(e.dependencies))?(oe||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,ie,F),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,ie,F)),typeof f.componentDidUpdate=="function"&&(n.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&ae===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&ae===e.memoizedState||(n.flags|=1024),n.memoizedProps=i,n.memoizedState=ie),f.props=i,f.state=ie,f.context=F,i=ue):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&ae===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&ae===e.memoizedState||(n.flags|=1024),i=!1)}return f=i,rc(e,n),i=(n.flags&128)!==0,f||i?(f=n.stateNode,s=i&&typeof s.getDerivedStateFromError!="function"?null:f.render(),n.flags|=1,e!==null&&i?(n.child=ua(n,e.child,null,u),n.child=ua(n,null,s,u)):fn(e,n,s,u),n.memoizedState=f.state,e=n.child):e=Po(e,n,u),e}function bb(e,n,s,i){return sa(),n.flags|=256,fn(e,n,s,i),n.child}var zd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ld(e){return{baseLanes:e,cachePool:iy()}}function Pd(e,n,s){return e=e!==null?e.childLanes&~s:0,n&&(e|=Pn),e}function vb(e,n,s){var i=n.pendingProps,u=!1,f=(n.flags&128)!==0,x;if((x=f)||(x=e!==null&&e.memoizedState===null?!1:(qt.current&2)!==0),x&&(u=!0,n.flags&=-129),x=(n.flags&32)!==0,n.flags&=-33,e===null){if(rt){if(u?ws(n):Ts(),(e=kt)?(e=Ov(e,Wn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ms!==null?{id:vo,overflow:xo}:null,retryLane:536870912,hydrationErrors:null},s=Zg(e),s.return=n,n.child=s,cn=n,kt=null)):e=null,e===null)throw ys(n);return vp(e)?n.lanes=32:n.lanes=536870912,null}var R=i.children;return i=i.fallback,u?(Ts(),u=n.mode,R=ic({mode:"hidden",children:R},u),i=oa(i,u,s,null),R.return=n,i.return=n,R.sibling=i,n.child=R,i=n.child,i.memoizedState=Ld(s),i.childLanes=Pd(e,x,s),n.memoizedState=zd,di(null,i)):(ws(n),Id(n,R))}var F=e.memoizedState;if(F!==null&&(R=F.dehydrated,R!==null)){if(f)n.flags&256?(ws(n),n.flags&=-257,n=Hd(e,n,s)):n.memoizedState!==null?(Ts(),n.child=e.child,n.flags|=128,n=null):(Ts(),R=i.fallback,u=n.mode,i=ic({mode:"visible",children:i.children},u),R=oa(R,u,s,null),R.flags|=2,i.return=n,R.return=n,i.sibling=R,n.child=i,ua(n,e.child,null,s),i=n.child,i.memoizedState=Ld(s),i.childLanes=Pd(e,x,s),n.memoizedState=zd,n=di(null,i));else if(ws(n),vp(R)){if(x=R.nextSibling&&R.nextSibling.dataset,x)var oe=x.dgst;x=oe,i=Error(r(419)),i.stack="",i.digest=x,ei({value:i,source:null,stack:null}),n=Hd(e,n,s)}else if($t||nr(e,n,s,!1),x=(s&e.childLanes)!==0,$t||x){if(x=Ot,x!==null&&(i=Rt(x,s),i!==0&&i!==F.retryLane))throw F.retryLane=i,na(e,i),Cn(x,e,i),_d;bp(R)||gc(),n=Hd(e,n,s)}else bp(R)?(n.flags|=192,n.child=e.child,n=null):(e=F.treeContext,kt=Zn(R.nextSibling),cn=n,rt=!0,gs=null,Wn=!1,e!==null&&ty(n,e),n=Id(n,i.children),n.flags|=4096);return n}return u?(Ts(),R=i.fallback,u=n.mode,F=e.child,oe=F.sibling,i=Mo(F,{mode:"hidden",children:i.children}),i.subtreeFlags=F.subtreeFlags&65011712,oe!==null?R=Mo(oe,R):(R=oa(R,u,s,null),R.flags|=2),R.return=n,i.return=n,i.sibling=R,n.child=i,di(null,i),i=n.child,R=e.child.memoizedState,R===null?R=Ld(s):(u=R.cachePool,u!==null?(F=Xt._currentValue,u=u.parent!==F?{parent:F,pool:F}:u):u=iy(),R={baseLanes:R.baseLanes|s,cachePool:u}),i.memoizedState=R,i.childLanes=Pd(e,x,s),n.memoizedState=zd,di(e.child,i)):(ws(n),s=e.child,e=s.sibling,s=Mo(s,{mode:"visible",children:i.children}),s.return=n,s.sibling=null,e!==null&&(x=n.deletions,x===null?(n.deletions=[e],n.flags|=16):x.push(e)),n.child=s,n.memoizedState=null,s)}function Id(e,n){return n=ic({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function ic(e,n){return e=_n(22,e,null,n),e.lanes=0,e}function Hd(e,n,s){return ua(n,e.child,null,s),e=Id(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function xb(e,n,s){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n),ed(e.return,n,s)}function Ud(e,n,s,i,u,f){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:u,treeForkCount:f}:(x.isBackwards=n,x.rendering=null,x.renderingStartTime=0,x.last=i,x.tail=s,x.tailMode=u,x.treeForkCount=f)}function Sb(e,n,s){var i=n.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var x=qt.current,R=(x&2)!==0;if(R?(x=x&1|2,n.flags|=128):x&=1,J(qt,x),fn(e,n,i,s),i=rt?Jr:0,!R&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xb(e,s,n);else if(e.tag===19)xb(e,s,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(s=n.child,u=null;s!==null;)e=s.alternate,e!==null&&$l(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=n.child,n.child=null):(u=s.sibling,s.sibling=null),Ud(n,!1,u,s,f,i);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=n.child,n.child=null;u!==null;){if(e=u.alternate,e!==null&&$l(e)===null){n.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Ud(n,!0,s,null,f,i);break;case"together":Ud(n,!1,null,null,void 0,i);break;default:n.memoizedState=null}return n.child}function Po(e,n,s){if(e!==null&&(n.dependencies=e.dependencies),Rs|=n.lanes,(s&n.childLanes)===0)if(e!==null){if(nr(e,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(r(153));if(n.child!==null){for(e=n.child,s=Mo(e,e.pendingProps),n.child=s,s.return=n;e.sibling!==null;)e=e.sibling,s=s.sibling=Mo(e,e.pendingProps),s.return=n;s.sibling=null}return n.child}function Bd(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Bl(e)))}function LC(e,n,s){switch(n.tag){case 3:pe(n,n.stateNode.containerInfo),bs(n,Xt,e.memoizedState.cache),sa();break;case 27:case 5:Ce(n);break;case 4:pe(n,n.stateNode.containerInfo);break;case 10:bs(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,dd(n),null;break;case 13:var i=n.memoizedState;if(i!==null)return i.dehydrated!==null?(ws(n),n.flags|=128,null):(s&n.child.childLanes)!==0?vb(e,n,s):(ws(n),e=Po(e,n,s),e!==null?e.sibling:null);ws(n);break;case 19:var u=(e.flags&128)!==0;if(i=(s&n.childLanes)!==0,i||(nr(e,n,s,!1),i=(s&n.childLanes)!==0),u){if(i)return Sb(e,n,s);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),J(qt,qt.current),i)break;return null;case 22:return n.lanes=0,pb(e,n,s,n.pendingProps);case 24:bs(n,Xt,e.memoizedState.cache)}return Po(e,n,s)}function wb(e,n,s){if(e!==null)if(e.memoizedProps!==n.pendingProps)$t=!0;else{if(!Bd(e,s)&&(n.flags&128)===0)return $t=!1,LC(e,n,s);$t=(e.flags&131072)!==0}else $t=!1,rt&&(n.flags&1048576)!==0&&ey(n,Jr,n.index);switch(n.lanes=0,n.tag){case 16:e:{var i=n.pendingProps;if(e=la(n.elementType),n.type=e,typeof e=="function")Gf(e)?(i=da(e,i),n.tag=1,n=yb(null,n,e,i,s)):(n.tag=0,n=Dd(null,n,e,i,s));else{if(e!=null){var u=e.$$typeof;if(u===j){n.tag=11,n=ub(null,n,e,i,s);break e}else if(u===L){n.tag=14,n=fb(null,n,e,i,s);break e}}throw n=ee(e)||e,Error(r(306,n,""))}}return n;case 0:return Dd(e,n,n.type,n.pendingProps,s);case 1:return i=n.type,u=da(i,n.pendingProps),yb(e,n,i,u,s);case 3:e:{if(pe(n,n.stateNode.containerInfo),e===null)throw Error(r(387));i=n.pendingProps;var f=n.memoizedState;u=f.element,id(e,n),ii(n,i,null,s);var x=n.memoizedState;if(i=x.cache,bs(n,Xt,i),i!==f.cache&&td(n,[Xt],s,!0),ri(),i=x.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:x.cache},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){n=bb(e,n,i,s);break e}else if(i!==u){u=Xn(Error(r(424)),n),ei(u),n=bb(e,n,i,s);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,kt=Zn(e.firstChild),cn=n,rt=!0,gs=null,Wn=!0,s=py(n,null,i,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(sa(),i===u){n=Po(e,n,s);break e}fn(e,n,i,s)}n=n.child}return n;case 26:return rc(e,n),e===null?(s=_v(n.type,null,n.pendingProps,null))?n.memoizedState=s:rt||(s=n.type,e=n.pendingProps,i=Tc(re.current).createElement(s),i[Yt]=n,i[mn]=e,dn(i,s,e),on(i),n.stateNode=i):n.memoizedState=_v(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Ce(n),e===null&&rt&&(i=n.stateNode=kv(n.type,n.pendingProps,re.current),cn=n,Wn=!0,u=kt,Ms(n.type)?(xp=u,kt=Zn(i.firstChild)):kt=u),fn(e,n,n.pendingProps.children,s),rc(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&rt&&((u=i=kt)&&(i=dR(i,n.type,n.pendingProps,Wn),i!==null?(n.stateNode=i,cn=n,kt=Zn(i.firstChild),Wn=!1,u=!0):u=!1),u||ys(n)),Ce(n),u=n.type,f=n.pendingProps,x=e!==null?e.memoizedProps:null,i=f.children,mp(u,f)?i=null:x!==null&&mp(u,x)&&(n.flags|=32),n.memoizedState!==null&&(u=hd(e,n,OC,null,null,s),Oi._currentValue=u),rc(e,n),fn(e,n,i,s),n.child;case 6:return e===null&&rt&&((e=s=kt)&&(s=pR(s,n.pendingProps,Wn),s!==null?(n.stateNode=s,cn=n,kt=null,e=!0):e=!1),e||ys(n)),null;case 13:return vb(e,n,s);case 4:return pe(n,n.stateNode.containerInfo),i=n.pendingProps,e===null?n.child=ua(n,null,i,s):fn(e,n,i,s),n.child;case 11:return ub(e,n,n.type,n.pendingProps,s);case 7:return fn(e,n,n.pendingProps,s),n.child;case 8:return fn(e,n,n.pendingProps.children,s),n.child;case 12:return fn(e,n,n.pendingProps.children,s),n.child;case 10:return i=n.pendingProps,bs(n,n.type,i.value),fn(e,n,i.children,s),n.child;case 9:return u=n.type._context,i=n.pendingProps.children,ra(n),u=un(u),i=i(u),n.flags|=1,fn(e,n,i,s),n.child;case 14:return fb(e,n,n.type,n.pendingProps,s);case 15:return db(e,n,n.type,n.pendingProps,s);case 19:return Sb(e,n,s);case 31:return zC(e,n,s);case 22:return pb(e,n,s,n.pendingProps);case 24:return ra(n),i=un(Xt),e===null?(u=sd(),u===null&&(u=Ot,f=nd(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=s),u=f),n.memoizedState={parent:i,cache:u},rd(n),bs(n,Xt,u)):((e.lanes&s)!==0&&(id(e,n),ii(n,null,null,s),ri()),u=e.memoizedState,f=n.memoizedState,u.parent!==i?(u={parent:i,cache:i},n.memoizedState=u,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=u),bs(n,Xt,i)):(i=f.cache,bs(n,Xt,i),i!==u.cache&&td(n,[Xt],s,!0))),fn(e,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function Io(e){e.flags|=4}function Vd(e,n,s,i,u){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if($b())e.flags|=8192;else throw ca=ql,ad}else e.flags&=-16777217}function Tb(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Iv(n))if($b())e.flags|=8192;else throw ca=ql,ad}function lc(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?ln():536870912,e.lanes|=n,hr|=n)}function pi(e,n){if(!rt)switch(e.tailMode){case"hidden":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Mt(e){var n=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(n)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags&65011712,i|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=s,n}function PC(e,n,s){var i=n.pendingProps;switch(Wf(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(n),null;case 1:return Mt(n),null;case 3:return s=n.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),Do(Xt),be(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(tr(n)?Io(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Zf())),Mt(n),null;case 26:var u=n.type,f=n.memoizedState;return e===null?(Io(n),f!==null?(Mt(n),Tb(n,f)):(Mt(n),Vd(n,u,null,i,s))):f?f!==e.memoizedState?(Io(n),Mt(n),Tb(n,f)):(Mt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==i&&Io(n),Mt(n),Vd(n,u,e,i,s)),null;case 27:if(Me(n),s=re.current,u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==i&&Io(n);else{if(!i){if(n.stateNode===null)throw Error(r(166));return Mt(n),null}e=$.current,tr(n)?ny(n):(e=kv(u,i,s),n.stateNode=e,Io(n))}return Mt(n),null;case 5:if(Me(n),u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==i&&Io(n);else{if(!i){if(n.stateNode===null)throw Error(r(166));return Mt(n),null}if(f=$.current,tr(n))ny(n);else{var x=Tc(re.current);switch(f){case 1:f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=x.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?x.createElement("select",{is:i.is}):x.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?x.createElement(u,{is:i.is}):x.createElement(u)}}f[Yt]=n,f[mn]=i;e:for(x=n.child;x!==null;){if(x.tag===5||x.tag===6)f.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===n)break e;for(;x.sibling===null;){if(x.return===null||x.return===n)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}n.stateNode=f;e:switch(dn(f,u,i),u){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Io(n)}}return Mt(n),Vd(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,s),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==i&&Io(n);else{if(typeof i!="string"&&n.stateNode===null)throw Error(r(166));if(e=re.current,tr(n)){if(e=n.stateNode,s=n.memoizedProps,i=null,u=cn,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[Yt]=n,e=!!(e.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||vv(e.nodeValue,s)),e||ys(n,!0)}else e=Tc(e).createTextNode(i),e[Yt]=n,n.stateNode=e}return Mt(n),null;case 31:if(s=n.memoizedState,e===null||e.memoizedState!==null){if(i=tr(n),s!==null){if(e===null){if(!i)throw Error(r(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Yt]=n}else sa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Mt(n),e=!1}else s=Zf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return n.flags&256?(zn(n),n):(zn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return Mt(n),null;case 13:if(i=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=tr(n),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(r(318));if(u=n.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));u[Yt]=n}else sa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Mt(n),u=!1}else u=Zf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return n.flags&256?(zn(n),n):(zn(n),null)}return zn(n),(n.flags&128)!==0?(n.lanes=s,n):(s=i!==null,e=e!==null&&e.memoizedState!==null,s&&(i=n.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048)),s!==e&&s&&(n.child.flags|=8192),lc(n,n.updateQueue),Mt(n),null);case 4:return be(),e===null&&up(n.stateNode.containerInfo),Mt(n),null;case 10:return Do(n.type),Mt(n),null;case 19:if(V(qt),i=n.memoizedState,i===null)return Mt(n),null;if(u=(n.flags&128)!==0,f=i.rendering,f===null)if(u)pi(i,!1);else{if(Ut!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(f=$l(e),f!==null){for(n.flags|=128,pi(i,!1),e=f.updateQueue,n.updateQueue=e,lc(n,e),n.subtreeFlags=0,e=s,s=n.child;s!==null;)Qg(s,e),s=s.sibling;return J(qt,qt.current&1|2),rt&&jo(n,i.treeForkCount),n.child}e=e.sibling}i.tail!==null&&le()>pc&&(n.flags|=128,u=!0,pi(i,!1),n.lanes=4194304)}else{if(!u)if(e=$l(f),e!==null){if(n.flags|=128,u=!0,e=e.updateQueue,n.updateQueue=e,lc(n,e),pi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!rt)return Mt(n),null}else 2*le()-i.renderingStartTime>pc&&s!==536870912&&(n.flags|=128,u=!0,pi(i,!1),n.lanes=4194304);i.isBackwards?(f.sibling=n.child,n.child=f):(e=i.last,e!==null?e.sibling=f:n.child=f,i.last=f)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=le(),e.sibling=null,s=qt.current,J(qt,u?s&1|2:s&1),rt&&jo(n,i.treeForkCount),e):(Mt(n),null);case 22:case 23:return zn(n),fd(),i=n.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(n.flags|=8192):i&&(n.flags|=8192),i?(s&536870912)!==0&&(n.flags&128)===0&&(Mt(n),n.subtreeFlags&6&&(n.flags|=8192)):Mt(n),s=n.updateQueue,s!==null&&lc(n,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==s&&(n.flags|=2048),e!==null&&V(ia),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Do(Xt),Mt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function IC(e,n){switch(Wf(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Do(Xt),be(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Me(n),null;case 31:if(n.memoizedState!==null){if(zn(n),n.alternate===null)throw Error(r(340));sa()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(zn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));sa()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return V(qt),null;case 4:return be(),null;case 10:return Do(n.type),null;case 22:case 23:return zn(n),fd(),e!==null&&V(ia),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Do(Xt),null;case 25:return null;default:return null}}function Eb(e,n){switch(Wf(n),n.tag){case 3:Do(Xt),be();break;case 26:case 27:case 5:Me(n);break;case 4:be();break;case 31:n.memoizedState!==null&&zn(n);break;case 13:zn(n);break;case 19:V(qt);break;case 10:Do(n.type);break;case 22:case 23:zn(n),fd(),e!==null&&V(ia);break;case 24:Do(Xt)}}function hi(e,n){try{var s=n.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var u=i.next;s=u;do{if((s.tag&e)===e){i=void 0;var f=s.create,x=s.inst;i=f(),x.destroy=i}s=s.next}while(s!==u)}}catch(R){gt(n,n.return,R)}}function Es(e,n,s){try{var i=n.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var f=u.next;i=f;do{if((i.tag&e)===e){var x=i.inst,R=x.destroy;if(R!==void 0){x.destroy=void 0,u=n;var F=s,oe=R;try{oe()}catch(ue){gt(u,F,ue)}}}i=i.next}while(i!==f)}}catch(ue){gt(n,n.return,ue)}}function Cb(e){var n=e.updateQueue;if(n!==null){var s=e.stateNode;try{my(n,s)}catch(i){gt(e,e.return,i)}}}function Rb(e,n,s){s.props=da(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(i){gt(e,n,i)}}function mi(e,n){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof s=="function"?e.refCleanup=s(i):s.current=i}}catch(u){gt(e,n,u)}}function So(e,n){var s=e.ref,i=e.refCleanup;if(s!==null)if(typeof i=="function")try{i()}catch(u){gt(e,n,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){gt(e,n,u)}else s.current=null}function Ob(e){var n=e.type,s=e.memoizedProps,i=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&i.focus();break e;case"img":s.src?i.src=s.src:s.srcSet&&(i.srcset=s.srcSet)}}catch(u){gt(e,e.return,u)}}function Fd(e,n,s){try{var i=e.stateNode;rR(i,e.type,s,n),i[mn]=n}catch(u){gt(e,e.return,u)}}function Ab(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ms(e.type)||e.tag===4}function Yd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ab(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&&Ms(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 qd(e,n,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(e),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=No));else if(i!==4&&(i===27&&Ms(e.type)&&(s=e.stateNode,n=null),e=e.child,e!==null))for(qd(e,n,s),e=e.sibling;e!==null;)qd(e,n,s),e=e.sibling}function cc(e,n,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?s.insertBefore(e,n):s.appendChild(e);else if(i!==4&&(i===27&&Ms(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(cc(e,n,s),e=e.sibling;e!==null;)cc(e,n,s),e=e.sibling}function Nb(e){var n=e.stateNode,s=e.memoizedProps;try{for(var i=e.type,u=n.attributes;u.length;)n.removeAttributeNode(u[0]);dn(n,i,s),n[Yt]=e,n[mn]=s}catch(f){gt(e,e.return,f)}}var Ho=!1,Wt=!1,Gd=!1,kb=typeof WeakSet=="function"?WeakSet:Set,sn=null;function HC(e,n){if(e=e.containerInfo,pp=kc,e=Vg(e),Hf(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var u=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break e}var x=0,R=-1,F=-1,oe=0,ue=0,de=e,ae=null;t:for(;;){for(var ie;de!==s||u!==0&&de.nodeType!==3||(R=x+u),de!==f||i!==0&&de.nodeType!==3||(F=x+i),de.nodeType===3&&(x+=de.nodeValue.length),(ie=de.firstChild)!==null;)ae=de,de=ie;for(;;){if(de===e)break t;if(ae===s&&++oe===u&&(R=x),ae===f&&++ue===i&&(F=x),(ie=de.nextSibling)!==null)break;de=ae,ae=de.parentNode}de=ie}s=R===-1||F===-1?null:{start:R,end:F}}else s=null}s=s||{start:0,end:0}}else s=null;for(hp={focusedElem:e,selectionRange:s},kc=!1,sn=n;sn!==null;)if(n=sn,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,sn=e;else for(;sn!==null;){switch(n=sn,f=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)u=e[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,s=n,u=f.memoizedProps,f=f.memoizedState,i=s.stateNode;try{var _e=da(s.type,u);e=i.getSnapshotBeforeUpdate(_e,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(Be){gt(s,s.return,Be)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,s=e.nodeType,s===9)yp(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":yp(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=n.sibling,e!==null){e.return=n.return,sn=e;break}sn=n.return}}function Mb(e,n,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:Bo(e,s),i&4&&hi(5,s);break;case 1:if(Bo(e,s),i&4)if(e=s.stateNode,n===null)try{e.componentDidMount()}catch(x){gt(s,s.return,x)}else{var u=da(s.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(u,n,e.__reactInternalSnapshotBeforeUpdate)}catch(x){gt(s,s.return,x)}}i&64&&Cb(s),i&512&&mi(s,s.return);break;case 3:if(Bo(e,s),i&64&&(e=s.updateQueue,e!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{my(e,n)}catch(x){gt(s,s.return,x)}}break;case 27:n===null&&i&4&&Nb(s);case 26:case 5:Bo(e,s),n===null&&i&4&&Ob(s),i&512&&mi(s,s.return);break;case 12:Bo(e,s);break;case 31:Bo(e,s),i&4&&Db(e,s);break;case 13:Bo(e,s),i&4&&zb(e,s),i&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=KC.bind(null,s),hR(e,s))));break;case 22:if(i=s.memoizedState!==null||Ho,!i){n=n!==null&&n.memoizedState!==null||Wt,u=Ho;var f=Wt;Ho=i,(Wt=n)&&!f?Vo(e,s,(s.subtreeFlags&8772)!==0):Bo(e,s),Ho=u,Wt=f}break;case 30:break;default:Bo(e,s)}}function jb(e){var n=e.alternate;n!==null&&(e.alternate=null,jb(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&wf(n)),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 Dt=null,Sn=!1;function Uo(e,n,s){for(s=s.child;s!==null;)_b(e,n,s),s=s.sibling}function _b(e,n,s){if(Ye&&typeof Ye.onCommitFiberUnmount=="function")try{Ye.onCommitFiberUnmount(Oe,s)}catch{}switch(s.tag){case 26:Wt||So(s,n),Uo(e,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Wt||So(s,n);var i=Dt,u=Sn;Ms(s.type)&&(Dt=s.stateNode,Sn=!1),Uo(e,n,s),Ei(s.stateNode),Dt=i,Sn=u;break;case 5:Wt||So(s,n);case 6:if(i=Dt,u=Sn,Dt=null,Uo(e,n,s),Dt=i,Sn=u,Dt!==null)if(Sn)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(s.stateNode)}catch(f){gt(s,n,f)}else try{Dt.removeChild(s.stateNode)}catch(f){gt(s,n,f)}break;case 18:Dt!==null&&(Sn?(e=Dt,Cv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),wr(e)):Cv(Dt,s.stateNode));break;case 4:i=Dt,u=Sn,Dt=s.stateNode.containerInfo,Sn=!0,Uo(e,n,s),Dt=i,Sn=u;break;case 0:case 11:case 14:case 15:Es(2,s,n),Wt||Es(4,s,n),Uo(e,n,s);break;case 1:Wt||(So(s,n),i=s.stateNode,typeof i.componentWillUnmount=="function"&&Rb(s,n,i)),Uo(e,n,s);break;case 21:Uo(e,n,s);break;case 22:Wt=(i=Wt)||s.memoizedState!==null,Uo(e,n,s),Wt=i;break;default:Uo(e,n,s)}}function Db(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{wr(e)}catch(s){gt(n,n.return,s)}}}function zb(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{wr(e)}catch(s){gt(n,n.return,s)}}function UC(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new kb),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new kb),n;default:throw Error(r(435,e.tag))}}function uc(e,n){var s=UC(e);n.forEach(function(i){if(!s.has(i)){s.add(i);var u=$C.bind(null,e,i);i.then(u,u)}})}function wn(e,n){var s=n.deletions;if(s!==null)for(var i=0;i<s.length;i++){var u=s[i],f=e,x=n,R=x;e:for(;R!==null;){switch(R.tag){case 27:if(Ms(R.type)){Dt=R.stateNode,Sn=!1;break e}break;case 5:Dt=R.stateNode,Sn=!1;break e;case 3:case 4:Dt=R.stateNode.containerInfo,Sn=!0;break e}R=R.return}if(Dt===null)throw Error(r(160));_b(f,x,u),Dt=null,Sn=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Lb(n,e),n=n.sibling}var lo=null;function Lb(e,n){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:wn(n,e),Tn(e),i&4&&(Es(3,e,e.return),hi(3,e),Es(5,e,e.return));break;case 1:wn(n,e),Tn(e),i&512&&(Wt||s===null||So(s,s.return)),i&64&&Ho&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?i:s.concat(i))));break;case 26:var u=lo;if(wn(n,e),Tn(e),i&512&&(Wt||s===null||So(s,s.return)),i&4){var f=s!==null?s.memoizedState:null;if(i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null){e:{i=e.type,s=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Vr]||f[Yt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(i),u.head.insertBefore(f,u.querySelector("head > title"))),dn(f,i,s),f[Yt]=e,on(f),i=f;break e;case"link":var x=Lv("link","href",u).get(i+(s.href||""));if(x){for(var R=0;R<x.length;R++)if(f=x[R],f.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&f.getAttribute("rel")===(s.rel==null?null:s.rel)&&f.getAttribute("title")===(s.title==null?null:s.title)&&f.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){x.splice(R,1);break t}}f=u.createElement(i),dn(f,i,s),u.head.appendChild(f);break;case"meta":if(x=Lv("meta","content",u).get(i+(s.content||""))){for(R=0;R<x.length;R++)if(f=x[R],f.getAttribute("content")===(s.content==null?null:""+s.content)&&f.getAttribute("name")===(s.name==null?null:s.name)&&f.getAttribute("property")===(s.property==null?null:s.property)&&f.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&f.getAttribute("charset")===(s.charSet==null?null:s.charSet)){x.splice(R,1);break t}}f=u.createElement(i),dn(f,i,s),u.head.appendChild(f);break;default:throw Error(r(468,i))}f[Yt]=e,on(f),i=f}e.stateNode=i}else Pv(u,e.type,e.stateNode);else e.stateNode=zv(u,i,e.memoizedProps);else f!==i?(f===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):f.count--,i===null?Pv(u,e.type,e.stateNode):zv(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Fd(e,e.memoizedProps,s.memoizedProps)}break;case 27:wn(n,e),Tn(e),i&512&&(Wt||s===null||So(s,s.return)),s!==null&&i&4&&Fd(e,e.memoizedProps,s.memoizedProps);break;case 5:if(wn(n,e),Tn(e),i&512&&(Wt||s===null||So(s,s.return)),e.flags&32){u=e.stateNode;try{qa(u,"")}catch(_e){gt(e,e.return,_e)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,Fd(e,u,s!==null?s.memoizedProps:u)),i&1024&&(Gd=!0);break;case 6:if(wn(n,e),Tn(e),i&4){if(e.stateNode===null)throw Error(r(162));i=e.memoizedProps,s=e.stateNode;try{s.nodeValue=i}catch(_e){gt(e,e.return,_e)}}break;case 3:if(Rc=null,u=lo,lo=Ec(n.containerInfo),wn(n,e),lo=u,Tn(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{wr(n.containerInfo)}catch(_e){gt(e,e.return,_e)}Gd&&(Gd=!1,Pb(e));break;case 4:i=lo,lo=Ec(e.stateNode.containerInfo),wn(n,e),Tn(e),lo=i;break;case 12:wn(n,e),Tn(e);break;case 31:wn(n,e),Tn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 13:wn(n,e),Tn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(dc=le()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 22:u=e.memoizedState!==null;var F=s!==null&&s.memoizedState!==null,oe=Ho,ue=Wt;if(Ho=oe||u,Wt=ue||F,wn(n,e),Wt=ue,Ho=oe,Tn(e),i&8192)e:for(n=e.stateNode,n._visibility=u?n._visibility&-2:n._visibility|1,u&&(s===null||F||Ho||Wt||pa(e)),s=null,n=e;;){if(n.tag===5||n.tag===26){if(s===null){F=s=n;try{if(f=F.stateNode,u)x=f.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{R=F.stateNode;var de=F.memoizedProps.style,ae=de!=null&&de.hasOwnProperty("display")?de.display:null;R.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(_e){gt(F,F.return,_e)}}}else if(n.tag===6){if(s===null){F=n;try{F.stateNode.nodeValue=u?"":F.memoizedProps}catch(_e){gt(F,F.return,_e)}}}else if(n.tag===18){if(s===null){F=n;try{var ie=F.stateNode;u?Rv(ie,!0):Rv(F.stateNode,!1)}catch(_e){gt(F,F.return,_e)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}i&4&&(i=e.updateQueue,i!==null&&(s=i.retryQueue,s!==null&&(i.retryQueue=null,uc(e,s))));break;case 19:wn(n,e),Tn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 30:break;case 21:break;default:wn(n,e),Tn(e)}}function Tn(e){var n=e.flags;if(n&2){try{for(var s,i=e.return;i!==null;){if(Ab(i)){s=i;break}i=i.return}if(s==null)throw Error(r(160));switch(s.tag){case 27:var u=s.stateNode,f=Yd(e);cc(e,f,u);break;case 5:var x=s.stateNode;s.flags&32&&(qa(x,""),s.flags&=-33);var R=Yd(e);cc(e,R,x);break;case 3:case 4:var F=s.stateNode.containerInfo,oe=Yd(e);qd(e,oe,F);break;default:throw Error(r(161))}}catch(ue){gt(e,e.return,ue)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Pb(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Pb(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Bo(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Mb(e,n.alternate,n),n=n.sibling}function pa(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Es(4,n,n.return),pa(n);break;case 1:So(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&Rb(n,n.return,s),pa(n);break;case 27:Ei(n.stateNode);case 26:case 5:So(n,n.return),pa(n);break;case 22:n.memoizedState===null&&pa(n);break;case 30:pa(n);break;default:pa(n)}e=e.sibling}}function Vo(e,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var i=n.alternate,u=e,f=n,x=f.flags;switch(f.tag){case 0:case 11:case 15:Vo(u,f,s),hi(4,f);break;case 1:if(Vo(u,f,s),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(oe){gt(i,i.return,oe)}if(i=f,u=i.updateQueue,u!==null){var R=i.stateNode;try{var F=u.shared.hiddenCallbacks;if(F!==null)for(u.shared.hiddenCallbacks=null,u=0;u<F.length;u++)hy(F[u],R)}catch(oe){gt(i,i.return,oe)}}s&&x&64&&Cb(f),mi(f,f.return);break;case 27:Nb(f);case 26:case 5:Vo(u,f,s),s&&i===null&&x&4&&Ob(f),mi(f,f.return);break;case 12:Vo(u,f,s);break;case 31:Vo(u,f,s),s&&x&4&&Db(u,f);break;case 13:Vo(u,f,s),s&&x&4&&zb(u,f);break;case 22:f.memoizedState===null&&Vo(u,f,s),mi(f,f.return);break;case 30:break;default:Vo(u,f,s)}n=n.sibling}}function Xd(e,n){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&ti(s))}function Kd(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ti(e))}function co(e,n,s,i){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Ib(e,n,s,i),n=n.sibling}function Ib(e,n,s,i){var u=n.flags;switch(n.tag){case 0:case 11:case 15:co(e,n,s,i),u&2048&&hi(9,n);break;case 1:co(e,n,s,i);break;case 3:co(e,n,s,i),u&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ti(e)));break;case 12:if(u&2048){co(e,n,s,i),e=n.stateNode;try{var f=n.memoizedProps,x=f.id,R=f.onPostCommit;typeof R=="function"&&R(x,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(F){gt(n,n.return,F)}}else co(e,n,s,i);break;case 31:co(e,n,s,i);break;case 13:co(e,n,s,i);break;case 23:break;case 22:f=n.stateNode,x=n.alternate,n.memoizedState!==null?f._visibility&2?co(e,n,s,i):gi(e,n):f._visibility&2?co(e,n,s,i):(f._visibility|=2,fr(e,n,s,i,(n.subtreeFlags&10256)!==0||!1)),u&2048&&Xd(x,n);break;case 24:co(e,n,s,i),u&2048&&Kd(n.alternate,n);break;default:co(e,n,s,i)}}function fr(e,n,s,i,u){for(u=u&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var f=e,x=n,R=s,F=i,oe=x.flags;switch(x.tag){case 0:case 11:case 15:fr(f,x,R,F,u),hi(8,x);break;case 23:break;case 22:var ue=x.stateNode;x.memoizedState!==null?ue._visibility&2?fr(f,x,R,F,u):gi(f,x):(ue._visibility|=2,fr(f,x,R,F,u)),u&&oe&2048&&Xd(x.alternate,x);break;case 24:fr(f,x,R,F,u),u&&oe&2048&&Kd(x.alternate,x);break;default:fr(f,x,R,F,u)}n=n.sibling}}function gi(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=e,i=n,u=i.flags;switch(i.tag){case 22:gi(s,i),u&2048&&Xd(i.alternate,i);break;case 24:gi(s,i),u&2048&&Kd(i.alternate,i);break;default:gi(s,i)}n=n.sibling}}var yi=8192;function dr(e,n,s){if(e.subtreeFlags&yi)for(e=e.child;e!==null;)Hb(e,n,s),e=e.sibling}function Hb(e,n,s){switch(e.tag){case 26:dr(e,n,s),e.flags&yi&&e.memoizedState!==null&&RR(s,lo,e.memoizedState,e.memoizedProps);break;case 5:dr(e,n,s);break;case 3:case 4:var i=lo;lo=Ec(e.stateNode.containerInfo),dr(e,n,s),lo=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=yi,yi=16777216,dr(e,n,s),yi=i):dr(e,n,s));break;default:dr(e,n,s)}}function Ub(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function bi(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];sn=i,Vb(i,e)}Ub(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bb(e),e=e.sibling}function Bb(e){switch(e.tag){case 0:case 11:case 15:bi(e),e.flags&2048&&Es(9,e,e.return);break;case 3:bi(e);break;case 12:bi(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,fc(e)):bi(e);break;default:bi(e)}}function fc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];sn=i,Vb(i,e)}Ub(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Es(8,n,n.return),fc(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,fc(n));break;default:fc(n)}e=e.sibling}}function Vb(e,n){for(;sn!==null;){var s=sn;switch(s.tag){case 0:case 11:case 15:Es(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var i=s.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:ti(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,sn=i;else e:for(s=e;sn!==null;){i=sn;var u=i.sibling,f=i.return;if(jb(i),i===s){sn=null;break e}if(u!==null){u.return=f,sn=u;break e}sn=f}}}var BC={getCacheForType:function(e){var n=un(Xt),s=n.data.get(e);return s===void 0&&(s=e(),n.data.set(e,s)),s},cacheSignal:function(){return un(Xt).controller.signal}},VC=typeof WeakMap=="function"?WeakMap:Map,ht=0,Ot=null,nt=null,st=0,mt=0,Ln=null,Cs=!1,pr=!1,$d=!1,Fo=0,Ut=0,Rs=0,ha=0,Wd=0,Pn=0,hr=0,vi=null,En=null,Qd=!1,dc=0,Fb=0,pc=1/0,hc=null,Os=null,en=0,As=null,mr=null,Yo=0,Zd=0,Jd=null,Yb=null,xi=0,ep=null;function In(){return(ht&2)!==0&&st!==0?st&-st:P.T!==null?rp():bo()}function qb(){if(Pn===0)if((st&536870912)===0||rt){var e=jt;jt<<=1,(jt&3932160)===0&&(jt=262144),Pn=e}else Pn=536870912;return e=Dn.current,e!==null&&(e.flags|=32),Pn}function Cn(e,n,s){(e===Ot&&(mt===2||mt===9)||e.cancelPendingCommit!==null)&&(gr(e,0),Ns(e,st,Pn,!1)),vn(e,s),((ht&2)===0||e!==Ot)&&(e===Ot&&((ht&2)===0&&(ha|=s),Ut===4&&Ns(e,st,Pn,!1)),wo(e))}function Gb(e,n,s){if((ht&6)!==0)throw Error(r(327));var i=!s&&(n&127)===0&&(n&e.expiredLanes)===0||Pt(e,n),u=i?qC(e,n):np(e,n,!0),f=i;do{if(u===0){pr&&!i&&Ns(e,n,0,!1);break}else{if(s=e.current.alternate,f&&!FC(s)){u=np(e,n,!1),f=!1;continue}if(u===2){if(f=n,e.errorRecoveryDisabledLanes&f)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){n=x;e:{var R=e;u=vi;var F=R.current.memoizedState.isDehydrated;if(F&&(gr(R,x).flags|=256),x=np(R,x,!1),x!==2){if($d&&!F){R.errorRecoveryDisabledLanes|=f,ha|=f,u=4;break e}f=En,En=u,f!==null&&(En===null?En=f:En.push.apply(En,f))}u=x}if(f=!1,u!==2)continue}}if(u===1){gr(e,0),Ns(e,n,0,!0);break}e:{switch(i=e,f=u,f){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:Ns(i,n,Pn,!Cs);break e;case 2:En=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(u=dc+300-le(),10<u)){if(Ns(i,n,Pn,!Cs),_t(i,0,!0)!==0)break e;Yo=n,i.timeoutHandle=Tv(Xb.bind(null,i,s,En,hc,Qd,n,Pn,ha,hr,Cs,f,"Throttled",-0,0),u);break e}Xb(i,s,En,hc,Qd,n,Pn,ha,hr,Cs,f,null,-0,0)}}break}while(!0);wo(e)}function Xb(e,n,s,i,u,f,x,R,F,oe,ue,de,ae,ie){if(e.timeoutHandle=-1,de=n.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:No},Hb(n,f,de);var _e=(f&62914560)===f?dc-le():(f&4194048)===f?Fb-le():0;if(_e=OR(de,_e),_e!==null){Yo=f,e.cancelPendingCommit=_e(tv.bind(null,e,n,f,s,i,u,x,R,F,ue,de,null,ae,ie)),Ns(e,f,x,!oe);return}}tv(e,n,f,s,i,u,x,R,F)}function FC(e){for(var n=e;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var i=0;i<s.length;i++){var u=s[i],f=u.getSnapshot;u=u.value;try{if(!jn(f(),u))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Ns(e,n,s,i){n&=~Wd,n&=~ha,e.suspendedLanes|=n,e.pingedLanes&=~n,i&&(e.warmLanes|=n),i=e.expirationTimes;for(var u=n;0<u;){var f=31-ct(u),x=1<<f;i[f]=-1,u&=~x}s!==0&&kn(e,s,n)}function mc(){return(ht&6)===0?(Si(0),!1):!0}function tp(){if(nt!==null){if(mt===0)var e=nt.return;else e=nt,_o=aa=null,yd(e),rr=null,oi=0,e=nt;for(;e!==null;)Eb(e.alternate,e),e=e.return;nt=null}}function gr(e,n){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,cR(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Yo=0,tp(),Ot=e,nt=s=Mo(e.current,null),st=n,mt=0,Ln=null,Cs=!1,pr=Pt(e,n),$d=!1,hr=Pn=Wd=ha=Rs=Ut=0,En=vi=null,Qd=!1,(n&8)!==0&&(n|=n&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=n;0<i;){var u=31-ct(i),f=1<<u;n|=e[u],i&=~f}return Fo=n,Ll(),s}function Kb(e,n){Ke=null,P.H=fi,n===ar||n===Yl?(n=uy(),mt=3):n===ad?(n=uy(),mt=4):mt=n===_d?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Ln=n,nt===null&&(Ut=1,sc(e,Xn(n,e.current)))}function $b(){var e=Dn.current;return e===null?!0:(st&4194048)===st?Qn===null:(st&62914560)===st||(st&536870912)!==0?e===Qn:!1}function Wb(){var e=P.H;return P.H=fi,e===null?fi:e}function Qb(){var e=P.A;return P.A=BC,e}function gc(){Ut=4,Cs||(st&4194048)!==st&&Dn.current!==null||(pr=!0),(Rs&134217727)===0&&(ha&134217727)===0||Ot===null||Ns(Ot,st,Pn,!1)}function np(e,n,s){var i=ht;ht|=2;var u=Wb(),f=Qb();(Ot!==e||st!==n)&&(hc=null,gr(e,n)),n=!1;var x=Ut;e:do try{if(mt!==0&&nt!==null){var R=nt,F=Ln;switch(mt){case 8:tp(),x=6;break e;case 3:case 2:case 9:case 6:Dn.current===null&&(n=!0);var oe=mt;if(mt=0,Ln=null,yr(e,R,F,oe),s&&pr){x=0;break e}break;default:oe=mt,mt=0,Ln=null,yr(e,R,F,oe)}}YC(),x=Ut;break}catch(ue){Kb(e,ue)}while(!0);return n&&e.shellSuspendCounter++,_o=aa=null,ht=i,P.H=u,P.A=f,nt===null&&(Ot=null,st=0,Ll()),x}function YC(){for(;nt!==null;)Zb(nt)}function qC(e,n){var s=ht;ht|=2;var i=Wb(),u=Qb();Ot!==e||st!==n?(hc=null,pc=le()+500,gr(e,n)):pr=Pt(e,n);e:do try{if(mt!==0&&nt!==null){n=nt;var f=Ln;t:switch(mt){case 1:mt=0,Ln=null,yr(e,n,f,1);break;case 2:case 9:if(ly(f)){mt=0,Ln=null,Jb(n);break}n=function(){mt!==2&&mt!==9||Ot!==e||(mt=7),wo(e)},f.then(n,n);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:ly(f)?(mt=0,Ln=null,Jb(n)):(mt=0,Ln=null,yr(e,n,f,7));break;case 5:var x=null;switch(nt.tag){case 26:x=nt.memoizedState;case 5:case 27:var R=nt;if(x?Iv(x):R.stateNode.complete){mt=0,Ln=null;var F=R.sibling;if(F!==null)nt=F;else{var oe=R.return;oe!==null?(nt=oe,yc(oe)):nt=null}break t}}mt=0,Ln=null,yr(e,n,f,5);break;case 6:mt=0,Ln=null,yr(e,n,f,6);break;case 8:tp(),Ut=6;break e;default:throw Error(r(462))}}GC();break}catch(ue){Kb(e,ue)}while(!0);return _o=aa=null,P.H=i,P.A=u,ht=s,nt!==null?0:(Ot=null,st=0,Ll(),Ut)}function GC(){for(;nt!==null&&!Ie();)Zb(nt)}function Zb(e){var n=wb(e.alternate,e,Fo);e.memoizedProps=e.pendingProps,n===null?yc(e):nt=n}function Jb(e){var n=e,s=n.alternate;switch(n.tag){case 15:case 0:n=gb(s,n,n.pendingProps,n.type,void 0,st);break;case 11:n=gb(s,n,n.pendingProps,n.type.render,n.ref,st);break;case 5:yd(n);default:Eb(s,n),n=nt=Qg(n,Fo),n=wb(s,n,Fo)}e.memoizedProps=e.pendingProps,n===null?yc(e):nt=n}function yr(e,n,s,i){_o=aa=null,yd(n),rr=null,oi=0;var u=n.return;try{if(DC(e,u,n,s,st)){Ut=1,sc(e,Xn(s,e.current)),nt=null;return}}catch(f){if(u!==null)throw nt=u,f;Ut=1,sc(e,Xn(s,e.current)),nt=null;return}n.flags&32768?(rt||i===1?e=!0:pr||(st&536870912)!==0?e=!1:(Cs=e=!0,(i===2||i===9||i===3||i===6)&&(i=Dn.current,i!==null&&i.tag===13&&(i.flags|=16384))),ev(n,e)):yc(n)}function yc(e){var n=e;do{if((n.flags&32768)!==0){ev(n,Cs);return}e=n.return;var s=PC(n.alternate,n,Fo);if(s!==null){nt=s;return}if(n=n.sibling,n!==null){nt=n;return}nt=n=e}while(n!==null);Ut===0&&(Ut=5)}function ev(e,n){do{var s=IC(e.alternate,e);if(s!==null){s.flags&=32767,nt=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(e=e.sibling,e!==null)){nt=e;return}nt=e=s}while(e!==null);Ut=6,nt=null}function tv(e,n,s,i,u,f,x,R,F){e.cancelPendingCommit=null;do bc();while(en!==0);if((ht&6)!==0)throw Error(r(327));if(n!==null){if(n===e.current)throw Error(r(177));if(f=n.lanes|n.childLanes,f|=Yf,Ro(e,s,f,x,R,F),e===Ot&&(nt=Ot=null,st=0),mr=n,As=e,Yo=s,Zd=f,Jd=u,Yb=i,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,WC(xe,function(){return rv(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||i){i=P.T,P.T=null,u=q.p,q.p=2,x=ht,ht|=4;try{HC(e,n,s)}finally{ht=x,q.p=u,P.T=i}}en=1,nv(),ov(),sv()}}function nv(){if(en===1){en=0;var e=As,n=mr,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=P.T,P.T=null;var i=q.p;q.p=2;var u=ht;ht|=4;try{Lb(n,e);var f=hp,x=Vg(e.containerInfo),R=f.focusedElem,F=f.selectionRange;if(x!==R&&R&&R.ownerDocument&&Bg(R.ownerDocument.documentElement,R)){if(F!==null&&Hf(R)){var oe=F.start,ue=F.end;if(ue===void 0&&(ue=oe),"selectionStart"in R)R.selectionStart=oe,R.selectionEnd=Math.min(ue,R.value.length);else{var de=R.ownerDocument||document,ae=de&&de.defaultView||window;if(ae.getSelection){var ie=ae.getSelection(),_e=R.textContent.length,Be=Math.min(F.start,_e),St=F.end===void 0?Be:Math.min(F.end,_e);!ie.extend&&Be>St&&(x=St,St=Be,Be=x);var te=Ug(R,Be),G=Ug(R,St);if(te&&G&&(ie.rangeCount!==1||ie.anchorNode!==te.node||ie.anchorOffset!==te.offset||ie.focusNode!==G.node||ie.focusOffset!==G.offset)){var ne=de.createRange();ne.setStart(te.node,te.offset),ie.removeAllRanges(),Be>St?(ie.addRange(ne),ie.extend(G.node,G.offset)):(ne.setEnd(G.node,G.offset),ie.addRange(ne))}}}}for(de=[],ie=R;ie=ie.parentNode;)ie.nodeType===1&&de.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<de.length;R++){var fe=de[R];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}kc=!!pp,hp=pp=null}finally{ht=u,q.p=i,P.T=s}}e.current=n,en=2}}function ov(){if(en===2){en=0;var e=As,n=mr,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=P.T,P.T=null;var i=q.p;q.p=2;var u=ht;ht|=4;try{Mb(e,n.alternate,n)}finally{ht=u,q.p=i,P.T=s}}en=3}}function sv(){if(en===4||en===3){en=0,je();var e=As,n=mr,s=Yo,i=Yb;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?en=5:(en=0,mr=As=null,av(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Os=null),ao(s),n=n.stateNode,Ye&&typeof Ye.onCommitFiberRoot=="function")try{Ye.onCommitFiberRoot(Oe,n,void 0,(n.current.flags&128)===128)}catch{}if(i!==null){n=P.T,u=q.p,q.p=2,P.T=null;try{for(var f=e.onRecoverableError,x=0;x<i.length;x++){var R=i[x];f(R.value,{componentStack:R.stack})}}finally{P.T=n,q.p=u}}(Yo&3)!==0&&bc(),wo(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===ep?xi++:(xi=0,ep=e):xi=0,Si(0)}}function av(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,ti(n)))}function bc(){return nv(),ov(),sv(),rv()}function rv(){if(en!==5)return!1;var e=As,n=Zd;Zd=0;var s=ao(Yo),i=P.T,u=q.p;try{q.p=32>s?32:s,P.T=null,s=Jd,Jd=null;var f=As,x=Yo;if(en=0,mr=As=null,Yo=0,(ht&6)!==0)throw Error(r(331));var R=ht;if(ht|=4,Bb(f.current),Ib(f,f.current,x,s),ht=R,Si(0,!1),Ye&&typeof Ye.onPostCommitFiberRoot=="function")try{Ye.onPostCommitFiberRoot(Oe,f)}catch{}return!0}finally{q.p=u,P.T=i,av(e,n)}}function iv(e,n,s){n=Xn(s,n),n=jd(e.stateNode,n,2),e=Ss(e,n,2),e!==null&&(vn(e,2),wo(e))}function gt(e,n,s){if(e.tag===3)iv(e,e,s);else for(;n!==null;){if(n.tag===3){iv(n,e,s);break}else if(n.tag===1){var i=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Os===null||!Os.has(i))){e=Xn(s,e),s=lb(2),i=Ss(n,s,2),i!==null&&(cb(s,i,n,e),vn(i,2),wo(i));break}}n=n.return}}function op(e,n,s){var i=e.pingCache;if(i===null){i=e.pingCache=new VC;var u=new Set;i.set(n,u)}else u=i.get(n),u===void 0&&(u=new Set,i.set(n,u));u.has(s)||($d=!0,u.add(s),e=XC.bind(null,e,n,s),n.then(e,e))}function XC(e,n,s){var i=e.pingCache;i!==null&&i.delete(n),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Ot===e&&(st&s)===s&&(Ut===4||Ut===3&&(st&62914560)===st&&300>le()-dc?(ht&2)===0&&gr(e,0):Wd|=s,hr===st&&(hr=0)),wo(e)}function lv(e,n){n===0&&(n=ln()),e=na(e,n),e!==null&&(vn(e,n),wo(e))}function KC(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),lv(e,s)}function $C(e,n){var s=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(r(314))}i!==null&&i.delete(n),lv(e,s)}function WC(e,n){return Re(e,n)}var vc=null,br=null,sp=!1,xc=!1,ap=!1,ks=0;function wo(e){e!==br&&e.next===null&&(br===null?vc=br=e:br=br.next=e),xc=!0,sp||(sp=!0,ZC())}function Si(e,n){if(!ap&&xc){ap=!0;do for(var s=!1,i=vc;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var x=i.suspendedLanes,R=i.pingedLanes;f=(1<<31-ct(42|e)+1)-1,f&=u&~(x&~R),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,dv(i,f))}else f=st,f=_t(i,i===Ot?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||Pt(i,f)||(s=!0,dv(i,f));i=i.next}while(s);ap=!1}}function QC(){cv()}function cv(){xc=sp=!1;var e=0;ks!==0&&lR()&&(e=ks);for(var n=le(),s=null,i=vc;i!==null;){var u=i.next,f=uv(i,n);f===0?(i.next=null,s===null?vc=u:s.next=u,u===null&&(br=s)):(s=i,(e!==0||(f&3)!==0)&&(xc=!0)),i=u}en!==0&&en!==5||Si(e),ks!==0&&(ks=0)}function uv(e,n){for(var s=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var x=31-ct(f),R=1<<x,F=u[x];F===-1?((R&s)===0||(R&i)!==0)&&(u[x]=Nn(R,n)):F<=n&&(e.expiredLanes|=R),f&=~R}if(n=Ot,s=st,s=_t(e,e===n?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,s===0||e===n&&(mt===2||mt===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Ne(i),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Pt(e,s)){if(n=s&-s,n===e.callbackPriority)return n;switch(i!==null&&Ne(i),ao(s)){case 2:case 8:s=ce;break;case 32:s=xe;break;case 268435456:s=Lt;break;default:s=xe}return i=fv.bind(null,e),s=Re(s,i),e.callbackPriority=n,e.callbackNode=s,n}return i!==null&&i!==null&&Ne(i),e.callbackPriority=2,e.callbackNode=null,2}function fv(e,n){if(en!==0&&en!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(bc()&&e.callbackNode!==s)return null;var i=st;return i=_t(e,e===Ot?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Gb(e,i,n),uv(e,le()),e.callbackNode!=null&&e.callbackNode===s?fv.bind(null,e):null)}function dv(e,n){if(bc())return null;Gb(e,n,!0)}function ZC(){uR(function(){(ht&6)!==0?Re(he,QC):cv()})}function rp(){if(ks===0){var e=or;e===0&&(e=bt,bt<<=1,(bt&261888)===0&&(bt=256)),ks=e}return ks}function pv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Al(""+e)}function hv(e,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,e.id&&s.setAttribute("form",e.id),n.parentNode.insertBefore(s,n),e=new FormData(e),s.parentNode.removeChild(s),e}function JC(e,n,s,i,u){if(n==="submit"&&s&&s.stateNode===u){var f=pv((u[mn]||null).action),x=i.submitter;x&&(n=(n=x[mn]||null)?pv(n.formAction):x.getAttribute("formAction"),n!==null&&(f=n,x=null));var R=new jl("action","action",null,i,u);e.push({event:R,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(ks!==0){var F=x?hv(u,x):new FormData(u);Rd(s,{pending:!0,data:F,method:u.method,action:f},null,F)}}else typeof f=="function"&&(R.preventDefault(),F=x?hv(u,x):new FormData(u),Rd(s,{pending:!0,data:F,method:u.method,action:f},f,F))},currentTarget:u}]})}}for(var ip=0;ip<Ff.length;ip++){var lp=Ff[ip],eR=lp.toLowerCase(),tR=lp[0].toUpperCase()+lp.slice(1);io(eR,"on"+tR)}io(qg,"onAnimationEnd"),io(Gg,"onAnimationIteration"),io(Xg,"onAnimationStart"),io("dblclick","onDoubleClick"),io("focusin","onFocus"),io("focusout","onBlur"),io(yC,"onTransitionRun"),io(bC,"onTransitionStart"),io(vC,"onTransitionCancel"),io(Kg,"onTransitionEnd"),Fa("onMouseEnter",["mouseout","mouseover"]),Fa("onMouseLeave",["mouseout","mouseover"]),Fa("onPointerEnter",["pointerout","pointerover"]),Fa("onPointerLeave",["pointerout","pointerover"]),Zs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wi="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(" "),nR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wi));function mv(e,n){n=(n&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],u=i.event;i=i.listeners;e:{var f=void 0;if(n)for(var x=i.length-1;0<=x;x--){var R=i[x],F=R.instance,oe=R.currentTarget;if(R=R.listener,F!==f&&u.isPropagationStopped())break e;f=R,u.currentTarget=oe;try{f(u)}catch(ue){zl(ue)}u.currentTarget=null,f=F}else for(x=0;x<i.length;x++){if(R=i[x],F=R.instance,oe=R.currentTarget,R=R.listener,F!==f&&u.isPropagationStopped())break e;f=R,u.currentTarget=oe;try{f(u)}catch(ue){zl(ue)}u.currentTarget=null,f=F}}}}function ot(e,n){var s=n[Sf];s===void 0&&(s=n[Sf]=new Set);var i=e+"__bubble";s.has(i)||(gv(n,e,2,!1),s.add(i))}function cp(e,n,s){var i=0;n&&(i|=4),gv(s,e,i,n)}var Sc="_reactListening"+Math.random().toString(36).slice(2);function up(e){if(!e[Sc]){e[Sc]=!0,cg.forEach(function(s){s!=="selectionchange"&&(nR.has(s)||cp(s,!1,e),cp(s,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Sc]||(n[Sc]=!0,cp("selectionchange",!1,n))}}function gv(e,n,s,i){switch(qv(n)){case 2:var u=kR;break;case 8:u=MR;break;default:u=Cp}s=u.bind(null,n,s,e),u=void 0,!kf||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(n,s,{capture:!0,passive:u}):e.addEventListener(n,s,!0):u!==void 0?e.addEventListener(n,s,{passive:u}):e.addEventListener(n,s,!1)}function fp(e,n,s,i,u){var f=i;if((n&1)===0&&(n&2)===0&&i!==null)e:for(;;){if(i===null)return;var x=i.tag;if(x===3||x===4){var R=i.stateNode.containerInfo;if(R===u)break;if(x===4)for(x=i.return;x!==null;){var F=x.tag;if((F===3||F===4)&&x.stateNode.containerInfo===u)return;x=x.return}for(;R!==null;){if(x=Ua(R),x===null)return;if(F=x.tag,F===5||F===6||F===26||F===27){i=f=x;continue e}R=R.parentNode}}i=i.return}Sg(function(){var oe=f,ue=Af(s),de=[];e:{var ae=$g.get(e);if(ae!==void 0){var ie=jl,_e=e;switch(e){case"keypress":if(kl(s)===0)break e;case"keydown":case"keyup":ie=$E;break;case"focusin":_e="focus",ie=Df;break;case"focusout":_e="blur",ie=Df;break;case"beforeblur":case"afterblur":ie=Df;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Eg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=PE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=ZE;break;case qg:case Gg:case Xg:ie=UE;break;case Kg:ie=eC;break;case"scroll":case"scrollend":ie=zE;break;case"wheel":ie=nC;break;case"copy":case"cut":case"paste":ie=VE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Rg;break;case"toggle":case"beforetoggle":ie=sC}var Be=(n&4)!==0,St=!Be&&(e==="scroll"||e==="scrollend"),te=Be?ae!==null?ae+"Capture":null:ae;Be=[];for(var G=oe,ne;G!==null;){var fe=G;if(ne=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||ne===null||te===null||(fe=Yr(G,te),fe!=null&&Be.push(Ti(G,fe,ne))),St)break;G=G.return}0<Be.length&&(ae=new ie(ae,_e,null,s,ue),de.push({event:ae,listeners:Be}))}}if((n&7)===0){e:{if(ae=e==="mouseover"||e==="pointerover",ie=e==="mouseout"||e==="pointerout",ae&&s!==Of&&(_e=s.relatedTarget||s.fromElement)&&(Ua(_e)||_e[Oo]))break e;if((ie||ae)&&(ae=ue.window===ue?ue:(ae=ue.ownerDocument)?ae.defaultView||ae.parentWindow:window,ie?(_e=s.relatedTarget||s.toElement,ie=oe,_e=_e?Ua(_e):null,_e!==null&&(St=c(_e),Be=_e.tag,_e!==St||Be!==5&&Be!==27&&Be!==6)&&(_e=null)):(ie=null,_e=oe),ie!==_e)){if(Be=Eg,fe="onMouseLeave",te="onMouseEnter",G="mouse",(e==="pointerout"||e==="pointerover")&&(Be=Rg,fe="onPointerLeave",te="onPointerEnter",G="pointer"),St=ie==null?ae:Fr(ie),ne=_e==null?ae:Fr(_e),ae=new Be(fe,G+"leave",ie,s,ue),ae.target=St,ae.relatedTarget=ne,fe=null,Ua(ue)===oe&&(Be=new Be(te,G+"enter",_e,s,ue),Be.target=ne,Be.relatedTarget=St,fe=Be),St=fe,ie&&_e)t:{for(Be=oR,te=ie,G=_e,ne=0,fe=te;fe;fe=Be(fe))ne++;fe=0;for(var Pe=G;Pe;Pe=Be(Pe))fe++;for(;0<ne-fe;)te=Be(te),ne--;for(;0<fe-ne;)G=Be(G),fe--;for(;ne--;){if(te===G||G!==null&&te===G.alternate){Be=te;break t}te=Be(te),G=Be(G)}Be=null}else Be=null;ie!==null&&yv(de,ae,ie,Be,!1),_e!==null&&St!==null&&yv(de,St,_e,Be,!0)}}e:{if(ae=oe?Fr(oe):window,ie=ae.nodeName&&ae.nodeName.toLowerCase(),ie==="select"||ie==="input"&&ae.type==="file")var dt=Dg;else if(jg(ae))if(zg)dt=hC;else{dt=dC;var ze=fC}else ie=ae.nodeName,!ie||ie.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?oe&&Rf(oe.elementType)&&(dt=Dg):dt=pC;if(dt&&(dt=dt(e,oe))){_g(de,dt,s,ue);break e}ze&&ze(e,ae,oe),e==="focusout"&&oe&&ae.type==="number"&&oe.memoizedProps.value!=null&&Cf(ae,"number",ae.value)}switch(ze=oe?Fr(oe):window,e){case"focusin":(jg(ze)||ze.contentEditable==="true")&&($a=ze,Uf=oe,Zr=null);break;case"focusout":Zr=Uf=$a=null;break;case"mousedown":Bf=!0;break;case"contextmenu":case"mouseup":case"dragend":Bf=!1,Fg(de,s,ue);break;case"selectionchange":if(gC)break;case"keydown":case"keyup":Fg(de,s,ue)}var $e;if(Lf)e:{switch(e){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else Ka?kg(e,s)&&(at="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(at="onCompositionStart");at&&(Og&&s.locale!=="ko"&&(Ka||at!=="onCompositionStart"?at==="onCompositionEnd"&&Ka&&($e=wg()):(hs=ue,Mf="value"in hs?hs.value:hs.textContent,Ka=!0)),ze=wc(oe,at),0<ze.length&&(at=new Cg(at,e,null,s,ue),de.push({event:at,listeners:ze}),$e?at.data=$e:($e=Mg(s),$e!==null&&(at.data=$e)))),($e=rC?iC(e,s):lC(e,s))&&(at=wc(oe,"onBeforeInput"),0<at.length&&(ze=new Cg("onBeforeInput","beforeinput",null,s,ue),de.push({event:ze,listeners:at}),ze.data=$e)),JC(de,e,oe,s,ue)}mv(de,n)})}function Ti(e,n,s){return{instance:e,listener:n,currentTarget:s}}function wc(e,n){for(var s=n+"Capture",i=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Yr(e,s),u!=null&&i.unshift(Ti(e,u,f)),u=Yr(e,n),u!=null&&i.push(Ti(e,u,f))),e.tag===3)return i;e=e.return}return[]}function oR(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function yv(e,n,s,i,u){for(var f=n._reactName,x=[];s!==null&&s!==i;){var R=s,F=R.alternate,oe=R.stateNode;if(R=R.tag,F!==null&&F===i)break;R!==5&&R!==26&&R!==27||oe===null||(F=oe,u?(oe=Yr(s,f),oe!=null&&x.unshift(Ti(s,oe,F))):u||(oe=Yr(s,f),oe!=null&&x.push(Ti(s,oe,F)))),s=s.return}x.length!==0&&e.push({event:n,listeners:x})}var sR=/\r\n?/g,aR=/\u0000|\uFFFD/g;function bv(e){return(typeof e=="string"?e:""+e).replace(sR,`
|
|
9
|
+
`).replace(aR,"")}function vv(e,n){return n=bv(n),bv(e)===n}function xt(e,n,s,i,u,f){switch(s){case"children":typeof i=="string"?n==="body"||n==="textarea"&&i===""||qa(e,i):(typeof i=="number"||typeof i=="bigint")&&n!=="body"&&qa(e,""+i);break;case"className":Rl(e,"class",i);break;case"tabIndex":Rl(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Rl(e,s,i);break;case"style":vg(e,i,f);break;case"data":if(n!=="object"){Rl(e,"data",i);break}case"src":case"href":if(i===""&&(n!=="a"||s!=="href")){e.removeAttribute(s);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Al(""+i),e.setAttribute(s,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(s,"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 f=="function"&&(s==="formAction"?(n!=="input"&&xt(e,n,"name",u.name,u,null),xt(e,n,"formEncType",u.formEncType,u,null),xt(e,n,"formMethod",u.formMethod,u,null),xt(e,n,"formTarget",u.formTarget,u,null)):(xt(e,n,"encType",u.encType,u,null),xt(e,n,"method",u.method,u,null),xt(e,n,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Al(""+i),e.setAttribute(s,i);break;case"onClick":i!=null&&(e.onclick=No);break;case"onScroll":i!=null&&ot("scroll",e);break;case"onScrollEnd":i!=null&&ot("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(r(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=s}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}s=Al(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""+i):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":i===!0?e.setAttribute(s,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(s,i):e.removeAttribute(s);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(s):e.setAttribute(s,i);break;case"popover":ot("beforetoggle",e),ot("toggle",e),Cl(e,"popover",i);break;case"xlinkActuate":Ao(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Ao(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Ao(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Ao(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Ao(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Ao(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Ao(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Ao(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Ao(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Cl(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=_E.get(s)||s,Cl(e,s,i))}}function dp(e,n,s,i,u,f){switch(s){case"style":vg(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(r(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=s}}break;case"children":typeof i=="string"?qa(e,i):(typeof i=="number"||typeof i=="bigint")&&qa(e,""+i);break;case"onScroll":i!=null&&ot("scroll",e);break;case"onScrollEnd":i!=null&&ot("scrollend",e);break;case"onClick":i!=null&&(e.onclick=No);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ug.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),n=s.slice(2,u?s.length-7:void 0),f=e[mn]||null,f=f!=null?f[s]:null,typeof f=="function"&&e.removeEventListener(n,f,u),typeof i=="function")){typeof f!="function"&&f!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(n,i,u);break e}s in e?e[s]=i:i===!0?e.setAttribute(s,""):Cl(e,s,i)}}}function dn(e,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ot("error",e),ot("load",e);var i=!1,u=!1,f;for(f in s)if(s.hasOwnProperty(f)){var x=s[f];if(x!=null)switch(f){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:xt(e,n,f,x,s,null)}}u&&xt(e,n,"srcSet",s.srcSet,s,null),i&&xt(e,n,"src",s.src,s,null);return;case"input":ot("invalid",e);var R=f=x=u=null,F=null,oe=null;for(i in s)if(s.hasOwnProperty(i)){var ue=s[i];if(ue!=null)switch(i){case"name":u=ue;break;case"type":x=ue;break;case"checked":F=ue;break;case"defaultChecked":oe=ue;break;case"value":f=ue;break;case"defaultValue":R=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,n));break;default:xt(e,n,i,ue,s,null)}}mg(e,f,R,F,oe,x,u,!1);return;case"select":ot("invalid",e),i=x=f=null;for(u in s)if(s.hasOwnProperty(u)&&(R=s[u],R!=null))switch(u){case"value":f=R;break;case"defaultValue":x=R;break;case"multiple":i=R;default:xt(e,n,u,R,s,null)}n=f,s=x,e.multiple=!!i,n!=null?Ya(e,!!i,n,!1):s!=null&&Ya(e,!!i,s,!0);return;case"textarea":ot("invalid",e),f=u=i=null;for(x in s)if(s.hasOwnProperty(x)&&(R=s[x],R!=null))switch(x){case"value":i=R;break;case"defaultValue":u=R;break;case"children":f=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(r(91));break;default:xt(e,n,x,R,s,null)}yg(e,i,u,f);return;case"option":for(F in s)s.hasOwnProperty(F)&&(i=s[F],i!=null)&&(F==="selected"?e.selected=i&&typeof i!="function"&&typeof i!="symbol":xt(e,n,F,i,s,null));return;case"dialog":ot("beforetoggle",e),ot("toggle",e),ot("cancel",e),ot("close",e);break;case"iframe":case"object":ot("load",e);break;case"video":case"audio":for(i=0;i<wi.length;i++)ot(wi[i],e);break;case"image":ot("error",e),ot("load",e);break;case"details":ot("toggle",e);break;case"embed":case"source":case"link":ot("error",e),ot("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(oe in s)if(s.hasOwnProperty(oe)&&(i=s[oe],i!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:xt(e,n,oe,i,s,null)}return;default:if(Rf(n)){for(ue in s)s.hasOwnProperty(ue)&&(i=s[ue],i!==void 0&&dp(e,n,ue,i,s,void 0));return}}for(R in s)s.hasOwnProperty(R)&&(i=s[R],i!=null&&xt(e,n,R,i,s,null))}function rR(e,n,s,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,x=null,R=null,F=null,oe=null,ue=null;for(ie in s){var de=s[ie];if(s.hasOwnProperty(ie)&&de!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":F=de;default:i.hasOwnProperty(ie)||xt(e,n,ie,null,i,de)}}for(var ae in i){var ie=i[ae];if(de=s[ae],i.hasOwnProperty(ae)&&(ie!=null||de!=null))switch(ae){case"type":f=ie;break;case"name":u=ie;break;case"checked":oe=ie;break;case"defaultChecked":ue=ie;break;case"value":x=ie;break;case"defaultValue":R=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,n));break;default:ie!==de&&xt(e,n,ae,ie,i,de)}}Ef(e,x,R,F,oe,ue,f,u);return;case"select":ie=x=R=ae=null;for(f in s)if(F=s[f],s.hasOwnProperty(f)&&F!=null)switch(f){case"value":break;case"multiple":ie=F;default:i.hasOwnProperty(f)||xt(e,n,f,null,i,F)}for(u in i)if(f=i[u],F=s[u],i.hasOwnProperty(u)&&(f!=null||F!=null))switch(u){case"value":ae=f;break;case"defaultValue":R=f;break;case"multiple":x=f;default:f!==F&&xt(e,n,u,f,i,F)}n=R,s=x,i=ie,ae!=null?Ya(e,!!s,ae,!1):!!i!=!!s&&(n!=null?Ya(e,!!s,n,!0):Ya(e,!!s,s?[]:"",!1));return;case"textarea":ie=ae=null;for(R in s)if(u=s[R],s.hasOwnProperty(R)&&u!=null&&!i.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:xt(e,n,R,null,i,u)}for(x in i)if(u=i[x],f=s[x],i.hasOwnProperty(x)&&(u!=null||f!=null))switch(x){case"value":ae=u;break;case"defaultValue":ie=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(r(91));break;default:u!==f&&xt(e,n,x,u,i,f)}gg(e,ae,ie);return;case"option":for(var _e in s)ae=s[_e],s.hasOwnProperty(_e)&&ae!=null&&!i.hasOwnProperty(_e)&&(_e==="selected"?e.selected=!1:xt(e,n,_e,null,i,ae));for(F in i)ae=i[F],ie=s[F],i.hasOwnProperty(F)&&ae!==ie&&(ae!=null||ie!=null)&&(F==="selected"?e.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":xt(e,n,F,ae,i,ie));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 Be in s)ae=s[Be],s.hasOwnProperty(Be)&&ae!=null&&!i.hasOwnProperty(Be)&&xt(e,n,Be,null,i,ae);for(oe in i)if(ae=i[oe],ie=s[oe],i.hasOwnProperty(oe)&&ae!==ie&&(ae!=null||ie!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,n));break;default:xt(e,n,oe,ae,i,ie)}return;default:if(Rf(n)){for(var St in s)ae=s[St],s.hasOwnProperty(St)&&ae!==void 0&&!i.hasOwnProperty(St)&&dp(e,n,St,void 0,i,ae);for(ue in i)ae=i[ue],ie=s[ue],!i.hasOwnProperty(ue)||ae===ie||ae===void 0&&ie===void 0||dp(e,n,ue,ae,i,ie);return}}for(var te in s)ae=s[te],s.hasOwnProperty(te)&&ae!=null&&!i.hasOwnProperty(te)&&xt(e,n,te,null,i,ae);for(de in i)ae=i[de],ie=s[de],!i.hasOwnProperty(de)||ae===ie||ae==null&&ie==null||xt(e,n,de,ae,i,ie)}function xv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iR(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,s=performance.getEntriesByType("resource"),i=0;i<s.length;i++){var u=s[i],f=u.transferSize,x=u.initiatorType,R=u.duration;if(f&&R&&xv(x)){for(x=0,R=u.responseEnd,i+=1;i<s.length;i++){var F=s[i],oe=F.startTime;if(oe>R)break;var ue=F.transferSize,de=F.initiatorType;ue&&xv(de)&&(F=F.responseEnd,x+=ue*(F<R?1:(R-oe)/(F-oe)))}if(--i,n+=8*(f+x)/(u.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var pp=null,hp=null;function Tc(e){return e.nodeType===9?e:e.ownerDocument}function Sv(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 wv(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function mp(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var gp=null;function lR(){var e=window.event;return e&&e.type==="popstate"?e===gp?!1:(gp=e,!0):(gp=null,!1)}var Tv=typeof setTimeout=="function"?setTimeout:void 0,cR=typeof clearTimeout=="function"?clearTimeout:void 0,Ev=typeof Promise=="function"?Promise:void 0,uR=typeof queueMicrotask=="function"?queueMicrotask:typeof Ev<"u"?function(e){return Ev.resolve(null).then(e).catch(fR)}:Tv;function fR(e){setTimeout(function(){throw e})}function Ms(e){return e==="head"}function Cv(e,n){var s=n,i=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(i===0){e.removeChild(u),wr(n);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")Ei(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Ei(s);for(var f=s.firstChild;f;){var x=f.nextSibling,R=f.nodeName;f[Vr]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=x}}else s==="body"&&Ei(e.ownerDocument.body);s=u}while(s);wr(n)}function Rv(e,n){var s=e;e=0;do{var i=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),i&&i.nodeType===8)if(s=i.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=i}while(s)}function yp(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":yp(s),wf(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function dR(e,n,s,i){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Vr])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Zn(e.nextSibling),e===null)break}return null}function pR(e,n,s){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Zn(e.nextSibling),e===null))return null;return e}function Ov(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Zn(e.nextSibling),e===null))return null;return e}function bp(e){return e.data==="$?"||e.data==="$~"}function vp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function hR(e,n){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||s.readyState!=="loading")n();else{var i=function(){n(),s.removeEventListener("DOMContentLoaded",i)};s.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Zn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var xp=null;function Av(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(n===0)return Zn(e.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}e=e.nextSibling}return null}function Nv(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return e;n--}else s!=="/$"&&s!=="/&"||n++}e=e.previousSibling}return null}function kv(e,n,s){switch(n=Tc(s),e){case"html":if(e=n.documentElement,!e)throw Error(r(452));return e;case"head":if(e=n.head,!e)throw Error(r(453));return e;case"body":if(e=n.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function Ei(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);wf(e)}var Jn=new Map,Mv=new Set;function Ec(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var qo=q.d;q.d={f:mR,r:gR,D:yR,C:bR,L:vR,m:xR,X:wR,S:SR,M:TR};function mR(){var e=qo.f(),n=mc();return e||n}function gR(e){var n=Ba(e);n!==null&&n.tag===5&&n.type==="form"?Ky(n):qo.r(e)}var vr=typeof document>"u"?null:document;function jv(e,n,s){var i=vr;if(i&&typeof n=="string"&&n){var u=qn(n);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),Mv.has(u)||(Mv.add(u),e={rel:e,crossOrigin:s,href:n},i.querySelector(u)===null&&(n=i.createElement("link"),dn(n,"link",e),on(n),i.head.appendChild(n)))}}function yR(e){qo.D(e),jv("dns-prefetch",e,null)}function bR(e,n){qo.C(e,n),jv("preconnect",e,n)}function vR(e,n,s){qo.L(e,n,s);var i=vr;if(i&&e&&n){var u='link[rel="preload"][as="'+qn(n)+'"]';n==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+qn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+qn(s.imageSizes)+'"]')):u+='[href="'+qn(e)+'"]';var f=u;switch(n){case"style":f=xr(e);break;case"script":f=Sr(e)}Jn.has(f)||(e=v({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:e,as:n},s),Jn.set(f,e),i.querySelector(u)!==null||n==="style"&&i.querySelector(Ci(f))||n==="script"&&i.querySelector(Ri(f))||(n=i.createElement("link"),dn(n,"link",e),on(n),i.head.appendChild(n)))}}function xR(e,n){qo.m(e,n);var s=vr;if(s&&e){var i=n&&typeof n.as=="string"?n.as:"script",u='link[rel="modulepreload"][as="'+qn(i)+'"][href="'+qn(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Sr(e)}if(!Jn.has(f)&&(e=v({rel:"modulepreload",href:e},n),Jn.set(f,e),s.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Ri(f)))return}i=s.createElement("link"),dn(i,"link",e),on(i),s.head.appendChild(i)}}}function SR(e,n,s){qo.S(e,n,s);var i=vr;if(i&&e){var u=Va(i).hoistableStyles,f=xr(e);n=n||"default";var x=u.get(f);if(!x){var R={loading:0,preload:null};if(x=i.querySelector(Ci(f)))R.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":n},s),(s=Jn.get(f))&&Sp(e,s);var F=x=i.createElement("link");on(F),dn(F,"link",e),F._p=new Promise(function(oe,ue){F.onload=oe,F.onerror=ue}),F.addEventListener("load",function(){R.loading|=1}),F.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Cc(x,n,i)}x={type:"stylesheet",instance:x,count:1,state:R},u.set(f,x)}}}function wR(e,n){qo.X(e,n);var s=vr;if(s&&e){var i=Va(s).hoistableScripts,u=Sr(e),f=i.get(u);f||(f=s.querySelector(Ri(u)),f||(e=v({src:e,async:!0},n),(n=Jn.get(u))&&wp(e,n),f=s.createElement("script"),on(f),dn(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function TR(e,n){qo.M(e,n);var s=vr;if(s&&e){var i=Va(s).hoistableScripts,u=Sr(e),f=i.get(u);f||(f=s.querySelector(Ri(u)),f||(e=v({src:e,async:!0,type:"module"},n),(n=Jn.get(u))&&wp(e,n),f=s.createElement("script"),on(f),dn(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function _v(e,n,s,i){var u=(u=re.current)?Ec(u):null;if(!u)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=xr(s.href),s=Va(u).hoistableStyles,i=s.get(n),i||(i={type:"style",instance:null,count:0,state:null},s.set(n,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=xr(s.href);var f=Va(u).hoistableStyles,x=f.get(e);if(x||(u=u.ownerDocument||u,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,x),(f=u.querySelector(Ci(e)))&&!f._p&&(x.instance=f,x.state.loading=5),Jn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Jn.set(e,s),f||ER(u,e,s,x.state))),n&&i===null)throw Error(r(528,""));return x}if(n&&i!==null)throw Error(r(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Sr(s),s=Va(u).hoistableScripts,i=s.get(n),i||(i={type:"script",instance:null,count:0,state:null},s.set(n,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function xr(e){return'href="'+qn(e)+'"'}function Ci(e){return'link[rel="stylesheet"]['+e+"]"}function Dv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function ER(e,n,s,i){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?i.loading=1:(n=e.createElement("link"),i.preload=n,n.addEventListener("load",function(){return i.loading|=1}),n.addEventListener("error",function(){return i.loading|=2}),dn(n,"link",s),on(n),e.head.appendChild(n))}function Sr(e){return'[src="'+qn(e)+'"]'}function Ri(e){return"script[async]"+e}function zv(e,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var i=e.querySelector('style[data-href~="'+qn(s.href)+'"]');if(i)return n.instance=i,on(i),i;var u=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),on(i),dn(i,"style",u),Cc(i,s.precedence,e),n.instance=i;case"stylesheet":u=xr(s.href);var f=e.querySelector(Ci(u));if(f)return n.state.loading|=4,n.instance=f,on(f),f;i=Dv(s),(u=Jn.get(u))&&Sp(i,u),f=(e.ownerDocument||e).createElement("link"),on(f);var x=f;return x._p=new Promise(function(R,F){x.onload=R,x.onerror=F}),dn(f,"link",i),n.state.loading|=4,Cc(f,s.precedence,e),n.instance=f;case"script":return f=Sr(s.src),(u=e.querySelector(Ri(f)))?(n.instance=u,on(u),u):(i=s,(u=Jn.get(f))&&(i=v({},s),wp(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),on(u),dn(u,"link",i),e.head.appendChild(u),n.instance=u);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(i=n.instance,n.state.loading|=4,Cc(i,s.precedence,e));return n.instance}function Cc(e,n,s){for(var i=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,f=u,x=0;x<i.length;x++){var R=i[x];if(R.dataset.precedence===n)f=R;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(e,n.firstChild))}function Sp(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function wp(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Rc=null;function Lv(e,n,s){if(Rc===null){var i=new Map,u=Rc=new Map;u.set(s,i)}else u=Rc,i=u.get(s),i||(i=new Map,u.set(s,i));if(i.has(e))return i;for(i.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var f=s[u];if(!(f[Vr]||f[Yt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var x=f.getAttribute(n)||"";x=e+x;var R=i.get(x);R?R.push(f):i.set(x,[f])}}return i}function Pv(e,n,s){e=e.ownerDocument||e,e.head.insertBefore(s,n==="title"?e.querySelector("head > title"):null)}function CR(e,n,s){if(s===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Iv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function RR(e,n,s,i){if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=xr(i.href),f=n.querySelector(Ci(u));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Oc.bind(e),n.then(e,e)),s.state.loading|=4,s.instance=f,on(f);return}f=n.ownerDocument||n,i=Dv(i),(u=Jn.get(u))&&Sp(i,u),f=f.createElement("link"),on(f);var x=f;x._p=new Promise(function(R,F){x.onload=R,x.onerror=F}),dn(f,"link",i),s.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Oc.bind(e),n.addEventListener("load",s),n.addEventListener("error",s))}}var Tp=0;function OR(e,n){return e.stylesheets&&e.count===0&&Nc(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var i=setTimeout(function(){if(e.stylesheets&&Nc(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+n);0<e.imgBytes&&Tp===0&&(Tp=62500*iR());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Nc(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Tp?50:800)+n);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function Oc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ac=null;function Nc(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ac=new Map,n.forEach(AR,e),Ac=null,Oc.call(e))}function AR(e,n){if(!(n.state.loading&4)){var s=Ac.get(e);if(s)var i=s.get(null);else{s=new Map,Ac.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var x=u[f];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(s.set(x.dataset.precedence,x),i=x)}i&&s.set(null,i)}u=n.instance,x=u.getAttribute("data-precedence"),f=s.get(x)||i,f===i&&s.set(null,u),s.set(x,u),this.count++,i=Oc.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),n.state.loading|=4}}var Oi={$$typeof:k,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function NR(e,n,s,i,u,f,x,R,F){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=yo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yo(0),this.hiddenUpdates=yo(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function Hv(e,n,s,i,u,f,x,R,F,oe,ue,de){return e=new NR(e,n,s,x,F,oe,ue,de,R),n=1,f===!0&&(n|=24),f=_n(3,null,null,n),e.current=f,f.stateNode=e,n=nd(),n.refCount++,e.pooledCache=n,n.refCount++,f.memoizedState={element:i,isDehydrated:s,cache:n},rd(f),e}function Uv(e){return e?(e=Za,e):Za}function Bv(e,n,s,i,u,f){u=Uv(u),i.context===null?i.context=u:i.pendingContext=u,i=xs(n),i.payload={element:s},f=f===void 0?null:f,f!==null&&(i.callback=f),s=Ss(e,i,n),s!==null&&(Cn(s,e,n),ai(s,e,n))}function Vv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<n?s:n}}function Ep(e,n){Vv(e,n),(e=e.alternate)&&Vv(e,n)}function Fv(e){if(e.tag===13||e.tag===31){var n=na(e,67108864);n!==null&&Cn(n,e,67108864),Ep(e,67108864)}}function Yv(e){if(e.tag===13||e.tag===31){var n=In();n=Mn(n);var s=na(e,n);s!==null&&Cn(s,e,n),Ep(e,n)}}var kc=!0;function kR(e,n,s,i){var u=P.T;P.T=null;var f=q.p;try{q.p=2,Cp(e,n,s,i)}finally{q.p=f,P.T=u}}function MR(e,n,s,i){var u=P.T;P.T=null;var f=q.p;try{q.p=8,Cp(e,n,s,i)}finally{q.p=f,P.T=u}}function Cp(e,n,s,i){if(kc){var u=Rp(i);if(u===null)fp(e,n,i,Mc,s),Gv(e,i);else if(_R(u,e,n,s,i))i.stopPropagation();else if(Gv(e,i),n&4&&-1<jR.indexOf(e)){for(;u!==null;){var f=Ba(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var x=ft(f.pendingLanes);if(x!==0){var R=f;for(R.pendingLanes|=2,R.entangledLanes|=2;x;){var F=1<<31-ct(x);R.entanglements[1]|=F,x&=~F}wo(f),(ht&6)===0&&(pc=le()+500,Si(0))}}break;case 31:case 13:R=na(f,2),R!==null&&Cn(R,f,2),mc(),Ep(f,2)}if(f=Rp(i),f===null&&fp(e,n,i,Mc,s),f===u)break;u=f}u!==null&&i.stopPropagation()}else fp(e,n,i,null,s)}}function Rp(e){return e=Af(e),Op(e)}var Mc=null;function Op(e){if(Mc=null,e=Ua(e),e!==null){var n=c(e);if(n===null)e=null;else{var s=n.tag;if(s===13){if(e=d(n),e!==null)return e;e=null}else if(s===31){if(e=g(n),e!==null)return e;e=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Mc=e,null}function qv(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"resize":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"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"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ve()){case he:return 2;case ce:return 8;case xe:case He:return 32;case Lt:return 268435456;default:return 32}default:return 32}}var Ap=!1,js=null,_s=null,Ds=null,Ai=new Map,Ni=new Map,zs=[],jR="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 Gv(e,n){switch(e){case"focusin":case"focusout":js=null;break;case"dragenter":case"dragleave":_s=null;break;case"mouseover":case"mouseout":Ds=null;break;case"pointerover":case"pointerout":Ai.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ni.delete(n.pointerId)}}function ki(e,n,s,i,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:n,domEventName:s,eventSystemFlags:i,nativeEvent:f,targetContainers:[u]},n!==null&&(n=Ba(n),n!==null&&Fv(n)),e):(e.eventSystemFlags|=i,n=e.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),e)}function _R(e,n,s,i,u){switch(n){case"focusin":return js=ki(js,e,n,s,i,u),!0;case"dragenter":return _s=ki(_s,e,n,s,i,u),!0;case"mouseover":return Ds=ki(Ds,e,n,s,i,u),!0;case"pointerover":var f=u.pointerId;return Ai.set(f,ki(Ai.get(f)||null,e,n,s,i,u)),!0;case"gotpointercapture":return f=u.pointerId,Ni.set(f,ki(Ni.get(f)||null,e,n,s,i,u)),!0}return!1}function Xv(e){var n=Ua(e.target);if(n!==null){var s=c(n);if(s!==null){if(n=s.tag,n===13){if(n=d(s),n!==null){e.blockedOn=n,ps(e.priority,function(){Yv(s)});return}}else if(n===31){if(n=g(s),n!==null){e.blockedOn=n,ps(e.priority,function(){Yv(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var s=Rp(e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);Of=i,s.target.dispatchEvent(i),Of=null}else return n=Ba(s),n!==null&&Fv(n),e.blockedOn=s,!1;n.shift()}return!0}function Kv(e,n,s){jc(e)&&s.delete(n)}function DR(){Ap=!1,js!==null&&jc(js)&&(js=null),_s!==null&&jc(_s)&&(_s=null),Ds!==null&&jc(Ds)&&(Ds=null),Ai.forEach(Kv),Ni.forEach(Kv)}function _c(e,n){e.blockedOn===n&&(e.blockedOn=null,Ap||(Ap=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,DR)))}var Dc=null;function $v(e){Dc!==e&&(Dc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Dc===e&&(Dc=null);for(var n=0;n<e.length;n+=3){var s=e[n],i=e[n+1],u=e[n+2];if(typeof i!="function"){if(Op(i||s)===null)continue;break}var f=Ba(s);f!==null&&(e.splice(n,3),n-=3,Rd(f,{pending:!0,data:u,method:s.method,action:i},i,u))}}))}function wr(e){function n(F){return _c(F,e)}js!==null&&_c(js,e),_s!==null&&_c(_s,e),Ds!==null&&_c(Ds,e),Ai.forEach(n),Ni.forEach(n);for(var s=0;s<zs.length;s++){var i=zs[s];i.blockedOn===e&&(i.blockedOn=null)}for(;0<zs.length&&(s=zs[0],s.blockedOn===null);)Xv(s),s.blockedOn===null&&zs.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(i=0;i<s.length;i+=3){var u=s[i],f=s[i+1],x=u[mn]||null;if(typeof f=="function")x||$v(s);else if(x){var R=null;if(f&&f.hasAttribute("formAction")){if(u=f,x=f[mn]||null)R=x.formAction;else if(Op(u)!==null)continue}else R=x.action;typeof R=="function"?s[i+1]=R:(s.splice(i,3),i-=3),$v(s)}}}function Wv(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(x){return u=x})},focusReset:"manual",scroll:"manual"})}function n(){u!==null&&(u(),u=null),i||setTimeout(s,20)}function s(){if(!i&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),u!==null&&(u(),u=null)}}}function Np(e){this._internalRoot=e}zc.prototype.render=Np.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));var s=n.current,i=In();Bv(s,i,e,n,null,null)},zc.prototype.unmount=Np.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Bv(e.current,2,null,e,null,null),mc(),n[Oo]=null}};function zc(e){this._internalRoot=e}zc.prototype.unstable_scheduleHydration=function(e){if(e){var n=bo();e={blockedOn:null,target:e,priority:n};for(var s=0;s<zs.length&&n!==0&&n<zs[s].priority;s++);zs.splice(s,0,e),s===0&&Xv(e)}};var Qv=o.version;if(Qv!=="19.2.4")throw Error(r(527,Qv,"19.2.4"));q.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=h(n),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var zR={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lc.isDisabled&&Lc.supportsFiber)try{Oe=Lc.inject(zR),Ye=Lc}catch{}}return ji.createRoot=function(e,n){if(!l(e))throw Error(r(299));var s=!1,i="",u=sb,f=ab,x=rb;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError)),n=Hv(e,1,!1,null,null,s,i,null,u,f,x,Wv),e[Oo]=n.current,up(e),new Np(n)},ji.hydrateRoot=function(e,n,s){if(!l(e))throw Error(r(299));var i=!1,u="",f=sb,x=ab,R=rb,F=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(R=s.onRecoverableError),s.formState!==void 0&&(F=s.formState)),n=Hv(e,1,!0,n,s??null,i,u,F,f,x,R,Wv),n.context=Uv(null),s=n.current,i=In(),i=Mn(i),u=xs(i),u.callback=null,Ss(s,u,i),s=i,n.current.lanes=s,vn(n,s),wo(n),e[Oo]=n.current,up(e),new zc(n)},ji.version="19.2.4",ji}var ix;function XR(){if(ix)return jp.exports;ix=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(o){console.error(o)}}return t(),jp.exports=GR(),jp.exports}var KR=XR();function oS(t){var o,a,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var l=t.length;for(o=0;o<l;o++)t[o]&&(a=oS(t[o]))&&(r&&(r+=" "),r+=a)}else for(a in t)t[a]&&(r&&(r+=" "),r+=a);return r}function $R(){for(var t,o,a=0,r="",l=arguments.length;a<l;a++)(t=arguments[a])&&(o=oS(t))&&(r&&(r+=" "),r+=o);return r}function lt(...t){return $R(t)}const lx={};function Qt(t,o){const a=b.useRef(lx);return a.current===lx&&(a.current=t(o)),a}const uh=[];let fh;function WR(){return fh}function QR(t){uh.push(t)}function il(t){const o=(a,r)=>{const l=Qt(ZR).current;let c;try{fh=l;for(const d of uh)d.before(l);c=t(a,r);for(const d of uh)d.after(l);l.didInitialize=!0}finally{fh=void 0}return c};return o.displayName=t.displayName||t.name,o}function Fh(t){return b.forwardRef(il(t))}function ZR(){return{didInitialize:!1}}function It(){}const po=Object.freeze([]),Tt=Object.freeze({}),JR=()=>{},we=typeof document<"u"?b.useLayoutEffect:JR;function eO(t,o){return function(r,...l){const c=new URL(t);return c.searchParams.set("code",r.toString()),l.forEach(d=>c.searchParams.append("args[]",d)),`${o} error #${r}; visit ${c} for the full message.`}}const At=eO("https://base-ui.com/production-error","Base UI"),sS=b.createContext(void 0);function Tu(t){const o=b.useContext(sS);if(o===void 0&&!t)throw new Error(At(72));return o}function Eu(t){b.useEffect(t,po)}const _i=0;class An{static create(){return new An}currentId=_i;start(o,a){this.clear(),this.currentId=setTimeout(()=>{this.currentId=_i,a()},o)}isStarted(){return this.currentId!==_i}clear=()=>{this.currentId!==_i&&(clearTimeout(this.currentId),this.currentId=_i)};disposeEffect=()=>this.clear}function nn(){const t=Qt(An.create).current;return Eu(t.disposeEffect),t}function tO(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:nO,platform:oO,maxTouchPoints:sO}=tO(),Cu=nO.toLowerCase(),$i=oO.toLowerCase(),Ru=/^i(os$|p)/.test($i)||$i==="macintel"&&sO>1,cx="android",dh=$i===cx||Cu.includes(cx),Yh=!Ru&&$i.startsWith("mac");$i.startsWith("win");const aO=Yh||Ru,cs=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!cs&&Cu.includes("firefox");!cs&&Cu.includes("chrom");const aS=aO,qh=/jsdom|happydom/.test(Cu);function To(t){t.preventDefault(),t.stopPropagation()}function rO(t){return"nativeEvent"in t}function Ou(t){return t.pointerType===""&&t.isTrusted?!0:dh&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Gh(t){return qh?!1:!dh&&t.width===0&&t.height===0||dh&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function Bs(t,o){const a=["mouse","pen"];return o||a.push("",void 0),a.includes(t)}function iO(t){const o=t.type;return o==="click"||o==="mousedown"||o==="keydown"||o==="keyup"}function Au(){return typeof window<"u"}function pn(t){return Xh(t)?(t.nodeName||"").toLowerCase():"#document"}function Et(t){var o;return(t==null||(o=t.ownerDocument)==null?void 0:o.defaultView)||window}function us(t){var o;return(o=(Xh(t)?t.ownerDocument:t.document)||window.document)==null?void 0:o.documentElement}function Xh(t){return Au()?t instanceof Node||t instanceof Et(t).Node:!1}function et(t){return Au()?t instanceof Element||t instanceof Et(t).Element:!1}function yt(t){return Au()?t instanceof HTMLElement||t instanceof Et(t).HTMLElement:!1}function Nr(t){return!Au()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Et(t).ShadowRoot}function ll(t){const{overflow:o,overflowX:a,overflowY:r,display:l}=Un(t);return/auto|scroll|overlay|hidden|clip/.test(o+r+a)&&l!=="inline"&&l!=="contents"}function lO(t){return/^(table|td|th)$/.test(pn(t))}function Nu(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const cO=/transform|translate|scale|rotate|perspective|filter/,uO=/paint|layout|strict|content/,ma=t=>!!t&&t!=="none";let Lp;function Kh(t){const o=et(t)?Un(t):t;return ma(o.transform)||ma(o.translate)||ma(o.scale)||ma(o.rotate)||ma(o.perspective)||!$h()&&(ma(o.backdropFilter)||ma(o.filter))||cO.test(o.willChange||"")||uO.test(o.contain||"")}function fO(t){let o=ts(t);for(;yt(o)&&!Wo(o);){if(Kh(o))return o;if(Nu(o))return null;o=ts(o)}return null}function $h(){return Lp==null&&(Lp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Lp}function Wo(t){return/^(html|body|#document)$/.test(pn(t))}function Un(t){return Et(t).getComputedStyle(t)}function ku(t){return et(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ts(t){if(pn(t)==="html")return t;const o=t.assignedSlot||t.parentNode||Nr(t)&&t.host||us(t);return Nr(o)?o.host:o}function rS(t){const o=ts(t);return Wo(o)?(t.ownerDocument||t).body:yt(o)&&ll(o)?o:rS(o)}function Wi(t,o,a){var r;o===void 0&&(o=[]),a===void 0&&(a=!0);const l=rS(t),c=l===((r=t.ownerDocument)==null?void 0:r.body),d=Et(l);if(c){const g=ph(d);return o.concat(d,d.visualViewport||[],ll(l)?l:[],g&&a?Wi(g):[])}else return o.concat(l,Wi(l,[],a))}function ph(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function tn(t){let o=t.activeElement;for(;o?.shadowRoot?.activeElement!=null;)o=o.shadowRoot.activeElement;return o}function De(t,o){if(!t||!o)return!1;const a=o.getRootNode?.();if(t.contains(o))return!0;if(a&&Nr(a)){let r=o;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function zt(t){return"composedPath"in t?t.composedPath()[0]??t.target:t.target}const hh="data-base-ui-focusable",iS="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Mu="ArrowLeft",ju="ArrowRight",lS="ArrowUp",Wh="ArrowDown",cS="data-starting-style",dO="data-ending-style",pO={[cS]:""},hO={[dO]:""},cl={transitionStatus(t){return t==="starting"?pO:t==="ending"?hO:null}},mO="data-open",gO="data-closed",yO="data-anchor-hidden",uS="data-popup-open",bO="data-pressed",vO={[uS]:""},xO={[uS]:"",[bO]:""},SO={[mO]:""},wO={[gO]:""},TO={[yO]:""},_u={open(t){return t?vO:null}},nu={open(t){return t?xO:null}},ul={open(t){return t?SO:wO},anchorHidden(t){return t?TO:null}},Du={...ul,...cl},mh="data-trigger-disabled";function ou(t,o){if(!et(t))return!1;const a=t;if(o.hasElement(a))return!a.hasAttribute(mh);for(const[,r]of o.entries())if(De(r,a))return!r.hasAttribute(mh);return!1}function Pp(t,o){if(o==null)return!1;if("composedPath"in t)return t.composedPath().includes(o);const a=t;return a.target!=null&&o.contains(a.target)}function EO(t){return t.matches("html,body")}function zu(t){return yt(t)&&t.matches(iS)}function CO(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${iS}`)!=null}function gh(t){return t?t.getAttribute("role")==="combobox"&&zu(t):!1}function su(t){if(!t||qh)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function au(t){return t?t.hasAttribute(hh)?t:t.querySelector(`[${hh}]`)||t:null}function RO(t,o){return o!=null&&!Bs(o)?0:typeof t=="function"?t():t}function Ra(t,o,a){const r=RO(t,a);return typeof r=="number"?r:r?.[o]}function ux(t){return typeof t=="function"?t():t}function fS(t,o){return o||t==="click"||t==="mousedown"}function OO(t){return t?.includes("mouse")&&t!=="mousedown"}const ns="none",os="trigger-press",Bt="trigger-hover",Er="trigger-focus",Lu="outside-press",Fi="item-press",dS="close-press",Fs="focus-out",fl="escape-key",ru="list-navigation",pS="cancel-open",Ii="sibling-open",AO="disabled",Pu="imperative-action",NO="window-resize";function qe(t,o,a,r){let l=!1,c=!1;const d=Tt;return{reason:t,event:o??new Event("base-ui"),cancel(){l=!0},allowPropagation(){c=!0},get isCanceled(){return l},get isPropagationAllowed(){return c},trigger:a,...d}}const hS=b.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new An,currentIdRef:{current:null},currentContextRef:{current:null}});function kO(t,o){t.current=o.current}function MO(t){const{children:o,delay:a,timeoutMs:r=0}=t,l=b.useRef(a),c=b.useRef(a),d=b.useRef(null),g=b.useRef(null),m=nn();return we(()=>{if(c.current=a,!d.current){l.current=a;return}l.current={open:Ra(l.current,"open"),close:Ra(a,"close")}},[a,d,l,c]),p.jsx(hS.Provider,{value:b.useMemo(()=>({hasProvider:!0,delayRef:l,initialDelayRef:c,currentIdRef:d,timeoutMs:r,currentContextRef:g,timeout:m}),[r,m]),children:o})}function jO(t,o={open:!1}){const{open:a}=o,r="rootStore"in t?t.rootStore:t,l=r.useState("floatingId"),c=b.useContext(hS),{currentIdRef:d,delayRef:g,timeoutMs:m,initialDelayRef:h,currentContextRef:y,hasProvider:v,timeout:S}=c,[w,T]=b.useState(!1),O=b.useRef(a);return we(()=>{O.current=a},[a]),we(()=>{function A(){y.current?.setIsInstantPhase(!1),d.current=null,y.current=null,g.current=h.current,S.clear()}if(d.current&&!a&&d.current===l){if(T(!1),m){const C=l;return S.start(m,()=>{r.select("open")||d.current&&d.current!==C||A()}),()=>{(O.current||d.current!==C)&&S.clear()}}A()}},[a,l,d,g,m,h,y,S,r]),we(()=>{if(!a)return;const A=y.current,C=d.current;S.clear(),y.current={onOpenChange:r.setOpen,setIsInstantPhase:T},d.current=l,g.current={open:0,close:Ra(h.current,"close")},C!==null&&C!==l?(T(!0),A?.setIsInstantPhase(!0),A?.onOpenChange(!1,qe(ns))):(T(!1),A?.setIsInstantPhase(!1))},[a,l,r,d,g,h,y,S]),we(()=>()=>{if(d.current===l){if(y.current=null,!O.current)return;d.current=null,kO(g,h),S.clear()}},[y,d,g,l,h,S]),b.useMemo(()=>({activeIdRef:d,hasProvider:v,delayRef:g,isInstantPhase:w}),[d,v,g,w])}function Ge(t,o,a,r){return t.addEventListener(o,a,r),()=>{t.removeEventListener(o,a,r)}}function fo(...t){return()=>{for(let o=0;o<t.length;o+=1){const a=t[o];a&&a()}}}function ss(t,o,a,r){const l=Qt(mS).current;return DO(l,t,o,a,r)&&gS(l,[t,o,a,r]),l.callback}function _O(t){const o=Qt(mS).current;return zO(o,t)&&gS(o,t),o.callback}function mS(){return{callback:null,cleanup:null,refs:[]}}function DO(t,o,a,r,l){return t.refs[0]!==o||t.refs[1]!==a||t.refs[2]!==r||t.refs[3]!==l}function zO(t,o){return t.refs.length!==o.length||t.refs.some((a,r)=>a!==o[r])}function gS(t,o){if(t.refs=o,o.every(a=>a==null)){t.callback=null;return}t.callback=a=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),a!=null){const r=Array(o.length).fill(null);for(let l=0;l<o.length;l+=1){const c=o[l];if(c!=null)switch(typeof c){case"function":{const d=c(a);typeof d=="function"&&(r[l]=d);break}case"object":{c.current=a;break}}}t.cleanup=()=>{for(let l=0;l<o.length;l+=1){const c=o[l];if(c!=null)switch(typeof c){case"function":{const d=r[l];typeof d=="function"?d():c(null);break}case"object":{c.current=null;break}}}}}}}function Vt(t){const o=Qt(LO,t).current;return o.next=t,we(o.effect),o}function LO(t){const o={current:t,next:t,effect:()=>{o.current=o.next}};return o}const Qh={...VR},Ip=Qh.useInsertionEffect,PO=Ip&&Ip!==Qh.useLayoutEffect?Ip:t=>t();function ke(t){const o=Qt(IO).current;return o.next=t,PO(o.effect),o.trampoline}function IO(){const t={next:void 0,callback:HO,trampoline:(...o)=>t.callback?.(...o),effect:()=>{t.callback=t.next}};return t}function HO(){}const Pc=null;class UO{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=o=>{this.isScheduled=!1;const a=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let l=0;l<a.length;l+=1)a[l]?.(o)};request(o){const a=this.nextId;return this.nextId+=1,this.callbacks.push(o),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),a}cancel(o){const a=o-this.startId;a<0||a>=this.callbacks.length||this.callbacks[a]!==null&&(this.callbacks[a]=null,this.callbacksCount-=1)}}let Ic=new UO;class Eo{static create(){return new Eo}static request(o){return Ic.request(o)}static cancel(o){return Ic.cancel(o)}currentId=Pc;request(o){this.cancel(),this.currentId=Ic.request(()=>{this.currentId=Pc,o()})}cancel=()=>{this.currentId!==Pc&&(Ic.cancel(this.currentId),this.currentId=Pc)};disposeEffect=()=>this.cancel}function kr(){const t=Qt(Eo.create).current;return Eu(t.disposeEffect),t}function We(t){return t?.ownerDocument||document}const yS={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Iu={...yS,position:"fixed",top:0,left:0},bS={...yS,position:"absolute"},as=b.forwardRef(function(o,a){const[r,l]=b.useState();we(()=>{aS&&cs&&l("button")},[]);const c={tabIndex:0,role:r};return p.jsx("span",{...o,ref:a,style:Iu,"aria-hidden":r?void 0:!0,...c,"data-base-ui-focus-guard":""})}),Mr=Math.min,Qo=Math.max,iu=Math.round,Hc=Math.floor,Zo=t=>({x:t,y:t}),BO={left:"right",right:"left",bottom:"top",top:"bottom"};function vS(t,o,a){return Qo(t,Mr(o,a))}function Ys(t,o){return typeof t=="function"?t(o):t}function to(t){return t.split("-")[0]}function rs(t){return t.split("-")[1]}function Zh(t){return t==="x"?"y":"x"}function Jh(t){return t==="y"?"height":"width"}function eo(t){const o=t[0];return o==="t"||o==="b"?"y":"x"}function em(t){return Zh(eo(t))}function VO(t,o,a){a===void 0&&(a=!1);const r=rs(t),l=em(t),c=Jh(l);let d=l==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return o.reference[c]>o.floating[c]&&(d=lu(d)),[d,lu(d)]}function FO(t){const o=lu(t);return[yh(t),o,yh(o)]}function yh(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const fx=["left","right"],dx=["right","left"],YO=["top","bottom"],qO=["bottom","top"];function GO(t,o,a){switch(t){case"top":case"bottom":return a?o?dx:fx:o?fx:dx;case"left":case"right":return o?YO:qO;default:return[]}}function XO(t,o,a,r){const l=rs(t);let c=GO(to(t),a==="start",r);return l&&(c=c.map(d=>d+"-"+l),o&&(c=c.concat(c.map(yh)))),c}function lu(t){const o=to(t);return BO[o]+t.slice(o.length)}function KO(t){var o,a,r,l;return{top:(o=t.top)!=null?o:0,right:(a=t.right)!=null?a:0,bottom:(r=t.bottom)!=null?r:0,left:(l=t.left)!=null?l:0}}function xS(t){return typeof t!="number"?KO(t):{top:t,right:t,bottom:t,left:t}}function Qi(t){const{x:o,y:a,width:r,height:l}=t;return{width:r,height:l,top:a,left:o,right:o+r,bottom:a+l,x:o,y:a}}function Yi(t,o){return o<0||o>=t.length}function Zc(t,o){return $o(t.current,{disabledIndices:o})}function bh(t,o){return $o(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:o})}function $o(t,{startingIndex:o=-1,decrement:a=!1,disabledIndices:r,amount:l=1}={}){let c=o;do c+=a?-l:l;while(c>=0&&c<=t.length-1&&Cr(t,c,r));return c}function Cr(t,o,a){if(typeof a=="function"?a(o):a?.includes(o)??!1)return!0;const l=t[o];return l?!Hu(l)||l.matches(":disabled")?!0:!a&&(l.hasAttribute("disabled")||l.getAttribute("aria-disabled")==="true"):!1}function $O(t){return t.visibility==="hidden"||t.visibility==="collapse"}function Hu(t,o=t?Un(t):null){return!t||!t.isConnected||!o||$O(o)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():o.display!=="none"&&o.display!=="contents"}const WO='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function QO(t){const o=t.assignedSlot;if(o)return o;if(t.parentElement)return t.parentElement;const a=t.getRootNode();return Nr(a)?a.host:null}function vh(t){for(const o of Array.from(t.children))if(pn(o)==="summary")return o;return null}function ZO(t,o){const a=vh(o);return!!a&&(t===a||De(a,t))}function SS(t){const o=t?pn(t):"";return t!=null&&t.matches(WO)&&(o!=="summary"||t.parentElement!=null&&pn(t.parentElement)==="details"&&vh(t.parentElement)===t)&&(o!=="details"||vh(t)==null)&&(o!=="input"||t.type!=="hidden")}function wS(t){if(!SS(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let o=t;o;o=QO(o)){const a=o!==t,r=pn(o)==="slot";if(o.hasAttribute("inert")||a&&pn(o)==="details"&&!o.open&&!ZO(t,o)||o.hasAttribute("hidden")||!r&&!JO(o,a))return!1}return!0}function JO(t,o){const a=Un(t);return o?a.display!=="none":Hu(t,a)}function TS(t){const o=t.tabIndex;if(o<0){const a=pn(t);if(a==="details"||a==="audio"||a==="video"||yt(t)&&t.isContentEditable)return 0}return o}function Hp(t){if(pn(t)!=="input")return null;const o=t;return o.type==="radio"&&o.name!==""?o:null}function eA(t,o){const a=Hp(t);if(!a)return!0;const r=o.find(l=>{const c=Hp(l);return c?.name===a.name&&c.form===a.form&&c.checked});return r?r===a:o.find(l=>{const c=Hp(l);return c?.name===a.name&&c.form===a.form})===a}function ES(t){if(yt(t)&&pn(t)==="slot"){const o=t.assignedElements({flatten:!0});if(o.length>0)return o}return yt(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function CS(t,o){ES(t).forEach(a=>{SS(a)&&o.push(a),CS(a,o)})}function RS(t,o,a){ES(t).forEach(r=>{yt(r)&&r.matches(o)&&a.push(r),RS(r,o,a)})}function tm(t){return wS(t)&&TS(t)>=0}function OS(t){const o=[];return CS(t,o),o.filter(wS)}function dl(t){const o=OS(t);return o.filter(a=>TS(a)>=0&&eA(a,o))}function AS(t,o){const a=dl(t),r=a.length;if(r===0)return;const l=tn(We(t)),c=a.indexOf(l),d=c===-1?o===1?0:r-1:c+o;return a[d]}function nm(t){return AS(We(t).body,1)||t}function NS(t){return AS(We(t).body,-1)||t}function kS(t,o){if(!t)return null;const a=dl(We(t).body),r=a.length;if(r===0)return null;const l=a.indexOf(t);if(l===-1)return null;const c=(l+o+r)%r;return a[c]}function tA(t){return kS(t,1)}function nA(t){return kS(t,-1)}function Rr(t,o){const a=o||t.currentTarget,r=t.relatedTarget;return!r||!De(a,r)}function oA(t){dl(t).forEach(a=>{a.dataset.tabindex=a.getAttribute("tabindex")||"",a.setAttribute("tabindex","-1")})}function px(t){const o=[];RS(t,"[data-tabindex]",o),o.forEach(a=>{const r=a.dataset.tabindex;delete a.dataset.tabindex,r?a.setAttribute("tabindex",r):a.removeAttribute("tabindex")})}function qs(t,o,a=!0){return t.filter(l=>l.parentId===o).flatMap(l=>[...!a||l.context?.open?[l]:[],...qs(t,l.id,a)])}function hx(t,o){let a=[],r=t.find(l=>l.id===o)?.parentId;for(;r;){const l=t.find(c=>c.id===r);r=l?.parentId,l&&(a=a.concat(l))}return a}function Zi(t){return`data-base-ui-${t}`}let Uc=0;function Jc(t,o={}){const{preventScroll:a=!1,sync:r=!1,shouldFocus:l}=o;cancelAnimationFrame(Uc);function c(){l&&!l()||t?.focus({preventScroll:a})}if(r)return c(),It;const d=requestAnimationFrame(c);return Uc=d,()=>{Uc===d&&(cancelAnimationFrame(d),Uc=0)}}const Up={inert:new WeakMap,"aria-hidden":new WeakMap},mx="data-base-ui-inert",xh={inert:new WeakSet,"aria-hidden":new WeakSet};let Di=new WeakMap,Bp=0;function sA(t){return xh[t]}function MS(t){return t?Nr(t)?t.host:MS(t.parentNode):null}const gx=(t,o)=>o.map(a=>{if(t.contains(a))return a;const r=MS(a);return t.contains(r)?r:null}).filter(a=>a!=null),yx=t=>{const o=new Set;return t.forEach(a=>{let r=a;for(;r&&!o.has(r);)o.add(r),r=r.parentNode}),o},bx=(t,o,a)=>{const r=[],l=c=>{!c||a.has(c)||Array.from(c.children).forEach(d=>{pn(d)!=="script"&&(o.has(d)?l(d):r.push(d))})};return l(t),r};function aA(t,o,a,r,{mark:l=!0}){let c=null;r?c="inert":a&&(c="aria-hidden");let d=null,g=null;const m=gx(o,t),h=l?bx(o,yx(m),new Set(m)):[],y=[],v=[];if(c){const S=Up[c],w=sA(c);g=w,d=S;const T=gx(o,Array.from(o.querySelectorAll("[aria-live]"))),O=m.concat(T);bx(o,yx(O),new Set(O)).forEach(C=>{const _=C.getAttribute(c),k=_!==null&&_!=="false",j=(S.get(C)||0)+1;S.set(C,j),y.push(C),j===1&&k&&w.add(C),k||C.setAttribute(c,c==="inert"?"":"true")})}return l&&h.forEach(S=>{const w=(Di.get(S)||0)+1;Di.set(S,w),v.push(S),w===1&&S.setAttribute(mx,"")}),Bp+=1,()=>{d&&y.forEach(S=>{const T=(d.get(S)||0)-1;d.set(S,T),T||(!g?.has(S)&&c&&S.removeAttribute(c),g?.delete(S))}),l&&v.forEach(S=>{const w=(Di.get(S)||0)-1;Di.set(S,w),w||S.removeAttribute(mx)}),Bp-=1,Bp||(Up.inert=new WeakMap,Up["aria-hidden"]=new WeakMap,xh.inert=new WeakSet,xh["aria-hidden"]=new WeakSet,Di=new WeakMap)}}function vx(t,o={}){const{ariaHidden:a=!1,inert:r=!1,mark:l=!0}=o,c=We(t[0]).body;return aA(t,c,a,r,{mark:l})}var oo=nS();let xx=0;function rA(t,o="mui"){const[a,r]=b.useState(t),l=t||a;return b.useEffect(()=>{a==null&&(xx+=1,r(`${o}-${xx}`))},[a,o]),l}const Sx=Qh.useId;function Gs(t,o){if(Sx!==void 0){const a=Sx();return t??(o?`${o}-${a}`:a)}return rA(t,o)}const iA=parseInt(b.version,10);function om(t){return iA>=t}function wx(t){if(!b.isValidElement(t))return null;const o=t,a=o.props;return(om(19)?a?.ref:o.ref)??null}function Sh(t,o){if(t&&!o)return t;if(!t&&o)return o;if(t||o)return{...t,...o}}function lA(t,o){const a={};for(const r in t){const l=t[r];if(o?.hasOwnProperty(r)){const c=o[r](l);c!=null&&Object.assign(a,c);continue}l===!0?a[`data-${r.toLowerCase()}`]="":l&&(a[`data-${r.toLowerCase()}`]=l.toString())}return a}function cA(t,o){return typeof t=="function"?t(o):t}function uA(t,o){return typeof t=="function"?t(o):t}const sm={};function no(t,o,a,r,l){if(!a&&!r&&!l&&!t)return cu(o);let c=cu(t);return o&&(c=Hi(c,o)),a&&(c=Hi(c,a)),r&&(c=Hi(c,r)),l&&(c=Hi(c,l)),c}function fA(t){if(t.length===0)return sm;if(t.length===1)return cu(t[0]);let o=cu(t[0]);for(let a=1;a<t.length;a+=1)o=Hi(o,t[a]);return o}function cu(t){return am(t)?{..._S(t,sm)}:dA(t)}function Hi(t,o){return am(o)?_S(o,t):pA(t,o)}function dA(t){const o={...t};for(const a in o){const r=o[a];jS(a,r)&&(o[a]=DS(r))}return o}function pA(t,o){if(!o)return t;for(const a in o){const r=o[a];switch(a){case"style":{t[a]=Sh(t.style,r);break}case"className":{t[a]=zS(t.className,r);break}default:jS(a,r)?t[a]=hA(t[a],r):t[a]=r}}return t}function jS(t,o){const a=t.charCodeAt(0),r=t.charCodeAt(1),l=t.charCodeAt(2);return a===111&&r===110&&l>=65&&l<=90&&(typeof o=="function"||typeof o>"u")}function am(t){return typeof t=="function"}function _S(t,o){return am(t)?t(o):t??sm}function hA(t,o){return o?t?(...a)=>{const r=a[0];if(LS(r)){const c=r;uu(c);const d=o(...a);return c.baseUIHandlerPrevented||t?.(...a),d}const l=o(...a);return t?.(...a),l}:DS(o):t}function DS(t){return t&&((...o)=>{const a=o[0];return LS(a)&&uu(a),t(...o)})}function uu(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function zS(t,o){return o?t?o+" "+t:o:t}function LS(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function tt(t,o,a={}){let r=o.render;a.enabled!==!1&&(r=bA(r));const l=mA(o,a,r);if(a.enabled===!1)return null;const c=a.state??Tt;return vA(t,r,l,c)}function mA(t,o,a){const{className:r,style:l}=t,{state:c=Tt,ref:d,props:g,stateAttributesMapping:m,enabled:h=!0}=o,y=h?cA(r,c):void 0,v=h?uA(l,c):void 0,S=h?lA(c,m):Tt,w=h&&g?gA(g):void 0,T=h?Sh(S,w)??{}:Tt;return typeof document<"u"&&(h?Array.isArray(d)?T.ref=_O([T.ref,wx(a),...d]):T.ref=ss(T.ref,wx(a),d):ss(null,null)),h?(y!==void 0&&(T.className=zS(T.className,y)),v!==void 0&&(T.style=Sh(T.style,v)),T):Tt}function gA(t){return Array.isArray(t)?fA(t):no(void 0,t)}const yA=Symbol.for("react.lazy");function bA(t){if(t?.$$typeof!==yA)return t;const o=b.Children.toArray(t)[0];return b.isValidElement(o)?o:t}function vA(t,o,a,r){if(o){if(typeof o=="function")return o(a,r);const l=no(a,o.props);return l.ref=a.ref,b.cloneElement(o,l)}if(t&&typeof t=="string")return xA(t,a);throw new Error(At(8))}function xA(t,o){return t==="button"?b.createElement("button",{type:"button",...o,key:o.key}):t==="img"?b.createElement("img",{alt:"",...o,key:o.key}):b.createElement(t,o)}const SA=500,PS=500,wA={style:{transition:"none"}},IS="data-base-ui-click-trigger",TA="data-base-ui-swipe-ignore",EA="data-swipe-ignore",CA=`[${TA}]`,RA=`[${EA}]`,HS={fallbackAxisSide:"none"},rm={fallbackAxisSide:"end"},OA={clipPath:"inset(50%)",position:"fixed",top:0,left:0},US=b.createContext(null),BS=()=>b.useContext(US),AA=Zi("portal");function VS(t={}){const{ref:o,container:a,componentProps:r=Tt,elementProps:l}=t,c=Gs(),g=BS()?.portalNode,[m,h]=b.useState(null),[y,v]=b.useState(null),S=ke(A=>{A!==null&&v(A)}),w=b.useRef(null);we(()=>{if(a===null){w.current&&(w.current=null,v(null),h(null));return}const A=(a&&(Xh(a)?a:a.current))??g??document.body;if(A==null){w.current&&(w.current=null,v(null),h(null));return}w.current!==A&&(w.current=A,v(null),h(A))},[a,g]);const T=tt("div",r,{ref:[o,S],props:[{id:c,[AA]:""},l]}),O=m&&T?oo.createPortal(T,m):null;return{node:y,nodeId:b.isValidElement(T)?T.props.id:void 0,subtree:O}}const Uu=b.forwardRef(function(o,a){const{render:r,className:l,style:c,children:d,container:g,portalOwnerRole:m,...h}=o,{node:y,nodeId:v,subtree:S}=VS({container:g,ref:a,componentProps:o,elementProps:h}),w=b.useRef(null),T=b.useRef(null),O=b.useRef(null),A=b.useRef(null),[C,_]=b.useState(null),k=b.useRef(!1),j=C?.modal,z=C?.open,D=!!C&&!C.modal&&C.open&&!!y;b.useEffect(()=>{if(!y||j)return;function B(Y){y&&Y.relatedTarget&&Rr(Y)&&(Y.type==="focusin"?k.current&&(px(y),k.current=!1):(oA(y),k.current=!0))}return fo(Ge(y,"focusin",B,!0),Ge(y,"focusout",B,!0))},[y,j]),we(()=>{!y||z!==!0||!k.current||(px(y),k.current=!1)},[z,y]);const L=b.useMemo(()=>({beforeOutsideRef:w,afterOutsideRef:T,beforeInsideRef:O,afterInsideRef:A,portalNode:y,setFocusManagerState:_}),[y]);return p.jsxs(b.Fragment,{children:[S,p.jsxs(US.Provider,{value:L,children:[D&&y&&p.jsx(as,{"data-type":"outside",ref:w,onFocus:B=>{if(Rr(B,y))O.current?.focus();else{const Y=C?C.domReference:null;NS(Y)?.focus()}}}),D&&y&&p.jsx("span",{role:m,"aria-owns":v,style:OA}),y&&oo.createPortal(d,y),D&&y&&p.jsx(as,{"data-type":"outside",ref:T,onFocus:B=>{if(Rr(B,y))A.current?.focus();else{const Y=C?C.domReference:null;nm(Y)?.focus(),C?.closeOnFocusOut&&C?.onOpenChange(!1,qe(Fs,B.nativeEvent))}}})]})]})});function FS(){const t=new Map;return{emit(o,a){t.get(o)?.forEach(r=>r(a))},on(o,a){t.has(o)||t.set(o,new Set),t.get(o).add(a)},off(o,a){t.get(o)?.delete(a)}}}class im{nodesRef={current:[]};events=FS();addNode(o){this.nodesRef.current.push(o)}removeNode(o){const a=this.nodesRef.current.findIndex(r=>r===o);a!==-1&&this.nodesRef.current.splice(a,1)}}const YS=b.createContext(null),qS=b.createContext(null),Xs=()=>b.useContext(YS)?.id||null,Ks=t=>{const o=b.useContext(qS);return t??o};function lm(t){const o=Gs(),a=Ks(t),r=Xs();return we(()=>{if(!o)return;const l={id:o,parentId:r};return a?.addNode(l),()=>{a?.removeNode(l)}},[a,o,r]),o}function GS(t){const{children:o,id:a}=t,r=Xs();return p.jsx(YS.Provider,{value:b.useMemo(()=>({id:a,parentId:r}),[a,r]),children:o})}function XS(t){const{children:o,externalTree:a}=t,r=Qt(()=>a??new im).current;return p.jsx(qS.Provider,{value:r,children:o})}function Go(t){return t==null?t:"current"in t?t.current:t}function NA(t,o){const a=Et(zt(t));return t instanceof a.KeyboardEvent?"keyboard":t instanceof a.FocusEvent?o||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof a.MouseEvent?o||(t.detail===0?"keyboard":"mouse"):""}const Tx=20;let Us=[];function cm(){Us=Us.filter(t=>t.deref()?.isConnected)}function Ex(t){cm(),t&&pn(t)!=="body"&&(Us.push(new WeakRef(t)),Us.length>Tx&&(Us=Us.slice(-Tx)))}function Cx(){return cm(),Us[Us.length-1]?.deref()}function kA(t){return t?tm(t)?t:dl(t)[0]||t:null}function Rx(t){if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!t.getAttribute("role")?.includes("dialog"))return;const a=OS(t).filter(l=>{const c=l.getAttribute("data-tabindex")||"";return tm(l)||l.hasAttribute("data-tabindex")&&!c.startsWith("-")}),r=t.getAttribute("tabindex");a.length===0?r!=="0"&&(t.setAttribute("tabindex","0"),t.setAttribute("data-tabindex","0")):(r!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function Bu(t){const{context:o,children:a,disabled:r=!1,initialFocus:l=!0,returnFocus:c=!0,restoreFocus:d=!1,modal:g=!0,closeOnFocusOut:m=!0,openInteractionType:h="",nextFocusableElement:y,previousFocusableElement:v,beforeContentFocusGuardRef:S,externalTree:w,getInsideElements:T}=t,O="rootStore"in o?o.rootStore:o,A=O.useState("open"),C=O.useState("domReferenceElement"),_=O.useState("floatingElement"),{events:k,dataRef:j}=O.context,z=ke(()=>j.current.floatingContext?.nodeId),D=l===!1,L=gh(C)&&D,B=Vt(l),Y=Vt(c),U=Vt(h),I=Vt(A),M=Ks(w),H=BS(),ee=b.useRef(!1),K=b.useRef(!1),P=b.useRef(!1),q=b.useRef(null),X=b.useRef(""),Z=b.useRef(""),W=b.useRef(null),N=b.useRef(null),V=ss(W,S,H?.beforeInsideRef),J=ss(N,H?.afterInsideRef),$=nn(),se=nn(),re=kr(),me=H!=null,pe=au(_),be=ke((ye=pe)=>ye?dl(ye):[]),Ce=ke(()=>T?.().filter(ye=>ye!=null)??[]);b.useEffect(()=>{if(r||!g)return;function ye(Te){Te.key==="Tab"&&De(pe,tn(We(pe)))&&be().length===0&&!L&&To(Te)}const ge=We(pe);return Ge(ge,"keydown",ye)},[r,pe,g,L,be]),b.useEffect(()=>{if(r||!A)return;const ye=We(pe);function ge(){P.current=!1}function Te(Ue){const Ee=zt(Ue),Le=Ce(),Se=De(_,Ee)||De(C,Ee)||De(H?.portalNode,Ee)||Le.some(Re=>Re===Ee||De(Re,Ee));P.current=!Se,Z.current=Ue.pointerType||"keyboard",Ee?.closest(`[${IS}]`)&&(K.current=!0,se.start(0,()=>{K.current=!1}))}function Ae(){Z.current="keyboard"}return fo(Ge(ye,"pointerdown",Te,!0),Ge(ye,"pointerup",ge,!0),Ge(ye,"pointercancel",ge,!0),Ge(ye,"keydown",Ae,!0),ge)},[r,_,C,pe,A,H,se,Ce]),b.useEffect(()=>{if(r||!m)return;const ye=We(pe);function ge(){K.current=!0,se.start(0,()=>{K.current=!1})}function Te(Le){const Se=zt(Le);tm(Se)&&(q.current=Se)}function Ae(Le){const Se=Le.relatedTarget,Re=Le.currentTarget,Ne=zt(Le);g&&Se==null&&Ne!=null&&De(_,Ne)&&Ex(Ne),queueMicrotask(()=>{const Ie=z(),je=O.context.triggerElements,le=Ce(),ve=Se?.hasAttribute(Zi("focus-guard"))&&[W.current,N.current,H?.beforeInsideRef.current,H?.afterInsideRef.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,Go(v),Go(y)].includes(Se),he=!(De(C,Se)||De(_,Se)||De(Se,_)||De(H?.portalNode,Se)||le.some(ce=>ce===Se||De(ce,Se))||je.hasMatchingElement(ce=>De(ce,Se))||ve||M&&(qs(M.nodesRef.current,Ie).find(ce=>De(ce.context?.elements.floating,Se)||De(ce.context?.elements.domReference,Se))||hx(M.nodesRef.current,Ie).find(ce=>[ce.context?.elements.floating,au(ce.context?.elements.floating)].includes(Se)||ce.context?.elements.domReference===Se)));if(Re===C&&pe&&Rx(pe),d&&Re!==C&&!Hu(Ne)&&tn(ye)===ye.body){if(yt(pe)&&(pe.focus(),d==="popup")){re.request(()=>{pe.focus()});return}const ce=be(),xe=q.current,He=(xe&&ce.includes(xe)?xe:null)||ce[ce.length-1]||pe;yt(He)&&He.focus()}if(j.current.insideReactTree){j.current.insideReactTree=!1;return}(L||!g)&&Se&&he&&!K.current&&(L||Se!==Cx())&&(ee.current=!0,O.setOpen(!1,qe(Fs,Le)))})}function Ue(){P.current||(j.current.insideReactTree=!0,$.start(0,()=>{j.current.insideReactTree=!1}))}const Ee=yt(C)?C:null;if(!(!_&&!Ee))return fo(Ee&&Ge(Ee,"focusout",Ae),Ee&&Ge(Ee,"pointerdown",ge),_&&Ge(_,"focusin",Te),_&&Ge(_,"focusout",Ae),_&&H&&Ge(_,"focusout",Ue,!0))},[r,C,_,pe,g,M,H,O,m,d,be,L,z,j,$,se,re,y,v,Ce]),b.useEffect(()=>{if(r||!_||!A)return;const ye=Array.from(H?.portalNode?.querySelectorAll(`[${Zi("portal")}]`)||[]),Te=(M?hx(M.nodesRef.current,z()):[]).find(Re=>gh(Re.context?.elements.domReference||null))?.context?.elements.domReference,Ue=[...[_,...ye,W.current,N.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,...Ce()],Te,Go(v),Go(y),L?C:null].filter(Re=>Re!=null),Ee=vx(Ue,{ariaHidden:g||L,mark:!1}),Le=[_,...ye].filter(Re=>Re!=null),Se=vx(Le);return()=>{Se(),Ee()}},[A,r,C,_,g,H,L,M,z,y,v,Ce]),we(()=>{if(!A||r||!yt(pe))return;X.current="",Z.current="";const ye=We(pe),ge=tn(ye);queueMicrotask(()=>{const Te=B.current,Ae=typeof Te=="function"?Te(U.current||""):Te;if(Ae===void 0||Ae===!1||De(pe,ge))return;let Ee=null;const Le=()=>(Ee==null&&(Ee=be(pe)),Ee[0]||pe);let Se;Ae===!0||Ae===null?Se=Le():Se=Go(Ae),Se=Se||Le();const Re=De(pe,tn(ye));Jc(Se,{preventScroll:Se===pe,shouldFocus(){if(!I.current)return!1;if(Re)return!0;const Ne=tn(ye);return!(Ne!==Se&&De(pe,Ne))}})})},[r,A,pe,be,B,U,I]),we(()=>{if(r||!pe)return;const ye=We(pe),ge=tn(ye),Te=U.current==null;Ex(ge);function Ae(Ee){if(Ee.open||(X.current=NA(Ee.nativeEvent,Z.current)),Ee.reason===Bt&&Ee.nativeEvent.type==="mouseleave"&&(ee.current=!0),Ee.reason===Lu)if(Ee.nested)ee.current=!1;else if(Ou(Ee.nativeEvent)||Gh(Ee.nativeEvent))ee.current=!1;else{let Le=!1;We(pe).createElement("div").focus({get preventScroll(){return Le=!0,!1}}),Le?ee.current=!1:ee.current=!0}}k.on("openchange",Ae);function Ue(Ee){const Le=Y.current;let Se=typeof Le=="function"?Le(Ee):Le;if(Se===void 0||Se===!1)return null;Se===null&&(Se=!0);const Re=C?.isConnected?C:null,Ne=ge?.isConnected&&pn(ge)!=="body"?ge:null;let Ie=Te?Ne||Re:Re||Ne;return Ie||(Ie=Cx()||null),typeof Se=="boolean"?Ie:Go(Se)||Ie||null}return()=>{k.off("openchange",Ae);const Ee=tn(ye),Le=Ce(),Se=De(_,Ee)||Le.some(je=>je===Ee||De(je,Ee))||M&&qs(M.nodesRef.current,z(),!1).some(je=>De(je.context?.elements.floating,Ee)),Re=Y.current,Ne=X.current,Ie=Ue(Ne);queueMicrotask(()=>{const je=kA(Ie),le=typeof Re!="boolean";if(Re&&!ee.current&&yt(je)&&(!(!le&&je!==Ee&&Ee!==ye.body)||Se)){const ve={preventScroll:!0};Ne==="keyboard"&&(ve.focusVisible=!0),je.focus(ve)}ee.current=!1})}},[r,_,pe,Y,U,k,M,C,z,Ce]),we(()=>{if(!cs||A||!_)return;const ye=tn(We(_));!yt(ye)||!zu(ye)||De(_,ye)&&ye.blur()},[A,_]),we(()=>{if(!(r||!H))return H.setFocusManagerState({modal:g,closeOnFocusOut:m,open:A,onOpenChange:O.setOpen,domReference:C}),()=>{H.setFocusManagerState(null)}},[r,H,g,A,O,m,C]),we(()=>{if(!(r||!pe))return Rx(pe),()=>{queueMicrotask(cm)}},[r,pe]);const Me=!r&&(g?!L:!0)&&(me||g);return p.jsxs(b.Fragment,{children:[Me&&p.jsx(as,{"data-type":"inside",ref:V,onFocus:ye=>{if(g){const ge=be();Jc(ge[ge.length-1])}else H?.portalNode&&(ee.current=!1,Rr(ye,H.portalNode)?nm(C)?.focus():Go(v??H.beforeOutsideRef)?.focus())}}),a,Me&&p.jsx(as,{"data-type":"inside",ref:J,onFocus:ye=>{g?Jc(be()[0]):H?.portalNode&&(m&&(ee.current=!0),Rr(ye,H.portalNode)?NS(C)?.focus():Go(y??H.afterOutsideRef)?.focus())}})]})}function Vu(t,o={}){const{enabled:a=!0,event:r="click",toggle:l=!0,ignoreMouse:c=!1,stickIfOpen:d=!0,touchOpenDelay:g=0,reason:m=os}=o,h="rootStore"in t?t.rootStore:t,y=h.context.dataRef,v=b.useRef(void 0),S=kr(),w=nn(),T=b.useMemo(()=>{function O(C,_,k,j){const z=qe(m,_,k);C&&j==="touch"&&g>0?w.start(g,()=>{h.setOpen(!0,z)}):h.setOpen(C,z)}function A(C,_,k){const j=y.current.openEvent,z=h.select("domReferenceElement")!==_;return C&&z||!C||!l?!0:j&&d?!k(j.type):!1}return{onPointerDown(C){v.current=Bs(C.pointerType,!0)&&Gh(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const _=v.current,k=C.nativeEvent,j=h.select("open");if(C.button!==0||r==="click"||Bs(_,!0)&&c)return;const z=A(j,C.currentTarget,B=>B==="click"||B==="mousedown"),D=zt(k);if(zu(D)){O(z,k,D,_);return}const L=C.currentTarget;S.request(()=>{O(z,k,L,_)})},onClick(C){if(r==="mousedown-only")return;const _=v.current;if(r==="mousedown"&&_){v.current=void 0;return}if(Bs(_,!0)&&c)return;const k=h.select("open"),j=A(k,C.currentTarget,z=>z==="click"||z==="mousedown"||z==="keydown"||z==="keyup");O(j,C.nativeEvent,C.currentTarget,_)},onKeyDown(){v.current=void 0}}},[y,r,c,m,h,d,l,S,w,g]);return b.useMemo(()=>a?{reference:T}:Tt,[a,T])}function MA(t,o){let a=null,r=null,l=!1;return{contextElement:t||void 0,getBoundingClientRect(){const c=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},d=o.axis==="x"||o.axis==="both",g=o.axis==="y"||o.axis==="both",m=["mouseenter","mousemove"].includes(o.dataRef.current.openEvent?.type||"")&&o.pointerType!=="touch";let h=c.width,y=c.height,v=c.x,S=c.y;return a==null&&o.x&&d&&(a=c.x-o.x),r==null&&o.y&&g&&(r=c.y-o.y),v-=a||0,S-=r||0,h=0,y=0,!l||m?(h=o.axis==="y"?c.width:0,y=o.axis==="x"?c.height:0,v=d&&o.x!=null?o.x:v,S=g&&o.y!=null?o.y:S):l&&!m&&(y=o.axis==="x"?c.height:y,h=o.axis==="y"?c.width:h),l=!0,{width:h,height:y,x:v,y:S,top:S,right:v+h,bottom:S+y,left:v}}}}function Ox(t){return t!=null&&t.clientX!=null}function jA(t,o={}){const{enabled:a=!0,axis:r="both"}=o,l="rootStore"in t?t.rootStore:t,c=l.useState("open"),d=l.useState("floatingElement"),g=l.useState("domReferenceElement"),m=l.context.dataRef,h=b.useRef(!1),y=b.useRef(null),[v,S]=b.useState(),[w,T]=b.useState([]),O=ke(j=>{l.set("positionReference",j)}),A=ke((j,z,D)=>{h.current||m.current.openEvent&&!Ox(m.current.openEvent)||l.set("positionReference",MA(D??g,{x:j,y:z,axis:r,dataRef:m,pointerType:v}))}),C=ke(j=>{c?y.current||(A(j.clientX,j.clientY,j.currentTarget),T([])):A(j.clientX,j.clientY,j.currentTarget)}),_=Bs(v)?d:c;b.useEffect(()=>{if(!a){O(g);return}if(!_)return;function j(){y.current?.(),y.current=null}const z=Et(d);function D(L){const B=zt(L);De(d,B)?j():A(L.clientX,L.clientY)}return!m.current.openEvent||Ox(m.current.openEvent)?y.current=Ge(z,"mousemove",D):O(g),j},[_,a,d,m,g,l,A,O,w]),b.useEffect(()=>()=>{l.set("positionReference",null)},[l]),b.useEffect(()=>{a&&!d&&(h.current=!1)},[a,d]),b.useEffect(()=>{!a&&c&&(h.current=!0)},[a,c]);const k=b.useMemo(()=>{function j(z){S(z.pointerType)}return{onPointerDown:j,onPointerEnter:j,onMouseMove:C,onMouseEnter:C}},[C]);return b.useMemo(()=>a?{reference:k,trigger:k}:{},[a,k])}function _A(){return!1}function DA(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function pl(t,o={}){const{enabled:a=!0,escapeKey:r=!0,outsidePress:l=!0,outsidePressEvent:c="sloppy",referencePress:d=_A,bubbles:g,externalTree:m}=o,h="rootStore"in t?t.rootStore:t,y=h.useState("open"),v=h.useState("floatingElement"),{dataRef:S,events:w}=h.context,T=Ks(m),O=ke(typeof l=="function"?l:()=>!1),A=typeof l=="function"?O:l,C=A!==!1,_=ke(()=>c),{escapeKey:k,outsidePress:j}=DA(g),z=b.useRef(!1),D=b.useRef(!1),L=b.useRef(!1),B=b.useRef(!1),Y=b.useRef(!1),U=b.useRef(""),I=b.useRef(null),M=nn(),H=nn(),ee=ke(()=>{H.clear(),S.current.insideReactTree=!1}),K=ke($=>{const se=S.current.floatingContext?.nodeId;return(T?qs(T.nodesRef.current,se):[]).some(me=>me.context?.open&&!me.context.dataRef.current[$])}),P=ke($=>Pp($,h.select("floatingElement"))||Pp($,h.select("domReferenceElement"))),q=ke($=>{d()&&h.setOpen(!1,qe(os,$.nativeEvent))}),X=ke($=>{if(!y||!a||!r||$.key!=="Escape"||Y.current||!k&&K("__escapeKeyBubbles"))return;const se=rO($)?$.nativeEvent:$,re=qe(fl,se);h.setOpen(!1,re),re.isCanceled||$.preventDefault(),!k&&!re.isPropagationAllowed&&$.stopPropagation()}),Z=ke(()=>{S.current.insideReactTree=!0,H.start(0,ee)}),W=ke($=>{if(!y||!a||$.button!==0)return;const se=zt($.nativeEvent);De(h.select("floatingElement"),se)&&(z.current||(z.current=!0,D.current=!1))}),N=ke($=>{!y||!a||($.defaultPrevented||$.nativeEvent.defaultPrevented)&&z.current&&(D.current=!0)});b.useEffect(()=>{function $(se){se.open||(B.current=!1)}return w.on("openchange",$),()=>{w.off("openchange",$)}},[w]),b.useEffect(()=>{if(!y||!a)return y||(B.current=!1),ee;S.current.__escapeKeyBubbles=k,S.current.__outsidePressBubbles=j;const $=new An,se=new An,re=We(v);function me(){$.clear(),Y.current=!0}function pe(){$.start(cs?5:0,()=>{Y.current=!1})}function be(){L.current=!0,se.start(0,()=>{L.current=!1})}function Ce(){z.current=!1,D.current=!1}function Me(){const he=U.current,ce=he==="pen"||!he?"mouse":he,xe=_(),He=typeof xe=="function"?xe():xe;return typeof He=="string"?He:He[ce]}function ye(he){const ce=Me();return ce==="intentional"&&he.type!=="click"||ce==="sloppy"&&he.type==="click"}function ge(he){const ce=S.current.floatingContext?.nodeId,xe=T&&qs(T.nodesRef.current,ce).some(He=>Pp(he,He.context?.elements.floating));return P(he)||xe}function Te(he){if(ye(he)){he.type!=="click"&&!P(he)&&(se.clear(),L.current=!1),ee();return}if(S.current.insideReactTree){ee();return}const ce=zt(he),xe=`[${Zi("inert")}]`,He=et(ce)?ce.getRootNode():null,Lt=Array.from((Nr(He)?He:We(h.select("floatingElement"))).querySelectorAll(xe)),Ft=h.context.triggerElements;if(ce&&(Ft.hasElement(ce)||Ft.hasMatchingElement(Oe=>De(Oe,ce))))return;let ut=et(ce)?ce:null;for(;ut&&!Wo(ut);){const Oe=ts(ut);if(Wo(Oe)||!et(Oe))break;ut=Oe}if(!(Lt.length&&et(ce)&&!EO(ce)&&!De(ce,h.select("floatingElement"))&&Lt.every(Oe=>!De(ut,Oe)))){if(yt(ce)&&!("touches"in he)){const Oe=Wo(ce),Ye=Un(ce),Qe=/auto|scroll/,ct=Oe||Qe.test(Ye.overflowX),Jt=Oe||Qe.test(Ye.overflowY),rn=ct&&ce.clientWidth>0&&ce.scrollWidth>ce.clientWidth,hn=Jt&&ce.clientHeight>0&&ce.scrollHeight>ce.clientHeight,bt=Ye.direction==="rtl",jt=hn&&(bt?he.offsetX<=ce.offsetWidth-ce.clientWidth:he.offsetX>ce.clientWidth),Fe=rn&&he.offsetY>ce.clientHeight;if(jt||Fe)return}if(!ge(he)){if(Me()==="intentional"){if(he.detail!==0&&!Ou(he)&&!B.current)return;if(L.current){se.clear(),L.current=!1;return}}typeof A=="function"&&!A(he)||K("__outsidePressBubbles")||(h.setOpen(!1,qe(Lu,he)),ee())}}}function Ae(he){Me()!=="sloppy"||he.pointerType==="touch"||!h.select("open")||!a||P(he)||Te(he)}function Ue(he){if(Me()!=="sloppy"||!h.select("open")||!a||P(he))return;const ce=he.touches[0];ce&&(I.current={startTime:Date.now(),startX:ce.clientX,startY:ce.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},M.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function Ee(he,ce){const xe=zt(he);if(!xe)return;const He=Ge(xe,he.type,()=>{ce(he),He()})}function Le(he){U.current="touch",Ee(he,Ue)}function Se(he){M.clear(),he.type==="pointerdown"&&(he.button===0&&(B.current=!0),U.current=he.pointerType),!(he.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)&&Ee(he,ce=>{ce.type==="pointerdown"?Ae(ce):Te(ce)})}function Re(he){if(he.type==="pointercancel"&&(B.current=!1),!z.current)return;const ce=D.current;if(Ce(),Me()==="intentional"){if(he.type==="pointercancel"){ce&&be();return}if(!ge(he)){if(ce){be();return}typeof A=="function"&&!A(he)||(se.clear(),L.current=!0,ee())}}}function Ne(he){if(Me()!=="sloppy"||!I.current||P(he))return;const ce=he.touches[0];if(!ce)return;const xe=Math.abs(ce.clientX-I.current.startX),He=Math.abs(ce.clientY-I.current.startY),Lt=Math.sqrt(xe*xe+He*He);Lt>5&&(I.current.dismissOnTouchEnd=!0),Lt>10&&(Te(he),M.clear(),I.current=null)}function Ie(he){Ee(he,Ne)}function je(he){Me()!=="sloppy"||!I.current||P(he)||(I.current.dismissOnTouchEnd&&Te(he),M.clear(),I.current=null)}function le(he){Ee(he,je)}const ve=fo(r&&fo(Ge(re,"keydown",X),Ge(re,"compositionstart",me),Ge(re,"compositionend",pe)),C&&fo(Ge(re,"click",Se,!0),Ge(re,"pointerdown",Se,!0),Ge(re,"pointerup",Re,!0),Ge(re,"pointercancel",Re,!0),Ge(re,"mousedown",Se,!0),Ge(re,"mouseup",Re,!0),Ge(re,"touchstart",Le,{capture:!0,passive:!0}),Ge(re,"touchmove",Ie,{capture:!0,passive:!0}),Ge(re,"touchend",le,{capture:!0,passive:!0})));return()=>{ve(),$.clear(),se.clear(),Ce(),L.current=!1,ee()}},[S,v,r,C,A,y,a,k,j,X,ee,_,K,P,T,h,M]);const V=b.useMemo(()=>({onKeyDown:X,onPointerDown:q,onClick:q}),[X,q]),J=b.useMemo(()=>({onKeyDown:X,onPointerDown:N,onMouseDown:N,onClickCapture:Z,onMouseDownCapture($){Z(),W($)},onPointerDownCapture($){Z(),W($)},onMouseUpCapture:Z,onTouchEndCapture:Z,onTouchMoveCapture:Z}),[X,Z,W,N]);return b.useMemo(()=>a?{reference:V,floating:J,trigger:V}:{},[a,V,J])}function Ax(t,o,a){let{reference:r,floating:l}=t;const c=eo(o),d=em(o),g=Jh(d),m=to(o),h=c==="y",y=r.x+r.width/2-l.width/2,v=r.y+r.height/2-l.height/2,S=r[g]/2-l[g]/2;let w;switch(m){case"top":w={x:y,y:r.y-l.height};break;case"bottom":w={x:y,y:r.y+r.height};break;case"right":w={x:r.x+r.width,y:v};break;case"left":w={x:r.x-l.width,y:v};break;default:w={x:r.x,y:r.y}}const T=rs(o);return T&&(w[d]+=S*(T==="end"?1:-1)*(a&&h?-1:1)),w}async function zA(t,o){var a;o===void 0&&(o={});const{x:r,y:l,platform:c,rects:d,elements:g,strategy:m}=t,{boundary:h="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:S=!1,padding:w=0}=Ys(o,t),T=xS(w),A=g[S?v==="floating"?"reference":"floating":v],C=Qi(await c.getClippingRect({element:(a=await(c.isElement==null?void 0:c.isElement(A)))==null||a?A:A.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(g.floating)),boundary:h,rootBoundary:y,strategy:m})),_=v==="floating"?{x:r,y:l,width:d.floating.width,height:d.floating.height}:d.reference,k=await(c.getOffsetParent==null?void 0:c.getOffsetParent(g.floating)),j=await(c.isElement==null?void 0:c.isElement(k))&&await(c.getScale==null?void 0:c.getScale(k))||{x:1,y:1},z=Qi(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:g,rect:_,offsetParent:k,strategy:m}):_);return{top:(C.top-z.top+T.top)/j.y,bottom:(z.bottom-C.bottom+T.bottom)/j.y,left:(C.left-z.left+T.left)/j.x,right:(z.right-C.right+T.right)/j.x}}const LA=50,PA=async(t,o,a)=>{const{placement:r="bottom",strategy:l="absolute",middleware:c=[],platform:d}=a,g=d.detectOverflow?d:{...d,detectOverflow:zA},m=await(d.isRTL==null?void 0:d.isRTL(o));let h=await d.getElementRects({reference:t,floating:o,strategy:l}),{x:y,y:v}=Ax(h,r,m),S=r,w=0;const T={};for(let O=0;O<c.length;O++){const A=c[O];if(!A)continue;const{name:C,fn:_}=A,{x:k,y:j,data:z,reset:D}=await _({x:y,y:v,initialPlacement:r,placement:S,strategy:l,middlewareData:T,rects:h,platform:g,elements:{reference:t,floating:o}});y=k??y,v=j??v,T[C]={...T[C],...z},D&&w<LA&&(w++,typeof D=="object"&&(D.placement&&(S=D.placement),D.rects&&(h=D.rects===!0?await d.getElementRects({reference:t,floating:o,strategy:l}):D.rects),{x:y,y:v}=Ax(h,S,m)),O=-1)}return{x:y,y:v,placement:S,strategy:l,middlewareData:T}},IA=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(o){var a,r;const{placement:l,middlewareData:c,rects:d,initialPlacement:g,platform:m,elements:h}=o,{mainAxis:y=!0,crossAxis:v=!0,fallbackPlacements:S,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:O=!0,...A}=Ys(t,o);if((a=c.arrow)!=null&&a.alignmentOffset)return{};const C=to(l),_=eo(g),k=to(g)===g,j=await(m.isRTL==null?void 0:m.isRTL(h.floating)),z=S||(k||!O?[lu(g)]:FO(g)),D=T!=="none";!S&&D&&z.push(...XO(g,O,T,j));const L=[g,...z],B=await m.detectOverflow(o,A),Y=[];let U=((r=c.flip)==null?void 0:r.overflows)||[];if(y&&Y.push(B[C]),v){const ee=VO(l,d,j);Y.push(B[ee[0]],B[ee[1]])}if(U=[...U,{placement:l,overflows:Y}],!Y.every(ee=>ee<=0)){var I,M;const ee=(((I=c.flip)==null?void 0:I.index)||0)+1,K=L[ee];if(K&&(!(v==="alignment"?_!==eo(K):!1)||U.every(X=>eo(X.placement)===_?X.overflows[0]>0:!0)))return{data:{index:ee,overflows:U},reset:{placement:K}};let P=(M=U.filter(q=>q.overflows[0]<=0).sort((q,X)=>q.overflows[1]-X.overflows[1])[0])==null?void 0:M.placement;if(!P)switch(w){case"bestFit":{var H;const q=(H=U.filter(X=>{if(D){const Z=eo(X.placement);return Z===_||Z==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(Z=>Z>0).reduce((Z,W)=>Z+W,0)]).sort((X,Z)=>X[1]-Z[1])[0])==null?void 0:H[0];q&&(P=q);break}case"initialPlacement":P=g;break}if(l!==P)return{reset:{placement:P}}}return{}}}},KS=new Set(["left","top"]);async function HA(t,o){const{placement:a,platform:r,elements:l}=t,c=await(r.isRTL==null?void 0:r.isRTL(l.floating)),d=to(a),g=rs(a),m=eo(a)==="y",h=KS.has(d)?-1:1,y=c&&m?-1:1,v=Ys(o,t);let{mainAxis:S,crossAxis:w,alignmentAxis:T}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return g&&typeof T=="number"&&(w=g==="end"?T*-1:T),m?{x:w*y,y:S*h}:{x:S*h,y:w*y}}const UA=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(o){var a,r;const{x:l,y:c,placement:d,middlewareData:g}=o,m=await HA(o,t);return d===((a=g.offset)==null?void 0:a.placement)&&(r=g.arrow)!=null&&r.alignmentOffset?{}:{x:l+m.x,y:c+m.y,data:{...m,placement:d}}}}},BA=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(o){const{x:a,y:r,placement:l,platform:c}=o,{mainAxis:d=!0,crossAxis:g=!1,limiter:m={fn:_=>{let{x:k,y:j}=_;return{x:k,y:j}}},...h}=Ys(t,o),y={x:a,y:r},v=await c.detectOverflow(o,h),S=eo(l),w=Zh(S);let T=y[w],O=y[S];const A=(_,k)=>vS(k+v[_==="y"?"top":"left"],k,k-v[_==="y"?"bottom":"right"]);d&&(T=A(w,T)),g&&(O=A(S,O));const C=m.fn({...o,[w]:T,[S]:O});return{...C,data:{x:C.x-a,y:C.y-r,enabled:{[w]:d,[S]:g}}}}}},VA=function(t){return t===void 0&&(t={}),{options:t,fn(o){var a,r;const{x:l,y:c,placement:d,rects:g,middlewareData:m}=o,{offset:h=0,mainAxis:y=!0,crossAxis:v=!0}=Ys(t,o),S={x:l,y:c},w=eo(d),T=Zh(w);let O=S[T],A=S[w];const C=Ys(h,o),_=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(a=C.mainAxis)!=null?a:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(y){const z=T==="y"?"height":"width",D=g.reference[T]-g.floating[z]+_.mainAxis,L=g.reference[T]+g.reference[z]-_.mainAxis;O<D?O=D:O>L&&(O=L)}if(v){var k,j;const z=T==="y"?"width":"height",D=KS.has(to(d)),L=g.reference[w]-g.floating[z]+(D&&((k=m.offset)==null?void 0:k[w])||0)+(D?0:_.crossAxis),B=g.reference[w]+g.reference[z]+(D?0:((j=m.offset)==null?void 0:j[w])||0)-(D?_.crossAxis:0);A<L?A=L:A>B&&(A=B)}return{[T]:O,[w]:A}}}},FA=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(o){const{placement:a,rects:r,platform:l,elements:c}=o,{apply:d=()=>{},...g}=Ys(t,o),m=await l.detectOverflow(o,g),h=to(a),y=rs(a),v=eo(a)==="y",{width:S,height:w}=r.floating;let T,O;h==="top"||h==="bottom"?(T=h,O=y===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(O=h,T=y==="end"?"top":"bottom");const A=w-m.top-m.bottom,C=S-m.left-m.right,_=Mr(w-m[T],A),k=Mr(S-m[O],C),j=o.middlewareData.shift,z=!j;let D=_,L=k;j!=null&&j.enabled.x&&(L=C),j!=null&&j.enabled.y&&(D=A),z&&!y&&(v?L=S-2*Qo(m.left,m.right):D=w-2*Qo(m.top,m.bottom)),await d({...o,availableWidth:L,availableHeight:D});const B=await l.getDimensions(c.floating);return S!==B.width||w!==B.height?{reset:{rects:!0}}:{}}}};function $S(t){const o=Un(t);let a=parseFloat(o.width)||0,r=parseFloat(o.height)||0;const l=yt(t),c=l?t.offsetWidth:a,d=l?t.offsetHeight:r,g=iu(a)!==c||iu(r)!==d;return g&&(a=c,r=d),{width:a,height:r,$:g}}function um(t){return et(t)?t:t.contextElement}function Or(t){const o=um(t);if(!yt(o))return Zo(1);const a=o.getBoundingClientRect(),{width:r,height:l,$:c}=$S(o);let d=(c?iu(a.width):a.width)/r,g=(c?iu(a.height):a.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!g||!Number.isFinite(g))&&(g=1),{x:d,y:g}}const YA=Zo(0);function WS(t){const o=Et(t);return!$h()||!o.visualViewport?YA:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function qA(t,o,a){return o===void 0&&(o=!1),!!a&&o&&a===Et(t)}function Oa(t,o,a,r){o===void 0&&(o=!1),a===void 0&&(a=!1);const l=t.getBoundingClientRect(),c=um(t);let d=Zo(1);o&&(r?et(r)&&(d=Or(r)):d=Or(t));const g=qA(c,a,r)?WS(c):Zo(0);let m=(l.left+g.x)/d.x,h=(l.top+g.y)/d.y,y=l.width/d.x,v=l.height/d.y;if(c&&r){const S=Et(c),w=et(r)?Et(r):r;let T=S,O=ph(T);for(;O&&w!==T;){const A=Or(O),C=O.getBoundingClientRect(),_=Un(O),k=C.left+(O.clientLeft+parseFloat(_.paddingLeft))*A.x,j=C.top+(O.clientTop+parseFloat(_.paddingTop))*A.y;m*=A.x,h*=A.y,y*=A.x,v*=A.y,m+=k,h+=j,T=Et(O),O=ph(T)}}return Qi({width:y,height:v,x:m,y:h})}function Fu(t,o){const a=ku(t).scrollLeft;return o?o.left+a:Oa(us(t)).left+a}function QS(t,o){const a=t.getBoundingClientRect(),r=a.left+o.scrollLeft-Fu(t,a),l=a.top+o.scrollTop;return{x:r,y:l}}function GA(t){let{elements:o,rect:a,offsetParent:r,strategy:l}=t;const c=l==="fixed",d=us(r),g=o?Nu(o.floating):!1;if(r===d||g&&c)return a;let m={scrollLeft:0,scrollTop:0},h=Zo(1);const y=Zo(0),v=yt(r);if((v||!c)&&((pn(r)!=="body"||ll(d))&&(m=ku(r)),v)){const w=Oa(r);h=Or(r),y.x=w.x+r.clientLeft,y.y=w.y+r.clientTop}const S=d&&!v&&!c?QS(d,m):Zo(0);return{width:a.width*h.x,height:a.height*h.y,x:a.x*h.x-m.scrollLeft*h.x+y.x+S.x,y:a.y*h.y-m.scrollTop*h.y+y.y+S.y}}function XA(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function KA(t){const o=ku(t),a=t.ownerDocument.body,r=Qo(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),l=Qo(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let c=-o.scrollLeft+Fu(t);const d=-o.scrollTop;return Un(a).direction==="rtl"&&(c+=Qo(t.clientWidth,a.clientWidth)-r),{width:r,height:l,x:c,y:d}}const $A=25;function WA(t,o,a){a===void 0&&(a="viewport");const r=a==="layoutViewport",l=Et(t),c=us(t),d=l.visualViewport;let g=c.clientWidth,m=c.clientHeight,h=0,y=0;if(d){const S=!$h()||o==="fixed";r?S||(h=-d.offsetLeft,y=-d.offsetTop):(g=d.width,m=d.height,S&&(h=d.offsetLeft,y=d.offsetTop))}if(Fu(c)<=0){const S=c.ownerDocument,w=S.body,T=getComputedStyle(w),O=S.compatMode==="CSS1Compat"&&parseFloat(T.marginLeft)+parseFloat(T.marginRight)||0,A=Math.abs(c.clientWidth-w.clientWidth-O),C=getComputedStyle(c).scrollbarGutter==="stable both-edges"?A/2:A;C<=$A&&(g-=C)}return{width:g,height:m,x:h,y}}function QA(t,o){const a=Oa(t,!0,o==="fixed"),r=a.top+t.clientTop,l=a.left+t.clientLeft,c=Or(t),d=t.clientWidth*c.x,g=t.clientHeight*c.y,m=l*c.x,h=r*c.y;return{width:d,height:g,x:m,y:h}}function Nx(t,o,a){let r;if(o==="viewport"||o==="layoutViewport")r=WA(t,a,o);else if(o==="document")r=KA(us(t));else if(et(o))r=QA(o,a);else{const l=WS(t);r={x:o.x-l.x,y:o.y-l.y,width:o.width,height:o.height}}return Qi(r)}function ZA(t,o){const a=o.get(t);if(a)return a;let r=Wi(t,[],!1).filter(g=>et(g)&&pn(g)!=="body"),l=null;const c=Un(t).position==="fixed";let d=c?ts(t):t;for(;et(d)&&!Wo(d);){const g=Un(d),m=Kh(d),h=l?l.position:c?"fixed":"";!m&&(h==="fixed"||h==="absolute"&&g.position==="static")?r=r.filter(v=>v!==d):l=g,d=ts(d)}return o.set(t,r),r}function JA(t){let{element:o,boundary:a,rootBoundary:r,strategy:l}=t;const d=[...a==="clippingAncestors"?Nu(o)?[]:ZA(o,this._c):[].concat(a),r],g=Nx(o,d[0],l);let m=g.top,h=g.right,y=g.bottom,v=g.left;for(let S=1;S<d.length;S++){const w=Nx(o,d[S],l);m=Qo(w.top,m),h=Mr(w.right,h),y=Mr(w.bottom,y),v=Qo(w.left,v)}return{width:h-v,height:y-m,x:v,y:m}}function e2(t){const{width:o,height:a}=$S(t);return{width:o,height:a}}function t2(t,o,a){const r=yt(o),l=us(o),c=a==="fixed",d=Oa(t,!0,c,o);let g={scrollLeft:0,scrollTop:0};const m=Zo(0);if((r||!c)&&((pn(o)!=="body"||ll(l))&&(g=ku(o)),r)){const S=Oa(o,!0,c,o);m.x=S.x+o.clientLeft,m.y=S.y+o.clientTop}!r&&l&&(m.x=Fu(l));const h=l&&!r&&!c?QS(l,g):Zo(0),y=d.left+g.scrollLeft-m.x-h.x,v=d.top+g.scrollTop-m.y-h.y;return{x:y,y:v,width:d.width,height:d.height}}function Vp(t){return Un(t).position==="static"}function kx(t,o){if(!yt(t)||Un(t).position==="fixed")return null;if(o)return o(t);let a=t.offsetParent;return us(t)===a&&(a=a.ownerDocument.body),a}function ZS(t,o){const a=Et(t);if(Nu(t))return a;if(!yt(t)){let l=ts(t);for(;l&&!Wo(l);){if(et(l)&&!Vp(l))return l;l=ts(l)}return a}let r=kx(t,o);for(;r&&lO(r)&&Vp(r);)r=kx(r,o);return r&&Wo(r)&&Vp(r)&&!Kh(r)?a:r||fO(t)||a}const n2=async function(t){const o=this.getOffsetParent||ZS,a=this.getDimensions,r=await a(t.floating);return{reference:t2(t.reference,await o(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function o2(t){return Un(t).direction==="rtl"}const JS={convertOffsetParentRelativeRectToViewportRelativeRect:GA,getDocumentElement:us,getClippingRect:JA,getOffsetParent:ZS,getElementRects:n2,getClientRects:XA,getDimensions:e2,getScale:Or,isElement:et,isRTL:o2};function e1(t,o){return t.x===o.x&&t.y===o.y&&t.width===o.width&&t.height===o.height}function s2(t,o,a){let r=null,l;const c=us(t);function d(){var y;clearTimeout(l),(y=r)==null||y.disconnect(),r=null}function g(y,v){y===void 0&&(y=!1),v===void 0&&(v=1),d();const S=t.getBoundingClientRect(),{left:w,top:T,width:O,height:A}=S;if(y||o(),!O||!A)return;const C=Hc(T),_=Hc(c.clientWidth-(w+O)),k=Hc(c.clientHeight-(T+A)),j=Hc(w),D={rootMargin:-C+"px "+-_+"px "+-k+"px "+-j+"px",threshold:Qo(0,Mr(1,v))||1};let L=!0;function B(Y){const U=Y[0].intersectionRatio;if(!e1(S,t.getBoundingClientRect()))return g();if(U!==v){if(!L)return g();U?g(!1,U):l=setTimeout(()=>{g(!1,1e-7)},1e3)}L=!1}try{r=new IntersectionObserver(B,{...D,root:c.ownerDocument})}catch{r=new IntersectionObserver(B,D)}r.observe(t)}const m=Et(t),h=()=>g(a);return m.addEventListener("resize",h),g(!0),()=>{m.removeEventListener("resize",h),d()}}function Mx(t,o,a,r){r===void 0&&(r={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:g=typeof IntersectionObserver=="function",animationFrame:m=!1}=r,h=um(t),y=l||c?[...h?Wi(h):[],...o?Wi(o):[]]:[];y.forEach(C=>{l&&C.addEventListener("scroll",a),c&&C.addEventListener("resize",a)});const v=h&&g?s2(h,a,c):null;let S=-1,w=null;d&&(w=new ResizeObserver(C=>{let[_]=C;_&&_.target===h&&w&&o&&(w.unobserve(o),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var k;(k=w)==null||k.observe(o)})),a()}),h&&!m&&w.observe(h),o&&w.observe(o));let T,O=m?Oa(t):null;m&&A();function A(){const C=Oa(t);O&&!e1(O,C)&&a(),O=C,T=requestAnimationFrame(A)}return a(),()=>{var C;y.forEach(_=>{l&&_.removeEventListener("scroll",a),c&&_.removeEventListener("resize",a)}),v?.(),(C=w)==null||C.disconnect(),w=null,m&&cancelAnimationFrame(T)}}const a2=UA,r2=BA,i2=IA,l2=FA,c2=VA,u2=(t,o,a)=>{const r=new Map,l=a??{},c={...JS,...l.platform,_c:r};return PA(t,o,{...l,platform:c})};var f2=typeof document<"u",d2=function(){},eu=f2?b.useLayoutEffect:d2;function fu(t,o){if(t===o)return!0;if(typeof t!=typeof o)return!1;if(typeof t=="function"&&t.toString()===o.toString())return!0;let a,r,l;if(t&&o&&typeof t=="object"){if(Array.isArray(t)){if(a=t.length,a!==o.length)return!1;for(r=a;r--!==0;)if(!fu(t[r],o[r]))return!1;return!0}if(l=Object.keys(t),a=l.length,a!==Object.keys(o).length)return!1;for(r=a;r--!==0;)if(!{}.hasOwnProperty.call(o,l[r]))return!1;for(r=a;r--!==0;){const c=l[r];if(!(c==="_owner"&&t.$$typeof)&&!fu(t[c],o[c]))return!1}return!0}return t!==t&&o!==o}function t1(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function jx(t,o){const a=t1(t);return Math.round(o*a)/a}function Fp(t){const o=b.useRef(t);return eu(()=>{o.current=t}),o}function p2(t){t===void 0&&(t={});const{placement:o="bottom",strategy:a="absolute",middleware:r=[],platform:l,elements:{reference:c,floating:d}={},transform:g=!0,whileElementsMounted:m,open:h}=t,[y,v]=b.useState({x:0,y:0,strategy:a,placement:o,middlewareData:{},isPositioned:!1}),[S,w]=b.useState(r);fu(S,r)||w(r);const[T,O]=b.useState(null),[A,C]=b.useState(null),_=b.useCallback(X=>{X!==D.current&&(D.current=X,O(X))},[]),k=b.useCallback(X=>{X!==L.current&&(L.current=X,C(X))},[]),j=c||T,z=d||A,D=b.useRef(null),L=b.useRef(null),B=b.useRef(y),Y=m!=null,U=Fp(m),I=Fp(l),M=Fp(h),H=b.useCallback(()=>{if(!D.current||!L.current)return;const X={placement:o,strategy:a,middleware:S};I.current&&(X.platform=I.current),u2(D.current,L.current,X).then(Z=>{const W={...Z,isPositioned:M.current!==!1};ee.current&&!fu(B.current,W)&&(B.current=W,oo.flushSync(()=>{v(W)}))})},[S,o,a,I,M]);eu(()=>{h===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,v(X=>({...X,isPositioned:!1})))},[h]);const ee=b.useRef(!1);eu(()=>(ee.current=!0,()=>{ee.current=!1}),[]),eu(()=>{if(j&&(D.current=j),z&&(L.current=z),j&&z){if(U.current)return U.current(j,z,H);H()}},[j,z,H,U,Y]);const K=b.useMemo(()=>({reference:D,floating:L,setReference:_,setFloating:k}),[_,k]),P=b.useMemo(()=>({reference:j,floating:z}),[j,z]),q=b.useMemo(()=>{const X={position:a,left:0,top:0};if(!P.floating)return X;const Z=jx(P.floating,y.x),W=jx(P.floating,y.y);return g?{...X,transform:"translate("+Z+"px, "+W+"px)",...t1(P.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:Z,top:W}},[a,g,P.floating,y.x,y.y]);return b.useMemo(()=>({...y,update:H,refs:K,elements:P,floatingStyles:q}),[y,H,K,P,q])}const h2=(t,o)=>{const a=a2(t);return{name:a.name,fn:a.fn,options:[t,o]}},m2=(t,o)=>{const a=r2(t);return{name:a.name,fn:a.fn,options:[t,o]}},g2=(t,o)=>({fn:c2(t).fn,options:[t,o]}),y2=(t,o)=>{const a=i2(t);return{name:a.name,fn:a.fn,options:[t,o]}},b2=(t,o)=>{const a=l2(t);return{name:a.name,fn:a.fn,options:[t,o]}};var Yp={exports:{}},qp={};var _x;function v2(){if(_x)return qp;_x=1;var t=rl();function o(v,S){return v===S&&(v!==0||1/v===1/S)||v!==v&&S!==S}var a=typeof Object.is=="function"?Object.is:o,r=t.useState,l=t.useEffect,c=t.useLayoutEffect,d=t.useDebugValue;function g(v,S){var w=S(),T=r({inst:{value:w,getSnapshot:S}}),O=T[0].inst,A=T[1];return c(function(){O.value=w,O.getSnapshot=S,m(O)&&A({inst:O})},[v,w,S]),l(function(){return m(O)&&A({inst:O}),v(function(){m(O)&&A({inst:O})})},[v]),d(w),w}function m(v){var S=v.getSnapshot;v=v.value;try{var w=S();return!a(v,w)}catch{return!0}}function h(v,S){return S()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:g;return qp.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y,qp}var Dx;function n1(){return Dx||(Dx=1,Yp.exports=v2()),Yp.exports}var fm=n1(),Gp={exports:{}},Xp={};var zx;function x2(){if(zx)return Xp;zx=1;var t=rl(),o=n1();function a(h,y){return h===y&&(h!==0||1/h===1/y)||h!==h&&y!==y}var r=typeof Object.is=="function"?Object.is:a,l=o.useSyncExternalStore,c=t.useRef,d=t.useEffect,g=t.useMemo,m=t.useDebugValue;return Xp.useSyncExternalStoreWithSelector=function(h,y,v,S,w){var T=c(null);if(T.current===null){var O={hasValue:!1,value:null};T.current=O}else O=T.current;T=g(function(){function C(D){if(!_){if(_=!0,k=D,D=S(D),w!==void 0&&O.hasValue){var L=O.value;if(w(L,D))return j=L}return j=D}if(L=j,r(k,D))return L;var B=S(D);return w!==void 0&&w(L,B)?(k=D,L):(k=D,j=B)}var _=!1,k,j,z=v===void 0?null:v;return[function(){return C(y())},z===null?void 0:function(){return C(z())}]},[y,v,S,w]);var A=l(h,T[0],T[1]);return d(function(){O.hasValue=!0,O.value=A},[A]),m(A),A},Xp}var Lx;function S2(){return Lx||(Lx=1,Gp.exports=x2()),Gp.exports}var w2=S2();const T2=om(19),E2=T2?R2:O2;function o1(t,o,a,r,l){return E2(t,o,a,r,l)}function C2(t,o,a,r,l){const c=b.useCallback(()=>o(t.getSnapshot(),a,r,l),[t,o,a,r,l]);return fm.useSyncExternalStore(t.subscribe,c,c)}QR({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let o=!1;for(let a=0;a<t.syncHooks.length;a+=1){const r=t.syncHooks[a],l=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,l)||(o=!0,r.value=l)}return o&&(t.syncTick+=1),t.syncTick})},after(t){t.syncHooks.length>0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=o=>{const a=new Set;for(const l of t.syncHooks)a.add(l.store);const r=[];for(const l of a)r.push(l.subscribe(o));return()=>{for(const l of r)l()}}),fm.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function R2(t,o,a,r,l){const c=WR();if(!c)return C2(t,o,a,r,l);const d=c.syncIndex;c.syncIndex+=1;let g;return c.didInitialize?(g=c.syncHooks[d],(g.store!==t||g.selector!==o||!Object.is(g.a1,a)||!Object.is(g.a2,r)||!Object.is(g.a3,l))&&(g.store!==t&&(c.didChangeStore=!0),g.store=t,g.selector=o,g.a1=a,g.a2=r,g.a3=l,g.value=o(t.getSnapshot(),a,r,l))):(g={store:t,selector:o,a1:a,a2:r,a3:l,value:o(t.getSnapshot(),a,r,l)},c.syncHooks.push(g)),g.value}function O2(t,o,a,r,l){return w2.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,c=>o(c,a,r,l))}class A2{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 a=this.updateTick;for(const r of this.listeners){if(a!==this.updateTick)return;r(o)}}update(o){for(const a in o)if(!Object.is(this.state[a],o[a])){this.setState({...this.state,...o});return}}set(o,a){Object.is(this.state[o],a)||this.setState({...this.state,[o]:a})}notifyAll(){const o={...this.state};this.setState(o)}use(o,a,r,l){return o1(this,o,a,r,l)}}class Da extends A2{constructor(o,a={},r){super(o),this.context=a,this.selectors=r}useSyncedValue(o,a){b.useDebugValue(o);const r=this;we(()=>{r.state[o]!==a&&r.set(o,a)},[r,o,a])}useSyncedValueWithCleanup(o,a){const r=this;we(()=>(r.state[o]!==a&&r.set(o,a),()=>{r.set(o,void 0)}),[r,o,a])}useSyncedValues(o){const a=this,r=Object.values(o);we(()=>{a.update(o)},[a,...r])}useControlledProp(o,a){b.useDebugValue(o);const r=this,l=a!==void 0;we(()=>{l&&!Object.is(r.state[o],a)&&r.setState({...r.state,[o]:a})},[r,o,a,l])}select(o,a,r,l){const c=this.selectors[o];return c(this.state,a,r,l)}useState(o,a,r,l){return b.useDebugValue(o),o1(this,this.selectors[o],a,r,l)}useContextCallback(o,a){b.useDebugValue(o);const r=ke(a??It);this.context[o]=r}useStateSetter(o){const a=b.useRef(void 0);return a.current===void 0&&(a.current=r=>{this.set(o,r)}),a.current}observe(o,a){let r;typeof o=="function"?r=o:r=this.selectors[o];let l=r(this.state);return a(l,l,this),this.subscribe(c=>{const d=r(c);if(!Object.is(l,d)){const g=l;l=d,a(d,g,this)}})}}const N2={open:t=>t.open,transitionStatus:t=>t.transitionStatus,domReferenceElement:t=>t.domReferenceElement,referenceElement:t=>t.positionReference??t.referenceElement,floatingElement:t=>t.floatingElement,floatingId:t=>t.floatingId};class dm extends Da{constructor(o){const{syncOnly:a,nested:r,onOpenChange:l,triggerElements:c,...d}=o;super({...d,positionReference:d.referenceElement,domReferenceElement:d.referenceElement},{onOpenChange:l,dataRef:{current:{}},events:FS(),nested:r,triggerElements:c},N2),this.syncOnly=a}syncOpenEvent=(o,a)=>{(!o||!this.state.open||a!=null&&iO(a))&&(this.context.dataRef.current.openEvent=o?a:void 0)};dispatchOpenChange=(o,a)=>{this.syncOpenEvent(o,a.event);const r={open:o,reason:a.reason,nativeEvent:a.event,nested:this.context.nested,triggerElement:a.trigger};this.context.events.emit("openchange",r)};setOpen=(o,a)=>{if(this.syncOnly){this.context.onOpenChange?.(o,a);return}this.dispatchOpenChange(o,a),this.context.onOpenChange?.(o,a)}}function s1(t){const{popupStore:o,treatPopupAsFloatingElement:a=!1,floatingRootContext:r,floatingId:l,nested:c,onOpenChange:d}=t,g=o.useState("open"),m=o.useState("activeTriggerElement"),h=o.useState(a?"popupElement":"positionerElement"),y=o.context.triggerElements,v=d,S=b.useRef(null);r===void 0&&S.current===null&&(S.current=new dm({open:g,transitionStatus:void 0,referenceElement:m,floatingElement:h,triggerElements:y,onOpenChange:v,floatingId:l,syncOnly:!0,nested:c}));const w=r??S.current;return o.useSyncedValue("floatingId",l),we(()=>{const T={open:g,floatingId:l,referenceElement:m,floatingElement:h};et(m)&&(T.domReferenceElement=m),w.state.positionReference===w.state.referenceElement&&(T.positionReference=m),w.update(T)},[g,l,m,h,w]),w.context.onOpenChange=v,w.context.nested=c,w}function pm(t,o=!1,a=!1,r=!1){const[l,c]=b.useState(t&&o?"idle":void 0),[d,g]=b.useState(t&&!r);return t&&!d&&(g(!0),c("starting")),!t&&d&&l!=="ending"&&!a&&c("ending"),!t&&!d&&l==="ending"&&c(void 0),we(()=>{if(!t&&d&&l!=="ending"&&a){const m=Eo.request(()=>{c("ending")});return()=>{Eo.cancel(m)}}},[t,d,l,a]),we(()=>{if(!t||o)return;const m=Eo.request(()=>{c(void 0)});return()=>{Eo.cancel(m)}},[o,t]),we(()=>{if(!t||!o)return;t&&d&&l!=="idle"&&c("starting");const m=Eo.request(()=>{c("idle")});return()=>{Eo.cancel(m)}},[o,t,d,l]),{mounted:d,setMounted:g,transitionStatus:l}}let Bc=null;function k2(t){if(!Bc){const o=[];Bc=o,queueMicrotask(()=>{Bc=null,oo.flushSync(()=>{for(const a of o)a()})})}Bc.push(t)}function Yu(t,o=!1,a=!1){const r=kr();return ke((l,c=null)=>{r.cancel();const d=Go(t);if(d==null)return;const g=d,m=()=>{if(!a){oo.flushSync(l);return}k2(()=>{c?.aborted||l()})};if(typeof g.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){l();return}function h(){Promise.all(g.getAnimations().map(y=>y.finished)).then(()=>{c?.aborted||m()},()=>{if(c?.aborted)return;if(g.getAnimations().some(v=>v.pending||v.playState!=="finished")){h();return}m()})}if(o){const y=cS;if(!g.hasAttribute(y)){r.request(h);return}const v=new MutationObserver(()=>{g.hasAttribute(y)||(v.disconnect(),h())});v.observe(g,{attributes:!0,attributeFilter:[y]}),c?.addEventListener("abort",()=>v.disconnect(),{once:!0});return}r.request(h)})}function fs(t){const{enabled:o=!0,open:a,ref:r,batch:l=!1,onComplete:c}=t,d=ke(c),g=Yu(r,a,l);b.useEffect(()=>{if(!o)return;const m=new AbortController;return g(d,m.signal),()=>{m.abort()}},[o,a,d,g])}const hl={tabIndex:-1,[hh]:""};function a1(t){return o=>o==="touch"?t.current:!0}function hm(t,o=!1){const a=Gs(),r=Xs()!=null,l=Qt(()=>t(a,r)).current;return s1({popupStore:l,treatPopupAsFloatingElement:o,floatingRootContext:l.state.floatingRootContext,floatingId:a,nested:r,onOpenChange:l.setOpen}),l}function qu({handle:t,store:o}){return we(()=>t.attachStore(o),[t,o]),null}function Px(t){const o=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==o&&t.set("triggerCount",o)}function r1(t,o){const a=b.useRef(null);return ke(r=>{const l=a.current;if(l!==null){if(l.element===r&&l.store===o&&l.id===t)return;a.current=null;const c=l.store;c.context.triggerElements.getById(l.id)===l.element&&(c.context.triggerElements.delete(l.id),Px(c))}r!==null&&t!==void 0&&(a.current={store:o,id:t,element:r},o.context.triggerElements.add(t,r),Px(o))})}function Gu(t,o,a,r=!1){let l=t.preventUnmountingOnClose;o?l=!1:r&&(l=!0);const c=a?.id??null;let d=t.activeTriggerId,g=t.activeTriggerElement;return(c||o)&&(d=c,g=a??null),{open:o,preventUnmountingOnClose:l,activeTriggerId:d,activeTriggerElement:g}}function mm(t){let o=!1;return t.preventUnmountOnClose=()=>{o=!0},()=>o}function M2(t,o,a,r={}){const l=a.reason,c=l===Bt,d=o&&l===Er,g=!o&&(l===os||l===fl),m=mm(a);if(t.context.onOpenChange?.(o,a),a.isCanceled)return;r.onBeforeDispatch?.(),t.state.floatingRootContext.dispatchOpenChange(o,a);const h=()=>{const y=Gu(t.state,o,a.trigger,m()),v={...r.extraState,...y};d?v.instantType="focus":g?v.instantType="dismiss":c&&(v.instantType=void 0),t.update(v)};c?oo.flushSync(h):h()}function gm(t,o,a,r){const l=a.useState("isMountedByTrigger",t),c=r1(t,a),d=ke(m=>{const h=a.select("open"),y=a.select("activeTriggerId");if(y===t){const v={activeTriggerElement:m,...h?r:null};a.update(v);return}if(y==null&&h){const v={activeTriggerId:t??null,activeTriggerElement:m,...r};a.update(v)}}),g=ke(m=>{c(m),m&&d(m)});return we(()=>(g(o.current),()=>g(null)),[g,o,a,t]),we(()=>{if(l){const m={activeTriggerElement:o.current,...r};a.update(m)}},[l,a,o,...Object.values(r)]),{registerTrigger:g,isMountedByThisTrigger:l}}function Xu(t,o={}){const{closeOnActiveTriggerUnmount:a=!1}=o,r=b.useRef(null),l=t.useState("open"),c=t.useState("triggerCount"),d=t.useState("activeTriggerId"),g=t.useState("activeTriggerElement");we(()=>{if(!l){r.current=null,t.state.triggerCount!==0&&t.set("triggerCount",0);return}const m=t.context.triggerElements.size,h={};t.state.triggerCount!==m&&(h.triggerCount=m);const y=t.select("activeTriggerId");let v=null;if(y){const S=t.context.triggerElements.getById(y);if(S)r.current=y,S!==t.state.activeTriggerElement&&(h.activeTriggerElement=S);else{for(const[w,T]of t.context.triggerElements.entries())if(T===t.state.activeTriggerElement){h.activeTriggerId=w,h.activeTriggerElement=T,r.current=w;break}h.activeTriggerId===void 0&&(r.current===y?v=y:r.current=null)}}else r.current=null;if(!v&&!y&&m===1){const S=t.context.triggerElements.entries().next();if(!S.done){const[w,T]=S.value;h.activeTriggerId=w,h.activeTriggerElement=T,r.current=w}}(h.triggerCount!==void 0||h.activeTriggerId!==void 0||h.activeTriggerElement!==void 0)&&t.update(h),v&&a&&queueMicrotask(()=>{if(t.select("open")&&t.select("activeTriggerId")===v&&!t.context.triggerElements.getById(v)){const S=qe(ns);t.setOpen(!1,S),S.isCanceled||t.update({activeTriggerId:null,activeTriggerElement:null})}})},[l,t,c,d,g,a])}function Ku(t,o,a,r){const{mounted:l,setMounted:c,transitionStatus:d}=pm(t,!1,!1,r),g=o.useState("preventUnmountingOnClose"),m=t?!1:g;o.useSyncedValues({mounted:l,transitionStatus:d,preventUnmountingOnClose:m});const h=ke(()=>{c(!1),o.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),a?.(),o.context.onOpenChangeComplete?.(!1)});return fs({enabled:l&&!t&&!m,open:t,ref:o.context.popupRef,onComplete(){t||h()}}),{forceUnmount:h,transitionStatus:d}}function $u(t,o){t.useSyncedValues(o),we(()=>()=>{t.update({activeTriggerProps:Tt,inactiveTriggerProps:Tt,popupProps:Tt})},[t])}function i1(t,o){we(()=>{!o&&t.state.openMethod!==null&&t.set("openMethod",null)},[o,t]),we(()=>()=>{t.state.openMethod!==null&&t.set("openMethod",null)},[t])}class ml{constructor(){this.idMap=new Map}add(o,a){this.idMap.set(o,a)}delete(o){this.idMap.delete(o)}hasElement(o){for(const a of this.idMap.values())if(a===o)return!0;return!1}hasMatchingElement(o){for(const a of this.idMap.values())if(o(a))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}}function Wu(t,o,a=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new dm({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:t,floatingId:o,syncOnly:!0,nested:a,onOpenChange:void 0}),floatingId:o,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Tt,inactiveTriggerProps:Tt,popupProps:Tt}}const qi=t=>t.triggerIdProp??t.activeTriggerId,ym=t=>t.openProp??t.open,Ix=t=>(t.popupElement?.id??t.floatingId)||void 0;function l1(t,o){return o!==void 0&&ym(t)&&qi(t)===o}function j2(t,o){return l1(t,o)?!0:o!==void 0&&ym(t)&&qi(t)==null&&t.triggerCount===1}const Qu={open:ym,mounted:t=>t.mounted,transitionStatus:t=>t.transitionStatus,floatingRootContext:t=>t.floatingRootContext,triggerCount:t=>t.triggerCount,preventUnmountingOnClose:t=>t.preventUnmountingOnClose,payload:t=>t.payload,activeTriggerId:qi,activeTriggerElement:t=>t.mounted?t.activeTriggerElement:null,popupId:Ix,isTriggerActive:(t,o)=>o!==void 0&&qi(t)===o,isOpenedByTrigger:(t,o)=>l1(t,o),isMountedByTrigger:(t,o)=>o!==void 0&&qi(t)===o&&t.mounted,triggerProps:(t,o)=>o?t.activeTriggerProps:t.inactiveTriggerProps,triggerPopupId:(t,o)=>j2(t,o)?Ix(t):void 0,popupProps:t=>t.popupProps,popupElement:t=>t.popupElement,positionerElement:t=>t.positionerElement};function bm(t){const o=b.useCallback(r=>t===void 0?It:t.subscribeStore(r),[t]),a=b.useCallback(()=>t===void 0?void 0:t.store,[t]);return fm.useSyncExternalStore(o,a,()=>t?.serverStore)}function _2(t){const{open:o=!1,onOpenChange:a,elements:r={}}=t,l=Gs(),c=Xs()!=null,d=Qt(()=>new dm({open:o,transitionStatus:void 0,onOpenChange:a,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new ml,floatingId:l,syncOnly:!1,nested:c})).current;return we(()=>{const g={open:o,floatingId:l};r.reference!==void 0&&(g.referenceElement=r.reference,g.domReferenceElement=et(r.reference)?r.reference:null),r.floating!==void 0&&(g.floatingElement=r.floating),d.update(g)},[o,l,r.reference,r.floating,d]),d.context.onOpenChange=a,d.context.nested=c,d}function D2(t){return z2(t,t.rootContext)}function z2(t,o){const{nodeId:a,externalTree:r}=t,l=o.useState("referenceElement"),c=o.useState("floatingElement"),d=o.useState("domReferenceElement"),g=o.useState("open"),m=o.useState("floatingId"),[h,y]=b.useState(null),[v,S]=b.useState(void 0),[w,T]=b.useState(void 0),O=b.useRef(null),A=Ks(r),C=b.useMemo(()=>({reference:l,floating:c,domReference:d}),[l,c,d]),_=p2({...t,elements:{...C,...h&&{reference:h}}}),k=et(v)?v:null,j=w===void 0?o.state.floatingElement:w;o.useSyncedValue("referenceElement",v??null),o.useSyncedValue("domReferenceElement",v===void 0?d:k),o.useSyncedValue("floatingElement",j);const z=b.useCallback(I=>{const M=et(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),getClientRects:()=>I.getClientRects(),contextElement:I}:I;y(M),_.refs.setReference(M)},[_.refs]),D=b.useCallback(I=>{(et(I)||I===null)&&(O.current=I,S(I)),(et(_.refs.reference.current)||_.refs.reference.current===null||I!==null&&!et(I))&&_.refs.setReference(I)},[_.refs,S]),L=b.useCallback(I=>{T(I),_.refs.setFloating(I)},[_.refs]),B=b.useMemo(()=>({..._.refs,setReference:D,setFloating:L,setPositionReference:z,domReference:O}),[_.refs,D,L,z]),Y=b.useMemo(()=>({..._.elements,domReference:d}),[_.elements,d]),U=b.useMemo(()=>({..._,dataRef:o.context.dataRef,open:g,onOpenChange:o.setOpen,events:o.context.events,floatingId:m,refs:B,elements:Y,nodeId:a,rootStore:o}),[_,B,Y,a,o,g,m]);return we(()=>{d&&(O.current=d)},[d]),we(()=>{o.context.dataRef.current.floatingContext=U;const I=A?.nodesRef.current.find(M=>M.id===a);I&&(I.context=U)}),b.useMemo(()=>({..._,context:U,refs:B,elements:Y,rootStore:o}),[_,B,Y,U,o])}const Kp=Yh&&cs;function c1(t,o={}){const{enabled:a=!0,delay:r}=o,l="rootStore"in t?t.rootStore:t,{events:c,dataRef:d}=l.context,g=b.useRef(!1),m=b.useRef(null),h=b.useRef(!0),y=nn();b.useEffect(()=>{const S=l.select("domReferenceElement");if(!a)return;const w=Et(S);function T(){const C=l.select("domReferenceElement");!l.select("open")&&yt(C)&&C===tn(We(C))&&(g.current=!0,m.current=C)}function O(){h.current=!0}function A(){h.current=!1}return fo(Ge(w,"blur",T),Kp&&Ge(w,"keydown",O,!0),Kp&&Ge(w,"pointerdown",A,!0))},[l,a]),b.useEffect(()=>{if(!a)return;function S(w){if(w.reason===os||w.reason===fl){const T=l.select("domReferenceElement");et(T)&&(m.current=T,g.current=!0)}}return c.on("openchange",S),()=>{c.off("openchange",S)}},[c,a,l]);const v=b.useMemo(()=>{function S(){g.current=!1,m.current=null}return{onMouseLeave(){S()},onFocus(w){const T=w.currentTarget;if(g.current){if(m.current===T)return;S()}const O=zt(w.nativeEvent);if(et(O)){if(Kp&&!w.relatedTarget){if(!h.current&&!zu(O))return}else if(!su(O))return}const A=ou(w.relatedTarget,l.context.triggerElements),{nativeEvent:C,currentTarget:_}=w,k=typeof r=="function"?r():r;if(l.select("open")&&A||k===0||k===void 0){l.setOpen(!0,qe(Er,C,_));return}y.start(k,()=>{g.current||l.setOpen(!0,qe(Er,C,_))})},onBlur(w){S();const T=w.relatedTarget,O=w.nativeEvent,A=et(T)&&T.hasAttribute(Zi("focus-guard"))&&T.getAttribute("data-type")==="outside";y.start(0,()=>{const C=l.select("domReferenceElement"),_=tn(We(C));!T&&_===C||De(d.current.floatingContext?.refs.floating.current,_)||De(C,_)||A||ou(T??_,l.context.triggerElements)||l.setOpen(!1,qe(Er,O))})}}},[d,r,l,y]);return b.useMemo(()=>a?{reference:v,trigger:v}:{},[a,v])}class vm{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new An,this.restTimeout=new An,this.handleCloseOptions=void 0}static create(){return new vm}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const du=new WeakMap;function pu(t){if(!t.performedPointerEventsMutation)return;const o=t.pointerEventsScopeElement;o&&du.get(o)===t&&(t.pointerEventsScopeElement?.style.removeProperty("pointer-events"),t.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),t.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),du.delete(o)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function u1(t,o){const{scopeElement:a,referenceElement:r,floatingElement:l}=o,c=du.get(a);c&&c!==t&&pu(c),pu(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=a,t.pointerEventsReferenceElement=r,t.pointerEventsFloatingElement=l,du.set(a,t),a.style.pointerEvents="none",r.style.pointerEvents="auto",l.style.pointerEvents="auto"}function xm(t){const o=t.context.dataRef.current,a=Qt(()=>o.hoverInteractionState??vm.create()).current;return o.hoverInteractionState||(o.hoverInteractionState=a),Eu(o.hoverInteractionState.disposeEffect),o.hoverInteractionState}function Sm(t,o={}){const{enabled:a=!0,closeDelay:r=0,nodeId:l}=o,c="rootStore"in t?t.rootStore:t,d=c.useState("open"),g=c.useState("floatingElement"),m=c.useState("domReferenceElement"),{dataRef:h}=c.context,y=Ks(),v=Xs(),S=xm(c),w=nn(),T=ke(()=>fS(h.current.openEvent?.type,S.interactedInside)),O=ke(()=>OO(h.current.openEvent?.type)),A=ke(()=>{pu(S)});we(()=>{d||(S.pointerType=void 0,S.restTimeoutPending=!1,S.interactedInside=!1,A())},[d,S,A]),b.useEffect(()=>A,[A]),we(()=>{if(a&&d&&S.handleCloseOptions?.blockPointerEvents&&O()&&et(m)&&g){const C=m,_=g,k=We(g),j=y?.nodesRef.current.find(B=>B.id===v)?.context?.elements.floating;j&&(j.style.pointerEvents="");const z=S.pointerEventsScopeElement!==_?S.pointerEventsScopeElement:null,D=j!==_?j:null,L=S.handleCloseOptions?.getScope?.()??z??D??C.closest("[data-rootownerid]")??k.body;return u1(S,{scopeElement:L,referenceElement:C,floatingElement:_}),()=>{A()}}},[a,d,m,g,S,O,y,v,A]),b.useEffect(()=>{if(!a)return;function C(){return!!(y&&v&&qs(y.nodesRef.current,v).length>0)}function _(B){const Y=Ra(r,"close",S.pointerType),U=()=>{c.setOpen(!1,qe(Bt,B)),y?.events.emit("floating.closed",B)};Y?S.openChangeTimeout.start(Y,U):(S.openChangeTimeout.clear(),U())}function k(B){const Y=zt(B);if(!CO(Y)){S.interactedInside=!1;return}S.interactedInside=Y?.closest("[aria-haspopup]")!=null}function j(){S.openChangeTimeout.clear(),w.clear(),y?.events.off("floating.closed",D),A()}function z(B){if(C()&&y){y.events.on("floating.closed",D);return}if(ou(B.relatedTarget,c.context.triggerElements))return;const Y=h.current.floatingContext?.nodeId??l,U=B.relatedTarget;if(!(y&&Y&&et(U)&&qs(y.nodesRef.current,Y,!1).some(M=>De(M.context?.elements.floating,U)))){if(S.handler){S.handler(B);return}A(),O()&&!T()&&_(B)}}function D(B){!y||!v||C()||w.start(0,()=>{y.events.off("floating.closed",D),c.setOpen(!1,qe(Bt,B)),y.events.emit("floating.closed",B)})}const L=g;return fo(L&&Ge(L,"mouseenter",j),L&&Ge(L,"mouseleave",z),L&&Ge(L,"pointerdown",k,!0),()=>{y?.events.off("floating.closed",D)})},[a,g,c,h,r,l,O,T,A,S,y,v,w])}const L2={current:null};function Zu(t,o={}){const{enabled:a=!0,delay:r=0,handleClose:l=null,mouseOnly:c=!1,restMs:d=0,move:g=!0,triggerElementRef:m=L2,externalTree:h,isActiveTrigger:y=!0,getHandleCloseContext:v,isClosing:S,shouldOpen:w,guardStaleOpen:T=!1}=o,O="rootStore"in t?t.rootStore:t,{dataRef:A,events:C}=O.context,_=Ks(h),k=xm(O),j=b.useRef(!1),z=Vt(l),D=Vt(r),L=Vt(d),B=Vt(a),Y=Vt(w),U=Vt(S),I=ke(()=>fS(A.current.openEvent?.type,k.interactedInside)),M=ke(()=>Y.current?.()!==!1),H=ke((P,q,X)=>{const Z=O.context.triggerElements;if(Z.hasElement(q))return!P||!De(P,q);if(!et(X))return!1;const W=X;return Z.hasMatchingElement(N=>De(N,W))&&(!P||!De(P,W))}),ee=ke(()=>{if(!k.handler)return;We(O.select("domReferenceElement")).removeEventListener("mousemove",k.handler),k.handler=void 0}),K=ke(()=>{pu(k)});return y&&(k.handleCloseOptions=l?.__options),b.useEffect(()=>ee,[ee]),b.useEffect(()=>{if(!a)return;function P(q){q.open?j.current=!1:(j.current=q.reason===Bt,ee(),k.openChangeTimeout.clear(),k.restTimeout.clear(),k.blockMouseMove=!0,k.restTimeoutPending=!1)}return C.on("openchange",P),()=>{C.off("openchange",P)}},[a,C,k,ee]),b.useEffect(()=>{if(!a)return;function P(V,J=!0){const $=Ra(D.current,"close",k.pointerType);$?k.openChangeTimeout.start($,()=>{O.setOpen(!1,qe(Bt,V)),_?.events.emit("floating.closed",V)}):J&&(k.openChangeTimeout.clear(),O.setOpen(!1,qe(Bt,V)),_?.events.emit("floating.closed",V))}const q=m.current??(y?O.select("domReferenceElement"):null);if(!et(q))return;function X(V){if(k.openChangeTimeout.clear(),k.blockMouseMove=!1,c&&!Bs(k.pointerType))return;const J=ux(L.current),$=Ra(D.current,"open",k.pointerType),se=zt(V),re=V.currentTarget??null,me=O.select("domReferenceElement");let pe=re;if(et(se)&&!O.context.triggerElements.hasElement(se)){for(const Ee of O.context.triggerElements.elements())if(De(Ee,se)){pe=Ee;break}}et(re)&&et(me)&&!O.context.triggerElements.hasElement(re)&&De(re,me)&&(pe=me);const be=pe==null?!1:H(me,pe,se),Ce=O.select("open"),Me=U.current?.()??O.select("transitionStatus")==="ending",ye=!Ce&&Me&&j.current,ge=!be&&et(pe)&&et(me)&&De(me,pe)&&ye,Te=J>0&&!$,Ae=be&&(Ce||ye)||ge,Ue=!Ce||be;if(Ae){M()&&O.setOpen(!0,qe(Bt,V,pe));return}Te||($?k.openChangeTimeout.start($,()=>{Ue&&M()&&O.setOpen(!0,qe(Bt,V,pe))}):Ue&&M()&&O.setOpen(!0,qe(Bt,V,pe)))}function Z(V){if(I()){K();return}ee();const J=O.select("domReferenceElement"),$=We(J);k.restTimeout.clear(),k.restTimeoutPending=!1;const se=A.current.floatingContext??v?.();if(ou(V.relatedTarget,O.context.triggerElements))return;if(z.current&&se){O.select("open")||k.openChangeTimeout.clear();const me=m.current;k.handler=z.current({...se,tree:_,x:V.clientX,y:V.clientY,onClose(){K(),ee(),B.current&&!I()&&me===O.select("domReferenceElement")&&P(V,!0)}}),$.addEventListener("mousemove",k.handler),k.handler(V);return}(k.pointerType!=="touch"||!De(O.select("floatingElement"),V.relatedTarget))&&P(V)}function W(V){De(q,V.relatedTarget)||(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1)}const N=T?Ge(q,"mouseout",W):void 0;return g?fo(Ge(q,"mousemove",X,{once:!0}),Ge(q,"mouseenter",X),Ge(q,"mouseleave",Z),N):fo(Ge(q,"mouseenter",X),Ge(q,"mouseleave",Z),N)},[ee,K,A,D,O,a,z,k,y,H,I,c,g,L,m,_,B,v,U,M,T]),b.useMemo(()=>{if(!a)return;function P(q){k.pointerType=q.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(q){const{nativeEvent:X}=q,Z=q.currentTarget,W=O.select("domReferenceElement"),N=O.select("open"),V=H(W,Z,q.target);if(c&&!Bs(k.pointerType))return;if(N&&V&&k.handleCloseOptions?.blockPointerEvents){const se=O.select("floatingElement");if(se){const re=k.handleCloseOptions?.getScope?.()??Z.ownerDocument.body;u1(k,{scopeElement:re,referenceElement:Z,floatingElement:se})}}const J=ux(L.current);if(N&&!V||J===0||!V&&k.restTimeoutPending&&q.movementX**2+q.movementY**2<2)return;k.restTimeout.clear();function $(){if(k.restTimeoutPending=!1,I())return;const se=O.select("open");!k.blockMouseMove&&(!se||V)&&M()&&O.setOpen(!0,qe(Bt,X,Z))}k.pointerType==="touch"?oo.flushSync(()=>{$()}):V&&N?$():(k.restTimeoutPending=!0,k.restTimeout.start(J,$))}}},[a,k,I,H,c,O,L,M])}const P2="Escape";function Hx(t){return cs&&t.movementX===0&&t.movementY===0}function Ju(t,o,a){switch(t){case"vertical":return o;case"horizontal":return a;default:return o||a}}function Vc(t,o){return Ju(o,t===lS||t===Wh,t===Mu||t===ju)}function $p(t,o,a){return Ju(o,t===Wh,a?t===Mu:t===ju)||t==="Enter"||t===" "||t===""}function I2(t,o,a){return Ju(o,a?t===Mu:t===ju,t===Wh)}function H2(t,o,a,r){const l=a?t===ju:t===Mu,c=t===lS;return o==="both"||o==="horizontal"&&r?t===P2:Ju(o,l,c)}function f1(t,o){const{listRef:a,activeIndex:r,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:d=null,allowEscape:g=!1,loopFocus:m=!1,nested:h=!1,rtl:y=!1,virtual:v=!1,focusItemOnOpen:S="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:T=!0,disabledIndices:O=void 0,orientation:A="vertical",parentOrientation:C,id:_,resetOnPointerLeave:k=!0,externalTree:j,grid:z}=o,D=z!=null,L="rootStore"in t?t.rootStore:t,B=L.useState("open"),Y=L.useState("floatingElement"),U=L.useState("domReferenceElement"),I=L.context.dataRef,M=au(Y),H=gh(U),ee=Vt(M),K=Xs(),P=Ks(j),q=b.useRef(S),X=b.useRef(d??-1),Z=b.useRef(null),W=b.useRef(!0),N=ke(le=>{l(X.current===-1?null:X.current,le)}),V=b.useRef(!!Y),J=b.useRef(B),$=b.useRef(!1),se=b.useRef(!1),re=b.useRef(null),me=Vt(O),pe=Vt(B),be=Vt(d),Ce=Vt(k),Me=kr(),ye=kr(),ge=ke(()=>{function le(xe){v?P?.events.emit("virtualfocus",xe):re.current=Jc(xe,{sync:$.current,preventScroll:!0})}const ve=a.current[X.current],he=se.current;ve&&le(ve),($.current?xe=>xe():xe=>Me.request(xe))(()=>{const xe=a.current[X.current]||ve;if(!xe)return;ve||le(xe),Se&&(he||!W.current)&&xe.scrollIntoView?.({block:"nearest",inline:"nearest"})})});we(()=>{I.current.orientation=A},[I,A]),we(()=>{c&&(B&&Y?(X.current=d??-1,q.current&&d!=null&&(se.current=!0,N())):V.current&&(X.current=-1,N()))},[c,B,Y,d,N]),we(()=>{if(c){if(!B){$.current=!1;return}if(Y)if(r==null){if($.current=!1,be.current!=null)return;if(V.current&&(X.current=-1,ge()),(!J.current||!V.current)&&q.current&&(Z.current!=null||q.current===!0&&Z.current==null)){let le=0;const ve=()=>{a.current[0]==null?(le<2&&(le?ce=>ye.request(ce):queueMicrotask)(ve),le+=1):(X.current=Z.current==null||$p(Z.current,A,y)||h?Zc(a):bh(a),Z.current=null,N())};ve()}}else Yi(a.current,r)||(X.current=r,ge(),se.current=!1)}},[c,B,Y,r,be,h,a,A,y,N,ge,ye]),we(()=>{if(!c||Y||!P||v||!V.current)return;const le=P.nodesRef.current,ve=le.find(xe=>xe.id===K)?.context?.elements.floating,he=tn(We(U??ve??null)),ce=le.some(xe=>xe.context&&De(xe.context.elements.floating,he));ve&&!ce&&W.current&&ve.focus({preventScroll:!0})},[c,Y,U,P,K,v]),we(()=>{J.current=B,V.current=!!Y}),we(()=>{B||(Z.current=null,q.current=S)},[B,S]);const Te=r!=null,Ae=ke(le=>{if(!pe.current)return;const ve=a.current.indexOf(le.currentTarget);ve!==-1&&(X.current!==ve||r!==ve)&&(X.current=ve,N(le))}),Ue=ke(()=>C??P?.nodesRef.current.find(le=>le.id===K)?.context?.dataRef?.current.orientation),Ee=ke(()=>Zc(a,me.current)),Le=ke(le=>{if(W.current=!1,$.current=!0,le.which===229||!pe.current&&le.currentTarget===ee.current)return;if(h&&H2(le.key,A,y,D)){Vc(le.key,Ue())||To(le),L.setOpen(!1,qe(ru,le.nativeEvent)),yt(U)&&(v?P?.events.emit("virtualfocus",U):U.focus());return}const ve=X.current,he=Zc(a,O),ce=bh(a,O);if(H||(le.key==="Home"&&(To(le),X.current=he,N(le)),le.key==="End"&&(To(le),X.current=ce,N(le))),z!=null){const xe=z(le,X.current,a,A,m,y,O,he,ce);if(xe!=null&&(X.current=xe,N(le)),A==="both")return}if(Vc(le.key,A)){if(To(le),B&&!v&&tn(le.currentTarget.ownerDocument)===le.currentTarget){X.current=$p(le.key,A,y)?he:ce,N(le);return}$p(le.key,A,y)?m?ve>=ce?g&&ve!==a.current.length?X.current=-1:($.current=!1,X.current=he):X.current=$o(a.current,{startingIndex:ve,disabledIndices:O}):X.current=Math.min(ce,$o(a.current,{startingIndex:ve,disabledIndices:O})):m?ve<=he?g&&ve!==-1?X.current=a.current.length:($.current=!1,X.current=ce):X.current=$o(a.current,{startingIndex:ve,decrement:!0,disabledIndices:O}):X.current=Math.max(he,$o(a.current,{startingIndex:ve,decrement:!0,disabledIndices:O})),Yi(a.current,X.current)&&(X.current=-1),N(le)}}),Se=b.useMemo(()=>({onFocus(ve){$.current=!0,Ae(ve)},onClick:({currentTarget:ve})=>ve.focus({preventScroll:!0}),onMouseMove(ve){Hx(ve)||($.current=!0,se.current=!1,w&&Ae(ve))},onPointerLeave(ve){if(!pe.current||!W.current||ve.pointerType==="touch")return;$.current=!0;const he=ve.relatedTarget;if(!(!w||a.current.includes(he))&&Ce.current&&(re.current?.(),re.current=null,X.current=-1,N(ve),!v)){const ce=ee.current,xe=tn(We(ce));ce&&De(ce,xe)&&ce.focus({preventScroll:!0})}}}),[Ae,pe,ee,w,a,N,Ce,v]),Re=b.useMemo(()=>v&&B&&Te&&{"aria-activedescendant":`${_}-${r}`},[v,B,Te,_,r]),Ne=b.useMemo(()=>({...H?{}:Re,onKeyDown(le){if(le.key==="Tab"&&le.shiftKey&&B&&!v){const ve=zt(le.nativeEvent);if(ve&&!De(ee.current,ve))return;To(le),L.setOpen(!1,qe(Fs,le.nativeEvent)),yt(U)&&U.focus();return}Le(le)},onPointerMove(le){Hx(le)||(W.current=!0)}}),[Re,Le,ee,H,L,B,v,U]),Ie=b.useMemo(()=>{function le(ce){L.setOpen(!0,qe(ru,ce.nativeEvent,ce.currentTarget))}function ve(ce){S==="auto"&&Ou(ce.nativeEvent)&&(q.current=!v)}function he(ce){q.current=S,S==="auto"&&Gh(ce.nativeEvent)&&(q.current=!0)}return{onKeyDown(ce){const xe=L.select("open");W.current=!1;const He=ce.key.startsWith("Arrow"),Lt=I2(ce.key,Ue(),y),Ft=Vc(ce.key,A),ut=(h?Lt:Ft)||ce.key==="Enter"||ce.key.trim()==="";if(v&&xe)return Le(ce);if(!(!xe&&!T&&He)){if(ut){const Oe=Vc(ce.key,Ue());Z.current=h&&Oe?null:ce.key}if(h){Lt&&(To(ce),xe?(X.current=Ee(),N(ce)):le(ce));return}Ft&&(be.current!=null&&(X.current=be.current),To(ce),!xe&&T?le(ce):Le(ce),xe&&N(ce))}},onFocus(ce){L.select("open")&&!v&&(X.current=-1,N(ce))},onPointerDown:he,onPointerEnter:he,onMouseDown:ve,onClick:ve}},[Le,S,Ee,h,N,L,T,A,Ue,y,be,v]),je=b.useMemo(()=>({...Re,...Ie}),[Re,Ie]);return b.useMemo(()=>c?{reference:je,floating:Ne,item:Se,trigger:Ie}:{},[c,je,Ne,Ie,Se])}function d1(t,o){const{listRef:a,elementsRef:r,activeIndex:l,onMatch:c,disabledIndices:d,onTyping:g,enabled:m=!0,resetMs:h=750,selectedIndex:y=null}=o,v="rootStore"in t?t.rootStore:t,S=v.useState("open"),w=nn(),T=b.useRef(""),O=b.useRef(y??l??-1),A=b.useRef(null),C=ke(j=>{function z(ee){return r?.current[ee]}function D(ee){const K=z(ee);return K&&!Hu(K)||K?.matches(":disabled")?!1:d==null||!Cr(po,ee,d)}function L(ee,K,P=0){if(ee.length===0)return-1;const q=(P%ee.length+ee.length)%ee.length,X=K.toLowerCase();for(let Z=0;Z<ee.length;Z+=1){const W=(q+Z)%ee.length;if(!(!ee[W]?.toLowerCase().startsWith(X)||!D(W)))return W}return-1}const B=a.current;if(T.current.length>0&&j.key===" "&&(To(j),g?.(!0)),T.current.length>0&&T.current[0]!==" "&&L(B,T.current)===-1&&j.key!==" "&&g?.(!1),B==null||j.key.length!==1||j.ctrlKey||j.metaKey||j.altKey)return;S&&j.key!==" "&&(To(j),g?.(!0));const Y=T.current==="";Y&&(O.current=y??l??-1),B.every((ee,K)=>ee&&D(K)?ee[0]?.toLowerCase()!==ee[1]?.toLowerCase():!0)&&T.current===j.key&&(T.current="",O.current=A.current),T.current+=j.key,w.start(h,()=>{T.current="",O.current=A.current,g?.(!1)});const M=((Y?y??l??-1:O.current)??0)+1,H=L(B,T.current,M);H!==-1?(c?.(H),A.current=H):j.key!==" "&&(T.current="",g?.(!1))}),_=ke(j=>{const z=j.relatedTarget,D=v.select("domReferenceElement"),L=v.select("floatingElement");De(D,z)||De(L,z)||(w.clear(),T.current="",O.current=A.current,g?.(!1))});we(()=>{!S&&y!==null||(w.clear(),A.current=null,T.current!==""&&(T.current=""))},[S,y,w]);const k=b.useMemo(()=>({onKeyDown:C,onBlur:_}),[C,_]);return b.useMemo(()=>m?{reference:k,floating:k}:{},[m,k])}const Ux=.1,U2=Ux*Ux,wt=.5;function Fc(t,o,a,r,l,c){return r>=o!=c>=o&&t<=(l-a)*(o-r)/(c-r)+a}function Yc(t,o,a,r,l,c,d,g,m,h){let y=!1;return Fc(t,o,a,r,l,c)&&(y=!y),Fc(t,o,l,c,d,g)&&(y=!y),Fc(t,o,d,g,m,h)&&(y=!y),Fc(t,o,m,h,a,r)&&(y=!y),y}function B2(t,o,a){return t>=a.x&&t<=a.x+a.width&&o>=a.y&&o<=a.y+a.height}function qc(t,o,a,r,l,c){const d=Math.min(a,l),g=Math.max(a,l),m=Math.min(r,c),h=Math.max(r,c);return t>=d&&t<=g&&o>=m&&o<=h}function ef(t={}){const{blockPointerEvents:o=!1}=t,a=new An,r=({x:l,y:c,placement:d,elements:g,onClose:m,nodeId:h,tree:y})=>{const v=d?.split("-")[0];let S=!1,w=null,T=null,O=typeof performance<"u"?performance.now():0;function A(_,k){const j=performance.now(),z=j-O;if(w===null||T===null||z===0)return w=_,T=k,O=j,!1;const D=_-w,L=k-T,B=D*D+L*L,Y=z*z*U2;return w=_,T=k,O=j,B<Y}function C(){a.clear(),m()}return function(k){a.clear();const j=g.domReference,z=g.floating;if(!j||!z||v==null||l==null||c==null)return;const{clientX:D,clientY:L}=k,B=zt(k),Y=k.type==="mouseleave",U=De(z,B),I=De(j,B);if(U&&(S=!0,!Y))return;if(I&&(S=!1,!Y)){S=!0;return}if(Y&&et(k.relatedTarget)&&De(z,k.relatedTarget))return;function M(){return!!(y&&qs(y.nodesRef.current,h).length>0)}function H(){M()||C()}if(M())return;const ee=j.getBoundingClientRect(),K=z.getBoundingClientRect(),P=l>K.right-K.width/2,q=c>K.bottom-K.height/2,X=K.width>ee.width,Z=K.height>ee.height,W=(X?ee:K).left,N=(X?ee:K).right,V=(Z?ee:K).top,J=(Z?ee:K).bottom;if(v==="top"&&c>=ee.bottom-1||v==="bottom"&&c<=ee.top+1||v==="left"&&l>=ee.right-1||v==="right"&&l<=ee.left+1){H();return}let $=!1;switch(v){case"top":$=qc(D,L,W,ee.top+1,N,K.bottom-1);break;case"bottom":$=qc(D,L,W,K.top+1,N,ee.bottom-1);break;case"left":$=qc(D,L,K.right-1,J,ee.left+1,V);break;case"right":$=qc(D,L,ee.right-1,J,K.left+1,V);break}if($)return;if(S&&!B2(D,L,ee)){H();return}if(!Y&&A(D,L)){H();return}let se=!1;switch(v){case"top":{const re=X?wt/2:wt*4,me=X||P?l+re:l-re,pe=X?l-re:P?l+re:l-re,be=c+wt+1,Ce=P||X?K.bottom-wt:K.top,Me=P?X?K.bottom-wt:K.top:K.bottom-wt;se=Yc(D,L,me,be,pe,be,K.left,Ce,K.right,Me);break}case"bottom":{const re=X?wt/2:wt*4,me=X||P?l+re:l-re,pe=X?l-re:P?l+re:l-re,be=c-wt,Ce=P||X?K.top+wt:K.bottom,Me=P?X?K.top+wt:K.bottom:K.top+wt;se=Yc(D,L,me,be,pe,be,K.left,Ce,K.right,Me);break}case"left":{const re=Z?wt/2:wt*4,me=Z||q?c+re:c-re,pe=Z?c-re:q?c+re:c-re,be=l+wt+1,Ce=q||Z?K.right-wt:K.left,Me=q?Z?K.right-wt:K.left:K.right-wt;se=Yc(D,L,Ce,K.top,Me,K.bottom,be,me,be,pe);break}case"right":{const re=Z?wt/2:wt*4,me=Z||q?c+re:c-re,pe=Z?c-re:q?c+re:c-re,be=l-wt,Ce=q||Z?K.left+wt:K.right,Me=q?Z?K.left+wt:K.right:K.left+wt;se=Yc(D,L,be,me,be,pe,Ce,K.top,Me,K.bottom);break}}se?S||a.start(40,H):H()}};return r.__options={...t,blockPointerEvents:o},r}const V2={...Qu,disabled:t=>t.disabled,instantType:t=>t.instantType,isInstantPhase:t=>t.isInstantPhase,trackCursorAxis:t=>t.trackCursorAxis,disableHoverablePopup:t=>t.disableHoverablePopup,lastOpenChangeReason:t=>t.openChangeReason,closeOnClick:t=>t.closeOnClick,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class F2 extends Da{constructor(o,a,r){const l=new ml;super(Y2(o,l,a,r),q2(l),V2)}setOpen=(o,a)=>{M2(this,o,a,{extraState:{openChangeReason:a.reason}})};cancelPendingOpen(o){this.state.floatingRootContext.dispatchOpenChange(!1,qe(os,o))}}function Y2(t,o,a,r=!1){return{...Wu(o,a,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t}}function q2(t){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const G2=il(function(o){const{disabled:a=!1,defaultOpen:r=!1,open:l,disableHoverablePopup:c=!1,trackCursorAxis:d="none",actionsRef:g,onOpenChange:m,onOpenChangeComplete:h,handle:y,triggerId:v,defaultTriggerId:S=null,children:w}=o,T=hm((I,M)=>new F2({open:r,openProp:l,activeTriggerId:S,triggerIdProp:v},I,M));T.useControlledProp("openProp",l),T.useControlledProp("triggerIdProp",v),T.useContextCallback("onOpenChange",m),T.useContextCallback("onOpenChangeComplete",h);const O=T.useState("open"),A=!a&&O,C=T.useState("activeTriggerId"),_=T.useState("mounted"),k=T.useState("payload");T.useSyncedValues({trackCursorAxis:d,disableHoverablePopup:c,disabled:a}),Xu(T,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:j,transitionStatus:z}=Ku(A,T),D=T.useState("isInstantPhase"),L=T.useState("instantType"),B=T.useState("lastOpenChangeReason"),Y=b.useRef(null);we(()=>{O&&a&&T.setOpen(!1,qe(AO))},[O,a,T]),we(()=>{z==="ending"&&B===ns||z!=="ending"&&D?(L!=="delay"&&(Y.current=L),T.set("instantType","delay")):Y.current!==null&&(T.set("instantType",Y.current),Y.current=null)},[z,D,B,L,T]),we(()=>{A&&C==null&&T.set("payload",void 0)},[T,C,A]),b.useImperativeHandle(g,()=>({unmount:j,close:()=>T.setOpen(!1,qe(Pu))}),[j,T]);const U=A||_||!a&&d!=="none";return p.jsxs(sS.Provider,{value:T,children:[y&&p.jsx(qu,{handle:y,store:T}),U&&p.jsx(X2,{store:T,disabled:a,trackCursorAxis:d}),typeof w=="function"?w({payload:k}):w]})});function X2({store:t,disabled:o,trackCursorAxis:a}){const r=t.useState("floatingRootContext"),l=pl(r,{enabled:!o,referencePress:()=>t.select("closeOnClick")}),c=jA(r,{enabled:!o&&a!=="none",axis:a==="none"?void 0:a}),d=b.useMemo(()=>no(c.reference,l.reference),[c.reference,l.reference]);return $u(t,{activeTriggerProps:d,inactiveTriggerProps:d,popupProps:l.floating??Tt}),null}function mo(t){return Gs(t,"base-ui")}const p1=b.createContext(void 0);function K2(){return b.useContext(p1)}const $2=600,h1="data-base-ui-tooltip-trigger";function Bx(t){if("composedPath"in t){const a=t.composedPath();for(let r=0;r<a.length;r+=1){const l=a[r];if(et(l))return l}}const o=t.target;return et(o)?o:null}function W2(t){let o=t;for(;o;){const a=o.closest(`[${h1}]`);if(a)return a;const r=o.getRootNode();o="host"in r&&et(r.host)?r.host:null}return null}const Q2=Fh(function(o,a){const{render:r,className:l,style:c,handle:d,payload:g,disabled:m,delay:h,closeOnClick:y=!0,closeDelay:v,id:S,...w}=o,T=Tu(!0),A=bm(d)??T;if(!A)throw new Error(At(82));const C=mo(S),_=A.useState("isTriggerActive",C),k=A.useState("isOpenedByTrigger",C),j=A.useState("floatingRootContext"),z=b.useRef(null),D=v??0,{registerTrigger:L,isMountedByThisTrigger:B}=gm(C,z,A,{payload:g,closeOnClick:y,closeDelay:D}),Y=K2(),{activeIdRef:U,delayRef:I,isInstantPhase:M,hasProvider:H}=jO(j,{open:k}),ee=xm(j);A.useSyncedValue("isInstantPhase",M);const K=A.useState("disabled"),P=m??K,q=Vt(P),X=A.useState("trackCursorAxis"),Z=A.useState("disableHoverablePopup"),W=b.useRef(!1),N=nn(),V=b.useRef(void 0);function J(){return H&&U.current!=null?0:h??Y??$2}function $(ge){const Te=z.current;if(!Te||!ge)return!1;const Ae=W2(ge);return Ae!==null&&Ae!==Te&&De(Te,Ae)}function se(ge){const Te=$(ge);return W.current=Te,Te&&(ee.openChangeTimeout.clear(),ee.restTimeout.clear(),ee.restTimeoutPending=!1,N.clear()),Te}const re=Zu(j,{enabled:!P,mouseOnly:!0,move:!1,handleClose:!Z&&X!=="both"?ef():null,restMs:J,delay(){return v==null&&H?{close:Ra(I.current,"close")}:{close:D}},triggerElementRef:z,isActiveTrigger:_,isClosing:()=>A.select("transitionStatus")==="ending",shouldOpen(){return!W.current}}),me=c1(j,{enabled:!P}).reference,pe=ge=>{const Te=W.current,Ae=Bx(ge),Ue=se(Ae),Ee=z.current,Le=Ee&&Ae&&De(Ee,Ae);if(Ue&&A.select("open")&&A.select("lastOpenChangeReason")===Bt){A.setOpen(!1,qe(Bt,ge));return}if(Te&&!Ue&&Le&&!q.current&&!A.select("open")&&Ee&&Bs(V.current)){const Se=()=>{!W.current&&!q.current&&!A.select("open")&&A.setOpen(!0,qe(Bt,ge,Ee))},Re=J();Re===0?(N.clear(),Se()):N.start(Re,Se)}},be=A.useState("triggerProps",B);return tt("button",o,{state:{open:k},ref:[a,L,z],props:[re,me,B||X!=="none"?be:void 0,{onMouseOver(ge){pe(ge.nativeEvent)},onFocus(ge){$(Bx(ge.nativeEvent))&&ge.preventBaseUIHandler()},onMouseLeave(){W.current=!1,N.clear(),V.current=void 0},onPointerEnter(ge){V.current=ge.pointerType},onPointerDown(ge){V.current=ge.pointerType,A.set("closeOnClick",y),y&&!A.select("open")&&A.cancelPendingOpen(ge.nativeEvent)},onClick(ge){y&&!A.select("open")&&A.cancelPendingOpen(ge.nativeEvent)},id:C,[mh]:P?"":void 0,[h1]:P?void 0:""},w],stateAttributesMapping:_u})}),m1=b.createContext(void 0);function Z2(){const t=b.useContext(m1);if(t===void 0)throw new Error(At(70));return t}const g1=b.forwardRef(function(o,a){const{children:r,container:l,className:c,render:d,style:g,...m}=o,{node:h,subtree:y}=VS({container:l,ref:a,componentProps:o,elementProps:m});return!y&&!h?null:p.jsxs(b.Fragment,{children:[y,h&&oo.createPortal(r,h)]})}),J2=b.forwardRef(function(o,a){const{keepMounted:r=!1,...l}=o;return Tu().useState("mounted")||r?p.jsx(m1.Provider,{value:r,children:p.jsx(g1,{ref:a,...l})}):null}),y1=b.createContext(void 0);function eN(){const t=b.useContext(y1);if(t===void 0)throw new Error(At(71));return t}const tN=b.createContext(void 0);function tf(){return b.useContext(tN)?.direction??"ltr"}const nN=t=>({name:"arrow",options:t,async fn(o){const{x:a,y:r,placement:l,rects:c,platform:d,elements:g,middlewareData:m}=o,{element:h,padding:y=0,offsetParent:v="real"}=Ys(t,o)||{};if(h==null)return{};const S=xS(y),w={x:a,y:r},T=em(l),O=Jh(T),A=await d.getDimensions(h),C=T==="y",_=C?"top":"left",k=C?"bottom":"right",j=C?"clientHeight":"clientWidth",z=c.reference[O]+c.reference[T]-w[T]-c.floating[O],D=w[T]-c.reference[T],L=v==="real"?await d.getOffsetParent?.(h):g.floating;let B=g.floating[j]||c.floating[O];(!B||!await d.isElement?.(L))&&(B=g.floating[j]||c.floating[O]);const Y=z/2-D/2,U=B/2-A[O]/2-1,I=Math.min(S[_],U),M=Math.min(S[k],U),H=I,ee=B-A[O]-M,K=B/2-A[O]/2+Y,P=vS(H,K,ee),q=!m.arrow&&rs(l)!=null&&K!==P&&c.reference[O]/2-(K<H?I:M)-A[O]/2<0,X=q?K<H?K-H:K-ee:0;return{[T]:w[T]+X,data:{[T]:P,centerOffset:K-P-X,...q&&{alignmentOffset:X}},reset:q}}}),oN=(t,o)=>{const{name:a,fn:r}=nN(t);return{name:a,fn:r,options:[t,o]}},sN={name:"hide",async fn(t){const{width:o,height:a,x:r,y:l}=t.rects.reference,c=o===0&&a===0&&r===0&&l===0,d=await t.platform.detectOverflow(t,{elementContext:"reference"});return{data:{referenceHidden:d.top-a>=0||d.right-o>=0||d.bottom-a>=0||d.left-o>=0||c}}}},aN={sideX:"left",sideY:"top"},rN="--available-width",iN="--available-height",lN="--anchor-width",cN="--anchor-height",uN="--transform-origin",Vx=rN,Fx=iN;function b1(t,o,a){const r=t==="inline-start"||t==="inline-end";return{top:"top",right:r?a?"inline-start":"inline-end":"right",bottom:"bottom",left:r?a?"inline-end":"inline-start":"left"}[o]}function Yx(t,o,a){const{rects:r,placement:l}=t;return{side:b1(o,to(l),a),align:rs(l)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function nf(t){return fN(t,D2)}function fN(t,o){const{anchor:a,positionMethod:r="absolute",side:l="bottom",sideOffset:c=0,align:d="center",alignOffset:g=0,collisionBoundary:m,collisionPadding:h=5,sticky:y=!1,arrowPadding:v=5,disableAnchorTracking:S=!1,inline:w,keepMounted:T=!1,floatingRootContext:O,mounted:A,collisionAvoidance:C,shift:_,nodeId:k,adaptiveOrigin:j,lazyFlip:z=!1,externalTree:D}=t,[L,B]=b.useState(null);!A&&L!==null&&B(null);const Y=C.side||"flip",U=C.align||"flip",I=C.fallbackAxisSide||"end",M=_?.crossAxis??!1,H=_?.rootBoundary,ee=typeof a=="function"?a:void 0,K=ke(ee),P=ee?K:a,q=Vt(a),X=Vt(A),W=tf()==="rtl",N=L||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":W?"left":"right","inline-start":W?"right":"left"}[l],V=d==="center"?N:`${N}-${d}`;let J=h;typeof J=="number"?J={top:J,right:J,bottom:J,left:J}:J&&(J={top:J.top||0,right:J.right||0,bottom:J.bottom||0,left:J.left||0});const $=1,se=l==="bottom"?$:0,re=l==="top"?$:0,me=l==="right"?$:0,pe=l==="left"?$:0,be={boundary:m==="clipping-ancestors"?"clippingAncestors":m,padding:J},Ce=b.useRef(null),Me=Vt(c),ye=Vt(g),ge=typeof c!="function"?c:0,Te=typeof g!="function"?g:0,Ae=[];w&&Ae.push(w),Ae.push(h2(Fe=>{const ft=Yx(Fe,l,W),_t=typeof Me.current=="function"?Me.current(ft):Me.current,Pt=typeof ye.current=="function"?ye.current(ft):ye.current;return{mainAxis:_t,crossAxis:Pt,alignmentAxis:Pt}},[ge,Te,W,l]));const Ue=U==="none"&&Y!=="shift",Ee=!Ue&&(y||M||Y==="shift"),Le=Y==="none"?null:y2({...be,padding:{top:J.top+$+se,right:J.right+$+pe,bottom:J.bottom+$+re,left:J.left+$+me},mainAxis:!M&&Y==="flip",crossAxis:U==="flip"?"alignment":!1,fallbackAxisSideDirection:I}),Se=Ue?null:m2({...be,rootBoundary:H,mainAxis:U!=="none",crossAxis:Ee,limiter:y||M?void 0:g2(Fe=>{if(!Ce.current)return{};const{width:ft,height:_t}=Ce.current.getBoundingClientRect(),Pt=eo(to(Fe.placement)),Nn=Pt==="y"?ft:_t,ln=Pt==="y"?J.left+J.right:J.top+J.bottom;return{offset:Nn/2+ln/2}})},[be,y,M,H,J,U]);Y==="shift"||U==="shift"||d==="center"?Ae.push(Se,Le):Ae.push(Le,Se),Ae.push(b2({...be,apply({elements:{floating:Fe},availableWidth:ft,availableHeight:_t,rects:Pt}){if(!X.current)return;const Nn=Fe.style;Nn.setProperty(Vx,`${ft}px`),Nn.setProperty(Fx,`${_t}px`);const ln=Et(Fe).devicePixelRatio||1,{x:yo,y:vn,width:Ro,height:kn}=Pt.reference,Ze=(Math.round((yo+Ro)*ln)-Math.round(yo*ln))/ln,Rt=(Math.round((vn+kn)*ln)-Math.round(vn*ln))/ln;Nn.setProperty(lN,`${Ze}px`),Nn.setProperty(cN,`${Rt}px`)}}),oN(Fe=>({element:Ce.current||We(Fe.elements.floating).createElement("div"),padding:Ce.current?v:0,offsetParent:"floating"}),[v]),{name:"transformOrigin",fn(Fe){const{elements:{floating:ft},middlewareData:_t,placement:Pt,platform:Nn,rects:ln,y:yo}=Fe,vn=to(Pt),Ro=rs(Pt),kn=eo(vn)==="y",Ze=Ce.current,Rt=typeof c=="function"?c(Yx(Fe,l,W)):c;let Mn;if(!Ze&&Ro&&Math.abs(kn?_t.shift?.x||0:_t.shift?.y||0)<=1)Mn=Ro==="start"===(kn&&Nn.isRTL?.(ft)===!0)?"100%":"0%";else{const bo=kn?_t.arrow?.x||0:_t.arrow?.y||0,ps=kn?Ze?.clientWidth||0:Ze?.clientHeight||0;Mn=`${bo+ps/2}px`}let ao=vn==="top"||vn==="left"?`calc(100% + ${Rt}px)`:`${-Rt}px`;return Ee&&kn&&Math.abs(_t.shift?.y||0)>Rt&&(ao=`${ln.reference.y+ln.reference.height/2-yo}px`),ft.style.setProperty(uN,kn?`${Mn} ${ao}`:`${ao} ${Mn}`),{}}},sN,j),we(()=>{!A&&O&&O.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[A,O]);const Re=b.useMemo(()=>({ancestorScroll:!S,elementResize:!S&&typeof ResizeObserver<"u",layoutShift:!S&&typeof IntersectionObserver<"u"}),[S]),{refs:Ne,elements:Ie,x:je,y:le,middlewareData:ve,update:he,placement:ce,context:xe,isPositioned:He,floatingStyles:Lt}=o({rootContext:O,open:T?A:void 0,placement:V,middleware:Ae,strategy:r,whileElementsMounted:T?void 0:(...Fe)=>Mx(...Fe,Re),nodeId:k,externalTree:D}),{sideX:Ft,sideY:ut}=ve.adaptiveOrigin||aN,Oe=He?r:"fixed",Ye=b.useMemo(()=>{let Fe;return He?j?Fe={position:Oe,[Ft]:je,[ut]:le}:Fe={...Lt,position:Oe}:Fe={position:Oe,top:0,left:0},Fe[Vx]="100vw",Fe[Fx]="100vh",He||(Fe.opacity=0),Fe},[j,Oe,Ft,je,ut,le,Lt,He]),Qe=b.useRef(null);we(()=>{if(!A)return;const Fe=q.current,ft=typeof Fe=="function"?Fe():Fe,Pt=(qx(ft)?ft.current:ft)||null||null;Pt!==Qe.current&&(Ne.setPositionReference(Pt),Qe.current=Pt)},[A,Ne,P,q]),b.useEffect(()=>{if(!A)return;const Fe=q.current;typeof Fe!="function"&&qx(Fe)&&Fe.current!==Qe.current&&(Ne.setPositionReference(Fe.current),Qe.current=Fe.current)},[A,Ne,P,q]),b.useEffect(()=>{if(T&&A&&Ie.reference&&Ie.floating)return Mx(Ie.reference,Ie.floating,he,Re)},[T,A,Ie,he,Re]);const ct=to(ce),Jt=b1(l,ct,W),rn=rs(ce)||"center",hn=!!ve.hide?.referenceHidden;we(()=>{z&&A&&He&&ct!==N&&B(ct)},[z,A,He,ct,N]);const bt=b.useMemo(()=>({position:"absolute",top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),jt=ve.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:Ye,arrowStyles:bt,arrowRef:Ce,arrowUncentered:jt,side:Jt,align:rn,physicalSide:ct,anchorHidden:hn,refs:Ne,context:xe,isPositioned:He,update:he}),[Ye,bt,Ce,jt,Jt,rn,ct,hn,Ne,xe,He,he])}function qx(t){return t!=null&&"current"in t}function gl(t){return t==="starting"?wA:Tt}function of(t,o,{styles:a,transitionStatus:r,props:l,refs:c,hidden:d,inert:g=!1}){const m={...a};return g&&(m.pointerEvents="none"),tt("div",t,{state:o,ref:c,props:[{role:"presentation",hidden:d,style:m},gl(r),l],stateAttributesMapping:ul})}const dN=b.forwardRef(function(o,a){const{render:r,className:l,anchor:c,positionMethod:d="absolute",side:g="top",align:m="center",sideOffset:h=0,alignOffset:y=0,collisionBoundary:v="clipping-ancestors",collisionPadding:S=5,arrowPadding:w=5,sticky:T=!1,disableAnchorTracking:O=!1,collisionAvoidance:A=rm,style:C,..._}=o,k=Tu(),j=Z2(),z=k.useState("open"),D=k.useState("mounted"),L=k.useState("trackCursorAxis"),B=k.useState("disableHoverablePopup"),Y=k.useState("floatingRootContext"),U=k.useState("instantType"),I=k.useState("transitionStatus"),M=k.useState("adaptiveOrigin"),H=nf({anchor:c,positionMethod:d,floatingRootContext:Y,mounted:D,side:g,sideOffset:h,align:m,alignOffset:y,collisionBoundary:v,collisionPadding:S,sticky:T,arrowPadding:w,disableAnchorTracking:O,keepMounted:j,collisionAvoidance:A,adaptiveOrigin:M}),ee=b.useMemo(()=>({open:z,side:H.side,align:H.align,anchorHidden:H.anchorHidden,instant:L!=="none"?"tracking-cursor":U}),[z,H.side,H.align,H.anchorHidden,L,U]),K=of(o,ee,{styles:H.positionerStyles,transitionStatus:I,props:_,refs:[a,k.useStateSetter("positionerElement")],hidden:!D,inert:!z||L==="both"||B});return p.jsx(y1.Provider,{value:H,children:K})}),pN=b.forwardRef(function(o,a){const{render:r,className:l,style:c,...d}=o,g=Tu(),{side:m,align:h}=eN(),y=g.useState("open"),v=g.useState("instantType"),S=g.useState("transitionStatus"),w=g.useState("popupProps"),T=g.useState("floatingRootContext"),O=g.useState("disabled"),A=g.useState("closeDelay");fs({open:y,ref:g.context.popupRef,onComplete(){y&&g.context.onOpenChangeComplete?.(!0)}}),Sm(T,{enabled:!O,closeDelay:A});const C=g.useStateSetter("popupElement");return tt("div",o,{state:{open:y,side:m,align:h,instant:v,transitionStatus:S},ref:[a,g.context.popupRef,C],props:[hl,w,gl(S),d],stateAttributesMapping:Du})}),hN=function(o){const{delay:a,closeDelay:r,timeout:l=400}=o,c=b.useMemo(()=>({open:a,close:r}),[a,r]);return p.jsx(p1.Provider,{value:a,children:p.jsx(MO,{delay:c,timeoutMs:l,children:o.children})})};function yl(t){return om(19)?t:t?"true":void 0}function mN(t){const[o,a]=b.useState({current:t,previous:null});return Object.is(t,o.current)||a({current:t,previous:o.current}),o.previous}function v1({label:t,shortcut:o,side:a="bottom",children:r}){return p.jsxs(G2,{children:[p.jsx(Q2,{render:r}),p.jsx(J2,{children:p.jsx(dN,{side:a,sideOffset:6,className:"z-[1000]",children:p.jsxs(pN,{className:"rounded-md bg-fg px-2 py-1 text-xs text-surface shadow-popup data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 transition-opacity",children:[t,o?p.jsx("span",{className:"ml-2 opacity-60",children:o}):null]})})})]})}function gN({children:t}){return p.jsx(hN,{delay:500,closeDelay:0,children:t})}function yN(t){return t.repeat&&(t.key==="Enter"||t.key===" ")}function jr(t){yN(t)&&t.target===t.currentTarget&&t.preventDefault()}function x1(t){return t?o=>{jr(o),t(o)}:jr}const bN=200,vN=2e3;function xN(t,o,a){let r=null,l=!1;const c=()=>{l||(l=!0,t.removeEventListener("keydown",d,!0),t.removeEventListener("keyup",d,!0),t.clearTimeout(g),r!==null&&t.clearTimeout(r))},d=m=>{const h=m.key==="Enter"||m.key===" ";if(m.type==="keyup"){m.key===" "&&!a(m.target)&&m.preventDefault(),m.key===o&&r===null&&(r=t.setTimeout(c,bN));return}h&&!a(m.target)&&(m.preventDefault(),m.stopImmediatePropagation())},g=t.setTimeout(c,vN);return t.addEventListener("keydown",d,!0),t.addEventListener("keyup",d,!0),c}const SN={primary:"bg-accent text-accent-fg hover:brightness-110 active:brightness-95",secondary:"bg-surface text-fg border border-line hover:bg-hover",ghost:"bg-transparent text-fg hover:bg-hover",danger:"bg-danger text-white hover:brightness-110"},wN={sm:"h-6 px-2 text-xs gap-1",md:"h-7 px-2.5 text-[13px] gap-1.5",lg:"h-8 px-3 text-[13px] gap-2"},it=b.forwardRef(function({variant:o="secondary",size:a="md",icon:r,className:l,children:c,type:d="button",onKeyDown:g,...m},h){return p.jsxs("button",{ref:h,type:d,className:lt("inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-control font-medium transition-[background,filter]","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent","disabled:pointer-events-none disabled:opacity-45",SN[o],wN[a],l),...m,onKeyDown:x1(g),children:[r,c]})}),TN={sm:"size-6",md:"size-7",lg:"size-8"},za=b.forwardRef(function({label:o,icon:a,shortcut:r,active:l,size:c="md",noTooltip:d,className:g,type:m="button",onKeyDown:h,...y},v){const S=p.jsx("button",{ref:v,type:m,"aria-label":o,"aria-pressed":l===void 0?void 0:l,className:lt("inline-flex shrink-0 items-center justify-center rounded-control text-fg-muted transition-colors","hover:bg-hover hover:text-fg focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent","disabled:pointer-events-none disabled:opacity-40",l&&"bg-accent-soft text-accent hover:bg-accent-soft hover:text-accent",TN[c],g),...y,onKeyDown:x1(h),children:a});return d?S:p.jsx(v1,{label:o,shortcut:r,children:S})}),S1=b.createContext(void 0);function wm(t){const o=b.useContext(S1);if(o===void 0&&!t)throw new Error(At(33));return o}const w1=b.createContext(void 0);function $s(t){const o=b.useContext(w1);if(o===void 0&&!t)throw new Error(At(36));return o}const EN=b.createContext(void 0);function Tm(t=!0){const o=b.useContext(EN);if(o===void 0&&!t)throw new Error(At(25));return o}function Ji({controlled:t,default:o,name:a,state:r="value"}){const{current:l}=b.useRef(t!==void 0),[c,d]=b.useState(o),g=l&&t!==void 0?t:c,m=b.useCallback(h=>{l||d(h)},[]);return[g,m]}const T1=b.createContext(void 0);function Em(t=!1){const o=b.useContext(T1);if(o===void 0&&!t)throw new Error(At(16));return o}function CN(t){const{focusableWhenDisabled:o,disabled:a,composite:r=!1,tabIndex:l=0,isNativeButton:c}=t,d=r&&o!==!1,g=r&&o===!1;return{props:b.useMemo(()=>{const h={onKeyDown(y){a&&o&&y.key!=="Tab"&&y.preventDefault()}};return r||(h.tabIndex=l,!c&&a&&(h.tabIndex=o?l:-1)),(c&&(o||d)||!c&&a)&&(h["aria-disabled"]=a),c&&(!o||g)&&(h.disabled=a),h},[r,a,o,d,g,c,l])}}function Gi(t,o,{detail:a=0}={}){t.dispatchEvent(new(Et(t)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:a,shiftKey:o.shiftKey,ctrlKey:o.ctrlKey,altKey:o.altKey,metaKey:o.metaKey}))}function Co(t={}){const{disabled:o=!1,focusableWhenDisabled:a,tabIndex:r=0,native:l=!0,composite:c}=t,d=b.useRef(null),g=Em(!0),m=c??g!==void 0,{props:h}=CN({focusableWhenDisabled:a,disabled:o,composite:m,tabIndex:r,isNativeButton:l}),y=b.useCallback(()=>{const w=d.current;Wp(w)&&m&&o&&h.disabled===void 0&&w.disabled&&(w.disabled=!1)},[o,h.disabled,m]);we(y,[y]);const v=b.useCallback((w={})=>{const{onClick:T,onMouseDown:O,onKeyUp:A,onKeyDown:C,onPointerDown:_,...k}=w;return no({onClick(j){if(o){j.preventDefault();return}T?.(j)},onMouseDown(j){o||O?.(j)},onKeyDown(j){if(o||(uu(j),C?.(j),j.baseUIHandlerPrevented))return;const z=j.target===j.currentTarget,D=j.currentTarget,L=Wp(D),B=!l&&RN(D),Y=z&&(l?L:!B),U=j.key==="Enter",I=j.key===" ",M=D.getAttribute("role"),H=M?.startsWith("menuitem")||M==="option"||M==="gridcell";if(z&&m&&I){if(j.defaultPrevented&&H)return;j.preventDefault(),(!l||L)&&(j.preventBaseUIHandler(),Gi(D,j));return}if(!Y||l||!I&&!U){z&&B&&I&&j.preventDefault();return}j.defaultPrevented||(j.preventDefault(),U&&(j.preventBaseUIHandler(),Gi(D,j)))},onKeyUp(j){if(!o){if(uu(j),A?.(j),j.target===j.currentTarget&&l&&m&&Wp(j.currentTarget)&&j.key===" "){j.preventDefault();return}j.baseUIHandlerPrevented||j.target===j.currentTarget&&!l&&!m&&!j.defaultPrevented&&j.key===" "&&(j.preventBaseUIHandler(),Gi(j.currentTarget,j))}},onPointerDown(j){if(o){j.preventDefault();return}_?.(j)}},l?{type:"button"}:{role:"button"},h,k)},[o,h,m,l]),S=ke(w=>{d.current=w,y()});return{getButtonProps:v,buttonRef:S}}function Wp(t){return yt(t)&&t.tagName==="BUTTON"}function RN(t){return yt(t)&&t.tagName==="A"&&!!t.href}function ON(t){const{closeOnClick:o,highlighted:a,id:r,nodeId:l,store:c,typingRef:d,itemRef:g,itemMetadata:m}=t,{events:h}=c.useState("floatingTreeRoot"),y=c.useState("open"),v=Tm(!0),S=v!==void 0;return b.useMemo(()=>({id:r,role:"menuitem",tabIndex:y&&a?0:-1,onKeyDown(w){w.key===" "&&d?.current&&w.preventDefault()},onMouseMove(w){l&&h.emit("itemhover",{nodeId:l,target:w.currentTarget})},onClick(w){o&&h.emit("close",{domEvent:w,reason:Fi})},onMouseUp(w){if(v){const T=v.initialCursorPointRef.current;if(v.initialCursorPointRef.current=null,S&&T&&Math.abs(w.clientX-T.x)<=1&&Math.abs(w.clientY-T.y)<=1||S&&!Yh&&w.button===2)return}g.current&&c.context.allowMouseUpTriggerRef.current&&(!S||w.button===2)&&m.type==="regular-item"&&Gi(g.current,w,{detail:1})}}),[o,a,r,h,l,y,c,d,g,v,S,m])}const AN={type:"regular-item"};function E1(t){const{closeOnClick:o,disabled:a,highlighted:r,id:l,store:c,typingRef:d=c.context.typingRef,nativeButton:g,itemMetadata:m,nodeId:h}=t,y=b.useRef(null),{getButtonProps:v,buttonRef:S}=Co({disabled:a,focusableWhenDisabled:!0,native:g,composite:!0}),w=ON({closeOnClick:o,highlighted:r,id:l,nodeId:h,store:c,typingRef:d,itemRef:y,itemMetadata:m}),T=b.useCallback(A=>no(w,{onMouseEnter(){m.type==="submenu-trigger"&&m.setActive()}},A,v),[w,v,m]),O=ss(y,S);return b.useMemo(()=>({getItemProps:T,itemRef:O}),[T,O])}const C1=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function NN(){return b.useContext(C1)}function sf(t={}){const{guess:o,label:a,metadata:r,textRef:l,index:c}=t,{register:d,unregister:g,subscribeMapChange:m,nextIndexRef:h}=NN(),y=b.useRef(-1),[v,S]=b.useState(c==null&&o?()=>{if(y.current===-1){const A=h.current;h.current+=1,y.current=A}return y.current}:-1),w=c??v,T=b.useRef(null),O=b.useCallback(A=>{const C=T.current;C&&g(C),T.current=A,A&&d(A,{metadata:r??null,index:c??null,label:a,textRef:l})},[c,d,g,r,a,l]);return we(()=>{if(c==null)return m(A=>{const C=T.current?A.get(T.current)?.index:null;C!=null&&S(C)})},[c,m]),{ref:O,index:w}}const R1=b.forwardRef(function(o,a){const{render:r,className:l,id:c,label:d,nativeButton:g=!1,disabled:m=!1,closeOnClick:h=!0,style:y,...v}=o,S=sf({guess:!0,label:d}),w=wm(!0),T=mo(c),{store:O}=$s(),A=O.useState("disabled"),C=m||A,_=O.useState("isActive",S.index),k=O.useState("itemProps"),{getItemProps:j,itemRef:z}=E1({closeOnClick:h,disabled:C,highlighted:_,id:T,store:O,nativeButton:g,nodeId:w?.context.nodeId,itemMetadata:AN});return tt("div",o,{state:{disabled:C,highlighted:_},props:[k,v,j],ref:[z,a,S.ref]})}),kN=b.createContext(void 0);function af(t){return b.useContext(kN)}const wh="ArrowUp",Th="ArrowDown",Eh="ArrowLeft",Ch="ArrowRight",Rh="Home",Oh="End",bl=new Set([wh,Th,Eh,Ch,Rh,Oh]),MN="Shift",jN=[MN,"Control","Alt","Meta"];function _N(t){return yt(t)&&t.tagName==="INPUT"}function Gx(t){return!!(_N(t)&&t.selectionStart!=null||yt(t)&&t.tagName==="TEXTAREA")}function Xx(t,o,a,r){if(!t||!o||!o.scrollTo)return;let l=t.scrollLeft,c=t.scrollTop;const d=t.clientWidth<t.scrollWidth,g=t.clientHeight<t.scrollHeight;if(d&&r!=="vertical"){const m=Kx(t,o,"left"),h=Gc(t),y=Gc(o);a==="ltr"&&(m+o.offsetWidth+y.scrollMarginRight>t.scrollLeft+t.clientWidth-h.scrollPaddingRight?l=m+o.offsetWidth+y.scrollMarginRight-t.clientWidth+h.scrollPaddingRight:m-y.scrollMarginLeft<t.scrollLeft+h.scrollPaddingLeft&&(l=m-y.scrollMarginLeft-h.scrollPaddingLeft)),a==="rtl"&&(m-y.scrollMarginLeft<t.scrollLeft+h.scrollPaddingLeft?l=m-y.scrollMarginLeft-h.scrollPaddingLeft:m+o.offsetWidth+y.scrollMarginRight>t.scrollLeft+t.clientWidth-h.scrollPaddingRight&&(l=m+o.offsetWidth+y.scrollMarginRight-t.clientWidth+h.scrollPaddingRight))}if(g&&r!=="horizontal"){const m=Kx(t,o,"top"),h=Gc(t),y=Gc(o);m-y.scrollMarginTop<t.scrollTop+h.scrollPaddingTop?c=m-y.scrollMarginTop-h.scrollPaddingTop:m+o.offsetHeight+y.scrollMarginBottom>t.scrollTop+t.clientHeight-h.scrollPaddingBottom&&(c=m+o.offsetHeight+y.scrollMarginBottom-t.clientHeight+h.scrollPaddingBottom)}t.scrollTo({left:l,top:c,behavior:"auto"})}function Kx(t,o,a){const r=a==="left"?"offsetLeft":"offsetTop";let l=0;for(;o.offsetParent&&(l+=o[r],o.offsetParent!==t);)o=o.offsetParent;return l}function Gc(t){const o=getComputedStyle(t);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 Cm=b.forwardRef(function(o,a){const{render:r,className:l,style:c,finalFocus:d,...g}=o,{store:m}=$s(),{side:h,align:y}=wm(),v=af()!=null,S=m.useState("open"),w=m.useState("transitionStatus"),T=m.useState("popupProps"),O=m.useState("mounted"),A=m.useState("instantType"),C=m.useState("activeTriggerElement"),_=m.useState("parent"),k=m.useState("lastOpenChangeReason"),j=m.useState("rootId"),z=m.useState("floatingRootContext"),D=m.useState("floatingTreeRoot"),L=m.useState("closeDelay"),B=m.useState("hoverEnabled"),Y=m.useState("disabled"),U=m.useState("openMethod"),I=_.type==="context-menu";fs({open:S,ref:m.context.popupRef,onComplete(){S&&m.context.onOpenChangeComplete?.(!0)}}),b.useEffect(()=>{function P(q){m.setOpen(!1,qe(q.reason,q.domEvent))}return D.events.on("close",P),()=>{D.events.off("close",P)}},[D.events,m]),Sm(z,{enabled:B&&!Y&&!I&&_.type!=="menubar",closeDelay:L});const M=m.useStateSetter("popupElement"),H={transitionStatus:w,side:h,align:y,open:S,nested:_.type==="menu",instant:A},ee=tt("div",o,{state:H,ref:[a,m.context.popupRef,M],stateAttributesMapping:Du,props:[T,{onKeyDown(P){v&&bl.has(P.key)&&P.stopPropagation()}},gl(w),g,{"data-rootownerid":j}]});let K=_.type===void 0||I;return(C||_.type==="menubar"&&k!==Lu)&&(K=!0),p.jsx(Bu,{context:z,openInteractionType:U,modal:I,disabled:!O,returnFocus:d===void 0?K:d,initialFocus:_.type!=="menu",restoreFocus:!0,externalTree:_.type!=="menubar"?D:void 0,previousFocusableElement:C,nextFocusableElement:_.type===void 0?m.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?m.context.beforeContentFocusGuardRef:void 0,children:ee})}),O1=b.createContext(void 0);function DN(){const t=b.useContext(O1);if(t===void 0)throw new Error(At(32));return t}const Rm=b.forwardRef(function(o,a){const{keepMounted:r=!1,...l}=o,{store:c,parent:d}=$s();if(!(c.useState("mounted")||r))return null;const h=d.type==="menu"||d.type==="menubar"?"group":void 0;return p.jsx(O1.Provider,{value:r,children:p.jsx(Uu,{ref:a,...l,portalOwnerRole:h})})});function Om(t){const{children:o,elementsRef:a,labelsRef:r,onMapChange:l}=t,c=ke(l),[,d]=b.useState(!1),g=Qt(LN).current,m=Qt(zN).current,h=b.useRef(0),y=b.useRef(!0),v=b.useRef(null),S=b.useRef(null),w=ke(()=>{y.current||(y.current=!0,d(z=>!z))}),T=ke((z,D)=>{m.set(z,D),w()}),O=ke(z=>{m.delete(z),w()}),A=ke(z=>{const D=new Map;return a.current.length=0,r&&(r.current.length=0),z.forEach(L=>{D.set(L.element,{...L.registration.metadata??{},index:L.index}),a.current[L.index]=L.element,r&&(r.current[L.index]=L.registration.label!==void 0?L.registration.label:L.registration.textRef?.current?.textContent??L.element.textContent)}),h.current=a.current.length,D});function C(z){if(S.current?.disconnect(),S.current=null,typeof MutationObserver!="function"||z.length<2)return;const D=new MutationObserver(B=>{if(!HN(B))return;let Y=null;for(const U of z)if(U.isConnected){if(Y&&A1(Y,U)>0){D.disconnect(),w();return}Y=U}});S.current=D;const L=new Set;for(let B=1;B<z.length;B+=1){const Y=IN(z[B-1],z[B]);Y&&L.add(Y)}L.forEach(B=>D.observe(B,{childList:!0}))}const _=ke(()=>{const[z,D]=PN(m),L=A(z),B=v.current,Y=!B||B.length!==z.length||z.some((U,I)=>{const M=B[I];return U.index!==M.index||U.element!==M.element||U.registration.index!==M.registration.index||U.registration.metadata!==M.registration.metadata});C(D),v.current=z,y.current=!1,Y&&(g.forEach(U=>U(L)),c(L))});we(()=>(!y.current&&v.current&&A(v.current),()=>{a.current=[],r&&(r.current=[])}),[a,r,A]),we(()=>{y.current&&_()}),we(()=>()=>{S.current?.disconnect(),y.current=!0},[]);const k=ke(z=>(g.add(z),()=>{g.delete(z)})),j=b.useMemo(()=>({register:T,unregister:O,subscribeMapChange:k,nextIndexRef:h}),[T,O,k,h]);return p.jsx(C1.Provider,{value:j,children:o})}function zN(){return new Map}function LN(){return new Set}function PN(t){const o=new Set,a=[],r=[];t.forEach((c,d)=>{if(!d.isConnected)return;const g=c.index,m={index:g??-1,element:d,registration:c};g===null?r.push(m):g>=0&&(o.add(g),a.push(m))});let l=0;return r.sort((c,d)=>A1(c.element,d.element)),r.forEach(c=>{for(;o.has(l);)l+=1;c.index=l,a.push(c),l+=1}),o.size>0&&a.sort((c,d)=>c.index-d.index),[a,r.map(c=>c.element)]}function IN(t,o){let a=t.parentElement;for(;a&&!a.contains(o);)a=a.parentElement;return a}function HN(t){for(const o of t)for(let a=0;a<o.removedNodes.length;a+=1)if(o.removedNodes[a].isConnected)return!0;return!1}function A1(t,o){return t.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const rf=b.forwardRef(function(o,a){const{cutout:r,...l}=o;let c;if(r){const d=r.getBoundingClientRect();c=`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 p.jsx("div",{ref:a,role:"presentation","data-base-ui-inert":"",...l,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:c}})});let $x={},Wx={},Qx="";function lf(t,o){return ll(t)?t:o}function Zx(t,o,a){return/hidden|clip/.test(t.getComputedStyle(lf(o,a)).overflowY)}function UN(t){if(typeof document>"u")return!1;const o=We(t);return Et(o).innerWidth-o.documentElement.clientWidth>0}function BN(t){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const a=We(t),r=a.documentElement,l=a.body,c=lf(r,l),d=c.style.overflowY,g=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",c.style.overflowY="scroll";const m=c.offsetWidth;c.style.overflowY="hidden";const h=c.offsetWidth;return c.style.overflowY=d,r.style.scrollbarGutter=g,m===h}function VN(t){const o=We(t),a=o.documentElement,r=o.body,l=lf(a,r),c={overflowY:l.style.overflowY,overflowX:l.style.overflowX};return Object.assign(l.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(l.style,c)}}function FN(t){const o=We(t),a=o.documentElement,r=o.body,l=Et(a);let c=0,d=0,g=!1;const m=Eo.create();if(cs&&(l.visualViewport?.scale??1)!==1)return()=>{};function h(){const w=l.getComputedStyle(a),T=l.getComputedStyle(r),C=(w.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";c=a.scrollTop,d=a.scrollLeft,$x={scrollbarGutter:a.style.scrollbarGutter,overflowY:a.style.overflowY,overflowX:a.style.overflowX},Qx=a.style.scrollBehavior,Wx={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const _=a.scrollHeight>a.clientHeight,k=a.scrollWidth>a.clientWidth,j=w.overflowY==="scroll"||T.overflowY==="scroll",z=w.overflowX==="scroll"||T.overflowX==="scroll",D=Math.max(0,l.innerWidth-r.clientWidth),L=Math.max(0,l.innerHeight-r.clientHeight),B=parseFloat(T.marginTop)+parseFloat(T.marginBottom),Y=parseFloat(T.marginLeft)+parseFloat(T.marginRight),U=lf(a,r);if(g=BN(t),g){a.style.scrollbarGutter=C,U.style.overflowY="hidden",U.style.overflowX="hidden";return}Object.assign(a.style,{scrollbarGutter:C,overflowY:"hidden",overflowX:"hidden"}),(_||j)&&(a.style.overflowY="scroll"),(k||z)&&(a.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:B||L?`calc(100dvh - ${B+L}px)`:"100dvh",width:Y||D?`calc(100vw - ${Y+D}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=c,r.scrollLeft=d,a.setAttribute("data-base-ui-scroll-locked",""),a.style.scrollBehavior="unset"}function y(){Object.assign(a.style,$x),Object.assign(r.style,Wx),g||(a.scrollTop=c,a.scrollLeft=d,a.removeAttribute("data-base-ui-scroll-locked"),a.style.scrollBehavior=Qx)}function v(){y(),m.request(h)}h();const S=Ge(l,"resize",v);return()=>{m.cancel(),y(),typeof l.removeEventListener=="function"&&S()}}class YN{lockCount=0;restore=null;timeoutLock=An.create();timeoutUnlock=An.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 a=We(o),r=a.documentElement,l=a.body,c=Et(r);if(Zx(c,r,l)){const g=new c.MutationObserver(()=>{Zx(c,r,l)||(g.disconnect(),this.restore=null,this.lock(o))}),m={attributes:!0};g.observe(r,m),g.observe(l,m),this.restore=()=>g.disconnect();return}const d=Ru||!UN(o);this.restore=d?VN(o):FN(o)}}const qN=new YN;function N1(t=!0,o=null){we(()=>{if(t)return qN.acquire(o)},[t,o])}const GN=20;function Am(t,o,a,r){const[l,c]=b.useState(!1);we(()=>{if(!t||!o||a==null){c(!1);return}const d=We(a).documentElement.clientWidth,g=a.offsetWidth;c(d>0&&g>0&&g>=d-GN)},[t,o,a]),N1(t&&(!o||l),r)}const Nm=b.forwardRef(function(o,a){const{anchor:r,positionMethod:l="absolute",className:c,render:d,side:g,align:m,sideOffset:h=0,alignOffset:y=0,collisionBoundary:v="clipping-ancestors",collisionPadding:S=5,arrowPadding:w=5,sticky:T=!1,disableAnchorTracking:O=!1,collisionAvoidance:A=HS,style:C,..._}=o,{store:k}=$s(),j=DN(),z=Tm(!0),D=k.useState("parent"),L=k.useState("floatingRootContext"),B=k.useState("floatingTreeRoot"),Y=k.useState("mounted"),U=k.useState("open"),I=k.useState("modal"),M=k.useState("openMethod"),H=k.useState("activeTriggerElement"),ee=k.useState("transitionStatus"),K=k.useState("positionerElement"),P=k.useState("instantType"),q=k.useState("adaptiveOrigin"),X=k.useState("lastOpenChangeReason"),Z=k.useState("floatingNodeId"),W=k.useState("floatingParentNodeId"),N=L.useState("domReferenceElement"),V=b.useRef(null),J=Yu(K);let $=r,se=h,re=y,me=m,pe=A;D.type==="context-menu"&&($=r??D.context?.anchor,me=me??"start",!g&&me!=="center"&&(re=o.alignOffset??2,se=o.sideOffset??-5));let be=g,Ce=me;D.type==="menu"?(be=be??"inline-end",Ce=Ce??"start",pe=o.collisionAvoidance??rm):D.type==="menubar"&&(be=be??(D.context.orientation==="vertical"?"inline-end":"bottom"),Ce=Ce??"start");const Me=D.type==="context-menu",ye=nf({anchor:$,floatingRootContext:L,positionMethod:z?"fixed":l,mounted:Y,side:be,sideOffset:se,align:Ce,alignOffset:re,arrowPadding:Me?0:w,collisionBoundary:v,collisionPadding:S,sticky:T,nodeId:Z,keepMounted:j,disableAnchorTracking:O,collisionAvoidance:pe,shift:Me?{crossAxis:!("side"in pe&&pe.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:B,adaptiveOrigin:q});b.useEffect(()=>{function Re(Ne){Ne.open&&(Ne.parentNodeId===Z&&k.set("hoverEnabled",!1),Ne.nodeId!==Z&&Ne.parentNodeId===k.select("floatingParentNodeId")&&k.setOpen(!1,qe(Ii)))}return B.events.on("menuopenchange",Re),()=>{B.events.off("menuopenchange",Re)}},[k,B.events,Z]),b.useEffect(()=>{if(k.select("floatingParentNodeId")==null)return;function Re(Ne){if(Ne.open||Ne.nodeId!==k.select("floatingParentNodeId"))return;const Ie=Ne.reason??Ii;k.setOpen(!1,qe(Ie))}return B.events.on("menuopenchange",Re),()=>{B.events.off("menuopenchange",Re)}},[B.events,k]);const ge=nn();b.useEffect(()=>{U||ge.clear()},[U,ge]),b.useEffect(()=>{function Re(Ne){if(!(!U||Ne.nodeId!==k.select("floatingParentNodeId")))if(Ne.target&&H&&H!==Ne.target){const Ie=k.select("closeDelay");Ie>0?ge.isStarted()||ge.start(Ie,()=>{k.setOpen(!1,qe(Ii))}):k.setOpen(!1,qe(Ii))}else ge.clear()}return B.events.on("itemhover",Re),()=>{B.events.off("itemhover",Re)}},[B.events,U,H,k,ge]),b.useEffect(()=>{const Re={open:U,nodeId:Z,parentNodeId:W,reason:k.select("lastOpenChangeReason")};B.events.emit("menuopenchange",Re)},[B.events,U,k,Z,W]),we(()=>{const Re=N,Ne=V.current;if(Re&&(V.current=Re),Ne&&Re&&Re!==Ne){k.set("instantType",void 0);const Ie=new AbortController;return J(()=>{k.set("instantType","trigger-change")},Ie.signal),()=>{Ie.abort()}}},[N,J,k]);const Te={open:U,side:ye.side,align:ye.align,anchorHidden:ye.anchorHidden,nested:D.type==="menu",instant:P},Ae=D.type==="menubar"&&D.context.modal;Am(U&&(Ae||I&&X!==Bt),M==="touch",K,H);const Ee=of(o,Te,{styles:ye.positionerStyles,transitionStatus:ee,props:_,refs:[a,k.useStateSetter("positionerElement")],hidden:!Y,inert:!U}),Le=Y&&D.type!=="menu"&&(D.type!=="menubar"&&I&&X!==Bt||D.type==="menubar"&&D.context.modal);let Se=null;return D.type==="menubar"?Se=D.context.contentElement:D.type===void 0&&(Se=H),p.jsxs(S1.Provider,{value:ye,children:[Le&&p.jsx(rf,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:yl(!U),cutout:Se}),p.jsx(GS,{id:Z,children:p.jsx(Om,{elementsRef:k.context.itemDomElements,labelsRef:k.context.itemLabels,children:Ee})})]})}),XN=b.createContext(null);function k1(t){return b.useContext(XN)}function KN(t){const o=b.useRef(""),a=b.useCallback(l=>{l.defaultPrevented||(o.current=l.pointerType,t(l,l.pointerType))},[t]);return{onClick:b.useCallback(l=>{if(l.detail===0){t(l,"keyboard");return}"pointerType"in l?t(l,l.pointerType):t(l,o.current),o.current=""},[t]),onPointerDown:a}}function km(t,o){const a=b.useRef(t),r=ke(o);we(()=>{a.current!==t&&r(a.current),a.current=t},[t,r])}function M1(t,o){const a=ke((c,d)=>{(typeof t=="function"?t():t)||o(d||(Ru?"touch":""))}),{onClick:r,onPointerDown:l}=KN(a);return b.useMemo(()=>({onClick:r,onPointerDown:l}),[r,l])}function j1(t){const[o,a]=b.useState(null),r=M1(t,a);return km(t,l=>{l&&!t&&a(null)}),b.useMemo(()=>({openMethod:o,triggerProps:r}),[o,r])}const $N={...Qu,disabled:t=>t.parent.type==="menubar"&&t.parent.context.disabled||t.disabled,modal:t=>(t.parent.type===void 0||t.parent.type==="context-menu")&&(t.modal??!0),openMethod:t=>t.openMethod,allowMouseEnter:t=>t.allowMouseEnter,highlightItemOnHover:t=>t.highlightItemOnHover,parent:t=>t.parent,rootId:t=>t.parent.type==="menu"?t.parent.store.select("rootId"):t.parent.type!==void 0?t.parent.context.rootId:t.rootId,activeIndex:t=>t.activeIndex,isActive:(t,o)=>t.activeIndex===o,hoverEnabled:t=>t.hoverEnabled,instantType:t=>t.instantType,lastOpenChangeReason:t=>t.openChangeReason,floatingTreeRoot:t=>t.parent.type==="menu"?t.parent.store.select("floatingTreeRoot"):t.floatingTreeRoot,floatingNodeId:t=>t.floatingNodeId,floatingParentNodeId:t=>t.floatingParentNodeId,itemProps:t=>t.itemProps,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin,keyboardEventRelay:t=>{if(t.keyboardEventRelay)return t.keyboardEventRelay;if(t.parent.type==="menu")return t.parent.store.select("keyboardEventRelay")}};class WN extends Da{constructor(o,a,r=!1){const l=new ml,c=ZN(l,a,r,o);super(c,QN(l),$N),this.unsubscribeParentListener=this.observe("parent",d=>{if(this.unsubscribeParentListener?.(),d.type==="menu"){let g=d.store.select("rootId"),m=d.store.select("floatingTreeRoot"),h=d.store.select("keyboardEventRelay");this.unsubscribeParentListener=d.store.subscribe(()=>{const y=d.store.select("rootId"),v=d.store.select("floatingTreeRoot"),S=d.store.select("keyboardEventRelay");g===y&&m===v&&h===S||(g=y,m=v,h=S,this.notifyAll())}),this.context.allowMouseUpTriggerRef=d.store.context.allowMouseUpTriggerRef;return}d.type!==void 0&&(this.context.allowMouseUpTriggerRef=d.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(o,a){this.state.floatingRootContext.context.events.emit("setOpen",{open:o,eventDetails:a})}unsubscribeParentListener=null}function QN(t){return{positionerRef:b.createRef(),popupRef:b.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),onOpenChangeComplete:void 0,triggerElements:t}}function ZN(t,o,a=!1,r){return{...Wu(t,o,a),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new im,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Tt,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}const _1=b.createContext(void 0);function D1(){return b.useContext(_1)}const Mm=il(function(o){const{children:a,open:r,onOpenChange:l,onOpenChangeComplete:c,defaultOpen:d=!1,disabled:g=!1,modal:m,loopFocus:h=!0,orientation:y="vertical",actionsRef:v,closeParentOnEsc:S=!1,handle:w,triggerId:T,defaultTriggerId:O=null,highlightItemOnHover:A=!0}=o,C=Tm(!0),_=$s(!0),k=k1(!0),j=D1(),z=b.useMemo(()=>j&&_?{type:"menu",store:_.store}:k?{type:"menubar",context:k}:C&&!_?{type:"context-menu",context:C}:{type:void 0},[C,_,k,j]),D=Gs(),L=Gs(),B=Xs(),Y=z.type==="menu"?z.store:void 0,U=(r??d)&&Y?.state.transitionStatus==="starting",I=Qt(()=>U?Y?.state.instantType:void 0).current,M=JN({open:d,openProp:r,activeTriggerId:O,triggerIdProp:T,parent:z,disabled:g,highlightItemOnHover:A,modal:z.type===void 0?m:void 0,rootId:D,instantType:I},L,B!=null);M.useControlledProp("openProp",r),M.useControlledProp("triggerIdProp",T),M.useContextCallback("onOpenChangeComplete",c);const H=M.useState("floatingTreeRoot"),ee=lm(H),K=M.useState("open"),P=M.useState("activeTriggerElement"),q=M.useState("positionerElement"),X=M.useState("hoverEnabled"),Z=M.useState("disabled"),W=M.useState("lastOpenChangeReason"),N=M.useState("parent"),V=M.useState("activeIndex"),J=M.useState("payload"),$=M.useState("floatingParentNodeId"),se=b.useRef(null),re=b.useRef(N.type!=="context-menu"),me=nn(),pe=b.useRef(!0),be=nn(),Ce=$!=null,{openMethod:Me,triggerProps:ye}=j1(K);M.useSyncedValues({disabled:g,highlightItemOnHover:A,modal:N.type===void 0?m:void 0,openMethod:Me,rootId:D}),Xu(M);const{forceUnmount:ge,transitionStatus:Te}=Ku(K,M,()=>{M.set("allowMouseEnter",!1)},U),Ae=Yu(M.context.popupRef);b.useEffect(()=>{if(I===void 0)return;const Oe=()=>{M.state.instantType===I&&M.set("instantType",void 0)};if(!K){Oe();return}if(Te!==void 0)return;if(M.context.popupRef.current==null){Oe();return}const Ye=new AbortController;return Ae(Oe,Ye.signal),()=>{Ye.abort()}},[I,K,Te,Ae,M]),we(()=>{C&&!_?M.update({parent:{type:"context-menu",context:C},floatingNodeId:ee,floatingParentNodeId:B}):_&&M.update({floatingNodeId:ee,floatingParentNodeId:B})},[C,_,ee,B,M]),b.useEffect(()=>{if(K||(se.current=null),N.type==="context-menu"){if(!K){me.clear(),re.current=!1;return}me.start(500,()=>{re.current=!0})}},[me,K,N.type]),we(()=>{!K&&!X&&M.set("hoverEnabled",!0)},[K,X,M]);const Ue=ke((Oe,Ye)=>{const Qe=Ye.reason;if(!Oe&&!M.select("open")||K===Oe&&Ye.trigger===P&&W===Qe)return;const ct=mm(Ye);if(!Oe&&Ye.trigger==null&&(Ye.trigger=P??void 0),l?.(Oe,Ye),Ye.isCanceled)return;M.state.floatingRootContext.dispatchOpenChange(Oe,Ye);const Jt=Ye.event;if(Oe===!1&&Jt?.type==="click"&&Jt.pointerType==="touch"&&!pe.current)return;Oe&&Qe===Er?(pe.current=!1,be.start(300,()=>{pe.current=!0})):(pe.current=!0,be.clear());const rn=(Qe===os||Qe===Fi)&&Jt.detail===0,hn=!Oe&&(Qe===fl||Qe==null);se.current=Ye.event;const bt=Gu(M.state,Oe,Ye.trigger,ct());bt.openChangeReason=Qe,N.type==="menubar"&&(Qe===Er||Qe===Fs||Qe===Bt||Qe===ru||Qe===Ii)?bt.instantType="group":rn||hn?bt.instantType=rn?"click":"dismiss":bt.instantType=void 0,M.update(bt)}),Ee=s1({popupStore:M,floatingRootContext:M.state.floatingRootContext,floatingId:L,nested:B!=null,onOpenChange:Ue}),Le=Ee.context.events;we(()=>{const Oe=({open:Ye,eventDetails:Qe})=>Ue(Ye,Qe);return Le.on("setOpen",Oe),()=>{Le?.off("setOpen",Oe)}},[Le,Ue]);const Se=b.useCallback(()=>{M.setOpen(!1,qe(Pu))},[M]);b.useImperativeHandle(v,()=>({unmount:ge,close:Se}),[ge,Se]);let Re;N.type==="context-menu"&&(Re=N.context),b.useImperativeHandle(Re?.positionerRef,()=>q,[q]),b.useImperativeHandle(Re?.actionsRef,()=>({setOpen:Ue}),[Ue]);const Ne=pl(Ee,{enabled:!Z,bubbles:{escapeKey:S&&N.type==="menu"},outsidePress(){return N.type!=="context-menu"||se.current?.type==="contextmenu"?!0:re.current},externalTree:Ce?H:void 0}),Ie=tf(),je=b.useCallback(Oe=>{M.select("activeIndex")!==Oe&&M.set("activeIndex",Oe)},[M]),le=f1(Ee,{enabled:!Z,listRef:M.context.itemDomElements,activeIndex:V,nested:N.type!==void 0,loopFocus:h,orientation:y,parentOrientation:N.type==="menubar"?N.context.orientation:void 0,rtl:Ie==="rtl",disabledIndices:po,onNavigate:je,openOnArrowKeyDown:N.type!=="context-menu",externalTree:Ce?H:void 0,focusItemOnHover:A}),ve=b.useCallback(Oe=>{M.context.typingRef.current=Oe},[M]),he=d1(Ee,{enabled:!Z,listRef:M.context.itemLabels,elementsRef:M.context.itemDomElements,activeIndex:V,resetMs:SA,onMatch:Oe=>{K&&Oe!==V&&M.set("activeIndex",Oe)},onTyping:ve}),ce=b.useMemo(()=>{const Oe=no(he.reference,le.reference,Ne.reference,{onMouseMove(){M.set("allowMouseEnter",!0)}},ye);return Oe["aria-haspopup"]="menu",Oe["aria-expanded"]=K,Oe},[M,he.reference,le.reference,Ne.reference,ye,K]),xe=b.useMemo(()=>{const Oe=no(le.trigger,Ne.trigger,ye);return Oe["aria-haspopup"]="menu",Oe["aria-expanded"]=!1,Oe},[le.trigger,Ne.trigger,ye]);Qt(()=>(M.update({inactiveTriggerProps:xe}),null));const He=b.useMemo(()=>no(hl,{id:L,role:"menu","aria-orientation":y==="horizontal"?"horizontal":void 0,"aria-labelledby":P?.id,onMouseMove(){M.set("allowMouseEnter",!0),N.type==="menu"&&M.set("hoverEnabled",!1)},onClick(){M.select("hoverEnabled")&&M.set("hoverEnabled",!1)},onKeyDown(Oe){const Ye=M.select("keyboardEventRelay");Ye&&!Oe.isPropagationStopped()&&Ye(Oe)}},he.floating,le.floating,Ne.floating),[P,L,y,N.type,M,he.floating,le.floating,Ne.floating]),Lt=le.item??Tt;$u(M,{floatingRootContext:Ee,activeTriggerProps:ce,inactiveTriggerProps:xe,popupProps:He,itemProps:Lt});const Ft=b.useMemo(()=>({store:M,parent:z}),[M,z]),ut=p.jsxs(w1.Provider,{value:Ft,children:[w&&p.jsx(qu,{handle:w,store:M}),typeof a=="function"?a({payload:J}):a]});return N.type===void 0||N.type==="context-menu"?p.jsx(XS,{externalTree:H,children:ut}):ut});function JN(t,o,a){return Qt(()=>new WN(t,o,a)).current}function ek(t){const o=$s().store,a=b.useMemo(()=>({parentMenu:o}),[o]);return p.jsx(_1.Provider,{value:a,children:p.jsx(Mm,{...t})})}const Xc=5;function z1(t,o){const a=tk(o);return t.clientX>=a.left-Xc&&t.clientX<=a.right+Xc&&t.clientY>=a.top-Xc&&t.clientY<=a.bottom+Xc}function tk(t){const o=t.getBoundingClientRect(),a=Et(t);if(qh)return o;const r=a.getComputedStyle(t,"::before"),l=a.getComputedStyle(t,"::after");if(!(r.content!=="none"||l.content!=="none"))return o;const d=parseFloat(r.width)||0,g=parseFloat(r.height)||0,m=parseFloat(l.width)||0,h=parseFloat(l.height)||0,y=Math.max(o.width,d,m),v=Math.max(o.height,g,h),S=y-o.width,w=v-o.height;return{left:o.left-S/2,right:o.right+S/2,top:o.top-w/2,bottom:o.bottom+w/2}}function nk(t={}){const{highlightItemOnHover:o,highlightedIndex:a,onHighlightedIndexChange:r}=Em(),{ref:l,index:c}=sf(t),d=a===c,g=b.useRef(null),m=ss(l,g);return{compositeProps:{tabIndex:d?0:-1,onFocus(){r(c)},onMouseMove(){const y=g.current;if(!o||!y)return;const v=y.hasAttribute("disabled")||y.ariaDisabled==="true";!d&&!v&&y.focus()}},compositeRef:m,index:c}}function L1(t){const{render:o,className:a,style:r,state:l=Tt,props:c=po,refs:d=po,metadata:g,stateAttributesMapping:m,tag:h="div",...y}=t,{compositeProps:v,compositeRef:S}=nk({metadata:g});return tt(h,t,{state:l,ref:[S,...d],props:[v,...c,y],stateAttributesMapping:m})}function P1(t){if(yt(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid");if(!Wo(t))return P1(ts(t))}function I1(t,o){const a=b.useRef(null);function r(c){oo.flushSync(()=>{t.setOpen(!1,qe(Fs,c.nativeEvent,c.currentTarget))}),nA(a.current)?.focus()}function l(c){const d=t.select("positionerElement");if(d&&Rr(c,d))t.context.beforeContentFocusGuardRef.current?.focus();else{oo.flushSync(()=>{t.setOpen(!1,qe(Fs,c.nativeEvent,c.currentTarget))});let g=tA(t.context.triggerFocusTargetRef.current||o.current);for(;g!==null&&De(d,g);){const m=g;if(g=nm(g),g===m)break}g?.focus()}}return{preFocusGuardRef:a,handlePreFocusGuardFocus:r,handleFocusTargetFocus:l}}function ok(t){const{enabled:o=!0,mouseDownAction:a,open:r}=t,l=b.useRef(!1);return b.useMemo(()=>o?{onMouseDown:c=>{(a==="open"&&!r||a==="close"&&r)&&(l.current=!0,We(c.currentTarget).addEventListener("click",()=>{l.current=!1},{once:!0}))},onClick:c=>{l.current&&(l.current=!1,c.preventBaseUIHandler())}}:Tt,[o,a,r])}const H1=Fh(function(o,a){const{render:r,className:l,style:c,disabled:d=!1,nativeButton:g=!0,id:m,openOnHover:h,delay:y=100,closeDelay:v=0,handle:S,payload:w,...T}=o,O=$s(!0),C=bm(S)??O?.store;if(!C)throw new Error(At(85));const _=mo(m),k=C.useState("isTriggerActive",_),j=C.useState("floatingRootContext"),z=C.useState("isOpenedByTrigger",_),D=C.useState("triggerPopupId",_),L=b.useRef(null),B=ak(),Y=Em(!0),U=Ks(),I=b.useMemo(()=>U??new im,[U]),M=lm(I),H=Xs(),{registerTrigger:ee,isMountedByThisTrigger:K}=gm(_,L,C,{payload:w,closeDelay:v,parent:B,floatingTreeRoot:I,floatingNodeId:M,floatingParentNodeId:H,keyboardEventRelay:Y?.relayKeyboardEvent}),P=B.type==="menubar",q=C.useState("disabled"),X=d||q||P&&B.context.disabled,{getButtonProps:Z,buttonRef:W}=Co({disabled:X,native:g});b.useEffect(()=>{!z&&B.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,z,B.type]);const N=b.useRef(null),V=nn(),J=ke(Re=>{if(!N.current)return;V.clear(),C.context.allowMouseUpTriggerRef.current=!1;const Ne=Re.target;De(N.current,Ne)||De(C.select("positionerElement"),Ne)||Ne===N.current||Ne!=null&&P1(Ne)===C.select("rootId")||z1(Re,N.current)||I.events.emit("close",{domEvent:Re,reason:pS})});b.useEffect(()=>{z&&C.select("lastOpenChangeReason")===Bt&&We(N.current).addEventListener("mouseup",J,{once:!0})},[z,J,C]);const $=P&&B.context.hasSubmenuOpen,re=Zu(j,{enabled:(h??$)&&!X&&(!P||$&&!K),handleClose:ef({blockPointerEvents:!P}),mouseOnly:!0,move:!1,restMs:B.type===void 0?y:void 0,delay:{close:v},triggerElementRef:L,externalTree:I,isActiveTrigger:k,isClosing:()=>C.select("transitionStatus")==="ending"}),me=sk(z,C.select("lastOpenChangeReason")),pe=Vu(j,{enabled:!X,event:z&&P?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:B.type===void 0?me:!1}),be=c1(j,{enabled:!X&&$}),Ce=ok({open:z,enabled:P,mouseDownAction:"open"}),Me=b.useMemo(()=>no(be.reference,pe.reference),[be.reference,pe.reference]),ye=C.useState("triggerProps",K),{preFocusGuardRef:ge,handlePreFocusGuardFocus:Te,handleFocusTargetFocus:Ae}=I1(C,L),Ue={disabled:X,open:z},Ee=[N,a,W,ee,L],Le=[Me,re??Tt,ye,{"aria-haspopup":"menu","aria-controls":D,id:_,onMouseDown:Re=>{if(C.select("open"))return;V.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),We(Re.currentTarget).addEventListener("mouseup",J,{once:!0})}},P?{role:"menuitem"}:{},Ce,T,Z],Se=tt("button",o,{enabled:!P,stateAttributesMapping:nu,state:Ue,ref:Ee,props:Le});return P?p.jsx(L1,{tag:"button",render:r,className:l,style:c,state:Ue,refs:Ee,props:Le,stateAttributesMapping:nu}):z?p.jsxs(b.Fragment,{children:[p.jsx(as,{ref:ge,onFocus:Te},`${_}-pre-focus-guard`),p.jsx(b.Fragment,{children:Se},_),p.jsx(as,{ref:C.context.triggerFocusTargetRef,onFocus:Ae},`${_}-post-focus-guard`)]}):p.jsx(b.Fragment,{children:Se},_)});function sk(t,o){const a=nn(),[r,l]=b.useState(!1);return we(()=>{t&&o===Bt?(l(!0),a.start(PS,()=>{l(!1)})):t||(a.clear(),l(!1))},[t,o,a]),r}function ak(){const t=k1();return b.useMemo(()=>t?{type:"menubar",context:t}:{type:void 0},[t])}const rk=b.forwardRef(function(o,a){const{className:r,render:l,orientation:c="horizontal",style:d,...g}=o;return tt("div",o,{state:{orientation:c},ref:a,props:[{role:"separator","aria-orientation":c},g]})});function U1(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}const ik={"aria-expanded":void 0},lk=b.forwardRef(function(o,a){const{render:r,className:l,style:c,label:d,id:g,nativeButton:m=!1,openOnHover:h=!0,delay:y=100,closeDelay:v=0,disabled:S=!1,...w}=o,T=D1();if(!T?.parentMenu)throw new Error(At(37));const O=sf({guess:!0,label:d}),A=wm(),{store:C}=$s(),_=mo(g),k=C.useState("open"),j=C.useState("floatingRootContext"),z=C.useState("floatingTreeRoot"),D=C.useState("triggerPopupId",_),L=r1(_,C),B=ke(Me=>{L(Me),Me!==null&&C.select("open")&&C.select("activeTriggerId")==null&&C.update({activeTriggerId:_??null,activeTriggerElement:Me,closeDelay:v})}),Y=b.useRef(null),U=b.useCallback(Me=>{Y.current=Me,C.set("activeTriggerElement",Me)},[C]);we(()=>(B(Y.current),()=>B(null)),[B,_,C]),C.useSyncedValue("closeDelay",v);const I=T.parentMenu,M=C.useState("disabled"),H=I.useState("disabled"),ee=S||M||H,K=I.useState("itemProps"),P=I.useState("isActive",O.index),q=b.useMemo(()=>({type:"submenu-trigger",setActive(){I.select("highlightItemOnHover")&&I.set("activeIndex",O.index)}}),[I,O.index]),{getItemProps:X,itemRef:Z}=E1({closeOnClick:!1,disabled:ee,highlighted:P,id:_,store:C,typingRef:I.context.typingRef,nativeButton:m,itemMetadata:q,nodeId:A?.context.nodeId}),W=C.useState("hoverEnabled"),N=Zu(j,{enabled:W&&h&&!ee,handleClose:ef({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:y,delay:{open:y,close:v},shouldOpen:y>0?()=>I.select("allowMouseEnter"):void 0,triggerElementRef:Y,externalTree:z,isClosing:()=>C.select("transitionStatus")==="ending",guardStaleOpen:!0}),J=Vu(j,{enabled:!ee,event:"mousedown",toggle:!h,ignoreMouse:h,stickIfOpen:!1}).reference??Tt,$=C.useState("triggerProps",!0);delete $.id;const se={disabled:ee,highlighted:P,open:k},re=C.useState("openMethod"),pe=C.useState("lastOpenChangeReason")===ru||re==="keyboard";return tt("div",o,{state:se,stateAttributesMapping:_u,props:[J,N,$,K,k&&pe&&aS?ik:void 0,{"aria-controls":D,tabIndex:k||P?0:-1,onBlur(){P&&I.set("activeIndex",null)}},w,X],ref:[a,O.ref,Z,B,U]})});const ck=t=>t?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function uk(t,o,a=[]){if(o==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:ck(t),size:24,node:o,...a.length>0?{aliases:a}:{}}}const fk=t=>{let o="",a=!1;for(const r of t){if(r==="-"||r==="_"||r<=" "){a=o.length>0;continue}o.length===0?o+=r.toLowerCase():o+=a?r.toUpperCase():r,a=!1}return o};const dk=t=>{const o=fk(t);return o.charAt(0).toUpperCase()+o.slice(1)};const Ah=(...t)=>t.filter((o,a,r)=>!!o&&o.trim()!==""&&r.indexOf(o)===a).join(" ").trim();const ga={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 Qp(t){return t!=null}function pk(t,o={}){const a=o.attributeNames??{},r=S=>a[S]??S,l=t.size??t.width??ga.width,c=t.size??t.height??ga.height,d=t.aliases?.filter(S=>typeof S=="string"&&S.trim()!=="").map(S=>`lucide-${S}`)??[],g=[...t.name?[`lucide-${t.name}`]:[],...d],m=o.className?.split(" ").filter(Boolean)??[],h=o.includeDefaultClasses===!1?Ah(...m):Ah("lucide",...g,...m),y=o.absoluteStrokeWidth?Number(o.strokeWidth??ga["stroke-width"])*Number(t.size??t.width??ga.width)/Number(o.size??o.width??ga.width):o.strokeWidth??ga["stroke-width"];return["svg",{...Object.entries(ga).reduce((S,[w,T])=>(S[r(w)]=T,S),{}),..."color"in o&&o.color&&{[r("stroke")]:o.color},..."size"in o&&Qp(o.size)&&{[r("width")]:o.size,[r("height")]:o.size},..."width"in o&&Qp(o.width)&&{[r("width")]:o.width},..."height"in o&&Qp(o.height)&&{[r("height")]:o.height},[r("stroke-width")]:y,...h&&{[r("class")]:h},[r("viewBox")]:`0 0 ${l} ${c}`,...o.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in o&&o.attributes},t.node.map(S=>{const[w,T,O]=S,A=o.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...T}:T;return O?[w,A,O]:[w,A]})]}function hk(t,o={}){return pk(t,{...o,attributeNames:{...o.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const mk=t=>{for(const o in t)if(o.startsWith("aria-")||o==="role"||o==="title")return!0;return!1},gk=b.createContext({}),yk=()=>b.useContext(gk),bk=b.forwardRef(({color:t,size:o,width:a,height:r,strokeWidth:l,absoluteStrokeWidth:c,nonScalingStroke:d,className:g="",children:m,iconNode:h=[],icon:y={node:h,aliases:[],size:24},...v},S)=>{const{size:w=24,strokeWidth:T=2,absoluteStrokeWidth:O=!1,nonScalingStroke:A=!1,color:C="currentColor",className:_=""}=yk()??{},k=!!m||mk(v),[j,z,D=[]]=hk(y,{color:t??C,width:a??o??w,height:r??o??w,strokeWidth:l??T,absoluteStrokeWidth:c??O,nonScalingStroke:d??A,className:Ah(_,g),hasA11yProp:k,attributes:v});return b.createElement(j,{ref:S,...z},[...D.map(([L,B])=>b.createElement(L,B)),...Array.isArray(m)?m:[m]])});function Ve(t,o=[],a=[]){const r=typeof t=="string"?uk(t,o,a):t,l=b.forwardRef(({className:c,...d},g)=>b.createElement(bk,{ref:g,icon:r,className:c,...d}));return r.name&&(l.displayName=dk(r.name)),l}const B1={name:"building-complex",size:24,node:[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],aliases:["building-2"]};B1.node;const vk=Ve(B1);const V1={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};V1.node;const Pr=Ve(V1);const F1={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};F1.node;const Aa=Ve(F1);const Y1={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};Y1.node;const jm=Ve(Y1);const q1={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};q1.node;const xk=Ve(q1);const G1={name:"cloud-alert",size:24,node:[["path",{d:"M12 12v4",key:"tww15h"}],["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642",key:"1namsd"}]]};G1.node;const Sk=Ve(G1);const X1={name:"cloud-off",size:24,node:[["path",{d:"M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057",key:"1uxyv8"}],["path",{d:"M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78",key:"99tcn7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};X1.node;const _m=Ve(X1);const K1={name:"cloud",size:24,node:[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]};K1.node;const $1=Ve(K1);const W1={name:"code",size:24,node:[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]};W1.node;const Q1=Ve(W1);const Z1={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};Z1.node;const hu=Ve(Z1);const J1={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};J1.node;const wk=Ve(J1);const ew={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};ew.node;const tw=Ve(ew);const nw={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};nw.node;const Tk=Ve(nw);const ow={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"}]]};ow.node;const vl=Ve(ow);const sw={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};sw.node;const Ek=Ve(sw);const aw={name:"file-text",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"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};aw.node;const Ck=Ve(aw);const rw={name:"file",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"}]]};rw.node;const Rk=Ve(rw);const iw={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};iw.node;const lw=Ve(iw);const cw={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};cw.node;const Dm=Ve(cw);const uw={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};uw.node;const Ok=Ve(uw);const fw={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};fw.node;const dw=Ve(fw);const pw={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};pw.node;const zm=Ve(pw);const hw={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};hw.node;const Ak=Ve(hw);const mw={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};mw.node;const so=Ve(mw);const gw={name:"log-in",size:24,node:[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]};gw.node;const Nk=Ve(gw);const yw={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};yw.node;const cf=Ve(yw);const bw={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"}]]};bw.node;const kk=Ve(bw);const vw={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};vw.node;const Lm=Ve(vw);const xw={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};xw.node;const Pm=Ve(xw);const Sw={name:"network",size:24,node:[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]};Sw.node;const Mk=Ve(Sw);const ww={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};ww.node;const jk=Ve(ww);const Tw={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};Tw.node;const Im=Ve(Tw);const Ew={name:"pin-off",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]};Ew.node;const _k=Ve(Ew);const Cw={name:"pin",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]};Cw.node;const Dk=Ve(Cw);const Rw={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"}]]};Rw.node;const zk=Ve(Rw);const Ow={name:"presentation",size:24,node:[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]};Ow.node;const Lk=Ve(Ow);const Aw={name:"redo-2",size:24,node:[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]};Aw.node;const Pk=Ve(Aw);const Nw={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"}]]};Nw.node;const Ik=Ve(Nw);const kw={name:"rotate-ccw-clock",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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],aliases:["history"]};kw.node;const Mw=Ve(kw);const jw={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};jw.node;const _w=Ve(jw);const Dw={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};Dw.node;const Hk=Ve(Dw);const zw={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};zw.node;const Uk=Ve(zw);const Lw={name:"send",size:24,node:[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]};Lw.node;const Bk=Ve(Lw);const Pw={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};Pw.node;const Vk=Ve(Pw);const Iw={name:"share",size:24,node:[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]]};Iw.node;const Fk=Ve(Iw);const Hw={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"]};Hw.node;const Uw=Ve(Hw);const Bw={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};Bw.node;const xl=Ve(Bw);const Vw={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};Vw.node;const Yk=Ve(Vw);const Fw={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};Fw.node;const Ui=Ve(Fw);const Yw={name:"video",size:24,node:[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]};Yw.node;const qk=Ve(Yw);const qw={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};qw.node;const Sl=Ve(qw),Nh=500,Gk=8;function Xk(t,o,a){return a<t.at||a-t.at>Nh?!1:Math.hypot(o.clientX-t.x,o.clientY-t.y)<=Gk}const Jx=["pointerdown","mousedown","pointerup","mouseup","click","dblclick"];function Kk(t,o,a=Date.now){let r=!1,l=!1,c=0;const d=()=>{if(!l){l=!0,t.clearTimeout(c);for(const h of Jx)t.removeEventListener(h,m,!0)}},g=()=>{r?c=t.setTimeout(g,Nh):d()},m=h=>{const y=h.type==="pointerdown"||h.type==="mousedown";!(r&&!y)&&!Xk(o,h,a())||(h.preventDefault(),h.stopImmediatePropagation(),y?r=!0:(h.type==="click"||h.type==="dblclick")&&(r=!1))};for(const h of Jx)t.addEventListener(h,m,!0);return c=t.setTimeout(g,Math.max(0,Nh-(a()-o.at))),d}function $k(t){t.detail<1||!t.view||Kk(t.view,{x:t.clientX,y:t.clientY,at:Date.now()})}const Hm="rounded-lg bg-surface p-1 text-[13px] text-fg shadow-popup outline-none origin-[var(--transform-origin)] transition-[opacity,transform] duration-100 data-[starting-style]:opacity-0 data-[starting-style]:scale-95 data-[ending-style]:opacity-0",Gw="flex h-7 min-w-40 cursor-default select-none items-center gap-2 rounded-md px-2 outline-none data-[highlighted]:bg-hover data-[disabled]:opacity-40";function el({trigger:t,children:o,side:a="bottom",align:r="start",open:l,onOpenChange:c}){return p.jsxs(Mm,{open:l,onOpenChange:c?d=>c(d):void 0,children:[p.jsx(H1,{render:t,onKeyDown:jr}),p.jsx(Rm,{children:p.jsx(Nm,{side:a,align:r,sideOffset:6,className:"z-[1000]",children:p.jsx(Cm,{className:Hm,children:o})})})]})}function Nt({children:t,onSelect:o,icon:a,shortcut:r,disabled:l,danger:c}){return p.jsxs(R1,{className:lt(Gw,c&&"text-danger"),disabled:l,onClick:d=>{$k(d.nativeEvent),o?.()},onKeyDown:jr,children:[p.jsx("span",{className:"flex size-4 items-center justify-center text-fg-muted",children:a}),p.jsx("span",{className:"flex-1",children:t}),r?p.jsx("span",{className:"ml-4 text-xs text-fg-subtle",children:r}):null]})}function Ko(){return p.jsx(rk,{className:"mx-1 my-1 h-px bg-line"})}function _r({children:t}){return p.jsx("div",{className:"px-2 py-1 text-xs text-fg-subtle",children:t})}function e0({label:t,icon:o,children:a}){return p.jsxs(ek,{children:[p.jsxs(lk,{className:Gw,onKeyDown:jr,children:[p.jsx("span",{className:"flex size-4 items-center justify-center text-fg-muted",children:o}),p.jsx("span",{className:"flex-1",children:t}),p.jsx(jm,{className:"size-3.5 text-fg-subtle"})]}),p.jsx(Rm,{children:p.jsx(Nm,{sideOffset:4,className:"z-[1000]",children:p.jsx(Cm,{className:Hm,children:a})})})]})}const Xw=b.createContext(void 0);function La(t){const o=b.useContext(Xw);if(!t&&o===void 0)throw new Error(At(27));return o}const Wk=b.forwardRef(function(o,a){const{render:r,className:l,style:c,forceRender:d=!1,...g}=o,m=La(),h=m.useState("open"),y=m.useState("nested"),v=m.useState("mounted"),S=m.useState("transitionStatus");return tt("div",o,{state:{open:h,transitionStatus:S},ref:[m.context.backdropRef,a],stateAttributesMapping:Du,props:[{role:"presentation",hidden:!v,style:{userSelect:"none",WebkitUserSelect:"none"}},g],enabled:d||!y})}),Qk=b.forwardRef(function(o,a){const{render:r,className:l,style:c,disabled:d=!1,nativeButton:g=!0,...m}=o,h=La(),y=h.useState("open"),{getButtonProps:v,buttonRef:S}=Co({disabled:d,native:g}),w={disabled:d};function T(O){y&&h.setOpen(!1,qe(dS,O.nativeEvent))}return tt("button",o,{state:w,ref:[a,S],props:[{onClick:T},m,v]})}),Zk=b.forwardRef(function(o,a){const{render:r,className:l,style:c,id:d,...g}=o,m=La(),h=mo(d);return m.useSyncedValueWithCleanup("descriptionElementId",h),tt("p",o,{ref:a,props:[{id:h},g]})}),Kw=b.createContext(void 0);function Jk(){const t=b.useContext(Kw);if(t===void 0)throw new Error(At(26));return t}const eM="--nested-dialogs",tM="data-nested-dialog-open",nM={...ul,...cl,nestedDialogOpen(t){return t?{[tM]:""}:null}},oM=b.forwardRef(function(o,a){const{render:r,className:l,style:c,finalFocus:d,initialFocus:g,...m}=o,h=La(),y=h.useState("descriptionElementId"),v=h.useState("disablePointerDismissal"),S=h.useState("floatingRootContext"),w=h.useState("popupProps"),T=h.useState("modal"),O=h.useState("mounted"),A=h.useState("nested"),C=h.useState("nestedOpenDialogCount"),_=h.useState("open"),k=h.useState("openMethod"),j=h.useState("titleElementId"),z=h.useState("transitionStatus"),D=h.useState("role"),L=S.useState("floatingId");Jk(),fs({open:_,ref:h.context.popupRef,onComplete(){_&&h.context.onOpenChangeComplete?.(!0)}});const B=g===void 0?a1(h.context.popupRef):g,Y=C>0,U=h.useStateSetter("popupElement"),M=tt("div",o,{state:{open:_,nested:A,transitionStatus:z,nestedDialogOpen:Y},props:[w,{id:L,"aria-labelledby":j,"aria-describedby":y,role:D,...hl,hidden:!O,onKeyDown(H){bl.has(H.key)&&H.stopPropagation()},style:{[eM]:C}},m],ref:[a,h.context.popupRef,U],stateAttributesMapping:nM});return p.jsx(Bu,{context:S,openInteractionType:k,disabled:!O,closeOnFocusOut:!v,initialFocus:B,returnFocus:d,modal:T!==!1,restoreFocus:"popup",children:M})}),sM=b.forwardRef(function(o,a){const{keepMounted:r=!1,...l}=o,c=La(),d=c.useState("mounted"),g=c.useState("modal"),m=c.useState("open");return d||r?p.jsx(Kw.Provider,{value:r,children:p.jsxs(Uu,{ref:a,...l,children:[d&&g===!0&&p.jsx(rf,{ref:c.context.internalBackdropRef,inert:yl(!m)}),o.children]})}):null});function aM({store:t,parentContext:o,isDrawer:a}){const r=t.useState("open"),l=t.useState("disablePointerDismissal"),c=t.useState("modal"),d=t.useState("popupElement"),g=t.useState("floatingRootContext"),[m,h]=b.useState(0),[y,v]=b.useState(0),S=m===0,w=pl(g,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:c==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(T){if(!t.context.outsidePressEnabledRef.current||"button"in T&&T.button!==0)return!1;if("touches"in T){if(T.type==="touchend"){if(T.changedTouches.length!==1||T.touches.length!==0)return!1}else if(T.touches.length!==1)return!1}const O=zt(T);if(S&&!l){if(c){const A=t.context.internalBackdropRef.current,C=t.context.backdropRef.current;return A||C?A===O||C===O||De(O,d)&&!O?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:S});return N1(r&&c===!0,d),t.useContextCallback("onNestedDialogOpen",(T,O)=>{h(T),v(O)}),we(()=>(o?.onNestedDialogOpen&&(r?o.onNestedDialogOpen(m+1,y+(a?1:0)):o.onNestedDialogOpen(0,0)),()=>{o?.onNestedDialogOpen&&r&&o.onNestedDialogOpen(0,0)}),[a,r,m,y,o]),$u(t,{activeTriggerProps:w.reference,inactiveTriggerProps:w.trigger,popupProps:w.floating,nestedOpenDialogCount:m,nestedOpenDrawerCount:y}),null}const rM={...Qu,modal:t=>t.modal,nested:t=>t.nested,nestedOpenDialogCount:t=>t.nestedOpenDialogCount,nestedOpenDrawerCount:t=>t.nestedOpenDrawerCount,disablePointerDismissal:t=>t.disablePointerDismissal,openMethod:t=>t.openMethod,descriptionElementId:t=>t.descriptionElementId,titleElementId:t=>t.titleElementId,viewportElement:t=>t.viewportElement,role:t=>t.role};class iM extends Da{constructor(o,a,r){const l=new ml,c=lM(o,l,a,r);super(c,cM(l),rM)}setOpen=(o,a)=>{a.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!o&&a.trigger==null&&this.state.activeTriggerId!=null&&(a.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(o,a),!a.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(o,a),this.update(Gu(this.state,o,a.trigger)))}}function lM(t,o,a,r=!1){return{...Wu(o,a,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t}}function cM(t){return{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:t,onOpenChange:void 0,onOpenChangeComplete:void 0}}function uM(t,o){const{children:a,open:r,defaultOpen:l=!1,onOpenChange:c,onOpenChangeComplete:d,disablePointerDismissal:g=!1,modal:m=!0,actionsRef:h,handle:y,triggerId:v,defaultTriggerId:S=null}=o,w=t==="drawer",T=m,O=g,A="dialog",C=La(!0),_=C!=null,k={modal:T,disablePointerDismissal:O,nested:_,role:A},j=hm((U,I)=>new iM({open:l,openProp:r,activeTriggerId:S,triggerIdProp:v,...k},U,I),!0);j.useControlledProp("openProp",r),j.useControlledProp("triggerIdProp",v),j.useSyncedValues(k),j.useContextCallback("onOpenChange",c),j.useContextCallback("onOpenChangeComplete",d);const z=j.useState("open"),D=j.useState("mounted"),L=j.useState("payload");i1(j,z),Xu(j);const{forceUnmount:B}=Ku(z,j);b.useImperativeHandle(h,()=>({unmount:B,close:()=>j.setOpen(!1,qe(Pu))}),[B,j]);const Y=z||D;return p.jsxs(Xw.Provider,{value:j,children:[y&&p.jsx(qu,{handle:y,store:j}),Y&&p.jsx(aM,{store:j,parentContext:C?.context,isDrawer:w}),typeof a=="function"?a({payload:L}):a]})}const fM=il(function(o){return uM("dialog",o)}),dM=b.forwardRef(function(o,a){const{render:r,className:l,style:c,id:d,...g}=o,m=La(),h=mo(d);return m.useSyncedValueWithCleanup("titleElementId",h),tt("h2",o,{ref:a,props:[{id:h},g]})}),$w=b.createContext(void 0);function Ir(t){const o=b.useContext($w);if(o===void 0&&!t)throw new Error(At(47));return o}const pM={...Qu,disabled:t=>t.disabled,instantType:t=>t.instantType,openMethod:t=>t.openMethod,openChangeReason:t=>t.openChangeReason,modal:t=>t.modal,focusManagerModal:t=>t.focusManagerModal,stickIfOpen:t=>t.stickIfOpen,titleElementId:t=>t.titleElementId,descriptionElementId:t=>t.descriptionElementId,openOnHover:t=>t.openOnHover,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class hM extends Da{constructor(o,a,r){const l=new ml;super(mM(o,l,a,r),gM(l),pM)}setOpen=(o,a)=>{const r=a.reason===Bt,l=a.reason===os&&a.event.detail===0,c=!o&&(a.reason===fl||a.reason==null),d=mm(a),g=this.select("activeTriggerId");if(!o&&a.reason===dS&&a.trigger==null&&g!=null&&(a.trigger=this.context.triggerElements.getById(g)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(o,a),a.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(o,a);const m=()=>{const y=Gu(this.state,o,a.trigger,d());y.openChangeReason=a.reason,this.update(y)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(PS,()=>{this.set("stickIfOpen",!1)}),oo.flushSync(m)):m();let h;l?h="click":c?h="dismiss":a.reason===Fs&&(h="focus"),this.set("instantType",h)}}function mM(t,o,a,r=!1){const l={...Wu(o,a,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...t};return l.open&&t?.mounted===void 0&&(l.mounted=!0),l}function gM(t){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),stickIfOpenTimeout:new An,triggerElements:t}}const t0=il(function({props:o}){const{children:a,open:r,defaultOpen:l=!1,onOpenChange:c,onOpenChangeComplete:d,modal:g=!1,handle:m,triggerId:h,defaultTriggerId:y=null}=o,v=bM(m,{modal:g,open:l,openProp:r,activeTriggerId:y,triggerIdProp:h});v.useControlledProp("openProp",r),v.useControlledProp("triggerIdProp",h);const S=v.useState("open"),w=v.useState("mounted"),T=v.useState("payload");v.useContextCallback("onOpenChange",c),v.useContextCallback("onOpenChangeComplete",d),i1(v,S),Xu(v);const{forceUnmount:O}=Ku(S,v,()=>{v.update({stickIfOpen:!0,openChangeReason:null})});v.useSyncedValues({modal:g}),b.useEffect(()=>{S||v.context.stickIfOpenTimeout.clear()},[v,S]),b.useImperativeHandle(o.actionsRef,()=>({unmount:O,close:()=>v.setOpen(!1,qe(Pu))}),[O,v]);const A=S||w;return p.jsxs($w.Provider,{value:v,children:[m&&p.jsx(qu,{handle:m,store:v}),A&&p.jsx(vM,{store:v,modal:g}),typeof a=="function"?a({payload:T}):a]})});function yM(t){return Ir(!0)?p.jsx(t0,{props:t}):p.jsx(XS,{children:p.jsx(t0,{props:t})})}function bM(t,o){const a=hm((r,l)=>new hM(o,r,l));return b.useEffect(()=>a.context.stickIfOpenTimeout.disposeEffect(),[a]),a}function vM({store:t,modal:o}){const a=t.useState("floatingRootContext"),r=pl(a,{outsidePressEvent:{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),l=r.reference,c=r.floating;return $u(t,{activeTriggerProps:l,inactiveTriggerProps:l,popupProps:c}),null}const xM=300,SM=Fh(function(o,a){const{render:r,className:l,style:c,disabled:d=!1,nativeButton:g=!0,handle:m,payload:h,openOnHover:y=!1,delay:v=xM,closeDelay:S=0,id:w,...T}=o,O=Ir(!0),C=bm(m)??O;if(!C)throw new Error(At(74));const _=mo(w),k=C.useState("isTriggerActive",_),j=C.useState("floatingRootContext"),z=C.useState("isOpenedByTrigger",_),D=C.useState("triggerPopupId",_),L=b.useRef(null),{registerTrigger:B,isMountedByThisTrigger:Y}=gm(_,L,C,{payload:h,disabled:d,openOnHover:y,closeDelay:S}),U=C.useState("openChangeReason"),I=C.useState("stickIfOpen"),M=C.useState("openMethod"),H=C.useState("focusManagerModal"),ee=Zu(j,{enabled:!d&&y&&(M!=="touch"||U!==os),mouseOnly:!0,move:!1,handleClose:ef(),restMs:v,delay:{close:S},triggerElementRef:L,isActiveTrigger:k,isClosing:()=>C.select("transitionStatus")==="ending"}),K=Vu(j,{stickIfOpen:I}),P=M1(()=>C.select("open"),me=>{C.set("openMethod",me)}),q=C.useState("triggerProps",Y),{getButtonProps:X,buttonRef:Z}=Co({disabled:d,native:g}),W={open(me){return me&&U===os?nu.open(me):_u.open(me)}},{preFocusGuardRef:N,handlePreFocusGuardFocus:V,handleFocusTargetFocus:J}=I1(C,L),se=tt("button",o,{state:{disabled:d,open:z},ref:[Z,a,B,L],props:[K.reference,ee,q,P,{[IS]:"",id:_,"aria-haspopup":"dialog","aria-expanded":z,"aria-controls":D},T,X],stateAttributesMapping:W}),re=p.jsx(b.Fragment,{children:se},_);return Y&&!H?p.jsxs(b.Fragment,{children:[p.jsx(as,{ref:N,onFocus:V}),re,p.jsx(as,{ref:C.context.triggerFocusTargetRef,onFocus:J})]}):re}),Ww=b.createContext(void 0);function wM(){const t=b.useContext(Ww);if(t===void 0)throw new Error(At(45));return t}const TM=b.forwardRef(function(o,a){const{keepMounted:r=!1,...l}=o;return Ir().useState("mounted")||r?p.jsx(Ww.Provider,{value:r,children:p.jsx(Uu,{ref:a,...l})}):null}),Qw=b.createContext(void 0);function Zw(){const t=b.useContext(Qw);if(!t)throw new Error(At(46));return t}const EM=b.forwardRef(function(o,a){const{render:r,className:l,style:c,anchor:d,positionMethod:g,side:m,align:h,sideOffset:y,alignOffset:v,collisionBoundary:S="clipping-ancestors",collisionPadding:w,arrowPadding:T,sticky:O,disableAnchorTracking:A=!1,collisionAvoidance:C=rm,..._}=o,k=Ir(),j=wM(),z=lm(),D=k.useState("floatingRootContext"),L=k.useState("mounted"),B=k.useState("open"),Y=k.useState("openChangeReason"),U=k.useState("activeTriggerElement"),I=k.useState("modal"),M=k.useState("openMethod"),H=k.useState("positionerElement"),ee=k.useState("instantType"),K=k.useState("transitionStatus"),P=k.useState("adaptiveOrigin"),q=b.useRef(null),X=Yu(H),Z=nf({anchor:d,floatingRootContext:D,positionMethod:g,mounted:L,side:m,sideOffset:y,align:h,alignOffset:v,arrowPadding:T,collisionBoundary:S,collisionPadding:w,sticky:O,disableAnchorTracking:A,keepMounted:j,nodeId:z,collisionAvoidance:C,adaptiveOrigin:P}),W=D.useState("domReferenceElement");we(()=>{const se=W,re=q.current;if(se&&(q.current=se),re&&se&&se!==re){k.set("instantType",void 0);const me=new AbortController;return X(()=>{k.set("instantType","trigger-change")},me.signal),()=>{me.abort()}}},[W,X,k]);const N=I===!0&&Y!==Bt;Am(B&&N,M==="touch",H,U);const V=k.useStateSetter("positionerElement"),J={open:B,side:Z.side,align:Z.align,anchorHidden:Z.anchorHidden,instant:ee},$=of(o,J,{styles:Z.positionerStyles,transitionStatus:K,props:_,refs:[a,V],hidden:!L,inert:!B});return p.jsxs(Qw.Provider,{value:Z,children:[L&&N&&p.jsx(rf,{inert:yl(!B),cutout:U}),p.jsx(GS,{id:z,children:$})]})}),CM=b.createContext(void 0);function RM(){const[t,o]=b.useState(0),a=ke(()=>(o(l=>l+1),()=>{o(l=>Math.max(0,l-1))}));return{context:b.useMemo(()=>({register:a}),[a]),hasClosePart:t>0}}const OM=b.forwardRef(function(o,a){const{render:r,className:l,style:c,initialFocus:d,finalFocus:g,...m}=o,h=Ir(),y=Zw(),v=af()!=null,{context:S,hasClosePart:w}=RM(),T=h.useState("open"),O=h.useState("openMethod"),A=h.useState("instantType"),C=h.useState("transitionStatus"),_=h.useState("popupProps"),k=h.useState("titleElementId"),j=h.useState("descriptionElementId"),z=h.useState("modal"),D=h.useState("mounted"),L=h.useState("openChangeReason"),B=h.useState("activeTriggerElement"),Y=h.useState("floatingRootContext"),U=Y.useState("floatingId"),I=h.useState("disabled"),M=h.useState("openOnHover"),H=h.useState("closeDelay");fs({open:T,ref:h.context.popupRef,onComplete(){T&&h.context.onOpenChangeComplete?.(!0)}}),Sm(Y,{enabled:M&&!I,closeDelay:H});const ee=d===void 0?a1(h.context.popupRef):d,K=z!==!1&&w;h.useSyncedValue("focusManagerModal",K);const P=h.useStateSetter("popupElement"),q={open:T,side:y.side,align:y.align,instant:A,transitionStatus:C},X=tt("div",o,{state:q,ref:[a,h.context.popupRef,P],props:[_,{id:U,role:"dialog",...hl,"aria-labelledby":k,"aria-describedby":j,onKeyDown(Z){v&&bl.has(Z.key)&&Z.stopPropagation()}},gl(C),m],stateAttributesMapping:Du});return p.jsx(Bu,{context:Y,openInteractionType:O,modal:K,disabled:!D||L===Bt,initialFocus:ee,returnFocus:g,restoreFocus:"popup",previousFocusableElement:yt(B)?B:void 0,nextFocusableElement:h.context.triggerFocusTargetRef,beforeContentFocusGuardRef:h.context.beforeContentFocusGuardRef,children:p.jsx(CM.Provider,{value:S,children:X})})}),AM=b.forwardRef(function(o,a){const{render:r,className:l,style:c,...d}=o,m=Ir().useState("open"),{arrowRef:h,side:y,align:v,arrowUncentered:S,arrowStyles:w}=Zw();return tt("div",o,{state:{open:m,side:y,align:v,uncentered:S},ref:[a,h],props:[{style:w,"aria-hidden":!0},d],stateAttributesMapping:ul})});function Jw({open:t,onOpenChange:o,title:a,description:r,children:l,footer:c,className:d}){return p.jsx(fM,{open:t,onOpenChange:g=>o(g),children:p.jsxs(sM,{children:[p.jsx(Wk,{className:"fixed inset-0 z-[900] bg-black/30 transition-opacity data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"}),p.jsxs(oM,{className:lt("fixed left-1/2 top-1/2 z-[901] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-xl bg-surface p-5 text-fg shadow-popup outline-none","transition-[opacity,transform] data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",d),children:[p.jsxs("div",{className:"mb-3 flex items-start gap-3",children:[p.jsxs("div",{className:"flex-1",children:[p.jsx(dM,{className:"text-[15px] font-semibold",children:a}),r?p.jsx(Zk,{className:"mt-1 text-fg-muted",children:r}):null]}),p.jsx(Qk,{"aria-label":"Close",className:"rounded-md p-1 text-fg-muted hover:bg-hover",children:p.jsx(Sl,{className:"size-4"})})]}),l,c?p.jsx("div",{className:"mt-4 flex justify-end gap-2",children:c}):null]})]})})}function NM({open:t,onOpenChange:o,title:a,description:r,confirmLabel:l="Confirm",danger:c,onConfirm:d}){return p.jsx(Jw,{open:t,onOpenChange:o,title:a,description:r,footer:p.jsxs(p.Fragment,{children:[p.jsx(it,{onClick:()=>o(!1),children:"Cancel"}),p.jsx(it,{variant:c?"danger":"primary",onClick:()=>{d(),o(!1)},children:l})]})})}const kM="data-valid",MM="data-invalid",jM={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},_M={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},DM={disabled:!1,..._M},eT={valid(t){return t===null?null:t?{[kM]:""}:{[MM]:""}}},zM={invalid:void 0,name:void 0,validityData:{state:jM,errors:[],error:"",value:"",initialValue:null},setValidityData:It,disabled:void 0,setTouched:It,setDirty:It,setFilled:It,setFocused:It,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:DM,registerFieldControl:It,validation:{getValidationProps:(t,o=Tt)=>o,inputRef:{current:null},registeredInputs:new Map,registerInput:It,getInputControl:()=>null,commit:async()=>{},change:It}},LM=b.createContext(zM);function uf(t=!0){const o=b.useContext(LM);if(o.setValidityData===It&&!t)throw new Error(At(28));return o}const PM=b.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:It,validationMode:"onSubmit",submitCountRef:{current:0}});function tT(){return b.useContext(PM)}const IM=b.createContext({controlId:void 0,registerControlId:It,resetControlId:It,labelId:void 0,setLabelId:It,messageIds:[],setMessageIds:It,getDescriptionProps:t=>t});function Um(){return b.useContext(IM)}function Bm(t={}){const{id:o,enabled:a=!0}=t,{controlId:r,registerControlId:l,resetControlId:c}=Um(),d=mo(),g=Qt(()=>Symbol()),m=b.useRef(!1),h=b.useRef(!1),y=ke(()=>{!m.current||l===It||(m.current=!1,l(g.current,void 0))});return we(()=>{if(!a||l===It){y();return}let v;if(o!==void 0)h.current=!0,v=o;else if(h.current)v=d;else{c();return}if(v===void 0){y();return}m.current=!0,l(g.current,v)},[o,a,l,c,d,g,y]),we(()=>y,[y]),(a?r:void 0)??o??d}function Bi(t,o=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER){return Math.max(o,Math.min(t,a))}function nT(t,o,a,r,l=!0,c){const{registerFieldControl:d}=uf(),g=Qt(()=>Symbol());we(()=>{const m=g.current;if(!l){d(m,void 0);return}d(m,{controlRef:t,getValue:r,id:o,name:c,value:a})},[t,l,r,o,c,d,g,a]),we(()=>{const m=g.current;return()=>{d(m,void 0)}},[d,g])}function HM(t){const o=b.useRef(!0);o.current&&(o.current=!1,t())}const oT=b.createContext(void 0),sT=b.createContext(void 0),aT=b.createContext(void 0);function ds(){const t=b.useContext(oT);if(t===void 0)throw new Error(At(60));return t}function ff(){const t=b.useContext(sT);if(t===void 0)throw new Error(At(101));return t}function rT(){const t=b.useContext(aT);if(t===void 0)throw new Error(At(61));return t}function UM(t,o,a=Object.is){const{length:r}=t;if(r!==o.length)return!1;for(let l=0;l<r;l+=1)if(!a(t[l],o[l]))return!1;return!0}const iT=(t,o)=>Object.is(t,o);function Na(t,o,a){return t==null||o==null?Object.is(t,o):a(t,o)}function BM(t,o,a){return Array.isArray(t)&&Array.isArray(o)?!UM(t,o,(r,l)=>Na(r,l,a)):t!==o}function kh(t,o,a){return t?t.some(r=>r===void 0?!1:Na(o,r,a)):!1}function tu(t,o,a){return t?t.findIndex(r=>r===void 0?!1:Na(r,o,a)):-1}function VM(t,o){if(o!==iT)return r=>kh(t,r,o);const a=new Set(t);return a.delete(void 0),r=>a.has(r)&&(r!==0||t.some(l=>Object.is(r,l)))}function lT(t,o,a,r){const l=r&&Array.isArray(o)?t.findIndex(VM(o,a)):tu(t,o,a);return l===-1?null:l}function FM(t,o,a,r,l,c){return kh(r,o,l)?c!=null&&t>c&&kh(r,a[c],l)?c:t:t===c?lT(a,r,l,!0):c}function YM(t,o,a){return t.filter(r=>!Na(o,r,a))}function Mh(t){if(t==null)return"";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function qM(t){return typeof t=="object"&&t!=null&&Array.isArray(t.items)}function cT(t){return qM(t?.[0])}function GM(t){return cT(t)?t.flatMap(o=>o.items):t}function XM(t){if(!Array.isArray(t))return t!=null&&"null"in t;const o=t;if(cT(o)){for(const a of o)for(const r of a.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const a of o)if(a&&a.value==null&&a.label!=null)return!0;return!1}function uT(t,o){if(o&&t!=null)return o(t)??"";if(t&&typeof t=="object"){if("label"in t&&t.label!=null)return String(t.label);if("value"in t)return String(t.value)}return Mh(t)}function Tr(t,o){return o&&t!=null?o(t)??"":t&&typeof t=="object"&&"value"in t&&"label"in t?Mh(t.value):Mh(t)}function fT(t,o,a){function r(){return uT(t,a)}if(a&&t!=null)return a(t);if(t&&typeof t=="object"&&"label"in t&&t.label!=null)return t.label;if(o&&!Array.isArray(o))return(Object.hasOwn(o,t)?o[t]:void 0)??r();if(Array.isArray(o)){const c=GM(o);if(t==null||typeof t!="object"){const d=c.find(g=>g.value===t);return d&&d.label!=null?d.label:r()}if("value"in t){const d=c.find(g=>g&&g.value===t.value);if(d&&d.label!=null)return d.label}}return r()}function KM(t,o,a){return t.reduce((r,l,c)=>(c>0&&r.push(", "),r.push(p.jsx(b.Fragment,{children:fT(l,o,a)},c)),r),[])}const $M={id:t=>t.id,labelId:t=>t.labelId,modal:t=>t.modal,items:t=>t.items,itemToStringLabel:t=>t.itemToStringLabel,isItemEqualToValue:t=>t.isItemEqualToValue,value:t=>t.value,hasSelectedValue:t=>{const{value:o,multiple:a,itemToStringValue:r}=t;return o==null?!1:a&&Array.isArray(o)?o.length>0:Tr(o,r)!==""},hasNullItemLabel:(t,o)=>o?XM(t.items):!1,open:t=>t.open,mounted:t=>t.mounted,forceMount:t=>t.forceMount,transitionStatus:t=>t.transitionStatus,openMethod:t=>t.openMethod,activeIndex:t=>t.activeIndex,selectedIndex:t=>t.selectedIndex,isActive:(t,o)=>t.activeIndex===o,isSelected:(t,o)=>{const a=t.isItemEqualToValue,r=t.value;return t.multiple?Array.isArray(r)&&r.some(l=>Na(o,l,a)):Na(o,r,a)},isSelectedByFocus:(t,o)=>t.selectedIndex===o,popupProps:t=>t.popupProps,triggerProps:t=>t.triggerProps,triggerElement:t=>t.triggerElement,positionerElement:t=>t.positionerElement,listElement:t=>t.listElement,popupSide:t=>t.popupSide,scrollUpArrowVisible:t=>t.scrollUpArrowVisible,scrollDownArrowVisible:t=>t.scrollDownArrowVisible,hasScrollArrows:t=>t.hasScrollArrows},Xo=1;function dT(t,o){return Math.max(0,t-o)}function WM(t,o){if(o<=0)return 0;const a=Bi(t,0,o),r=a,l=o-a,c=r<=Xo,d=l<=Xo;return c&&d?r<=l?0:o:c?0:d?o:a}function QM(t){const{id:o,value:a,defaultValue:r=null,onValueChange:l,open:c,defaultOpen:d=!1,onOpenChange:g,name:m,form:h,autoComplete:y,disabled:v=!1,readOnly:S=!1,required:w=!1,modal:T=!0,actionsRef:O,inputRef:A,onOpenChangeComplete:C,items:_,multiple:k=!1,itemToStringLabel:j,itemToStringValue:z,isItemEqualToValue:D=iT,highlightItemOnHover:L=!0,children:B}=t,{clearErrors:Y}=tT(),{setDirty:U,setTouched:I,setFocused:M,validityData:H,setFilled:ee,name:K,disabled:P,validation:q,validationMode:X}=uf(),Z=Bm({id:o}),W=P||v,N=K??m,[V,J]=Ji({controlled:a,default:k?r??po:r,name:"Select",state:"value"}),[$,se]=Ji({controlled:c,default:d,name:"Select",state:"open"}),re=b.useRef([]),me=b.useRef([]),pe=b.useRef(null),be=b.useRef(null),Ce=b.useRef(0),Me=b.useRef(null),ye=b.useRef([]),ge=b.useRef(!1),Te=b.useRef(null),Ae=b.useRef(null),Ue=b.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Ee=b.useRef(!1),Le=b.useRef(V),{mounted:Se,setMounted:Re,transitionStatus:Ne}=pm($),{openMethod:Ie,triggerProps:je}=j1($),le=Qt(()=>new Da({id:Z,labelId:void 0,modal:T,multiple:k,itemToStringLabel:j,itemToStringValue:z,isItemEqualToValue:D,value:V,open:$,mounted:Se,transitionStatus:Ne,items:_,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:Tt,triggerProps:Tt,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:It,setOpen:It,handleScrollArrowVisibility:It,onOpenChangeComplete:It,listRef:re,popupRef:pe,scrollHandlerRef:be,scrollArrowsMountedCountRef:Ce,valueRef:Me,valuesRef:ye,labelsRef:me,typingRef:ge,selectionRef:Ue,firstItemTextRef:Te,selectedItemTextRef:Ae,alignItemWithTriggerActiveRef:Ee,initialValueRef:Le},$M)).current,ve=le.useState("activeIndex"),he=le.useState("selectedIndex"),ce=le.useState("triggerElement"),xe=le.useState("positionerElement"),He=mN(Ie),Lt=Ie??He,Ft=b.useMemo(()=>k?"":Tr(V,z),[k,V,z]),ut=b.useMemo(()=>k&&Array.isArray(V)?V.map(Ze=>Tr(Ze,z)):Tr(V,z),[k,V,z]),Oe=Vt(ce),Ye=ke(()=>ut);nT(Oe,Z,V,Ye,!W,m);const Qe=k?Array.isArray(V)&&V.length>0:V!=null&&Ft!=="";we(()=>{ee(Qe)},[Qe,ee]),we(function(){const Rt=lT(ye.current,V,D,k);Rt===null&&(Ae.current=null),!$&&le.set("selectedIndex",Rt)},[k,$,V,D,le]),km(V,()=>{Y(N),U(BM(V,H.initialValue,D)),q.change(V)});const ct=ke((Ze,Rt)=>{g?.(Ze,Rt),!Rt.isCanceled&&(se(Ze),!Ze&&(Rt.reason===Fs||Rt.reason===Lu)&&(I(!0),M(!1),X==="onBlur"&&q.commit(V)))}),Jt=ke(()=>{Re(!1),le.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),C?.(!1)});fs({enabled:!O,open:$,ref:pe,onComplete(){$||Jt()}}),b.useImperativeHandle(O,()=>({unmount:Jt}),[Jt]);const rn=ke((Ze,Rt)=>{l?.(Ze,Rt),!Rt.isCanceled&&J(Ze)}),hn=ke(Ze=>{const Rt=dT(Ze.scrollHeight,Ze.clientHeight),Mn=WM(Ze.scrollTop,Rt),ao=Mn>0,bo=Mn<Rt;le.set("scrollUpArrowVisible",ao),le.set("scrollDownArrowVisible",bo)}),bt=_2({open:$,onOpenChange:ct,elements:{reference:ce,floating:xe}}),jt=Vu(bt,{enabled:!W,event:"mousedown"}),Fe=pl(bt),ft=f1(bt,{enabled:!W,listRef:re,activeIndex:ve,selectedIndex:he,disabledIndices:po,onNavigate(Ze){Ze===null&&!$||le.set("activeIndex",Ze)},focusItemOnHover:L}),_t=d1(bt,{enabled:!W&&($||!S&&!k),listRef:me,activeIndex:ve,selectedIndex:he,disabledIndices:Ze=>U1(re.current[Ze]),onMatch(Ze){$?le.set("activeIndex",Ze):rn(ye.current[Ze],qe(ns))},onTyping(Ze){ge.current=Ze}}),Pt=b.useMemo(()=>no(_t.reference,ft.reference,Fe.reference,jt.reference,je),[jt.reference,_t.reference,ft.reference,Fe.reference,je]),Nn=b.useMemo(()=>no(hl,_t.floating,ft.floating,Fe.floating),[_t.floating,ft.floating,Fe.floating]),ln=ft.item??Tt;le.useContextCallback("setValue",rn),le.useContextCallback("setOpen",ct),le.useContextCallback("handleScrollArrowVisibility",hn),le.useContextCallback("onOpenChangeComplete",C),HM(()=>{le.update({popupProps:Nn,triggerProps:Pt})}),le.useSyncedValues({id:Z,modal:T,multiple:k,value:V,open:$,mounted:Se,transitionStatus:Ne,popupProps:Nn,triggerProps:Pt,items:_,itemToStringLabel:j,itemToStringValue:z,isItemEqualToValue:D,openMethod:Lt});const yo=b.useMemo(()=>({disabled:W,readOnly:S,required:w,multiple:k,highlightItemOnHover:L,itemProps:ln}),[W,S,w,k,L,ln]),vn=ss(A,q.inputRef),Ro=k?void 0:N,kn=b.useMemo(()=>!k||!Array.isArray(V)||!N?null:V.map(Ze=>{const Rt=Tr(Ze,z);return p.jsx("input",{type:"hidden",form:h,name:N,value:Rt,disabled:W},Rt)}),[k,V,h,N,z,W]);return p.jsxs(oT.Provider,{value:le,children:[p.jsx(sT.Provider,{value:yo,children:p.jsx(aT.Provider,{value:bt,children:B})}),p.jsx("input",{...q.getValidationProps(W,{onFocus(){le.state.triggerElement?.focus({focusVisible:!0})},onChange(Ze){if(Ze.nativeEvent.defaultPrevented||W||S)return;const Rt=Ze.currentTarget.value,Mn=qe(ns,Ze.nativeEvent);function ao(){if(k)return;const bo=Rt.toLowerCase();let ps=ye.current.findIndex(Yt=>Tr(Yt,z).toLowerCase()===bo||uT(Yt,j).toLowerCase()===bo);ps===-1&&(ps=ye.current.findIndex((Yt,mn)=>{const Oo=me.current[mn];return Oo!=null&&Oo.toLowerCase()===bo}));const ro=ye.current[ps];ro!=null&&rn(ro,Mn)}le.set("forceMount",!0),queueMicrotask(ao)}}),id:Z&&Ro==null?`${Z}-hidden-input`:void 0,form:h,name:Ro,autoComplete:y,value:Ft,disabled:W,required:w&&!(k&&Qe),readOnly:S,ref:vn,style:N?bS:Iu,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),kn]})}function ZM(t,o){return t??o}const JM="data-popup-side",ej=400,tj={...nu,...eT,popupSide:t=>t?{[JM]:t}:null,value:()=>null},nj=b.forwardRef(function(o,a){const{render:r,className:l,id:c,disabled:d=!1,nativeButton:g=!0,style:m,...h}=o,{setTouched:y,setFocused:v,validationMode:S,validation:w,state:T,disabled:O}=uf(),{labelId:A}=Um(),C=ds(),{readOnly:_,required:k,disabled:j}=ff(),z=O||j||d,D=C.useState("open"),L=C.useState("mounted"),B=C.useState("value"),Y=C.useState("triggerProps"),U=C.useState("positionerElement"),I=C.useState("listElement"),M=C.useState("popupSide"),H=C.useState("id"),ee=C.useState("labelId"),K=C.useState("hasSelectedValue"),P=L&&U?M:null,q=c??H,X=ZM(A,ee);Bm({id:c});const Z=Vt(U),W=b.useRef(null),{getButtonProps:N,buttonRef:V}=Co({disabled:z,native:g}),J=C.useStateSetter("triggerElement"),$=nn(),se=nn(),re=nn();b.useEffect(()=>{if(D)return re.start(ej,()=>{C.context.selectionRef.current.allowUnselectedMouseUp=!0,C.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{re.clear()};C.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},se.clear()},[D,C,se,re]);const me=no(Y,{id:q,role:"combobox","aria-expanded":D,"aria-haspopup":"listbox","aria-controls":D?I?.id??au(U)?.id:void 0,"aria-labelledby":X,"aria-readonly":_||void 0,"aria-required":k||void 0,tabIndex:z?-1:0,onFocus(Ce){v(!0),D&&C.context.alignItemWithTriggerActiveRef.current&&C.context.setOpen(!1,qe(ns,Ce.nativeEvent)),$.start(0,()=>{C.set("forceMount",!0)})},onBlur(Ce){De(U,Ce.relatedTarget)||(y(!0),v(!1),S==="onBlur"&&w.commit(B))},onMouseDown(Ce){if(D)return;const Me=We(Ce.currentTarget);function ye(ge){if(!W.current)return;const Te=ge.target;De(W.current,Te)||De(Z.current,Te)||z1(ge,W.current)||C.context.setOpen(!1,qe(pS,ge))}se.start(0,()=>{Me.addEventListener("mouseup",ye,{once:!0})})}},h,N),pe=w.getValidationProps(z,me);pe.role="combobox";const be={...T,open:D,disabled:z,value:B,readOnly:_,popupSide:P,placeholder:!K};return tt("button",o,{ref:[a,W,V,J],state:be,stateAttributesMapping:tj,props:pe})}),oj={value:()=>null},sj=b.forwardRef(function(o,a){const{className:r,render:l,children:c,placeholder:d,style:g,...m}=o,h=ds(),y=h.useState("value"),v=h.useState("items"),S=h.useState("itemToStringLabel"),w=h.useState("hasSelectedValue"),T=!w&&d!=null&&c==null,O=h.useState("hasNullItemLabel",T),A={value:y,placeholder:!w};let C=null;return typeof c=="function"?C=c(y):c!=null?C=c:T&&!O?C=d:Array.isArray(y)?C=KM(y,v,S):C=fT(y,v,S),tt("span",o,{state:A,ref:[a,h.context.valueRef],props:[{children:C},m],stateAttributesMapping:oj})}),aj=b.forwardRef(function(o,a){const{render:r,className:l,style:c,...d}=o,h={open:ds().useState("open")};return tt("span",o,{state:h,ref:a,props:[{"aria-hidden":!0,children:"▼"},d],stateAttributesMapping:_u})}),rj=b.forwardRef(function(o,a){const r=ds(),l=r.useState("mounted"),c=r.useState("forceMount");return l||c?p.jsx(Uu,{ref:a,...o}):null}),pT=b.createContext(void 0);function hT(){const t=b.useContext(pT);if(!t)throw new Error(At(59));return t}function mu(t,o){t&&Object.assign(t.style,o)}const mT={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},ij={position:"fixed"},lj=b.forwardRef(function(o,a){const{anchor:r,className:l,render:c,positionMethod:d,side:g,align:m,sideOffset:h,alignOffset:y,collisionBoundary:v="clipping-ancestors",collisionPadding:S,arrowPadding:w,sticky:T,disableAnchorTracking:O,alignItemWithTrigger:A=!0,collisionAvoidance:C=HS,style:_,...k}=o,j=ds(),z=rT(),D=j.useState("open"),L=j.useState("mounted"),B=j.useState("modal"),Y=j.useState("value"),U=j.useState("openMethod"),I=j.useState("positionerElement"),M=j.useState("triggerElement"),H=j.useState("isItemEqualToValue"),ee=j.useState("transitionStatus"),K=b.useRef(null),P=b.useRef(null),[q,X]=b.useState(A),Z=L&&q&&U!=="touch";!L&&q!==A&&X(A),b.useImperativeHandle(j.context.alignItemWithTriggerActiveRef,()=>Z),Am((Z||B)&&D,U==="touch",I,M);const W=nf({anchor:r,floatingRootContext:z,positionMethod:d,mounted:L,side:g,sideOffset:h,align:m,alignOffset:y,arrowPadding:w,collisionBoundary:v,collisionPadding:S,sticky:T,disableAnchorTracking:O??Z,collisionAvoidance:C,keepMounted:!0}),N=Z?"none":W.side,V=Z?ij:W.positionerStyles,J={open:D,side:N,align:W.align,anchorHidden:W.anchorHidden};we(()=>{j.set("popupSide",W.side)},[j,W.side]);const $=j.useStateSetter("positionerElement"),se=of(o,J,{styles:V,transitionStatus:ee,props:k,refs:[a,$],hidden:!L,inert:!D}),re=b.useRef(0),me=ke(be=>{if(j.context.valuesRef.current.length===0)return;const Ce=re.current;re.current=be.size;const Me=qe(ns);if(Ce!==0&&!j.state.multiple&&Y!==null&&tu(j.context.valuesRef.current,Y,H)===-1){const ge=j.context.initialValueRef.current,Ae=ge!=null&&tu(j.context.valuesRef.current,ge,H)!==-1?ge:null;j.context.setValue(Ae,Me),Ae===null&&(j.set("selectedIndex",null),j.context.selectedItemTextRef.current=null)}if(Ce!==0&&j.state.multiple&&Array.isArray(Y)){const ye=Y.filter(ge=>tu(j.context.valuesRef.current,ge,H)!==-1);ye.length!==Y.length&&(j.context.setValue(ye,Me),ye.length===0&&(j.set("selectedIndex",null),j.context.selectedItemTextRef.current=null))}if(D&&Z){j.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const ye={height:""};mu(I,ye),mu(j.context.popupRef.current,ye)}}),pe=b.useMemo(()=>({...W,side:N,alignItemWithTriggerActive:Z,setControlledAlignItemWithTrigger:X,scrollUpArrowRef:K,scrollDownArrowRef:P}),[W,N,Z,X]);return p.jsx(Om,{elementsRef:j.context.listRef,labelsRef:j.context.labelsRef,onMapChange:me,children:p.jsxs(pT.Provider,{value:pe,children:[L&&B&&p.jsx(rf,{inert:yl(!D),cutout:M}),se]})})}),Kc="base-ui-disable-scrollbar",jh={className:Kc,getElement(t){return p.jsx("style",{nonce:t,href:Kc,precedence:"base-ui:low",children:`.${Kc}{scrollbar-width:none}.${Kc}::-webkit-scrollbar{display:none}`})}},cj=b.createContext(void 0),uj={disableStyleElements:!1};function fj(){return b.useContext(cj)??uj}const n0="--transform-origin",dj={...ul,...cl},pj=b.forwardRef(function(o,a){const{render:r,className:l,style:c,finalFocus:d,...g}=o,m=ds(),{multiple:h,readOnly:y,highlightItemOnHover:v}=ff(),S=rT(),{side:w,align:T,alignItemWithTriggerActive:O,isPositioned:A,setControlledAlignItemWithTrigger:C}=hT(),_=af()!=null,k=tf(),{nonce:j,disableStyleElements:z}=fj(),D=m.useState("id"),L=m.useState("open"),B=m.useState("openMethod"),Y=m.useState("mounted"),U=m.useState("popupProps"),I=m.useState("transitionStatus"),M=m.useState("triggerElement"),H=m.useState("positionerElement"),ee=m.useState("listElement"),K=b.useRef(!1),P=b.useRef(!1),q=b.useRef({}),X=kr(),Z=ke(J=>{if(!H||!m.context.popupRef.current||!P.current)return;const $=H.style.top==="0px",se=H.style.bottom==="0px";if(K.current||!O||!$&&!se){m.context.handleScrollArrowVisibility(J);return}const re=s0(H),me=Vi(H.getBoundingClientRect().height,"y",re),pe=We(H),be=Et(H),Ce=be.getComputedStyle(H),Me=parseFloat(Ce.marginTop),ye=parseFloat(Ce.marginBottom),ge=o0(be.getComputedStyle(m.context.popupRef.current)),Te=Math.min(pe.documentElement.clientHeight-Me-ye,ge),Ae=J.scrollTop,Ue=$c(J);let Ee=null;const Le=Ie=>{H.style.height=`${Ie}px`},Se=$?Ue-Ae:Ae,Re=Math.min(me+Se,Te);if(Se<=Xo){const Ie=Bi(Se,0,Te-me);Ie>0&&Le(me+Ie),J.scrollTop=$?Ue:0,Te-(me+Ie)<=Xo&&(K.current=!0),m.context.handleScrollArrowVisibility(J);return}if(Te-Re>Xo)Ee=$?1/0:0;else if(se&&Ae<Ue){const Ie=me+Se-Te;Ee=Ae-(Se-Ie)}const Ne=Math.ceil(Re);if(Ne!==0&&Le(Ne),Ee!=null){const Ie=Bi(Ee,0,$c(J));Math.abs(J.scrollTop-Ie)>Xo&&(J.scrollTop=Ie)}Ne>=Te-Xo&&(K.current=!0),m.context.handleScrollArrowVisibility(J)});b.useImperativeHandle(m.context.scrollHandlerRef,()=>Z,[Z]),fs({open:L,ref:m.context.popupRef,onComplete(){L&&m.context.onOpenChangeComplete(!0)}});const W={open:L,transitionStatus:I,side:w,align:T};we(()=>{!H||!m.context.popupRef.current||Object.keys(q.current).length||(q.current={top:H.style.top||"0",left:H.style.left||"0",right:H.style.right,height:H.style.height,bottom:H.style.bottom,minHeight:H.style.minHeight,maxHeight:H.style.maxHeight,marginTop:H.style.marginTop,marginBottom:H.style.marginBottom})},[m,H]),we(()=>{L||O||(P.current=!1,K.current=!1,mu(H,q.current))},[L,O,H]),we(()=>{const J=m.context.popupRef.current;if(!L||!M||!H||!J||O&&!A||m.state.transitionStatus==="ending")return;if(P.current=!0,J.style.removeProperty(n0),!O){X.request(()=>m.context.handleScrollArrowVisibility(ee||J));return}const $=hj(J);try{let se=m.context.selectedItemTextRef.current;se?.isConnected||(se=!m.select("hasSelectedValue")&&m.context.firstItemTextRef.current?.isConnected?m.context.firstItemTextRef.current:null);const re=m.context.valueRef.current,me=Et(H),pe=me.getComputedStyle(H),be=me.getComputedStyle(J),Ce=We(M),Me=s0(M),ye=Wc(M.getBoundingClientRect(),Me),ge=Wc(H.getBoundingClientRect(),Me),Te=ye.height,Ae=ee||J,Ue=Ae.scrollHeight,Ee=parseFloat(be.borderBottomWidth),Le=parseFloat(pe.marginTop)||10,Se=parseFloat(pe.marginBottom)||10,Re=parseFloat(pe.minHeight)||100,Ne=o0(be),Ie=5,je=5,le=20,ve=Ce.documentElement.clientHeight-Le-Se,he=Ce.documentElement.clientWidth,ce=ve-ye.bottom+Te;let xe,He=k==="rtl"?ye.right-ge.width:ye.left,Lt=0;if(se&&re){const jt=Wc(re.getBoundingClientRect(),Me);xe=Wc(se.getBoundingClientRect(),Me),He=ge.left+(k==="rtl"?jt.right-xe.right:jt.left-xe.left);const Fe=jt.top-ye.top+jt.height/2;Lt=xe.top-ge.top+xe.height/2-Fe}const Ft=ce+Lt+Se+Ee;let ut=Math.min(ve,Ft);const Oe=ve-Le-Se,Ye=Ft-ut,Qe=he-je;H.style.left=`${Bi(He,Ie,Qe-ge.width)}px`,H.style.height=`${ut}px`,H.style.maxHeight="none",H.style.marginTop=`${Le}px`,H.style.marginBottom=`${Se}px`,J.style.height="100%";const ct=$c(Ae),Jt=Ye>=ct-Xo;Jt&&(ut=Math.min(ve,ge.height)-(Ye-ct));const rn=ye.top<le||ye.bottom>ve-le||Math.ceil(ut)+Xo<Math.min(Ue,Re),hn=(me.visualViewport?.scale??1)!==1&&cs;if(rn||hn){mu(H,q.current),C(!1);return}const bt=Math.max(Re,ut);if(Jt){const jt=Math.max(0,ve-Ft);H.style.top=ge.height>=Oe?"0":`${jt}px`,H.style.height=`${ut}px`,Ae.scrollTop=$c(Ae)}else H.style.bottom="0",Ae.scrollTop=Ye;if(xe){const jt=ge.top,Fe=ge.height,ft=xe.top+xe.height/2,_t=Bi(Fe>0?(ft-jt)/Fe*100:50,0,100);J.style.setProperty(n0,`50% ${_t}%`)}(bt===ve||ut>=Ne)&&(K.current=!0),m.context.handleScrollArrowVisibility(Ae),v&&m.state.selectedIndex===null&&m.state.activeIndex===null&&m.context.listRef.current[0]!=null&&m.set("activeIndex",0)}finally{$()}},[m,L,H,M,O,C,X,ee,v,k,A]),b.useEffect(()=>{if(!O||!H||!L)return;const J=Et(H);function $(se){m.context.setOpen(!1,qe(NO,se))}return Ge(J,"resize",$)},[m,O,H,L]);const N={...ee?{role:"presentation"}:{role:"listbox","aria-multiselectable":h||void 0,"aria-readonly":y||void 0,id:`${D}-list`},onKeyDown(J){_&&bl.has(J.key)&&J.stopPropagation()},onScroll(J){ee||Z(J.currentTarget)},...O&&{style:ee?{height:"100%"}:mT},className:!ee&&O?jh.className:void 0},V=tt("div",o,{ref:[a,m.context.popupRef],state:W,stateAttributesMapping:dj,props:[U,N,gl(I),g]});return p.jsxs(b.Fragment,{children:[!z&&jh.getElement(j),p.jsx(Bu,{context:S,modal:!1,disabled:!Y,openInteractionType:B,returnFocus:d,restoreFocus:!0,children:V})]})});function o0(t){const o=t.maxHeight;return o.endsWith("px")&&parseFloat(o)||1/0}function $c(t){return dT(t.scrollHeight,t.clientHeight)}function s0(t){return JS.getScale(t)}function Vi(t,o,a){return t/a[o]}function Wc(t,o){return Qi({x:Vi(t.x,"x",o),y:Vi(t.y,"y",o),width:Vi(t.width,"x",o),height:Vi(t.height,"y",o)})}const a0=[["transform","none"],["scale","1"],["translate","0 0"]];function hj(t){const{style:o}=t,a={};for(const[r,l]of a0)a[r]=o.getPropertyValue(r),o.setProperty(r,l,"important");return()=>{for(const[r]of a0){const l=a[r];l?o.setProperty(r,l):o.removeProperty(r)}}}const mj=b.forwardRef(function(o,a){const{render:r,className:l,style:c,...d}=o,g=ds(),{multiple:m,readOnly:h}=ff(),{alignItemWithTriggerActive:y}=hT(),v=g.useState("hasScrollArrows"),S=g.useState("openMethod"),T={id:`${g.useState("id")}-list`,role:"listbox","aria-multiselectable":m||void 0,"aria-readonly":h||void 0,onScroll(A){g.context.scrollHandlerRef.current?.(A.currentTarget)},...y&&{style:mT},className:v&&S!=="touch"?jh.className:void 0},O=g.useStateSetter("listElement");return tt("div",o,{ref:[a,O],props:[T,d]})}),gT=b.createContext(void 0);function Vm(){const t=b.useContext(gT);if(!t)throw new Error(At(57));return t}const gj=b.memo(b.forwardRef(function(o,a){const{render:r,className:l,style:c,value:d=null,label:g,disabled:m=!1,nativeButton:h=!1,...y}=o,v=b.useRef(null),S=sf({guess:!0,label:g,textRef:v}),w=ds(),{itemProps:T,multiple:O,disabled:A,readOnly:C}=ff(),_=A||m,k=w.useState("isActive",S.index),j=w.useState("open"),z=w.useState("isSelected",d),D=w.useState("isSelectedByFocus",S.index),L=w.useState("isItemEqualToValue"),B=S.index,Y=b.useRef(null);we(()=>{const W=w.context.valuesRef.current;return W[B]=d,()=>{delete W[B]}},[B,d,w]),we(()=>{const W=w.state.value,N=w.state.selectedIndex;let V=N,J;O&&Array.isArray(W)?(V=FM(B,d,w.context.valuesRef.current,W,L,N),J=V===B,B===N&&!J&&(w.context.selectedItemTextRef.current=null)):(J=W!==void 0&&Na(d,W,L),J&&(V=B)),w.set("selectedIndex",V),J&&v.current&&(w.context.selectedItemTextRef.current=v.current)},[B,O,L,w,d]);const U=b.useRef("mouse"),I=b.useRef(!1),{getButtonProps:M,buttonRef:H}=Co({disabled:_,focusableWhenDisabled:!0,native:h,composite:!0}),ee={disabled:_,selected:z,highlighted:k};function K(W){if(A||C)return;const N=w.state.value;if(O){const V=Array.isArray(N)?N:[],J=z?YM(V,d,L):[...V,d];w.context.setValue(J,qe(Fi,W))}else w.context.setValue(d,qe(Fi,W)),w.context.setOpen(!1,qe(Fi,W))}function P(){w.context.selectionRef.current.dragY=0}const q={role:"option","aria-selected":z,tabIndex:j&&k?0:-1,onKeyDown(W){w.set("activeIndex",B),W.key===" "&&w.context.typingRef.current&&W.preventDefault()},onClick(W){const N=U.current!=="touch",V=W.nativeEvent.pointerType,J=N&&Ou(W.nativeEvent)&&(V!==void 0||k),$=N&&!J&&!I.current;I.current=!1,!(_||$)&&K(W.nativeEvent)},onPointerEnter(W){U.current=W.pointerType},onPointerMove(W){if(W.pointerType==="mouse"&&W.buttons===1){const N=w.context.selectionRef.current;N.dragY+=W.movementY,N.dragY**2>=64&&(N.allowUnselectedMouseUp=!0)}},onPointerDown(W){U.current=W.pointerType,I.current=!0,P()},onMouseUp(){if(P(),_||U.current==="touch"||I.current)return;const W=!w.context.selectionRef.current.allowSelectedMouseUp&&z,N=!w.context.selectionRef.current.allowUnselectedMouseUp&&!z;W||N||(I.current=!0,Y.current?.click(),I.current=!1)}},X=tt("div",o,{ref:[H,a,S.ref,Y],state:ee,props:[T,q,y,M]}),Z=b.useMemo(()=>({selected:z,index:B,textRef:v,selectedByFocus:D}),[z,B,v,D]);return p.jsx(gT.Provider,{value:Z,children:X})})),yj=b.forwardRef(function(o,a){const{selected:r}=Vm();return o.keepMounted||r?p.jsx(bj,{...o,ref:a}):null}),bj=b.memo(b.forwardRef((t,o)=>{const{render:a,className:r,style:l,keepMounted:c,...d}=t,{selected:g}=Vm(),m=b.useRef(null),{transitionStatus:h,setMounted:y}=pm(g),S=tt("span",t,{ref:[o,m],state:{selected:g,transitionStatus:h},props:[{"aria-hidden":!0,children:"✔️"},d],stateAttributesMapping:cl});return fs({batch:!0,enabled:!g,open:g,ref:m,onComplete(){g||y(!1)}}),S})),vj=b.memo(b.forwardRef(function(o,a){const{index:r,textRef:l,selectedByFocus:c}=Vm(),d=ds(),{render:g,className:m,style:h,...y}=o,v=b.useCallback(w=>{w&&(r===0&&(d.context.firstItemTextRef.current=w),c&&(d.context.selectedItemTextRef.current=w))},[d,r,c]);return tt("div",o,{ref:[v,a,l],props:y})})),yT=b.createContext(void 0);function xj(){const t=b.useContext(yT);if(t===void 0)throw new Error(At(63));return t}const Sj="data-checked",wj="data-unchecked",bT={...eT,checked(t){return t?{[Sj]:""}:{[wj]:""}}};function Tj(t,o,a,r=!0,l){const[c,d]=b.useState(),g=mo(l?`${l}-label`:void 0),m=t??o??c;return we(()=>{const h=t||o||!r?void 0:Ej(a.current,g);c!==h&&d(h)}),m}function Ej(t,o){const a=Cj(t);if(a)return!a.id&&o&&(a.id=o),a.id||void 0}function Cj(t){if(!t)return;const o=t.parentElement;if(o&&o.tagName==="LABEL")return o;const a=t.id;if(a){const l=t.nextElementSibling;if(l&&l.htmlFor===a)return l}const r=t.labels;return r&&r[0]}const Rj=b.forwardRef(function(o,a){const{checked:r,className:l,defaultChecked:c,"aria-labelledby":d,form:g,id:m,inputRef:h,name:y,nativeButton:v=!1,onCheckedChange:S,readOnly:w=!1,required:T=!1,disabled:O=!1,render:A,uncheckedValue:C,value:_,style:k,...j}=o,{clearErrors:z}=tT(),{state:D,setTouched:L,setDirty:B,validityData:Y,setFilled:U,setFocused:I,validationMode:M,disabled:H,name:ee,validation:K}=uf(),{labelId:P}=Um(),q=H||O,X=ee??y,Z=b.useRef(null),W=ss(Z,h,K.inputRef),N=b.useRef(null),V=mo(),J=Bm({id:m}),$=v?void 0:J,[se,re]=Ji({controlled:r,default:!!c,name:"Switch",state:"checked"});nT(N,V,se,void 0,!q,y),we(()=>{U(se)},[se,U]),km(se,()=>{z(X),B(se!==Y.initialValue),K.change(se)});const{getButtonProps:me,buttonRef:pe}=Co({disabled:q,native:v}),be=Tj(d,P,Z,!v,$),Ce={id:v?J:V,role:"switch","aria-checked":se,"aria-readonly":w||void 0,"aria-required":T||void 0,"aria-labelledby":be,onFocus(){q||I(!0)},onBlur(){const Te=Z.current;!Te||q||(L(!0),I(!1),M==="onBlur"&&K.commit(Te.checked))},onClick(Te){if(w||q)return;Te.preventDefault();const Ae=Z.current;Ae&&Gi(Ae,Te)}},Me={...K.getValidationProps(q),checked:se,disabled:q,form:g,id:$,name:X,required:T,style:X?bS:Iu,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:W,onChange(Te){if(Te.nativeEvent.defaultPrevented)return;if(w){Te.preventDefault();return}const Ae=Te.currentTarget.checked,Ue=qe(ns,Te.nativeEvent);S?.(Ae,Ue),!Ue.isCanceled&&re(Ae)},onClick(Te){Te.stopPropagation()},onFocus(){N.current?.focus()},..._!==void 0?{value:_}:Tt},ye=b.useMemo(()=>({...D,checked:se,disabled:q,readOnly:w,required:T}),[D,se,q,w,T]),ge=tt("span",o,{state:ye,ref:[a,N,pe],props:[Ce,j,me,Te=>K.getValidationProps(q,Te)],stateAttributesMapping:bT});return p.jsxs(yT.Provider,{value:ye,children:[ge,!se&&X&&C!==void 0&&p.jsx("input",{type:"hidden",form:g,name:X,value:C,disabled:q}),p.jsx("input",{...Me,suppressHydrationWarning:!0})]})}),Oj=b.forwardRef(function(o,a){const{render:r,className:l,style:c,...d}=o,g=xj();return tt("span",o,{state:g,ref:a,stateAttributesMapping:bT,props:d})}),vT="data-composite-item-active";function Aj(t){const{loopFocus:o=!0,orientation:a="both",grid:r,onLoop:l,direction:c,highlightedIndex:d,onHighlightedIndexChange:g,rootRef:m,enableHomeAndEndKeys:h=!1,stopEventPropagation:y,disabledIndices:v,modifierKeys:S=po}=t,[w,T]=b.useState(0),O=r!=null,A=b.useRef(null),C=ss(A,m),_=b.useRef([]),k=b.useRef(!1),j=b.useRef(null),z=d??w,D=ke((I,M=!1)=>{if(j.current=_.current[I]??null,(g??T)(I),M){const H=_.current[I];Xx(A.current,H,c,a)}}),L=ke(I=>{if(I.size===0)return;if(k.current){const K=_.current,P=K.indexOf(j.current);if(P===-1){const q=K[z];!q||Cr(K,z,v)?D(Nj(K,v)):j.current=q}else P!==z&&D(P);return}k.current=!0;const M=Array.from(I.keys()),H=M.find(K=>K?.hasAttribute(vT))??null,ee=H?I.get(H)?.index??-1:-1;if(ee!==-1)D(ee);else if(Cr(M,z,v)){const K=$o(M,{disabledIndices:v});Yi(M,K)||D(K)}Xx(A.current,H,c,a)});we(()=>{if(v==null||d!=null||!k.current)return;const I=_.current;if(Cr(I,z,v)){const M=$o(I,{disabledIndices:v});Yi(I,M)||D(M)}},[v,d,z,_,D]);const B=ke((I,M,H)=>l?l(I,M,H,_):H),Y=ke(I=>{const M=I.key===Rh||I.key===Oh;if(!bl.has(I.key)||!h&&M||kj(I,S)||!A.current)return;const ee=c==="rtl",K=ee?Eh:Ch,P=ee?Ch:Eh,q=a==="vertical"?Th:K,X=a==="vertical"?wh:P,Z=zt(I.nativeEvent);if(Z!=null&&Gx(Z)&&!U1(Z)){const se=Z.selectionStart,re=Z.selectionEnd,me=Z.value;if(se==null||I.shiftKey||se!==re||I.key!==X&&se<me.length||I.key!==q&&se>0)return}let W=z;const N=Zc(_,v),V=bh(_,v);r!=null&&(W=r({disabledIndices:v,elementsRef:_,event:I,highlightedIndex:z,loopFocus:o,maxIndex:V,minIndex:N,onLoop:B,orientation:a,rtl:ee}));const J=a!=="vertical"&&I.key===K||a!=="horizontal"&&I.key===Th,$=a!=="vertical"&&I.key===P||a!=="horizontal"&&I.key===wh;h&&(I.key===Rh?W=N:I.key===Oh&&(W=V)),W===z&&(J||$)&&(o&&W===V&&J?(W=N,l&&(W=l(I,z,W,_))):o&&W===N&&$?(W=V,l&&(W=l(I,z,W,_))):W=$o(_.current,{startingIndex:W,decrement:$,disabledIndices:v})),W!==z&&!Yi(_.current,W)&&(y&&I.stopPropagation(),(O||M||J||$)&&I.preventDefault(),D(W,!0),queueMicrotask(()=>{_.current[W]?.focus()}))});return{props:{ref:C,onFocus(I){const M=A.current,H=zt(I.nativeEvent);!M||H==null||!Gx(H)||H.setSelectionRange(0,H.value.length)},onKeyDown:Y},highlightedIndex:z,onHighlightedIndexChange:D,elementsRef:_,onMapChange:L,relayKeyboardEvent:Y}}function Nj(t,o){let a=-1;for(let r=0;r<t.length;r+=1){const l=t[r];if(!(!l||Cr(t,r,o))){if(l.hasAttribute(vT))return r;a===-1&&(a=r)}}return Math.max(a,0)}function kj(t,o){for(const a of jN)if(!o.includes(a)&&t.getModifierState(a))return!0;return!1}function Mj(t){const{render:o,className:a,style:r,refs:l=po,props:c=po,state:d=Tt,stateAttributesMapping:g,highlightedIndex:m,onHighlightedIndexChange:h,orientation:y,grid:v,loopFocus:S,onLoop:w,enableHomeAndEndKeys:T,onMapChange:O,stopEventPropagation:A=!0,rootRef:C,disabledIndices:_,modifierKeys:k,highlightItemOnHover:j=!1,tag:z="div",...D}=t,L=tf(),{props:B,highlightedIndex:Y,onHighlightedIndexChange:U,elementsRef:I,onMapChange:M,relayKeyboardEvent:H}=Aj({grid:v,loopFocus:S,onLoop:w,orientation:y,highlightedIndex:m,onHighlightedIndexChange:h,rootRef:C,stopEventPropagation:A,enableHomeAndEndKeys:T,direction:L,disabledIndices:_,modifierKeys:k}),ee=tt(z,t,{state:d,ref:l,props:[B,...c,D],stateAttributesMapping:g}),K=b.useMemo(()=>({highlightedIndex:Y,onHighlightedIndexChange:U,highlightItemOnHover:j,relayKeyboardEvent:H}),[Y,U,j,H]);return p.jsx(T1.Provider,{value:K,children:p.jsx(Om,{elementsRef:I,onMapChange:P=>{O?.(P),M(P)},children:ee})})}const jj=b.createContext(void 0);function _j(){return b.useContext(jj)}const xT=b.createContext(void 0);function Dj(){return b.useContext(xT)}const zj=b.forwardRef(function(o,a){const{defaultValue:r,disabled:l=!1,loopFocus:c=!0,onValueChange:d,orientation:g="horizontal",multiple:m=!1,value:h,className:y,render:v,style:S,...w}=o,T=af(),O=_j(),A=r??po,C=h!==void 0||r!==void 0,_=(T?.disabled??!1)||(O?.disabled??!1)||l,[k,j]=Ji({controlled:h,default:A,name:"ToggleGroup",state:"value"}),z=ke((U,I,M)=>{let H;m?(H=k.slice(),I?H.push(U):H.splice(k.indexOf(U),1)):H=I?[U]:[],d?.(H,M),!M.isCanceled&&j(H)}),D={disabled:_,multiple:m,orientation:g},L=b.useMemo(()=>({disabled:_,setGroupValue:z,value:k,isValueInitialized:C}),[_,z,k,C]),B={role:"group"},Y=tt("div",o,{enabled:!!T,state:D,ref:a,props:[B,w]});return p.jsx(xT.Provider,{value:L,children:T?Y:p.jsx(Mj,{render:v,className:y,style:S,state:D,refs:[a],props:[B,w],loopFocus:c,enableHomeAndEndKeys:!0,orientation:g})})}),Lj=b.forwardRef(function(o,a){const{className:r,defaultPressed:l=!1,disabled:c=!1,form:d,onPressedChange:g,pressed:m,render:h,type:y,value:v,nativeButton:S=!0,style:w,...T}=o,O=mo(v||void 0),A=Dj(),C=A?.value??[],_=(c||A?.disabled)??!1,[k,j]=Ji({controlled:A?O!==void 0&&C.indexOf(O)>-1:m,default:l,name:"Toggle",state:"pressed"}),{getButtonProps:z,buttonRef:D}=Co({disabled:_,native:S}),L={disabled:_,pressed:k},B=[D,a],Y=[{"aria-pressed":k,onClick(M){const H=!k,ee=qe(ns,M.nativeEvent);g?.(H,ee),!ee.isCanceled&&(O&&A?.setGroupValue?.(O,H,ee),!ee.isCanceled&&j(H))}},T,z],U=tt("button",o,{enabled:!A,state:L,ref:B,props:Y}),I=b.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return A?p.jsx(L1,{tag:"button",render:h,className:r,style:w,metadata:I,state:L,refs:B,props:Y}):U}),ST="h-7 w-full min-w-0 rounded-control border border-line bg-surface-2 px-2 text-[13px] text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:bg-surface",tl=b.forwardRef(function({className:o,...a},r){return p.jsx("input",{ref:r,"data-ui-field":"",className:lt(ST,o),...a})});function Pj({value:t,options:o,onChange:a,placeholder:r="—",className:l,...c}){return p.jsxs(QM,{value:t,onValueChange:d=>d!==null&&a(d),children:[p.jsxs(nj,{"aria-label":c["aria-label"],"data-ui-field":"",className:lt(ST,"flex items-center justify-between gap-1 text-left",l),children:[p.jsx(sj,{children:d=>o.find(g=>g.value===d)?.label??p.jsx("span",{className:"text-fg-subtle",children:r})}),p.jsx(aj,{children:p.jsx(Aa,{className:"size-3.5 text-fg-subtle"})})]}),p.jsx(rj,{children:p.jsx(lj,{sideOffset:4,className:"z-[1000]",alignItemWithTrigger:!1,children:p.jsx(pj,{className:lt(Hm,"max-h-80 overflow-auto"),children:p.jsx(mj,{children:o.map(d=>p.jsxs(gj,{value:d.value,className:"flex h-7 min-w-32 cursor-default select-none items-center gap-2 rounded-md px-2 outline-none data-[highlighted]:bg-hover",children:[p.jsx("span",{className:"flex size-4 items-center justify-center",children:p.jsx(yj,{children:p.jsx(Pr,{className:"size-3.5"})})}),p.jsx(vj,{children:d.label})]},d.value))})})})})]})}function Ij({value:t,options:o,onChange:a,onRepick:r,className:l,...c}){return p.jsx(zj,{value:t===null?[]:[t],onValueChange:d=>{const g=d[0];g!==void 0?a(g):t!==null&&r?.(t)},"aria-label":c["aria-label"],"data-ui-field":"",className:lt("flex h-7 items-center gap-0.5 rounded-control bg-surface-2 p-0.5",l),children:o.map(d=>p.jsx(Lj,{value:d.value,"aria-label":d.title,title:d.title,className:"flex h-full flex-1 items-center justify-center whitespace-nowrap rounded-[4px] px-1.5 text-fg-muted outline-none hover:text-fg data-[pressed]:bg-surface data-[pressed]:text-fg data-[pressed]:shadow-sm focus-visible:outline-2 focus-visible:outline-accent",children:d.label},d.value))})}function wT({checked:t,onChange:o,disabled:a,...r}){return p.jsx(Rj,{checked:t,disabled:a,onCheckedChange:l=>o(l),onKeyDown:jr,"aria-label":r["aria-label"],className:"relative inline-flex h-4 w-7 shrink-0 items-center rounded-full bg-line-strong p-0.5 transition-colors data-[checked]:bg-accent disabled:opacity-40",children:p.jsx(Oj,{className:"size-3 rounded-full bg-white shadow transition-transform data-[checked]:translate-x-3"})})}function Hj(t,o){const a=Et(t).getComputedStyle(t).transform;let r=0,l=0,c=1;if(a&&a!=="none"){const d=a.match(/matrix(?:3d)?\(([^)]+)\)/);if(d){const g=d[1].split(", ").map(parseFloat);g.length===6?(r=g[4],l=g[5],c=Math.sqrt(g[0]*g[0]+g[1]*g[1])):g.length===16&&(r=g[12],l=g[13],c=g[0])}}return{x:r,y:l,scale:c}}const TT=b.createContext(void 0);function df(){const t=b.useContext(TT);if(!t)throw new Error(At(73));return t}let r0=0;function ET(t){return r0+=1,`${t}-${Math.random().toString(36).slice(2,6)}-${r0}`}function Zp(t,o){if(typeof t=="string")return{description:t};if(typeof t=="function"){const a=t(o);return typeof a=="string"?{description:a}:a}return t}function Jp(t){const o=new Map;let a=0,r=0;return t.forEach((l,c)=>{const d=l.transitionStatus==="ending";o.set(l.id,{value:l,domIndex:c,visibleIndex:d?-1:a,offsetY:r}),r+=l.height||0,d||(a+=1)}),o}function eh(t,o){let a=0;return t.map(r=>{if(r.transitionStatus==="ending")return r;const l=a>=o;return a+=1,r.limited===l?r:{...r,limited:l}})}const uo={toasts:t=>t.toasts,isEmpty:t=>t.toasts.length===0,toast:(t,o)=>t.toastMetadata.get(o)?.value,toastIndex:(t,o)=>t.toastMetadata.get(o)?.domIndex??-1,toastOffsetY:(t,o)=>t.toastMetadata.get(o)?.offsetY??0,toastVisibleIndex:(t,o)=>t.toastMetadata.get(o)?.visibleIndex??-1,focused:t=>t.focused,expanded:t=>t.hovering||t.focused,expandedOrOutOfFocus:t=>t.hovering||t.focused||!t.isWindowFocused,prevFocusElement:t=>t.prevFocusElement};class Uj extends Da{timers=new Map;areTimersPaused=!1;constructor(o){super({...o,toastMetadata:Jp(o.toasts)},{},uo)}setViewport=o=>{this.set("viewport",o)};syncProviderProps(o,a){const r=this.state.limit!==a;if(this.state.timeout===o&&!r)return;const l={timeout:o,limit:a};if(r){const c=eh(this.state.toasts,a);l.toasts=c,l.toastMetadata=Jp(c)}this.update(l)}disposeEffect=()=>()=>{this.timers.forEach(o=>{o.timeout?.clear()}),this.timers.clear()};removeToast(o,a=!1){const r=uo.toastIndex(this.state,o);if(r===-1)return;const l=this.state.toasts[r];a||l?.onRemove?.();const c=[...this.state.toasts];c.splice(r,1),this.setToasts(c)}addToast=o=>{const{timeout:a,limit:r}=this.state,l=o.id||ET("toast");if(o.id){const m=uo.toast(this.state,o.id);if(m)if(m.transitionStatus==="ending")this.removeToast(o.id,!0);else{const{id:h,transitionStatus:y,...v}=o;return this.updateToastInternal(o.id,v,!0,!0),o.id}}const c={...o,id:l,updateKey:0,transitionStatus:"starting"},d=[c,...this.state.toasts];this.setToasts(eh(d,r));const g=c.timeout??a;return c.type!=="loading"&&g>0&&this.scheduleTimer(l,g,()=>this.closeToast(l)),uo.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),l};updateToast=(o,a)=>{const r=uo.toast(this.state,o);!r||r.transitionStatus==="ending"||this.updateToastInternal(o,typeof a=="function"?a(r):a,!1,!0)};updateToastInternal=(o,a,r=!1,l=!1)=>{const{timeout:c,toasts:d}=this.state,g=uo.toast(this.state,o);if(!g||g.transitionStatus==="ending")return;const m={...g,...a,...l&&{updateKey:g.updateKey+1}};this.setToasts(d.map(A=>A.id===o?m:A));const h=m.timeout??c,y=g.timeout??c,v=Object.hasOwn(a,"timeout"),S=m.transitionStatus!=="ending"&&m.type!=="loading"&&h>0,w=this.timers.has(o),T=y!==h,O=g.type==="loading";if(!S&&w){this.clearTimer(o);return}S&&(!w||T||v||O||r)&&(this.clearTimer(o),this.scheduleTimer(o,h,()=>this.closeToast(o)),uo.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=o=>{const a=o===void 0,{limit:r,toasts:l}=this.state;let c;if(a)c=l,this.clearTimers();else{const m=uo.toast(this.state,o);if(!m)return;c=[m],this.clearTimer(o)}const d=l.map(m=>a||m.id===o?{...m,transitionStatus:"ending",height:0}:m),g=eh(d,r);this.setToasts(g,!g.some(m=>m.transitionStatus!=="ending")),c.forEach(m=>{m.transitionStatus!=="ending"&&m.onClose?.()}),this.handleFocusManagement(o)};promiseToast=(o,a)=>{const r=Zp(a.loading),l=this.addToast({...r,type:"loading"}),c=o.then(d=>{const g=Zp(a.success,d);return this.updateToast(l,{...g,type:"success",timeout:g.timeout}),d}).catch(d=>{const g=Zp(a.error,d);return this.updateToast(l,{...g,type:"error",timeout:g.timeout}),Promise.reject(d)});return{}.hasOwnProperty.call(a,"setPromise")&&a.setPromise(c),c};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(o=>{o.timeout&&(o.timeout.clear(),o.remaining=Math.max(o.remaining-(Date.now()-o.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((o,a)=>{o.remaining=o.remaining>0?o.remaining:o.delay,o.timeout??=An.create(),o.timeout.start(o.remaining,()=>{this.handleTimerFired(a),o.callback()}),o.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=o=>{if(o.pointerType!=="touch")return;const a=zt(o);De(this.state.viewport,a)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(o,a,r){const l=Date.now(),d=!uo.expandedOrOutOfFocus(this.state)?An.create():void 0;d?.start(a,()=>{this.handleTimerFired(o),r()}),this.timers.set(o,{timeout:d,start:l,delay:a,remaining:a,callback:r})}clearTimers(){this.timers.forEach(o=>{o.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(o){this.timers.get(o)?.timeout?.clear(),this.timers.delete(o),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(o){this.timers.delete(o),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(o,a=o.length===0){const r={toasts:o,toastMetadata:Jp(o)};a&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(o){const a=tn(We(this.state.viewport));if(!this.state.viewport||!De(this.state.viewport,a)||!su(a))return;if(o===void 0){this.restoreFocusToPrevElement();return}const r=uo.toasts(this.state),l=uo.toastIndex(this.state,o),c=(g,m)=>{for(let h=g;h>=0&&h<r.length;h+=m)if(r[h].transitionStatus!=="ending")return r[h];return null},d=c(l+1,1)??c(l-1,-1);d?d.ref?.current?.focus():this.restoreFocusToPrevElement()}}const Bj=function(o){const{children:a,timeout:r=5e3,limit:l=3,toastManager:c}=o,d=Qt(()=>new Uj({timeout:r,limit:l,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Eu(d.disposeEffect),b.useEffect(function(){return c?c[" subscribe"](({action:h,options:y})=>{const v=y.id;h==="promise"&&y.promise?d.promiseToast(y.promise,y):h==="update"&&v?d.updateToast(v,y.updates):h==="close"?d.closeToast(v):d.addToast(y)}):void 0},[d,c]),p.jsxs(TT.Provider,{value:d,children:[p.jsx(Vj,{store:d,timeout:r,limit:l}),a]})};function Vj(t){const{store:o,timeout:a,limit:r}=t;return we(()=>{o.syncProviderProps(a,r)},[o,a,r]),null}const Fj="--toast-frontmost-height",Yj=b.forwardRef(function(o,a){const{render:r,className:l,style:c,children:d,...g}=o,m=df(),h=nn(),y=b.useRef(!1),v=b.useRef(!1),S=b.useRef(!1),w=m.useState("isEmpty"),T=m.useState("toasts"),O=m.useState("focused"),A=m.useState("expanded"),C=m.useState("prevFocusElement"),_=T[0]?.height,k=T.some(Z=>Z.transitionStatus==="ending"),j=T.filter(Z=>Z.priority==="high");b.useEffect(()=>{const Z=m.state.viewport;if(!Z||w)return;const W=Et(Z),N=We(Z);function V(se){se.key==="F6"&&zt(se)!==Z&&(se.preventDefault(),m.set("prevFocusElement",tn(N)),Z?.focus({preventScroll:!0}),m.pauseTimers(),m.set("focused",!0))}function J(se){zt(se)===W&&(m.set("isWindowFocused",!1),m.pauseTimers())}function $(se){if(se.relatedTarget)return;const re=zt(se),me=tn(We(Z));(re===W||!De(Z,re)||!su(me))&&m.resumeTimers(),h.start(0,()=>m.set("isWindowFocused",!0))}return fo(Ge(W,"keydown",V),Ge(W,"blur",J,!0),Ge(W,"focus",$,!0),Ge(N,"pointerdown",m.handleDocumentPointerDown,!0))},[m,h,w]);function z(Z){y.current=!0;const W=Z.relatedTarget===m.state.viewport?T.find(N=>N.transitionStatus!=="ending"&&!N.limited):void 0;W?W.ref?.current?.focus():m.restoreFocusToPrevElement()}function D(Z){Z.key==="Tab"&&Z.shiftKey&&zt(Z.nativeEvent)===m.state.viewport&&(Z.preventDefault(),m.restoreFocusToPrevElement())}function L(){m.state.toasts.some(W=>W.transitionStatus==="ending")||S.current||!v.current||(m.state.isWindowFocused&&m.resumeTimers(),m.set("hovering",!1),v.current=!1)}b.useEffect(L,[k,m]);function B(){m.pauseTimers(),m.set("hovering",!0),v.current=!1}function Y(){m.state.isWindowFocused&&m.resumeTimers()}function U(){v.current=!0,L()}function I(Z){Z.pointerType==="touch"&&(S.current=!0)}function M(Z){Z.pointerType==="touch"&&(S.current=!1,L())}function H(){if(y.current){y.current=!1;return}O||su(tn(We(m.state.viewport)))&&(m.set("focused",!0),m.pauseTimers())}function ee(Z){!O||De(m.state.viewport,Z.relatedTarget)||(m.set("focused",!1),Y())}const K={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:B,onMouseMove:B,onMouseLeave:U,onFocus:H,onBlur:ee,onKeyDown:D,onClick:H,onPointerDown:I,onPointerUp:M,onPointerCancel:M,style:{[Fj]:_?`${_}px`:void 0}},P={expanded:A},q=!w&&C&&p.jsx(as,{onFocus:z}),X=tt("div",o,{ref:[a,m.setViewport],state:P,props:[K,g,{children:p.jsxs(b.Fragment,{children:[q,d,q]})}]});return p.jsxs(b.Fragment,{children:[q,X,!O&&j.length>0&&p.jsx("div",{style:Iu,children:j.map(Z=>p.jsxs("div",{role:"alert","aria-atomic":!0,children:[p.jsx("div",{children:Z.title}),p.jsx("div",{children:Z.description})]},Z.id))})]})}),CT=b.createContext(void 0);function pf(){const t=b.useContext(CT);if(!t)throw new Error(At(66));return t}function th(t,o,a){switch(t){case"up":return-a;case"down":return a;case"left":return-o;case"right":return o;default:return 0}}const qj="--toast-index",Gj="--toast-offset-y",Xj="--toast-height",Kj="--toast-swipe-movement-x",$j="--toast-swipe-movement-y",Wj="data-swipe-direction",Qj={...cl,swipeDirection(t){return t?{[Wj]:t}:null}},i0=40,Zj=10,l0=.5,Jj=1,e_=`${CA},${RA}`,t_=b.forwardRef(function(o,a){const{toast:r,render:l,className:c,swipeDirection:d=["down","right"],style:g,...m}=o,h=r.positionerProps?.anchor!==void 0;let y=[];h||(y=Array.isArray(d)?d:[d]);const v=y.length>0,S=df(),[w,T]=b.useState(void 0),[O,A]=b.useState(!1),[C,_]=b.useState(!1),[k,j]=b.useState({x:0,y:0}),[z,D]=b.useState({x:0,y:0,scale:1}),[L,B]=b.useState(),[Y,U]=b.useState(),[I,M]=b.useState(null),H=b.useRef(null),ee=b.useRef(void 0),K=b.useRef({x:0,y:0}),P=b.useRef({x:0,y:0,scale:1}),q=b.useRef(void 0),X=b.useRef(0),Z=b.useRef(!1),W=b.useRef({x:0,y:0}),N=b.useRef(!1),V=b.useRef({x:0,y:0}),J=b.useRef(null),$=b.useRef(null),se=S.useState("toastIndex",r.id),re=S.useState("toastVisibleIndex",r.id),me=S.useState("toastOffsetY",r.id),pe=S.useState("focused"),be=S.useState("expanded");fs({open:r.transitionStatus!=="ending",ref:H,onComplete(){r.transitionStatus==="ending"&&S.removeToast(r.id)}});const Ce=ke((je=!1)=>{const le=H.current;if(!le)return;const ve=le.style.height;le.style.height="auto";const he=le.offsetHeight;le.style.height=ve;function ce(){S.updateToastInternal(r.id,{ref:H,height:he,transitionStatus:void 0})}je?oo.flushSync(ce):ce()});we(()=>{const je=ee.current;r.transitionStatus!=="starting"&&je===r.id||(je!==void 0&&(T(void 0),D({x:0,y:0,scale:1}),Me({x:0,y:0})),ee.current=r.id,Ce())},[Ce,r.id,r.transitionStatus]);function Me(je){V.current=je,j(je)}we(()=>()=>{$.current?.abort()},[]);function ye(je,le){const ve=xe=>xe>0?xe**l0:-(Math.abs(xe)**l0),he=je>0&&!y.includes("right")||je<0&&!y.includes("left"),ce=le>0&&!y.includes("down")||le<0&&!y.includes("up");return{x:he?ve(je):je,y:ce?ve(le):le}}const ge=ke(je=>{if(je.pointerId!==J.current)return;J.current=null,$.current?.abort(),$.current=null,A(!1),_(!1),M(null);const le=P.current;if(je.type==="pointercancel"||Z.current){Me({x:le.x,y:le.y}),T(void 0);return}const ve=V.current,he=ve.x-le.x,ce=ve.y-le.y;let xe;for(const He of y)if(th(He,he,ce)>i0){xe=He;break}xe?(T(xe),S.closeToast(r.id)):(Me({x:le.x,y:le.y}),T(void 0))});function Te(je){if(je.button!==0||(je.pointerType==="touch"&&S.pauseTimers(),zt(je.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${e_}`)))return;Z.current=!1,q.current=void 0,X.current=0,J.current=je.pointerId,K.current={x:je.clientX,y:je.clientY},W.current=K.current;const he=je.currentTarget,ce=Hj(he);P.current=ce,D(ce),Me({x:ce.x,y:ce.y}),S.set("hovering",!0),A(!0),_(!1),M(null),N.current=!0,$.current?.abort();const xe=new AbortController;$.current=xe;const He=We(he);He.addEventListener("pointerup",ge,{signal:xe.signal}),He.addEventListener("pointercancel",ge,{signal:xe.signal}),he.setPointerCapture?.(je.pointerId)}function Ae(je){if(je.pointerId!==J.current)return;je.preventDefault(),N.current&&(K.current={x:je.clientX,y:je.clientY},N.current=!1);const{clientY:le,clientX:ve,movementX:he,movementY:ce}=je;(ce<0&&le>W.current.y||ce>0&&le<W.current.y)&&(W.current={x:W.current.x,y:le}),(he<0&&ve>W.current.x||he>0&&ve<W.current.x)&&(W.current={x:ve,y:W.current.y});const xe=ve-K.current.x,He=le-K.current.y,Lt=le-W.current.y,Ft=ve-W.current.x;let ut=I;if(!C&&Math.sqrt(xe*xe+He*He)>=Jj){_(!0);const bt=y.includes("left")||y.includes("right"),jt=y.includes("up")||y.includes("down");if(bt&&jt){const Fe=Math.abs(xe),ft=Math.abs(He);ut=Fe>ft?"horizontal":"vertical",M(ut)}}let Oe;if(!q.current)ut==="vertical"?He>0?Oe="down":He<0&&(Oe="up"):ut==="horizontal"?xe>0?Oe="right":xe<0&&(Oe="left"):Math.abs(xe)>=Math.abs(He)?Oe=xe>0?"right":"left":Oe=He>0?"down":"up",Oe&&y.includes(Oe)&&(q.current=Oe,X.current=th(Oe,xe,He),T(Oe));else{const hn=q.current,bt=th(hn,Ft,Lt);bt>i0?(Z.current=!1,T(hn)):!(y.includes("left")&&y.includes("right"))&&!(y.includes("up")&&y.includes("down"))&&X.current-bt>=Zj&&(Z.current=!0)}const Ye=ye(xe,He);let Qe=P.current.x,ct=P.current.y;const Jt=y.includes("left")||y.includes("right"),rn=y.includes("up")||y.includes("down");ut!=="vertical"&&Jt&&(Qe+=Ye.x),ut!=="horizontal"&&rn&&(ct+=Ye.y),Me({x:Qe,y:ct})}function Ue(je){if(je.key==="Escape"){if(!H.current||!De(H.current,tn(We(H.current))))return;S.closeToast(r.id)}}b.useEffect(()=>{const je=H.current;if(!v||!je)return;function le(ve){J.current===null||!De(je,zt(ve))||ve.preventDefault()}return Ge(je,"touchmove",le,{passive:!1})},[v]);function Ee(){const je=k.x-z.x,le=k.y-z.y;return{transition:O?"none":void 0,transform:O?`translateX(${k.x}px) translateY(${k.y}px) scale(${z.scale})`:void 0,[Kj]:`${je}px`,[$j]:`${le}px`}}const Le=r.priority==="high",Se={role:Le?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":L,"aria-describedby":Y,"aria-hidden":Le&&!pe?!0:void 0,onPointerDown:v?Te:void 0,onPointerMove:v?Ae:void 0,onPointerUp:v?ge:void 0,onPointerCancel:v?ge:void 0,onKeyDown:Ue,inert:yl(r.limited),style:{...Ee(),[qj]:r.transitionStatus==="ending"?se:re,[Gj]:`${me}px`,[Xj]:r.height?`${r.height}px`:void 0}},Re=b.useMemo(()=>({toast:r,setTitleId:B,setDescriptionId:U,recalculateHeight:Ce,visibleIndex:re,expanded:be}),[r,B,U,Ce,re,be]),Ne={transitionStatus:r.transitionStatus,expanded:be,limited:r.limited||!1,type:r.type,swiping:O,swipeDirection:w},Ie=tt("div",o,{ref:[a,H],state:Ne,stateAttributesMapping:Qj,props:[Se,m]});return p.jsx(CT.Provider,{value:Re,children:Ie})}),n_=b.forwardRef(function(o,a){const{render:r,className:l,style:c,...d}=o,{visibleIndex:g,expanded:m,recalculateHeight:h}=pf(),y=b.useRef(null);we(()=>{h();const w=y.current;if(!w||typeof ResizeObserver!="function"||typeof MutationObserver!="function")return;const T=new ResizeObserver(()=>h(!0)),O=new MutationObserver(()=>h(!0));return T.observe(w),O.observe(w,{childList:!0,subtree:!0,characterData:!0}),()=>{T.disconnect(),O.disconnect()}},[h]);const v=g>0;return tt("div",o,{ref:[a,y],state:{expanded:m,behind:v},props:d})});function RT(t){return t==null||typeof t=="boolean"||t===""?!1:Array.isArray(t)?t.some(RT):!0}function OT(t){return b.isValidElement(t)&&RT(t.props.children)}function AT(t,o,a){const{toast:r,setTitleId:l,setDescriptionId:c}=pf(),d=a==="title"?l:c,g=o??(a==="title"?r.title:r.description);return{id:Gs(t),children:g,type:r.type,setId:d}}function NT(t,o,a){const r=OT(t);return we(()=>{if(r)return a(o),()=>{a(l=>l===o?void 0:l)}},[r,o,a]),r?t:null}const o_=b.forwardRef(function(o,a){const{render:r,className:l,style:c,id:d,children:g,...m}=o,{id:h,children:y,type:v,setId:S}=AT(d,g,"description"),T=tt("p",o,{ref:a,state:{type:v},props:{...m,id:h,children:y}});return NT(T,h,S)}),s_=b.forwardRef(function(o,a){const{render:r,className:l,style:c,id:d,children:g,...m}=o,{id:h,children:y,type:v,setId:S}=AT(d,g,"title"),T=tt("h2",o,{ref:a,state:{type:v},props:{...m,id:h,children:y}});return NT(T,h,S)}),a_=b.forwardRef(function(o,a){const{render:r,className:l,style:c,disabled:d,nativeButton:g=!0,...m}=o,h=df(),{toast:y,expanded:v}=pf(),[S,w]=b.useState(!1),{getButtonProps:T,buttonRef:O}=Co({disabled:d,native:g}),A={type:y.type};return tt("button",o,{ref:[a,O],state:A,props:[{"aria-hidden":!v&&!S,onClick(){h.closeToast(y.id)},onFocus(){w(!0)},onBlur(){w(!1)}},m,T]})}),r_=b.forwardRef(function(o,a){const{render:r,className:l,style:c,disabled:d,nativeButton:g=!0,...m}=o,{toast:h}=pf(),y=h.actionProps?.children??m.children,{getButtonProps:v,buttonRef:S}=Co({disabled:d,native:g}),w={type:h.type},T=tt("button",o,{ref:[a,S],state:w,props:[m,h.actionProps,v,{children:y}]});return OT(T)?T:null}),i_=b.forwardRef(function(o,a){return p.jsx(g1,{ref:a,...o})});function l_(){const t=df(),o=t.useState("toasts");return b.useMemo(()=>({toasts:o,add:t.addToast,close:t.closeToast,update:t.updateToast,promise:t.promiseToast}),[o,t])}function c_(){const t=new Set;function o(a){t.forEach(r=>r(a))}return{" subscribe":function(r){return t.add(r),()=>{t.delete(r)}},add(a){const r=a.id||ET("toast"),l={...a,id:r,transitionStatus:"starting"};return o({action:"add",options:l}),r},close(a){o({action:"close",options:{id:a}})},update(a,r){o({action:"update",options:{id:a,updates:r}})},promise(a,r){let l=a;return o({action:"promise",options:{...r,promise:a,setPromise(c){l=c}}}),l}}}function c0({icon:t,title:o,children:a}){return p.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-8 text-center text-fg-muted",children:[t?p.jsx("div",{className:"text-fg-subtle",children:t}):null,p.jsx("div",{className:"text-[15px] font-semibold text-fg",children:o}),a?p.jsx("div",{className:"max-w-sm",children:a}):null]})}const ka=c_();function u_(t){if(t.repeat||t.key!=="Enter"&&t.key!==" ")return;const o=t.currentTarget.closest("[data-toast]")??t.currentTarget,a=o.ownerDocument.defaultView;a&&xN(a,t.key,r=>r instanceof a.Node&&o.contains(r))}function f_(){const{toasts:t}=l_();return t.map(o=>p.jsxs(t_,{toast:o,"data-toast":"",className:"pointer-events-auto flex w-80 items-start gap-3 rounded-lg bg-surface p-3 text-fg shadow-popup transition-[opacity,transform] data-[starting-style]:translate-y-2 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",children:[p.jsxs(n_,{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[p.jsx(s_,{className:"text-[13px] font-semibold"}),p.jsx(o_,{className:"text-xs text-fg-muted"}),o.actionProps?p.jsx(r_,{className:"mt-1 self-start rounded px-2 py-0.5 text-xs font-medium text-accent hover:bg-hover"}):null]}),p.jsx(a_,{"aria-label":"Dismiss",onKeyDown:u_,className:"rounded p-0.5 text-fg-muted hover:bg-hover",children:p.jsx(Sl,{className:"size-3.5"})})]},o.id))}function d_({children:t}){return p.jsxs(Bj,{toastManager:ka,timeout:4e3,children:[t,p.jsx(i_,{children:p.jsx(Yj,{className:"pointer-events-none fixed bottom-4 right-4 z-[1100] flex flex-col gap-2",children:p.jsx(f_,{})})})]})}const p_=["a[href]","button","iframe","input","select","textarea","summary","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])","[tabindex]"].join(", "),h_="audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function m_(t){return!(t.tabIndex>=0||!t.hasAttribute("tabindex")&&t.matches(h_))||t.getAttribute("aria-hidden")==="true"||t.matches(":disabled")?!1:typeof t.checkVisibility!="function"||t.checkVisibility({visibilityProperty:!0})}function g_(t){return Array.from(t.querySelectorAll(p_)).filter(m_)}function y_(t){const o=a=>!/visible|hidden|clip/.test(a);return t.scrollWidth>t.clientWidth+1&&o(t.overflowX)||t.scrollHeight>t.clientHeight+1&&o(t.overflowY)}function b_(t){const[o,a]=b.useState(!1);return b.useLayoutEffect(()=>{const r=t.current,l=r?.ownerDocument.defaultView;if(!r||!l)return;const c=()=>{const y=l.getComputedStyle(r);a(y_({scrollWidth:r.scrollWidth,clientWidth:r.clientWidth,scrollHeight:r.scrollHeight,clientHeight:r.clientHeight,overflowX:y.overflowX,overflowY:y.overflowY}))};if(c(),typeof l.ResizeObserver!="function")return;const d=new l.ResizeObserver(c),g=new Set,m=y=>{if(y.nodeType!==1)return;const v=y;if(l.getComputedStyle(v).display==="contents"){v.childNodes.forEach(m);return}g.has(v)||(g.add(v),d.observe(v))};d.observe(r),r.childNodes.forEach(m);const h=new l.MutationObserver(y=>{for(const v of y)v.addedNodes.forEach(m);for(const v of g)r.contains(v)||(d.unobserve(v),g.delete(v));c()});return h.observe(r,{childList:!0,subtree:!0,characterData:!0}),()=>{d.disconnect(),h.disconnect()}},[t]),o}b.forwardRef(function({label:o,className:a,...r},l){const c=b.useRef(null),d=b.useCallback(w=>{c.current=w,typeof l=="function"?l(w):l&&(l.current=w)},[l]),g=b_(c),[m,h]=b.useState(!1),[y,v]=b.useState(null);b.useLayoutEffect(()=>{const w=c.current,T=w?.ownerDocument.defaultView;if(!g||!w||!T)return;const O=()=>{h(g_(w).length===0),v(w.closest('[role="dialog"], [role="alertdialog"]')?.getAttribute("aria-labelledby")??null)};O();const A=new T.MutationObserver(O);return A.observe(w,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex","disabled","hidden","href","contenteditable"]}),()=>A.disconnect()},[g]);const S=g&&m;return p.jsx("div",{ref:d,...S?{role:"group",tabIndex:0,"aria-labelledby":o===void 0?y??void 0:void 0,"aria-label":o??(y===null?"Panel content":void 0)}:{},className:lt(S&&"focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent",a),...r})});const v_={blur:{label:"Blur",unit:"px",min:0,max:200,step:1,identity:0,initial:4},brightness:{label:"Brightness",unit:"%",min:0,max:500,step:1,identity:100,initial:120},contrast:{label:"Contrast",unit:"%",min:0,max:500,step:1,identity:100,initial:120},grayscale:{label:"Grayscale",unit:"%",min:0,max:100,step:1,identity:0,initial:100},saturate:{label:"Saturate",unit:"%",min:0,max:500,step:1,identity:100,initial:150},"hue-rotate":{label:"Hue rotate",unit:"deg",min:-360,max:360,step:1,identity:0,initial:90},invert:{label:"Invert",unit:"%",min:0,max:100,step:1,identity:0,initial:100},sepia:{label:"Sepia",unit:"%",min:0,max:100,step:1,identity:0,initial:100},opacity:{label:"Opacity",unit:"%",min:0,max:100,step:1,identity:100,initial:50}};[...Object.keys(v_)];const x_={cancel:"Cancel",close:"Close",copy:"Copy",copied:"Copied",copyLink:"Copy link",loading:"Loading…",justNow:"just now",never:"never",agent:"Agent",delete:"Delete",rename:"Rename",duplicate:"Duplicate",copyName:"Name of the copy",documentTabs:"Document tabs",pin:"Pin",unpin:"Unpin",open:"Open",save:"Save",updated:"Updated {when}",pinned:"Pinned",unpinned:"Unpinned",duplicated:"Duplicated",couldNotPin:"Could not pin: {error}",couldNotUnpin:"Could not unpin: {error}",couldNotRename:"Could not rename: {error}",couldNotDuplicate:"Could not duplicate: {error}",couldNotDelete:"Could not delete: {error}",statusNone:"No session",statusWorking:"Working",statusIdle:"Idle",statusWaiting:"Waiting",statusOffline:"Offline",working:"{agent} is working…",artifactOptions:"Artifact options",artifactName:"Artifact name",comments:"Comments",doneCommenting:"Done commenting",openComment:"1 open comment",openComments:"{count} open comments",commentOptions:"Comment options",showAllComments:"Show all comments",hideComments:"Hide comments",share:"Share",sharedOnNetwork:"Shared with your network",onlyThisComputer:"Only this computer",ask:"Ask {agent}",hideAsk:"Hide",openHarnessSession:"Open the {harness} session",messageAgent:"Message {agent} about this artifact",switchArtifact:"Switch artifact",inThisSession:"In this session",recent:"Recent",allArtifacts:"All artifacts",export:"Export",openSession:"Open session",offline:"offline",versionHistory:"Version history",peopleHere:"Here now",peopleHereNames:"Here now: {names}",peopleMore:"+{count}",youOtherTab:"You, in another tab",yourOtherTab:"your other tab",follow:"Follow",stopFollow:"Stop",followName:"Follow {name}",stopFollowingName:"Stop following {name}",followingName:"Following {name}",followingYou:"Following you",followingToast:"Following {name}. Press Escape to stop.",stoppedFollowingLeft:"Stopped following: {name} left.",openInNewTab:"Open in new tab",refresh:"Refresh",storage:"Storage",inThisFolder:"{size} in this folder",copyPath:"Copy path",linkCopied:"Link copied",pathCopied:"Path copied",deleteTitle:'Delete "{title}"?',deleteBody:"It leaves your artifacts. Its folder stays where it is: {root}",shareTitle:"Share this artifact",peopleWithAccess:"People with access",joinedPeople:"People who joined",noneJoined:"Nobody has joined yet. Send someone a link below.",online:"Online",seenAgo:"Seen {when}",guestPaused:"Link off: no access until it is back on",changeRole:"Change {name}'s role",roleLinkOff:"Link off",remove:"Remove",removeGuest:"Remove {name}",removeTitle:"Remove {name}?",removeBody:"They lose access to this artifact. They can join again with a link.",you:"(you)",thisComputer:"This computer",owner:"Owner",generalAccess:"General access",onLan:"Anyone on your network with a link",onlyHereSub:"Nobody else can open the links.",onLanSub:"People on the same Wi-Fi or LAN open it with a link; the link sets their role.",onNetworkAt:"On this network at {addresses}",onTailnet:"Tailscale: {address}, for people on your tailnet from any network (copy it from a link's More menu)",noAddress:"This computer has no local network address.",whereOff:"Only this computer can open these links for now. Copying one opens this to your network.",inviteLinks:"Invite links",roleEditor:"Editor",roleCommenter:"Commenter",roleViewer:"Viewer",linkEditor:"Can edit",linkCommenter:"Can comment",linkViewer:"Can view",noteEditor:"Edit and comment",noteCommenter:"Comment, no edits",noteViewer:"Read only",linkOff:"Off: nobody can join with it",turnOn:"Turn on",more:"More",moreFor:"More: {role}",copyTailnet:"Copy Tailscale link",copyTailnetNote:"For people on your tailnet, off this network ({address})",turnOnLink:"Turn on link",turnOffLink:"Turn off link",turnOffNote:"Whoever joined with it loses access until it is back on",resetLink:"Reset link",resetNote:"A new address; whoever joined with the old one is removed",resetTitle:'Reset the "{role}" link?',resetBody:"The old link stops working and the people who joined with it lose access.",plainHttp:"This is plain HTTP: others on the network can read what passes. A link is the permission: whoever has it gets its role, so send it only to the people meant to have it, and reset a link that went further.",cannotShare:"{type} pages can't be shared on the network yet: only this computer opens it.",shareError:"Could not do that: {error}",shareNoAnswer:"The sharing settings did not load: the Open Artifact service is not answering. Try again in a moment.",sendingTitle:"Sending this to someone?",sendingBody:"Share the link instead of a file and they will always have the latest changes.",invitePeople:"Invite people",allLinksOff:"All the links are off. Invite people to turn one on.",joinsAs:"People who open this link join as {role}. Invite people to give another role.",standaloneShare:"Manage network sharing in the Open Artifact app or with the share CLI command.",onlyHereLink:"Only this computer can open the link.",nothingToExport:"Nothing to export yet.",exportOptions:"Asks for options first",archiveLabel:"Whole folder (.zip)",destinationDescription:"Asks {agent} to export it there",destinationRequestLabel:"Export to {label}",destinationSent:"Asked {agent} to export to {label}",archiveDescription:"Everything here, to back up or move",archiveStarted:"Downloading {name}",archiveHint:"The whole folder in one zip, to back up, move to another computer or send to someone. Unzip it and open it with the same type to carry on; share links and this computer's server state are left out.",archiveTooLarge:"The folder is over what a zip holds (4 GiB or 65,535 files): copy the folder itself instead.",archiveUnsupported:"{type} folders can't be zipped here: copy the folder itself instead.",archiveFailed:"Could not zip the folder: {error}",exportBusy:"Another export is running. Try {label} again in a moment.",exportUnsupported:"{label} can't be exported right now.",exportFailed:"Could not export {label}.",saving:"Saving…",reconnecting:"Reconnecting…",notSaved:"Not saved",notSavedTitle:"The page could not save its last changes.",saveRetry:"Couldn't save — retry",readOnly:"Read-only",readOnlyTitle:"Nothing can be saved here",leaveLosesWork:"Leave? Changes that are not saved yet will be lost.",actionSaveNow:"Save now",actionOpenFind:"Find",actionUndo:"Undo",actionRedo:"Redo",actionEditPage:"Edit page",actionUsePage:"Use this page",actionCommentSelection:"Comment on selection",actionOpenPageList:"Pages",actionHandOffCode:"Hand off to code",whyOlderVersion:"You are viewing an older version",whyAgentWorking:"{agent} is working",whyDraftOpen:"Close the open draft first",whyCommentsOn:"Turn off comment mode first",whyNeedsAgent:"Needs an agent session",whyUnsaved:"Save first",whyOther:"Not available right now",noOwner:"No session owns this artifact",noOwnerNote:"What you send waits for the next session that works on it.",ownerNote:"Messages go to the {harness} session that made this artifact.",agentIdle:"{agent} is idle",agentWaiting:"{agent} is waiting",sessionOffline:"The session is offline",offlineNote:"{agent} sees what you send the next time the {harness} session works.",askPlaceholder:"What should change?",sendToAgent:"Send to {agent}",sendToConversation:"Put in the {agent} conversation",sending:"Sending…",sent:"Sent.",sentInbox:"{agent} will see it the next time the session works.",sentDrafted:"It is in the {agent} conversation now: send it there.",notDelivered:"Not delivered.",notSent:"Not sent: {error}",viaDelivered:"delivered",viaDrafted:"in the conversation, for you to send",viaInbox:"waiting for the session",viaFailed:"not delivered",askCloudOnline:"{agent} is connected: it gets this now.",askCloudOffline:"{agent} will get this when its computer is back online.",askCloudMcp:"{agent} will see this the next time it works on the artifact.",askCloudNone:"No agent is connected to this site for you. Connect a computer or an MCP client; the request waits until then.",askCloudNoneOther:"The owner has no agent connected to this site. The request waits until they connect one.",sentCloudDelivered:"Delivered: {agent} has it now.",sentCloudOffline:"Sent. {agent} will get it when its computer is back online.",sentCloudMcp:"Sent. {agent} will see it the next time it works on the artifact.",sentCloudNone:"Sent. It waits until an agent is connected.",viaWaitingAgent:"waiting for the agent",statusConnected:"Connected",statusNoAgent:"No agent",emptyTitle:"This artifact is empty",emptyBody:"Nothing of {type} has been written to {root} yet. An agent writes it: send it this.",startSession:"Start a session with {agent}",promptCopied:"Copied: paste it into any agent session that has the Artifact tool.",sentToSession:"Sent to a new session.",problemTitle:"This artifact cannot open here",noPage:"No page.",readOnlyNewer:"Read-only here: {type} {release} wrote this artifact and this computer has {version}. Update Open Artifact (open-artifact runtime update, or update the app it came with) to edit it.",folder:"Folder: {root}",askToLook:"Ask {agent} to look",problemAsk:"The artifact page could not open: {problem}",noBoot:"No artifact to show. Open one from the home page.",tryAgain:"Try again",bootFailed:"The page did not open: {error}",frameNotOpen:"The page is not open any more (its server may have restarted), and opening it again did not work.",frameNotGranted:"This page is not open to you here any more.",homeTitle:"Open Artifact",homeSub:"The artifacts and types every agent on this computer shares.",artifacts:"Artifacts",types:"Types",newArtifact:"New artifact",moreActions:"More actions",backToSession:"Back to session",noArtifacts:"No artifacts yet. Ask an agent to make one with the Artifact tool, or start one here.",pageOpen:"Open now",typeMissing:"Type not installed",deleted:'Deleted "{title}". Its folder stays.',undo:"Undo",restored:"Restored",couldNotRestore:"Could not restore: {error}",couldNotLoad:"Could not load: {error}",typeRoots:"Type roots: {roots}",noTypes:"No types found.",disabled:"Disabled",shadowedBy:"Overridden by {root}",newOf:"New {type}",create:"Create",title:"Title",folderOptional:"Folder (optional)",folderHint:"Default: a new folder in the home workspace",needTitle:"Give it a title first.",couldNotCreate:"Could not create it: {error}",renameArtifact:"Rename artifact",cannotCreateYet:"Only Design artifacts can be made here for now.",cannotShareCloud:"{type} artifacts can't be shared here yet.",signIn:"Sign in",signOut:"Sign out",signOutFailed:"Could not sign out: {error}",accountOf:"Account: {name}",sharedWithOthers:"Shared with others",addPeople:"Add people",addPeoplePlaceholder:"Email, or @domain for everyone there",add:"Add",addInvalid:"Not an email address or @domain: {entries}",roleFor:"Role for the people you add",memberPending:"Invited: has not signed in yet",memberDomain:"Everyone at {domain}",memberGroup:"Group",removeAccess:"Remove access",removeMemberBody:"They lose access to this artifact. You can add them again.",noMembers:"Nobody else is added yet.",accessRestricted:"Restricted",accessRestrictedSub:"Only the people added here can open it.",accessLink:"Anyone with the link",accessLinkSub:"Whoever has one of the links below gets its role.",accessPublic:"Public",accessPublicSub:"Anyone can open it as a viewer; the links below give more.",shareSettings:"Settings",viewersCanExport:"Viewers can download and export",editorsCanAsk:"Editors can ask {agent}",ownedBy:"Owned by {name}",yourRole:"Your role: {role}",onlyOwnerShares:"Only the owner can change who has access.",emptyBodyCloud:"Nothing of {type} has been written yet. An agent writes it: send it this.",homeSubCloud:"Your artifacts and the ones shared with you.",noArtifactsCloud:"No artifacts yet. Publish one from an agent with the Artifact tool, or ask someone to share one with you.",pubTitle:"Publish to the web",pubIntro:"Give it a web address that works even when this computer is off. You choose who can open it there.",pubDataNote:"Publishing this dashboard publishes its data too: this computer runs its live queries and puts the rows on the site, where everyone who can open it sees them.",pubDataPending:"Its live data isn’t on the site yet: the page there shows no figures until you publish the data.",pubDataConfirm:"Publish its data",pubDataAsOf:"Data on the site as of {time}, refreshed from this computer.",pubDataNone:"Its data is published; the first rows are on their way.",pubDataFailed:"The last refresh failed: {reason}",pubDataRefresh:"Refresh now",pubDataRefreshing:"Refreshing…",pubDataStop:"Stop publishing data",pubDataStopTitle:"Stop publishing its data?",pubDataStopBody:"The rows are removed from {host} and this computer stops refreshing them. The dashboard stays published there, with no figures until you publish its data again.",pubConnectSite:"Connect a site…",pubConnectAnother:"Connect another site…",pubAddress:"Site address",pubAddressPlaceholder:"https://artifacts.example.com",pubAddressHint:"The web address of an Open Artifact site you have an account on.",pubName:"Name",pubNameHint:"A short name to tell your sites apart, like work.",pubConnect:"Connect",pubConnecting:"Connecting…",pubCodeTitle:"Approve this computer on {host}",pubCodeBody:"Check that the page shows this code, then approve.",pubCodeOpened:"The approval page opened in your browser. If you don’t see it, open it here:",pubOpenApproval:"Open approval page",pubWaitingApproval:"Waiting for you to approve…",pubConnected:"Connected to {host} as {name}.",pubTryAgain:"Try again",pubSignedInAs:"Signed in as {name}",pubStateConnected:"Connected",pubStateConnecting:"Connecting…",pubStateUnreachable:"Can't be reached",pubStateSignedOut:"Signed out",pubPublish:"Publish",pubPublishing:"Publishing…",pubReconnect:"Connect again",pubPublishedAt:"Published on {host}",pubOpen:"Open",pubManage:"Who can open it is set on its web page: open it and use Share there.",pubManageLink:"Manage access on the web",pubOpensThere:"Opening it on this computer now takes you to its web address while the site can be reached.",pubUnpublish:"Unpublish",pubUnpublishing:"Unpublishing…",unpubTitle:"Unpublish this artifact?",unpubBody:"The web copy goes to the trash on {host} and its web address stops working. This folder stays on this computer, with the latest changes from the web.",pubInSync:"Up to date",pubInSyncAt:"Up to date · synced {when}",pubWaitingOne:"1 change waiting to be sent",pubWaiting:"{count} changes waiting to be sent",pubOffline:"Can't reach {host}: changes are kept here and sent when it is back.",pubSignedOutSync:"Signed out of {host}: changes are kept here. Connect again to send them.",pubSyncFailed:"The last sync failed: {error}",pubCloudMark:"Published to the web",pubCloudAt:"Published at {url}",pubHostEmpty:"Type the site’s address.",pubHostInvalid:"That is not a web address. Type it like https://artifacts.example.com.",pubHostNotHttps:"The address must start with https:// (plain http only works for this computer or a private network, like 192.168.1.20, nas.lan or 192-168-1-20.nip.io).",pubInsecureWarning:"Plain http: what you publish travels unencrypted. Use it only on a network you trust.",pubAutoSwitch:"Publish new artifacts automatically",pubAutoHint:"Artifacts created from now on go to {host} by themselves. Earlier ones stay as they are.",pubAutoNoSite:"Choose a default site to publish to.",pubDefaultSite:"Default site",pubDefaultMark:"default",pubAutoPublishing:"Being published to {host} automatically…",pubAutoSignedOut:"Waiting to be published to {host}: this computer is not signed in there yet.",pubAutoUnreachable:"Waiting to be published: can't reach {host}. It is tried again by itself.",pubAutoFailed:"Not published to {host} yet: {error} It is tried again by itself.",pubApprovalTitle:"Approve this computer on {host}",pubApprovalBody:"This computer was set up to publish to {host}. Open the approval page, check that it shows this code, and approve.",pubCloudSettingsFailed:"Could not change the setting: {error}",pubNameInvalid:"Use letters, digits, - and _ (up to 32), like work.",pubNameTaken:"That name is already used for another site. Choose another name.",pubNoDaemon:"Open Artifact on this computer did not answer. Check that it is running, then try again.",pubConnectDenied:"The connection was refused on {host}. Try again if that was a mistake.",pubConnectExpired:"The code ran out before it was approved. Try again and approve within a few minutes.",pubConnectUnreachable:"Can't reach {host}. Check the address and your connection, then try again.",pubConnectNotHost:"{host} does not look like an Open Artifact site. Check the address.",pubConnectFailed:"Could not connect: {error}",pubIdTaken:"{host} already has an artifact with this one’s id that is still published there (maybe from another computer) or is someone else’s. Unpublish it there first (one you unpublished is replaced when you publish again), or duplicate this artifact and publish the copy.",pubAlreadyElsewhere:"It is already published to another site. Unpublish it there first.",pubTooLarge:"It is too large for {host}. Remove big files from its folder, then try again.",pubSignedOut:"You are signed out of {host}. Connect again, then try again.",pubNotAllowed:"{host} did not allow it: your account there may not be able to publish.",pubUnreachable:"Can't reach {host} right now. Try again once it is back.",pubUnsupported:"{host} cannot take this kind of artifact yet.",pubFailed:"Could not publish: {error}",unpubUnreachable:"Can't reach {host} to bring its latest version here first. Try again once it is back.",unpubFailed:"Could not unpublish: {error}",openOnWeb:"Open on the web",copyWebLink:"Copy web link",webLinkCopied:"Web link copied",signOutAccess:"Sign out, here and of your organisation’s sign-in",upload:"Upload",uploadHint:"Upload an artifact: the .zip from “Whole folder (.zip)” in its Export tab.",uploadDrop:"Drop the .zip to upload it",uploadSending:"Uploading {name}… {percent}%",uploadSendingSize:"Uploading {name}…",uploadChecking:"Checking {name}…",uploadOpening:"Uploaded {name}. Opening it…",uploadNotZip:"That file is not a .zip. Use “Whole folder (.zip)” from an artifact’s Export tab.",uploadNotArtifact:"That zip is not an Open Artifact folder. Use “Whole folder (.zip)” from an artifact’s Export tab.",uploadTooLargeLimit:"That zip is too large: this site takes up to {limit}. Remove big files from the folder, then try again.",uploadTooLarge:"That zip is too large for this site. Remove big files from the folder, then try again.",uploadTooLargeSaid:"That zip is too large for this site: {error} Remove big files from the folder, then try again.",uploadSignedOut:"You are signed out. Sign in again, then upload it.",uploadNotAllowed:"This site does not let you upload artifacts.",uploadConflict:"Something on the site got in the way. Try again.",uploadTypeMissing:"This site cannot open {type} artifacts yet.",uploadBusy:"Too many tries at once. Wait a moment, then try again.",uploadNoAnswer:"The site did not answer. Check your connection, then try again.",uploadFailed:"Could not upload it: {error}",dismiss:"Dismiss",trash:"Trash",trashEmpty:"The trash is empty.",trashNote:"Nobody it was shared with can open an artifact while it is in the trash.",trashedWhen:"Moved to the trash {when}",trashKeptDays:"Deleted for good after {days} days in the trash.",trashKeptOneDay:"Deleted for good after 1 day in the trash.",trashKeptForever:"Kept here until you delete it forever.",restore:"Restore",restoredTitle:'Restored "{title}"',deleteForever:"Delete forever",purgeTitle:'Delete "{title}" forever?',purgeBody:"This cannot be undone. It is removed from this site, and everyone it was shared with loses access to it.",purged:'Deleted "{title}" forever',purgeNotTrashed:"It is not in the trash any more.",purgeGone:"It is already gone.",couldNotPurge:"Could not delete it: {error}",moveToTrash:"Move to trash",movedToTrash:'Moved "{title}" to the trash.',shareOnNetwork:"Share on this network instead",shareOnNetworkSub:"Links from here open this computer’s copy, not the web page."},S_={cancel:"取消",close:"关闭",copy:"复制",copied:"已复制",copyLink:"复制链接",loading:"加载中…",justNow:"刚刚",never:"从未",agent:"Agent",delete:"删除",rename:"重命名",duplicate:"复制一份",copyName:"副本名称",documentTabs:"文档标签页",pin:"置顶",unpin:"取消置顶",open:"打开",save:"保存",updated:"更新于 {when}",pinned:"已置顶",unpinned:"已取消置顶",duplicated:"已复制一份",couldNotPin:"没能置顶:{error}",couldNotUnpin:"没能取消置顶:{error}",couldNotRename:"没能重命名:{error}",couldNotDuplicate:"没能复制:{error}",couldNotDelete:"没能删除:{error}",statusNone:"无会话",statusWorking:"工作中",statusIdle:"空闲",statusWaiting:"等待中",statusOffline:"离线",working:"{agent} 正在工作…",artifactOptions:"作品选项",artifactName:"作品名",comments:"评论",doneCommenting:"结束评论",openComment:"1 条未解决的评论",openComments:"{count} 条未解决的评论",commentOptions:"评论选项",showAllComments:"显示全部评论",hideComments:"隐藏评论",share:"分享",sharedOnNetwork:"已分享到局域网",onlyThisComputer:"仅这台电脑",ask:"问 {agent}",hideAsk:"收起",openHarnessSession:"打开 {harness} 会话",messageAgent:"就这个作品给 {agent} 发消息",switchArtifact:"切换作品",inThisSession:"这个会话里的",recent:"最近",allArtifacts:"所有作品",export:"导出",openSession:"打开会话",offline:"离线",versionHistory:"版本历史",peopleHere:"正在查看",peopleHereNames:"正在查看:{names}",youOtherTab:"你(另一个标签页)",yourOtherTab:"你的另一个标签页",follow:"跟随",stopFollow:"停止",followName:"跟随 {name}",stopFollowingName:"停止跟随 {name}",followingName:"正在跟随 {name}",followingYou:"正在跟随你",followingToast:"正在跟随 {name},按 Esc 停止。",stoppedFollowingLeft:"{name} 已离开,停止跟随。",openInNewTab:"在新标签页打开",refresh:"刷新",storage:"存储",inThisFolder:"这个文件夹 {size}",copyPath:"复制路径",linkCopied:"链接已复制",pathCopied:"路径已复制",deleteTitle:"删除「{title}」?",deleteBody:"它会移出作品列表,文件夹保留在原处:{root}",shareTitle:"分享这份内容",peopleWithAccess:"有权访问的人",joinedPeople:"加入的人",noneJoined:"还没有人加入。把下面的链接发给对方。",online:"在线",seenAgo:"{when}来过",guestPaused:"链接已关闭,暂时无法访问",changeRole:"更改「{name}」的角色",roleLinkOff:"链接已关闭",remove:"移出",removeGuest:"移出 {name}",removeTitle:"移出「{name}」?",removeBody:"对方将无法再访问这份内容,之后仍可以用链接重新加入。",you:"(你)",thisComputer:"这台电脑",owner:"所有者",generalAccess:"一般访问权限",onLan:"同一网络里有链接的人",onlyHereSub:"别人打不开这些链接。",onLanSub:"同一 Wi-Fi 或局域网里的人用链接打开,链接决定角色。",onNetworkAt:"在这个网络上:{addresses}",onTailnet:"Tailscale:{address},同一 tailnet 的人在别的网络也能打开(复制在链接的「更多」里)",noAddress:"这台电脑没有局域网地址。",whereOff:"现在只有这台电脑能打开这些链接。复制链接会顺手分享到局域网。",inviteLinks:"邀请链接",roleEditor:"编辑者",roleCommenter:"评论者",roleViewer:"查看者",linkEditor:"可编辑",linkCommenter:"可评论",linkViewer:"可查看",noteEditor:"编辑和评论",noteCommenter:"只能评论",noteViewer:"只读",linkOff:"已关闭:没人能用它加入",turnOn:"开启",more:"更多",moreFor:"更多:{role}",copyTailnet:"复制 Tailscale 链接",copyTailnetNote:"给同一 tailnet 里不在这个网络的人({address})",turnOnLink:"开启链接",turnOffLink:"关闭链接",turnOffNote:"用它加入的人暂时无法访问",resetLink:"重置链接",resetNote:"换一个新地址,用旧链接加入的人会被移出",resetTitle:"重置「{role}」链接?",resetBody:"旧链接会失效,通过它加入的人也会失去访问权限。",plainHttp:"这是明文 HTTP:同一网络的人能看到传输内容。链接就是权限:拿到链接的人就有对应角色,只发给该有的人;传出去了就重置链接。",cannotShare:"{type} 的页面暂时不能分享到网络:只有这台电脑能打开。",shareError:"没做成:{error}",shareNoAnswer:"分享设置没有加载出来:Open Artifact 服务没有响应,稍后再试。",sendingTitle:"要发给别人?",sendingBody:"发链接而不是文件,对方看到的总是最新版本。",invitePeople:"邀请别人",allLinksOff:"所有链接都关着。去邀请页打开一条。",joinsAs:"用这条链接打开的人以{role}身份加入。要给别的角色,去邀请页。",standaloneShare:"可在 Open Artifact 应用或 CLI 的 share 命令中管理网络分享。",onlyHereLink:"只有这台电脑能打开这个链接。",nothingToExport:"还没有可导出的内容。",exportOptions:"会先询问导出选项",archiveLabel:"整个文件夹(.zip)",destinationDescription:"请 {agent} 导出到这里",destinationRequestLabel:"导出到 {label}",destinationSent:"已请 {agent} 导出到 {label}",archiveDescription:"这里的全部内容,用来备份或搬走",archiveStarted:"开始下载 {name}",archiveHint:"整个文件夹打成了一个 zip,可以备份、换电脑或发给别人。解压后用同一个类型打开就能接着用;分享链接和这台电脑上的服务器状态不在里面。",archiveTooLarge:"文件夹超过了 zip 的上限(4 GiB 或 65535 个文件),请直接复制文件夹。",archiveUnsupported:"{type} 的文件夹在这里打不了包,请直接复制文件夹。",archiveFailed:"没能打包:{error}",exportBusy:"另一个导出正在进行,请稍后再导出 {label}。",exportUnsupported:"现在无法导出 {label}。",exportFailed:"无法导出 {label}。",saving:"正在保存…",reconnecting:"正在重新连接…",notSaved:"未保存",notSavedTitle:"页面没能保存最近的修改。",saveRetry:"保存失败,点击重试",readOnly:"只读",readOnlyTitle:"这里的内容无法保存",leaveLosesWork:"确定离开?尚未保存的修改会丢失。",actionSaveNow:"立即保存",actionOpenFind:"查找",actionUndo:"撤销",actionRedo:"重做",actionEditPage:"编辑页面",actionUsePage:"使用这个页面",actionCommentSelection:"评论选中内容",actionOpenPageList:"页面列表",actionHandOffCode:"交给代码处理",whyOlderVersion:"你正在查看旧版本",whyAgentWorking:"{agent} 正在工作",whyDraftOpen:"请先关闭打开的草稿",whyCommentsOn:"请先退出评论模式",whyNeedsAgent:"需要一个智能体会话",whyUnsaved:"请先保存",whyOther:"暂时不可用",noOwner:"没有会话拥有这个作品",noOwnerNote:"发出的消息会等下一个处理它的会话。",ownerNote:"消息会发给做这个作品的 {harness} 会话。",agentIdle:"{agent} 空闲",agentWaiting:"{agent} 在等待",sessionOffline:"会话离线",offlineNote:"{harness} 会话下次工作时,{agent} 会看到你发的消息。",askPlaceholder:"想改什么?",sendToAgent:"发给 {agent}",sendToConversation:"放进 {agent} 的对话",sending:"发送中…",sent:"已发送。",sentInbox:"会话下次工作时 {agent} 会看到。",sentDrafted:"已放进 {agent} 的对话:到那里发出去。",notDelivered:"没送达。",notSent:"没发出去:{error}",viaDelivered:"已送达",viaDrafted:"在对话里,等你发出",viaInbox:"等会话处理",viaFailed:"没送达",askCloudOnline:"{agent} 已连接:它现在就会收到。",askCloudOffline:"{agent} 所在的电脑重新上线后,它会收到。",askCloudMcp:"{agent} 下次处理这个作品时会看到。",askCloudNone:"这个站点上还没有连接你的 Agent。连接一台电脑或一个 MCP 客户端;在那之前,请求会一直等着。",askCloudNoneOther:"所有者还没有在这个站点上连接 Agent。请求会等到他们连接为止。",sentCloudDelivered:"已送达:{agent} 现在就收到了。",sentCloudOffline:"已发送。{agent} 所在的电脑重新上线后,它会收到。",sentCloudMcp:"已发送。{agent} 下次处理这个作品时会看到。",sentCloudNone:"已发送。会等到有 Agent 连接为止。",viaWaitingAgent:"等 Agent 接收",statusConnected:"已连接",statusNoAgent:"无 Agent",emptyTitle:"这个作品还是空的",emptyBody:"{root} 里还没有写入 {type} 的内容。由 Agent 来写:把下面这段发给它。",startSession:"和 {agent} 开个新会话",promptCopied:"已复制:粘贴到任意装了 Artifact 工具的 Agent 会话里。",sentToSession:"已发到新会话。",problemTitle:"这个作品在这里打不开",noPage:"没有页面。",readOnlyNewer:"在这里只读:这个作品由 {type} {release} 写入,这台电脑上是 {version}。更新 Open Artifact(open-artifact runtime update,或更新附带它的应用)后才能编辑。",folder:"文件夹:{root}",askToLook:"让 {agent} 看看",problemAsk:"作品页打不开:{problem}",noBoot:"没有要显示的作品。从主页打开一个。",tryAgain:"重试",bootFailed:"页面没有打开:{error}",frameNotOpen:"页面已经不在打开状态(它的服务可能重启过),重新打开也没成功。",frameNotGranted:"这个页面在这里已经不对你开放了。",homeTitle:"Open Artifact",homeSub:"本机所有 Agent 共用的作品和类型。",artifacts:"作品",types:"类型",newArtifact:"新建作品",moreActions:"更多操作",backToSession:"回到会话",noArtifacts:"还没有作品。让 Agent 用 Artifact 工具创建一个,或者在这里新建。",pageOpen:"已打开",typeMissing:"类型没有安装",deleted:"已删除「{title}」,文件夹保留。",undo:"撤销",restored:"已恢复",couldNotRestore:"没能恢复:{error}",couldNotLoad:"读取失败:{error}",typeRoots:"类型根目录:{roots}",noTypes:"没有找到类型。",disabled:"已停用",shadowedBy:"被 {root} 覆盖",newOf:"新建 {type}",create:"创建",title:"标题",folderOptional:"文件夹(可不填)",folderHint:"默认:主工作区里新建一个文件夹",needTitle:"先写个标题。",couldNotCreate:"没建成:{error}",renameArtifact:"重命名作品",cannotCreateYet:"目前这里只能新建 Design 作品。",cannotShareCloud:"{type} 作品暂时不能在这里分享。",signIn:"登录",signOut:"退出登录",signOutFailed:"没能退出登录:{error}",accountOf:"账号:{name}",sharedWithOthers:"已分享给他人",addPeople:"添加成员",addPeoplePlaceholder:"邮箱,或 @域名(该域名下所有人)",add:"添加",addInvalid:"不是邮箱地址或 @域名:{entries}",roleFor:"新加成员的角色",memberPending:"已邀请,还没登录过",memberDomain:"{domain} 的所有人",memberGroup:"群组",removeAccess:"移除访问权限",removeMemberBody:"对方将无法再访问这份内容,之后可以再加回来。",noMembers:"还没有添加其他人。",accessRestricted:"受限",accessRestrictedSub:"只有这里添加的人能打开。",accessLink:"知道链接的任何人",accessLinkSub:"拿到下面某条链接的人获得对应角色。",accessPublic:"公开",accessPublicSub:"任何人都能以查看者身份打开;下面的链接可以给更多权限。",shareSettings:"设置",viewersCanExport:"查看者可以下载和导出",editorsCanAsk:"编辑者可以向 {agent} 提需求",ownedBy:"所有者:{name}",yourRole:"你的角色:{role}",onlyOwnerShares:"只有所有者能更改谁可以访问。",emptyBodyCloud:"还没有写入任何 {type} 内容。由 Agent 来写:把下面这段发给它。",homeSubCloud:"你的作品,以及别人分享给你的。",noArtifactsCloud:"还没有作品。让 Agent 用 Artifact 工具发布一个,或者请别人分享给你。",pubTitle:"发布到网上",pubIntro:"给它一个网址,这台电脑关机也能打开。在那边由你决定谁能打开。",pubDataNote:"发布这个仪表盘也会发布它的数据:这台电脑运行它的实时查询,把结果放到站点上,能打开它的人都看得到。",pubDataPending:"它的实时数据还没上站点:在你发布数据之前,那边的页面没有数字。",pubDataConfirm:"发布它的数据",pubDataAsOf:"站点上的数据截至 {time},由这台电脑刷新。",pubDataNone:"它的数据已发布,第一批结果正在上传。",pubDataFailed:"上次刷新失败:{reason}",pubDataRefresh:"现在刷新",pubDataRefreshing:"正在刷新…",pubDataStop:"停止发布数据",pubDataStopTitle:"停止发布它的数据?",pubDataStopBody:"数据会从 {host} 上删掉,这台电脑也不再刷新它们。仪表盘仍发布在那里,只是在你再次发布数据之前没有数字。",pubConnectSite:"连接一个站点…",pubConnectAnother:"再连接一个站点…",pubAddress:"站点地址",pubAddressPlaceholder:"https://artifacts.example.com",pubAddressHint:"你有账号的 Open Artifact 站点的网址。",pubName:"名称",pubNameHint:"用来区分不同站点的简短名字,比如 work。",pubConnect:"连接",pubConnecting:"正在连接…",pubCodeTitle:"在 {host} 上批准这台电脑",pubCodeBody:"确认页面上显示的是这个代码,然后点批准。",pubCodeOpened:"已在浏览器里打开批准页面。没看到的话,从这里打开:",pubOpenApproval:"打开批准页面",pubWaitingApproval:"等你批准…",pubConnected:"已连接到 {host},账号 {name}。",pubTryAgain:"重试",pubSignedInAs:"账号:{name}",pubStateConnected:"已连接",pubStateConnecting:"正在连接…",pubStateUnreachable:"连不上",pubStateSignedOut:"已退出登录",pubPublish:"发布",pubPublishing:"正在发布…",pubReconnect:"重新连接",pubPublishedAt:"已发布到 {host}",pubOpen:"打开",pubManage:"谁能打开,在它的网页上设置:打开后点那里的“分享”。",pubManageLink:"到网上管理访问权限",pubOpensThere:"站点连得上时,在这台电脑上打开它会直接跳到网址。",pubUnpublish:"取消发布",pubUnpublishing:"正在取消发布…",unpubTitle:"取消发布这份内容?",unpubBody:"网上那份会移到 {host} 的回收站,网址随之失效。这个文件夹留在这台电脑上,并带上网上的最新改动。",pubInSync:"已同步",pubInSyncAt:"已同步 · {when}",pubWaitingOne:"有 1 处改动等待发送",pubWaiting:"有 {count} 处改动等待发送",pubOffline:"连不上 {host}:改动先保存在这里,恢复后自动发送。",pubSignedOutSync:"已退出 {host} 的登录:改动先保存在这里,重新连接后发送。",pubSyncFailed:"上次同步失败:{error}",pubCloudMark:"已发布到网上",pubCloudAt:"已发布:{url}",pubHostEmpty:"请填写站点地址。",pubHostInvalid:"这不是网址。请按 https://artifacts.example.com 这样填写。",pubHostNotHttps:"地址必须以 https:// 开头(http 只能用于本机或内网地址,比如 192.168.1.20、nas.lan、192-168-1-20.nip.io)。",pubInsecureWarning:"这是明文 http:发布的内容不加密传输。只在你信任的网络里使用。",pubAutoSwitch:"自动发布新建的作品",pubAutoHint:"从现在起新建的作品会自动发布到 {host},之前的保持不变。",pubAutoNoSite:"先选一个默认站点。",pubDefaultSite:"默认站点",pubDefaultMark:"默认",pubAutoPublishing:"正在自动发布到 {host}…",pubAutoSignedOut:"等待发布到 {host}:这台电脑还没在那边登录。",pubAutoUnreachable:"等待发布:连不上 {host},稍后会自动重试。",pubAutoFailed:"还没发布到 {host}:{error} 稍后会自动重试。",pubApprovalTitle:"在 {host} 上批准这台电脑",pubApprovalBody:"这台电脑已设置为发布到 {host}。打开批准页面,确认显示的是这个代码,然后批准。",pubCloudSettingsFailed:"没能修改设置:{error}",pubNameInvalid:"只能用字母、数字、- 和 _(最多 32 个),比如 work。",pubNameTaken:"这个名称已经用于另一个站点,换一个名称。",pubNoDaemon:"这台电脑上的 Open Artifact 没有响应。确认它在运行后再试。",pubConnectDenied:"{host} 拒绝了这次连接。如果是误操作,再试一次。",pubConnectExpired:"代码在批准前过期了。请重试,并在几分钟内批准。",pubConnectUnreachable:"连不上 {host}。检查地址和网络后再试。",pubConnectNotHost:"{host} 看起来不是 Open Artifact 站点,请检查地址。",pubConnectFailed:"连接失败:{error}",pubIdTaken:"{host} 上已经有一份同样 id 的作品,它仍在那边发布着(可能是从另一台电脑发布的),或者属于别人。先在那边取消发布(你取消发布过的作品,再次发布时会被替换),或者复制这份作品后发布副本。",pubAlreadyElsewhere:"它已经发布到另一个站点了,先在那边取消发布。",pubTooLarge:"它对 {host} 来说太大了。把文件夹里的大文件移走后再试。",pubSignedOut:"你已退出 {host} 的登录。重新连接后再试。",pubNotAllowed:"{host} 不允许这样做:你在那边的账号可能没有发布权限。",pubUnreachable:"暂时连不上 {host},恢复后再试。",pubUnsupported:"{host} 暂时不支持这类作品。",pubFailed:"发布失败:{error}",unpubUnreachable:"连不上 {host},没法先把网上的最新版本取回来。恢复后再试。",unpubFailed:"取消发布失败:{error}",openOnWeb:"在网上打开",copyWebLink:"复制网址",webLinkCopied:"网址已复制",signOutAccess:"退出登录(同时退出组织的统一登录)",upload:"上传",uploadHint:"上传一个作品:在它的“导出”里选“整个文件夹(.zip)”得到的 .zip。",uploadDrop:"松开即可上传这个 .zip",uploadSending:"正在上传 {name}… {percent}%",uploadSendingSize:"正在上传 {name}…",uploadChecking:"正在检查 {name}…",uploadOpening:"{name} 已上传,正在打开…",uploadNotZip:"这不是 .zip 文件。请在作品的“导出”里选“整个文件夹(.zip)”。",uploadNotArtifact:"这个 zip 不是 Open Artifact 作品文件夹。请在作品的“导出”里选“整个文件夹(.zip)”。",uploadTooLargeLimit:"这个 zip 太大了:这个站点最多接收 {limit}。把文件夹里的大文件删掉后再试。",uploadTooLarge:"这个 zip 对这个站点来说太大了。把文件夹里的大文件删掉后再试。",uploadTooLargeSaid:"这个 zip 对这个站点来说太大了:{error} 把文件夹里的大文件删掉后再试。",uploadSignedOut:"你已退出登录。重新登录后再上传。",uploadNotAllowed:"这个站点不允许你上传作品。",uploadConflict:"站点那边出了点冲突,再试一次。",uploadTypeMissing:"这个站点暂时打不开 {type} 作品。",uploadBusy:"尝试太频繁了,稍等一会儿再试。",uploadNoAnswer:"站点没有响应。检查网络后再试。",uploadFailed:"没能上传:{error}",dismiss:"关闭",trash:"回收站",trashEmpty:"回收站是空的。",trashNote:"作品在回收站里时,分享过的人都打不开它。",trashedWhen:"{when}移到回收站",trashKeptDays:"在回收站里放满 {days} 天后会被永久删除。",trashKeptOneDay:"在回收站里放满 1 天后会被永久删除。",trashKeptForever:"会一直留在这里,直到你永久删除。",restore:"恢复",restoredTitle:"已恢复「{title}」",deleteForever:"永久删除",purgeTitle:"永久删除「{title}」?",purgeBody:"删除后无法撤销。它会从这个站点上移除,分享过的人也都无法再打开。",purged:"已永久删除「{title}」",purgeNotTrashed:"它已经不在回收站里了。",purgeGone:"它已经不存在了。",couldNotPurge:"没能删除:{error}",moveToTrash:"移到回收站",movedToTrash:"已把「{title}」移到回收站。",shareOnNetwork:"改为在本地网络里分享",shareOnNetworkSub:"这里的链接打开的是这台电脑上的副本,不是网页版。"};function w_(t){return t&&/^zh\b/i.test(t)?"zh-CN":"en"}const Fm=w_(typeof navigator>"u"?void 0:navigator.language);function T_(t,o){return o?t.replace(/\{(\w+)\}/g,(a,r)=>r in o?String(o[r]):a):t}function E_(t,o,a){return T_((t==="zh-CN"?S_[o]:void 0)??x_[o],a)}function E(t,o){return E_(Fm,t,o)}const C_=/^art_[0-9a-z]{10,40}$/;function R_(t){if(typeof t!="string")return null;const o=/^open-artifact:\/\/artifact\/([^/?#]+)/.exec(t.trim()),a=o?o[1]:t.trim();return C_.test(a)?a:null}const an={artifacts:"artifacts",artifact:"artifact",types:"types",harnesses:"harnesses",events:"events",share:"artifact.share",archive:"artifact.archive",thumbnail:"artifacts.thumbnail",restore:"artifacts.restore",open:"artifacts.open",boot:"artifacts.boot",preview:"artifacts.preview",create:"artifacts.create",update:"artifacts.update",duplicate:"artifacts.duplicate",delete:"artifacts.delete",ask:"artifacts.ask",adopt:"artifacts.adopt",tools:"tools",embed:"embed",view:"view"},O_="[Artifact comment sent to agent]",A_="[Artifact edit request sent to agent]",N_="[Artifact task finished]",k_="open-artifact-shell",xa={shell:"open_artifact_shell",id:"open_artifact_id",comment:"comment",panel:"panel"},Ma=/^#slide-(?:~[A-Za-z0-9_-]{1,64}(?:\.only(?:\.[0-9]{1,4}\.[0-9]{1,4})?)?|[0-9]{1,4})$/,M_="#view-inline",hf=/^#[0-9a-f]{8}-[0-9a-f]{4}(?:\.[^\s#]{1,500})?$/,j_=["not_open","not_granted"],kT=1e4,__=["saved","actions","formats","shareNotice","peers"],MT=/^[A-Za-z0-9_.:-]{1,128}$/,D_=24,z_=["text/plain","text/html","image/png","image/svg+xml"],L_=/^[A-Za-z0-9_-]{1,64}$/,P_=64*1024*1024,I_=1,H_=/^[a-z][a-z0-9]{0,23}$/,u0="not run: the artifact was updated",U_=1,B_=8,V_=8e3,f0="oa_view",F_=(t,o=V_)=>typeof t=="string"?t.slice(0,o):"",zi=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function Y_(t){if(!zi(t))return null;if(t.openArtifact==="goto"){const r=F_(t.hash,2e3);return r?{openArtifact:"goto",hash:r}:null}if(t.openArtifact!=="host_hello")return null;const o=zi(t.caps)?t.caps:{},a={openArtifact:"host_hello",caps:{...o.sessions===!0?{sessions:!0}:{},...o.toolbar===!0?{toolbar:!0}:{},...o.artifacts===!0?{artifacts:!0}:{}}};if(typeof t.agentName=="string"&&t.agentName.trim()&&(a.agentName=t.agentName.trim().slice(0,80)),typeof t.harness=="string"&&t.harness&&(a.harness=t.harness.slice(0,64)),Number.isInteger(t.protocol)&&(a.protocol=t.protocol),zi(t.theme)&&(t.theme.scheme==="light"||t.theme.scheme==="dark")&&(a.theme={scheme:t.theme.scheme,...typeof t.theme.accent=="string"&&/^#[0-9a-f]{6}$/i.test(t.theme.accent)?{accent:t.theme.accent}:{}}),Array.isArray(t.destinations)&&(a.destinations=t.destinations.filter(r=>zi(r)&&typeof r.id=="string"&&!!r.id&&typeof r.label=="string"&&!!r.label.trim()).slice(0,B_).map(r=>({id:r.id.slice(0,64),label:r.label.trim().slice(0,80)}))),zi(t.library)){const r={};typeof t.library.harness=="string"&&t.library.harness&&(r.harness=t.library.harness.slice(0,64)),typeof t.library.workspace=="string"&&t.library.workspace&&(r.workspace=t.library.workspace.slice(0,4096)),(r.harness||r.workspace)&&(a.library=r)}return a}function jT(t){return!!t&&typeof t=="object"&&typeof t.openArtifact=="string"}const q_=["quickstart","list","publish","read","open","call","adopt","delete","share"],G_=["get","list","query","set","update","delete","str_replace","batch"],X_=["read","reply","resolve","reopen","wait"],K_=["share","export"],$_={type:"object",properties:{action:{type:"string",enum:q_,description:"What to do. Omitted: publish."},intent:{type:"string",description:"quickstart: what is being made (design, design-system, slides, whiteboard, document, data, sheets, motion, other), or a few words about it."},scope:{type:"string",enum:["types","mine","all"],description:"list: the installed types, this session's and this workspace's artifacts (default), or every artifact."},type:{type:"string",description:"list: only artifacts of this type (an id, or open-artifact://type/<id>). quickstart: the type already chosen (an id), to get its create call and steps without matching."},query:{type:"string",description:"list: only artifacts whose title contains this text."},limit:{type:"integer",description:"list: how many to return (default 50, at most 200)."},cursor:{type:"string",description:"list: the next_cursor of the previous page."},type_url:{type:"string",description:"publish without url: the type to create from (open-artifact://type/<id>, from quickstart). read without url: the type to describe."},title:{type:"string",description:"publish without url: the new artifact's name. quickstart: the name it will have, to find similar ones."},folder:{type:"string",description:"publish without url, or adopt: where the artifact's folder goes (absolute, or relative to the workspace). Default <workspace>/artifacts/<slug>."},url:{type:"string",description:"An artifact: open-artifact://artifact/<id>, as publish returned it."},files:{type:"object",additionalProperties:!0,description:'publish with url: files to write under the artifact root, as {"rel/path": "text"} or {"rel/path": {"content": "...", "encoding": "base64"}}; null deletes.'},if_match:{type:"object",additionalProperties:!0,description:'publish with url: {"rel/path": sha256 | null | "*"}. Write only while the file still has the sha256 you read, does not exist (null), or anyway ("*"). One mismatch writes nothing and returns the current versions.'},check:{type:"boolean",description:"publish with url: run the type's check action after writing; its result comes back as check."},open:{type:"string",enum:["after_first_write","now","never"],description:"publish without url: after_first_write (the default) opens the page in your app once your first write lands; now opens it at once; never leaves it closed. Where your app cannot show pages by itself the result says so: open view_url in your app's built-in browser, if you have one."},related:{type:"boolean",description:"quickstart: list existing artifacts the recommended type can build on, such as design systems (default true)."},path:{type:"string",description:"read: one file or folder under the root (omitted: the record and the file list)."},paths:{type:"array",items:{type:"string"},description:"read: several files under the root at once."},name:{type:"string",description:"call: the action's name (check, upload, ...; read with url lists them)."},args:{type:"object",additionalProperties:!0,description:"call: the action's arguments. upload: {file: absolute path, name?, group?}."},panel:{type:"string",enum:K_,description:"open: also open the page's Share panel (share), for the person to share it on the network, or its Export tab (export), for them to download a file."},cloud:{type:"string",description:"share: publish the artifact to this cloud remote (its name, as `open-artifact remote list` shows it). It works only on a remote the person set up and let agents publish to (agentMayPublish); otherwise the person publishes it, from the Share panel or with `open-artifact publish <id> --remote <name>`."}}},W_={type:"object",properties:{action:{type:"string",enum:G_},url:{type:"string",description:"The artifact (open-artifact://artifact/<id>)."},collection:{type:"string"},doc_id:{type:"string"},path:{type:"string",description:"collection/doc_id, instead of the two."},data:{type:"object",additionalProperties:!0,description:"set / update: the document's fields."},file_path:{type:"string",description:"set / update: a JSON file holding the fields, instead of data."},if_match:{description:'set / update / delete / str_replace: the sha256 get returned (write only if unchanged), null (only if it does not exist) or "*" (replace whatever is there).'},field:{type:"string",description:"str_replace: the text field, as a dot path (body, notes.text)."},old:{type:"string",description:"str_replace: the passage to replace; it must occur exactly once."},new:{type:"string",description:"str_replace: the passage that replaces it."},where:{type:"array",items:{type:"object",additionalProperties:!0},description:"query: [{field, op, value}], all must hold. op: ==, !=, <, <=, >, >=, in, not-in (up to 30 values), array-contains."},order_by:{type:"object",additionalProperties:!0,description:'query: {field, dir: "asc" | "desc"}.'},limit:{type:"integer",description:"list / query: how many documents (default 100, at most 1000)."},cursor:{type:"string",description:"list / query: the next_cursor of the previous page."},out_file:{type:"string",description:"get / list / query: write the result to this JSON file (absolute, or relative to the workspace) and return only its path and counts."},writes:{type:"array",items:{type:"object",additionalProperties:!0},description:"batch: [{op: set|update|delete|str_replace, path | collection+doc_id, data | file_path, if_match?, field?, old?, new?}], at most 500."}},required:["action","url"]},Q_={type:"object",properties:{action:{type:"string",enum:X_},url:{type:"string",description:"The artifact (open-artifact://artifact/<id>). wait: optional."},thread_id:{type:"string",description:'reply / resolve / reopen: the thread (after ";thread=" in the message).'},text:{type:"string",description:"reply: the answer."},resolve:{type:"boolean",description:"reply: resolve the thread too."},all:{type:"boolean",description:"read: resolved threads too."},since:{type:"string",description:"read: only threads with a message at or after this time (ISO 8601)."},acknowledge_duplicate:{type:"boolean",description:"reply: send the same text as your last reply in this thread again, on purpose."},timeout_ms:{type:"number",description:"wait: how long (default 600000)."}},required:["action"]},d0={Artifact:$_,ArtifactData:W_,ArtifactComments:Q_},Z_={Artifact:["Make and change artifacts: typed folders of files that open as live pages the person can view, edit, comment on and export. Actions:","- quickstart {intent, type?}: call first for a new artifact; recommends a type (or takes the one given) and returns the call that creates it, the steps for this app and similar artifacts that already exist.",'- list {scope: "mine" | "all" | "types", type?, query?}: find existing artifacts, or the installed types.',"- publish {type_url, title, folder?, open?}: create an artifact; the result carries its root folder and the type's instructions. publish {url, files, if_match?, check?}: write files when you have no file tools of your own.","- read {url, path? | paths?}: the artifact's record, files and actions, or some of its files with their sha256. read {type_url}: a type's instructions, before creating.",`- open {url, panel?}: show it to the person in the computer's browser (or the app, when it shows pages), once its content is written. When your app has a built-in browser, open view_url there instead. panel "share" or "export" opens its Share panel or Export tab for them.`,"- call {url, name, args?}: run one of the type's actions (check, upload, ...). A long one answers {task, pending: true}; its result comes later as a message.","- adopt {url | folder}: take over an artifact, or add an existing folder. Only when the person asks.","- share {url}: whether it is shared on the local network, and its links. Only the person changes that, in the page's Share panel.","- delete {url}: forget an artifact; its folder stays. Only when the person asks."].join(`
|
|
10
10
|
`),ArtifactData:'Read and write the document store of an artifact whose type keeps one (its instructions say so). get, list and query read documents with their sha256; set, update, delete, str_replace and batch write them. update merges fields, and {"__delete__": true} removes one; str_replace changes one passage of a long text field. Replacing or deleting an existing document needs if_match: the sha256 you read, or "*". Your writes show live on open pages.',ArtifactComments:`Comments the person leaves on their artifact's page, kept in the artifact's own folder on this computer (no outside service). read lists the threads; reply answers one (thread_id is after ";thread=" in the message), with resolve: true when it is done; resolve and reopen change a thread's state. A thread sent to you is the person asking for your answer in it, so replying there is what they asked for. Answer only threads sent to you, in one or two lines. wait blocks until the next message for this session: use it only when nothing else can wake you.`},p0={Artifact:{title:"Artifact",openWorldHint:!1},ArtifactData:{title:"Artifact data",openWorldHint:!1},ArtifactComments:{title:"Artifact comments",destructiveHint:!1,openWorldHint:!1}},J_={Artifact:{quickstart:"read",list:"read",read:"read",publish:"write",call:"write",open:"ui",delete:"remove",adopt:"remove",share:"person"},ArtifactData:{get:"read",list:"read",query:"read",set:"write",update:"write",str_replace:"write",batch:"write",delete:"write"},ArtifactComments:{read:"read",wait:"read",reply:"write",resolve:"write",reopen:"write"}},eD={Artifact:["publish","open","call","share"],ArtifactData:["get","list","query","set","update","str_replace","batch","delete"],ArtifactComments:["read","reply","resolve","reopen"]};function tD(t={any:!1,actions:!1}){return Object.keys(d0).map(o=>{const a=o==="Artifact"?t.any:t.actions;return{name:o,description:Z_[o],inputSchema:d0[o],annotations:a?{...p0[o],openWorldHint:!0}:p0[o],actions:J_[o],remoteActions:[...eD[o]]}})}tD();const nD=300,oD=12,h0=["Artifact","ArtifactData","ArtifactComments"];function Vs(t,o=nD){const a=String(t??"").replace(/[<>]/g,"").replace(/\s+/g," ").trim();return a.length>o?`${a.slice(0,o-1).trimEnd()}…`:a}function sD(t){const o=Vs(t,Number.MAX_SAFE_INTEGER),a=o.search(/[.!?。!?](\s|$)/);return a>=0?o.slice(0,a+1):o}function aD(t){const o=Vs(t,24);return/^[a-z0-9]{1,5}$/i.test(o)?o.toUpperCase():o}const m0=t=>!t||/[.!?。!?…]$/.test(t)?t:`${t}.`;function rD(t,o=!1){const a=Vs(t.title,80)||t.id;if(o)return`- ${t.id}: ${a}`;const r=Vs(t.when)||Vs(sD(t.description)),l=(t.exports??[]).map(aD).filter(Boolean),c=[m0(a),m0(r),l.length?`Exports: ${l.join(", ")}.`:""].filter(Boolean);return`- ${t.id}: ${c.join(" ")}`}const iD="Open Artifact lets you make artifacts: typed folders of files (a slide deck, a design canvas, a whiteboard, a data dashboard, a spreadsheet, a doc, an animated motion piece and more) that open as live pages the person can view, edit, comment on and export. You make and change them with the Artifact, ArtifactData and ArtifactComments tools.",lD=`<where_output_goes>
|
|
11
11
|
Decide where your output will live before you make anything.
|
|
12
12
|
- Something the person will read once and move on from (an answer, an explanation, a summary, a short report) goes in your reply, however long it is. A diagram or chart that explains your answer goes in the reply too, when you can show one there.
|
|
@@ -40,4 +40,4 @@ Messages that start with "${O_}" or "${A_}" carry what a person typed into an ar
|
|
|
40
40
|
`)}function hD(t){const o=[...t].filter(a=>Vs(a.offer)).sort((a,r)=>a.id.localeCompare(r.id));return o.length?["<offers>","You may end a reply with one short offer to put the work into an artifact, at most once per conversation, and never in a reply that already made or changed one:",...o.map(a=>`- ${a.id}: ${Vs(a.offer)}`),"</offers>"].join(`
|
|
41
41
|
`):null}function mD(t={}){const o=t.types&&t.offer!==!1?hD(t.types):null;return["<open_artifact>",[iD,dD(t.toolNames)].filter(Boolean).join(`
|
|
42
42
|
`),"",lD,"",cD,"",uD,"",fD,"",t.types?pD(t.types):'Call Artifact {action: "quickstart"} to see the installed artifact types.',...o?["",o]:[],"</open_artifact>"].filter(r=>r!==null).join(`
|
|
43
|
-
`)}mD();function gD(t){let o=t.trim();if(!o||/[\s/?#@\\%]/.test(o))return null;!o.startsWith("[")&&(o.match(/:/g)?.length??0)>=2&&(o=`[${o}]`);let a;try{a=new URL(`http://${o}/`).hostname}catch{return null}return a.replace(/^\[(.*)\]$/,"$1")}function _T(t){const o=/^(0|[1-9]\d{0,2})\.(0|[1-9]\d{0,2})\.(0|[1-9]\d{0,2})\.(0|[1-9]\d{0,2})$/.exec(t);if(!o)return null;const a=o.slice(1).map(Number);return a.every(r=>r<=255)?a:null}function _h([t,o]){return t===127?"loopback":t===10||t===172&&o>=16&&o<=31||t===192&&o===168||t===169&&o===254?"private":"refused"}function yD(t){if(!/^[0-9a-f:]+$/.test(t))return null;const o=t.split("::");if(o.length>2)return null;const a=c=>c?c.split(":").map(d=>/^[0-9a-f]{1,4}$/.test(d)?Number.parseInt(d,16):Number.NaN):[],r=a(o[0]),l=o.length===2?a(o[1]):[];return[...r,...l].some(c=>Number.isNaN(c))||(o.length===1?r.length!==8:r.length+l.length>7)?null:[...r,...new Array(8-r.length-l.length).fill(0),...l]}function bD(t){const[o,a,r,l,c,d,g,m]=t;return o===0&&a===0&&r===0&&l===0&&c===0?d===0&&g===0&&m===1?"loopback":d===65535?_h([g>>8,g&255,m>>8,m&255]):"refused":(o&65024)===64512||(o&65472)===65152?"private":"refused"}const vD=["nip.io","sslip.io"],xD=[".local",".lan",".home.arpa",".internal"],SD=/(?:^|[.-])0\d/;function wD(t){const o=vD.find(g=>t.endsWith(`.${g}`));if(!o)return null;const a=t.slice(0,-(o.length+1)).split(".");if(a.some(g=>g.includes("--")))return null;const r=[],l=[],c=g=>{for(let m=0;m+4<=g.length;m++){const h=g.slice(m,m+4).join(".");if(SD.test(h))return!1;const y=_T(h);y&&r.push(y)}return!0};let d=[];for(const g of[...a,""])if(/^\d+$/.test(g))d.push(g);else{if(!c(d))return null;d=[]}for(const g of a){const m=g.split("-");let h=[];for(const v of[...m,""])if(/^\d+$/.test(v))h.push(v);else{if(!c(h))return null;h=[]}const y=/^[0-9a-f]{8}$/.test(m.at(-1)??"")?m.at(-1):null;if(y){const v=Number.parseInt(y,16);l.push([v>>>24,v>>>16&255,v>>>8&255,v&255])}}return r.length?[...r,...l]:[]}function g0(t){const o=gD(t);if(!o)return"refused";const a=_T(o);if(a)return _h(a);if(o.includes(":")){const g=yD(o);return g?bD(g):"refused"}const r=o.endsWith("."),l=r?o.slice(0,-1):o,c=l.split(".");if(c.some(g=>!g))return"refused";if(l==="localhost"||l.endsWith(".localhost"))return"loopback";if(c.length===1)return r?"refused":"private";if(xD.some(g=>l.endsWith(g)))return"private";const d=wD(l);return d?.length&&d.every(g=>_h(g)!=="refused")?"private":"refused"}const y0="__OPEN_ARTIFACT_BOOT_PREFETCH__",TD="__OPEN_ARTIFACT_WATCHDOG__",b0="__OPEN_ARTIFACT_VITALS__",ED="/api/open-artifact.artifacts.boot",CD=3e4,RD={skeleton:"oa-preboot",error:"oa-preboot-error"},OD="data-oa-preboot-bar",AD=["oa:preboot","oa:boot","oa:frame-src","oa:frame-load","oa:frame-ready"];function ND(t,o=!1){return`${ED}?${new URLSearchParams(o?{id:t,fresh:"1"}:{id:t})}`}function kD(t,o){try{const a=t.performance;a&&typeof a.mark=="function"&&!a.getEntriesByName(o,"mark").length&&a.mark(o)}catch{}}function MD(t){const o={};try{for(const a of AD){const r=t?.getEntriesByName(a,"mark")[0];r&&(o[a]=Math.round(r.startTime*10)/10)}}catch{}return Object.freeze(o)}function jD(t){try{if(Object.getOwnPropertyDescriptor(t,b0))return;Object.defineProperty(t,b0,{configurable:!0,enumerable:!1,get:()=>MD(t.performance)})}catch{}}function _D(t){try{for(const o of t?.getAnimations?.()??[])o.startTime=0}catch{}}function DD(t,o){const a=t,r=a[y0];return r?(delete a[y0],r.url===ND(o)&&r.res&&typeof r.res.then=="function"?r:null):null}function zD(t){try{t[TD]?.disarm();for(const o of Object.values(RD))t.document.getElementById(o)?.remove();t.document.documentElement?.removeAttribute(OD)}catch{}}function LD(){const t=typeof navigator>"u"?void 0:navigator.locks;return!t||typeof BroadcastChannel>"u"||typeof EventSource>"u"?null:{openSource:o=>new EventSource(o),openChannel:o=>new BroadcastChannel(o),locks:t}}function PD(t,o){const a=`open-artifact.events ${t}`,r=new Set;let l=null,c=null,d=null;const g=y=>{for(const v of[...r])try{v(y)}catch{}},m=()=>{l=o.openChannel(a),l.onmessage=v=>{typeof v.data=="string"&&g(v.data)};const y=new AbortController;c=y,o.locks.request(a,{signal:y.signal},async()=>{if(y.signal.aborted)return;const v=o.openSource(t);v.onmessage=S=>{g(S.data),l?.postMessage(S.data)},await new Promise(S=>d=S),v.close()}).catch(()=>{})},h=()=>{c?.abort(),c=null,d?.(),d=null,l?.close(),l=null};return{listen(y){return r.add(y),r.size===1&&m(),()=>{r.delete(y)&&(r.size||h())}}}}const v0=new Map;function ID(t,o){let a=v0.get(t);return a||(a=PD(t,o),v0.set(t,a)),a}class ja extends Error{code;status;fix;constructor(o,a,r,l){super(a),this.name="ApiError",this.code=o,this.status=r,this.fix=l}}async function HD(t){try{const o=await t.json();return o&&typeof o=="object"?o:{}}catch{return{}}}const UD=15e3;async function DT(t){const o=await HD(t);if(!t.ok){const a=typeof o.code=="string"?o.code:"error",r=typeof o.message=="string"?o.message:`HTTP ${t.status}`;throw new ja(a,r,t.status,typeof o.fix=="string"?o.fix:void 0)}return o}function BD(t={}){const o=(t.base??"").replace(/\/$/,""),a=t.fetch??((c,d)=>fetch(c,d)),r=(c,d)=>`${o}/api/open-artifact.${c}${d?`?${new URLSearchParams(d)}`:""}`;async function l(c,d={}){const g=d.body===void 0?{cache:"no-store"}:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d.body)};d.body===void 0&&typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function"&&(g.signal=AbortSignal.timeout(d.timeoutMs??UD));let m;try{m=await a(r(c,d.query),g)}catch(h){throw new ja("connect_failed",h instanceof Error?h.message:String(h),0)}return DT(m)}return{async artifacts(){const c=await l(an.artifacts);return Array.isArray(c.artifacts)?c.artifacts:[]},artifact:c=>l(an.artifact,{query:{id:c}}),async types(){const c=await l(an.types);return{roots:Array.isArray(c.roots)?c.roots:[],types:Array.isArray(c.types)?c.types:[]}},share:c=>l(an.share,{query:{id:c}}),setShare:c=>l(an.share,{body:c}),create:c=>l(an.create,{body:c}),update:c=>l(an.update,{body:c}),duplicate:(c,d)=>l(an.duplicate,{body:{id:c,...d&&{name:d}}}),remove:c=>l(an.delete,{body:{id:c}}),restore:c=>l(an.restore,{body:{id:c}}),async trashed(){const c=await l(an.artifacts,{query:{trashed:"1"}});return Array.isArray(c.artifacts)?c.artifacts:[]},purge:c=>l("artifacts.purge",{body:{id:c}}),ask:c=>l(an.ask,{body:c}),open:c=>l(an.open,{body:{id:c,host:!1}}),boot:(c,d)=>l(an.boot,{query:d?.fresh?{id:c,fresh:"1"}:{id:c},timeoutMs:CD}),async remotes(){const c=await l("remotes"),d=c.cloud&&typeof c.cloud=="object"&&Array.isArray(c.cloud.pending)?c.cloud:null;return{remotes:Array.isArray(c.remotes)?c.remotes:[],cloud:d}},cloudSettings:c=>l("cloud.settings",{body:c}),connect:(c,d)=>l("remotes.add",{body:{name:c,host:d,browse:!1}}),connectCancel:c=>l("remotes.add.cancel",{body:{name:c}}),connectWait:(c,d)=>l("remotes.add.wait",{body:{name:c,ms:d}}),publish:(c,d,g={})=>l("artifacts.publish",{body:{id:c,remote:d,...g.data?{data:!0}:{}}}),unpublish:c=>l("artifacts.unpublish",{body:{id:c}}),dataPublish:(c,d={})=>l("artifacts.data",{body:{id:c,...d}}),eventsUrl:r(an.events),archiveUrl:c=>r(an.archive,{id:c}),typeIconUrl:c=>r("type.icon",{id:c})}}const Ct=BD();function Bn(t){return t instanceof Error?t.message:String(t)}const VD=new Set(["artifacts/changed","types/changed","harness/changed","wake/state"]);function FD(t){try{const o=JSON.parse(t);if(!o||typeof o!="object")return null;const a=o.type;return typeof a=="string"&&VD.has(a)?o:null}catch{return null}}function YD(t,o={}){const a=o.url??Ct.eventsUrl,r=g=>{const m=FD(g);m&&t(m)},l=o.shared!==void 0?o.shared:o.EventSource?null:LD();if(l)return ID(a,l).listen(r);const c=o.EventSource??(typeof EventSource>"u"?null:EventSource);if(!c)return()=>{};let d;try{d=new c(a)}catch{return()=>{}}return d.onmessage=g=>r(g.data),()=>d.close()}function wl(t,o=Date.now(),a=Fm){if(!t)return"";const r=Date.parse(t);if(!Number.isFinite(r))return"";const l=Math.max(0,(o-r)/1e3);if(l<60)return E("justNow");const c=new Intl.RelativeTimeFormat(a,{numeric:"auto"});return l<3600?c.format(-Math.round(l/60),"minute"):l<86400?c.format(-Math.round(l/3600),"hour"):l<86400*30?c.format(-Math.round(l/86400),"day"):new Date(r).toLocaleDateString(a)}function x0(t){if(typeof t!="number"||!Number.isFinite(t))return"";if(t<1024)return`${t} B`;const o=["KB","MB","GB","TB"];let a=t/1024,r=0;for(;a>=1024&&r<o.length-1;)a/=1024,r++;return`${a<10?a.toFixed(1):Math.round(a)} ${o[r]}`}function Ym(t){const o=String(t??"").trim();if(!o)return"?";if(/^[-ヿ㐀-鿿가-]/.test(o))return[...o][0];const a=o.split(/\s+/);return((a[0]?.[0]??"")+(a[1]?.[0]??"")).toUpperCase()||"?"}const S0=["#0f766e","#4f46e5","#b45309","#7c3aed","#be185d","#0369a1","#4d7c0f","#9f1239"];function qm(t){let o=0;for(const a of t)o=o*31+a.charCodeAt(0)|0;return S0[Math.abs(o)%S0.length]}function w0(t){return/folder/i.test(t)?"folder":/pdf/i.test(t)?"pdf":/word|docx/i.test(t)?"document":/powerpoint|pptx|slides/i.test(t)?"slides":/excel|xlsx|csv|spreadsheet/i.test(t)?"spreadsheet":/png|jpe?g|image|svg/i.test(t)?"image":/html|web page/i.test(t)?"html":/video|mp4|gif/i.test(t)?"video":/markdown|text|\.md\b/i.test(t)?"text":"file"}async function mf(t){try{await navigator.clipboard.writeText(t)}catch{const o=document.createElement("textarea");o.value=t,o.style.position="fixed",o.style.opacity="0",document.body.append(o),o.select(),document.execCommand("copy"),o.remove()}}function qD(t){if(!t)return"";const o=/filename\*\s*=\s*(?:UTF-8|utf-8)''([^;]+)/.exec(t);if(o)try{return decodeURIComponent(o[1].trim())}catch{}const a=/filename\s*=\s*"([^"]*)"|filename\s*=\s*([^;]+)/.exec(t);return(a?.[1]??a?.[2]??"").trim()}function zT(t){return!!t?.cloud}function nh(t){return typeof t!="string"||t.length===0||t.length>2048||/[\u0000-\u001f\u007f]/.test(t)?!1:t.startsWith("/")?!t.startsWith("//")&&!t.includes("\\"):/^https?:\/\//i.test(t)}function T0(t,o){if(typeof t!="string")return null;const a=t.trim();return a.length>0&&a.length<=o?a:null}function LT(t){if(!t||typeof t!="object")return;const o=t,a=[];if(Array.isArray(o.links))for(const l of o.links){if(!l||typeof l!="object")continue;const{label:c,href:d,where:g}=l,m=T0(c,80);m&&nh(d)&&(g==="account-menu"||g==="home")&&a.push({label:m,href:d,where:g})}let r;if(o.brand&&typeof o.brand=="object"){const{name:l,logoUrl:c}=o.brand,d=T0(l,80);(d||nh(c))&&(r={...d?{name:d}:{},...nh(c)?{logoUrl:c}:{}})}if(!(a.length===0&&!r))return{...a.length>0?{links:a}:{},...r?{brand:r}:{}}}function GD(t,o){return(LT(t)?.links??[]).filter(a=>a.where===o).map(({label:a,href:r})=>({label:a,href:r}))}function XD(t,o){if(t.startsWith("/"))return!1;try{return new URL(t).origin!==o}catch{return!0}}function Tl(t){return t?.cloud?.role??t?.typeServer?.role??"owner"}function KD(t){return t==="owner"||t==="editor"}function PT(t){return t!=="viewer"}function $D(t,o){return t==="owner"?!0:t==="editor"&&(o?.editorsCanAskAgent??!0)}function IT(t,o){return t!=="viewer"||!!o?.viewersCanExport}function WD(t,o){const a={agent:t.name};switch(t.state){case"online":return{key:"askCloudOnline",vars:a};case"offline":return{key:"askCloudOffline",vars:a};case"mcp":return{key:"askCloudMcp",vars:a};case"none":return{key:o?"askCloudNone":"askCloudNoneOther"}}}function QD(t,o){const a={agent:o.name};return t==="delivered"?{key:"sentCloudDelivered",vars:a}:o.state==="mcp"?{key:"sentCloudMcp",vars:a}:o.state==="offline"||o.state==="online"?{key:"sentCloudOffline",vars:a}:{key:"sentCloudNone"}}function ZD(t){return!t||t.state==="none"?"none":t.state==="online"?"idle":"offline"}function JD(t,o,a){let r;try{r=new URL(t,a)}catch{return t}return!r.searchParams.has("return_to")&&o.startsWith("/")&&!o.startsWith("//")&&r.searchParams.set("return_to",o),r.origin===a?`${r.pathname}${r.search}${r.hash}`:r.href}function HT(t){if(!t||typeof t!="object")return null;const o=t.accessLogoutUrl;if(typeof o!="string")return null;try{const a=new URL(o);return a.protocol==="https:"||a.protocol==="http:"?a.href:null}catch{return null}}function ez(t){if(!t||typeof t!="object")return!1;if(UT(t))return!0;const o=t.providers;return Array.isArray(o)&&o.some(a=>!!a&&typeof a=="object"&&a.id==="cloudflare-access")}function UT(t){return HT(t)}const tz=/^[^\s@,;<>()"]+@([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)$/i,nz=/^@([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)$/i;function oz(t){const o=t.trim().replace(/^<|>$/g,"").toLowerCase();if(nz.test(o)){const a=o.slice(1);return{id:`domain:${a}`,kind:"domain",label:`@${a}`}}return tz.test(o)?{id:`email:${o}`,kind:"email",label:o}:null}function sz(t){const o=[],a=[],r=new Set;for(const l of t.split(/[\s,;]+/)){if(!l)continue;const c=oz(l);c?r.has(c.id)||(r.add(c.id),o.push(c)):a.push(l)}return{members:o,invalid:a}}function az(t){const o=t.indexOf(":");if(o<=0||o===t.length-1)return null;const a=t.slice(0,o),r=t.slice(o+1);return a==="group"?r.includes(":")&&!r.startsWith(":")&&!r.endsWith(":")?{kind:a,value:r}:null:a==="user"||a==="email"||a==="domain"?{kind:a,value:r}:null}function rz(t,o){return{members:Object.fromEntries(t.map(a=>[a.id,o]))}}function E0(t,o){return{members:{[t]:o}}}function iz(t){return{access:t}}function C0(t,o){return{settings:{[t]:o}}}function lz(t){return t!=="restricted"}function cz(t){return t.access!=="restricted"||t.members.length>0}function uz(t,o){const a=t.cloud;if(!a)return t;let r=a.members;for(const[c,d]of Object.entries(o.members??{}))if(d===null)r=r.filter(g=>g.id!==c);else if(r.some(g=>g.id===c))r=r.map(g=>g.id===c?{...g,role:d}:g);else{const g=az(c);if(!g||g.kind!=="email"&&g.kind!=="domain")continue;r=[...r,{id:c,kind:g.kind,label:g.kind==="domain"?`@${g.value}`:g.value,role:d,pending:g.kind==="email"}]}const l={...t.links};for(const[c,d]of Object.entries(o.links??{})){const g=l[c];g&&(l[c]={...g,on:d})}return{...t,links:l,cloud:{...a,members:r,access:o.access??a.access,settings:{...a.settings,...o.settings}}}}function fz(t,o){return!o||!o.length?"undeclared":o.includes(t)?"declared":"refused"}function BT(t,o,a,r="frame"){const l=Y_(t);return!l||l.openArtifact!=="host_hello"?null:{origin:o,caps:l.caps,agentName:l.agentName??null,declared:a,via:r,theme:l.theme??null,destinations:a?l.destinations??[]:[]}}function dz(t,o){if(t.declared)return o;switch(o.openArtifact){case"new_session":return{...o,prompt:""};case"comment_summon":return{...o,text:""};case"open_external":case"saved_file":return null;default:return o}}function pz(t,o){return`Export "${o}" and send it to the destination the person picked in the Export tab: "${t.label}" (destination id: ${t.id}). The host app that embeds the Shell offered this destination.`}function hz(t){if(!t||!/^#[0-9a-f]{6}$/i.test(t))return{};const[o,a,r]=[1,3,5].map(d=>parseInt(t.slice(d,d+2),16)/255),l=d=>d<=.03928?d/12.92:((d+.055)/1.055)**2.4,c=.2126*l(o)+.7152*l(a)+.0722*l(r);return{"--open-artifact-accent":t.toLowerCase(),"--open-artifact-accent-fg":c>.4?"#0b1220":"#ffffff","--open-artifact-accent-soft":`${t.toLowerCase()}1f`}}const Hr=["editor","commenter","viewer"];function mz(t,o,a){return t?.agentName||o?.agentName||a}function Gm(t,o){return t?t.live&&t.status==="running":!!o.agent?.busy}function gz(t,o){return Gm(t,o)?"working":t?t.live?"idle":"offline":"none"}function yz(t,o){return!!(t?.caps.sessions&&o?.session)}function VT(t){return!!(t.comments?.available&&!t.comments.pageButton)}function R0(t){return!t||t<0?"":t>99?"99+":String(t)}function O0(t){return Date.parse(t.openedAt||t.contentAt||t.updatedAt||t.createdAt||"")||0}function FT(t,o){const a=o?.session?t.filter(c=>c.owner&&c.owner.harness===o.harness&&c.owner.session===o.session):[],r=a.length>1;return{inSession:r,list:[...r?a:t].sort((c,d)=>O0(d)-O0(c))}}const bz=/^#(?:page|artboard|play)-[^=&]+$/;function Xm(t){const o=new URLSearchParams(t.replace(/^#/,"")).get("page");return o?"#"+new URLSearchParams({page:o}).toString():""}function gf(t){if(t.startsWith("#sheet-")&&!t.includes("=")){const o=t.slice(7);return o?"#"+new URLSearchParams({page:o}).toString():""}return Xm(t)}const vz=new Set(["slides","data"]);function gu(t,o,a){return a&&vz.has(t.type)&&new URL(o).hash===M_}function xz(t,o,a=!1){if(!t.page)return null;const r=new URL(o),l=r.searchParams.get(xa.comment);try{const c=new URL(t.page,r.href);if(c.searchParams.set(xa.shell,r.origin),c.searchParams.set(xa.id,t.id),t.type==="slides"&&Ma.test(r.hash)&&(c.hash=r.hash),t.type!==void 0&&gu({type:t.type},r.href,a)&&(c.hash=r.hash),t.type==="docs"){c.searchParams.set("doc_link_base",t.typeServer?.invite||r.origin+r.pathname);const d=r.searchParams.get("tab");d&&c.searchParams.set("tab",d),c.hash=r.hash}if(t.type==="sheets"&&(c.hash=gf(r.hash)),t.type==="design"){const d=bz.test(r.hash)?r.hash:Xm(r.hash);d&&(c.hash=d)}return(t.type==="design"||t.type==="slides")&&(r.searchParams.get("open_artifact_engine")==="off"&&c.searchParams.set("open_artifact_engine","off"),r.searchParams.get("open_artifact_live")==="all"&&c.searchParams.set("open_artifact_live","all")),l&&c.searchParams.set(xa.comment,l),c.href}catch{return t.page}}function YT(t,o){const a=new URL(t);return a.searchParams.has(o)?(a.searchParams.delete(o),`${a.pathname}${a.search}${a.hash}`):null}function Sz(t){return YT(t,xa.comment)}function wz(t){const o=new URL(t).searchParams.get(xa.panel);return o==="share"||o==="export"?o:null}function Tz(t,o){try{return t?new URL(t,o).origin:new URL(o).origin}catch{return new URL(o).origin}}function Ez(t,o,a){return t?.cloud?cz(t.cloud):t?t.lan:!!(o.shareOn||a?.shared)}function qT(t){return[...t.guests??[]].sort((o,a)=>Number(a.online)-Number(o.online)||(a.seen??a.joined).localeCompare(o.seen??o.joined))}function Cz(t){const o=t.addresses??[],a=o.filter(l=>l!==t.tailnet?.address),r=t.port?`:${t.port}`:"";return(a.length?a:o).map(l=>`${l.includes(":")?`[${l}]`:l}${r}`)}function Rz(t){return[...Hr].reverse().find(o=>t.links[o]?.on)??null}function Oz(t,o){return t==="live"&&o==="drafted"?"drafted":t==="live"||t==="wait"||t==="link"&&o==="delivered"?"delivered":t==="inbox"||t==="link"?"inbox":"failed"}function Az(t,o,a=50){return[...t,o].slice(-a)}function Nz(t){if(!t)return[];try{const o=JSON.parse(t);return Array.isArray(o)?o.filter(a=>!!a&&typeof a=="object"&&typeof a.text=="string"&&typeof a.at=="string").map(a=>({text:a.text,at:a.at,delivery:a.delivery==="inbox"||a.delivery==="failed"||a.delivery==="drafted"?a.delivery:"delivered"})):[]}catch{return[]}}function A0(t,o){const a=t;if(!a||typeof a!="object"||a.id!==o.id||typeof a.title!="string"||typeof a.type!="string")throw new Error(`No boot for ${o.id}.`);const{pending:r,...l}=a;return l}function kz(t){return{...t,page:null,pageUrl:null,pageKind:null,problem:null,pending:!0}}function GT(t,o){const{pending:a,...r}=t;return{...r,page:null,pageUrl:null,pageKind:null,problem:o}}function Mz(t){const o=t;return!o||typeof o!="object"||o.openArtifact!=="frame_denied"?null:j_.includes(o.reason)?o.reason:"not_open"}function jz(t,o){return o||t.typeServer?"problem":"reopen"}function _z(t){return t!=="server"}const Dz=1500,XT=150;function zz(t,o,a){return{id:t.id,url:t.url,title:t.title,type:t.type,typeTitle:t.typeTitle,root:t.root,page:o?.page??null,pageUrl:o?.page_url??null,pageKind:null,problem:o?null:a,empty:!1,prompt:null,owner:t.owner?{harness:t.owner.harness,key:null}:null,agentName:"",userName:"",version:"dev"}}const Lz=["saved","saving","unsaved","reconnecting","readonly"],Pz=["older_version","agent_working","draft_open","comments_on","needs_agent","unsaved","other"],N0=/^[a-z][a-z0-9_-]{0,31}$/,Iz=8,Hz=16,Uz=/^[a-z0-9]{1,8}$/,Bz=/^#[0-9a-fA-F]{6}$/,ya=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function ba(t,o){return typeof t!="string"?void 0:[...t.replace(/[\u0000-\u001f\u007f]+/g," ").trim()].slice(0,o).join("")||void 0}function k0(t){return Pz.includes(t)?t:void 0}function KT(t){if(!ya(t))return{};const o={};typeof t.title=="string"&&(o.title=t.title.trim().slice(0,256));for(const a of["comments","agent"])ya(t[a])&&(o[a]=t[a]);for(const a of["ready","history","share","shareOn","exports","leaveLosesWork","hasContent"])typeof t[a]=="boolean"&&(o[a]=t[a]);if(Lz.includes(t.saved)&&(o.saved=t.saved),Array.isArray(t.actions)){const a=new Set,r=[];for(const l of t.actions){if(!ya(l)||typeof l.id!="string"||!N0.test(l.id)||a.has(l.id))continue;a.add(l.id);const c=ba(l.label,48),d=k0(l.why);if(r.push({id:l.id,...c?{label:c}:{},...l.disabled===!0?{disabled:!0}:{},...d?{why:d}:{}}),r.length===18)break}o.actions=r}if(Array.isArray(t.formats)){const a=new Set,r=[];for(const l of t.formats){if(!ya(l)||typeof l.format!="string"||!Uz.test(l.format)||a.has(l.format))continue;a.add(l.format);const c=ba(l.label,48),d=ba(l.description,160),g=k0(l.why),m=ba(l.disabledReason,160),h=Array.isArray(l.variants)?l.variants.filter(y=>ya(y)&&typeof y.id=="string"&&N0.test(y.id)).slice(0,Hz).map(y=>{const v=ba(y.label,80),S=ba(y.disabledReason,160);return{id:y.id,...v?{label:v}:{},...y.disabled===!0?{disabled:!0}:{},...S?{disabledReason:S}:{}}}):void 0;if(r.push({format:l.format,...c?{label:c}:{},...d?{description:d}:{},...l.disabled===!0?{disabled:!0}:{},...g?{why:g}:{},...m?{disabledReason:m}:{},...l.interactive===!0?{interactive:!0}:{},...l.more===!0?{more:!0}:{},...h?.length?{variants:h}:{}}),r.length===Iz)break}o.formats=r}return ya(t.shareNotice)&&t.shareNotice.tone==="warning"&&typeof t.shareNotice.text=="string"&&t.shareNotice.text.trim()&&(o.shareNotice={text:t.shareNotice.text.slice(0,2e3),tone:"warning"}),Array.isArray(t.peers)&&(o.peers=Vz(t.peers)),t.following===null?o.following=null:typeof t.following=="string"&&MT.test(t.following)&&(o.following=t.following),o}function Vz(t){const o=new Set,a=[];for(const r of t){if(!ya(r)||typeof r.key!="string"||!MT.test(r.key)||o.has(r.key))continue;const l=ba(r.name,80);if(l&&(o.add(r.key),a.push({key:r.key,name:l,...typeof r.color=="string"&&Bz.test(r.color)?{color:r.color.toLowerCase()}:{},...r.self===!0?{self:!0}:{},...r.followsYou===!0?{followsYou:!0}:{}}),a.length===D_))break}return a}function Fz(t){return t.following!==void 0}function Yz(t){const o=t.following;return o?t.peers?.find(a=>a.key===o)??null:null}const M0=["#dc3c3d","#019c7f","#fbb315","#ce447d","#10a122","#257de0","#d25f25","#785ee8"];function qz(t){if(t.color)return t.color;let o=0;for(const a of t.key)o=o*31+a.charCodeAt(0)>>>0;return M0[o%M0.length]}function Gz(t){const o=r=>{const l=parseInt(t.slice(r,r+2),16)/255;return l<=.03928?l/12.92:((l+.055)/1.055)**2.4};return .2126*o(1)+.7152*o(3)+.0722*o(5)>.4?"#0b0b0b":"#ffffff"}function Xz(t){return(t.trim().split(/\s+/).filter(Boolean).slice(0,2).map(r=>[...r][0]??"").join("")||"?").toUpperCase()}function Kz(t){return!!(t.formats?.length||t.exports)}function $T(t){return t.saved!=="readonly"}function Xi(t){return Kz(t)||$T(t)}function yf(t,o){return t.actions?.find(a=>a.id===o)}const $z=new Set(["chat_toggle"]);function Wz(t){return(t.actions??[]).filter(o=>!$z.has(o.id))}const Qz=500;function Zz(t){const o=yf(t,"save_now");switch(t.saved){case"readonly":return"readonly";case"unsaved":return o&&!o.disabled?"retry":"unsaved";case"saving":case"reconnecting":return o?t.saved:"none";default:return"none"}}const Jz={pdf:"PDF",pptx:"PowerPoint",docx:"Word",xlsx:"Excel",png:"PNG",jpg:"JPEG",jpeg:"JPEG",svg:"SVG",gif:"GIF",mp4:"MP4",webm:"WebM",html:"HTML",md:"Markdown",csv:"CSV",json:"JSON",zip:"ZIP",txt:"Text"};function WT(t){const o=t.replace(/[_-]+/g," ").trim();return o?o[0].toUpperCase()+o.slice(1):t}function e3(t){const o=t.hasContent===!1,a=[];for(const r of t.formats??[]){const l=r.label??Jz[r.format]??r.format.toUpperCase(),c={kind:`${l} ${r.format}`,format:r.format,interactive:!!r.interactive,more:!!(r.more||r.interactive),...r.why?{why:r.why}:{}};if(r.variants?.length)for(const d of r.variants){const g=!!r.disabled||!!d.disabled,m=g?d.disabled&&d.disabledReason||r.disabledReason:void 0;a.push({...c,key:`${r.format}:${d.id}`,label:`${l} · ${d.label??WT(d.id)}`,...r.description?{description:r.description}:{},variant:d.id,disabled:o||g,...m?{disabledReason:m}:{}})}else a.push({...c,key:r.format,label:l,...r.description?{description:r.description}:{},disabled:o||!!r.disabled,...r.disabled&&r.disabledReason?{disabledReason:r.disabledReason}:{}})}return a}const j0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function t3(t=o=>crypto.getRandomValues(new Uint8Array(o))){return[...t(24)].map(o=>j0[o%j0.length]).join("")}const QT=/^[a-z0-9][a-z0-9_-]{0,31}$/i;function n3(t){return/^(\[[^\]]*\]|[^/:?#]+)/.exec(t)?.[1]??""}function ZT(t){const o=t.trim();if(!o)return{ok:!1,reason:{key:"pubHostEmpty"}};const a=/^[a-z][a-z0-9+.-]*:\/\//i.test(o)?o:`${g0(n3(o))==="refused"?"https":"http"}://${o}`;let r;try{r=new URL(a)}catch{return{ok:!1,reason:{key:"pubHostInvalid"}}}if(!r.hostname||r.protocol!=="https:"&&r.protocol!=="http:")return{ok:!1,reason:{key:"pubHostInvalid"}};if(r.username||r.password)return{ok:!1,reason:{key:"pubHostInvalid"}};if(r.protocol!=="http:")return{ok:!0,host:r.origin};const l=g0(r.hostname);return l==="refused"?{ok:!1,reason:{key:"pubHostNotHttps"}}:l==="private"?{ok:!0,host:r.origin,insecure:!0}:{ok:!0,host:r.origin}}function JT(t,o){if(!t?.length)return null;const a=o?.default??t.find(r=>r.default)?.name??null;return a&&t.some(r=>r.name===a)?a:t.length===1?t[0].name:null}function eE(t){return(t?.length??0)>1}function o3(t,o){const a=t?.pending.find(r=>r.id===o);return a?a.lastError?{kind:"failed",site:a.remote,attempts:a.attempts,error:a.lastError,code:a.code??"error"}:{kind:"publishing",site:a.remote}:null}function s3(t,o){const a=o?.find(l=>l.name===t.site),r=a?Vn(a.host):t.site??"";return t.kind==="publishing"?{key:"pubAutoPublishing",vars:{host:r}}:t.code==="signed_out"?{key:"pubAutoSignedOut",vars:{host:r}}:t.code==="unreachable"?{key:"pubAutoUnreachable",vars:{host:r}}:{key:"pubAutoFailed",vars:{host:r,error:t.error}}}function a3(t,o){let a="web";try{const c=(new URL(t).hostname.split(".")[0]??"").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,28);c&&QT.test(c)&&(a=c)}catch{}const r=new Set(o.map(l=>l.toLowerCase()));if(!r.has(a))return a;for(let l=2;;l++)if(!r.has(`${a}-${l}`))return`${a}-${l}`}function r3(t){return QT.test(t.trim())?null:{key:"pubNameInvalid"}}function Km(t,o){for(const a of t??[]){const r=a.artifacts.find(l=>l.id===o);if(r)return{remote:a,artifact:r}}return null}function i3(t){return t.signedIn?t.reachable?t.connected?"connected":"connecting":"unreachable":"signed_out"}function l3(t,o){const a=o.pending.length;return t.signedIn?t.reachable?o.lastError?o.code==="unreachable"?{kind:"offline",count:a}:o.code==="signed_out"?{kind:"signed_out",count:a}:{kind:"failed",error:o.lastError,count:a}:a?{kind:"waiting",count:a}:{kind:"in_sync",at:o.lastSyncAt??o.syncedAt}:{kind:"offline",count:a}:{kind:"signed_out",count:a}}function c3(t,o,a){switch(t.kind){case"in_sync":return t.at?{key:"pubInSyncAt",vars:{when:a(t.at)}}:{key:"pubInSync"};case"waiting":return{key:t.count===1?"pubWaitingOne":"pubWaiting",vars:{count:t.count}};case"offline":return{key:"pubOffline",vars:{host:Vn(o)}};case"signed_out":return{key:"pubSignedOutSync",vars:{host:Vn(o)}};case"failed":return{key:"pubSyncFailed",vars:{error:t.error}}}}function Vn(t){try{const o=new URL(t);return o.protocol==="https:"?o.host:`${o.protocol}//${o.host}`}catch{return t}}function u3(t,o){const a={host:Vn(o)};if(t.status===0)return{key:"pubNoDaemon"};switch(t.code){case"not_granted":case"access_denied":return{key:"pubConnectDenied",vars:a};case"timeout":case"expired_token":return{key:"pubConnectExpired"};case"connect_failed":return{key:"pubConnectUnreachable",vars:a};case"not_found":return/sign-in to .* is under way/i.test(t.message)?{key:"pubConnectExpired"}:{key:"pubConnectNotHost",vars:a};case"conflict":return{key:"pubNameTaken"};case"invalid_argument":return/https/i.test(t.message)?{key:"pubHostNotHttps"}:/remote name/i.test(t.message)?{key:"pubNameInvalid"}:{key:"pubHostInvalid"};case"server_failed":return/without a code|is it an Open Artifact host/i.test(t.message)?{key:"pubConnectNotHost",vars:a}:{key:"pubConnectFailed",vars:{error:t.message}};default:return{key:"pubConnectFailed",vars:{error:t.message}}}}function f3(t,o){const a={host:Vn(o)};if(t.status===0)return{key:"pubNoDaemon"};switch(t.code){case"conflict":return/published to .* already/i.test(t.message)?{key:"pubAlreadyElsewhere"}:{key:"pubIdTaken",vars:a};case"too_large":return{key:"pubTooLarge",vars:a};case"unauthorized":return{key:"pubSignedOut",vars:a};case"not_granted":return{key:"pubNotAllowed",vars:a};case"connect_failed":return{key:"pubUnreachable",vars:a};case"unsupported":return{key:"pubUnsupported",vars:a};default:return t.status===413?{key:"pubTooLarge",vars:a}:{key:"pubFailed",vars:{error:t.message}}}}function d3(t,o){const a={host:Vn(o)};if(t.status===0)return{key:"pubNoDaemon"};switch(t.code){case"connect_failed":return{key:"unpubUnreachable",vars:a};case"unauthorized":return{key:"pubSignedOut",vars:a};default:return{key:"unpubFailed",vars:{error:t.message}}}}async function p3(){try{const t=await fetch(`/api/open-artifact.${an.embed}`,{cache:"no-store",signal:AbortSignal.timeout(3e3)});if(!t.ok)return null;const o=await t.json();return Array.isArray(o.hosts)?o.hosts.filter(a=>typeof a=="string"):null}catch{return null}}class Ar extends Error{code;paths;retryable;constructor(o,a,r,l){super(a),this.name="ArtifactError",this.code=o,r&&(this.paths=r),l&&(this.retryable=!0)}}function h3(t,o){if(!t||typeof t!="object")return!1;const a=t;return a.name!=="ArtifactError"||typeof a.code!="string"?!1:o===void 0}function m3(t){return t==="owner"||t==="editor"}const ot={session:"_api/session",files:"_api/files",file:"_api/file",publish:"_api/publish",assets:"_api/assets",events:"_api/events",agentSend:"_api/agent/send",presence:"_api/presence",peers:"_api/peers",downloads:"_api/downloads",roomEmit:"_api/room/emit",dbGet:"_api/db/get",dbList:"_api/db/list",dbWrite:"_api/db/write",comments:"_api/comments",commentsCreate:"_api/comments/create",commentsReply:"_api/comments/reply",commentsEdit:"_api/comments/edit",commentsReact:"_api/comments/react",commentsResolve:"_api/comments/resolve",commentsMove:"_api/comments/move",commentsRemove:"_api/comments/remove",commentsSend:"_api/comments/send",history:"_api/history",historyFiles:"_api/history/files",historyFile:"_api/history/file",historyDiff:"_api/history/diff",historyRestore:"_api/history/restore",historyDismiss:"_api/history/dismiss",systemCopy:"_api/design/system-copy",mcpTools:"_api/mcp/tools",mcpCall:"_api/mcp/call",dataRefresh:"_api/data/refresh"},Qc={read:"_api/sheet/read",send:"_api/sheet/send",widget:"_api/sheet/widget",importFile:"_api/sheet/import"},g3="sheet",y3="sheetWalkthrough",Ps={session:"_api/doc/session",read:"_api/doc/read",call:"_api/doc/call",history:"_api/doc/history",version:"_api/doc/version",restore:"_api/doc/restore",importFile:"_api/doc/import",exportFile:"_api/doc/export"};function b3(t,o,a){return o===401||o===403?"removed":o<200||o>=300||!a||a.id===t.id&&a.role===t.role?null:"changed"}async function oh(t){let o={};try{o=await t.json()}catch{}const a=t.status===409?"conflict":t.status===403?"not_writer":t.status===404?"not_found":"unavailable";return new Ar(o.code??a,o.message??`HTTP ${t.status}`,o.paths,o.retryable===!0)}function v3(){const t=new Uint8Array(8);return crypto.getRandomValues(t),Array.from(t,o=>o.toString(16).padStart(2,"0")).join("")}function x3(t={}){const o=new URL(t.base??"./",location.href),a=v3(),r=(Y,H)=>{const I=new URL(Y,o);for(const[j,U]of Object.entries(H??{}))I.searchParams.set(j,U);return I.toString()},l=async(Y,H,I)=>{let j;try{j=await fetch(r(Y,I),H)}catch(U){throw new Ar("unavailable",U instanceof Error?U.message:String(U))}if(!j.ok)throw await oh(j);return await j.json()},c=(Y,H)=>l(Y,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(H)}),d=new Map,g=(Y,H)=>{for(const I of d.get(Y)??[])I(H)},m=(Y,H)=>{let I=d.get(Y);return I||(I=new Set,d.set(Y,I),v?.addEventListener(Y,w)),I.add(H),k(),()=>I.delete(H)};let h=null,y=!1,v=null,S=null;const w=Y=>{g(Y.type,JSON.parse(Y.data))},T=()=>{const Y=new EventSource(r(ot.events,{client:a}));v=Y;for(const H of d.keys())Y.addEventListener(H,w);Y.onerror=()=>{_().then(H=>{H||Y.readyState!==EventSource.CLOSED||v!==Y||(v=null,S=setTimeout(()=>{S=null,k()},2e3))})}};let O=!1,A=!1;const C=Y=>{O||(O=!0,S&&clearTimeout(S),S=null,v?.close(),v=null,h?.close(),h=null,t.onAccessChange?t.onAccessChange(Y):location.reload())},_=async()=>{if(O)return!0;if(!M||A)return!1;A=!0;try{const Y=(await M.catch(()=>null))?.viewer;if(!Y)return!1;let H;try{H=await fetch(r(ot.session),{cache:"no-store"})}catch{return!1}const I=H.ok?(await H.json().catch(()=>null))?.viewer:null,j=b3(Y,H.status,I);return j&&C(j),j!==null}finally{A=!1}};function k(){if(h||v||S||O)return;if(typeof WebSocket>"u")return T();const Y=new URL(r(ot.events,{client:a}));Y.protocol=Y.protocol==="https:"?"wss:":"ws:";const H=new WebSocket(Y);h=H,H.onopen=()=>{y=!0},H.onmessage=I=>{let j;try{j=JSON.parse(String(I.data))}catch{return}j.event&&g(j.event,j.data)},H.onclose=()=>{if(h===H&&(h=null),!O){if(!y)return T();_().then(I=>{I||h||v||S||(S=setTimeout(()=>{S=null,k()},2e3))})}}}let M=null;const z=()=>M??=l(ot.session),D={async artifact(){const{artifact:Y,stores:H}=await z();return{id:Y.id,...H?.systemCopy?{systemCopy:(j,U)=>l(ot.systemCopy,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({namespace:j,action:U})})}:{},title:async()=>(await l(ot.session)).artifact.title,list:async()=>(await l(ot.files)).files,readText:async j=>new TextDecoder().decode(await L(j)),readBytes:j=>L(j),publish:async j=>{const U={files:j,client:a};return l(ot.publish,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(U)})},onChange:j=>m("files",j)}},async assets(){const{viewer:Y}=await z();return m3(Y.role)?{upload:async(I,j)=>l(ot.assets,{method:"POST",headers:{"content-type":I.type||"application/octet-stream"},body:I},j?.name?{name:j.name}:void 0)}:null},async user(){const{viewer:Y}=await z();return{me:async()=>Y}},async agent(){return{send:async(H,I)=>{const j={request:H,deliver:I?.deliver??"send"};return l(ot.agentSend,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(j)})},status:async()=>(await l(ot.session)).agent,onStatus:H=>m("agent",H)}},async room(){return{self:async()=>a,presence:async H=>{const I={client:a,patch:H};await l(ot.presence,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(I)})},peers:async()=>(await l(ot.peers)).peers,onPeers:H=>m("peers",H),emit:async(H,I)=>{const j={client:a,topic:H,data:I};await c(ot.roomEmit,j)},onMessage:H=>m("room",H)}},async db(){const{stores:Y}=await z();return Y?.db?{get:async I=>(await l(ot.dbGet,{cache:"no-store"},{path:I})).data,list:async I=>(await l(ot.dbList,{cache:"no-store"},{collection:I})).documents,write:async I=>{const j={writes:I,client:a};await c(ot.dbWrite,j)},onChange:I=>m("db",I)}:null},async comments(){const{stores:Y}=await z();if(!Y?.comments)return null;const H=async(j,U)=>(await c(j,U)).thread;return{list:async()=>(await l(ot.comments,{cache:"no-store"})).threads,create:j=>H(ot.commentsCreate,{input:j}),reply:(j,U,te)=>H(ot.commentsReply,{threadId:j,text:U,...te?.to?.length?{to:te.to}:{}}),edit:(j,U,te,$)=>H(ot.commentsEdit,{threadId:j,messageId:U,text:te,...$?.to?{to:$.to}:{}}),react:(j,U,te,$)=>H(ot.commentsReact,{threadId:j,messageId:U,emoji:te,on:$}),setResolved:(j,U)=>H(ot.commentsResolve,{threadId:j,resolved:U}),move:(j,U,te)=>H(ot.commentsMove,{threadId:j,anchor:U,...te?{location:te}:{}}),remove:async(j,U)=>{await c(ot.commentsRemove,{threadId:j,...U?{messageId:U}:{}})},sendToAgent:(j,U)=>H(ot.commentsSend,{threadId:j,...U?.unasked?{unasked:!0}:{}}),onChange:j=>m("comments",j)}},async doc(){const{stores:Y}=await z();return Y?.doc?{session:()=>c(Ps.session,{client:a}),read:I=>c(Ps.read,{tab:I}),call:I=>c(Ps.call,{...I,client:a}),history:I=>c(Ps.history,{tab:I}),version:(I,j)=>c(Ps.version,{tab:I,rev:j}),restore:I=>c(Ps.restore,I),importFile:(I,j,U)=>l(Ps.importFile,{method:"POST",headers:{"content-type":"application/octet-stream"},body:j},{name:I,...U?{tabName:U}:{}}),exportFile:async I=>{let j;try{j=await fetch(r(Ps.exportFile,{format:I.format,...I.tab?{tab:I.tab}:{},...I.paper?{paper:I.paper}:{}}),{cache:"no-store"})}catch(P){throw new Ar("unavailable",P instanceof Error?P.message:String(P))}if(!j.ok)throw await oh(j);const U=j.headers.get("content-disposition")??"",te=decodeURIComponent(/filename\*=UTF-8''([^;]+)/.exec(U)?.[1]??"")||`doc.${I.format==="markdown"?"md":I.format}`;let $=[];try{$=JSON.parse(decodeURIComponent(j.headers.get("x-doc-export-notes")??"%5B%5D"))}catch{}return{name:te,mime:j.headers.get("content-type")??"application/octet-stream",bytes:new Uint8Array(await j.arrayBuffer()),notes:$}},onFrame:I=>m("doc",I)}:null},async history(){const{stores:Y}=await z();if(!Y?.history)return null;const H=(j,U)=>({n:String(j),...U===void 0?{}:{path:U}});return{list:()=>l(ot.history,{cache:"no-store"}),files:async j=>(await l(ot.historyFiles,{cache:"no-store"},H(j))).files,read:async(j,U)=>new TextDecoder().decode(await B(ot.historyFile,H(j,U))),readBytes:(j,U)=>B(ot.historyFile,H(j,U)),diff:(j,U)=>l(ot.historyDiff,{cache:"no-store"},H(j,U)),restore:(j,U)=>c(ot.historyRestore,{n:j,...U?{paths:U}:{},client:a}),dismissNotice:async j=>{await c(ot.historyDismiss,{id:j})},onChange:j=>m("history",j)}},async mcp(){const{viewer:Y}=await z();return Y.role!=="owner"?null:{callTool:async(I,j,U,te)=>{const $=te?.signal;$?.throwIfAborted();const P={server:I,tool:j,args:U,...te?.timeoutMs===void 0?{}:{timeoutMs:te.timeoutMs}};try{return await l(ot.mcpCall,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(P),...$?{signal:$}:{}})}catch(q){throw $?.aborted?$.reason:q}},listTools:I=>l(ot.mcpTools,{cache:"no-store"},I===void 0?void 0:{server:I})}},async sheet(){const{stores:Y}=await z();if(!Y?.sheet)return null;let H=Promise.resolve();return{read:j=>c(Qc.read,j),send:j=>{const U=H.then(()=>c(Qc.send,j));return H=U.catch(()=>{}),U},widget:j=>c(Qc.widget,j),importFile:(j,U)=>l(Qc.importFile,{method:"POST",headers:{"content-type":j.type||"application/octet-stream"},body:j},{name:U}),onFrame:j=>m(g3,j),onWalkthrough:j=>m(y3,j)}},async downloads(){return{save:async({name:H,data:I})=>l(ot.downloads,{method:"POST",headers:{"content-type":I.type||"application/octet-stream"},body:I},{name:H})}}};function L(Y){return B(ot.file,{path:Y})}async function B(Y,H){let I;try{I=await fetch(r(Y,H),{cache:"no-store"})}catch(j){throw new Ar("unavailable",j instanceof Error?j.message:String(j))}if(!I.ok)throw await oh(I);return new Uint8Array(await I.arrayBuffer())}return{get(Y){const H=D[Y];return H?H():null}}}const Dh={artifact:["title","list","readText","readBytes","publish"],assets:["upload"],user:["me"],agent:["send","status"],room:["self","presence","peers","emit"],downloads:["save","check"],db:["get","list","write"],comments:["list","create","reply","edit","react","setResolved","move","remove","sendToAgent"],history:["list","files","read","readBytes","diff","restore","dismissNotice"],doc:["session","read","call","history","version","restore","importFile","exportFile"],mcp:["callTool","listTools"],sheet:["read","send","widget","importFile"]},S3={artifact:{onChange:"files"},agent:{onStatus:"status"},room:{onPeers:"peers",onMessage:"message"},db:{onChange:"change"},comments:{onChange:"threads"},history:{onChange:"change"},sheet:{onFrame:"frame",onWalkthrough:"walkthrough"},doc:{onFrame:"frame"}},w3=6e4;function T3(t){const o=String(t).split(/[\\/]/).pop().replace(/[\u0000-\u001f\u007f]+/g,"").trim();return o&&o!=="."&&o!==".."?o.slice(0,200):"download"}function E3(){return{document,URL,setTimeout:(t,o)=>setTimeout(t,o)}}function C3(t,o=E3()){const a=o.URL.createObjectURL(t.data),r=o.document.createElement("a");return r.href=a,r.download=T3(t.name),r.rel="noopener",r.style.display="none",o.document.body.append(r),r.click(),r.remove(),o.setTimeout(()=>o.URL.revokeObjectURL(a),w3),{}}const _0="The owner has not let viewers download or export this artifact.";function R3(t,o){const a=o.save??(l=>C3(l)),r={save:async l=>{if(!await o.mayExport())throw new Ar("not_writer",_0);return a(l)},browser:!0,check:async()=>{if(!await o.mayExport())throw new Ar("not_writer",_0)}};return{get(l){return l==="mcp"?null:l==="downloads"?r:t.get(l)}}}const O3=new Set(["artifact.publish","assets.upload","downloads.save","agent.send","db.write","comments.sendToAgent","history.restore","doc.call","doc.restore","doc.importFile","doc.exportFile"]);let wa=0,Hs=null,tE=null;function D0(t){tE=t}let A3=t=>x3({base:t}),zh=null;function N3(t){zh=t}function k3(t,o){return wa+=1,t?.({openArtifact:"cap_rewired",gen:wa,...o?{caps:o}:{}}),wa}function M3(t){if(h3(t)){const o=t.paths;return{code:t.code,message:t.message,...o?{paths:o}:{},...t.retryable?{retryable:!0}:{}}}return{code:"unavailable",message:t instanceof Error?t.message:String(t)}}function j3(t,o){if(Hs?.base===t)return Hs;const a=Hs;for(const l of a?.stops??[])l();const r=A3(t);return Hs={base:t,provider:zh?R3(r,zh):r,namespaces:new Map,stops:[],granted:new Set},a?.granted.size&&k3(o,[]),Hs}function nE(t,o){let a=t.namespaces.get(o);return a||(a=Promise.resolve().then(()=>t.provider.get(o)).then(r=>r||null).catch(()=>null),t.namespaces.set(o,a)),a}function _3(t,o,a,r){if(t.granted.has(o))return;t.granted.add(o);const l=S3[o]??{};for(const[c,d]of Object.entries(l)){const g=a[c];if(typeof g!="function")continue;const m=g.call(a,h=>{Hs===t&&r({openArtifact:"cap_ev",cap:o,event:d,data:h})});t.stops.push(m)}}async function D3(t,o,a){const r=t.cap,l=()=>a({openArtifact:"cap_grant",cap:String(r),ok:!1,gen:wa});if(typeof r!="string"||!H_.test(r)||!Object.hasOwn(Dh,r)||t.protocol!==I_||typeof t.base!="string")return l();let c;try{c=new URL(t.base)}catch{return l()}if(c.origin!==o||!/^https?:$/.test(c.protocol))return l();c.hash="",c.search="";const d=j3(c.toString(),a),g=await nE(d,r);if(!g)return l();const m={};if(r==="artifact"&&(m.id=g.id),r==="downloads"&&g.browser===!0&&(m.browser=!0),r==="user")try{m.me=await g.me()}catch{}_3(d,r,g,a),a({openArtifact:"cap_grant",cap:r,ok:!0,gen:wa,config:m})}function z3(t){const o=t?.userActivation;return!!o&&o.isActive===!1}async function L3(t,o,a){const{id:r,cap:l,method:c}=t;if(typeof r!="string"||!r)return;const d=S=>a({openArtifact:"cap_r",id:r,error:S});if(t.gen!==wa)return l==="user"?a({openArtifact:"cap_r",id:r,result:null}):d({code:"unavailable",message:u0});const g=Object.hasOwn(Dh,l)?Dh[l]:null;if(!g||typeof c!="string"||!g.includes(c))return d({code:"invalid",message:`unknown method ${String(l)}.${String(c)}`});const m=Hs;if(!m?.granted.has(l))return d({code:"not_granted",message:`${l} was not granted to this page.`});const h=await nE(m,l),y=h?.[c];if(typeof y!="function")return d({code:"not_granted",message:`${l} is not available here.`});let v=Array.isArray(t.args)?[...t.args]:[];if(l==="agent"&&c==="send"&&z3(o)){const S=v[1]&&typeof v[1]=="object"?v[1]:{};v=[v[0],{...S,deliver:"stage"}]}O3.has(`${l}.${c}`)&&a({openArtifact:"cap_ack",id:r});try{const S=await y.apply(h,v);if(Hs!==m||t.gen!==wa)return d({code:"unavailable",message:u0});const w=S instanceof Uint8Array&&S.byteOffset===0&&S.byteLength===S.buffer.byteLength&&S.buffer instanceof ArrayBuffer?[S.buffer]:void 0;if(a({openArtifact:"cap_r",id:r,result:S},w),l==="downloads"&&c==="save"&&S&&typeof S.savedTo=="string")try{tE?.(S.savedTo)}catch{}}catch(S){d(M3(S))}}const P3=4;function I3(t,o,a=3*6e4){const r=new Map;function l(g,m){if(typeof g!="string"||!L_.test(g)||r.has(g))return;const h=Array.isArray(m)?m.filter(O=>typeof O=="string"):[],y=[...new Set(h)].filter(O=>z_.includes(O)&&t.supports(O));if(!y.length)return o(g,"This browser cannot copy that to the clipboard.");if(r.size>=P3)return o(g,"Still copying…");let v;const S=new Promise((O,A)=>{v=(C,_)=>{clearTimeout(w),r.delete(g),C?O(C):A(new Error(_||"Nothing to copy."))}}),w=setTimeout(()=>v(null,"The page did not send what to copy."),a);r.set(g,{types:y,settle:v});const T=Object.fromEntries(y.map(O=>{const A=S.then(C=>C[O]);return A.catch(()=>{}),[O,A]}));t.write(T).then(()=>o(g),O=>{r.get(g)?.settle(null,"The clipboard was not written."),o(g,O instanceof Error?O.message:String(O))})}function c(g,m,h){const y=typeof g=="string"?r.get(g):void 0;if(!y)return;if(typeof h=="string")return y.settle(null,h);if(!m||typeof m!="object")return y.settle(null,"Nothing to copy.");const v={};let S=0;for(const w of y.types){const T=m[w];if(!(T instanceof Blob))return y.settle(null,`No ${w} to copy.`);S+=T.size,v[w]=T.type===w?T:new Blob([T],{type:w})}if(S>P_)return y.settle(null,"Too large to copy.");y.settle(v)}function d(){for(const g of[...r.values()])g.settle(null,"The page went away.")}return{start:l,data:c,clear:d}}function H3(){return typeof ClipboardItem>"u"||!navigator.clipboard?.write?null:{write:t=>navigator.clipboard.write([new ClipboardItem(t)]),supports:t=>typeof ClipboardItem.supports=="function"?ClipboardItem.supports(t):t!=="image/svg+xml"}}function U3(t,o){switch(o.openArtifact){case"current_slide":return t==="slides"&&typeof o.hash=="string"&&Ma.test(o.hash)?o.hash:null;case"doc_place":return t==="docs"&&typeof o.hash=="string"&&hf.test(o.hash)?o.hash:null;case"sheet_page":return t==="sheets"&&typeof o.page=="string"&&o.page?"#"+new URLSearchParams({page:o.page}).toString():null;default:return null}}function B3(t,o){if(typeof o!="string"||o.length>1e3)return null;if(t==="slides")return Ma.test(o)?{cmd:"goto_slide",hash:o}:null;if(t==="docs")return hf.test(o)?{cmd:"goto_doc",hash:o}:null;if(t==="sheets"){const a=new URLSearchParams(gf(o).slice(1)).get("page");return a?{cmd:"goto_sheet",page:a}:null}return null}const z0=t=>{let o;const a=new Set,r=(h,y)=>{const v=typeof h=="function"?h(o):h;if(!Object.is(v,o)){const S=o;o=y??(typeof v!="object"||v===null)?v:Object.assign({},o,v),a.forEach(w=>w(o,S))}},l=()=>o,g={setState:r,getState:l,getInitialState:()=>m,subscribe:h=>(a.add(h),()=>a.delete(h))},m=o=t(r,l,g);return g},V3=(t=>t?z0(t):z0),F3=t=>t;function Y3(t,o=F3){const a=Pi.useSyncExternalStore(t.subscribe,Pi.useCallback(()=>o(t.getState()),[t,o]),Pi.useCallback(()=>o(t.getInitialState()),[t,o]));return Pi.useDebugValue(a),a}const q3=t=>{const o=V3(t),a=r=>Y3(o,r);return Object.assign(a,o),a},G3=(t=>q3);function oE(t,o){const a=t.ready===!1,r=(t.history??(a&&o.history))||void 0,l=t.comments;let c=a&&!l?o.comments:void 0;if(l?.available===!0&&l.pageButton===!1){const d=Number.isFinite(l.count)?Math.max(0,Math.floor(l.count)):0;c=o.comments?.count===d?o.comments:{available:!0,pageButton:!1,count:d,on:!1,open:!1}}return r===o.history&&c===o.comments?o:{...r&&{history:r},...c&&{comments:c}}}function X3(t){try{return oE(KT(JSON.parse(sessionStorage.getItem(`oa-shell-chrome:${t}`)??"null")),{})}catch{return{}}}const L0={view:null,unsupported:!1,error:"",exports:null,copied:null},K3={remotes:null,cloud:null,missing:!1,connect:{step:"closed"},busy:null,error:"",data:null},Q=G3()((t,o)=>({boot:null,bootError:null,bootGen:0,canRetry:!1,pageReady:!1,artifact:null,report:{},rememberedChrome:{},host:null,library:null,barHidden:!1,menuOpen:!1,shareOpen:!1,shareTab:"share",exportWanted:!1,share:L0,publish:K3,askOpen:!1,sent:[],askStatus:"",renaming:!1,confirmingDelete:!1,setBoot:(a,r=null,l=!1)=>t(c=>({boot:a,bootError:r,canRetry:l,bootGen:c.bootGen+1,pageReady:!a?.pending&&(!a?.page||!!a.empty||!!a.problem),report:{},rememberedChrome:a&&(a.pending||a.page&&!a.empty&&!a.problem)?X3(a.id):{}})),setFrameLoading:()=>t({report:{},pageReady:!1}),setPageReady:a=>t({pageReady:a}),setArtifact:a=>t({artifact:a}),mergeArtifact:a=>{const r=o().artifact;r&&t({artifact:{...r,...a}})},setReport:a=>t(r=>{const l=oE(a,r.rememberedChrome);if(r.boot&&l!==r.rememberedChrome)try{const c=`oa-shell-chrome:${r.boot.id}`;l.history||l.comments?sessionStorage.setItem(c,JSON.stringify(l)):sessionStorage.removeItem(c)}catch{}return{report:a,rememberedChrome:l,...r.exportWanted&&r.shareOpen&&Xi(a)&&{shareTab:"export",exportWanted:!1}}}),setHost:a=>t({host:a}),setLibrary:a=>t({library:a}),setBarHidden:a=>t({barHidden:a}),setMenuOpen:a=>t(a?{menuOpen:a,shareOpen:!1}:{menuOpen:a}),openShare:(a,r)=>t(l=>{const c=a==="export"&&Xi(l.report);return{shareOpen:!0,menuOpen:!1,shareTab:c?"export":"share",exportWanted:a==="export"&&!c&&!!r?.wait,share:l.shareOpen?l.share:{...L0,view:l.share.view,unsupported:l.share.unsupported}}}),closeShare:()=>t({shareOpen:!1,exportWanted:!1}),setShareTab:a=>t(r=>({shareTab:a==="export"&&!Xi(r.report)?"share":a,exportWanted:!1})),patchShare:a=>t(r=>({share:{...r.share,...a}})),patchPublish:a=>t(r=>({publish:{...r.publish,...a}})),setAskOpen:a=>t({askOpen:a}),setSent:a=>t({sent:a}),setAskStatus:a=>t({askStatus:a}),setRenaming:a=>t({renaming:a,menuOpen:!1}),setConfirmingDelete:a=>t({confirmingDelete:a}),closePopups:()=>t({menuOpen:!1,shareOpen:!1,exportWanted:!1})}));function Fn(){const t=Q(o=>o.boot);if(!t)throw new Error("The Shell rendered before its boot.");return t}const sE=`/api/open-artifact.${an.view}`,$3=5;let Is=null;const Lh=t=>`open-artifact.view.${t}`;function W3(t){try{const o=JSON.parse(sessionStorage.getItem(Lh(t))??"null");return o&&typeof o.view=="string"&&typeof o.key=="string"?{view:o.view,key:o.key}:null}catch{return null}}function P0(t,o){try{o?sessionStorage.setItem(Lh(t),JSON.stringify(o)):sessionStorage.removeItem(Lh(t))}catch{}}function Q3(){const t=new URL(location.href),o=t.searchParams.get(f0);return o===null?null:(t.searchParams.delete(f0),history.replaceState(history.state,"",t),o||null)}function Z3(t,o){const a=Q3(),r=a?null:W3(t);if(!a&&!r)return null;let l=!1,c=null,d=0;const g=(m,h)=>{const y=new URLSearchParams({view:m,id:t,...h?{key:h}:{}});c=new EventSource(`${sE}?${y}`),c.addEventListener("view",v=>{try{const S=JSON.parse(v.data);if(typeof S.view!="string"||typeof S.key!="string")return;Is={view:S.view,key:S.key},P0(t,Is),d=0,o.onOpen()}catch{}}),c.addEventListener("command",v=>{try{o.onCommand(JSON.parse(v.data))}catch{}}),c.addEventListener("error",()=>{if(c?.close(),c=null,l)return;if(!Is||d>=$3){P0(t,null),Is=null;return}d+=1;const v=Is;setTimeout(()=>!l&&g(v.view,v.key),1e3*d)})};return a?g(a,null):r&&(Is=r,g(r.view,r.key)),()=>{l=!0,c?.close(),Is=null}}function $m(t){const o=Is;o&&fetch(sE,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({view:o.view,key:o.key,event:t})}).catch(()=>{})}let On=null,Dr=location.origin,Ph=!1,Ih=!1,Wm=!1,nl,yu,Qm=!1,Ur=!1;const bu=new Map;let J3=0;const ol=new Map;let Hh=null,Sa=null;const I0=H3(),vu=I0?I3(I0,(t,o)=>bf({openArtifact:"clipboard_done",id:t,...o===void 0?{}:{error:o}})):null,_a=window.parent!==window;function Zm(){clearTimeout(nl),clearTimeout(yu),nl=yu=void 0}function Jm(t=!0){Zm(),Wm=Ih=Qm=Ur=!1,t?Q.getState().setFrameLoading():Q.getState().setReport({})}function xu(){Zm(),Qm=!0,Ur=!1,Q.getState().setPageReady(!0)}function e5(t,o){On===t&&o===Dr||(Zm(),Ur=!1,On=t,Dr=o,t&&Jm())}function t5(){if(!On)return;const t=Q.getState(),o=_z(t.boot?.pageKind??null);if(Ih&&Jm(!o),Ih=!0,Ur=!1,ol.clear(),vu?.clear(),Ph=!0,eg(),Wm)return;const a=()=>{t.setReport({}),xu()};o?a():nl=setTimeout(a,Dz)}function eg(){const t=Q.getState().boot,o=t?.type==="design"&&t.typeServer,a=Q.getState().host?.theme;bf({openArtifact:"chrome_hello",draws:__.filter(r=>r!=="actions"||!o),...vu?{clipboard:!0}:{},...a?{theme:a}:{}})}function bf(t){On?.contentWindow?.postMessage(t,Dr)}const H0=(t,o)=>{On?.contentWindow?.postMessage(t,{targetOrigin:Dr,...o?{transfer:o}:{}})};function bn(t){bf({openArtifact:"chrome_cmd",...t})}function n5(){return new Promise(t=>{if(!Q.getState().report.exports)return t([]);const o=`x${++J3}`;bu.set(o,t),bn({cmd:"exports",id:o}),setTimeout(()=>{bu.delete(o)&&t([])},2e3)})}function Ki(t){const o=yf(Q.getState().report,t);o&&!o.disabled&&bn({cmd:"action",id:t})}function o5(t){if(t.disabled)return;const o=t3();ol.set(o,t.label),setTimeout(()=>ol.delete(o),15*6e4),bn({cmd:"export_format",request:o,format:t.format,...t.variant?{variant:t.variant}:{}})}const s5={busy:"exportBusy",unsupported:"exportUnsupported",failed:"exportFailed"};function a5(t,o,a){if(typeof t!="string")return;const r=ol.get(t);if(r===void 0||o==="started")return;ol.delete(t);const l=s5[o];if(!l)return;const c=typeof a=="string"&&a.trim()?a.trim().slice(0,200):"";ka.add({title:E(l,{label:r}),...c?{description:c}:{}})}function aE(){if(On){Jm(),Ur=!0,yu=setTimeout(xu,kT);try{On.contentWindow?.location.reload()}catch{const t=On.src;On.src=t}}}function r5(t){On&&(bf({openArtifact:"files_changed",paths:t}),Sa&&clearTimeout(Sa),Sa=setTimeout(()=>{Sa=null,aE()},1e3))}function Pa(t){const{host:o,boot:a}=Q.getState();if(!o||!a)return!1;const r=dz(o,t);return r?(o.via==="view"?$m({artifact:a.url,...r}):window.parent.postMessage({artifact:a.url,...r},o.origin),!0):!1}function tg(t){/^https?:\/\//i.test(t)&&Pa({openArtifact:"open_external",url:t})||window.open(t,"_blank","noopener")}function i5(t){const o=document.documentElement;if(t.theme){o.dataset.theme=t.theme.scheme;for(const[a,r]of Object.entries(hz(t.theme.accent??null)))o.style.setProperty(a,r)}}function rE(t){const o=Q.getState();o.setHost(t),i5(t),t.theme&&eg();const a=o.boot;if(!a)return;const r={openArtifact:"shell_ready",artifact:a.url};t.via==="view"?$m(r):window.parent.postMessage(r,t.origin),ng()}function iE(t){const o=Q.getState().boot;if(!o||typeof t!="string")return;const a=B3(o.type,t);a?bn(a):ng()}function ng(){const t=Q.getState().boot;t&&Hh&&Pa({openArtifact:"place",artifact:t.url,hash:Hh})}function l5(t,o){const a=Q.getState(),r=a.boot?U3(a.boot.type,t):null;switch(r&&(Hh=r,ng()),t.openArtifact){case"request_comment_mode":if(PT(Tl(a.boot))&&VT(a.report)&&typeof t.on=="boolean"){const l=t.on&&typeof t.anchor=="string"?t.anchor:void 0;bn({cmd:"comments_mode",on:t.on,...l?{anchor:l}:{}})}break;case"copy_slide_link":a.boot?.type==="slides"&&typeof t.hash=="string"&&Ma.test(t.hash)&&Bh(t.hash);break;case"copy_sheet_link":a.boot?.type==="sheets"&&typeof t.page=="string"&&Bh("#"+new URLSearchParams({page:t.page}).toString());break;case"sheet_page":if(a.boot?.type!=="sheets"||t.page!==null&&typeof t.page!="string")break;{const l=t.page?"#"+new URLSearchParams({page:t.page}).toString():"";location.hash!==l&&history.replaceState(history.state,"",location.pathname+location.search+l)}break;case"design_page":if(a.boot?.type==="design"&&(t.page===null||typeof t.page=="string")){const l=t.page?"#"+new URLSearchParams({page:t.page}).toString():"";location.hash!==l&&history.replaceState(history.state,"",location.pathname+location.search+l)}break;case"doc_place":if(a.boot?.type==="docs"&&typeof t.hash=="string"&&hf.test(t.hash)){const l=new URL(location.href);l.searchParams.delete("tab"),l.hash=t.hash,l.href!==location.href&&history.replaceState(history.state,"",l)}break;case"current_slide":a.boot?.type==="slides"&&typeof t.hash=="string"&&Ma.test(t.hash)&&location.hash!==t.hash&&!gu(a.boot,location.href,_a)&&history.replaceState(history.state,"",t.hash);break;case"cap_want":D3(t,Dr,H0);break;case"cap":L3(t,o,H0);break;case"clipboard_write":vu?.start(t.id,t.types);break;case"clipboard_data":vu?.data(t.id,t.items,t.error);break;case"files_changed_ok":Sa&&clearTimeout(Sa),Sa=null;break;case"frame_denied":{const l=Mz(t);l&&p5(l);break}case"chrome_report":if(Ur)break;t.report&&typeof t.report=="object"&&(clearTimeout(nl),nl=void 0,Wm=!0,a.setReport(KT(t.report)),t.report.ready!==!1||Qm?xu():(a.setPageReady(!1),yu??=setTimeout(xu,kT)),Ph&&(Ph=!1,eg()));break;case"chrome_export":a5(t.request,t.state,t.reason);break;case"chrome_exports":{const l=bu.get(t.id);bu.delete(t.id);const c=Array.isArray(t.items)?t.items.filter(d=>d&&typeof d.label=="string"):[];l?.(c);break}}}function U0(t){const o=t.data;if(!jT(o))return;if(On&&t.source===On.contentWindow){t.origin===Dr&&l5(o,t);return}if(t.source!==window.parent||!_a)return;if(o.openArtifact==="goto"){const r=Q.getState().host;if(!r||r.via!=="frame"||t.origin!==r.origin)return;iE(o.hash);return}if(o.openArtifact!=="host_hello")return;const a=t.origin;p3().then(r=>{const l=fz(a,r);if(l==="refused")return;const c=BT(o,a,l==="declared");c&&rE(c)})}function c5(t){if(!jT(t))return;if(t.openArtifact==="goto"){Q.getState().host?.via==="view"&&iE(t.hash);return}const o=BT(t,"view",!0,"view");o&&rE(o)}function B0(){setTimeout(()=>{On&&document.activeElement===On&&Q.getState().closePopups()})}function V0(t){Q.getState().report.leaveLosesWork&&(t.preventDefault(),t.returnValue="")}function u5(){const t=()=>{if(Q.getState().boot?.type==="docs"&&location.hash&&bn({cmd:"goto_doc",hash:location.hash}),Q.getState().boot?.type==="sheets"){const l=new URLSearchParams(gf(location.hash).slice(1)).get("page");l&&bn({cmd:"goto_sheet",page:l})}Q.getState().boot?.type==="slides"&&Ma.test(location.hash)&&bn({cmd:"goto_slide",hash:location.hash})};window.addEventListener("hashchange",t),window.addEventListener("message",U0),window.addEventListener("blur",B0),window.addEventListener("beforeunload",V0);const o=Q.getState().boot,a=o?{openArtifact:"shell_hello",version:o.version,protocol:U_,artifact:o.url,id:o.id,title:o.title,type:o.type}:null;_a&&a&&window.parent.postMessage(a,"*");const r=!_a&&o&&a?Z3(o.id,{onCommand:c5,onOpen:()=>$m(a)}):null;return D0(l=>{Pa({openArtifact:"saved_file",path:l})}),()=>{r?.(),D0(null),window.removeEventListener("hashchange",t),window.removeEventListener("message",U0),window.removeEventListener("blur",B0),window.removeEventListener("beforeunload",V0)}}const ho=t=>{ka.add({title:t})},Zt=()=>{const t=Q.getState().boot;if(!t)throw new Error("No boot.");return t};function lE(t,o){return t?.type==="docs"&&hf.test(o)?o:t?.type==="sheets"?gf(o):t?.type==="design"?Xm(o):t?.type==="slides"&&Ma.test(o)?o:""}function sl(t=location.hash){const o=Zt();return(o.typeServer?o.typeServer.invite??location.origin+location.pathname:`${location.origin}/a/${encodeURIComponent(o.id)}`)+lE(o,t)}function zr(t){jD(window),kD(window,t)}async function f5(){const t=window.__OPEN_ARTIFACT_BOOT__,o=Q.getState();if(t){o.setBoot(t),t.pending?await cE(t,!1):zr("oa:boot");return}const a=R_(new URLSearchParams(location.search).get("id"));if(!a)return o.setBoot(null,E("noBoot"));try{const r=await Ct.artifact(a);let l=null,c=null;try{l=await Ct.open(a)}catch(d){c=Bn(d)}o.setBoot(zz(r,l,c)),zr("oa:boot")}catch(r){o.setBoot(null,Bn(r))}}async function d5(t,o){const a=o?null:DD(window,t.id);if(a){let r=null;try{r=await a.res}catch{}if(r)return A0(await DT(r),t)}return A0(await Ct.boot(t.id,{fresh:o}),t)}async function cE(t,o){try{Q.getState().setBoot(await d5(t,o)),zr("oa:boot")}catch(a){Q.getState().setBoot(GT(t,E("bootFailed",{error:Bn(a)})),null,!0)}}async function uE(){const t=Q.getState().boot;if(!t)return;if(t.typeServer)return location.reload();const o=kz(t);Q.getState().setBoot(o),await cE(o,!0)}let Uh=!1;function p5(t){const o=Q.getState().boot;if(!(!o||o.pending)){if(jz(o,Uh)==="problem"){Q.getState().setBoot(GT(o,E(t==="not_granted"?"frameNotGranted":"frameNotOpen")),null,!0);return}Uh=!0,uE()}}function h5(){Uh=!1,zr("oa:frame-ready")}async function Ta(){try{Q.getState().setArtifact(await Ct.artifact(Zt().id))}catch{}}async function fE(){try{Q.getState().setLibrary(await Ct.artifacts())}catch{Q.getState().library||Q.getState().setLibrary([])}}async function m5(){const t=!Q.getState().artifact?.pinned;try{Q.getState().mergeArtifact(await Ct.update({id:Zt().id,pinned:t})),ho(E(t?"pinned":"unpinned"))}catch(o){ho(E(t?"couldNotPin":"couldNotUnpin",{error:Bn(o)}))}}async function g5(t){const o=t.trim(),a=Q.getState(),r=a.artifact?.title??Zt().title;if(!(!o||o===r)){a.mergeArtifact({title:o});try{a.mergeArtifact(await Ct.update({id:Zt().id,title:o}))}catch(l){a.mergeArtifact({title:r}),ho(E("couldNotRename",{error:Bn(l)}))}}}async function y5(){try{const t=await Ct.duplicate(Zt().id);ho(E("duplicated")),location.href=`/a/${encodeURIComponent(t.id)}${location.search}`}catch(t){ho(E("couldNotDuplicate",{error:Bn(t)}))}}function dE(){const{host:t,report:o}=Q.getState();if(t){if(o.leaveLosesWork&&!window.confirm(E("leaveLosesWork")))return;Pa({openArtifact:"close"})}else location.href="/"}async function b5(){try{await Ct.remove(Zt().id),dE()}catch(t){ho(E("couldNotDelete",{error:Bn(t)}))}}function pE(){const t=Q.getState().artifact?.owner;t&&Pa({openArtifact:"open_session",session:t.session,harness:t.harness})}function v5(t){Pa({openArtifact:"new_session",prompt:t,artifact:Zt().url})}async function x5(t,o){const a=Q.getState().host;if(!a?.declared||!a.destinations.some(l=>l.id===t.id))return;const r=Q.getState().artifact?.title||Zt().title;try{await Ct.ask({id:Zt().id,text:pz(t,r),label:E("destinationRequestLabel",{label:t.label})}),ho(E("destinationSent",{label:t.label,agent:o}))}catch(l){ho(E("notSent",{error:Bn(l)}))}}async function Bh(t){await mf(sl(t)),ho(E("linkCopied"))}async function S5(){await mf(Zt().root),ho(E("pathCopied"))}let sh=!1;async function Hn(t){if(!t&&sh)return!0;const o=Q.getState();t||(sh=!0);try{const a=Zt();let r;if(a.typeServer?.sharePath){const l=await fetch(a.typeServer.sharePath,t&&{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!l.ok)throw new Error((await l.json()).error?.message??l.statusText);r=await l.json()}else r=t?await Ct.setShare({id:a.id,...t}):await Ct.share(a.id);return o.patchShare({view:r,error:"",unsupported:!1}),!0}catch(a){return a instanceof ja&&a.code==="unsupported"?o.patchShare({view:null,unsupported:!0,error:""}):a instanceof ja&&a.status===0?o.patchShare({error:E("shareNoAnswer")}):o.patchShare({error:E("shareError",{error:Bn(a)})}),!1}finally{t||(sh=!1)}}let ah=null;async function hE(t,o){const a=Q.getState(),r=t==="page"?"":lE(a.boot,location.hash);await mf(o+r),a.patchShare({copied:t}),ah&&clearTimeout(ah),ah=setTimeout(()=>{Q.getState().share.copied===t&&Q.getState().patchShare({copied:null})},1600);const l=a.share.view;t!=="page"&&t!=="web"&&l&&!l.lan&&!l.cloud&&await Hn({lan:!0})}async function Lr(t){const o=Q.getState(),a=o.share.view,r=a?uz(a,t):null;r&&o.patchShare({view:r});const l=await Hn(t);return!l&&r&&Q.getState().share.view===r&&Q.getState().patchShare({view:a}),l}async function w5(){const t=Tl(Q.getState().boot);if(t!=="viewer")return!0;const o=Q.getState().boot?.cloud?.settings;return!Q.getState().share.view?.cloud&&!o&&await Hn(),IT(t,Q.getState().share.view?.cloud?.settings??o)}const Ea=t=>E(t.key,t.vars),Ia=t=>t instanceof ja?{code:t.code,message:t.message,status:t.status}:{code:"error",message:Bn(t),status:0};function mE(){const t=Q.getState().boot;return!!t&&!zT(t)&&!t.typeServer}let rh=!1,Su=0;async function is(){if(!(!mE()||rh)){rh=!0;try{const{remotes:t,cloud:o}=await Ct.remotes();Q.getState().patchPublish({remotes:t,cloud:o,missing:!1}),T5()}catch(t){t instanceof ja&&t.code==="not_found"&&Q.getState().patchPublish({remotes:[],missing:!0})}finally{rh=!1}}}async function T5(){const t=Q.getState().boot;if(!(!t||t.type!=="data"||!mE()))try{Q.getState().patchPublish({data:await Ct.dataPublish(t.id)})}catch{Q.getState().patchPublish({data:null})}}async function F0(t){const o=Q.getState();if(!o.publish.busy){o.patchPublish({busy:"data",error:""});try{Q.getState().patchPublish({data:await Ct.dataPublish(Zt().id,{publish:t})})}catch(a){Q.getState().patchPublish({error:Ia(a).message})}finally{Q.getState().patchPublish({busy:null})}}}async function E5(){const t=Q.getState();if(!t.publish.busy){t.patchPublish({busy:"data-refresh",error:""});try{Q.getState().patchPublish({data:await Ct.dataPublish(Zt().id,{refresh:!0})})}catch(o){Q.getState().patchPublish({error:Ia(o).message})}finally{Q.getState().patchPublish({busy:null})}}}function al(t){Su++,Q.getState().patchPublish({connect:{step:"form",host:t?.host??"",name:t?.name??"",error:""}})}function Vh(){const{connect:t}=Q.getState().publish,o=t.step==="code"?t.start.name:t.step==="starting"?t.name:null;Su++,Q.getState().patchPublish({connect:{step:"closed"}}),o&&Ct.connectCancel(o).catch(()=>{})}function C5(){const{connect:t}=Q.getState().publish;(t.step==="done"||t.step==="failed"||t.step==="form")&&Q.getState().patchPublish({connect:{step:"closed"}}),Q.getState().patchPublish({error:""})}async function R5(t,o){const a=Q.getState(),r=ZT(t),l=o.trim();if(!r.ok)return a.patchPublish({connect:{step:"form",host:t,name:o,error:Ea(r.reason)}});const c=r3(l);if(c)return a.patchPublish({connect:{step:"form",host:t,name:o,error:Ea(c)}});const d=r.host,g=++Su,m=()=>g===Su,h=S=>{m()&&Q.getState().patchPublish({connect:{step:"failed",host:d,name:l,error:Ea(u3(Ia(S),d))}})};a.patchPublish({connect:{step:"starting",host:d,name:l}});let y;try{y=await Ct.connect(l,d)}catch(S){return h(S)}if(!m()){Q.getState().publish.connect.step==="closed"&&Ct.connectCancel(l).catch(()=>{});return}Q.getState().patchPublish({connect:{step:"code",start:y}});let v=0;for(;m();)try{const S=await Ct.connectWait(l,25e3);if(v=0,S.status==="done"){if(!m())return;Q.getState().patchPublish({connect:{step:"done",host:d,user:S.user.name||S.user.email||S.user.id}}),await is();return}}catch(S){if(S instanceof ja&&S.status===0&&++v<4){await new Promise(w=>setTimeout(w,2e3));continue}return h(S)}}async function O5(t){const o=Q.getState();if(o.publish.busy)return;const a=o.publish.remotes?.find(r=>r.name===t)?.host??t;o.patchPublish({busy:`publish:${t}`,error:""});try{await Ct.publish(Zt().id,t,{data:o.publish.data?.live===!0}),await is(),Ta()}catch(r){Q.getState().patchPublish({error:Ea(f3(Ia(r),a))}),is()}finally{Q.getState().patchPublish({busy:null})}}async function A5(t){const o=Q.getState();if(!o.publish.busy){o.patchPublish({busy:"cloud",error:""});try{const{cloud:a}=await Ct.cloudSettings({publish:t?"auto":"manual"});Q.getState().patchPublish({cloud:a}),await is()}catch(a){Q.getState().patchPublish({error:Ea({key:"pubCloudSettingsFailed",vars:{error:Ia(a).message}})})}finally{Q.getState().patchPublish({busy:null})}}}async function N5(t){const o=Q.getState();if(!o.publish.busy){o.patchPublish({busy:"cloud",error:""});try{const{cloud:a}=await Ct.cloudSettings({default:t});Q.getState().patchPublish({cloud:a}),await is()}catch(a){Q.getState().patchPublish({error:Ea({key:"pubCloudSettingsFailed",vars:{error:Ia(a).message}})})}finally{Q.getState().patchPublish({busy:null})}}}async function k5(){const t=Q.getState();if(t.publish.busy)return;const o=Km(t.publish.remotes,Zt().id)?.remote.host??"";t.patchPublish({busy:"unpublish",error:""});try{await Ct.unpublish(Zt().id),await is(),Ta()}catch(a){Q.getState().patchPublish({error:Ea(d3(Ia(a),o))})}finally{Q.getState().patchPublish({busy:null})}}let ih=!1;async function M5(){if(ih)return;ih=!0;const t=Zt(),o=Ct.archiveUrl(t.id);try{let a;try{a=await fetch(o,{method:"HEAD",cache:"no-store"})}catch(l){throw new Error(E("archiveFailed",{error:Bn(l)}))}if(!a.ok){if(a.status===413)throw new Error(E("archiveTooLarge"));if(a.status===409)throw new Error(E("archiveUnsupported",{type:t.typeTitle}));if(a.status===403){const l=await fetch(o,{cache:"no-store"}).then(c=>c.json()).catch(()=>null);if(typeof l?.message=="string"&&l.message)throw new Error(l.message)}throw new Error(E("archiveFailed",{error:`HTTP ${a.status}`}))}const r=document.createElement("a");r.href=o,r.download="",r.style.display="none",document.body.append(r),r.click(),r.remove(),ka.add({title:E("archiveStarted",{name:qD(a.headers.get("Content-Disposition"))||"folder.zip"}),description:E("archiveHint")})}catch(a){ho(Bn(a))}finally{ih=!1}}const gE=()=>`open-artifact-ask-${Zt().id}`;function j5(){try{Q.getState().setSent(Nz(sessionStorage.getItem(gE())))}catch{}}async function yE(t,o){const a=t.trim();if(!a)return!1;const r=Q.getState();r.setAskStatus(E("sending"));try{const l=await Ct.ask({id:Zt().id,text:a}),c=Oz(l.via,l.status),d=Az(Q.getState().sent,{text:a,at:new Date().toISOString(),delivery:c});r.setSent(d);try{sessionStorage.setItem(gE(),JSON.stringify(d))}catch{}const g=Q.getState(),m=g.boot?.cloud?g.artifact?.agent??g.boot.cloud.agent:void 0;if(m&&c!=="failed"){const h=QD(l.status,m);r.setAskStatus(E(h.key,h.vars))}else r.setAskStatus(c==="inbox"?E("sentInbox",{agent:o}):c==="drafted"?E("sentDrafted",{agent:o}):E(c==="delivered"?"sent":"notDelivered"));return Pa({openArtifact:"comment_summon",text:a}),!0}catch(l){return r.setAskStatus(E("notSent",{error:Bn(l)})),!1}}function _5(){return YD(t=>{const o=Q.getState().boot;if(o)switch(t.type){case"artifacts/changed":if(Q.getState().setLibrary(null),t.id!==o.id)return;Ta(),is(),t.paths?.length&&o.pageKind==="static"&&r5(t.paths);break;case"harness/changed":Ta();break;case"wake/state":t.artifactId===o.id&&Ta();break}})}const D5={none:"statusNone",working:"statusWorking",idle:"statusIdle",waiting:"statusWaiting",offline:"statusOffline"};function bE({state:t,className:o}){return p.jsx("span",{"aria-hidden":"true",className:lt("inline-block size-2 shrink-0 rounded-full",t==="working"?"animate-pulse bg-accent motion-reduce:animate-none":t==="idle"||t==="waiting"?"bg-success":"bg-fg-subtle",o)})}function z5({state:t,prefix:o,label:a,className:r}){const l=a??E(D5[t]);return p.jsxs("span",{className:lt("inline-flex min-w-0 items-center gap-1.5 text-xs text-fg-muted",r),children:[p.jsx(bE,{state:t}),p.jsx("span",{className:"truncate",children:o?`${o} · ${l}`:l})]})}function Ws(){const t=Q(a=>a.host),o=Q(a=>a.boot);return mz(t,o,E("agent"))}function og(){return Q(t=>t.boot?.type==="docs"&&t.report.title||t.artifact?.title||t.boot?.title||"")}function Qs(){return Q(t=>t.artifact?.owner??null)}function L5(){const t=Qs(),o=Q(a=>a.report);return Gm(t,o)}function sg(){return Q(t=>t.boot?.cloud?t.artifact?.agent??t.boot.cloud.agent??null:null)}function ag(){const t=Qs(),o=Q(r=>r.report),a=sg();return a&&!Gm(t,o)?ZD(a):gz(t,o)}function vE(){const t=Q(r=>r.host),o=Qs();return!Q(r=>!!r.boot?.cloud)&&yz(t,o)}function vf(){return Q(t=>t.boot?.cloud??null)}function xf(){return Q(t=>Tl(t.boot))}function xE(){const t=Q(r=>!!r.boot?.typeServer),o=xf(),a=Q(r=>r.share.view?.cloud?.settings??r.boot?.cloud?.settings);return!t&&$D(o,a)}const P5={delivered:"viaDelivered",drafted:"viaDrafted",inbox:"viaInbox",failed:"viaFailed"};function I5(t){const o=Qs(),a=ag(),r=sg(),l=xf();if(r&&a!=="working"){const d=WD(r,l==="owner");return{state:E(d.key,d.vars),note:""}}if(r)return{state:E("working",{agent:r.name}),note:""};if(!o)return{state:E("noOwner"),note:E("noOwnerNote")};const c=o.harnessTitle??o.harness;return a==="working"?{state:E("working",{agent:t}),note:E("ownerNote",{harness:c})}:o.live?{state:E("agentIdle",{agent:t}),note:E("ownerNote",{harness:c})}:{state:E("sessionOffline"),note:E("offlineNote",{agent:t,harness:c})}}function H5(){const t=Ws(),o=Q(A=>A.sent),a=Q(A=>A.askStatus),r=ag(),l=sg(),c=Qs(),{state:d,note:g}=I5(t),m=l&&r!=="working"?E(l.state==="online"?"statusConnected":l.state==="none"?"statusNoAgent":"statusOffline"):void 0,[h,y]=b.useState(""),[v,S]=b.useState(!1),w=b.useRef(null),T=b.useRef(null);b.useEffect(()=>w.current?.focus(),[]),b.useEffect(()=>{T.current?.lastElementChild?.scrollIntoView({block:"end"})},[o.length]);const O=async()=>{v||!h.trim()||(S(!0),await yE(h,t)&&y(""),S(!1))};return p.jsxs("aside",{"aria-label":E("ask",{agent:t}),className:"flex w-[360px] max-w-full shrink-0 flex-col border-l border-line bg-surface max-md:absolute max-md:inset-y-0 max-md:right-0 max-md:z-10 max-md:shadow-popup",children:[p.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-line pl-3.5 pr-1.5",children:[p.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:t}),p.jsx(z5,{state:r,...m?{label:m}:{}}),p.jsx(za,{label:E("hideAsk"),icon:p.jsx(Sl,{className:"size-4"}),size:"lg",onClick:()=>Q.getState().setAskOpen(!1)})]}),p.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-3.5",children:[p.jsx("p",{className:"mb-1 mt-0 font-medium",children:d}),g?p.jsx("p",{className:"mb-3.5 mt-0 text-xs text-fg-muted",children:g}):p.jsx("div",{className:"mb-3.5"}),p.jsx("ol",{ref:T,className:"m-0 flex list-none flex-col gap-2.5 p-0",children:o.map((A,C)=>p.jsxs("li",{className:"max-w-[92%] self-end whitespace-pre-wrap break-words rounded-2xl bg-surface-2 px-3 py-2",children:[A.text,p.jsxs("span",{className:"mt-0.5 block text-[11px] text-fg-muted",children:[wl(A.at)," · ",E(l&&A.delivery==="inbox"?"viaWaitingAgent":P5[A.delivery])]})]},`${A.at}-${C}`))})]}),p.jsxs("form",{className:"p-3",onSubmit:A=>{A.preventDefault(),O()},children:[p.jsx("textarea",{ref:w,rows:3,value:h,placeholder:E("askPlaceholder"),"aria-label":E("askPlaceholder"),onChange:A=>y(A.target.value),onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey&&!A.nativeEvent.isComposing&&(A.preventDefault(),O())},className:"block max-h-[40vh] min-h-[72px] w-full resize-y rounded-xl border border-line bg-surface-2 px-3 py-2.5 text-[13px] text-fg outline-none placeholder:text-fg-subtle focus:border-accent"}),p.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[p.jsx("span",{role:"status",className:"min-w-0 flex-1 text-xs text-fg-muted",children:a}),p.jsx(it,{type:"submit",size:"lg",variant:"primary",disabled:v||!h.trim(),icon:p.jsx(Bk,{className:"size-3.5"}),children:E(c?.wakeMode==="draft"?"sendToConversation":"sendToAgent",{agent:t})})]})]})]})}function SE({hiding:t=!1}){return p.jsx("div",{role:"status","data-shell-loading":t?void 0:"","aria-label":E("loading"),"aria-hidden":t||void 0,className:lt("absolute inset-0 flex items-center justify-center bg-canvas transition-opacity motion-reduce:transition-none",t&&"pointer-events-none opacity-0"),style:{transitionDuration:`${XT}ms`},children:p.jsx(so,{ref:_D,className:"size-6 animate-spin text-fg-subtle motion-reduce:animate-none"})})}const U5=()=>{try{return matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}};function B5(){const t=Fn(),o=Q(m=>m.pageReady),[a,r]=b.useState(!0),l=b.useMemo(()=>xz(t,location.href,_a),[t]);b.useEffect(()=>{const m=Sz(location.href);m&&history.replaceState(history.state,"",m)},[]),b.useEffect(()=>{if(!o){r(!0);return}h5();const m=setTimeout(()=>r(!1),U5()?0:XT);return()=>clearTimeout(m)},[o]);const c=Tz(t.page,location.href),d=b.useCallback(m=>{e5(m,c),m&&zr("oa:frame-src")},[c]),g=()=>{t5(),zr("oa:frame-load")};return l?p.jsxs(p.Fragment,{children:[p.jsx("iframe",{ref:d,name:k_,src:l,title:t.title,allow:"clipboard-read; clipboard-write; fullscreen",onLoad:g,inert:!o,className:"absolute inset-0 size-full border-0 bg-surface"}),(!o||a)&&p.jsx(SE,{hiding:o})]}):null}function V5(){const t=Fn(),o=Ws(),a=!!vf(),r=Q(g=>!!g.host?.caps.sessions)&&!a,[l,c]=b.useState(""),d=t.prompt??"";return p.jsxs("div",{className:"max-w-2xl px-8 py-10",children:[p.jsx("h2",{className:"mb-2 mt-0 text-base font-semibold",children:E("emptyTitle")}),p.jsx("p",{className:"mb-3 mt-0 text-fg-muted",children:a?E("emptyBodyCloud",{type:t.typeTitle}):E("emptyBody",{type:t.typeTitle,root:t.root})}),p.jsx("textarea",{readOnly:!0,value:d,"aria-label":E("emptyTitle"),className:"block min-h-28 w-full resize-y rounded-lg border border-line bg-surface-2 px-3 py-2.5 font-mono text-xs leading-relaxed text-fg outline-none focus:border-accent"}),p.jsxs("div",{className:"mt-2.5 flex flex-wrap gap-2",children:[r?p.jsx(it,{size:"lg",variant:"primary",icon:p.jsx(zk,{className:"size-3.5"}),onClick:()=>{v5(d),c(E("sentToSession"))},children:E("startSession",{agent:o})}):null,p.jsx(it,{size:"lg",icon:p.jsx(hu,{className:"size-3.5"}),onClick:async()=>{await mf(d),c(E("promptCopied"))},children:E("copy")})]}),p.jsx("p",{role:"status",className:"mt-2 text-xs text-fg-muted",children:l})]})}function F5(){const t=Fn(),o=Ws(),a=Q(g=>g.askStatus),r=Q(g=>g.canRetry),l=!!vf(),c=xE()||!l,d=t.problem||E("noPage");return p.jsxs("div",{className:"max-w-2xl px-8 py-10",children:[p.jsxs("h2",{className:"mb-2 mt-0 flex items-center gap-2 text-base font-semibold",children:[p.jsx(xl,{className:"size-4 text-warning"}),E("problemTitle")]}),p.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-xs text-fg-muted",children:d}),l?null:p.jsx("p",{className:"text-xs text-fg-muted",children:E("folder",{root:t.root})}),p.jsxs("div",{className:"flex flex-wrap gap-2",children:[r?p.jsx(it,{size:"lg",variant:"primary",icon:p.jsx(_w,{className:"size-3.5"}),onClick:()=>{uE()},children:E("tryAgain")}):null,c?p.jsx(it,{size:"lg",icon:p.jsx(Pm,{className:"size-3.5"}),onClick:()=>{yE(E("problemAsk",{problem:d}),o)},children:E("askToLook",{agent:o})}):null]}),p.jsx("p",{role:"status",className:"mt-2 text-xs text-fg-muted",children:a})]})}function Y5(){const t=Fn(),o="?";return p.jsxs("p",{role:"status",className:"m-0 flex shrink-0 items-center gap-2 border-b border-line bg-surface-2 px-4 py-2 text-xs text-fg-muted",children:[p.jsx(xl,{className:"size-3.5 shrink-0 text-warning"}),E("readOnlyNewer",{type:t.typeTitle,release:t.type_release??o,version:t.type_version??o})]})}function q5(){const t=Fn(),o=Q(r=>r.bootGen),a=t.pending?p.jsx(SE,{}):t.empty?p.jsx(V5,{}):t.problem||!t.page?p.jsx(F5,{}):p.jsx(B5,{},o);return t.read_only&&!t.pending?p.jsxs("main",{className:"relative flex min-w-0 flex-1 flex-col",children:[p.jsx(Y5,{}),p.jsx("div",{className:"relative min-h-0 flex-1 overflow-auto",children:a})]}):p.jsx("main",{className:"relative min-w-0 flex-1 overflow-auto",children:a})}async function G5(t){try{const o=await fetch(t,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json",accept:"application/json"},body:"{}"});if(!o.ok&&o.status!==401)throw new Error(`HTTP ${o.status}`);const a=HT(await o.json().catch(()=>null))??(await wE()).accessLogout;a?location.href=a:location.reload()}catch(o){ka.add({title:E("signOutFailed",{error:o instanceof Error?o.message:String(o)})})}}let Y0=null;function wE(){return Y0??=fetch("/api/open-artifact.auth.me",{credentials:"same-origin",cache:"no-store"}).then(t=>t.ok?t.json():null).then(t=>({access:ez(t),accessLogout:UT(t)}),()=>({access:!1,accessLogout:null})),Y0}function wu({id:t,name:o,avatar:a,size:r=28}){const[l,c]=b.useState(!1),d={width:r,height:r,fontSize:Math.round(r*.4)};return a&&!l?p.jsx("img",{src:a,alt:"",referrerPolicy:"no-referrer",className:"shrink-0 rounded-full bg-surface-2 object-cover",style:d,onError:()=>c(!0)}):p.jsx("span",{"aria-hidden":!0,className:"grid shrink-0 place-items-center rounded-full font-semibold text-white",style:{...d,background:qm(`user${t}`)},children:Ym(o)})}function X5(t){XD(t,location.origin)?window.open(t,"_blank","noopener,noreferrer"):location.href=t}function K5({cloud:t}){const o=t.user,a=GD(t.site,"account-menu"),[r,l]=b.useState(!1);if(b.useEffect(()=>{if(!o)return;let c=!0;return wE().then(d=>c&&l(d.access)),()=>{c=!1}},[o]),!o){const c=`${location.pathname}${location.search}`;return p.jsx(it,{size:"lg",variant:"ghost",className:"gap-1.5 px-2 font-normal",icon:p.jsx(Nk,{className:"size-4"}),onClick:()=>location.href=JD(t.signInUrl,c,location.origin),children:p.jsx("span",{className:"max-sm:hidden",children:E("signIn")})})}return p.jsxs(el,{align:"end",trigger:p.jsx("button",{type:"button","aria-label":E("accountOf",{name:o.name}),title:o.email?`${o.name} · ${o.email}`:o.name,className:"inline-flex size-8 shrink-0 items-center justify-center rounded-full outline-none hover:bg-hover focus-visible:outline-2 focus-visible:outline-accent data-[popup-open]:bg-hover",children:p.jsx(wu,{id:o.id,name:o.name,avatar:o.avatar,size:26})}),children:[p.jsx(_r,{children:p.jsxs("span",{className:"flex max-w-64 items-center gap-2.5 py-0.5",children:[p.jsx(wu,{id:o.id,name:o.name,avatar:o.avatar,size:32}),p.jsxs("span",{className:"min-w-0",children:[p.jsx("span",{className:"block truncate text-[13px] font-medium text-fg",children:o.name}),o.email?p.jsx("span",{className:"block truncate text-xs",children:o.email}):null]})]})}),p.jsx(Ko,{}),a.map(c=>p.jsx(Nt,{icon:p.jsx(vl,{className:"size-3.5"}),onSelect:()=>X5(c.href),children:c.label},`${c.label} ${c.href}`)),a.length>0?p.jsx(Ko,{}):null,p.jsx(Nt,{icon:p.jsx(kk,{className:"size-3.5"}),onSelect:()=>{G5(t.signOutUrl)},children:E(r?"signOutAccess":"signOut")})]})}function $5({site:t,compact:o=!1}){const a=LT(t)?.brand,[r,l]=b.useState(!1);if(!a)return null;const c=a.logoUrl&&!r?p.jsx("img",{src:a.logoUrl,alt:a.name?"":"logo",referrerPolicy:"no-referrer",className:o?"h-5 w-auto shrink-0":"h-6 w-auto shrink-0",onError:()=>l(!0)}):null;return p.jsxs("span",{"data-site-brand":"",className:"inline-flex min-w-0 items-center gap-1.5",children:[c,a.name?p.jsx("span",{className:o?"truncate text-[13px] font-medium text-fg-muted max-sm:hidden":"truncate",children:a.name}):null]})}const W5=3,va=(t,o=!1)=>t.self?E(o?"yourOtherTab":"youOtherTab"):t.name;function q0({peer:t,ring:o,className:a}){const r=qz(t);return p.jsx("span",{"aria-hidden":!0,"data-peer-avatar":t.key,className:lt("inline-flex size-6 shrink-0 select-none items-center justify-center rounded-full text-[10px] font-semibold ring-2 ring-surface",o&&"outline-2 outline-offset-1",a),style:{background:r,color:Gz(r),outlineColor:o?r:void 0,outlineStyle:o?"solid":void 0},children:Xz(t.name)})}function Q5(t,o){const a=b.useRef(null);b.useEffect(()=>{const r=a.current,l=o?t?.find(c=>c.key===o):void 0;if(l){r?.key!==l.key&&ka.add({title:E("followingToast",{name:va(l,!0)})}),a.current={key:l.key,name:va(l,!0)};return}o||(r&&t&&!t.some(c=>c.key===r.key)&&ka.add({title:E("stoppedFollowingLeft",{name:r.name})}),a.current=null)},[t,o])}function Z5(){const t=Q(h=>h.report.peers),o=Q(h=>h.report.following),a=Q(h=>Yz(h.report)),r=Q(h=>Fz(h.report));if(Q5(t,o),b.useEffect(()=>{if(!a)return;const h=y=>{y.key!=="Escape"||y.defaultPrevented||y.target instanceof Element&&y.target.closest('[role="menu"], [role="dialog"]')||bn({cmd:"follow",key:null})};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[a]),!t?.length)return null;const l=a?[a,...t.filter(h=>h!==a)]:t,c=l.slice(0,W5),d=l.length-c.length,g=l.map(h=>va(h)).join(", "),m=a?`${E("followingName",{name:va(a,!0)})} · ${E("peopleHereNames",{names:g})}`:E("peopleHereNames",{names:g});return p.jsxs(el,{align:"end",trigger:p.jsx("button",{type:"button","data-peers":"","aria-label":m,title:m,className:"inline-flex h-8 shrink-0 items-center rounded-control px-1 hover:bg-hover focus-visible:outline-2 focus-visible:outline-accent data-[popup-open]:bg-hover",children:p.jsxs("span",{className:"flex items-center",children:[c.map((h,y)=>p.jsx(q0,{peer:h,ring:h===a,className:y>0?"-ml-1.5":void 0},h.key)),d>0?p.jsx("span",{className:"ml-1 text-xs text-fg-muted",children:E("peopleMore",{count:d})}):null]})}),children:[p.jsx(_r,{children:E("peopleHere")}),l.map(h=>{const y=h===a,v=p.jsxs("span",{className:"flex min-w-56 items-center gap-2.5",children:[p.jsx(q0,{peer:h,ring:y}),p.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[p.jsx("span",{className:"truncate",children:va(h)}),h.followsYou?p.jsx("span",{className:"text-xs text-fg-subtle",children:E("followingYou")}):null]}),r?p.jsx("span",{"data-follow":y?"on":"off","aria-label":y?E("stopFollowingName",{name:va(h,!0)}):E("followName",{name:va(h,!0)}),className:lt("rounded-control px-2 py-0.5 text-xs font-medium",y?"bg-fg text-surface":"bg-surface-2 text-fg"),children:E(y?"stopFollow":"follow")}):null]});return r?p.jsx(Nt,{onSelect:()=>bn({cmd:"follow",key:y?null:h.key}),children:v},h.key):p.jsx("div",{className:"px-2 py-1.5 text-sm",children:v},h.key)})]})}function J5(t){return t.remotes!==null?Km(t.remotes,t.id)?"published":"lan":t.publishedUrl?"published":"lan"}function e4(t){return t?.lan?"sharedOnNetwork":null}const t4={save_now:"actionSaveNow",open_find:"actionOpenFind",undo:"actionUndo",redo:"actionRedo",edit_page:"actionEditPage",use_page:"actionUsePage",comment_selection:"actionCommentSelection",open_page_list:"actionOpenPageList",hand_off_code:"actionHandOffCode"},n4={older_version:"whyOlderVersion",agent_working:"whyAgentWorking",draft_open:"whyDraftOpen",comments_on:"whyCommentsOn",needs_agent:"whyNeedsAgent",unsaved:"whyUnsaved",other:"whyOther"};function o4(t){const o=t4[t.id];return o?E(o):t.label??WT(t.id)}function TE(t,o){return t?E(n4[t],{agent:o}):void 0}const Jo={editor:"roleEditor",commenter:"roleCommenter",viewer:"roleViewer"},lh={editor:"linkEditor",commenter:"linkCommenter",viewer:"linkViewer"},rg={editor:"noteEditor",commenter:"noteCommenter",viewer:"noteViewer"},s4={editor:p.jsx(Im,{className:"size-4"}),commenter:p.jsx(Lm,{className:"size-4"}),viewer:p.jsx(Ek,{className:"size-4"})};function ch({color:t,text:o,size:a,y:r}){return p.jsxs("svg",{viewBox:"0 0 22 22",width:"22",height:"22","aria-hidden":"true",children:[p.jsx("rect",{width:"22",height:"22",rx:"5",fill:t}),p.jsx("text",{x:"11",y:r,textAnchor:"middle",fontSize:a,fontWeight:"700",fontFamily:"ui-sans-serif, system-ui, sans-serif",fill:"#fff",children:o})]})}const a4={folder:p.jsx(lw,{className:"size-[18px]"}),pdf:p.jsx(ch,{color:"#e0342b",text:"PDF",size:8,y:14.6}),document:p.jsx(ch,{color:"#2b579a",text:"W",size:11,y:15.4}),slides:p.jsx(Lk,{className:"size-[18px]"}),spreadsheet:p.jsx(ch,{color:"#1d7044",text:"X",size:11,y:15.4}),image:p.jsx(Ok,{className:"size-[18px]"}),html:p.jsx(Q1,{className:"size-[18px]"}),video:p.jsx(qk,{className:"size-[18px]"}),text:p.jsx(Ck,{className:"size-[18px]"}),file:p.jsx(Rk,{className:"size-[18px]"})},Ha=b.createContext({menu:()=>{},ask:t=>t.run()});function Br({trigger:t,items:o,align:a="end"}){const r=b.useContext(Ha),l=b.useId(),[c,d]=b.useState(!1);b.useEffect(()=>()=>r.menu(l,!1),[r,l]);const g=o.some(m=>m.checked!==void 0);return p.jsxs(Mm,{open:c,modal:!1,onOpenChange:(m,h)=>{d(m),r.menu(l,m,h.reason)},children:[p.jsx(H1,{render:t}),p.jsx(Rm,{children:p.jsx(Nm,{side:"bottom",align:a,sideOffset:6,collisionPadding:12,className:"z-[1001]",children:p.jsx(Cm,{"data-share-menu":"",className:"min-w-[200px] max-w-[min(340px,calc(100vw-24px))] rounded-xl bg-surface p-1.5 text-[13px] text-fg shadow-popup outline-none transition-opacity duration-100 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",children:o.map(m=>p.jsxs(R1,{disabled:m.disabled,onClick:m.run,...g?{role:"menuitemradio","aria-checked":!!m.checked}:{},className:"flex w-full cursor-default select-none items-center gap-4 rounded-lg py-2 pl-3 pr-2.5 text-left outline-none data-[highlighted]:bg-hover data-[disabled]:opacity-45",children:[p.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[p.jsx("span",{className:lt("truncate",m.danger&&"text-danger"),children:m.label}),m.sub?p.jsx("span",{className:"text-xs text-fg-muted",children:m.sub}):null]}),g?p.jsx("span",{className:"flex w-[18px] shrink-0 justify-center text-accent",children:m.checked?p.jsx(Pr,{className:"size-4"}):null}):null]},m.key))})})})]})}function r4({spec:t,onDone:o}){const a=b.useRef(null);return b.useEffect(()=>{const r=requestAnimationFrame(()=>a.current?.focus());return()=>cancelAnimationFrame(r)},[]),p.jsx("div",{role:"alertdialog","aria-modal":"true","aria-label":t.title,className:"absolute inset-0 z-[2] grid place-items-center rounded-2xl bg-surface/85 p-5 backdrop-blur-[2px]",onMouseDown:r=>{r.target===r.currentTarget&&o(!1)},children:p.jsxs("div",{className:"w-full max-w-[360px] rounded-xl bg-surface p-[18px] shadow-popup",children:[p.jsx("h3",{className:"m-0 mb-1.5 text-[15px] font-semibold",children:t.title}),p.jsx("p",{className:"m-0 mb-4 text-fg-muted",children:t.body}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx(it,{ref:a,size:"lg",onClick:()=>o(!1),children:E("cancel")}),p.jsx(it,{size:"lg",variant:"danger",onClick:()=>o(!0),children:t.ok})]})]})})}function Rn({children:t}){return p.jsx("div",{className:"mb-2 mt-[18px] text-[13px] text-fg-muted",children:t})}function ls({children:t,dim:o}){return p.jsx("div",{className:lt("grid size-9 shrink-0 place-items-center rounded-full bg-surface-2 text-fg",o&&"opacity-50"),children:t})}const go="flex min-h-12 items-center gap-3 py-1",Ca="border-transparent bg-surface-2 px-3 text-[13px] hover:bg-hover";function es({which:t,url:o}){const a=Q(r=>r.share.copied===t);return p.jsx(it,{size:"lg",variant:"ghost",icon:a?p.jsx(Pr,{className:"size-3.5"}):p.jsx(zm,{className:"size-3.5"}),className:lt(Ca,a&&"text-success"),disabled:!o,onClick:()=>{hE(t,o)},children:E(a?"copied":"copyLink")})}function El(t,o={},a=!1){return p.jsxs(it,{size:"lg",variant:"ghost",className:lt("gap-1.5 px-2.5 font-normal data-[popup-open]:bg-hover",a&&"-ml-2.5 max-w-full font-medium"),...o,children:[p.jsx("span",{className:"truncate",children:t}),p.jsx(Aa,{className:"size-3.5 shrink-0 text-fg-muted"})]})}function G0(){const t=Fn(),o=t.userName||E("you");return p.jsxs("div",{className:go,children:[p.jsx("div",{className:"grid size-9 shrink-0 place-items-center rounded-full text-[13px] font-semibold text-white",style:{background:qm(`local${o}`)},children:Ym(o)}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"truncate",children:[o,t.userName?p.jsxs("span",{className:"text-fg-muted",children:[" ",E("you")]}):null]}),p.jsx("div",{className:"truncate text-xs text-fg-muted",children:E("thisComputer")})]}),p.jsxs("span",{className:"inline-flex h-8 items-center gap-1.5 px-2.5 text-fg-subtle",children:[E("owner"),p.jsx(Aa,{className:"size-3.5"})]})]})}function EE({guest:t,view:o}){const a=b.useContext(Ha),r=t.online?E("online"):t.active?E("seenAgo",{when:wl(t.seen??t.joined)}):E("guestPaused");return p.jsxs("div",{className:go,"data-share-guest":t.id,children:[p.jsxs("div",{className:lt("relative grid size-9 shrink-0 place-items-center rounded-full text-[13px] font-semibold text-white",!t.active&&"opacity-55 grayscale"),style:{background:qm(t.id)},children:[Ym(t.name),t.online?p.jsx("span",{"aria-hidden":!0,className:"absolute -bottom-px -right-px size-2.5 rounded-full border-2 border-surface bg-success"}):null]}),p.jsxs("div",{className:lt("min-w-0 flex-1",!t.active&&"opacity-70"),children:[p.jsx("div",{className:"truncate",children:t.name}),p.jsx("div",{className:lt("truncate text-xs",t.online?"text-success":"text-fg-muted"),children:r})]}),p.jsx(Br,{trigger:El(E(Jo[t.role]),{"aria-label":E("changeRole",{name:t.name})}),items:Hr.map(l=>{const c=!!o.links[l]?.on;return{key:l,label:E(Jo[l]),...c?{}:{sub:E("roleLinkOff")},checked:l===t.role,disabled:!c,run:()=>{l!==t.role&&Hn({guests:{[t.id]:l}})}}})}),p.jsx(za,{label:E("removeGuest",{name:t.name}),title:E("remove"),noTooltip:!0,size:"lg",icon:p.jsx(Uw,{className:"size-4"}),onClick:()=>a.ask({title:E("removeTitle",{name:t.name}),body:E("removeBody"),ok:E("remove"),run:()=>{Hn({guests:{[t.id]:null}})}})})]})}function i4({view:t}){const o=Cz(t),a=t.lan?t.addresses?.length?E("onNetworkAt",{addresses:o.join(" · ")}):E("noAddress"):E("whereOff"),r=t.port?`:${t.port}`:"";return p.jsxs("div",{className:lt(go,"items-start"),children:[p.jsx(ls,{children:t.lan?p.jsx(Mk,{className:"size-4"}):p.jsx(cf,{className:"size-4"})}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx(Br,{align:"start",trigger:El(t.lan?E("onLan"):E("onlyThisComputer"),{"aria-label":E("generalAccess")},!0),items:[{key:"here",label:E("onlyThisComputer"),sub:E("onlyHereSub"),checked:!t.lan,run:()=>t.lan&&void Hn({lan:!1})},{key:"lan",label:E("onLan"),sub:E("onLanSub"),checked:t.lan,run:()=>!t.lan&&void Hn({lan:!0})}]}),p.jsx("div",{className:"break-words text-xs text-fg-muted",children:a}),t.lan&&t.tailnet?p.jsx("div",{className:"mt-0.5 break-words text-xs text-fg-muted",children:E("onTailnet",{address:`${t.tailnet.address}${r}`})}):null]})]})}function CE({role:t,view:o}){const a=b.useContext(Ha),r=o.links[t];if(!r)return null;const l=o.lan&&o.tailnet?o.tailnet.links[t]:void 0,c=[...r.on&&l?[{key:"tailnet",label:E("copyTailnet"),sub:E("copyTailnetNote",{address:o.tailnet.address}),run:()=>{hE(t,l)}}]:[],r.on?{key:"off",label:E("turnOffLink"),sub:E("turnOffNote"),run:()=>{Hn({links:{[t]:!1}})}}:{key:"on",label:E("turnOnLink"),run:()=>{Hn({links:{[t]:!0}})}},{key:"reset",label:E("resetLink"),sub:E("resetNote"),danger:!0,run:()=>a.ask({title:E("resetTitle",{role:E(lh[t])}),body:E("resetBody"),ok:E("resetLink"),run:()=>{Hn({reset:[t]})}})}];return p.jsxs("div",{className:go,title:r.on?r.url:void 0,"data-share-link":t,children:[p.jsx(ls,{dim:!r.on,children:s4[t]}),p.jsxs("div",{className:lt("min-w-0 flex-1",!r.on&&"opacity-50"),children:[p.jsx("div",{className:"truncate",children:E(lh[t])}),p.jsx("div",{className:"truncate text-xs text-fg-muted",children:r.on?E(rg[t]):E("linkOff")})]}),r.on?p.jsx(es,{which:t,url:r.url??""}):p.jsx(it,{size:"lg",variant:"ghost",className:Ca,onClick:()=>{Hn({links:{[t]:!0}})},children:E("turnOn")}),p.jsx(Br,{items:c,trigger:p.jsx(za,{label:E("moreFor",{role:E(lh[t])}),title:E("more"),noTooltip:!0,size:"lg",icon:p.jsx(Tk,{className:"size-4"})})})]})}const l4={connected:"pubStateConnected",connecting:"pubStateConnecting",unreachable:"pubStateUnreachable",signed_out:"pubStateSignedOut"},ig=t=>tg(t);function c4({host:t,name:o,error:a,taken:r}){const[l,c]=b.useState(t),[d,g]=b.useState(o),[m,h]=b.useState(!!o),y=b.useId(),v=b.useId(),S=ZT(l),w=S.ok&&S.insecure===!0,T=m?d:l.trim()?a3(S.ok?S.host:`https://${l.trim()}`,r):"";return p.jsxs("form",{"data-publish-form":"",className:"mt-2 rounded-xl border border-line p-3",onSubmit:O=>{O.preventDefault(),R5(l,T)},children:[p.jsx("label",{htmlFor:y,className:"mb-1 block text-xs font-medium",children:E("pubAddress")}),p.jsx(tl,{id:y,autoFocus:!0,value:l,type:"text",inputMode:"url",autoComplete:"url",spellCheck:!1,placeholder:E("pubAddressPlaceholder"),className:"h-8 w-full text-[13px]",onChange:O=>c(O.target.value)}),p.jsx("div",{className:"mt-1 text-xs text-fg-muted",children:E("pubAddressHint")}),w?p.jsxs("div",{"data-publish-insecure":"",className:"mt-1 flex items-start gap-1.5 text-xs text-warning",children:[p.jsx(xl,{className:"mt-px size-3.5 shrink-0"}),E("pubInsecureWarning")]}):null,p.jsx("label",{htmlFor:v,className:"mb-1 mt-3 block text-xs font-medium",children:E("pubName")}),p.jsx(tl,{id:v,value:T,type:"text",autoComplete:"off",spellCheck:!1,className:"h-8 w-40 text-[13px]",onChange:O=>{h(!0),g(O.target.value)}}),p.jsx("div",{className:"mt-1 text-xs text-fg-muted",children:E("pubNameHint")}),a?p.jsx("div",{role:"alert",className:"mt-2 text-xs text-danger",children:a}):null,p.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[p.jsx(it,{size:"lg",onClick:()=>Vh(),children:E("cancel")}),p.jsx(it,{type:"submit",size:"lg",variant:"primary",disabled:!l.trim(),children:E("pubConnect")})]})]})}function u4({taken:t}){const o=Q(a=>a.publish.connect);switch(o.step){case"closed":return null;case"form":return p.jsx(c4,{host:o.host,name:o.name,error:o.error,taken:t});case"starting":return p.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded-xl border border-line p-3 text-fg-muted",children:[p.jsx(so,{className:"size-4 animate-spin"}),E("pubConnecting")]});case"code":{const{start:a}=o;return p.jsxs("div",{"data-publish-code":"",className:"mt-2 rounded-xl border border-line p-3",children:[p.jsx("div",{className:"font-medium",children:E("pubCodeTitle",{host:Vn(a.host)})}),p.jsx("p",{className:"mb-2 mt-1 text-xs text-fg-muted",children:E("pubCodeBody")}),p.jsx("div",{className:"mb-2.5 select-all rounded-lg bg-surface-2 py-2 text-center font-mono text-xl font-semibold tracking-[0.2em]",children:a.user_code}),a.opened?p.jsx("p",{className:"mb-2 mt-0 text-xs text-fg-muted",children:E("pubCodeOpened")}):null,p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx(it,{size:"lg",variant:"primary",icon:p.jsx(vl,{className:"size-3.5"}),onClick:()=>ig(a.verification_uri_complete),children:E("pubOpenApproval")}),p.jsxs("span",{className:"flex flex-1 items-center gap-1.5 text-xs text-fg-muted",children:[p.jsx(so,{className:"size-3.5 animate-spin"}),E("pubWaitingApproval")]}),p.jsx(it,{size:"lg",variant:"ghost",onClick:()=>Vh(),children:E("cancel")})]})]})}case"done":return p.jsxs("div",{role:"status",className:"mt-2 flex items-center gap-2 text-xs text-success",children:[p.jsx(Pr,{className:"size-3.5 shrink-0"}),E("pubConnected",{host:Vn(o.host),name:o.user})]});case"failed":return p.jsxs("div",{className:"mt-2 rounded-xl border border-line p-3",children:[p.jsx("div",{role:"alert",className:"text-xs text-danger",children:o.error}),p.jsxs("div",{className:"mt-2.5 flex justify-end gap-2",children:[p.jsx(it,{size:"lg",variant:"ghost",onClick:()=>Vh(),children:E("cancel")}),p.jsx(it,{size:"lg",onClick:()=>al({host:o.host,name:o.name}),children:E("pubTryAgain")})]})]})}}function f4({remote:t,isDefault:o}){const a=Q(d=>d.publish.busy),r=i3(t),l=a===`publish:${t.name}`,c=[t.user?E("pubSignedInAs",{name:t.user.name||t.user.email||t.user.id}):"",E(l4[r])].filter(Boolean).join(" · ");return t.approval?p.jsx(d4,{remote:t}):p.jsxs("div",{className:go,"data-publish-remote":t.name,children:[p.jsx(ls,{dim:r==="signed_out",children:r==="unreachable"||r==="signed_out"?p.jsx(_m,{className:"size-4"}):p.jsx($1,{className:"size-4"})}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"truncate",children:[t.name," ",p.jsxs("span",{className:"text-fg-muted",children:["· ",Vn(t.host)]}),o?p.jsx("span",{"data-publish-default":"",className:"ml-1.5 rounded bg-surface-2 px-1 text-[11px] text-fg-muted",children:E("pubDefaultMark")}):null]}),p.jsx("div",{className:lt("truncate text-xs",r==="connected"?"text-success":"text-fg-muted"),children:c}),t.insecure?p.jsx("div",{className:"truncate text-xs text-warning",children:E("pubInsecureWarning")}):null]}),r==="signed_out"?p.jsx(it,{size:"lg",variant:"ghost",className:Ca,onClick:()=>al({host:t.host,name:t.name}),children:E("pubReconnect")}):p.jsx(it,{size:"lg",variant:"primary",disabled:!!a,icon:l?p.jsx(so,{className:"size-3.5 animate-spin"}):void 0,onClick:()=>{O5(t.name)},children:E(l?"pubPublishing":"pubPublish")})]})}function d4({remote:t}){const o=t.approval,a=Vn(t.host);return p.jsxs("div",{"data-publish-approval":t.name,className:"mt-2 rounded-xl border border-line p-3",children:[p.jsx("div",{className:"font-medium",children:E("pubApprovalTitle",{host:a})}),p.jsx("p",{className:"mb-2 mt-1 text-xs text-fg-muted",children:E("pubApprovalBody",{host:a})}),p.jsx("div",{className:"mb-2.5 select-all rounded-lg bg-surface-2 py-2 text-center font-mono text-xl font-semibold tracking-[0.2em]",children:o.user_code}),t.insecure?p.jsx("p",{className:"mb-2 mt-0 text-xs text-warning",children:E("pubInsecureWarning")}):null,p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx(it,{size:"lg",variant:"primary",icon:p.jsx(vl,{className:"size-3.5"}),onClick:()=>ig(o.verification_uri_complete),children:E("pubOpenApproval")}),p.jsxs("span",{className:"flex flex-1 items-center gap-1.5 text-xs text-fg-muted",children:[p.jsx(so,{className:"size-3.5 animate-spin"}),E("pubWaitingApproval")]})]})]})}function p4({remotes:t}){const o=Q(d=>d.publish.cloud),a=Q(d=>d.publish.busy);if(!o)return null;const r=JT(t,o),l=t.find(d=>d.name===r)?.host,c=o.publish==="auto";return p.jsxs("div",{"data-publish-auto":c?"on":"off",className:"mt-2 border-t border-line pt-2",children:[eE(t)?p.jsxs("label",{className:"flex min-h-9 items-center gap-3 py-1",children:[p.jsx("span",{className:"min-w-0 flex-1",children:E("pubDefaultSite")}),p.jsx(Pj,{"aria-label":E("pubDefaultSite"),value:r,className:"h-8 max-w-60 overflow-hidden whitespace-nowrap text-[13px]",options:t.map(d=>({value:d.name,label:`${d.name} · ${Vn(d.host)}`})),onChange:d=>{N5(d)}})]}):null,p.jsxs("label",{className:"flex min-h-9 cursor-default items-center gap-3 py-1",children:[p.jsx("span",{className:"min-w-0 flex-1",children:E("pubAutoSwitch")}),p.jsx(wT,{checked:c,disabled:!!a||!c&&!r,"aria-label":E("pubAutoSwitch"),onChange:d=>{A5(d)}})]}),p.jsx("div",{className:"text-xs text-fg-muted",children:r&&l?c?E("pubAutoHint",{host:Vn(l)}):null:E("pubAutoNoSite")})]})}const h4={in_sync:"text-success",waiting:"text-fg-muted",offline:"text-warning",signed_out:"text-warning",failed:"text-danger"};function m4({remote:t,artifact:o}){const a=b.useContext(Ha),r=Q(g=>g.publish.busy),l=l3(t,o),c=c3(l,t.host,wl),d=Vn(t.host);return p.jsxs("div",{"data-publish-state":l.kind,children:[p.jsxs("div",{className:go,title:o.view_url,children:[p.jsx(ls,{children:p.jsx(Dm,{className:"size-4"})}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"truncate",children:E("pubPublishedAt",{host:d})}),p.jsx("div",{className:"truncate text-xs text-fg-muted",children:o.view_url})]}),p.jsx(es,{which:"web",url:o.view_url}),p.jsx(za,{label:E("pubOpen"),size:"lg",icon:p.jsx(vl,{className:"size-4"}),onClick:()=>ig(o.view_url)})]}),p.jsxs("div",{className:lt("mt-0.5 flex items-start gap-1.5 text-xs",h4[l.kind]),role:"status","data-publish-sync":"",children:[l.kind==="in_sync"?p.jsx(Pr,{className:"mt-px size-3.5 shrink-0"}):l.kind==="waiting"?p.jsx(so,{className:"mt-px size-3.5 shrink-0"}):p.jsx(_m,{className:"mt-px size-3.5 shrink-0"}),p.jsxs("span",{className:"min-w-0 flex-1 break-words",children:[E(c.key,c.vars),(l.kind==="offline"||l.kind==="failed")&&l.count?` · ${E(l.count===1?"pubWaitingOne":"pubWaiting",{count:l.count})}`:""]}),l.kind==="signed_out"?p.jsx("button",{type:"button",className:"shrink-0 text-accent hover:underline",onClick:()=>al({host:t.host,name:t.name}),children:E("pubReconnect")}):null]}),p.jsxs("p",{className:"mb-0 mt-2.5 text-xs text-fg-muted",children:[E("pubManage")," ",p.jsx("a",{href:o.view_url,target:"_blank",rel:"noopener",className:"text-accent hover:underline",onClick:g=>{g.preventDefault(),tg(o.view_url)},children:E("pubManageLink")})]}),p.jsx("p",{className:"mb-0 mt-1 text-xs text-fg-muted",children:E("pubOpensThere")}),p.jsx(g4,{host:d}),p.jsx("div",{className:"mt-2.5 flex justify-end",children:p.jsx(it,{size:"lg",variant:"ghost",className:"text-danger",disabled:!!r,icon:r==="unpublish"?p.jsx(so,{className:"size-3.5 animate-spin"}):void 0,onClick:()=>a.ask({title:E("unpubTitle"),body:E("unpubBody",{host:d}),ok:E("pubUnpublish"),run:()=>{k5()}}),children:E(r==="unpublish"?"pubUnpublishing":"pubUnpublish")})})]})}function g4({host:t}){const o=b.useContext(Ha),a=Q(l=>l.publish.data),r=Q(l=>l.publish.busy);return a?.live?a.publish?p.jsxs("div",{"data-publish-data":"on",className:"mt-2 text-xs text-fg-muted",children:[p.jsx("div",{children:a.at?E("pubDataAsOf",{time:new Date(a.at).toLocaleString()}):E("pubDataNone")}),a.lastError?p.jsx("div",{className:"text-warning",children:E("pubDataFailed",{reason:a.lastError})}):null,p.jsxs("div",{className:"mt-1 flex flex-wrap justify-end gap-2",children:[p.jsx(it,{size:"sm",variant:"ghost",className:Ca,disabled:!!r||a.running,"data-publish-data-refresh":"",icon:r==="data-refresh"||a.running?p.jsx(so,{className:"size-3.5 animate-spin"}):void 0,onClick:()=>{E5()},children:r==="data-refresh"||a.running?E("pubDataRefreshing"):E("pubDataRefresh")}),p.jsx(it,{size:"sm",variant:"ghost",className:lt(Ca,"text-danger"),disabled:!!r,"data-publish-data-stop":"",onClick:()=>o.ask({title:E("pubDataStopTitle"),body:E("pubDataStopBody",{host:t}),ok:E("pubDataStop"),run:()=>{F0(!1)}}),children:E("pubDataStop")})]})]}):p.jsxs("div",{"data-publish-data":"pending",className:"mt-2 flex items-start gap-2 text-xs text-fg-muted",children:[p.jsx("span",{className:"min-w-0 flex-1",children:E("pubDataPending")}),p.jsx(it,{size:"sm",variant:"ghost",className:Ca,disabled:!!r,"data-publish-data-confirm":"",onClick:()=>{F0(!0)},children:E("pubDataConfirm")})]}):null}function X0(){const t=Q(S=>S.boot?.id??""),o=Q(S=>S.publish.remotes),a=Q(S=>S.publish.missing),r=Q(S=>S.publish.connect.step),l=Q(S=>S.publish.error),c=Q(S=>S.publish.cloud),d=Q(S=>S.publish.data);if(a||o===null)return null;const g=Km(o,t),m=o.map(S=>S.name),h=g?null:o3(c,t),y=h?s3(h,o):null,v=JT(o,c);return p.jsxs("section",{"data-share-publish":"",children:[p.jsx(Rn,{children:E("pubTitle")}),h&&y?p.jsxs("div",{"data-publish-auto-state":h.kind,role:"status",className:lt("mb-1 flex items-start gap-1.5 text-xs",h.kind==="failed"?"text-warning":"text-fg-muted"),children:[h.kind==="failed"?p.jsx(_m,{className:"mt-px size-3.5 shrink-0"}):p.jsx(so,{className:"mt-px size-3.5 shrink-0 animate-spin"}),p.jsx("span",{className:"min-w-0 flex-1 break-words",children:E(y.key,y.vars)})]}):null,g?p.jsx(m4,{remote:g.remote,artifact:g.artifact}):o.length?p.jsxs(p.Fragment,{children:[o.map(S=>p.jsx(f4,{remote:S,isDefault:eE(o)&&S.name===v},S.name)),d?.live?p.jsx("p",{"data-publish-data-note":"",className:"mb-0 mt-1 text-xs text-fg-muted",children:E("pubDataNote")}):null,r==="closed"||r==="done"?p.jsx("button",{type:"button",className:"mt-1 text-xs text-accent hover:underline",onClick:()=>al(),children:E("pubConnectAnother")}):null]}):p.jsxs("div",{className:lt(go,"items-start"),children:[p.jsx(ls,{children:p.jsx(Dm,{className:"size-4"})}),p.jsx("div",{className:"min-w-0 flex-1 pt-0.5 text-xs text-fg-muted",children:E("pubIntro")}),r==="closed"?p.jsx(it,{size:"lg",variant:"ghost",className:Ca,onClick:()=>al(),children:E("pubConnectSite")}):null]}),g&&r==="done"?null:p.jsx(u4,{taken:m}),o.length?p.jsx(p4,{remotes:o}):null,l?p.jsx("div",{role:"alert",className:"mt-2 text-xs text-danger",children:l}):null]})}const K0={restricted:"accessRestricted",link:"accessLink",public:"accessPublic"},$0={restricted:"accessRestrictedSub",link:"accessLinkSub",public:"accessPublicSub"},y4={restricted:p.jsx(cf,{className:"size-4"}),link:p.jsx(zm,{className:"size-4"}),public:p.jsx(Dm,{className:"size-4"})};function W0({cloud:t}){const o=Q(r=>r.boot?.cloud?.user?.id),a=t.owner;return p.jsxs("div",{className:go,"data-share-owner":"",children:[p.jsx(wu,{id:a.id,name:a.name,avatar:a.avatar,size:36}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"truncate",children:[a.name,o===a.id?p.jsxs("span",{className:"text-fg-muted",children:[" ",E("you")]}):null]}),a.email?p.jsx("div",{className:"truncate text-xs text-fg-muted",children:a.email}):null]}),p.jsx("span",{className:"inline-flex h-8 items-center px-2.5 text-fg-subtle",children:E("owner")})]})}function b4({member:t,canManage:o}){const a=b.useContext(Ha),r=Q(g=>g.boot?.cloud?.user?.id),l=t.kind==="domain"?E("memberDomain",{domain:t.label.replace(/^@/,"")}):t.label,c=t.pending?E("memberPending"):t.kind==="group"?E("memberGroup"):t.email&&t.email!==t.label?t.email:"",d=t.kind==="domain"?p.jsx(ls,{children:p.jsx(vk,{className:"size-4"})}):t.kind==="group"?p.jsx(ls,{children:p.jsx(Ui,{className:"size-4"})}):p.jsx("span",{className:lt(t.pending&&"opacity-55"),children:p.jsx(wu,{id:t.id,name:t.label,avatar:t.avatar,size:36})});return p.jsxs("div",{className:go,"data-share-member":t.id,children:[d,p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"truncate",children:[l,r&&t.id===`user:${r}`?p.jsxs("span",{className:"text-fg-muted",children:[" ",E("you")]}):null]}),c?p.jsx("div",{className:"truncate text-xs text-fg-muted",children:c}):null]}),o?p.jsx(Br,{trigger:El(E(Jo[t.role]),{"aria-label":E("changeRole",{name:l})}),items:[...Hr.map(g=>({key:g,label:E(Jo[g]),sub:E(rg[g]),checked:g===t.role,run:()=>{g!==t.role&&Lr(E0(t.id,g))}})),{key:"remove",label:E("removeAccess"),danger:!0,run:()=>a.ask({title:E("removeTitle",{name:l}),body:E("removeMemberBody"),ok:E("remove"),run:()=>{Lr(E0(t.id,null))}})}]}):p.jsx("span",{className:"inline-flex h-8 items-center px-2.5 text-fg-subtle",children:E(Jo[t.role])})]})}function v4(){const[t,o]=b.useState(""),[a,r]=b.useState("editor"),[l,c]=b.useState(""),[d,g]=b.useState(!1),m=async()=>{const{members:h,invalid:y}=sz(t);if(y.length)return c(E("addInvalid",{entries:y.join(", ")}));if(!h.length||d)return;c(""),g(!0);const v=await Lr(rz(h,a));g(!1),v&&o("")};return p.jsxs("form",{className:"mt-3",onSubmit:h=>{h.preventDefault(),m()},children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(tl,{value:t,type:"text",inputMode:"email",autoComplete:"off",spellCheck:!1,"aria-label":E("addPeople"),placeholder:E("addPeoplePlaceholder"),className:"h-8 min-w-0 flex-1 text-[13px]",onChange:h=>{o(h.target.value),l&&c("")}}),p.jsx(Br,{trigger:El(E(Jo[a]),{"aria-label":E("roleFor")}),items:Hr.map(h=>({key:h,label:E(Jo[h]),sub:E(rg[h]),checked:h===a,run:()=>r(h)}))}),p.jsx(it,{type:"submit",size:"lg",variant:"primary",disabled:d||!t.trim(),children:E("add")})]}),l?p.jsx("div",{role:"alert",className:"mt-1.5 text-xs text-danger",children:l}):null]})}function x4({cloud:t}){const o=["restricted","link","public"];return p.jsxs("div",{className:lt(go,"items-start"),children:[p.jsx(ls,{children:y4[t.access]}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx(Br,{align:"start",trigger:El(E(K0[t.access]),{"aria-label":E("generalAccess")},!0),items:o.map(a=>({key:a,label:E(K0[a]),sub:E($0[a]),checked:a===t.access,run:()=>{a!==t.access&&Lr(iz(a))}}))}),p.jsx("div",{className:"break-words text-xs text-fg-muted",children:E($0[t.access])})]})]})}function Q0({label:t,checked:o,onChange:a}){return p.jsxs("label",{className:"flex min-h-9 cursor-default items-center gap-3 py-1",children:[p.jsx("span",{className:"min-w-0 flex-1",children:t}),p.jsx(wT,{checked:o,"aria-label":t,onChange:a})]})}function S4({view:t,cloud:o}){const a=Ws(),r=Q(d=>Tl(d.boot)),l=qT(t),c=p.jsx("div",{className:"mt-4 flex justify-end",children:p.jsx(es,{which:"cloud",url:o.url})});return o.canManage?p.jsxs(p.Fragment,{children:[p.jsx(v4,{}),p.jsx(Rn,{children:E("peopleWithAccess")}),p.jsx(W0,{cloud:o}),o.members.map(d=>p.jsx(b4,{member:d,canManage:!0},d.id)),o.members.length?null:p.jsx("div",{className:"pb-0.5 pt-1.5 text-xs text-fg-muted",children:E("noMembers")}),l.length?p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E("joinedPeople")}),l.map(d=>p.jsx(EE,{guest:d,view:t},d.id))]}):null,p.jsx(Rn,{children:E("generalAccess")}),p.jsx(x4,{cloud:o}),lz(o.access)?p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E("inviteLinks")}),Hr.map(d=>p.jsx(CE,{role:d,view:t},d))]}):null,p.jsx(Rn,{children:E("shareSettings")}),p.jsx(Q0,{label:E("viewersCanExport"),checked:o.settings.viewersCanExport,onChange:d=>{Lr(C0("viewersCanExport",d))}}),p.jsx(Q0,{label:E("editorsCanAsk",{agent:a}),checked:o.settings.editorsCanAskAgent,onChange:d=>{Lr(C0("editorsCanAskAgent",d))}}),c]}):p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E("peopleWithAccess")}),p.jsx(W0,{cloud:o}),p.jsx("p",{className:"mb-0 mt-2 text-fg-muted",children:E("yourRole",{role:E(r==="owner"?"owner":Jo[r])})}),p.jsx("p",{className:"mb-0 mt-1 text-xs text-fg-muted",children:E("onlyOwnerShares")}),c]})}function w4({view:t,children:o}){const[a,r]=b.useState(!1),l=e4(t);return p.jsxs("section",{"data-share-network":a?"open":"closed",className:"mt-4 border-t border-line pt-2",children:[p.jsxs("button",{type:"button","aria-expanded":a,className:"-mx-2 flex w-[calc(100%+16px)] items-start gap-2 rounded-lg px-2 py-1.5 text-left outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent",onClick:()=>r(!a),children:[a?p.jsx(Aa,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}):p.jsx(jm,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}),p.jsxs("span",{className:"min-w-0 flex-1",children:[p.jsxs("span",{className:"block",children:[E("shareOnNetwork"),l?p.jsxs("span",{className:"text-xs text-success",children:[" · ",E(l)]}):null]}),p.jsx("span",{className:"block text-xs text-fg-muted",children:E("shareOnNetworkSub")})]})]}),a?o:null]})}function Z0({view:t,unsupported:o}){const a=Fn();if(!t)return p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E("peopleWithAccess")}),p.jsx(G0,{}),o?p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E("generalAccess")}),p.jsxs("div",{className:go,children:[p.jsx(ls,{children:p.jsx(cf,{className:"size-4"})}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{children:E("onlyThisComputer")}),p.jsx("div",{className:"text-xs text-fg-muted",children:E("cannotShare",{type:a.typeTitle})})]}),p.jsx(es,{which:"page",url:sl()})]})]}):p.jsx("div",{className:"py-2 text-xs text-fg-muted",children:E("loading")})]});const r=qT(t);return p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E("peopleWithAccess")}),p.jsx(G0,{}),p.jsx(Rn,{children:E("joinedPeople")}),r.length?r.map(l=>p.jsx(EE,{guest:l,view:t},l.id)):p.jsx("div",{className:"pb-0.5 pt-1.5 text-xs text-fg-muted",children:E("noneJoined")}),p.jsx(Rn,{children:E("generalAccess")}),p.jsx(i4,{view:t}),p.jsx(Rn,{children:E("inviteLinks")}),Hr.map(l=>p.jsx(CE,{role:l,view:t},l)),t.lan?p.jsx("p",{"data-share-security":"",className:"mb-0 mt-1.5 text-xs text-fg-muted",children:E("plainHttp")}):null]})}function T4(){const t=Fn(),{view:o,unsupported:a}=Q(c=>c.share),r=Q(c=>c.publish.remotes),l=Q(c=>c.artifact?.remote?.url??null);return o?.cloud?p.jsx(S4,{view:o,cloud:o.cloud}):t.cloud?a?p.jsxs("div",{className:"mt-3",children:[p.jsx("p",{className:"mb-2 mt-0 text-xs text-fg-muted",children:E("cannotShareCloud",{type:t.typeTitle})}),p.jsx(es,{which:"page",url:sl()})]}):p.jsx("div",{className:"py-3 text-xs text-fg-muted",children:E("loading")}):t.typeServer&&!t.typeServer.sharePath?p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E(t.typeServer.role==="owner"?"onlyThisComputer":"inviteLinks")}),t.typeServer.role==="owner"&&p.jsx("p",{className:"mb-2 text-xs text-fg-muted",children:E("standaloneShare")}),p.jsx(es,{which:"page",url:sl()})]}):J5({id:t.id,remotes:r,publishedUrl:l})==="published"?p.jsxs(p.Fragment,{children:[r===null?p.jsx("div",{className:"py-3 text-xs text-fg-muted",children:E("loading")}):p.jsx(X0,{}),p.jsx(w4,{view:o,children:p.jsx(Z0,{view:o,unsupported:a})})]}):p.jsxs(p.Fragment,{children:[p.jsx(Z0,{view:o,unsupported:a}),p.jsx(X0,{})]})}function Li({kind:t,label:o,description:a,disabled:r,reason:l,more:c,onPick:d}){return p.jsxs("button",{type:"button",disabled:r,title:r?l:void 0,"data-export-row":o,className:"flex w-full items-center gap-3 rounded-[10px] px-2 py-1.5 text-left outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent disabled:opacity-45 disabled:hover:bg-transparent",onClick:()=>{Q.getState().closeShare(),d()},children:[p.jsx("span",{className:"grid size-9 shrink-0 place-items-center rounded-[10px] border border-line",children:a4[t]}),p.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[p.jsx("span",{className:"truncate",children:o}),a?p.jsx("span",{className:"text-xs text-fg-muted",children:a}):null]}),c?p.jsx(jm,{className:"size-4 shrink-0 text-fg-muted"}):p.jsx(tw,{className:"size-[18px] shrink-0 text-fg-muted"})]})}const E4=[];function J0(){const t=Q(h=>h.boot?.typeServer),o=Q(h=>h.report),a=Q(h=>h.share.exports),r=Ws(),l=Fn(),c=e3(o),d=!c.length&&!!o.exports,g=Q(h=>!h.boot?.cloud||IT(Tl(h.boot),h.share.view?.cloud?.settings)),m=Q(h=>h.host?.declared&&!h.boot?.cloud&&!t?h.host.destinations:E4);return p.jsxs("div",{className:"-mx-2 mt-2.5",children:[o.hasContent===!1?p.jsx("div",{className:"px-2 py-2 text-xs text-fg-muted",children:E("nothingToExport")}):null,c.map(h=>p.jsx(Li,{kind:w0(h.kind),label:h.label,description:h.description??(h.interactive?E("exportOptions"):void 0),disabled:h.disabled,reason:h.disabledReason??TE(h.why,r),more:h.more,onPick:()=>o5(h)},h.key)),d&&a===null?p.jsx("div",{className:"px-2 py-2 text-xs text-fg-muted",children:E("loading")}):null,d?(a??[]).map(h=>p.jsx(Li,{kind:w0(h.label),label:h.label,description:h.description,disabled:h.disabled,reason:h.disabledReason,more:h.more,onPick:()=>bn({cmd:"export",label:h.label})},h.label)):null,t?.role==="owner"&&l.type==="docs"?p.jsx(Li,{kind:"folder",label:E("archiveLabel"),description:E("archiveDescription"),onPick:()=>{const h=document.createElement("a");h.href=new URL("_api/frame/archive",location.href).href,h.download="",h.click()}}):null,!t&&g&&$T(o)?p.jsx(Li,{kind:"folder",label:E("archiveLabel"),description:E("archiveDescription"),onPick:()=>{M5()}}):null,m.map(h=>p.jsx(Li,{kind:"file",label:h.label,description:E("destinationDescription",{agent:r}),onPick:()=>{x5(h,r)}},`destination:${h.id}`))]})}function C4(){const t=Q(o=>o.report.shareNotice);return t?p.jsxs("div",{role:"note",className:"mt-3 flex gap-2.5 rounded-lg border border-line bg-surface-2 p-3 text-xs",children:[p.jsx(xl,{className:"mt-px size-3.5 shrink-0 text-danger"}),p.jsx("p",{className:"m-0 whitespace-pre-wrap break-words",children:t.text})]}):null}function R4(){const{view:t,unsupported:o}=Q(c=>c.share),a=Q.getState();if(t?.cloud){const c=t.cloud;return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"mt-3.5 flex gap-3 rounded-[14px] bg-surface-2 p-4",children:[p.jsx(Ui,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("h3",{className:"m-0 text-sm font-semibold",children:E("sendingTitle")}),p.jsx("p",{className:"mb-3 mt-1 text-fg-muted",children:E("sendingBody")}),p.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.canManage?p.jsx(it,{size:"lg",variant:"primary",icon:p.jsx(Ui,{className:"size-3.5"}),onClick:()=>a.setShareTab("share"),children:E("invitePeople")}):null,p.jsx(es,{which:"cloud",url:c.url})]})]})]}),p.jsx(J0,{})]})}const r=t?Rz(t):null,l=t?r?t.lan?E("joinsAs",{role:E(Jo[r]).toLowerCase()}):E("whereOff"):E("allLinksOff"):o?E("onlyHereLink"):"";return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"mt-3.5 flex gap-3 rounded-[14px] bg-surface-2 p-4",children:[p.jsx(Ui,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("h3",{className:"m-0 text-sm font-semibold",children:E("sendingTitle")}),p.jsx("p",{className:"mb-3 mt-1 text-fg-muted",children:E("sendingBody")}),p.jsxs("div",{className:"flex flex-wrap gap-2",children:[t?p.jsx(it,{size:"lg",variant:"primary",icon:p.jsx(Ui,{className:"size-3.5"}),onClick:()=>a.setShareTab("share"),children:E("invitePeople")}):null,t&&r?p.jsx(es,{which:r,url:t.links[r]?.url??""}):null,t?null:p.jsx(es,{which:"page",url:sl()})]}),l?p.jsx("p",{className:"mb-0 mt-2.5 text-xs text-fg-muted",children:l}):null]})]}),p.jsx(J0,{})]})}async function O4(){const t=await n5();Q.getState().shareOpen&&Q.getState().patchShare({exports:t})}function A4(){const t=Fn(),o=og(),a=Q(D=>D.shareOpen),r=Q(D=>D.shareTab),l=Q(D=>D.share.error),c=Q(D=>D.share.unsupported),d=Q(D=>D.share.view),g=Q(D=>D.artifact),m=Q(D=>D.report),h=Q.getState(),y=Ez(d,m,g),v=Q(D=>D.boot&&!D.boot.cloud?D.artifact?.remote?.url??null:null),[S,w]=b.useState(null),T=b.useRef(new Set),O=b.useRef(0),A=b.useRef(null);A.current=S;const C=b.useRef({menu(D,L,B){L?T.current.add(D):T.current.delete(D),!L&&B==="escape-key"&&(O.current=performance.now())},ask:D=>w(D)}).current,_=Q(D=>D.boot?.typeServer);b.useEffect(()=>{if(!a){w(null);return}if(_&&!_.sharePath||(Hn(),c))return;const D=setInterval(()=>{Hn()},4e3);return()=>clearInterval(D)},[a,_,c]),b.useEffect(()=>{if(!a)return;is();const D=setInterval(()=>{is()},4e3);return()=>{clearInterval(D),C5()}},[a]);const k=!!m.exports&&!m.formats?.length;b.useEffect(()=>{a&&k&&O4()},[a,k]);const M=_?_.role==="owner"&&!!m.formats?.length:Xi(m),z=(D,L)=>{if(D)return h.openShare("share");switch(L.reason){case"escape-key":if(A.current)return w(null);if(T.current.size||performance.now()-O.current<250)return;break;case"outside-press":{const B=L.event.target;if(B instanceof Element&&B.closest("[data-share-menu]"))return;break}case"focus-out":return}h.closeShare()};return p.jsxs(yM,{open:a,onOpenChange:z,children:[p.jsx(SM,{render:p.jsxs(it,{size:"lg",variant:"ghost",title:[E("share"),y?E(d?.cloud?"sharedWithOthers":"sharedOnNetwork"):"",v?E("pubCloudAt",{url:v}):""].filter(Boolean).join(" · "),"aria-label":E("share"),className:"gap-1.5 px-2 font-normal data-[popup-open]:bg-hover",icon:p.jsx(Vk,{className:"size-4"}),children:[p.jsx("span",{className:t.type==="docs"?void 0:"max-sm:hidden",children:E("share")}),y?p.jsx("span",{"aria-hidden":!0,"data-share-dot":"",className:"size-1.5 shrink-0 rounded-full bg-success max-sm:absolute max-sm:right-1 max-sm:top-1"}):null,v?p.jsx("span",{"data-share-published":"","aria-label":E("pubCloudMark"),className:"inline-flex text-accent max-sm:hidden",children:p.jsx($1,{className:"size-3.5"})}):null]})}),p.jsx(TM,{children:p.jsx(EM,{side:"bottom",align:"end",sideOffset:10,collisionPadding:12,className:"z-[1000]",children:p.jsxs(OM,{"aria-label":E("shareTitle"),className:"relative flex max-h-[min(var(--available-height),calc(100vh-24px))] w-[min(460px,calc(100vw-24px))] origin-[var(--transform-origin)] flex-col rounded-2xl bg-surface text-[13px] text-fg shadow-popup outline-none transition-[opacity,transform] duration-100 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",children:[p.jsx(AM,{className:"size-3.5 rotate-45 rounded-tl-[3px] border-l border-t border-line bg-surface data-[side=bottom]:-top-[7px]"}),p.jsxs(Ha.Provider,{value:C,children:[p.jsxs("div",{className:"min-h-0 overflow-auto overscroll-contain px-5 pb-5 pt-[18px]",children:[p.jsxs("div",{className:"mb-1.5 flex items-center gap-3",children:[p.jsx("h2",{className:"m-0 min-w-0 flex-1 truncate text-[17px] font-semibold tracking-[-0.01em]",children:o||E("shareTitle")}),p.jsx(za,{label:E("close"),icon:p.jsx(Sl,{className:"size-[18px]"}),size:"lg",noTooltip:!0,onClick:()=>h.closeShare()})]}),M?p.jsx(Ij,{"aria-label":E("share"),className:"mt-2.5 h-8",value:r,onChange:D=>h.setShareTab(D),options:[{value:"share",label:E("share")},{value:"export",label:E("export")}]}):null,p.jsx(C4,{}),r==="export"&&M?p.jsx(R4,{}):p.jsx(T4,{}),l?p.jsx("div",{role:"alert",className:"mt-3 text-xs text-danger",children:l}):null]}),S?p.jsx(r4,{spec:S,onDone:D=>{w(null),D&&S.run()}}):null]})]})})})]})}function N4({comments:t,command:o,readOnly:a=!1,disabled:r=!1}){const l=Q(h=>yf(h.report,"comment_selection"));if(!t||!VT({comments:t}))return null;const c=t.on,d=Math.max(0,t.count||0),g=!c&&d>0,m=c?E("doneCommenting"):d===1?E("openComment"):d>0?E("openComments",{count:R0(d)}):E("comments");return p.jsxs("span",{"data-comments-button":"",className:"inline-flex items-center",children:[p.jsx(v1,{label:m,children:p.jsx("button",{type:"button","aria-label":E("comments"),disabled:r,"aria-pressed":a?t.open:c,className:lt("inline-flex size-8 shrink-0 items-center justify-center rounded-control text-fg-muted transition-colors hover:bg-hover hover:text-fg","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent",c&&"text-fg"),onClick:()=>o(a?{cmd:"comments_list",open:!t.open}:{cmd:"comments_mode",on:!c}),children:p.jsxs("span",{className:"relative inline-flex",children:[p.jsx(Lm,{className:"size-4",fill:c?"currentColor":"none"}),g?p.jsx("span",{"aria-hidden":!0,"data-comments-dot":"",className:"absolute -right-0.5 -top-px size-1.5 rounded-full bg-accent ring-[1.5px] ring-surface"}):null]})})}),p.jsxs(el,{align:"end",trigger:p.jsx("button",{type:"button","aria-label":E("commentOptions"),disabled:r,title:E("commentOptions"),className:"-ml-0.5 inline-flex h-8 w-5 shrink-0 items-center justify-center rounded-control text-fg-muted hover:bg-hover hover:text-fg focus-visible:outline-2 focus-visible:outline-accent data-[popup-open]:bg-hover",children:p.jsx(Aa,{className:"size-3"})}),children:[l&&!a&&p.jsx(Nt,{disabled:l.disabled,onSelect:()=>o({cmd:"action",id:l.id}),children:E("actionCommentSelection")}),t.open?p.jsx(Nt,{onSelect:()=>o({cmd:"comments_list",open:!1}),children:E("hideComments")}):p.jsx(Nt,{onSelect:()=>o({cmd:"comments_list",open:!0}),children:p.jsxs("span",{className:"flex items-center gap-6",children:[p.jsx("span",{className:"flex-1",children:E("showAllComments")}),d?p.jsx("span",{className:"text-xs text-fg-subtle",children:R0(d)}):null]})})]})]})}function eS({title:t,close:o}){const a=Fn(),[r,l]=b.useState(t.slice(0,249)+" (copy)"),[c,d]=b.useState(!1),[g,m]=b.useState(""),h=async()=>{if(!(c||!r.trim())){d(!0);try{if(a.typeServer){const y=await fetch("_api/frame/duplicate",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:r})}),v=await y.json();if(!y.ok)throw new Error(v.message||y.statusText);location.assign(v.url)}else{const y=await Ct.duplicate(a.id,r);location.assign("/a/"+encodeURIComponent(y.id))}}catch(y){m(y instanceof Error?y.message:String(y)),d(!1)}}};return p.jsxs(Jw,{open:!0,title:E("duplicate"),onOpenChange:y=>{!y&&!c&&o()},footer:p.jsxs(p.Fragment,{children:[p.jsx(it,{disabled:c,onClick:o,children:E("cancel")}),p.jsx(it,{variant:"primary",disabled:c||!r.trim(),onClick:()=>{h()},children:E("duplicate")})]}),children:[p.jsx(tl,{autoFocus:!0,"aria-label":E("copyName"),value:r,maxLength:256,onFocus:y=>y.target.select(),onChange:y=>l(y.target.value),onKeyDown:y=>{y.key==="Enter"&&!y.nativeEvent.isComposing&&h()}}),g&&p.jsx("p",{role:"alert",className:"mt-2 text-sm text-danger",children:g})]})}const k4={save_now:p.jsx(Hk,{className:"size-3.5"}),open_find:p.jsx(Uk,{className:"size-3.5"}),undo:p.jsx(Yk,{className:"size-3.5"}),redo:p.jsx(Pk,{className:"size-3.5"}),edit_page:p.jsx(Im,{className:"size-3.5"}),use_page:p.jsx(hu,{className:"size-3.5"}),comment_selection:p.jsx(Lm,{className:"size-3.5"}),open_page_list:p.jsx(Ak,{className:"size-3.5"}),hand_off_code:p.jsx(Q1,{className:"size-3.5"})};function M4(){const t=og(),[o,a]=b.useState(t),r=b.useRef(null),l=b.useRef(!1),c=b.useRef(0);b.useEffect(()=>{c.current=performance.now(),r.current?.focus(),r.current?.select()},[]);const d=()=>{if(performance.now()-c.current<400){requestAnimationFrame(()=>{r.current?.focus(),r.current?.select()});return}g(!0)},g=m=>{l.current||(l.current=!0,Q.getState().setRenaming(!1),m&&g5(o))};return p.jsx(tl,{ref:r,value:o,maxLength:200,"aria-label":E("artifactName"),className:"h-8 w-[min(360px,50vw)] text-sm font-medium",onChange:m=>a(m.target.value),onBlur:d,onKeyDown:m=>{m.key==="Enter"&&!m.nativeEvent.isComposing?(m.preventDefault(),g(!0)):m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),g(!1))}})}function j4(){const t=Fn(),o=Q(c=>c.library),a=Qs(),{inSession:r,list:l}=FT(o??[],a);return p.jsxs(p.Fragment,{children:[p.jsx(_r,{children:E(r?"inThisSession":"recent")}),o===null?p.jsx(_r,{children:E("loading")}):null,l.slice(0,12).map(c=>p.jsx(Nt,{icon:c.id===t.id?p.jsx(Pr,{className:"size-3.5 text-accent"}):null,shortcut:wl(c.contentAt||c.updatedAt),onSelect:()=>{c.id!==t.id&&(location.href=`/a/${encodeURIComponent(c.id)}${location.search}`)},children:p.jsx("span",{className:lt("block max-w-56 truncate",c.id===t.id&&"font-semibold"),title:`${c.title} · ${c.typeTitle}`,children:c.title||c.id})},c.id)),p.jsx(Ko,{}),p.jsx(Nt,{icon:p.jsx(dw,{className:"size-3.5"}),shortcut:o?String(o.length):void 0,onSelect:()=>location.href="/",children:E("allArtifacts")})]})}function _4(){const t=Fn(),o=og(),a=Q(H=>H.menuOpen),r=Q(H=>H.renaming),[l,c]=b.useState(!1),d=Q(H=>H.confirmingDelete),g=Q(H=>H.artifact),m=Q(H=>H.report),h=Q(H=>H.library),y=Qs(),v=vE(),S=Ws(),w=vf(),T=!!w,O=xf(),A=!T,C=KD(O),_=A||!!w?.user,k=Wz(m).filter(H=>t.type!=="docs"||H.id!=="rename_doc"&&H.id!=="open_page_list"),M=!!t.page&&!t.empty&&!t.problem,z=Q.getState();b.useEffect(()=>{document.title=o},[o]);const D=H=>{z.setMenuOpen(H),H&&(Q.getState().library===null&&fE(),Ta())},L=p.jsx(NM,{open:d,onOpenChange:H=>z.setConfirmingDelete(H),title:E("deleteTitle",{title:o}),description:E("deleteBody",{root:t.root}),confirmLabel:E("delete"),danger:!0,onConfirm:()=>{b5()}});if(t.typeServer&&t.type==="docs")return p.jsxs(p.Fragment,{children:[p.jsxs(el,{trigger:p.jsxs("button",{type:"button","aria-label":E("artifactOptions"),className:"flex min-w-0 items-center gap-1 px-2",children:[p.jsx("span",{className:"truncate",children:o}),p.jsx(Aa,{className:"size-3.5"})]}),children:[m.actions?.some(H=>H.id==="rename_doc")&&p.jsx(Nt,{onSelect:()=>Ki("rename_doc"),children:E("rename")}),t.typeServer.role==="owner"&&p.jsx(Nt,{disabled:m.leaveLosesWork,onSelect:()=>c(!0),children:E("duplicate")}),p.jsx(Nt,{onSelect:()=>z.openShare("share"),children:E("share")}),t.typeServer.role==="owner"&&p.jsx(Nt,{onSelect:()=>z.openShare("export"),children:E("export")}),p.jsx(Nt,{onSelect:()=>bn({cmd:"history"}),children:E("versionHistory")})]}),l&&p.jsx(eS,{title:o,close:()=>c(!1)})]});if(r)return p.jsxs(p.Fragment,{children:[p.jsx(M4,{}),L]});const B=g?g.contentAt||g.updatedAt||g.createdAt:null,Y=FT(h??[],y).list.length;return p.jsxs(p.Fragment,{children:[p.jsxs(el,{open:a,onOpenChange:D,align:"start",trigger:p.jsxs("button",{type:"button",title:`${o} · ${t.typeTitle}`,"aria-label":E("artifactOptions"),className:"inline-flex h-8 min-w-0 max-w-full items-center gap-1 rounded-control px-2.5 text-sm font-medium text-fg outline-none hover:bg-hover focus-visible:outline-2 focus-visible:outline-accent data-[popup-open]:bg-hover",children:[p.jsx("span",{className:"truncate",children:o}),p.jsx(Aa,{className:"size-3.5 shrink-0 text-fg-muted"})]}),children:[p.jsx(e0,{icon:p.jsx(dw,{className:"size-3.5"}),label:p.jsxs("span",{className:"flex items-center justify-between gap-4",children:[E("switchArtifact"),h?p.jsx("span",{className:"text-xs text-fg-subtle",children:Y}):null]}),children:p.jsx(j4,{})}),p.jsx(_r,{children:p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(xk,{className:"size-3.5"}),E("updated",{when:wl(B)||E("never")})]})}),p.jsx(Ko,{}),p.jsx(Nt,{icon:p.jsx(Fk,{className:"size-3.5"}),onSelect:()=>z.openShare("share"),children:E("share")}),p.jsx(Nt,{icon:p.jsx(tw,{className:"size-3.5"}),disabled:!Xi(m),onSelect:()=>z.openShare("export"),children:E("export")}),v&&y?p.jsx(Nt,{icon:p.jsx(Pm,{className:"size-3.5"}),shortcut:y.live?y.harnessTitle??y.harness:`${y.harnessTitle??y.harness} · ${E("offline")}`,onSelect:pE,children:E("openSession")}):null,k.length?p.jsx(Ko,{}):null,k.map(H=>p.jsx(Nt,{icon:k4[H.id],disabled:H.disabled,onSelect:()=>Ki(H.id),children:p.jsx("span",{title:H.disabled?TE(H.why,S):void 0,children:o4(H)})},H.id)),_||C||A||m.history?p.jsx(Ko,{}):null,_?p.jsx(Nt,{icon:g?.pinned?p.jsx(_k,{className:"size-3.5"}):p.jsx(Dk,{className:"size-3.5"}),onSelect:()=>{m5()},children:g?.pinned?E("unpin"):E("pin")}):null,C?p.jsx(Nt,{icon:p.jsx(Im,{className:"size-3.5"}),disabled:t.type==="docs"&&!yf(m,"rename_doc"),onSelect:()=>t.type==="docs"?Ki("rename_doc"):z.setRenaming(!0),children:E("rename")}):null,A?p.jsx(Nt,{icon:p.jsx(hu,{className:"size-3.5"}),disabled:t.type==="docs"&&m.leaveLosesWork,onSelect:()=>t.type==="docs"?c(!0):void y5(),children:E("duplicate")}):null,m.history?p.jsx(Nt,{icon:p.jsx(Mw,{className:"size-3.5"}),onSelect:()=>bn({cmd:"history"}),children:E("versionHistory")}):null,p.jsx(Ko,{}),M?p.jsx(Nt,{icon:p.jsx(vl,{className:"size-3.5"}),onSelect:()=>tg(t.pageUrl||new URL(t.page,location.href).href),children:E("openInNewTab")}):null,p.jsx(Nt,{icon:p.jsx(zm,{className:"size-3.5"}),onSelect:()=>{Bh()},children:E("copyLink")}),M?p.jsx(Nt,{icon:p.jsx(Ik,{className:"size-3.5"}),onSelect:aE,children:E("refresh")}):null,A?p.jsxs(p.Fragment,{children:[p.jsxs(e0,{icon:p.jsx(wk,{className:"size-3.5"}),label:p.jsxs("span",{className:"flex items-center justify-between gap-4",children:[E("storage"),p.jsx("span",{className:"text-xs text-fg-subtle",children:x0(g?.bytes)})]}),children:[p.jsx(_r,{children:p.jsxs("span",{className:"flex max-w-72 items-start gap-2 break-all",title:t.root,children:[p.jsx(lw,{className:"mt-0.5 size-3.5 shrink-0"}),p.jsxs("span",{children:[t.root,g?p.jsx("span",{className:"block text-fg-subtle",children:E("inThisFolder",{size:x0(g.bytes)})}):null]})]})}),p.jsx(Ko,{}),p.jsx(Nt,{icon:p.jsx(hu,{className:"size-3.5"}),onSelect:()=>{S5()},children:E("copyPath")})]}),p.jsx(Ko,{}),p.jsx(Nt,{icon:p.jsx(Uw,{className:"size-3.5"}),danger:!0,onSelect:()=>z.setConfirmingDelete(!0),children:E("delete")})]}):null]}),l&&p.jsx(eS,{title:o,close:()=>c(!1)}),L]})}function D4(){const t=Ws();return L5()?p.jsxs("span",{role:"status",className:"inline-flex min-w-0 items-center gap-1.5 whitespace-nowrap text-xs text-fg-muted",children:[p.jsx(so,{className:"size-3.5 shrink-0 animate-spin text-accent motion-reduce:animate-none"}),p.jsx("span",{className:"truncate max-sm:hidden",children:E("working",{agent:t})})]}):null}function z4(t,o){const[a,r]=b.useState(!1);return b.useEffect(()=>{if(!t){r(!1);return}const l=setTimeout(()=>r(!0),o);return()=>clearTimeout(l)},[t,o]),t&&a}function L4(){const t=Q(l=>l.boot?.type==="docs"&&l.report.saved==="reconnecting"?"reconnecting":Zz(l.report)),o=z4(t==="saving",Qz),a=t==="saving"&&!o?"none":t,r="inline-flex min-w-0 items-center gap-1.5 whitespace-nowrap text-xs text-fg-muted";switch(a){case"saving":case"reconnecting":return p.jsxs("span",{role:"status","data-shell-save-state":a,className:r,children:[p.jsx(so,{className:"size-3.5 shrink-0 animate-spin motion-reduce:animate-none"}),p.jsx("span",{className:"max-sm:hidden",children:E(a)})]});case"unsaved":return p.jsxs("span",{role:"status","data-shell-save-state":"unsaved",title:E("notSavedTitle"),className:lt(r,"text-danger"),children:[p.jsx(Sk,{className:"size-3.5 shrink-0"}),p.jsx("span",{className:"max-sm:hidden",children:E("notSaved")})]});case"retry":return p.jsx(it,{"data-shell-save-state":"unsaved",size:"sm",variant:"ghost",className:"text-danger",title:E("notSavedTitle"),icon:p.jsx(_w,{className:"size-3.5"}),onClick:()=>Ki("save_now"),children:p.jsx("span",{className:"max-sm:hidden",children:E("saveRetry")})});case"readonly":return p.jsxs("span",{title:E("readOnlyTitle"),className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[11px] font-medium text-fg-muted",children:[p.jsx(cf,{className:"size-3"}),E("readOnly")]});default:return null}}function tS(){const t=Q(a=>a.report.history??(!a.pageReady&&a.rememberedChrome.history)),o=Q(a=>a.pageReady&&!!a.report.history);return t?p.jsx(za,{label:E("versionHistory"),icon:p.jsx(Mw,{className:"size-4"}),size:"lg",disabled:!o,onClick:()=>bn({cmd:"history"})}):null}function P4(){const t=Ws(),o=Q(d=>d.askOpen),a=vE(),r=Qs(),l=ag(),c=a&&r?E("openHarnessSession",{harness:r.harnessTitle??r.harness}):o?E("hideAsk"):E("messageAgent",{agent:t});return p.jsx(it,{size:"lg",variant:"ghost",title:c,"aria-expanded":o,className:lt(o&&"bg-hover"),icon:p.jsxs("span",{className:"relative",children:[p.jsx(Pm,{className:"size-4"}),p.jsx(bE,{state:l,className:"absolute -right-0.5 -top-0.5 size-1.5"})]}),onClick:()=>a&&!o?pE():Q.getState().setAskOpen(!o),children:p.jsx("span",{className:"max-sm:hidden",children:E("ask",{agent:t})})})}function I4(){const t=Q(h=>h.report.comments??(h.pageReady?void 0:h.rememberedChrome.comments)),o=Q(h=>h.pageReady&&!!h.report.comments),a=Q(h=>h.boot?.typeServer),r=Q(h=>h.boot?.type==="docs"),l=Q(h=>h.boot?.type==="docs"?h.report.title||h.boot.title:h.boot?.title),c=Q(h=>!!h.host?.caps.toolbar),d=xf(),g=xE(),m=vf();return p.jsxs("header",{"aria-label":E("artifactOptions"),className:lt("flex shrink-0 items-center gap-2 border-b border-line bg-surface pl-2.5 pr-2 max-sm:gap-1 max-sm:px-1.5",r?"h-10":"h-12"),children:[p.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[m?.site?.brand?p.jsx("a",{href:`${m.appOrigin}/`,className:"flex min-w-0 max-w-40 shrink-0 items-center rounded px-1 hover:bg-hover",children:p.jsx($5,{site:m.site,compact:!0})}):null,r&&p.jsx("button",{"aria-label":E("documentTabs"),className:"hidden size-7 shrink-0 items-center justify-center [@media(max-width:480px)_and_(pointer:coarse)]:inline-flex",onClick:()=>Ki("open_page_list"),children:p.jsx(jk,{className:"size-4"})}),a&&!r?p.jsx("span",{className:"truncate font-medium",children:l}):p.jsx(_4,{}),p.jsx(D4,{}),p.jsx(L4,{})]}),p.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[p.jsx(Z5,{}),!r&&p.jsx(tS,{}),p.jsx(A4,{}),r&&p.jsx(tS,{}),p.jsx(N4,{comments:t,command:bn,disabled:!o,readOnly:!PT(d)}),g?p.jsx(P4,{}):null,m?p.jsx(K5,{cloud:m}):null,c||a?null:p.jsx(za,{label:E("close"),icon:p.jsx(Sl,{className:"size-4"}),size:"lg",onClick:dE})]})]})}function H4(){const t=Q(a=>a.barHidden||!!a.boot&&gu(a.boot,location.href,_a)),o=Q(a=>a.askOpen);return b.useEffect(()=>{const a=new URLSearchParams(location.search),r=Q.getState();(a.get("toolbar")==="0"||r.boot&&gu(r.boot,location.href,_a))&&r.setBarHidden(!0),(a.get("chat")==="1"||a.get("ask")==="1")&&r.setAskOpen(!0);const l=wz(location.href);if(l){Q.getState().barHidden||r.openShare(l,{wait:!0});const g=YT(location.href,xa.panel);g&&history.replaceState(history.state,"",g)}zT(r.boot)&&N3({mayExport:w5});const c=u5();if(r.boot?.typeServer)return c;j5();const d=_5();return Ta(),fE(),()=>{c(),d()}},[]),p.jsxs("div",{className:"flex h-full flex-col overflow-hidden bg-canvas text-fg",children:[t?null:p.jsx(I4,{}),p.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[p.jsx(q5,{}),o&&!t?p.jsx(H5,{}):null]})]})}function U4(){const t=Q(a=>a.boot),o=Q(a=>a.bootError);return b.useEffect(()=>zD(window),[]),t?p.jsx(H4,{}):o?p.jsx(c0,{icon:p.jsx(xl,{className:"size-6"}),title:E("problemTitle"),children:o}):p.jsx(c0,{icon:p.jsx(so,{className:"size-6 animate-spin"}),title:E("loading")})}document.documentElement.lang=Fm;f5();KR.createRoot(document.getElementById("root")).render(p.jsx(b.StrictMode,{children:p.jsx(gN,{children:p.jsx(d_,{children:p.jsx(U4,{})})})}));
|
|
43
|
+
`)}mD();function gD(t){let o=t.trim();if(!o||/[\s/?#@\\%]/.test(o))return null;!o.startsWith("[")&&(o.match(/:/g)?.length??0)>=2&&(o=`[${o}]`);let a;try{a=new URL(`http://${o}/`).hostname}catch{return null}return a.replace(/^\[(.*)\]$/,"$1")}function _T(t){const o=/^(0|[1-9]\d{0,2})\.(0|[1-9]\d{0,2})\.(0|[1-9]\d{0,2})\.(0|[1-9]\d{0,2})$/.exec(t);if(!o)return null;const a=o.slice(1).map(Number);return a.every(r=>r<=255)?a:null}function _h([t,o]){return t===127?"loopback":t===10||t===172&&o>=16&&o<=31||t===192&&o===168||t===169&&o===254?"private":"refused"}function yD(t){if(!/^[0-9a-f:]+$/.test(t))return null;const o=t.split("::");if(o.length>2)return null;const a=c=>c?c.split(":").map(d=>/^[0-9a-f]{1,4}$/.test(d)?Number.parseInt(d,16):Number.NaN):[],r=a(o[0]),l=o.length===2?a(o[1]):[];return[...r,...l].some(c=>Number.isNaN(c))||(o.length===1?r.length!==8:r.length+l.length>7)?null:[...r,...new Array(8-r.length-l.length).fill(0),...l]}function bD(t){const[o,a,r,l,c,d,g,m]=t;return o===0&&a===0&&r===0&&l===0&&c===0?d===0&&g===0&&m===1?"loopback":d===65535?_h([g>>8,g&255,m>>8,m&255]):"refused":(o&65024)===64512||(o&65472)===65152?"private":"refused"}const vD=["nip.io","sslip.io"],xD=[".local",".lan",".home.arpa",".internal"],SD=/(?:^|[.-])0\d/;function wD(t){const o=vD.find(g=>t.endsWith(`.${g}`));if(!o)return null;const a=t.slice(0,-(o.length+1)).split(".");if(a.some(g=>g.includes("--")))return null;const r=[],l=[],c=g=>{for(let m=0;m+4<=g.length;m++){const h=g.slice(m,m+4).join(".");if(SD.test(h))return!1;const y=_T(h);y&&r.push(y)}return!0};let d=[];for(const g of[...a,""])if(/^\d+$/.test(g))d.push(g);else{if(!c(d))return null;d=[]}for(const g of a){const m=g.split("-");let h=[];for(const v of[...m,""])if(/^\d+$/.test(v))h.push(v);else{if(!c(h))return null;h=[]}const y=/^[0-9a-f]{8}$/.test(m.at(-1)??"")?m.at(-1):null;if(y){const v=Number.parseInt(y,16);l.push([v>>>24,v>>>16&255,v>>>8&255,v&255])}}return r.length?[...r,...l]:[]}function g0(t){const o=gD(t);if(!o)return"refused";const a=_T(o);if(a)return _h(a);if(o.includes(":")){const g=yD(o);return g?bD(g):"refused"}const r=o.endsWith("."),l=r?o.slice(0,-1):o,c=l.split(".");if(c.some(g=>!g))return"refused";if(l==="localhost"||l.endsWith(".localhost"))return"loopback";if(c.length===1)return r?"refused":"private";if(xD.some(g=>l.endsWith(g)))return"private";const d=wD(l);return d?.length&&d.every(g=>_h(g)!=="refused")?"private":"refused"}const y0="__OPEN_ARTIFACT_BOOT_PREFETCH__",TD="__OPEN_ARTIFACT_WATCHDOG__",b0="__OPEN_ARTIFACT_VITALS__",ED="/api/open-artifact.artifacts.boot",CD=3e4,RD={skeleton:"oa-preboot",error:"oa-preboot-error"},OD="data-oa-preboot-bar",AD=["oa:preboot","oa:boot","oa:frame-src","oa:frame-load","oa:frame-ready"];function ND(t,o=!1){return`${ED}?${new URLSearchParams(o?{id:t,fresh:"1"}:{id:t})}`}function kD(t,o){try{const a=t.performance;a&&typeof a.mark=="function"&&!a.getEntriesByName(o,"mark").length&&a.mark(o)}catch{}}function MD(t){const o={};try{for(const a of AD){const r=t?.getEntriesByName(a,"mark")[0];r&&(o[a]=Math.round(r.startTime*10)/10)}}catch{}return Object.freeze(o)}function jD(t){try{if(Object.getOwnPropertyDescriptor(t,b0))return;Object.defineProperty(t,b0,{configurable:!0,enumerable:!1,get:()=>MD(t.performance)})}catch{}}function _D(t){try{for(const o of t?.getAnimations?.()??[])o.startTime=0}catch{}}function DD(t,o){const a=t,r=a[y0];return r?(delete a[y0],r.url===ND(o)&&r.res&&typeof r.res.then=="function"?r:null):null}function zD(t){try{t[TD]?.disarm();for(const o of Object.values(RD))t.document.getElementById(o)?.remove();t.document.documentElement?.removeAttribute(OD)}catch{}}function LD(){const t=typeof navigator>"u"?void 0:navigator.locks;return!t||typeof BroadcastChannel>"u"||typeof EventSource>"u"?null:{openSource:o=>new EventSource(o),openChannel:o=>new BroadcastChannel(o),locks:t}}function PD(t,o){const a=`open-artifact.events ${t}`,r=new Set;let l=null,c=null,d=null;const g=y=>{for(const v of[...r])try{v(y)}catch{}},m=()=>{l=o.openChannel(a),l.onmessage=v=>{typeof v.data=="string"&&g(v.data)};const y=new AbortController;c=y,o.locks.request(a,{signal:y.signal},async()=>{if(y.signal.aborted)return;const v=o.openSource(t);v.onmessage=S=>{g(S.data),l?.postMessage(S.data)},await new Promise(S=>d=S),v.close()}).catch(()=>{})},h=()=>{c?.abort(),c=null,d?.(),d=null,l?.close(),l=null};return{listen(y){return r.add(y),r.size===1&&m(),()=>{r.delete(y)&&(r.size||h())}}}}const v0=new Map;function ID(t,o){let a=v0.get(t);return a||(a=PD(t,o),v0.set(t,a)),a}class ja extends Error{code;status;fix;constructor(o,a,r,l){super(a),this.name="ApiError",this.code=o,this.status=r,this.fix=l}}async function HD(t){try{const o=await t.json();return o&&typeof o=="object"?o:{}}catch{return{}}}const UD=15e3;async function DT(t){const o=await HD(t);if(!t.ok){const a=typeof o.code=="string"?o.code:"error",r=typeof o.message=="string"?o.message:`HTTP ${t.status}`;throw new ja(a,r,t.status,typeof o.fix=="string"?o.fix:void 0)}return o}function BD(t={}){const o=(t.base??"").replace(/\/$/,""),a=t.fetch??((c,d)=>fetch(c,d)),r=(c,d)=>`${o}/api/open-artifact.${c}${d?`?${new URLSearchParams(d)}`:""}`;async function l(c,d={}){const g=d.body===void 0?{cache:"no-store"}:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d.body)};d.body===void 0&&typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function"&&(g.signal=AbortSignal.timeout(d.timeoutMs??UD));let m;try{m=await a(r(c,d.query),g)}catch(h){throw new ja("connect_failed",h instanceof Error?h.message:String(h),0)}return DT(m)}return{async artifacts(){const c=await l(an.artifacts);return Array.isArray(c.artifacts)?c.artifacts:[]},artifact:c=>l(an.artifact,{query:{id:c}}),async types(){const c=await l(an.types);return{roots:Array.isArray(c.roots)?c.roots:[],types:Array.isArray(c.types)?c.types:[]}},share:c=>l(an.share,{query:{id:c}}),setShare:c=>l(an.share,{body:c}),create:c=>l(an.create,{body:c}),update:c=>l(an.update,{body:c}),duplicate:(c,d)=>l(an.duplicate,{body:{id:c,...d&&{name:d}}}),remove:c=>l(an.delete,{body:{id:c}}),restore:c=>l(an.restore,{body:{id:c}}),async trashed(){const c=await l(an.artifacts,{query:{trashed:"1"}});return Array.isArray(c.artifacts)?c.artifacts:[]},purge:c=>l("artifacts.purge",{body:{id:c}}),ask:c=>l(an.ask,{body:c}),open:c=>l(an.open,{body:{id:c,host:!1}}),boot:(c,d)=>l(an.boot,{query:d?.fresh?{id:c,fresh:"1"}:{id:c},timeoutMs:CD}),async remotes(){const c=await l("remotes"),d=c.cloud&&typeof c.cloud=="object"&&Array.isArray(c.cloud.pending)?c.cloud:null;return{remotes:Array.isArray(c.remotes)?c.remotes:[],cloud:d}},cloudSettings:c=>l("cloud.settings",{body:c}),connect:(c,d)=>l("remotes.add",{body:{name:c,host:d,browse:!1}}),connectCancel:c=>l("remotes.add.cancel",{body:{name:c}}),connectWait:(c,d)=>l("remotes.add.wait",{body:{name:c,ms:d}}),publish:(c,d,g={})=>l("artifacts.publish",{body:{id:c,remote:d,...g.data?{data:!0}:{}}}),unpublish:c=>l("artifacts.unpublish",{body:{id:c}}),dataPublish:(c,d={})=>l("artifacts.data",{body:{id:c,...d}}),eventsUrl:r(an.events),archiveUrl:c=>r(an.archive,{id:c}),typeIconUrl:c=>r("type.icon",{id:c})}}const Ct=BD();function Bn(t){return t instanceof Error?t.message:String(t)}const VD=new Set(["artifacts/changed","types/changed","harness/changed","wake/state"]);function FD(t){try{const o=JSON.parse(t);if(!o||typeof o!="object")return null;const a=o.type;return typeof a=="string"&&VD.has(a)?o:null}catch{return null}}function YD(t,o={}){const a=o.url??Ct.eventsUrl,r=g=>{const m=FD(g);m&&t(m)},l=o.shared!==void 0?o.shared:o.EventSource?null:LD();if(l)return ID(a,l).listen(r);const c=o.EventSource??(typeof EventSource>"u"?null:EventSource);if(!c)return()=>{};let d;try{d=new c(a)}catch{return()=>{}}return d.onmessage=g=>r(g.data),()=>d.close()}function wl(t,o=Date.now(),a=Fm){if(!t)return"";const r=Date.parse(t);if(!Number.isFinite(r))return"";const l=Math.max(0,(o-r)/1e3);if(l<60)return E("justNow");const c=new Intl.RelativeTimeFormat(a,{numeric:"auto"});return l<3600?c.format(-Math.round(l/60),"minute"):l<86400?c.format(-Math.round(l/3600),"hour"):l<86400*30?c.format(-Math.round(l/86400),"day"):new Date(r).toLocaleDateString(a)}function x0(t){if(typeof t!="number"||!Number.isFinite(t))return"";if(t<1024)return`${t} B`;const o=["KB","MB","GB","TB"];let a=t/1024,r=0;for(;a>=1024&&r<o.length-1;)a/=1024,r++;return`${a<10?a.toFixed(1):Math.round(a)} ${o[r]}`}function Ym(t){const o=String(t??"").trim();if(!o)return"?";if(/^[-ヿ㐀-鿿가-]/.test(o))return[...o][0];const a=o.split(/\s+/);return((a[0]?.[0]??"")+(a[1]?.[0]??"")).toUpperCase()||"?"}const S0=["#0f766e","#4f46e5","#b45309","#7c3aed","#be185d","#0369a1","#4d7c0f","#9f1239"];function qm(t){let o=0;for(const a of t)o=o*31+a.charCodeAt(0)|0;return S0[Math.abs(o)%S0.length]}function w0(t){return/folder/i.test(t)?"folder":/pdf/i.test(t)?"pdf":/word|docx/i.test(t)?"document":/powerpoint|pptx|slides/i.test(t)?"slides":/excel|xlsx|csv|spreadsheet/i.test(t)?"spreadsheet":/png|jpe?g|image|svg/i.test(t)?"image":/html|web page/i.test(t)?"html":/video|mp4|gif/i.test(t)?"video":/markdown|text|\.md\b/i.test(t)?"text":"file"}async function mf(t){try{await navigator.clipboard.writeText(t)}catch{const o=document.createElement("textarea");o.value=t,o.style.position="fixed",o.style.opacity="0",document.body.append(o),o.select(),document.execCommand("copy"),o.remove()}}function qD(t){if(!t)return"";const o=/filename\*\s*=\s*(?:UTF-8|utf-8)''([^;]+)/.exec(t);if(o)try{return decodeURIComponent(o[1].trim())}catch{}const a=/filename\s*=\s*"([^"]*)"|filename\s*=\s*([^;]+)/.exec(t);return(a?.[1]??a?.[2]??"").trim()}function zT(t){return!!t?.cloud}function nh(t){return typeof t!="string"||t.length===0||t.length>2048||/[\u0000-\u001f\u007f]/.test(t)?!1:t.startsWith("/")?!t.startsWith("//")&&!t.includes("\\"):/^https?:\/\//i.test(t)}function T0(t,o){if(typeof t!="string")return null;const a=t.trim();return a.length>0&&a.length<=o?a:null}function LT(t){if(!t||typeof t!="object")return;const o=t,a=[];if(Array.isArray(o.links))for(const l of o.links){if(!l||typeof l!="object")continue;const{label:c,href:d,where:g}=l,m=T0(c,80);m&&nh(d)&&(g==="account-menu"||g==="home")&&a.push({label:m,href:d,where:g})}let r;if(o.brand&&typeof o.brand=="object"){const{name:l,logoUrl:c}=o.brand,d=T0(l,80);(d||nh(c))&&(r={...d?{name:d}:{},...nh(c)?{logoUrl:c}:{}})}if(!(a.length===0&&!r))return{...a.length>0?{links:a}:{},...r?{brand:r}:{}}}function GD(t,o){return(LT(t)?.links??[]).filter(a=>a.where===o).map(({label:a,href:r})=>({label:a,href:r}))}function XD(t,o){if(t.startsWith("/"))return!1;try{return new URL(t).origin!==o}catch{return!0}}function Tl(t){return t?.cloud?.role??t?.typeServer?.role??"owner"}function KD(t){return t==="owner"||t==="editor"}function PT(t){return t!=="viewer"}function $D(t,o){return t==="owner"?!0:t==="editor"&&(o?.editorsCanAskAgent??!0)}function IT(t,o){return t!=="viewer"||!!o?.viewersCanExport}function WD(t,o){const a={agent:t.name};switch(t.state){case"online":return{key:"askCloudOnline",vars:a};case"offline":return{key:"askCloudOffline",vars:a};case"mcp":return{key:"askCloudMcp",vars:a};case"none":return{key:o?"askCloudNone":"askCloudNoneOther"}}}function QD(t,o){const a={agent:o.name};return t==="delivered"?{key:"sentCloudDelivered",vars:a}:o.state==="mcp"?{key:"sentCloudMcp",vars:a}:o.state==="offline"||o.state==="online"?{key:"sentCloudOffline",vars:a}:{key:"sentCloudNone"}}function ZD(t){return!t||t.state==="none"?"none":t.state==="online"?"idle":"offline"}function JD(t,o,a){let r;try{r=new URL(t,a)}catch{return t}return!r.searchParams.has("return_to")&&o.startsWith("/")&&!o.startsWith("//")&&r.searchParams.set("return_to",o),r.origin===a?`${r.pathname}${r.search}${r.hash}`:r.href}function HT(t){if(!t||typeof t!="object")return null;const o=t.accessLogoutUrl;if(typeof o!="string")return null;try{const a=new URL(o);return a.protocol==="https:"||a.protocol==="http:"?a.href:null}catch{return null}}function ez(t){if(!t||typeof t!="object")return!1;if(UT(t))return!0;const o=t.providers;return Array.isArray(o)&&o.some(a=>!!a&&typeof a=="object"&&a.id==="cloudflare-access")}function UT(t){return HT(t)}const tz=/^[^\s@,;<>()"]+@([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)$/i,nz=/^@([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+)$/i;function oz(t){const o=t.trim().replace(/^<|>$/g,"").toLowerCase();if(nz.test(o)){const a=o.slice(1);return{id:`domain:${a}`,kind:"domain",label:`@${a}`}}return tz.test(o)?{id:`email:${o}`,kind:"email",label:o}:null}function sz(t){const o=[],a=[],r=new Set;for(const l of t.split(/[\s,;]+/)){if(!l)continue;const c=oz(l);c?r.has(c.id)||(r.add(c.id),o.push(c)):a.push(l)}return{members:o,invalid:a}}function az(t){const o=t.indexOf(":");if(o<=0||o===t.length-1)return null;const a=t.slice(0,o),r=t.slice(o+1);return a==="group"?r.includes(":")&&!r.startsWith(":")&&!r.endsWith(":")?{kind:a,value:r}:null:a==="user"||a==="email"||a==="domain"?{kind:a,value:r}:null}function rz(t,o){return{members:Object.fromEntries(t.map(a=>[a.id,o]))}}function E0(t,o){return{members:{[t]:o}}}function iz(t){return{access:t}}function C0(t,o){return{settings:{[t]:o}}}function lz(t){return t!=="restricted"}function cz(t){return t.access!=="restricted"||t.members.length>0}function uz(t,o){const a=t.cloud;if(!a)return t;let r=a.members;for(const[c,d]of Object.entries(o.members??{}))if(d===null)r=r.filter(g=>g.id!==c);else if(r.some(g=>g.id===c))r=r.map(g=>g.id===c?{...g,role:d}:g);else{const g=az(c);if(!g||g.kind!=="email"&&g.kind!=="domain")continue;r=[...r,{id:c,kind:g.kind,label:g.kind==="domain"?`@${g.value}`:g.value,role:d,pending:g.kind==="email"}]}const l={...t.links};for(const[c,d]of Object.entries(o.links??{})){const g=l[c];g&&(l[c]={...g,on:d})}return{...t,links:l,cloud:{...a,members:r,access:o.access??a.access,settings:{...a.settings,...o.settings}}}}function fz(t,o){return!o||!o.length?"undeclared":o.includes(t)?"declared":"refused"}function BT(t,o,a,r="frame"){const l=Y_(t);return!l||l.openArtifact!=="host_hello"?null:{origin:o,caps:l.caps,agentName:l.agentName??null,declared:a,via:r,theme:l.theme??null,destinations:a?l.destinations??[]:[]}}function dz(t,o){if(t.declared)return o;switch(o.openArtifact){case"new_session":return{...o,prompt:""};case"comment_summon":return{...o,text:""};case"open_external":case"saved_file":return null;default:return o}}function pz(t,o){return`Export "${o}" and send it to the destination the person picked in the Export tab: "${t.label}" (destination id: ${t.id}). The host app that embeds the Shell offered this destination.`}function hz(t){if(!t||!/^#[0-9a-f]{6}$/i.test(t))return{};const[o,a,r]=[1,3,5].map(d=>parseInt(t.slice(d,d+2),16)/255),l=d=>d<=.03928?d/12.92:((d+.055)/1.055)**2.4,c=.2126*l(o)+.7152*l(a)+.0722*l(r);return{"--open-artifact-accent":t.toLowerCase(),"--open-artifact-accent-fg":c>.4?"#0b1220":"#ffffff","--open-artifact-accent-soft":`${t.toLowerCase()}1f`}}const Hr=["editor","commenter","viewer"];function mz(t,o,a){return t?.agentName||o?.agentName||a}function Gm(t,o){return t?t.live&&t.status==="running":!!o.agent?.busy}function gz(t,o){return Gm(t,o)?"working":t?t.live?"idle":"offline":"none"}function yz(t,o){return!!(t?.caps.sessions&&o?.session)}function VT(t){return!!(t.comments?.available&&!t.comments.pageButton)}function R0(t){return!t||t<0?"":t>99?"99+":String(t)}function O0(t){return Date.parse(t.openedAt||t.contentAt||t.updatedAt||t.createdAt||"")||0}function FT(t,o){const a=o?.session?t.filter(c=>c.owner&&c.owner.harness===o.harness&&c.owner.session===o.session):[],r=a.length>1;return{inSession:r,list:[...r?a:t].sort((c,d)=>O0(d)-O0(c))}}const bz=/^#(?:page|artboard|play)-[^=&]+$/;function Xm(t){const o=new URLSearchParams(t.replace(/^#/,"")).get("page");return o?"#"+new URLSearchParams({page:o}).toString():""}function gf(t){if(t.startsWith("#sheet-")&&!t.includes("=")){const o=t.slice(7);return o?"#"+new URLSearchParams({page:o}).toString():""}return Xm(t)}const vz=new Set(["slides","data"]);function gu(t,o,a){return a&&vz.has(t.type)&&new URL(o).hash===M_}function xz(t,o,a=!1){if(!t.page)return null;const r=new URL(o),l=r.searchParams.get(xa.comment);try{const c=new URL(t.page,r.href);if(c.searchParams.set(xa.shell,r.origin),c.searchParams.set(xa.id,t.id),t.type==="slides"&&Ma.test(r.hash)&&(c.hash=r.hash),t.type!==void 0&&gu({type:t.type},r.href,a)&&(c.hash=r.hash),t.type==="docs"){c.searchParams.set("doc_link_base",t.typeServer?.invite||r.origin+r.pathname);const d=r.searchParams.get("tab");d&&c.searchParams.set("tab",d),c.hash=r.hash}if(t.type==="sheets"&&(c.hash=gf(r.hash)),t.type==="design"){const d=bz.test(r.hash)?r.hash:Xm(r.hash);d&&(c.hash=d)}return(t.type==="design"||t.type==="slides")&&(r.searchParams.get("open_artifact_engine")==="off"&&c.searchParams.set("open_artifact_engine","off"),r.searchParams.get("open_artifact_live")==="all"&&c.searchParams.set("open_artifact_live","all")),l&&c.searchParams.set(xa.comment,l),c.href}catch{return t.page}}function YT(t,o){const a=new URL(t);return a.searchParams.has(o)?(a.searchParams.delete(o),`${a.pathname}${a.search}${a.hash}`):null}function Sz(t){return YT(t,xa.comment)}function wz(t){const o=new URL(t).searchParams.get(xa.panel);return o==="share"||o==="export"?o:null}function Tz(t,o){try{return t?new URL(t,o).origin:new URL(o).origin}catch{return new URL(o).origin}}function Ez(t,o,a){return t?.cloud?cz(t.cloud):t?t.lan:!!(o.shareOn||a?.shared)}function qT(t){return[...t.guests??[]].sort((o,a)=>Number(a.online)-Number(o.online)||(a.seen??a.joined).localeCompare(o.seen??o.joined))}function Cz(t){const o=t.addresses??[],a=o.filter(l=>l!==t.tailnet?.address),r=t.port?`:${t.port}`:"";return(a.length?a:o).map(l=>`${l.includes(":")?`[${l}]`:l}${r}`)}function Rz(t){return[...Hr].reverse().find(o=>t.links[o]?.on)??null}function Oz(t,o){return t==="live"&&o==="drafted"?"drafted":t==="live"||t==="wait"||t==="link"&&o==="delivered"?"delivered":t==="inbox"||t==="link"?"inbox":"failed"}function Az(t,o,a=50){return[...t,o].slice(-a)}function Nz(t){if(!t)return[];try{const o=JSON.parse(t);return Array.isArray(o)?o.filter(a=>!!a&&typeof a=="object"&&typeof a.text=="string"&&typeof a.at=="string").map(a=>({text:a.text,at:a.at,delivery:a.delivery==="inbox"||a.delivery==="failed"||a.delivery==="drafted"?a.delivery:"delivered"})):[]}catch{return[]}}function A0(t,o){const a=t;if(!a||typeof a!="object"||a.id!==o.id||typeof a.title!="string"||typeof a.type!="string")throw new Error(`No boot for ${o.id}.`);const{pending:r,...l}=a;return l}function kz(t){return{...t,page:null,pageUrl:null,pageKind:null,problem:null,pending:!0}}function GT(t,o){const{pending:a,...r}=t;return{...r,page:null,pageUrl:null,pageKind:null,problem:o}}function Mz(t){const o=t;return!o||typeof o!="object"||o.openArtifact!=="frame_denied"?null:j_.includes(o.reason)?o.reason:"not_open"}function jz(t,o){return o||t.typeServer?"problem":"reopen"}function _z(t){return t!=="server"}const Dz=1500,XT=150;function zz(t,o,a){return{id:t.id,url:t.url,title:t.title,type:t.type,typeTitle:t.typeTitle,root:t.root,page:o?.page??null,pageUrl:o?.page_url??null,pageKind:null,problem:o?null:a,empty:!1,prompt:null,owner:t.owner?{harness:t.owner.harness,key:null}:null,agentName:"",userName:"",version:"dev"}}const Lz=["saved","saving","unsaved","reconnecting","readonly"],Pz=["older_version","agent_working","draft_open","comments_on","needs_agent","unsaved","other"],N0=/^[a-z][a-z0-9_-]{0,31}$/,Iz=8,Hz=16,Uz=/^[a-z0-9]{1,8}$/,Bz=/^#[0-9a-fA-F]{6}$/,ya=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function ba(t,o){return typeof t!="string"?void 0:[...t.replace(/[\u0000-\u001f\u007f]+/g," ").trim()].slice(0,o).join("")||void 0}function k0(t){return Pz.includes(t)?t:void 0}function KT(t){if(!ya(t))return{};const o={};typeof t.title=="string"&&(o.title=t.title.trim().slice(0,256));for(const a of["comments","agent"])ya(t[a])&&(o[a]=t[a]);for(const a of["ready","history","share","shareOn","exports","leaveLosesWork","hasContent"])typeof t[a]=="boolean"&&(o[a]=t[a]);if(Lz.includes(t.saved)&&(o.saved=t.saved),Array.isArray(t.actions)){const a=new Set,r=[];for(const l of t.actions){if(!ya(l)||typeof l.id!="string"||!N0.test(l.id)||a.has(l.id))continue;a.add(l.id);const c=ba(l.label,48),d=k0(l.why);if(r.push({id:l.id,...c?{label:c}:{},...l.disabled===!0?{disabled:!0}:{},...d?{why:d}:{}}),r.length===18)break}o.actions=r}if(Array.isArray(t.formats)){const a=new Set,r=[];for(const l of t.formats){if(!ya(l)||typeof l.format!="string"||!Uz.test(l.format)||a.has(l.format))continue;a.add(l.format);const c=ba(l.label,48),d=ba(l.description,160),g=k0(l.why),m=ba(l.disabledReason,160),h=Array.isArray(l.variants)?l.variants.filter(y=>ya(y)&&typeof y.id=="string"&&N0.test(y.id)).slice(0,Hz).map(y=>{const v=ba(y.label,80),S=ba(y.disabledReason,160);return{id:y.id,...v?{label:v}:{},...y.disabled===!0?{disabled:!0}:{},...S?{disabledReason:S}:{}}}):void 0;if(r.push({format:l.format,...c?{label:c}:{},...d?{description:d}:{},...l.disabled===!0?{disabled:!0}:{},...g?{why:g}:{},...m?{disabledReason:m}:{},...l.interactive===!0?{interactive:!0}:{},...l.more===!0?{more:!0}:{},...h?.length?{variants:h}:{}}),r.length===Iz)break}o.formats=r}return ya(t.shareNotice)&&t.shareNotice.tone==="warning"&&typeof t.shareNotice.text=="string"&&t.shareNotice.text.trim()&&(o.shareNotice={text:t.shareNotice.text.slice(0,2e3),tone:"warning"}),Array.isArray(t.peers)&&(o.peers=Vz(t.peers)),t.following===null?o.following=null:typeof t.following=="string"&&MT.test(t.following)&&(o.following=t.following),o}function Vz(t){const o=new Set,a=[];for(const r of t){if(!ya(r)||typeof r.key!="string"||!MT.test(r.key)||o.has(r.key))continue;const l=ba(r.name,80);if(l&&(o.add(r.key),a.push({key:r.key,name:l,...typeof r.color=="string"&&Bz.test(r.color)?{color:r.color.toLowerCase()}:{},...r.self===!0?{self:!0}:{},...r.followsYou===!0?{followsYou:!0}:{}}),a.length===D_))break}return a}function Fz(t){return t.following!==void 0}function Yz(t){const o=t.following;return o?t.peers?.find(a=>a.key===o)??null:null}const M0=["#dc3c3d","#019c7f","#fbb315","#ce447d","#10a122","#257de0","#d25f25","#785ee8"];function qz(t){if(t.color)return t.color;let o=0;for(const a of t.key)o=o*31+a.charCodeAt(0)>>>0;return M0[o%M0.length]}function Gz(t){const o=r=>{const l=parseInt(t.slice(r,r+2),16)/255;return l<=.03928?l/12.92:((l+.055)/1.055)**2.4};return .2126*o(1)+.7152*o(3)+.0722*o(5)>.4?"#0b0b0b":"#ffffff"}function Xz(t){return(t.trim().split(/\s+/).filter(Boolean).slice(0,2).map(r=>[...r][0]??"").join("")||"?").toUpperCase()}function Kz(t){return!!(t.formats?.length||t.exports)}function $T(t){return t.saved!=="readonly"}function Xi(t){return Kz(t)||$T(t)}function yf(t,o){return t.actions?.find(a=>a.id===o)}const $z=new Set(["chat_toggle"]);function Wz(t){return(t.actions??[]).filter(o=>!$z.has(o.id))}const Qz=500;function Zz(t){const o=yf(t,"save_now");switch(t.saved){case"readonly":return"readonly";case"unsaved":return o&&!o.disabled?"retry":"unsaved";case"saving":case"reconnecting":return o?t.saved:"none";default:return"none"}}const Jz={pdf:"PDF",pptx:"PowerPoint",docx:"Word",xlsx:"Excel",png:"PNG",jpg:"JPEG",jpeg:"JPEG",svg:"SVG",gif:"GIF",mp4:"MP4",webm:"WebM",html:"HTML",md:"Markdown",csv:"CSV",json:"JSON",zip:"ZIP",txt:"Text"};function WT(t){const o=t.replace(/[_-]+/g," ").trim();return o?o[0].toUpperCase()+o.slice(1):t}function e3(t){const o=t.hasContent===!1,a=[];for(const r of t.formats??[]){const l=r.label??Jz[r.format]??r.format.toUpperCase(),c={kind:`${l} ${r.format}`,format:r.format,interactive:!!r.interactive,more:!!(r.more||r.interactive),...r.why?{why:r.why}:{}};if(r.variants?.length)for(const d of r.variants){const g=!!r.disabled||!!d.disabled,m=g?d.disabled&&d.disabledReason||r.disabledReason:void 0;a.push({...c,key:`${r.format}:${d.id}`,label:`${l} · ${d.label??WT(d.id)}`,...r.description?{description:r.description}:{},variant:d.id,disabled:o||g,...m?{disabledReason:m}:{}})}else a.push({...c,key:r.format,label:l,...r.description?{description:r.description}:{},disabled:o||!!r.disabled,...r.disabled&&r.disabledReason?{disabledReason:r.disabledReason}:{}})}return a}const j0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function t3(t=o=>crypto.getRandomValues(new Uint8Array(o))){return[...t(24)].map(o=>j0[o%j0.length]).join("")}const QT=/^[a-z0-9][a-z0-9_-]{0,31}$/i;function n3(t){return/^(\[[^\]]*\]|[^/:?#]+)/.exec(t)?.[1]??""}function ZT(t){const o=t.trim();if(!o)return{ok:!1,reason:{key:"pubHostEmpty"}};const a=/^[a-z][a-z0-9+.-]*:\/\//i.test(o)?o:`${g0(n3(o))==="refused"?"https":"http"}://${o}`;let r;try{r=new URL(a)}catch{return{ok:!1,reason:{key:"pubHostInvalid"}}}if(!r.hostname||r.protocol!=="https:"&&r.protocol!=="http:")return{ok:!1,reason:{key:"pubHostInvalid"}};if(r.username||r.password)return{ok:!1,reason:{key:"pubHostInvalid"}};if(r.protocol!=="http:")return{ok:!0,host:r.origin};const l=g0(r.hostname);return l==="refused"?{ok:!1,reason:{key:"pubHostNotHttps"}}:l==="private"?{ok:!0,host:r.origin,insecure:!0}:{ok:!0,host:r.origin}}function JT(t,o){if(!t?.length)return null;const a=o?.default??t.find(r=>r.default)?.name??null;return a&&t.some(r=>r.name===a)?a:t.length===1?t[0].name:null}function eE(t){return(t?.length??0)>1}function o3(t,o){const a=t?.pending.find(r=>r.id===o);return a?a.lastError?{kind:"failed",site:a.remote,attempts:a.attempts,error:a.lastError,code:a.code??"error"}:{kind:"publishing",site:a.remote}:null}function s3(t,o){const a=o?.find(l=>l.name===t.site),r=a?Vn(a.host):t.site??"";return t.kind==="publishing"?{key:"pubAutoPublishing",vars:{host:r}}:t.code==="signed_out"?{key:"pubAutoSignedOut",vars:{host:r}}:t.code==="unreachable"?{key:"pubAutoUnreachable",vars:{host:r}}:{key:"pubAutoFailed",vars:{host:r,error:t.error}}}function a3(t,o){let a="web";try{const c=(new URL(t).hostname.split(".")[0]??"").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,28);c&&QT.test(c)&&(a=c)}catch{}const r=new Set(o.map(l=>l.toLowerCase()));if(!r.has(a))return a;for(let l=2;;l++)if(!r.has(`${a}-${l}`))return`${a}-${l}`}function r3(t){return QT.test(t.trim())?null:{key:"pubNameInvalid"}}function Km(t,o){for(const a of t??[]){const r=a.artifacts.find(l=>l.id===o);if(r)return{remote:a,artifact:r}}return null}function i3(t){return t.signedIn?t.reachable?t.connected?"connected":"connecting":"unreachable":"signed_out"}function l3(t,o){const a=o.pending.length;return t.signedIn?t.reachable?o.lastError?o.code==="unreachable"?{kind:"offline",count:a}:o.code==="signed_out"?{kind:"signed_out",count:a}:{kind:"failed",error:o.lastError,count:a}:a?{kind:"waiting",count:a}:{kind:"in_sync",at:o.lastSyncAt??o.syncedAt}:{kind:"offline",count:a}:{kind:"signed_out",count:a}}function c3(t,o,a){switch(t.kind){case"in_sync":return t.at?{key:"pubInSyncAt",vars:{when:a(t.at)}}:{key:"pubInSync"};case"waiting":return{key:t.count===1?"pubWaitingOne":"pubWaiting",vars:{count:t.count}};case"offline":return{key:"pubOffline",vars:{host:Vn(o)}};case"signed_out":return{key:"pubSignedOutSync",vars:{host:Vn(o)}};case"failed":return{key:"pubSyncFailed",vars:{error:t.error}}}}function Vn(t){try{const o=new URL(t);return o.protocol==="https:"?o.host:`${o.protocol}//${o.host}`}catch{return t}}function u3(t,o){const a={host:Vn(o)};if(t.status===0)return{key:"pubNoDaemon"};switch(t.code){case"not_granted":case"access_denied":return{key:"pubConnectDenied",vars:a};case"timeout":case"expired_token":return{key:"pubConnectExpired"};case"connect_failed":return{key:"pubConnectUnreachable",vars:a};case"not_found":return/sign-in to .* is under way/i.test(t.message)?{key:"pubConnectExpired"}:{key:"pubConnectNotHost",vars:a};case"conflict":return{key:"pubNameTaken"};case"invalid_argument":return/https/i.test(t.message)?{key:"pubHostNotHttps"}:/remote name/i.test(t.message)?{key:"pubNameInvalid"}:{key:"pubHostInvalid"};case"server_failed":return/without a code|is it an Open Artifact host/i.test(t.message)?{key:"pubConnectNotHost",vars:a}:{key:"pubConnectFailed",vars:{error:t.message}};default:return{key:"pubConnectFailed",vars:{error:t.message}}}}function f3(t,o){const a={host:Vn(o)};if(t.status===0)return{key:"pubNoDaemon"};switch(t.code){case"conflict":return/published to .* already/i.test(t.message)?{key:"pubAlreadyElsewhere"}:{key:"pubIdTaken",vars:a};case"too_large":return{key:"pubTooLarge",vars:a};case"unauthorized":return{key:"pubSignedOut",vars:a};case"not_granted":return{key:"pubNotAllowed",vars:a};case"connect_failed":return{key:"pubUnreachable",vars:a};case"unsupported":return{key:"pubUnsupported",vars:a};default:return t.status===413?{key:"pubTooLarge",vars:a}:{key:"pubFailed",vars:{error:t.message}}}}function d3(t,o){const a={host:Vn(o)};if(t.status===0)return{key:"pubNoDaemon"};switch(t.code){case"connect_failed":return{key:"unpubUnreachable",vars:a};case"unauthorized":return{key:"pubSignedOut",vars:a};default:return{key:"unpubFailed",vars:{error:t.message}}}}async function p3(){try{const t=await fetch(`/api/open-artifact.${an.embed}`,{cache:"no-store",signal:AbortSignal.timeout(3e3)});if(!t.ok)return null;const o=await t.json();return Array.isArray(o.hosts)?o.hosts.filter(a=>typeof a=="string"):null}catch{return null}}class Ar extends Error{code;paths;retryable;constructor(o,a,r,l){super(a),this.name="ArtifactError",this.code=o,r&&(this.paths=r),l&&(this.retryable=!0)}}function h3(t,o){if(!t||typeof t!="object")return!1;const a=t;return a.name!=="ArtifactError"||typeof a.code!="string"?!1:o===void 0}function m3(t){return t==="owner"||t==="editor"}const Je={session:"_api/session",files:"_api/files",file:"_api/file",publish:"_api/publish",assets:"_api/assets",events:"_api/events",agentSend:"_api/agent/send",presence:"_api/presence",peers:"_api/peers",downloads:"_api/downloads",roomEmit:"_api/room/emit",dbGet:"_api/db/get",dbList:"_api/db/list",dbWrite:"_api/db/write",comments:"_api/comments",commentsCreate:"_api/comments/create",commentsReply:"_api/comments/reply",commentsEdit:"_api/comments/edit",commentsReact:"_api/comments/react",commentsResolve:"_api/comments/resolve",commentsMove:"_api/comments/move",commentsRemove:"_api/comments/remove",commentsSend:"_api/comments/send",history:"_api/history",historyFiles:"_api/history/files",historyFile:"_api/history/file",historyDiff:"_api/history/diff",historyRestore:"_api/history/restore",historyDismiss:"_api/history/dismiss",systemCopy:"_api/design/system-copy",mcpTools:"_api/mcp/tools",mcpCall:"_api/mcp/call",dataRefresh:"_api/data/refresh"},Qc={read:"_api/sheet/read",send:"_api/sheet/send",widget:"_api/sheet/widget",importFile:"_api/sheet/import"},g3="sheet",y3="sheetWalkthrough",Ps={session:"_api/doc/session",read:"_api/doc/read",call:"_api/doc/call",history:"_api/doc/history",version:"_api/doc/version",restore:"_api/doc/restore",importFile:"_api/doc/import",exportFile:"_api/doc/export"};function b3(t,o,a){return o===401||o===403?"removed":o<200||o>=300||!a||a.id===t.id&&a.role===t.role?null:"changed"}async function oh(t){let o={};try{o=await t.json()}catch{}const a=t.status===409?"conflict":t.status===403?"not_writer":t.status===404?"not_found":"unavailable";return new Ar(o.code??a,o.message??`HTTP ${t.status}`,o.paths,o.retryable===!0)}function v3(){const t=new Uint8Array(8);return crypto.getRandomValues(t),Array.from(t,o=>o.toString(16).padStart(2,"0")).join("")}function x3(t={}){const o=new URL(t.base??"./",location.href),a=v3(),r=(Y,U)=>{const I=new URL(Y,o);for(const[M,H]of Object.entries(U??{}))I.searchParams.set(M,H);return I.toString()},l=async(Y,U,I)=>{let M;try{M=await fetch(r(Y,I),U)}catch(H){throw new Ar("unavailable",H instanceof Error?H.message:String(H))}if(!M.ok)throw await oh(M);return await M.json()},c=(Y,U)=>l(Y,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(U)}),d=new Map,g=(Y,U)=>{for(const I of d.get(Y)??[])I(U)},m=(Y,U)=>{let I=d.get(Y);return I||(I=new Set,d.set(Y,I),v?.addEventListener(Y,w)),I.add(U),k(),()=>I.delete(U)};let h=null,y=!1,v=null,S=null;const w=Y=>{g(Y.type,JSON.parse(Y.data))},T=()=>{const Y=new EventSource(r(Je.events,{client:a}));v=Y;for(const U of d.keys())Y.addEventListener(U,w);Y.onerror=()=>{_().then(U=>{U||Y.readyState!==EventSource.CLOSED||v!==Y||(v=null,S=setTimeout(()=>{S=null,k()},2e3))})}};let O=!1,A=!1;const C=Y=>{O||(O=!0,S&&clearTimeout(S),S=null,v?.close(),v=null,h?.close(),h=null,t.onAccessChange?t.onAccessChange(Y):location.reload())},_=async()=>{if(O)return!0;if(!j||A)return!1;A=!0;try{const Y=(await j.catch(()=>null))?.viewer;if(!Y)return!1;let U;try{U=await fetch(r(Je.session),{cache:"no-store"})}catch{return!1}const I=U.ok?(await U.json().catch(()=>null))?.viewer:null,M=b3(Y,U.status,I);return M&&C(M),M!==null}finally{A=!1}};function k(){if(h||v||S||O)return;if(typeof WebSocket>"u")return T();const Y=new URL(r(Je.events,{client:a}));Y.protocol=Y.protocol==="https:"?"wss:":"ws:";const U=new WebSocket(Y);h=U,U.onopen=()=>{y=!0},U.onmessage=I=>{let M;try{M=JSON.parse(String(I.data))}catch{return}M.event&&g(M.event,M.data)},U.onclose=()=>{if(h===U&&(h=null),!O){if(!y)return T();_().then(I=>{I||h||v||S||(S=setTimeout(()=>{S=null,k()},2e3))})}}}let j=null;const z=()=>j??=l(Je.session),D={async artifact(){const{artifact:Y,stores:U}=await z();return{id:Y.id,...U?.systemCopy?{systemCopy:(M,H)=>l(Je.systemCopy,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({namespace:M,action:H})})}:{},title:async()=>(await l(Je.session)).artifact.title,list:async()=>(await l(Je.files)).files,readText:async M=>new TextDecoder().decode(await L(M)),readBytes:M=>L(M),publish:async M=>{const H={files:M,client:a};return l(Je.publish,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(H)})},onChange:M=>m("files",M)}},async assets(){const{viewer:Y}=await z();return m3(Y.role)?{upload:async(I,M)=>l(Je.assets,{method:"POST",headers:{"content-type":I.type||"application/octet-stream"},body:I},M?.name?{name:M.name}:void 0)}:null},async user(){const{viewer:Y}=await z();return{me:async()=>Y}},async agent(){return{send:async(U,I)=>{const M={request:U,deliver:I?.deliver??"send"};return l(Je.agentSend,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(M)})},status:async()=>(await l(Je.session)).agent,onStatus:U=>m("agent",U)}},async room(){return{self:async()=>a,presence:async U=>{const I={client:a,patch:U};await l(Je.presence,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(I)})},peers:async()=>(await l(Je.peers)).peers,onPeers:U=>m("peers",U),emit:async(U,I)=>{const M={client:a,topic:U,data:I};await c(Je.roomEmit,M)},onMessage:U=>m("room",U)}},async db(){const{stores:Y}=await z();return Y?.db?{get:async I=>(await l(Je.dbGet,{cache:"no-store"},{path:I})).data,list:async I=>(await l(Je.dbList,{cache:"no-store"},{collection:I})).documents,listing:async I=>{const{documents:M,epoch:H,seq:ee}=await l(Je.dbList,{cache:"no-store"},{collection:I});return typeof H=="string"&&typeof ee=="number"?{documents:M,epoch:H,seq:ee}:{documents:M}},write:async I=>{const M={writes:I,client:a},{epoch:H,seq:ee,documents:K}=await c(Je.dbWrite,M);return typeof H=="string"&&typeof ee=="number"&&K!==void 0?{epoch:H,seq:ee,documents:K}:void 0},onChange:I=>m("db",I)}:null},async comments(){const{stores:Y}=await z();if(!Y?.comments)return null;const U=async(M,H)=>(await c(M,H)).thread;return{list:async()=>(await l(Je.comments,{cache:"no-store"})).threads,create:M=>U(Je.commentsCreate,{input:M}),reply:(M,H,ee)=>U(Je.commentsReply,{threadId:M,text:H,...ee?.to?.length?{to:ee.to}:{}}),edit:(M,H,ee,K)=>U(Je.commentsEdit,{threadId:M,messageId:H,text:ee,...K?.to?{to:K.to}:{}}),react:(M,H,ee,K)=>U(Je.commentsReact,{threadId:M,messageId:H,emoji:ee,on:K}),setResolved:(M,H)=>U(Je.commentsResolve,{threadId:M,resolved:H}),move:(M,H,ee)=>U(Je.commentsMove,{threadId:M,anchor:H,...ee?{location:ee}:{}}),remove:async(M,H)=>{await c(Je.commentsRemove,{threadId:M,...H?{messageId:H}:{}})},sendToAgent:(M,H)=>U(Je.commentsSend,{threadId:M,...H?.unasked?{unasked:!0}:{}}),onChange:M=>m("comments",M)}},async doc(){const{stores:Y}=await z();return Y?.doc?{session:()=>c(Ps.session,{client:a}),read:I=>c(Ps.read,{tab:I}),call:I=>c(Ps.call,{...I,client:a}),history:I=>c(Ps.history,{tab:I}),version:(I,M)=>c(Ps.version,{tab:I,rev:M}),restore:I=>c(Ps.restore,I),importFile:(I,M,H)=>l(Ps.importFile,{method:"POST",headers:{"content-type":"application/octet-stream"},body:M},{name:I,...H?{tabName:H}:{}}),exportFile:async I=>{let M;try{M=await fetch(r(Ps.exportFile,{format:I.format,...I.tab?{tab:I.tab}:{},...I.paper?{paper:I.paper}:{}}),{cache:"no-store"})}catch(P){throw new Ar("unavailable",P instanceof Error?P.message:String(P))}if(!M.ok)throw await oh(M);const H=M.headers.get("content-disposition")??"",ee=decodeURIComponent(/filename\*=UTF-8''([^;]+)/.exec(H)?.[1]??"")||`doc.${I.format==="markdown"?"md":I.format}`;let K=[];try{K=JSON.parse(decodeURIComponent(M.headers.get("x-doc-export-notes")??"%5B%5D"))}catch{}return{name:ee,mime:M.headers.get("content-type")??"application/octet-stream",bytes:new Uint8Array(await M.arrayBuffer()),notes:K}},onFrame:I=>m("doc",I)}:null},async history(){const{stores:Y}=await z();if(!Y?.history)return null;const U=(M,H)=>({n:String(M),...H===void 0?{}:{path:H}});return{list:()=>l(Je.history,{cache:"no-store"}),files:async M=>(await l(Je.historyFiles,{cache:"no-store"},U(M))).files,read:async(M,H)=>new TextDecoder().decode(await B(Je.historyFile,U(M,H))),readBytes:(M,H)=>B(Je.historyFile,U(M,H)),diff:(M,H)=>l(Je.historyDiff,{cache:"no-store"},U(M,H)),restore:(M,H)=>c(Je.historyRestore,{n:M,...H?{paths:H}:{},client:a}),dismissNotice:async M=>{await c(Je.historyDismiss,{id:M})},onChange:M=>m("history",M)}},async mcp(){const{viewer:Y}=await z();return Y.role!=="owner"?null:{callTool:async(I,M,H,ee)=>{const K=ee?.signal;K?.throwIfAborted();const P={server:I,tool:M,args:H,...ee?.timeoutMs===void 0?{}:{timeoutMs:ee.timeoutMs}};try{return await l(Je.mcpCall,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(P),...K?{signal:K}:{}})}catch(q){throw K?.aborted?K.reason:q}},listTools:I=>l(Je.mcpTools,{cache:"no-store"},I===void 0?void 0:{server:I})}},async sheet(){const{stores:Y}=await z();if(!Y?.sheet)return null;let U=Promise.resolve();return{read:M=>c(Qc.read,M),send:M=>{const H=U.then(()=>c(Qc.send,M));return U=H.catch(()=>{}),H},widget:M=>c(Qc.widget,M),importFile:(M,H)=>l(Qc.importFile,{method:"POST",headers:{"content-type":M.type||"application/octet-stream"},body:M},{name:H}),onFrame:M=>m(g3,M),onWalkthrough:M=>m(y3,M)}},async downloads(){return{save:async({name:U,data:I})=>l(Je.downloads,{method:"POST",headers:{"content-type":I.type||"application/octet-stream"},body:I},{name:U})}}};function L(Y){return B(Je.file,{path:Y})}async function B(Y,U){let I;try{I=await fetch(r(Y,U),{cache:"no-store"})}catch(M){throw new Ar("unavailable",M instanceof Error?M.message:String(M))}if(!I.ok)throw await oh(I);return new Uint8Array(await I.arrayBuffer())}return{get(Y){const U=D[Y];return U?U():null}}}const Dh={artifact:["title","list","readText","readBytes","publish"],assets:["upload"],user:["me"],agent:["send","status"],room:["self","presence","peers","emit"],downloads:["save","check"],db:["get","list","listing","write"],comments:["list","create","reply","edit","react","setResolved","move","remove","sendToAgent"],history:["list","files","read","readBytes","diff","restore","dismissNotice"],doc:["session","read","call","history","version","restore","importFile","exportFile"],mcp:["callTool","listTools"],sheet:["read","send","widget","importFile"]},S3={artifact:{onChange:"files"},agent:{onStatus:"status"},room:{onPeers:"peers",onMessage:"message"},db:{onChange:"change"},comments:{onChange:"threads"},history:{onChange:"change"},sheet:{onFrame:"frame",onWalkthrough:"walkthrough"},doc:{onFrame:"frame"}},w3=6e4;function T3(t){const o=String(t).split(/[\\/]/).pop().replace(/[\u0000-\u001f\u007f]+/g,"").trim();return o&&o!=="."&&o!==".."?o.slice(0,200):"download"}function E3(){return{document,URL,setTimeout:(t,o)=>setTimeout(t,o)}}function C3(t,o=E3()){const a=o.URL.createObjectURL(t.data),r=o.document.createElement("a");return r.href=a,r.download=T3(t.name),r.rel="noopener",r.style.display="none",o.document.body.append(r),r.click(),r.remove(),o.setTimeout(()=>o.URL.revokeObjectURL(a),w3),{}}const _0="The owner has not let viewers download or export this artifact.";function R3(t,o){const a=o.save??(l=>C3(l)),r={save:async l=>{if(!await o.mayExport())throw new Ar("not_writer",_0);return a(l)},browser:!0,check:async()=>{if(!await o.mayExport())throw new Ar("not_writer",_0)}};return{get(l){return l==="mcp"?null:l==="downloads"?r:t.get(l)}}}const O3=new Set(["artifact.publish","assets.upload","downloads.save","agent.send","db.write","comments.sendToAgent","history.restore","doc.call","doc.restore","doc.importFile","doc.exportFile"]);let wa=0,Hs=null,tE=null;function D0(t){tE=t}let A3=t=>x3({base:t}),zh=null;function N3(t){zh=t}function k3(t,o){return wa+=1,t?.({openArtifact:"cap_rewired",gen:wa,...o?{caps:o}:{}}),wa}function M3(t){if(h3(t)){const o=t.paths;return{code:t.code,message:t.message,...o?{paths:o}:{},...t.retryable?{retryable:!0}:{}}}return{code:"unavailable",message:t instanceof Error?t.message:String(t)}}function j3(t,o){if(Hs?.base===t)return Hs;const a=Hs;for(const l of a?.stops??[])l();const r=A3(t);return Hs={base:t,provider:zh?R3(r,zh):r,namespaces:new Map,stops:[],granted:new Set},a?.granted.size&&k3(o,[]),Hs}function nE(t,o){let a=t.namespaces.get(o);return a||(a=Promise.resolve().then(()=>t.provider.get(o)).then(r=>r||null).catch(()=>null),t.namespaces.set(o,a)),a}function _3(t,o,a,r){if(t.granted.has(o))return;t.granted.add(o);const l=S3[o]??{};for(const[c,d]of Object.entries(l)){const g=a[c];if(typeof g!="function")continue;const m=g.call(a,h=>{Hs===t&&r({openArtifact:"cap_ev",cap:o,event:d,data:h})});t.stops.push(m)}}async function D3(t,o,a){const r=t.cap,l=()=>a({openArtifact:"cap_grant",cap:String(r),ok:!1,gen:wa});if(typeof r!="string"||!H_.test(r)||!Object.hasOwn(Dh,r)||t.protocol!==I_||typeof t.base!="string")return l();let c;try{c=new URL(t.base)}catch{return l()}if(c.origin!==o||!/^https?:$/.test(c.protocol))return l();c.hash="",c.search="";const d=j3(c.toString(),a),g=await nE(d,r);if(!g)return l();const m={};if(r==="artifact"&&(m.id=g.id),r==="downloads"&&g.browser===!0&&(m.browser=!0),r==="user")try{m.me=await g.me()}catch{}_3(d,r,g,a),a({openArtifact:"cap_grant",cap:r,ok:!0,gen:wa,config:m})}function z3(t){const o=t?.userActivation;return!!o&&o.isActive===!1}async function L3(t,o,a){const{id:r,cap:l,method:c}=t;if(typeof r!="string"||!r)return;const d=S=>a({openArtifact:"cap_r",id:r,error:S});if(t.gen!==wa)return l==="user"?a({openArtifact:"cap_r",id:r,result:null}):d({code:"unavailable",message:u0});const g=Object.hasOwn(Dh,l)?Dh[l]:null;if(!g||typeof c!="string"||!g.includes(c))return d({code:"invalid",message:`unknown method ${String(l)}.${String(c)}`});const m=Hs;if(!m?.granted.has(l))return d({code:"not_granted",message:`${l} was not granted to this page.`});const h=await nE(m,l),y=h?.[c];if(typeof y!="function")return d({code:"not_granted",message:`${l} is not available here.`});let v=Array.isArray(t.args)?[...t.args]:[];if(l==="agent"&&c==="send"&&z3(o)){const S=v[1]&&typeof v[1]=="object"?v[1]:{};v=[v[0],{...S,deliver:"stage"}]}O3.has(`${l}.${c}`)&&a({openArtifact:"cap_ack",id:r});try{const S=await y.apply(h,v);if(Hs!==m||t.gen!==wa)return d({code:"unavailable",message:u0});const w=S instanceof Uint8Array&&S.byteOffset===0&&S.byteLength===S.buffer.byteLength&&S.buffer instanceof ArrayBuffer?[S.buffer]:void 0;if(a({openArtifact:"cap_r",id:r,result:S},w),l==="downloads"&&c==="save"&&S&&typeof S.savedTo=="string")try{tE?.(S.savedTo)}catch{}}catch(S){d(M3(S))}}const P3=4;function I3(t,o,a=3*6e4){const r=new Map;function l(g,m){if(typeof g!="string"||!L_.test(g)||r.has(g))return;const h=Array.isArray(m)?m.filter(O=>typeof O=="string"):[],y=[...new Set(h)].filter(O=>z_.includes(O)&&t.supports(O));if(!y.length)return o(g,"This browser cannot copy that to the clipboard.");if(r.size>=P3)return o(g,"Still copying…");let v;const S=new Promise((O,A)=>{v=(C,_)=>{clearTimeout(w),r.delete(g),C?O(C):A(new Error(_||"Nothing to copy."))}}),w=setTimeout(()=>v(null,"The page did not send what to copy."),a);r.set(g,{types:y,settle:v});const T=Object.fromEntries(y.map(O=>{const A=S.then(C=>C[O]);return A.catch(()=>{}),[O,A]}));t.write(T).then(()=>o(g),O=>{r.get(g)?.settle(null,"The clipboard was not written."),o(g,O instanceof Error?O.message:String(O))})}function c(g,m,h){const y=typeof g=="string"?r.get(g):void 0;if(!y)return;if(typeof h=="string")return y.settle(null,h);if(!m||typeof m!="object")return y.settle(null,"Nothing to copy.");const v={};let S=0;for(const w of y.types){const T=m[w];if(!(T instanceof Blob))return y.settle(null,`No ${w} to copy.`);S+=T.size,v[w]=T.type===w?T:new Blob([T],{type:w})}if(S>P_)return y.settle(null,"Too large to copy.");y.settle(v)}function d(){for(const g of[...r.values()])g.settle(null,"The page went away.")}return{start:l,data:c,clear:d}}function H3(){return typeof ClipboardItem>"u"||!navigator.clipboard?.write?null:{write:t=>navigator.clipboard.write([new ClipboardItem(t)]),supports:t=>typeof ClipboardItem.supports=="function"?ClipboardItem.supports(t):t!=="image/svg+xml"}}function U3(t,o){switch(o.openArtifact){case"current_slide":return t==="slides"&&typeof o.hash=="string"&&Ma.test(o.hash)?o.hash:null;case"doc_place":return t==="docs"&&typeof o.hash=="string"&&hf.test(o.hash)?o.hash:null;case"sheet_page":return t==="sheets"&&typeof o.page=="string"&&o.page?"#"+new URLSearchParams({page:o.page}).toString():null;default:return null}}function B3(t,o){if(typeof o!="string"||o.length>1e3)return null;if(t==="slides")return Ma.test(o)?{cmd:"goto_slide",hash:o}:null;if(t==="docs")return hf.test(o)?{cmd:"goto_doc",hash:o}:null;if(t==="sheets"){const a=new URLSearchParams(gf(o).slice(1)).get("page");return a?{cmd:"goto_sheet",page:a}:null}return null}const z0=t=>{let o;const a=new Set,r=(h,y)=>{const v=typeof h=="function"?h(o):h;if(!Object.is(v,o)){const S=o;o=y??(typeof v!="object"||v===null)?v:Object.assign({},o,v),a.forEach(w=>w(o,S))}},l=()=>o,g={setState:r,getState:l,getInitialState:()=>m,subscribe:h=>(a.add(h),()=>a.delete(h))},m=o=t(r,l,g);return g},V3=(t=>t?z0(t):z0),F3=t=>t;function Y3(t,o=F3){const a=Pi.useSyncExternalStore(t.subscribe,Pi.useCallback(()=>o(t.getState()),[t,o]),Pi.useCallback(()=>o(t.getInitialState()),[t,o]));return Pi.useDebugValue(a),a}const q3=t=>{const o=V3(t),a=r=>Y3(o,r);return Object.assign(a,o),a},G3=(t=>q3);function oE(t,o){const a=t.ready===!1,r=(t.history??(a&&o.history))||void 0,l=t.comments;let c=a&&!l?o.comments:void 0;if(l?.available===!0&&l.pageButton===!1){const d=Number.isFinite(l.count)?Math.max(0,Math.floor(l.count)):0;c=o.comments?.count===d?o.comments:{available:!0,pageButton:!1,count:d,on:!1,open:!1}}return r===o.history&&c===o.comments?o:{...r&&{history:r},...c&&{comments:c}}}function X3(t){try{return oE(KT(JSON.parse(sessionStorage.getItem(`oa-shell-chrome:${t}`)??"null")),{})}catch{return{}}}const L0={view:null,unsupported:!1,error:"",exports:null,copied:null},K3={remotes:null,cloud:null,missing:!1,connect:{step:"closed"},busy:null,error:"",data:null},Q=G3()((t,o)=>({boot:null,bootError:null,bootGen:0,canRetry:!1,pageReady:!1,artifact:null,report:{},rememberedChrome:{},host:null,library:null,barHidden:!1,menuOpen:!1,shareOpen:!1,shareTab:"share",exportWanted:!1,share:L0,publish:K3,askOpen:!1,sent:[],askStatus:"",renaming:!1,confirmingDelete:!1,setBoot:(a,r=null,l=!1)=>t(c=>({boot:a,bootError:r,canRetry:l,bootGen:c.bootGen+1,pageReady:!a?.pending&&(!a?.page||!!a.empty||!!a.problem),report:{},rememberedChrome:a&&(a.pending||a.page&&!a.empty&&!a.problem)?X3(a.id):{}})),setFrameLoading:()=>t({report:{},pageReady:!1}),setPageReady:a=>t({pageReady:a}),setArtifact:a=>t({artifact:a}),mergeArtifact:a=>{const r=o().artifact;r&&t({artifact:{...r,...a}})},setReport:a=>t(r=>{const l=oE(a,r.rememberedChrome);if(r.boot&&l!==r.rememberedChrome)try{const c=`oa-shell-chrome:${r.boot.id}`;l.history||l.comments?sessionStorage.setItem(c,JSON.stringify(l)):sessionStorage.removeItem(c)}catch{}return{report:a,rememberedChrome:l,...r.exportWanted&&r.shareOpen&&Xi(a)&&{shareTab:"export",exportWanted:!1}}}),setHost:a=>t({host:a}),setLibrary:a=>t({library:a}),setBarHidden:a=>t({barHidden:a}),setMenuOpen:a=>t(a?{menuOpen:a,shareOpen:!1}:{menuOpen:a}),openShare:(a,r)=>t(l=>{const c=a==="export"&&Xi(l.report);return{shareOpen:!0,menuOpen:!1,shareTab:c?"export":"share",exportWanted:a==="export"&&!c&&!!r?.wait,share:l.shareOpen?l.share:{...L0,view:l.share.view,unsupported:l.share.unsupported}}}),closeShare:()=>t({shareOpen:!1,exportWanted:!1}),setShareTab:a=>t(r=>({shareTab:a==="export"&&!Xi(r.report)?"share":a,exportWanted:!1})),patchShare:a=>t(r=>({share:{...r.share,...a}})),patchPublish:a=>t(r=>({publish:{...r.publish,...a}})),setAskOpen:a=>t({askOpen:a}),setSent:a=>t({sent:a}),setAskStatus:a=>t({askStatus:a}),setRenaming:a=>t({renaming:a,menuOpen:!1}),setConfirmingDelete:a=>t({confirmingDelete:a}),closePopups:()=>t({menuOpen:!1,shareOpen:!1,exportWanted:!1})}));function Fn(){const t=Q(o=>o.boot);if(!t)throw new Error("The Shell rendered before its boot.");return t}const sE=`/api/open-artifact.${an.view}`,$3=5;let Is=null;const Lh=t=>`open-artifact.view.${t}`;function W3(t){try{const o=JSON.parse(sessionStorage.getItem(Lh(t))??"null");return o&&typeof o.view=="string"&&typeof o.key=="string"?{view:o.view,key:o.key}:null}catch{return null}}function P0(t,o){try{o?sessionStorage.setItem(Lh(t),JSON.stringify(o)):sessionStorage.removeItem(Lh(t))}catch{}}function Q3(){const t=new URL(location.href),o=t.searchParams.get(f0);return o===null?null:(t.searchParams.delete(f0),history.replaceState(history.state,"",t),o||null)}function Z3(t,o){const a=Q3(),r=a?null:W3(t);if(!a&&!r)return null;let l=!1,c=null,d=0;const g=(m,h)=>{const y=new URLSearchParams({view:m,id:t,...h?{key:h}:{}});c=new EventSource(`${sE}?${y}`),c.addEventListener("view",v=>{try{const S=JSON.parse(v.data);if(typeof S.view!="string"||typeof S.key!="string")return;Is={view:S.view,key:S.key},P0(t,Is),d=0,o.onOpen()}catch{}}),c.addEventListener("command",v=>{try{o.onCommand(JSON.parse(v.data))}catch{}}),c.addEventListener("error",()=>{if(c?.close(),c=null,l)return;if(!Is||d>=$3){P0(t,null),Is=null;return}d+=1;const v=Is;setTimeout(()=>!l&&g(v.view,v.key),1e3*d)})};return a?g(a,null):r&&(Is=r,g(r.view,r.key)),()=>{l=!0,c?.close(),Is=null}}function $m(t){const o=Is;o&&fetch(sE,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({view:o.view,key:o.key,event:t})}).catch(()=>{})}let On=null,Dr=location.origin,Ph=!1,Ih=!1,Wm=!1,nl,yu,Qm=!1,Ur=!1;const bu=new Map;let J3=0;const ol=new Map;let Hh=null,Sa=null;const I0=H3(),vu=I0?I3(I0,(t,o)=>bf({openArtifact:"clipboard_done",id:t,...o===void 0?{}:{error:o}})):null,_a=window.parent!==window;function Zm(){clearTimeout(nl),clearTimeout(yu),nl=yu=void 0}function Jm(t=!0){Zm(),Wm=Ih=Qm=Ur=!1,t?Q.getState().setFrameLoading():Q.getState().setReport({})}function xu(){Zm(),Qm=!0,Ur=!1,Q.getState().setPageReady(!0)}function e5(t,o){On===t&&o===Dr||(Zm(),Ur=!1,On=t,Dr=o,t&&Jm())}function t5(){if(!On)return;const t=Q.getState(),o=_z(t.boot?.pageKind??null);if(Ih&&Jm(!o),Ih=!0,Ur=!1,ol.clear(),vu?.clear(),Ph=!0,eg(),Wm)return;const a=()=>{t.setReport({}),xu()};o?a():nl=setTimeout(a,Dz)}function eg(){const t=Q.getState().boot,o=t?.type==="design"&&t.typeServer,a=Q.getState().host?.theme;bf({openArtifact:"chrome_hello",draws:__.filter(r=>r!=="actions"||!o),...vu?{clipboard:!0}:{},...a?{theme:a}:{}})}function bf(t){On?.contentWindow?.postMessage(t,Dr)}const H0=(t,o)=>{On?.contentWindow?.postMessage(t,{targetOrigin:Dr,...o?{transfer:o}:{}})};function bn(t){bf({openArtifact:"chrome_cmd",...t})}function n5(){return new Promise(t=>{if(!Q.getState().report.exports)return t([]);const o=`x${++J3}`;bu.set(o,t),bn({cmd:"exports",id:o}),setTimeout(()=>{bu.delete(o)&&t([])},2e3)})}function Ki(t){const o=yf(Q.getState().report,t);o&&!o.disabled&&bn({cmd:"action",id:t})}function o5(t){if(t.disabled)return;const o=t3();ol.set(o,t.label),setTimeout(()=>ol.delete(o),15*6e4),bn({cmd:"export_format",request:o,format:t.format,...t.variant?{variant:t.variant}:{}})}const s5={busy:"exportBusy",unsupported:"exportUnsupported",failed:"exportFailed"};function a5(t,o,a){if(typeof t!="string")return;const r=ol.get(t);if(r===void 0||o==="started")return;ol.delete(t);const l=s5[o];if(!l)return;const c=typeof a=="string"&&a.trim()?a.trim().slice(0,200):"";ka.add({title:E(l,{label:r}),...c?{description:c}:{}})}function aE(){if(On){Jm(),Ur=!0,yu=setTimeout(xu,kT);try{On.contentWindow?.location.reload()}catch{const t=On.src;On.src=t}}}function r5(t){On&&(bf({openArtifact:"files_changed",paths:t}),Sa&&clearTimeout(Sa),Sa=setTimeout(()=>{Sa=null,aE()},1e3))}function Pa(t){const{host:o,boot:a}=Q.getState();if(!o||!a)return!1;const r=dz(o,t);return r?(o.via==="view"?$m({artifact:a.url,...r}):window.parent.postMessage({artifact:a.url,...r},o.origin),!0):!1}function tg(t){/^https?:\/\//i.test(t)&&Pa({openArtifact:"open_external",url:t})||window.open(t,"_blank","noopener")}function i5(t){const o=document.documentElement;if(t.theme){o.dataset.theme=t.theme.scheme;for(const[a,r]of Object.entries(hz(t.theme.accent??null)))o.style.setProperty(a,r)}}function rE(t){const o=Q.getState();o.setHost(t),i5(t),t.theme&&eg();const a=o.boot;if(!a)return;const r={openArtifact:"shell_ready",artifact:a.url};t.via==="view"?$m(r):window.parent.postMessage(r,t.origin),ng()}function iE(t){const o=Q.getState().boot;if(!o||typeof t!="string")return;const a=B3(o.type,t);a?bn(a):ng()}function ng(){const t=Q.getState().boot;t&&Hh&&Pa({openArtifact:"place",artifact:t.url,hash:Hh})}function l5(t,o){const a=Q.getState(),r=a.boot?U3(a.boot.type,t):null;switch(r&&(Hh=r,ng()),t.openArtifact){case"request_comment_mode":if(PT(Tl(a.boot))&&VT(a.report)&&typeof t.on=="boolean"){const l=t.on&&typeof t.anchor=="string"?t.anchor:void 0;bn({cmd:"comments_mode",on:t.on,...l?{anchor:l}:{}})}break;case"copy_slide_link":a.boot?.type==="slides"&&typeof t.hash=="string"&&Ma.test(t.hash)&&Bh(t.hash);break;case"copy_sheet_link":a.boot?.type==="sheets"&&typeof t.page=="string"&&Bh("#"+new URLSearchParams({page:t.page}).toString());break;case"sheet_page":if(a.boot?.type!=="sheets"||t.page!==null&&typeof t.page!="string")break;{const l=t.page?"#"+new URLSearchParams({page:t.page}).toString():"";location.hash!==l&&history.replaceState(history.state,"",location.pathname+location.search+l)}break;case"design_page":if(a.boot?.type==="design"&&(t.page===null||typeof t.page=="string")){const l=t.page?"#"+new URLSearchParams({page:t.page}).toString():"";location.hash!==l&&history.replaceState(history.state,"",location.pathname+location.search+l)}break;case"doc_place":if(a.boot?.type==="docs"&&typeof t.hash=="string"&&hf.test(t.hash)){const l=new URL(location.href);l.searchParams.delete("tab"),l.hash=t.hash,l.href!==location.href&&history.replaceState(history.state,"",l)}break;case"current_slide":a.boot?.type==="slides"&&typeof t.hash=="string"&&Ma.test(t.hash)&&location.hash!==t.hash&&!gu(a.boot,location.href,_a)&&history.replaceState(history.state,"",t.hash);break;case"cap_want":D3(t,Dr,H0);break;case"cap":L3(t,o,H0);break;case"clipboard_write":vu?.start(t.id,t.types);break;case"clipboard_data":vu?.data(t.id,t.items,t.error);break;case"files_changed_ok":Sa&&clearTimeout(Sa),Sa=null;break;case"frame_denied":{const l=Mz(t);l&&p5(l);break}case"chrome_report":if(Ur)break;t.report&&typeof t.report=="object"&&(clearTimeout(nl),nl=void 0,Wm=!0,a.setReport(KT(t.report)),t.report.ready!==!1||Qm?xu():(a.setPageReady(!1),yu??=setTimeout(xu,kT)),Ph&&(Ph=!1,eg()));break;case"chrome_export":a5(t.request,t.state,t.reason);break;case"chrome_exports":{const l=bu.get(t.id);bu.delete(t.id);const c=Array.isArray(t.items)?t.items.filter(d=>d&&typeof d.label=="string"):[];l?.(c);break}}}function U0(t){const o=t.data;if(!jT(o))return;if(On&&t.source===On.contentWindow){t.origin===Dr&&l5(o,t);return}if(t.source!==window.parent||!_a)return;if(o.openArtifact==="goto"){const r=Q.getState().host;if(!r||r.via!=="frame"||t.origin!==r.origin)return;iE(o.hash);return}if(o.openArtifact!=="host_hello")return;const a=t.origin;p3().then(r=>{const l=fz(a,r);if(l==="refused")return;const c=BT(o,a,l==="declared");c&&rE(c)})}function c5(t){if(!jT(t))return;if(t.openArtifact==="goto"){Q.getState().host?.via==="view"&&iE(t.hash);return}const o=BT(t,"view",!0,"view");o&&rE(o)}function B0(){setTimeout(()=>{On&&document.activeElement===On&&Q.getState().closePopups()})}function V0(t){Q.getState().report.leaveLosesWork&&(t.preventDefault(),t.returnValue="")}function u5(){const t=()=>{if(Q.getState().boot?.type==="docs"&&location.hash&&bn({cmd:"goto_doc",hash:location.hash}),Q.getState().boot?.type==="sheets"){const l=new URLSearchParams(gf(location.hash).slice(1)).get("page");l&&bn({cmd:"goto_sheet",page:l})}Q.getState().boot?.type==="slides"&&Ma.test(location.hash)&&bn({cmd:"goto_slide",hash:location.hash})};window.addEventListener("hashchange",t),window.addEventListener("message",U0),window.addEventListener("blur",B0),window.addEventListener("beforeunload",V0);const o=Q.getState().boot,a=o?{openArtifact:"shell_hello",version:o.version,protocol:U_,artifact:o.url,id:o.id,title:o.title,type:o.type}:null;_a&&a&&window.parent.postMessage(a,"*");const r=!_a&&o&&a?Z3(o.id,{onCommand:c5,onOpen:()=>$m(a)}):null;return D0(l=>{Pa({openArtifact:"saved_file",path:l})}),()=>{r?.(),D0(null),window.removeEventListener("hashchange",t),window.removeEventListener("message",U0),window.removeEventListener("blur",B0),window.removeEventListener("beforeunload",V0)}}const ho=t=>{ka.add({title:t})},Zt=()=>{const t=Q.getState().boot;if(!t)throw new Error("No boot.");return t};function lE(t,o){return t?.type==="docs"&&hf.test(o)?o:t?.type==="sheets"?gf(o):t?.type==="design"?Xm(o):t?.type==="slides"&&Ma.test(o)?o:""}function sl(t=location.hash){const o=Zt();return(o.typeServer?o.typeServer.invite??location.origin+location.pathname:`${location.origin}/a/${encodeURIComponent(o.id)}`)+lE(o,t)}function zr(t){jD(window),kD(window,t)}async function f5(){const t=window.__OPEN_ARTIFACT_BOOT__,o=Q.getState();if(t){o.setBoot(t),t.pending?await cE(t,!1):zr("oa:boot");return}const a=R_(new URLSearchParams(location.search).get("id"));if(!a)return o.setBoot(null,E("noBoot"));try{const r=await Ct.artifact(a);let l=null,c=null;try{l=await Ct.open(a)}catch(d){c=Bn(d)}o.setBoot(zz(r,l,c)),zr("oa:boot")}catch(r){o.setBoot(null,Bn(r))}}async function d5(t,o){const a=o?null:DD(window,t.id);if(a){let r=null;try{r=await a.res}catch{}if(r)return A0(await DT(r),t)}return A0(await Ct.boot(t.id,{fresh:o}),t)}async function cE(t,o){try{Q.getState().setBoot(await d5(t,o)),zr("oa:boot")}catch(a){Q.getState().setBoot(GT(t,E("bootFailed",{error:Bn(a)})),null,!0)}}async function uE(){const t=Q.getState().boot;if(!t)return;if(t.typeServer)return location.reload();const o=kz(t);Q.getState().setBoot(o),await cE(o,!0)}let Uh=!1;function p5(t){const o=Q.getState().boot;if(!(!o||o.pending)){if(jz(o,Uh)==="problem"){Q.getState().setBoot(GT(o,E(t==="not_granted"?"frameNotGranted":"frameNotOpen")),null,!0);return}Uh=!0,uE()}}function h5(){Uh=!1,zr("oa:frame-ready")}async function Ta(){try{Q.getState().setArtifact(await Ct.artifact(Zt().id))}catch{}}async function fE(){try{Q.getState().setLibrary(await Ct.artifacts())}catch{Q.getState().library||Q.getState().setLibrary([])}}async function m5(){const t=!Q.getState().artifact?.pinned;try{Q.getState().mergeArtifact(await Ct.update({id:Zt().id,pinned:t})),ho(E(t?"pinned":"unpinned"))}catch(o){ho(E(t?"couldNotPin":"couldNotUnpin",{error:Bn(o)}))}}async function g5(t){const o=t.trim(),a=Q.getState(),r=a.artifact?.title??Zt().title;if(!(!o||o===r)){a.mergeArtifact({title:o});try{a.mergeArtifact(await Ct.update({id:Zt().id,title:o}))}catch(l){a.mergeArtifact({title:r}),ho(E("couldNotRename",{error:Bn(l)}))}}}async function y5(){try{const t=await Ct.duplicate(Zt().id);ho(E("duplicated")),location.href=`/a/${encodeURIComponent(t.id)}${location.search}`}catch(t){ho(E("couldNotDuplicate",{error:Bn(t)}))}}function dE(){const{host:t,report:o}=Q.getState();if(t){if(o.leaveLosesWork&&!window.confirm(E("leaveLosesWork")))return;Pa({openArtifact:"close"})}else location.href="/"}async function b5(){try{await Ct.remove(Zt().id),dE()}catch(t){ho(E("couldNotDelete",{error:Bn(t)}))}}function pE(){const t=Q.getState().artifact?.owner;t&&Pa({openArtifact:"open_session",session:t.session,harness:t.harness})}function v5(t){Pa({openArtifact:"new_session",prompt:t,artifact:Zt().url})}async function x5(t,o){const a=Q.getState().host;if(!a?.declared||!a.destinations.some(l=>l.id===t.id))return;const r=Q.getState().artifact?.title||Zt().title;try{await Ct.ask({id:Zt().id,text:pz(t,r),label:E("destinationRequestLabel",{label:t.label})}),ho(E("destinationSent",{label:t.label,agent:o}))}catch(l){ho(E("notSent",{error:Bn(l)}))}}async function Bh(t){await mf(sl(t)),ho(E("linkCopied"))}async function S5(){await mf(Zt().root),ho(E("pathCopied"))}let sh=!1;async function Hn(t){if(!t&&sh)return!0;const o=Q.getState();t||(sh=!0);try{const a=Zt();let r;if(a.typeServer?.sharePath){const l=await fetch(a.typeServer.sharePath,t&&{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!l.ok)throw new Error((await l.json()).error?.message??l.statusText);r=await l.json()}else r=t?await Ct.setShare({id:a.id,...t}):await Ct.share(a.id);return o.patchShare({view:r,error:"",unsupported:!1}),!0}catch(a){return a instanceof ja&&a.code==="unsupported"?o.patchShare({view:null,unsupported:!0,error:""}):a instanceof ja&&a.status===0?o.patchShare({error:E("shareNoAnswer")}):o.patchShare({error:E("shareError",{error:Bn(a)})}),!1}finally{t||(sh=!1)}}let ah=null;async function hE(t,o){const a=Q.getState(),r=t==="page"?"":lE(a.boot,location.hash);await mf(o+r),a.patchShare({copied:t}),ah&&clearTimeout(ah),ah=setTimeout(()=>{Q.getState().share.copied===t&&Q.getState().patchShare({copied:null})},1600);const l=a.share.view;t!=="page"&&t!=="web"&&l&&!l.lan&&!l.cloud&&await Hn({lan:!0})}async function Lr(t){const o=Q.getState(),a=o.share.view,r=a?uz(a,t):null;r&&o.patchShare({view:r});const l=await Hn(t);return!l&&r&&Q.getState().share.view===r&&Q.getState().patchShare({view:a}),l}async function w5(){const t=Tl(Q.getState().boot);if(t!=="viewer")return!0;const o=Q.getState().boot?.cloud?.settings;return!Q.getState().share.view?.cloud&&!o&&await Hn(),IT(t,Q.getState().share.view?.cloud?.settings??o)}const Ea=t=>E(t.key,t.vars),Ia=t=>t instanceof ja?{code:t.code,message:t.message,status:t.status}:{code:"error",message:Bn(t),status:0};function mE(){const t=Q.getState().boot;return!!t&&!zT(t)&&!t.typeServer}let rh=!1,Su=0;async function is(){if(!(!mE()||rh)){rh=!0;try{const{remotes:t,cloud:o}=await Ct.remotes();Q.getState().patchPublish({remotes:t,cloud:o,missing:!1}),T5()}catch(t){t instanceof ja&&t.code==="not_found"&&Q.getState().patchPublish({remotes:[],missing:!0})}finally{rh=!1}}}async function T5(){const t=Q.getState().boot;if(!(!t||t.type!=="data"||!mE()))try{Q.getState().patchPublish({data:await Ct.dataPublish(t.id)})}catch{Q.getState().patchPublish({data:null})}}async function F0(t){const o=Q.getState();if(!o.publish.busy){o.patchPublish({busy:"data",error:""});try{Q.getState().patchPublish({data:await Ct.dataPublish(Zt().id,{publish:t})})}catch(a){Q.getState().patchPublish({error:Ia(a).message})}finally{Q.getState().patchPublish({busy:null})}}}async function E5(){const t=Q.getState();if(!t.publish.busy){t.patchPublish({busy:"data-refresh",error:""});try{Q.getState().patchPublish({data:await Ct.dataPublish(Zt().id,{refresh:!0})})}catch(o){Q.getState().patchPublish({error:Ia(o).message})}finally{Q.getState().patchPublish({busy:null})}}}function al(t){Su++,Q.getState().patchPublish({connect:{step:"form",host:t?.host??"",name:t?.name??"",error:""}})}function Vh(){const{connect:t}=Q.getState().publish,o=t.step==="code"?t.start.name:t.step==="starting"?t.name:null;Su++,Q.getState().patchPublish({connect:{step:"closed"}}),o&&Ct.connectCancel(o).catch(()=>{})}function C5(){const{connect:t}=Q.getState().publish;(t.step==="done"||t.step==="failed"||t.step==="form")&&Q.getState().patchPublish({connect:{step:"closed"}}),Q.getState().patchPublish({error:""})}async function R5(t,o){const a=Q.getState(),r=ZT(t),l=o.trim();if(!r.ok)return a.patchPublish({connect:{step:"form",host:t,name:o,error:Ea(r.reason)}});const c=r3(l);if(c)return a.patchPublish({connect:{step:"form",host:t,name:o,error:Ea(c)}});const d=r.host,g=++Su,m=()=>g===Su,h=S=>{m()&&Q.getState().patchPublish({connect:{step:"failed",host:d,name:l,error:Ea(u3(Ia(S),d))}})};a.patchPublish({connect:{step:"starting",host:d,name:l}});let y;try{y=await Ct.connect(l,d)}catch(S){return h(S)}if(!m()){Q.getState().publish.connect.step==="closed"&&Ct.connectCancel(l).catch(()=>{});return}Q.getState().patchPublish({connect:{step:"code",start:y}});let v=0;for(;m();)try{const S=await Ct.connectWait(l,25e3);if(v=0,S.status==="done"){if(!m())return;Q.getState().patchPublish({connect:{step:"done",host:d,user:S.user.name||S.user.email||S.user.id}}),await is();return}}catch(S){if(S instanceof ja&&S.status===0&&++v<4){await new Promise(w=>setTimeout(w,2e3));continue}return h(S)}}async function O5(t){const o=Q.getState();if(o.publish.busy)return;const a=o.publish.remotes?.find(r=>r.name===t)?.host??t;o.patchPublish({busy:`publish:${t}`,error:""});try{await Ct.publish(Zt().id,t,{data:o.publish.data?.live===!0}),await is(),Ta()}catch(r){Q.getState().patchPublish({error:Ea(f3(Ia(r),a))}),is()}finally{Q.getState().patchPublish({busy:null})}}async function A5(t){const o=Q.getState();if(!o.publish.busy){o.patchPublish({busy:"cloud",error:""});try{const{cloud:a}=await Ct.cloudSettings({publish:t?"auto":"manual"});Q.getState().patchPublish({cloud:a}),await is()}catch(a){Q.getState().patchPublish({error:Ea({key:"pubCloudSettingsFailed",vars:{error:Ia(a).message}})})}finally{Q.getState().patchPublish({busy:null})}}}async function N5(t){const o=Q.getState();if(!o.publish.busy){o.patchPublish({busy:"cloud",error:""});try{const{cloud:a}=await Ct.cloudSettings({default:t});Q.getState().patchPublish({cloud:a}),await is()}catch(a){Q.getState().patchPublish({error:Ea({key:"pubCloudSettingsFailed",vars:{error:Ia(a).message}})})}finally{Q.getState().patchPublish({busy:null})}}}async function k5(){const t=Q.getState();if(t.publish.busy)return;const o=Km(t.publish.remotes,Zt().id)?.remote.host??"";t.patchPublish({busy:"unpublish",error:""});try{await Ct.unpublish(Zt().id),await is(),Ta()}catch(a){Q.getState().patchPublish({error:Ea(d3(Ia(a),o))})}finally{Q.getState().patchPublish({busy:null})}}let ih=!1;async function M5(){if(ih)return;ih=!0;const t=Zt(),o=Ct.archiveUrl(t.id);try{let a;try{a=await fetch(o,{method:"HEAD",cache:"no-store"})}catch(l){throw new Error(E("archiveFailed",{error:Bn(l)}))}if(!a.ok){if(a.status===413)throw new Error(E("archiveTooLarge"));if(a.status===409)throw new Error(E("archiveUnsupported",{type:t.typeTitle}));if(a.status===403){const l=await fetch(o,{cache:"no-store"}).then(c=>c.json()).catch(()=>null);if(typeof l?.message=="string"&&l.message)throw new Error(l.message)}throw new Error(E("archiveFailed",{error:`HTTP ${a.status}`}))}const r=document.createElement("a");r.href=o,r.download="",r.style.display="none",document.body.append(r),r.click(),r.remove(),ka.add({title:E("archiveStarted",{name:qD(a.headers.get("Content-Disposition"))||"folder.zip"}),description:E("archiveHint")})}catch(a){ho(Bn(a))}finally{ih=!1}}const gE=()=>`open-artifact-ask-${Zt().id}`;function j5(){try{Q.getState().setSent(Nz(sessionStorage.getItem(gE())))}catch{}}async function yE(t,o){const a=t.trim();if(!a)return!1;const r=Q.getState();r.setAskStatus(E("sending"));try{const l=await Ct.ask({id:Zt().id,text:a}),c=Oz(l.via,l.status),d=Az(Q.getState().sent,{text:a,at:new Date().toISOString(),delivery:c});r.setSent(d);try{sessionStorage.setItem(gE(),JSON.stringify(d))}catch{}const g=Q.getState(),m=g.boot?.cloud?g.artifact?.agent??g.boot.cloud.agent:void 0;if(m&&c!=="failed"){const h=QD(l.status,m);r.setAskStatus(E(h.key,h.vars))}else r.setAskStatus(c==="inbox"?E("sentInbox",{agent:o}):c==="drafted"?E("sentDrafted",{agent:o}):E(c==="delivered"?"sent":"notDelivered"));return Pa({openArtifact:"comment_summon",text:a}),!0}catch(l){return r.setAskStatus(E("notSent",{error:Bn(l)})),!1}}function _5(){return YD(t=>{const o=Q.getState().boot;if(o)switch(t.type){case"artifacts/changed":if(Q.getState().setLibrary(null),t.id!==o.id)return;Ta(),is(),t.paths?.length&&o.pageKind==="static"&&r5(t.paths);break;case"harness/changed":Ta();break;case"wake/state":t.artifactId===o.id&&Ta();break}})}const D5={none:"statusNone",working:"statusWorking",idle:"statusIdle",waiting:"statusWaiting",offline:"statusOffline"};function bE({state:t,className:o}){return p.jsx("span",{"aria-hidden":"true",className:lt("inline-block size-2 shrink-0 rounded-full",t==="working"?"animate-pulse bg-accent motion-reduce:animate-none":t==="idle"||t==="waiting"?"bg-success":"bg-fg-subtle",o)})}function z5({state:t,prefix:o,label:a,className:r}){const l=a??E(D5[t]);return p.jsxs("span",{className:lt("inline-flex min-w-0 items-center gap-1.5 text-xs text-fg-muted",r),children:[p.jsx(bE,{state:t}),p.jsx("span",{className:"truncate",children:o?`${o} · ${l}`:l})]})}function Ws(){const t=Q(a=>a.host),o=Q(a=>a.boot);return mz(t,o,E("agent"))}function og(){return Q(t=>t.boot?.type==="docs"&&t.report.title||t.artifact?.title||t.boot?.title||"")}function Qs(){return Q(t=>t.artifact?.owner??null)}function L5(){const t=Qs(),o=Q(a=>a.report);return Gm(t,o)}function sg(){return Q(t=>t.boot?.cloud?t.artifact?.agent??t.boot.cloud.agent??null:null)}function ag(){const t=Qs(),o=Q(r=>r.report),a=sg();return a&&!Gm(t,o)?ZD(a):gz(t,o)}function vE(){const t=Q(r=>r.host),o=Qs();return!Q(r=>!!r.boot?.cloud)&&yz(t,o)}function vf(){return Q(t=>t.boot?.cloud??null)}function xf(){return Q(t=>Tl(t.boot))}function xE(){const t=Q(r=>!!r.boot?.typeServer),o=xf(),a=Q(r=>r.share.view?.cloud?.settings??r.boot?.cloud?.settings);return!t&&$D(o,a)}const P5={delivered:"viaDelivered",drafted:"viaDrafted",inbox:"viaInbox",failed:"viaFailed"};function I5(t){const o=Qs(),a=ag(),r=sg(),l=xf();if(r&&a!=="working"){const d=WD(r,l==="owner");return{state:E(d.key,d.vars),note:""}}if(r)return{state:E("working",{agent:r.name}),note:""};if(!o)return{state:E("noOwner"),note:E("noOwnerNote")};const c=o.harnessTitle??o.harness;return a==="working"?{state:E("working",{agent:t}),note:E("ownerNote",{harness:c})}:o.live?{state:E("agentIdle",{agent:t}),note:E("ownerNote",{harness:c})}:{state:E("sessionOffline"),note:E("offlineNote",{agent:t,harness:c})}}function H5(){const t=Ws(),o=Q(A=>A.sent),a=Q(A=>A.askStatus),r=ag(),l=sg(),c=Qs(),{state:d,note:g}=I5(t),m=l&&r!=="working"?E(l.state==="online"?"statusConnected":l.state==="none"?"statusNoAgent":"statusOffline"):void 0,[h,y]=b.useState(""),[v,S]=b.useState(!1),w=b.useRef(null),T=b.useRef(null);b.useEffect(()=>w.current?.focus(),[]),b.useEffect(()=>{T.current?.lastElementChild?.scrollIntoView({block:"end"})},[o.length]);const O=async()=>{v||!h.trim()||(S(!0),await yE(h,t)&&y(""),S(!1))};return p.jsxs("aside",{"aria-label":E("ask",{agent:t}),className:"flex w-[360px] max-w-full shrink-0 flex-col border-l border-line bg-surface max-md:absolute max-md:inset-y-0 max-md:right-0 max-md:z-10 max-md:shadow-popup",children:[p.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-line pl-3.5 pr-1.5",children:[p.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:t}),p.jsx(z5,{state:r,...m?{label:m}:{}}),p.jsx(za,{label:E("hideAsk"),icon:p.jsx(Sl,{className:"size-4"}),size:"lg",onClick:()=>Q.getState().setAskOpen(!1)})]}),p.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-3.5",children:[p.jsx("p",{className:"mb-1 mt-0 font-medium",children:d}),g?p.jsx("p",{className:"mb-3.5 mt-0 text-xs text-fg-muted",children:g}):p.jsx("div",{className:"mb-3.5"}),p.jsx("ol",{ref:T,className:"m-0 flex list-none flex-col gap-2.5 p-0",children:o.map((A,C)=>p.jsxs("li",{className:"max-w-[92%] self-end whitespace-pre-wrap break-words rounded-2xl bg-surface-2 px-3 py-2",children:[A.text,p.jsxs("span",{className:"mt-0.5 block text-[11px] text-fg-muted",children:[wl(A.at)," · ",E(l&&A.delivery==="inbox"?"viaWaitingAgent":P5[A.delivery])]})]},`${A.at}-${C}`))})]}),p.jsxs("form",{className:"p-3",onSubmit:A=>{A.preventDefault(),O()},children:[p.jsx("textarea",{ref:w,rows:3,value:h,placeholder:E("askPlaceholder"),"aria-label":E("askPlaceholder"),onChange:A=>y(A.target.value),onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey&&!A.nativeEvent.isComposing&&(A.preventDefault(),O())},className:"block max-h-[40vh] min-h-[72px] w-full resize-y rounded-xl border border-line bg-surface-2 px-3 py-2.5 text-[13px] text-fg outline-none placeholder:text-fg-subtle focus:border-accent"}),p.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[p.jsx("span",{role:"status",className:"min-w-0 flex-1 text-xs text-fg-muted",children:a}),p.jsx(it,{type:"submit",size:"lg",variant:"primary",disabled:v||!h.trim(),icon:p.jsx(Bk,{className:"size-3.5"}),children:E(c?.wakeMode==="draft"?"sendToConversation":"sendToAgent",{agent:t})})]})]})]})}function SE({hiding:t=!1}){return p.jsx("div",{role:"status","data-shell-loading":t?void 0:"","aria-label":E("loading"),"aria-hidden":t||void 0,className:lt("absolute inset-0 flex items-center justify-center bg-canvas transition-opacity motion-reduce:transition-none",t&&"pointer-events-none opacity-0"),style:{transitionDuration:`${XT}ms`},children:p.jsx(so,{ref:_D,className:"size-6 animate-spin text-fg-subtle motion-reduce:animate-none"})})}const U5=()=>{try{return matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}};function B5(){const t=Fn(),o=Q(m=>m.pageReady),[a,r]=b.useState(!0),l=b.useMemo(()=>xz(t,location.href,_a),[t]);b.useEffect(()=>{const m=Sz(location.href);m&&history.replaceState(history.state,"",m)},[]),b.useEffect(()=>{if(!o){r(!0);return}h5();const m=setTimeout(()=>r(!1),U5()?0:XT);return()=>clearTimeout(m)},[o]);const c=Tz(t.page,location.href),d=b.useCallback(m=>{e5(m,c),m&&zr("oa:frame-src")},[c]),g=()=>{t5(),zr("oa:frame-load")};return l?p.jsxs(p.Fragment,{children:[p.jsx("iframe",{ref:d,name:k_,src:l,title:t.title,allow:"clipboard-read; clipboard-write; fullscreen",onLoad:g,inert:!o,className:"absolute inset-0 size-full border-0 bg-surface"}),(!o||a)&&p.jsx(SE,{hiding:o})]}):null}function V5(){const t=Fn(),o=Ws(),a=!!vf(),r=Q(g=>!!g.host?.caps.sessions)&&!a,[l,c]=b.useState(""),d=t.prompt??"";return p.jsxs("div",{className:"max-w-2xl px-8 py-10",children:[p.jsx("h2",{className:"mb-2 mt-0 text-base font-semibold",children:E("emptyTitle")}),p.jsx("p",{className:"mb-3 mt-0 text-fg-muted",children:a?E("emptyBodyCloud",{type:t.typeTitle}):E("emptyBody",{type:t.typeTitle,root:t.root})}),p.jsx("textarea",{readOnly:!0,value:d,"aria-label":E("emptyTitle"),className:"block min-h-28 w-full resize-y rounded-lg border border-line bg-surface-2 px-3 py-2.5 font-mono text-xs leading-relaxed text-fg outline-none focus:border-accent"}),p.jsxs("div",{className:"mt-2.5 flex flex-wrap gap-2",children:[r?p.jsx(it,{size:"lg",variant:"primary",icon:p.jsx(zk,{className:"size-3.5"}),onClick:()=>{v5(d),c(E("sentToSession"))},children:E("startSession",{agent:o})}):null,p.jsx(it,{size:"lg",icon:p.jsx(hu,{className:"size-3.5"}),onClick:async()=>{await mf(d),c(E("promptCopied"))},children:E("copy")})]}),p.jsx("p",{role:"status",className:"mt-2 text-xs text-fg-muted",children:l})]})}function F5(){const t=Fn(),o=Ws(),a=Q(g=>g.askStatus),r=Q(g=>g.canRetry),l=!!vf(),c=xE()||!l,d=t.problem||E("noPage");return p.jsxs("div",{className:"max-w-2xl px-8 py-10",children:[p.jsxs("h2",{className:"mb-2 mt-0 flex items-center gap-2 text-base font-semibold",children:[p.jsx(xl,{className:"size-4 text-warning"}),E("problemTitle")]}),p.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-xs text-fg-muted",children:d}),l?null:p.jsx("p",{className:"text-xs text-fg-muted",children:E("folder",{root:t.root})}),p.jsxs("div",{className:"flex flex-wrap gap-2",children:[r?p.jsx(it,{size:"lg",variant:"primary",icon:p.jsx(_w,{className:"size-3.5"}),onClick:()=>{uE()},children:E("tryAgain")}):null,c?p.jsx(it,{size:"lg",icon:p.jsx(Pm,{className:"size-3.5"}),onClick:()=>{yE(E("problemAsk",{problem:d}),o)},children:E("askToLook",{agent:o})}):null]}),p.jsx("p",{role:"status",className:"mt-2 text-xs text-fg-muted",children:a})]})}function Y5(){const t=Fn(),o="?";return p.jsxs("p",{role:"status",className:"m-0 flex shrink-0 items-center gap-2 border-b border-line bg-surface-2 px-4 py-2 text-xs text-fg-muted",children:[p.jsx(xl,{className:"size-3.5 shrink-0 text-warning"}),E("readOnlyNewer",{type:t.typeTitle,release:t.type_release??o,version:t.type_version??o})]})}function q5(){const t=Fn(),o=Q(r=>r.bootGen),a=t.pending?p.jsx(SE,{}):t.empty?p.jsx(V5,{}):t.problem||!t.page?p.jsx(F5,{}):p.jsx(B5,{},o);return t.read_only&&!t.pending?p.jsxs("main",{className:"relative flex min-w-0 flex-1 flex-col",children:[p.jsx(Y5,{}),p.jsx("div",{className:"relative min-h-0 flex-1 overflow-auto",children:a})]}):p.jsx("main",{className:"relative min-w-0 flex-1 overflow-auto",children:a})}async function G5(t){try{const o=await fetch(t,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json",accept:"application/json"},body:"{}"});if(!o.ok&&o.status!==401)throw new Error(`HTTP ${o.status}`);const a=HT(await o.json().catch(()=>null))??(await wE()).accessLogout;a?location.href=a:location.reload()}catch(o){ka.add({title:E("signOutFailed",{error:o instanceof Error?o.message:String(o)})})}}let Y0=null;function wE(){return Y0??=fetch("/api/open-artifact.auth.me",{credentials:"same-origin",cache:"no-store"}).then(t=>t.ok?t.json():null).then(t=>({access:ez(t),accessLogout:UT(t)}),()=>({access:!1,accessLogout:null})),Y0}function wu({id:t,name:o,avatar:a,size:r=28}){const[l,c]=b.useState(!1),d={width:r,height:r,fontSize:Math.round(r*.4)};return a&&!l?p.jsx("img",{src:a,alt:"",referrerPolicy:"no-referrer",className:"shrink-0 rounded-full bg-surface-2 object-cover",style:d,onError:()=>c(!0)}):p.jsx("span",{"aria-hidden":!0,className:"grid shrink-0 place-items-center rounded-full font-semibold text-white",style:{...d,background:qm(`user${t}`)},children:Ym(o)})}function X5(t){XD(t,location.origin)?window.open(t,"_blank","noopener,noreferrer"):location.href=t}function K5({cloud:t}){const o=t.user,a=GD(t.site,"account-menu"),[r,l]=b.useState(!1);if(b.useEffect(()=>{if(!o)return;let c=!0;return wE().then(d=>c&&l(d.access)),()=>{c=!1}},[o]),!o){const c=`${location.pathname}${location.search}`;return p.jsx(it,{size:"lg",variant:"ghost",className:"gap-1.5 px-2 font-normal",icon:p.jsx(Nk,{className:"size-4"}),onClick:()=>location.href=JD(t.signInUrl,c,location.origin),children:p.jsx("span",{className:"max-sm:hidden",children:E("signIn")})})}return p.jsxs(el,{align:"end",trigger:p.jsx("button",{type:"button","aria-label":E("accountOf",{name:o.name}),title:o.email?`${o.name} · ${o.email}`:o.name,className:"inline-flex size-8 shrink-0 items-center justify-center rounded-full outline-none hover:bg-hover focus-visible:outline-2 focus-visible:outline-accent data-[popup-open]:bg-hover",children:p.jsx(wu,{id:o.id,name:o.name,avatar:o.avatar,size:26})}),children:[p.jsx(_r,{children:p.jsxs("span",{className:"flex max-w-64 items-center gap-2.5 py-0.5",children:[p.jsx(wu,{id:o.id,name:o.name,avatar:o.avatar,size:32}),p.jsxs("span",{className:"min-w-0",children:[p.jsx("span",{className:"block truncate text-[13px] font-medium text-fg",children:o.name}),o.email?p.jsx("span",{className:"block truncate text-xs",children:o.email}):null]})]})}),p.jsx(Ko,{}),a.map(c=>p.jsx(Nt,{icon:p.jsx(vl,{className:"size-3.5"}),onSelect:()=>X5(c.href),children:c.label},`${c.label} ${c.href}`)),a.length>0?p.jsx(Ko,{}):null,p.jsx(Nt,{icon:p.jsx(kk,{className:"size-3.5"}),onSelect:()=>{G5(t.signOutUrl)},children:E(r?"signOutAccess":"signOut")})]})}function $5({site:t,compact:o=!1}){const a=LT(t)?.brand,[r,l]=b.useState(!1);if(!a)return null;const c=a.logoUrl&&!r?p.jsx("img",{src:a.logoUrl,alt:a.name?"":"logo",referrerPolicy:"no-referrer",className:o?"h-5 w-auto shrink-0":"h-6 w-auto shrink-0",onError:()=>l(!0)}):null;return p.jsxs("span",{"data-site-brand":"",className:"inline-flex min-w-0 items-center gap-1.5",children:[c,a.name?p.jsx("span",{className:o?"truncate text-[13px] font-medium text-fg-muted max-sm:hidden":"truncate",children:a.name}):null]})}const W5=3,va=(t,o=!1)=>t.self?E(o?"yourOtherTab":"youOtherTab"):t.name;function q0({peer:t,ring:o,className:a}){const r=qz(t);return p.jsx("span",{"aria-hidden":!0,"data-peer-avatar":t.key,className:lt("inline-flex size-6 shrink-0 select-none items-center justify-center rounded-full text-[10px] font-semibold ring-2 ring-surface",o&&"outline-2 outline-offset-1",a),style:{background:r,color:Gz(r),outlineColor:o?r:void 0,outlineStyle:o?"solid":void 0},children:Xz(t.name)})}function Q5(t,o){const a=b.useRef(null);b.useEffect(()=>{const r=a.current,l=o?t?.find(c=>c.key===o):void 0;if(l){r?.key!==l.key&&ka.add({title:E("followingToast",{name:va(l,!0)})}),a.current={key:l.key,name:va(l,!0)};return}o||(r&&t&&!t.some(c=>c.key===r.key)&&ka.add({title:E("stoppedFollowingLeft",{name:r.name})}),a.current=null)},[t,o])}function Z5(){const t=Q(h=>h.report.peers),o=Q(h=>h.report.following),a=Q(h=>Yz(h.report)),r=Q(h=>Fz(h.report));if(Q5(t,o),b.useEffect(()=>{if(!a)return;const h=y=>{y.key!=="Escape"||y.defaultPrevented||y.target instanceof Element&&y.target.closest('[role="menu"], [role="dialog"]')||bn({cmd:"follow",key:null})};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[a]),!t?.length)return null;const l=a?[a,...t.filter(h=>h!==a)]:t,c=l.slice(0,W5),d=l.length-c.length,g=l.map(h=>va(h)).join(", "),m=a?`${E("followingName",{name:va(a,!0)})} · ${E("peopleHereNames",{names:g})}`:E("peopleHereNames",{names:g});return p.jsxs(el,{align:"end",trigger:p.jsx("button",{type:"button","data-peers":"","aria-label":m,title:m,className:"inline-flex h-8 shrink-0 items-center rounded-control px-1 hover:bg-hover focus-visible:outline-2 focus-visible:outline-accent data-[popup-open]:bg-hover",children:p.jsxs("span",{className:"flex items-center",children:[c.map((h,y)=>p.jsx(q0,{peer:h,ring:h===a,className:y>0?"-ml-1.5":void 0},h.key)),d>0?p.jsx("span",{className:"ml-1 text-xs text-fg-muted",children:E("peopleMore",{count:d})}):null]})}),children:[p.jsx(_r,{children:E("peopleHere")}),l.map(h=>{const y=h===a,v=p.jsxs("span",{className:"flex min-w-56 items-center gap-2.5",children:[p.jsx(q0,{peer:h,ring:y}),p.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[p.jsx("span",{className:"truncate",children:va(h)}),h.followsYou?p.jsx("span",{className:"text-xs text-fg-subtle",children:E("followingYou")}):null]}),r?p.jsx("span",{"data-follow":y?"on":"off","aria-label":y?E("stopFollowingName",{name:va(h,!0)}):E("followName",{name:va(h,!0)}),className:lt("rounded-control px-2 py-0.5 text-xs font-medium",y?"bg-fg text-surface":"bg-surface-2 text-fg"),children:E(y?"stopFollow":"follow")}):null]});return r?p.jsx(Nt,{onSelect:()=>bn({cmd:"follow",key:y?null:h.key}),children:v},h.key):p.jsx("div",{className:"px-2 py-1.5 text-sm",children:v},h.key)})]})}function J5(t){return t.remotes!==null?Km(t.remotes,t.id)?"published":"lan":t.publishedUrl?"published":"lan"}function e4(t){return t?.lan?"sharedOnNetwork":null}const t4={save_now:"actionSaveNow",open_find:"actionOpenFind",undo:"actionUndo",redo:"actionRedo",edit_page:"actionEditPage",use_page:"actionUsePage",comment_selection:"actionCommentSelection",open_page_list:"actionOpenPageList",hand_off_code:"actionHandOffCode"},n4={older_version:"whyOlderVersion",agent_working:"whyAgentWorking",draft_open:"whyDraftOpen",comments_on:"whyCommentsOn",needs_agent:"whyNeedsAgent",unsaved:"whyUnsaved",other:"whyOther"};function o4(t){const o=t4[t.id];return o?E(o):t.label??WT(t.id)}function TE(t,o){return t?E(n4[t],{agent:o}):void 0}const Jo={editor:"roleEditor",commenter:"roleCommenter",viewer:"roleViewer"},lh={editor:"linkEditor",commenter:"linkCommenter",viewer:"linkViewer"},rg={editor:"noteEditor",commenter:"noteCommenter",viewer:"noteViewer"},s4={editor:p.jsx(Im,{className:"size-4"}),commenter:p.jsx(Lm,{className:"size-4"}),viewer:p.jsx(Ek,{className:"size-4"})};function ch({color:t,text:o,size:a,y:r}){return p.jsxs("svg",{viewBox:"0 0 22 22",width:"22",height:"22","aria-hidden":"true",children:[p.jsx("rect",{width:"22",height:"22",rx:"5",fill:t}),p.jsx("text",{x:"11",y:r,textAnchor:"middle",fontSize:a,fontWeight:"700",fontFamily:"ui-sans-serif, system-ui, sans-serif",fill:"#fff",children:o})]})}const a4={folder:p.jsx(lw,{className:"size-[18px]"}),pdf:p.jsx(ch,{color:"#e0342b",text:"PDF",size:8,y:14.6}),document:p.jsx(ch,{color:"#2b579a",text:"W",size:11,y:15.4}),slides:p.jsx(Lk,{className:"size-[18px]"}),spreadsheet:p.jsx(ch,{color:"#1d7044",text:"X",size:11,y:15.4}),image:p.jsx(Ok,{className:"size-[18px]"}),html:p.jsx(Q1,{className:"size-[18px]"}),video:p.jsx(qk,{className:"size-[18px]"}),text:p.jsx(Ck,{className:"size-[18px]"}),file:p.jsx(Rk,{className:"size-[18px]"})},Ha=b.createContext({menu:()=>{},ask:t=>t.run()});function Br({trigger:t,items:o,align:a="end"}){const r=b.useContext(Ha),l=b.useId(),[c,d]=b.useState(!1);b.useEffect(()=>()=>r.menu(l,!1),[r,l]);const g=o.some(m=>m.checked!==void 0);return p.jsxs(Mm,{open:c,modal:!1,onOpenChange:(m,h)=>{d(m),r.menu(l,m,h.reason)},children:[p.jsx(H1,{render:t}),p.jsx(Rm,{children:p.jsx(Nm,{side:"bottom",align:a,sideOffset:6,collisionPadding:12,className:"z-[1001]",children:p.jsx(Cm,{"data-share-menu":"",className:"min-w-[200px] max-w-[min(340px,calc(100vw-24px))] rounded-xl bg-surface p-1.5 text-[13px] text-fg shadow-popup outline-none transition-opacity duration-100 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",children:o.map(m=>p.jsxs(R1,{disabled:m.disabled,onClick:m.run,...g?{role:"menuitemradio","aria-checked":!!m.checked}:{},className:"flex w-full cursor-default select-none items-center gap-4 rounded-lg py-2 pl-3 pr-2.5 text-left outline-none data-[highlighted]:bg-hover data-[disabled]:opacity-45",children:[p.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[p.jsx("span",{className:lt("truncate",m.danger&&"text-danger"),children:m.label}),m.sub?p.jsx("span",{className:"text-xs text-fg-muted",children:m.sub}):null]}),g?p.jsx("span",{className:"flex w-[18px] shrink-0 justify-center text-accent",children:m.checked?p.jsx(Pr,{className:"size-4"}):null}):null]},m.key))})})})]})}function r4({spec:t,onDone:o}){const a=b.useRef(null);return b.useEffect(()=>{const r=requestAnimationFrame(()=>a.current?.focus());return()=>cancelAnimationFrame(r)},[]),p.jsx("div",{role:"alertdialog","aria-modal":"true","aria-label":t.title,className:"absolute inset-0 z-[2] grid place-items-center rounded-2xl bg-surface/85 p-5 backdrop-blur-[2px]",onMouseDown:r=>{r.target===r.currentTarget&&o(!1)},children:p.jsxs("div",{className:"w-full max-w-[360px] rounded-xl bg-surface p-[18px] shadow-popup",children:[p.jsx("h3",{className:"m-0 mb-1.5 text-[15px] font-semibold",children:t.title}),p.jsx("p",{className:"m-0 mb-4 text-fg-muted",children:t.body}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx(it,{ref:a,size:"lg",onClick:()=>o(!1),children:E("cancel")}),p.jsx(it,{size:"lg",variant:"danger",onClick:()=>o(!0),children:t.ok})]})]})})}function Rn({children:t}){return p.jsx("div",{className:"mb-2 mt-[18px] text-[13px] text-fg-muted",children:t})}function ls({children:t,dim:o}){return p.jsx("div",{className:lt("grid size-9 shrink-0 place-items-center rounded-full bg-surface-2 text-fg",o&&"opacity-50"),children:t})}const go="flex min-h-12 items-center gap-3 py-1",Ca="border-transparent bg-surface-2 px-3 text-[13px] hover:bg-hover";function es({which:t,url:o}){const a=Q(r=>r.share.copied===t);return p.jsx(it,{size:"lg",variant:"ghost",icon:a?p.jsx(Pr,{className:"size-3.5"}):p.jsx(zm,{className:"size-3.5"}),className:lt(Ca,a&&"text-success"),disabled:!o,onClick:()=>{hE(t,o)},children:E(a?"copied":"copyLink")})}function El(t,o={},a=!1){return p.jsxs(it,{size:"lg",variant:"ghost",className:lt("gap-1.5 px-2.5 font-normal data-[popup-open]:bg-hover",a&&"-ml-2.5 max-w-full font-medium"),...o,children:[p.jsx("span",{className:"truncate",children:t}),p.jsx(Aa,{className:"size-3.5 shrink-0 text-fg-muted"})]})}function G0(){const t=Fn(),o=t.userName||E("you");return p.jsxs("div",{className:go,children:[p.jsx("div",{className:"grid size-9 shrink-0 place-items-center rounded-full text-[13px] font-semibold text-white",style:{background:qm(`local${o}`)},children:Ym(o)}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"truncate",children:[o,t.userName?p.jsxs("span",{className:"text-fg-muted",children:[" ",E("you")]}):null]}),p.jsx("div",{className:"truncate text-xs text-fg-muted",children:E("thisComputer")})]}),p.jsxs("span",{className:"inline-flex h-8 items-center gap-1.5 px-2.5 text-fg-subtle",children:[E("owner"),p.jsx(Aa,{className:"size-3.5"})]})]})}function EE({guest:t,view:o}){const a=b.useContext(Ha),r=t.online?E("online"):t.active?E("seenAgo",{when:wl(t.seen??t.joined)}):E("guestPaused");return p.jsxs("div",{className:go,"data-share-guest":t.id,children:[p.jsxs("div",{className:lt("relative grid size-9 shrink-0 place-items-center rounded-full text-[13px] font-semibold text-white",!t.active&&"opacity-55 grayscale"),style:{background:qm(t.id)},children:[Ym(t.name),t.online?p.jsx("span",{"aria-hidden":!0,className:"absolute -bottom-px -right-px size-2.5 rounded-full border-2 border-surface bg-success"}):null]}),p.jsxs("div",{className:lt("min-w-0 flex-1",!t.active&&"opacity-70"),children:[p.jsx("div",{className:"truncate",children:t.name}),p.jsx("div",{className:lt("truncate text-xs",t.online?"text-success":"text-fg-muted"),children:r})]}),p.jsx(Br,{trigger:El(E(Jo[t.role]),{"aria-label":E("changeRole",{name:t.name})}),items:Hr.map(l=>{const c=!!o.links[l]?.on;return{key:l,label:E(Jo[l]),...c?{}:{sub:E("roleLinkOff")},checked:l===t.role,disabled:!c,run:()=>{l!==t.role&&Hn({guests:{[t.id]:l}})}}})}),p.jsx(za,{label:E("removeGuest",{name:t.name}),title:E("remove"),noTooltip:!0,size:"lg",icon:p.jsx(Uw,{className:"size-4"}),onClick:()=>a.ask({title:E("removeTitle",{name:t.name}),body:E("removeBody"),ok:E("remove"),run:()=>{Hn({guests:{[t.id]:null}})}})})]})}function i4({view:t}){const o=Cz(t),a=t.lan?t.addresses?.length?E("onNetworkAt",{addresses:o.join(" · ")}):E("noAddress"):E("whereOff"),r=t.port?`:${t.port}`:"";return p.jsxs("div",{className:lt(go,"items-start"),children:[p.jsx(ls,{children:t.lan?p.jsx(Mk,{className:"size-4"}):p.jsx(cf,{className:"size-4"})}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx(Br,{align:"start",trigger:El(t.lan?E("onLan"):E("onlyThisComputer"),{"aria-label":E("generalAccess")},!0),items:[{key:"here",label:E("onlyThisComputer"),sub:E("onlyHereSub"),checked:!t.lan,run:()=>t.lan&&void Hn({lan:!1})},{key:"lan",label:E("onLan"),sub:E("onLanSub"),checked:t.lan,run:()=>!t.lan&&void Hn({lan:!0})}]}),p.jsx("div",{className:"break-words text-xs text-fg-muted",children:a}),t.lan&&t.tailnet?p.jsx("div",{className:"mt-0.5 break-words text-xs text-fg-muted",children:E("onTailnet",{address:`${t.tailnet.address}${r}`})}):null]})]})}function CE({role:t,view:o}){const a=b.useContext(Ha),r=o.links[t];if(!r)return null;const l=o.lan&&o.tailnet?o.tailnet.links[t]:void 0,c=[...r.on&&l?[{key:"tailnet",label:E("copyTailnet"),sub:E("copyTailnetNote",{address:o.tailnet.address}),run:()=>{hE(t,l)}}]:[],r.on?{key:"off",label:E("turnOffLink"),sub:E("turnOffNote"),run:()=>{Hn({links:{[t]:!1}})}}:{key:"on",label:E("turnOnLink"),run:()=>{Hn({links:{[t]:!0}})}},{key:"reset",label:E("resetLink"),sub:E("resetNote"),danger:!0,run:()=>a.ask({title:E("resetTitle",{role:E(lh[t])}),body:E("resetBody"),ok:E("resetLink"),run:()=>{Hn({reset:[t]})}})}];return p.jsxs("div",{className:go,title:r.on?r.url:void 0,"data-share-link":t,children:[p.jsx(ls,{dim:!r.on,children:s4[t]}),p.jsxs("div",{className:lt("min-w-0 flex-1",!r.on&&"opacity-50"),children:[p.jsx("div",{className:"truncate",children:E(lh[t])}),p.jsx("div",{className:"truncate text-xs text-fg-muted",children:r.on?E(rg[t]):E("linkOff")})]}),r.on?p.jsx(es,{which:t,url:r.url??""}):p.jsx(it,{size:"lg",variant:"ghost",className:Ca,onClick:()=>{Hn({links:{[t]:!0}})},children:E("turnOn")}),p.jsx(Br,{items:c,trigger:p.jsx(za,{label:E("moreFor",{role:E(lh[t])}),title:E("more"),noTooltip:!0,size:"lg",icon:p.jsx(Tk,{className:"size-4"})})})]})}const l4={connected:"pubStateConnected",connecting:"pubStateConnecting",unreachable:"pubStateUnreachable",signed_out:"pubStateSignedOut"},ig=t=>tg(t);function c4({host:t,name:o,error:a,taken:r}){const[l,c]=b.useState(t),[d,g]=b.useState(o),[m,h]=b.useState(!!o),y=b.useId(),v=b.useId(),S=ZT(l),w=S.ok&&S.insecure===!0,T=m?d:l.trim()?a3(S.ok?S.host:`https://${l.trim()}`,r):"";return p.jsxs("form",{"data-publish-form":"",className:"mt-2 rounded-xl border border-line p-3",onSubmit:O=>{O.preventDefault(),R5(l,T)},children:[p.jsx("label",{htmlFor:y,className:"mb-1 block text-xs font-medium",children:E("pubAddress")}),p.jsx(tl,{id:y,autoFocus:!0,value:l,type:"text",inputMode:"url",autoComplete:"url",spellCheck:!1,placeholder:E("pubAddressPlaceholder"),className:"h-8 w-full text-[13px]",onChange:O=>c(O.target.value)}),p.jsx("div",{className:"mt-1 text-xs text-fg-muted",children:E("pubAddressHint")}),w?p.jsxs("div",{"data-publish-insecure":"",className:"mt-1 flex items-start gap-1.5 text-xs text-warning",children:[p.jsx(xl,{className:"mt-px size-3.5 shrink-0"}),E("pubInsecureWarning")]}):null,p.jsx("label",{htmlFor:v,className:"mb-1 mt-3 block text-xs font-medium",children:E("pubName")}),p.jsx(tl,{id:v,value:T,type:"text",autoComplete:"off",spellCheck:!1,className:"h-8 w-40 text-[13px]",onChange:O=>{h(!0),g(O.target.value)}}),p.jsx("div",{className:"mt-1 text-xs text-fg-muted",children:E("pubNameHint")}),a?p.jsx("div",{role:"alert",className:"mt-2 text-xs text-danger",children:a}):null,p.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[p.jsx(it,{size:"lg",onClick:()=>Vh(),children:E("cancel")}),p.jsx(it,{type:"submit",size:"lg",variant:"primary",disabled:!l.trim(),children:E("pubConnect")})]})]})}function u4({taken:t}){const o=Q(a=>a.publish.connect);switch(o.step){case"closed":return null;case"form":return p.jsx(c4,{host:o.host,name:o.name,error:o.error,taken:t});case"starting":return p.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded-xl border border-line p-3 text-fg-muted",children:[p.jsx(so,{className:"size-4 animate-spin"}),E("pubConnecting")]});case"code":{const{start:a}=o;return p.jsxs("div",{"data-publish-code":"",className:"mt-2 rounded-xl border border-line p-3",children:[p.jsx("div",{className:"font-medium",children:E("pubCodeTitle",{host:Vn(a.host)})}),p.jsx("p",{className:"mb-2 mt-1 text-xs text-fg-muted",children:E("pubCodeBody")}),p.jsx("div",{className:"mb-2.5 select-all rounded-lg bg-surface-2 py-2 text-center font-mono text-xl font-semibold tracking-[0.2em]",children:a.user_code}),a.opened?p.jsx("p",{className:"mb-2 mt-0 text-xs text-fg-muted",children:E("pubCodeOpened")}):null,p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx(it,{size:"lg",variant:"primary",icon:p.jsx(vl,{className:"size-3.5"}),onClick:()=>ig(a.verification_uri_complete),children:E("pubOpenApproval")}),p.jsxs("span",{className:"flex flex-1 items-center gap-1.5 text-xs text-fg-muted",children:[p.jsx(so,{className:"size-3.5 animate-spin"}),E("pubWaitingApproval")]}),p.jsx(it,{size:"lg",variant:"ghost",onClick:()=>Vh(),children:E("cancel")})]})]})}case"done":return p.jsxs("div",{role:"status",className:"mt-2 flex items-center gap-2 text-xs text-success",children:[p.jsx(Pr,{className:"size-3.5 shrink-0"}),E("pubConnected",{host:Vn(o.host),name:o.user})]});case"failed":return p.jsxs("div",{className:"mt-2 rounded-xl border border-line p-3",children:[p.jsx("div",{role:"alert",className:"text-xs text-danger",children:o.error}),p.jsxs("div",{className:"mt-2.5 flex justify-end gap-2",children:[p.jsx(it,{size:"lg",variant:"ghost",onClick:()=>Vh(),children:E("cancel")}),p.jsx(it,{size:"lg",onClick:()=>al({host:o.host,name:o.name}),children:E("pubTryAgain")})]})]})}}function f4({remote:t,isDefault:o}){const a=Q(d=>d.publish.busy),r=i3(t),l=a===`publish:${t.name}`,c=[t.user?E("pubSignedInAs",{name:t.user.name||t.user.email||t.user.id}):"",E(l4[r])].filter(Boolean).join(" · ");return t.approval?p.jsx(d4,{remote:t}):p.jsxs("div",{className:go,"data-publish-remote":t.name,children:[p.jsx(ls,{dim:r==="signed_out",children:r==="unreachable"||r==="signed_out"?p.jsx(_m,{className:"size-4"}):p.jsx($1,{className:"size-4"})}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"truncate",children:[t.name," ",p.jsxs("span",{className:"text-fg-muted",children:["· ",Vn(t.host)]}),o?p.jsx("span",{"data-publish-default":"",className:"ml-1.5 rounded bg-surface-2 px-1 text-[11px] text-fg-muted",children:E("pubDefaultMark")}):null]}),p.jsx("div",{className:lt("truncate text-xs",r==="connected"?"text-success":"text-fg-muted"),children:c}),t.insecure?p.jsx("div",{className:"truncate text-xs text-warning",children:E("pubInsecureWarning")}):null]}),r==="signed_out"?p.jsx(it,{size:"lg",variant:"ghost",className:Ca,onClick:()=>al({host:t.host,name:t.name}),children:E("pubReconnect")}):p.jsx(it,{size:"lg",variant:"primary",disabled:!!a,icon:l?p.jsx(so,{className:"size-3.5 animate-spin"}):void 0,onClick:()=>{O5(t.name)},children:E(l?"pubPublishing":"pubPublish")})]})}function d4({remote:t}){const o=t.approval,a=Vn(t.host);return p.jsxs("div",{"data-publish-approval":t.name,className:"mt-2 rounded-xl border border-line p-3",children:[p.jsx("div",{className:"font-medium",children:E("pubApprovalTitle",{host:a})}),p.jsx("p",{className:"mb-2 mt-1 text-xs text-fg-muted",children:E("pubApprovalBody",{host:a})}),p.jsx("div",{className:"mb-2.5 select-all rounded-lg bg-surface-2 py-2 text-center font-mono text-xl font-semibold tracking-[0.2em]",children:o.user_code}),t.insecure?p.jsx("p",{className:"mb-2 mt-0 text-xs text-warning",children:E("pubInsecureWarning")}):null,p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx(it,{size:"lg",variant:"primary",icon:p.jsx(vl,{className:"size-3.5"}),onClick:()=>ig(o.verification_uri_complete),children:E("pubOpenApproval")}),p.jsxs("span",{className:"flex flex-1 items-center gap-1.5 text-xs text-fg-muted",children:[p.jsx(so,{className:"size-3.5 animate-spin"}),E("pubWaitingApproval")]})]})]})}function p4({remotes:t}){const o=Q(d=>d.publish.cloud),a=Q(d=>d.publish.busy);if(!o)return null;const r=JT(t,o),l=t.find(d=>d.name===r)?.host,c=o.publish==="auto";return p.jsxs("div",{"data-publish-auto":c?"on":"off",className:"mt-2 border-t border-line pt-2",children:[eE(t)?p.jsxs("label",{className:"flex min-h-9 items-center gap-3 py-1",children:[p.jsx("span",{className:"min-w-0 flex-1",children:E("pubDefaultSite")}),p.jsx(Pj,{"aria-label":E("pubDefaultSite"),value:r,className:"h-8 max-w-60 overflow-hidden whitespace-nowrap text-[13px]",options:t.map(d=>({value:d.name,label:`${d.name} · ${Vn(d.host)}`})),onChange:d=>{N5(d)}})]}):null,p.jsxs("label",{className:"flex min-h-9 cursor-default items-center gap-3 py-1",children:[p.jsx("span",{className:"min-w-0 flex-1",children:E("pubAutoSwitch")}),p.jsx(wT,{checked:c,disabled:!!a||!c&&!r,"aria-label":E("pubAutoSwitch"),onChange:d=>{A5(d)}})]}),p.jsx("div",{className:"text-xs text-fg-muted",children:r&&l?c?E("pubAutoHint",{host:Vn(l)}):null:E("pubAutoNoSite")})]})}const h4={in_sync:"text-success",waiting:"text-fg-muted",offline:"text-warning",signed_out:"text-warning",failed:"text-danger"};function m4({remote:t,artifact:o}){const a=b.useContext(Ha),r=Q(g=>g.publish.busy),l=l3(t,o),c=c3(l,t.host,wl),d=Vn(t.host);return p.jsxs("div",{"data-publish-state":l.kind,children:[p.jsxs("div",{className:go,title:o.view_url,children:[p.jsx(ls,{children:p.jsx(Dm,{className:"size-4"})}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"truncate",children:E("pubPublishedAt",{host:d})}),p.jsx("div",{className:"truncate text-xs text-fg-muted",children:o.view_url})]}),p.jsx(es,{which:"web",url:o.view_url}),p.jsx(za,{label:E("pubOpen"),size:"lg",icon:p.jsx(vl,{className:"size-4"}),onClick:()=>ig(o.view_url)})]}),p.jsxs("div",{className:lt("mt-0.5 flex items-start gap-1.5 text-xs",h4[l.kind]),role:"status","data-publish-sync":"",children:[l.kind==="in_sync"?p.jsx(Pr,{className:"mt-px size-3.5 shrink-0"}):l.kind==="waiting"?p.jsx(so,{className:"mt-px size-3.5 shrink-0"}):p.jsx(_m,{className:"mt-px size-3.5 shrink-0"}),p.jsxs("span",{className:"min-w-0 flex-1 break-words",children:[E(c.key,c.vars),(l.kind==="offline"||l.kind==="failed")&&l.count?` · ${E(l.count===1?"pubWaitingOne":"pubWaiting",{count:l.count})}`:""]}),l.kind==="signed_out"?p.jsx("button",{type:"button",className:"shrink-0 text-accent hover:underline",onClick:()=>al({host:t.host,name:t.name}),children:E("pubReconnect")}):null]}),p.jsxs("p",{className:"mb-0 mt-2.5 text-xs text-fg-muted",children:[E("pubManage")," ",p.jsx("a",{href:o.view_url,target:"_blank",rel:"noopener",className:"text-accent hover:underline",onClick:g=>{g.preventDefault(),tg(o.view_url)},children:E("pubManageLink")})]}),p.jsx("p",{className:"mb-0 mt-1 text-xs text-fg-muted",children:E("pubOpensThere")}),p.jsx(g4,{host:d}),p.jsx("div",{className:"mt-2.5 flex justify-end",children:p.jsx(it,{size:"lg",variant:"ghost",className:"text-danger",disabled:!!r,icon:r==="unpublish"?p.jsx(so,{className:"size-3.5 animate-spin"}):void 0,onClick:()=>a.ask({title:E("unpubTitle"),body:E("unpubBody",{host:d}),ok:E("pubUnpublish"),run:()=>{k5()}}),children:E(r==="unpublish"?"pubUnpublishing":"pubUnpublish")})})]})}function g4({host:t}){const o=b.useContext(Ha),a=Q(l=>l.publish.data),r=Q(l=>l.publish.busy);return a?.live?a.publish?p.jsxs("div",{"data-publish-data":"on",className:"mt-2 text-xs text-fg-muted",children:[p.jsx("div",{children:a.at?E("pubDataAsOf",{time:new Date(a.at).toLocaleString()}):E("pubDataNone")}),a.lastError?p.jsx("div",{className:"text-warning",children:E("pubDataFailed",{reason:a.lastError})}):null,p.jsxs("div",{className:"mt-1 flex flex-wrap justify-end gap-2",children:[p.jsx(it,{size:"sm",variant:"ghost",className:Ca,disabled:!!r||a.running,"data-publish-data-refresh":"",icon:r==="data-refresh"||a.running?p.jsx(so,{className:"size-3.5 animate-spin"}):void 0,onClick:()=>{E5()},children:r==="data-refresh"||a.running?E("pubDataRefreshing"):E("pubDataRefresh")}),p.jsx(it,{size:"sm",variant:"ghost",className:lt(Ca,"text-danger"),disabled:!!r,"data-publish-data-stop":"",onClick:()=>o.ask({title:E("pubDataStopTitle"),body:E("pubDataStopBody",{host:t}),ok:E("pubDataStop"),run:()=>{F0(!1)}}),children:E("pubDataStop")})]})]}):p.jsxs("div",{"data-publish-data":"pending",className:"mt-2 flex items-start gap-2 text-xs text-fg-muted",children:[p.jsx("span",{className:"min-w-0 flex-1",children:E("pubDataPending")}),p.jsx(it,{size:"sm",variant:"ghost",className:Ca,disabled:!!r,"data-publish-data-confirm":"",onClick:()=>{F0(!0)},children:E("pubDataConfirm")})]}):null}function X0(){const t=Q(S=>S.boot?.id??""),o=Q(S=>S.publish.remotes),a=Q(S=>S.publish.missing),r=Q(S=>S.publish.connect.step),l=Q(S=>S.publish.error),c=Q(S=>S.publish.cloud),d=Q(S=>S.publish.data);if(a||o===null)return null;const g=Km(o,t),m=o.map(S=>S.name),h=g?null:o3(c,t),y=h?s3(h,o):null,v=JT(o,c);return p.jsxs("section",{"data-share-publish":"",children:[p.jsx(Rn,{children:E("pubTitle")}),h&&y?p.jsxs("div",{"data-publish-auto-state":h.kind,role:"status",className:lt("mb-1 flex items-start gap-1.5 text-xs",h.kind==="failed"?"text-warning":"text-fg-muted"),children:[h.kind==="failed"?p.jsx(_m,{className:"mt-px size-3.5 shrink-0"}):p.jsx(so,{className:"mt-px size-3.5 shrink-0 animate-spin"}),p.jsx("span",{className:"min-w-0 flex-1 break-words",children:E(y.key,y.vars)})]}):null,g?p.jsx(m4,{remote:g.remote,artifact:g.artifact}):o.length?p.jsxs(p.Fragment,{children:[o.map(S=>p.jsx(f4,{remote:S,isDefault:eE(o)&&S.name===v},S.name)),d?.live?p.jsx("p",{"data-publish-data-note":"",className:"mb-0 mt-1 text-xs text-fg-muted",children:E("pubDataNote")}):null,r==="closed"||r==="done"?p.jsx("button",{type:"button",className:"mt-1 text-xs text-accent hover:underline",onClick:()=>al(),children:E("pubConnectAnother")}):null]}):p.jsxs("div",{className:lt(go,"items-start"),children:[p.jsx(ls,{children:p.jsx(Dm,{className:"size-4"})}),p.jsx("div",{className:"min-w-0 flex-1 pt-0.5 text-xs text-fg-muted",children:E("pubIntro")}),r==="closed"?p.jsx(it,{size:"lg",variant:"ghost",className:Ca,onClick:()=>al(),children:E("pubConnectSite")}):null]}),g&&r==="done"?null:p.jsx(u4,{taken:m}),o.length?p.jsx(p4,{remotes:o}):null,l?p.jsx("div",{role:"alert",className:"mt-2 text-xs text-danger",children:l}):null]})}const K0={restricted:"accessRestricted",link:"accessLink",public:"accessPublic"},$0={restricted:"accessRestrictedSub",link:"accessLinkSub",public:"accessPublicSub"},y4={restricted:p.jsx(cf,{className:"size-4"}),link:p.jsx(zm,{className:"size-4"}),public:p.jsx(Dm,{className:"size-4"})};function W0({cloud:t}){const o=Q(r=>r.boot?.cloud?.user?.id),a=t.owner;return p.jsxs("div",{className:go,"data-share-owner":"",children:[p.jsx(wu,{id:a.id,name:a.name,avatar:a.avatar,size:36}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"truncate",children:[a.name,o===a.id?p.jsxs("span",{className:"text-fg-muted",children:[" ",E("you")]}):null]}),a.email?p.jsx("div",{className:"truncate text-xs text-fg-muted",children:a.email}):null]}),p.jsx("span",{className:"inline-flex h-8 items-center px-2.5 text-fg-subtle",children:E("owner")})]})}function b4({member:t,canManage:o}){const a=b.useContext(Ha),r=Q(g=>g.boot?.cloud?.user?.id),l=t.kind==="domain"?E("memberDomain",{domain:t.label.replace(/^@/,"")}):t.label,c=t.pending?E("memberPending"):t.kind==="group"?E("memberGroup"):t.email&&t.email!==t.label?t.email:"",d=t.kind==="domain"?p.jsx(ls,{children:p.jsx(vk,{className:"size-4"})}):t.kind==="group"?p.jsx(ls,{children:p.jsx(Ui,{className:"size-4"})}):p.jsx("span",{className:lt(t.pending&&"opacity-55"),children:p.jsx(wu,{id:t.id,name:t.label,avatar:t.avatar,size:36})});return p.jsxs("div",{className:go,"data-share-member":t.id,children:[d,p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"truncate",children:[l,r&&t.id===`user:${r}`?p.jsxs("span",{className:"text-fg-muted",children:[" ",E("you")]}):null]}),c?p.jsx("div",{className:"truncate text-xs text-fg-muted",children:c}):null]}),o?p.jsx(Br,{trigger:El(E(Jo[t.role]),{"aria-label":E("changeRole",{name:l})}),items:[...Hr.map(g=>({key:g,label:E(Jo[g]),sub:E(rg[g]),checked:g===t.role,run:()=>{g!==t.role&&Lr(E0(t.id,g))}})),{key:"remove",label:E("removeAccess"),danger:!0,run:()=>a.ask({title:E("removeTitle",{name:l}),body:E("removeMemberBody"),ok:E("remove"),run:()=>{Lr(E0(t.id,null))}})}]}):p.jsx("span",{className:"inline-flex h-8 items-center px-2.5 text-fg-subtle",children:E(Jo[t.role])})]})}function v4(){const[t,o]=b.useState(""),[a,r]=b.useState("editor"),[l,c]=b.useState(""),[d,g]=b.useState(!1),m=async()=>{const{members:h,invalid:y}=sz(t);if(y.length)return c(E("addInvalid",{entries:y.join(", ")}));if(!h.length||d)return;c(""),g(!0);const v=await Lr(rz(h,a));g(!1),v&&o("")};return p.jsxs("form",{className:"mt-3",onSubmit:h=>{h.preventDefault(),m()},children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(tl,{value:t,type:"text",inputMode:"email",autoComplete:"off",spellCheck:!1,"aria-label":E("addPeople"),placeholder:E("addPeoplePlaceholder"),className:"h-8 min-w-0 flex-1 text-[13px]",onChange:h=>{o(h.target.value),l&&c("")}}),p.jsx(Br,{trigger:El(E(Jo[a]),{"aria-label":E("roleFor")}),items:Hr.map(h=>({key:h,label:E(Jo[h]),sub:E(rg[h]),checked:h===a,run:()=>r(h)}))}),p.jsx(it,{type:"submit",size:"lg",variant:"primary",disabled:d||!t.trim(),children:E("add")})]}),l?p.jsx("div",{role:"alert",className:"mt-1.5 text-xs text-danger",children:l}):null]})}function x4({cloud:t}){const o=["restricted","link","public"];return p.jsxs("div",{className:lt(go,"items-start"),children:[p.jsx(ls,{children:y4[t.access]}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx(Br,{align:"start",trigger:El(E(K0[t.access]),{"aria-label":E("generalAccess")},!0),items:o.map(a=>({key:a,label:E(K0[a]),sub:E($0[a]),checked:a===t.access,run:()=>{a!==t.access&&Lr(iz(a))}}))}),p.jsx("div",{className:"break-words text-xs text-fg-muted",children:E($0[t.access])})]})]})}function Q0({label:t,checked:o,onChange:a}){return p.jsxs("label",{className:"flex min-h-9 cursor-default items-center gap-3 py-1",children:[p.jsx("span",{className:"min-w-0 flex-1",children:t}),p.jsx(wT,{checked:o,"aria-label":t,onChange:a})]})}function S4({view:t,cloud:o}){const a=Ws(),r=Q(d=>Tl(d.boot)),l=qT(t),c=p.jsx("div",{className:"mt-4 flex justify-end",children:p.jsx(es,{which:"cloud",url:o.url})});return o.canManage?p.jsxs(p.Fragment,{children:[p.jsx(v4,{}),p.jsx(Rn,{children:E("peopleWithAccess")}),p.jsx(W0,{cloud:o}),o.members.map(d=>p.jsx(b4,{member:d,canManage:!0},d.id)),o.members.length?null:p.jsx("div",{className:"pb-0.5 pt-1.5 text-xs text-fg-muted",children:E("noMembers")}),l.length?p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E("joinedPeople")}),l.map(d=>p.jsx(EE,{guest:d,view:t},d.id))]}):null,p.jsx(Rn,{children:E("generalAccess")}),p.jsx(x4,{cloud:o}),lz(o.access)?p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E("inviteLinks")}),Hr.map(d=>p.jsx(CE,{role:d,view:t},d))]}):null,p.jsx(Rn,{children:E("shareSettings")}),p.jsx(Q0,{label:E("viewersCanExport"),checked:o.settings.viewersCanExport,onChange:d=>{Lr(C0("viewersCanExport",d))}}),p.jsx(Q0,{label:E("editorsCanAsk",{agent:a}),checked:o.settings.editorsCanAskAgent,onChange:d=>{Lr(C0("editorsCanAskAgent",d))}}),c]}):p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E("peopleWithAccess")}),p.jsx(W0,{cloud:o}),p.jsx("p",{className:"mb-0 mt-2 text-fg-muted",children:E("yourRole",{role:E(r==="owner"?"owner":Jo[r])})}),p.jsx("p",{className:"mb-0 mt-1 text-xs text-fg-muted",children:E("onlyOwnerShares")}),c]})}function w4({view:t,children:o}){const[a,r]=b.useState(!1),l=e4(t);return p.jsxs("section",{"data-share-network":a?"open":"closed",className:"mt-4 border-t border-line pt-2",children:[p.jsxs("button",{type:"button","aria-expanded":a,className:"-mx-2 flex w-[calc(100%+16px)] items-start gap-2 rounded-lg px-2 py-1.5 text-left outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent",onClick:()=>r(!a),children:[a?p.jsx(Aa,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}):p.jsx(jm,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}),p.jsxs("span",{className:"min-w-0 flex-1",children:[p.jsxs("span",{className:"block",children:[E("shareOnNetwork"),l?p.jsxs("span",{className:"text-xs text-success",children:[" · ",E(l)]}):null]}),p.jsx("span",{className:"block text-xs text-fg-muted",children:E("shareOnNetworkSub")})]})]}),a?o:null]})}function Z0({view:t,unsupported:o}){const a=Fn();if(!t)return p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E("peopleWithAccess")}),p.jsx(G0,{}),o?p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E("generalAccess")}),p.jsxs("div",{className:go,children:[p.jsx(ls,{children:p.jsx(cf,{className:"size-4"})}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{children:E("onlyThisComputer")}),p.jsx("div",{className:"text-xs text-fg-muted",children:E("cannotShare",{type:a.typeTitle})})]}),p.jsx(es,{which:"page",url:sl()})]})]}):p.jsx("div",{className:"py-2 text-xs text-fg-muted",children:E("loading")})]});const r=qT(t);return p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E("peopleWithAccess")}),p.jsx(G0,{}),p.jsx(Rn,{children:E("joinedPeople")}),r.length?r.map(l=>p.jsx(EE,{guest:l,view:t},l.id)):p.jsx("div",{className:"pb-0.5 pt-1.5 text-xs text-fg-muted",children:E("noneJoined")}),p.jsx(Rn,{children:E("generalAccess")}),p.jsx(i4,{view:t}),p.jsx(Rn,{children:E("inviteLinks")}),Hr.map(l=>p.jsx(CE,{role:l,view:t},l)),t.lan?p.jsx("p",{"data-share-security":"",className:"mb-0 mt-1.5 text-xs text-fg-muted",children:E("plainHttp")}):null]})}function T4(){const t=Fn(),{view:o,unsupported:a}=Q(c=>c.share),r=Q(c=>c.publish.remotes),l=Q(c=>c.artifact?.remote?.url??null);return o?.cloud?p.jsx(S4,{view:o,cloud:o.cloud}):t.cloud?a?p.jsxs("div",{className:"mt-3",children:[p.jsx("p",{className:"mb-2 mt-0 text-xs text-fg-muted",children:E("cannotShareCloud",{type:t.typeTitle})}),p.jsx(es,{which:"page",url:sl()})]}):p.jsx("div",{className:"py-3 text-xs text-fg-muted",children:E("loading")}):t.typeServer&&!t.typeServer.sharePath?p.jsxs(p.Fragment,{children:[p.jsx(Rn,{children:E(t.typeServer.role==="owner"?"onlyThisComputer":"inviteLinks")}),t.typeServer.role==="owner"&&p.jsx("p",{className:"mb-2 text-xs text-fg-muted",children:E("standaloneShare")}),p.jsx(es,{which:"page",url:sl()})]}):J5({id:t.id,remotes:r,publishedUrl:l})==="published"?p.jsxs(p.Fragment,{children:[r===null?p.jsx("div",{className:"py-3 text-xs text-fg-muted",children:E("loading")}):p.jsx(X0,{}),p.jsx(w4,{view:o,children:p.jsx(Z0,{view:o,unsupported:a})})]}):p.jsxs(p.Fragment,{children:[p.jsx(Z0,{view:o,unsupported:a}),p.jsx(X0,{})]})}function Li({kind:t,label:o,description:a,disabled:r,reason:l,more:c,onPick:d}){return p.jsxs("button",{type:"button",disabled:r,title:r?l:void 0,"data-export-row":o,className:"flex w-full items-center gap-3 rounded-[10px] px-2 py-1.5 text-left outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent disabled:opacity-45 disabled:hover:bg-transparent",onClick:()=>{Q.getState().closeShare(),d()},children:[p.jsx("span",{className:"grid size-9 shrink-0 place-items-center rounded-[10px] border border-line",children:a4[t]}),p.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[p.jsx("span",{className:"truncate",children:o}),a?p.jsx("span",{className:"text-xs text-fg-muted",children:a}):null]}),c?p.jsx(jm,{className:"size-4 shrink-0 text-fg-muted"}):p.jsx(tw,{className:"size-[18px] shrink-0 text-fg-muted"})]})}const E4=[];function J0(){const t=Q(h=>h.boot?.typeServer),o=Q(h=>h.report),a=Q(h=>h.share.exports),r=Ws(),l=Fn(),c=e3(o),d=!c.length&&!!o.exports,g=Q(h=>!h.boot?.cloud||IT(Tl(h.boot),h.share.view?.cloud?.settings)),m=Q(h=>h.host?.declared&&!h.boot?.cloud&&!t?h.host.destinations:E4);return p.jsxs("div",{className:"-mx-2 mt-2.5",children:[o.hasContent===!1?p.jsx("div",{className:"px-2 py-2 text-xs text-fg-muted",children:E("nothingToExport")}):null,c.map(h=>p.jsx(Li,{kind:w0(h.kind),label:h.label,description:h.description??(h.interactive?E("exportOptions"):void 0),disabled:h.disabled,reason:h.disabledReason??TE(h.why,r),more:h.more,onPick:()=>o5(h)},h.key)),d&&a===null?p.jsx("div",{className:"px-2 py-2 text-xs text-fg-muted",children:E("loading")}):null,d?(a??[]).map(h=>p.jsx(Li,{kind:w0(h.label),label:h.label,description:h.description,disabled:h.disabled,reason:h.disabledReason,more:h.more,onPick:()=>bn({cmd:"export",label:h.label})},h.label)):null,t?.role==="owner"&&l.type==="docs"?p.jsx(Li,{kind:"folder",label:E("archiveLabel"),description:E("archiveDescription"),onPick:()=>{const h=document.createElement("a");h.href=new URL("_api/frame/archive",location.href).href,h.download="",h.click()}}):null,!t&&g&&$T(o)?p.jsx(Li,{kind:"folder",label:E("archiveLabel"),description:E("archiveDescription"),onPick:()=>{M5()}}):null,m.map(h=>p.jsx(Li,{kind:"file",label:h.label,description:E("destinationDescription",{agent:r}),onPick:()=>{x5(h,r)}},`destination:${h.id}`))]})}function C4(){const t=Q(o=>o.report.shareNotice);return t?p.jsxs("div",{role:"note",className:"mt-3 flex gap-2.5 rounded-lg border border-line bg-surface-2 p-3 text-xs",children:[p.jsx(xl,{className:"mt-px size-3.5 shrink-0 text-danger"}),p.jsx("p",{className:"m-0 whitespace-pre-wrap break-words",children:t.text})]}):null}function R4(){const{view:t,unsupported:o}=Q(c=>c.share),a=Q.getState();if(t?.cloud){const c=t.cloud;return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"mt-3.5 flex gap-3 rounded-[14px] bg-surface-2 p-4",children:[p.jsx(Ui,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("h3",{className:"m-0 text-sm font-semibold",children:E("sendingTitle")}),p.jsx("p",{className:"mb-3 mt-1 text-fg-muted",children:E("sendingBody")}),p.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.canManage?p.jsx(it,{size:"lg",variant:"primary",icon:p.jsx(Ui,{className:"size-3.5"}),onClick:()=>a.setShareTab("share"),children:E("invitePeople")}):null,p.jsx(es,{which:"cloud",url:c.url})]})]})]}),p.jsx(J0,{})]})}const r=t?Rz(t):null,l=t?r?t.lan?E("joinsAs",{role:E(Jo[r]).toLowerCase()}):E("whereOff"):E("allLinksOff"):o?E("onlyHereLink"):"";return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"mt-3.5 flex gap-3 rounded-[14px] bg-surface-2 p-4",children:[p.jsx(Ui,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("h3",{className:"m-0 text-sm font-semibold",children:E("sendingTitle")}),p.jsx("p",{className:"mb-3 mt-1 text-fg-muted",children:E("sendingBody")}),p.jsxs("div",{className:"flex flex-wrap gap-2",children:[t?p.jsx(it,{size:"lg",variant:"primary",icon:p.jsx(Ui,{className:"size-3.5"}),onClick:()=>a.setShareTab("share"),children:E("invitePeople")}):null,t&&r?p.jsx(es,{which:r,url:t.links[r]?.url??""}):null,t?null:p.jsx(es,{which:"page",url:sl()})]}),l?p.jsx("p",{className:"mb-0 mt-2.5 text-xs text-fg-muted",children:l}):null]})]}),p.jsx(J0,{})]})}async function O4(){const t=await n5();Q.getState().shareOpen&&Q.getState().patchShare({exports:t})}function A4(){const t=Fn(),o=og(),a=Q(D=>D.shareOpen),r=Q(D=>D.shareTab),l=Q(D=>D.share.error),c=Q(D=>D.share.unsupported),d=Q(D=>D.share.view),g=Q(D=>D.artifact),m=Q(D=>D.report),h=Q.getState(),y=Ez(d,m,g),v=Q(D=>D.boot&&!D.boot.cloud?D.artifact?.remote?.url??null:null),[S,w]=b.useState(null),T=b.useRef(new Set),O=b.useRef(0),A=b.useRef(null);A.current=S;const C=b.useRef({menu(D,L,B){L?T.current.add(D):T.current.delete(D),!L&&B==="escape-key"&&(O.current=performance.now())},ask:D=>w(D)}).current,_=Q(D=>D.boot?.typeServer);b.useEffect(()=>{if(!a){w(null);return}if(_&&!_.sharePath||(Hn(),c))return;const D=setInterval(()=>{Hn()},4e3);return()=>clearInterval(D)},[a,_,c]),b.useEffect(()=>{if(!a)return;is();const D=setInterval(()=>{is()},4e3);return()=>{clearInterval(D),C5()}},[a]);const k=!!m.exports&&!m.formats?.length;b.useEffect(()=>{a&&k&&O4()},[a,k]);const j=_?_.role==="owner"&&!!m.formats?.length:Xi(m),z=(D,L)=>{if(D)return h.openShare("share");switch(L.reason){case"escape-key":if(A.current)return w(null);if(T.current.size||performance.now()-O.current<250)return;break;case"outside-press":{const B=L.event.target;if(B instanceof Element&&B.closest("[data-share-menu]"))return;break}case"focus-out":return}h.closeShare()};return p.jsxs(yM,{open:a,onOpenChange:z,children:[p.jsx(SM,{render:p.jsxs(it,{size:"lg",variant:"ghost",title:[E("share"),y?E(d?.cloud?"sharedWithOthers":"sharedOnNetwork"):"",v?E("pubCloudAt",{url:v}):""].filter(Boolean).join(" · "),"aria-label":E("share"),className:"gap-1.5 px-2 font-normal data-[popup-open]:bg-hover",icon:p.jsx(Vk,{className:"size-4"}),children:[p.jsx("span",{className:t.type==="docs"?void 0:"max-sm:hidden",children:E("share")}),y?p.jsx("span",{"aria-hidden":!0,"data-share-dot":"",className:"size-1.5 shrink-0 rounded-full bg-success max-sm:absolute max-sm:right-1 max-sm:top-1"}):null,v?p.jsx("span",{"data-share-published":"","aria-label":E("pubCloudMark"),className:"inline-flex text-accent max-sm:hidden",children:p.jsx($1,{className:"size-3.5"})}):null]})}),p.jsx(TM,{children:p.jsx(EM,{side:"bottom",align:"end",sideOffset:10,collisionPadding:12,className:"z-[1000]",children:p.jsxs(OM,{"aria-label":E("shareTitle"),className:"relative flex max-h-[min(var(--available-height),calc(100vh-24px))] w-[min(460px,calc(100vw-24px))] origin-[var(--transform-origin)] flex-col rounded-2xl bg-surface text-[13px] text-fg shadow-popup outline-none transition-[opacity,transform] duration-100 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",children:[p.jsx(AM,{className:"size-3.5 rotate-45 rounded-tl-[3px] border-l border-t border-line bg-surface data-[side=bottom]:-top-[7px]"}),p.jsxs(Ha.Provider,{value:C,children:[p.jsxs("div",{className:"min-h-0 overflow-auto overscroll-contain px-5 pb-5 pt-[18px]",children:[p.jsxs("div",{className:"mb-1.5 flex items-center gap-3",children:[p.jsx("h2",{className:"m-0 min-w-0 flex-1 truncate text-[17px] font-semibold tracking-[-0.01em]",children:o||E("shareTitle")}),p.jsx(za,{label:E("close"),icon:p.jsx(Sl,{className:"size-[18px]"}),size:"lg",noTooltip:!0,onClick:()=>h.closeShare()})]}),j?p.jsx(Ij,{"aria-label":E("share"),className:"mt-2.5 h-8",value:r,onChange:D=>h.setShareTab(D),options:[{value:"share",label:E("share")},{value:"export",label:E("export")}]}):null,p.jsx(C4,{}),r==="export"&&j?p.jsx(R4,{}):p.jsx(T4,{}),l?p.jsx("div",{role:"alert",className:"mt-3 text-xs text-danger",children:l}):null]}),S?p.jsx(r4,{spec:S,onDone:D=>{w(null),D&&S.run()}}):null]})]})})})]})}function N4({comments:t,command:o,readOnly:a=!1,disabled:r=!1}){const l=Q(h=>yf(h.report,"comment_selection"));if(!t||!VT({comments:t}))return null;const c=t.on,d=Math.max(0,t.count||0),g=!c&&d>0,m=c?E("doneCommenting"):d===1?E("openComment"):d>0?E("openComments",{count:R0(d)}):E("comments");return p.jsxs("span",{"data-comments-button":"",className:"inline-flex items-center",children:[p.jsx(v1,{label:m,children:p.jsx("button",{type:"button","aria-label":E("comments"),disabled:r,"aria-pressed":a?t.open:c,className:lt("inline-flex size-8 shrink-0 items-center justify-center rounded-control text-fg-muted transition-colors hover:bg-hover hover:text-fg","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent",c&&"text-fg"),onClick:()=>o(a?{cmd:"comments_list",open:!t.open}:{cmd:"comments_mode",on:!c}),children:p.jsxs("span",{className:"relative inline-flex",children:[p.jsx(Lm,{className:"size-4",fill:c?"currentColor":"none"}),g?p.jsx("span",{"aria-hidden":!0,"data-comments-dot":"",className:"absolute -right-0.5 -top-px size-1.5 rounded-full bg-accent ring-[1.5px] ring-surface"}):null]})})}),p.jsxs(el,{align:"end",trigger:p.jsx("button",{type:"button","aria-label":E("commentOptions"),disabled:r,title:E("commentOptions"),className:"-ml-0.5 inline-flex h-8 w-5 shrink-0 items-center justify-center rounded-control text-fg-muted hover:bg-hover hover:text-fg focus-visible:outline-2 focus-visible:outline-accent data-[popup-open]:bg-hover",children:p.jsx(Aa,{className:"size-3"})}),children:[l&&!a&&p.jsx(Nt,{disabled:l.disabled,onSelect:()=>o({cmd:"action",id:l.id}),children:E("actionCommentSelection")}),t.open?p.jsx(Nt,{onSelect:()=>o({cmd:"comments_list",open:!1}),children:E("hideComments")}):p.jsx(Nt,{onSelect:()=>o({cmd:"comments_list",open:!0}),children:p.jsxs("span",{className:"flex items-center gap-6",children:[p.jsx("span",{className:"flex-1",children:E("showAllComments")}),d?p.jsx("span",{className:"text-xs text-fg-subtle",children:R0(d)}):null]})})]})]})}function eS({title:t,close:o}){const a=Fn(),[r,l]=b.useState(t.slice(0,249)+" (copy)"),[c,d]=b.useState(!1),[g,m]=b.useState(""),h=async()=>{if(!(c||!r.trim())){d(!0);try{if(a.typeServer){const y=await fetch("_api/frame/duplicate",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:r})}),v=await y.json();if(!y.ok)throw new Error(v.message||y.statusText);location.assign(v.url)}else{const y=await Ct.duplicate(a.id,r);location.assign("/a/"+encodeURIComponent(y.id))}}catch(y){m(y instanceof Error?y.message:String(y)),d(!1)}}};return p.jsxs(Jw,{open:!0,title:E("duplicate"),onOpenChange:y=>{!y&&!c&&o()},footer:p.jsxs(p.Fragment,{children:[p.jsx(it,{disabled:c,onClick:o,children:E("cancel")}),p.jsx(it,{variant:"primary",disabled:c||!r.trim(),onClick:()=>{h()},children:E("duplicate")})]}),children:[p.jsx(tl,{autoFocus:!0,"aria-label":E("copyName"),value:r,maxLength:256,onFocus:y=>y.target.select(),onChange:y=>l(y.target.value),onKeyDown:y=>{y.key==="Enter"&&!y.nativeEvent.isComposing&&h()}}),g&&p.jsx("p",{role:"alert",className:"mt-2 text-sm text-danger",children:g})]})}const k4={save_now:p.jsx(Hk,{className:"size-3.5"}),open_find:p.jsx(Uk,{className:"size-3.5"}),undo:p.jsx(Yk,{className:"size-3.5"}),redo:p.jsx(Pk,{className:"size-3.5"}),edit_page:p.jsx(Im,{className:"size-3.5"}),use_page:p.jsx(hu,{className:"size-3.5"}),comment_selection:p.jsx(Lm,{className:"size-3.5"}),open_page_list:p.jsx(Ak,{className:"size-3.5"}),hand_off_code:p.jsx(Q1,{className:"size-3.5"})};function M4(){const t=og(),[o,a]=b.useState(t),r=b.useRef(null),l=b.useRef(!1),c=b.useRef(0);b.useEffect(()=>{c.current=performance.now(),r.current?.focus(),r.current?.select()},[]);const d=()=>{if(performance.now()-c.current<400){requestAnimationFrame(()=>{r.current?.focus(),r.current?.select()});return}g(!0)},g=m=>{l.current||(l.current=!0,Q.getState().setRenaming(!1),m&&g5(o))};return p.jsx(tl,{ref:r,value:o,maxLength:200,"aria-label":E("artifactName"),className:"h-8 w-[min(360px,50vw)] text-sm font-medium",onChange:m=>a(m.target.value),onBlur:d,onKeyDown:m=>{m.key==="Enter"&&!m.nativeEvent.isComposing?(m.preventDefault(),g(!0)):m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),g(!1))}})}function j4(){const t=Fn(),o=Q(c=>c.library),a=Qs(),{inSession:r,list:l}=FT(o??[],a);return p.jsxs(p.Fragment,{children:[p.jsx(_r,{children:E(r?"inThisSession":"recent")}),o===null?p.jsx(_r,{children:E("loading")}):null,l.slice(0,12).map(c=>p.jsx(Nt,{icon:c.id===t.id?p.jsx(Pr,{className:"size-3.5 text-accent"}):null,shortcut:wl(c.contentAt||c.updatedAt),onSelect:()=>{c.id!==t.id&&(location.href=`/a/${encodeURIComponent(c.id)}${location.search}`)},children:p.jsx("span",{className:lt("block max-w-56 truncate",c.id===t.id&&"font-semibold"),title:`${c.title} · ${c.typeTitle}`,children:c.title||c.id})},c.id)),p.jsx(Ko,{}),p.jsx(Nt,{icon:p.jsx(dw,{className:"size-3.5"}),shortcut:o?String(o.length):void 0,onSelect:()=>location.href="/",children:E("allArtifacts")})]})}function _4(){const t=Fn(),o=og(),a=Q(U=>U.menuOpen),r=Q(U=>U.renaming),[l,c]=b.useState(!1),d=Q(U=>U.confirmingDelete),g=Q(U=>U.artifact),m=Q(U=>U.report),h=Q(U=>U.library),y=Qs(),v=vE(),S=Ws(),w=vf(),T=!!w,O=xf(),A=!T,C=KD(O),_=A||!!w?.user,k=Wz(m).filter(U=>t.type!=="docs"||U.id!=="rename_doc"&&U.id!=="open_page_list"),j=!!t.page&&!t.empty&&!t.problem,z=Q.getState();b.useEffect(()=>{document.title=o},[o]);const D=U=>{z.setMenuOpen(U),U&&(Q.getState().library===null&&fE(),Ta())},L=p.jsx(NM,{open:d,onOpenChange:U=>z.setConfirmingDelete(U),title:E("deleteTitle",{title:o}),description:E("deleteBody",{root:t.root}),confirmLabel:E("delete"),danger:!0,onConfirm:()=>{b5()}});if(t.typeServer&&t.type==="docs")return p.jsxs(p.Fragment,{children:[p.jsxs(el,{trigger:p.jsxs("button",{type:"button","aria-label":E("artifactOptions"),className:"flex min-w-0 items-center gap-1 px-2",children:[p.jsx("span",{className:"truncate",children:o}),p.jsx(Aa,{className:"size-3.5"})]}),children:[m.actions?.some(U=>U.id==="rename_doc")&&p.jsx(Nt,{onSelect:()=>Ki("rename_doc"),children:E("rename")}),t.typeServer.role==="owner"&&p.jsx(Nt,{disabled:m.leaveLosesWork,onSelect:()=>c(!0),children:E("duplicate")}),p.jsx(Nt,{onSelect:()=>z.openShare("share"),children:E("share")}),t.typeServer.role==="owner"&&p.jsx(Nt,{onSelect:()=>z.openShare("export"),children:E("export")}),p.jsx(Nt,{onSelect:()=>bn({cmd:"history"}),children:E("versionHistory")})]}),l&&p.jsx(eS,{title:o,close:()=>c(!1)})]});if(r)return p.jsxs(p.Fragment,{children:[p.jsx(M4,{}),L]});const B=g?g.contentAt||g.updatedAt||g.createdAt:null,Y=FT(h??[],y).list.length;return p.jsxs(p.Fragment,{children:[p.jsxs(el,{open:a,onOpenChange:D,align:"start",trigger:p.jsxs("button",{type:"button",title:`${o} · ${t.typeTitle}`,"aria-label":E("artifactOptions"),className:"inline-flex h-8 min-w-0 max-w-full items-center gap-1 rounded-control px-2.5 text-sm font-medium text-fg outline-none hover:bg-hover focus-visible:outline-2 focus-visible:outline-accent data-[popup-open]:bg-hover",children:[p.jsx("span",{className:"truncate",children:o}),p.jsx(Aa,{className:"size-3.5 shrink-0 text-fg-muted"})]}),children:[p.jsx(e0,{icon:p.jsx(dw,{className:"size-3.5"}),label:p.jsxs("span",{className:"flex items-center justify-between gap-4",children:[E("switchArtifact"),h?p.jsx("span",{className:"text-xs text-fg-subtle",children:Y}):null]}),children:p.jsx(j4,{})}),p.jsx(_r,{children:p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(xk,{className:"size-3.5"}),E("updated",{when:wl(B)||E("never")})]})}),p.jsx(Ko,{}),p.jsx(Nt,{icon:p.jsx(Fk,{className:"size-3.5"}),onSelect:()=>z.openShare("share"),children:E("share")}),p.jsx(Nt,{icon:p.jsx(tw,{className:"size-3.5"}),disabled:!Xi(m),onSelect:()=>z.openShare("export"),children:E("export")}),v&&y?p.jsx(Nt,{icon:p.jsx(Pm,{className:"size-3.5"}),shortcut:y.live?y.harnessTitle??y.harness:`${y.harnessTitle??y.harness} · ${E("offline")}`,onSelect:pE,children:E("openSession")}):null,k.length?p.jsx(Ko,{}):null,k.map(U=>p.jsx(Nt,{icon:k4[U.id],disabled:U.disabled,onSelect:()=>Ki(U.id),children:p.jsx("span",{title:U.disabled?TE(U.why,S):void 0,children:o4(U)})},U.id)),_||C||A||m.history?p.jsx(Ko,{}):null,_?p.jsx(Nt,{icon:g?.pinned?p.jsx(_k,{className:"size-3.5"}):p.jsx(Dk,{className:"size-3.5"}),onSelect:()=>{m5()},children:g?.pinned?E("unpin"):E("pin")}):null,C?p.jsx(Nt,{icon:p.jsx(Im,{className:"size-3.5"}),disabled:t.type==="docs"&&!yf(m,"rename_doc"),onSelect:()=>t.type==="docs"?Ki("rename_doc"):z.setRenaming(!0),children:E("rename")}):null,A?p.jsx(Nt,{icon:p.jsx(hu,{className:"size-3.5"}),disabled:t.type==="docs"&&m.leaveLosesWork,onSelect:()=>t.type==="docs"?c(!0):void y5(),children:E("duplicate")}):null,m.history?p.jsx(Nt,{icon:p.jsx(Mw,{className:"size-3.5"}),onSelect:()=>bn({cmd:"history"}),children:E("versionHistory")}):null,p.jsx(Ko,{}),j?p.jsx(Nt,{icon:p.jsx(vl,{className:"size-3.5"}),onSelect:()=>tg(t.pageUrl||new URL(t.page,location.href).href),children:E("openInNewTab")}):null,p.jsx(Nt,{icon:p.jsx(zm,{className:"size-3.5"}),onSelect:()=>{Bh()},children:E("copyLink")}),j?p.jsx(Nt,{icon:p.jsx(Ik,{className:"size-3.5"}),onSelect:aE,children:E("refresh")}):null,A?p.jsxs(p.Fragment,{children:[p.jsxs(e0,{icon:p.jsx(wk,{className:"size-3.5"}),label:p.jsxs("span",{className:"flex items-center justify-between gap-4",children:[E("storage"),p.jsx("span",{className:"text-xs text-fg-subtle",children:x0(g?.bytes)})]}),children:[p.jsx(_r,{children:p.jsxs("span",{className:"flex max-w-72 items-start gap-2 break-all",title:t.root,children:[p.jsx(lw,{className:"mt-0.5 size-3.5 shrink-0"}),p.jsxs("span",{children:[t.root,g?p.jsx("span",{className:"block text-fg-subtle",children:E("inThisFolder",{size:x0(g.bytes)})}):null]})]})}),p.jsx(Ko,{}),p.jsx(Nt,{icon:p.jsx(hu,{className:"size-3.5"}),onSelect:()=>{S5()},children:E("copyPath")})]}),p.jsx(Ko,{}),p.jsx(Nt,{icon:p.jsx(Uw,{className:"size-3.5"}),danger:!0,onSelect:()=>z.setConfirmingDelete(!0),children:E("delete")})]}):null]}),l&&p.jsx(eS,{title:o,close:()=>c(!1)}),L]})}function D4(){const t=Ws();return L5()?p.jsxs("span",{role:"status",className:"inline-flex min-w-0 items-center gap-1.5 whitespace-nowrap text-xs text-fg-muted",children:[p.jsx(so,{className:"size-3.5 shrink-0 animate-spin text-accent motion-reduce:animate-none"}),p.jsx("span",{className:"truncate max-sm:hidden",children:E("working",{agent:t})})]}):null}function z4(t,o){const[a,r]=b.useState(!1);return b.useEffect(()=>{if(!t){r(!1);return}const l=setTimeout(()=>r(!0),o);return()=>clearTimeout(l)},[t,o]),t&&a}function L4(){const t=Q(l=>l.boot?.type==="docs"&&l.report.saved==="reconnecting"?"reconnecting":Zz(l.report)),o=z4(t==="saving",Qz),a=t==="saving"&&!o?"none":t,r="inline-flex min-w-0 items-center gap-1.5 whitespace-nowrap text-xs text-fg-muted";switch(a){case"saving":case"reconnecting":return p.jsxs("span",{role:"status","data-shell-save-state":a,className:r,children:[p.jsx(so,{className:"size-3.5 shrink-0 animate-spin motion-reduce:animate-none"}),p.jsx("span",{className:"max-sm:hidden",children:E(a)})]});case"unsaved":return p.jsxs("span",{role:"status","data-shell-save-state":"unsaved",title:E("notSavedTitle"),className:lt(r,"text-danger"),children:[p.jsx(Sk,{className:"size-3.5 shrink-0"}),p.jsx("span",{className:"max-sm:hidden",children:E("notSaved")})]});case"retry":return p.jsx(it,{"data-shell-save-state":"unsaved",size:"sm",variant:"ghost",className:"text-danger",title:E("notSavedTitle"),icon:p.jsx(_w,{className:"size-3.5"}),onClick:()=>Ki("save_now"),children:p.jsx("span",{className:"max-sm:hidden",children:E("saveRetry")})});case"readonly":return p.jsxs("span",{title:E("readOnlyTitle"),className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[11px] font-medium text-fg-muted",children:[p.jsx(cf,{className:"size-3"}),E("readOnly")]});default:return null}}function tS(){const t=Q(a=>a.report.history??(!a.pageReady&&a.rememberedChrome.history)),o=Q(a=>a.pageReady&&!!a.report.history);return t?p.jsx(za,{label:E("versionHistory"),icon:p.jsx(Mw,{className:"size-4"}),size:"lg",disabled:!o,onClick:()=>bn({cmd:"history"})}):null}function P4(){const t=Ws(),o=Q(d=>d.askOpen),a=vE(),r=Qs(),l=ag(),c=a&&r?E("openHarnessSession",{harness:r.harnessTitle??r.harness}):o?E("hideAsk"):E("messageAgent",{agent:t});return p.jsx(it,{size:"lg",variant:"ghost",title:c,"aria-expanded":o,className:lt(o&&"bg-hover"),icon:p.jsxs("span",{className:"relative",children:[p.jsx(Pm,{className:"size-4"}),p.jsx(bE,{state:l,className:"absolute -right-0.5 -top-0.5 size-1.5"})]}),onClick:()=>a&&!o?pE():Q.getState().setAskOpen(!o),children:p.jsx("span",{className:"max-sm:hidden",children:E("ask",{agent:t})})})}function I4(){const t=Q(h=>h.report.comments??(h.pageReady?void 0:h.rememberedChrome.comments)),o=Q(h=>h.pageReady&&!!h.report.comments),a=Q(h=>h.boot?.typeServer),r=Q(h=>h.boot?.type==="docs"),l=Q(h=>h.boot?.type==="docs"?h.report.title||h.boot.title:h.boot?.title),c=Q(h=>!!h.host?.caps.toolbar),d=xf(),g=xE(),m=vf();return p.jsxs("header",{"aria-label":E("artifactOptions"),className:lt("flex shrink-0 items-center gap-2 border-b border-line bg-surface pl-2.5 pr-2 max-sm:gap-1 max-sm:px-1.5",r?"h-10":"h-12"),children:[p.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[m?.site?.brand?p.jsx("a",{href:`${m.appOrigin}/`,className:"flex min-w-0 max-w-40 shrink-0 items-center rounded px-1 hover:bg-hover",children:p.jsx($5,{site:m.site,compact:!0})}):null,r&&p.jsx("button",{"aria-label":E("documentTabs"),className:"hidden size-7 shrink-0 items-center justify-center [@media(max-width:480px)_and_(pointer:coarse)]:inline-flex",onClick:()=>Ki("open_page_list"),children:p.jsx(jk,{className:"size-4"})}),a&&!r?p.jsx("span",{className:"truncate font-medium",children:l}):p.jsx(_4,{}),p.jsx(D4,{}),p.jsx(L4,{})]}),p.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[p.jsx(Z5,{}),!r&&p.jsx(tS,{}),p.jsx(A4,{}),r&&p.jsx(tS,{}),p.jsx(N4,{comments:t,command:bn,disabled:!o,readOnly:!PT(d)}),g?p.jsx(P4,{}):null,m?p.jsx(K5,{cloud:m}):null,c||a?null:p.jsx(za,{label:E("close"),icon:p.jsx(Sl,{className:"size-4"}),size:"lg",onClick:dE})]})]})}function H4(){const t=Q(a=>a.barHidden||!!a.boot&&gu(a.boot,location.href,_a)),o=Q(a=>a.askOpen);return b.useEffect(()=>{const a=new URLSearchParams(location.search),r=Q.getState();(a.get("toolbar")==="0"||r.boot&&gu(r.boot,location.href,_a))&&r.setBarHidden(!0),(a.get("chat")==="1"||a.get("ask")==="1")&&r.setAskOpen(!0);const l=wz(location.href);if(l){Q.getState().barHidden||r.openShare(l,{wait:!0});const g=YT(location.href,xa.panel);g&&history.replaceState(history.state,"",g)}zT(r.boot)&&N3({mayExport:w5});const c=u5();if(r.boot?.typeServer)return c;j5();const d=_5();return Ta(),fE(),()=>{c(),d()}},[]),p.jsxs("div",{className:"flex h-full flex-col overflow-hidden bg-canvas text-fg",children:[t?null:p.jsx(I4,{}),p.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[p.jsx(q5,{}),o&&!t?p.jsx(H5,{}):null]})]})}function U4(){const t=Q(a=>a.boot),o=Q(a=>a.bootError);return b.useEffect(()=>zD(window),[]),t?p.jsx(H4,{}):o?p.jsx(c0,{icon:p.jsx(xl,{className:"size-6"}),title:E("problemTitle"),children:o}):p.jsx(c0,{icon:p.jsx(so,{className:"size-6 animate-spin"}),title:E("loading")})}document.documentElement.lang=Fm;f5();KR.createRoot(document.getElementById("root")).render(p.jsx(b.StrictMode,{children:p.jsx(gN,{children:p.jsx(d_,{children:p.jsx(U4,{})})})}));
|