morpheus-cli 0.9.20 → 0.9.23
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/dist/channels/discord.js +5 -0
- package/dist/channels/telegram.js +5 -0
- package/dist/http/api.js +3 -0
- package/dist/http/middleware/auth.js +2 -1
- package/dist/http/routers/display.js +38 -0
- package/dist/runtime/audit/repository.js +69 -1
- package/dist/runtime/chronos/worker.js +2 -0
- package/dist/runtime/display.js +49 -2
- package/dist/runtime/memory/sati/service.js +5 -0
- package/dist/runtime/oracle.js +5 -0
- package/dist/runtime/providers/factory.js +14 -2
- package/dist/runtime/smiths/delegator.js +3 -0
- package/dist/runtime/subagents/devkit-instrument.js +5 -0
- package/dist/runtime/subagents/link/link.js +120 -77
- package/dist/runtime/subagents/trinity/trinity.js +64 -34
- package/dist/runtime/tools/factory.js +6 -2
- package/dist/ui/assets/{AuditDashboard-Cu33zb_7.js → AuditDashboard-ClqEr7jg.js} +1 -1
- package/dist/ui/assets/{Chat-mt1j5V55.js → Chat-BwxZJphx.js} +7 -7
- package/dist/ui/assets/{Chronos-Bq_h41cw.js → Chronos-BafOMteb.js} +1 -1
- package/dist/ui/assets/{ConfirmationModal-CxLP8iC6.js → ConfirmationModal-DU0AwhXD.js} +1 -1
- package/dist/ui/assets/Dashboard-DvJb72Xe.js +4120 -0
- package/dist/ui/assets/{DeleteConfirmationModal-kZ_c3sFk.js → DeleteConfirmationModal-FSWLK6-I.js} +1 -1
- package/dist/ui/assets/{Documents-nlQNoUcq.js → Documents-D73CeGkW.js} +1 -1
- package/dist/ui/assets/{Logs-C1tlg574.js → Logs-BrFWnLIL.js} +1 -1
- package/dist/ui/assets/{MCPManager-Do7isizG.js → MCPManager-_L2Yo-uY.js} +1 -1
- package/dist/ui/assets/{ModelPricing-BeJ7oXBA.js → ModelPricing-CyXMdxJD.js} +1 -1
- package/dist/ui/assets/Notifications-BpHokTLS.js +1 -0
- package/dist/ui/assets/{Pagination-BHZKk42X.js → Pagination-D4ShqUKO.js} +1 -1
- package/dist/ui/assets/SatiMemories-CfSTgr9V.js +1 -0
- package/dist/ui/assets/{SelectInput-KVLsnfra.js → SelectInput-BPDcd3y7.js} +1 -1
- package/dist/ui/assets/{SessionAudit-Da1ySlYg.js → SessionAudit-pOWRgJtc.js} +1 -1
- package/dist/ui/assets/{Settings-DpXwpEhO.js → Settings-CPDXAk18.js} +1 -1
- package/dist/ui/assets/Skills-GIkCxMS3.js +7 -0
- package/dist/ui/assets/{Smiths-DA-x4KFT.js → Smiths-ZcHXcrMt.js} +1 -1
- package/dist/ui/assets/{Switch-CJTE4ZQm.js → Switch-C7TxLq0E.js} +1 -1
- package/dist/ui/assets/Tasks-DJ6R3d4f.js +1 -0
- package/dist/ui/assets/{TrinityDatabases-CoKzKTL-.js → TrinityDatabases-CnRAkDuu.js} +1 -1
- package/dist/ui/assets/{UsageStats-cds352Pj.js → UsageStats-Bl7bs4ay.js} +1 -1
- package/dist/ui/assets/{WebhookManager-DdAdHQUk.js → WebhookManager-CEjjk4tx.js} +2 -2
- package/dist/ui/assets/{agents-B1z_dlQC.js → agents-DO69pNM1.js} +1 -1
- package/dist/ui/assets/{audit-BAhaGrKY.js → audit-CP5fC4m8.js} +1 -1
- package/dist/ui/assets/{chronos-DGD_Md9M.js → chronos-DPhK718h.js} +1 -1
- package/dist/ui/assets/{config-BwTXe5M2.js → config-OLGQFNJL.js} +1 -1
- package/dist/ui/assets/{index-BcX5O7kY.js → index-B9ePr-vB.js} +3 -3
- package/dist/ui/assets/index-D_0tPLCk.css +1 -0
- package/dist/ui/assets/{mcp-BlkruPaA.js → mcp-BeBznKtK.js} +1 -1
- package/dist/ui/assets/{skills-CtCb-52u.js → skills-wEUxSGB3.js} +1 -1
- package/dist/ui/assets/{stats-BiPI2kaw.js → stats-KMbKDMJ-.js} +1 -1
- package/dist/ui/assets/{useCurrency-BCdG-pHx.js → useCurrency-Bgg-7MTE.js} +1 -1
- package/dist/ui/assets/vendor-icons-DE7PWdkN.js +1 -0
- package/dist/ui/assets/vendor-utils-BIYveU_1.js +39 -0
- package/dist/ui/index.html +4 -4
- package/dist/ui/sw.js +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/Dashboard-D0LAlHtG.js +0 -1
- package/dist/ui/assets/Notifications-Cg5CMlY0.js +0 -1
- package/dist/ui/assets/SatiMemories-D9l6s8Pc.js +0 -1
- package/dist/ui/assets/Skills-DaqCY8QH.js +0 -7
- package/dist/ui/assets/Tasks-DU49M9U-.js +0 -1
- package/dist/ui/assets/index-Cjli-AD7.css +0 -1
- package/dist/ui/assets/vendor-icons-NHF9HNeN.js +0 -1
- package/dist/ui/assets/vendor-utils-D4NnWbOU.js +0 -39
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import{a as zr,r as G,R as Ct}from"./vendor-react-DikRIOlj.js";var pt={exports:{}},ht={};var Ht;function Sr(){if(Ht)return ht;Ht=1;var e=zr();function t(p,f){return p===f&&(p!==0||1/p===1/f)||p!==p&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(p,f){var h=f(),k=r({inst:{value:h,getSnapshot:f}}),b=k[0].inst,$=k[1];return i(function(){b.value=h,b.getSnapshot=f,c(b)&&$({inst:b})},[p,h,f]),o(function(){return c(b)&&$({inst:b}),p(function(){c(b)&&$({inst:b})})},[p]),s(h),h}function c(p){var f=p.getSnapshot;p=p.value;try{var h=f();return!n(p,h)}catch{return!0}}function u(p,f){return f()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return ht.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,ht}var Yt;function $r(){return Yt||(Yt=1,pt.exports=Sr()),pt.exports}var Xt=$r();const xn=0,Rn=1,Tn=2,Qt=3;var en=Object.prototype.hasOwnProperty;function zt(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&zt(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(en.call(e,n)&&++r&&!en.call(t,n)||!(n in t)||!zt(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ge=new WeakMap,be=()=>{},q=be(),St=Object,O=e=>e===q,ue=e=>typeof e=="function",we=(e,t)=>({...e,...t}),Pn=e=>ue(e.then),mt={},He={},jt="undefined",Be=typeof window!=jt,$t=typeof document!=jt,Or=Be&&"Deno"in window,Er=()=>Be&&typeof window.requestAnimationFrame!=jt,In=(e,t)=>{const n=ge.get(e);return[()=>!O(t)&&e.get(t)||mt,r=>{if(!O(t)){const o=e.get(t);t in He||(He[t]=o),n[5](t,we(o,r),o||mt)}},n[6],()=>!O(t)&&t in He?He[t]:!O(t)&&e.get(t)||mt]};let Ot=!0;const Zr=()=>Ot,[Et,Zt]=Be&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[be,be],xr=()=>{const e=$t&&document.visibilityState;return O(e)||e!=="hidden"},Rr=e=>($t&&document.addEventListener("visibilitychange",e),Et("focus",e),()=>{$t&&document.removeEventListener("visibilitychange",e),Zt("focus",e)}),Tr=e=>{const t=()=>{Ot=!0,e()},n=()=>{Ot=!1};return Et("online",t),Et("offline",n),()=>{Zt("online",t),Zt("offline",n)}},Pr={isOnline:Zr,isVisible:xr},Ir={initFocus:Rr,initReconnect:Tr},tn=!Ct.useId,Ae=!Be||Or,Ar=e=>Er()?window.requestAnimationFrame(e):setTimeout(e,1),gt=Ae?G.useEffect:G.useLayoutEffect,bt=typeof navigator<"u"&&navigator.connection,nn=!Ae&&bt&&(["slow-2g","2g"].includes(bt.effectiveType)||bt.saveData),Ye=new WeakMap,Cr=e=>St.prototype.toString.call(e),vt=(e,t)=>e===`[object ${t}]`;let jr=0;const xt=e=>{const t=typeof e,n=Cr(e),r=vt(n,"Date"),o=vt(n,"RegExp"),i=vt(n,"Object");let s,a;if(St(e)===e&&!r&&!o){if(s=Ye.get(e),s)return s;if(s=++jr+"~",Ye.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=xt(e[a])+",";Ye.set(e,s)}if(i){s="#";const c=St.keys(e).sort();for(;!O(a=c.pop());)O(e[a])||(s+=a+":"+xt(e[a])+",");Ye.set(e,s)}}else s=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},Dt=e=>{if(ue(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?xt(e):"",[e,t]};let Dr=0;const Rt=()=>++Dr;async function An(...e){const[t,n,r,o]=e,i=we({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let c=i.optimisticData;const u=f=>typeof a=="function"?a(f):a!==!1,d=i.throwOnError;if(ue(n)){const f=n,h=[],k=t.keys();for(const b of k)!/^\$(inf|sub)\$/.test(b)&&f(t.get(b)._k)&&h.push(b);return Promise.all(h.map(p))}return p(n);async function p(f){const[h]=Dt(f);if(!h)return;const[k,b]=In(t,h),[$,K,w,j]=ge.get(t),x=()=>{const H=$[h];return(ue(i.revalidate)?i.revalidate(k().data,f):i.revalidate!==!1)&&(delete w[h],delete j[h],H&&H[0])?H[0](Tn).then(()=>k().data):k().data};if(e.length<3)return x();let S=r,F,V=!1;const _=Rt();K[h]=[_,0];const E=!O(c),de=k(),ee=de.data,oe=de._c,ie=O(oe)?ee:oe;if(E&&(c=ue(c)?c(ie,ee):c,b({data:c,_c:ie})),ue(S))try{S=S(ie)}catch(H){F=H,V=!0}if(S&&Pn(S))if(S=await S.catch(H=>{F=H,V=!0}),_!==K[h][0]){if(V)throw F;return S}else V&&E&&u(F)&&(s=!0,b({data:ie,_c:q}));if(s&&!V)if(ue(s)){const H=s(S,ie);b({data:H,error:q,_c:q})}else b({data:S,error:q,_c:q});if(K[h][1]=Rt(),Promise.resolve(x()).then(()=>{b({_c:q})}),V){if(d)throw F;return}return S}}const rn=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Nr=(e,t)=>{if(!ge.has(e)){const n=we(Ir,t),r=Object.create(null),o=An.bind(q,e);let i=be;const s=Object.create(null),a=(d,p)=>{const f=s[d]||[];return s[d]=f,f.push(p),()=>f.splice(f.indexOf(p),1)},c=(d,p,f)=>{e.set(d,p);const h=s[d];if(h)for(const k of h)k(p,f)},u=()=>{if(!ge.has(e)&&(ge.set(e,[r,Object.create(null),Object.create(null),Object.create(null),o,c,a]),!Ae)){const d=n.initFocus(setTimeout.bind(q,rn.bind(q,r,xn))),p=n.initReconnect(setTimeout.bind(q,rn.bind(q,r,Rn)));i=()=>{d&&d(),p&&p(),ge.delete(e)}}};return u(),[e,o,u,i]}return[e,ge.get(e)[4]]},Lr=(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!O(i)&&s>i||setTimeout(r,a,o)},Ur=zt,[Cn,Fr]=Nr(new Map),Mr=we({onLoadingSlow:be,onSuccess:be,onError:be,onErrorRetry:Lr,onDiscarded:be,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:nn?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:nn?5e3:3e3,compare:Ur,isPaused:()=>!1,cache:Cn,mutate:Fr,fallback:{}},Pr),Vr=(e,t)=>{const n=we(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=we(o,s))}return n},Jr=G.createContext({}),Wr="$inf$",jn=Be&&window.__SWR_DEVTOOLS_USE__,Gr=jn?window.__SWR_DEVTOOLS_USE__:[],Br=()=>{jn&&(window.__SWR_DEVTOOLS_REACT__=Ct)},qr=e=>ue(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Kr=()=>{const e=G.useContext(Jr);return G.useMemo(()=>we(Mr,e),[e])},Hr=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=Dt(t),[,,,a]=ge.get(Cn);if(s.startsWith(Wr))return n(...i);const c=a[s];return O(c)?n(...i):(delete a[s],c)}),r),Yr=Gr.concat(Hr),Xr=e=>function(...n){const r=Kr(),[o,i,s]=qr(n),a=Vr(r,s);let c=e;const{use:u}=a,d=(u||[]).concat(Yr);for(let p=d.length;p--;)c=d[p](c);return c(o,i||a.fetcher||null,a)},Qr=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};Br();const _t=Ct.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),wt={dedupe:!0},on=Promise.resolve(q),eo=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:c,refreshInterval:u,refreshWhenHidden:d,refreshWhenOffline:p,keepPreviousData:f,strictServerPrefetchWarning:h}=n,[k,b,$,K]=ge.get(r),[w,j]=Dt(e),x=G.useRef(!1),S=G.useRef(!1),F=G.useRef(w),V=G.useRef(t),_=G.useRef(n),E=()=>_.current,de=()=>E().isVisible()&&E().isOnline(),[ee,oe,ie,H]=In(r,w),te=G.useRef({}).current,Q=O(s)?O(n.fallback)?q:n.fallback[w]:s,ae=(T,C)=>{for(const N in te){const D=N;if(D==="data"){if(!o(T[D],C[D])&&(!O(T[D])||!o(ze,C[D])))return!1}else if(C[D]!==T[D])return!1}return!0},v=G.useMemo(()=>{const T=!w||!t?!1:O(a)?E().isPaused()||i?!1:c!==!1:a,C=Y=>{const pe=we(Y);return delete pe._k,T?{isValidating:!0,isLoading:!0,...pe}:pe},N=ee(),D=H(),se=C(N),Te=N===D?se:C(D);let W=se;return[()=>{const Y=C(ee());return ae(Y,W)?(W.data=Y.data,W.isLoading=Y.isLoading,W.isValidating=Y.isValidating,W.error=Y.error,W):(W=Y,Y)},()=>Te]},[r,w]),fe=Xt.useSyncExternalStore(G.useCallback(T=>ie(w,(C,N)=>{ae(N,C)||T()}),[r,w]),v[0],v[1]),Ue=!x.current,qe=k[w]&&k[w].length>0,ce=fe.data,I=O(ce)?Q&&Pn(Q)?_t(Q):Q:ce,J=fe.error,ve=G.useRef(I),ze=f?O(ce)?O(ve.current)?I:ve.current:ce:I,R=w&&O(I),Ke=!Ae&&Xt.useSyncExternalStore(()=>be,()=>!1,()=>!0);h&&Ke&&!i&&R&&console.warn(`Missing pre-initiated data for serialized key "${w}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Se=qe&&!O(J)?!1:Ue&&!O(a)?a:E().isPaused()?!1:i?O(I)?!1:c:O(I)||c,$e=!!(w&&t&&Ue&&Se),Fe=O(fe.isValidating)?$e:fe.isValidating,Re=O(fe.isLoading)?$e:fe.isLoading,Me=G.useCallback(async T=>{const C=V.current;if(!w||!C||S.current||E().isPaused())return!1;let N,D,se=!0;const Te=T||{},W=!$[w]||!Te.dedupe,Y=()=>tn?!S.current&&w===F.current&&x.current:w===F.current,pe={isValidating:!1,isLoading:!1},Bt=()=>{oe(pe)},qt=()=>{const ne=$[w];ne&&ne[1]===D&&delete $[w]},Kt={isValidating:!0};O(ee().data)&&(Kt.isLoading=!0);try{if(W&&(oe(Kt),n.loadingTimeout&&O(ee().data)&&setTimeout(()=>{se&&Y()&&E().onLoadingSlow(w,n)},n.loadingTimeout),$[w]=[C(j),Rt()]),[N,D]=$[w],N=await N,W&&setTimeout(qt,n.dedupingInterval),!$[w]||$[w][1]!==D)return W&&Y()&&E().onDiscarded(w),!1;pe.error=q;const ne=b[w];if(!O(ne)&&(D<=ne[0]||D<=ne[1]||ne[1]===0))return Bt(),W&&Y()&&E().onDiscarded(w),!1;const he=ee().data;pe.data=o(he,N)?he:N,W&&Y()&&E().onSuccess(N,w,n)}catch(ne){qt();const he=E(),{shouldRetryOnError:dt}=he;he.isPaused()||(pe.error=ne,W&&Y()&&(he.onError(ne,w,he),(dt===!0||ue(dt)&&dt(ne))&&(!E().revalidateOnFocus||!E().revalidateOnReconnect||de())&&he.onErrorRetry(ne,w,he,kr=>{const ft=k[w];ft&&ft[0]&&ft[0](Qt,kr)},{retryCount:(Te.retryCount||0)+1,dedupe:!0})))}return se=!1,Bt(),!0},[w,r]),Gt=G.useCallback((...T)=>An(r,F.current,...T),[]);if(gt(()=>{V.current=t,_.current=n,O(ce)||(ve.current=ce)}),gt(()=>{if(!w)return;const T=Me.bind(q,wt);let C=0;E().revalidateOnFocus&&(C=Date.now()+E().focusThrottleInterval);const D=Qr(w,k,(se,Te={})=>{if(se==xn){const W=Date.now();E().revalidateOnFocus&&W>C&&de()&&(C=W+E().focusThrottleInterval,T())}else if(se==Rn)E().revalidateOnReconnect&&de()&&T();else{if(se==Tn)return Me();if(se==Qt)return Me(Te)}});return S.current=!1,F.current=w,x.current=!0,oe({_k:j}),Se&&($[w]||(O(I)||Ae?T():Ar(T))),()=>{S.current=!0,D()}},[w]),gt(()=>{let T;function C(){const D=ue(u)?u(ee().data):u;D&&T!==-1&&(T=setTimeout(N,D))}function N(){!ee().error&&(d||E().isVisible())&&(p||E().isOnline())?Me(wt).then(C):C()}return C(),()=>{T&&(clearTimeout(T),T=-1)}},[u,d,p,w]),G.useDebugValue(ze),i){if(!tn&&Ae&&R)throw new Error("Fallback data is required when using Suspense in SSR.");R&&(V.current=t,_.current=n,S.current=!1);const T=K[w],C=!O(T)&&R?Gt(T):on;if(_t(C),!O(J)&&R)throw J;const N=R?Me(wt):on;!O(ze)&&R&&(N.status="fulfilled",N.value=!0),_t(N)}return{mutate:Gt,get data(){return te.data=!0,ze},get error(){return te.error=!0,J},get isValidating(){return te.isValidating=!0,Fe},get isLoading(){return te.isLoading=!0,Re}}},lu=Xr(eo);function Dn(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Dn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function du(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Dn(e))&&(r&&(r+=" "),r+=t);return r}const to=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},no=(e,t)=>({classGroupId:e,validator:t}),Nn=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rt="-",sn=[],ro="arbitrary..",oo=e=>{const t=io(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return so(s);const a=s.split(rt),c=a[0]===""&&a.length>1?1:0;return Ln(a,c,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const c=r[s],u=n[s];return c?u?to(u,c):c:u||sn}return n[s]||sn}}},Ln=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const u=Ln(e,t+1,i);if(u)return u}const s=n.validators;if(s===null)return;const a=t===0?e.join(rt):e.slice(t).join(rt),c=s.length;for(let u=0;u<c;u++){const d=s[u];if(d.validator(a))return d.classGroupId}},so=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?ro+r:void 0})(),io=e=>{const{theme:t,classGroups:n}=e;return ao(n,t)},ao=(e,t)=>{const n=Nn();for(const r in e){const o=e[r];Nt(o,n,r,t)}return n},Nt=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];co(s,t,n,r)}},co=(e,t,n,r)=>{if(typeof e=="string"){uo(e,t,n);return}if(typeof e=="function"){lo(e,t,n,r);return}fo(e,t,n,r)},uo=(e,t,n)=>{const r=e===""?t:Un(t,e);r.classGroupId=n},lo=(e,t,n,r)=>{if(po(e)){Nt(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(no(n,e))},fo=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,c]=o[s];Nt(c,Un(t,a),n,r)}},Un=(e,t)=>{let n=e;const r=t.split(rt),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=Nn(),n.nextPart.set(s,a)),n=a}return n},po=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ho=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(i,s)=>{n[i]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let s=n[i];if(s!==void 0)return s;if((s=r[i])!==void 0)return o(i,s),s},set(i,s){i in n?n[i]=s:o(i,s)}}},Tt="!",an=":",mo=[],cn=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),go=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,c=0,u;const d=o.length;for(let b=0;b<d;b++){const $=o[b];if(s===0&&a===0){if($===an){i.push(o.slice(c,b)),c=b+1;continue}if($==="/"){u=b;continue}}$==="["?s++:$==="]"?s--:$==="("?a++:$===")"&&a--}const p=i.length===0?o:o.slice(c);let f=p,h=!1;p.endsWith(Tt)?(f=p.slice(0,-1),h=!0):p.startsWith(Tt)&&(f=p.slice(1),h=!0);const k=u&&u>c?u-c:void 0;return cn(i,h,f,k)};if(t){const o=t+an,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):cn(mo,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},bo=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let i=0;i<n.length;i++){const s=n[i],a=s[0]==="[",c=t.has(s);a||c?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(s)):o.push(s)}return o.length>0&&(o.sort(),r.push(...o)),r}},vo=e=>({cache:ho(e.cacheSize),parseClassName:go(e),sortModifiers:bo(e),...oo(e)}),_o=/\s+/,wo=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(_o);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:p,modifiers:f,hasImportantModifier:h,baseClassName:k,maybePostfixModifierPosition:b}=n(d);if(p){c=d+(c.length>0?" "+c:c);continue}let $=!!b,K=r($?k.substring(0,b):k);if(!K){if(!$){c=d+(c.length>0?" "+c:c);continue}if(K=r(k),!K){c=d+(c.length>0?" "+c:c);continue}$=!1}const w=f.length===0?"":f.length===1?f[0]:i(f).join(":"),j=h?w+Tt:w,x=j+K;if(s.indexOf(x)>-1)continue;s.push(x);const S=o(K,$);for(let F=0;F<S.length;++F){const V=S[F];s.push(j+V)}c=d+(c.length>0?" "+c:c)}return c},yo=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Fn(n))&&(o&&(o+=" "),o+=r);return o},Fn=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Fn(e[r]))&&(n&&(n+=" "),n+=t);return n},ko=(e,...t)=>{let n,r,o,i;const s=c=>{const u=t.reduce((d,p)=>p(d),e());return n=vo(u),r=n.cache.get,o=n.cache.set,i=a,a(c)},a=c=>{const u=r(c);if(u)return u;const d=wo(c,n);return o(c,d),d};return i=s,(...c)=>i(yo(...c))},zo=[],M=e=>{const t=n=>n[e]||zo;return t.isThemeGetter=!0,t},Mn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Vn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,So=/^\d+\/\d+$/,$o=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Oo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Eo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Zo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pe=e=>So.test(e),z=e=>!!e&&!Number.isNaN(Number(e)),_e=e=>!!e&&Number.isInteger(Number(e)),yt=e=>e.endsWith("%")&&z(e.slice(0,-1)),me=e=>$o.test(e),Ro=()=>!0,To=e=>Oo.test(e)&&!Eo.test(e),Jn=()=>!1,Po=e=>Zo.test(e),Io=e=>xo.test(e),Ao=e=>!m(e)&&!g(e),Co=e=>De(e,Bn,Jn),m=e=>Mn.test(e),Oe=e=>De(e,qn,To),kt=e=>De(e,Uo,z),un=e=>De(e,Wn,Jn),jo=e=>De(e,Gn,Io),Xe=e=>De(e,Kn,Po),g=e=>Vn.test(e),Ve=e=>Ne(e,qn),Do=e=>Ne(e,Fo),ln=e=>Ne(e,Wn),No=e=>Ne(e,Bn),Lo=e=>Ne(e,Gn),Qe=e=>Ne(e,Kn,!0),De=(e,t,n)=>{const r=Mn.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ne=(e,t,n=!1)=>{const r=Vn.exec(e);return r?r[1]?t(r[1]):n:!1},Wn=e=>e==="position"||e==="percentage",Gn=e=>e==="image"||e==="url",Bn=e=>e==="length"||e==="size"||e==="bg-size",qn=e=>e==="length",Uo=e=>e==="number",Fo=e=>e==="family-name",Kn=e=>e==="shadow",Mo=()=>{const e=M("color"),t=M("font"),n=M("text"),r=M("font-weight"),o=M("tracking"),i=M("leading"),s=M("breakpoint"),a=M("container"),c=M("spacing"),u=M("radius"),d=M("shadow"),p=M("inset-shadow"),f=M("text-shadow"),h=M("drop-shadow"),k=M("blur"),b=M("perspective"),$=M("aspect"),K=M("ease"),w=M("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...x(),g,m],F=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],_=()=>[g,m,c],E=()=>[Pe,"full","auto",..._()],de=()=>[_e,"none","subgrid",g,m],ee=()=>["auto",{span:["full",_e,g,m]},_e,g,m],oe=()=>[_e,"auto",g,m],ie=()=>["auto","min","max","fr",g,m],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",..._()],ae=()=>[Pe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],v=()=>[e,g,m],fe=()=>[...x(),ln,un,{position:[g,m]}],Ue=()=>["no-repeat",{repeat:["","x","y","space","round"]}],qe=()=>["auto","cover","contain",No,Co,{size:[g,m]}],ce=()=>[yt,Ve,Oe],I=()=>["","none","full",u,g,m],J=()=>["",z,Ve,Oe],ve=()=>["solid","dashed","dotted","double"],ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>[z,yt,ln,un],Ke=()=>["","none",k,g,m],Se=()=>["none",z,g,m],$e=()=>["none",z,g,m],Fe=()=>[z,g,m],Re=()=>[Pe,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[me],breakpoint:[me],color:[Ro],container:[me],"drop-shadow":[me],ease:["in","out","in-out"],font:[Ao],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[me],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[me],shadow:[me],spacing:["px",z],text:[me],"text-shadow":[me],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pe,m,g,$]}],container:["container"],columns:[{columns:[z,m,g,a]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{start:E()}],end:[{end:E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[_e,"auto",g,m]}],basis:[{basis:[Pe,"full","auto",a,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[z,Pe,"auto","initial","none",m]}],grow:[{grow:["",z,g,m]}],shrink:[{shrink:["",z,g,m]}],order:[{order:[_e,"first","last","none",g,m]}],"grid-cols":[{"grid-cols":de()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":de()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:ae()}],w:[{w:[a,"screen",...ae()]}],"min-w":[{"min-w":[a,"screen","none",...ae()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...ae()]}],h:[{h:["screen","lh",...ae()]}],"min-h":[{"min-h":["screen","lh","none",...ae()]}],"max-h":[{"max-h":["screen","lh",...ae()]}],"font-size":[{text:["base",n,Ve,Oe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,g,kt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yt,m]}],"font-family":[{font:[Do,m,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,g,m]}],"line-clamp":[{"line-clamp":[z,"none",g,kt]}],leading:[{leading:[i,..._()]}],"list-image":[{"list-image":["none",g,m]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",g,m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:v()}],"text-color":[{text:v()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[z,"from-font","auto",g,Oe]}],"text-decoration-color":[{decoration:v()}],"underline-offset":[{"underline-offset":[z,"auto",g,m]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",g,m]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",g,m]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:fe()}],"bg-repeat":[{bg:Ue()}],"bg-size":[{bg:qe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},_e,g,m],radial:["",g,m],conic:[_e,g,m]},Lo,jo]}],"bg-color":[{bg:v()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:v()}],"gradient-via":[{via:v()}],"gradient-to":[{to:v()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:v()}],"border-color-x":[{"border-x":v()}],"border-color-y":[{"border-y":v()}],"border-color-s":[{"border-s":v()}],"border-color-e":[{"border-e":v()}],"border-color-t":[{"border-t":v()}],"border-color-r":[{"border-r":v()}],"border-color-b":[{"border-b":v()}],"border-color-l":[{"border-l":v()}],"divide-color":[{divide:v()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[z,g,m]}],"outline-w":[{outline:["",z,Ve,Oe]}],"outline-color":[{outline:v()}],shadow:[{shadow:["","none",d,Qe,Xe]}],"shadow-color":[{shadow:v()}],"inset-shadow":[{"inset-shadow":["none",p,Qe,Xe]}],"inset-shadow-color":[{"inset-shadow":v()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:v()}],"ring-offset-w":[{"ring-offset":[z,Oe]}],"ring-offset-color":[{"ring-offset":v()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":v()}],"text-shadow":[{"text-shadow":["none",f,Qe,Xe]}],"text-shadow-color":[{"text-shadow":v()}],opacity:[{opacity:[z,g,m]}],"mix-blend":[{"mix-blend":[...ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ze()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[z]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":v()}],"mask-image-linear-to-color":[{"mask-linear-to":v()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":v()}],"mask-image-t-to-color":[{"mask-t-to":v()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":v()}],"mask-image-r-to-color":[{"mask-r-to":v()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":v()}],"mask-image-b-to-color":[{"mask-b-to":v()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":v()}],"mask-image-l-to-color":[{"mask-l-to":v()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":v()}],"mask-image-x-to-color":[{"mask-x-to":v()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":v()}],"mask-image-y-to-color":[{"mask-y-to":v()}],"mask-image-radial":[{"mask-radial":[g,m]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":v()}],"mask-image-radial-to-color":[{"mask-radial-to":v()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[z]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":v()}],"mask-image-conic-to-color":[{"mask-conic-to":v()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:fe()}],"mask-repeat":[{mask:Ue()}],"mask-size":[{mask:qe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",g,m]}],filter:[{filter:["","none",g,m]}],blur:[{blur:Ke()}],brightness:[{brightness:[z,g,m]}],contrast:[{contrast:[z,g,m]}],"drop-shadow":[{"drop-shadow":["","none",h,Qe,Xe]}],"drop-shadow-color":[{"drop-shadow":v()}],grayscale:[{grayscale:["",z,g,m]}],"hue-rotate":[{"hue-rotate":[z,g,m]}],invert:[{invert:["",z,g,m]}],saturate:[{saturate:[z,g,m]}],sepia:[{sepia:["",z,g,m]}],"backdrop-filter":[{"backdrop-filter":["","none",g,m]}],"backdrop-blur":[{"backdrop-blur":Ke()}],"backdrop-brightness":[{"backdrop-brightness":[z,g,m]}],"backdrop-contrast":[{"backdrop-contrast":[z,g,m]}],"backdrop-grayscale":[{"backdrop-grayscale":["",z,g,m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[z,g,m]}],"backdrop-invert":[{"backdrop-invert":["",z,g,m]}],"backdrop-opacity":[{"backdrop-opacity":[z,g,m]}],"backdrop-saturate":[{"backdrop-saturate":[z,g,m]}],"backdrop-sepia":[{"backdrop-sepia":["",z,g,m]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",g,m]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[z,"initial",g,m]}],ease:[{ease:["linear","initial",K,g,m]}],delay:[{delay:[z,g,m]}],animate:[{animate:["none",w,g,m]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,g,m]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:$e()}],"scale-x":[{"scale-x":$e()}],"scale-y":[{"scale-y":$e()}],"scale-z":[{"scale-z":$e()}],"scale-3d":["scale-3d"],skew:[{skew:Fe()}],"skew-x":[{"skew-x":Fe()}],"skew-y":[{"skew-y":Fe()}],transform:[{transform:[g,m,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Re()}],"translate-x":[{"translate-x":Re()}],"translate-y":[{"translate-y":Re()}],"translate-z":[{"translate-z":Re()}],"translate-none":["translate-none"],accent:[{accent:v()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:v()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",g,m]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",g,m]}],fill:[{fill:["none",...v()]}],"stroke-w":[{stroke:[z,Ve,Oe,kt]}],stroke:[{stroke:["none",...v()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},fu=ko(Mo);function l(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=s.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){const f=d[p];f in a||(a[f]=u[f].bind(a))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var c;const u=n?.Parent?new i:this;r(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class Ce extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Hn extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Yn={};function Ee(e){return Yn}function Xn(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Pt(e,t){return typeof t=="bigint"?t.toString():t}function Lt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ut(e){return e==null}function Ft(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const dn=Symbol("evaluating");function Z(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==dn)return r===void 0&&(r=dn,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function xe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ye(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function fn(e){return JSON.stringify(e)}function Vo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Qn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ot(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Jo=Lt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function We(e){if(ot(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ot(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function er(e){return We(e)?{...e}:Array.isArray(e)?[...e]:e}const Wo=new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ke(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function y(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Go(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function Bo(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=ye(e._zod.def,{get shape(){const s={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=n.shape[a])}return xe(this,"shape",s),s},checks:[]});return ke(e,i)}function qo(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=ye(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return xe(this,"shape",s),s},checks:[]});return ke(e,i)}function Ko(e,t){if(!We(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=ye(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return xe(this,"shape",i),i}});return ke(e,o)}function Ho(e,t){if(!We(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ye(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return xe(this,"shape",r),r}});return ke(e,n)}function Yo(e,t){const n=ye(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return xe(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return ke(e,n)}function Xo(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=ye(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return xe(this,"shape",c),c},checks:[]});return ke(t,s)}function Qo(e,t,n){const r=ye(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(const s in o)i[s]=new e({type:"nonoptional",innerType:o[s]});return xe(this,"shape",i),i}});return ke(t,r)}function Ie(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function tr(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function et(e){return typeof e=="string"?e:e?.message}function Ze(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=et(e.inst?._zod.def?.error?.(e))??et(t?.error?.(e))??et(n.customError?.(e))??et(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Mt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ge(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const nr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Pt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},rr=l("$ZodError",nr),or=l("$ZodError",nr,{Parent:Error});function es(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function ts(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>r({issues:s}));else if(i.code==="invalid_key")r({issues:i.issues});else if(i.code==="invalid_element")r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let s=n,a=0;for(;a<i.path.length;){const c=i.path[a];a===i.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(i))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return r(e),n}const Vt=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Ce;if(s.issues.length){const a=new(o?.Err??e)(s.issues.map(c=>Ze(c,i,Ee())));throw Qn(a,o?.callee),a}return s.value},Jt=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new(o?.Err??e)(s.issues.map(c=>Ze(c,i,Ee())));throw Qn(a,o?.callee),a}return s.value},ct=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Ce;return i.issues.length?{success:!1,error:new(e??rr)(i.issues.map(s=>Ze(s,o,Ee())))}:{success:!0,data:i.value}},ns=ct(or),ut=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Ze(s,o,Ee())))}:{success:!0,data:i.value}},rs=ut(or),os=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Vt(e)(t,n,o)},ss=e=>(t,n,r)=>Vt(e)(t,n,r),is=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Jt(e)(t,n,o)},as=e=>async(t,n,r)=>Jt(e)(t,n,r),cs=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ct(e)(t,n,o)},us=e=>(t,n,r)=>ct(e)(t,n,r),ls=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ut(e)(t,n,o)},ds=e=>async(t,n,r)=>ut(e)(t,n,r),fs=/^[cC][^\s-]{8,}$/,ps=/^[0-9a-z]+$/,hs=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ms=/^[0-9a-vA-V]{20}$/,gs=/^[A-Za-z0-9]{27}$/,bs=/^[a-zA-Z0-9_-]{21}$/,vs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_s=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,pn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ws=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ys="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ks(){return new RegExp(ys,"u")}const zs=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ss=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,$s=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Os=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Es=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sr=/^[A-Za-z0-9_-]*$/,Zs=/^\+[1-9]\d{6,14}$/,ir="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",xs=new RegExp(`^${ir}$`);function ar(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Rs(e){return new RegExp(`^${ar(e)}$`)}function Ts(e){const t=ar({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${ir}T(?:${r})$`)}const Ps=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Is=/^[^A-Z]*$/,As=/^[^a-z]*$/,le=l("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Cs=l("$ZodCheckMaxLength",(e,t)=>{var n;le.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ut(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const s=Mt(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),js=l("$ZodCheckMinLength",(e,t)=>{var n;le.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ut(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const s=Mt(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ds=l("$ZodCheckLengthEquals",(e,t)=>{var n;le.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ut(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const s=Mt(o),a=i>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),lt=l("$ZodCheckStringFormat",(e,t)=>{var n,r;le.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ns=l("$ZodCheckRegex",(e,t)=>{lt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ls=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Is),lt.init(e,t)}),Us=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=As),lt.init(e,t)}),Fs=l("$ZodCheckIncludes",(e,t)=>{le.init(e,t);const n=je(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Ms=l("$ZodCheckStartsWith",(e,t)=>{le.init(e,t);const n=new RegExp(`^${je(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Vs=l("$ZodCheckEndsWith",(e,t)=>{le.init(e,t);const n=new RegExp(`.*${je(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Js=l("$ZodCheckOverwrite",(e,t)=>{le.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Ws{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
2
|
+
`).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,o.join(`
|
|
3
|
+
`))}}const Gs={major:4,minor:3,patch:6},L=l("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Gs;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const i of o._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(s,a,c)=>{let u=Ie(s),d;for(const p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(u)continue;const f=s.issues.length,h=p._zod.check(s);if(h instanceof Promise&&c?.async===!1)throw new Ce;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,s.issues.length!==f&&(u||(u=Ie(s,f)))});else{if(s.issues.length===f)continue;u||(u=Ie(s,f))}}return d?d.then(()=>s):s},i=(s,a,c)=>{if(Ie(s))return s.aborted=!0,s;const u=o(a,r,c);if(u instanceof Promise){if(c.async===!1)throw new Ce;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){const u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(d=>i(d,s,a)):i(u,s,a)}const c=e._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new Ce;return c.then(u=>o(u,r,a))}return o(c,r,a)}}Z(e,"~standard",()=>({validate:o=>{try{const i=ns(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return rs(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Wt=l("$ZodString",(e,t)=>{L.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ps(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),P=l("$ZodStringFormat",(e,t)=>{lt.init(e,t),Wt.init(e,t)}),Bs=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=_s),P.init(e,t)}),qs=l("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=pn(r))}else t.pattern??(t.pattern=pn());P.init(e,t)}),Ks=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ws),P.init(e,t)}),Hs=l("$ZodURL",(e,t)=>{P.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ys=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ks()),P.init(e,t)}),Xs=l("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=bs),P.init(e,t)}),Qs=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=fs),P.init(e,t)}),ei=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ps),P.init(e,t)}),ti=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=hs),P.init(e,t)}),ni=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ms),P.init(e,t)}),ri=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=gs),P.init(e,t)}),oi=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ts(t)),P.init(e,t)}),si=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=xs),P.init(e,t)}),ii=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Rs(t)),P.init(e,t)}),ai=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=vs),P.init(e,t)}),ci=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=zs),P.init(e,t),e._zod.bag.format="ipv4"}),ui=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ss),P.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),li=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=$s),P.init(e,t)}),di=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Os),P.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,i]=r;if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function cr(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const fi=l("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Es),P.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{cr(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function pi(e){if(!sr.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return cr(n)}const hi=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=sr),P.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{pi(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),mi=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Zs),P.init(e,t)});function gi(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const bi=l("$ZodJWT",(e,t)=>{P.init(e,t),e._zod.check=n=>{gi(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),vi=l("$ZodUnknown",(e,t)=>{L.init(e,t),e._zod.parse=n=>n}),_i=l("$ZodNever",(e,t)=>{L.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function hn(e,t,n){e.issues.length&&t.issues.push(...tr(n,e.issues)),t.value[n]=e.value}const wi=l("$ZodArray",(e,t)=>{L.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let s=0;s<o.length;s++){const a=o[s],c=t.element._zod.run({value:a,issues:[]},r);c instanceof Promise?i.push(c.then(u=>hn(u,n,s))):hn(c,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function st(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...tr(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function ur(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=Go(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function lr(e,t,n,r,o,i){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type,d=c.optout==="optional";for(const p in t){if(a.has(p))continue;if(u==="never"){s.push(p);continue}const f=c.run({value:t[p],issues:[]},r);f instanceof Promise?e.push(f.then(h=>st(h,n,p,t,d))):st(f,n,p,t,d)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const yi=l("$ZodObject",(e,t)=>{if(L.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Lt(()=>ur(t));Z(e._zod,"propValues",()=>{const a=t.shape,c={};for(const u in a){const d=a[u]._zod;if(d.values){c[u]??(c[u]=new Set);for(const p of d.values)c[u].add(p)}}return c});const o=ot,i=t.catchall;let s;e._zod.parse=(a,c)=>{s??(s=r.value);const u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const d=[],p=s.shape;for(const f of s.keys){const h=p[f],k=h._zod.optout==="optional",b=h._zod.run({value:u[f],issues:[]},c);b instanceof Promise?d.push(b.then($=>st($,a,f,u,k))):st(b,a,f,u,k)}return i?lr(d,u,a,c,r.value,e):d.length?Promise.all(d).then(()=>a):a}}),ki=l("$ZodObjectJIT",(e,t)=>{yi.init(e,t);const n=e._zod.parse,r=Lt(()=>ur(t)),o=f=>{const h=new Ws(["shape","payload","ctx"]),k=r.value,b=j=>{const x=fn(j);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};h.write("const input = payload.value;");const $=Object.create(null);let K=0;for(const j of k.keys)$[j]=`key_${K++}`;h.write("const newResult = {};");for(const j of k.keys){const x=$[j],S=fn(j),V=f[j]?._zod?.optout==="optional";h.write(`const ${x} = ${b(j)};`),V?h.write(`
|
|
4
|
+
if (${x}.issues.length) {
|
|
5
|
+
if (${S} in input) {
|
|
6
|
+
payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
|
|
7
|
+
...iss,
|
|
8
|
+
path: iss.path ? [${S}, ...iss.path] : [${S}]
|
|
9
|
+
})));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (${x}.value === undefined) {
|
|
14
|
+
if (${S} in input) {
|
|
15
|
+
newResult[${S}] = undefined;
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
newResult[${S}] = ${x}.value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
`):h.write(`
|
|
22
|
+
if (${x}.issues.length) {
|
|
23
|
+
payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
|
|
24
|
+
...iss,
|
|
25
|
+
path: iss.path ? [${S}, ...iss.path] : [${S}]
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (${x}.value === undefined) {
|
|
30
|
+
if (${S} in input) {
|
|
31
|
+
newResult[${S}] = undefined;
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
newResult[${S}] = ${x}.value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");const w=h.compile();return(j,x)=>w(f,j,x)};let i;const s=ot,a=!Yn.jitless,u=a&&Jo.value,d=t.catchall;let p;e._zod.parse=(f,h)=>{p??(p=r.value);const k=f.value;return s(k)?a&&u&&h?.async===!1&&h.jitless!==!0?(i||(i=o(t.shape)),f=i(f,h),d?lr([],k,f,h,p,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),f)}});function mn(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!Ie(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>Ze(s,r,Ee())))}),t)}const zi=l("$ZodUnion",(e,t)=>{L.init(e,t),Z(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Z(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Z(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Z(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Ft(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:o.value,issues:[]},i);if(u instanceof Promise)a.push(u),s=!0;else{if(u.issues.length===0)return u;a.push(u)}}return s?Promise.all(a).then(c=>mn(c,o,e,i)):mn(a,o,e,i)}}),Si=l("$ZodIntersection",(e,t)=>{L.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>gn(n,c,u)):gn(n,i,s)}});function It(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(We(e)&&We(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const s=It(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],s=It(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function gn(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&o&&e.issues.push({...o,keys:i}),Ie(e))return e;const s=It(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const $i=l("$ZodEnum",(e,t)=>{L.init(e,t);const n=Xn(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>Wo.has(typeof o)).map(o=>typeof o=="string"?je(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:n,input:s,inst:e}),o}}),Oi=l("$ZodLiteral",(e,t)=>{if(L.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?je(r):r?je(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),Ei=l("$ZodTransform",(e,t)=>{L.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Hn(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n));if(o instanceof Promise)throw new Ce;return n.value=o,n}});function bn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const dr=l("$ZodOptional",(e,t)=>{L.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Z(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Z(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ft(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>bn(i,n.value)):bn(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Zi=l("$ZodExactOptional",(e,t)=>{dr.init(e,t),Z(e._zod,"values",()=>t.innerType._zod.values),Z(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),xi=l("$ZodNullable",(e,t)=>{L.init(e,t),Z(e._zod,"optin",()=>t.innerType._zod.optin),Z(e._zod,"optout",()=>t.innerType._zod.optout),Z(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ft(n.source)}|null)$`):void 0}),Z(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Ri=l("$ZodDefault",(e,t)=>{L.init(e,t),e._zod.optin="optional",Z(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>vn(i,t)):vn(o,t)}});function vn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ti=l("$ZodPrefault",(e,t)=>{L.init(e,t),e._zod.optin="optional",Z(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Pi=l("$ZodNonOptional",(e,t)=>{L.init(e,t),Z(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>_n(i,e)):_n(o,e)}});function _n(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ii=l("$ZodCatch",(e,t)=>{L.init(e,t),Z(e._zod,"optin",()=>t.innerType._zod.optin),Z(e._zod,"optout",()=>t.innerType._zod.optout),Z(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Ze(s,r,Ee()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>Ze(i,r,Ee()))},input:n.value}),n.issues=[]),n)}}),Ai=l("$ZodPipe",(e,t)=>{L.init(e,t),Z(e._zod,"values",()=>t.in._zod.values),Z(e._zod,"optin",()=>t.in._zod.optin),Z(e._zod,"optout",()=>t.out._zod.optout),Z(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>tt(s,t.in,r)):tt(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>tt(i,t.out,r)):tt(o,t.out,r)}});function tt(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ci=l("$ZodReadonly",(e,t)=>{L.init(e,t),Z(e._zod,"propValues",()=>t.innerType._zod.propValues),Z(e._zod,"values",()=>t.innerType._zod.values),Z(e._zod,"optin",()=>t.innerType?._zod?.optin),Z(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(wn):wn(o)}});function wn(e){return e.value=Object.freeze(e.value),e}const ji=l("$ZodCustom",(e,t)=>{le.init(e,t),L.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>yn(i,n,r,e));yn(o,n,r,e)}});function yn(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Ge(o))}}var kn;class Di{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Ni(){return new Di}(kn=globalThis).__zod_globalRegistry??(kn.__zod_globalRegistry=Ni());const Je=globalThis.__zod_globalRegistry;function Li(e,t){return new e({type:"string",...y(t)})}function Ui(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...y(t)})}function zn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...y(t)})}function Fi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...y(t)})}function Mi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...y(t)})}function Vi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...y(t)})}function Ji(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...y(t)})}function Wi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...y(t)})}function Gi(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...y(t)})}function Bi(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...y(t)})}function qi(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...y(t)})}function Ki(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...y(t)})}function Hi(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...y(t)})}function Yi(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...y(t)})}function Xi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...y(t)})}function Qi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...y(t)})}function ea(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...y(t)})}function ta(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...y(t)})}function na(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...y(t)})}function ra(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...y(t)})}function oa(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...y(t)})}function sa(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...y(t)})}function ia(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...y(t)})}function aa(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...y(t)})}function ca(e,t){return new e({type:"string",format:"date",check:"string_format",...y(t)})}function ua(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...y(t)})}function la(e,t){return new e({type:"string",format:"duration",check:"string_format",...y(t)})}function da(e){return new e({type:"unknown"})}function fa(e,t){return new e({type:"never",...y(t)})}function fr(e,t){return new Cs({check:"max_length",...y(t),maximum:e})}function it(e,t){return new js({check:"min_length",...y(t),minimum:e})}function pr(e,t){return new Ds({check:"length_equals",...y(t),length:e})}function pa(e,t){return new Ns({check:"string_format",format:"regex",...y(t),pattern:e})}function ha(e){return new Ls({check:"string_format",format:"lowercase",...y(e)})}function ma(e){return new Us({check:"string_format",format:"uppercase",...y(e)})}function ga(e,t){return new Fs({check:"string_format",format:"includes",...y(t),includes:e})}function ba(e,t){return new Ms({check:"string_format",format:"starts_with",...y(t),prefix:e})}function va(e,t){return new Vs({check:"string_format",format:"ends_with",...y(t),suffix:e})}function Le(e){return new Js({check:"overwrite",tx:e})}function _a(e){return Le(t=>t.normalize(e))}function wa(){return Le(e=>e.trim())}function ya(){return Le(e=>e.toLowerCase())}function ka(){return Le(e=>e.toUpperCase())}function za(){return Le(e=>Vo(e))}function Sa(e,t,n){return new e({type:"array",element:t,...y(n)})}function $a(e,t,n){return new e({type:"custom",check:"custom",fn:t,...y(n)})}function Oa(e){const t=Ea(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Ge(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Ge(o))}},e(n.value,n)));return t}function Ea(e,t){const n=new le({check:"custom",...y(t)});return n._zod.check=e,n}function hr(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Je,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function B(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,d);else{const f=s.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,d)}const p=e._zod.parent;p&&(s.ref||(s.ref=p),B(p,t,d),t.seen.get(p).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),t.io==="input"&&X(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function mr(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const s of e.seen.entries()){const a=e.metadataRegistry.get(s[0])?.id;if(a){const c=r.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,s[0])}}const o=s=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const p=e.external.registry.get(s[0])?.id,f=e.external.uri??(k=>k);if(p)return{ref:f(p)};const h=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=h,{defId:h,ref:`${f("__shared")}#/${a}/${h}`}}if(s[1]===n)return{ref:"#"};const u=`#/${a}/`,d=s[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:c,defId:u}=o(s);a.def={...a.schema},u&&(a.defId=u);const d=a.schema;for(const p in d)delete d[p];d.$ref=c};if(e.cycles==="throw")for(const s of e.seen.entries()){const a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
38
|
+
|
|
39
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const a=s[1];if(t===s[0]){i(s);continue}if(e.external){const u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function gr(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=s=>{const a=e.seen.get(s);if(a.ref===null)return;const c=a.def??a.schema,u={...c},d=a.ref;if(a.ref=null,d){r(d);const f=e.seen.get(d),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,u),s._zod.parent===d)for(const b in c)b==="$ref"||b==="allOf"||b in u||delete c[b];if(h.$ref&&f.def)for(const b in c)b==="$ref"||b==="allOf"||b in f.def&&JSON.stringify(c[b])===JSON.stringify(f.def[b])&&delete c[b]}const p=s._zod.parent;if(p&&p!==d){r(p);const f=e.seen.get(p);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(const h in c)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(c[h])===JSON.stringify(f.def[h])&&delete c[h]}e.override({zodSchema:s,jsonSchema:c,path:a.path??[]})};for(const s of[...e.seen.entries()].reverse())r(s[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(s)}Object.assign(o,n.def??n.schema);const i=e.external?.defs??{};for(const s of e.seen.entries()){const a=s[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const s=JSON.parse(JSON.stringify(o));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:at(t,"input",e.processors),output:at(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function X(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return X(r.element,n);if(r.type==="set")return X(r.valueType,n);if(r.type==="lazy")return X(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return X(r.innerType,n);if(r.type==="intersection")return X(r.left,n)||X(r.right,n);if(r.type==="record"||r.type==="map")return X(r.keyType,n)||X(r.valueType,n);if(r.type==="pipe")return X(r.in,n)||X(r.out,n);if(r.type==="object"){for(const o in r.shape)if(X(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(X(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(X(o,n))return!0;return!!(r.rest&&X(r.rest,n))}return!1}const Za=(e,t={})=>n=>{const r=hr({...n,processors:t});return B(e,r),mr(r,e),gr(r,e)},at=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=hr({...o??{},target:i,io:t,processors:n});return B(e,s),mr(s,e),gr(s,e)},xa={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ra=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=xa[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const d=[...c];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Ta=(e,t,n,r)=>{n.not={}},Pa=(e,t,n,r)=>{},Ia=(e,t,n,r)=>{const o=e._zod.def,i=Xn(o.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},Aa=(e,t,n,r)=>{const o=e._zod.def,i=[];for(const s of o.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},Ca=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ja=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Da=(e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=B(i.element,t,{...r,path:[...r.path,"items"]})},Na=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const u in s)o.properties[u]=B(s[u],t,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(s)),c=new Set([...a].filter(u=>{const d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(o.required=Array.from(c)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=B(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},La=(e,t,n,r)=>{const o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,c)=>B(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=s:n.anyOf=s},Ua=(e,t,n,r)=>{const o=e._zod.def,i=B(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=B(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=c},Fa=(e,t,n,r)=>{const o=e._zod.def,i=B(o.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},Ma=(e,t,n,r)=>{const o=e._zod.def;B(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},Va=(e,t,n,r)=>{const o=e._zod.def;B(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},Ja=(e,t,n,r)=>{const o=e._zod.def;B(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},Wa=(e,t,n,r)=>{const o=e._zod.def;B(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},Ga=(e,t,n,r)=>{const o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;B(i,t,r);const s=t.seen.get(e);s.ref=i},Ba=(e,t,n,r)=>{const o=e._zod.def;B(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},br=(e,t,n,r)=>{const o=e._zod.def;B(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},qa=l("ZodISODateTime",(e,t)=>{oi.init(e,t),A.init(e,t)});function Ka(e){return aa(qa,e)}const Ha=l("ZodISODate",(e,t)=>{si.init(e,t),A.init(e,t)});function Ya(e){return ca(Ha,e)}const Xa=l("ZodISOTime",(e,t)=>{ii.init(e,t),A.init(e,t)});function Qa(e){return ua(Xa,e)}const ec=l("ZodISODuration",(e,t)=>{ai.init(e,t),A.init(e,t)});function tc(e){return la(ec,e)}const vr=(e,t)=>{rr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>ts(e,n)},flatten:{value:n=>es(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Pt,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Pt,2)}},isEmpty:{get(){return e.issues.length===0}}})},pu=l("ZodError",vr),re=l("ZodError",vr,{Parent:Error}),nc=Vt(re),rc=Jt(re),oc=ct(re),sc=ut(re),ic=os(re),ac=ss(re),cc=is(re),uc=as(re),lc=cs(re),dc=us(re),fc=ls(re),pc=ds(re),U=l("ZodType",(e,t)=>(L.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:at(e,"input"),output:at(e,"output")}}),e.toJSONSchema=Za(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ye(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>ke(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>nc(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>oc(e,n,r),e.parseAsync=async(n,r)=>rc(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>sc(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>ic(e,n,r),e.decode=(n,r)=>ac(e,n,r),e.encodeAsync=async(n,r)=>cc(e,n,r),e.decodeAsync=async(n,r)=>uc(e,n,r),e.safeEncode=(n,r)=>lc(e,n,r),e.safeDecode=(n,r)=>dc(e,n,r),e.safeEncodeAsync=async(n,r)=>fc(e,n,r),e.safeDecodeAsync=async(n,r)=>pc(e,n,r),e.refine=(n,r)=>e.check(iu(n,r)),e.superRefine=n=>e.check(au(n)),e.overwrite=n=>e.check(Le(n)),e.optional=()=>On(e),e.exactOptional=()=>Bc(e),e.nullable=()=>En(e),e.nullish=()=>On(En(e)),e.nonoptional=n=>Qc(e,n),e.array=()=>jc(e),e.or=n=>Lc([e,n]),e.and=n=>Fc(e,n),e.transform=n=>Zn(e,Wc(n)),e.default=n=>Hc(e,n),e.prefault=n=>Xc(e,n),e.catch=n=>tu(e,n),e.pipe=n=>Zn(e,n),e.readonly=()=>ou(e),e.describe=n=>{const r=e.clone();return Je.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Je.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Je.get(e);const r=e.clone();return Je.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),_r=l("_ZodString",(e,t)=>{Wt.init(e,t),U.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Ra(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(pa(...r)),e.includes=(...r)=>e.check(ga(...r)),e.startsWith=(...r)=>e.check(ba(...r)),e.endsWith=(...r)=>e.check(va(...r)),e.min=(...r)=>e.check(it(...r)),e.max=(...r)=>e.check(fr(...r)),e.length=(...r)=>e.check(pr(...r)),e.nonempty=(...r)=>e.check(it(1,...r)),e.lowercase=r=>e.check(ha(r)),e.uppercase=r=>e.check(ma(r)),e.trim=()=>e.check(wa()),e.normalize=(...r)=>e.check(_a(...r)),e.toLowerCase=()=>e.check(ya()),e.toUpperCase=()=>e.check(ka()),e.slugify=()=>e.check(za())}),hc=l("ZodString",(e,t)=>{Wt.init(e,t),_r.init(e,t),e.email=n=>e.check(Ui(mc,n)),e.url=n=>e.check(Wi(gc,n)),e.jwt=n=>e.check(ia(Tc,n)),e.emoji=n=>e.check(Gi(bc,n)),e.guid=n=>e.check(zn(Sn,n)),e.uuid=n=>e.check(Fi(nt,n)),e.uuidv4=n=>e.check(Mi(nt,n)),e.uuidv6=n=>e.check(Vi(nt,n)),e.uuidv7=n=>e.check(Ji(nt,n)),e.nanoid=n=>e.check(Bi(vc,n)),e.guid=n=>e.check(zn(Sn,n)),e.cuid=n=>e.check(qi(_c,n)),e.cuid2=n=>e.check(Ki(wc,n)),e.ulid=n=>e.check(Hi(yc,n)),e.base64=n=>e.check(ra(Zc,n)),e.base64url=n=>e.check(oa(xc,n)),e.xid=n=>e.check(Yi(kc,n)),e.ksuid=n=>e.check(Xi(zc,n)),e.ipv4=n=>e.check(Qi(Sc,n)),e.ipv6=n=>e.check(ea($c,n)),e.cidrv4=n=>e.check(ta(Oc,n)),e.cidrv6=n=>e.check(na(Ec,n)),e.e164=n=>e.check(sa(Rc,n)),e.datetime=n=>e.check(Ka(n)),e.date=n=>e.check(Ya(n)),e.time=n=>e.check(Qa(n)),e.duration=n=>e.check(tc(n))});function hu(e){return Li(hc,e)}const A=l("ZodStringFormat",(e,t)=>{P.init(e,t),_r.init(e,t)}),mc=l("ZodEmail",(e,t)=>{Ks.init(e,t),A.init(e,t)}),Sn=l("ZodGUID",(e,t)=>{Bs.init(e,t),A.init(e,t)}),nt=l("ZodUUID",(e,t)=>{qs.init(e,t),A.init(e,t)}),gc=l("ZodURL",(e,t)=>{Hs.init(e,t),A.init(e,t)}),bc=l("ZodEmoji",(e,t)=>{Ys.init(e,t),A.init(e,t)}),vc=l("ZodNanoID",(e,t)=>{Xs.init(e,t),A.init(e,t)}),_c=l("ZodCUID",(e,t)=>{Qs.init(e,t),A.init(e,t)}),wc=l("ZodCUID2",(e,t)=>{ei.init(e,t),A.init(e,t)}),yc=l("ZodULID",(e,t)=>{ti.init(e,t),A.init(e,t)}),kc=l("ZodXID",(e,t)=>{ni.init(e,t),A.init(e,t)}),zc=l("ZodKSUID",(e,t)=>{ri.init(e,t),A.init(e,t)}),Sc=l("ZodIPv4",(e,t)=>{ci.init(e,t),A.init(e,t)}),$c=l("ZodIPv6",(e,t)=>{ui.init(e,t),A.init(e,t)}),Oc=l("ZodCIDRv4",(e,t)=>{li.init(e,t),A.init(e,t)}),Ec=l("ZodCIDRv6",(e,t)=>{di.init(e,t),A.init(e,t)}),Zc=l("ZodBase64",(e,t)=>{fi.init(e,t),A.init(e,t)}),xc=l("ZodBase64URL",(e,t)=>{hi.init(e,t),A.init(e,t)}),Rc=l("ZodE164",(e,t)=>{mi.init(e,t),A.init(e,t)}),Tc=l("ZodJWT",(e,t)=>{bi.init(e,t),A.init(e,t)}),Pc=l("ZodUnknown",(e,t)=>{vi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Pa()});function $n(){return da(Pc)}const Ic=l("ZodNever",(e,t)=>{_i.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ta(e,n,r)});function Ac(e){return fa(Ic,e)}const Cc=l("ZodArray",(e,t)=>{wi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Da(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(it(n,r)),e.nonempty=n=>e.check(it(1,n)),e.max=(n,r)=>e.check(fr(n,r)),e.length=(n,r)=>e.check(pr(n,r)),e.unwrap=()=>e.element});function jc(e,t){return Sa(Cc,e,t)}const Dc=l("ZodObject",(e,t)=>{ki.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Na(e,n,r,o),Z(e,"shape",()=>t.shape),e.keyof=()=>Mc(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:$n()}),e.loose=()=>e.clone({...e._zod.def,catchall:$n()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ac()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Ko(e,n),e.safeExtend=n=>Ho(e,n),e.merge=n=>Yo(e,n),e.pick=n=>Bo(e,n),e.omit=n=>qo(e,n),e.partial=(...n)=>Xo(wr,e,n[0]),e.required=(...n)=>Qo(yr,e,n[0])});function mu(e,t){const n={type:"object",shape:e??{},...y(t)};return new Dc(n)}const Nc=l("ZodUnion",(e,t)=>{zi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>La(e,n,r,o),e.options=t.options});function Lc(e,t){return new Nc({type:"union",options:e,...y(t)})}const Uc=l("ZodIntersection",(e,t)=>{Si.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ua(e,n,r,o)});function Fc(e,t){return new Uc({type:"intersection",left:e,right:t})}const At=l("ZodEnum",(e,t)=>{$i.init(e,t),U.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Ia(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new At({...t,checks:[],...y(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new At({...t,checks:[],...y(o),entries:i})}});function Mc(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new At({type:"enum",entries:n,...y(t)})}const Vc=l("ZodLiteral",(e,t)=>{Oi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Aa(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function gu(e,t){return new Vc({type:"literal",values:Array.isArray(e)?e:[e],...y(t)})}const Jc=l("ZodTransform",(e,t)=>{Ei.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ja(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Hn(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Ge(i,n.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(Ge(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function Wc(e){return new Jc({type:"transform",transform:e})}const wr=l("ZodOptional",(e,t)=>{dr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>br(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function On(e){return new wr({type:"optional",innerType:e})}const Gc=l("ZodExactOptional",(e,t)=>{Zi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>br(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Bc(e){return new Gc({type:"optional",innerType:e})}const qc=l("ZodNullable",(e,t)=>{xi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fa(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function En(e){return new qc({type:"nullable",innerType:e})}const Kc=l("ZodDefault",(e,t)=>{Ri.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Va(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Hc(e,t){return new Kc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():er(t)}})}const Yc=l("ZodPrefault",(e,t)=>{Ti.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ja(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Xc(e,t){return new Yc({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():er(t)}})}const yr=l("ZodNonOptional",(e,t)=>{Pi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ma(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Qc(e,t){return new yr({type:"nonoptional",innerType:e,...y(t)})}const eu=l("ZodCatch",(e,t)=>{Ii.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Wa(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function tu(e,t){return new eu({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const nu=l("ZodPipe",(e,t)=>{Ai.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ga(e,n,r,o),e.in=t.in,e.out=t.out});function Zn(e,t){return new nu({type:"pipe",in:e,out:t})}const ru=l("ZodReadonly",(e,t)=>{Ci.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ba(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ou(e){return new ru({type:"readonly",innerType:e})}const su=l("ZodCustom",(e,t)=>{ji.init(e,t),U.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ca(e,n)});function iu(e,t={}){return $a(su,e,t)}function au(e){return Oa(e)}export{pu as Z,Lc as a,du as c,gu as l,Fr as m,mu as o,$r as r,hu as s,fu as t,lu as u};
|
package/dist/ui/index.html
CHANGED
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
|
|
19
19
|
<title>Morpheus Agent UI</title>
|
|
20
20
|
<!-- vite-plugin-pwa injeta <link rel="manifest"> automaticamente no build -->
|
|
21
|
-
<script type="module" crossorigin src="./assets/index-
|
|
21
|
+
<script type="module" crossorigin src="./assets/index-B9ePr-vB.js"></script>
|
|
22
22
|
<link rel="modulepreload" crossorigin href="./assets/vendor-react-DikRIOlj.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="./assets/vendor-motion-C3CZ8ZlO.js">
|
|
24
|
-
<link rel="modulepreload" crossorigin href="./assets/vendor-utils-
|
|
25
|
-
<link rel="modulepreload" crossorigin href="./assets/vendor-icons-
|
|
26
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
24
|
+
<link rel="modulepreload" crossorigin href="./assets/vendor-utils-BIYveU_1.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="./assets/vendor-icons-DE7PWdkN.js">
|
|
26
|
+
<link rel="stylesheet" crossorigin href="./assets/index-D_0tPLCk.css">
|
|
27
27
|
<link rel="manifest" href="./manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="./registerSW.js"></script></head>
|
|
28
28
|
<body>
|
|
29
29
|
<div id="root"></div>
|
package/dist/ui/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let s,e={};const
|
|
1
|
+
if(!self.define){let s,e={};const n=(n,i)=>(n=new URL(n+".js",i).href,e[n]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=n,s.onload=e,document.head.appendChild(s)}else s=n,importScripts(n),e()}).then(()=>{let s=e[n];if(!s)throw new Error(`Module ${n} didn’t register its module`);return s}));self.define=(i,l)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const a=s=>n(s,r),o={module:{uri:r},exports:u,require:a};e[r]=Promise.all(i.map(s=>o[s]||a(s))).then(s=>(l(...s),u))}}define(["./workbox-26f462e7"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"vite.svg",revision:"5e386a6b1608494961c0a0de283e0df8"},{url:"registerSW.js",revision:"402b66900e731ca748771b6fc5e7a068"},{url:"pwa-maskable-512x512.png",revision:"e9dc04fc1b43cd6093e286bf765726d8"},{url:"pwa-maskable-192x192.png",revision:"8eb12fd764e6cb6f56247b2e1b21a31f"},{url:"pwa-512x512.png",revision:"f9619ef45b67856ce91010c1eb1d3c0c"},{url:"pwa-192x192.png",revision:"6174f6c5724689f6c15526be28983ca8"},{url:"index.html",revision:"df6faeee58bd6730db31a9e07d3e5541"},{url:"assets/vendor-utils-BIYveU_1.js",revision:null},{url:"assets/vendor-react-DikRIOlj.js",revision:null},{url:"assets/vendor-motion-C3CZ8ZlO.js",revision:null},{url:"assets/vendor-markdown-BN_Np5Ta.js",revision:null},{url:"assets/vendor-icons-DE7PWdkN.js",revision:null},{url:"assets/useCurrency-Bgg-7MTE.js",revision:null},{url:"assets/stats-KMbKDMJ-.js",revision:null},{url:"assets/skills-wEUxSGB3.js",revision:null},{url:"assets/mcp-BeBznKtK.js",revision:null},{url:"assets/index-D_0tPLCk.css",revision:null},{url:"assets/index-B9ePr-vB.js",revision:null},{url:"assets/config-OLGQFNJL.js",revision:null},{url:"assets/chronos-DPhK718h.js",revision:null},{url:"assets/audit-CP5fC4m8.js",revision:null},{url:"assets/agents-DO69pNM1.js",revision:null},{url:"assets/WebhookManager-CEjjk4tx.js",revision:null},{url:"assets/UsageStats-Bl7bs4ay.js",revision:null},{url:"assets/TrinityDatabases-CnRAkDuu.js",revision:null},{url:"assets/Tasks-DJ6R3d4f.js",revision:null},{url:"assets/Switch-C7TxLq0E.js",revision:null},{url:"assets/Smiths-ZcHXcrMt.js",revision:null},{url:"assets/Skills-GIkCxMS3.js",revision:null},{url:"assets/Settings-CPDXAk18.js",revision:null},{url:"assets/SessionAudit-pOWRgJtc.js",revision:null},{url:"assets/SelectInput-BPDcd3y7.js",revision:null},{url:"assets/SatiMemories-CfSTgr9V.js",revision:null},{url:"assets/Pagination-D4ShqUKO.js",revision:null},{url:"assets/Notifications-BpHokTLS.js",revision:null},{url:"assets/ModelPricing-CyXMdxJD.js",revision:null},{url:"assets/MCPManager-_L2Yo-uY.js",revision:null},{url:"assets/Logs-BrFWnLIL.js",revision:null},{url:"assets/Documents-D73CeGkW.js",revision:null},{url:"assets/DeleteConfirmationModal-FSWLK6-I.js",revision:null},{url:"assets/Dashboard-DvJb72Xe.js",revision:null},{url:"assets/ConfirmationModal-DU0AwhXD.js",revision:null},{url:"assets/Chronos-BafOMteb.js",revision:null},{url:"assets/Chat-BwxZJphx.js",revision:null},{url:"assets/AuditDashboard-ClqEr7jg.js",revision:null},{url:"pwa-192x192.png",revision:"6174f6c5724689f6c15526be28983ca8"},{url:"pwa-512x512.png",revision:"f9619ef45b67856ce91010c1eb1d3c0c"},{url:"pwa-maskable-192x192.png",revision:"8eb12fd764e6cb6f56247b2e1b21a31f"},{url:"pwa-maskable-512x512.png",revision:"e9dc04fc1b43cd6093e286bf765726d8"},{url:"manifest.webmanifest",revision:"da8b9a11743009a7e50876a50de29362"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("/index.html"),{denylist:[/^\/api\//]})),s.registerRoute(/^\/api\//,new s.NetworkOnly,"GET"),s.registerRoute(/\.(?:js|css|woff2)$/,new s.CacheFirst({cacheName:"static-assets",plugins:[new s.ExpirationPlugin({maxAgeSeconds:31536e3})]}),"GET"),s.registerRoute(/\.(?:png|svg|ico)$/,new s.StaleWhileRevalidate({cacheName:"images",plugins:[new s.ExpirationPlugin({maxEntries:50,maxAgeSeconds:2592e3})]}),"GET")});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "morpheus-cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.23",
|
|
4
4
|
"description": "Morpheus is a local AI agent for developers, running as a CLI daemon that connects to LLMs, local tools, and MCPs, enabling interaction via Terminal, Telegram, and Discord. Inspired by the character Morpheus from *The Matrix*, the project acts as an intelligent orchestrator, bridging the gap between the developer and complex systems.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"morpheus": "./bin/morpheus.js"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,m as d}from"./vendor-motion-C3CZ8ZlO.js";import{u as P,t as z,h as w,f as U}from"./index-BcX5O7kY.js";import{u as n}from"./vendor-utils-D4NnWbOU.js";import{s as A}from"./stats-BiPI2kaw.js";import{m as E}from"./mcp-BlkruPaA.js";import{s as R}from"./skills-CtCb-52u.js";import{L as V,A as F,g as j,l as O,m as J,n as W,i as B,W as G,P as H,H as q,f as X,o as S,p as K,q as Q,r as Y}from"./vendor-icons-NHF9HNeN.js";import{L as C}from"./vendor-react-DikRIOlj.js";const Z={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},k=({title:r,value:a,icon:i,subValue:l})=>e.jsxs(d.div,{variants:Z,className:"border border-azure-border dark:border-matrix-primary bg-azure-surface/50 dark:bg-zinc-950/50 p-6 rounded relative overflow-hidden group hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",children:[e.jsxs("div",{className:"flex justify-between items-start mb-4",children:[e.jsx("h3",{className:"text-azure-text-secondary dark:text-matrix-secondary text-sm font-bold uppercase",children:r}),e.jsx(i,{className:"w-6 h-6 text-azure-primary dark:text-matrix-primary group-hover:text-azure-primary dark:group-hover:text-matrix-highlight transition-colors"})]}),e.jsx("div",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight mb-1 font-mono tracking-tighter truncate",children:a}),l&&e.jsx("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70 font-mono",children:l})]}),ee={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.07}}},c={hidden:{opacity:0,y:12},show:{opacity:1,y:0}};function m({icon:r,title:a,to:i,children:l,status:o="neutral"}){const h=o==="ok"?"border-emerald-300/60 dark:border-emerald-700/40":o==="warn"?"border-amber-300/60 dark:border-amber-700/40":o==="error"?"border-red-300/60 dark:border-red-700/40":"border-azure-border dark:border-matrix-primary/50";return e.jsxs(C,{to:i,className:`group flex flex-col gap-3 rounded-lg border bg-white dark:bg-black p-4 hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors ${h}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"}),e.jsx("span",{className:"text-sm font-semibold text-azure-text dark:text-matrix-highlight",children:a})]}),e.jsx(S,{className:"w-3.5 h-3.5 text-azure-text-secondary dark:text-matrix-tertiary group-hover:text-azure-primary dark:group-hover:text-matrix-highlight transition-colors"})]}),e.jsx("div",{className:"space-y-1.5",children:l})]})}function s({label:r,value:a,highlight:i}){return e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary",children:r}),e.jsx("span",{className:i?"font-semibold text-azure-text dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-secondary",children:a})]})}function te({status:r}){return r==="completed"?e.jsx(K,{className:"w-3.5 h-3.5 text-emerald-500 shrink-0"}):r==="failed"?e.jsx(Q,{className:"w-3.5 h-3.5 text-red-500 shrink-0"}):r==="running"?e.jsx(Y,{className:"w-3.5 h-3.5 text-blue-500 animate-spin shrink-0"}):e.jsx(j,{className:"w-3.5 h-3.5 text-yellow-500 shrink-0"})}function xe(){const{data:r}=P(),{data:a}=n("/tasks/stats",()=>z.stats(),{refreshInterval:5e3}),{data:i}=n("/api/stats/usage",()=>A.fetchUsageStats(),{refreshInterval:3e4}),{data:l}=n("/api/mcp/stats",()=>E.fetchStats(),{refreshInterval:3e4}),{data:o}=n("/smiths",()=>w.get("/smiths"),{refreshInterval:1e4}),{data:h=[]}=n("/chronos",()=>w.get("/chronos"),{refreshInterval:3e4}),{data:x}=n("/api/skills",()=>R.fetchSkills(),{refreshInterval:6e4}),{data:p=[]}=n(["/tasks",{limit:5}],()=>z.list({limit:5}),{refreshInterval:5e3}),v=(i?.totalInputTokens??0)+(i?.totalOutputTokens??0),f=i?.totalEstimatedCostUsd!=null,T=i?.totalEstimatedCostUsd??0,g=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t),u=h.filter(t=>t.enabled),y=u.filter(t=>t.next_run_at).sort((t,b)=>t.next_run_at-b.next_run_at)[0],N=y?.next_run_at?(()=>{const t=y.next_run_at-Date.now();return t<0?"due now":t<6e4?`${Math.floor(t/1e3)}s`:t<36e5?`${Math.floor(t/6e4)}m`:`${Math.floor(t/36e5)}h`})():null,$=(a?.pending??0)+(a?.running??0),I=a?.failed?"warn":$>0?"ok":"neutral",L=(l?.totalTools??0)>0?"ok":"neutral",_=(o?.online??0)>0?"ok":(o?.total??0)>0?"warn":"neutral",D=u.length>0?"ok":"neutral",M=(x?.enabled??0)>0?"ok":"neutral";return e.jsxs(d.div,{className:"space-y-6",variants:ee,initial:"hidden",animate:"show",children:[e.jsxs(d.div,{variants:c,className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:e.jsx(V,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Dashboard"}),e.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Overview of the Morpheus agent runtime."})]})]}),e.jsxs(d.div,{variants:c,className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsx(k,{title:"Agent Status",value:r?.status.toUpperCase()??"CONNECTING...",icon:F,subValue:r?`PID: ${r.pid}`:""}),e.jsx(k,{title:"Uptime",value:r?U(r.uptimeSeconds):"-",icon:j,subValue:r?`${r.uptimeSeconds.toFixed(0)}s elapsed`:""}),e.jsx(k,{title:"Version",value:r?.projectVersion??"-",icon:O,subValue:`Node ${r?.nodeVersion??"-"}`})]}),e.jsxs(d.div,{variants:c,className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-4",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Provider"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight shrink-0"}),e.jsx("p",{className:"text-base font-bold text-azure-text dark:text-matrix-highlight truncate",children:r?.llmProvider?.toUpperCase()??"—"})]})]}),e.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-4",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Model"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight shrink-0"}),e.jsx("p",{className:"text-sm font-bold text-azure-text dark:text-matrix-highlight truncate leading-tight",children:r?.llmModel??"—"})]})]}),e.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-4",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Total Tokens"}),e.jsx("p",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:v>0?g(v):"—"}),e.jsxs("p",{className:"text-[10px] text-azure-text-secondary dark:text-matrix-tertiary mt-1",children:[g(i?.totalInputTokens??0)," in · ",g(i?.totalOutputTokens??0)," out"]})]}),e.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-4",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Est. Cost"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(B,{className:"w-4 h-4 text-emerald-500 shrink-0"}),e.jsx("p",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:f?`$${T.toFixed(4)}`:"—"})]}),e.jsx("p",{className:"text-[10px] text-azure-text-secondary dark:text-matrix-tertiary mt-1",children:f?"accumulated total":"configure pricing to track"})]})]}),e.jsxs(d.div,{variants:c,children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-3",children:"Platform"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4",children:[e.jsxs(m,{icon:G,title:"Skills",to:"/skills",status:M,children:[e.jsx(s,{label:"Enabled",value:x?`${x.enabled} / ${x.total}`:"—",highlight:(x?.enabled??0)>0}),e.jsx(s,{label:"Total",value:x?.total??"—"})]}),e.jsxs(m,{icon:H,title:"MCP Servers",to:"/mcp-servers",status:L,children:[e.jsx(s,{label:"Tools loaded",value:l?.totalTools??"—",highlight:!!l?.totalTools}),e.jsx(s,{label:"Servers",value:l?.servers?.length??"—"}),l?.lastLoadedAt&&e.jsx(s,{label:"Last loaded",value:new Date(l.lastLoadedAt).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]}),e.jsxs(m,{icon:q,title:"Smiths",to:"/smiths",status:_,children:[e.jsx(s,{label:"Online",value:o?`${o.online} / ${o.total}`:"—",highlight:(o?.online??0)>0}),e.jsx(s,{label:"System",value:o?.enabled?"enabled":"disabled"})]}),e.jsxs(m,{icon:X,title:"Tasks",to:"/tasks",status:I,children:[e.jsx(s,{label:"Running",value:a?.running??"—",highlight:!!a?.running}),e.jsx(s,{label:"Pending",value:a?.pending??"—"}),e.jsx(s,{label:"Completed",value:a?.completed??"—"}),(a?.failed??0)>0&&e.jsx(s,{label:"Failed",value:a.failed})]}),e.jsxs(m,{icon:j,title:"Chronos",to:"/chronos",status:D,children:[e.jsx(s,{label:"Active jobs",value:u.length,highlight:u.length>0}),e.jsx(s,{label:"Total jobs",value:h.length}),N&&e.jsx(s,{label:"Next run",value:`in ${N}`})]})]})]}),p.length>0&&e.jsxs(d.div,{variants:c,children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary",children:"Recent Tasks"}),e.jsxs(C,{to:"/tasks",className:"flex items-center gap-0.5 text-xs text-azure-primary dark:text-matrix-highlight hover:underline",children:["View all ",e.jsx(S,{className:"w-3 h-3"})]})]}),e.jsx("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:p.map((t,b)=>e.jsxs("div",{className:`flex items-center gap-3 px-4 py-2.5 ${b<p.length-1?"border-b border-azure-border dark:border-matrix-primary/30":""} hover:bg-azure-surface/60 dark:hover:bg-zinc-900/50 transition-colors`,children:[e.jsx(te,{status:t.status}),e.jsx("span",{className:"font-mono text-[10px] text-azure-text-secondary dark:text-matrix-tertiary w-16 shrink-0",children:t.id.slice(0,8)}),e.jsx("span",{className:"flex-1 text-xs text-azure-text dark:text-matrix-secondary truncate",children:t.input.slice(0,100)}),e.jsx("span",{className:"text-[10px] font-mono uppercase text-azure-text-secondary dark:text-matrix-tertiary shrink-0",children:t.agent}),e.jsx("span",{className:"text-[10px] text-azure-text-secondary dark:text-matrix-tertiary shrink-0",children:new Date(t.created_at).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]},t.id))})]})]})}export{xe as Dashboard};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,m as n}from"./vendor-motion-C3CZ8ZlO.js";import{r as i,L as P}from"./vendor-react-DikRIOlj.js";import{u as S}from"./vendor-utils-D4NnWbOU.js";import{w as y,D as _,e as D,j as R}from"./index-BcX5O7kY.js";import{P as O}from"./Pagination-BHZKk42X.js";import{B as k,a8 as A,a9 as F,aa as B,_ as L,p as W,q as E,g as J}from"./vendor-icons-NHF9HNeN.js";const M={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},g={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},j=({status:r})=>r==="completed"?e.jsxs("div",{className:"flex items-center gap-1.5 text-green-600 dark:text-green-400",children:[e.jsx(W,{className:"w-4 h-4"}),e.jsx("span",{className:"text-xs",children:"Completed"})]}):r==="failed"?e.jsxs("div",{className:"flex items-center gap-1.5 text-red-600 dark:text-red-400",children:[e.jsx(E,{className:"w-4 h-4"}),e.jsx("span",{className:"text-xs",children:"Failed"})]}):e.jsxs("div",{className:"flex items-center gap-1.5 text-yellow-600 dark:text-yellow-400",children:[e.jsx(J,{className:"w-4 h-4 animate-pulse"}),e.jsx("span",{className:"text-xs",children:"Pending"})]}),x=r=>new Date(r).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),U=r=>{try{return JSON.stringify(JSON.parse(r),null,2)}catch{return r}},X=()=>{const[r,f]=i.useState(!1),[c,N]=i.useState("all"),[m,d]=i.useState(1),[h,v]=i.useState(20),[a,u]=i.useState(null),{data:s,mutate:z}=S(["/webhooks/notifications",r,c,m,h],()=>y.listNotifications({unreadOnly:r,status:c,page:m,per_page:h}),{refreshInterval:5e3}),o=s?.data??[],l=o.filter(t=>!t.read).length,b=async t=>{t.length!==0&&(await y.markRead(t),await z())},w=()=>{const t=o.filter(p=>!p.read).map(p=>p.id);b(t)},C=async t=>{u(t),t.read||await b([t.id])};return e.jsxs(n.div,{variants:M,initial:"hidden",animate:"show",className:"space-y-6",children:[e.jsxs(n.div,{variants:g,className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:[e.jsx(k,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"}),l>0&&e.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[10px] font-bold rounded-full w-4 h-4 flex items-center justify-center leading-none",children:l>9?"9+":l})]}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Notifications"}),e.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary mt-0.5",children:"Webhook execution results from the Oracle agent."})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs(P,{to:"/webhooks",className:"flex items-center gap-2 text-sm text-azure-text-secondary dark:text-matrix-dim hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:[e.jsx(A,{className:"w-4 h-4"}),"Back to Webhooks"]}),e.jsxs("select",{value:c,onChange:t=>{N(t.target.value),d(1)},className:"px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black text-azure-text-secondary dark:text-matrix-dim text-sm focus:outline-none focus:border-azure-primary dark:focus:border-matrix-highlight",children:[e.jsx("option",{value:"all",children:"All statuses"}),e.jsx("option",{value:"completed",children:"Completed"}),e.jsx("option",{value:"failed",children:"Failed"}),e.jsx("option",{value:"pending",children:"Pending"})]}),e.jsxs("button",{onClick:()=>{f(!r),d(1)},className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-sm transition-colors ${r?"border-azure-primary dark:border-matrix-highlight bg-azure-active dark:bg-matrix-primary/20 text-azure-primary dark:text-matrix-highlight":"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-dim hover:bg-azure-surface dark:hover:bg-zinc-800"}`,children:[e.jsx(F,{className:"w-4 h-4"}),"Unread only"]}),l>0&&e.jsxs("button",{onClick:w,className:"flex items-center gap-2 px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-sm text-azure-text-secondary dark:text-matrix-dim hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:[e.jsx(B,{className:"w-4 h-4"}),"Mark all read"]})]})]}),e.jsx(n.div,{variants:g,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:e.jsx("tr",{children:["","Webhook","Status","Created","Completed","Actions"].map(t=>e.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-dim",children:t},t))})}),e.jsx("tbody",{children:o.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-dim",children:r?"No unread notifications.":"No notifications yet."})}):o.map(t=>e.jsxs("tr",{className:`border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-800/50 transition-colors ${t.read?"":"bg-blue-50/40 dark:bg-blue-900/10"}`,children:[e.jsx("td",{className:"px-4 py-3 w-6",children:!t.read&&e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500 dark:bg-matrix-highlight"})}),e.jsx("td",{className:"px-4 py-3 font-mono font-medium text-azure-text-primary dark:text-matrix-text",children:t.webhook_name}),e.jsx("td",{className:"px-4 py-3",children:e.jsx(j,{status:t.status})}),e.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:x(t.created_at)}),e.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:t.completed_at?x(t.completed_at):"—"}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("button",{onClick:()=>C(t),title:"View details",className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-dim hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:e.jsx(L,{className:"w-4 h-4"})})})]},t.id))})]})})}),s&&s.total_pages>1&&e.jsx(n.div,{variants:g,children:e.jsx("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black",children:e.jsx(O,{page:m,totalPages:s.total_pages,perPage:h,total:s.total,onPageChange:d,onPerPageChange:t=>{v(t),d(1)}})})}),e.jsxs(_,{open:!!a,onOpenChange:t=>!t&&u(null),children:[e.jsx(D,{children:e.jsxs(R,{className:"text-azure-text-primary dark:text-matrix-highlight flex items-center gap-2",children:[e.jsx(k,{className:"w-4 h-4"}),a?.webhook_name]})}),a&&e.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[65vh]",children:[e.jsxs("div",{className:"flex items-center gap-4 text-xs text-azure-text-secondary dark:text-matrix-dim",children:[e.jsx(j,{status:a.status}),e.jsx("span",{children:x(a.created_at)}),a.completed_at&&e.jsxs("span",{children:["→ ",x(a.completed_at)]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Received Payload"}),e.jsx("pre",{className:"bg-azure-bg dark:bg-zinc-950 rounded-lg p-3 text-xs font-mono overflow-auto max-h-44 text-azure-text-primary dark:text-matrix-text border border-azure-border dark:border-matrix-primary/30 whitespace-pre-wrap",children:U(a.payload)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Agent Result"}),e.jsx("div",{className:"bg-azure-bg dark:bg-zinc-950 rounded-lg p-3 text-xs font-mono overflow-auto max-h-64 text-azure-text-primary dark:text-matrix-text border border-azure-border dark:border-matrix-primary/30 whitespace-pre-wrap",children:a.result??e.jsx("span",{className:"text-yellow-600 dark:text-yellow-400 animate-pulse",children:"Processing…"})})]}),e.jsx("div",{className:"flex justify-end pt-2",children:e.jsx("button",{onClick:()=>u(null),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-dim text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Close"})})]})]})]})};export{X as Notifications};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./vendor-motion-C3CZ8ZlO.js";import{r as i}from"./vendor-react-DikRIOlj.js";import{B as j,h as N}from"./index-BcX5O7kY.js";import{M as de,D as oe}from"./DeleteConfirmationModal-kZ_c3sFk.js";import{V as xe,Y as me,Z as H,g as ue,_ as O,$ as he,a0 as ge,A as pe,z as B,a1 as fe}from"./vendor-icons-NHF9HNeN.js";import{P as je}from"./Pagination-BHZKk42X.js";import"./vendor-utils-D4NnWbOU.js";const ye=({className:r,...a})=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{className:`w-full caption-bottom text-sm ${r}`,...a})}),be=({...r})=>e.jsx("thead",{...r}),ke=({...r})=>e.jsx("tbody",{...r}),M=({...r})=>e.jsx("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 transition-colors hover:bg-azure-hover/50 dark:hover:bg-matrix-primary/10",...r}),f=({className:r,...a})=>e.jsx("th",{className:`h-12 px-4 text-left align-middle font-medium text-azure-text-secondary dark:text-matrix-secondary/70 [&:has([role=checkbox])]:pr-0 ${r}`,...a}),g=({className:r,...a})=>e.jsx("td",{className:`p-4 align-middle [&:has([role=checkbox])]:pr-0 ${r}`,...a}),F=({checked:r,onCheckedChange:a,className:s,...n})=>{const l=x=>{a&&a(x.target.checked),n.onChange&&n.onChange(x)};return e.jsx("input",{type:"checkbox",checked:r,onChange:l,className:`h-4 w-4 rounded border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-primary dark:text-matrix-highlight focus:ring-azure-primary dark:focus:ring-matrix-highlight ${s||""}`,...n})},v=({className:r,variant:a="default",...s})=>{const l=`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-zinc-950 focus:ring-offset-2 dark:focus:ring-zinc-300 ${a==="destructive"?"border-transparent bg-red-500 text-zinc-50 dark:bg-red-900 dark:text-zinc-50":a==="secondary"?"border-transparent bg-azure-surface dark:bg-zinc-800 text-azure-text-secondary dark:text-matrix-secondary":a==="outline"?"text-azure-text-primary dark:text-matrix-secondary border-azure-border dark:border-matrix-primary":"border-transparent bg-azure-primary dark:bg-matrix-highlight text-azure-text-inverse dark:text-black"} ${r||""}`;return e.jsx("div",{className:l,...s})},T=({className:r,...a})=>e.jsx("div",{className:`rounded-lg border border-azure-border dark:border-matrix-primary/30 bg-azure-surface dark:bg-zinc-900 text-azure-text-primary dark:text-matrix-secondary shadow-sm ${r||""}`,...a}),I=({className:r,...a})=>e.jsx("div",{className:`flex flex-col space-y-1.5 p-6 ${r||""}`,...a}),Ne=({className:r,...a})=>e.jsx("h3",{className:`text-2xl font-semibold leading-none tracking-tight ${r||""}`,...a}),A=({className:r,...a})=>e.jsx("div",{className:`p-6 pt-0 ${r||""}`,...a}),ve=({className:r,variant:a="default",...s})=>{const l=`relative w-full rounded-lg border p-4 ${a==="destructive"?"border-red-500/50 text-red-700 dark:border-red-900/50 dark:text-red-300":"border-azure-border dark:border-matrix-primary"} ${r||""}`;return e.jsx("div",{className:l,...s})},ze=({className:r,...a})=>e.jsx("div",{className:`text-sm [&_p]:leading-relaxed ${r||""}`,...a}),we=({isOpen:r,onClose:a,memory:s})=>s?e.jsx(de,{isOpen:r,onClose:a,title:"Memory Details",size:"lg",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xe,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),e.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Category"})]}),e.jsx("div",{children:e.jsx(v,{variant:"outline",children:s.category})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(me,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),e.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Importance"})]}),e.jsx("div",{children:e.jsx(v,{variant:s.importance==="critical"?"destructive":s.importance==="high"?"default":s.importance==="medium"?"secondary":"outline",children:s.importance})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),e.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Created"})]}),e.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(s.created_at).toLocaleString()}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ue,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),e.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Updated"})]}),e.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(s.updated_at).toLocaleString()}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),e.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Access Count"})]}),e.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:s.access_count}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(he,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),e.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Hash"})]}),e.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary break-all text-sm",children:s.hash}),s.source&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ge,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),e.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Source"})]}),e.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:s.source})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Summary"}),e.jsx("p",{className:"text-azure-text-primary dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 p-3 rounded-md",children:s.summary})]}),s.details&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Details"}),e.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 p-3 rounded-md whitespace-pre-wrap",children:s.details})]}),e.jsx("div",{className:"flex justify-end pt-4",children:e.jsx(j,{onClick:a,children:"Close"})})]})}):null,Ce=()=>{const[r,a]=i.useState(!1),[s,n]=i.useState(null),l=i.useCallback(o=>(a(!0),n(null),N.get(o).then(c=>c).catch(c=>{throw n(c.message||"An error occurred"),c}).finally(()=>{a(!1)})),[]),x=i.useCallback((o,c)=>(a(!0),n(null),N.post(o,c).then(d=>d).catch(d=>{throw n(d.message||"An error occurred"),d}).finally(()=>{a(!1)})),[]),m=i.useCallback((o,c)=>(a(!0),n(null),N.post(o,c).then(d=>d).catch(d=>{throw n(d.message||"An error occurred"),d}).finally(()=>{a(!1)})),[]),z=i.useCallback(o=>(a(!0),n(null),N.delete(o).then(c=>c).catch(c=>{throw n(c.message||"An error occurred"),c}).finally(()=>{a(!1)})),[]);return{get:l,post:x,put:m,del:z,loading:r,error:s}},_e=()=>{const[r,a]=i.useState([]),[s,n]=i.useState(!0),[l,x]=i.useState([]),[m,z]=i.useState(""),[o,c]=i.useState("all"),[d,R]=i.useState("all"),[u,y]=i.useState(1),[h,U]=i.useState(20),[V,q]=i.useState(0),[$,Y]=i.useState(1),[P,b]=i.useState(null),[Z,w]=i.useState(!1),[G,J]=i.useState(null),[K,_]=i.useState(!1),[E,L]=i.useState(null),[Q,C]=i.useState(!1),{get:W,del:X,post:ee}=Ce(),S=i.useCallback(async(t=u,D=h)=>{try{n(!0);const p=new URLSearchParams({page:String(t),per_page:String(D)});o!=="all"&&p.set("category",o),d!=="all"&&p.set("importance",d),m.trim()&&p.set("search",m.trim());const k=await W(`/sati/memories?${p}`);a(k.data??k),q(k.total??0),Y(k.total_pages??1),b(null)}catch(p){b("Failed to load memories. Please try again."),console.error("Error fetching memories:",p)}finally{n(!1)}},[u,h,o,d,m]);i.useEffect(()=>{S(u,h)},[u,h,o,d,m]);const te=()=>{l.length===r.length?x([]):x(r.map(t=>t.id))},re=t=>{l.includes(t)?x(l.filter(D=>D!==t)):x([...l,t])},ae=async()=>{if(l.length!==0)try{await ee("/sati/memories/bulk-delete",{ids:l}),await S(u,h),x([]),w(!1)}catch(t){b("Failed to delete memories. Please try again."),console.error("Error deleting memories:",t)}},se=t=>{L(t),C(!0)},ie=async()=>{if(E)try{await X(`/sati/memories/${E}`),await S(u,h)}catch(t){b("Failed to delete memory. Please try again."),console.error("Error deleting memory:",t)}finally{L(null),C(!1)}},le=t=>{J(t),_(!0)},ne=["preference","project","identity","constraint","context","personal_data","languages","favorite_things","relationships","pets","naming","professional_profile"],ce=["low","medium","high"];return s&&r.length===0?e.jsx(T,{className:"w-full",children:e.jsx(A,{className:"flex justify-center items-center h-64",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-azure-primary dark:border-matrix-highlight"})})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:e.jsx(pe,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Sati Memories"}),e.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"View and manage long-term memories stored by Sati."})]})]}),l.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-azure-text-muted dark:text-matrix-secondary",children:[l.length," selected"]}),e.jsxs(j,{variant:"destructive",size:"sm",onClick:()=>w(!0),disabled:l.length===0,children:[e.jsx(B,{className:"w-4 h-4 mr-1"}),"Delete Selected"]})]})]}),P&&e.jsx(ve,{variant:"destructive",children:e.jsx(ze,{children:P})}),e.jsxs(T,{children:[e.jsx(I,{className:"border-b border-azure-border dark:border-matrix-primary",children:e.jsxs("div",{className:"flex flex-col lg:flex-row gap-4",children:[e.jsxs("div",{className:"flex flex-col relative w-full",children:[e.jsx(fe,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-azure-text-secondary dark:text-matrix-secondary w-4 h-4"}),e.jsx("input",{type:"text",placeholder:"Search memories...",value:m,onChange:t=>{z(t.target.value),y(1)},className:"w-full pl-10 pr-4 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[e.jsxs("select",{value:o,onChange:t=>{c(t.target.value),y(1)},className:"px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight flex-grow",children:[e.jsx("option",{value:"all",children:"All Categories"}),ne.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsxs("select",{value:d,onChange:t=>{R(t.target.value),y(1)},className:"px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight flex-grow",children:[e.jsx("option",{value:"all",children:"All Importance"}),ce.map(t=>e.jsx("option",{value:t,children:t},t))]})]})]})}),e.jsx(A,{className:"p-0",children:e.jsxs(ye,{children:[e.jsx(be,{children:e.jsxs(M,{className:"hover:bg-transparent",children:[e.jsx(f,{className:"w-12",children:e.jsx(F,{checked:r.length>0&&l.length===r.length,onCheckedChange:te})}),e.jsx(f,{children:"Summary"}),e.jsx(f,{children:"Category"}),e.jsx(f,{children:"Importance"}),e.jsx(f,{children:"Created"}),e.jsx(f,{className:"w-32",children:"Actions"})]})}),e.jsx(ke,{children:r.length===0?e.jsx(M,{children:e.jsx(g,{colSpan:6,className:"text-center py-8 text-azure-text-secondary dark:text-matrix-secondary",children:s?"Loading memories...":"No memories found"})}):r.map(t=>e.jsxs(M,{children:[e.jsx(g,{children:e.jsx(F,{checked:l.includes(t.id),onCheckedChange:()=>re(t.id)})}),e.jsx(g,{className:"font-medium max-w-xs truncate",children:t.summary}),e.jsx(g,{children:e.jsx(v,{variant:"outline",children:t.category})}),e.jsx(g,{children:e.jsx(v,{variant:t.importance==="critical"?"destructive":t.importance==="high"?"default":t.importance==="medium"?"secondary":"outline",children:t.importance})}),e.jsx(g,{children:e.jsxs("div",{className:"flex items-center gap-1 text-azure-text-secondary dark:text-matrix-secondary",children:[e.jsx(H,{className:"w-4 h-4"}),new Date(t.created_at).toLocaleDateString()]})}),e.jsx(g,{children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>le(t),className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:e.jsx(O,{className:"w-4 h-4"})}),e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>se(t.id),className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:e.jsx(B,{className:"w-4 h-4"})})]})})]},t.id))})]})}),$>1&&e.jsx(je,{page:u,totalPages:$,perPage:h,total:V,onPageChange:y,onPerPageChange:t=>{U(t),y(1)}})]}),Z&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:e.jsxs(T,{className:"w-full max-w-md mx-4",children:[e.jsx(I,{children:e.jsx(Ne,{children:"Delete Memories"})}),e.jsxs(A,{children:[e.jsxs("p",{className:"mb-4",children:["Are you sure you want to delete ",l.length," ","memory(ies)? This action cannot be undone."]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(j,{variant:"outline",onClick:()=>w(!1),children:"Cancel"}),e.jsx(j,{variant:"destructive",onClick:ae,children:"Delete"})]})]})]})}),e.jsx(we,{isOpen:K,onClose:()=>_(!1),memory:G}),e.jsx(oe,{isOpen:Q,onClose:()=>C(!1),onConfirm:ie,title:"Confirm Memory Deletion",message:"Are you sure you want to delete this memory? This action cannot be undone.",confirmButtonText:"Delete Memory",cancelButtonText:"Cancel"})]})};export{_e as SatiMemories};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{j as e,m as n}from"./vendor-motion-C3CZ8ZlO.js";import{r as s}from"./vendor-react-DikRIOlj.js";import{u as Z}from"./vendor-utils-D4NnWbOU.js";import{s as l}from"./skills-CtCb-52u.js";import{D as K,e as O,j as V}from"./index-BcX5O7kY.js";import{W as y,ak as u,Q as b,a2 as W,G as F,V as L,U as I,_ as q,a3 as A,a4 as B,X as G,al as H}from"./vendor-icons-NHF9HNeN.js";const U={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},g={hidden:{opacity:0,y:8},show:{opacity:1,y:0}};function M({skill:r,onToggle:i,onView:d}){return e.jsxs(n.div,{variants:g,className:`rounded-lg border flex flex-col transition-all ${r.enabled?"border-azure-primary/50 dark:border-matrix-primary bg-white dark:bg-zinc-900 shadow-sm":"border-azure-border dark:border-matrix-primary/30 bg-azure-surface/50 dark:bg-zinc-900 shadow-sm"}`,children:[e.jsxs("div",{className:"p-4 flex items-start gap-3 flex-1",children:[e.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center shrink-0 ${r.enabled?"bg-azure-primary/10 dark:bg-matrix-highlight/10":"bg-azure-surface dark:bg-zinc-900"}`,children:e.jsx(y,{className:`w-4 h-4 ${r.enabled?"text-azure-primary dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-tertiary"}`})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:`font-semibold truncate ${r.enabled?"text-azure-text dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-secondary"}`,children:r.name}),r.version&&e.jsxs("span",{className:"text-[10px] font-mono text-azure-text-secondary dark:text-matrix-tertiary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 rounded px-1.5 py-0.5 shrink-0",children:["v",r.version]}),!r.enabled&&e.jsx("span",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 bg-zinc-100 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded px-1.5 py-0.5 shrink-0",children:"disabled"})]}),e.jsx("p",{className:`text-sm mt-1.5 line-clamp-2 leading-relaxed ${r.enabled?"text-azure-text-secondary dark:text-matrix-secondary":"text-azure-text-secondary/70 dark:text-matrix-tertiary"}`,children:r.description}),r.tags&&r.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:r.tags.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-medium rounded border border-azure-primary/20 dark:border-matrix-primary/40 bg-azure-primary/5 dark:bg-matrix-primary/10 text-azure-primary dark:text-matrix-secondary",children:[e.jsx(L,{className:"w-2.5 h-2.5"}),t]},t))})]})]}),e.jsxs("div",{className:"px-4 py-3 border-t border-azure-border dark:border-matrix-primary/30 flex items-center justify-between gap-2",children:[r.author?e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-azure-text-secondary dark:text-matrix-tertiary min-w-0",children:[e.jsx(I,{className:"w-3 h-3 shrink-0"}),e.jsx("span",{className:"truncate",children:r.author})]}):e.jsx("div",{}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx("button",{onClick:d,className:"p-1.5 rounded border border-azure-border dark:border-matrix-primary/50 text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-primary dark:hover:text-matrix-highlight hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",title:"View details",children:e.jsx(q,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:i,className:`p-1.5 rounded border transition-colors ${r.enabled?"border-emerald-300 dark:border-emerald-700/60 text-emerald-500 dark:text-emerald-400 hover:bg-emerald-50 dark:hover:bg-emerald-900/20":"border-azure-border dark:border-matrix-primary/40 text-zinc-400 dark:text-zinc-600 hover:text-azure-text dark:hover:text-matrix-secondary hover:border-azure-border dark:hover:border-matrix-primary"}`,title:r.enabled?"Disable skill":"Enable skill",children:r.enabled?e.jsx(A,{className:"w-4 h-4"}):e.jsx(B,{className:"w-4 h-4"})})]})]})]})}function Q({skill:r,open:i,onOpenChange:d}){return!i||!r?null:e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>d(!1)}),e.jsxs("div",{className:"relative bg-white dark:bg-black border border-azure-border dark:border-matrix-primary rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 px-5 py-4 border-b border-azure-border dark:border-matrix-primary shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 flex items-center justify-center shrink-0",children:e.jsx(y,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h2",{className:"text-base font-semibold text-azure-text dark:text-matrix-highlight truncate",children:r.name}),r.version&&e.jsxs("span",{className:"text-[10px] font-mono text-azure-text-secondary dark:text-matrix-tertiary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 rounded px-1.5 py-0.5 shrink-0",children:["v",r.version]})]}),r.author&&e.jsxs("div",{className:"flex items-center gap-1 mt-0.5 text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:[e.jsx(I,{className:"w-3 h-3 shrink-0"}),r.author]})]})]}),e.jsx("button",{onClick:()=>d(!1),className:"p-1.5 rounded text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text dark:hover:text-matrix-highlight hover:bg-azure-surface dark:hover:bg-zinc-900 transition-colors shrink-0",children:e.jsx(G,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"overflow-y-auto flex-1 p-5 space-y-5",children:[r.description&&e.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary leading-relaxed",children:r.description}),e.jsx("div",{className:"flex flex-col gap-2",children:e.jsxs("div",{className:"flex items-start gap-2 text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:[e.jsx(H,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),e.jsx("span",{className:"break-all font-mono text-azure-text dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 rounded px-2 py-0.5",children:r.path})]})}),r.tags&&r.tags.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Tags"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.tags.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-medium rounded border border-azure-primary/20 dark:border-matrix-primary/40 bg-azure-primary/5 dark:bg-matrix-primary/10 text-azure-primary dark:text-matrix-secondary",children:[e.jsx(L,{className:"w-2.5 h-2.5"}),t]},t))})]}),r.examples&&r.examples.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Examples"}),e.jsx("ul",{className:"space-y-1.5",children:r.examples.map((t,x)=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-azure-text-secondary dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/30 rounded px-3 py-2",children:[e.jsxs("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary font-mono text-xs mt-0.5 shrink-0",children:[x+1,"."]}),t]},x))})]}),r.content&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"SKILL.md"}),e.jsx("pre",{className:"rounded-lg bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 p-4 text-xs text-azure-text-secondary dark:text-matrix-secondary overflow-auto max-h-72 whitespace-pre-wrap leading-relaxed font-mono",children:r.content})]})]})]})]})}function ae(){const[r,i]=s.useState(null),[d,t]=s.useState(!1),[x,N]=s.useState(!1),[o,v]=s.useState(!1),[c,k]=s.useState(null),[w,f]=s.useState(null),j=s.useRef(null),{data:S,mutate:z,isLoading:D}=Z("/skills",()=>l.fetchSkills(),{refreshInterval:1e4}),m=S?.skills??[],E=S?.enabled??0,R=async()=>{await l.reloadSkills(),z()},T=async a=>{a.enabled?await l.disableSkill(a.name):await l.enableSkill(a.name),z()},$=async a=>{t(!0);try{const p=await l.fetchSkill(a.name);i(p)}finally{t(!1)}},P=async a=>{const p=a.target.files?.[0];if(p){k(null),f(null),v(!0);try{const h=await l.uploadSkill(p);f(`Skill "${h.skill.name}" uploaded successfully!`),z(),j.current&&(j.current.value="")}catch(h){k({error:h.message||"Upload failed",details:h.details})}finally{v(!1)}}},C=()=>{k(null),f(null),N(!0)};return e.jsxs(n.div,{variants:U,initial:"hidden",animate:"show",className:"space-y-6",children:[e.jsxs(n.div,{variants:g,className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:e.jsx(y,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Skills"}),e.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:[m.length," skill",m.length!==1?"s":"",", ",E," enabled"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:C,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-azure-primary dark:border-matrix-primary text-azure-primary dark:text-matrix-primary font-medium hover:bg-azure-primary/10 dark:hover:bg-matrix-primary/10 transition-colors",children:[e.jsx(u,{className:"w-4 h-4"}),"Upload"]}),e.jsxs("button",{onClick:R,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-black font-medium hover:opacity-90 transition-opacity",children:[e.jsx(b,{className:"w-4 h-4"}),"Reload"]})]})]}),D?e.jsxs(n.div,{variants:g,className:"text-center py-12",children:[e.jsx(b,{className:"w-8 h-8 animate-spin mx-auto text-azure-text-secondary dark:text-matrix-dim"}),e.jsx("p",{className:"mt-2 text-azure-text-secondary dark:text-matrix-dim",children:"Loading skills..."})]}):m.length===0?e.jsxs(n.div,{variants:g,className:"rounded-lg border border-dashed border-azure-border dark:border-matrix-primary p-8 text-center",children:[e.jsx(y,{className:"w-12 h-12 mx-auto text-azure-text-tertiary dark:text-matrix-dim"}),e.jsx("h3",{className:"mt-4 text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:"No skills found"}),e.jsxs("p",{className:"mt-2 text-azure-text-secondary dark:text-matrix-secondary max-w-md mx-auto",children:["Upload a skill ZIP or add skills manually to"," ",e.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"~/.morpheus/skills/"}),". Each skill folder must contain a"," ",e.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"SKILL.md"})," file with frontmatter."]}),e.jsxs("button",{onClick:C,className:"mt-4 inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-black font-medium hover:opacity-90 transition-opacity",children:[e.jsx(u,{className:"w-4 h-4"}),"Upload Skill"]})]}):e.jsx(n.div,{variants:U,initial:"hidden",animate:"show",className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:m.map(a=>e.jsx(M,{skill:a,onToggle:()=>T(a),onView:()=>$(a)},a.name))}),e.jsx(Q,{skill:r,open:!!r,onOpenChange:a=>!a&&i(null)}),e.jsxs(K,{open:x,onOpenChange:N,children:[e.jsx(O,{children:e.jsx(V,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(u,{className:"w-5 h-5"}),"Upload Skill"]})})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-azure-text-secondary dark:text-matrix-secondary text-sm",children:["Upload a ZIP file containing your skill folder. The ZIP must have exactly one folder at root level with a valid ",e.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"SKILL.md"})," file."]}),e.jsxs("div",{className:"border-2 border-dashed border-azure-border dark:border-matrix-primary rounded-lg p-6",children:[e.jsx("input",{ref:j,type:"file",accept:".zip,application/zip,application/x-zip-compressed",onChange:P,disabled:o,className:"hidden",id:"skill-upload-input"}),e.jsxs("label",{htmlFor:"skill-upload-input",className:`flex flex-col items-center gap-2 cursor-pointer ${o?"opacity-50 cursor-not-allowed":""}`,children:[o?e.jsx(b,{className:"w-8 h-8 animate-spin text-azure-primary dark:text-matrix-primary"}):e.jsx(u,{className:"w-8 h-8 text-azure-text-tertiary dark:text-matrix-dim"}),e.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:o?"Uploading...":"Click to select ZIP file"})]})]}),c&&e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800",children:[e.jsx(W,{className:"w-5 h-5 text-red-600 dark:text-red-400 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:c.error}),c.details&&e.jsx("p",{className:"text-xs text-red-600 dark:text-red-300 mt-1",children:c.details})]})]}),w&&e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800",children:[e.jsx(F,{className:"w-5 h-5 text-green-600 dark:text-green-400"}),e.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:w})]}),e.jsxs("div",{className:"rounded-lg bg-azure-hover dark:bg-zinc-900 p-3",children:[e.jsx("h4",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight mb-2",children:"ZIP Structure Example"}),e.jsx("pre",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:`my-skill.zip
|
|
2
|
-
└── my-skill/
|
|
3
|
-
├── SKILL.md (required)
|
|
4
|
-
├── scripts/ (optional)
|
|
5
|
-
│ └── script.js
|
|
6
|
-
└── examples/ (optional)
|
|
7
|
-
└── output.txt`})]})]})]}),d&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:e.jsx(b,{className:"w-8 h-8 animate-spin text-white"})})]})}export{ae as SkillsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,m as l}from"./vendor-motion-C3CZ8ZlO.js";import{r as s}from"./vendor-react-DikRIOlj.js";import{u as S}from"./vendor-utils-D4NnWbOU.js";import{t as m}from"./index-BcX5O7kY.js";import{P as B}from"./Pagination-BHZKk42X.js";import{u as E}from"./agents-B1z_dlQC.js";import{f as D,Q as O,_ as M,ab as K,p as W,q as _,r as X,g as q,X as Q,a2 as U}from"./vendor-icons-NHF9HNeN.js";const V={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},u={hidden:{opacity:0,y:8},show:{opacity:1,y:0}},G={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"};function F({status:r}){const t="inline-flex items-center gap-1 text-xs font-medium rounded-full px-2 py-0.5 border";return r==="completed"?e.jsxs("span",{className:`${t} text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-900/20 border-emerald-200 dark:border-emerald-700/50`,children:[e.jsx(W,{className:"w-3 h-3"}),"Completed"]}):r==="failed"?e.jsxs("span",{className:`${t} text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-700/50`,children:[e.jsx(_,{className:"w-3 h-3"}),"Failed"]}):r==="running"?e.jsxs("span",{className:`${t} text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-700/50`,children:[e.jsx(X,{className:"w-3 h-3 animate-spin"}),"Running"]}):r==="cancelled"?e.jsxs("span",{className:`${t} text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-900 border-zinc-200 dark:border-zinc-700`,children:[e.jsx(_,{className:"w-3 h-3"}),"Cancelled"]}):e.jsxs("span",{className:`${t} text-yellow-600 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-700/50`,children:[e.jsx(q,{className:"w-3 h-3"}),"Pending"]})}function R({agent:r}){return e.jsx("span",{className:"inline-flex items-center text-[10px] font-medium font-mono rounded px-1.5 py-0.5 border border-azure-primary/20 dark:border-matrix-primary/40 bg-azure-primary/5 dark:bg-matrix-primary/10 text-azure-primary dark:text-matrix-secondary uppercase",children:r})}function $({channel:r}){return e.jsx("span",{className:"inline-flex items-center text-[10px] font-medium rounded px-1.5 py-0.5 border border-zinc-200 dark:border-zinc-700 bg-zinc-100 dark:bg-zinc-900 text-zinc-500 dark:text-zinc-400 uppercase",children:r})}const P=r=>r?new Date(r).toLocaleString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"—",A=r=>r?new Date(r).toLocaleString():"—";function H({task:r,onClose:t,onCancel:o,onRetry:k}){const h=r.status==="pending"||r.status==="running",d=r.status==="failed";return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),e.jsxs("div",{className:"relative bg-white dark:bg-black border border-azure-border dark:border-matrix-primary rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 px-5 py-4 border-b border-azure-border dark:border-matrix-primary shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 flex items-center justify-center shrink-0",children:e.jsx(D,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h2",{className:"text-base font-semibold text-azure-text dark:text-matrix-highlight",children:"Task Details"}),e.jsx(F,{status:r.status})]}),e.jsx("p",{className:"text-xs font-mono text-azure-text-secondary dark:text-matrix-tertiary mt-0.5 truncate",children:r.id})]})]}),e.jsx("button",{onClick:t,className:"p-1.5 rounded text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text dark:hover:text-matrix-highlight hover:bg-azure-surface dark:hover:bg-zinc-900 transition-colors shrink-0",children:e.jsx(Q,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"overflow-y-auto flex-1 p-5 space-y-5",children:[e.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2 text-sm",children:[{label:"Agent",value:e.jsx(R,{agent:r.agent})},{label:"Channel",value:e.jsx($,{channel:r.origin_channel})},{label:"Attempts",value:`${r.attempt_count} / ${r.max_attempts}`},{label:"Session",value:e.jsx("span",{className:"font-mono text-xs",children:r.session_id})},{label:"Created",value:A(r.created_at)},{label:"Finished",value:A(r.finished_at)}].map(({label:p,value:c})=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary",children:p}),e.jsx("span",{className:"text-azure-text dark:text-matrix-secondary",children:c})]},p))}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Input"}),e.jsx("pre",{className:"rounded-lg bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 p-4 text-xs text-azure-text-secondary dark:text-matrix-secondary overflow-auto max-h-48 whitespace-pre-wrap leading-relaxed font-mono",children:r.input})]}),r.output&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Output"}),e.jsx("pre",{className:"rounded-lg bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 p-4 text-xs text-azure-text-secondary dark:text-matrix-secondary overflow-auto max-h-64 whitespace-pre-wrap leading-relaxed font-mono",children:r.output})]}),r.error&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-red-500 mb-2 flex items-center gap-1",children:[e.jsx(U,{className:"w-3 h-3"})," Error"]}),e.jsx("pre",{className:"rounded-lg bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-800/50 p-4 text-xs text-red-600 dark:text-red-400 overflow-auto max-h-48 whitespace-pre-wrap leading-relaxed font-mono",children:r.error})]})]}),(h||d)&&e.jsxs("div",{className:"flex justify-end gap-2 px-5 py-4 border-t border-azure-border dark:border-matrix-primary shrink-0",children:[h&&e.jsx("button",{onClick:o,className:"px-4 py-2 rounded text-sm border border-red-300 dark:border-red-700/60 text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:"Cancel Task"}),d&&e.jsx("button",{onClick:k,className:"px-4 py-2 rounded text-sm font-medium bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 transition-colors",children:"Retry Task"})]})]})]})}const J={Pending:"text-yellow-600 dark:text-yellow-400",Running:"text-blue-600 dark:text-blue-400",Completed:"text-emerald-600 dark:text-emerald-400",Failed:"text-red-600 dark:text-red-400",Cancelled:"text-zinc-500 dark:text-zinc-400",Total:"text-azure-text dark:text-matrix-highlight"};function n({label:r,value:t}){return e.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black px-4 py-3",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary",children:r}),e.jsx("p",{className:`text-2xl font-bold mt-0.5 ${J[r]??"text-azure-text dark:text-matrix-secondary"}`,children:t})]})}function de(){const[r,t]=s.useState(""),[o,k]=s.useState(""),{getSubagents:h}=E(),[d,p]=s.useState(""),[c,T]=s.useState(""),[b,g]=s.useState(null),[f,v]=s.useState(1),[w,I]=s.useState(20),z=s.useMemo(()=>({status:r||void 0,agent:o||void 0,origin_channel:d||void 0,session_id:c.trim()||void 0,page:f,per_page:w}),[r,o,d,c,f,w]),y=()=>v(1),{data:i}=S("/tasks/stats",()=>m.stats(),{refreshInterval:5e3}),{data:x,mutate:N}=S(["/tasks",z],()=>m.list(z),{refreshInterval:3e3}),C=x?.data??[],j="px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-white dark:bg-black text-azure-text dark:text-matrix-secondary text-sm focus:outline-none focus:border-azure-primary dark:focus:border-matrix-highlight";return e.jsxs(l.div,{variants:V,initial:"hidden",animate:"show",className:"space-y-6",children:[e.jsxs(l.div,{variants:u,className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:e.jsx(D,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Tasks"}),e.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Async tasks delegated by Oracle and processed by workers."})]})]}),e.jsxs(l.div,{variants:u,className:"grid grid-cols-3 md:grid-cols-6 gap-3",children:[e.jsx(n,{label:"Pending",value:i?.pending??0}),e.jsx(n,{label:"Running",value:i?.running??0}),e.jsx(n,{label:"Completed",value:i?.completed??0}),e.jsx(n,{label:"Failed",value:i?.failed??0}),e.jsx(n,{label:"Cancelled",value:i?.cancelled??0}),e.jsx(n,{label:"Total",value:i?.total??0})]}),e.jsxs(l.div,{variants:u,className:"rounded-lg border border-azure-border dark:border-matrix-primary p-4 bg-white dark:bg-black grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[e.jsxs("select",{className:j,value:r,onChange:a=>{t(a.target.value||""),y()},children:[e.jsx("option",{value:"",children:"All status"}),Object.entries(G).map(([a,L])=>e.jsx("option",{value:a,children:L},a))]}),e.jsxs("select",{className:j,value:o,onChange:a=>{k(a.target.value||""),y()},children:[e.jsx("option",{value:"",children:"All agents"}),h().map(a=>e.jsx("option",{value:a.agentKey,children:a.label},a.agentKey))]}),e.jsxs("select",{className:j,value:d,onChange:a=>{p(a.target.value||""),y()},children:[e.jsx("option",{value:"",children:"All channels"}),e.jsx("option",{value:"telegram",children:"Telegram"}),e.jsx("option",{value:"discord",children:"Discord"}),e.jsx("option",{value:"ui",children:"UI"}),e.jsx("option",{value:"api",children:"API"}),e.jsx("option",{value:"webhook",children:"Webhook"}),e.jsx("option",{value:"cli",children:"CLI"})]}),e.jsx("input",{className:`${j} placeholder:text-azure-text-secondary/50 dark:placeholder:text-matrix-secondary/40`,value:c,onChange:a=>{T(a.target.value),y()},placeholder:"Filter by session ID"})]}),e.jsx(l.div,{variants:u,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm min-w-[820px]",children:[e.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:e.jsx("tr",{children:[{label:"ID",cls:"w-24"},{label:"Status",cls:"w-32"},{label:"Agent",cls:"w-24"},{label:"Channel",cls:"w-24"},{label:"Session",cls:"w-28"},{label:"Attempts",cls:"w-20"},{label:"Created",cls:"w-36"},{label:"Finished",cls:"w-36"},{label:"",cls:"w-16"}].map(a=>e.jsx("th",{className:`text-left px-4 py-3 text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary ${a.cls}`,children:a.label},a.label))})}),e.jsx("tbody",{children:C.length===0?e.jsx("tr",{children:e.jsxs("td",{colSpan:9,className:"px-4 py-12 text-center text-azure-text-secondary dark:text-matrix-tertiary",children:[e.jsx(O,{className:"w-5 h-5 mx-auto mb-2 opacity-40"}),"No tasks found."]})}):C.map(a=>e.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/60 dark:hover:bg-zinc-900/50 transition-colors",children:[e.jsx("td",{className:"px-4 py-3 font-mono text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:a.id.slice(0,8)}),e.jsx("td",{className:"px-4 py-3",children:e.jsx(F,{status:a.status})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx(R,{agent:a.agent})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx($,{channel:a.origin_channel})}),e.jsx("td",{className:"px-4 py-3 font-mono text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:a.session_id?a.session_id.slice(0,10):"—"}),e.jsxs("td",{className:"px-4 py-3 text-center text-azure-text-secondary dark:text-matrix-secondary text-xs",children:[a.attempt_count,"/",a.max_attempts]}),e.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-secondary whitespace-nowrap",children:P(a.created_at)}),e.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-secondary whitespace-nowrap",children:P(a.finished_at)}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>g(a),className:"p-1.5 rounded border border-azure-border dark:border-matrix-primary/50 text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-primary dark:hover:text-matrix-highlight hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",title:"View details",children:e.jsx(M,{className:"w-3.5 h-3.5"})}),(a.status==="pending"||a.status==="running")&&e.jsx("button",{onClick:async()=>{await m.cancel(a.id),N()},className:"p-1.5 rounded border border-red-200 dark:border-red-800/50 text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 hover:text-red-500 transition-colors",title:"Cancel task",children:e.jsx(K,{className:"w-3.5 h-3.5"})})]})})]},a.id))})]})})}),x&&x.total_pages>1&&e.jsx(l.div,{variants:u,children:e.jsx("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black",children:e.jsx(B,{page:f,totalPages:x.total_pages,perPage:w,total:x.total,onPageChange:v,onPerPageChange:a=>{I(a),v(1)}})})}),b&&e.jsx(H,{task:b,onClose:()=>g(null),onCancel:async()=>{await m.cancel(b.id),g(null),N()},onRetry:async()=>{await m.retry(b.id),g(null),N()}})]})}export{de as TasksPage};
|