@xopcai/xopc 0.0.192 → 0.0.193
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/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-B-tzXpDD.js → activity-store-BwmdJ5pv.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-xOu0qNwc.js → agent-avatar-dicebear-DmNq0t2n.js} +1 -1
- package/dist/gateway/static/root/assets/agents-BOo1rVn9.js +68 -0
- package/dist/gateway/static/root/assets/{api-fMItZb-h.js → api-BM1hNzjw.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-D6Rv3OWI.js → app-management-settings-panel-B3xStqSX.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CKoNCwco.js → appearance-settings-DglyenDq.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DC9qPFTx.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BokNQBwH.js → archive-plugin-DvtcrBss.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-Dx1HglsM.js → attachment-load-CALdq4xM.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-BIGGKb0T.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CPYAflIG.js → binary-plugins-GaVuvrDI.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BFLgl8SS.js → block-editor-C2KrMYa_.js} +47 -47
- package/dist/gateway/static/root/assets/browser-settings-page-CPW_E-xj.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-CqLnqA9z.js → browser-workflow-inputs-FfEEjhIS.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-Db5v3HtE.js → browser-workflows-page-DFP9_UQk.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CsD8aGHU.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-lov0J9A2.js → capability-presets-api-BoOzFotX.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-NCeyWH6Z.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-DSJznouK.js → channel-recipient-api-_8IiTxRB.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-CknzwxNC.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-DPaJSYX_.js +1 -0
- package/dist/gateway/static/root/assets/{connectors-api-3ccRyS3L.js → connectors-api-vaSrhPF8.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DEGE7xp_.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-C9hhCiuo.js → cron-expression-BjFuXlGY.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CTtZFZug.js → dependency-picker-DOdkHdPv.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DOUeNVmC.js → desktop-pet-Dz-Yf8Uu.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-D4704vtl.js → desktop-pet-settings-C8EHFEtd.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DJDXeA1B.js → directory-picker-path-field-DKbfmZlZ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-C0n2NMF1.js → extension-debug-page-Dq0xsr_e.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-vG-xxRNs.js → extension-page-IgSLUyWP.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CtuY2THd.js → extension-settings-page-VC-8Pjn2.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-CZra7GuI.js → gateway-config-api-CH2R7yqo.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-Cz33jRkR.js → gateway-settings-DLQJWaBQ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BbVV0udv.js → gateway-startup-retry--2njcDpC.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-D2XMlA_U.js → heartbeat-settings-43loWoGb.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DqvpI6LC.js +3 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BgrOvhaJ.js → image-generation-api-Cki7jfEV.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DzmbmOGA.js → index-BpkdvHH0.js} +61 -61
- package/dist/gateway/static/root/assets/index-CFVjH-EK.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BfyAEG1G.js → keyboard-shortcuts-settings-DJDZes_8.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CvNQM6qm.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BYalcRSY.js → local-apps-page-C2ajOn1D.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-VOY1wMO9.js → locale-store-Bjvw7jtg.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-BLm5yWqQ.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-BQf-6s32.js → management-settings--_eXnFVr.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-Cy_2SN1Q.js → markdown-split-iL2oi-x2.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CkDupqb2.js → media-plugins-BIbkLVpQ.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-DMJ-6-1m.js → messages-DQ5X6cXp.js} +2 -2
- package/dist/gateway/static/root/assets/{notes-page-kiGRR9jo.js → notes-page-xFxaZ6gT.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-PAftxL3V.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-CvzSdYVj.js → page-tabs-CROi9zm1.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-kZ0nco7e.js → preview-open-alternatives-BwYcPjOM.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-DgoieqQC.js → product-open-page-BezeuVFd.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CCdfZcw-.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DOG9zm5e.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-DQBFgveI.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Bud_NTEZ.js → runtime-tools-settings-panel-Bs6tpSyX.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-GlbsCBmv.js → schema-form-CWoSjz9s.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-Db6L6M2H.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CcO2bd6q.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CKLns16d.js → settings-form-section-BJaMEHsX.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-BDzpxgk0.js → settings-loading-skeleton-sn4k17x7.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BH0pF7QB.js → settings-page-D2hfeFPX.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-J793iqfm.js → settings-page-layout-CLtUsWsu.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-UmQC_uZ1.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-UTm_7r0l.js → share-preview-page-BJ58AluH.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BZKn6Fdc.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-Cx3i24w_.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DjUllGtk.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-Bwid1TGB.js → skills-page.utils-CZYIuE26.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-DUrgdQMk.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-BGG2cFe9.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-GVZOImyb.js → theme-store-DtxpMC5S.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-CT2c85Ju.js → typed-models-lib-CRNMvvFX.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-CcvY7DTh.js → use-autosave-Dle3-zdQ.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-BLLmw5S1.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-Ricc3QGo.js → voice-api-key-field-BrWH0dCl.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BoomfqhX.js → work-discovery-overlay-BZ1l9CFM.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BnPF2vx7.js +1 -0
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-BK6e9yzK.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-Bp5JxQJa.js +5 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/gateway/static/root/notification-sw.js +15 -0
- package/dist/package.js +1 -1
- package/dist/src/auth/oauth/xopc-cloud.js +163 -7
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/routes/workflows.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +21 -8
- package/dist/src/heartbeat/index.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agents-CxuwvDk0.js +0 -68
- package/dist/gateway/static/root/assets/apps-page-wAb5dnHZ.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-Drgazevs.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DmYlFJW7.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-D7Z8T0o5.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-COjnwO0U.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-DcRYBNN7.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-C2UYdebT.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-FVmvBG9H.js +0 -2
- package/dist/gateway/static/root/assets/home-page-CPrHkPN6.js +0 -3
- package/dist/gateway/static/root/assets/index-Cg7Xnlu3.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Clz47vSr.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-Cxq9WMf5.js +0 -2
- package/dist/gateway/static/root/assets/notes-workbench-DkYkPGyB.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-CeSjJd-N.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-fZ1rm4b9.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CbYI6KC8.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-sOJ_TnLm.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BI0u77dt.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CGsml89P.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BM--lgUS.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CGCOC-rV.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-iLyaOl48.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-BcB3p1e3.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DQYEf08v.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-CGI41bfO.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-mbnepbQk.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-DSWG2xqL.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-DtV0ruyk.js +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as a}from"./cn-JdwAhgNB.js";import{t as o}from"./messages-DMJ-6-1m.js";import{l as s,n as c,r as l,s as u}from"./locale-store-VOY1wMO9.js";import{i as d}from"./vendor-swr-BIWyz7Rc.js";import{$l as f,Bs as p,Gl as m,Kl as h,Lc as g,Sr as _,bn as v,el as y,fo as b,js as x,ls as S,nu as C,oc as ee,sn as w,ss as T,wu as E,ya as D,yn as O}from"./index-DzmbmOGA.js";import{n as k,r as A}from"./settings-page-layout-J793iqfm.js";import{n as j}from"./settings-loading-skeleton-BDzpxgk0.js";import{n as M,t as N}from"./settings-form-section-CKLns16d.js";var P=e(t(),1),F=n();function I(e){if(!e||typeof e!=`object`)return 0;let t=e.providers;return!t||typeof t!=`object`||Array.isArray(t)?0:Object.values(t).filter(e=>typeof e==`string`&&T(e)).length}function L(e){if(!e||typeof e!=`object`)return``;let t=e.agents;if(!t||typeof t!=`object`||Array.isArray(t))return``;let n=t,r=typeof n.defaultPreset==`string`&&n.defaultPreset.trim()?n.defaultPreset.trim():`default`,i=n.capabilityPresets,a=i&&typeof i==`object`&&!Array.isArray(i)?i[r]:void 0,o=a&&typeof a==`object`&&!Array.isArray(a)?a.models:void 0;if(!o||typeof o!=`object`||Array.isArray(o))return``;let s=o,c=s.roles;if(!c||typeof c!=`object`||Array.isArray(c))return``;let l=c,u=typeof s.defaultRole==`string`&&s.defaultRole.trim()?s.defaultRole.trim():Object.keys(l)[0],d=u?l[u]:void 0;if(!d||typeof d!=`object`||Array.isArray(d))return``;let f=d.model;return typeof f==`string`?f.trim():``}function R(e){if(!e||typeof e!=`object`)return!1;let t=e.channels;return!t||typeof t!=`object`||Array.isArray(t)?!1:Object.values(t).some(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;if(`configured`in t||`config`in t||`schema`in t||`uiHints`in t){if(t.configured===!0)return!0;let e=t.config;if(!e||typeof e!=`object`||Array.isArray(e))return!1;let n=e;return n.enabled===!0||Object.keys(n).length>0}return t.enabled===!0||Object.keys(t).length>0})}function z(e){if(!e||typeof e!=`object`)return{enabled:!1,backend:`extension`};let t=e.browser;if(!t||typeof t!=`object`||Array.isArray(t))return{enabled:!1,backend:`extension`};let n=t;return{enabled:n.enabled===!0,backend:typeof n.backend==`string`&&n.backend.trim()?n.backend.trim():`extension`}}function B(e){return e?`pass`:`fail`}function V(e){if(e===`provider-auth`)return`/settings/capabilities/models`;if(e===`config-health`)return`/settings/gateway`;if(e===`state-integrity`||e===`workspace-status`)return`/agents`;if(e===`database-schema`||e===`session-integrity`)return`/settings/sessions`;if(e===`channel-config`||e===`channel-pairing-pending`||e.startsWith(`channel:`))return`/channels`;if(e===`security-audit`||e===`gateway-service`||e===`gateway-health`)return`/settings/gateway`;if(e===`version-check`)return`/settings/desktop-app`}function H(e){return{fail:4,warn:3,skip:2,pass:1}[e]}function te(e){return e.filter(e=>e.status===`fail`||e.status===`warn`).map(e=>({id:e.id,label:e.label,status:e.status,message:e.message,hints:e.hints,path:V(e.id),source:`doctor`})).toSorted((e,t)=>H(t.status)-H(e.status)||e.label.localeCompare(t.label))}function U(e){let t=new Map(e.doctorChecks.map(e=>[e.id,e])),n=[];for(let e of[`security-audit`,`channel-config`,`channel-pairing-pending`,`gateway-health`]){let r=t.get(e);r&&n.push({id:r.id,label:r.label,status:r.status,message:r.message,path:V(r.id)})}if(e.logsHealth){let t=e.logsHealth.stats?.errorsLast24h??0;n.push({id:`logs-health`,label:`Logs`,status:e.logsHealth.shuttingDown||t>0?`warn`:`pass`,message:e.logsHealth.shuttingDown?`Logger is shutting down.`:t>0?`${t} error(s) in the last 24 hours.`:`Log system is healthy.`,path:`/settings/logs`})}for(let t of e.browserDiagnostics??[])n.push(t);return n}function ne(e){let t=I(e.config),n=e.providerMeta?.configured??t,r=e.providerMeta?.total??0,i=n>0||t>0,a=L(e.config),o=a.length>0,s=e.hasToken&&e.realtimeConnected,c=R(e.config),l=e.skillCount>0,u=e.doctorChecks??[],d=te(u),f=[{id:`gateway`,done:s,detail:s?e.labels.gatewayOnline:e.labels.gatewayOffline},{id:`provider`,done:i,detail:i?e.providerMeta&&e.providerMeta.total>0?e.labels.providersMetaReady(n,r):e.labels.providersConfigured(t):e.labels.providersMissing},{id:`defaultModel`,done:o,detail:o?e.labels.modelConfigured(a):e.labels.modelMissing},{id:`channel`,done:c,optional:!0,detail:c?e.labels.channelConfigured:e.labels.channelMissing},{id:`skill`,done:l,optional:!0,detail:l?e.labels.skillsConfigured(e.skillCount):e.labels.skillsMissing}],p=f.filter(e=>!e.optional).every(e=>e.done),m=f.every(e=>e.done),h=[{id:`gateway`,status:B(s),title:`Gateway`,detail:s?e.labels.gatewayOnline:e.labels.gatewayOffline,path:`/settings/gateway`},{id:`provider`,status:B(i),title:`Model provider`,detail:i?e.providerMeta&&e.providerMeta.total>0?e.labels.providersMetaReady(n,r):e.labels.providersConfigured(t):e.labels.providersMissing,path:`/settings/capabilities/models`},{id:`defaultModel`,status:B(o),title:`Default model`,detail:o?e.labels.modelConfigured(a):e.labels.modelMissing,path:`/settings/capabilities/models`},{id:`ready`,status:p?`pass`:`fail`,title:`Chat readiness`,detail:p?e.labels.readyToChat:e.labels.modelMissing,path:`/chat`}],g=d.some(e=>e.status===`fail`),_=d.some(e=>e.status===`warn`),v=g?`blocked`:_?`attention`:p?`ready`:`setup`,y=U({doctorChecks:u,logsHealth:e.logsHealth,browserDiagnostics:e.browserDiagnostics});return{gatewayConnected:s,providerConfigured:i,providerCount:t,providerMetaConfigured:n,providerMetaTotal:r,defaultModel:a,defaultModelConfigured:o,channelConfigured:c,skillInstalled:l,skillCount:e.skillCount,checklist:f,readiness:h,issues:d,healthTier:v,diagnosticSignals:y,requiredComplete:p,allComplete:m}}function re(e){return z(e)}function W(e){return!e.id||!e.label||!e.status||!e.message||![`pass`,`warn`,`fail`,`skip`].includes(e.status)?null:{id:e.id,label:e.label,status:e.status,message:e.message,hints:Array.isArray(e.hints)?e.hints.filter(e=>typeof e==`string`):[],fixed:e.fixed===!0,findings:Array.isArray(e.findings)?e.findings:void 0}}function ie(){return l(`/api/doctor`)}async function ae(){return((await u(ie())).checks??[]).map(W).filter(e=>e!==null)}function oe(){return l(`/api/logs/health`)}async function se(){return u(oe())}function G(e){return e?`pass`:`warn`}function K(e){return`/settings/agent-browser?tab=${encodeURIComponent(e)}`}function ce(e){return e?.enabled?[`setup-browser-diagnostics`,e]:null}async function q(e){if(!e.enabled)return[];if(e.backend===`local`){let e=await u(l(`/api/browser/playwright/doctor`)),t=e.payload?.installed===!0;return[{id:`browser-playwright`,label:`Browser: Playwright`,status:G(t),message:t?`Local Chromium is installed.`:e.payload?.reason??`Local Chromium is not installed.`,path:K(`local`)}]}if(e.backend===`cloakbrowser`){let e=await u(l(`/api/browser/cloakbrowser/doctor`)),t=e.payload?.installed===!0;return[{id:`browser-cloakbrowser`,label:`Browser: CloakBrowser`,status:G(t),message:t?`CloakBrowser ${e.payload?.version??``}`.trim():`CloakBrowser is not installed.`,path:K(`cloakbrowser`)}]}if(e.backend===`extension`){let e=await u(l(`/api/browser/extension-status?probe=true`)),t=e.artifacts?.installed===!0,n=e.connected===!0,r=e.artifacts?.needsRefresh===!0||e.artifacts?.needsChromeReload===!0;return[{id:`browser-extension`,label:`Browser: Chrome extension`,status:n?`pass`:`warn`,message:n?`Chrome extension bridge is connected.`:t?r?`Chrome extension needs refresh.`:`Chrome extension is installed but not connected.`:`Chrome extension is not installed.`,path:K(`extension`)}]}return[{id:`browser-playwright`,label:`Browser`,status:`skip`,message:`Browser backend "${e.backend}" is not checked on this overview.`,path:K(e.backend||`overview`)}]}function J(){let e=(0,F.c)(57),t=s(me),n=c(pe),r;e[0]===n?r=e[1]:(r=o(n),e[0]=n,e[1]=r);let i=r,a=i.setupStatus.labels,l=D(fe),{data:u,error:f,isLoading:p,mutate:m}=b(!!t),h;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(h={revalidateOnFocus:!1},e[2]=h):h=e[2];let{data:g,error:_,isLoading:y,mutate:x}=d(t?`setup-checklist-skills`:null,de,h),S;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(S={revalidateOnFocus:!1},e[3]=S):S=e[3];let{data:C,error:ee,isLoading:T,mutate:E}=d(t?`setup-checklist-provider-meta`:null,w,S),k;e[4]===t?k=e[5]:(k=t?ie():null,e[4]=t,e[5]=k);let A;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(A={revalidateOnFocus:!1},e[6]=A):A=e[6];let{data:j,error:M,isLoading:N,mutate:P}=d(k,ae,A),I;e[7]===t?I=e[8]:(I=t?oe():null,e[7]=t,e[8]=I);let L;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(L={revalidateOnFocus:!1},e[9]=L):L=e[9];let{data:R,isLoading:z,mutate:B}=d(I,se,L);u?.payload?.config;let V=u?.payload?.config,H;e[10]===V?H=e[11]:(H=re(V),e[10]=V,e[11]=H);let te=t?H:null,U;e[12]===te?U=e[13]:(U=ce(te),e[12]=te,e[13]=U);let W;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(W={revalidateOnFocus:!1},e[14]=W):W=e[14];let{data:G,isLoading:K,mutate:q}=d(U,ue,W),J;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(J={revalidateOnFocus:!1},e[15]=J):J=e[15],d(t?O:null,v,J);let Y=!t||!p&&!y&&!T&&!N&&!z&&!K,X=!!(f||_||ee||M),Z;bb0:{if(!t||!Y){Z=null;break bb0}let n=g?.catalog?.length??0,r;if(e[16]!==G||e[17]!==u?.payload?.config||e[18]!==j||e[19]!==a.channelConfigured||e[20]!==a.channelMissing||e[21]!==a.gatewayOffline||e[22]!==a.gatewayOnline||e[23]!==a.modelConfigured||e[24]!==a.modelMissing||e[25]!==a.providersConfigured||e[26]!==a.providersMetaReady||e[27]!==a.providersMissing||e[28]!==a.skillsConfigured||e[29]!==a.skillsMissing||e[30]!==R||e[31]!==i.setupStatus.requiredCompleteMessage||e[32]!==C||e[33]!==l||e[34]!==n||e[35]!==t){let o=C?.filter(le).length??0,s=C?.length??0,c;e[37]===a.providersConfigured?c=e[38]:(c=e=>a.providersConfigured.replace(`{{count}}`,String(e)),e[37]=a.providersConfigured,e[38]=c);let d;e[39]===a.providersMetaReady?d=e[40]:(d=(e,t)=>a.providersMetaReady.replace(`{{configured}}`,String(e)).replace(`{{total}}`,String(t)),e[39]=a.providersMetaReady,e[40]=d);let f;e[41]===a.modelConfigured?f=e[42]:(f=e=>a.modelConfigured.replace(`{{model}}`,e),e[41]=a.modelConfigured,e[42]=f);let p;e[43]===a.skillsConfigured?p=e[44]:(p=e=>a.skillsConfigured.replace(`{{count}}`,String(e)),e[43]=a.skillsConfigured,e[44]=p),r=ne({hasToken:!!t,realtimeConnected:l,config:u?.payload?.config,skillCount:n,providerMeta:s>0?{configured:o,total:s}:null,doctorChecks:j,logsHealth:R,browserDiagnostics:G,labels:{gatewayOnline:a.gatewayOnline,gatewayOffline:a.gatewayOffline,providersConfigured:c,providersMetaReady:d,providersMissing:a.providersMissing,modelConfigured:f,modelMissing:a.modelMissing,channelConfigured:a.channelConfigured,channelMissing:a.channelMissing,skillsConfigured:p,skillsMissing:a.skillsMissing,readyToChat:i.setupStatus.requiredCompleteMessage}}),e[16]=G,e[17]=u?.payload?.config,e[18]=j,e[19]=a.channelConfigured,e[20]=a.channelMissing,e[21]=a.gatewayOffline,e[22]=a.gatewayOnline,e[23]=a.modelConfigured,e[24]=a.modelMissing,e[25]=a.providersConfigured,e[26]=a.providersMetaReady,e[27]=a.providersMissing,e[28]=a.skillsConfigured,e[29]=a.skillsMissing,e[30]=R,e[31]=i.setupStatus.requiredCompleteMessage,e[32]=C,e[33]=l,e[34]=n,e[35]=t,e[36]=r}else r=e[36];Z=r}let he=Z,Q;e[45]!==q||e[46]!==m||e[47]!==P||e[48]!==B||e[49]!==E||e[50]!==x?(Q=async()=>{await Promise.all([m(),x(),E(),P(),B(),q()])},e[45]=q,e[46]=m,e[47]=P,e[48]=B,e[49]=E,e[50]=x,e[51]=Q):Q=e[51];let ge=Q,$;return e[52]!==X||e[53]!==Y||e[54]!==ge||e[55]!==he?($={ready:Y,error:X,snapshot:he,refresh:ge},e[52]=X,e[53]=Y,e[54]=ge,e[55]=he,e[56]=$):$=e[56],$}function le(e){return e.configured}function ue(e){let[,t]=e;return q(t)}function de(){return _()}function fe(e){return e.connectionState===`connected`}function pe(e){return e.language}function me(e){return e.token}var Y=r();function X(e){return e===`pass`?`border-success/30 bg-success-soft text-success`:e===`warn`?`border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300`:e===`fail`?`border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300`:`border-edge bg-surface-hover text-fg-muted`}function Z(e){return e===`pass`?f:e===`warn`?x:e===`fail`?h:y}function he(e,t){return e===`blocked`?{icon:h,className:`bg-red-500/10 text-red-950 dark:text-red-100`,title:t.health.blockedTitle,body:t.health.blockedBody,action:t.health.viewIssues,targetId:`next-steps`}:e===`attention`?{icon:x,className:`bg-amber-500/10 text-amber-950 dark:text-amber-100`,title:t.health.attentionTitle,body:t.health.attentionBody,action:t.health.viewIssues,targetId:`next-steps`}:e===`setup`?{icon:m,className:`bg-surface-base text-fg shadow-surface`,title:t.health.setupTitle,body:t.health.setupBody,action:t.health.continueSetup,targetId:`next-steps`}:{icon:f,className:`bg-success-soft text-success`,title:t.health.readyTitle,body:t.health.readyBody,action:t.health.startChat,actionPath:`/chat`}}function Q(e){let t=(0,F.c)(48),{tier:n,issueCount:r,onRunDoctor:s,ready:l,doctorRunning:u,doctorRunState:d}=e,f=c(ge),p,m,h,_,v,y,b,x,w,T,E;if(t[0]!==r||t[1]!==f||t[2]!==n){m=o(f).setupStatus;let e=he(n,m),s=e.icon,c=`targetId`in e&&typeof e.targetId==`string`?e.targetId:null,l=`actionPath`in e&&typeof e.actionPath==`string`?e.actionPath:`/chat`;p=c?(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>document.getElementById(c)?.scrollIntoView({block:`start`,behavior:`smooth`}),className:`inline-flex items-center gap-1 rounded-lg bg-surface-base px-3 py-2 text-sm font-medium text-fg shadow-sm hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[e.action,(0,Y.jsx)(C,{className:`size-4`,"aria-hidden":!0})]}):(0,Y.jsxs)(i,{to:l,className:`inline-flex items-center gap-1 rounded-lg bg-surface-base px-3 py-2 text-sm font-medium text-fg shadow-sm hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[e.action,(0,Y.jsx)(C,{className:`size-4`,"aria-hidden":!0})]}),E=a(`rounded-xl p-4`,e.className),T=`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,x=`flex min-w-0 gap-3`,w=(0,Y.jsx)(s,{className:`mt-0.5 size-5 shrink-0`,"aria-hidden":!0}),v=`min-w-0`,y=(0,Y.jsx)(`h2`,{className:`text-base font-semibold`,children:e.title}),b=(0,Y.jsx)(`p`,{className:`mt-1 text-sm opacity-85`,children:e.body}),h=`mt-2 text-xs opacity-75`,_=m.health.issueCount.replace(`{{count}}`,String(r)),t[0]=r,t[1]=f,t[2]=n,t[3]=p,t[4]=m,t[5]=h,t[6]=_,t[7]=v,t[8]=y,t[9]=b,t[10]=x,t[11]=w,t[12]=T,t[13]=E}else p=t[3],m=t[4],h=t[5],_=t[6],v=t[7],y=t[8],b=t[9],x=t[10],w=t[11],T=t[12],E=t[13];let D;t[14]!==h||t[15]!==_?(D=(0,Y.jsx)(`p`,{className:h,children:_}),t[14]=h,t[15]=_,t[16]=D):D=t[16];let O;t[17]!==D||t[18]!==v||t[19]!==y||t[20]!==b?(O=(0,Y.jsxs)(`div`,{className:v,children:[y,b,D]}),t[17]=D,t[18]=v,t[19]=y,t[20]=b,t[21]=O):O=t[21];let k;t[22]!==O||t[23]!==x||t[24]!==w?(k=(0,Y.jsxs)(`div`,{className:x,children:[w,O]}),t[22]=O,t[23]=x,t[24]=w,t[25]=k):k=t[25];let A;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(A=a(`inline-flex items-center gap-2 rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,S.press),t[26]=A):A=t[26];let j=!l||u,M;t[27]===u?M=t[28]:(M=u?(0,Y.jsx)(g,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,Y.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),t[27]=u,t[28]=M);let N=u?m.health.runDoctorRunning:m.health.runDoctor,P;t[29]!==u||t[30]!==s||t[31]!==j||t[32]!==M||t[33]!==N?(P=(0,Y.jsxs)(`button`,{type:`button`,className:A,onClick:s,disabled:j,"aria-busy":u,children:[M,N]}),t[29]=u,t[30]=s,t[31]=j,t[32]=M,t[33]=N,t[34]=P):P=t[34];let I;t[35]!==p||t[36]!==P?(I=(0,Y.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[p,P]}),t[35]=p,t[36]=P,t[37]=I):I=t[37];let L;t[38]!==k||t[39]!==I||t[40]!==T?(L=(0,Y.jsxs)(`div`,{className:T,children:[k,I]}),t[38]=k,t[39]=I,t[40]=T,t[41]=L):L=t[41];let R=u?m.health.doctorRunningMessage:d===`success`?m.health.doctorCompleteMessage:d===`error`?m.health.doctorFailedMessage:m.health.doctorIdleMessage,z;t[42]===R?z=t[43]:(z=(0,Y.jsx)(`p`,{className:`mt-3 text-xs opacity-75`,role:`status`,"aria-live":`polite`,children:R}),t[42]=R,t[43]=z);let B;return t[44]!==L||t[45]!==z||t[46]!==E?(B=(0,Y.jsxs)(`section`,{className:E,children:[L,z]}),t[44]=L,t[45]=z,t[46]=E,t[47]=B):B=t[47],B}function ge(e){return e.language}function $(e){let t=(0,F.c)(34),{issue:n,fixLabel:r}=e,o;t[0]===n.status?o=t[1]:(o=Z(n.status),t[0]=n.status,t[1]=o);let s=o,c;t[2]===s?c=t[3]:(c=(0,Y.jsx)(s,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":!0}),t[2]=s,t[3]=c);let l;t[4]===n.label?l=t[5]:(l=(0,Y.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:n.label}),t[4]=n.label,t[5]=l);let u;t[6]===n.status?u=t[7]:(u=a(`rounded-full border px-2 py-0.5 text-[11px] font-medium uppercase`,X(n.status)),t[6]=n.status,t[7]=u);let d;t[8]!==n.status||t[9]!==u?(d=(0,Y.jsx)(`span`,{className:u,children:n.status}),t[8]=n.status,t[9]=u,t[10]=d):d=t[10];let f;t[11]!==l||t[12]!==d?(f=(0,Y.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[l,d]}),t[11]=l,t[12]=d,t[13]=f):f=t[13];let p;t[14]===n.message?p=t[15]:(p=(0,Y.jsx)(`span`,{className:`mt-1 block text-sm text-fg-muted`,children:n.message}),t[14]=n.message,t[15]=p);let m;t[16]===n.hints[0]?m=t[17]:(m=n.hints[0]?(0,Y.jsx)(`span`,{className:`mt-1 block truncate text-xs text-fg-subtle`,children:n.hints[0]}):null,t[16]=n.hints[0],t[17]=m);let h;t[18]!==f||t[19]!==p||t[20]!==m?(h=(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[f,p,m]}),t[18]=f,t[19]=p,t[20]=m,t[21]=h):h=t[21];let g;t[22]!==r||t[23]!==n.path?(g=n.path?(0,Y.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-xs font-medium text-accent-fg`,children:[r,(0,Y.jsx)(C,{className:`size-4`,"aria-hidden":!0})]}):null,t[22]=r,t[23]=n.path,t[24]=g):g=t[24];let _;t[25]!==g||t[26]!==c||t[27]!==h?(_=(0,Y.jsxs)(Y.Fragment,{children:[c,h,g]}),t[25]=g,t[26]=c,t[27]=h,t[28]=_):_=t[28];let v=_;if(n.path){let e;return t[29]!==v||t[30]!==n.path?(e=(0,Y.jsx)(i,{to:n.path,className:`flex items-start gap-3 rounded-lg bg-surface-panel/80 p-3 shadow-surface hover:bg-surface-hover/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:v}),t[29]=v,t[30]=n.path,t[31]=e):e=t[31],e}let y;return t[32]===v?y=t[33]:(y=(0,Y.jsx)(`div`,{className:`flex items-start gap-3 rounded-lg bg-surface-panel/80 p-3 shadow-surface`,children:v}),t[32]=v,t[33]=y),y}function _e(e){let t=(0,F.c)(27),{item:n,labels:r}=e,o;t[0]===n.status?o=t[1]:(o=Z(n.status),t[0]=n.status,t[1]=o);let s=o,c=r[n.id]??n.title,l;t[2]===n.status?l=t[3]:(l=a(`flex size-7 shrink-0 items-center justify-center rounded-full border`,X(n.status)),t[2]=n.status,t[3]=l);let u;t[4]===s?u=t[5]:(u=(0,Y.jsx)(s,{className:`size-4`,"aria-hidden":!0}),t[4]=s,t[5]=u);let d;t[6]!==l||t[7]!==u?(d=(0,Y.jsx)(`span`,{className:l,children:u}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;t[9]===c?f=t[10]:(f=(0,Y.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:c}),t[9]=c,t[10]=f);let p;t[11]===n.detail?p=t[12]:(p=(0,Y.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:n.detail}),t[11]=n.detail,t[12]=p);let m;t[13]!==f||t[14]!==p?(m=(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===n.path?h=t[17]:(h=n.path?(0,Y.jsx)(C,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}):null,t[16]=n.path,t[17]=h);let g;t[18]!==d||t[19]!==m||t[20]!==h?(g=(0,Y.jsxs)(Y.Fragment,{children:[d,m,h]}),t[18]=d,t[19]=m,t[20]=h,t[21]=g):g=t[21];let _=g;if(n.path){let e;return t[22]!==_||t[23]!==n.path?(e=(0,Y.jsx)(i,{to:n.path,className:`flex items-center gap-3 rounded-lg p-3 hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:_}),t[22]=_,t[23]=n.path,t[24]=e):e=t[24],e}let v;return t[25]===_?v=t[26]:(v=(0,Y.jsx)(`div`,{className:`flex items-center gap-3 rounded-lg p-3`,children:_}),t[25]=_,t[26]=v),v}function ve(e){let t=(0,F.c)(29),{signal:n,fixLabel:r}=e,o;t[0]===n.status?o=t[1]:(o=Z(n.status),t[0]=n.status,t[1]=o);let s=o,c;t[2]===s?c=t[3]:(c=(0,Y.jsx)(s,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":!0}),t[2]=s,t[3]=c);let l;t[4]===n.label?l=t[5]:(l=(0,Y.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:n.label}),t[4]=n.label,t[5]=l);let u;t[6]===n.message?u=t[7]:(u=(0,Y.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:n.message}),t[6]=n.message,t[7]=u);let d;t[8]!==l||t[9]!==u?(d=(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;t[11]===n.status?f=t[12]:(f=a(`shrink-0 rounded-full border px-2 py-0.5 text-[11px] font-medium uppercase`,X(n.status)),t[11]=n.status,t[12]=f);let p;t[13]!==n.status||t[14]!==f?(p=(0,Y.jsx)(`span`,{className:f,children:n.status}),t[13]=n.status,t[14]=f,t[15]=p):p=t[15];let m;t[16]!==r||t[17]!==n.path?(m=n.path?(0,Y.jsx)(`span`,{className:`sr-only`,children:r}):null,t[16]=r,t[17]=n.path,t[18]=m):m=t[18];let h;t[19]!==c||t[20]!==d||t[21]!==p||t[22]!==m?(h=(0,Y.jsxs)(Y.Fragment,{children:[c,d,p,m]}),t[19]=c,t[20]=d,t[21]=p,t[22]=m,t[23]=h):h=t[23];let g=h;if(n.path){let e;return t[24]!==g||t[25]!==n.path?(e=(0,Y.jsx)(i,{to:n.path,className:`flex min-w-0 items-start gap-2 rounded-lg bg-surface-panel/80 px-3 py-2.5 shadow-surface hover:bg-surface-hover/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:g}),t[24]=g,t[25]=n.path,t[26]=e):e=t[26],e}let _;return t[27]===g?_=t[28]:(_=(0,Y.jsx)(`div`,{className:`flex min-w-0 items-start gap-2 rounded-lg bg-surface-panel/80 px-3 py-2.5 shadow-surface`,children:g}),t[27]=g,t[28]=_),_}function ye(){let e=o(c(e=>e.language)).setupStatus,{ready:t,error:n,snapshot:r,refresh:i}=J(),[s,l]=(0,P.useState)(!1),[u,d]=(0,P.useState)(`idle`),f=r?.diagnosticSignals.filter(e=>e.status===`fail`||e.status===`warn`)??[],m=async()=>{if(!(s||!t)){l(!0),d(`idle`);try{await i(),d(`success`)}catch{d(`error`)}finally{l(!1)}}};return(0,Y.jsxs)(A,{gap:`gap-6`,children:[(0,Y.jsx)(k,{title:e.title,subtitle:e.subtitle,actions:(0,Y.jsxs)(`button`,{type:`button`,className:a(`inline-flex shrink-0 items-center gap-2 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,S.press),onClick:()=>void m(),disabled:!t||s,"aria-busy":s,children:[(0,Y.jsx)(ee,{className:a(`size-4`,(!t||s)&&`animate-spin`),"aria-hidden":!0}),s?e.health.runDoctorRunning:e.refresh]})}),n?(0,Y.jsx)(`p`,{className:`rounded-xl border border-red-300/40 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/40 dark:bg-red-950/30 dark:text-red-300`,children:e.loadError}):null,!t||!r?(0,Y.jsx)(j,{sections:2}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Q,{tier:r.healthTier,issueCount:r.issues.length,ready:t,onRunDoctor:()=>void m(),doctorRunning:s,doctorRunState:u}),(0,Y.jsxs)(N,{id:`next-steps`,children:[(0,Y.jsx)(M,{icon:r.issues.length?x:E,title:e.nextStepsTitle,subtitle:r.issues.length?e.nextStepsIssuesSubtitle:e.nextStepsReadySubtitle}),r.issues.length?(0,Y.jsx)(`div`,{className:`mt-4 flex flex-col gap-2`,children:r.issues.slice(0,8).map(t=>(0,Y.jsx)($,{issue:t,fixLabel:e.fixIssue},`${t.source}:${t.id}`))}):(0,Y.jsx)(`div`,{className:`mt-4 rounded-lg bg-surface-panel/80 shadow-surface`,children:r.readiness.map(t=>(0,Y.jsx)(_e,{item:t,labels:e.readinessLabels},t.id))})]}),(0,Y.jsxs)(N,{children:[(0,Y.jsx)(M,{icon:p,title:e.diagnosticsTitle,subtitle:e.diagnosticsSubtitle}),f.length?(0,Y.jsx)(`div`,{className:`mt-4 grid gap-2 md:grid-cols-2`,children:f.map(t=>(0,Y.jsx)(ve,{signal:t,fixLabel:e.fixIssue},t.id))}):(0,Y.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-panel/80 p-3 text-sm text-fg-muted shadow-surface`,children:r.diagnosticSignals.length?e.diagnosticsAllClear:e.diagnosticsEmpty})]})]})]})}export{ye as SetupStatusPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as a}from"./check-DUBLcKHA.js";import{t as o}from"./cn-JdwAhgNB.js";import{t as s}from"./copy-to-clipboard-HOJ79TWv.js";import{t as c}from"./messages-DMJ-6-1m.js";import{l,n as u,r as d,s as f}from"./locale-store-VOY1wMO9.js";import{i as p}from"./vendor-swr-BIWyz7Rc.js";import{$r as m,Ai as h,Ao as g,At as _,Cl as v,Do as y,En as b,Eo as x,Fl as S,Ho as C,Lc as w,Mo as T,Ms as E,Oo as D,Qr as O,Ta as k,Uo as A,Vl as j,Xr as M,_l as N,ai as P,do as F,ei as I,fo as L,hs as R,ii as ee,iu as te,jo as ne,mr as re,ms as ie,ni as z,oc as ae,oi as oe,pc as B,ri as V,sr as se,ti as H,vs as ce}from"./index-DzmbmOGA.js";import{n as U,r as W,t as G}from"./settings-page-layout-J793iqfm.js";import{t as K}from"./settings-loading-skeleton-BDzpxgk0.js";import{t as q}from"./settings-form-section-CKLns16d.js";import{t as le}from"./page-tabs-CvzSdYVj.js";var J=e(t(),1),ue=n(),Y={enabled:!0,defaultTtlHours:24,maxTtlDays:30,maxActiveShares:500,maxFileSizeMb:500,directoryMaxFolderSizeMb:2048,directoryMaxFileCount:1e4,inlinePreviewMimes:[`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/svg+xml`,`application/pdf`,`text/html`,`text/markdown`,`text/plain`,`application/json`],siteEnabled:!0,siteDefaultTtlHours:24,siteMaxTtlDays:30,maxActiveSites:50,siteMaxRootDirSizeMb:1024,siteMaxFileCount:2e4};function de(){return structuredClone(Y)}var fe=36e5,X=864e5,Z=1048576;function pe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function me(e,t=32){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.trim().length>0).map(e=>e.trim()).slice(0,t):[]}function he(e){let t=pe(e)?e:{},n=pe(t.gateway)?t.gateway:{},r=pe(n.share)?n.share:{},i=pe(r.directory)?r.directory:{},a=pe(n.siteShare)?n.siteShare:{},o=pe(a.static)?a.static:{},s=typeof r.defaultTtlMs==`number`&&Number.isFinite(r.defaultTtlMs)?Math.floor(r.defaultTtlMs):Y.defaultTtlHours*fe,c=typeof r.maxTtlMs==`number`&&Number.isFinite(r.maxTtlMs)?Math.floor(r.maxTtlMs):Y.maxTtlDays*X,l=typeof r.maxFileSize==`number`&&Number.isFinite(r.maxFileSize)?Math.floor(r.maxFileSize):Y.maxFileSizeMb*Z,u=typeof i.maxFolderSize==`number`&&Number.isFinite(i.maxFolderSize)?Math.floor(i.maxFolderSize):Y.directoryMaxFolderSizeMb*Z,d=typeof a.defaultTtlMs==`number`&&Number.isFinite(a.defaultTtlMs)?Math.floor(a.defaultTtlMs):Y.siteDefaultTtlHours*fe,f=typeof a.maxTtlMs==`number`&&Number.isFinite(a.maxTtlMs)?Math.floor(a.maxTtlMs):Y.siteMaxTtlDays*X,p=typeof o.maxRootDirSize==`number`&&Number.isFinite(o.maxRootDirSize)?Math.floor(o.maxRootDirSize):Y.siteMaxRootDirSizeMb*Z;return{enabled:r.enabled!==!1,defaultTtlHours:Math.max(1,Math.round(s/fe)),maxTtlDays:Math.max(1,Math.round(c/X)),maxActiveShares:typeof r.maxActiveShares==`number`&&Number.isFinite(r.maxActiveShares)?Math.max(1,Math.min(1e4,Math.floor(r.maxActiveShares))):Y.maxActiveShares,maxFileSizeMb:Math.max(1,Math.round(l/Z)),directoryMaxFolderSizeMb:Math.max(1,Math.round(u/Z)),directoryMaxFileCount:typeof i.maxFileCount==`number`&&Number.isFinite(i.maxFileCount)?Math.max(1,Math.min(1e5,Math.floor(i.maxFileCount))):Y.directoryMaxFileCount,inlinePreviewMimes:me(r.inlinePreviewMimes,32).length?me(r.inlinePreviewMimes,32):[...Y.inlinePreviewMimes],siteEnabled:a.enabled!==!1,siteDefaultTtlHours:Math.max(1,Math.round(d/fe)),siteMaxTtlDays:Math.max(1,Math.round(f/X)),maxActiveSites:typeof a.maxActiveSites==`number`&&Number.isFinite(a.maxActiveSites)?Math.max(1,Math.min(1e3,Math.floor(a.maxActiveSites))):Y.maxActiveSites,siteMaxRootDirSizeMb:Math.max(1,Math.round(p/Z)),siteMaxFileCount:typeof o.maxFileCount==`number`&&Number.isFinite(o.maxFileCount)?Math.max(1,Math.min(1e5,Math.floor(o.maxFileCount))):Y.siteMaxFileCount}}function ge(e){let t=e.defaultTtlHours*fe,n=e.maxTtlDays*X,r=e.siteDefaultTtlHours*fe,i=e.siteMaxTtlDays*X;return t<6e4||t>6048e5?`Default share TTL must be between 1 minute and 7 days.`:n<6e4||n>2592e6?`Maximum share TTL must be between 1 minute and 30 days.`:t>n?`Default TTL cannot exceed maximum TTL.`:e.maxActiveShares<1||e.maxActiveShares>1e4?`Maximum active shares must be between 1 and 10,000.`:e.maxActiveSites<1||e.maxActiveSites>1e3?`Maximum active site shares must be between 1 and 1,000.`:e.maxFileSizeMb<1||e.maxFileSizeMb>10240?`Maximum file size must be between 1 MB and 10 GB.`:e.directoryMaxFolderSizeMb<1||e.directoryMaxFolderSizeMb>10240?`Maximum folder size must be between 1 MB and 10 GB.`:e.directoryMaxFileCount<1||e.directoryMaxFileCount>1e5?`Maximum directory file count must be between 1 and 100,000.`:r<6e4||r>6048e5?`Default site share TTL must be between 1 minute and 7 days.`:i<6e4||i>2592e6?`Maximum site share TTL must be between 1 minute and 30 days.`:r>i?`Default site TTL cannot exceed maximum site TTL.`:e.siteMaxRootDirSizeMb<1||e.siteMaxRootDirSizeMb>10240?`Maximum static site size must be between 1 MB and 10 GB.`:e.siteMaxFileCount<1||e.siteMaxFileCount>1e5?`Maximum static site file count must be between 1 and 100,000.`:null}async function _e(e){let t=ge(e);if(t)throw Error(t);await f(d(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{share:{enabled:e.enabled,defaultTtlMs:e.defaultTtlHours*fe,maxTtlMs:e.maxTtlDays*X,maxActiveShares:e.maxActiveShares,maxFileSize:e.maxFileSizeMb*Z,inlinePreviewMimes:e.inlinePreviewMimes,directory:{maxFolderSize:e.directoryMaxFolderSizeMb*Z,maxFileCount:e.directoryMaxFileCount}},siteShare:{enabled:e.siteEnabled,defaultTtlMs:e.siteDefaultTtlHours*fe,maxTtlMs:e.siteMaxTtlDays*X,maxActiveSites:e.maxActiveSites,static:{maxRootDirSize:e.siteMaxRootDirSizeMb*Z,maxFileCount:e.siteMaxFileCount}}}})}),F()}var Q=r();function ve(){return o(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,ie,`dark:border-edge`)}function ye({hasToken:e}){let t=c(u(e=>e.language)).sharesSettings,{data:n,isLoading:r}=L(e),i=(0,J.useMemo)(()=>n?.payload?.config===void 0?null:structuredClone(he(n.payload.config)),[n]),a=(0,J.useRef)(!1),[o,s]=(0,J.useState)(null),[l,d]=(0,J.useState)(!1),[f,p]=(0,J.useState)(null),[m,h]=(0,J.useState)(!1),g=o??i,_=i,v=(0,J.useMemo)(()=>!g||!_?!1:JSON.stringify(g)!==JSON.stringify(_),[g,_]),y=(0,J.useCallback)(e=>{a.current=!0,s(t=>{let n=t??_;return n?{...n,...e}:null})},[_]),b=(0,J.useCallback)(async()=>{if(!(!g||l)){d(!0),p(null),h(!1);try{await _e(g),a.current=!1,s(null),h(!0),window.setTimeout(()=>h(!1),2500)}catch(e){p(e instanceof Error?e.message:t.policySaveError)}finally{d(!1)}}},[g,l,t.policySaveError]),x=(0,J.useCallback)(()=>{a.current=!1,s(null),p(null),h(!1)},[]);return!e||!g?r?(0,Q.jsx)(q,{children:(0,Q.jsx)(K,{rows:2})}):null:(0,Q.jsxs)(q,{children:[(0,Q.jsxs)(`div`,{className:`mb-4 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.policyTitle}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.policyHint})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[m?(0,Q.jsx)(`span`,{className:`text-sm text-fg-muted`,children:t.policySaved}):null,(0,Q.jsx)(R,{type:`button`,variant:`secondary`,disabled:l,onClick:()=>y(de()),children:t.policyUseRecommended}),(0,Q.jsx)(R,{type:`button`,variant:`secondary`,disabled:!v||l,onClick:x,children:t.policyDiscard}),(0,Q.jsx)(R,{type:`button`,variant:`primary`,disabled:!v||l,onClick:()=>void b(),children:l?t.policySaving:t.policySave})]})]}),v?(0,Q.jsx)(`p`,{className:`mb-3 text-xs text-amber-800 dark:text-amber-200`,children:t.policyUnsaved}):null,f?(0,Q.jsx)(`p`,{className:`mb-3 text-sm text-red-600 dark:text-red-400`,children:f}):null,(0,Q.jsx)(`p`,{className:`mb-4 text-xs text-fg-subtle`,children:t.policyRestartHint}),(0,Q.jsx)(be,{t,form:g,onChange:y})]})}function be(e){let t=(0,ue.c)(150),{t:n,form:r,onChange:i}=e,a;t[0]===n.policyFileSection?a=t[1]:(a=(0,Q.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.policyFileSection}),t[0]=n.policyFileSection,t[1]=a);let o;t[2]===n.policyFileSectionHint?o=t[3]:(o=(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:n.policyFileSectionHint}),t[2]=n.policyFileSectionHint,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Q.jsxs)(`div`,{className:`mb-4`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===i?c=t[8]:(c=e=>i({enabled:e.target.checked}),t[7]=i,t[8]=c);let l;t[9]!==r.enabled||t[10]!==c?(l=(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:r.enabled,onChange:c}),t[9]=r.enabled,t[10]=c,t[11]=l):l=t[11];let u;t[12]!==n.policyEnabled||t[13]!==l?(u=(0,Q.jsxs)(`label`,{className:`mb-4 flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[l,n.policyEnabled]}),t[12]=n.policyEnabled,t[13]=l,t[14]=u):u=t[14];let d=!r.enabled,f;t[15]===i?f=t[16]:(f=e=>i({defaultTtlHours:e}),t[15]=i,t[16]=f);let p;t[17]!==r.defaultTtlHours||t[18]!==n.policyDefaultTtlHint||t[19]!==n.policyDefaultTtlHours||t[20]!==d||t[21]!==f?(p=(0,Q.jsx)($,{id:`share-default-ttl-hours`,label:n.policyDefaultTtlHours,hint:n.policyDefaultTtlHint,value:r.defaultTtlHours,min:1,max:168,disabled:d,onChange:f}),t[17]=r.defaultTtlHours,t[18]=n.policyDefaultTtlHint,t[19]=n.policyDefaultTtlHours,t[20]=d,t[21]=f,t[22]=p):p=t[22];let m=!r.enabled,h;t[23]===i?h=t[24]:(h=e=>i({maxTtlDays:e}),t[23]=i,t[24]=h);let g;t[25]!==r.maxTtlDays||t[26]!==n.policyMaxTtlDays||t[27]!==n.policyMaxTtlHint||t[28]!==m||t[29]!==h?(g=(0,Q.jsx)($,{id:`share-max-ttl-days`,label:n.policyMaxTtlDays,hint:n.policyMaxTtlHint,value:r.maxTtlDays,min:1,max:30,disabled:m,onChange:h}),t[25]=r.maxTtlDays,t[26]=n.policyMaxTtlDays,t[27]=n.policyMaxTtlHint,t[28]=m,t[29]=h,t[30]=g):g=t[30];let _=!r.enabled,v;t[31]===i?v=t[32]:(v=e=>i({maxActiveShares:e}),t[31]=i,t[32]=v);let y;t[33]!==r.maxActiveShares||t[34]!==n.policyMaxActiveShares||t[35]!==n.policyMaxActiveSharesHint||t[36]!==_||t[37]!==v?(y=(0,Q.jsx)($,{id:`share-max-active`,label:n.policyMaxActiveShares,hint:n.policyMaxActiveSharesHint,value:r.maxActiveShares,min:1,max:1e4,disabled:_,onChange:v}),t[33]=r.maxActiveShares,t[34]=n.policyMaxActiveShares,t[35]=n.policyMaxActiveSharesHint,t[36]=_,t[37]=v,t[38]=y):y=t[38];let b=!r.enabled,x;t[39]===i?x=t[40]:(x=e=>i({maxFileSizeMb:e}),t[39]=i,t[40]=x);let S;t[41]!==r.maxFileSizeMb||t[42]!==n.policyMaxFileSizeHint||t[43]!==n.policyMaxFileSizeMb||t[44]!==b||t[45]!==x?(S=(0,Q.jsx)($,{id:`share-max-file-mb`,label:n.policyMaxFileSizeMb,hint:n.policyMaxFileSizeHint,value:r.maxFileSizeMb,min:1,max:10240,disabled:b,onChange:x}),t[41]=r.maxFileSizeMb,t[42]=n.policyMaxFileSizeHint,t[43]=n.policyMaxFileSizeMb,t[44]=b,t[45]=x,t[46]=S):S=t[46];let C=!r.enabled,w;t[47]===i?w=t[48]:(w=e=>i({directoryMaxFolderSizeMb:e}),t[47]=i,t[48]=w);let T;t[49]!==r.directoryMaxFolderSizeMb||t[50]!==n.policyDirectoryMaxFolderSizeHint||t[51]!==n.policyDirectoryMaxFolderSizeMb||t[52]!==C||t[53]!==w?(T=(0,Q.jsx)($,{id:`share-directory-max-size-mb`,label:n.policyDirectoryMaxFolderSizeMb,hint:n.policyDirectoryMaxFolderSizeHint,value:r.directoryMaxFolderSizeMb,min:1,max:10240,disabled:C,onChange:w}),t[49]=r.directoryMaxFolderSizeMb,t[50]=n.policyDirectoryMaxFolderSizeHint,t[51]=n.policyDirectoryMaxFolderSizeMb,t[52]=C,t[53]=w,t[54]=T):T=t[54];let E=!r.enabled,D;t[55]===i?D=t[56]:(D=e=>i({directoryMaxFileCount:e}),t[55]=i,t[56]=D);let O;t[57]!==r.directoryMaxFileCount||t[58]!==n.policyDirectoryMaxFileCount||t[59]!==n.policyDirectoryMaxFileCountHint||t[60]!==E||t[61]!==D?(O=(0,Q.jsx)($,{id:`share-directory-max-files`,label:n.policyDirectoryMaxFileCount,hint:n.policyDirectoryMaxFileCountHint,value:r.directoryMaxFileCount,min:1,max:1e5,disabled:E,onChange:D}),t[57]=r.directoryMaxFileCount,t[58]=n.policyDirectoryMaxFileCount,t[59]=n.policyDirectoryMaxFileCountHint,t[60]=E,t[61]=D,t[62]=O):O=t[62];let k;t[63]!==g||t[64]!==y||t[65]!==S||t[66]!==T||t[67]!==O||t[68]!==p?(k=(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[p,g,y,S,T,O]}),t[63]=g,t[64]=y,t[65]=S,t[66]=T,t[67]=O,t[68]=p,t[69]=k):k=t[69];let A=!r.enabled,j;t[70]===i?j=t[71]:(j=e=>i({inlinePreviewMimes:e}),t[70]=i,t[71]=j);let M;t[72]!==r.inlinePreviewMimes||t[73]!==n||t[74]!==A||t[75]!==j?(M=(0,Q.jsx)(xe,{t:n,values:r.inlinePreviewMimes,disabled:A,onChange:j}),t[72]=r.inlinePreviewMimes,t[73]=n,t[74]=A,t[75]=j,t[76]=M):M=t[76];let N;t[77]!==k||t[78]!==M||t[79]!==s||t[80]!==u?(N=(0,Q.jsxs)(`div`,{className:`rounded-xl border border-edge bg-surface-muted/25 p-4`,children:[s,u,k,M]}),t[77]=k,t[78]=M,t[79]=s,t[80]=u,t[81]=N):N=t[81];let P;t[82]===n.policySiteSection?P=t[83]:(P=(0,Q.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.policySiteSection}),t[82]=n.policySiteSection,t[83]=P);let F;t[84]===n.policySiteSectionHint?F=t[85]:(F=(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:n.policySiteSectionHint}),t[84]=n.policySiteSectionHint,t[85]=F);let I;t[86]!==P||t[87]!==F?(I=(0,Q.jsxs)(`div`,{className:`mb-4`,children:[P,F]}),t[86]=P,t[87]=F,t[88]=I):I=t[88];let L;t[89]===i?L=t[90]:(L=e=>i({siteEnabled:e.target.checked}),t[89]=i,t[90]=L);let R;t[91]!==r.siteEnabled||t[92]!==L?(R=(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:r.siteEnabled,onChange:L}),t[91]=r.siteEnabled,t[92]=L,t[93]=R):R=t[93];let ee;t[94]!==n.policySiteEnabled||t[95]!==R?(ee=(0,Q.jsxs)(`label`,{className:`mb-4 flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[R,n.policySiteEnabled]}),t[94]=n.policySiteEnabled,t[95]=R,t[96]=ee):ee=t[96];let te=!r.siteEnabled,ne;t[97]===i?ne=t[98]:(ne=e=>i({siteDefaultTtlHours:e}),t[97]=i,t[98]=ne);let re;t[99]!==r.siteDefaultTtlHours||t[100]!==n.policySiteDefaultTtlHint||t[101]!==n.policySiteDefaultTtlHours||t[102]!==te||t[103]!==ne?(re=(0,Q.jsx)($,{id:`site-share-default-ttl-hours`,label:n.policySiteDefaultTtlHours,hint:n.policySiteDefaultTtlHint,value:r.siteDefaultTtlHours,min:1,max:168,disabled:te,onChange:ne}),t[99]=r.siteDefaultTtlHours,t[100]=n.policySiteDefaultTtlHint,t[101]=n.policySiteDefaultTtlHours,t[102]=te,t[103]=ne,t[104]=re):re=t[104];let ie=!r.siteEnabled,z;t[105]===i?z=t[106]:(z=e=>i({siteMaxTtlDays:e}),t[105]=i,t[106]=z);let ae;t[107]!==r.siteMaxTtlDays||t[108]!==n.policySiteMaxTtlDays||t[109]!==n.policySiteMaxTtlHint||t[110]!==ie||t[111]!==z?(ae=(0,Q.jsx)($,{id:`site-share-max-ttl-days`,label:n.policySiteMaxTtlDays,hint:n.policySiteMaxTtlHint,value:r.siteMaxTtlDays,min:1,max:30,disabled:ie,onChange:z}),t[107]=r.siteMaxTtlDays,t[108]=n.policySiteMaxTtlDays,t[109]=n.policySiteMaxTtlHint,t[110]=ie,t[111]=z,t[112]=ae):ae=t[112];let oe=!r.siteEnabled,B;t[113]===i?B=t[114]:(B=e=>i({maxActiveSites:e}),t[113]=i,t[114]=B);let V;t[115]!==r.maxActiveSites||t[116]!==n.policyMaxActiveSites||t[117]!==n.policyMaxActiveSitesHint||t[118]!==oe||t[119]!==B?(V=(0,Q.jsx)($,{id:`site-share-max-active`,label:n.policyMaxActiveSites,hint:n.policyMaxActiveSitesHint,value:r.maxActiveSites,min:1,max:1e3,disabled:oe,onChange:B}),t[115]=r.maxActiveSites,t[116]=n.policyMaxActiveSites,t[117]=n.policyMaxActiveSitesHint,t[118]=oe,t[119]=B,t[120]=V):V=t[120];let se=!r.siteEnabled,H;t[121]===i?H=t[122]:(H=e=>i({siteMaxRootDirSizeMb:e}),t[121]=i,t[122]=H);let ce;t[123]!==r.siteMaxRootDirSizeMb||t[124]!==n.policySiteMaxRootDirSizeHint||t[125]!==n.policySiteMaxRootDirSizeMb||t[126]!==se||t[127]!==H?(ce=(0,Q.jsx)($,{id:`site-share-max-root-size-mb`,label:n.policySiteMaxRootDirSizeMb,hint:n.policySiteMaxRootDirSizeHint,value:r.siteMaxRootDirSizeMb,min:1,max:10240,disabled:se,onChange:H}),t[123]=r.siteMaxRootDirSizeMb,t[124]=n.policySiteMaxRootDirSizeHint,t[125]=n.policySiteMaxRootDirSizeMb,t[126]=se,t[127]=H,t[128]=ce):ce=t[128];let U=!r.siteEnabled,W;t[129]===i?W=t[130]:(W=e=>i({siteMaxFileCount:e}),t[129]=i,t[130]=W);let G;t[131]!==r.siteMaxFileCount||t[132]!==n.policySiteMaxFileCount||t[133]!==n.policySiteMaxFileCountHint||t[134]!==U||t[135]!==W?(G=(0,Q.jsx)($,{id:`site-share-max-files`,label:n.policySiteMaxFileCount,hint:n.policySiteMaxFileCountHint,value:r.siteMaxFileCount,min:1,max:1e5,disabled:U,onChange:W}),t[131]=r.siteMaxFileCount,t[132]=n.policySiteMaxFileCount,t[133]=n.policySiteMaxFileCountHint,t[134]=U,t[135]=W,t[136]=G):G=t[136];let K;t[137]!==re||t[138]!==ae||t[139]!==V||t[140]!==ce||t[141]!==G?(K=(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[re,ae,V,ce,G]}),t[137]=re,t[138]=ae,t[139]=V,t[140]=ce,t[141]=G,t[142]=K):K=t[142];let q;t[143]!==I||t[144]!==ee||t[145]!==K?(q=(0,Q.jsxs)(`div`,{className:`rounded-xl border border-edge bg-surface-muted/25 p-4`,children:[I,ee,K]}),t[143]=I,t[144]=ee,t[145]=K,t[146]=q):q=t[146];let le;return t[147]!==N||t[148]!==q?(le=(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[N,q]}),t[147]=N,t[148]=q,t[149]=le):le=t[149],le}function $(e){let t=(0,ue.c)(21),{id:n,label:r,hint:i,value:a,min:s,max:c,disabled:l,onChange:u}=e,d;t[0]!==n||t[1]!==r?(d=(0,Q.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,htmlFor:n,children:r}),t[0]=n,t[1]=r,t[2]=d):d=t[2];let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=o(ve(),`max-w-xs font-mono text-xs`),t[3]=f):f=t[3];let p;t[4]!==c||t[5]!==s||t[6]!==u?(p=e=>{let t=Number(e.target.value);Number.isFinite(t)&&u(Math.max(s,Math.min(c,Math.floor(t))))},t[4]=c,t[5]=s,t[6]=u,t[7]=p):p=t[7];let m;t[8]!==l||t[9]!==n||t[10]!==c||t[11]!==s||t[12]!==p||t[13]!==a?(m=(0,Q.jsx)(`input`,{id:n,type:`number`,min:s,max:c,disabled:l,className:f,value:a,onChange:p}),t[8]=l,t[9]=n,t[10]=c,t[11]=s,t[12]=p,t[13]=a,t[14]=m):m=t[14];let h;t[15]===i?h=t[16]:(h=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:i}),t[15]=i,t[16]=h);let g;return t[17]!==d||t[18]!==m||t[19]!==h?(g=(0,Q.jsxs)(`div`,{children:[d,m,h]}),t[17]=d,t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function xe(e){let t=(0,ue.c)(25),{t:n,values:r,disabled:i,onChange:a}=e,s;t[0]!==a||t[1]!==r?(s=e=>{let t=e.trim();!t||r.includes(t)||r.length>=32||a([...r,t])},t[0]=a,t[1]=r,t[2]=s):s=t[2];let c=s,l;t[3]===n.policyInlinePreviewMimes?l=t[4]:(l=(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n.policyInlinePreviewMimes}),t[3]=n.policyInlinePreviewMimes,t[4]=l);let u;t[5]===n.policyInlinePreviewMimesHint?u=t[6]:(u=(0,Q.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n.policyInlinePreviewMimesHint}),t[5]=n.policyInlinePreviewMimesHint,t[6]=u);let d;t[7]!==i||t[8]!==a||t[9]!==r?(d=r.map(e=>(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-edge bg-surface-panel px-2 py-0.5 font-mono text-xs text-fg`,children:[e,i?null:(0,Q.jsx)(`button`,{type:`button`,className:`text-fg-muted hover:text-fg`,"aria-label":`Remove ${e}`,onClick:()=>a(r.filter(t=>t!==e)),children:`×`})]},e)),t[7]=i,t[8]=a,t[9]=r,t[10]=d):d=t[10];let f;t[11]===d?f=t[12]:(f=(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:d}),t[11]=d,t[12]=f);let p;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(p=o(ve(),`font-mono text-xs`),t[13]=p):p=t[13];let m=i||r.length>=32,h;t[14]===c?h=t[15]:(h=e=>{e.key===`Enter`&&(e.preventDefault(),c(e.target.value),e.target.value=``)},t[14]=c,t[15]=h);let g;t[16]!==n.policyMimePlaceholder||t[17]!==m||t[18]!==h?(g=(0,Q.jsx)(`input`,{className:p,placeholder:n.policyMimePlaceholder,disabled:m,onKeyDown:h}),t[16]=n.policyMimePlaceholder,t[17]=m,t[18]=h,t[19]=g):g=t[19];let _;return t[20]!==l||t[21]!==u||t[22]!==f||t[23]!==g?(_=(0,Q.jsxs)(`div`,{className:`space-y-2 border-t border-edge pt-4`,children:[l,u,f,g]}),t[20]=l,t[21]=u,t[22]=f,t[23]=g,t[24]=_):_=t[24],_}function Se(e){let t=(0,ue.c)(70),{open:n,onOpenChange:r,onConfirm:i,initialPath:a,selectKind:s,sessionKey:d,agentId:f}=e,m=s===void 0?`any`:s,_=c(u(Te)),v=_.workspace,b=_.sharesSettings,S=M(we),{data:E}=p(l(Ce)?`picker-agents-list`:null,re),k;bb0:{let e;t[0]===f?e=t[1]:(e=f?.trim(),t[0]=f,t[1]=e);let n=e;if(n){k=n;break bb0}let r;t[2]===S?r=t[3]:(r=S.trim(),t[2]=S,t[3]=r);let i=r;if(i){k=i;break bb0}if(E?.defaultId){k=E.defaultId;break bb0}if(E?.agents?.[0]?.id){k=E.agents[0].id;break bb0}k=``}let j=k,[P,F]=(0,J.useState)(j),I,L;t[4]===j?(I=t[5],L=t[6]):(I=()=>{F(j)},L=[j],t[4]=j,t[5]=I,t[6]=L),(0,J.useEffect)(I,L);let{tree:ee,loading:te,error:ie,loadRoot:z,loadChildren:oe,reset:B}=O(P,d??null),V;t[7]===a?V=t[8]:(V=a?{path:a,isDirectory:!1}:null,t[7]=a,t[8]=V);let[H,U]=(0,J.useState)(V),W;t[9]!==a||t[10]!==z||t[11]!==n||t[12]!==B||t[13]!==U?(W=()=>{if(!n){B(),U(a?{path:a,isDirectory:!1}:null);return}z()},t[9]=a,t[10]=z,t[11]=n,t[12]=B,t[13]=U,t[14]=W):W=t[14];let G;t[15]!==a||t[16]!==z||t[17]!==n||t[18]!==P||t[19]!==B||t[20]!==d?(G=[n,P,d,z,B,a],t[15]=a,t[16]=z,t[17]=n,t[18]=P,t[19]=B,t[20]=d,t[21]=G):G=t[21],(0,J.useEffect)(W,G);let K;t[22]===oe?K=t[23]:(K=e=>{oe(e)},t[22]=oe,t[23]=K);let q=K,le=H!==null&&(m===`any`||m===`file`&&!H.isDirectory||m===`directory`&&H.isDirectory),Y;bb1:{if(!H){Y=b.pickerHintNone;break bb1}if(m===`file`&&H.isDirectory){Y=b.pickerHintNeedsFile;break bb1}if(m===`directory`&&!H.isDirectory){Y=b.pickerHintNeedsDirectory;break bb1}Y=`${H.isDirectory?`📁`:`📄`} ${H.path}`}let de=Y,fe=E?.agents??[],X;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,Q.jsx)(g,{className:`fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),t[24]=X):X=t[24];let Z;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Z=o(`fixed left-1/2 top-1/2 z-[71] w-[min(34rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2`,`flex h-[min(28rem,calc(100vh-3rem))] flex-col overflow-hidden rounded-lg border border-edge bg-surface-panel shadow-popover outline-none`),t[25]=Z):Z=t[25];let pe;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(N,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),t[26]=pe):pe=t[26];let me=_.cron.refresh,he=_.cron.refresh,ge;t[27]===z?ge=t[28]:(ge=()=>void z(),t[27]=z,t[28]=ge);let _e=te&&`animate-spin`,ve;t[29]===_e?ve=t[30]:(ve=o(`size-4`,_e),t[29]=_e,t[30]=ve);let ye;t[31]===ve?ye=t[32]:(ye=(0,Q.jsx)(ae,{className:ve,"aria-hidden":!0}),t[31]=ve,t[32]=ye);let be;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,Q.jsx)(ce,{className:`size-4`}),t[33]=be):be=t[33];let $;t[34]!==ie||t[35]!==v.loadError?($=ie?(0,Q.jsxs)(`p`,{className:`shrink-0 px-4 py-2 text-xs text-red-600 dark:text-red-400`,children:[v.loadError,`: `,ie]}):null,t[34]=ie,t[35]=v.loadError,t[36]=$):$=t[36];let xe;t[37]!==q||t[38]!==te||t[39]!==H?.path||t[40]!==U||t[41]!==v.emptyDir||t[42]!==v.title||t[43]!==ee?(xe=te&&ee.length===0?(0,Q.jsxs)(`p`,{className:`flex shrink-0 items-center gap-2 px-4 py-3 text-sm text-fg-muted`,children:[(0,Q.jsx)(w,{className:`size-4 animate-spin`}),v.title,`…`]}):(0,Q.jsx)(h,{tree:ee,selectedPath:H?.path??null,onSelectFile:e=>U({path:e,isDirectory:!1}),onSelectEntry:(e,t)=>U({path:e,isDirectory:t}),onExpandDir:q,onAction:void 0,emptyHint:v.emptyDir}),t[37]=q,t[38]=te,t[39]=H?.path,t[40]=U,t[41]=v.emptyDir,t[42]=v.title,t[43]=ee,t[44]=xe):xe=t[44];let Se;t[45]!==$||t[46]!==xe?(Se=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[$,xe]}),t[45]=$,t[46]=xe,t[47]=Se):Se=t[47];let Ee;t[48]===de?Ee=t[49]:(Ee=(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-xs text-fg-muted`,children:de}),t[48]=de,t[49]=Ee);let De;t[50]===r?De=t[51]:(De=()=>r(!1),t[50]=r,t[51]=De);let Oe;t[52]!==b.cancel||t[53]!==De?(Oe=(0,Q.jsx)(R,{type:`button`,variant:`ghost`,onClick:De,children:b.cancel}),t[52]=b.cancel,t[53]=De,t[54]=Oe):Oe=t[54];let ke=!le,Ae;t[55]!==i||t[56]!==r||t[57]!==P||t[58]!==H?(Ae=()=>{H&&(i({...H,agentId:P}),r(!1))},t[55]=i,t[56]=r,t[57]=P,t[58]=H,t[59]=Ae):Ae=t[59];let je;t[60]!==b.pickerConfirm||t[61]!==ke||t[62]!==Ae?(je=(0,Q.jsx)(R,{type:`button`,disabled:ke,onClick:Ae,children:b.pickerConfirm}),t[60]=b.pickerConfirm,t[61]=ke,t[62]=Ae,t[63]=je):je=t[63];let Me;t[64]!==Oe||t[65]!==je?(Me=(0,Q.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[Oe,je]}),t[64]=Oe,t[65]=je,t[66]=Me):Me=t[66];let Ne;return t[67]!==Ee||t[68]!==Me?(Ne=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-edge px-4 py-3`,children:[Ee,Me]}),t[67]=Ee,t[68]=Me,t[69]=Ne):Ne=t[69],(0,Q.jsx)(x,{open:n,onOpenChange:r,children:(0,Q.jsxs)(ne,{children:[X,(0,Q.jsxs)(D,{className:Z,children:[(0,Q.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-edge px-4`,children:[pe,(0,Q.jsx)(T,{className:`min-w-0 flex-1 truncate text-base font-semibold text-fg`,children:b.pickerTitle}),(0,Q.jsx)(`button`,{type:`button`,className:`inline-flex size-8 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50`,title:me,"aria-label":he,disabled:te,onClick:ge,children:ye}),(0,Q.jsx)(y,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:`inline-flex size-8 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":v.close,children:be})})]}),fe.length>0?(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-edge px-4 py-2`,children:[(0,Q.jsx)(`label`,{className:`text-xs text-fg-muted`,htmlFor:`picker-agent-select`,children:b.pickerAgentLabel}),(0,Q.jsx)(C,{id:`picker-agent-select`,className:`min-w-0 flex-1 rounded-md border border-edge bg-surface-panel px-2 py-1 text-sm text-fg focus:outline-none focus:ring-2 focus:ring-accent`,value:P,onChange:e=>{F(e.target.value),U(null)},children:fe.map(e=>(0,Q.jsxs)(A,{value:e.id,children:[se(e,_.agentsSettings),e.id===E?.defaultId?` ★`:``]},e.id))})]}):null,Se,Ne]})]})})}function Ce(e){return e.token}function we(e){return e.agentId}function Te(e){return e.language}var Ee=[`shares`,`policy`];function De(e){let t=(e??``).trim();return Ee.includes(t)?t:`shares`}function Oe(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function ke(e,t){let n=new Date(e).getTime()-Date.now(),r=Math.abs(n),i=n<0;if(r<6e4)return t===`zh`?`刚刚`:`just now`;let a=Math.floor(r/6e4);if(a<60){let e=t===`zh`?`${a} 分钟`:`${a}m`;return i?t===`zh`?`${e}前`:`${e} ago`:e}let o=Math.floor(a/60);if(o<24){let e=t===`zh`?`${o} 小时`:`${o}h`;return i?t===`zh`?`${e}前`:`${e} ago`:e}let s=Math.floor(o/24),c=t===`zh`?`${s} 天`:`${s}d`;return i?t===`zh`?`${c}前`:`${c} ago`:c}var Ae=[{value:36e5,key:`1h`},{value:216e5,key:`6h`},{value:864e5,key:`24h`},{value:2592e5,key:`3d`},{value:6048e5,key:`7d`},{value:2592e6,key:`30d`}];function je(){let e=(0,ue.c)(24),t=u(Ne),n=c(t).sharesSettings,r=!!l(Me),[a,o]=i(),s;e[0]===a?s=e[1]:(s=De(a.get(`tab`)),e[0]=a,e[1]=s);let d=s,f;e[2]===o?f=e[3]:(f=e=>{o(t=>{let n=new URLSearchParams(t);return e===`shares`?n.delete(`tab`):n.set(`tab`,e),n},{replace:!0})},e[2]=o,e[3]=f);let p=f;if(!r)return(0,Q.jsx)(W,{gap:`gap-3`,padding:`px-3 py-8 sm:px-5 xl:px-6`,children:(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.needToken})});let m={shares:n.tabShares,policy:n.tabPolicy},h=Ee.map(e=>({id:e,label:m[e]})),g;e[4]!==n.subtitle||e[5]!==n.title?(g=(0,Q.jsx)(U,{title:n.title,subtitle:n.subtitle}),e[4]=n.subtitle,e[5]=n.title,e[6]=g):g=e[6];let _;e[7]!==d||e[8]!==p||e[9]!==n.tabsAria||e[10]!==h?(_=(0,Q.jsx)(le,{items:h,activeTab:d,onChange:p,ariaLabel:n.tabsAria,tabIdPrefix:`shares-tab`,panelIdPrefix:`shares-panel`}),e[7]=d,e[8]=p,e[9]=n.tabsAria,e[10]=h,e[11]=_):_=e[11];let v;e[12]!==d||e[13]!==r||e[14]!==t||e[15]!==n?(v=d===`shares`?(0,Q.jsx)(Pe,{t:n,language:t}):(0,Q.jsx)(ye,{hasToken:r}),e[12]=d,e[13]=r,e[14]=t,e[15]=n,e[16]=v):v=e[16];let y;e[17]!==d||e[18]!==v?(y=(0,Q.jsx)(G,{id:d,activeTab:d,tabIdPrefix:`shares-tab`,panelIdPrefix:`shares-panel`,showHeading:!1,children:v}),e[17]=d,e[18]=v,e[19]=y):y=e[19];let b;return e[20]!==g||e[21]!==_||e[22]!==y?(b=(0,Q.jsxs)(W,{children:[g,_,y]}),e[20]=g,e[21]=_,e[22]=y,e[23]=b):b=e[23],b}function Me(e){return e.token}function Ne(e){return e.language}function Pe(e){let t=(0,ue.c)(60),{t:n,language:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={refreshInterval:3e4},t[0]=i):i=t[0];let{data:a,error:s,isLoading:c,mutate:l}=p(`shares-list`,z,i),u;t[1]===a?.payload?.shares?u=t[2]:(u=a?.payload?.shares??[],t[1]=a?.payload?.shares,t[2]=u);let d=u,[f,m]=(0,J.useState)(!1),h;bb0:{if(f){h=d;break bb0}let e;t[3]===d?e=t[4]:(e=d.filter(ze),t[3]=d,t[4]=e),h=e}let g=h,_;t[5]===d?_=t[6]:(_=d.filter(Re),t[5]=d,t[6]=_);let v=_.length,y;t[7]===d?y=t[8]:(y=d.filter(Le),t[7]=d,t[8]=y);let b=y.length,x;t[9]===l?x=t[10]:(x=()=>void l(),t[9]=l,t[10]=x);let S;t[11]!==n||t[12]!==x?(S=(0,Q.jsx)(Ve,{t:n,onCreated:x}),t[11]=n,t[12]=x,t[13]=S):S=t[13];let C=f?n.allSharesTitle:n.listTitle,w;t[14]===v?w=t[15]:(w=v>0&&(0,Q.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-fg-muted`,children:[`(`,v,`)`]}),t[14]=v,t[15]=w);let T;t[16]!==C||t[17]!==w?(T=(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[C,w]}),t[16]=C,t[17]=w,t[18]=T):T=t[18];let E;t[19]===l?E=t[20]:(E=()=>void l(),t[19]=l,t[20]=E);let D=c&&`animate-spin`,O;t[21]===D?O=t[22]:(O=o(`size-3.5`,D),t[21]=D,t[22]=O);let k;t[23]===O?k=t[24]:(k=(0,Q.jsx)(ae,{className:O}),t[23]=O,t[24]=k);let A;t[25]!==c||t[26]!==E||t[27]!==k?(A=(0,Q.jsx)(R,{type:`button`,variant:`ghost`,className:`px-2 py-1`,onClick:E,disabled:c,children:k}),t[25]=c,t[26]=E,t[27]=k,t[28]=A):A=t[28];let j;t[29]!==b||t[30]!==f||t[31]!==n.hideExpired||t[32]!==n.showExpired?(j=b>0&&(0,Q.jsx)(`button`,{type:`button`,className:`text-xs text-accent hover:underline`,onClick:()=>m(Ie),children:f?n.hideExpired:n.showExpired}),t[29]=b,t[30]=f,t[31]=n.hideExpired,t[32]=n.showExpired,t[33]=j):j=t[33];let M;t[34]!==A||t[35]!==j?(M=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[A,j]}),t[34]=A,t[35]=j,t[36]=M):M=t[36];let N;t[37]!==T||t[38]!==M?(N=(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[T,M]}),t[37]=T,t[38]=M,t[39]=N):N=t[39];let P;t[40]!==a||t[41]!==s||t[42]!==g||t[43]!==c||t[44]!==r||t[45]!==l||t[46]!==n?(P=c&&!a?(0,Q.jsx)(`div`,{className:`grid gap-2`,"aria-busy":`true`,children:Array.from({length:4}).map(Fe)}):s?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-red-600 dark:text-red-400`,children:[(0,Q.jsx)(`span`,{children:n.error}),(0,Q.jsx)(R,{type:`button`,variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>void l(),children:n.retry})]}):g.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.emptyState}):(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,children:g.map(e=>(0,Q.jsx)(Ue,{share:e,t:n,language:r,onRevoked:()=>void l(),onExtended:()=>void l()},e.id))}),t[40]=a,t[41]=s,t[42]=g,t[43]=c,t[44]=r,t[45]=l,t[46]=n,t[47]=P):P=t[47];let F;t[48]!==b||t[49]!==l||t[50]!==f||t[51]!==n?(F=b>0&&f&&(0,Q.jsx)(We,{t:n,onCleaned:()=>void l()}),t[48]=b,t[49]=l,t[50]=f,t[51]=n,t[52]=F):F=t[52];let I;t[53]!==N||t[54]!==P||t[55]!==F?(I=(0,Q.jsxs)(q,{children:[N,P,F]}),t[53]=N,t[54]=P,t[55]=F,t[56]=I):I=t[56];let L;return t[57]!==I||t[58]!==S?(L=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[S,I]}),t[57]=I,t[58]=S,t[59]=L):L=t[59],L}function Fe(e,t){return(0,Q.jsx)(`div`,{className:`rounded-lg border border-edge bg-surface-base p-3`,children:(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(k,{className:`h-4 w-2/3`}),(0,Q.jsx)(k,{className:`mt-2 h-3 w-1/2`})]}),(0,Q.jsx)(k,{className:`h-7 w-20 rounded-md`})]})},t)}function Ie(e){return!e}function Le(e){return e.expired||e.revoked}function Re(e){return!e.expired&&!e.revoked}function ze(e){return!e.expired&&!e.revoked}var Be={expanded:!0,path:``,isDirectory:!1,agentId:``,ttlMs:864e5,maxViews:null,description:``,directoryMode:`browse`,creating:!1,result:null,errorMsg:null,resultDialogOpen:!1,pickerOpen:!1};function Ve({t:e,onCreated:t}){let[n,r]=(0,J.useReducer)(_,Be),{expanded:i,path:a,isDirectory:s,agentId:c,ttlMs:l,maxViews:u,description:d,directoryMode:f,creating:p,result:m,errorMsg:h,resultDialogOpen:g,pickerOpen:y}=n,b=(0,J.useCallback)(async()=>{if(a.trim()){r({type:`patch`,patch:{creating:!0,errorMsg:null,result:null}});try{r({type:`patch`,patch:{result:(await I({path:a.trim(),ttlMs:l,maxViews:u,description:d.trim()||void 0,...c?{agentId:c}:{},...s?{kind:`directory`,directoryMode:f}:{}})).payload,resultDialogOpen:!0}}),t()}catch(e){r({type:`patch`,patch:{errorMsg:e instanceof Error?e.message:String(e)}})}finally{r({type:`patch`,patch:{creating:!1}})}}},[a,s,c,l,u,d,f,t]),x=(0,J.useCallback)(()=>{r({type:`patch`,patch:{path:``,isDirectory:!1,agentId:``,description:``,maxViews:null,ttlMs:864e5,directoryMode:`browse`,result:null,errorMsg:null}})},[]);return i?(0,Q.jsxs)(q,{children:[(0,Q.jsx)(`h2`,{className:`mb-1 text-sm font-semibold text-fg`,children:e.createTitle}),(0,Q.jsx)(`p`,{className:`mb-4 text-xs text-fg-muted`,children:e.createHint}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.pathLabel}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`div`,{className:o(`flex min-w-0 flex-1 items-center gap-2 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm`,a?`text-fg`:`text-fg-subtle`),children:a?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,children:s?`📁`:`📄`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:a,children:a})]}):(0,Q.jsx)(`span`,{className:`truncate`,children:e.pathPlaceholder})}),(0,Q.jsxs)(R,{type:`button`,variant:`ghost`,onClick:()=>r({type:`patch`,patch:{pickerOpen:!0}}),children:[(0,Q.jsx)(v,{className:`size-4`}),a?e.pathBrowseChange:e.pathBrowse]})]})]}),s?(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.directoryModeLabel}),(0,Q.jsxs)(C,{className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus:outline-none focus:ring-2 focus:ring-accent`,value:f,onChange:e=>r({type:`patch`,patch:{directoryMode:e.target.value===`zip-only`?`zip-only`:`browse`}}),children:[(0,Q.jsx)(A,{value:`browse`,children:e.directoryModeBrowse}),(0,Q.jsx)(A,{value:`zip-only`,children:e.directoryModeZipOnly})]})]}):null,(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.ttlLabel}),(0,Q.jsx)(C,{className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus:outline-none focus:ring-2 focus:ring-accent`,value:l,onChange:e=>r({type:`patch`,patch:{ttlMs:Number(e.target.value)}}),children:Ae.map(t=>(0,Q.jsx)(A,{value:t.value,children:e.ttlOptions[t.key]},t.key))})]}),(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.maxViewsLabel}),(0,Q.jsxs)(C,{className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus:outline-none focus:ring-2 focus:ring-accent`,value:u??`unlimited`,onChange:e=>r({type:`patch`,patch:{maxViews:e.target.value===`unlimited`?null:Number(e.target.value)}}),children:[(0,Q.jsx)(A,{value:`unlimited`,children:e.maxViewsUnlimited}),(0,Q.jsx)(A,{value:`1`,children:`1`}),(0,Q.jsx)(A,{value:`5`,children:`5`}),(0,Q.jsx)(A,{value:`10`,children:`10`}),(0,Q.jsx)(A,{value:`50`,children:`50`}),(0,Q.jsx)(A,{value:`100`,children:`100`})]})]})]}),(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.descriptionLabel}),(0,Q.jsx)(`input`,{type:`text`,className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle focus:outline-none focus:ring-2 focus:ring-accent`,placeholder:e.descriptionPlaceholder,value:d,onChange:e=>r({type:`patch`,patch:{description:e.target.value}})})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,Q.jsxs)(R,{type:`button`,disabled:p||!a.trim(),onClick:()=>void b(),children:[p?(0,Q.jsx)(w,{className:`size-4 animate-spin`}):(0,Q.jsx)(B,{className:`size-4`}),p?e.creating:e.createButton]}),(0,Q.jsx)(R,{type:`button`,variant:`ghost`,onClick:()=>{x(),r({type:`patch`,patch:{expanded:!1}})},children:e.cancel})]}),h&&(0,Q.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:h})]}),(0,Q.jsx)(P,{open:g,onOpenChange:e=>{r({type:`patch`,patch:{resultDialogOpen:e,...e?{}:{result:null}}})},result:m}),(0,Q.jsx)(Se,{open:y,onOpenChange:e=>r({type:`patch`,patch:{pickerOpen:e}}),initialPath:a||void 0,selectKind:`any`,onConfirm:e=>r({type:`patch`,patch:{path:e.path,isDirectory:e.isDirectory,agentId:e.agentId,directoryMode:`browse`}})})]}):(0,Q.jsxs)(R,{type:`button`,onClick:()=>r({type:`patch`,patch:{expanded:!0}}),className:`self-start`,children:[(0,Q.jsx)(B,{className:`size-4`}),e.createTitle]})}var He={revokeOpen:!1,revoking:!1,linksOpen:!1,urlCopied:!1,copyFailed:!1,extending:!1};function Ue({share:e,t,language:n,onRevoked:r,onExtended:i}){let[c,l]=(0,J.useReducer)(_,He),{revokeOpen:u,revoking:d,linksOpen:f,urlCopied:p,copyFailed:m,extending:h}=c,g=!e.expired&&!e.revoked,y=e.revoked?t.statusRevoked:e.expired?t.statusExpired:t.statusActive,x=e.revoked?`text-red-600 dark:text-red-400`:e.expired?`text-fg-subtle`:`text-emerald-600 dark:text-emerald-400`,C=(0,J.useCallback)(async()=>{l({type:`patch`,patch:{revokeOpen:!1,revoking:!0}});try{await V(e.id),r()}catch{}finally{l({type:`patch`,patch:{revoking:!1}})}},[e.id,r]),T=(0,J.useCallback)(async()=>{if(l({type:`patch`,patch:{linksOpen:!0,copyFailed:!1}}),!await s(e.shareUrl)){l({type:`patch`,patch:{copyFailed:!0}}),window.setTimeout(()=>l({type:`patch`,patch:{copyFailed:!1}}),2500);return}l({type:`patch`,patch:{urlCopied:!0}}),window.setTimeout(()=>l({type:`patch`,patch:{urlCopied:!1}}),2e3)},[e.shareUrl]),D=(0,J.useCallback)(async()=>{l({type:`patch`,patch:{extending:!0}});try{await H(e.id,864e5),i()}catch{}finally{l({type:`patch`,patch:{extending:!1}})}},[e.id,i]),O=`share-links-${e.id}`;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`rounded-lg bg-surface-panel/80 px-3 py-2.5 shadow-surface`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:o(`flex min-w-0 flex-1 items-start gap-3 rounded-md text-left`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),"aria-expanded":f,"aria-controls":O,onClick:()=>l({type:`patch`,patch:{linksOpen:!f}}),children:[(0,Q.jsx)(te,{className:o(`mt-0.5 size-4 shrink-0 text-fg-muted transition-transform`,f?`rotate-0`:`-rotate-90`),"aria-hidden":!0}),(0,Q.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.fileName}),(0,Q.jsx)(`span`,{className:o(`text-xs font-medium`,x),children:y})]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-fg-subtle`,children:e.workspaceRelativePath}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:Oe(e.fileSize)}),(0,Q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(j,{className:`size-3`}),e.expired?n===`zh`?`已过期`:`expired`:ke(e.expiresAt,n)]}),(0,Q.jsxs)(`span`,{children:[t.views,`: `,e.downloadCount,e.maxViews!==null&&` ${t.viewsOf} ${e.maxViews}`]}),e.description&&(0,Q.jsx)(`span`,{className:`italic text-fg-subtle`,children:e.description})]})]})]}),(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:g&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(R,{type:`button`,variant:`ghost`,className:`px-2 py-1`,title:t.copyUrl,onClick:()=>void T(),children:p?(0,Q.jsx)(a,{className:`size-3.5 text-emerald-500`}):(0,Q.jsx)(S,{className:`size-3.5`})}),(0,Q.jsx)(R,{type:`button`,variant:`ghost`,className:`px-2 py-1`,onClick:()=>void D(),disabled:h,title:t.extend,children:h?(0,Q.jsx)(w,{className:`size-3.5 animate-spin`}):(0,Q.jsx)(j,{className:`size-3.5`})}),(0,Q.jsx)(R,{type:`button`,variant:`ghost`,className:`px-2 py-1 text-red-600 hover:text-red-700 dark:text-red-400`,onClick:()=>l({type:`patch`,patch:{revokeOpen:!0}}),disabled:d,children:d?(0,Q.jsx)(w,{className:`size-3.5 animate-spin`}):(0,Q.jsx)(E,{className:`size-3.5`})})]})})]}),g&&f?(0,Q.jsxs)(`div`,{id:O,className:`mt-3 bg-surface-base/45 py-3 pl-7 pr-3`,children:[(0,Q.jsx)(oe,{shareUrl:e.shareUrl,lanUrl:e.lanUrl,reachability:e.reachability,compact:!0}),m?(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-red-600 dark:text-red-400`,children:t.copyFailed}):null,(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(ee,{reachability:e.reachability})})]}):null]}),(0,Q.jsx)(b,{open:u,title:t.revokeConfirmTitle,description:t.revokeConfirmBody,confirmLabel:t.revokeConfirmLabel,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void C(),onCancel:()=>l({type:`patch`,patch:{revokeOpen:!1}})})]})}function We({t:e,onCleaned:t}){let[n,r]=(0,J.useState)(!1),[i,a]=(0,J.useState)(!1),o=(0,J.useCallback)(async()=>{r(!1),a(!0);try{await m(),t()}catch{}finally{a(!1)}},[t]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsxs)(R,{type:`button`,variant:`secondary`,disabled:i,onClick:()=>r(!0),className:`border-danger/40 px-2 py-1 text-xs text-danger hover:bg-danger/10`,children:[i?(0,Q.jsx)(w,{className:`size-3.5 animate-spin`}):(0,Q.jsx)(E,{className:`size-3.5`}),e.cleanExpired]})}),(0,Q.jsx)(b,{open:n,title:e.cleanExpiredConfirmTitle,description:e.cleanExpiredConfirmBody,confirmLabel:e.cleanExpiredConfirmLabel,cancelLabel:e.cancel,destructive:!0,onConfirm:()=>void o(),onCancel:()=>r(!1)})]})}export{je as SharesSettingsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-aKtaBQYM.js";import{o as t,r as n}from"./locale-store-VOY1wMO9.js";import{Cr as r}from"./index-DzmbmOGA.js";var i=e({reloadSkills:()=>a});async function a(){let e=await t(n(`/api/skills/reload`),{method:`POST`});if(!e.ok)throw Error(await r(e))}export{i as n,a as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jszip.min-DT31yWkU.js","assets/rolldown-runtime-aKtaBQYM.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{c as a,f as o,l as s}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as c}from"./cn-JdwAhgNB.js";import{t as l}from"./messages-DMJ-6-1m.js";import{l as u,n as d}from"./locale-store-VOY1wMO9.js";import{t as f}from"./config-reload-event-Bjh2zoKp.js";import{$l as p,Ao as m,Do as h,El as g,Eo as _,Fa as v,Lc as y,Mo as b,Ms as x,Ol as S,Oo as C,Pa as w,Sr as T,Vo as E,Vs as D,_i as O,el as k,hi as A,hs as j,ji as M,jo as N,js as P,ls as F,nc as I,nu as L,pc as R,ru as z,tu as B,vs as V}from"./index-DzmbmOGA.js";import{t as H}from"./page-tabs-CvzSdYVj.js";import{t as U}from"./skill-reload-api-CGCOC-rV.js";import{_ as W,a as G,c as ee,d as K,f as q,g as J,h as te,i as ne,l as re,m as ie,n as ae,o as oe,p as se,r as Y,s as ce,t as le,u as ue}from"./skills-page.utils-Bwid1TGB.js";var X=n(),Z=e(t(),1),Q=r(),de=(0,Z.memo)(function(e){let t=(0,X.c)(23),{loading:n,onReloadClick:r,searchQuery:i,setSearchQuery:a,mainTab:o,sk:s,setPendingFile:c,setInstallOpen:l}=e,u;t[0]!==n||t[1]!==r||t[2]!==s.reloadDiskAria||t[3]!==s.reloadRuntime?(u=(0,Q.jsx)(M,{className:`size-9 shrink-0 p-0`,loading:n,label:s.reloadDiskAria,title:s.reloadRuntime,onClick:r}),t[0]=n,t[1]=r,t[2]=s.reloadDiskAria,t[3]=s.reloadRuntime,t[4]=u):u=t[4];let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(I,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-disabled`,strokeWidth:1.75,"aria-hidden":!0}),t[5]=d):d=t[5];let f;t[6]===a?f=t[7]:(f=e=>a(e.target.value),t[6]=a,t[7]=f);let p=o===`marketplace`?s.marketplaceSearchPackages:s.searchPlaceholder,m;t[8]!==i||t[9]!==f||t[10]!==p?(m=(0,Q.jsxs)(`label`,{className:`relative flex min-h-9 min-w-0 max-w-sm cursor-text items-center rounded-pill border border-edge bg-surface-base py-1.5 pl-9 pr-3 shadow-surface dark:bg-surface-hover/40 sm:max-w-md`,children:[d,(0,Q.jsx)(`input`,{type:`search`,enterKeyHint:`search`,value:i,onChange:f,placeholder:p,autoComplete:`off`,spellCheck:!1,className:`min-w-0 flex-1 appearance-none border-0 bg-transparent py-0.5 text-sm leading-normal text-fg caret-current placeholder:text-fg-disabled focus:border-0 focus:shadow-none focus:outline-none focus:ring-0 focus-visible:outline-none`})]}),t[8]=i,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]!==l||t[13]!==c?(h=()=>{c(null),l(!0)},t[12]=l,t[13]=c,t[14]=h):h=t[14];let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(R,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[15]=g):g=t[15];let _;t[16]!==s.installCta||t[17]!==h?(_=(0,Q.jsxs)(j,{type:`button`,variant:`primary`,className:`shrink-0 gap-2`,onClick:h,children:[g,s.installCta]}),t[16]=s.installCta,t[17]=h,t[18]=_):_=t[18];let v;return t[19]!==u||t[20]!==m||t[21]!==_?(v=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center justify-end gap-2`,children:[u,m,_]}),t[19]=u,t[20]=m,t[21]=_,t[22]=v):v=t[22],v}),fe=`animate-pulse motion-reduce:animate-none rounded-md bg-surface-hover dark:bg-surface-active/50`;function pe(){let e=(0,X.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{className:c(`h-4 min-w-0 flex-1`,fe)}),e[0]=t):t=e[0];let n,r,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[t,(0,Q.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,Q.jsx)(`div`,{className:c(`size-8 shrink-0 rounded-lg`,fe)}),(0,Q.jsx)(`div`,{className:c(`h-8 w-[4.5rem] shrink-0 rounded-lg`,fe)})]})]}),r=(0,Q.jsx)(`div`,{className:c(`h-3 w-full`,fe)}),i=(0,Q.jsx)(`div`,{className:c(`h-3 w-[92%]`,fe)}),e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(`div`,{className:`flex h-full min-h-[10.5rem] flex-col rounded-xl bg-surface-panel p-4 shadow-surface`,"aria-hidden":!0,children:(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 items-start gap-3`,children:(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:[n,r,i,(0,Q.jsxs)(`div`,{className:`mt-auto space-y-1 pt-0.5`,children:[(0,Q.jsx)(`div`,{className:c(`h-3 w-full`,fe)}),(0,Q.jsx)(`div`,{className:c(`h-2.5 w-4/5`,fe)})]})]})})}),e[4]=a):a=e[4],a}function me(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(pe,{}),e[0]=t):t=e[0],t}var he=new Set([`installed`,`marketplace`]),ge=new Set([`all`,`builtin`,`installed`,`global`,`workspace`,`extra`]),_e=new Set([`all`,`enabled`,`disabled`]),ve=`mprov`,ye=[`s0`,`s1`,`s2`,`s3`,`s4`,`s5`],be=[`business`,`creative`,`documents`,`engineering`,`tools`];function xe(e){let t=(0,X.c)(27),{sk:n,loading:r,catalog:i,filteredCatalog:a,builtinCategories:o,builtinCategoryFilter:s,setBuiltinCategoryFilter:l,catalogDisplayRows:u,catalogStatusFilter:d,resolveSkillEnabled:f,categoryLabel:m,sourceLabel:h,openSkillDetail:g,onSkillToggle:_,onUseSkillInChat:v,usingSkillInChatName:y,togglingSkillName:b}=e;if(r){let e=n.loading,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=ye.map(Se),t[0]=r):r=t[0];let i;return t[1]===n.loading?i=t[2]:(i=(0,Q.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,"aria-busy":`true`,"aria-label":e,children:r}),t[1]=n.loading,t[2]=i),i}if(i.length===0){let e;return t[3]===n.empty?e=t[4]:(e=(0,Q.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge py-16 text-center text-sm text-fg-muted`,children:n.empty}),t[3]=n.empty,t[4]=e),e}if(a.length===0){let e;return t[5]===n.noSearchResults?e=t[6]:(e=(0,Q.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge py-16 text-center text-sm text-fg-muted`,children:n.noSearchResults}),t[5]=n.noSearchResults,t[6]=e),e}let x;t[7]!==o||t[8]!==s||t[9]!==m||t[10]!==l||t[11]!==n?(x=o.length>1?(0,Q.jsx)(H,{items:[{id:``,label:n.marketplaceCategoryAll},...o.map(e=>({id:e,label:m(e),title:m(e)}))],activeTab:s,onChange:l,ariaLabel:n.marketplaceCategoriesAria,tabIdPrefix:`skills-builtin-category-tab`,className:`gap-2 pt-0.5 [scrollbar-width:thin]`,buttonClassName:`max-w-[14rem] truncate rounded-full border px-3 py-1.5 text-xs`,selectedClassName:`border-fg bg-fg text-surface-panel dark:border-fg dark:bg-fg dark:text-surface-base`,unselectedClassName:`border-edge bg-surface-panel text-fg-muted hover:border-edge-strong hover:text-fg dark:border-edge dark:bg-surface-hover/40`}):null,t[7]=o,t[8]=s,t[9]=m,t[10]=l,t[11]=n,t[12]=x):x=t[12];let S;t[13]!==u||t[14]!==d||t[15]!==_||t[16]!==v||t[17]!==g||t[18]!==f||t[19]!==n||t[20]!==h||t[21]!==b||t[22]!==y?(S=u.length===0?(0,Q.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge py-16 text-center text-sm text-fg-muted`,children:d===`disabled`?n.noDisabledSkills:n.noSearchResults}):(0,Q.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:u.map(e=>{let t=f(e);return(0,Q.jsxs)(`article`,{className:c(`group flex h-full flex-col rounded-xl bg-surface-panel p-4 shadow-surface transition-colors`,t?`hover:bg-surface-hover`:`bg-amber-50/30 hover:bg-amber-50/50 dark:bg-amber-950/20`),children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`button`,{type:`button`,className:c(`min-w-0 flex-1 cursor-pointer rounded-lg text-left outline-none`,F.focusRingPanel),"aria-labelledby":`catalog-skill-title-${e.directoryId}`,onClick:()=>void g(e),children:(0,Q.jsx)(`h3`,{id:`catalog-skill-title-${e.directoryId}`,className:`truncate text-[15px] font-semibold leading-8 tracking-tight text-fg`,children:e.name})}),(0,Q.jsxs)(`span`,{className:c(`hidden shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-medium xl:inline-flex`,t?`border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:`border-amber-500/30 bg-amber-500/10 text-amber-800 dark:text-amber-200`),children:[t?(0,Q.jsx)(p,{className:`size-3`,"aria-hidden":!0}):(0,Q.jsx)(B,{className:`size-3`,"aria-hidden":!0}),t?n.statusEnabled:n.statusDisabled]}),t?(0,Q.jsx)(j,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 whitespace-nowrap px-2.5 text-xs font-medium`,disabled:y===e.name||b===e.name,onClick:()=>void v({name:e.name,source:`catalog`}),children:y===e.name?n.previewUseInChatBusy:n.previewUseInChat}):(0,Q.jsx)(j,{type:`button`,variant:`primary`,className:`h-8 shrink-0 whitespace-nowrap px-2.5 text-xs font-medium`,disabled:b===e.name,onClick:()=>void _(e.name,!0),children:b===e.name?n.uploading:n.detailModalEnable})]}),(0,Q.jsx)(`button`,{type:`button`,className:c(`mt-2 flex min-h-0 w-full flex-1 cursor-pointer flex-col rounded-lg text-left outline-none`,F.focusRingPanel),"aria-labelledby":`catalog-skill-title-${e.directoryId}`,onClick:()=>void g(e),children:(0,Q.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:[(0,Q.jsx)(`p`,{className:`line-clamp-2 text-sm leading-relaxed text-fg-muted`,title:e.description?e.description:void 0,children:e.description||`—`}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 text-[11px] text-fg-subtle`,children:[(0,Q.jsx)(`span`,{className:`rounded-md bg-surface-hover/60 px-2 py-0.5 dark:bg-surface-active/50`,children:h(e)}),e.managed?(0,Q.jsxs)(`span`,{className:`rounded-md bg-surface-hover/60 px-2 py-0.5 dark:bg-surface-active/50`,children:[n.col.managed,`: `,n.yes]}):null,e.hub?(0,Q.jsxs)(`span`,{className:`max-w-full break-all rounded-md bg-surface-hover/60 px-2 py-0.5 font-mono text-[10px] leading-snug dark:bg-surface-active/50 line-clamp-2`,title:`${e.hub.source}${e.hub.ref?`\nref: ${e.hub.ref}`:``}\nupdated: ${e.hub.updatedAt}`,children:[n.hubRemote,` ·`,` `,e.hub.kind===`git`?n.hubKindGit:n.hubKindArchive,` ·`,` `,e.hub.source.length>48?`${e.hub.source.slice(0,48)}…`:e.hub.source]}):null]})]})})})]},`${e.directoryId}-${e.path}`)})}),t[13]=u,t[14]=d,t[15]=_,t[16]=v,t[17]=g,t[18]=f,t[19]=n,t[20]=h,t[21]=b,t[22]=y,t[23]=S):S=t[23];let C;return t[24]!==x||t[25]!==S?(C=(0,Q.jsxs)(Q.Fragment,{children:[x,S]}),t[24]=x,t[25]=S,t[26]=C):C=t[26],C}function Se(e){return(0,Q.jsx)(me,{},e)}function Ce(e){let t=(0,X.c)(32),{sk:n,confirmOpen:r,setConfirmOpen:i,confirmId:a,setConfirmId:o,runDelete:s}=e,c;t[0]!==o||t[1]!==i?(c=e=>{i(e),e||o(null)},t[0]=o,t[1]=i,t[2]=c):c=t[2];let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(m,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),t[3]=l):l=t[3];let u;t[4]===n.deleteTitle?u=t[5]:(u=(0,Q.jsx)(b,{className:`text-base font-semibold text-fg`,children:n.deleteTitle}),t[4]=n.deleteTitle,t[5]=u);let d;t[6]!==a||t[7]!==n.deleteMessage?(d=a?Y(n.deleteMessage,{id:a}):``,t[6]=a,t[7]=n.deleteMessage,t[8]=d):d=t[8];let f;t[9]===d?f=t[10]:(f=(0,Q.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:d}),t[9]=d,t[10]=f);let p;t[11]===i?p=t[12]:(p=()=>i(!1),t[11]=i,t[12]=p);let h;t[13]!==n.cancel||t[14]!==p?(h=(0,Q.jsx)(j,{type:`button`,variant:`secondary`,onClick:p,children:n.cancel}),t[13]=n.cancel,t[14]=p,t[15]=h):h=t[15];let g;t[16]===s?g=t[17]:(g=()=>void s(),t[16]=s,t[17]=g);let v;t[18]!==n.deleteConfirm||t[19]!==g?(v=(0,Q.jsx)(j,{type:`button`,variant:`primary`,className:`bg-red-600 hover:bg-red-700`,onClick:g,children:n.deleteConfirm}),t[18]=n.deleteConfirm,t[19]=g,t[20]=v):v=t[20];let y;t[21]!==h||t[22]!==v?(y=(0,Q.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[h,v]}),t[21]=h,t[22]=v,t[23]=y):y=t[23];let x;t[24]!==y||t[25]!==u||t[26]!==f?(x=(0,Q.jsxs)(N,{children:[l,(0,Q.jsxs)(C,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[60] w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-edge bg-surface-panel p-4 shadow-popover dark:border-edge`,children:[u,f,y]})]}),t[24]=y,t[25]=u,t[26]=f,t[27]=x):x=t[27];let S;return t[28]!==r||t[29]!==c||t[30]!==x?(S=(0,Q.jsx)(_,{open:r,onOpenChange:c,children:x}),t[28]=r,t[29]=c,t[30]=x,t[31]=S):S=t[31],S}function we(e){let t=(0,X.c)(7),{label:n,children:r}=e;if(r==null||r===!1)return null;let i;t[0]===n?i=t[1]:(i=(0,Q.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Q.jsx)(`div`,{className:`mt-1.5 min-w-0 text-sm text-fg`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3 dark:border-edge/60`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Te(e){let t=(0,X.c)(118),{preview:n,sk:r}=e,i=n.metadata,a=n.toolConditions,o=!!a&&(a.requiresTools.length>0||a.requiresToolsets.length>0||a.fallbackForTools.length>0||a.fallbackForToolsets.length>0),s=i.requires,l=s&&((s.bins?.length??0)>0||(s.env?.length??0)>0||(s.anyBins?.length??0)>0),u,d,f,p,m,h,g,_,v,y,b,x,S,C,w;if(t[0]!==a||t[1]!==l||t[2]!==o||t[3]!==i.emoji||t[4]!==i.homepage||t[5]!==i.install||t[6]!==i.os||t[7]!==n.description||t[8]!==n.disableModelInvocation||t[9]!==n.requiredEnvVarNames||t[10]!==s||t[11]!==r.detailEnvVarsLabel||t[12]!==r.detailHomepageLabel||t[13]!==r.detailInstallLabel||t[14]!==r.detailNotInjectedNote||t[15]!==r.detailPlatformsLabel||t[16]!==r.detailRequiresAnyBins||t[17]!==r.detailRequiresBins||t[18]!==r.detailRequiresEnv||t[19]!==r.detailRequiresLabel||t[20]!==r.detailSummaryHeading||t[21]!==r.detailToolGatingLabel||t[22]!==r.detailToolsFallbackList||t[23]!==r.detailToolsRequiresList||t[24]!==r.detailToolsetsFallbackList||t[25]!==r.detailToolsetsRequiresList){let e=i.install?.filter(Oe)??[],T=n.requiredEnvVarNames?.filter(De)??[];g=`space-y-6`,m=`skill-detail-summary-heading`,t[41]===r.detailSummaryHeading?h=t[42]:(h=(0,Q.jsx)(`h3`,{id:`skill-detail-summary-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:r.detailSummaryHeading}),t[41]=r.detailSummaryHeading,t[42]=h),v=`rounded-xl border border-edge bg-surface-base px-4 py-3 dark:bg-surface-hover/25`,t[43]===i.emoji?y=t[44]:(y=i.emoji?.trim()?(0,Q.jsx)(`p`,{className:`text-2xl leading-none`,"aria-hidden":!0,children:i.emoji.trim()}):null,t[43]=i.emoji,t[44]=y);let E;t[45]===i.emoji?E=t[46]:(E=i.emoji?.trim()?`mt-2`:``,t[45]=i.emoji,t[46]=E);let D;t[47]===E?D=t[48]:(D=c(`text-sm leading-relaxed text-fg`,E),t[47]=E,t[48]=D),t[49]!==n.description||t[50]!==D?(b=(0,Q.jsx)(`p`,{className:D,children:n.description}),t[49]=n.description,t[50]=D,t[51]=b):b=t[51],t[52]!==n.disableModelInvocation||t[53]!==r.detailNotInjectedNote?(x=n.disableModelInvocation?(0,Q.jsx)(`p`,{className:`mt-3 rounded-lg border border-amber-200/80 bg-amber-50/90 px-3 py-2 text-xs leading-snug text-amber-950 dark:border-amber-900/50 dark:bg-amber-950/40 dark:text-amber-100`,children:r.detailNotInjectedNote}):null,t[52]=n.disableModelInvocation,t[53]=r.detailNotInjectedNote,t[54]=x):x=t[54];let O;t[55]===i.homepage?O=t[56]:(O=i.homepage?.trim()?(0,Q.jsx)(`a`,{href:i.homepage.trim(),target:`_blank`,rel:`noopener noreferrer`,className:`break-all text-accent underline-offset-2 hover:underline`,children:i.homepage.trim()}):null,t[55]=i.homepage,t[56]=O),t[57]!==r.detailHomepageLabel||t[58]!==O?(S=(0,Q.jsx)(we,{label:r.detailHomepageLabel,children:O}),t[57]=r.detailHomepageLabel,t[58]=O,t[59]=S):S=t[59];let k;t[60]===i.os?k=t[61]:(k=i.os&&i.os.length>0?(0,Q.jsx)(`span`,{className:`font-mono text-xs text-fg-muted`,children:i.os.join(`, `)}):null,t[60]=i.os,t[61]=k),t[62]!==r.detailPlatformsLabel||t[63]!==k?(C=(0,Q.jsx)(we,{label:r.detailPlatformsLabel,children:k}),t[62]=r.detailPlatformsLabel,t[63]=k,t[64]=C):C=t[64];let A;t[65]!==l||t[66]!==s||t[67]!==r.detailRequiresAnyBins||t[68]!==r.detailRequiresBins||t[69]!==r.detailRequiresEnv?(A=l&&s?(0,Q.jsxs)(`ul`,{className:`list-inside list-disc space-y-1 text-sm text-fg-muted`,children:[s.bins&&s.bins.length>0?(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`span`,{className:`text-fg`,children:[r.detailRequiresBins,`: `]}),s.bins.join(`, `)]}):null,s.env&&s.env.length>0?(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`span`,{className:`text-fg`,children:[r.detailRequiresEnv,`: `]}),(0,Q.jsx)(`span`,{className:`font-mono text-xs`,children:s.env.join(`, `)})]}):null,s.anyBins&&s.anyBins.length>0?(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`span`,{className:`text-fg`,children:[r.detailRequiresAnyBins,`: `]}),s.anyBins.join(`, `)]}):null]}):null,t[65]=l,t[66]=s,t[67]=r.detailRequiresAnyBins,t[68]=r.detailRequiresBins,t[69]=r.detailRequiresEnv,t[70]=A):A=t[70],t[71]!==r.detailRequiresLabel||t[72]!==A?(w=(0,Q.jsx)(we,{label:r.detailRequiresLabel,children:A}),t[71]=r.detailRequiresLabel,t[72]=A,t[73]=w):w=t[73];let j=e.length>0?(0,Q.jsx)(`ul`,{className:`list-inside list-decimal space-y-1.5 text-sm text-fg-muted`,children:e.map(Ee)}):null;t[74]!==r.detailInstallLabel||t[75]!==j?(f=(0,Q.jsx)(we,{label:r.detailInstallLabel,children:j}),t[74]=r.detailInstallLabel,t[75]=j,t[76]=f):f=t[76];let M;t[77]!==a||t[78]!==o||t[79]!==r.detailToolsFallbackList||t[80]!==r.detailToolsRequiresList||t[81]!==r.detailToolsetsFallbackList||t[82]!==r.detailToolsetsRequiresList?(M=o&&a?(0,Q.jsxs)(`ul`,{className:`mt-1 space-y-2 text-sm text-fg-muted`,children:[a.requiresTools.length>0?(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`span`,{className:`font-medium text-fg`,children:[r.detailToolsRequiresList,`: `]}),a.requiresTools.join(`, `)]}):null,a.requiresToolsets.length>0?(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`span`,{className:`font-medium text-fg`,children:[r.detailToolsetsRequiresList,`: `]}),a.requiresToolsets.join(`, `)]}):null,a.fallbackForTools.length>0?(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`span`,{className:`font-medium text-fg`,children:[r.detailToolsFallbackList,`: `]}),a.fallbackForTools.join(`, `)]}):null,a.fallbackForToolsets.length>0?(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`span`,{className:`font-medium text-fg`,children:[r.detailToolsetsFallbackList,`: `]}),a.fallbackForToolsets.join(`, `)]}):null]}):null,t[77]=a,t[78]=o,t[79]=r.detailToolsFallbackList,t[80]=r.detailToolsRequiresList,t[81]=r.detailToolsetsFallbackList,t[82]=r.detailToolsetsRequiresList,t[83]=M):M=t[83],t[84]!==r.detailToolGatingLabel||t[85]!==M?(p=(0,Q.jsx)(we,{label:r.detailToolGatingLabel,children:M}),t[84]=r.detailToolGatingLabel,t[85]=M,t[86]=p):p=t[86],u=we,d=r.detailEnvVarsLabel,_=T.length>0?(0,Q.jsx)(`span`,{className:`font-mono text-xs text-fg-muted`,children:T.join(`, `)}):null,t[0]=a,t[1]=l,t[2]=o,t[3]=i.emoji,t[4]=i.homepage,t[5]=i.install,t[6]=i.os,t[7]=n.description,t[8]=n.disableModelInvocation,t[9]=n.requiredEnvVarNames,t[10]=s,t[11]=r.detailEnvVarsLabel,t[12]=r.detailHomepageLabel,t[13]=r.detailInstallLabel,t[14]=r.detailNotInjectedNote,t[15]=r.detailPlatformsLabel,t[16]=r.detailRequiresAnyBins,t[17]=r.detailRequiresBins,t[18]=r.detailRequiresEnv,t[19]=r.detailRequiresLabel,t[20]=r.detailSummaryHeading,t[21]=r.detailToolGatingLabel,t[22]=r.detailToolsFallbackList,t[23]=r.detailToolsRequiresList,t[24]=r.detailToolsetsFallbackList,t[25]=r.detailToolsetsRequiresList,t[26]=u,t[27]=d,t[28]=f,t[29]=p,t[30]=m,t[31]=h,t[32]=g,t[33]=_,t[34]=v,t[35]=y,t[36]=b,t[37]=x,t[38]=S,t[39]=C,t[40]=w}else u=t[26],d=t[27],f=t[28],p=t[29],m=t[30],h=t[31],g=t[32],_=t[33],v=t[34],y=t[35],b=t[36],x=t[37],S=t[38],C=t[39],w=t[40];let T;t[87]!==u||t[88]!==d||t[89]!==_?(T=(0,Q.jsx)(u,{label:d,children:_}),t[87]=u,t[88]=d,t[89]=_,t[90]=T):T=t[90];let E;t[91]!==f||t[92]!==p||t[93]!==T||t[94]!==v||t[95]!==y||t[96]!==b||t[97]!==x||t[98]!==S||t[99]!==C||t[100]!==w?(E=(0,Q.jsxs)(`div`,{className:v,children:[y,b,x,S,C,w,f,p,T]}),t[91]=f,t[92]=p,t[93]=T,t[94]=v,t[95]=y,t[96]=b,t[97]=x,t[98]=S,t[99]=C,t[100]=w,t[101]=E):E=t[101];let D;t[102]!==m||t[103]!==h||t[104]!==E?(D=(0,Q.jsxs)(`section`,{"aria-labelledby":m,children:[h,E]}),t[102]=m,t[103]=h,t[104]=E,t[105]=D):D=t[105];let k;t[106]===r.detailInstructionsHeading?k=t[107]:(k=(0,Q.jsx)(`h3`,{id:`skill-detail-instructions-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:r.detailInstructionsHeading}),t[106]=r.detailInstructionsHeading,t[107]=k);let A;t[108]!==n.bodyMarkdown||t[109]!==r.detailNoInstructionsBody?(A=n.bodyMarkdown.trim()?(0,Q.jsx)(`div`,{className:`markdown-content min-w-0 break-words`,children:(0,Q.jsx)(O,{content:n.bodyMarkdown})}):(0,Q.jsx)(`p`,{className:`text-sm italic text-fg-muted`,children:r.detailNoInstructionsBody}),t[108]=n.bodyMarkdown,t[109]=r.detailNoInstructionsBody,t[110]=A):A=t[110];let j;t[111]!==k||t[112]!==A?(j=(0,Q.jsxs)(`section`,{"aria-labelledby":`skill-detail-instructions-heading`,children:[k,A]}),t[111]=k,t[112]=A,t[113]=j):j=t[113];let M;return t[114]!==g||t[115]!==D||t[116]!==j?(M=(0,Q.jsxs)(`div`,{className:g,children:[D,j]}),t[114]=g,t[115]=D,t[116]=j,t[117]=M):M=t[117],M}function Ee(e,t){return(0,Q.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:(0,Q.jsx)(`span`,{className:`text-fg`,children:ae(e)})},e.id||`${e.kind}-${t}`)}function De(e){return e.trim()}function Oe(e){return e&&typeof e.kind==`string`}var ke=[{id:`s0`,width:`w-[92%]`},{id:`s1`,width:`w-full`},{id:`s2`,width:`w-4/5`},{id:`s3`,width:`w-[92%]`},{id:`s4`,width:`w-full`},{id:`s5`,width:`w-4/5`},{id:`s6`,width:`w-[92%]`},{id:`s7`,width:`w-full`},{id:`s8`,width:`w-4/5`},{id:`s9`,width:`w-[92%]`}];function Ae(e){let t=(0,X.c)(81),{sk:n,detailOpen:r,setDetailOpen:i,detailSource:a,setDetailSource:o,detailTitle:s,setDetailTitle:l,detailCatalogPreview:u,setDetailCatalogPreview:d,detailMarketplacePreview:f,setDetailMarketplacePreview:p,detailLoading:g,detailError:v,setDetailError:y,detailEnabled:w,detailDirectoryId:T,detailManaged:E,detailExternalUrl:D,usingSkillInChatName:O,installingMarketName:A,togglingSkillName:M,isSkillInstalledByName:I,onUseSkillInChat:L,onMarketInstall:R,onSkillToggle:z,setConfirmId:B,setConfirmOpen:H}=e,U;t[0]!==d||t[1]!==y||t[2]!==p||t[3]!==i||t[4]!==o||t[5]!==l?(U=e=>{i(e),e||(o(`catalog`),d(null),p(null),y(null),l(``))},t[0]=d,t[1]=y,t[2]=p,t[3]=i,t[4]=o,t[5]=l,t[6]=U):U=t[6];let W;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(m,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),t[7]=W):W=t[7];let G;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(G=c(`xopc-dialog-content fixed left-1/2 top-1/2 z-[60] flex h-[min(88vh,44rem)] max-h-[min(92vh,56rem)] w-[min(100%-2rem,min(92vw,56rem))]`,`-translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-panel shadow-float dark:border-edge`),t[8]=G):G=t[8];let ee=s||`?`,K;t[9]===ee?K=t[10]:(K=(0,Q.jsx)(ce,{name:ee}),t[9]=ee,t[10]=K);let q=s||`—`,J;t[11]===q?J=t[12]:(J=(0,Q.jsx)(b,{className:`min-w-0 flex-1 truncate text-base font-semibold text-fg`,children:q}),t[11]=q,t[12]=J);let te;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(te=c(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,F.focusRingPanel),t[13]=te):te=t[13];let ne;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(V,{className:`size-5`,strokeWidth:1.75,"aria-hidden":!0}),t[14]=ne):ne=t[14];let re;t[15]===n.detailCloseAria?re=t[16]:(re=(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:te,"aria-label":n.detailCloseAria,children:ne})}),t[15]=n.detailCloseAria,t[16]=re);let ie;t[17]!==K||t[18]!==J||t[19]!==re?(ie=(0,Q.jsxs)(`div`,{className:`group flex min-h-[3.25rem] shrink-0 items-center gap-3 border-b border-edge px-4 py-3`,children:[K,J,re]}),t[17]=K,t[18]=J,t[19]=re,t[20]=ie):ie=t[20];let ae;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Q.jsx)(k,{className:`mt-0.5 size-4 shrink-0 text-blue-600 dark:text-blue-400`,strokeWidth:1.75,"aria-hidden":!0}),t[21]=ae):ae=t[21];let oe=a===`store`&&f?n.detailModalBanner:a===`store`?n.detailModalBannerStore:n.detailModalBanner,se;t[22]===oe?se=t[23]:(se=(0,Q.jsxs)(`div`,{className:`flex min-h-[3.25rem] shrink-0 items-start gap-2 border-b border-blue-200/80 bg-blue-50/95 px-4 py-2.5 text-sm text-fg dark:border-blue-900/50 dark:bg-blue-950/45`,children:[ae,(0,Q.jsx)(`p`,{className:`min-w-0 leading-relaxed`,children:oe})]}),t[22]=oe,t[23]=se);let Y;t[24]!==u||t[25]!==w||t[26]!==v||t[27]!==g||t[28]!==f||t[29]!==a||t[30]!==n?(Y=(0,Q.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-auto p-4`,children:g?(0,Q.jsx)(`div`,{className:`flex h-full min-h-[14rem] flex-col gap-2.5 py-1`,"aria-busy":`true`,"aria-label":n.loading,children:ke.map(je)}):v?(0,Q.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:v}):a===`catalog`&&u?(0,Q.jsxs)(Q.Fragment,{children:[w?null:(0,Q.jsxs)(`div`,{className:`mb-4 flex items-start gap-2 rounded-xl border border-amber-200 bg-amber-50 px-3 py-2.5 text-sm text-amber-900 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-100`,children:[(0,Q.jsx)(P,{className:`mt-0.5 size-4 shrink-0 text-amber-600 dark:text-amber-300`,strokeWidth:1.75,"aria-hidden":!0}),(0,Q.jsx)(`p`,{className:`leading-relaxed`,children:n.detailDisabledNotice})]}),(0,Q.jsx)(Te,{preview:u,sk:n})]}):a===`store`&&f?(0,Q.jsx)(Te,{preview:f,sk:n}):(0,Q.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:n.detailLoadFailed})}),t[24]=u,t[25]=w,t[26]=v,t[27]=g,t[28]=f,t[29]=a,t[30]=n,t[31]=Y):Y=t[31];let le;t[32]!==D||t[33]!==a||t[34]!==n.marketplaceOpenExternal||t[35]!==n.marketplaceOpenExternalAria?(le=a===`store`&&D?(0,Q.jsxs)(`a`,{href:D,target:`_blank`,rel:`noopener noreferrer`,className:c(`inline-flex h-9 items-center gap-1.5 rounded-lg border border-edge bg-surface-panel px-3 text-sm font-medium text-fg-muted`,`hover:bg-surface-hover hover:text-fg dark:border-edge`,F.focusRingPanel),"aria-label":n.marketplaceOpenExternalAria,title:n.marketplaceOpenExternal,children:[(0,Q.jsx)(S,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:n.marketplaceOpenExternal})]}):null,t[32]=D,t[33]=a,t[34]=n.marketplaceOpenExternal,t[35]=n.marketplaceOpenExternalAria,t[36]=le):le=t[36];let ue;t[37]!==T||t[38]!==E||t[39]!==a||t[40]!==B||t[41]!==H||t[42]!==n.delete?(ue=a===`catalog`&&E&&T?(0,Q.jsxs)(j,{type:`button`,variant:`ghost`,className:`gap-1.5 text-red-600 hover:bg-red-50 hover:text-red-700 dark:text-red-400 dark:hover:bg-red-950/40 dark:hover:text-red-300`,onClick:()=>{B(T),H(!0)},children:[(0,Q.jsx)(x,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),n.delete]}):null,t[37]=T,t[38]=E,t[39]=a,t[40]=B,t[41]=H,t[42]=n.delete,t[43]=ue):ue=t[43];let Z;t[44]!==le||t[45]!==ue?(Z=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[le,ue]}),t[44]=le,t[45]=ue,t[46]=Z):Z=t[46];let de;t[47]!==w||t[48]!==g||t[49]!==a||t[50]!==s||t[51]!==A||t[52]!==I||t[53]!==R||t[54]!==z||t[55]!==L||t[56]!==i||t[57]!==n.cancel||t[58]!==n.detailModalDisable||t[59]!==n.detailModalEnable||t[60]!==n.marketplaceInstall||t[61]!==n.marketplaceReinstall||t[62]!==n.previewUseInChat||t[63]!==n.previewUseInChatBusy||t[64]!==n.uploading||t[65]!==n.useRequiresEnabled||t[66]!==M||t[67]!==O?(de=(0,Q.jsx)(`div`,{className:`flex items-center gap-2`,children:a===`store`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(j,{type:`button`,variant:`ghost`,onClick:()=>i(!1),children:n.cancel}),(0,Q.jsx)(j,{type:`button`,variant:`secondary`,disabled:!s||g||O===s||A===s,onClick:()=>void L(),children:O===s?n.previewUseInChatBusy:n.previewUseInChat}),(0,Q.jsx)(j,{type:`button`,variant:I(s)?`secondary`:`primary`,disabled:!s||A===s,onClick:()=>{s&&R(s,{useDetailProvider:!0})},children:A===s?n.uploading:I(s)?n.marketplaceReinstall:n.marketplaceInstall})]}):(0,Q.jsxs)(Q.Fragment,{children:[w?(0,Q.jsx)(j,{type:`button`,variant:`secondary`,disabled:!s||M===s,onClick:()=>{s&&z(s,!1)},children:M===s?n.uploading:n.detailModalDisable}):(0,Q.jsx)(j,{type:`button`,variant:`primary`,disabled:!s||M===s,onClick:()=>{s&&z(s,!0)},children:M===s?n.uploading:n.detailModalEnable}),(0,Q.jsx)(j,{type:`button`,variant:`secondary`,disabled:!s||!w||g||O===s||M===s,title:w?void 0:n.useRequiresEnabled,onClick:()=>void L(),children:O===s?n.previewUseInChatBusy:n.previewUseInChat})]})}),t[47]=w,t[48]=g,t[49]=a,t[50]=s,t[51]=A,t[52]=I,t[53]=R,t[54]=z,t[55]=L,t[56]=i,t[57]=n.cancel,t[58]=n.detailModalDisable,t[59]=n.detailModalEnable,t[60]=n.marketplaceInstall,t[61]=n.marketplaceReinstall,t[62]=n.previewUseInChat,t[63]=n.previewUseInChatBusy,t[64]=n.uploading,t[65]=n.useRequiresEnabled,t[66]=M,t[67]=O,t[68]=de):de=t[68];let fe;t[69]!==Z||t[70]!==de?(fe=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-t border-edge px-4 py-3`,children:[Z,de]}),t[69]=Z,t[70]=de,t[71]=fe):fe=t[71];let pe;t[72]!==ie||t[73]!==se||t[74]!==Y||t[75]!==fe?(pe=(0,Q.jsxs)(N,{children:[W,(0,Q.jsxs)(C,{className:G,children:[ie,se,Y,fe]})]}),t[72]=ie,t[73]=se,t[74]=Y,t[75]=fe,t[76]=pe):pe=t[76];let me;return t[77]!==r||t[78]!==U||t[79]!==pe?(me=(0,Q.jsx)(_,{open:r,onOpenChange:U,children:pe}),t[77]=r,t[78]=U,t[79]=pe,t[80]=me):me=t[80],me}function je(e){return(0,Q.jsx)(`div`,{className:c(`h-4 animate-pulse rounded-md bg-surface-hover dark:bg-surface-active/50`,e.width)},e.id)}function Me(e){let t=(0,X.c)(67),{sk:n,installOpen:r,setInstallOpen:i,pendingFile:a,setPendingFile:o,dropActive:s,setDropActive:l,uploading:u,onModalDragOver:d,onModalDragLeave:f,onModalDrop:p,onFileInputChange:v,onInstallSubmit:y}=e,x;t[0]!==l||t[1]!==i||t[2]!==o?(x=e=>{i(e),e||(o(null),l(!1))},t[0]=l,t[1]=i,t[2]=o,t[3]=x):x=t[3];let S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(m,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),t[4]=S):S=t[4];let w;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(w=c(`xopc-dialog-content fixed left-1/2 top-1/2 z-[60] max-h-[min(100vh-2rem,44rem)] w-[min(100%-2rem,min(92vw,48rem))] -translate-x-1/2 -translate-y-1/2 overflow-y-auto`,`rounded-2xl border border-edge bg-surface-panel p-6 shadow-float dark:border-edge`),t[5]=w):w=t[5];let T;t[6]===n.installModalTitle?T=t[7]:(T=(0,Q.jsx)(b,{className:`text-base font-semibold text-fg`,children:n.installModalTitle}),t[6]=n.installModalTitle,t[7]=T);let E;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(E=c(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,F.focusRingPanel),t[8]=E):E=t[8];let D;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(V,{className:`size-5`,strokeWidth:1.75,"aria-hidden":!0}),t[9]=D):D=t[9];let O;t[10]===n.installClose?O=t[11]:(O=(0,Q.jsx)(`span`,{className:`sr-only`,children:n.installClose}),t[10]=n.installClose,t[11]=O);let k;t[12]!==n.installClose||t[13]!==O?(k=(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:E,"aria-label":n.installClose,children:[D,O]})}),t[12]=n.installClose,t[13]=O,t[14]=k):k=t[14];let A;t[15]!==T||t[16]!==k?(A=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,k]}),t[15]=T,t[16]=k,t[17]=A):A=t[17];let j=s?`border-accent bg-accent-soft/60 dark:bg-blue-950/40`:`border-edge bg-surface-base dark:bg-surface-hover/30`,M;t[18]===j?M=t[19]:(M=c(`mt-4 flex min-h-[11rem] cursor-pointer flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed px-6 py-12 text-center transition-colors`,j),t[18]=j,t[19]=M);let P;t[20]!==v||t[21]!==n.installModalDropHint||t[22]!==u?(P=(0,Q.jsx)(`input`,{type:`file`,accept:`.zip,.md,application/zip,text/markdown`,className:`sr-only`,"aria-label":n.installModalDropHint,disabled:u,onChange:v}),t[20]=v,t[21]=n.installModalDropHint,t[22]=u,t[23]=P):P=t[23];let I;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(g,{className:`size-12 text-fg-subtle`,strokeWidth:1.25,"aria-hidden":!0}),t[24]=I):I=t[24];let L;t[25]===n.installModalDropHint?L=t[26]:(L=(0,Q.jsx)(`span`,{className:`text-sm text-fg-muted`,children:n.installModalDropHint}),t[25]=n.installModalDropHint,t[26]=L);let R;t[27]===a?R=t[28]:(R=a?(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:a.name}):null,t[27]=a,t[28]=R);let z;t[29]!==f||t[30]!==d||t[31]!==p||t[32]!==M||t[33]!==P||t[34]!==L||t[35]!==R?(z=(0,Q.jsxs)(`label`,{className:M,onDragLeave:f,onDragOver:d,onDrop:p,children:[P,I,L,R]}),t[29]=f,t[30]=d,t[31]=p,t[32]=M,t[33]=P,t[34]=L,t[35]=R,t[36]=z):z=t[36];let B;t[37]===n.installModalReqTitle?B=t[38]:(B=(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:n.installModalReqTitle}),t[37]=n.installModalReqTitle,t[38]=B);let H;t[39]===n.installModalReq1?H=t[40]:(H=(0,Q.jsx)(`li`,{children:n.installModalReq1}),t[39]=n.installModalReq1,t[40]=H);let U;t[41]===n.installModalReq2?U=t[42]:(U=(0,Q.jsx)(`li`,{children:n.installModalReq2}),t[41]=n.installModalReq2,t[42]=U);let W;t[43]!==H||t[44]!==U?(W=(0,Q.jsxs)(`ul`,{className:`list-inside list-disc space-y-1 text-sm text-fg-muted`,children:[H,U]}),t[43]=H,t[44]=U,t[45]=W):W=t[45];let G;t[46]!==B||t[47]!==W?(G=(0,Q.jsxs)(`div`,{className:`mt-5 space-y-2`,children:[B,W]}),t[46]=B,t[47]=W,t[48]=G):G=t[48];let ee=!a||u,K=!a||u?`cursor-not-allowed bg-surface-active text-fg-disabled`:`bg-accent text-white hover:bg-accent-hover`,q;t[49]===K?q=t[50]:(q=c(`mt-6 flex w-full items-center justify-center rounded-xl py-3 text-sm font-semibold`,`transition-colors`,K,F.focusRingPanel),t[49]=K,t[50]=q);let J;t[51]===y?J=t[52]:(J=()=>void y(),t[51]=y,t[52]=J);let te=u?n.uploading:n.installAction,ne;t[53]!==ee||t[54]!==q||t[55]!==J||t[56]!==te?(ne=(0,Q.jsx)(`button`,{type:`button`,disabled:ee,className:q,onClick:J,children:te}),t[53]=ee,t[54]=q,t[55]=J,t[56]=te,t[57]=ne):ne=t[57];let re;t[58]!==z||t[59]!==G||t[60]!==ne||t[61]!==A?(re=(0,Q.jsxs)(N,{children:[S,(0,Q.jsxs)(C,{className:w,children:[A,z,G,ne]})]}),t[58]=z,t[59]=G,t[60]=ne,t[61]=A,t[62]=re):re=t[62];let ie;return t[63]!==r||t[64]!==x||t[65]!==re?(ie=(0,Q.jsx)(_,{open:r,onOpenChange:x,children:re}),t[63]=r,t[64]=x,t[65]=re,t[66]=ie):ie=t[66],ie}function Ne(e){let t=(0,X.c)(68),{sk:n,mpCategories:r,mpCategoriesLoading:i,mpCategoriesError:a,mpPayload:o,mpLoading:s,mpError:l,marketCategoryId:u,setMarketCategoryId:d,marketPage:f,setMarketPage:m,isSkillInstalledByName:h,openMarketplaceDetail:g,onMarketInstall:_,installingMarketName:v,onUseSkillInChat:b,usingSkillInChatName:x,searchInputActive:S,searchQuery:C,setSearchQuery:w,registeredProviders:T,marketBrowseProvider:E,setMarketBrowseProvider:O}=e,k=!S,A,M,N;if(t[0]!==v||t[1]!==h||t[2]!==E||t[3]!==u||t[4]!==f||t[5]!==r||t[6]!==a||t[7]!==i||t[8]!==l||t[9]!==s||t[10]!==o||t[11]!==_||t[12]!==b||t[13]!==g||t[14]!==T||t[15]!==S||t[16]!==C||t[17]!==O||t[18]!==d||t[19]!==m||t[20]!==w||t[21]!==k||t[22]!==n.loading||t[23]!==n.marketplaceAuthor||t[24]!==n.marketplaceCategoriesAria||t[25]!==n.marketplaceCategoryAll||t[26]!==n.marketplaceDownloads||t[27]!==n.marketplaceEmpty||t[28]!==n.marketplaceEmptySearch||t[29]!==n.marketplaceEmptySearchClear||t[30]!==n.marketplaceEmptySearchTryProvider||t[31]!==n.marketplaceInstall||t[32]!==n.marketplaceInstalled||t[33]!==n.marketplacePageNext||t[34]!==n.marketplacePagePrev||t[35]!==n.marketplacePageStatus||t[36]!==n.marketplaceVersion||t[37]!==n.previewUseInChat||t[38]!==n.previewUseInChatBusy||t[39]!==n.uploading||t[40]!==x){let e;t[44]===E?e=t[45]:(e=e=>e.id!==E,t[44]=E,t[45]=e);let P=T.filter(e),I=C.trim(),R;t[46]===n.marketplaceCategoryAll?R=t[47]:(R={id:``,label:n.marketplaceCategoryAll},t[46]=n.marketplaceCategoryAll,t[47]=R);let B;t[48]!==r||t[49]!==R?(B=[R,...r.map(Re)],t[48]=r,t[49]=R,t[50]=B):B=t[50];let V=B,U;t[51]===r?U=t[52]:(U=new Map(r.map(Le)),t[51]=r,t[52]=U);let W=U;t[53]!==V||t[54]!==u||t[55]!==r.length||t[56]!==i||t[57]!==d||t[58]!==k||t[59]!==n.marketplaceCategoriesAria?(A=k?r.length>0?(0,Q.jsx)(H,{items:V,activeTab:u,onChange:d,ariaLabel:n.marketplaceCategoriesAria,tabIdPrefix:`skills-marketplace-category-tab`,className:`min-h-[2.75rem] items-center gap-2 pt-0.5 [scrollbar-width:thin]`,buttonClassName:`max-w-[14rem] truncate rounded-full border px-3 py-1.5 text-xs`,selectedClassName:`border-fg bg-fg text-surface-panel dark:border-fg dark:bg-fg dark:text-surface-base`,unselectedClassName:`border-edge bg-surface-panel text-fg-muted hover:border-edge-strong hover:text-fg dark:border-edge dark:bg-surface-hover/40`}):i?(0,Q.jsx)(`div`,{className:`-mx-1 flex min-h-[2.75rem] items-center gap-2 overflow-x-auto px-1 pb-1 pt-0.5 [scrollbar-width:thin]`,"aria-hidden":!0,children:[`p0`,`p1`,`p2`,`p3`,`p4`].map(Ie)}):null:null,t[53]=V,t[54]=u,t[55]=r.length,t[56]=i,t[57]=d,t[58]=k,t[59]=n.marketplaceCategoriesAria,t[60]=A):A=t[60],t[61]!==a||t[62]!==k?(M=k&&a?(0,Q.jsx)(`p`,{className:`text-xs text-red-600 dark:text-red-400`,role:`alert`,children:a}):null,t[61]=a,t[62]=k,t[63]=M):M=t[63],N=!o&&!l?(0,Q.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,"aria-busy":`true`,"aria-label":n.loading,children:ye.map(Fe)}):l&&!o?(0,Q.jsx)(`div`,{className:`rounded-xl border border-edge bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-edge dark:bg-red-950/40 dark:text-red-300`,role:`alert`,children:l}):o?(0,Q.jsxs)(`div`,{className:`relative`,children:[s?(0,Q.jsx)(`div`,{className:`pointer-events-none absolute inset-0 z-[1] flex justify-center bg-surface-panel/40 pt-[min(28vh,7.5rem)] backdrop-blur-[1px] motion-reduce:backdrop-blur-none dark:bg-surface-base/35`,"aria-busy":`true`,"aria-label":n.loading,children:(0,Q.jsx)(y,{className:`size-8 shrink-0 animate-spin text-accent motion-reduce:animate-none`,strokeWidth:2,"aria-hidden":!0})}):null,o.items.length===0?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3 rounded-2xl border border-dashed border-edge py-12 text-center text-sm text-fg-muted`,children:[(0,Q.jsx)(`p`,{className:`px-4`,children:S&&I?Y(n.marketplaceEmptySearch,{query:I}):n.marketplaceEmpty}),S?(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[P.map(e=>(0,Q.jsx)(j,{type:`button`,variant:`secondary`,className:`h-8 px-3 text-xs`,onClick:()=>O(e.id),children:Y(n.marketplaceEmptySearchTryProvider,{provider:e.displayName})},e.id)),(0,Q.jsx)(j,{type:`button`,variant:`ghost`,className:`h-8 px-3 text-xs`,onClick:()=>w(``),children:n.marketplaceEmptySearchClear})]}):null]}):(0,Q.jsx)(`div`,{className:c(`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,s&&`pointer-events-none opacity-[0.52] motion-reduce:opacity-100`),children:o.items.map(e=>{let t=ne(e,e.providerId??E),r=h(t),i=e.category??e.categories?.[0],a=i?W.get(i)??i:null;return(0,Q.jsxs)(`article`,{className:c(`group flex h-full flex-col rounded-xl bg-surface-panel p-4 shadow-surface`,`transition-colors hover:bg-surface-hover`),children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,Q.jsx)(`button`,{type:`button`,className:c(`min-w-0 flex-1 rounded-lg text-left outline-none`,F.focusRingPanel),onClick:()=>void g(t,e.name,e.providerId??void 0),children:(0,Q.jsx)(`h3`,{id:`mp-skill-title-${e.id}`,className:`truncate text-[15px] font-semibold leading-snug tracking-tight text-fg`,children:e.name})}),r?(0,Q.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full border border-emerald-500/30 bg-emerald-500/10 px-2 py-0.5 text-[11px] font-medium text-emerald-700 dark:text-emerald-300`,children:[(0,Q.jsx)(p,{className:`size-3`,"aria-hidden":!0}),n.marketplaceInstalled]}):(0,Q.jsx)(j,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 whitespace-nowrap px-2.5 text-xs font-medium`,disabled:s||v===t,onClick:()=>void _(t,{providerOverride:e.providerId??null}),children:v===t?n.uploading:n.marketplaceInstall})]}),(0,Q.jsx)(`button`,{type:`button`,className:c(`mt-2 flex min-h-0 w-full flex-1 cursor-pointer flex-col rounded-lg text-left outline-none`,F.focusRingPanel),"aria-labelledby":`mp-skill-title-${e.id}`,onClick:()=>void g(t,e.name,e.providerId??void 0),children:(0,Q.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:[(0,Q.jsx)(`p`,{className:`line-clamp-2 text-sm leading-relaxed text-fg-muted`,title:e.description?e.description:void 0,children:e.description||`—`}),a?(0,Q.jsx)(`span`,{className:`w-fit max-w-full truncate rounded-full bg-surface-subtle px-2 py-0.5 text-[10px] font-medium text-fg-muted`,children:a}):null,(0,Q.jsxs)(`div`,{className:`mt-auto min-h-[2.625rem] space-y-1 text-[11px] leading-snug text-fg-muted`,children:[(0,Q.jsxs)(`p`,{className:`line-clamp-1`,title:`${n.marketplaceAuthor}: ${e.author.username} · ${n.marketplaceDownloads}: ${e.downloads}${e.stars!=null&&e.stars>0?` · ★${e.stars}`:``}${r?` · ${n.marketplaceInstalled}`:``}`,children:[(0,Q.jsx)(`span`,{className:`text-fg-subtle`,children:n.marketplaceAuthor}),` `,(0,Q.jsx)(`span`,{className:`text-fg`,children:e.author.username}),(0,Q.jsx)(`span`,{className:`text-fg-subtle`,children:` · `}),(0,Q.jsxs)(`span`,{children:[n.marketplaceDownloads,`: `,e.downloads]}),e.stars!=null&&e.stars>0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`text-fg-subtle`,children:` · `}),(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-fg-muted`,children:[(0,Q.jsx)(D,{className:`size-3 shrink-0 text-amber-600 dark:text-amber-400`,strokeWidth:2,"aria-hidden":!0}),e.stars]})]}):null]}),e.latestVersion?(0,Q.jsxs)(`p`,{className:`line-clamp-1 min-h-[1.125rem] font-mono text-[10px] text-fg-subtle`,title:`${n.marketplaceVersion}: ${e.latestVersion}`,children:[n.marketplaceVersion,`: `,e.latestVersion]}):null]})]})})}),r?(0,Q.jsx)(`div`,{role:`group`,className:`mt-3 flex items-center justify-end gap-1 border-t border-edge-subtle pt-3`,children:(0,Q.jsx)(j,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 whitespace-nowrap px-2.5 text-xs font-medium`,disabled:s||x===t,onClick:()=>void b({name:t,source:`store`,providerOverride:e.providerId??null}),children:x===t?n.previewUseInChatBusy:n.previewUseInChat})}):null]},e.id)})}),o.items.length>0?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-col items-center justify-between gap-3 sm:flex-row`,children:[(0,Q.jsx)(`p`,{className:`text-center text-xs text-fg-muted sm:text-left`,children:Y(n.marketplacePageStatus,{page:o.meta.page,totalPages:o.meta.totalPages,total:o.meta.total})}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(j,{type:`button`,variant:`ghost`,className:`h-9 gap-1 px-2`,disabled:s||f<=1,"aria-label":n.marketplacePagePrev,onClick:()=>m(Pe),children:[(0,Q.jsx)(z,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:n.marketplacePagePrev})]}),(0,Q.jsxs)(j,{type:`button`,variant:`ghost`,className:`h-9 gap-1 px-2`,disabled:s||f>=o.meta.totalPages,"aria-label":n.marketplacePageNext,onClick:()=>m(e=>Math.min(o.meta.totalPages,e+1)),children:[(0,Q.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:n.marketplacePageNext}),(0,Q.jsx)(L,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0})]})]})]}):null]}):null,t[0]=v,t[1]=h,t[2]=E,t[3]=u,t[4]=f,t[5]=r,t[6]=a,t[7]=i,t[8]=l,t[9]=s,t[10]=o,t[11]=_,t[12]=b,t[13]=g,t[14]=T,t[15]=S,t[16]=C,t[17]=O,t[18]=d,t[19]=m,t[20]=w,t[21]=k,t[22]=n.loading,t[23]=n.marketplaceAuthor,t[24]=n.marketplaceCategoriesAria,t[25]=n.marketplaceCategoryAll,t[26]=n.marketplaceDownloads,t[27]=n.marketplaceEmpty,t[28]=n.marketplaceEmptySearch,t[29]=n.marketplaceEmptySearchClear,t[30]=n.marketplaceEmptySearchTryProvider,t[31]=n.marketplaceInstall,t[32]=n.marketplaceInstalled,t[33]=n.marketplacePageNext,t[34]=n.marketplacePagePrev,t[35]=n.marketplacePageStatus,t[36]=n.marketplaceVersion,t[37]=n.previewUseInChat,t[38]=n.previewUseInChatBusy,t[39]=n.uploading,t[40]=x,t[41]=A,t[42]=M,t[43]=N}else A=t[41],M=t[42],N=t[43];let P;return t[64]!==A||t[65]!==M||t[66]!==N?(P=(0,Q.jsxs)(Q.Fragment,{children:[A,M,N]}),t[64]=A,t[65]=M,t[66]=N,t[67]=P):P=t[67],P}function Pe(e){return Math.max(1,e-1)}function Fe(e){return(0,Q.jsx)(pe,{},e)}function Ie(e){return(0,Q.jsx)(`div`,{className:`h-8 w-[4.5rem] shrink-0 animate-pulse rounded-full bg-surface-hover motion-reduce:animate-none dark:bg-surface-active/50`},e)}function Le(e){return[e.id,e.label]}function Re(e){return{id:e.id,label:e.label,title:e.label}}function ze(e){let t=(0,X.c)(130),{vm:n}=e,{sk:r,hasToken:i,error:a,actionFeedback:o,skillDiagnostics:s,mainTab:l,setMainTab:u,sourceFilter:d,setSourceFilter:f,builtinTabStats:p,userTabStats:m,catalogDisabledCount:h,catalogStatusFilter:g,setCatalogStatusFilter:_,marketSort:v,setMarketSort:y,marketBrowseProvider:b,setMarketBrowseProvider:x,registeredProviders:S,inSettingsShell:C,searchInputActive:w,resultTab:T,setResultTab:D,aggregatedTabCounts:O,aggregatedProviderStatus:k}=n,A,j,M,N,P,F,I,L;if(t[0]!==o||t[1]!==k||t[2]!==O||t[3]!==p||t[4]!==a||t[5]!==i||t[6]!==S||t[7]!==r.diagnosticsHint||t[8]!==r.diagnosticsTitle||t[9]!==r.marketplaceLoadFailed||t[10]!==r.marketplaceResultsTabAll||t[11]!==r.needToken||t[12]!==r.tabDiscover||t[13]!==r.tabInstalled||t[14]!==s||t[15]!==m||t[16]!==n){L=Symbol.for(`react.early_return_sentinel`);bb0:{let e=le(s);if(!i){let e;t[25]===n?e=t[26]:(e=(0,Q.jsx)(Ue,{vm:n}),t[25]=n,t[26]=e);let i;t[27]===r.needToken?i=t[28]:(i=(0,Q.jsx)(`div`,{className:`w-full px-3 py-16 text-center text-sm text-fg-muted sm:px-5 xl:px-6`,children:r.needToken}),t[27]=r.needToken,t[28]=i);let a;t[29]!==e||t[30]!==i?(a=(0,Q.jsxs)(Q.Fragment,{children:[e,i]}),t[29]=e,t[30]=i,t[31]=a):a=t[31],L=a;break bb0}let l=p.total+m.total,u;t[32]!==l||t[33]!==r.tabInstalled?(u={id:`installed`,label:r.tabInstalled,count:l},t[32]=l,t[33]=r.tabInstalled,t[34]=u):u=t[34];let d;t[35]===r.tabDiscover?d=t[36]:(d={id:`marketplace`,label:r.tabDiscover},t[35]=r.tabDiscover,t[36]=d);let f;t[37]!==u||t[38]!==d?(f=[u,d],t[37]=u,t[38]=d,t[39]=f):f=t[39],A=f;let h;t[40]===S?h=t[41]:(h=[`all`,...S.map(He)],t[40]=S,t[41]=h);let g=h,_;t[42]!==k||t[43]!==O||t[44]!==S||t[45]!==r.marketplaceLoadFailed||t[46]!==r.marketplaceResultsTabAll||t[47]!==g?(_=g.map(e=>{let t=e===`all`?r.marketplaceResultsTabAll:S.find(t=>t.id===e)?.displayName??e,n=O[e]??0,i=e===`all`?null:k[e];return{id:e,label:t,title:i===`error`?`${t} · ${r.marketplaceLoadFailed}`:void 0,suffix:i===`loading`?(0,Q.jsx)(`span`,{className:`inline-block size-1.5 animate-pulse rounded-full bg-fg-muted/60 motion-reduce:animate-none`,"aria-hidden":!0}):i===`error`?(0,Q.jsx)(`span`,{className:`inline-block size-1.5 rounded-full bg-red-500`,"aria-hidden":!0}):(0,Q.jsx)(`span`,{className:`tabular-nums opacity-70`,children:n})}}),t[42]=k,t[43]=O,t[44]=S,t[45]=r.marketplaceLoadFailed,t[46]=r.marketplaceResultsTabAll,t[47]=g,t[48]=_):_=t[48],j=_,t[49]===n?I=t[50]:(I=(0,Q.jsx)(Ue,{vm:n}),t[49]=n,t[50]=I),F=`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,M=`flex w-full flex-col gap-6 px-3 py-6 sm:px-5 xl:px-6`,t[51]!==o||t[52]!==a?(N=o?(0,Q.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:c(`rounded-xl border px-3 py-2 text-sm`,o.kind===`success`?`border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-900/40 dark:bg-emerald-950/40 dark:text-emerald-200`:`border-red-200 bg-red-50 text-red-800 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200`),children:o.message}):a?(0,Q.jsx)(`div`,{className:`rounded-xl border border-edge bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-edge dark:bg-red-950/40 dark:text-red-300`,role:`alert`,children:a}):null,t[51]=o,t[52]=a,t[53]=N):N=t[53],P=e.length>0?(0,Q.jsxs)(`div`,{className:`rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-200`,role:`status`,children:[(0,Q.jsx)(`div`,{className:`font-medium`,children:Y(r.diagnosticsTitle,{count:e.length})}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs opacity-80`,children:r.diagnosticsHint}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.slice(0,3).map(Ve)})]}):null}t[0]=o,t[1]=k,t[2]=O,t[3]=p,t[4]=a,t[5]=i,t[6]=S,t[7]=r.diagnosticsHint,t[8]=r.diagnosticsTitle,t[9]=r.marketplaceLoadFailed,t[10]=r.marketplaceResultsTabAll,t[11]=r.needToken,t[12]=r.tabDiscover,t[13]=r.tabInstalled,t[14]=s,t[15]=m,t[16]=n,t[17]=A,t[18]=j,t[19]=M,t[20]=N,t[21]=P,t[22]=F,t[23]=I,t[24]=L}else A=t[17],j=t[18],M=t[19],N=t[20],P=t[21],F=t[22],I=t[23],L=t[24];if(L!==Symbol.for(`react.early_return_sentinel`))return L;let R;t[54]!==C||t[55]!==n.loading||t[56]!==n.mainTab||t[57]!==n.onReloadClick||t[58]!==n.searchQuery||t[59]!==n.setInstallOpen||t[60]!==n.setPendingFile||t[61]!==n.setSearchQuery||t[62]!==n.sk?(R=C?(0,Q.jsx)(`div`,{className:`flex flex-col gap-3 border-b border-edge-subtle pb-4 dark:border-edge-subtle sm:flex-row sm:flex-wrap sm:items-center sm:justify-end`,children:(0,Q.jsx)(de,{loading:n.loading,onReloadClick:n.onReloadClick,searchQuery:n.searchQuery,setSearchQuery:n.setSearchQuery,mainTab:n.mainTab,sk:n.sk,setPendingFile:n.setPendingFile,setInstallOpen:n.setInstallOpen})}):null,t[54]=C,t[55]=n.loading,t[56]=n.mainTab,t[57]=n.onReloadClick,t[58]=n.searchQuery,t[59]=n.setInstallOpen,t[60]=n.setPendingFile,t[61]=n.setSearchQuery,t[62]=n.sk,t[63]=R):R=t[63];let z;t[64]!==l||t[65]!==A||t[66]!==u||t[67]!==r.skillsNavAria?(z=(0,Q.jsx)(`div`,{className:`border-b border-edge-subtle pb-3 dark:border-edge-subtle`,children:(0,Q.jsx)(H,{items:A,activeTab:l,onChange:u,ariaLabel:r.skillsNavAria,tabIdPrefix:`skills-tab`,panelIdPrefix:`skills-panel`,className:`flex-wrap`})}),t[64]=l,t[65]=A,t[66]=u,t[67]=r.skillsNavAria,t[68]=z):z=t[68];let B;t[69]!==h||t[70]!==g||t[71]!==l||t[72]!==b||t[73]!==v||t[74]!==S||t[75]!==T||t[76]!==j||t[77]!==w||t[78]!==_||t[79]!==x||t[80]!==y||t[81]!==D||t[82]!==f||t[83]!==r.discoverHeading||t[84]!==r.discoverHint||t[85]!==r.filterAll||t[86]!==r.filterDisabledOnly||t[87]!==r.filterEnabled||t[88]!==r.filterExtra||t[89]!==r.filterGlobal||t[90]!==r.filterInstalled||t[91]!==r.filterWorkspace||t[92]!==r.installedHeading||t[93]!==r.installedHint||t[94]!==r.marketplaceBrowseSwitchAria||t[95]!==r.marketplaceResultsTabsAria||t[96]!==r.marketplaceSortDownloads||t[97]!==r.marketplaceSortLabel||t[98]!==r.marketplaceSortNewest||t[99]!==r.sourceFilterAria||t[100]!==r.statusFilterAria||t[101]!==r.tabBuiltin||t[102]!==d?(B=l===`installed`?(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h2`,{className:`text-balance text-sm font-semibold text-fg`,children:r.installedHeading}),(0,Q.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm text-fg-muted`,children:r.installedHint})]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2 sm:justify-end`,children:[(0,Q.jsx)(E,{value:d,placeholder:r.filterAll,ariaLabel:r.sourceFilterAria,options:[{value:`all`,label:r.filterAll},{value:`builtin`,label:r.tabBuiltin},{value:`installed`,label:r.filterInstalled},{value:`workspace`,label:r.filterWorkspace},{value:`global`,label:r.filterGlobal},{value:`extra`,label:r.filterExtra}],allowEmpty:!1,triggerClassName:`h-9 w-auto min-w-[9rem] bg-surface-panel text-xs shadow-surface`,align:`end`,onChange:e=>f(e)}),(0,Q.jsx)(E,{value:g,placeholder:r.filterAll,ariaLabel:r.statusFilterAria,options:[{value:`all`,label:r.filterAll},{value:`enabled`,label:r.filterEnabled},{value:`disabled`,label:Y(r.filterDisabledOnly,{count:h})}],allowEmpty:!1,triggerClassName:`h-9 w-auto min-w-[9rem] bg-surface-panel text-xs shadow-surface`,align:`end`,onChange:e=>_(e)})]})]})}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h2`,{className:`text-balance text-sm font-semibold text-fg`,children:r.discoverHeading}),(0,Q.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm text-fg-muted`,children:r.discoverHint})]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2 sm:justify-end`,children:[w?null:(0,Q.jsx)(E,{value:b??``,placeholder:r.marketplaceBrowseSwitchAria,ariaLabel:r.marketplaceBrowseSwitchAria,options:S.map(Be),allowEmpty:!1,triggerClassName:`h-9 w-auto min-w-[9rem] bg-surface-panel text-xs shadow-surface`,align:`end`,onChange:x}),(0,Q.jsx)(E,{value:v,placeholder:r.marketplaceSortLabel,ariaLabel:r.marketplaceSortLabel,options:[{value:`downloads`,label:r.marketplaceSortDownloads},{value:`newest`,label:r.marketplaceSortNewest}],allowEmpty:!1,triggerClassName:`h-9 w-auto min-w-[9rem] bg-surface-panel text-xs shadow-surface`,align:`end`,onChange:e=>y(e)})]})]}),w?(0,Q.jsx)(H,{items:j,activeTab:T,onChange:D,ariaLabel:r.marketplaceResultsTabsAria,tabIdPrefix:`skills-marketplace-results-tab`,panelIdPrefix:`skills-marketplace-results-panel`,className:`min-h-9 gap-1 overflow-x-auto rounded-lg border border-edge bg-surface-panel p-0.5 shadow-surface`,buttonClassName:`rounded-md px-2.5 py-1.5 text-xs`,selectedClassName:`bg-fg text-surface-panel dark:bg-fg dark:text-surface-base`,unselectedClassName:`text-fg-muted hover:text-fg`}):null]}),t[69]=h,t[70]=g,t[71]=l,t[72]=b,t[73]=v,t[74]=S,t[75]=T,t[76]=j,t[77]=w,t[78]=_,t[79]=x,t[80]=y,t[81]=D,t[82]=f,t[83]=r.discoverHeading,t[84]=r.discoverHint,t[85]=r.filterAll,t[86]=r.filterDisabledOnly,t[87]=r.filterEnabled,t[88]=r.filterExtra,t[89]=r.filterGlobal,t[90]=r.filterInstalled,t[91]=r.filterWorkspace,t[92]=r.installedHeading,t[93]=r.installedHint,t[94]=r.marketplaceBrowseSwitchAria,t[95]=r.marketplaceResultsTabsAria,t[96]=r.marketplaceSortDownloads,t[97]=r.marketplaceSortLabel,t[98]=r.marketplaceSortNewest,t[99]=r.sourceFilterAria,t[100]=r.statusFilterAria,t[101]=r.tabBuiltin,t[102]=d,t[103]=B):B=t[103];let V;t[104]!==l||t[105]!==n?(V=l===`marketplace`?(0,Q.jsx)(Ne,{...n}):(0,Q.jsx)(xe,{...n}),t[104]=l,t[105]=n,t[106]=V):V=t[106];let U;t[107]!==V||t[108]!==z||t[109]!==B?(U=(0,Q.jsxs)(`section`,{className:`flex flex-col gap-5`,children:[z,B,V]}),t[107]=V,t[108]=z,t[109]=B,t[110]=U):U=t[110];let W;t[111]!==M||t[112]!==U||t[113]!==N||t[114]!==P||t[115]!==R?(W=(0,Q.jsxs)(`div`,{className:M,children:[N,P,R,U]}),t[111]=M,t[112]=U,t[113]=N,t[114]=P,t[115]=R,t[116]=W):W=t[116];let G,ee,K;t[117]===n?(G=t[118],ee=t[119],K=t[120]):(G=(0,Q.jsx)(Ae,{...n}),ee=(0,Q.jsx)(Me,{...n}),K=(0,Q.jsx)(Ce,{...n}),t[117]=n,t[118]=G,t[119]=ee,t[120]=K);let q;t[121]!==W||t[122]!==G||t[123]!==ee||t[124]!==K||t[125]!==F?(q=(0,Q.jsxs)(`div`,{className:F,children:[W,G,ee,K]}),t[121]=W,t[122]=G,t[123]=ee,t[124]=K,t[125]=F,t[126]=q):q=t[126];let J;return t[127]!==q||t[128]!==I?(J=(0,Q.jsxs)(Q.Fragment,{children:[I,q]}),t[127]=q,t[128]=I,t[129]=J):J=t[129],J}function Be(e){return{value:e.id,label:e.displayName}}function Ve(e,t){return(0,Q.jsxs)(`li`,{className:`truncate`,children:[e.type,`: `,e.message]},`${e.path??e.skillName??`diagnostic`}-${t}`)}function He(e){return e.id}function Ue(e){let t=(0,X.c)(17),{vm:n}=e,{sk:r,hasToken:i,loading:a,onReloadClick:o,searchQuery:s,setSearchQuery:c,mainTab:l,setPendingFile:u,setInstallOpen:d,inSettingsShell:f}=n,p=v(Ge),m=v(We),h;t[0]!==a||t[1]!==l||t[2]!==o||t[3]!==s||t[4]!==d||t[5]!==u||t[6]!==c||t[7]!==r?(h=(0,Q.jsx)(de,{loading:a,onReloadClick:o,searchQuery:s,setSearchQuery:c,mainTab:l,sk:r,setPendingFile:u,setInstallOpen:d}),t[0]=a,t[1]=l,t[2]=o,t[3]=s,t[4]=d,t[5]=u,t[6]=c,t[7]=r,t[8]=h):h=t[8];let g=h,_,y;return t[9]!==m||t[10]!==i||t[11]!==f||t[12]!==p||t[13]!==r.title||t[14]!==g?(_=()=>!i||f?(m(),()=>m()):(p({startExtra:null,main:(0,Q.jsx)(`div`,{className:`min-w-0`,children:(0,Q.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:r.title})}),end:g}),()=>m()),y=[m,i,f,p,g,r.title],t[9]=m,t[10]=i,t[11]=f,t[12]=p,t[13]=r.title,t[14]=g,t[15]=_,t[16]=y):(_=t[15],y=t[16]),(0,Z.useLayoutEffect)(_,y),null}function We(e){return e.clearPageHeader}function Ge(e){return e.setPageHeader}async function Ke(t){let n=t.name.toLowerCase();if(n.endsWith(`.zip`))return t;if(n.endsWith(`skill.md`)){let n=(await i(async()=>{let{default:t}=await import(`./jszip.min-DT31yWkU.js`).then(t=>e(t.default,1));return{default:t}},__vite__mapDeps([0,1]))).default,r=new n;r.file(`SKILL.md`,await t.arrayBuffer());let a=await r.generateAsync({type:`blob`,compression:`DEFLATE`}),o=t.name.replace(/\.md$/i,``).replace(/\s+/g,`-`)||`skill`;return new File([a],`${o}.zip`,{type:`application/zip`})}throw Error(`invalid`)}function qe(){let e=d(e=>e.language),t=l(e).skills,n=!!u(e=>e.token),r=s(),[i,c]=o(),p=i.get(`mprov`)?.trim()||null,[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(!1),b=i.get(`q`)??``,x=i.get(`tab`),S=i.get(`source`),C=i.get(`status`),E=he.has(x)?x:`installed`,D=x===`builtin`?`builtin`:x===`user`?`installed`:null,O=ge.has(S)?S:D??`all`,k=_e.has(C)?C:`all`,[j,M]=(0,Z.useState)(b),[N]=A(j,250),P=N.trim(),F=j.trim().length>0,I=P.length>0,[L,R]=(0,Z.useState)(null),[z,B]=(0,Z.useState)(E),[V,H]=(0,Z.useState)(O),[ne,ae]=(0,Z.useState)(``),[Y,ce]=(0,Z.useState)(k),[le,X]=(0,Z.useState)(!1),[Q,de]=(0,Z.useState)(null),[fe,pe]=(0,Z.useState)(!1),[me,ye]=(0,Z.useState)(!1),[xe,Se]=(0,Z.useState)(null),[Ce,we]=(0,Z.useState)(null),[Te,Ee]=(0,Z.useState)({}),[De,Oe]=(0,Z.useState)(!1),[ke,Ae]=(0,Z.useState)(`catalog`),[je,Me]=(0,Z.useState)(``),[Ne,Pe]=(0,Z.useState)(null),[Fe,Ie]=(0,Z.useState)(null),[Le,Re]=(0,Z.useState)(!1),[ze,Be]=(0,Z.useState)(null),[Ve,He]=(0,Z.useState)(`downloads`),[Ue,We]=(0,Z.useState)(1),[Ge,qe]=(0,Z.useState)(null),[Je,Ye]=(0,Z.useState)(null),[Xe,Ze]=(0,Z.useState)(``),[$,Qe]=(0,Z.useState)(()=>p),[$e,et]=(0,Z.useState)(0),[tt,nt]=(0,Z.useState)(0),[rt,it]=(0,Z.useState)([]),at=(0,Z.useRef)(null),ot=(0,Z.useRef)(p),st=(0,Z.useRef)(null),ct=(0,Z.useRef)(``),lt=(0,Z.useRef)(null),ut=(0,Z.useRef)(!1),[dt,ft]=(0,Z.useState)({query:``,byProvider:{}}),[pt,mt]=(0,Z.useState)(`all`),ht=(0,Z.useRef)(0),gt=(0,Z.useRef)(P);gt.current!==P&&(gt.current=P,mt(e=>e===`all`?e:`all`));let _t=w(()=>T().then(e=>(it(e.diagnostics??[]),e.catalog.map(oe))),[n,tt],{enabled:n,initial:[],errorData:[]}),{data:vt,loading:yt,setData:bt}=_t,xt=w(async()=>{try{let{providers:e,current:t}=await q();return{providers:e.map(e=>({id:e.id,displayName:e.displayName})),current:t}}catch{try{return{providers:[],current:(await K()).provider}}catch{return{providers:[],current:`store`}}}},[n,$e],{enabled:n,initial:{providers:[],current:null}}),St=m||yt,Ct=xt.data.providers;(0,Z.useEffect)(()=>{let e=e=>{if(f(e.detail)===`skills`){if(ut.current){ut.current=!1;return}nt(e=>e+1)}else et(e=>e+1)};return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},[]);let wt=i.toString(),Tt=(0,Z.useRef)(wt);if(Tt.current!==wt){Tt.current=wt;let e=i.get(`q`)??``,t=i.get(`tab`),n=i.get(`source`),r=i.get(`status`),a=he.has(t)?t:`installed`,o=t===`builtin`?`builtin`:t===`user`?`installed`:null,s=ge.has(n)?n:o??`all`,c=_e.has(r)?r:`all`;M(t=>t===e?t:e),B(e=>e===a?e:a),H(e=>e===s?e:s),ce(e=>e===c?e:c);let l=i.get(`mcat`)??``;Ze(a===`marketplace`?e=>e===l?e:l:``)}let Et=(0,Z.useRef)(n);!n&&Et.current&&(Qe(null),at.current=null),Et.current=n,n&&p&&ot.current!==p&&(ot.current=p,Qe(p)),n&&p==null&&xt.data.current&&xt.data.current!==st.current&&(st.current=xt.data.current,Qe(e=>e??xt.data.current));let Dt=`${P}|${Ve}|${z}|${Xe}|${$??``}|${pt}`;ct.current!==Dt&&(ct.current=Dt,We(1)),z===`marketplace`&&$&<.current!=null&<.current!==$&&Ze(``),lt.current=$;let Ot=w(()=>se({page:Ue,pageSize:20,sort:Ve,category:Xe.trim()||void 0,provider:$}),[n,z,Xe,Ue,Ve,I,$],{enabled:n&&z===`marketplace`&&!!$&&!I,initial:null,errorData:null});(0,Z.useEffect)(()=>{if(!n||!I||z!==`marketplace`||Ct.length===0)return;let e=++ht.current,r={};for(let e of Ct)r[e.id]={status:`loading`,rows:[]};ft({query:P,byProvider:r});let i=[],a=[];for(let n of Ct){let r=new AbortController;i.push(r);let o=window.setTimeout(()=>{r.abort(new DOMException(`Adapter timed out`,`TimeoutError`))},8e3);a.push(o),se({provider:n.id,q:P,page:1,pageSize:40,sort:Ve,signal:r.signal}).then(t=>{if(window.clearTimeout(o),e!==ht.current)return;let r=t.items.map(e=>({...e,providerId:n.id}));ft(e=>({...e,byProvider:{...e.byProvider,[n.id]:{status:`ok`,rows:r}}}))}).catch(r=>{if(window.clearTimeout(o),e!==ht.current)return;let i=r instanceof DOMException&&(r.name===`TimeoutError`||r.name===`AbortError`)?t.marketplaceLoadFailed:r instanceof Error?r.message:t.marketplaceLoadFailed;ft(e=>({...e,byProvider:{...e.byProvider,[n.id]:{status:`error`,rows:[],error:i}}}))})}return()=>{for(let e of a)window.clearTimeout(e);for(let e of i)e.abort()}},[n,z,I,P,Ct,Ve,t.marketplaceLoadFailed]);let kt=w(()=>re({provider:$,locale:e}).then(e=>e.items),[n,z,$,e],{enabled:n&&z===`marketplace`&&!!$,initial:[],errorData:[]}),At=(0,Z.useMemo)(()=>{if(!I||dt.query!==P)return[];let e=Ct.map(e=>({id:e.id,rows:[...dt.byProvider[e.id]?.rows??[]]})),t=[];for(;e.some(e=>e.rows.length>0);)for(let n of e)n.rows.length>0&&t.push(n.rows.shift());let n=new Map;for(let e of t){let t=[(e.id??``).toLowerCase().trim(),(e.name??``).toLowerCase().trim(),(e.author?.username??``).toLowerCase().trim()].join(`|`),r=n.get(t);if(!r){n.set(t,{...e,additionalSources:[]});continue}if(e.providerId&&e.providerId!==r.providerId){let t=r.additionalSources??[];t.some(t=>t.providerId===e.providerId)||(t.push({providerId:e.providerId,sourceLabel:e.sourceLabel}),r.additionalSources=t)}}return Array.from(n.values())},[I,P,dt,Ct]),jt=(0,Z.useMemo)(()=>{if(!I)return{};let e={all:At.length};for(let t of Ct)e[t.id]=At.filter(e=>e.providerId===t.id||(e.additionalSources??[]).some(e=>e.providerId===t.id)).length;return e},[I,At,Ct]),Mt=(0,Z.useMemo)(()=>I?pt===`all`?At:At.filter(e=>e.providerId===pt||(e.additionalSources??[]).some(e=>e.providerId===pt)):[],[I,At,pt]),Nt=(0,Z.useMemo)(()=>{if(!I)return{};let e={};for(let t of Ct)e[t.id]=dt.byProvider[t.id]?.status??`loading`;return e},[I,dt,Ct]),Pt=(0,Z.useMemo)(()=>Object.values(Nt).some(e=>e===`loading`),[Nt]),Ft=(0,Z.useMemo)(()=>{if(!I)return!1;let e=Object.values(Nt);return e.length>0&&e.every(e=>e===`error`)},[I,Nt]),It=(0,Z.useMemo)(()=>{if(!I||At.length===0&&Pt)return null;let e=Mt.length,t=(Ue-1)*20;return{items:Mt.slice(t,t+20),meta:{page:Ue,pageSize:20,total:e,totalPages:Math.max(1,Math.ceil(e/20))},provider:pt}},[I,At,Pt,Mt,Ue,pt]),Lt=z===`marketplace`?F?I?It:null:Ot.data:null,Rt=z===`marketplace`?F?I?Pt:!0:Ot.loading:!1,zt=I?Ft?t.marketplaceLoadFailed:null:Ot.error instanceof Error?Ot.error.message:Ot.error?t.marketplaceLoadFailed:null,Bt=z===`marketplace`?kt.data:[],Vt=z===`marketplace`?kt.loading:!1,Ht=kt.error instanceof Error?kt.error.message:kt.error?t.marketplaceCategoriesFailed:null;Xe.trim()&&Bt.length>0&&!Bt.some(e=>e.id===Xe)&&Ze(``);let Ut=(0,Z.useCallback)(async e=>{let n=e?.silent===!0;n||h(!0),_(null);try{let e=await T();return it(e.diagnostics??[]),bt(e.catalog.map(oe)),{ok:!0}}catch(e){let n=e instanceof Error?e.message:t.loadFailed;return _(n),{ok:!1,message:n}}finally{n||h(!1)}},[bt,t.loadFailed]),Wt=!m&&_t.error?_t.error instanceof Error?_t.error.message:t.loadFailed:null,Gt=g??Wt;(0,Z.useEffect)(()=>{c(e=>{let t=new URLSearchParams(e);return P?t.set(`q`,P):t.delete(`q`),z===`marketplace`?t.set(`tab`,z):t.delete(`tab`),V===`all`?t.delete(`source`):t.set(`source`,V),z===`installed`&&Y!==`all`?t.set(`status`,Y):t.delete(`status`),z===`marketplace`&&Xe.trim()?t.set(`mcat`,Xe.trim()):t.delete(`mcat`),z===`marketplace`&&$?t.set(ve,$):t.delete(ve),t.toString()===e.toString()?e:t},{replace:!0})},[z,Xe,$,P,Y,c,V]);let Kt=(0,Z.useCallback)((e,t,n=5e3)=>{R({kind:e,message:t}),window.setTimeout(()=>R(null),n)},[]),qt=(0,Z.useCallback)(e=>{let n=e.availability;if(!n)return t.installSuccess;let r=n.skillName||n.skillId;if(!n.loaded)return`Skill "${r}" installed, but it was not loaded. Check skill diagnostics.`;if(n.diagnostics.length>0)return`Skill "${r}" installed with ${n.diagnostics.length} diagnostic(s).`;if(n.enabled===!1)return`Skill "${r}" installed but disabled. Enable it before use.`;if(n.availableForDefaultAgent===!1){let e=n.unavailableReason||`unavailable`;return`Skill "${r}" installed but unavailable for agent "${n.defaultAgentId}" (${e}).`}return`Skill "${r}" installed and ready.`},[t.installSuccess]),Jt=(0,Z.useCallback)(async e=>{Ae(`catalog`),Oe(!0),Me(e.name),Pe(null),Ie(null),Be(null),Re(!0);try{let t=await ie(e.name);Pe(t),Me(t.name)}catch(e){Pe(null),Be(e instanceof Error?e.message:t.detailLoadFailed)}finally{Re(!1)}},[t.detailLoadFailed]),Yt=(0,Z.useCallback)(async e=>{let n=e.trim();if(n){Ae(`catalog`),Oe(!0),Me(n),Pe(null),Ie(null),Be(null),Re(!0);try{let e=await ie(n);Pe(e),Me(e.name)}catch(e){Pe(null),Be(e instanceof Error?e.message:t.detailLoadFailed)}finally{Re(!1)}}},[t.detailLoadFailed]),Xt=(0,Z.useCallback)(async(e,n,r)=>{let i=r?.trim()||$;if(i){at.current=i,Ae(`store`),Oe(!0),Me(n?.trim()||e),Pe(null),Ie(null),Be(null),Re(!0);try{let t=await ue(e,{provider:i});Me(t.name),Ie(t.skillDocPreview)}catch(e){Ie(null),Be(e instanceof Error?e.message:t.detailLoadFailed)}finally{Re(!1)}}},[$,t.detailLoadFailed]),Zt=(0,Z.useCallback)(async(e,n)=>{we(e),Ee(t=>({...t,[e]:n})),R(null);try{return await J(e,n),await Ut({silent:!0}),!0}catch(n){return Ee(t=>{let{[e]:n,...r}=t;return r}),Kt(`error`,n instanceof Error?n.message:t.skillToggleFailed),!1}finally{we(null),Ee(t=>{let{[e]:n,...r}=t;return r})}},[Ut,Kt,t.skillToggleFailed]),Qt=(0,Z.useCallback)(async()=>{R(null),h(!0),_(null);try{await U()}catch(e){_(e instanceof Error?e.message:t.reloadFailed),h(!1);return}await Ut()},[Ut,t.reloadFailed]),$t=(0,Z.useMemo)(()=>{let e=j.trim().toLowerCase();return e?vt.filter(t=>[t.name,t.description,t.directoryId,t.path,t.source,t.hub?.source,t.hub?.ref].filter(Boolean).join(` `).toLowerCase().includes(e)):vt},[vt,j]),en=(0,Z.useMemo)(()=>{let e=vt.filter(e=>e.source===`builtin`);return{total:e.length,enabled:e.filter(e=>Te[e.name]??e.enabled).length}},[vt,Te]),tn=(0,Z.useMemo)(()=>{let e=vt.filter(e=>e.source!==`builtin`);return{total:e.length,enabled:e.filter(e=>Te[e.name]??e.enabled).length}},[vt,Te]),nn=(0,Z.useMemo)(()=>je?vt.find(e=>e.name===je):void 0,[vt,je]),rn=nn==null?!0:Te[je]??nn.enabled,an=nn?.directoryId??null,on=nn?.managed??!1,sn=(0,Z.useMemo)(()=>ke!==`store`||!je?null:G(at.current??$,je),[ke,je,$]),cn=(0,Z.useMemo)(()=>{let e=$t;return z===`installed`&&V!==`all`&&(e=V===`installed`?e.filter(e=>e.source!==`builtin`):e.filter(e=>e.source===V)),e},[$t,z,V]),ln=(0,Z.useMemo)(()=>{let e=new Set,t=[];for(let n of cn){let r=n.category;!r||e.has(r)||(e.add(r),t.push(r))}return t.sort((e,t)=>{let n=be.indexOf(e),r=be.indexOf(t);return n>=0&&r>=0?n-r:n>=0?-1:r>=0?1:e.localeCompare(t)})},[cn]),un=(0,Z.useCallback)(e=>t.categoryLabel?.[e]||e,[t.categoryLabel]),dn=(0,Z.useMemo)(()=>ne?cn.filter(e=>e.category===ne):cn,[cn,ne]);(0,Z.useEffect)(()=>{ae(``)},[V]);let fn=(0,Z.useCallback)(e=>Te[e.name]??e.enabled,[Te]),pn=(0,Z.useMemo)(()=>dn.filter(e=>!fn(e)).length,[dn,fn]),mn=(0,Z.useMemo)(()=>{let e=dn;return Y===`disabled`&&(e=e.filter(e=>!fn(e))),Y===`enabled`&&(e=e.filter(e=>fn(e))),[...e].toSorted((e,t)=>{let n=fn(e);return n===fn(t)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})},[dn,Y,fn]),hn=async e=>{R(null),y(!0),_(null);try{let n;try{n=await Ke(e)}catch{_(t.invalidFile),Kt(`error`,t.invalidFile);return}let r=await W(n,{overwrite:!0});ut.current=!0,await Ut(),Kt(`success`,qt(r)),X(!1),de(null),B(`installed`),H(`installed`),await Yt(r.availability?.skillName||r.skillId)}catch(e){_(e instanceof Error?e.message:t.uploadFailed),Kt(`error`,e instanceof Error?e.message:t.uploadFailed)}finally{y(!1)}},gn=()=>{Q&&hn(Q)},_n=e=>{let t=e.target.files?.[0];e.target.value=``,t&&de(t)},vn=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer.types.includes(`Files`)&&(pe(!0),e.dataTransfer.dropEffect=`copy`)},yn=e=>{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||pe(!1)},bn=e=>{e.preventDefault(),e.stopPropagation(),pe(!1);let t=e.dataTransfer?.files?.[0];t&&de(t)},xn=e=>{if(e.origin===`agents-global`)return t.source.agentsGlobal;if(e.origin===`agents-workspace`)return t.source.agentsWorkspace;switch(e.source){case`builtin`:return t.source.builtin;case`workspace`:return t.source.workspace;case`global`:return t.source.global;case`extra`:return t.source.extra;default:return e.source}},Sn=async()=>{let e=xe,n=De&&ke===`catalog`&&an===e;if(ye(!1),Se(null),e){R(null);try{await ee(e),ut.current=!0,await Ut(),n&&(Oe(!1),Ae(`catalog`),Me(``),Pe(null),Ie(null),Be(null))}catch(e){_(e instanceof Error?e.message:t.deleteFailed)}}},Cn=(0,Z.useCallback)(e=>vt.some(t=>t.name===e),[vt]),wn=(0,Z.useCallback)(async e=>{let n=(e?.name??je).trim();if(!n)return;let i=e?.source??ke;if(i===`catalog`){let e=vt.find(e=>e.name===n);if(e&&!(Te[e.name]??e.enabled))return}R(null);let a=i===`store`&&!Cn(n);Ye(n);try{if(a){let t=e?.providerOverride?.trim()||at.current||$;await te({name:n,overwrite:!1,...t?{provider:t}:{}}),ut.current=!0,await Ut({silent:!0})}Oe(!1),r(`/chat/new?skill=${encodeURIComponent(n)}`)}catch(e){Kt(`error`,e instanceof Error?e.message:t.uploadFailed)}finally{Ye(null)}},[vt,je,ke,Te,Cn,Ut,r,Kt,t.uploadFailed,$]),Tn=(0,Z.useCallback)(async(e,n)=>{let r=Cn(e);if(!(r&&!window.confirm(t.marketplaceReinstallConfirm))){R(null),qe(e);try{let t=n?.providerOverride?.trim()||(n?.useDetailProvider?at.current??$:$),i=await te({name:e,overwrite:r,...t?{provider:t}:{}});ut.current=!0,await Ut({silent:!0}),Kt(`success`,qt(i)),B(`installed`),H(`installed`),await Yt(i.availability?.skillName||i.skillId||e)}catch(e){Kt(`error`,e instanceof Error?e.message:t.uploadFailed)}finally{qe(null)}}},[Cn,qt,Ut,$,Yt,Kt,t.marketplaceReinstallConfirm,t.uploadFailed]),{pathname:En}=a();return{sk:t,hasToken:n,catalog:vt,loading:St,error:Gt,uploading:v,searchQuery:j,setSearchQuery:M,actionFeedback:L,skillDiagnostics:rt,mainTab:z,setMainTab:B,sourceFilter:V,setSourceFilter:H,builtinCategoryFilter:ne,setBuiltinCategoryFilter:ae,installOpen:le,setInstallOpen:X,pendingFile:Q,setPendingFile:de,dropActive:fe,setDropActive:pe,confirmOpen:me,setConfirmOpen:ye,confirmId:xe,setConfirmId:Se,togglingSkillName:Ce,enabledOverride:Te,detailOpen:De,setDetailOpen:Oe,detailSource:ke,setDetailSource:Ae,detailTitle:je,setDetailTitle:Me,detailCatalogPreview:Ne,setDetailCatalogPreview:Pe,detailMarketplacePreview:Fe,setDetailMarketplacePreview:Ie,detailLoading:Le,detailError:ze,setDetailError:Be,marketSort:Ve,setMarketSort:He,marketPage:Ue,setMarketPage:We,mpLoading:Rt,mpError:zt,mpPayload:Lt,searchActive:I,searchInputActive:F,resultTab:pt,setResultTab:mt,aggregatedTabCounts:jt,aggregatedProviderStatus:Nt,aggregatedAllFailed:Ft,installingMarketName:Ge,usingSkillInChatName:Je,onUseSkillInChat:wn,marketCategoryId:Xe,setMarketCategoryId:Ze,mpCategories:Bt,mpCategoriesError:Ht,mpCategoriesLoading:Vt,marketBrowseProvider:$,setMarketBrowseProvider:Qe,registeredProviders:Ct,builtinTabStats:en,userTabStats:tn,detailEnabled:rn,detailDirectoryId:an,detailManaged:on,detailExternalUrl:sn,filteredCatalog:cn,builtinCategories:ln,categoryFilteredCatalog:dn,catalogDisplayRows:mn,catalogDisabledCount:pn,catalogStatusFilter:Y,setCatalogStatusFilter:ce,resolveSkillEnabled:fn,inSettingsShell:En.startsWith(`/settings/`),categoryLabel:un,onReloadClick:Qt,openSkillDetail:Jt,openMarketplaceDetail:Xt,onSkillToggle:Zt,onInstallSubmit:gn,onFileInputChange:_n,onModalDragOver:vn,onModalDragLeave:yn,onModalDrop:bn,sourceLabel:xn,runDelete:Sn,onMarketInstall:Tn,isSkillInstalledByName:Cn}}function Je(){let e=(0,X.c)(2),t=qe(),n;return e[0]===t?n=e[1]:(n=(0,Q.jsx)(ze,{vm:t}),e[0]=t,e[1]=n),n}export{Je as SkillsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./cn-JdwAhgNB.js";import{t as i}from"./messages-DMJ-6-1m.js";import{n as a}from"./locale-store-VOY1wMO9.js";import{At as o,Hr as s,Js as c,No as l,Ol as u,Ur as d,ls as f,oc as p}from"./index-DzmbmOGA.js";import{n as m,r as h}from"./settings-page-layout-J793iqfm.js";import{r as g,t as _}from"./settings-form-section-CKLns16d.js";var v=e(t(),1),y=n();async function b(){if(typeof navigator>`u`||!navigator.mediaDevices?.getUserMedia)return!1;try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop();return!0}catch{return!1}}function x(e,t,n){return e.task===`opened-settings`?n.openedSettings:e.status===`granted`&&t?e.task===`already-granted`?n.alreadyGranted:n.granted:t?e.status===`denied`?n.denied:n.prompted:n.rendererDenied}function S(e,t){return e.task===`opened-settings`?t.openedSettings:e.status===`granted`?e.task===`already-granted`?t.alreadyGranted:t.granted:t.denied}function C(e,t){return e.task===`opened-settings`?t.openedSettings:e.status===`granted`?e.task===`already-granted`?t.alreadyGranted:t.granted:e.status===`denied`?t.denied:t.prompted}function w(e,t){return e.task===`opened-settings`?t.openedSettings:e.status===`granted`?e.task===`already-granted`?t.alreadyGranted:t.granted:e.status===`denied`?t.denied:t.prompted}var T=new Set([`microphone`,`accessibility`,`notifications`,`screen`]);function E(e,t,n){return t===`granted`?!1:e===`accessibility`&&(n===`darwin`||n===`win32`||n===`linux`)||e===`screen`&&(n===`darwin`||n===`win32`)||T.has(e)?t===`unknown`:!1}function D(e,t,n){return e===`accessibility`?!1:e===`screen`&&n===`linux`?!0:T.has(e)?t===`denied`:!0}var O=[{key:`fullDisk`,pane:`fullDisk`,platforms:[`darwin`]},{key:`screen`,pane:`screen`},{key:`microphone`,pane:`microphone`},{key:`accessibility`,pane:`accessibility`},{key:`automation`,pane:`automation`},{key:`notifications`,pane:`notifications`},{key:`location`,pane:`location`}];function k(e){return e===`linux`?O:O.filter(t=>!t.platforms||t.platforms.includes(e))}function A(e,t){let n=i(e).systemSettings.status;return t===`granted`?{label:n.granted,className:`text-emerald-600 dark:text-emerald-400`}:t===`denied`?{label:n.denied,className:`text-amber-600 dark:text-amber-400`}:{label:n.unknown,className:`text-fg-muted`}}function j(e,t,n){let r=i(e).systemSettings.permUnknown?.[t];return r?n===`darwin`&&r.darwin?r.darwin:n===`win32`&&r.win32?r.win32:n===`linux`&&r.linux?r.linux:null:null}var M={behavior:null,perms:null,loadError:null,permFeedback:null,permBusy:!1,refreshing:!1};function N(){let e=a(e=>e.language),t=i(e).systemSettings,[n,T]=(0,v.useReducer)(o,M),{behavior:O,perms:N,loadError:P,permFeedback:F,permBusy:I,refreshing:L}=n,R=typeof window<`u`?window.electronAPI?.system:void 0,z=(0,v.useCallback)(async e=>{if(R){T({type:`patch`,patch:{loadError:null}});try{T({type:`patch`,patch:{behavior:await R.getBehavior(),perms:await R.getPermissions({probe:e?.showRefreshFeedback}),...e?.showRefreshFeedback?{permFeedback:t.refreshDone}:{}}})}catch(t){T({type:`patch`,patch:{loadError:t instanceof Error?t.message:String(t),...e?.showRefreshFeedback?{permFeedback:null}:{}}})}}},[R,t.refreshDone]),B=(0,v.useCallback)(async()=>{if(!(L||I)){T({type:`patch`,patch:{refreshing:!0}});try{await z({showRefreshFeedback:!0})}finally{T({type:`patch`,patch:{refreshing:!1}})}}},[z,I,L]);if((0,v.useEffect)(()=>{let e=new Set([t.refreshDone,t.openSettingsDone,t.openSettingsFailed,t.desktopNotify.testShown]);if(!F||!e.has(F))return;let n=window.setTimeout(()=>{T({type:`patch`,patch:{permFeedback:null}})},3e3);return()=>window.clearTimeout(n)},[F,t.openSettingsDone,t.openSettingsFailed,t.refreshDone,t.desktopNotify.testShown]),(0,v.useEffect)(()=>{l()&&R&&z()},[R,z]),!l()||!R)return(0,y.jsxs)(h,{gap:`gap-3`,children:[(0,y.jsx)(m,{title:t.title}),(0,y.jsxs)(`div`,{className:g(),children:[(0,y.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.desktopOnlyTitle}),(0,y.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.desktopOnlyBody})]})]});let V=async e=>{try{let{behavior:t}=await R.setBehavior(e);T({type:`patch`,patch:{behavior:t}}),(e.notifyEnabled!==void 0||e.notifySoundEnabled!==void 0)&&s()}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}},H=async e=>{if(!e){await V({notifyEnabled:!1});return}T({type:`patch`,patch:{permBusy:!0,permFeedback:null}});try{let e=await d(t.desktopNotify.testTitle,t.desktopNotify.testBody);if(e===`unsupported`){T({type:`patch`,patch:{permFeedback:t.notificationsFeedback.unsupported}});return}if(e===`denied`){T({type:`patch`,patch:{permFeedback:t.desktopNotify.denied}});return}if(e==="default"){T({type:`patch`,patch:{permFeedback:t.notificationsFeedback.default}});return}await V({notifyEnabled:!0}),T({type:`patch`,patch:{perms:await R.getPermissions()}}),T({type:`patch`,patch:{permFeedback:t.desktopNotify.testShown}})}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{T({type:`patch`,patch:{permBusy:!1}})}},U=async e=>{T({type:`patch`,patch:{permFeedback:null}}),T({type:`patch`,patch:{loadError:null}});try{(await R.openPrivacy(e)).ok?T({type:`patch`,patch:{permFeedback:t.openSettingsDone}}):T({type:`patch`,patch:{permFeedback:t.openSettingsFailed}})}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}},W=async()=>{T({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),T({type:`patch`,patch:{loadError:null}});try{let e=await R.requestMicrophone(),n=await b();T({type:`patch`,patch:{perms:await R.getPermissions()}}),T({type:`patch`,patch:{permFeedback:x(e,n,t.permFeedback)}})}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{T({type:`patch`,patch:{permBusy:!1}})}},G=async()=>{if(R.requestAccessibility){T({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),T({type:`patch`,patch:{loadError:null}});try{let e=await R.requestAccessibility();T({type:`patch`,patch:{perms:await R.getPermissions()}}),T({type:`patch`,patch:{permFeedback:S(e,t.accessibilityFeedback)}})}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{T({type:`patch`,patch:{permBusy:!1}})}}},K=async()=>{if(R.requestNotifications){T({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),T({type:`patch`,patch:{loadError:null}});try{let e=await R.requestNotifications();T({type:`patch`,patch:{perms:await R.getPermissions()}}),T({type:`patch`,patch:{permFeedback:C(e,t.notificationsFeedback)}})}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{T({type:`patch`,patch:{permBusy:!1}})}}},q=async()=>{if(R.requestScreen){T({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),T({type:`patch`,patch:{loadError:null}});try{let e=await R.requestScreen();T({type:`patch`,patch:{perms:await R.getPermissions()}}),T({type:`patch`,patch:{permFeedback:w(e,t.screenFeedback)}})}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{T({type:`patch`,patch:{permBusy:!1}})}}},J=O?O.platform===`win32`?t.permissionsHintWin:O.platform===`linux`?t.permissionsHintLinux:O.platform===`darwin`?t.permissionsHintDarwin:t.permissionsHint:t.permissionsHint;return(0,y.jsxs)(h,{gap:`gap-6`,children:[(0,y.jsx)(m,{title:t.title}),P?(0,y.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:P}):null,F?(0,y.jsx)(`p`,{className:r(`text-sm`,F===t.refreshDone||F===t.openSettingsDone||F===t.permFeedback.granted||F===t.permFeedback.alreadyGranted||F===t.accessibilityFeedback.granted||F===t.accessibilityFeedback.alreadyGranted||F===t.notificationsFeedback.granted||F===t.notificationsFeedback.alreadyGranted||F===t.screenFeedback.granted||F===t.screenFeedback.alreadyGranted||F===t.desktopNotify.testShown?`text-emerald-600 dark:text-emerald-400`:`text-fg-muted`),role:`status`,"aria-live":`polite`,children:F}):null,(0,y.jsxs)(_,{children:[(0,y.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,y.jsx)(c,{className:`size-4 text-accent`,strokeWidth:1.75}),t.behaviorGroup]}),(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.toggles.openAtLogin}),(0,y.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.toggles.openAtLoginDesc})]}),(0,y.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!O,checked:!!O?.openAtLogin,onChange:e=>{V({openAtLogin:e.target.checked})}})]}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.toggles.keepAwake}),(0,y.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.toggles.keepAwakeDesc})]}),(0,y.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!O,checked:!!O?.keepAwakePreferred,onChange:e=>{V({keepAwakePreferred:e.target.checked})}})]}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.toggles.notifyDesktop}),(0,y.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.toggles.notifyDesktopDesc})]}),(0,y.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!O||I,checked:!!O?.notifyEnabled,onChange:e=>{H(e.target.checked)}})]}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.toggles.notifySound}),(0,y.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.toggles.notifySoundDesc})]}),(0,y.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!O,checked:!!O?.notifySoundEnabled,onChange:e=>{V({notifySoundEnabled:e.target.checked})}})]})]})]}),O&&N?(0,y.jsxs)(`section`,{className:g(),children:[(0,y.jsxs)(`div`,{className:`mb-4 flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.permissionsTitle}),(0,y.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:J}),O.platform===`darwin`&&!O.packaged?(0,y.jsx)(`p`,{className:`mt-1 text-xs text-amber-600 dark:text-amber-400`,children:t.permissionsHintDevDarwin}):null]}),(0,y.jsxs)(`button`,{type:`button`,disabled:L||I,"aria-busy":L,className:r(`mt-2 inline-flex max-w-full items-center justify-center gap-1.5 rounded-lg border border-edge bg-surface-panel px-3 py-1.5 text-sm font-medium text-fg transition-colors hover:bg-surface-hover disabled:opacity-50 sm:mt-0`,f.press),onClick:()=>void B(),children:[(0,y.jsx)(p,{className:r(`size-3.5`,L&&`animate-spin`),strokeWidth:1.75,"aria-hidden":!0}),L?t.refreshing:t.refresh]})]}),(0,y.jsx)(`ul`,{className:`space-y-3`,children:k(O.platform).map(({key:n,pane:i})=>{let a=A(e,N[n]),o=t.perm[n],s=N[n]===`unknown`?j(e,n,O.platform):null;return o?(0,y.jsxs)(`li`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:o.title}),(0,y.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:o.desc}),(0,y.jsx)(`p`,{className:`mt-1 text-xs font-medium ${a.className}`,children:a.label}),s?(0,y.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:s}):null]}),(0,y.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[n===`notifications`&&E(n,N[n],O.platform)?(0,y.jsx)(`button`,{type:`button`,disabled:I,className:r(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,f.press),onClick:()=>void K(),children:t.requestAccess}):null,n===`microphone`&&E(n,N[n],O.platform)?(0,y.jsx)(`button`,{type:`button`,disabled:I,className:r(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,f.press),onClick:()=>void W(),children:t.requestAccess}):null,n===`accessibility`&&E(n,N[n],O.platform)?(0,y.jsx)(`button`,{type:`button`,disabled:I,className:r(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,f.press),onClick:()=>void G(),children:t.requestAccess}):null,n===`screen`&&E(n,N[n],O.platform)?(0,y.jsx)(`button`,{type:`button`,disabled:I,className:r(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,f.press),onClick:()=>void q(),children:t.requestAccess}):null,D(n,N[n],O.platform)?(0,y.jsxs)(`button`,{type:`button`,className:r(`inline-flex items-center gap-1.5 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover`,f.press),onClick:()=>void U(i),children:[t.openSettings,(0,y.jsx)(u,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0})]}):null]})]},n):null})})]}):null]})}export{N as SystemSettingsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,f as a,t as o}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{l as s,n as c}from"./locale-store-VOY1wMO9.js";import{$l as l,Ao as u,Ct as d,Do as f,Eo as p,Fa as m,Gl as h,Gr as g,Kl as _,Kr as v,Mo as y,Ol as b,Oo as x,Sn as S,Ta as C,Tt as w,Wr as ee,Yr as te,au as ne,ca as re,hc as T,hs as E,ht as ie,jo as D,kl as ae,ko as O,pt as oe,qr as se,rt as k,uu as ce,vi as le,vl as ue,vs as A,xc as de,xl as fe,yc as pe,yi as me,yt as he,yu as ge}from"./index-DzmbmOGA.js";import{t as _e}from"./dependency-picker-CTtZFZug.js";var j=n(),M=e(t(),1),N=r();function P(e,t){return(t===`zh`?{backlog:`收集箱`,ready:`就绪`,active:`进行中`,review:`待验收`,closed:`已关闭`}:{backlog:`Backlog`,ready:`Ready`,active:`Active`,review:`Review`,closed:`Closed`})[e]}function ve(){let e=(0,j.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,N.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[(0,N.jsx)(C,{className:`h-32 rounded-2xl`}),(0,N.jsx)(C,{className:`h-52 rounded-2xl`}),(0,N.jsx)(C,{className:`h-40 rounded-2xl`})]}),e[0]=t):t=e[0],t}function F(e){return e.task.phase===`closed`?e.task.resolution===`done`?`completed`:`ended`:e.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`)?`needsUser`:e.operationalState===`idle`?e.task.phase===`backlog`?`captured`:e.task.phase===`ready`?`ready`:e.task.phase===`review`?`review`:`paused`:e.operationalState}function I(e){let t=(0,j.c)(9),{items:n,empty:r,verificationByCriterion:i}=e;if(n.length===0){let e;return t[0]===r?e=t[1]:(e=(0,N.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:r}),t[0]=r,t[1]=e),e}let a;if(t[2]!==n||t[3]!==i){let e;t[5]===i?e=t[6]:(e=e=>{let t=i?.get(e)??`unverified`;return(0,N.jsxs)(`li`,{className:`flex gap-2 text-sm leading-6 text-fg`,children:[(0,N.jsx)(t===`passed`?l:t===`failed`?_:h,{className:t===`passed`?`mt-1 size-4 shrink-0 text-success`:t===`failed`?`mt-1 size-4 shrink-0 text-danger`:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,N.jsx)(`span`,{children:e})]},e)},t[5]=i,t[6]=e),a=n.map(e),t[2]=n,t[3]=i,t[4]=a}else a=t[4];let o;return t[7]===a?o=t[8]:(o=(0,N.jsx)(`ul`,{className:`space-y-2`,children:a}),t[7]=a,t[8]=o),o}function L({taskId:e,presentation:t,backgroundPath:n}){let[r]=a(),i=c(e=>e.language),u=s(e=>e.token),f=(0,M.useMemo)(()=>oe(i),[i]),p=m(e=>e.setPageHeader),h=m(e=>e.clearPageHeader),[_,y]=(0,M.useState)(null),[x,C]=(0,M.useState)(null),[D,O]=(0,M.useState)(!1),[A,j]=(0,M.useState)([]),[L,R]=(0,M.useState)(null),[z,B]=(0,M.useState)(!1),[V,H]=(0,M.useState)([]),U=(0,M.useMemo)(()=>le(r.get(`returnTo`),`/`,[`/projects`,`/chat`,`/notes`,`/tasks`]),[r]);(0,M.useEffect)(()=>{let t=!0;return y(null),C(null),he(e).then(e=>{t&&y(e)}).catch(()=>{t&&C(f.taskNotFound)}),()=>{t=!1}},[f.taskNotFound,e,u]),(0,M.useEffect)(()=>{let t=_?.task.projectId,n=_?.dependencies??[];if(!t){R(null),j(n);return}R(null);let r=!0;return re(t).then(t=>{if(!r)return;R(t.project.name);let i=new Map;for(let r of[...t.tasks,...n])r.id!==e&&i.set(r.id,{id:r.id,title:r.title});j([...i.values()])}).catch(()=>{r&&(R(null),j(n))}),()=>{r=!1}},[_?.dependencies,_?.task.projectId,e]);let W=async t=>{if(_){O(!0),C(null);try{y(await ie(e,t,_.task.version))}catch{C(f.actionFailed)}finally{O(!1)}}},ye=async()=>{if(_){O(!0),C(null);try{y(await w(e,V,_.task.version)),B(!1)}catch{C(f.dependencyUpdateFailed)}finally{O(!1)}}};if((0,M.useLayoutEffect)(()=>{if(t!==`modal`)return p({startExtra:(0,N.jsx)(o,{to:U,className:`flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover`,"aria-label":f.backToWork,children:(0,N.jsx)(ge,{className:`size-4`})}),main:_?(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsx)(`p`,{className:`truncate text-sm font-semibold text-fg`,children:L?`${L} / ${f.taskLabel}`:f.taskLabel}),(0,N.jsx)(`p`,{className:`text-xs text-fg-muted`,children:f.detailStatuses[F(_)]})]}):null,end:null}),h},[h,f.backToWork,f.detailStatuses,f.taskLabel,_,t,L,U,p]),x&&!_)return(0,N.jsx)(`div`,{className:t===`modal`?`p-5 text-sm text-danger`:`mx-auto max-w-3xl p-6 text-sm text-danger`,children:x});if(!_)return(0,N.jsx)(`div`,{className:t===`modal`?`p-5`:`mx-auto max-w-4xl p-4 sm:p-6`,children:(0,N.jsx)(ve,{})});let G=_.waits[0],K=G?.kind===`paused`?G:void 0,q=_.receipts[0],be=f.detailStatuses[F(_)],xe=f.detailStatusDescriptions[F(_)],J=_.task.body?.trim()||_.task.contract?.objective.trim(),Se=_.task.delegateAgentId??_.task.ownerId,Y=new Map(q?.verification.checks.map(e=>[e.criterion,e.status])),Ce=_.allowedCommands.includes(`mark_ready`),we=_.allowedCommands.includes(`start`),Te=_.allowedCommands.includes(`add_wait`),Ee=_.task.phase===`review`&&_.allowedCommands.includes(`close`),De=_.allowedCommands.includes(`reopen`),Oe=_.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`),X=_.task.contract?.acceptanceCriteria??[],ke=X.filter(e=>Y.get(e)===`passed`).length,Z=_.task.contract?.expectedOutputs??[],Q=_.task.contract?.constraints??[],$=_.task.contract?.approvalRequired??[],Ae=_.task.contract?.assumptions??[],je=_.task.contract?.risks??[],Me=e=>t===`modal`&&n?S(n,e):me(`/tasks/${e}`,U);return(0,N.jsxs)(`div`,{className:t===`modal`?`space-y-4 p-5`:`mx-auto max-w-4xl space-y-4 p-4 pb-16 sm:p-6`,children:[(0,N.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`span`,{className:`inline-flex rounded-full bg-accent-soft px-2.5 py-1 text-xs font-medium text-accent-fg`,children:be}),(0,N.jsx)(`h1`,{className:`mt-3 text-xl font-semibold leading-7 text-fg`,children:_.task.title}),J&&J!==_.task.title?(0,N.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap text-sm leading-6 text-fg-muted`,children:J}):null,(0,N.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-x-4 gap-y-2 text-xs text-fg-muted`,children:[L?(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(ue,{className:`size-3.5`,"aria-hidden":!0}),L]}):null,(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(fe,{className:`size-3.5`,"aria-hidden":!0}),f.priorityLabels[_.task.priority]]}),(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),Se??f.unassigned]}),(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0}),_.task.dueAt?k(_.task.dueAt,i):f.noDueDate]})]})]}),(0,N.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[Ce?(0,N.jsxs)(E,{disabled:D,onClick:()=>void W({type:`mark_ready`}),children:[(0,N.jsx)(T,{className:`size-4`}),f.scheduleTask]}):null,K?(0,N.jsxs)(E,{disabled:D,onClick:()=>void W({type:`resolve_wait`,waitId:K.id}),children:[(0,N.jsx)(T,{className:`size-4`}),f.resumeTask]}):null,!G&&we?(0,N.jsxs)(E,{disabled:D,onClick:()=>void W({type:`start`,executor:{kind:`agent`,agentId:_.task.delegateAgentId??`main`}}),children:[(0,N.jsx)(T,{className:`size-4`}),f.runTask]}):null,Ee?(0,N.jsxs)(E,{disabled:D,onClick:()=>void W({type:`close`,resolution:`done`}),children:[(0,N.jsx)(l,{className:`size-4`}),f.approveTask]}):null,De?(0,N.jsxs)(E,{disabled:D,onClick:()=>void W({type:`reopen`,phase:`ready`}),children:[(0,N.jsx)(T,{className:`size-4`}),f.reopenTask]}):null,!G&&Te?(0,N.jsxs)(E,{variant:`secondary`,disabled:D,onClick:()=>void W({type:`add_wait`,wait:{kind:`paused`,reason:`Paused by user`,condition:{}}}),children:[(0,N.jsx)(de,{className:`size-4`}),f.pauseTask]}):null,_.task.phase===`closed`?null:(0,N.jsxs)(se,{children:[(0,N.jsx)(te,{asChild:!0,children:(0,N.jsx)(E,{type:`button`,variant:`ghost`,className:`size-9 p-0`,disabled:D,"aria-label":f.moreActions,children:(0,N.jsx)(ae,{className:`size-4`,"aria-hidden":!0})})}),(0,N.jsx)(v,{children:(0,N.jsx)(ee,{align:`end`,sideOffset:6,className:`z-[100] min-w-40 rounded-lg border border-edge bg-surface-panel p-1 shadow-lg`,children:(0,N.jsx)(g,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>void W({type:`close`,resolution:`cancelled`}),children:f.cancelTask})})})]})]})]}),x?(0,N.jsx)(`p`,{className:`mt-3 text-sm text-danger`,children:x}):null]}),(0,N.jsxs)(`section`,{className:`rounded-2xl border border-accent/20 bg-accent-soft/40 p-5`,children:[(0,N.jsx)(`h2`,{className:`font-medium text-fg`,children:f.statusSummary}),(0,N.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:xe}),(0,N.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:f.updatedAt.replace(`{{date}}`,k(_.task.updatedAt,i))})]}),_.attention.length>0?(0,N.jsxs)(`section`,{className:`rounded-2xl border border-warning/40 bg-warning/5 p-5`,children:[(0,N.jsx)(`h3`,{className:`font-medium text-fg`,children:Oe?f.needsAttention:f.waitingStatus}),(0,N.jsx)(`ul`,{className:`mt-3 space-y-2 text-sm text-fg-muted`,children:_.attention.map((e,t)=>(0,N.jsx)(`li`,{children:e.summary},`${e.kind}-${t}`))})]}):null,q?(0,N.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h2`,{className:`font-medium text-fg`,children:f.latestResult}),(0,N.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg`,children:q.summary})]}),(0,N.jsxs)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1 text-xs text-fg-muted`,children:[f.receiptStatuses[q.status],` · `,f.verificationStatuses[q.verification.status]]})]}),q.remainingWork.length>0?(0,N.jsxs)(`div`,{className:`mt-4`,children:[(0,N.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:f.remainingWork}),(0,N.jsx)(`div`,{className:`mt-2`,children:(0,N.jsx)(I,{items:q.remainingWork,empty:f.noRemainingWork})})]}):null,q.nextAction?(0,N.jsxs)(`div`,{className:`mt-4 rounded-lg bg-surface-hover p-3`,children:[(0,N.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:f.nextAction}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:q.nextAction})]}):null,(0,N.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[(0,N.jsx)(E,{className:`px-2 py-1 text-xs`,variant:`secondary`,onClick:()=>void d(q.runId,`helpful`),children:f.doneWell}),(0,N.jsx)(E,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>void d(q.runId,`not_helpful`),children:f.needsFix}),q.evidence.filter(e=>e.uri).map(e=>(0,N.jsxs)(`a`,{className:`ml-auto inline-flex items-center gap-1 text-xs text-accent hover:underline`,href:e.uri,children:[(0,N.jsx)(b,{className:`size-3`}),e.title]},`${e.title}-${e.uri}`))]}),_.receipts.length>1?(0,N.jsxs)(`details`,{className:`mt-4 border-t border-edge pt-4`,children:[(0,N.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted`,children:f.executionHistory.replace(`{{count}}`,String(_.receipts.length-1))}),(0,N.jsx)(`div`,{className:`mt-3 space-y-3`,children:_.receipts.slice(1).map(e=>(0,N.jsx)(`article`,{className:`rounded-lg bg-surface-hover p-3`,children:(0,N.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,N.jsx)(`p`,{className:`text-sm text-fg`,children:e.summary}),(0,N.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:f.receiptStatuses[e.status]})]})},e.runId))})]}):null]}):null,(0,N.jsxs)(`div`,{className:`grid items-start gap-4 lg:grid-cols-[minmax(0,2fr)_minmax(16rem,1fr)]`,children:[(0,N.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,N.jsx)(`h2`,{className:`font-medium text-fg`,children:f.taskDefinition}),(0,N.jsxs)(`div`,{className:`mt-5`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,N.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:f.successDefinition}),X.length>0?(0,N.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:f.criteriaProgress.replace(`{{verified}}`,String(ke)).replace(`{{total}}`,String(X.length))}):null]}),(0,N.jsx)(`div`,{className:`mt-3`,children:(0,N.jsx)(I,{items:X,empty:f.noDefinition,verificationByCriterion:Y})})]}),Z.length>0?(0,N.jsxs)(`div`,{className:`mt-5 border-t border-edge pt-5`,children:[(0,N.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:f.expectedOutputs}),(0,N.jsx)(`div`,{className:`mt-3`,children:(0,N.jsx)(I,{items:Z,empty:f.noDefinition})})]}):null,Q.length>0?(0,N.jsxs)(`details`,{className:`mt-5 border-t border-edge pt-4`,children:[(0,N.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:f.constraints}),(0,N.jsx)(`div`,{className:`mt-3`,children:(0,N.jsx)(I,{items:Q,empty:f.noDefinition})})]}):null,$.length>0?(0,N.jsxs)(`details`,{className:`mt-4 border-t border-edge pt-4`,children:[(0,N.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:f.approvalRequired}),(0,N.jsx)(`div`,{className:`mt-3`,children:(0,N.jsx)(I,{items:$,empty:f.noDefinition})})]}):null,Ae.length>0?(0,N.jsxs)(`details`,{className:`mt-4 border-t border-edge pt-4`,children:[(0,N.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:f.contextAssumptions}),(0,N.jsx)(`div`,{className:`mt-3`,children:(0,N.jsx)(I,{items:Ae,empty:f.noDefinition})})]}):null,je.length>0?(0,N.jsxs)(`details`,{className:`mt-4 border-t border-edge pt-4`,children:[(0,N.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:f.contextRisks}),(0,N.jsx)(`div`,{className:`mt-3`,children:(0,N.jsx)(I,{items:je,empty:f.noDefinition})})]}):null]}),(0,N.jsxs)(`div`,{className:`grid min-w-0 gap-4`,children:[(0,N.jsxs)(`section`,{className:`min-w-0 rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,N.jsx)(`h2`,{className:`font-medium text-fg`,children:f.taskRelations}),z?null:(0,N.jsxs)(E,{type:`button`,variant:`ghost`,className:`h-8 rounded-lg px-2.5 text-xs`,onClick:()=>{H(_.dependencies.map(e=>e.id)),B(!0)},children:[(0,N.jsx)(pe,{className:`size-3.5`,"aria-hidden":!0}),f.editDependencies]})]}),z?(0,N.jsxs)(`div`,{className:`mt-4 grid gap-3`,children:[(0,N.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:f.dependenciesDescription}),(0,N.jsx)(_e,{candidates:A,selectedIds:V,disabled:D,onChange:H,labels:{link:f.linkDependencies,linked:f.linkedDependencies,searchPlaceholder:f.dependencySearchPlaceholder,noMatches:f.noDependencyMatches,noCandidates:f.noDependencyCandidates,remove:f.removeDependency}}),(0,N.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,N.jsx)(E,{type:`button`,variant:`ghost`,disabled:D,onClick:()=>B(!1),children:f.cancelDependencyEdit}),(0,N.jsx)(E,{type:`button`,variant:`primary`,disabled:D,onClick:()=>void ye(),children:f.saveDependencies})]})]}):(0,N.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:f.dependencies}),_.dependencies.length>0?(0,N.jsx)(`div`,{className:`space-y-2`,children:_.dependencies.map(e=>(0,N.jsxs)(o,{to:Me(e.id),className:`block rounded-lg bg-surface-hover p-2.5 text-sm text-accent hover:underline`,children:[(0,N.jsx)(`span`,{className:`break-words`,children:e.title}),(0,N.jsx)(`span`,{className:`mt-1 block text-xs text-fg-subtle`,children:P(e.phase,i)})]},e.id))}):(0,N.jsx)(`p`,{className:`text-sm text-fg-subtle`,children:f.noDependencies})]}),(0,N.jsxs)(`div`,{className:`rounded-lg border border-accent/25 bg-accent-soft/40 p-3`,children:[(0,N.jsx)(`p`,{className:`text-xs font-medium text-accent`,children:f.currentTask}),(0,N.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg`,children:_.task.title})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:f.dependents}),_.dependents.length>0?(0,N.jsx)(`div`,{className:`space-y-2`,children:_.dependents.map(e=>(0,N.jsxs)(o,{to:Me(e.id),className:`block rounded-lg bg-surface-hover p-2.5 text-sm text-accent hover:underline`,children:[(0,N.jsx)(`span`,{className:`break-words`,children:e.title}),(0,N.jsx)(`span`,{className:`mt-1 block text-xs text-fg-subtle`,children:P(e.phase,i)})]},e.id))}):(0,N.jsx)(`p`,{className:`text-sm text-fg-subtle`,children:f.noDependents})]})]})]}),_.context.length>0?(0,N.jsxs)(`section`,{className:`min-w-0 rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,N.jsx)(`h2`,{className:`font-medium text-fg`,children:f.contextUsed}),(0,N.jsx)(`ul`,{className:`mt-4 space-y-2`,children:_.context.map(e=>(0,N.jsxs)(`li`,{className:`min-w-0 rounded-lg bg-surface-hover p-2.5`,children:[(0,N.jsxs)(`span`,{className:`text-[11px] text-fg-subtle`,children:[f.contextRoleLabels[e.role],` · `,f.contextKindLabels[e.targetKind]]}),e.targetKind===`url`&&/^https?:\/\//.test(e.targetId)?(0,N.jsx)(`a`,{className:`mt-1 block break-all text-sm text-accent hover:underline`,href:e.targetId,target:`_blank`,rel:`noreferrer`,children:e.title??e.targetId}):(0,N.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg`,children:e.title??e.targetId})]},e.id))})]}):null]})]})]})}function R(){let e=(0,j.c)(2),{taskId:t}=i(),n=t===void 0?``:t,r;return e[0]===n?r=e[1]:(r=(0,N.jsx)(L,{taskId:n,presentation:`page`}),e[0]=n,e[1]=r),r}function z(e){let t=(0,j.c)(23),{taskId:n,backgroundPath:r,onClose:i}=e,a=c(B),o;t[0]===i?o=t[1]:(o=e=>{e||i()},t[0]=i,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,N.jsx)(u,{className:`fixed inset-0 z-[80] bg-black/45 backdrop-blur-[1px]`}),t[2]=s):s=t[2];let l=a===`zh`?`任务详情`:`Task details`,d;t[3]===l?d=t[4]:(d=(0,N.jsx)(y,{className:`font-medium text-fg`,children:l}),t[3]=l,t[4]=d);let m=a===`zh`?`查看并操作任务详情`:`View and manage task details`,h;t[5]===m?h=t[6]:(h=(0,N.jsx)(O,{className:`sr-only`,children:m}),t[5]=m,t[6]=h);let g=a===`zh`?`关闭任务详情`:`Close task details`,_;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,N.jsx)(A,{className:`size-4`,"aria-hidden":!0}),t[7]=_):_=t[7];let v;t[8]===g?v=t[9]:(v=(0,N.jsx)(f,{className:`flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":g,children:_}),t[8]=g,t[9]=v);let b;t[10]!==d||t[11]!==h||t[12]!==v?(b=(0,N.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge px-5 py-3.5`,children:[d,h,v]}),t[10]=d,t[11]=h,t[12]=v,t[13]=b):b=t[13];let S;t[14]!==r||t[15]!==n?(S=(0,N.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,N.jsx)(L,{taskId:n,presentation:`modal`,backgroundPath:r})}),t[14]=r,t[15]=n,t[16]=S):S=t[16];let C;t[17]!==b||t[18]!==S?(C=(0,N.jsxs)(D,{children:[s,(0,N.jsxs)(x,{className:`fixed left-1/2 top-1/2 z-[90] flex h-[min(52rem,calc(100dvh-2rem))] w-[min(64rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-base shadow-float focus:outline-none`,children:[b,S]})]}),t[17]=b,t[18]=S,t[19]=C):C=t[19];let w;return t[20]!==o||t[21]!==C?(w=(0,N.jsx)(p,{open:!0,onOpenChange:o,children:C}),t[20]=o,t[21]=C,t[22]=w):w=t[22],w}function B(e){return e.language}export{z as TaskDetailModal,R as TaskDetailPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,t as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{n as o}from"./locale-store-VOY1wMO9.js";import{i as s}from"./vendor-swr-BIWyz7Rc.js";import{$a as c,Dc as l,Fa as u,Ho as d,Ms as f,Ol as p,Qa as m,Ta as h,Uo as g,Xa as _,Xs as v,Ya as y,Za as b,ao as x,co as S,dl as C,eo as w,hs as T,io as E,lo as D,no as O,oo as k,ou as A,pc as j,ql as M,ro as N,so as P,su as F,to as I,uo as L,yc as R}from"./index-DzmbmOGA.js";import{n as z,t as B}from"./use-autosave-CcvY7DTh.js";import{t as V}from"./page-tabs-CvzSdYVj.js";import{a as H}from"./connectors-api-3ccRyS3L.js";var U=n(),W=e(t(),1),G=r(),K=new Set([`profile`,`understanding`,`collaboration`,`sources`,`dreaming`,`privacy`]),q=`w-full rounded-xl border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent/60 focus:ring-2 focus:ring-accent/20`,ee={en:{title:`About You`,subtitle:`What xopc knows, why it knows it, and how it should work with you.`,profile:`Profile`,understanding:`Understanding`,collaboration:`Working agreement`,sources:`Sources`,dreaming:`Background review`,privacy:`Privacy`,profileHint:`Facts you provide directly. These are available across conversations.`,done:`Done`,required:`This field cannot be empty.`,callName:`What should xopc call you?`,callNamePlaceholder:`For example: Alex, Joyce, or Dr. Chen`,role:`Your role`,rolePlaceholder:`For example: product designer, founder, or engineer`,primaryGoal:`What are you mainly trying to achieve?`,primaryGoalPlaceholder:`The outcome you want xopc to optimize for`,pronouns:`Pronouns (optional)`,pronounsPlaceholder:`For example: she/her, he/him, they/them`,timezone:`Timezone`,locale:`Language / locale`,detect:`Use this device`,understoodHint:`Reviewable beliefs learned from your conversations and work. Inferences stay pending until confirmed.`,addUnderstanding:`Add understanding`,statement:`What should xopc understand?`,kind:`Type`,add:`Add`,cancel:`Cancel`,active:`Active`,review:`Needs review`,confirm:`Confirm`,reject:`Wrong`,edit:`Edit`,delete:`Delete`,confirmDelete:`Delete now`,rulesHint:`Explicit instructions for how xopc should collaborate with you. Rules outrank inferred understanding.`,addRule:`Add rule`,ruleStatement:`How should xopc work with you?`,category:`Category`,disable:`Disable`,enable:`Enable`,emptyUnderstanding:`Nothing here yet. Tell xopc something explicitly, or confirm a suggestion after it learns one.`,qualityTitle:`Learning quality`,qualityActive:`Confirmed`,qualityPending:`Pending review`,qualityAcceptance:`30-day acceptance`,qualityRecall:`Helpful recall`,qualityNoData:`Not enough feedback yet`,emptyRules:`No working agreements yet.`,sourceExplicit:`You said this directly`,sourceInferred:`Inferred — may be wrong`,sourceObserved:`Observed across prior work`,sourcesHint:`Review every granted source, its access mode, retention, and last collection. Revoking stops future learning.`,manageSources:`Connect another source`,noSources:`No sources are authorized.`,connected:`Connected`,unavailable:`Needs attention`,revoke:`Revoke & remove derived`,refresh:`Refresh`,once:`One-time`,continuous:`Continuous`,localOnly:`Local only`,derivedOnly:`Derived understanding only`,focuses:`Current focuses`,focusHint:`Candidate focuses never activate until you confirm them.`,activate:`Activate`,pause:`Pause`,complete:`Complete`,noFocuses:`No focus candidates yet.`,dreamingHint:`A deterministic daily review checks expiry, contradictory evidence, and corroborated candidates. It never auto-activates an inference.`,mode:`Background review`,on:`On — propose for review`,off:`Off`,reviewTime:`Daily review time`,evidenceThreshold:`Supporting evidence required`,scanLimit:`Maximum items per run`,lastRun:`Last review`,neverRun:`Not run yet`,runCompleted:`Completed`,runFailed:`Failed`,runRunning:`Running`,runItems:`items`,privacyHint:`Choose how generic memory providers handle sensitive content. Structured user understanding applies stricter rules of its own.`,sensitivePolicy:`Sensitive memory writes`,policyDeny:`Do not store`,policyConfirm:`Ask before storing`,policyAllow:`Store when relevant`,privacyWarning:`Secret and regulated content is never stored as structured user understanding, regardless of this setting.`,error:`Could not load your context.`,retry:`Try again`},zh:{title:`关于你`,subtitle:`清楚查看 xopc 知道什么、为什么知道,以及应该如何与你协作。`,profile:`个人资料`,understanding:`对你的理解`,collaboration:`协作约定`,sources:`数据来源`,dreaming:`后台复核`,privacy:`隐私`,profileHint:`由你直接提供的事实,会在不同对话中使用。`,done:`完成`,required:`此项不能为空。`,callName:`希望 xopc 如何称呼你?`,callNamePlaceholder:`例如:Mic、Joyce、张老师`,role:`你的角色`,rolePlaceholder:`例如:产品设计师、创业者、工程师`,primaryGoal:`你目前最想达成什么?`,primaryGoalPlaceholder:`希望 xopc 优先帮助你实现的结果`,pronouns:`代词(可选)`,pronounsPlaceholder:`例如:she/her、he/him、they/them`,timezone:`时区`,locale:`语言 / 地区`,detect:`使用本机时区`,understoodHint:`从对话和工作中形成、可复核的理解。推断内容在你确认前保持待审核。`,addUnderstanding:`添加理解`,statement:`希望 xopc 了解什么?`,kind:`类型`,add:`添加`,cancel:`取消`,active:`使用中`,review:`待审核`,confirm:`确认`,reject:`不正确`,edit:`编辑`,delete:`删除`,confirmDelete:`确认删除`,rulesHint:`你明确设定的协作方式。协作约定的优先级高于推断出的理解。`,addRule:`添加约定`,ruleStatement:`希望 xopc 如何与你协作?`,category:`类别`,disable:`停用`,enable:`启用`,emptyUnderstanding:`还没有内容。你可以直接告诉 xopc,或在它学到建议后进行确认。`,emptyRules:`还没有协作约定。`,qualityTitle:`学习质量`,qualityActive:`已确认`,qualityPending:`待审核`,qualityAcceptance:`30 天采纳率`,qualityRecall:`有效召回`,qualityNoData:`反馈数据还不足`,sourceExplicit:`由你直接告知`,sourceInferred:`推断内容,可能有误`,sourceObserved:`从过往工作中观察到`,sourcesHint:`查看每项授权的访问方式、保留策略和最近采集时间;撤销后将停止后续学习。`,manageSources:`连接其他来源`,noSources:`尚未授权任何来源。`,connected:`已连接`,unavailable:`需要处理`,revoke:`撤销并删除派生理解`,refresh:`立即更新`,once:`仅一次`,continuous:`持续更新`,localOnly:`仅本地处理`,derivedOnly:`仅保留派生理解`,focuses:`当前关注`,focusHint:`候选关注不会自动生效,只有你确认后才会启用。`,activate:`启用`,pause:`暂停`,complete:`完成`,noFocuses:`还没有候选关注。`,dreamingHint:`每天进行一次确定性复核,检查过期、矛盾证据和得到佐证的候选理解;推断内容不会自动生效。`,mode:`后台复核`,on:`开启并生成待审核项`,off:`关闭`,reviewTime:`每日复核时间`,evidenceThreshold:`所需支持证据数`,scanLimit:`每次最多检查`,lastRun:`最近一次复核`,neverRun:`尚未运行`,runCompleted:`已完成`,runFailed:`失败`,runRunning:`运行中`,runItems:`项`,privacyHint:`选择通用记忆服务如何处理敏感内容;结构化用户理解有独立且更严格的规则。`,sensitivePolicy:`敏感记忆写入`,policyDeny:`不保存`,policyConfirm:`保存前询问`,policyAllow:`相关时允许保存`,privacyWarning:`无论这里如何设置,秘密和受监管内容都不会保存为结构化用户理解。`,error:`无法加载用户上下文。`,retry:`重试`}},J={preference:{en:`Preference`,zh:`偏好`},boundary:{en:`Boundary`,zh:`边界`},relationship:{en:`Relationship`,zh:`关系`},routine:{en:`Routine`,zh:`习惯`},current_state:{en:`Current state`,zh:`当前状态`},long_term_goal:{en:`Long-term goal`,zh:`长期目标`},project_context:{en:`Project context`,zh:`项目背景`},task_lesson:{en:`Task lesson`,zh:`任务经验`},derived_insight:{en:`Insight`,zh:`洞察`}},Y={communication:{en:`Communication`,zh:`沟通`},execution:{en:`Execution`,zh:`执行`},boundary:{en:`Boundary`,zh:`边界`},routine:{en:`Routine`,zh:`习惯`},proactive:{en:`Proactive help`,zh:`主动协助`}};function X(e){let t=(0,U.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,G.jsx)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`,children:n}),t[0]=n,t[1]=r),r}function Z(e){let t=(0,U.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,G.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge px-5 py-10 text-center text-sm text-fg-muted`,children:n}),t[0]=n,t[1]=r),r}function te(e){return JSON.stringify(e)}function ne(e){let t=(0,U.c)(10),[n,r]=(0,W.useState)(e),i;t[0]===e?i=t[1]:(i=te(e),t[0]=e,t[1]=i);let a=(0,W.useRef)(i),o;t[2]===e?o=t[3]:(o=te(e),t[2]=e,t[3]=o);let s=o,c,l;t[4]!==e||t[5]!==s?(c=()=>{if(s===a.current)return;let t=a.current;a.current=s,r(n=>te(n)===t?e:n)},l=[e,s],t[4]=e,t[5]=s,t[6]=c,t[7]=l):(c=t[6],l=t[7]),(0,W.useEffect)(c,l);let u;return t[8]===n?u=t[9]:(u=[n,r],t[8]=n,t[9]=u),u}function re(e){return{callName:e.callName,role:e.role,primaryGoal:e.primaryGoal,pronouns:e.pronouns,timezone:e.timezone,locale:e.locale}}function ie(){let e=(0,U.c)(87),t=o(ce),n=ee[t],[r,a]=i(),c;if(e[0]!==r){let t=r.get(`tab`);c=t&&K.has(t)?t:`profile`,e[0]=r,e[1]=c}else c=e[1];let d=c,f=u(se),p=u(oe),{data:m,error:g,isLoading:_,mutate:y}=s(`/api/you`,I),b;e[2]!==p||e[3]!==f||e[4]!==n.subtitle||e[5]!==n.title?(b=()=>(f({startExtra:null,main:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:n.title}),(0,G.jsx)(`p`,{className:`hidden text-xs text-fg-muted sm:block`,children:n.subtitle})]}),end:null}),p),e[2]=p,e[3]=f,e[4]=n.subtitle,e[5]=n.title,e[6]=b):b=e[6];let x;if(e[7]!==p||e[8]!==f||e[9]!==n?(x=[p,f,n],e[7]=p,e[8]=f,e[9]=n,e[10]=x):x=e[10],(0,W.useEffect)(b,x),_){let t;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsxs)(`div`,{className:`space-y-4 p-4 sm:p-6`,children:[(0,G.jsx)(h,{className:`h-10 w-96 max-w-full`}),(0,G.jsx)(h,{className:`h-72 rounded-2xl`})]}),e[11]=t):t=e[11],t}if(g||!m){let t;e[12]===y?t=e[13]:(t=()=>void y(),e[12]=y,e[13]=t);let r;e[14]!==n.retry||e[15]!==t?(r=(0,G.jsx)(`button`,{className:`text-accent hover:underline`,onClick:t,children:n.retry}),e[14]=n.retry,e[15]=t,e[16]=r):r=e[16];let i;return e[17]!==n.error||e[18]!==r?(i=(0,G.jsx)(`div`,{className:`p-6`,children:(0,G.jsxs)(Z,{children:[n.error,` `,r]})}),e[17]=n.error,e[18]=r,e[19]=i):i=e[19],i}let S=n.title,w;e[20]===a?w=e[21]:(w=e=>a({tab:e}),e[20]=a,e[21]=w);let T;e[22]===n.profile?T=e[23]:(T={id:`profile`,label:n.profile,icon:M},e[22]=n.profile,e[23]=T);let E;e[24]!==m.understandings.length||e[25]!==n.understanding?(E={id:`understanding`,label:n.understanding,icon:F,count:m.understandings.length},e[24]=m.understandings.length,e[25]=n.understanding,e[26]=E):E=e[26];let D=n.collaboration,O;e[27]===m.rules?O=e[28]:(O=m.rules.filter(ae),e[27]=m.rules,e[28]=O);let k;e[29]!==n.collaboration||e[30]!==O.length?(k={id:`collaboration`,label:D,icon:C,count:O.length},e[29]=n.collaboration,e[30]=O.length,e[31]=k):k=e[31];let j;e[32]===n.sources?j=e[33]:(j={id:`sources`,label:n.sources,icon:A},e[32]=n.sources,e[33]=j);let N;e[34]===n.dreaming?N=e[35]:(N={id:`dreaming`,label:n.dreaming,icon:l},e[34]=n.dreaming,e[35]=N);let P;e[36]===n.privacy?P=e[37]:(P={id:`privacy`,label:n.privacy,icon:v},e[36]=n.privacy,e[37]=P);let L;e[38]!==j||e[39]!==N||e[40]!==P||e[41]!==T||e[42]!==E||e[43]!==k?(L=[T,E,k,j,N,P],e[38]=j,e[39]=N,e[40]=P,e[41]=T,e[42]=E,e[43]=k,e[44]=L):L=e[44];let R;e[45]!==n.title||e[46]!==L||e[47]!==w||e[48]!==d?(R=(0,G.jsx)(V,{ariaLabel:S,activeTab:d,onChange:w,items:L}),e[45]=n.title,e[46]=L,e[47]=w,e[48]=d,e[49]=R):R=e[49];let z;e[50]!==m.profile||e[51]!==t||e[52]!==y||e[53]!==n||e[54]!==d?(z=d===`profile`?(0,G.jsx)(Q,{profile:m.profile,language:t,t:n,onChanged:e=>y(t=>t&&{...t,profile:e},{revalidate:!1})}):null,e[50]=m.profile,e[51]=t,e[52]=y,e[53]=n,e[54]=d,e[55]=z):z=e[55];let B;e[56]!==m.quality||e[57]!==m.understandings||e[58]!==t||e[59]!==y||e[60]!==n||e[61]!==d?(B=d===`understanding`?(0,G.jsx)(ue,{items:m.understandings,quality:m.quality,language:t,t:n,onChanged:e=>e?y(t=>t&&{...t,understandings:t.understandings.map(t=>t.id===e.id?e:t)},{revalidate:!0}):y()}):null,e[56]=m.quality,e[57]=m.understandings,e[58]=t,e[59]=y,e[60]=n,e[61]=d,e[62]=B):B=e[62];let H;e[63]!==m.rules||e[64]!==t||e[65]!==y||e[66]!==n||e[67]!==d?(H=d===`collaboration`?(0,G.jsx)(_e,{rules:m.rules,language:t,t:n,onChanged:()=>y()}):null,e[63]=m.rules,e[64]=t,e[65]=y,e[66]=n,e[67]=d,e[68]=H):H=e[68];let q;e[69]!==n||e[70]!==d?(q=d===`sources`?(0,G.jsx)(be,{t:n}):null,e[69]=n,e[70]=d,e[71]=q):q=e[71];let J;e[72]!==m.consolidation?.lastRun||e[73]!==n||e[74]!==d?(J=d===`dreaming`?(0,G.jsx)(xe,{lastRun:m.consolidation?.lastRun??null,t:n}):null,e[72]=m.consolidation?.lastRun,e[73]=n,e[74]=d,e[75]=J):J=e[75];let Y;e[76]!==n||e[77]!==d?(Y=d===`privacy`?(0,G.jsx)(Ce,{t:n}):null,e[76]=n,e[77]=d,e[78]=Y):Y=e[78];let X;return e[79]!==R||e[80]!==z||e[81]!==B||e[82]!==H||e[83]!==q||e[84]!==J||e[85]!==Y?(X=(0,G.jsxs)(`div`,{className:`mx-auto w-full max-w-5xl space-y-5 p-4 sm:p-6`,children:[R,z,B,H,q,J,Y]}),e[79]=R,e[80]=z,e[81]=B,e[82]=H,e[83]=q,e[84]=J,e[85]=Y,e[86]=X):X=e[86],X}function ae(e){return e.status===`active`}function oe(e){return e.clearPageHeader}function se(e){return e.setPageHeader}function ce(e){return e.language}function Q(e){let t=(0,U.c)(78),{profile:n,language:r,t:i,onChanged:a}=e,o;t[0]===n?o=t[1]:(o=re(n),t[0]=n,t[1]=o);let s=o,[c,l]=ne(s),u;t[2]===c?u=t[3]:(u=te(c),t[2]=c,t[3]=u);let d;t[4]===s?d=t[5]:(d=te(s),t[4]=s,t[5]=d);let f=u!==d,p;t[6]!==a||t[7]!==n?(p=async e=>{await a((await L({...e,accessibility:n.accessibility})).profile)},t[6]=a,t[7]=n,t[8]=p):p=t[8];let m;t[9]!==c||t[10]!==f||t[11]!==p?(m={value:c,dirty:f,delayMs:500,onSave:p},t[9]=c,t[10]=f,t[11]=p,t[12]=m):m=t[12];let h=B(m),g;t[13]!==c||t[14]!==l?(g=(e,t,n)=>(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:t}),(0,G.jsx)(`input`,{className:q,placeholder:n,value:c[e],onChange:t=>l(n=>({...n,[e]:t.target.value}))})]}),t[13]=c,t[14]=l,t[15]=g):g=t[15];let _=g,v=h.onBlurCapture,y;t[16]===i.profileHint?y=t[17]:(y=(0,G.jsx)(`p`,{className:`mb-5 text-sm leading-6 text-fg-muted`,children:i.profileHint}),t[16]=i.profileHint,t[17]=y);let b;t[18]!==_||t[19]!==i.callName||t[20]!==i.callNamePlaceholder?(b=_(`callName`,i.callName,i.callNamePlaceholder),t[18]=_,t[19]=i.callName,t[20]=i.callNamePlaceholder,t[21]=b):b=t[21];let x;t[22]!==_||t[23]!==i.role||t[24]!==i.rolePlaceholder?(x=_(`role`,i.role,i.rolePlaceholder),t[22]=_,t[23]=i.role,t[24]=i.rolePlaceholder,t[25]=x):x=t[25];let S;t[26]===i.primaryGoal?S=t[27]:(S=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:i.primaryGoal}),t[26]=i.primaryGoal,t[27]=S);let C;t[28]===l?C=t[29]:(C=e=>l(t=>({...t,primaryGoal:e.target.value})),t[28]=l,t[29]=C);let w;t[30]!==c.primaryGoal||t[31]!==i.primaryGoalPlaceholder||t[32]!==C?(w=(0,G.jsx)(`textarea`,{className:q,rows:3,placeholder:i.primaryGoalPlaceholder,value:c.primaryGoal,onChange:C}),t[30]=c.primaryGoal,t[31]=i.primaryGoalPlaceholder,t[32]=C,t[33]=w):w=t[33];let E;t[34]!==S||t[35]!==w?(E=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm sm:col-span-2`,children:[S,w]}),t[34]=S,t[35]=w,t[36]=E):E=t[36];let D;t[37]!==_||t[38]!==r||t[39]!==i.pronouns||t[40]!==i.pronounsPlaceholder?(D=r===`en`?_(`pronouns`,i.pronouns,i.pronounsPlaceholder):null,t[37]=_,t[38]=r,t[39]=i.pronouns,t[40]=i.pronounsPlaceholder,t[41]=D):D=t[41];let O;t[42]===i.timezone?O=t[43]:(O=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:i.timezone}),t[42]=i.timezone,t[43]=O);let k;t[44]===l?k=t[45]:(k=e=>l(t=>({...t,timezone:e.target.value})),t[44]=l,t[45]=k);let A;t[46]!==c.timezone||t[47]!==k?(A=(0,G.jsx)(`input`,{className:`${q} min-w-0 flex-1`,value:c.timezone,onChange:k}),t[46]=c.timezone,t[47]=k,t[48]=A):A=t[48];let j;t[49]===l?j=t[50]:(j=()=>l(le),t[49]=l,t[50]=j);let M;t[51]!==i.detect||t[52]!==j?(M=(0,G.jsx)(T,{className:`shrink-0 whitespace-nowrap`,onClick:j,children:i.detect}),t[51]=i.detect,t[52]=j,t[53]=M):M=t[53];let N;t[54]!==A||t[55]!==M?(N=(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[A,M]}),t[54]=A,t[55]=M,t[56]=N):N=t[56];let P;t[57]!==O||t[58]!==N?(P=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[O,N]}),t[57]=O,t[58]=N,t[59]=P):P=t[59];let F;t[60]!==_||t[61]!==i.locale?(F=_(`locale`,i.locale),t[60]=_,t[61]=i.locale,t[62]=F):F=t[62];let I;t[63]!==b||t[64]!==x||t[65]!==E||t[66]!==D||t[67]!==P||t[68]!==F?(I=(0,G.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[b,x,E,D,P,F]}),t[63]=b,t[64]=x,t[65]=E,t[66]=D,t[67]=P,t[68]=F,t[69]=I):I=t[69];let R;t[70]!==h.error||t[71]!==h.status?(R=(0,G.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,G.jsx)(z,{status:h.status,error:h.error})}),t[70]=h.error,t[71]=h.status,t[72]=R):R=t[72];let V;return t[73]!==h.onBlurCapture||t[74]!==I||t[75]!==R||t[76]!==y?(V=(0,G.jsx)(X,{children:(0,G.jsxs)(`div`,{onBlurCapture:v,children:[y,I,R]})}),t[73]=h.onBlurCapture,t[74]=I,t[75]=R,t[76]=y,t[77]=V):V=t[77],V}function le(e){return{...e,timezone:c()}}function ue(e){let t=(0,U.c)(54),{items:n,quality:r,language:i,t:a,onChanged:o}=e,[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(``),[f,p]=(0,W.useState)(`preference`),m;t[0]===n?m=t[1]:(m=n.filter(fe),t[0]=n,t[1]=m);let h=m,v;t[2]===n?v=t[3]:(v=n.filter(de),t[2]=n,t[3]=v);let y=v,b;t[4]!==f||t[5]!==o||t[6]!==l?(b=async e=>{e.preventDefault(),l.trim()&&(await _({statement:l,kind:f}),u(``),c(!1),await o())},t[4]=f,t[5]=o,t[6]=l,t[7]=b):b=t[7];let x=b,S;t[8]===a.understoodHint?S=t[9]:(S=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:a.understoodHint}),t[8]=a.understoodHint,t[9]=S);let C,w;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>c(!0),w=(0,G.jsx)(j,{className:`size-4`}),t[10]=C,t[11]=w):(C=t[10],w=t[11]);let E;t[12]===a.addUnderstanding?E=t[13]:(E=(0,G.jsxs)(T,{variant:`primary`,onClick:C,children:[w,a.addUnderstanding]}),t[12]=a.addUnderstanding,t[13]=E);let D;t[14]!==S||t[15]!==E?(D=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[S,E]}),t[14]=S,t[15]=E,t[16]=D):D=t[16];let O;t[17]!==r||t[18]!==a?(O=(0,G.jsx)(pe,{quality:r,t:a}),t[17]=r,t[18]=a,t[19]=O):O=t[19];let k;t[20]===a?k=t[21]:(k=(0,G.jsx)(he,{t:a}),t[20]=a,t[21]=k);let A;t[22]!==s||t[23]!==f||t[24]!==i||t[25]!==l||t[26]!==x||t[27]!==a.add||t[28]!==a.cancel||t[29]!==a.statement?(A=s?(0,G.jsx)(X,{children:(0,G.jsxs)(`form`,{className:`space-y-3`,onSubmit:x,children:[(0,G.jsx)(`textarea`,{autoFocus:!0,className:q,rows:3,placeholder:a.statement,value:l,onChange:e=>u(e.target.value)}),(0,G.jsx)(d,{value:f,onChange:e=>p(e.target.value),children:Object.entries(J).map(e=>{let[t,n]=e;return(0,G.jsx)(g,{value:t,children:n[i]},t)})}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(T,{type:`submit`,variant:`primary`,children:a.add}),(0,G.jsx)(T,{onClick:()=>c(!1),children:a.cancel})]})]})}):null,t[22]=s,t[23]=f,t[24]=i,t[25]=l,t[26]=x,t[27]=a.add,t[28]=a.cancel,t[29]=a.statement,t[30]=A):A=t[30];let M;t[31]!==i||t[32]!==o||t[33]!==y||t[34]!==a?(M=y.length?(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[a.review,` · `,y.length]}),y.map(e=>(0,G.jsx)($,{item:e,language:i,t:a,onChanged:o},e.id))]}):null,t[31]=i,t[32]=o,t[33]=y,t[34]=a,t[35]=M):M=t[35];let N;t[36]!==h.length||t[37]!==a.active?(N=(0,G.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[a.active,` · `,h.length]}),t[36]=h.length,t[37]=a.active,t[38]=N):N=t[38];let P;t[39]!==h||t[40]!==i||t[41]!==o||t[42]!==a?(P=h.length?h.map(e=>(0,G.jsx)($,{item:e,language:i,t:a,onChanged:o},e.id)):(0,G.jsx)(Z,{children:a.emptyUnderstanding}),t[39]=h,t[40]=i,t[41]=o,t[42]=a,t[43]=P):P=t[43];let F;t[44]!==N||t[45]!==P?(F=(0,G.jsxs)(`section`,{className:`space-y-3`,children:[N,P]}),t[44]=N,t[45]=P,t[46]=F):F=t[46];let I;return t[47]!==k||t[48]!==A||t[49]!==M||t[50]!==F||t[51]!==D||t[52]!==O?(I=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[D,O,k,A,M,F]}),t[47]=k,t[48]=A,t[49]=M,t[50]=F,t[51]=D,t[52]=O,t[53]=I):I=t[53],I}function de(e){return[`candidate`,`needs_review`,`stale`].includes(e.status)}function fe(e){return e.status===`active`}function pe(e){let t=(0,U.c)(32),{quality:n,t:r}=e,i;t[0]===r.qualityNoData?i=t[1]:(i=e=>e==null?r.qualityNoData:`${Math.round(e*100)}%`,t[0]=r.qualityNoData,t[1]=i);let a=i,o=r.qualityActive,s=String(n.records.active),c;t[2]!==r.qualityActive||t[3]!==s?(c=[o,s],t[2]=r.qualityActive,t[3]=s,t[4]=c):c=t[4];let l=r.qualityPending,u=String(n.records.candidate+n.records.needsReview),d;t[5]!==r.qualityPending||t[6]!==u?(d=[l,u],t[5]=r.qualityPending,t[6]=u,t[7]=d):d=t[7];let f=r.qualityAcceptance,p;t[8]!==n.decisions.acceptanceRate||t[9]!==a?(p=a(n.decisions.acceptanceRate),t[8]=n.decisions.acceptanceRate,t[9]=a,t[10]=p):p=t[10];let m;t[11]!==r.qualityAcceptance||t[12]!==p?(m=[f,p],t[11]=r.qualityAcceptance,t[12]=p,t[13]=m):m=t[13];let h=r.qualityRecall,g;t[14]!==n.recall.helpfulRate||t[15]!==a?(g=a(n.recall.helpfulRate),t[14]=n.recall.helpfulRate,t[15]=a,t[16]=g):g=t[16];let _;t[17]!==r.qualityRecall||t[18]!==g?(_=[h,g],t[17]=r.qualityRecall,t[18]=g,t[19]=_):_=t[19];let v;t[20]!==m||t[21]!==_||t[22]!==c||t[23]!==d?(v=[c,d,m,_],t[20]=m,t[21]=_,t[22]=c,t[23]=d,t[24]=v):v=t[24];let y=v,b;t[25]===r.qualityTitle?b=t[26]:(b=(0,G.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:r.qualityTitle}),t[25]=r.qualityTitle,t[26]=b);let x;t[27]===y?x=t[28]:(x=(0,G.jsx)(`div`,{className:`mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4`,children:y.map(me)}),t[27]=y,t[28]=x);let S;return t[29]!==b||t[30]!==x?(S=(0,G.jsxs)(X,{children:[b,x]}),t[29]=b,t[30]=x,t[31]=S):S=t[31],S}function me(e){let[t,n]=e;return(0,G.jsxs)(`div`,{className:`rounded-xl bg-surface-muted px-3 py-2.5`,children:[(0,G.jsx)(`p`,{className:`text-[11px] text-fg-subtle`,children:t}),(0,G.jsx)(`p`,{className:`mt-1 text-sm font-semibold text-fg`,children:n})]},t)}function $(e){let t=(0,U.c)(57),{item:n,language:r,t:i,onChanged:a}=e,[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(!1),[u,d]=ne(n.statement),p=u!==n.statement,h;t[0]===i.required?h=t[1]:(h=e=>e.trim()?null:i.required,t[0]=i.required,t[1]=h);let g;t[2]!==n.id||t[3]!==a?(g=async e=>{await a((await P(n.id,{statement:e})).understanding)},t[2]=n.id,t[3]=a,t[4]=g):g=t[4];let _;t[5]!==u||t[6]!==o||t[7]!==p||t[8]!==h||t[9]!==g?(_={value:u,dirty:p,enabled:o,delayMs:500,validate:h,onSave:g},t[5]=u,t[6]=o,t[7]=p,t[8]=h,t[9]=g,t[10]=_):_=t[10];let v=B(_),y=J[n.kind][r],b;t[11]===y?b=t[12]:(b=(0,G.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:y}),t[11]=y,t[12]=b);let x=n.explicitness===`explicit`?i.sourceExplicit:n.explicitness===`observed`?i.sourceObserved:i.sourceInferred,S;t[13]===x?S=t[14]:(S=(0,G.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:x}),t[13]=x,t[14]=S);let C;t[15]!==b||t[16]!==S?(C=(0,G.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[b,S]}),t[15]=b,t[16]=S,t[17]=C):C=t[17];let w;t[18]!==u||t[19]!==o||t[20]!==d?(w=o?(0,G.jsx)(`textarea`,{autoFocus:!0,className:q,value:u,onChange:e=>d(e.target.value),rows:3}):(0,G.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:u}),t[18]=u,t[19]=o,t[20]=d,t[21]=w):w=t[21];let E;t[22]!==w||t[23]!==C?(E=(0,G.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[C,w]})}),t[22]=w,t[23]=C,t[24]=E):E=t[24];let D;t[25]!==v||t[26]!==o||t[27]!==i.done||t[28]!==i.edit?(D=o?(0,G.jsx)(T,{variant:`ghost`,onClick:()=>{v.flush(),s(!1)},children:i.done}):(0,G.jsxs)(T,{variant:`ghost`,onClick:()=>s(!0),children:[(0,G.jsx)(R,{className:`size-3.5`}),i.edit]}),t[25]=v,t[26]=o,t[27]=i.done,t[28]=i.edit,t[29]=D):D=t[29];let O;t[30]!==n.id||t[31]!==n.status||t[32]!==a||t[33]!==i.confirm||t[34]!==i.reject?(O=n.status===`active`?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(T,{variant:`primary`,onClick:async()=>{await a((await P(n.id,{status:`active`})).understanding)},children:i.confirm}),(0,G.jsx)(T,{onClick:async()=>{await a((await P(n.id,{status:`rejected`})).understanding)},children:i.reject})]}),t[30]=n.id,t[31]=n.status,t[32]=a,t[33]=i.confirm,t[34]=i.reject,t[35]=O):O=t[35];let k;t[36]!==c||t[37]!==n.id||t[38]!==a?(k=async()=>{if(!c){l(!0);return}await m(n.id),l(!1),await a()},t[36]=c,t[37]=n.id,t[38]=a,t[39]=k):k=t[39];let A;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,G.jsx)(f,{className:`size-3.5`}),t[40]=A):A=t[40];let j=c?i.confirmDelete:i.delete,M;t[41]!==k||t[42]!==j?(M=(0,G.jsxs)(T,{variant:`ghost`,className:`text-danger`,onClick:k,children:[A,j]}),t[41]=k,t[42]=j,t[43]=M):M=t[43];let N;t[44]!==v.error||t[45]!==v.status||t[46]!==o?(N=o||v.status!==`idle`?(0,G.jsx)(z,{className:`ml-auto`,status:v.status,error:v.error}):null,t[44]=v.error,t[45]=v.status,t[46]=o,t[47]=N):N=t[47];let F;t[48]!==D||t[49]!==O||t[50]!==M||t[51]!==N?(F=(0,G.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[D,O,M,N]}),t[48]=D,t[49]=O,t[50]=M,t[51]=N,t[52]=F):F=t[52];let I;return t[53]!==v.onBlurCapture||t[54]!==E||t[55]!==F?(I=(0,G.jsx)(X,{children:(0,G.jsxs)(`div`,{onBlurCapture:v.onBlurCapture,children:[E,F]})}),t[53]=v.onBlurCapture,t[54]=E,t[55]=F,t[56]=I):I=t[56],I}function he(e){let t=(0,U.c)(20),{t:n}=e,{data:r,error:i,isLoading:a,mutate:o}=s(`you-focuses`,N);if(a){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(h,{className:`h-40 rounded-2xl`}),t[0]=e):e=t[0],e}if(i){let e;return t[1]===n.error?e=t[2]:(e=(0,G.jsx)(Z,{children:n.error}),t[1]=n.error,t[2]=e),e}let c;if(t[3]!==r||t[4]!==o||t[5]!==n.activate||t[6]!==n.complete||t[7]!==n.focusHint||t[8]!==n.focuses||t[9]!==n.noFocuses||t[10]!==n.pause||t[11]!==n.reject){let e=(r??[]).filter(ge),i;t[13]===n.focuses?i=t[14]:(i=(0,G.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.focuses}),t[13]=n.focuses,t[14]=i);let a;t[15]===n.focusHint?a=t[16]:(a=(0,G.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.focusHint}),t[15]=n.focusHint,t[16]=a);let s;t[17]!==i||t[18]!==a?(s=(0,G.jsxs)(`div`,{children:[i,a]}),t[17]=i,t[18]=a,t[19]=s):s=t[19],c=(0,G.jsxs)(`section`,{className:`space-y-3`,children:[s,e.length?e.map(e=>(0,G.jsxs)(X,{children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e.title}),(0,G.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] text-fg-muted`,children:e.status})]}),(0,G.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:e.summary})]}),(0,G.jsxs)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:[Math.round(e.confidence*100),`%`]})]}),(0,G.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[e.status===`active`?(0,G.jsx)(T,{onClick:async()=>{await D(e.id,`paused`),await o()},children:n.pause}):(0,G.jsx)(T,{variant:`primary`,onClick:async()=>{await D(e.id,`active`),await o()},children:n.activate}),(0,G.jsx)(T,{variant:`ghost`,onClick:async()=>{await D(e.id,`completed`),await o()},children:n.complete}),e.status===`candidate`?(0,G.jsx)(T,{variant:`ghost`,className:`text-danger`,onClick:async()=>{await D(e.id,`rejected`),await o()},children:n.reject}):null]})]},e.id)):(0,G.jsx)(Z,{children:n.noFocuses})]}),t[3]=r,t[4]=o,t[5]=n.activate,t[6]=n.complete,t[7]=n.focusHint,t[8]=n.focuses,t[9]=n.noFocuses,t[10]=n.pause,t[11]=n.reject,t[12]=c}else c=t[12];return c}function ge(e){return e.status!==`rejected`}function _e(e){let t=(0,U.c)(36),{rules:n,language:r,t:i,onChanged:a}=e,[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(``),[u,p]=(0,W.useState)(`communication`),[m,h]=(0,W.useState)(null),_;t[0]!==u||t[1]!==a||t[2]!==c?(_=async e=>{e.preventDefault(),c.trim()&&(await y({statement:c,category:u}),l(``),s(!1),await a())},t[0]=u,t[1]=a,t[2]=c,t[3]=_):_=t[3];let v=_,x;t[4]===i.rulesHint?x=t[5]:(x=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:i.rulesHint}),t[4]=i.rulesHint,t[5]=x);let S,C;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>s(!0),C=(0,G.jsx)(j,{className:`size-4`}),t[6]=S,t[7]=C):(S=t[6],C=t[7]);let w;t[8]===i.addRule?w=t[9]:(w=(0,G.jsxs)(T,{variant:`primary`,onClick:S,children:[C,i.addRule]}),t[8]=i.addRule,t[9]=w);let E;t[10]!==x||t[11]!==w?(E=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[x,w]}),t[10]=x,t[11]=w,t[12]=E):E=t[12];let D;t[13]!==o||t[14]!==u||t[15]!==r||t[16]!==c||t[17]!==v||t[18]!==i.add||t[19]!==i.cancel||t[20]!==i.ruleStatement?(D=o?(0,G.jsx)(X,{children:(0,G.jsxs)(`form`,{className:`space-y-3`,onSubmit:v,children:[(0,G.jsx)(`textarea`,{autoFocus:!0,className:q,rows:3,placeholder:i.ruleStatement,value:c,onChange:e=>l(e.target.value)}),(0,G.jsx)(d,{value:u,onChange:e=>p(e.target.value),children:Object.entries(Y).map(e=>{let[t,n]=e;return(0,G.jsx)(g,{value:t,children:n[r]},t)})}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(T,{type:`submit`,variant:`primary`,children:i.add}),(0,G.jsx)(T,{onClick:()=>s(!1),children:i.cancel})]})]})}):null,t[13]=o,t[14]=u,t[15]=r,t[16]=c,t[17]=v,t[18]=i.add,t[19]=i.cancel,t[20]=i.ruleStatement,t[21]=D):D=t[21];let O;t[22]!==m||t[23]!==r||t[24]!==a||t[25]!==n||t[26]!==i.confirmDelete||t[27]!==i.delete||t[28]!==i.disable||t[29]!==i.emptyRules||t[30]!==i.enable?(O=n.length?n.filter(ve).map(e=>(0,G.jsxs)(X,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:Y[e.category][r]}),(0,G.jsx)(`p`,{className:`mt-3 text-sm leading-6 ${e.status===`disabled`?`text-fg-subtle line-through`:`text-fg`}`,children:e.statement})]}),(0,G.jsxs)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:[`P`,e.priority]})]}),(0,G.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,G.jsx)(T,{variant:`ghost`,onClick:async()=>{await k(e.id,{status:e.status===`active`?`disabled`:`active`}),await a()},children:e.status===`active`?i.disable:i.enable}),(0,G.jsxs)(T,{variant:`ghost`,className:`text-danger`,onClick:async()=>{if(m!==e.id){h(e.id);return}await b(e.id),h(null),await a()},children:[(0,G.jsx)(f,{className:`size-3.5`}),m===e.id?i.confirmDelete:i.delete]})]})]},e.id)):(0,G.jsx)(Z,{children:i.emptyRules}),t[22]=m,t[23]=r,t[24]=a,t[25]=n,t[26]=i.confirmDelete,t[27]=i.delete,t[28]=i.disable,t[29]=i.emptyRules,t[30]=i.enable,t[31]=O):O=t[31];let A;return t[32]!==E||t[33]!==D||t[34]!==O?(A=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[E,D,O]}),t[32]=E,t[33]=D,t[34]=O,t[35]=A):A=t[35],A}function ve(e){return e.status!==`archived`}async function ye(){let[e,t]=await Promise.all([w(),H()]);return{grants:e,connectors:t}}function be(e){let t=(0,U.c)(39),{t:n}=e,{data:r,error:i,isLoading:o,mutate:c}=s(`you-understanding-sources`,ye);if(o){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(h,{className:`h-64 rounded-2xl`}),t[0]=e):e=t[0],e}if(i){let e;t[1]===c?e=t[2]:(e=()=>void c(),t[1]=c,t[2]=e);let r;t[3]!==n.retry||t[4]!==e?(r=(0,G.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:n.retry}),t[3]=n.retry,t[4]=e,t[5]=r):r=t[5];let i;return t[6]!==n.error||t[7]!==r?(i=(0,G.jsxs)(Z,{children:[n.error,` `,r]}),t[6]=n.error,t[7]=r,t[8]=i):i=t[8],i}let l;t[9]===r?.grants?l=t[10]:(l=r?.grants??[],t[9]=r?.grants,t[10]=l);let u=l,d;t[11]===r?.connectors?d=t[12]:(d=r?.connectors??[],t[11]=r?.connectors,t[12]=d);let f=d,m;t[13]===n.sourcesHint?m=t[14]:(m=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:n.sourcesHint}),t[13]=n.sourcesHint,t[14]=m);let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,G.jsx)(p,{className:`size-4`}),t[15]=g):g=t[15];let _;t[16]===n.manageSources?_=t[17]:(_=(0,G.jsx)(T,{asChild:!0,variant:`primary`,children:(0,G.jsxs)(a,{to:`/connectors?understanding=1&returnTo=%2Fyou%3Ftab%3Dsources`,children:[n.manageSources,g]})}),t[16]=n.manageSources,t[17]=_);let v;t[18]!==m||t[19]!==_?(v=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[m,_]}),t[18]=m,t[19]=_,t[20]=v):v=t[20];let y;t[21]!==u||t[22]!==c||t[23]!==n.continuous||t[24]!==n.derivedOnly||t[25]!==n.localOnly||t[26]!==n.noSources||t[27]!==n.once||t[28]!==n.refresh||t[29]!==n.revoke?(y=u.length?(0,G.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:u.map(e=>(0,G.jsx)(X,{children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,G.jsxs)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:[e.accessMode===`continuous`?n.continuous:n.once,` · `,e.processingPolicy===`local_only`?n.localOnly:e.retentionPolicy===`derived_only`?n.derivedOnly:e.retentionPolicy]}),e.lastCollectedAt?(0,G.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:new Date(e.lastCollectedAt).toLocaleString()}):null]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:[e.accessMode===`continuous`?(0,G.jsx)(T,{variant:`ghost`,onClick:async()=>{await E(e.id),await c()},children:n.refresh}):null,(0,G.jsx)(T,{variant:`ghost`,className:`text-danger`,onClick:async()=>{await x(e.id),await c()},children:n.revoke})]})]})},e.id))}):(0,G.jsx)(Z,{children:n.noSources}),t[21]=u,t[22]=c,t[23]=n.continuous,t[24]=n.derivedOnly,t[25]=n.localOnly,t[26]=n.noSources,t[27]=n.once,t[28]=n.refresh,t[29]=n.revoke,t[30]=y):y=t[30];let b;t[31]!==f||t[32]!==n.connected||t[33]!==n.unavailable?(b=f.length?(0,G.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:f.map(e=>{let t=e.enabled&&(e.status===`connected`||e.connectionStatus===`connected`||e.authStatus===`connected`);return(0,G.jsx)(X,{children:(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,G.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:e.connectorId})]}),(0,G.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-1 text-xs ${t?`bg-success-soft text-success`:`bg-warning-soft text-warning`}`,children:t?n.connected:n.unavailable})]})},e.instanceId)})}):null,t[31]=f,t[32]=n.connected,t[33]=n.unavailable,t[34]=b):b=t[34];let S;return t[35]!==v||t[36]!==y||t[37]!==b?(S=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[v,y,b]}),t[35]=v,t[36]=y,t[37]=b,t[38]=S):S=t[38],S}function xe(e){let t=(0,U.c)(112),{lastRun:n,t:r}=e,{data:i,error:a,isLoading:o,mutate:l}=s(`you-context-settings`,O),u=i?.dreaming??null,[f,p]=ne(u),m;t[0]!==f||t[1]!==u?(m=f&&u&&te(f)!==te(u),t[0]=f,t[1]=u,t[2]=m):m=t[2];let _=!!m,v;t[3]===l?v=t[4]:(v=async e=>{await S({dreaming:e}),await l()},t[3]=l,t[4]=v);let y;t[5]!==f||t[6]!==_||t[7]!==v?(y={value:f,dirty:_,delayMs:500,onSave:v},t[5]=f,t[6]=_,t[7]=v,t[8]=y):y=t[8];let b=B(y);if(a){let e;t[9]===l?e=t[10]:(e=()=>void l(),t[9]=l,t[10]=e);let n;t[11]!==r.retry||t[12]!==e?(n=(0,G.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:r.retry}),t[11]=r.retry,t[12]=e,t[13]=n):n=t[13];let i;return t[14]!==r.error||t[15]!==n?(i=(0,G.jsxs)(Z,{children:[r.error,` `,n]}),t[14]=r.error,t[15]=n,t[16]=i):i=t[16],i}if(o||!f){let e;return t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(h,{className:`h-72 rounded-2xl`}),t[17]=e):e=t[17],e}let x=n?.status===`completed`?r.runCompleted:n?.status===`failed`?r.runFailed:r.runRunning,C;t[18]===r.dreamingHint?C=t[19]:(C=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:r.dreamingHint}),t[18]=r.dreamingHint,t[19]=C);let w=b.onBlurCapture,E;t[20]===r.mode?E=t[21]:(E=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.mode}),t[20]=r.mode,t[21]=E);let D;t[22]===p?D=t[23]:(D=e=>p(t=>t&&{...t,mode:e.target.value}),t[22]=p,t[23]=D);let k;t[24]===r.on?k=t[25]:(k=(0,G.jsx)(g,{value:`review`,children:r.on}),t[24]=r.on,t[25]=k);let A;t[26]===r.off?A=t[27]:(A=(0,G.jsx)(g,{value:`off`,children:r.off}),t[26]=r.off,t[27]=A);let j;t[28]!==f.mode||t[29]!==A||t[30]!==D||t[31]!==k?(j=(0,G.jsxs)(d,{value:f.mode,onChange:D,children:[k,A]}),t[28]=f.mode,t[29]=A,t[30]=D,t[31]=k,t[32]=j):j=t[32];let M;t[33]!==j||t[34]!==E?(M=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[E,j]}),t[33]=j,t[34]=E,t[35]=M):M=t[35];let N;t[36]===r.reviewTime?N=t[37]:(N=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.reviewTime}),t[36]=r.reviewTime,t[37]=N);let P;t[38]===p?P=t[39]:(P=e=>p(t=>t&&{...t,schedule:{time:e.target.value}}),t[38]=p,t[39]=P);let F;t[40]!==f.schedule.time||t[41]!==P?(F=(0,G.jsx)(`input`,{type:`time`,className:q,value:f.schedule.time,onChange:P}),t[40]=f.schedule.time,t[41]=P,t[42]=F):F=t[42];let I;t[43]!==N||t[44]!==F?(I=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[N,F]}),t[43]=N,t[44]=F,t[45]=I):I=t[45];let L;t[46]===r.timezone?L=t[47]:(L=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.timezone}),t[46]=r.timezone,t[47]=L);let R=f.timezone??``,V;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(V=c(),t[48]=V):V=t[48];let H;t[49]===p?H=t[50]:(H=e=>p(t=>t&&{...t,timezone:e.target.value||void 0}),t[49]=p,t[50]=H);let W;t[51]!==R||t[52]!==H?(W=(0,G.jsx)(`input`,{className:`${q} min-w-0 flex-1`,value:R,placeholder:V,onChange:H}),t[51]=R,t[52]=H,t[53]=W):W=t[53];let K;t[54]===p?K=t[55]:(K=()=>p(Se),t[54]=p,t[55]=K);let ee;t[56]!==r.detect||t[57]!==K?(ee=(0,G.jsx)(T,{className:`shrink-0 whitespace-nowrap`,onClick:K,children:r.detect}),t[56]=r.detect,t[57]=K,t[58]=ee):ee=t[58];let J;t[59]!==W||t[60]!==ee?(J=(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[W,ee]}),t[59]=W,t[60]=ee,t[61]=J):J=t[61];let Y;t[62]!==L||t[63]!==J?(Y=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm sm:col-span-2`,children:[L,J]}),t[62]=L,t[63]=J,t[64]=Y):Y=t[64];let re;t[65]===r.evidenceThreshold?re=t[66]:(re=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.evidenceThreshold}),t[65]=r.evidenceThreshold,t[66]=re);let ie;t[67]===p?ie=t[68]:(ie=e=>p(t=>t&&{...t,minEvidenceSources:Number(e.target.value)}),t[67]=p,t[68]=ie);let ae;t[69]!==f.minEvidenceSources||t[70]!==ie?(ae=(0,G.jsx)(`input`,{type:`number`,min:2,max:10,className:q,value:f.minEvidenceSources,onChange:ie}),t[69]=f.minEvidenceSources,t[70]=ie,t[71]=ae):ae=t[71];let oe;t[72]!==re||t[73]!==ae?(oe=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[re,ae]}),t[72]=re,t[73]=ae,t[74]=oe):oe=t[74];let se;t[75]===r.scanLimit?se=t[76]:(se=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.scanLimit}),t[75]=r.scanLimit,t[76]=se);let ce;t[77]===p?ce=t[78]:(ce=e=>p(t=>t&&{...t,limit:Number(e.target.value)}),t[77]=p,t[78]=ce);let Q;t[79]!==f.limit||t[80]!==ce?(Q=(0,G.jsx)(`input`,{type:`number`,min:1,max:2e3,className:q,value:f.limit,onChange:ce}),t[79]=f.limit,t[80]=ce,t[81]=Q):Q=t[81];let le;t[82]!==se||t[83]!==Q?(le=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[se,Q]}),t[82]=se,t[83]=Q,t[84]=le):le=t[84];let ue;t[85]!==M||t[86]!==I||t[87]!==Y||t[88]!==oe||t[89]!==le?(ue=(0,G.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[M,I,Y,oe,le]}),t[85]=M,t[86]=I,t[87]=Y,t[88]=oe,t[89]=le,t[90]=ue):ue=t[90];let de;t[91]!==b.error||t[92]!==b.status?(de=(0,G.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,G.jsx)(z,{status:b.status,error:b.error})}),t[91]=b.error,t[92]=b.status,t[93]=de):de=t[93];let fe;t[94]!==b.onBlurCapture||t[95]!==ue||t[96]!==de?(fe=(0,G.jsx)(X,{children:(0,G.jsxs)(`div`,{onBlurCapture:w,children:[ue,de]})}),t[94]=b.onBlurCapture,t[95]=ue,t[96]=de,t[97]=fe):fe=t[97];let pe;t[98]===r.lastRun?pe=t[99]:(pe=(0,G.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.lastRun}),t[98]=r.lastRun,t[99]=pe);let me;t[100]!==n||t[101]!==x||t[102]!==r.neverRun||t[103]!==r.runItems?(me=n?(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-sm text-fg-muted`,children:[(0,G.jsx)(`span`,{children:x}),(0,G.jsx)(`span`,{children:`·`}),(0,G.jsx)(`time`,{children:new Date(n.startedAt).toLocaleString()}),typeof n.metrics.scanned==`number`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:`·`}),(0,G.jsxs)(`span`,{children:[String(n.metrics.scanned),` `,r.runItems]})]}):null]}):(0,G.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:r.neverRun}),t[100]=n,t[101]=x,t[102]=r.neverRun,t[103]=r.runItems,t[104]=me):me=t[104];let $;t[105]!==pe||t[106]!==me?($=(0,G.jsxs)(X,{children:[pe,me]}),t[105]=pe,t[106]=me,t[107]=$):$=t[107];let he;return t[108]!==fe||t[109]!==$||t[110]!==C?(he=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[C,fe,$]}),t[108]=fe,t[109]=$,t[110]=C,t[111]=he):he=t[111],he}function Se(e){return e&&{...e,timezone:c()}}function Ce(e){let t=(0,U.c)(49),{t:n}=e,{data:r,error:i,isLoading:a,mutate:o}=s(`you-context-settings`,O),c=r?.privacy.sensitiveWritePolicy??null,[l,u]=ne(c),f=!!(l&&c&&l!==c),p;t[0]===o?p=t[1]:(p=async e=>{await S({privacy:{sensitiveWritePolicy:e}}),await o()},t[0]=o,t[1]=p);let m;t[2]!==l||t[3]!==f||t[4]!==p?(m={value:l,dirty:f,delayMs:350,onSave:p},t[2]=l,t[3]=f,t[4]=p,t[5]=m):m=t[5];let _=B(m);if(i){let e;t[6]===o?e=t[7]:(e=()=>void o(),t[6]=o,t[7]=e);let r;t[8]!==n.retry||t[9]!==e?(r=(0,G.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:n.retry}),t[8]=n.retry,t[9]=e,t[10]=r):r=t[10];let i;return t[11]!==n.error||t[12]!==r?(i=(0,G.jsxs)(Z,{children:[n.error,` `,r]}),t[11]=n.error,t[12]=r,t[13]=i):i=t[13],i}if(a||!l){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(h,{className:`h-56 rounded-2xl`}),t[14]=e):e=t[14],e}let v;t[15]===n.privacyHint?v=t[16]:(v=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:n.privacyHint}),t[15]=n.privacyHint,t[16]=v);let y;t[17]===n.sensitivePolicy?y=t[18]:(y=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:n.sensitivePolicy}),t[17]=n.sensitivePolicy,t[18]=y);let b;t[19]===u?b=t[20]:(b=e=>u(e.target.value),t[19]=u,t[20]=b);let x;t[21]===n.policyDeny?x=t[22]:(x=(0,G.jsx)(g,{value:`deny`,children:n.policyDeny}),t[21]=n.policyDeny,t[22]=x);let C;t[23]===n.policyConfirm?C=t[24]:(C=(0,G.jsx)(g,{value:`confirm`,children:n.policyConfirm}),t[23]=n.policyConfirm,t[24]=C);let w;t[25]===n.policyAllow?w=t[26]:(w=(0,G.jsx)(g,{value:`allow`,children:n.policyAllow}),t[25]=n.policyAllow,t[26]=w);let T;t[27]!==l||t[28]!==b||t[29]!==x||t[30]!==C||t[31]!==w?(T=(0,G.jsxs)(d,{value:l,onChange:b,children:[x,C,w]}),t[27]=l,t[28]=b,t[29]=x,t[30]=C,t[31]=w,t[32]=T):T=t[32];let E;t[33]!==T||t[34]!==y?(E=(0,G.jsxs)(`label`,{className:`block max-w-xl space-y-1.5 text-sm`,children:[y,T]}),t[33]=T,t[34]=y,t[35]=E):E=t[35];let D;t[36]===n.privacyWarning?D=t[37]:(D=(0,G.jsx)(`p`,{className:`mt-3 max-w-2xl text-xs leading-5 text-fg-subtle`,children:n.privacyWarning}),t[36]=n.privacyWarning,t[37]=D);let k;t[38]!==_.error||t[39]!==_.status?(k=(0,G.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,G.jsx)(z,{status:_.status,error:_.error})}),t[38]=_.error,t[39]=_.status,t[40]=k):k=t[40];let A;t[41]!==_.onBlurCapture||t[42]!==E||t[43]!==D||t[44]!==k?(A=(0,G.jsx)(X,{children:(0,G.jsxs)(`div`,{onBlurCapture:_.onBlurCapture,children:[E,D,k]})}),t[41]=_.onBlurCapture,t[42]=E,t[43]=D,t[44]=k,t[45]=A):A=t[45];let j;return t[46]!==A||t[47]!==v?(j=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[v,A]}),t[46]=A,t[47]=v,t[48]=j):j=t[48],j}export{ie as UserContextPage};
|