opencami 1.8.13 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/client/assets/{CSPContext-DATmz4sz.js → CSPContext-TfUptlEu.js} +1 -1
- package/dist/client/assets/{DirectionContext-FHFKdJq_.js → DirectionContext-CQMv7g2N.js} +1 -1
- package/dist/client/assets/_sessionKey-DYknvaDS.js +23 -0
- package/dist/client/assets/agents-DNywJUai.js +2 -0
- package/dist/client/assets/{agents-screen-C58VLjES.js → agents-screen-fSZJpRi_.js} +1 -1
- package/dist/client/assets/bots-Bqjqhws8.js +2 -0
- package/dist/client/assets/{bots-screen-B8h4Y1VL.js → bots-screen-4yT-e3cM.js} +1 -1
- package/dist/client/assets/{button-BcUmP7JL.js → button-DqP4GZwZ.js} +1 -1
- package/dist/client/assets/{composite--BBbKdxm.js → composite-BLgu_EOL.js} +1 -1
- package/dist/client/assets/{connect-BmwKnEFP.js → connect-CiqRvR6s.js} +1 -1
- package/dist/client/assets/{dashboard-BWQl_-2-.js → dashboard-CyWDWpbj.js} +1 -1
- package/dist/client/assets/{event-BxzjTPjG.js → event-2_Dxdv7h.js} +1 -1
- package/dist/client/assets/{file-explorer-screen-BAbbb_R4.js → file-explorer-screen-CZ2QKk-0.js} +1 -1
- package/dist/client/assets/files-Cbhud0J8.js +2 -0
- package/dist/client/assets/{follow-up-suggestions-Bq-xR5GV.js → follow-up-suggestions-Bi3Ci2my.js} +1 -1
- package/dist/client/assets/{index-BTtT4Vbb.js → index-C_gsW9fo.js} +1 -1
- package/dist/client/assets/{index-rOr2i8gW.js → index-ygitKeM-.js} +1 -1
- package/dist/client/assets/{keyboard-shortcuts-dialog-BA8cBwWm.js → keyboard-shortcuts-dialog-z-amTZVi.js} +1 -1
- package/dist/client/assets/{main-_1IghVZn.js → main-ZBMVSJTF.js} +3 -3
- package/dist/client/assets/{markdown-CqIcraPO.js → markdown-CHUjmWcv.js} +1 -1
- package/dist/client/assets/memory-BRa-0plj.js +2 -0
- package/dist/client/assets/{memory-screen-GBzowsnE.js → memory-screen-C_ZNDGLd.js} +1 -1
- package/dist/client/assets/{menu--FXN_JCl.js → menu-CB88T7R1.js} +1 -1
- package/dist/client/assets/{opencami-logo-BFo87CeM.js → opencami-logo-C0Kj1DiT.js} +1 -1
- package/dist/client/assets/{proxy-CJ6-TEKD.js → proxy-D-juuhw6.js} +1 -1
- package/dist/client/assets/{react-BRYbnjMp.js → react-Akh4y69S.js} +1 -1
- package/dist/client/assets/{search-dialog-CJS2GUnE.js → search-dialog-BasfzCyM.js} +1 -1
- package/dist/client/assets/{search-sources-badge-D0YArqfp.js → search-sources-badge-DwFHWd7S.js} +1 -1
- package/dist/client/assets/{session-export-dialog-Bc9YEPLs.js → session-export-dialog-CAl3iJnD.js} +1 -1
- package/dist/client/assets/{settings-dialog-SDzqDXsx.js → settings-dialog-C8OoRXwX.js} +1 -1
- package/dist/client/assets/skills-Cx12984a.js +2 -0
- package/dist/client/assets/{skills-panel-DIalYvpW.js → skills-panel-B7BRAofP.js} +1 -1
- package/dist/client/assets/styles-CXa-SiWC.css +1 -0
- package/dist/client/assets/{switch-BwmDNR0d.js → switch-DYEbEgy5.js} +1 -1
- package/dist/client/assets/{tabs-T1fJbUsm.js → tabs-eiBvL0H7.js} +1 -1
- package/dist/client/assets/{thinking-DUdE6Iej.js → thinking-CariuioI.js} +1 -1
- package/dist/client/assets/{tooltip-DexBPu8g.js → tooltip-CekkGEYG.js} +1 -1
- package/dist/client/assets/{use-file-explorer-state-eXs92yKN.js → use-file-explorer-state-Dfyh4GwR.js} +1 -1
- package/dist/client/assets/{useBaseUiId-DN9cOflS.js → useBaseUiId-DLhdkHJl.js} +1 -1
- package/dist/client/assets/{useCompositeItem-B_J-cnZX.js → useCompositeItem-DTSTTR0Z.js} +1 -1
- package/dist/client/assets/{useControlled-DeDLOsPR.js → useControlled-CpliTEve.js} +1 -1
- package/dist/client/assets/{useMutation-TzgejsE_.js → useMutation-CpD2Pn0F.js} +1 -1
- package/dist/client/assets/{useOnFirstRender-S4-xcV93.js → useOnFirstRender-DsFYFJoB.js} +1 -1
- package/dist/client/assets/{useQuery-BdjM5kzn.js → useQuery-DMTgpIql.js} +1 -1
- package/dist/server/assets/{_sessionKey-DBzlGMo3.js → _sessionKey-Bhksr7VP.js} +139 -46
- package/dist/server/assets/{_tanstack-start-manifest_v-CX4xb59U.js → _tanstack-start-manifest_v-D-5ReiD4.js} +1 -1
- package/dist/server/assets/{follow-up-suggestions-BmSFSY87.js → follow-up-suggestions-B3hol2KT.js} +2 -2
- package/dist/server/assets/{index-C1dylvu-.js → index-4G_4vZNY.js} +1 -1
- package/dist/server/assets/{router-CL6A11qi.js → router-C9JRmWMm.js} +63 -244
- package/dist/server/assets/{search-dialog-D8DvpPZw.js → search-dialog-CTJULPB8.js} +2 -2
- package/dist/server/assets/{settings-dialog-CeP-J_NJ.js → settings-dialog-B5yR2pBy.js} +2 -2
- package/dist/server/assets/{thinking-ClIWjSbx.js → thinking-CHx4Oouj.js} +2 -2
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/_sessionKey-D2ZMdqJ0.js +0 -23
- package/dist/client/assets/agents-9A0buuwT.js +0 -2
- package/dist/client/assets/bots-Lqt92ma0.js +0 -2
- package/dist/client/assets/files-DvIFms9G.js +0 -2
- package/dist/client/assets/memory-B3LyVZwO.js +0 -2
- package/dist/client/assets/skills-BVLjvrPU.js +0 -2
- package/dist/client/assets/styles-b2XYKZYx.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dashboard-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dashboard-CyWDWpbj.js","assets/useQuery-DMTgpIql.js","assets/connect-CiqRvR6s.js","assets/index-C_gsW9fo.js","assets/button-DqP4GZwZ.js","assets/react-Akh4y69S.js","assets/_sessionKey-DYknvaDS.js","assets/tooltip-CekkGEYG.js","assets/useOnFirstRender-DsFYFJoB.js","assets/useBaseUiId-DLhdkHJl.js","assets/event-2_Dxdv7h.js","assets/visuallyHidden-COI6QeQH.js","assets/DirectionContext-CQMv7g2N.js","assets/useMutation-CpD2Pn0F.js","assets/use-file-explorer-state-Dfyh4GwR.js","assets/composite-BLgu_EOL.js","assets/useControlled-CpliTEve.js","assets/CSPContext-TfUptlEu.js","assets/menu-CB88T7R1.js","assets/useCompositeItem-DTSTTR0Z.js","assets/opencami-logo-C0Kj1DiT.js","assets/proxy-D-juuhw6.js","assets/markdown-CHUjmWcv.js","assets/index-T4TOjvD0.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function Y0(a,i){for(var s=0;s<i.length;s++){const r=i[s];if(typeof r!="string"&&!Array.isArray(r)){for(const c in r)if(c!=="default"&&!(c in a)){const f=Object.getOwnPropertyDescriptor(r,c);f&&Object.defineProperty(a,c,f.get?f:{enumerable:!0,get:()=>r[c]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}function Q0(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var fc={exports:{}},Hi={};var ip;function G0(){if(ip)return Hi;ip=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function s(r,c,f){var y=null;if(f!==void 0&&(y=""+f),c.key!==void 0&&(y=""+c.key),"key"in c){f={};for(var h in c)h!=="key"&&(f[h]=c[h])}else f=c;return c=f.ref,{$$typeof:a,type:r,key:y,ref:c!==void 0?c:null,props:f}}return Hi.Fragment=i,Hi.jsx=s,Hi.jsxs=s,Hi}var sp;function V0(){return sp||(sp=1,fc.exports=G0()),fc.exports}var Z=V0(),dc={exports:{}},rt={};var up;function X0(){if(up)return rt;up=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),y=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),_=Symbol.iterator;function E(O){return O===null||typeof O!="object"?null:(O=_&&O[_]||O["@@iterator"],typeof O=="function"?O:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,w={};function L(O,Q,J){this.props=O,this.context=Q,this.refs=w,this.updater=J||M}L.prototype.isReactComponent={},L.prototype.setState=function(O,Q){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,Q,"setState")},L.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function V(){}V.prototype=L.prototype;function X(O,Q,J){this.props=O,this.context=Q,this.refs=w,this.updater=J||M}var q=X.prototype=new V;q.constructor=X,C(q,L.prototype),q.isPureReactComponent=!0;var F=Array.isArray;function I(){}var K={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function k(O,Q,J){var $=J.ref;return{$$typeof:a,type:O,key:Q,ref:$!==void 0?$:null,props:J}}function ct(O,Q){return k(O.type,Q,O.props)}function it(O){return typeof O=="object"&&O!==null&&O.$$typeof===a}function nt(O){var Q={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(J){return Q[J]})}var Bt=/\/+/g;function Rt(O,Q){return typeof O=="object"&&O!==null&&O.key!=null?nt(""+O.key):Q.toString(36)}function Kt(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(I,I):(O.status="pending",O.then(function(Q){O.status==="pending"&&(O.status="fulfilled",O.value=Q)},function(Q){O.status==="pending"&&(O.status="rejected",O.reason=Q)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function j(O,Q,J,$,at){var dt=typeof O;(dt==="undefined"||dt==="boolean")&&(O=null);var vt=!1;if(O===null)vt=!0;else switch(dt){case"bigint":case"string":case"number":vt=!0;break;case"object":switch(O.$$typeof){case a:case i:vt=!0;break;case v:return vt=O._init,j(vt(O._payload),Q,J,$,at)}}if(vt)return at=at(O),vt=$===""?"."+Rt(O,0):$,F(at)?(J="",vt!=null&&(J=vt.replace(Bt,"$&/")+"/"),j(at,Q,J,"",function(on){return on})):at!=null&&(it(at)&&(at=ct(at,J+(at.key==null||O&&O.key===at.key?"":(""+at.key).replace(Bt,"$&/")+"/")+vt)),Q.push(at)),1;vt=0;var Gt=$===""?".":$+":";if(F(O))for(var Ut=0;Ut<O.length;Ut++)$=O[Ut],dt=Gt+Rt($,Ut),vt+=j($,Q,J,dt,at);else if(Ut=E(O),typeof Ut=="function")for(O=Ut.call(O),Ut=0;!($=O.next()).done;)$=$.value,dt=Gt+Rt($,Ut++),vt+=j($,Q,J,dt,at);else if(dt==="object"){if(typeof O.then=="function")return j(Kt(O),Q,J,$,at);throw Q=String(O),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return vt}function P(O,Q,J){if(O==null)return O;var $=[],at=0;return j(O,$,"","",function(dt){return Q.call(J,dt,at++)}),$}function ut(O){if(O._status===-1){var Q=O._result;Q=Q(),Q.then(function(J){(O._status===0||O._status===-1)&&(O._status=1,O._result=J)},function(J){(O._status===0||O._status===-1)&&(O._status=2,O._result=J)}),O._status===-1&&(O._status=0,O._result=Q)}if(O._status===1)return O._result.default;throw O._result}var wt=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},Tt={map:P,forEach:function(O,Q,J){P(O,function(){Q.apply(this,arguments)},J)},count:function(O){var Q=0;return P(O,function(){Q++}),Q},toArray:function(O){return P(O,function(Q){return Q})||[]},only:function(O){if(!it(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return rt.Activity=S,rt.Children=Tt,rt.Component=L,rt.Fragment=s,rt.Profiler=c,rt.PureComponent=X,rt.StrictMode=r,rt.Suspense=p,rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,rt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return K.H.useMemoCache(O)}},rt.cache=function(O){return function(){return O.apply(null,arguments)}},rt.cacheSignal=function(){return null},rt.cloneElement=function(O,Q,J){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var $=C({},O.props),at=O.key;if(Q!=null)for(dt in Q.key!==void 0&&(at=""+Q.key),Q)!G.call(Q,dt)||dt==="key"||dt==="__self"||dt==="__source"||dt==="ref"&&Q.ref===void 0||($[dt]=Q[dt]);var dt=arguments.length-2;if(dt===1)$.children=J;else if(1<dt){for(var vt=Array(dt),Gt=0;Gt<dt;Gt++)vt[Gt]=arguments[Gt+2];$.children=vt}return k(O.type,at,$)},rt.createContext=function(O){return O={$$typeof:y,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:f,_context:O},O},rt.createElement=function(O,Q,J){var $,at={},dt=null;if(Q!=null)for($ in Q.key!==void 0&&(dt=""+Q.key),Q)G.call(Q,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(at[$]=Q[$]);var vt=arguments.length-2;if(vt===1)at.children=J;else if(1<vt){for(var Gt=Array(vt),Ut=0;Ut<vt;Ut++)Gt[Ut]=arguments[Ut+2];at.children=Gt}if(O&&O.defaultProps)for($ in vt=O.defaultProps,vt)at[$]===void 0&&(at[$]=vt[$]);return k(O,dt,at)},rt.createRef=function(){return{current:null}},rt.forwardRef=function(O){return{$$typeof:h,render:O}},rt.isValidElement=it,rt.lazy=function(O){return{$$typeof:v,_payload:{_status:-1,_result:O},_init:ut}},rt.memo=function(O,Q){return{$$typeof:m,type:O,compare:Q===void 0?null:Q}},rt.startTransition=function(O){var Q=K.T,J={};K.T=J;try{var $=O(),at=K.S;at!==null&&at(J,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(I,wt)}catch(dt){wt(dt)}finally{Q!==null&&J.types!==null&&(Q.types=J.types),K.T=Q}},rt.unstable_useCacheRefresh=function(){return K.H.useCacheRefresh()},rt.use=function(O){return K.H.use(O)},rt.useActionState=function(O,Q,J){return K.H.useActionState(O,Q,J)},rt.useCallback=function(O,Q){return K.H.useCallback(O,Q)},rt.useContext=function(O){return K.H.useContext(O)},rt.useDebugValue=function(){},rt.useDeferredValue=function(O,Q){return K.H.useDeferredValue(O,Q)},rt.useEffect=function(O,Q){return K.H.useEffect(O,Q)},rt.useEffectEvent=function(O){return K.H.useEffectEvent(O)},rt.useId=function(){return K.H.useId()},rt.useImperativeHandle=function(O,Q,J){return K.H.useImperativeHandle(O,Q,J)},rt.useInsertionEffect=function(O,Q){return K.H.useInsertionEffect(O,Q)},rt.useLayoutEffect=function(O,Q){return K.H.useLayoutEffect(O,Q)},rt.useMemo=function(O,Q){return K.H.useMemo(O,Q)},rt.useOptimistic=function(O,Q){return K.H.useOptimistic(O,Q)},rt.useReducer=function(O,Q,J){return K.H.useReducer(O,Q,J)},rt.useRef=function(O){return K.H.useRef(O)},rt.useState=function(O){return K.H.useState(O)},rt.useSyncExternalStore=function(O,Q,J){return K.H.useSyncExternalStore(O,Q,J)},rt.useTransition=function(){return K.H.useTransition()},rt.version="19.2.4",rt}var rp;function $i(){return rp||(rp=1,dc.exports=X0()),dc.exports}var et=$i();const Ql=Q0(et),K0=Y0({__proto__:null,default:Ql},[et]);var hc={exports:{}},qi={},mc={exports:{}},pc={};var op;function Z0(){return op||(op=1,(function(a){function i(j,P){var ut=j.length;j.push(P);t:for(;0<ut;){var wt=ut-1>>>1,Tt=j[wt];if(0<c(Tt,P))j[wt]=P,j[ut]=Tt,ut=wt;else break t}}function s(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var P=j[0],ut=j.pop();if(ut!==P){j[0]=ut;t:for(var wt=0,Tt=j.length,O=Tt>>>1;wt<O;){var Q=2*(wt+1)-1,J=j[Q],$=Q+1,at=j[$];if(0>c(J,ut))$<Tt&&0>c(at,J)?(j[wt]=at,j[$]=ut,wt=$):(j[wt]=J,j[Q]=ut,wt=Q);else if($<Tt&&0>c(at,ut))j[wt]=at,j[$]=ut,wt=$;else break t}}return P}function c(j,P){var ut=j.sortIndex-P.sortIndex;return ut!==0?ut:j.id-P.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var y=Date,h=y.now();a.unstable_now=function(){return y.now()-h}}var p=[],m=[],v=1,S=null,_=3,E=!1,M=!1,C=!1,w=!1,L=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function q(j){for(var P=s(m);P!==null;){if(P.callback===null)r(m);else if(P.startTime<=j)r(m),P.sortIndex=P.expirationTime,i(p,P);else break;P=s(m)}}function F(j){if(C=!1,q(j),!M)if(s(p)!==null)M=!0,I||(I=!0,nt());else{var P=s(m);P!==null&&Kt(F,P.startTime-j)}}var I=!1,K=-1,G=5,k=-1;function ct(){return w?!0:!(a.unstable_now()-k<G)}function it(){if(w=!1,I){var j=a.unstable_now();k=j;var P=!0;try{t:{M=!1,C&&(C=!1,V(K),K=-1),E=!0;var ut=_;try{e:{for(q(j),S=s(p);S!==null&&!(S.expirationTime>j&&ct());){var wt=S.callback;if(typeof wt=="function"){S.callback=null,_=S.priorityLevel;var Tt=wt(S.expirationTime<=j);if(j=a.unstable_now(),typeof Tt=="function"){S.callback=Tt,q(j),P=!0;break e}S===s(p)&&r(p),q(j)}else r(p);S=s(p)}if(S!==null)P=!0;else{var O=s(m);O!==null&&Kt(F,O.startTime-j),P=!1}}break t}finally{S=null,_=ut,E=!1}P=void 0}}finally{P?nt():I=!1}}}var nt;if(typeof X=="function")nt=function(){X(it)};else if(typeof MessageChannel<"u"){var Bt=new MessageChannel,Rt=Bt.port2;Bt.port1.onmessage=it,nt=function(){Rt.postMessage(null)}}else nt=function(){L(it,0)};function Kt(j,P){K=L(function(){j(a.unstable_now())},P)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(j){j.callback=null},a.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<j?Math.floor(1e3/j):5},a.unstable_getCurrentPriorityLevel=function(){return _},a.unstable_next=function(j){switch(_){case 1:case 2:case 3:var P=3;break;default:P=_}var ut=_;_=P;try{return j()}finally{_=ut}},a.unstable_requestPaint=function(){w=!0},a.unstable_runWithPriority=function(j,P){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var ut=_;_=j;try{return P()}finally{_=ut}},a.unstable_scheduleCallback=function(j,P,ut){var wt=a.unstable_now();switch(typeof ut=="object"&&ut!==null?(ut=ut.delay,ut=typeof ut=="number"&&0<ut?wt+ut:wt):ut=wt,j){case 1:var Tt=-1;break;case 2:Tt=250;break;case 5:Tt=1073741823;break;case 4:Tt=1e4;break;default:Tt=5e3}return Tt=ut+Tt,j={id:v++,callback:P,priorityLevel:j,startTime:ut,expirationTime:Tt,sortIndex:-1},ut>wt?(j.sortIndex=ut,i(m,j),s(p)===null&&j===s(m)&&(C?(V(K),K=-1):C=!0,Kt(F,ut-wt))):(j.sortIndex=Tt,i(p,j),M||E||(M=!0,I||(I=!0,nt()))),j},a.unstable_shouldYield=ct,a.unstable_wrapCallback=function(j){var P=_;return function(){var ut=_;_=P;try{return j.apply(this,arguments)}finally{_=ut}}}})(pc)),pc}var cp;function P0(){return cp||(cp=1,mc.exports=Z0()),mc.exports}var yc={exports:{}},oe={};var fp;function k0(){if(fp)return oe;fp=1;var a=$i();function i(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(i(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},c=Symbol.for("react.portal");function f(p,m,v){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:S==null?null:""+S,children:p,containerInfo:m,implementation:v}}var y=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return oe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,oe.createPortal=function(p,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(i(299));return f(p,m,null,v)},oe.flushSync=function(p){var m=y.T,v=r.p;try{if(y.T=null,r.p=2,p)return p()}finally{y.T=m,r.p=v,r.d.f()}},oe.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(p,m))},oe.prefetchDNS=function(p){typeof p=="string"&&r.d.D(p)},oe.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var v=m.as,S=h(v,m.crossOrigin),_=typeof m.integrity=="string"?m.integrity:void 0,E=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?r.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:S,integrity:_,fetchPriority:E}):v==="script"&&r.d.X(p,{crossOrigin:S,integrity:_,fetchPriority:E,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},oe.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=h(m.as,m.crossOrigin);r.d.M(p,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(p)},oe.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,S=h(v,m.crossOrigin);r.d.L(p,v,{crossOrigin:S,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},oe.preloadModule=function(p,m){if(typeof p=="string")if(m){var v=h(m.as,m.crossOrigin);r.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(p)},oe.requestFormReset=function(p){r.d.r(p)},oe.unstable_batchedUpdates=function(p,m){return p(m)},oe.useFormState=function(p,m,v){return y.H.useFormState(p,m,v)},oe.useFormStatus=function(){return y.H.useHostTransitionStatus()},oe.version="19.2.4",oe}var dp;function sy(){if(dp)return yc.exports;dp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),yc.exports=k0(),yc.exports}var hp;function J0(){if(hp)return qi;hp=1;var a=P0(),i=$i(),s=sy();function r(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function y(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function h(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function p(t){if(f(t)!==t)throw Error(r(188))}function m(t){var e=t.alternate;if(!e){if(e=f(t),e===null)throw Error(r(188));return e!==t?null:t}for(var n=t,l=e;;){var u=n.return;if(u===null)break;var o=u.alternate;if(o===null){if(l=u.return,l!==null){n=l;continue}break}if(u.child===o.child){for(o=u.child;o;){if(o===n)return p(u),t;if(o===l)return p(u),e;o=o.sibling}throw Error(r(188))}if(n.return!==l.return)n=u,l=o;else{for(var d=!1,g=u.child;g;){if(g===n){d=!0,n=u,l=o;break}if(g===l){d=!0,l=u,n=o;break}g=g.sibling}if(!d){for(g=o.child;g;){if(g===n){d=!0,n=o,l=u;break}if(g===l){d=!0,l=o,n=u;break}g=g.sibling}if(!d)throw Error(r(189))}}if(n.alternate!==l)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?t:e}function v(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=v(t),e!==null)return e;t=t.sibling}return null}var S=Object.assign,_=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),X=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),ct=Symbol.for("react.memo_cache_sentinel"),it=Symbol.iterator;function nt(t){return t===null||typeof t!="object"?null:(t=it&&t[it]||t["@@iterator"],typeof t=="function"?t:null)}var Bt=Symbol.for("react.client.reference");function Rt(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Bt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case L:return"Profiler";case w:return"StrictMode";case F:return"Suspense";case I:return"SuspenseList";case k:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case M:return"Portal";case X:return t.displayName||"Context";case V:return(t._context.displayName||"Context")+".Consumer";case q:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case K:return e=t.displayName||null,e!==null?e:Rt(t.type)||"Memo";case G:e=t._payload,t=t._init;try{return Rt(t(e))}catch{}}return null}var Kt=Array.isArray,j=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ut={pending:!1,data:null,method:null,action:null},wt=[],Tt=-1;function O(t){return{current:t}}function Q(t){0>Tt||(t.current=wt[Tt],wt[Tt]=null,Tt--)}function J(t,e){Tt++,wt[Tt]=t.current,t.current=e}var $=O(null),at=O(null),dt=O(null),vt=O(null);function Gt(t,e){switch(J(dt,e),J(at,t),J($,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?Mm(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=Mm(e),t=xm(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Q($),J($,t)}function Ut(){Q($),Q(at),Q(dt)}function on(t){t.memoizedState!==null&&J(vt,t);var e=$.current,n=xm(e,t.type);e!==n&&(J(at,t),J($,n))}function cn(t){at.current===t&&(Q($),Q(at)),vt.current===t&&(Q(vt),Ui._currentValue=ut)}var Nn,Vl;function Ie(t){if(Nn===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Nn=e&&e[1]||"",Vl=-1<n.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+Nn+t+Vl}var Xl=!1;function Za(t,e){if(!t||Xl)return"";Xl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(e){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(N){var U=N}Reflect.construct(t,[],Y)}else{try{Y.call()}catch(N){U=N}t.call(Y.prototype)}}else{try{throw Error()}catch(N){U=N}(Y=t())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(N){if(N&&U&&typeof N.stack=="string")return[N.stack,U.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=l.DetermineComponentFrameRoot(),d=o[0],g=o[1];if(d&&g){var R=d.split(`
|
|
@@ -15,7 +15,7 @@ Error generating stack: `+l.message+`
|
|
|
15
15
|
`)}else{const m=c.indexOf(`
|
|
16
16
|
`);if(m>=0){const v=c.slice(0,m).trim();c=c.slice(m+1),v.length>0&&(y=JSON.parse(v),f=!0)}}}return(async()=>{try{for(;;){const{value:h,done:p}=await r.read();h&&(c+=h);const m=c.lastIndexOf(`
|
|
17
17
|
`);if(m>=0){const v=c.slice(0,m);c=c.slice(m+1);const S=v.split(`
|
|
18
|
-
`).filter(Boolean);for(const _ of S)try{i(JSON.parse(_))}catch(E){s?.(`Invalid JSON line: ${_}`,E)}}if(p)break}}catch(h){s?.("Stream processing error:",h)}})(),i(y)}async function vR({jsonStream:a,onMessage:i,onError:s}){const r=a.getReader(),{value:c,done:f}=await r.read();if(f||!c)throw new Error("Stream ended before first object");const y=JSON.parse(c);return(async()=>{try{for(;;){const{value:h,done:p}=await r.read();if(p)break;if(h)try{i(JSON.parse(h))}catch(m){s?.(`Invalid JSON: ${h}`,m)}}}catch(h){s?.("Stream processing error:",h)}})(),i(y)}function SR(a){const i="/_serverFn/"+a;return Object.assign((...c)=>{const f=fg()?.serverFns?.fetch;return mR(i,c,f??fetch)},{url:i,serverFnMeta:{id:a},[jc]:!0})}const bR={key:"$TSS/serverfn",test:a=>typeof a!="function"||!(jc in a)?!1:!!a[jc],toSerializable:({serverFnMeta:a})=>({functionId:a.id}),fromSerializable:({functionId:a})=>SR(a)};var Ju=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_R={setTimeout:(a,i)=>setTimeout(a,i),clearTimeout:a=>clearTimeout(a),setInterval:(a,i)=>setInterval(a,i),clearInterval:a=>clearInterval(a)},ER=class{#t=_R;#n=!1;setTimeoutProvider(a){this.#t=a}setTimeout(a,i){return this.#t.setTimeout(a,i)}clearTimeout(a){this.#t.clearTimeout(a)}setInterval(a,i){return this.#t.setInterval(a,i)}clearInterval(a){this.#t.clearInterval(a)}},Bc=new ER;function RR(a){setTimeout(a,0)}var Fu=typeof window>"u"||"Deno"in globalThis;function Fe(){}function TR(a,i){return typeof a=="function"?a(i):a}function wR(a){return typeof a=="number"&&a>=0&&a!==1/0}function AR(a,i){return Math.max(a+(i||0)-Date.now(),0)}function Hc(a,i){return typeof a=="function"?a(i):a}function OR(a,i){return typeof a=="function"?a(i):a}function $p(a,i){const{type:s="all",exact:r,fetchStatus:c,predicate:f,queryKey:y,stale:h}=a;if(y){if(r){if(i.queryHash!==sf(y,i.options))return!1}else if(!Fi(i.queryKey,y))return!1}if(s!=="all"){const p=i.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof h=="boolean"&&i.isStale()!==h||c&&c!==i.state.fetchStatus||f&&!f(i))}function Ip(a,i){const{exact:s,status:r,predicate:c,mutationKey:f}=a;if(f){if(!i.options.mutationKey)return!1;if(s){if(Ji(i.options.mutationKey)!==Ji(f))return!1}else if(!Fi(i.options.mutationKey,f))return!1}return!(r&&i.state.status!==r||c&&!c(i))}function sf(a,i){return(i?.queryKeyHashFn||Ji)(a)}function Ji(a){return JSON.stringify(a,(i,s)=>qc(s)?Object.keys(s).sort().reduce((r,c)=>(r[c]=s[c],r),{}):s)}function Fi(a,i){return a===i?!0:typeof a!=typeof i?!1:a&&i&&typeof a=="object"&&typeof i=="object"?Object.keys(i).every(s=>Fi(a[s],i[s])):!1}var MR=Object.prototype.hasOwnProperty;function pg(a,i,s=0){if(a===i)return a;if(s>500)return i;const r=Wp(a)&&Wp(i);if(!r&&!(qc(a)&&qc(i)))return i;const f=(r?a:Object.keys(a)).length,y=r?i:Object.keys(i),h=y.length,p=r?new Array(h):{};let m=0;for(let v=0;v<h;v++){const S=r?v:y[v],_=a[S],E=i[S];if(_===E){p[S]=_,(r?v<f:MR.call(a,S))&&m++;continue}if(_===null||E===null||typeof _!="object"||typeof E!="object"){p[S]=E;continue}const M=pg(_,E,s+1);p[S]=M,M===_&&m++}return f===h&&m===f?a:p}function eT(a,i){if(!i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const s in a)if(a[s]!==i[s])return!1;return!0}function Wp(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function qc(a){if(!ty(a))return!1;const i=a.constructor;if(i===void 0)return!0;const s=i.prototype;return!(!ty(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function ty(a){return Object.prototype.toString.call(a)==="[object Object]"}function xR(a){return new Promise(i=>{Bc.setTimeout(i,a)})}function CR(a,i,s){return typeof s.structuralSharing=="function"?s.structuralSharing(a,i):s.structuralSharing!==!1?pg(a,i):i}function zR(a,i,s=0){const r=[...a,i];return s&&r.length>s?r.slice(1):r}function DR(a,i,s=0){const r=[i,...a];return s&&r.length>s?r.slice(0,-1):r}var uf=Symbol();function yg(a,i){return!a.queryFn&&i?.initialPromise?()=>i.initialPromise:!a.queryFn||a.queryFn===uf?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function nT(a,i){return typeof a=="function"?a(...i):!!a}function LR(a,i,s){let r=!1,c;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(c??=i(),r||(r=!0,c.aborted?s():c.addEventListener("abort",s,{once:!0})),c)}),a}var UR=class extends Ju{#t;#n;#e;constructor(){super(),this.#e=a=>{if(!Fu&&window.addEventListener){const i=()=>a();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}}}onSubscribe(){this.#n||this.setEventListener(this.#e)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#e=a,this.#n?.(),this.#n=a(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()})}setFocused(a){this.#t!==a&&(this.#t=a,this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(i=>{i(a)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},gg=new UR;function NR(){let a,i;const s=new Promise((c,f)=>{a=c,i=f});s.status="pending",s.catch(()=>{});function r(c){Object.assign(s,c),delete s.resolve,delete s.reject}return s.resolve=c=>{r({status:"fulfilled",value:c}),a(c)},s.reject=c=>{r({status:"rejected",reason:c}),i(c)},s}var jR=RR;function BR(){let a=[],i=0,s=h=>{h()},r=h=>{h()},c=jR;const f=h=>{i?a.push(h):c(()=>{s(h)})},y=()=>{const h=a;a=[],h.length&&c(()=>{r(()=>{h.forEach(p=>{s(p)})})})};return{batch:h=>{let p;i++;try{p=h()}finally{i--,i||y()}return p},batchCalls:h=>(...p)=>{f(()=>{h(...p)})},schedule:f,setNotifyFunction:h=>{s=h},setBatchNotifyFunction:h=>{r=h},setScheduler:h=>{c=h}}}var he=BR(),HR=class extends Ju{#t=!0;#n;#e;constructor(){super(),this.#e=a=>{if(!Fu&&window.addEventListener){const i=()=>a(!0),s=()=>a(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#n||this.setEventListener(this.#e)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#e=a,this.#n?.(),this.#n=a(this.setOnline.bind(this))}setOnline(a){this.#t!==a&&(this.#t=a,this.listeners.forEach(s=>{s(a)}))}isOnline(){return this.#t}},qu=new HR;function qR(a){return Math.min(1e3*2**a,3e4)}function vg(a){return(a??"online")==="online"?qu.isOnline():!0}var Yc=class extends Error{constructor(a){super("CancelledError"),this.revert=a?.revert,this.silent=a?.silent}};function Sg(a){let i=!1,s=0,r;const c=NR(),f=()=>c.status!=="pending",y=C=>{if(!f()){const w=new Yc(C);_(w),a.onCancel?.(w)}},h=()=>{i=!0},p=()=>{i=!1},m=()=>gg.isFocused()&&(a.networkMode==="always"||qu.isOnline())&&a.canRun(),v=()=>vg(a.networkMode)&&a.canRun(),S=C=>{f()||(r?.(),c.resolve(C))},_=C=>{f()||(r?.(),c.reject(C))},E=()=>new Promise(C=>{r=w=>{(f()||m())&&C(w)},a.onPause?.()}).then(()=>{r=void 0,f()||a.onContinue?.()}),M=()=>{if(f())return;let C;const w=s===0?a.initialPromise:void 0;try{C=w??a.fn()}catch(L){C=Promise.reject(L)}Promise.resolve(C).then(S).catch(L=>{if(f())return;const V=a.retry??(Fu?0:3),X=a.retryDelay??qR,q=typeof X=="function"?X(s,L):X,F=V===!0||typeof V=="number"&&s<V||typeof V=="function"&&V(s,L);if(i||!F){_(L);return}s++,a.onFail?.(s,L),xR(q).then(()=>m()?void 0:E()).then(()=>{i?_(L):M()})})};return{promise:c,status:()=>c.status,cancel:y,continue:()=>(r?.(),c),cancelRetry:h,continueRetry:p,canStart:v,start:()=>(v()?M():E().then(M),c)}}var bg=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),wR(this.gcTime)&&(this.#t=Bc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(Fu?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Bc.clearTimeout(this.#t),this.#t=void 0)}},YR=class extends bg{#t;#n;#e;#l;#a;#s;#u;constructor(a){super(),this.#u=!1,this.#s=a.defaultOptions,this.setOptions(a.options),this.observers=[],this.#l=a.client,this.#e=this.#l.getQueryCache(),this.queryKey=a.queryKey,this.queryHash=a.queryHash,this.#t=ny(this.options),this.state=a.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(a){if(this.options={...this.#s,...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=ny(this.options);i.data!==void 0&&(this.setState(ey(i.data,i.dataUpdatedAt)),this.#t=i)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#e.remove(this)}setData(a,i){const s=CR(this.state.data,a,this.options);return this.#i({data:s,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),s}setState(a,i){this.#i({type:"setState",state:a,setStateOptions:i})}cancel(a){const i=this.#a?.promise;return this.#a?.cancel(a),i?i.then(Fe).catch(Fe):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(a=>OR(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>Hc(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!AR(this.state.dataUpdatedAt,a)}onFocus(){this.observers.find(i=>i.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(i=>i.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(i=>i!==a),this.observers.length||(this.#a&&(this.#u?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#e.notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(a,i){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&i?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(a&&this.setOptions(a),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const s=new AbortController,r=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#u=!0,s.signal)})},c=()=>{const h=yg(this.options,i),m=(()=>{const v={client:this.#l,queryKey:this.queryKey,meta:this.meta};return r(v),v})();return this.#u=!1,this.options.persister?this.options.persister(h,m,this):h(m)},y=(()=>{const h={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:c};return r(h),h})();this.options.behavior?.onFetch(y,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==y.fetchOptions?.meta)&&this.#i({type:"fetch",meta:y.fetchOptions?.meta}),this.#a=Sg({initialPromise:i?.initialPromise,fn:y.fetchFn,onCancel:h=>{h instanceof Yc&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:y.options.retry,retryDelay:y.options.retryDelay,networkMode:y.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#e.config.onSuccess?.(h,this),this.#e.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof Yc){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#e.config.onError?.(h,this),this.#e.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(a){const i=s=>{switch(a.type){case"failed":return{...s,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...QR(s.data,this.options),fetchMeta:a.meta??null};case"success":const r={...s,...ey(a.data,a.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=a.manual?r:void 0,r;case"error":const c=a.error;return{...s,error:c,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...a.state}}};this.state=i(this.state),he.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#e.notify({query:this,type:"updated",action:a})})}};function QR(a,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vg(i.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function ey(a,i){return{data:a,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ny(a){const i=typeof a.initialData=="function"?a.initialData():a.initialData,s=i!==void 0,r=s?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}function ay(a){return{onFetch:(i,s)=>{const r=i.options,c=i.fetchOptions?.meta?.fetchMore?.direction,f=i.state.data?.pages||[],y=i.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const S=M=>{LR(M,()=>i.signal,()=>v=!0)},_=yg(i.options,i.fetchOptions),E=async(M,C,w)=>{if(v)return Promise.reject();if(C==null&&M.pages.length)return Promise.resolve(M);const V=(()=>{const I={client:i.client,queryKey:i.queryKey,pageParam:C,direction:w?"backward":"forward",meta:i.options.meta};return S(I),I})(),X=await _(V),{maxPages:q}=i.options,F=w?DR:zR;return{pages:F(M.pages,X,q),pageParams:F(M.pageParams,C,q)}};if(c&&f.length){const M=c==="backward",C=M?GR:ly,w={pages:f,pageParams:y},L=C(r,w);h=await E(w,L,M)}else{const M=a??f.length;do{const C=p===0?y[0]??r.initialPageParam:ly(r,h);if(p>0&&C==null)break;h=await E(h,C),p++}while(p<M)}return h};i.options.persister?i.fetchFn=()=>i.options.persister?.(m,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},s):i.fetchFn=m}}}function ly(a,{pages:i,pageParams:s}){const r=i.length-1;return i.length>0?a.getNextPageParam(i[r],i,s[r],s):void 0}function GR(a,{pages:i,pageParams:s}){return i.length>0?a.getPreviousPageParam?.(i[0],i,s[0],s):void 0}var VR=class extends bg{#t;#n;#e;#l;constructor(a){super(),this.#t=a.client,this.mutationId=a.mutationId,this.#e=a.mutationCache,this.#n=[],this.state=a.state||XR(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){this.#n.includes(a)||(this.#n.push(a),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){this.#n=this.#n.filter(i=>i!==a),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(a){const i=()=>{this.#a({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=Sg({fn:()=>this.options.mutationFn?this.options.mutationFn(a,s):Promise.reject(new Error("No mutationFn found")),onFail:(f,y)=>{this.#a({type:"failed",failureCount:f,error:y})},onPause:()=>{this.#a({type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const r=this.state.status==="pending",c=!this.#l.canStart();try{if(r)i();else{this.#a({type:"pending",variables:a,isPaused:c}),this.#e.config.onMutate&&await this.#e.config.onMutate(a,this,s);const y=await this.options.onMutate?.(a,s);y!==this.state.context&&this.#a({type:"pending",context:y,variables:a,isPaused:c})}const f=await this.#l.start();return await this.#e.config.onSuccess?.(f,a,this.state.context,this,s),await this.options.onSuccess?.(f,a,this.state.context,s),await this.#e.config.onSettled?.(f,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(f,null,a,this.state.context,s),this.#a({type:"success",data:f}),f}catch(f){try{await this.#e.config.onError?.(f,a,this.state.context,this,s)}catch(y){Promise.reject(y)}try{await this.options.onError?.(f,a,this.state.context,s)}catch(y){Promise.reject(y)}try{await this.#e.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,s)}catch(y){Promise.reject(y)}try{await this.options.onSettled?.(void 0,f,a,this.state.context,s)}catch(y){Promise.reject(y)}throw this.#a({type:"error",error:f}),f}finally{this.#e.runNext(this)}}#a(a){const i=s=>{switch(a.type){case"failed":return{...s,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...s,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:a.error,failureCount:s.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=i(this.state),he.batch(()=>{this.#n.forEach(s=>{s.onMutationUpdate(a)}),this.#e.notify({mutation:this,type:"updated",action:a})})}};function XR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var KR=class extends Ju{constructor(a={}){super(),this.config=a,this.#t=new Set,this.#n=new Map,this.#e=0}#t;#n;#e;build(a,i,s){const r=new VR({client:a,mutationCache:this,mutationId:++this.#e,options:a.defaultMutationOptions(i),state:s});return this.add(r),r}add(a){this.#t.add(a);const i=Ru(a);if(typeof i=="string"){const s=this.#n.get(i);s?s.push(a):this.#n.set(i,[a])}this.notify({type:"added",mutation:a})}remove(a){if(this.#t.delete(a)){const i=Ru(a);if(typeof i=="string"){const s=this.#n.get(i);if(s)if(s.length>1){const r=s.indexOf(a);r!==-1&&s.splice(r,1)}else s[0]===a&&this.#n.delete(i)}}this.notify({type:"removed",mutation:a})}canRun(a){const i=Ru(a);if(typeof i=="string"){const r=this.#n.get(i)?.find(c=>c.state.status==="pending");return!r||r===a}else return!0}runNext(a){const i=Ru(a);return typeof i=="string"?this.#n.get(i)?.find(r=>r!==a&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){he.batch(()=>{this.#t.forEach(a=>{this.notify({type:"removed",mutation:a})}),this.#t.clear(),this.#n.clear()})}getAll(){return Array.from(this.#t)}find(a){const i={exact:!0,...a};return this.getAll().find(s=>Ip(i,s))}findAll(a={}){return this.getAll().filter(i=>Ip(a,i))}notify(a){he.batch(()=>{this.listeners.forEach(i=>{i(a)})})}resumePausedMutations(){const a=this.getAll().filter(i=>i.state.isPaused);return he.batch(()=>Promise.all(a.map(i=>i.continue().catch(Fe))))}};function Ru(a){return a.options.scope?.id}var ZR=class extends Ju{constructor(a={}){super(),this.config=a,this.#t=new Map}#t;build(a,i,s){const r=i.queryKey,c=i.queryHash??sf(r,i);let f=this.get(c);return f||(f=new YR({client:a,queryKey:r,queryHash:c,options:a.defaultQueryOptions(i),state:s,defaultOptions:a.getQueryDefaults(r)}),this.add(f)),f}add(a){this.#t.has(a.queryHash)||(this.#t.set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const i=this.#t.get(a.queryHash);i&&(a.destroy(),i===a&&this.#t.delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){he.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return this.#t.get(a)}getAll(){return[...this.#t.values()]}find(a){const i={exact:!0,...a};return this.getAll().find(s=>$p(i,s))}findAll(a={}){const i=this.getAll();return Object.keys(a).length>0?i.filter(s=>$p(a,s)):i}notify(a){he.batch(()=>{this.listeners.forEach(i=>{i(a)})})}onFocus(){he.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){he.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},PR=class{#t;#n;#e;#l;#a;#s;#u;#i;constructor(a={}){this.#t=a.queryCache||new ZR,this.#n=a.mutationCache||new KR,this.#e=a.defaultOptions||{},this.#l=new Map,this.#a=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#u=gg.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=qu.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#u?.(),this.#u=void 0,this.#i?.(),this.#i=void 0)}isFetching(a){return this.#t.findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return this.#n.findAll({...a,status:"pending"}).length}getQueryData(a){const i=this.defaultQueryOptions({queryKey:a});return this.#t.get(i.queryHash)?.state.data}ensureQueryData(a){const i=this.defaultQueryOptions(a),s=this.#t.build(this,i),r=s.state.data;return r===void 0?this.fetchQuery(a):(a.revalidateIfStale&&s.isStaleByTime(Hc(i.staleTime,s))&&this.prefetchQuery(i),Promise.resolve(r))}getQueriesData(a){return this.#t.findAll(a).map(({queryKey:i,state:s})=>{const r=s.data;return[i,r]})}setQueryData(a,i,s){const r=this.defaultQueryOptions({queryKey:a}),f=this.#t.get(r.queryHash)?.state.data,y=TR(i,f);if(y!==void 0)return this.#t.build(this,r).setData(y,{...s,manual:!0})}setQueriesData(a,i,s){return he.batch(()=>this.#t.findAll(a).map(({queryKey:r})=>[r,this.setQueryData(r,i,s)]))}getQueryState(a){const i=this.defaultQueryOptions({queryKey:a});return this.#t.get(i.queryHash)?.state}removeQueries(a){const i=this.#t;he.batch(()=>{i.findAll(a).forEach(s=>{i.remove(s)})})}resetQueries(a,i){const s=this.#t;return he.batch(()=>(s.findAll(a).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...a},i)))}cancelQueries(a,i={}){const s={revert:!0,...i},r=he.batch(()=>this.#t.findAll(a).map(c=>c.cancel(s)));return Promise.all(r).then(Fe).catch(Fe)}invalidateQueries(a,i={}){return he.batch(()=>(this.#t.findAll(a).forEach(s=>{s.invalidate()}),a?.refetchType==="none"?Promise.resolve():this.refetchQueries({...a,type:a?.refetchType??a?.type??"active"},i)))}refetchQueries(a,i={}){const s={...i,cancelRefetch:i.cancelRefetch??!0},r=he.batch(()=>this.#t.findAll(a).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let f=c.fetch(void 0,s);return s.throwOnError||(f=f.catch(Fe)),c.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(r).then(Fe)}fetchQuery(a){const i=this.defaultQueryOptions(a);i.retry===void 0&&(i.retry=!1);const s=this.#t.build(this,i);return s.isStaleByTime(Hc(i.staleTime,s))?s.fetch(i):Promise.resolve(s.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Fe).catch(Fe)}fetchInfiniteQuery(a){return a.behavior=ay(a.pages),this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Fe).catch(Fe)}ensureInfiniteQueryData(a){return a.behavior=ay(a.pages),this.ensureQueryData(a)}resumePausedMutations(){return qu.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#n}getDefaultOptions(){return this.#e}setDefaultOptions(a){this.#e=a}setQueryDefaults(a,i){this.#l.set(Ji(a),{queryKey:a,defaultOptions:i})}getQueryDefaults(a){const i=[...this.#l.values()],s={};return i.forEach(r=>{Fi(a,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(a,i){this.#a.set(Ji(a),{mutationKey:a,defaultOptions:i})}getMutationDefaults(a){const i=[...this.#a.values()],s={};return i.forEach(r=>{Fi(a,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(a){if(a._defaulted)return a;const i={...this.#e.queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return i.queryHash||(i.queryHash=sf(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===uf&&(i.enabled=!1),i}defaultMutationOptions(a){return a?._defaulted?a:{...this.#e.mutations,...a?.mutationKey&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){this.#t.clear(),this.#n.clear()}},_g=et.createContext(void 0),aT=a=>{const i=et.useContext(_g);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},kR=({client:a,children:i})=>(et.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),Z.jsx(_g.Provider,{value:a,children:i}));const JR="/assets/styles-b2XYKZYx.css",FR=`
|
|
18
|
+
`).filter(Boolean);for(const _ of S)try{i(JSON.parse(_))}catch(E){s?.(`Invalid JSON line: ${_}`,E)}}if(p)break}}catch(h){s?.("Stream processing error:",h)}})(),i(y)}async function vR({jsonStream:a,onMessage:i,onError:s}){const r=a.getReader(),{value:c,done:f}=await r.read();if(f||!c)throw new Error("Stream ended before first object");const y=JSON.parse(c);return(async()=>{try{for(;;){const{value:h,done:p}=await r.read();if(p)break;if(h)try{i(JSON.parse(h))}catch(m){s?.(`Invalid JSON: ${h}`,m)}}}catch(h){s?.("Stream processing error:",h)}})(),i(y)}function SR(a){const i="/_serverFn/"+a;return Object.assign((...c)=>{const f=fg()?.serverFns?.fetch;return mR(i,c,f??fetch)},{url:i,serverFnMeta:{id:a},[jc]:!0})}const bR={key:"$TSS/serverfn",test:a=>typeof a!="function"||!(jc in a)?!1:!!a[jc],toSerializable:({serverFnMeta:a})=>({functionId:a.id}),fromSerializable:({functionId:a})=>SR(a)};var Ju=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_R={setTimeout:(a,i)=>setTimeout(a,i),clearTimeout:a=>clearTimeout(a),setInterval:(a,i)=>setInterval(a,i),clearInterval:a=>clearInterval(a)},ER=class{#t=_R;#n=!1;setTimeoutProvider(a){this.#t=a}setTimeout(a,i){return this.#t.setTimeout(a,i)}clearTimeout(a){this.#t.clearTimeout(a)}setInterval(a,i){return this.#t.setInterval(a,i)}clearInterval(a){this.#t.clearInterval(a)}},Bc=new ER;function RR(a){setTimeout(a,0)}var Fu=typeof window>"u"||"Deno"in globalThis;function Fe(){}function TR(a,i){return typeof a=="function"?a(i):a}function wR(a){return typeof a=="number"&&a>=0&&a!==1/0}function AR(a,i){return Math.max(a+(i||0)-Date.now(),0)}function Hc(a,i){return typeof a=="function"?a(i):a}function OR(a,i){return typeof a=="function"?a(i):a}function $p(a,i){const{type:s="all",exact:r,fetchStatus:c,predicate:f,queryKey:y,stale:h}=a;if(y){if(r){if(i.queryHash!==sf(y,i.options))return!1}else if(!Fi(i.queryKey,y))return!1}if(s!=="all"){const p=i.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof h=="boolean"&&i.isStale()!==h||c&&c!==i.state.fetchStatus||f&&!f(i))}function Ip(a,i){const{exact:s,status:r,predicate:c,mutationKey:f}=a;if(f){if(!i.options.mutationKey)return!1;if(s){if(Ji(i.options.mutationKey)!==Ji(f))return!1}else if(!Fi(i.options.mutationKey,f))return!1}return!(r&&i.state.status!==r||c&&!c(i))}function sf(a,i){return(i?.queryKeyHashFn||Ji)(a)}function Ji(a){return JSON.stringify(a,(i,s)=>qc(s)?Object.keys(s).sort().reduce((r,c)=>(r[c]=s[c],r),{}):s)}function Fi(a,i){return a===i?!0:typeof a!=typeof i?!1:a&&i&&typeof a=="object"&&typeof i=="object"?Object.keys(i).every(s=>Fi(a[s],i[s])):!1}var MR=Object.prototype.hasOwnProperty;function pg(a,i,s=0){if(a===i)return a;if(s>500)return i;const r=Wp(a)&&Wp(i);if(!r&&!(qc(a)&&qc(i)))return i;const f=(r?a:Object.keys(a)).length,y=r?i:Object.keys(i),h=y.length,p=r?new Array(h):{};let m=0;for(let v=0;v<h;v++){const S=r?v:y[v],_=a[S],E=i[S];if(_===E){p[S]=_,(r?v<f:MR.call(a,S))&&m++;continue}if(_===null||E===null||typeof _!="object"||typeof E!="object"){p[S]=E;continue}const M=pg(_,E,s+1);p[S]=M,M===_&&m++}return f===h&&m===f?a:p}function eT(a,i){if(!i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const s in a)if(a[s]!==i[s])return!1;return!0}function Wp(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function qc(a){if(!ty(a))return!1;const i=a.constructor;if(i===void 0)return!0;const s=i.prototype;return!(!ty(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function ty(a){return Object.prototype.toString.call(a)==="[object Object]"}function xR(a){return new Promise(i=>{Bc.setTimeout(i,a)})}function CR(a,i,s){return typeof s.structuralSharing=="function"?s.structuralSharing(a,i):s.structuralSharing!==!1?pg(a,i):i}function zR(a,i,s=0){const r=[...a,i];return s&&r.length>s?r.slice(1):r}function DR(a,i,s=0){const r=[i,...a];return s&&r.length>s?r.slice(0,-1):r}var uf=Symbol();function yg(a,i){return!a.queryFn&&i?.initialPromise?()=>i.initialPromise:!a.queryFn||a.queryFn===uf?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function nT(a,i){return typeof a=="function"?a(...i):!!a}function LR(a,i,s){let r=!1,c;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(c??=i(),r||(r=!0,c.aborted?s():c.addEventListener("abort",s,{once:!0})),c)}),a}var UR=class extends Ju{#t;#n;#e;constructor(){super(),this.#e=a=>{if(!Fu&&window.addEventListener){const i=()=>a();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}}}onSubscribe(){this.#n||this.setEventListener(this.#e)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#e=a,this.#n?.(),this.#n=a(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()})}setFocused(a){this.#t!==a&&(this.#t=a,this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(i=>{i(a)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},gg=new UR;function NR(){let a,i;const s=new Promise((c,f)=>{a=c,i=f});s.status="pending",s.catch(()=>{});function r(c){Object.assign(s,c),delete s.resolve,delete s.reject}return s.resolve=c=>{r({status:"fulfilled",value:c}),a(c)},s.reject=c=>{r({status:"rejected",reason:c}),i(c)},s}var jR=RR;function BR(){let a=[],i=0,s=h=>{h()},r=h=>{h()},c=jR;const f=h=>{i?a.push(h):c(()=>{s(h)})},y=()=>{const h=a;a=[],h.length&&c(()=>{r(()=>{h.forEach(p=>{s(p)})})})};return{batch:h=>{let p;i++;try{p=h()}finally{i--,i||y()}return p},batchCalls:h=>(...p)=>{f(()=>{h(...p)})},schedule:f,setNotifyFunction:h=>{s=h},setBatchNotifyFunction:h=>{r=h},setScheduler:h=>{c=h}}}var he=BR(),HR=class extends Ju{#t=!0;#n;#e;constructor(){super(),this.#e=a=>{if(!Fu&&window.addEventListener){const i=()=>a(!0),s=()=>a(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#n||this.setEventListener(this.#e)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#e=a,this.#n?.(),this.#n=a(this.setOnline.bind(this))}setOnline(a){this.#t!==a&&(this.#t=a,this.listeners.forEach(s=>{s(a)}))}isOnline(){return this.#t}},qu=new HR;function qR(a){return Math.min(1e3*2**a,3e4)}function vg(a){return(a??"online")==="online"?qu.isOnline():!0}var Yc=class extends Error{constructor(a){super("CancelledError"),this.revert=a?.revert,this.silent=a?.silent}};function Sg(a){let i=!1,s=0,r;const c=NR(),f=()=>c.status!=="pending",y=C=>{if(!f()){const w=new Yc(C);_(w),a.onCancel?.(w)}},h=()=>{i=!0},p=()=>{i=!1},m=()=>gg.isFocused()&&(a.networkMode==="always"||qu.isOnline())&&a.canRun(),v=()=>vg(a.networkMode)&&a.canRun(),S=C=>{f()||(r?.(),c.resolve(C))},_=C=>{f()||(r?.(),c.reject(C))},E=()=>new Promise(C=>{r=w=>{(f()||m())&&C(w)},a.onPause?.()}).then(()=>{r=void 0,f()||a.onContinue?.()}),M=()=>{if(f())return;let C;const w=s===0?a.initialPromise:void 0;try{C=w??a.fn()}catch(L){C=Promise.reject(L)}Promise.resolve(C).then(S).catch(L=>{if(f())return;const V=a.retry??(Fu?0:3),X=a.retryDelay??qR,q=typeof X=="function"?X(s,L):X,F=V===!0||typeof V=="number"&&s<V||typeof V=="function"&&V(s,L);if(i||!F){_(L);return}s++,a.onFail?.(s,L),xR(q).then(()=>m()?void 0:E()).then(()=>{i?_(L):M()})})};return{promise:c,status:()=>c.status,cancel:y,continue:()=>(r?.(),c),cancelRetry:h,continueRetry:p,canStart:v,start:()=>(v()?M():E().then(M),c)}}var bg=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),wR(this.gcTime)&&(this.#t=Bc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(Fu?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Bc.clearTimeout(this.#t),this.#t=void 0)}},YR=class extends bg{#t;#n;#e;#l;#a;#s;#u;constructor(a){super(),this.#u=!1,this.#s=a.defaultOptions,this.setOptions(a.options),this.observers=[],this.#l=a.client,this.#e=this.#l.getQueryCache(),this.queryKey=a.queryKey,this.queryHash=a.queryHash,this.#t=ny(this.options),this.state=a.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(a){if(this.options={...this.#s,...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=ny(this.options);i.data!==void 0&&(this.setState(ey(i.data,i.dataUpdatedAt)),this.#t=i)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#e.remove(this)}setData(a,i){const s=CR(this.state.data,a,this.options);return this.#i({data:s,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),s}setState(a,i){this.#i({type:"setState",state:a,setStateOptions:i})}cancel(a){const i=this.#a?.promise;return this.#a?.cancel(a),i?i.then(Fe).catch(Fe):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(a=>OR(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>Hc(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!AR(this.state.dataUpdatedAt,a)}onFocus(){this.observers.find(i=>i.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(i=>i.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(i=>i!==a),this.observers.length||(this.#a&&(this.#u?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#e.notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(a,i){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&i?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(a&&this.setOptions(a),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const s=new AbortController,r=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#u=!0,s.signal)})},c=()=>{const h=yg(this.options,i),m=(()=>{const v={client:this.#l,queryKey:this.queryKey,meta:this.meta};return r(v),v})();return this.#u=!1,this.options.persister?this.options.persister(h,m,this):h(m)},y=(()=>{const h={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:c};return r(h),h})();this.options.behavior?.onFetch(y,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==y.fetchOptions?.meta)&&this.#i({type:"fetch",meta:y.fetchOptions?.meta}),this.#a=Sg({initialPromise:i?.initialPromise,fn:y.fetchFn,onCancel:h=>{h instanceof Yc&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:y.options.retry,retryDelay:y.options.retryDelay,networkMode:y.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#e.config.onSuccess?.(h,this),this.#e.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof Yc){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#e.config.onError?.(h,this),this.#e.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(a){const i=s=>{switch(a.type){case"failed":return{...s,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...QR(s.data,this.options),fetchMeta:a.meta??null};case"success":const r={...s,...ey(a.data,a.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=a.manual?r:void 0,r;case"error":const c=a.error;return{...s,error:c,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...a.state}}};this.state=i(this.state),he.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#e.notify({query:this,type:"updated",action:a})})}};function QR(a,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vg(i.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function ey(a,i){return{data:a,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ny(a){const i=typeof a.initialData=="function"?a.initialData():a.initialData,s=i!==void 0,r=s?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}function ay(a){return{onFetch:(i,s)=>{const r=i.options,c=i.fetchOptions?.meta?.fetchMore?.direction,f=i.state.data?.pages||[],y=i.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const S=M=>{LR(M,()=>i.signal,()=>v=!0)},_=yg(i.options,i.fetchOptions),E=async(M,C,w)=>{if(v)return Promise.reject();if(C==null&&M.pages.length)return Promise.resolve(M);const V=(()=>{const I={client:i.client,queryKey:i.queryKey,pageParam:C,direction:w?"backward":"forward",meta:i.options.meta};return S(I),I})(),X=await _(V),{maxPages:q}=i.options,F=w?DR:zR;return{pages:F(M.pages,X,q),pageParams:F(M.pageParams,C,q)}};if(c&&f.length){const M=c==="backward",C=M?GR:ly,w={pages:f,pageParams:y},L=C(r,w);h=await E(w,L,M)}else{const M=a??f.length;do{const C=p===0?y[0]??r.initialPageParam:ly(r,h);if(p>0&&C==null)break;h=await E(h,C),p++}while(p<M)}return h};i.options.persister?i.fetchFn=()=>i.options.persister?.(m,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},s):i.fetchFn=m}}}function ly(a,{pages:i,pageParams:s}){const r=i.length-1;return i.length>0?a.getNextPageParam(i[r],i,s[r],s):void 0}function GR(a,{pages:i,pageParams:s}){return i.length>0?a.getPreviousPageParam?.(i[0],i,s[0],s):void 0}var VR=class extends bg{#t;#n;#e;#l;constructor(a){super(),this.#t=a.client,this.mutationId=a.mutationId,this.#e=a.mutationCache,this.#n=[],this.state=a.state||XR(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){this.#n.includes(a)||(this.#n.push(a),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){this.#n=this.#n.filter(i=>i!==a),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(a){const i=()=>{this.#a({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=Sg({fn:()=>this.options.mutationFn?this.options.mutationFn(a,s):Promise.reject(new Error("No mutationFn found")),onFail:(f,y)=>{this.#a({type:"failed",failureCount:f,error:y})},onPause:()=>{this.#a({type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const r=this.state.status==="pending",c=!this.#l.canStart();try{if(r)i();else{this.#a({type:"pending",variables:a,isPaused:c}),this.#e.config.onMutate&&await this.#e.config.onMutate(a,this,s);const y=await this.options.onMutate?.(a,s);y!==this.state.context&&this.#a({type:"pending",context:y,variables:a,isPaused:c})}const f=await this.#l.start();return await this.#e.config.onSuccess?.(f,a,this.state.context,this,s),await this.options.onSuccess?.(f,a,this.state.context,s),await this.#e.config.onSettled?.(f,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(f,null,a,this.state.context,s),this.#a({type:"success",data:f}),f}catch(f){try{await this.#e.config.onError?.(f,a,this.state.context,this,s)}catch(y){Promise.reject(y)}try{await this.options.onError?.(f,a,this.state.context,s)}catch(y){Promise.reject(y)}try{await this.#e.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,s)}catch(y){Promise.reject(y)}try{await this.options.onSettled?.(void 0,f,a,this.state.context,s)}catch(y){Promise.reject(y)}throw this.#a({type:"error",error:f}),f}finally{this.#e.runNext(this)}}#a(a){const i=s=>{switch(a.type){case"failed":return{...s,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...s,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:a.error,failureCount:s.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=i(this.state),he.batch(()=>{this.#n.forEach(s=>{s.onMutationUpdate(a)}),this.#e.notify({mutation:this,type:"updated",action:a})})}};function XR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var KR=class extends Ju{constructor(a={}){super(),this.config=a,this.#t=new Set,this.#n=new Map,this.#e=0}#t;#n;#e;build(a,i,s){const r=new VR({client:a,mutationCache:this,mutationId:++this.#e,options:a.defaultMutationOptions(i),state:s});return this.add(r),r}add(a){this.#t.add(a);const i=Ru(a);if(typeof i=="string"){const s=this.#n.get(i);s?s.push(a):this.#n.set(i,[a])}this.notify({type:"added",mutation:a})}remove(a){if(this.#t.delete(a)){const i=Ru(a);if(typeof i=="string"){const s=this.#n.get(i);if(s)if(s.length>1){const r=s.indexOf(a);r!==-1&&s.splice(r,1)}else s[0]===a&&this.#n.delete(i)}}this.notify({type:"removed",mutation:a})}canRun(a){const i=Ru(a);if(typeof i=="string"){const r=this.#n.get(i)?.find(c=>c.state.status==="pending");return!r||r===a}else return!0}runNext(a){const i=Ru(a);return typeof i=="string"?this.#n.get(i)?.find(r=>r!==a&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){he.batch(()=>{this.#t.forEach(a=>{this.notify({type:"removed",mutation:a})}),this.#t.clear(),this.#n.clear()})}getAll(){return Array.from(this.#t)}find(a){const i={exact:!0,...a};return this.getAll().find(s=>Ip(i,s))}findAll(a={}){return this.getAll().filter(i=>Ip(a,i))}notify(a){he.batch(()=>{this.listeners.forEach(i=>{i(a)})})}resumePausedMutations(){const a=this.getAll().filter(i=>i.state.isPaused);return he.batch(()=>Promise.all(a.map(i=>i.continue().catch(Fe))))}};function Ru(a){return a.options.scope?.id}var ZR=class extends Ju{constructor(a={}){super(),this.config=a,this.#t=new Map}#t;build(a,i,s){const r=i.queryKey,c=i.queryHash??sf(r,i);let f=this.get(c);return f||(f=new YR({client:a,queryKey:r,queryHash:c,options:a.defaultQueryOptions(i),state:s,defaultOptions:a.getQueryDefaults(r)}),this.add(f)),f}add(a){this.#t.has(a.queryHash)||(this.#t.set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const i=this.#t.get(a.queryHash);i&&(a.destroy(),i===a&&this.#t.delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){he.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return this.#t.get(a)}getAll(){return[...this.#t.values()]}find(a){const i={exact:!0,...a};return this.getAll().find(s=>$p(i,s))}findAll(a={}){const i=this.getAll();return Object.keys(a).length>0?i.filter(s=>$p(a,s)):i}notify(a){he.batch(()=>{this.listeners.forEach(i=>{i(a)})})}onFocus(){he.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){he.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},PR=class{#t;#n;#e;#l;#a;#s;#u;#i;constructor(a={}){this.#t=a.queryCache||new ZR,this.#n=a.mutationCache||new KR,this.#e=a.defaultOptions||{},this.#l=new Map,this.#a=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#u=gg.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=qu.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#u?.(),this.#u=void 0,this.#i?.(),this.#i=void 0)}isFetching(a){return this.#t.findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return this.#n.findAll({...a,status:"pending"}).length}getQueryData(a){const i=this.defaultQueryOptions({queryKey:a});return this.#t.get(i.queryHash)?.state.data}ensureQueryData(a){const i=this.defaultQueryOptions(a),s=this.#t.build(this,i),r=s.state.data;return r===void 0?this.fetchQuery(a):(a.revalidateIfStale&&s.isStaleByTime(Hc(i.staleTime,s))&&this.prefetchQuery(i),Promise.resolve(r))}getQueriesData(a){return this.#t.findAll(a).map(({queryKey:i,state:s})=>{const r=s.data;return[i,r]})}setQueryData(a,i,s){const r=this.defaultQueryOptions({queryKey:a}),f=this.#t.get(r.queryHash)?.state.data,y=TR(i,f);if(y!==void 0)return this.#t.build(this,r).setData(y,{...s,manual:!0})}setQueriesData(a,i,s){return he.batch(()=>this.#t.findAll(a).map(({queryKey:r})=>[r,this.setQueryData(r,i,s)]))}getQueryState(a){const i=this.defaultQueryOptions({queryKey:a});return this.#t.get(i.queryHash)?.state}removeQueries(a){const i=this.#t;he.batch(()=>{i.findAll(a).forEach(s=>{i.remove(s)})})}resetQueries(a,i){const s=this.#t;return he.batch(()=>(s.findAll(a).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...a},i)))}cancelQueries(a,i={}){const s={revert:!0,...i},r=he.batch(()=>this.#t.findAll(a).map(c=>c.cancel(s)));return Promise.all(r).then(Fe).catch(Fe)}invalidateQueries(a,i={}){return he.batch(()=>(this.#t.findAll(a).forEach(s=>{s.invalidate()}),a?.refetchType==="none"?Promise.resolve():this.refetchQueries({...a,type:a?.refetchType??a?.type??"active"},i)))}refetchQueries(a,i={}){const s={...i,cancelRefetch:i.cancelRefetch??!0},r=he.batch(()=>this.#t.findAll(a).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let f=c.fetch(void 0,s);return s.throwOnError||(f=f.catch(Fe)),c.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(r).then(Fe)}fetchQuery(a){const i=this.defaultQueryOptions(a);i.retry===void 0&&(i.retry=!1);const s=this.#t.build(this,i);return s.isStaleByTime(Hc(i.staleTime,s))?s.fetch(i):Promise.resolve(s.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Fe).catch(Fe)}fetchInfiniteQuery(a){return a.behavior=ay(a.pages),this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Fe).catch(Fe)}ensureInfiniteQueryData(a){return a.behavior=ay(a.pages),this.ensureQueryData(a)}resumePausedMutations(){return qu.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#n}getDefaultOptions(){return this.#e}setDefaultOptions(a){this.#e=a}setQueryDefaults(a,i){this.#l.set(Ji(a),{queryKey:a,defaultOptions:i})}getQueryDefaults(a){const i=[...this.#l.values()],s={};return i.forEach(r=>{Fi(a,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(a,i){this.#a.set(Ji(a),{mutationKey:a,defaultOptions:i})}getMutationDefaults(a){const i=[...this.#a.values()],s={};return i.forEach(r=>{Fi(a,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(a){if(a._defaulted)return a;const i={...this.#e.queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return i.queryHash||(i.queryHash=sf(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===uf&&(i.enabled=!1),i}defaultMutationOptions(a){return a?._defaulted?a:{...this.#e.mutations,...a?.mutationKey&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){this.#t.clear(),this.#n.clear()}},_g=et.createContext(void 0),aT=a=>{const i=et.useContext(_g);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},kR=({client:a,children:i})=>(et.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),Z.jsx(_g.Provider,{value:a,children:i}));const JR="/assets/styles-CXa-SiWC.css",FR=`
|
|
19
19
|
(() => {
|
|
20
20
|
// Skip PWA service worker inside Capacitor native shell — they conflict
|
|
21
21
|
// with the native networking layer and caching.
|
|
@@ -209,4 +209,4 @@ Error generating stack: `+l.message+`
|
|
|
209
209
|
document.documentElement.setAttribute('data-opencami-bubble-style', value)
|
|
210
210
|
} catch {}
|
|
211
211
|
})()
|
|
212
|
-
`;function s2(){return typeof window<"u"&&(window.location.href="/chat/main"),null}const $e=qE({notFoundComponent:s2,head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"},{title:"OpenCami"},{name:"description",content:"a fast web client for OpenClaw"},{property:"og:image",content:"/cover.webp"},{property:"og:image:type",content:"image/webp"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:image",content:"/cover.webp"},{name:"theme-color",content:"#0a0a0a"},{name:"apple-mobile-web-app-capable",content:"yes"},{name:"apple-mobile-web-app-status-bar-style",content:"black-translucent"},{name:"apple-mobile-web-app-title",content:"OpenCami"},{name:"mobile-web-app-capable",content:"yes"}],links:[{rel:"stylesheet",href:JR},{rel:"icon",type:"image/svg+xml",href:"/favicon.svg"},{rel:"apple-touch-icon",href:"/apple-touch-icon-180x180.png"},{rel:"manifest",href:"/manifest.json"}]}),shellComponent:o2,component:r2}),u2=new PR;function r2(){return Z.jsx(kR,{client:u2,children:Z.jsx(rg,{})})}function o2({children:a}){return Z.jsxs("html",{lang:"en",suppressHydrationWarning:!0,children:[Z.jsxs("head",{children:[Z.jsx("script",{dangerouslySetInnerHTML:{__html:IR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:WR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:t2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:e2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:n2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:a2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:l2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:i2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:$R}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:FR}}),Z.jsx(tR,{})]}),Z.jsxs("body",{children:[Z.jsx("div",{className:"root",children:a}),Z.jsx(eR,{})]})]})}const c2="modulepreload",f2=function(a){return"/"+a},iy={},rn=function(i,s,r){let c=Promise.resolve();if(s&&s.length>0){let p=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};document.getElementsByTagName("link");const y=document.querySelector("meta[property=csp-nonce]"),h=y?.nonce||y?.getAttribute("nonce");c=p(s.map(m=>{if(m=f2(m),m in iy)return;iy[m]=!0;const v=m.endsWith(".css"),S=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${S}`))return;const _=document.createElement("link");if(_.rel=v?"stylesheet":c2,v||(_.as="script"),_.crossOrigin="",_.href=m,h&&_.setAttribute("nonce",h),document.head.appendChild(_),v)return new Promise((E,M)=>{_.addEventListener("load",E),_.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${m}`)))})}))}function f(y){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=y,window.dispatchEvent(h),!h.defaultPrevented)throw y}return c.then(y=>{for(const h of y||[])h.status==="rejected"&&f(h.reason);return i().catch(f)})},d2=()=>rn(()=>import("./skills-
|
|
212
|
+
`;function s2(){return typeof window<"u"&&(window.location.href="/chat/main"),null}const $e=qE({notFoundComponent:s2,head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"},{title:"OpenCami"},{name:"description",content:"a fast web client for OpenClaw"},{property:"og:image",content:"/cover.webp"},{property:"og:image:type",content:"image/webp"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:image",content:"/cover.webp"},{name:"theme-color",content:"#0a0a0a"},{name:"apple-mobile-web-app-capable",content:"yes"},{name:"apple-mobile-web-app-status-bar-style",content:"black-translucent"},{name:"apple-mobile-web-app-title",content:"OpenCami"},{name:"mobile-web-app-capable",content:"yes"}],links:[{rel:"stylesheet",href:JR},{rel:"icon",type:"image/svg+xml",href:"/favicon.svg"},{rel:"apple-touch-icon",href:"/apple-touch-icon-180x180.png"},{rel:"manifest",href:"/manifest.json"}]}),shellComponent:o2,component:r2}),u2=new PR;function r2(){return Z.jsx(kR,{client:u2,children:Z.jsx(rg,{})})}function o2({children:a}){return Z.jsxs("html",{lang:"en",suppressHydrationWarning:!0,children:[Z.jsxs("head",{children:[Z.jsx("script",{dangerouslySetInnerHTML:{__html:IR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:WR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:t2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:e2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:n2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:a2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:l2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:i2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:$R}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:FR}}),Z.jsx(tR,{})]}),Z.jsxs("body",{children:[Z.jsx("div",{className:"root",children:a}),Z.jsx(eR,{})]})]})}const c2="modulepreload",f2=function(a){return"/"+a},iy={},rn=function(i,s,r){let c=Promise.resolve();if(s&&s.length>0){let p=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};document.getElementsByTagName("link");const y=document.querySelector("meta[property=csp-nonce]"),h=y?.nonce||y?.getAttribute("nonce");c=p(s.map(m=>{if(m=f2(m),m in iy)return;iy[m]=!0;const v=m.endsWith(".css"),S=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${S}`))return;const _=document.createElement("link");if(_.rel=v?"stylesheet":c2,v||(_.as="script"),_.crossOrigin="",_.href=m,h&&_.setAttribute("nonce",h),document.head.appendChild(_),v)return new Promise((E,M)=>{_.addEventListener("load",E),_.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${m}`)))})}))}function f(y){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=y,window.dispatchEvent(h),!h.defaultPrevented)throw y}return c.then(y=>{for(const h of y||[])h.status==="rejected"&&f(h.reason);return i().catch(f)})},d2=()=>rn(()=>import("./skills-Cx12984a.js"),[]),h2=Ke("/skills")({component:un(d2,"component")}),m2=()=>rn(()=>import("./new-DLlBm66g.js"),[]),p2=Ke("/new")({beforeLoad:function(){throw Pc({to:"/chat/$sessionKey",params:{sessionKey:"new"},replace:!0})},component:un(m2,"component")}),y2=()=>rn(()=>import("./memory-BRa-0plj.js"),[]),g2=Ke("/memory")({component:un(y2,"component")}),v2=()=>rn(()=>import("./files-Cbhud0J8.js"),[]),S2=Ke("/files")({component:un(v2,"component")}),b2=()=>rn(()=>import("./dashboard-CyWDWpbj.js"),__vite__mapDeps([0,1])),_2=Ke("/dashboard")({component:un(b2,"component")}),E2=()=>rn(()=>import("./connect-CiqRvR6s.js"),__vite__mapDeps([2,3,4,5])),R2=Ke("/connect")({component:un(E2,"component")}),T2=()=>rn(()=>import("./bots-Bqjqhws8.js"),[]),w2=Ke("/bots")({component:un(T2,"component")}),A2=()=>rn(()=>import("./agents-DNywJUai.js"),[]),O2=Ke("/agents")({component:un(A2,"component")}),M2=()=>rn(()=>import("./index-ygitKeM-.js"),[]),x2=Ke("/")({component:un(M2,"component")}),C2=()=>rn(()=>import("./_sessionKey-DYknvaDS.js").then(a=>a.$),__vite__mapDeps([6,1,7,4,8,9,10,11,12,13,14,15,5,16,17,18,19,20,21,22,3,23])),z2=Ke("/chat/$sessionKey")({component:un(C2,"component")}),D2=h2.update({id:"/skills",path:"/skills",getParentRoute:()=>$e}),L2=p2.update({id:"/new",path:"/new",getParentRoute:()=>$e}),U2=g2.update({id:"/memory",path:"/memory",getParentRoute:()=>$e}),N2=S2.update({id:"/files",path:"/files",getParentRoute:()=>$e}),j2=_2.update({id:"/dashboard",path:"/dashboard",getParentRoute:()=>$e}),B2=R2.update({id:"/connect",path:"/connect",getParentRoute:()=>$e}),H2=w2.update({id:"/bots",path:"/bots",getParentRoute:()=>$e}),q2=O2.update({id:"/agents",path:"/agents",getParentRoute:()=>$e}),Y2=x2.update({id:"/",path:"/",getParentRoute:()=>$e}),Q2=z2.update({id:"/chat/$sessionKey",path:"/chat/$sessionKey",getParentRoute:()=>$e}),G2={IndexRoute:Y2,AgentsRoute:q2,BotsRoute:H2,ConnectRoute:B2,DashboardRoute:j2,FilesRoute:N2,MemoryRoute:U2,NewRoute:L2,SkillsRoute:D2,ChatSessionKeyRoute:Q2},V2=$e._addFileChildren(G2),X2=()=>PE({routeTree:V2,context:{},scrollRestoration:!0,defaultPreloadStaleTime:0});async function K2(){const a=await X2();let i;return i=[],window.__TSS_START_OPTIONS__={serializationAdapters:i},i.push(bR),a.options.serializationAdapters&&i.push(...a.options.serializationAdapters),a.update({basepath:"",serializationAdapters:i}),a.state.matches.length||await aR(a),a}async function Z2(){const a=await K2();return window.$_TSR?.h(),a}let Cc;function P2(){return Cc||(Cc=Z2()),Z.jsx(hE,{promise:Cc,children:a=>Z.jsx(FE,{router:a})})}et.startTransition(()=>{$0.hydrateRoot(document,Z.jsx(et.StrictMode,{children:Z.jsx(P2,{})}))});export{Q0 as A,ig as L,x2 as R,Ju as S,rn as _,Ql as a,Fe as b,nT as c,lf as d,OR as e,Hc as f,XR as g,Ji as h,Fu as i,Z as j,wR as k,Bc as l,gg as m,he as n,QR as o,NR as p,CR as q,et as r,eT as s,AR as t,aT as u,K0 as v,AE as w,SE as x,EE as y,z2 as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as Ir,j as _,r as he,d as Xi,L as _n}from"./main-
|
|
1
|
+
import{A as Ir,j as _,r as he,d as Xi,L as _n}from"./main-ZBMVSJTF.js";import{r as Yi,C as Jt}from"./index-C_gsW9fo.js";import{u as Ct,D as Ji,a as Ki,b as el,d as tl}from"./use-file-explorer-state-Dfyh4GwR.js";import{c as nl,B as Ln}from"./button-DqP4GZwZ.js";import{s as Kt,h as rl,w as il,f as ll,a as sl,b as al,c as Fn}from"./index-T4TOjvD0.js";function en(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ze=en();function Tr(e){ze=e}var Ie={exec:()=>null};function O(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,s)=>{let l=typeof s=="string"?s:s.source;return l=l.replace(J.caret,"$1"),n=n.replace(i,l),r},getRegex:()=>new RegExp(n,t)};return r}var ol=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),J={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},ul=/^(?:[ \t]*(?:\n|$))+/,cl=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hl=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Je=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,fl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,tn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ar=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zr=O(Ar).replace(/bull/g,tn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),pl=O(Ar).replace(/bull/g,tn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),nn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ml=/^[^\n]+/,rn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,gl=O(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),dl=O(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,tn).getRegex(),dt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ln=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,kl=O("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ln).replace("tag",dt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Rr=O(nn).replace("hr",Je).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dt).getRegex(),xl=O(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Rr).getRegex(),sn={blockquote:xl,code:cl,def:gl,fences:hl,heading:fl,hr:Je,html:kl,lheading:zr,list:dl,newline:ul,paragraph:Rr,table:Ie,text:ml},Dn=O("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Je).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dt).getRegex(),yl={...sn,lheading:pl,table:Dn,paragraph:O(nn).replace("hr",Je).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Dn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dt).getRegex()},bl={...sn,html:O(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ln).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ie,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:O(nn).replace("hr",Je).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",zr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},wl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Sl=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Pr=/^( {2,}|\\)\n(?!\s*$)/,Cl=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,kt=/[\p{P}\p{S}]/u,an=/[\s\p{P}\p{S}]/u,_r=/[^\s\p{P}\p{S}]/u,El=O(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,an).getRegex(),Lr=/(?!~)[\p{P}\p{S}]/u,Il=/(?!~)[\s\p{P}\p{S}]/u,Tl=/(?:[^\s\p{P}\p{S}]|~)/u,Fr=/(?![*_])[\p{P}\p{S}]/u,Al=/(?![*_])[\s\p{P}\p{S}]/u,zl=/(?:[^\s\p{P}\p{S}]|[*_])/u,Rl=O(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ol?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Dr=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Pl=O(Dr,"u").replace(/punct/g,kt).getRegex(),_l=O(Dr,"u").replace(/punct/g,Lr).getRegex(),vr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ll=O(vr,"gu").replace(/notPunctSpace/g,_r).replace(/punctSpace/g,an).replace(/punct/g,kt).getRegex(),Fl=O(vr,"gu").replace(/notPunctSpace/g,Tl).replace(/punctSpace/g,Il).replace(/punct/g,Lr).getRegex(),Dl=O("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_r).replace(/punctSpace/g,an).replace(/punct/g,kt).getRegex(),vl=O(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Fr).getRegex(),Nl="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",$l=O(Nl,"gu").replace(/notPunctSpace/g,zl).replace(/punctSpace/g,Al).replace(/punct/g,Fr).getRegex(),Bl=O(/\\(punct)/,"gu").replace(/punct/g,kt).getRegex(),Ol=O(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),jl=O(ln).replace("(?:-->|$)","-->").getRegex(),Ml=O("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",jl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ot=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,ql=O(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ot).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nr=O(/^!?\[(label)\]\[(ref)\]/).replace("label",ot).replace("ref",rn).getRegex(),$r=O(/^!?\[(ref)\](?:\[\])?/).replace("ref",rn).getRegex(),Hl=O("reflink|nolink(?!\\()","g").replace("reflink",Nr).replace("nolink",$r).getRegex(),vn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,on={_backpedal:Ie,anyPunctuation:Bl,autolink:Ol,blockSkip:Rl,br:Pr,code:Sl,del:Ie,delLDelim:Ie,delRDelim:Ie,emStrongLDelim:Pl,emStrongRDelimAst:Ll,emStrongRDelimUnd:Dl,escape:wl,link:ql,nolink:$r,punctuation:El,reflink:Nr,reflinkSearch:Hl,tag:Ml,text:Cl,url:Ie},Vl={...on,link:O(/^!?\[(label)\]\((.*?)\)/).replace("label",ot).getRegex(),reflink:O(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ot).getRegex()},Mt={...on,emStrongRDelimAst:Fl,emStrongLDelim:_l,delLDelim:vl,delRDelim:$l,url:O(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",vn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:O(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",vn).getRegex()},Ul={...Mt,br:O(Pr).replace("{2,}","*").getRegex(),text:O(Mt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},nt={normal:sn,gfm:yl,pedantic:bl},je={normal:on,gfm:Mt,breaks:Ul,pedantic:Vl},Wl={"&":"&","<":"<",">":">",'"':""","'":"'"},Nn=e=>Wl[e];function ce(e,t){if(t){if(J.escapeTest.test(e))return e.replace(J.escapeReplace,Nn)}else if(J.escapeTestNoEncode.test(e))return e.replace(J.escapeReplaceNoEncode,Nn);return e}function $n(e){try{e=encodeURI(e).replace(J.percentDecode,"%")}catch{return null}return e}function Bn(e,t){let n=e.replace(J.findPipe,(s,l,a)=>{let o=!1,u=l;for(;--u>=0&&a[u]==="\\";)o=!o;return o?"|":" |"}),r=n.split(J.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(J.slashPipe,"|");return r}function Me(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function Ql(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Zl(e,t=0){let n=t,r="";for(let i of e)if(i===" "){let s=4-n%4;r+=" ".repeat(s),n+=s}else r+=i,n++;return r}function On(e,t,n,r,i){let s=t.href,l=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:l,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,o}function Gl(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
3
3
|
`).map(s=>{let l=s.match(n.other.beginningSpace);if(l===null)return s;let[a]=l;return a.length>=i.length?s.slice(i.length):s}).join(`
|
|
4
4
|
`)}var ut=class{options;rules;lexer;constructor(e){this.options=e||ze}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Me(n,`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/memory-screen-C_ZNDGLd.js","assets/main-ZBMVSJTF.js","assets/useQuery-DMTgpIql.js","assets/useMutation-CpD2Pn0F.js","assets/button-DqP4GZwZ.js","assets/markdown-CHUjmWcv.js","assets/index-C_gsW9fo.js","assets/react-Akh4y69S.js","assets/use-file-explorer-state-Dfyh4GwR.js","assets/useOnFirstRender-DsFYFJoB.js","assets/useBaseUiId-DLhdkHJl.js","assets/event-2_Dxdv7h.js","assets/visuallyHidden-COI6QeQH.js","assets/composite-BLgu_EOL.js","assets/index-T4TOjvD0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r,_ as s}from"./main-ZBMVSJTF.js";const n=r.lazy(()=>s(()=>import("./memory-screen-C_ZNDGLd.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(t=>({default:t.MemoryScreen})));function a(){return e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"flex h-screen items-center justify-center text-primary-500 text-sm",children:"Loading…"}),children:e.jsx(n,{})})}export{a as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,r as h,u as N,L as R}from"./main-
|
|
1
|
+
import{j as e,r as h,u as N,L as R}from"./main-ZBMVSJTF.js";import{u as g}from"./useQuery-DMTgpIql.js";import{u as S}from"./useMutation-CpD2Pn0F.js";import{c as M,B as f,b as k}from"./button-DqP4GZwZ.js";import{M as C}from"./markdown-CHUjmWcv.js";import"./index-C_gsW9fo.js";import"./react-Akh4y69S.js";import"./use-file-explorer-state-Dfyh4GwR.js";import"./useOnFirstRender-DsFYFJoB.js";import"./useBaseUiId-DLhdkHJl.js";import"./event-2_Dxdv7h.js";import"./visuallyHidden-COI6QeQH.js";import"./composite-BLgu_EOL.js";import"./index-T4TOjvD0.js";const w=/\/(\d{4}-\d{2}-\d{2})/;function j({path:r,label:n,selected:o,onSelect:m}){return e.jsx("button",{type:"button",onClick:()=>m(r),className:M("w-full text-left px-2.5 py-1.5 rounded-md text-sm transition-colors",o?"text-primary-900":"text-primary-600 hover:text-primary-900 hover:bg-primary-50"),style:o?{backgroundColor:"var(--opencami-accent-light)"}:void 0,children:n})}function b(r){return r==="/MEMORY.md"?"📋 MEMORY.md":r.match(w)?`📅 ${r.replace(/^\/?memory\//,"")}`:`📄 ${r.replace(/^\/?memory\//,"")}`}function F({files:r,selectedPath:n,onSelect:o,loading:m}){const i=r.filter(t=>t==="/MEMORY.md"),s=r.filter(t=>t!=="/MEMORY.md"&&w.test(t)),l=r.filter(t=>t!=="/MEMORY.md"&&!w.test(t));return e.jsxs("aside",{className:"border-r border-primary-200 bg-primary-100 md:w-72 w-full md:h-full h-auto overflow-y-auto",children:[e.jsx("div",{className:"px-4 py-3 border-b border-primary-200",children:e.jsx("h2",{className:"text-sm font-semibold text-primary-800",children:"Memory Files"})}),e.jsx("div",{className:"p-2 space-y-0.5",children:m?e.jsx("div",{className:"px-2 py-2 text-sm text-primary-500",children:"Loading files…"}):r.length===0?e.jsx("div",{className:"px-2 py-2 text-sm text-primary-500",children:"No memory files found."}):e.jsxs(e.Fragment,{children:[i.map(t=>e.jsx(j,{path:t,label:b(t),selected:n===t,onSelect:o},t)),s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-2.5 pt-3 pb-1 text-xs font-medium text-primary-400 uppercase tracking-wider",children:"Daily"}),s.map(t=>e.jsx(j,{path:t,label:b(t),selected:n===t,onSelect:o},t))]}),l.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-2.5 pt-3 pb-1 text-xs font-medium text-primary-400 uppercase tracking-wider",children:"Notes"}),l.map(t=>e.jsx(j,{path:t,label:b(t),selected:n===t,onSelect:o},t))]})]})})]})}function O({filePath:r,content:n,isLoading:o,onSave:m,onBack:i}){const[s,l]=h.useState(!1),[t,x]=h.useState(n),[u,p]=h.useState(!1);h.useEffect(()=>{x(n),l(!1)},[r,n]);const a=async()=>{p(!0);try{await m(t),l(!1)}finally{p(!1)}};return e.jsxs("section",{className:"flex-1 min-h-0 flex flex-col",children:[e.jsxs("header",{className:"border-b border-primary-100 px-4 py-3 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i?e.jsx(f,{size:"sm",variant:"ghost",onClick:i,children:"Back"}):null,e.jsx("h1",{className:"text-sm font-semibold text-primary-800 truncate",children:r})]}),!o&&e.jsx("div",{className:"flex items-center gap-2",children:s?e.jsxs(e.Fragment,{children:[e.jsx(f,{size:"sm",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(f,{size:"sm",onClick:()=>{a()},disabled:u,children:u?"Saving…":"Save"})]}):e.jsx(f,{size:"sm",variant:"outline",onClick:()=>l(!0),children:"Edit"})})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-4",children:o?e.jsx("div",{className:"text-sm text-primary-500",children:"Loading content…"}):s?e.jsx("textarea",{value:t,onChange:c=>x(c.target.value),className:"w-full min-h-[60vh] rounded-md border border-primary-200 bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"}):e.jsx(C,{className:"prose prose-invert max-w-none",children:n||"_Empty file_"})})]})}const Y=/\/(\d{4}-\d{2}-\d{2})/;function z(r){const n=r.includes("/MEMORY.md")?["/MEMORY.md"]:[],o=r.filter(s=>s!=="/MEMORY.md"&&(s.startsWith("memory/")||s.startsWith("/memory/"))&&s.endsWith(".md")),m=[],i=[];for(const s of o)Y.test(s)?m.push(s):i.push(s);return m.sort((s,l)=>l.localeCompare(s)),i.sort((s,l)=>s.localeCompare(l)),[...n,...m,...i]}function J(){const r=N(),[n,o]=h.useState("/MEMORY.md"),m=g({queryKey:["memory","files"],queryFn:async({signal:a})=>{const[c,d]=await Promise.all([fetch("/api/files/read?path=/MEMORY.md",{signal:a}),fetch("/api/files/list?path=/memory",{signal:a})]),y=[];if(c.ok&&y.push("/MEMORY.md"),d.ok){const E=await d.json();for(const v of E.items)!v.isDir&&v.path.endsWith(".md")&&y.push(v.path)}return z(y)},staleTime:3e4}),i=n??m.data?.[0]??null,s=g({queryKey:["memory","content",i],queryFn:async({signal:a})=>{const c=i.startsWith("/")?i:`/${i}`,d=await fetch(`/api/files/read?path=${encodeURIComponent(c)}`,{signal:a});if(!d.ok)throw new Error("Failed to read memory file");return d.json()},enabled:!!i}),l=S({mutationFn:async a=>{const c=a.path.startsWith("/")?a.path:`/${a.path}`,d=await fetch("/api/files/save",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...a,path:c})});if(!d.ok)throw new Error("Failed to save memory file");return d.json()},onSuccess:async(a,c)=>{await r.invalidateQueries({queryKey:["memory","content",c.path]}),await r.invalidateQueries({queryKey:["memory","files"]})}}),[t,x]=h.useState(()=>typeof window<"u"?window.innerWidth<768:!1);h.useEffect(()=>{if(typeof window>"u")return;const a=()=>x(window.innerWidth<768);return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]);const u=t&&!i,p=h.useCallback(a=>{o(a)},[]);return e.jsxs("div",{className:"h-screen bg-surface text-primary-900",children:[e.jsxs("div",{className:"h-12 border-b border-primary-100 px-3 flex items-center justify-between",children:[e.jsx("h1",{className:"text-sm font-semibold",children:"Memory Viewer"}),e.jsx(R,{to:"/chat/$sessionKey",params:{sessionKey:"main"},className:M(k({variant:"ghost",size:"sm"})),children:"Back to Chat"})]}),e.jsxs("div",{className:"h-[calc(100vh-48px)] md:grid md:grid-cols-[18rem_1fr]",children:[(!t||u)&&e.jsx(F,{files:m.data??[],selectedPath:i,onSelect:p,loading:m.isLoading}),i&&(!t||!u)?e.jsx(O,{filePath:i,content:s.data?.content??"",isLoading:s.isLoading,onBack:t?()=>o(null):void 0,onSave:async a=>{await l.mutateAsync({path:i,content:a})}}):e.jsx("div",{className:"p-4 text-sm text-primary-500",children:"Select a file to view."})]}),(m.isError||s.isError||l.isError)&&e.jsxs("div",{className:"fixed bottom-4 right-4 rounded-md border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-700",children:["Something went wrong. ",e.jsx(f,{size:"sm",variant:"ghost",onClick:()=>{m.refetch()},children:"Retry"})]})]})}export{J as MemoryScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as W,w as ot}from"./main-_1IghVZn.js";import{ab as Ee,ac as Pe,ad as qe,E as At,ag as Oe,C as Dt,ah as $e,c as Je}from"./button-BcUmP7JL.js";import{u as Lt,a as Te,b as Me,c as Qe,d as dt,e as Ht,p as pt,t as Kt,F as Ut,D as jt,P as Bt,f as _t,R as Gt,g as Vt,h as Wt,i as gt,j as zt,k as $,l as Yt,m as qt,n as mt,o as $t,q as Xt,r as Jt,s as Qt,T as Zt,v as xt,w as en,x as tn,y as nn,z as on,A as rn,B as sn,C as an,E as rt,G as st,H as cn}from"./useOnFirstRender-S4-xcV93.js";import{t as ht,g as ne,u as fe,a as me,l as De,i as Xe,j as He,k as yt,f as Rt,e as bt,o as un,m as Ke,s as Le,p as ln,q as it,r as fn,v as dn,w as pn,x as gn,b as mn,y as xn}from"./useBaseUiId-DN9cOflS.js";import{e as at,F as hn,I as yn,i as Rn,f as bn,g as vn,h as Cn}from"./use-file-explorer-state-eXs92yKN.js";import{u as In}from"./DirectionContext-FHFKdJq_.js";import{i as ct,f as Tn,g as Mn,h as En,j as Pn,d as ut,o as Ue,e as ve,s as he,a as je,b as Se,c as we,k as On,l as Sn,m as wn,A as vt}from"./event-BxzjTPjG.js";import{h as lt,g as We,a as ft,c as kn,i as ze,b as Fn,d as Nn,e as An,f as Fe,j as Dn,C as Ln,u as Hn}from"./useCompositeItem-B_J-cnZX.js";import{u as Kn,e as Ct,f as Un,h as jn,i as Bn,j as _n}from"./tooltip-DexBPu8g.js";import{C as Gn}from"./composite--BBbKdxm.js";function Vn(e,t={}){const o="rootStore"in e?e.rootStore:e,c=o.context.dataRef,{enabled:d=!0,event:x="click",toggle:T=!0,ignoreMouse:r=!1,stickIfOpen:v=!0,touchOpenDelay:C=0,reason:R=ht}=t,m=n.useRef(void 0),O=Lt(),b=Te(),M=n.useMemo(()=>({onPointerDown(u){m.current=u.pointerType},onMouseDown(u){const p=m.current,h=u.nativeEvent,l=o.select("open");if(u.button!==0||x==="click"||ct(p,!0)&&r)return;const w=c.current.openEvent,I=w?.type,s=o.select("domReferenceElement")!==u.currentTarget,i=l&&s||!(l&&T&&(!(w&&v)||I==="click"||I==="mousedown"));if(Mn(h.target)){const S=ne(R,h,h.target);i&&p==="touch"&&C>0?b.start(C,()=>{o.setOpen(!0,S)}):o.setOpen(i,S);return}const y=u.currentTarget;O.request(()=>{const S=ne(R,h,y);i&&p==="touch"&&C>0?b.start(C,()=>{o.setOpen(!0,S)}):o.setOpen(i,S)})},onClick(u){if(x==="mousedown-only")return;const p=m.current;if(x==="mousedown"&&p){m.current=void 0;return}if(ct(p,!0)&&r)return;const h=o.select("open"),l=c.current.openEvent,w=o.select("domReferenceElement")!==u.currentTarget,I=h&&w||!(h&&T&&(!(l&&v)||Tn(l))),s=ne(R,u.nativeEvent,u.currentTarget);I&&p==="touch"&&C>0?b.start(C,()=>{o.setOpen(!0,s)}):o.setOpen(I,s)},onKeyDown(){m.current=void 0}}),[c,x,r,o,v,T,O,b,C,R]);return n.useMemo(()=>d?{reference:M}:Ee,[d,M])}const Wn="Escape";function Be(e,t,o){switch(e){case"vertical":return t;case"horizontal":return o;default:return t||o}}function Ne(e,t){return Be(t,e===vt||e===je,e===Se||e===we)}function Ye(e,t,o){return Be(t,e===je,o?e===Se:e===we)||e==="Enter"||e===" "||e===""}function zn(e,t,o){return Be(t,o?e===Se:e===we,e===je)}function Yn(e,t,o,c){const d=o?e===we:e===Se,x=e===vt;return t==="both"||t==="horizontal"&&c&&c>1?e===Wn:Be(t,d,x)}function qn(e,t){const o="rootStore"in e?e.rootStore:e,c=o.useState("open"),d=o.useState("floatingElement"),x=o.useState("domReferenceElement"),T=o.context.dataRef,{listRef:r,activeIndex:v,onNavigate:C=()=>{},enabled:R=!0,selectedIndex:m=null,allowEscape:O=!1,loopFocus:b=!1,nested:M=!1,rtl:u=!1,virtual:p=!1,focusItemOnOpen:h="auto",focusItemOnHover:l=!0,openOnArrowKeyDown:w=!0,disabledIndices:I=void 0,orientation:s="vertical",parentOrientation:i,cols:y=1,id:S,resetOnPointerLeave:G=!0,externalTree:H}=t,Y=En(d),B=Me(Y),L=Qe(),N=dt(H);fe(()=>{T.current.orientation=s},[T,s]);const V=Pn(x),q=n.useRef(h),f=n.useRef(m??-1),K=n.useRef(null),X=n.useRef(!0),F=me(a=>{C(f.current===-1?null:f.current,a)}),J=n.useRef(F),Q=n.useRef(!!d),oe=n.useRef(c),P=n.useRef(!1),re=n.useRef(!1),xe=Me(I),ue=Me(c),se=Me(m),le=Me(G),ee=me(()=>{function a(z){p?N?.events.emit("virtualfocus",z):at(z,{sync:P.current,preventScroll:!0})}const k=r.current[f.current],g=re.current;k&&a(k),(P.current?z=>z():requestAnimationFrame)(()=>{const z=r.current[f.current]||k;if(!z)return;k||a(z),A&&(g||!X.current)&&z.scrollIntoView?.({block:"nearest",inline:"nearest"})})});fe(()=>{R&&(c&&d?(f.current=m??-1,q.current&&m!=null&&(re.current=!0,F())):Q.current&&(f.current=-1,J.current()))},[R,c,d,m,F]),fe(()=>{if(R){if(!c){P.current=!1;return}if(d)if(v==null){if(P.current=!1,se.current!=null)return;if(Q.current&&(f.current=-1,ee()),(!oe.current||!Q.current)&&q.current&&(K.current!=null||q.current===!0&&K.current==null)){let a=0;const k=()=>{r.current[0]==null?(a<2&&(a?requestAnimationFrame:queueMicrotask)(k),a+=1):(f.current=K.current==null||Ye(K.current,s,u)||M?We(r):ft(r),K.current=null,F())};k()}}else lt(r,v)||(f.current=v,ee(),re.current=!1)}},[R,c,d,v,se,M,r,s,u,F,ee,xe]),fe(()=>{if(!R||d||!N||p||!Q.current)return;const a=N.nodesRef.current,k=a.find(z=>z.id===L)?.context?.elements.floating,g=ut(Ue(d)),j=a.some(z=>z.context&&ve(z.context.elements.floating,g));k&&!j&&X.current&&k.focus({preventScroll:!0})},[R,d,N,L,p]),fe(()=>{J.current=F,oe.current=c,Q.current=!!d}),fe(()=>{c||(K.current=null,q.current=h)},[c,h]);const _=v!=null,A=n.useMemo(()=>{function a(g){if(!ue.current)return;const j=r.current.indexOf(g.currentTarget);j!==-1&&f.current!==j&&(f.current=j,F(g))}return{onFocus(g){P.current=!0,a(g)},onClick:({currentTarget:g})=>g.focus({preventScroll:!0}),onMouseMove(g){P.current=!0,re.current=!1,l&&a(g)},onPointerLeave(g){if(!ue.current||!X.current||g.pointerType==="touch")return;P.current=!0;const j=g.relatedTarget;!l||r.current.includes(j)||le.current&&(at(null,{sync:!0}),f.current=-1,F(g),p||B.current?.focus({preventScroll:!0}))}}},[ue,B,l,r,F,le,p]),ae=n.useCallback(()=>i??N?.nodesRef.current.find(a=>a.id===L)?.context?.dataRef?.current.orientation,[L,N,i]),de=me(a=>{if(X.current=!1,P.current=!0,a.which===229||!ue.current&&a.currentTarget===B.current)return;if(M&&Yn(a.key,s,u,y)){Ne(a.key,ae())||he(a),o.setOpen(!1,ne(De,a.nativeEvent)),Xe(x)&&(p?N?.events.emit("virtualfocus",x):x.focus());return}const k=f.current,g=We(r,I),j=ft(r,I);if(V||(a.key==="Home"&&(he(a),f.current=g,F(a)),a.key==="End"&&(he(a),f.current=j,F(a))),y>1){const z=Array.from({length:r.current.length},()=>({width:1,height:1})),ie=kn(z,y,!1),ye=ie.findIndex(ge=>ge!=null&&!ze(r,ge,I)),Ie=ie.reduce((ge,be,Ge)=>be!=null&&!ze(r,be,I)?Ge:ge,-1),Re=ie[Fn({current:ie.map(ge=>ge!=null?r.current[ge]:null)},{event:a,orientation:s,loopFocus:b,rtl:u,cols:y,disabledIndices:An([...(typeof I!="function"?I:null)||r.current.map((ge,be)=>ze(r,be,I)?be:void 0),void 0],ie),minIndex:ye,maxIndex:Ie,prevIndex:Nn(f.current>j?g:f.current,z,ie,y,a.key===je?"bl":a.key===(u?Se:we)?"tr":"tl"),stopEvent:!0})];if(Re!=null&&(f.current=Re,F(a)),s==="both")return}if(Ne(a.key,s)){if(he(a),c&&!p&&ut(a.currentTarget.ownerDocument)===a.currentTarget){f.current=Ye(a.key,s,u)?g:j,F(a);return}Ye(a.key,s,u)?b?k>=j?O&&k!==r.current.length?f.current=-1:(P.current=!1,f.current=g):f.current=Fe(r,{startingIndex:k,disabledIndices:I}):f.current=Math.min(j,Fe(r,{startingIndex:k,disabledIndices:I})):b?k<=g?O&&k!==-1?f.current=r.current.length:(P.current=!1,f.current=j):f.current=Fe(r,{startingIndex:k,decrement:!0,disabledIndices:I}):f.current=Math.max(g,Fe(r,{startingIndex:k,decrement:!0,disabledIndices:I})),lt(r,f.current)&&(f.current=-1),F(a)}}),pe=n.useMemo(()=>p&&c&&_&&{"aria-activedescendant":`${S}-${v}`},[p,c,_,S,v]),ce=n.useMemo(()=>({"aria-orientation":s==="both"?void 0:s,...V?{}:pe,onKeyDown(a){if(a.key==="Tab"&&a.shiftKey&&c&&!p){const k=On(a.nativeEvent);if(k&&!ve(B.current,k))return;he(a),o.setOpen(!1,ne(He,a.nativeEvent)),Xe(x)&&x.focus();return}de(a)},onPointerMove(){X.current=!0}}),[pe,de,B,s,V,o,c,p,x]),U=n.useMemo(()=>{function a(g){h==="auto"&&Sn(g.nativeEvent)&&(q.current=!p)}function k(g){q.current=h,h==="auto"&&wn(g.nativeEvent)&&(q.current=!0)}return{onKeyDown(g){const j=o.select("open");X.current=!1;const z=g.key.startsWith("Arrow"),ie=zn(g.key,ae(),u),ye=Ne(g.key,s),Ie=(M?ie:ye)||g.key==="Enter"||g.key.trim()==="";if(p&&j)return de(g);if(!(!j&&!w&&z)){if(Ie){const Re=Ne(g.key,ae());K.current=M&&Re?null:g.key}if(M){ie&&(he(g),j?(f.current=We(r,xe.current),F(g)):o.setOpen(!0,ne(De,g.nativeEvent,g.currentTarget)));return}ye&&(se.current!=null&&(f.current=se.current),he(g),!j&&w?o.setOpen(!0,ne(De,g.nativeEvent,g.currentTarget)):de(g),j&&F(g))}},onFocus(g){o.select("open")&&!p&&(f.current=-1,F(g))},onPointerDown:k,onPointerEnter:k,onMouseDown:a,onClick:a}},[de,xe,h,r,M,F,o,w,s,ae,u,se,p]),Z=n.useMemo(()=>({...pe,...U}),[pe,U]);return n.useMemo(()=>R?{reference:Z,floating:ce,item:A,trigger:U}:{},[R,Z,ce,U,A])}function $n(e,t){const o="rootStore"in e?e.rootStore:e,c=o.context.dataRef,d=o.useState("open"),{listRef:x,activeIndex:T,onMatch:r,onTypingChange:v,enabled:C=!0,resetMs:R=750,selectedIndex:m=null}=t,O=Te(),b=n.useRef(""),M=n.useRef(m??T??-1),u=n.useRef(null);fe(()=>{!d&&m!==null||(O.clear(),u.current=null,b.current!==""&&(b.current=""))},[d,m,O]),fe(()=>{d&&b.current===""&&(M.current=m??T??-1)},[d,m,T]);const p=me(s=>{s?c.current.typing||(c.current.typing=s,v?.(s)):c.current.typing&&(c.current.typing=s,v?.(s))}),h=me(s=>{function i(B,L,N){const V=L.find(q=>q?.toLocaleLowerCase().indexOf(N.toLocaleLowerCase())===0);return V?B.indexOf(V):-1}const y=x.current;if(b.current.length>0&&b.current[0]!==" "&&(i(y,y,b.current)===-1?p(!1):s.key===" "&&he(s)),y==null||s.key.length!==1||s.ctrlKey||s.metaKey||s.altKey)return;d&&s.key!==" "&&(he(s),p(!0));const S=b.current==="";S&&(M.current=m??T??-1),y.every(B=>B?B[0]?.toLocaleLowerCase()!==B[1]?.toLocaleLowerCase():!0)&&b.current===s.key&&(b.current="",M.current=u.current),b.current+=s.key,O.start(R,()=>{b.current="",M.current=u.current,p(!1)});const H=S?m??T??-1:M.current,Y=i(y,[...y.slice((H||0)+1),...y.slice(0,(H||0)+1)],b.current);Y!==-1?(r?.(Y),u.current=Y):s.key!==" "&&(b.current="",p(!1))}),l=me(s=>{const i=s.relatedTarget,y=o.select("domReferenceElement"),S=o.select("floatingElement"),G=ve(y,i),H=ve(S,i);G||H||(O.clear(),b.current="",M.current=u.current,p(!1))}),w=n.useMemo(()=>({onKeyDown:h,onBlur:l}),[h,l]),I=n.useMemo(()=>({onKeyDown:h,onKeyUp(s){s.key===" "&&p(!1)},onBlur:l}),[h,l,p]);return n.useMemo(()=>C?{reference:w,floating:I}:{},[C,w,I])}const It=n.createContext(void 0);function Tt(e){const t=n.useContext(It);if(t===void 0&&!e)throw new Error(Pe(33));return t}const Mt=n.createContext(void 0);function Ce(e){const t=n.useContext(Mt);if(t===void 0&&!e)throw new Error(Pe(36));return t}const Xn=n.createContext(void 0);function _e(e=!0){const t=n.useContext(Xn);if(t===void 0&&!e)throw new Error(Pe(25));return t}function Jn(e){const{closeOnClick:t,highlighted:o,id:c,nodeId:d,store:x,itemRef:T,itemMetadata:r}=e,{events:v}=x.useState("floatingTreeRoot"),C=_e(!0),R=C!==void 0;return n.useMemo(()=>({id:c,role:"menuitem",tabIndex:o?0:-1,onMouseMove(m){d&&v.emit("itemhover",{nodeId:d,target:m.currentTarget})},onClick(m){t&&v.emit("close",{domEvent:m,reason:yt})},onMouseUp(m){if(C){const O=C.initialCursorPointRef.current;if(C.initialCursorPointRef.current=null,R&&O&&Math.abs(m.clientX-O.x)<=1&&Math.abs(m.clientY-O.y)<=1)return}T.current&&x.context.allowMouseUpTriggerRef.current&&(!R||m.button===2)&&(!r||r.type==="regular-item")&&T.current.click()}}),[t,o,c,v,d,x,T,C,R,r])}const Qn={type:"regular-item"};function Zn(e){const{closeOnClick:t,disabled:o=!1,highlighted:c,id:d,store:x,nativeButton:T,itemMetadata:r,nodeId:v}=e,C=n.useRef(null),{getButtonProps:R,buttonRef:m}=Rt({disabled:o,focusableWhenDisabled:!0,native:T}),O=Jn({closeOnClick:t,highlighted:c,id:d,nodeId:v,store:x,itemRef:C,itemMetadata:r}),b=n.useCallback(u=>qe(O,{onMouseEnter(){r.type==="submenu-trigger"&&r.setActive()},onKeyUp(p){p.key===" "&&x.context.typingRef.current&&p.preventBaseUIHandler()}},u,R),[O,R,x,r]),M=At(C,m);return n.useMemo(()=>({getItemProps:b,itemRef:M}),[b,M])}const eo=n.forwardRef(function(t,o){const{render:c,className:d,id:x,label:T,nativeButton:r=!1,disabled:v=!1,closeOnClick:C=!0,...R}=t,m=Dn({label:T}),O=Tt(!0),b=bt(x),{store:M}=Ce(),u=M.useState("isActive",m.index),p=M.useState("itemProps"),{getItemProps:h,itemRef:l}=Zn({closeOnClick:C,disabled:v,highlighted:u,id:b,store:M,nativeButton:r,nodeId:O?.nodeId,itemMetadata:Qn});return Oe("div",t,{state:{disabled:v,highlighted:u},props:[p,R,h],ref:[l,o,m.ref]})}),to=n.createContext(void 0);function no(e){return n.useContext(to)}const oo={...pt,...Kt},ro=n.forwardRef(function(t,o){const{render:c,className:d,finalFocus:x,...T}=t,{store:r}=Ce(),{side:v,align:C}=Tt(),R=no()!=null,m=r.useState("open"),O=r.useState("transitionStatus"),b=r.useState("popupProps"),M=r.useState("mounted"),u=r.useState("instantType"),p=r.useState("activeTriggerElement"),h=r.useState("parent"),l=r.useState("lastOpenChangeReason"),w=r.useState("rootId"),I=r.useState("floatingRootContext"),s=r.useState("floatingTreeRoot"),i=r.useState("closeDelay"),y=r.useState("activeTriggerElement"),S=h.type==="context-menu";Ht({open:m,ref:r.context.popupRef,onComplete(){m&&r.context.onOpenChangeComplete?.(!0)}}),n.useEffect(()=>{function N(V){r.setOpen(!1,ne(V.reason,V.domEvent))}return s.events.on("close",N),()=>{s.events.off("close",N)}},[s.events,r]);const G=r.useState("hoverEnabled"),H=r.useState("disabled");Kn(I,{enabled:G&&!H&&!S&&h.type!=="menubar",closeDelay:i});const Y={transitionStatus:O,side:v,align:C,open:m,nested:h.type==="menu",instant:u},B=Oe("div",t,{state:Y,ref:[o,r.context.popupRef],stateAttributesMapping:oo,props:[b,{onKeyDown(N){R&&Gn.has(N.key)&&N.stopPropagation()}},Ct(O),T,{"data-rootownerid":w}]});let L=h.type===void 0||S;return(p||h.type==="menubar"&&l!==un)&&(L=!0),W.jsx(hn,{context:I,modal:S,disabled:!M,returnFocus:x===void 0?L:x,initialFocus:h.type!=="menu",restoreFocus:!0,externalTree:h.type!=="menubar"?s:void 0,previousFocusableElement:y,nextFocusableElement:h.type===void 0?r.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:h.type===void 0?r.context.beforeContentFocusGuardRef:void 0,children:B})}),Et=n.createContext(void 0);function so(){const e=n.useContext(Et);if(e===void 0)throw new Error(Pe(32));return e}const io=n.forwardRef(function(t,o){const{keepMounted:c=!1,...d}=t,{store:x}=Ce();return x.useState("mounted")||c?W.jsx(Et.Provider,{value:c,children:W.jsx(Ut,{ref:o,...d})}):null}),ao=n.forwardRef(function(t,o){const{anchor:c,positionMethod:d="absolute",className:x,render:T,side:r,align:v,sideOffset:C=0,alignOffset:R=0,collisionBoundary:m="clipping-ancestors",collisionPadding:O=5,arrowPadding:b=5,sticky:M=!1,disableAnchorTracking:u=!1,collisionAvoidance:p=jt,...h}=t,{store:l}=Ce(),w=so(),I=_e(!0),s=l.useState("parent"),i=l.useState("floatingRootContext"),y=l.useState("floatingTreeRoot"),S=l.useState("mounted"),G=l.useState("open"),H=l.useState("modal"),Y=l.useState("activeTriggerElement"),B=l.useState("transitionStatus"),L=l.useState("lastOpenChangeReason"),N=l.useState("floatingNodeId"),V=l.useState("floatingParentNodeId");let q=c,f=C,K=R,X=v,F=p;s.type==="context-menu"&&(q=c??s.context?.anchor,X=X??"start",!r&&X!=="center"&&(K=t.alignOffset??2,f=t.sideOffset??-5));let J=r,Q=X;s.type==="menu"?(J=J??"inline-end",Q=Q??"start",F=t.collisionAvoidance??Bt):s.type==="menubar"&&(J=J??"bottom",Q=Q??"start");const oe=s.type==="context-menu",P=Un({anchor:q,floatingRootContext:i,positionMethod:I?"fixed":d,mounted:S,side:J,sideOffset:f,align:Q,alignOffset:K,arrowPadding:oe?0:b,collisionBoundary:m,collisionPadding:O,sticky:M,nodeId:N,keepMounted:w,disableAnchorTracking:u,collisionAvoidance:F,shiftCrossAxis:oe&&!("side"in F&&F.side==="flip"),externalTree:y}),re=n.useMemo(()=>{const _={};return G||(_.pointerEvents="none"),{role:"presentation",hidden:!S,style:{...P.positionerStyles,..._}}},[G,S,P.positionerStyles]);n.useEffect(()=>{function _(A){A.open&&(A.parentNodeId===N&&l.set("hoverEnabled",!1),A.nodeId!==N&&A.parentNodeId===l.select("floatingParentNodeId")&&l.setOpen(!1,ne(Le)))}return y.events.on("menuopenchange",_),()=>{y.events.off("menuopenchange",_)}},[l,y.events,N]),n.useEffect(()=>{if(l.select("floatingParentNodeId")==null)return;function _(A){if(A.open||A.nodeId!==l.select("floatingParentNodeId"))return;const ae=A.reason??Le;l.setOpen(!1,ne(ae))}return y.events.on("menuopenchange",_),()=>{y.events.off("menuopenchange",_)}},[y.events,l]),n.useEffect(()=>{function _(A){!G||A.nodeId!==l.select("floatingParentNodeId")||A.target&&Y&&Y!==A.target&&l.setOpen(!1,ne(Le))}return y.events.on("itemhover",_),()=>{y.events.off("itemhover",_)}},[y.events,G,Y,l]),n.useEffect(()=>{const _={open:G,nodeId:N,parentNodeId:V,reason:l.select("lastOpenChangeReason")};y.events.emit("menuopenchange",_)},[y.events,G,l,N,V]);const xe={open:G,side:P.side,align:P.align,anchorHidden:P.anchorHidden,nested:s.type==="menu"},ue=n.useMemo(()=>({side:P.side,align:P.align,arrowRef:P.arrowRef,arrowUncentered:P.arrowUncentered,arrowStyles:P.arrowStyles,nodeId:P.context.nodeId}),[P.side,P.align,P.arrowRef,P.arrowUncentered,P.arrowStyles,P.context.nodeId]),se=Oe("div",t,{state:xe,stateAttributesMapping:pt,ref:[o,l.useStateSetter("positionerElement")],props:[re,Ct(B),h]}),le=S&&s.type!=="menu"&&(s.type!=="menubar"&&H&&L!==Ke||s.type==="menubar"&&s.context.modal);let ee=null;return s.type==="menubar"?ee=s.context.contentElement:s.type===void 0&&(ee=Y),W.jsxs(It.Provider,{value:ue,children:[le&&W.jsx(yn,{ref:s.type==="context-menu"||s.type==="nested-context-menu"?s.context.internalBackdropRef:null,inert:Rn(!G),cutout:ee}),W.jsx(_t,{id:N,children:W.jsx(Ln,{elementsRef:l.context.itemDomElements,labelsRef:l.context.itemLabels,children:se})})]})}),co=n.createContext(null);function Pt(e){return n.useContext(co)}const uo={...Wt,disabled:$(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:$(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:$(e=>e.allowMouseEnter),stickIfOpen:$(e=>e.stickIfOpen),parent:$(e=>e.parent),rootId:$(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:$(e=>e.activeIndex),isActive:$((e,t)=>e.activeIndex===t),hoverEnabled:$(e=>e.hoverEnabled),instantType:$(e=>e.instantType),lastOpenChangeReason:$(e=>e.openChangeReason),floatingTreeRoot:$(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:$(e=>e.floatingNodeId),floatingParentNodeId:$(e=>e.floatingParentNodeId),itemProps:$(e=>e.itemProps),closeDelay:$(e=>e.closeDelay),keyboardEventRelay:$(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class Ze extends Gt{constructor(t){super({...lo(),...t},{positionerRef:n.createRef(),popupRef:n.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:n.createRef(),beforeContentFocusGuardRef:n.createRef(),onOpenChangeComplete:void 0,triggerElements:new Vt},uo),this.unsubscribeParentListener=this.observe("parent",o=>{if(this.unsubscribeParentListener?.(),o.type==="menu"){this.unsubscribeParentListener=o.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=o.store.context.allowMouseUpTriggerRef;return}o.type!==void 0&&(this.context.allowMouseUpTriggerRef=o.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,o){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:o})}static useStore(t,o){const c=Dt(()=>new Ze(o)).current;return t??c}unsubscribeParentListener=null}function lo(){return{...zt(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new gt,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ee,keyboardEventRelay:void 0,closeDelay:0}}const fo=n.createContext(void 0);function po(){return n.useContext(fo)}const go=Yt(function(t){const{children:o,open:c,onOpenChange:d,onOpenChangeComplete:x,defaultOpen:T=!1,disabled:r=!1,modal:v,loopFocus:C=!0,orientation:R="vertical",actionsRef:m,closeParentOnEsc:O=!1,handle:b,triggerId:M,defaultTriggerId:u=null,highlightItemOnHover:p=!0}=t,h=_e(!0),l=Ce(!0),w=Pt(!0),I=po(),s=n.useMemo(()=>I&&l?{type:"menu",store:l.store}:w?{type:"menubar",context:w}:h&&!l?{type:"context-menu",context:h}:{type:void 0},[h,l,w,I]),i=Ze.useStore(b?.store,{open:T,openProp:c,activeTriggerId:u,triggerIdProp:M,parent:s});qt(()=>{c===void 0&&i.state.open===!1&&T===!0&&i.update({open:!0,activeTriggerId:u})}),i.useControlledProp("openProp",c),i.useControlledProp("triggerIdProp",M),i.useContextCallback("onOpenChangeComplete",x);const y=i.useState("floatingTreeRoot"),S=mt(y),G=Qe();fe(()=>{h&&!l?i.update({parent:{type:"context-menu",context:h},floatingNodeId:S,floatingParentNodeId:G}):l&&i.update({floatingNodeId:S,floatingParentNodeId:G})},[h,l,S,G,i]);const H=i.useState("open"),Y=i.useState("activeTriggerElement"),B=i.useState("positionerElement"),L=i.useState("hoverEnabled"),N=i.useState("modal"),V=i.useState("disabled"),q=i.useState("lastOpenChangeReason"),f=i.useState("parent"),K=i.useState("activeIndex"),X=i.useState("payload"),F=i.useState("floatingParentNodeId"),J=n.useRef(null),Q=F!=null;let oe;i.useSyncedValues({disabled:r,modal:f.type===void 0?v:void 0,rootId:ln()});const{openMethod:P,triggerProps:re,reset:xe}=bn(H);$t(i);const{forceUnmount:ue}=Xt(H,i,()=>{i.update({allowMouseEnter:!1,stickIfOpen:!0}),xe()}),se=n.useRef(f.type!=="context-menu"),le=Te();n.useEffect(()=>{if(H||(J.current=null),f.type==="context-menu"){if(!H){le.clear(),se.current=!1;return}le.start(500,()=>{se.current=!0})}},[le,H,f.type]),vn(H&&N&&q!==Ke&&P!=="touch",B),fe(()=>{!H&&!L&&i.set("hoverEnabled",!0)},[H,L,i]);const ee=n.useRef(!0),_=Te(),A=me((E,D)=>{const te=D.reason;if(H===E&&D.trigger===Y&&q===te||(D.preventUnmountOnClose=()=>{i.set("preventUnmountingOnClose",!0)},!E&&D.trigger==null&&(D.trigger=Y??void 0),d?.(E,D),D.isCanceled))return;const kt={open:E,nativeEvent:D.event,reason:D.reason,nested:Q};oe?.emit("openchange",kt);const ke=D.event;if(E===!1&&ke?.type==="click"&&ke.pointerType==="touch"&&!ee.current)return;if(!E&&K!==null){const Nt=i.context.itemDomElements.current[K];queueMicrotask(()=>{Nt?.setAttribute("tabindex","-1")})}E&&te===it?(ee.current=!1,_.start(300,()=>{ee.current=!0})):(ee.current=!0,_.clear());const tt=(te===ht||te===yt)&&ke.detail===0&&ke?.isTrusted,Ft=!E&&(te===fn||te==null),Ve={open:E,openChangeReason:te};J.current=D.event??null;const nt=D.trigger?.id??null;(nt||E)&&(Ve.activeTriggerId=nt,Ve.activeTriggerElement=D.trigger??null),i.update(Ve),f.type==="menubar"&&(te===it||te===He||te===Ke||te===De||te===Le)?i.set("instantType","group"):tt||Ft?i.set("instantType",tt?"click":"dismiss"):i.set("instantType",void 0)}),ae=n.useCallback(E=>{const D=ne(E);return D.preventUnmountOnClose=()=>{i.set("preventUnmountingOnClose",!0)},D},[i]),de=n.useCallback(()=>{i.setOpen(!1,ae(dn))},[i,ae]);n.useImperativeHandle(m,()=>({unmount:ue,close:de}),[ue,de]);let pe;f.type==="context-menu"&&(pe=f.context),n.useImperativeHandle(pe?.positionerRef,()=>B,[B]),n.useImperativeHandle(pe?.actionsRef,()=>({setOpen:A}),[A]);const ce=Jt({popupStore:i,onOpenChange:A});oe=ce.context.events,n.useEffect(()=>{const E=({open:D,eventDetails:te})=>A(D,te);return oe.on("setOpen",E),()=>{oe?.off("setOpen",E)}},[oe,A]);const U=Qt(ce,{enabled:!V,bubbles:{escapeKey:O&&f.type==="menu"},outsidePress(){return f.type!=="context-menu"||J.current?.type==="contextmenu"?!0:se.current},externalTree:Q?y:void 0}),Z=Cn(ce,{role:"menu"}),a=In(),k=n.useCallback(E=>{i.select("activeIndex")!==E&&i.set("activeIndex",E)},[i]),g=qn(ce,{enabled:!V,listRef:i.context.itemDomElements,activeIndex:K,nested:f.type!==void 0,loopFocus:C,orientation:R,parentOrientation:f.type==="menubar"?f.context.orientation:void 0,rtl:a==="rtl",disabledIndices:$e,onNavigate:k,openOnArrowKeyDown:f.type!=="context-menu",externalTree:Q?y:void 0,focusItemOnHover:p}),j=n.useCallback(E=>{i.context.typingRef.current=E},[i]),z=$n(ce,{listRef:i.context.itemLabels,activeIndex:K,resetMs:Zt,onMatch:E=>{H&&E!==K&&i.set("activeIndex",E)},onTypingChange:j}),{getReferenceProps:ie,getFloatingProps:ye,getItemProps:Ie,getTriggerProps:Re}=xt([U,Z,g,z]),ge=n.useMemo(()=>{const E=qe(ie(),{onMouseMove(){i.set("allowMouseEnter",!0)}},re);return delete E.role,E},[ie,i,re]),be=n.useMemo(()=>{const E=Re();if(!E)return E;const D=qe(E,re);return delete D.role,delete D["aria-controls"],D},[Re,re]),Ge=n.useMemo(()=>ye({onMouseMove(){i.set("allowMouseEnter",!0),f.type==="menu"&&i.set("hoverEnabled",!1)},onClick(){i.select("hoverEnabled")&&i.set("hoverEnabled",!1)},onKeyDown(E){const D=i.select("keyboardEventRelay");D&&!E.isPropagationStopped()&&D(E)}}),[ye,f.type,i]),St=n.useMemo(()=>Ie(),[Ie]);i.useSyncedValues({floatingRootContext:ce,activeTriggerProps:ge,inactiveTriggerProps:be,popupProps:Ge,itemProps:St});const wt=n.useMemo(()=>({store:i,parent:s}),[i,s]),et=W.jsx(Mt.Provider,{value:wt,children:typeof o=="function"?o({payload:X}):o});return f.type===void 0||f.type==="context-menu"?W.jsx(en,{externalTree:y,children:et}):et});function mo(e){const t=e.getBoundingClientRect(),o=window.getComputedStyle(e,"::before"),c=window.getComputedStyle(e,"::after");if(!(o.content!=="none"||c.content!=="none"))return t;const x=parseFloat(o.width)||0,T=parseFloat(o.height)||0,r=parseFloat(c.width)||0,v=parseFloat(c.height)||0,C=Math.max(t.width,x,r),R=Math.max(t.height,T,v),m=C-t.width,O=R-t.height;return{left:t.left-m/2,right:t.right+m/2,top:t.top-O/2,bottom:t.bottom+O/2}}function xo(e){const{render:t,className:o,state:c=Ee,props:d=$e,refs:x=$e,metadata:T,stateAttributesMapping:r,tag:v="div",...C}=e,{compositeProps:R,compositeRef:m}=Hn({metadata:T});return Oe(v,e,{state:c,ref:[...x,m],props:[R,...d,C],stateAttributesMapping:r})}function Ot(e){if(Xe(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!pn(e))return Ot(gn(e))}function ho(e){const{enabled:t=!0,mouseDownAction:o,open:c}=e,d=n.useRef(!1);return n.useMemo(()=>t?{onMouseDown:x=>{(o==="open"&&!c||o==="close"&&c)&&(d.current=!0,Ue(x.currentTarget).addEventListener("click",()=>{d.current=!1},{once:!0}))},onClick:x=>{d.current&&(d.current=!1,x.preventBaseUIHandler())}}:Ee,[t,o,c])}const Ae=2,yo=tn(function(t,o){const{render:c,className:d,disabled:x=!1,nativeButton:T=!0,id:r,openOnHover:v,delay:C=100,closeDelay:R=0,handle:m,payload:O,...b}=t,M=Ce(!0),u=m?.store??M?.store;if(!u)throw new Error(Pe(85));const p=bt(r),h=u.useState("isTriggerActive",p),l=u.useState("floatingRootContext"),w=u.useState("isOpenedByTrigger",p),I=n.useRef(null),s=bo(),i=mn(!0),y=dt(),S=n.useMemo(()=>y??new gt,[y]),G=mt(S),H=Qe(),{registerTrigger:Y,isMountedByThisTrigger:B}=nn(p,I,u,{payload:O,closeDelay:R,parent:s,floatingTreeRoot:S,floatingNodeId:G,floatingParentNodeId:H,keyboardEventRelay:i?.relayKeyboardEvent}),L=s.type==="menubar",N=u.useState("disabled"),V=x||N||L&&s.context.disabled,{getButtonProps:q,buttonRef:f}=Rt({disabled:V,native:T});n.useEffect(()=>{!w&&s.type===void 0&&(u.context.allowMouseUpTriggerRef.current=!1)},[u,w,s.type]);const K=n.useRef(null),X=Te(),F=me(U=>{if(!K.current)return;X.clear(),u.context.allowMouseUpTriggerRef.current=!1;const Z=U.target;if(ve(K.current,Z)||ve(u.select("positionerElement"),Z)||Z===K.current||Z!=null&&Ot(Z)===u.select("rootId"))return;const a=mo(K.current);U.clientX>=a.left-Ae&&U.clientX<=a.right+Ae&&U.clientY>=a.top-Ae&&U.clientY<=a.bottom+Ae||S.events.emit("close",{domEvent:U,reason:xn})});n.useEffect(()=>{w&&u.select("lastOpenChangeReason")===Ke&&Ue(K.current).addEventListener("mouseup",F,{once:!0})},[w,F,u]);const J=L&&s.context.hasSubmenuOpen,oe=jn(l,{enabled:(v??J)&&!V&&s.type!=="context-menu"&&(!L||J&&!B),handleClose:Bn({blockPointerEvents:!L}),mouseOnly:!0,move:!1,restMs:s.type===void 0?C:void 0,delay:{close:R},triggerElementRef:I,externalTree:S,isActiveTrigger:h}),P=Ro(w,u.select("lastOpenChangeReason")),re=Vn(l,{enabled:!V&&s.type!=="context-menu",event:w&&L?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:s.type===void 0?P:!1}),xe=_n(l,{enabled:!V&&J}),ue=ho({open:w,enabled:L,mouseDownAction:"open"}),se=xt([re,xe]),le={disabled:V,open:w},ee=u.useState("triggerProps",B),_=[K,o,f,Y,I],A=[se.getReferenceProps(),oe??Ee,ee,{"aria-haspopup":"menu",id:p,onMouseDown:U=>{if(u.select("open"))return;X.start(200,()=>{u.context.allowMouseUpTriggerRef.current=!0}),Ue(U.currentTarget).addEventListener("mouseup",F,{once:!0})}},L?{role:"menuitem"}:{},ue,b,q],ae=n.useRef(null),de=me(U=>{ot.flushSync(()=>{u.setOpen(!1,ne(He,U.nativeEvent,U.currentTarget))}),on(ae.current)?.focus()}),pe=me(U=>{const Z=u.select("positionerElement");if(Z&&rn(U,Z))u.context.beforeContentFocusGuardRef.current?.focus();else{ot.flushSync(()=>{u.setOpen(!1,ne(He,U.nativeEvent,U.currentTarget))});let a=sn(u.context.triggerFocusTargetRef.current||I.current);for(;a!==null&&ve(Z,a);){const k=a;if(a=an(a),a===k)break}a?.focus()}}),ce=Oe("button",t,{enabled:!L,stateAttributesMapping:rt,state:le,ref:_,props:A});return L?W.jsx(xo,{tag:"button",render:c,className:d,state:le,refs:_,props:A,stateAttributesMapping:rt}):w?W.jsxs(n.Fragment,{children:[W.jsx(st,{ref:ae,onFocus:de},`${p}-pre-focus-guard`),W.jsx(n.Fragment,{children:ce},p),W.jsx(st,{ref:u.context.triggerFocusTargetRef,onFocus:pe},`${p}-post-focus-guard`)]}):W.jsx(n.Fragment,{children:ce},p)});function Ro(e,t){const o=Te(),[c,d]=n.useState(!1);return fe(()=>{e&&t==="trigger-hover"?(d(!0),o.start(cn,()=>{d(!1)})):e||(o.clear(),d(!1))},[e,t,o]),c}function bo(){const e=_e(!0),t=Ce(!0),o=Pt();return n.useMemo(()=>o?{type:"menubar",context:o}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,o])}function ko({children:e,...t}){return W.jsx(go,{...t,children:e})}function Fo({className:e,...t}){return W.jsx(yo,{className:Je(e),...t})}function No({className:e,side:t="bottom",align:o="end",children:c}){return W.jsx(io,{children:W.jsx(ao,{side:t,align:o,children:W.jsx(ro,{className:Je("min-w-[110px] rounded-lg bg-primary-50 p-1 text-sm text-primary-900 shadow-lg outline outline-primary-900/10",e),children:c})})})}function Ao({className:e,...t}){return W.jsx(eo,{className:Je("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-primary-900 hover:bg-primary-100 data-highlighted:bg-primary-100","select-none font-[450]",e),...t})}export{ko as M,Fo as a,No as b,Ao as c};
|
|
1
|
+
import{r as n,j as W,w as ot}from"./main-ZBMVSJTF.js";import{ab as Ee,ac as Pe,ad as qe,E as At,ag as Oe,C as Dt,ah as $e,c as Je}from"./button-DqP4GZwZ.js";import{u as Lt,a as Te,b as Me,c as Qe,d as dt,e as Ht,p as pt,t as Kt,F as Ut,D as jt,P as Bt,f as _t,R as Gt,g as Vt,h as Wt,i as gt,j as zt,k as $,l as Yt,m as qt,n as mt,o as $t,q as Xt,r as Jt,s as Qt,T as Zt,v as xt,w as en,x as tn,y as nn,z as on,A as rn,B as sn,C as an,E as rt,G as st,H as cn}from"./useOnFirstRender-DsFYFJoB.js";import{t as ht,g as ne,u as fe,a as me,l as De,i as Xe,j as He,k as yt,f as Rt,e as bt,o as un,m as Ke,s as Le,p as ln,q as it,r as fn,v as dn,w as pn,x as gn,b as mn,y as xn}from"./useBaseUiId-DLhdkHJl.js";import{e as at,F as hn,I as yn,i as Rn,f as bn,g as vn,h as Cn}from"./use-file-explorer-state-Dfyh4GwR.js";import{u as In}from"./DirectionContext-CQMv7g2N.js";import{i as ct,f as Tn,g as Mn,h as En,j as Pn,d as ut,o as Ue,e as ve,s as he,a as je,b as Se,c as we,k as On,l as Sn,m as wn,A as vt}from"./event-2_Dxdv7h.js";import{h as lt,g as We,a as ft,c as kn,i as ze,b as Fn,d as Nn,e as An,f as Fe,j as Dn,C as Ln,u as Hn}from"./useCompositeItem-DTSTTR0Z.js";import{u as Kn,e as Ct,f as Un,h as jn,i as Bn,j as _n}from"./tooltip-CekkGEYG.js";import{C as Gn}from"./composite-BLgu_EOL.js";function Vn(e,t={}){const o="rootStore"in e?e.rootStore:e,c=o.context.dataRef,{enabled:d=!0,event:x="click",toggle:T=!0,ignoreMouse:r=!1,stickIfOpen:v=!0,touchOpenDelay:C=0,reason:R=ht}=t,m=n.useRef(void 0),O=Lt(),b=Te(),M=n.useMemo(()=>({onPointerDown(u){m.current=u.pointerType},onMouseDown(u){const p=m.current,h=u.nativeEvent,l=o.select("open");if(u.button!==0||x==="click"||ct(p,!0)&&r)return;const w=c.current.openEvent,I=w?.type,s=o.select("domReferenceElement")!==u.currentTarget,i=l&&s||!(l&&T&&(!(w&&v)||I==="click"||I==="mousedown"));if(Mn(h.target)){const S=ne(R,h,h.target);i&&p==="touch"&&C>0?b.start(C,()=>{o.setOpen(!0,S)}):o.setOpen(i,S);return}const y=u.currentTarget;O.request(()=>{const S=ne(R,h,y);i&&p==="touch"&&C>0?b.start(C,()=>{o.setOpen(!0,S)}):o.setOpen(i,S)})},onClick(u){if(x==="mousedown-only")return;const p=m.current;if(x==="mousedown"&&p){m.current=void 0;return}if(ct(p,!0)&&r)return;const h=o.select("open"),l=c.current.openEvent,w=o.select("domReferenceElement")!==u.currentTarget,I=h&&w||!(h&&T&&(!(l&&v)||Tn(l))),s=ne(R,u.nativeEvent,u.currentTarget);I&&p==="touch"&&C>0?b.start(C,()=>{o.setOpen(!0,s)}):o.setOpen(I,s)},onKeyDown(){m.current=void 0}}),[c,x,r,o,v,T,O,b,C,R]);return n.useMemo(()=>d?{reference:M}:Ee,[d,M])}const Wn="Escape";function Be(e,t,o){switch(e){case"vertical":return t;case"horizontal":return o;default:return t||o}}function Ne(e,t){return Be(t,e===vt||e===je,e===Se||e===we)}function Ye(e,t,o){return Be(t,e===je,o?e===Se:e===we)||e==="Enter"||e===" "||e===""}function zn(e,t,o){return Be(t,o?e===Se:e===we,e===je)}function Yn(e,t,o,c){const d=o?e===we:e===Se,x=e===vt;return t==="both"||t==="horizontal"&&c&&c>1?e===Wn:Be(t,d,x)}function qn(e,t){const o="rootStore"in e?e.rootStore:e,c=o.useState("open"),d=o.useState("floatingElement"),x=o.useState("domReferenceElement"),T=o.context.dataRef,{listRef:r,activeIndex:v,onNavigate:C=()=>{},enabled:R=!0,selectedIndex:m=null,allowEscape:O=!1,loopFocus:b=!1,nested:M=!1,rtl:u=!1,virtual:p=!1,focusItemOnOpen:h="auto",focusItemOnHover:l=!0,openOnArrowKeyDown:w=!0,disabledIndices:I=void 0,orientation:s="vertical",parentOrientation:i,cols:y=1,id:S,resetOnPointerLeave:G=!0,externalTree:H}=t,Y=En(d),B=Me(Y),L=Qe(),N=dt(H);fe(()=>{T.current.orientation=s},[T,s]);const V=Pn(x),q=n.useRef(h),f=n.useRef(m??-1),K=n.useRef(null),X=n.useRef(!0),F=me(a=>{C(f.current===-1?null:f.current,a)}),J=n.useRef(F),Q=n.useRef(!!d),oe=n.useRef(c),P=n.useRef(!1),re=n.useRef(!1),xe=Me(I),ue=Me(c),se=Me(m),le=Me(G),ee=me(()=>{function a(z){p?N?.events.emit("virtualfocus",z):at(z,{sync:P.current,preventScroll:!0})}const k=r.current[f.current],g=re.current;k&&a(k),(P.current?z=>z():requestAnimationFrame)(()=>{const z=r.current[f.current]||k;if(!z)return;k||a(z),A&&(g||!X.current)&&z.scrollIntoView?.({block:"nearest",inline:"nearest"})})});fe(()=>{R&&(c&&d?(f.current=m??-1,q.current&&m!=null&&(re.current=!0,F())):Q.current&&(f.current=-1,J.current()))},[R,c,d,m,F]),fe(()=>{if(R){if(!c){P.current=!1;return}if(d)if(v==null){if(P.current=!1,se.current!=null)return;if(Q.current&&(f.current=-1,ee()),(!oe.current||!Q.current)&&q.current&&(K.current!=null||q.current===!0&&K.current==null)){let a=0;const k=()=>{r.current[0]==null?(a<2&&(a?requestAnimationFrame:queueMicrotask)(k),a+=1):(f.current=K.current==null||Ye(K.current,s,u)||M?We(r):ft(r),K.current=null,F())};k()}}else lt(r,v)||(f.current=v,ee(),re.current=!1)}},[R,c,d,v,se,M,r,s,u,F,ee,xe]),fe(()=>{if(!R||d||!N||p||!Q.current)return;const a=N.nodesRef.current,k=a.find(z=>z.id===L)?.context?.elements.floating,g=ut(Ue(d)),j=a.some(z=>z.context&&ve(z.context.elements.floating,g));k&&!j&&X.current&&k.focus({preventScroll:!0})},[R,d,N,L,p]),fe(()=>{J.current=F,oe.current=c,Q.current=!!d}),fe(()=>{c||(K.current=null,q.current=h)},[c,h]);const _=v!=null,A=n.useMemo(()=>{function a(g){if(!ue.current)return;const j=r.current.indexOf(g.currentTarget);j!==-1&&f.current!==j&&(f.current=j,F(g))}return{onFocus(g){P.current=!0,a(g)},onClick:({currentTarget:g})=>g.focus({preventScroll:!0}),onMouseMove(g){P.current=!0,re.current=!1,l&&a(g)},onPointerLeave(g){if(!ue.current||!X.current||g.pointerType==="touch")return;P.current=!0;const j=g.relatedTarget;!l||r.current.includes(j)||le.current&&(at(null,{sync:!0}),f.current=-1,F(g),p||B.current?.focus({preventScroll:!0}))}}},[ue,B,l,r,F,le,p]),ae=n.useCallback(()=>i??N?.nodesRef.current.find(a=>a.id===L)?.context?.dataRef?.current.orientation,[L,N,i]),de=me(a=>{if(X.current=!1,P.current=!0,a.which===229||!ue.current&&a.currentTarget===B.current)return;if(M&&Yn(a.key,s,u,y)){Ne(a.key,ae())||he(a),o.setOpen(!1,ne(De,a.nativeEvent)),Xe(x)&&(p?N?.events.emit("virtualfocus",x):x.focus());return}const k=f.current,g=We(r,I),j=ft(r,I);if(V||(a.key==="Home"&&(he(a),f.current=g,F(a)),a.key==="End"&&(he(a),f.current=j,F(a))),y>1){const z=Array.from({length:r.current.length},()=>({width:1,height:1})),ie=kn(z,y,!1),ye=ie.findIndex(ge=>ge!=null&&!ze(r,ge,I)),Ie=ie.reduce((ge,be,Ge)=>be!=null&&!ze(r,be,I)?Ge:ge,-1),Re=ie[Fn({current:ie.map(ge=>ge!=null?r.current[ge]:null)},{event:a,orientation:s,loopFocus:b,rtl:u,cols:y,disabledIndices:An([...(typeof I!="function"?I:null)||r.current.map((ge,be)=>ze(r,be,I)?be:void 0),void 0],ie),minIndex:ye,maxIndex:Ie,prevIndex:Nn(f.current>j?g:f.current,z,ie,y,a.key===je?"bl":a.key===(u?Se:we)?"tr":"tl"),stopEvent:!0})];if(Re!=null&&(f.current=Re,F(a)),s==="both")return}if(Ne(a.key,s)){if(he(a),c&&!p&&ut(a.currentTarget.ownerDocument)===a.currentTarget){f.current=Ye(a.key,s,u)?g:j,F(a);return}Ye(a.key,s,u)?b?k>=j?O&&k!==r.current.length?f.current=-1:(P.current=!1,f.current=g):f.current=Fe(r,{startingIndex:k,disabledIndices:I}):f.current=Math.min(j,Fe(r,{startingIndex:k,disabledIndices:I})):b?k<=g?O&&k!==-1?f.current=r.current.length:(P.current=!1,f.current=j):f.current=Fe(r,{startingIndex:k,decrement:!0,disabledIndices:I}):f.current=Math.max(g,Fe(r,{startingIndex:k,decrement:!0,disabledIndices:I})),lt(r,f.current)&&(f.current=-1),F(a)}}),pe=n.useMemo(()=>p&&c&&_&&{"aria-activedescendant":`${S}-${v}`},[p,c,_,S,v]),ce=n.useMemo(()=>({"aria-orientation":s==="both"?void 0:s,...V?{}:pe,onKeyDown(a){if(a.key==="Tab"&&a.shiftKey&&c&&!p){const k=On(a.nativeEvent);if(k&&!ve(B.current,k))return;he(a),o.setOpen(!1,ne(He,a.nativeEvent)),Xe(x)&&x.focus();return}de(a)},onPointerMove(){X.current=!0}}),[pe,de,B,s,V,o,c,p,x]),U=n.useMemo(()=>{function a(g){h==="auto"&&Sn(g.nativeEvent)&&(q.current=!p)}function k(g){q.current=h,h==="auto"&&wn(g.nativeEvent)&&(q.current=!0)}return{onKeyDown(g){const j=o.select("open");X.current=!1;const z=g.key.startsWith("Arrow"),ie=zn(g.key,ae(),u),ye=Ne(g.key,s),Ie=(M?ie:ye)||g.key==="Enter"||g.key.trim()==="";if(p&&j)return de(g);if(!(!j&&!w&&z)){if(Ie){const Re=Ne(g.key,ae());K.current=M&&Re?null:g.key}if(M){ie&&(he(g),j?(f.current=We(r,xe.current),F(g)):o.setOpen(!0,ne(De,g.nativeEvent,g.currentTarget)));return}ye&&(se.current!=null&&(f.current=se.current),he(g),!j&&w?o.setOpen(!0,ne(De,g.nativeEvent,g.currentTarget)):de(g),j&&F(g))}},onFocus(g){o.select("open")&&!p&&(f.current=-1,F(g))},onPointerDown:k,onPointerEnter:k,onMouseDown:a,onClick:a}},[de,xe,h,r,M,F,o,w,s,ae,u,se,p]),Z=n.useMemo(()=>({...pe,...U}),[pe,U]);return n.useMemo(()=>R?{reference:Z,floating:ce,item:A,trigger:U}:{},[R,Z,ce,U,A])}function $n(e,t){const o="rootStore"in e?e.rootStore:e,c=o.context.dataRef,d=o.useState("open"),{listRef:x,activeIndex:T,onMatch:r,onTypingChange:v,enabled:C=!0,resetMs:R=750,selectedIndex:m=null}=t,O=Te(),b=n.useRef(""),M=n.useRef(m??T??-1),u=n.useRef(null);fe(()=>{!d&&m!==null||(O.clear(),u.current=null,b.current!==""&&(b.current=""))},[d,m,O]),fe(()=>{d&&b.current===""&&(M.current=m??T??-1)},[d,m,T]);const p=me(s=>{s?c.current.typing||(c.current.typing=s,v?.(s)):c.current.typing&&(c.current.typing=s,v?.(s))}),h=me(s=>{function i(B,L,N){const V=L.find(q=>q?.toLocaleLowerCase().indexOf(N.toLocaleLowerCase())===0);return V?B.indexOf(V):-1}const y=x.current;if(b.current.length>0&&b.current[0]!==" "&&(i(y,y,b.current)===-1?p(!1):s.key===" "&&he(s)),y==null||s.key.length!==1||s.ctrlKey||s.metaKey||s.altKey)return;d&&s.key!==" "&&(he(s),p(!0));const S=b.current==="";S&&(M.current=m??T??-1),y.every(B=>B?B[0]?.toLocaleLowerCase()!==B[1]?.toLocaleLowerCase():!0)&&b.current===s.key&&(b.current="",M.current=u.current),b.current+=s.key,O.start(R,()=>{b.current="",M.current=u.current,p(!1)});const H=S?m??T??-1:M.current,Y=i(y,[...y.slice((H||0)+1),...y.slice(0,(H||0)+1)],b.current);Y!==-1?(r?.(Y),u.current=Y):s.key!==" "&&(b.current="",p(!1))}),l=me(s=>{const i=s.relatedTarget,y=o.select("domReferenceElement"),S=o.select("floatingElement"),G=ve(y,i),H=ve(S,i);G||H||(O.clear(),b.current="",M.current=u.current,p(!1))}),w=n.useMemo(()=>({onKeyDown:h,onBlur:l}),[h,l]),I=n.useMemo(()=>({onKeyDown:h,onKeyUp(s){s.key===" "&&p(!1)},onBlur:l}),[h,l,p]);return n.useMemo(()=>C?{reference:w,floating:I}:{},[C,w,I])}const It=n.createContext(void 0);function Tt(e){const t=n.useContext(It);if(t===void 0&&!e)throw new Error(Pe(33));return t}const Mt=n.createContext(void 0);function Ce(e){const t=n.useContext(Mt);if(t===void 0&&!e)throw new Error(Pe(36));return t}const Xn=n.createContext(void 0);function _e(e=!0){const t=n.useContext(Xn);if(t===void 0&&!e)throw new Error(Pe(25));return t}function Jn(e){const{closeOnClick:t,highlighted:o,id:c,nodeId:d,store:x,itemRef:T,itemMetadata:r}=e,{events:v}=x.useState("floatingTreeRoot"),C=_e(!0),R=C!==void 0;return n.useMemo(()=>({id:c,role:"menuitem",tabIndex:o?0:-1,onMouseMove(m){d&&v.emit("itemhover",{nodeId:d,target:m.currentTarget})},onClick(m){t&&v.emit("close",{domEvent:m,reason:yt})},onMouseUp(m){if(C){const O=C.initialCursorPointRef.current;if(C.initialCursorPointRef.current=null,R&&O&&Math.abs(m.clientX-O.x)<=1&&Math.abs(m.clientY-O.y)<=1)return}T.current&&x.context.allowMouseUpTriggerRef.current&&(!R||m.button===2)&&(!r||r.type==="regular-item")&&T.current.click()}}),[t,o,c,v,d,x,T,C,R,r])}const Qn={type:"regular-item"};function Zn(e){const{closeOnClick:t,disabled:o=!1,highlighted:c,id:d,store:x,nativeButton:T,itemMetadata:r,nodeId:v}=e,C=n.useRef(null),{getButtonProps:R,buttonRef:m}=Rt({disabled:o,focusableWhenDisabled:!0,native:T}),O=Jn({closeOnClick:t,highlighted:c,id:d,nodeId:v,store:x,itemRef:C,itemMetadata:r}),b=n.useCallback(u=>qe(O,{onMouseEnter(){r.type==="submenu-trigger"&&r.setActive()},onKeyUp(p){p.key===" "&&x.context.typingRef.current&&p.preventBaseUIHandler()}},u,R),[O,R,x,r]),M=At(C,m);return n.useMemo(()=>({getItemProps:b,itemRef:M}),[b,M])}const eo=n.forwardRef(function(t,o){const{render:c,className:d,id:x,label:T,nativeButton:r=!1,disabled:v=!1,closeOnClick:C=!0,...R}=t,m=Dn({label:T}),O=Tt(!0),b=bt(x),{store:M}=Ce(),u=M.useState("isActive",m.index),p=M.useState("itemProps"),{getItemProps:h,itemRef:l}=Zn({closeOnClick:C,disabled:v,highlighted:u,id:b,store:M,nativeButton:r,nodeId:O?.nodeId,itemMetadata:Qn});return Oe("div",t,{state:{disabled:v,highlighted:u},props:[p,R,h],ref:[l,o,m.ref]})}),to=n.createContext(void 0);function no(e){return n.useContext(to)}const oo={...pt,...Kt},ro=n.forwardRef(function(t,o){const{render:c,className:d,finalFocus:x,...T}=t,{store:r}=Ce(),{side:v,align:C}=Tt(),R=no()!=null,m=r.useState("open"),O=r.useState("transitionStatus"),b=r.useState("popupProps"),M=r.useState("mounted"),u=r.useState("instantType"),p=r.useState("activeTriggerElement"),h=r.useState("parent"),l=r.useState("lastOpenChangeReason"),w=r.useState("rootId"),I=r.useState("floatingRootContext"),s=r.useState("floatingTreeRoot"),i=r.useState("closeDelay"),y=r.useState("activeTriggerElement"),S=h.type==="context-menu";Ht({open:m,ref:r.context.popupRef,onComplete(){m&&r.context.onOpenChangeComplete?.(!0)}}),n.useEffect(()=>{function N(V){r.setOpen(!1,ne(V.reason,V.domEvent))}return s.events.on("close",N),()=>{s.events.off("close",N)}},[s.events,r]);const G=r.useState("hoverEnabled"),H=r.useState("disabled");Kn(I,{enabled:G&&!H&&!S&&h.type!=="menubar",closeDelay:i});const Y={transitionStatus:O,side:v,align:C,open:m,nested:h.type==="menu",instant:u},B=Oe("div",t,{state:Y,ref:[o,r.context.popupRef],stateAttributesMapping:oo,props:[b,{onKeyDown(N){R&&Gn.has(N.key)&&N.stopPropagation()}},Ct(O),T,{"data-rootownerid":w}]});let L=h.type===void 0||S;return(p||h.type==="menubar"&&l!==un)&&(L=!0),W.jsx(hn,{context:I,modal:S,disabled:!M,returnFocus:x===void 0?L:x,initialFocus:h.type!=="menu",restoreFocus:!0,externalTree:h.type!=="menubar"?s:void 0,previousFocusableElement:y,nextFocusableElement:h.type===void 0?r.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:h.type===void 0?r.context.beforeContentFocusGuardRef:void 0,children:B})}),Et=n.createContext(void 0);function so(){const e=n.useContext(Et);if(e===void 0)throw new Error(Pe(32));return e}const io=n.forwardRef(function(t,o){const{keepMounted:c=!1,...d}=t,{store:x}=Ce();return x.useState("mounted")||c?W.jsx(Et.Provider,{value:c,children:W.jsx(Ut,{ref:o,...d})}):null}),ao=n.forwardRef(function(t,o){const{anchor:c,positionMethod:d="absolute",className:x,render:T,side:r,align:v,sideOffset:C=0,alignOffset:R=0,collisionBoundary:m="clipping-ancestors",collisionPadding:O=5,arrowPadding:b=5,sticky:M=!1,disableAnchorTracking:u=!1,collisionAvoidance:p=jt,...h}=t,{store:l}=Ce(),w=so(),I=_e(!0),s=l.useState("parent"),i=l.useState("floatingRootContext"),y=l.useState("floatingTreeRoot"),S=l.useState("mounted"),G=l.useState("open"),H=l.useState("modal"),Y=l.useState("activeTriggerElement"),B=l.useState("transitionStatus"),L=l.useState("lastOpenChangeReason"),N=l.useState("floatingNodeId"),V=l.useState("floatingParentNodeId");let q=c,f=C,K=R,X=v,F=p;s.type==="context-menu"&&(q=c??s.context?.anchor,X=X??"start",!r&&X!=="center"&&(K=t.alignOffset??2,f=t.sideOffset??-5));let J=r,Q=X;s.type==="menu"?(J=J??"inline-end",Q=Q??"start",F=t.collisionAvoidance??Bt):s.type==="menubar"&&(J=J??"bottom",Q=Q??"start");const oe=s.type==="context-menu",P=Un({anchor:q,floatingRootContext:i,positionMethod:I?"fixed":d,mounted:S,side:J,sideOffset:f,align:Q,alignOffset:K,arrowPadding:oe?0:b,collisionBoundary:m,collisionPadding:O,sticky:M,nodeId:N,keepMounted:w,disableAnchorTracking:u,collisionAvoidance:F,shiftCrossAxis:oe&&!("side"in F&&F.side==="flip"),externalTree:y}),re=n.useMemo(()=>{const _={};return G||(_.pointerEvents="none"),{role:"presentation",hidden:!S,style:{...P.positionerStyles,..._}}},[G,S,P.positionerStyles]);n.useEffect(()=>{function _(A){A.open&&(A.parentNodeId===N&&l.set("hoverEnabled",!1),A.nodeId!==N&&A.parentNodeId===l.select("floatingParentNodeId")&&l.setOpen(!1,ne(Le)))}return y.events.on("menuopenchange",_),()=>{y.events.off("menuopenchange",_)}},[l,y.events,N]),n.useEffect(()=>{if(l.select("floatingParentNodeId")==null)return;function _(A){if(A.open||A.nodeId!==l.select("floatingParentNodeId"))return;const ae=A.reason??Le;l.setOpen(!1,ne(ae))}return y.events.on("menuopenchange",_),()=>{y.events.off("menuopenchange",_)}},[y.events,l]),n.useEffect(()=>{function _(A){!G||A.nodeId!==l.select("floatingParentNodeId")||A.target&&Y&&Y!==A.target&&l.setOpen(!1,ne(Le))}return y.events.on("itemhover",_),()=>{y.events.off("itemhover",_)}},[y.events,G,Y,l]),n.useEffect(()=>{const _={open:G,nodeId:N,parentNodeId:V,reason:l.select("lastOpenChangeReason")};y.events.emit("menuopenchange",_)},[y.events,G,l,N,V]);const xe={open:G,side:P.side,align:P.align,anchorHidden:P.anchorHidden,nested:s.type==="menu"},ue=n.useMemo(()=>({side:P.side,align:P.align,arrowRef:P.arrowRef,arrowUncentered:P.arrowUncentered,arrowStyles:P.arrowStyles,nodeId:P.context.nodeId}),[P.side,P.align,P.arrowRef,P.arrowUncentered,P.arrowStyles,P.context.nodeId]),se=Oe("div",t,{state:xe,stateAttributesMapping:pt,ref:[o,l.useStateSetter("positionerElement")],props:[re,Ct(B),h]}),le=S&&s.type!=="menu"&&(s.type!=="menubar"&&H&&L!==Ke||s.type==="menubar"&&s.context.modal);let ee=null;return s.type==="menubar"?ee=s.context.contentElement:s.type===void 0&&(ee=Y),W.jsxs(It.Provider,{value:ue,children:[le&&W.jsx(yn,{ref:s.type==="context-menu"||s.type==="nested-context-menu"?s.context.internalBackdropRef:null,inert:Rn(!G),cutout:ee}),W.jsx(_t,{id:N,children:W.jsx(Ln,{elementsRef:l.context.itemDomElements,labelsRef:l.context.itemLabels,children:se})})]})}),co=n.createContext(null);function Pt(e){return n.useContext(co)}const uo={...Wt,disabled:$(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:$(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:$(e=>e.allowMouseEnter),stickIfOpen:$(e=>e.stickIfOpen),parent:$(e=>e.parent),rootId:$(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:$(e=>e.activeIndex),isActive:$((e,t)=>e.activeIndex===t),hoverEnabled:$(e=>e.hoverEnabled),instantType:$(e=>e.instantType),lastOpenChangeReason:$(e=>e.openChangeReason),floatingTreeRoot:$(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:$(e=>e.floatingNodeId),floatingParentNodeId:$(e=>e.floatingParentNodeId),itemProps:$(e=>e.itemProps),closeDelay:$(e=>e.closeDelay),keyboardEventRelay:$(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class Ze extends Gt{constructor(t){super({...lo(),...t},{positionerRef:n.createRef(),popupRef:n.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:n.createRef(),beforeContentFocusGuardRef:n.createRef(),onOpenChangeComplete:void 0,triggerElements:new Vt},uo),this.unsubscribeParentListener=this.observe("parent",o=>{if(this.unsubscribeParentListener?.(),o.type==="menu"){this.unsubscribeParentListener=o.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=o.store.context.allowMouseUpTriggerRef;return}o.type!==void 0&&(this.context.allowMouseUpTriggerRef=o.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,o){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:o})}static useStore(t,o){const c=Dt(()=>new Ze(o)).current;return t??c}unsubscribeParentListener=null}function lo(){return{...zt(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new gt,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ee,keyboardEventRelay:void 0,closeDelay:0}}const fo=n.createContext(void 0);function po(){return n.useContext(fo)}const go=Yt(function(t){const{children:o,open:c,onOpenChange:d,onOpenChangeComplete:x,defaultOpen:T=!1,disabled:r=!1,modal:v,loopFocus:C=!0,orientation:R="vertical",actionsRef:m,closeParentOnEsc:O=!1,handle:b,triggerId:M,defaultTriggerId:u=null,highlightItemOnHover:p=!0}=t,h=_e(!0),l=Ce(!0),w=Pt(!0),I=po(),s=n.useMemo(()=>I&&l?{type:"menu",store:l.store}:w?{type:"menubar",context:w}:h&&!l?{type:"context-menu",context:h}:{type:void 0},[h,l,w,I]),i=Ze.useStore(b?.store,{open:T,openProp:c,activeTriggerId:u,triggerIdProp:M,parent:s});qt(()=>{c===void 0&&i.state.open===!1&&T===!0&&i.update({open:!0,activeTriggerId:u})}),i.useControlledProp("openProp",c),i.useControlledProp("triggerIdProp",M),i.useContextCallback("onOpenChangeComplete",x);const y=i.useState("floatingTreeRoot"),S=mt(y),G=Qe();fe(()=>{h&&!l?i.update({parent:{type:"context-menu",context:h},floatingNodeId:S,floatingParentNodeId:G}):l&&i.update({floatingNodeId:S,floatingParentNodeId:G})},[h,l,S,G,i]);const H=i.useState("open"),Y=i.useState("activeTriggerElement"),B=i.useState("positionerElement"),L=i.useState("hoverEnabled"),N=i.useState("modal"),V=i.useState("disabled"),q=i.useState("lastOpenChangeReason"),f=i.useState("parent"),K=i.useState("activeIndex"),X=i.useState("payload"),F=i.useState("floatingParentNodeId"),J=n.useRef(null),Q=F!=null;let oe;i.useSyncedValues({disabled:r,modal:f.type===void 0?v:void 0,rootId:ln()});const{openMethod:P,triggerProps:re,reset:xe}=bn(H);$t(i);const{forceUnmount:ue}=Xt(H,i,()=>{i.update({allowMouseEnter:!1,stickIfOpen:!0}),xe()}),se=n.useRef(f.type!=="context-menu"),le=Te();n.useEffect(()=>{if(H||(J.current=null),f.type==="context-menu"){if(!H){le.clear(),se.current=!1;return}le.start(500,()=>{se.current=!0})}},[le,H,f.type]),vn(H&&N&&q!==Ke&&P!=="touch",B),fe(()=>{!H&&!L&&i.set("hoverEnabled",!0)},[H,L,i]);const ee=n.useRef(!0),_=Te(),A=me((E,D)=>{const te=D.reason;if(H===E&&D.trigger===Y&&q===te||(D.preventUnmountOnClose=()=>{i.set("preventUnmountingOnClose",!0)},!E&&D.trigger==null&&(D.trigger=Y??void 0),d?.(E,D),D.isCanceled))return;const kt={open:E,nativeEvent:D.event,reason:D.reason,nested:Q};oe?.emit("openchange",kt);const ke=D.event;if(E===!1&&ke?.type==="click"&&ke.pointerType==="touch"&&!ee.current)return;if(!E&&K!==null){const Nt=i.context.itemDomElements.current[K];queueMicrotask(()=>{Nt?.setAttribute("tabindex","-1")})}E&&te===it?(ee.current=!1,_.start(300,()=>{ee.current=!0})):(ee.current=!0,_.clear());const tt=(te===ht||te===yt)&&ke.detail===0&&ke?.isTrusted,Ft=!E&&(te===fn||te==null),Ve={open:E,openChangeReason:te};J.current=D.event??null;const nt=D.trigger?.id??null;(nt||E)&&(Ve.activeTriggerId=nt,Ve.activeTriggerElement=D.trigger??null),i.update(Ve),f.type==="menubar"&&(te===it||te===He||te===Ke||te===De||te===Le)?i.set("instantType","group"):tt||Ft?i.set("instantType",tt?"click":"dismiss"):i.set("instantType",void 0)}),ae=n.useCallback(E=>{const D=ne(E);return D.preventUnmountOnClose=()=>{i.set("preventUnmountingOnClose",!0)},D},[i]),de=n.useCallback(()=>{i.setOpen(!1,ae(dn))},[i,ae]);n.useImperativeHandle(m,()=>({unmount:ue,close:de}),[ue,de]);let pe;f.type==="context-menu"&&(pe=f.context),n.useImperativeHandle(pe?.positionerRef,()=>B,[B]),n.useImperativeHandle(pe?.actionsRef,()=>({setOpen:A}),[A]);const ce=Jt({popupStore:i,onOpenChange:A});oe=ce.context.events,n.useEffect(()=>{const E=({open:D,eventDetails:te})=>A(D,te);return oe.on("setOpen",E),()=>{oe?.off("setOpen",E)}},[oe,A]);const U=Qt(ce,{enabled:!V,bubbles:{escapeKey:O&&f.type==="menu"},outsidePress(){return f.type!=="context-menu"||J.current?.type==="contextmenu"?!0:se.current},externalTree:Q?y:void 0}),Z=Cn(ce,{role:"menu"}),a=In(),k=n.useCallback(E=>{i.select("activeIndex")!==E&&i.set("activeIndex",E)},[i]),g=qn(ce,{enabled:!V,listRef:i.context.itemDomElements,activeIndex:K,nested:f.type!==void 0,loopFocus:C,orientation:R,parentOrientation:f.type==="menubar"?f.context.orientation:void 0,rtl:a==="rtl",disabledIndices:$e,onNavigate:k,openOnArrowKeyDown:f.type!=="context-menu",externalTree:Q?y:void 0,focusItemOnHover:p}),j=n.useCallback(E=>{i.context.typingRef.current=E},[i]),z=$n(ce,{listRef:i.context.itemLabels,activeIndex:K,resetMs:Zt,onMatch:E=>{H&&E!==K&&i.set("activeIndex",E)},onTypingChange:j}),{getReferenceProps:ie,getFloatingProps:ye,getItemProps:Ie,getTriggerProps:Re}=xt([U,Z,g,z]),ge=n.useMemo(()=>{const E=qe(ie(),{onMouseMove(){i.set("allowMouseEnter",!0)}},re);return delete E.role,E},[ie,i,re]),be=n.useMemo(()=>{const E=Re();if(!E)return E;const D=qe(E,re);return delete D.role,delete D["aria-controls"],D},[Re,re]),Ge=n.useMemo(()=>ye({onMouseMove(){i.set("allowMouseEnter",!0),f.type==="menu"&&i.set("hoverEnabled",!1)},onClick(){i.select("hoverEnabled")&&i.set("hoverEnabled",!1)},onKeyDown(E){const D=i.select("keyboardEventRelay");D&&!E.isPropagationStopped()&&D(E)}}),[ye,f.type,i]),St=n.useMemo(()=>Ie(),[Ie]);i.useSyncedValues({floatingRootContext:ce,activeTriggerProps:ge,inactiveTriggerProps:be,popupProps:Ge,itemProps:St});const wt=n.useMemo(()=>({store:i,parent:s}),[i,s]),et=W.jsx(Mt.Provider,{value:wt,children:typeof o=="function"?o({payload:X}):o});return f.type===void 0||f.type==="context-menu"?W.jsx(en,{externalTree:y,children:et}):et});function mo(e){const t=e.getBoundingClientRect(),o=window.getComputedStyle(e,"::before"),c=window.getComputedStyle(e,"::after");if(!(o.content!=="none"||c.content!=="none"))return t;const x=parseFloat(o.width)||0,T=parseFloat(o.height)||0,r=parseFloat(c.width)||0,v=parseFloat(c.height)||0,C=Math.max(t.width,x,r),R=Math.max(t.height,T,v),m=C-t.width,O=R-t.height;return{left:t.left-m/2,right:t.right+m/2,top:t.top-O/2,bottom:t.bottom+O/2}}function xo(e){const{render:t,className:o,state:c=Ee,props:d=$e,refs:x=$e,metadata:T,stateAttributesMapping:r,tag:v="div",...C}=e,{compositeProps:R,compositeRef:m}=Hn({metadata:T});return Oe(v,e,{state:c,ref:[...x,m],props:[R,...d,C],stateAttributesMapping:r})}function Ot(e){if(Xe(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!pn(e))return Ot(gn(e))}function ho(e){const{enabled:t=!0,mouseDownAction:o,open:c}=e,d=n.useRef(!1);return n.useMemo(()=>t?{onMouseDown:x=>{(o==="open"&&!c||o==="close"&&c)&&(d.current=!0,Ue(x.currentTarget).addEventListener("click",()=>{d.current=!1},{once:!0}))},onClick:x=>{d.current&&(d.current=!1,x.preventBaseUIHandler())}}:Ee,[t,o,c])}const Ae=2,yo=tn(function(t,o){const{render:c,className:d,disabled:x=!1,nativeButton:T=!0,id:r,openOnHover:v,delay:C=100,closeDelay:R=0,handle:m,payload:O,...b}=t,M=Ce(!0),u=m?.store??M?.store;if(!u)throw new Error(Pe(85));const p=bt(r),h=u.useState("isTriggerActive",p),l=u.useState("floatingRootContext"),w=u.useState("isOpenedByTrigger",p),I=n.useRef(null),s=bo(),i=mn(!0),y=dt(),S=n.useMemo(()=>y??new gt,[y]),G=mt(S),H=Qe(),{registerTrigger:Y,isMountedByThisTrigger:B}=nn(p,I,u,{payload:O,closeDelay:R,parent:s,floatingTreeRoot:S,floatingNodeId:G,floatingParentNodeId:H,keyboardEventRelay:i?.relayKeyboardEvent}),L=s.type==="menubar",N=u.useState("disabled"),V=x||N||L&&s.context.disabled,{getButtonProps:q,buttonRef:f}=Rt({disabled:V,native:T});n.useEffect(()=>{!w&&s.type===void 0&&(u.context.allowMouseUpTriggerRef.current=!1)},[u,w,s.type]);const K=n.useRef(null),X=Te(),F=me(U=>{if(!K.current)return;X.clear(),u.context.allowMouseUpTriggerRef.current=!1;const Z=U.target;if(ve(K.current,Z)||ve(u.select("positionerElement"),Z)||Z===K.current||Z!=null&&Ot(Z)===u.select("rootId"))return;const a=mo(K.current);U.clientX>=a.left-Ae&&U.clientX<=a.right+Ae&&U.clientY>=a.top-Ae&&U.clientY<=a.bottom+Ae||S.events.emit("close",{domEvent:U,reason:xn})});n.useEffect(()=>{w&&u.select("lastOpenChangeReason")===Ke&&Ue(K.current).addEventListener("mouseup",F,{once:!0})},[w,F,u]);const J=L&&s.context.hasSubmenuOpen,oe=jn(l,{enabled:(v??J)&&!V&&s.type!=="context-menu"&&(!L||J&&!B),handleClose:Bn({blockPointerEvents:!L}),mouseOnly:!0,move:!1,restMs:s.type===void 0?C:void 0,delay:{close:R},triggerElementRef:I,externalTree:S,isActiveTrigger:h}),P=Ro(w,u.select("lastOpenChangeReason")),re=Vn(l,{enabled:!V&&s.type!=="context-menu",event:w&&L?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:s.type===void 0?P:!1}),xe=_n(l,{enabled:!V&&J}),ue=ho({open:w,enabled:L,mouseDownAction:"open"}),se=xt([re,xe]),le={disabled:V,open:w},ee=u.useState("triggerProps",B),_=[K,o,f,Y,I],A=[se.getReferenceProps(),oe??Ee,ee,{"aria-haspopup":"menu",id:p,onMouseDown:U=>{if(u.select("open"))return;X.start(200,()=>{u.context.allowMouseUpTriggerRef.current=!0}),Ue(U.currentTarget).addEventListener("mouseup",F,{once:!0})}},L?{role:"menuitem"}:{},ue,b,q],ae=n.useRef(null),de=me(U=>{ot.flushSync(()=>{u.setOpen(!1,ne(He,U.nativeEvent,U.currentTarget))}),on(ae.current)?.focus()}),pe=me(U=>{const Z=u.select("positionerElement");if(Z&&rn(U,Z))u.context.beforeContentFocusGuardRef.current?.focus();else{ot.flushSync(()=>{u.setOpen(!1,ne(He,U.nativeEvent,U.currentTarget))});let a=sn(u.context.triggerFocusTargetRef.current||I.current);for(;a!==null&&ve(Z,a);){const k=a;if(a=an(a),a===k)break}a?.focus()}}),ce=Oe("button",t,{enabled:!L,stateAttributesMapping:rt,state:le,ref:_,props:A});return L?W.jsx(xo,{tag:"button",render:c,className:d,state:le,refs:_,props:A,stateAttributesMapping:rt}):w?W.jsxs(n.Fragment,{children:[W.jsx(st,{ref:ae,onFocus:de},`${p}-pre-focus-guard`),W.jsx(n.Fragment,{children:ce},p),W.jsx(st,{ref:u.context.triggerFocusTargetRef,onFocus:pe},`${p}-post-focus-guard`)]}):W.jsx(n.Fragment,{children:ce},p)});function Ro(e,t){const o=Te(),[c,d]=n.useState(!1);return fe(()=>{e&&t==="trigger-hover"?(d(!0),o.start(cn,()=>{d(!1)})):e||(o.clear(),d(!1))},[e,t,o]),c}function bo(){const e=_e(!0),t=Ce(!0),o=Pt();return n.useMemo(()=>o?{type:"menubar",context:o}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,o])}function ko({children:e,...t}){return W.jsx(go,{...t,children:e})}function Fo({className:e,...t}){return W.jsx(yo,{className:Je(e),...t})}function No({className:e,side:t="bottom",align:o="end",children:c}){return W.jsx(io,{children:W.jsx(ao,{side:t,align:o,children:W.jsx(ro,{className:Je("min-w-[110px] rounded-lg bg-primary-50 p-1 text-sm text-primary-900 shadow-lg outline outline-primary-900/10",e),children:c})})})}function Ao({className:e,...t}){return W.jsx(eo,{className:Je("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-primary-900 hover:bg-primary-100 data-highlighted:bg-primary-100","select-none font-[450]",e),...t})}export{ko as M,Fo as a,No as b,Ao as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./main-
|
|
1
|
+
import{j as t}from"./main-ZBMVSJTF.js";function a({className:e}){return t.jsx("div",{className:e,children:t.jsx("span",{className:"text-xl",children:"🦎"})})}function i({className:e}){return t.jsx("span",{className:e,style:{background:"linear-gradient(90deg, #10b981, #14b8a6, #06b6d4, #8b5cf6, #ec4899)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",fontWeight:600},children:"OpenCami"})}export{a as O,i as a};
|