@inkeep/open-knowledge 0.53.0-beta.0 → 0.53.0-beta.1
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/{acp-harness-probe-DvXLWBwm.mjs → acp-harness-probe-s3CqzCCO.mjs} +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/config-schema.json +12 -3
- package/dist/config.project-local.schema.json +1 -1
- package/dist/config.project.schema.json +11 -2
- package/dist/constants-LXoEgYJe.mjs +2 -0
- package/dist/{fs-traced-DV9uD41t.mjs → fs-traced-CBFyXjv8.mjs} +2 -2
- package/dist/fs-traced-CChInc-O.mjs +1 -0
- package/dist/{git-handle-VuHcNtS4.mjs → git-handle-CjkVOyU7.mjs} +2 -2
- package/dist/git-handle-OIwLbjAT.mjs +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +91 -91
- package/dist/{init-ja0T-etx.mjs → init-BSKAqmkk.mjs} +3 -3
- package/dist/init-D6zgpP-Z.mjs +1 -0
- package/dist/{launch-json-removal-DaMY_ELf.mjs → launch-json-removal-DS4Iihpf.mjs} +2 -2
- package/dist/{loader-CZJtDyW1.mjs → loader-BTTXRFLw.mjs} +2 -2
- package/dist/loader-CVvRSwYS.mjs +1 -0
- package/dist/md-manager-C2pyfP1M.mjs +2 -0
- package/dist/{open-browser-BfbWvPXH.mjs → open-browser-RpCPdtF_.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-CCsYKQw8.mjs +1 -0
- package/dist/{preview-DZFeEN5M.mjs → preview-DwoADdoO.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-BMqdsZEQ.js → ActivityModeContent-BVNDha83.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-D_ubtipg.js → AgentDiffPane-tc3vpwY_.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-B7pwGsKU.js → AgentThreadClientBinder-CSCbo226.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-4TgQdQOf.js → ChangedOutsideBadge-DrITuwxs.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-CjgqNZXo.js → CodeMirrorPropInput-CCoKlaSP.js} +1 -1
- package/dist/public/assets/{DocumentContext-tOm4SkOp.js → DocumentContext-BrnqRC7f.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-CFFhQhHA.js → EditorModeToggle-tYJlAm15.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-BiThAkoH.js → EnableSyncConfirmDialog-BpR4lOGV.js} +1 -1
- package/dist/public/assets/FeedbackForm-B26S-tMj.js +1 -0
- package/dist/public/assets/{GraphPanel-CsRKre3D.js → GraphPanel-BBDNp1Lu.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-DcZoBHf-.js → ImportSkillDialog-BHURtwXV.js} +1 -1
- package/dist/public/assets/{LintConfigEditor--yFdaWpg.js → LintConfigEditor-B1_9NfyV.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BxCiEKqW.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-CIVfnd15.js → ManagedArtifactProperties-XetEd70v.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-DEhSeOSg.js → McpConsentDialogBody-BMcFiOpb.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-civq6mkL.js → MermaidDocEditor-2uKE8dRs.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-DO7eotFd.js → ReportBugDialogBody-CokSHlbL.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-NxaI-Jdd.js → SchemaConfigEditor-m3x_uxwj.js} +1 -1
- package/dist/public/assets/{SessionsHost-PjSsebux.js → SessionsHost-BwjsJ4kM.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-BNYz-D4X.js → SettingsDialogBody-NnXMegDb.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-B7Bl6qR0.js → ShareBranchSwitchDialog-DGpxR8rv.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-BmMkjWTr.js → ShareReceiveDialog-DmLaRlCo.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-R20sy2ia.js → ShareReceiveMissDialog-eWc73H2u.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-B2U7UdOB.js → SkillEditBanner-Bcj_SsXK.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-B3wOLT3t.js → SkillOriginInline-D59WrmB9.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-B_RJpm5V.js → SkillToolbarControls-CF4GI3N4.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-56-P71vE.js → SlidesToolbarControls-pic8RAQO.js} +1 -1
- package/dist/public/assets/{SourceEditor-BW7yuIvG.js → SourceEditor-D4_TDrJh.js} +1 -1
- package/dist/public/assets/{TerminalPanel-Clr6j-jo.js → TerminalPanel-XbiaeXBm.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-DRbYHuvS.js → TerminalWindowApp-ptqnI_mm.js} +1 -1
- package/dist/public/assets/{TextDocEditor-Bwwrrcn5.js → TextDocEditor-BjbQZtTc.js} +1 -1
- package/dist/public/assets/{ThreadView-BA7gxPI6.js → ThreadView-CdeJaSQw.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-CTJnk9me.js → TimelineDiffPane-BbiOEtH2.js} +1 -1
- package/dist/public/assets/{agent-diff-store-BvxTke2d.js → agent-diff-store-BDOTYRUw.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DrAhOPTB.js → auth-state-cache-BvGXSOYb.js} +1 -1
- package/dist/public/assets/client-version-vFgto74n.js +1 -0
- package/dist/public/assets/{comment-chips-W2ozPSpm.js → comment-chips-DBaYF7lS.js} +1 -1
- package/dist/public/assets/{config-provider-DamFbxl8.js → config-provider-C5Tk3I1Q.js} +1 -1
- package/dist/public/assets/{dist-ILlrHFKs.js → dist-C27Q9mDy.js} +82 -82
- package/dist/public/assets/{doc-paths-DAh95jxf.js → doc-paths-BVBn68AJ.js} +1 -1
- package/dist/public/assets/{documents-events-CCW6R-r2.js → documents-events-BsVKB80J.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-Bf1ZqkPA.js → file-tree-adapter-BnVxsS3Y.js} +1 -1
- package/dist/public/assets/{file-tree-utils-CgJ4lrP9.js → file-tree-utils-Bo6aWobj.js} +1 -1
- package/dist/public/assets/{folder-config-api-CKV5STj1.js → folder-config-api-BKVZKM0Y.js} +1 -1
- package/dist/public/assets/{follow-file-D0HdtSlc.js → follow-file-DqzQHgKU.js} +1 -1
- package/dist/public/assets/i18n-DdNV3ihn.js +1 -0
- package/dist/public/assets/{index-qtxLhYJO.js → index-MDvvCb3N.js} +7 -7
- package/dist/public/assets/{lint-config-client-xawAT1mQ.js → lint-config-client-kEetoezQ.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-B3UPVPG_.js → markdownlint-rule-browser-Chpu90_w.js} +1 -1
- package/dist/public/assets/{navigation-targets-C1boWExT.js → navigation-targets-BZG2mu1V.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-G7xdjHph.js → open-managed-artifact-tab-b7h2CbkR.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-CpVItLnx.js → pending-receive-nav-store-Clqxh2Fp.js} +1 -1
- package/dist/public/assets/{prop-types-BIrEWnOv.js → prop-types-CxA_rPl_.js} +1 -1
- package/dist/public/assets/{receive-store-BrOspwat.js → receive-store-DjapXAoN.js} +1 -1
- package/dist/public/assets/{selection-context-nm7zlSXJ.js → selection-context-C32Stxol.js} +1 -1
- package/dist/public/assets/{skill-actions-e3PRoOA3.js → skill-actions-5PfZ_o96.js} +1 -1
- package/dist/public/assets/{skill-scope-8PP6d5Gw.js → skill-scope-D6RlM0oa.js} +1 -1
- package/dist/public/assets/{skills-api-DQ0PK-8O.js → skills-api-Cdab4eC0.js} +1 -1
- package/dist/public/assets/{src-BKQkpwCc.js → src-Bfy3jrQ_.js} +1 -1
- package/dist/public/assets/{tag-pill-input-BHj2SAnj.js → tag-pill-input-Bcisv-E4.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-DpIU3fe6.js → target-navigation-intent-AcMTl0tC.js} +1 -1
- package/dist/public/assets/{telemetry-impl-Byic_ID0.js → telemetry-impl-CQnpJy_e.js} +1 -1
- package/dist/public/assets/{telemetry-startup-D_ttbNLC.js → telemetry-startup-D9BKJrQj.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-CgJpdKCI.js → terminal-cli-display-Co0kpfr2.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-DQ0KtteM.js → terminal-launch-events-BYyc92EH.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-CE1yzjKD.js → terminal-telemetry-C-cKlmwu.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-B6UhFT8T.js → typing-burst-detector-B5Vy4mIn.js} +1 -1
- package/dist/public/assets/{uninstall-BE8yLKij.js → uninstall-GQMfCPpu.js} +1 -1
- package/dist/public/assets/{use-activity-panel-CF6Guvjl.js → use-activity-panel-jeOH8Waq.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-BatIDUX7.js → use-apply-config-color-theme-BApSgC_I.js} +1 -1
- package/dist/public/assets/{use-collab-url-7XE2_0_k.js → use-collab-url-bZfgDsoc.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-DS89T4Os.js → use-live-xterm-theme-BplIi05T.js} +1 -1
- package/dist/public/assets/{use-open-skill-CtzMj-sg.js → use-open-skill-DXlvLAoL.js} +1 -1
- package/dist/public/assets/{use-popular-skills-BY0ulPzk.js → use-popular-skills-CfUTYkxE.js} +1 -1
- package/dist/public/assets/{use-settings-route-DN0TWdfX.js → use-settings-route-Di4sAvRi.js} +1 -1
- package/dist/public/assets/{use-skill-origin-COh1_mOK.js → use-skill-origin-B_Rm_rN6.js} +1 -1
- package/dist/public/assets/{use-skills-C_HuRxth.js → use-skills-D1P4d0d_.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-CIQB6jgW.js → use-terminal-enabled-D26F4OF8.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-CDFU16yg.js → use-timeline-entry-diff-DjaTQJZU.js} +1 -1
- package/dist/public/assets/{use-workspace-CNCW4CS8.js → use-workspace-CyUAn3C0.js} +1 -1
- package/dist/public/index.html +44 -44
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-D0g7JIQF.mjs → repair-launch-json-6ZgSt8VQ.mjs} +2 -2
- package/dist/{repair-mcp-configs-hbX7fywV.mjs → repair-mcp-configs-BX-Egvbf.mjs} +2 -2
- package/dist/repair-skills-BVA056EW.mjs +1 -0
- package/dist/{repair-skills-BVCJQr-D.mjs → repair-skills-CnWUwwGE.mjs} +2 -2
- package/dist/schemas/v0/config.project-local.schema.json +1 -1
- package/dist/schemas/v0/config.project.schema.json +11 -2
- package/dist/{server-lock-CeKMy65H.mjs → server-lock-B8gC6O_D.mjs} +2 -2
- package/dist/server-lock-BgDwOXHz.mjs +1 -0
- package/dist/{skill-teardown-CybJJo-5.mjs → skill-teardown-Bz8I6Qtp.mjs} +2 -2
- package/dist/{sleep-A0G7hOuG.mjs → sleep-C7muMiHm.mjs} +2 -2
- package/dist/{src-DNgZpbWL.mjs → src-1_fSbfZs.mjs} +2 -2
- package/dist/{src-3gxGmFyn.mjs → src-B6lC36UX.mjs} +1 -1
- package/dist/{src-Dj6UxpKM.mjs → src-BqZfalMj.mjs} +21 -21
- package/dist/src-C5VWLO7S.mjs +1 -0
- package/dist/{src--OhnhRml.mjs → src-CPA_Jv5y.mjs} +10 -10
- package/dist/start-BBU8Sqd0.mjs +1 -0
- package/dist/start-CTIu5W77.mjs +12 -0
- package/dist/{ui-DXs7IMUP.mjs → ui-CaE3cWnk.mjs} +3 -3
- package/dist/{write-project-skill-B4M4CzQe.mjs → write-project-skill-lYT2q0EM.mjs} +2 -2
- package/package.json +5 -5
- package/dist/constants-GVvlP0F1.mjs +0 -2
- package/dist/fs-traced-DtlsFK7O.mjs +0 -1
- package/dist/git-handle-CEoe8TIl.mjs +0 -1
- package/dist/init-CXnCnSQu.mjs +0 -1
- package/dist/loader-zzsiCoMM.mjs +0 -1
- package/dist/md-manager-45eVlaBq.mjs +0 -2
- package/dist/preview-BqJFFDSI.mjs +0 -1
- package/dist/public/assets/FeedbackForm-tTwFtkKO.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-Bb9ghWb1.js +0 -1
- package/dist/public/assets/client-version-DFQNNQh_.js +0 -1
- package/dist/public/assets/i18n-CUKvPzxt.js +0 -1
- package/dist/repair-skills-BmAntgZP.mjs +0 -1
- package/dist/server-lock-CDm0H6LS.mjs +0 -1
- package/dist/src-BqNFscyh.mjs +0 -1
- package/dist/start-DYelgMjm.mjs +0 -1
- package/dist/start-xJV4Y-0A.mjs +0 -12
package/dist/public/assets/{SettingsDialogBody-BNYz-D4X.js → SettingsDialogBody-NnXMegDb.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{Qt as r,an as i,jn as a,kn as o,on as s,rn as c,sn as l,tn as u}from"./DocumentContext-tOm4SkOp.js";import{t as d}from"./react-f2sANaYj.js";import{n as f,r as p}from"./dist-Nvb76hAm.js";import{t as m}from"./useQuery-ZeEDLtxh.js";import{n as h}from"./dist-PQ5KMVDh.js";import{t as g}from"./compiler-runtime-BfE3aGVn.js";import{a as _,c as v,o as y,r as b}from"./local-menu-action-bus-Cypryz6Z.js";import{t as x}from"./utils-CPqDy6Hr.js";import{a as S,h as C,i as w,m as T,n as E,t as D}from"./ChangedOutsideBadge-4TgQdQOf.js";import{t as O}from"./button-CA0dewJJ.js";import{i as k,n as A,t as j}from"./tooltip-DHXgxWLL.js";import{n as M,r as N,t as P}from"./collapsible-COrqeoHr.js";import{a as F,c as I,i as L,n as R,o as z,r as B,s as V,t as ee}from"./dialog-R8GugqUq.js";import{t as H}from"./checkbox-Bxl4H4lV.js";import{a as U,m as te,r as W,t as ne}from"./dropdown-menu-CLgDYkh1.js";import{t as G}from"./label-B5yNUINo.js";import{i as K,n as q,o as re,s as ie,t as ae}from"./select-CguJodwX.js";import{n as oe,t as se}from"./radio-group-BSCe7mNt.js";import{n as ce}from"./separator-vdmCepR4.js";import{t as J}from"./switch-B2sF5R0q.js";import{n as le,r as Y,t as ue}from"./toggle-group-CZcn-1gX.js";import{S as de,a as fe,c as pe,d as me,f as he,i as ge,l as _e,m as ve,n as ye,o as be,r as xe,s as Se,u as Ce,v as we,y as Te}from"./terminal-cli-display-CgJpdKCI.js";import{i as Ee}from"./terminal-telemetry-CE1yzjKD.js";import{$o as De,Ai as Oe,Do as ke,Fo as Ae,Ga as je,Go as Me,Gt as Ne,Ko as Pe,Kt as Fe,Lo as Ie,Mr as Le,No as Re,Po as ze,Ro as Be,Ss as Ve,Wo as He,Xa as Ue,Xo as We,Yo as Ge,Zo as Ke,bs as qe,gs as Je,hs as Ye,kn as Xe,ls as Ze,ms as Qe,os as $e,ps as et,qa as tt,rs as nt,sr as rt,ts as it,tt as at,xs as ot,ys as st,yt as ct}from"./dist-ILlrHFKs.js";import{t as lt}from"./trace-api-18gcBe0u.js";import{a as ut,c as dt,d as ft,g as pt,l as mt,n as ht,p as gt,u as _t}from"./use-settings-route-DN0TWdfX.js";import{t as vt}from"./dist-DUfEoSbR.js";import{n as X}from"./dist-B6jB2qbD2.js";import{a as yt,c as bt,d as xt,f as St,g as Ct,h as wt,i as Tt,l as Et,n as Dt,o as Ot,p as kt,s as At,u as jt}from"./use-apply-config-color-theme-BatIDUX7.js";import{t as Mt}from"./createLucideIcon-Bhw2PmPp.js";import{a as Nt,c as Pt,d as Ft,s as It,t as Lt}from"./EnableSyncConfirmDialog-BiThAkoH.js";import{t as Rt}from"./arrow-up-right-CGe6dTck.js";import{t as zt}from"./RegisteredAgentIcon-BxpJAHOj.js";import{t as Bt}from"./check-CGfmW4da.js";import{t as Vt}from"./chevron-right-Diamp-K_.js";import{n as Ht,t as Ut}from"./lint-plugin-meta-CsGPauME.js";import{r as Wt,t as Gt}from"./CopyButton-CKyZY1PL.js";import{i as Kt,r as qt}from"./prop-types-BIrEWnOv.js";import{A as Jt,C as Yt,D as Xt,E as Zt,L as Qt,M as $t,N as en,P as tn,S as nn,V as rn,_ as an,b as on,d as sn,f as cn,g as ln,i as un,j as dn,k as fn,l as pn,n as mn,o as hn,u as gn,v as _n,x as vn,y as yn,z as bn}from"./auth-state-cache-DrAhOPTB.js";import{o as xn}from"./folder-config-api-CKV5STj1.js";import{t as Sn}from"./info-w0kv2CeC.js";import{t as Cn}from"./spinner-CHTY-VE-.js";import{t as wn}from"./square-pen-DdAKbKU7.js";import{t as Tn}from"./terminal-DRi0ugpC.js";import{t as En}from"./trash-2-BWJWOK8-.js";import{t as Dn}from"./triangle-alert-DV20-jn9.js";import{t as On}from"./x-BaJrHZK_.js";import{d as kn}from"./doc-paths-DAh95jxf.js";import{t as An}from"./ConfigSharingInfoTooltip-CuqrTakc.js";import{t as jn}from"./input-BFt4qZaV.js";import{t as Mn}from"./badge-BYteLKha.js";import{i as Nn,o as Pn,r as Fn,t as In}from"./field-CvwbVfuf.js";import{a as Ln,n as Rn}from"./config-provider-DamFbxl8.js";import{t as zn}from"./external-link-3El87eIe.js";import{t as Bn}from"./textarea-CzW0aR0j.js";import{t as Vn}from"./skeleton-BOVIbSHk.js";import{d as Hn,n as Un,r as Wn,t as Gn,u as Kn}from"./lint-config-client-xawAT1mQ.js";import{_ as qn,a as Jn,d as Yn,f as Xn,g as Zn,h as Qn,i as $n,o as er,s as tr,t as nr,u as rr}from"./sortable.esm-Dd5A8_XI.js";import{t as ir}from"./open-managed-artifact-tab-G7xdjHph.js";import{n as ar,r as or,t as sr}from"./input-group-ClrIuhWi.js";import{a as cr,f as lr,i as ur,n as dr,o as fr,p as pr,r as mr,s as hr,t as gr}from"./form-dlFqxdSN.js";import{r as _r,t as vr}from"./terminal-command-events-DXmeHtnk.js";import{t as yr}from"./tag-pill-input-BHj2SAnj.js";import{t as br}from"./markdownlint-rule-browser-B3UPVPG_.js";import{i as xr,n as Sr}from"./schema-fields-view-intent-D0jz38_6.js";import{n as Cr,t as wr}from"./use-terminal-enabled-CIQB6jgW.js";var Tr=Mt(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Er=Mt(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Dr=Mt(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Or=Mt(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=g(),Q=e(d(),1),$=n(),kr=`settings-sharing-title`;function Ar(){let e=(0,Z.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,$.jsx)(jr,{}):(0,$.jsx)(Mr,{}),e[0]=n):n=e[0],n}function jr(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`h3`,{id:kr,className:`text-base font-semibold`,children:(0,$.jsx)(f,{id:`cs4mps`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`section`,{"aria-labelledby":kr,className:`space-y-3`,children:(0,$.jsxs)(`div`,{className:`space-y-1`,children:[t,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})]})}),e[1]=n):n=e[1],n}function Mr(){let e=(0,Z.c)(39),{_:t}=p(),[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(null),c;e[0]===t?c=e[1]:(c=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r(Pr)}},e[0]=t,e[1]=c);let l=c,u;e[2]===l?u=e[3]:(u=()=>{l()},e[2]=l,e[3]=u);let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],e[4]=d):d=e[4],(0,Q.useEffect)(u,d);let m;e[5]!==t||e[6]!==i||e[7]!==l||e[8]!==n?(m=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),s(null);let o=null,c=null;try{o=await r.setMode(e)}catch(e){c=e}if(a(!1),c!==null){X.error(c instanceof Error?c.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(s({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`wdzBgi`}:{id:`k_pade`})),await l())},e[5]=t,e[6]=i,e[7]=l,e[8]=n,e[9]=m):m=e[9];let h=m,g;e[10]!==t||e[11]!==i||e[12]!==l||e[13]!==n?(g=async function(){let e=window.okDesktop?.sharing;if(!e||n===null||i)return;a(!0);let r=null,o=null;try{r=await e.setSkillsShared(!1)}catch(e){o=e}if(a(!1),o!==null){X.error(o instanceof Error?o.message:t({id:`onTlRk`}));return}if(r!==null){if(r.kind===`no-exclude`){let e=r.reason===`no-git`?t({id:`Xwump4`}):r.reason===`inaccessible`?t({id:`PlGC6r`}):t({id:`zcmYx4`});X.warning(t({id:`4h3e0H`,values:{detail:e}}));return}X.success(t({id:`P3S14k`})),await l()}},e[10]=t,e[11]=i,e[12]=l,e[13]=n,e[14]=g):g=e[14];let _=g;if(n===null){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":kr,className:`space-y-3`,children:[(0,$.jsx)(`h3`,{id:kr,className:`text-base font-semibold`,children:(0,$.jsx)(f,{id:`cs4mps`})}),(0,$.jsx)(Vn,{className:`h-24`})]}),e[15]=t):t=e[15],t}let v=n.mode===`no-git`,y;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`h3`,{id:kr,className:`text-base font-semibold`,children:(0,$.jsx)(f,{id:`cs4mps`})}),(0,$.jsx)(An,{})]}),e[16]=y):y=e[16];let b;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[y,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`N55YNr`})})]}),e[17]=b):b=e[17];let x;e[18]!==i||e[19]!==v||e[20]!==h||e[21]!==n.mode?(x=v?(0,$.jsx)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,$.jsx)(f,{id:`ju38ms`})}):(0,$.jsxs)(se,{value:n.mode,onValueChange:e=>void h(e),disabled:i,className:`gap-2`,"aria-labelledby":kr,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(oe,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(f,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`dJw2_7`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(oe,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(f,{id:`QjzFZj`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`un-K1H`})})]})]})]}),e[18]=i,e[19]=v,e[20]=h,e[21]=n.mode,e[22]=x):x=e[22];let S;e[23]!==i||e[24]!==_||e[25]!==n.mode||e[26]!==n.skillsShared?(S=n.mode===`local-only`&&n.skillsShared?(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-skills-exception`,children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(f,{id:`Kiytqd`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`K0FgsP`})})]}),(0,$.jsx)(O,{variant:`outline`,size:`sm`,disabled:i,onClick:()=>void _(),children:(0,$.jsx)(f,{id:`9uI_rE`})})]}):null,e[23]=i,e[24]=_,e[25]=n.mode,e[26]=n.skillsShared,e[27]=S):S=e[27];let C;e[28]===o?C=e[29]:(C=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(f,{id:`ZscwQ0`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>s(null),children:(0,$.jsx)(f,{id:`1QfxQT`})})]}),e[28]=o,e[29]=C);let w;e[30]!==o||e[31]!==n.mode||e[32]!==n.trackedUpstream?(w=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(f,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(Nr)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[30]=o,e[31]=n.mode,e[32]=n.trackedUpstream,e[33]=w):w=e[33];let T;return e[34]!==w||e[35]!==x||e[36]!==S||e[37]!==C?(T=(0,$.jsxs)(`section`,{"aria-labelledby":kr,className:`space-y-4`,"data-testid":`settings-sharing`,children:[b,x,S,C,w]}),e[34]=w,e[35]=x,e[36]=S,e[37]=C,e[38]=T):T=e[38],T}function Nr(e){return(0,$.jsx)(`li`,{children:e},e)}function Pr(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[],skillsShared:!1}}function Fr(e){let t=(0,Z.c)(35),{authQueryTransport:n,authTransport:r}=e,{_:i}=p(),a;t[0]===n?a=t[1]:(a=n??Qt(),t[0]=n,t[1]=a);let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={phase:`loading`},t[2]=s):s=t[2];let[c,l]=(0,Q.useState)(s),[u,d]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(null),v=(0,Q.useRef)(!1),y;t[3]===o?y=t[4]:(y=async function(){l({phase:`loading`});try{let e=await o.status();l({phase:`loaded`,result:e}),mn(e.authenticated)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),l({phase:`check-failed`})}},t[3]=o,t[4]=y);let b=y,x;t[5]===b?x=t[6]:(x=()=>{b()},t[5]=b,t[6]=x);let S;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[7]=S):S=t[7],(0,Q.useEffect)(x,S);let C;t[8]!==i||t[9]!==b||t[10]!==o?(C=async function(){if(v.current)return;v.current=!0,d(!1),h(!0),_(null);let e=null;try{let t=o.signout?await o.signout():{ok:!1,error:i({id:`8cpOa8`})};t.ok||(e=t.error??i({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=i({id:`8cpOa8`})}await b(),e&&_(e),h(!1),v.current=!1},t[8]=i,t[9]=b,t[10]=o,t[11]=C):C=t[11];let w=C,T;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(`h3`,{id:`settings-account-title`,className:`text-base font-semibold`,children:(0,$.jsx)(f,{id:`AeXO77`})}),t[12]=T):T=t[12];let E;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[T,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`E6lrpp`})})]}),t[13]=E):E=t[13];let D;t[14]!==g||t[15]!==m||t[16]!==w||t[17]!==b||t[18]!==c.phase||t[19]!==c.result?(D=c.phase===`loading`?(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(f,{id:`IWGfGF`})}),(0,$.jsx)(Vn,{className:`h-4 w-40`}),(0,$.jsx)(Vn,{className:`h-8 w-32`})]}):c.phase===`check-failed`?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`T_wG4n`})}),(0,$.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:(0,$.jsx)(f,{id:`KDw4GX`})})]}):c.result.authenticated?c.result.tier===`A`?(0,$.jsx)(Lr,{login:c.result.login}):(0,$.jsx)(Ir,{login:c.result.login,disconnecting:m,error:g,onDisconnect:()=>void w()}):(0,$.jsx)(Rr,{onConnect:()=>d(!0)}),t[14]=g,t[15]=m,t[16]=w,t[17]=b,t[18]=c.phase,t[19]=c.result,t[20]=D):D=t[20];let k;t[21]===b?k=t[22]:(k=e=>{d(e),e||b()},t[21]=b,t[22]=k);let A=c.phase===`loaded`?c.result.host:void 0,j=c.phase===`loaded`?c.result.ghAvailable:void 0,M;t[23]===b?M=t[24]:(M=()=>{b()},t[23]=b,t[24]=M);let N;t[25]!==u||t[26]!==r||t[27]!==k||t[28]!==A||t[29]!==j||t[30]!==M?(N=(0,$.jsx)(tn,{open:u,onOpenChange:k,transport:r,host:A,ghAvailable:j,onSuccess:M}),t[25]=u,t[26]=r,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N):N=t[31];let P;return t[32]!==N||t[33]!==D?(P=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[E,D,N]}),t[32]=N,t[33]=D,t[34]=P):P=t[34],P}function Ir(e){let t=(0,Z.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(f,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(f,{id:`nxlOpL`})}),t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[3]=o,t[4]=c);let l;t[5]===r?l=t[6]:(l=r?(0,$.jsx)(f,{id:`rppgXF`}):(0,$.jsx)(f,{id:`-K0AvT`}),t[5]=r,t[6]=l);let u;t[7]!==r||t[8]!==a||t[9]!==l?(u=(0,$.jsx)(O,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:l}),t[7]=r,t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==c||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(f,{id:`msOK6I`})}),t[14]=p):p=t[14];let m;t[15]===i?m=t[16]:(m=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=m);let h;return t[17]!==d||t[18]!==m?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[d,p,m]}),t[17]=d,t[18]=m,t[19]=h):h=t[19],h}function Lr(e){let t=(0,Z.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(f,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(f,{id:`ny6vNn`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r,i]})}),t[3]=r,t[4]=a),a}function Rr(e){let t=(0,Z.c)(5),{onConnect:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(f,{id:`S33tz3`})}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(f,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(f,{id:`5lWFkC`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(O,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function zr(e){return e.kind===`editor`?`editor:${e.id}`:e.kind===`skill`?`skill:${e.id}`:`path`}function Br(e){let t=(0,Z.c)(11),{testId:n,children:r}=e,{_:i}=p(),a;t[0]===i?a=t[1]:(a=i({id:`2B6eYX`}),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Sn,{className:`size-3.5`}),t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==n?(s=(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(O,{variant:`ghost`,size:`icon`,className:`mt-1.5 mr-1.5 h-6 w-6 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,"aria-label":a,"data-testid":n,children:o})}),t[3]=a,t[4]=n,t[5]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=(0,$.jsx)(A,{side:`left`,className:`max-w-sm text-left`,children:(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:r})}),t[6]=r,t[7]=c);let l;return t[8]!==s||t[9]!==c?(l=(0,$.jsxs)(j,{children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Vr(){let e=(0,Z.c)(38),{_:t}=p(),n=typeof window<`u`?window.okDesktop??null:null,[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(null),l,u;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{if(!n)return;let e=!1;return n.integrations.status().then(t=>{e||i(t)}).catch(()=>{e||o(!0)}),()=>{e=!0}},u=[n],e[0]=l,e[1]=u):(l=e[0],u=e[1]),(0,Q.useEffect)(l,u);let d;e[2]===t?d=e[3]:(d=async function(e,r){if(n){c(zr(e));try{let t=await n.integrations.setComponent({component:e,enabled:r});i(t.status),t.ok||X.error(t.error)}catch(e){let n=e;X.error(t({id:`gfdqcY`,values:{0:n instanceof Error?n.message:String(n)}}))}c(null)}},e[2]=t,e[3]=d);let m=d,h;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`h3`,{id:`settings-ai-tools-title`,className:`text-base font-semibold`,children:(0,$.jsx)(f,{id:`_5qBNl`})}),e[4]=h):h=e[4];let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[h,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`mLAjyL`})})]}),e[5]=g):g=e[5];let _=g;if(!n||a){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`ai-tools-unavailable`,children:(0,$.jsx)(f,{id:`O4PnDd`})})]}),e[6]=t):t=e[6],t}if(r===null){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsxs)(`div`,{className:`space-y-2`,"data-testid":`ai-tools-loading`,children:[(0,$.jsx)(Vn,{className:`h-10 w-full`}),(0,$.jsx)(Vn,{className:`h-10 w-full`}),(0,$.jsx)(Vn,{className:`h-10 w-full`})]})]}),e[7]=t):t=e[7],t}let v=s!==null||!r.available,y=r.path.shellDetected||r.path.installed,b;e[8]===r.available?b=e[9]:(b=!r.available&&(0,$.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,"data-testid":`ai-tools-read-only`,children:(0,$.jsx)(f,{id:`OplnBG`})}),e[8]=r.available,e[9]=b);let x;e[10]!==t||e[11]!==m||e[12]!==v||e[13]!==y||e[14]!==r.path.installed||e[15]!==r.path.rcFilesToTouch?(x=y&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(f,{id:`ALhMYW`})}),(0,$.jsxs)(`div`,{className:`flex items-start overflow-hidden rounded-md border border-border bg-card/50 hover:bg-accent`,children:[(0,$.jsxs)(G,{htmlFor:`ai-tools-path`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(H,{id:`ai-tools-path`,checked:r.path.installed,disabled:v,onCheckedChange:()=>void m({kind:`path`},!r.path.installed),className:`mt-0.5`,"data-testid":`ai-tools-path-checkbox`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(f,{id:`Fsx78O`,components:{0:(0,$.jsx)(`code`,{className:`inline-code`})}})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-path-status`,children:r.path.installed?t({id:`yhdqox`}):t({id:`04XyCH`,values:{0:r.path.rcFilesToTouch.join(`, `)}})})]})]}),(0,$.jsxs)(Br,{testId:`ai-tools-path-info`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(f,{id:`f9lQNJ`})}),r.path.rcFilesToTouch.map(Ur),(0,$.jsx)(`p`,{className:`pt-1`,children:(0,$.jsx)(f,{id:`CWzc2T`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]})]})]}),e[10]=t,e[11]=m,e[12]=v,e[13]=y,e[14]=r.path.installed,e[15]=r.path.rcFilesToTouch,e[16]=x):x=e[16];let S;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(f,{id:`psfGPX`})}),e[17]=S):S=e[17];let C;if(e[18]!==t||e[19]!==m||e[20]!==v||e[21]!==r.editors){let n;e[23]!==t||e[24]!==m||e[25]!==v?(n=e=>{let n=e.state===`installed`||e.state===`foreign`,r=v||e.state===`unmanageable`,i=e.state===`not-installed`&&!e.detected,a=`https://openknowledge.ai/docs/integrations/${Ue[e.id]}`,o=e.state===`installed`?t({id:`eQkgKV`}):e.state===`foreign`?t({id:`AczYxH`}):e.state===`unmanageable`?t({id:`LbmLyU`}):e.detected?t({id:`bBE5tC`}):null,s=e.state===`foreign`||e.state===`unmanageable`?`text-xs text-amber-600 dark:text-amber-400`:`text-xs text-muted-foreground`;return(0,$.jsxs)(`li`,{className:r?`flex items-start`:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(G,{htmlFor:`ai-tools-editor-${e.id}`,className:r?`flex flex-1 items-start gap-2.5 px-3 py-2.5 font-normal`:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(H,{id:`ai-tools-editor-${e.id}`,checked:n,disabled:r,onCheckedChange:()=>void m({kind:`editor`,id:e.id},!n),className:`mt-0.5`,"data-testid":`ai-tools-editor-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.label}),o!==null&&(0,$.jsx)(`span`,{className:s,"data-testid":`ai-tools-editor-status-${e.id}`,children:o})]})]}),i&&(0,$.jsxs)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>zn(e,a),onAuxClick:e=>zn(e,a),"aria-label":t({id:`D-Oh1s`,values:{0:e.label}}),className:`flex shrink-0 items-center gap-0.5 px-2 py-2.5 text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`ai-tools-editor-status-${e.id}`,children:[(0,$.jsx)(f,{id:`P_bX4O`}),(0,$.jsx)(Rt,{className:`size-3`,"aria-hidden":!0})]}),(0,$.jsxs)(Br,{testId:`ai-tools-editor-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(f,{id:`J2eKUI`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.configPath??t({id:`ndwmea`})})}),(0,$.jsx)(`p`,{className:`pt-1 opacity-70`,children:(0,$.jsx)(f,{id:`VIwCaD`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.entryLocator})})]})]},e.id)},e[23]=t,e[24]=m,e[25]=v,e[26]=n):n=e[26],C=r.editors.map(n),e[18]=t,e[19]=m,e[20]=v,e[21]=r.editors,e[22]=C}else C=e[22];let w;e[27]===C?w=e[28]:(w=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[S,(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:C})]}),e[27]=C,e[28]=w);let T;e[29]!==m||e[30]!==v||e[31]!==r.skills?(T=r.skills.length>0&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(f,{id:`28B21t`})}),(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:r.skills.map(e=>(0,$.jsxs)(`li`,{className:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(G,{htmlFor:`ai-tools-skill-${e.id}`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(H,{id:`ai-tools-skill-${e.id}`,checked:e.installed,disabled:v,onCheckedChange:()=>void m({kind:`skill`,id:e.id},!e.installed),className:`mt-0.5`,"data-testid":`ai-tools-skill-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(`code`,{children:e.name})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-skill-status-${e.id}`,children:e.id===`discovery`?(0,$.jsx)(f,{id:`0inVGS`}):(0,$.jsx)(f,{id:`FXk_zY`})})]})]}),(0,$.jsxs)(Br,{testId:`ai-tools-skill-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(f,{id:`HSh8u_`})}),e.paths.map(Hr)]})]},e.id))})]}),e[29]=m,e[30]=v,e[31]=r.skills,e[32]=T):T=e[32];let E;return e[33]!==T||e[34]!==b||e[35]!==x||e[36]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,b,x,w,T]}),e[33]=T,e[34]=b,e[35]=x,e[36]=w,e[37]=E):E=e[37],E}function Hr(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function Ur(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}var Wr=`open-knowledge-app`;function Gr({from:e,to:t}){try{lt.getTracer(Wr).startSpan(`ok.language.preferenceChanged`,{attributes:{"ok.language.from":e,"ok.language.to":t}}).end()}catch(e){console.warn(`[language-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}var Kr=`open-knowledge-app`;function qr(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function Jr(e){try{lt.getTracer(Kr).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":qr(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Yr=`system`;function Xr(e){return typeof e==`string`&&Me.includes(e)}function Zr(e){return Xr(e)?e:Yr}function Qr(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function $r(e){let t=(0,Z.c)(6),{choice:n}=e;if(n===Yr){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(f,{id:`D-NlUC`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=Qr(n),t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(`span`,{lang:n,className:`capitalize`,children:r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ei(e){let t=(0,Z.c)(22),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({value:o,onValueChange:r,onBlur:n,ref:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=Zr(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Zr(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,$.jsx)(ie,{children:(0,$.jsx)($r,{choice:c})}),t[10]=c,t[11]=u);let d;t[12]!==n||t[13]!==i||t[14]!==a||t[15]!==u?(d=(0,$.jsx)(re,{...a,ref:i,onBlur:n,size:`sm`,className:`w-48`,children:u}),t[12]=n,t[13]=i,t[14]=a,t[15]=u,t[16]=d):d=t[16];let f;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(q,{children:[(0,$.jsx)(K,{value:Yr,children:(0,$.jsx)($r,{choice:Yr})}),He.map(ti)]}),t[17]=f):f=t[17];let p;return t[18]!==c||t[19]!==l||t[20]!==d?(p=(0,$.jsxs)(ae,{value:c,onValueChange:l,children:[d,f]}),t[18]=c,t[19]=l,t[20]=d,t[21]=p):p=t[21],p}function ti(e){return(0,$.jsx)(K,{value:e,children:(0,$.jsx)($r,{choice:e})},e)}function ni(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function ri(e,t,n){return e.id===`custom`?ni(Ge(kt(t))):e.scheme?ni(Ge(e.scheme)):ni(jt(n))}function ii(e){let t=(0,Z.c)(38),{theme:n,customSeed:r,slotMode:i}=e,a,o,s,c,l,u,d,f,p,m;t[0]!==r||t[1]!==i||t[2]!==n?(a=ri(n,r,i),u=!0,d=``,f=`aspect-[4/3] w-full overflow-hidden rounded-md border`,p={backgroundColor:a.surface,borderColor:a.line},m=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(ai),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]);let h;t[13]!==o||t[14]!==s||t[15]!==c?(h=(0,$.jsx)(`div`,{className:o,style:s,children:c}),t[13]=o,t[14]=s,t[15]=c,t[16]=h):h=t[16];let g;t[17]===a.dots[1]?g=t[18]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[17]=a.dots[1],t[18]=g);let _;t[19]===a.line?_=t[20]:(_=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[19]=a.line,t[20]=_);let v;t[21]===a.dots[0]?v=t[22]:(v=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[21]=a.dots[0],t[22]=v);let y;t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[g,_,v]}),t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;t[27]!==h||t[28]!==y||t[29]!==l?(b=(0,$.jsxs)(`div`,{className:l,children:[h,y]}),t[27]=h,t[28]=y,t[29]=l,t[30]=b):b=t[30];let x;return t[31]!==b||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==p||t[36]!==m?(x=(0,$.jsxs)(`div`,{"aria-hidden":u,"data-theme-swatch":d,className:f,style:p,children:[m,b]}),t[31]=b,t[32]=u,t[33]=d,t[34]=f,t[35]=p,t[36]=m,t[37]=x):x=t[37],x}function ai(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function oi(e){return x(`size-6 min-w-6 rounded-md border p-0 transition-colors`,e?`border-primary bg-primary/15 text-primary hover:bg-primary/20 data-[state=on]:bg-primary/15`:`border-border/70 text-muted-foreground/70 hover:text-foreground`)}function si(e){return x(`size-3.5`,e&&`fill-current`)}function ci(e){let t=(0,Z.c)(32),{selection:n,themes:r,unavailableThemes:i,onAssign:o,editControl:s,deleteControl:c,createControl:l,slotMode:u,customSeed:d,firstItemId:f,"aria-label":m,"aria-describedby":h}=e,g=r===void 0?Pe:r,_;t[0]===i?_=t[1]:(_=i===void 0?[]:i,t[0]=i,t[1]=_);let y=_,b=u===void 0?`light`:u,{_:S}=p(),C;if(t[2]!==S||t[3]!==d||t[4]!==c||t[5]!==s||t[6]!==f||t[7]!==o||t[8]!==n||t[9]!==b||t[10]!==g){let e;t[12]!==S||t[13]!==d||t[14]!==c||t[15]!==s||t[16]!==f||t[17]!==o||t[18]!==n||t[19]!==b?(e=(e,t)=>{let r=n.light===e.id,i=n.dark===e.id,l=s?.themeIds.includes(e.id)??!1,u=c?.themeIds.includes(e.id)??!1,p=s?.selectedId===e.id,m=S(b===`light`?{id:`hgF0al`,values:{0:e.label}}:{id:`6Nea1q`,values:{0:e.label}});return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:x(`relative flex min-w-0 flex-col gap-1.5 rounded-lg border-2 p-1 text-left`,n[b]===e.id?`border-primary`:`border-transparent`),children:[(0,$.jsx)(O,{type:`button`,variant:`ghost`,"aria-label":m,"data-theme-focus-target":``,onClick:()=>o(b,e.id),className:`h-auto w-full cursor-pointer p-0 transition-opacity hover:bg-transparent hover:opacity-90`,children:(0,$.jsx)(ii,{theme:e,customSeed:d,slotMode:b})}),u?(0,$.jsx)(O,{type:`button`,variant:`outline`,size:`icon-sm`,title:S({id:`Y2tU6I`,values:{0:e.label}}),"aria-label":S({id:`Y2tU6I`,values:{0:e.label}}),className:`absolute top-2 end-2 z-10 border-border/80 bg-background/85 text-muted-foreground shadow-sm backdrop-blur-sm hover:border-destructive/50 hover:bg-destructive/15 hover:text-destructive focus-visible:border-destructive/50 focus-visible:text-destructive focus-visible:ring-destructive/20 dark:bg-background/80 dark:hover:bg-destructive/20`,onClick:async t=>{let n=t.currentTarget.closest(`fieldset`),r=n?.previousElementSibling?.querySelector(`[data-theme-focus-target]`)??n?.nextElementSibling?.querySelector(`[data-theme-focus-target]`);await c?.onDelete(e.id)!==!1&&r?.focus()},children:(0,$.jsx)(En,{"aria-hidden":!0})}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-1 px-0.5`,children:[(0,$.jsx)(`span`,{className:`truncate text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[l?(0,$.jsx)(Y,{className:oi(p),pressed:p,onPressedChange:t=>{s?.onSelect(t?e.id:null)},"aria-label":S(p?{id:`8x6zk9`,values:{0:e.label}}:{id:`N6j2JH`,values:{0:e.label}}),children:(0,$.jsx)(a,{className:`size-3.5`})}):null,(0,$.jsx)(Y,{id:t===0?f:void 0,className:oi(r),pressed:r,onPressedChange:t=>{t&&o(`light`,e.id)},"aria-label":S({id:`sq4WQH`,values:{0:e.label}}),children:(0,$.jsx)(Dr,{className:si(r)})}),(0,$.jsx)(Y,{className:oi(i),pressed:i,onPressedChange:t=>{t&&o(`dark`,e.id)},"aria-label":S({id:`lZvQrY`,values:{0:e.label}}),children:(0,$.jsx)(Er,{className:si(i)})})]})]})]},e.id)},t[12]=S,t[13]=d,t[14]=c,t[15]=s,t[16]=f,t[17]=o,t[18]=n,t[19]=b,t[20]=e):e=t[20],C=g.map(e),t[2]=S,t[3]=d,t[4]=c,t[5]=s,t[6]=f,t[7]=o,t[8]=n,t[9]=b,t[10]=g,t[11]=C}else C=t[11];let w;t[21]!==S||t[22]!==l?(w=l?(0,$.jsxs)(O,{type:`button`,variant:`ghost`,onClick:l.onCreate,className:`group h-auto min-w-0 flex-col items-stretch gap-1.5 rounded-lg border-2 border-transparent p-1 text-left text-muted-foreground hover:bg-transparent hover:text-foreground`,children:[(0,$.jsx)(`span`,{className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-dashed border-border bg-muted/10 transition-colors group-hover:border-foreground/40`,children:(0,$.jsx)(v,{"aria-hidden":!0,className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium`,children:S({id:`AJ7_B2`})})]}):null,t[21]=S,t[22]=l,t[23]=w):w=t[23];let T;t[24]===y?T=t[25]:(T=y.map(li),t[24]=y,t[25]=T);let E;return t[26]!==h||t[27]!==m||t[28]!==C||t[29]!==w||t[30]!==T?(E=(0,$.jsxs)(`fieldset`,{"aria-label":m,"aria-describedby":h,className:`grid w-full min-w-0 grid-cols-2 gap-2 sm:grid-cols-3`,children:[C,w,T]}),t[26]=h,t[27]=m,t[28]=C,t[29]=w,t[30]=T,t[31]=E):E=t[31],E}function li(e){return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:`flex min-w-0 flex-col gap-1.5 rounded-lg border-2 border-destructive/40 bg-destructive/5 p-1 text-left`,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-destructive/30 bg-muted/40 text-destructive`,children:(0,$.jsx)(Wt,{className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`px-0.5 text-xs font-medium text-destructive`,children:e.problem}),(0,$.jsx)(`span`,{className:`px-0.5 pb-0.5 text-xs text-muted-foreground`,children:e.detail})]},e.key)}var ui=12e3;function di(e){let t=(0,Z.c)(210),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({appearance:n,onAssign:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=p(),{themes:o,warnings:s,truncated:c,loadError:l,refresh:u,deleteTheme:d,restoreTheme:f,editingThemeId:m,themeEditorOpen:h,selectThemeToEdit:g}=Ln(),[_,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(``),[x,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(!1),T=(0,Q.useRef)(null),E,D;t[4]===u?(E=t[5],D=t[6]):(E=()=>{u()},D=[u],t[4]=u,t[5]=E,t[6]=D),(0,Q.useEffect)(E,D);let k;t[7]!==n||t[8]!==o?(k=st(n,o),t[7]=n,t[8]=o,t[9]=k):k=t[9];let A=k,j,M,N,P,B,H,U,te,W,ne,G,K,q,re,ie,ae,oe,se,ce,J,le;if(t[10]!==a||t[11]!==x||t[12]!==y||t[13]!==_||t[14]!==d||t[15]!==m||t[16]!==C||t[17]!==l||t[18]!==r||t[19]!==i||t[20]!==u||t[21]!==f||t[22]!==g||t[23]!==A||t[24]!==h||t[25]!==o||t[26]!==c||t[27]!==s){let e=De(y),n;t[49]===o?n=t[50]:(n=o.filter(gi),t[49]=o,t[50]=n);let p=n,E,D,k,z,Y,ue,de,fe,pe;if(t[51]!==a||t[52]!==y||t[53]!==d||t[54]!==m||t[55]!==p||t[56]!==C||t[57]!==l||t[58]!==r||t[59]!==i||t[60]!==u||t[61]!==f||t[62]!==g||t[63]!==A||t[64]!==h||t[65]!==o||t[66]!==c||t[67]!==s){let e=o.flatMap(hi),n;t[80]!==a||t[81]!==u||t[82]!==f?(n=async function(e){let t=await f({id:e.id,name:e.scheme.name,stem:e.stem,scheme:{...e.scheme,palette:{...e.scheme.palette}},extension:e.filename.endsWith(`.yml`)?`.yml`:`.yaml`});if(t.ok){await u(),X.success(a({id:`Kx881F`,values:{0:e.label}}));return}if(t.reason===`name-taken`){X.error(a({id:`oZUYMv`,values:{0:e.label}}));return}X.error(a({id:`7O7REc`,values:{0:e.label}}))},t[80]=a,t[81]=u,t[82]=f,t[83]=n):n=t[83];let _=n;k=async function(t){let n=e.find(e=>e.id===t);if(!n)return X.error(a({id:`ANFxWn`})),!1;let r=await d(n.id);if(!r.ok)return X.error(a({id:`kkux8f`,values:{0:n.label}})),!1;if(m===n.id&&g(null),await u(),!r.existed)return X(a({id:`ekSPiP`,values:{0:n.label}})),!0;let i={...n,filename:r.filename,label:r.scheme.name,scheme:r.scheme};return X(a({id:`YCmS3k`,values:{0:i.label}}),{duration:ui,action:{label:a({id:`9uI_rE`}),onClick:()=>_(i)}}),!0};let x;t[84]!==a||t[85]!==y||t[86]!==C||t[87]!==r||t[88]!==i||t[89]!==u||t[90]!==f||t[91]!==g||t[92]!==A||t[93]!==o?(x=async function(e){if(e.preventDefault(),C)return;let t=De(y);if(!t.ok){S(a({id:`RG3yW6`})),T.current?.focus();return}let n=i.slotMode??`light`,s=o.find(e=>e.id===A[n])?.scheme??kt(i.customSeed),c={name:t.name,variant:s.variant,palette:{...s.palette}};S(null),w(!0);let l=await f({id:t.id,name:t.name,scheme:c});if(!l.ok){S(l.reason===`name-taken`?a({id:`_IfSZn`}):l.reason===`name-invalid`?a({id:`qtnmEX`}):a({id:`DmkTrb`})),w(!1),T.current?.focus();return}let d={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>Ge(c)};r(n,l.id,A,[...o,d]),await u(),b(``),v(!1),w(!1),g(l.id)},t[84]=a,t[85]=y,t[86]=C,t[87]=r,t[88]=i,t[89]=u,t[90]=f,t[91]=g,t[92]=A,t[93]=o,t[94]=x):x=t[94],D=x;let j;if(t[95]!==a||t[96]!==s){let e;t[98]===a?e=t[99]:(e=e=>{let t;bb90:switch(e.code){case`unparseable`:t=a({id:`g12y1g`});break bb90;case`not-a-scheme`:t=a({id:`p7Utw8`});break bb90;case`missing-slots`:t=a({id:`GUZHkL`});break bb90;case`bad-hex`:t=a({id:`IMLUBh`});break bb90;case`empty`:t=a({id:`k_tFzX`});break bb90;case`too-long`:t=a({id:`FyyIjH`});break bb90;case`invalid-chars`:t=a({id:`JaU1ld`});break bb90;case`unsupported-extension-case`:t=a({id:`R30SFt`});break bb90;case`duplicate-identity`:t=a({id:`DUb7Ax`});break bb90;case`symlink`:t=a({id:`hFmYGU`});break bb90;case`not-regular-file`:t=a({id:`UH0Zqw`});break bb90;case`file-too-large`:t=a({id:`-othoN`});break bb90;case`read-failed`:t=a({id:`cLn264`});break bb90;default:t=a({id:`WBNpt9`,values:{0:e.code}})}return{key:e.filename,label:e.filename,problem:t,detail:e.conflictingFilenames?a({id:`QwG_zJ`,values:{0:e.conflictingFilenames.join(`, `)}}):a({id:`kwNS82`})}},t[98]=a,t[99]=e),j=s.map(e),t[95]=a,t[96]=s,t[97]=j}else j=t[97];let M=j;K=`flex w-full min-w-0 flex-col gap-2`,t[100]!==a||t[101]!==l||t[102]!==u?(q=l?(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{children:a({id:`hVzt9x`})}),(0,$.jsx)(O,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>void u(),children:a({id:`KDw4GX`})})]}):null,t[100]=a,t[101]=l,t[102]=u,t[103]=q):q=t[103];let N;t[104]!==a||t[105]!==c?(N=c?(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(Dn,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-amber-600`}),(0,$.jsx)(`span`,{children:a({id:`DLIljL`})})]}):null,t[104]=a,t[105]=c,t[106]=N):N=t[106],t[107]===N?re=t[108]:(re=(0,$.jsx)(`div`,{role:`status`,children:N}),t[107]=N,t[108]=re),E=ci,Y=i,ue=A,de=p,fe=M;let P;t[109]===o?P=t[110]:(P=o.filter(mi).map(pi),t[109]=o,t[110]=P);let F=h?m:null;t[111]!==g||t[112]!==P||t[113]!==F?(pe={themeIds:P,selectedId:F,onSelect:g},t[111]=g,t[112]=P,t[113]=F,t[114]=pe):pe=t[114],z=e.map(fi),t[51]=a,t[52]=y,t[53]=d,t[54]=m,t[55]=p,t[56]=C,t[57]=l,t[58]=r,t[59]=i,t[60]=u,t[61]=f,t[62]=g,t[63]=A,t[64]=h,t[65]=o,t[66]=c,t[67]=s,t[68]=E,t[69]=D,t[70]=k,t[71]=K,t[72]=q,t[73]=re,t[74]=z,t[75]=Y,t[76]=ue,t[77]=de,t[78]=fe,t[79]=pe}else E=t[68],D=t[69],k=t[70],K=t[71],q=t[72],re=t[73],z=t[74],Y=t[75],ue=t[76],de=t[77],fe=t[78],pe=t[79];let me;t[115]!==k||t[116]!==z?(me={themeIds:z,onDelete:k},t[115]=k,t[116]=z,t[117]=me):me=t[117];let he;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(he={onCreate:()=>v(!0)},t[118]=he):he=t[118];let ge;t[119]!==r||t[120]!==A||t[121]!==o?(ge=(e,t)=>r(e,t,A,o),t[119]=r,t[120]=A,t[121]=o,t[122]=ge):ge=t[122],t[123]!==E||t[124]!==Y||t[125]!==ue||t[126]!==de||t[127]!==fe||t[128]!==pe||t[129]!==me||t[130]!==ge?(ie=(0,$.jsx)(E,{...Y,selection:ue,themes:de,unavailableThemes:fe,editControl:pe,deleteControl:me,createControl:he,onAssign:ge}),t[123]=E,t[124]=Y,t[125]=ue,t[126]=de,t[127]=fe,t[128]=pe,t[129]=me,t[130]=ge,t[131]=ie):ie=t[131],B=ee,ne=_,t[132]===C?G=t[133]:(G=e=>{C||v(e)},t[132]=C,t[133]=G),P=L;let _e;t[134]===a?_e=t[135]:(_e=a({id:`Z_nNa2`}),t[134]=a,t[135]=_e);let ve;t[136]===_e?ve=t[137]:(ve=(0,$.jsx)(I,{children:_e}),t[136]=_e,t[137]=ve);let ye;t[138]===a?ye=t[139]:(ye=a({id:`nTM8ab`}),t[138]=a,t[139]=ye);let be;t[140]===ye?be=t[141]:(be=(0,$.jsx)(F,{children:ye}),t[140]=ye,t[141]=be),t[142]!==ve||t[143]!==be?(W=(0,$.jsxs)(V,{className:`gap-2`,children:[ve,be]}),t[142]=ve,t[143]=be,t[144]=W):W=t[144],N=R,H=`create-saved-theme-form`,U=!0,te=D,M=In,ce=x!==null;let xe;t[145]===a?xe=t[146]:(xe=a({id:`HZ7fEu`}),t[145]=a,t[146]=xe),t[147]===xe?J=t[148]:(J=(0,$.jsx)(Pn,{htmlFor:`create-saved-theme-name`,children:xe}),t[147]=xe,t[148]=J);let Se=x!==null,Ce=x?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,we;t[149]===x?we=t[150]:(we=e=>{b(e.target.value),x&&S(null)},t[149]=x,t[150]=we),t[151]!==y||t[152]!==C||t[153]!==Se||t[154]!==Ce||t[155]!==we?(le=(0,$.jsx)(jn,{ref:T,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:C,"aria-invalid":Se,"aria-describedby":Ce,onChange:we}),t[151]=y,t[152]=C,t[153]=Se,t[154]=Ce,t[155]=we,t[156]=le):le=t[156],j=Fn,ae=`create-saved-theme-help`,oe=`font-mono`,se=e.ok?a({id:`Yb82LN`,values:{0:e.stem}}):a({id:`4d0VYJ`}),t[10]=a,t[11]=x,t[12]=y,t[13]=_,t[14]=d,t[15]=m,t[16]=C,t[17]=l,t[18]=r,t[19]=i,t[20]=u,t[21]=f,t[22]=g,t[23]=A,t[24]=h,t[25]=o,t[26]=c,t[27]=s,t[28]=j,t[29]=M,t[30]=N,t[31]=P,t[32]=B,t[33]=H,t[34]=U,t[35]=te,t[36]=W,t[37]=ne,t[38]=G,t[39]=K,t[40]=q,t[41]=re,t[42]=ie,t[43]=ae,t[44]=oe,t[45]=se,t[46]=ce,t[47]=J,t[48]=le}else j=t[28],M=t[29],N=t[30],P=t[31],B=t[32],H=t[33],U=t[34],te=t[35],W=t[36],ne=t[37],G=t[38],K=t[39],q=t[40],re=t[41],ie=t[42],ae=t[43],oe=t[44],se=t[45],ce=t[46],J=t[47],le=t[48];let Y;t[157]!==j||t[158]!==ae||t[159]!==oe||t[160]!==se?(Y=(0,$.jsx)(j,{id:ae,className:oe,children:se}),t[157]=j,t[158]=ae,t[159]=oe,t[160]=se,t[161]=Y):Y=t[161];let ue;t[162]===x?ue=t[163]:(ue=x?(0,$.jsx)(Nn,{id:`create-saved-theme-error`,children:x}):null,t[162]=x,t[163]=ue);let de;t[164]!==M||t[165]!==Y||t[166]!==ue||t[167]!==ce||t[168]!==J||t[169]!==le?(de=(0,$.jsxs)(M,{"data-invalid":ce,children:[J,le,Y,ue]}),t[164]=M,t[165]=Y,t[166]=ue,t[167]=ce,t[168]=J,t[169]=le,t[170]=de):de=t[170];let fe;t[171]!==H||t[172]!==U||t[173]!==te||t[174]!==de?(fe=(0,$.jsx)(`form`,{id:H,noValidate:U,onSubmit:te,children:de}),t[171]=H,t[172]=U,t[173]=te,t[174]=de,t[175]=fe):fe=t[175];let pe;t[176]!==N||t[177]!==fe?(pe=(0,$.jsx)(N,{children:fe}),t[176]=N,t[177]=fe,t[178]=pe):pe=t[178];let me;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(me=()=>v(!1),t[179]=me):me=t[179];let he;t[180]===a?he=t[181]:(he=a({id:`dEgA5A`}),t[180]=a,t[181]=he);let ge;t[182]!==C||t[183]!==he?(ge=(0,$.jsx)(O,{type:`button`,variant:`outline`,disabled:C,onClick:me,children:he}),t[182]=C,t[183]=he,t[184]=ge):ge=t[184];let _e;t[185]!==a||t[186]!==C?(_e=a(C?{id:`_DwR-n`}:{id:`cuHhjo`}),t[185]=a,t[186]=C,t[187]=_e):_e=t[187];let ve;t[188]!==C||t[189]!==_e?(ve=(0,$.jsx)(O,{type:`submit`,form:`create-saved-theme-form`,disabled:C,children:_e}),t[188]=C,t[189]=_e,t[190]=ve):ve=t[190];let ye;t[191]!==ge||t[192]!==ve?(ye=(0,$.jsxs)(z,{children:[ge,ve]}),t[191]=ge,t[192]=ve,t[193]=ye):ye=t[193];let be;t[194]!==P||t[195]!==W||t[196]!==pe||t[197]!==ye?(be=(0,$.jsxs)(P,{children:[W,pe,ye]}),t[194]=P,t[195]=W,t[196]=pe,t[197]=ye,t[198]=be):be=t[198];let xe;t[199]!==B||t[200]!==ne||t[201]!==G||t[202]!==be?(xe=(0,$.jsx)(B,{open:ne,onOpenChange:G,children:be}),t[199]=B,t[200]=ne,t[201]=G,t[202]=be,t[203]=xe):xe=t[203];let Se;return t[204]!==K||t[205]!==q||t[206]!==re||t[207]!==ie||t[208]!==xe?(Se=(0,$.jsxs)(`div`,{className:K,children:[q,re,ie,xe]}),t[204]=K,t[205]=q,t[206]=re,t[207]=ie,t[208]=xe,t[209]=Se):Se=t[209],Se}function fi(e){return e.id}function pi(e){return e.id}function mi(e){return e.id.startsWith(`saved-`)}function hi(e){let t=Je(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function gi(e){return e.id!==`custom`}function _i(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:_i(r,t)}}function vi(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function yi(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function bi(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function xi(e){let t=(0,Z.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=lr(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{Si(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,Q.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>Ci(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function Si(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function Ci(e,t,n){let r=e.getValues(n),i=_i(Ei(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if($e(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:wi(a.error,n)});return!1}function wi(e,t){if($e(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>Ti(e,t));if(n)return n.message}return nt(e)}function Ti(e,t){return e.path.map(String).join(`.`)===t}function Ei(e){return e.split(`.`)}var Di={light:{id:`1njn7W`},dark:{id:`pvnfJD`},system:{id:`D-NlUC`}};function Oi(e){if(!$e(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function ki(){let e=(0,Z.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Vn,{className:`h-5 w-32`}),n=(0,$.jsx)(Vn,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Vn,{className:`h-9 w-full`}),(0,$.jsx)(Vn,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function Ai({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=p(),a=pr(),o=Ct(),s=qe(Ae,e.path),c=s?yi(s):void 0,l=s?vi(s):void 0,u=s?bi(s):void 0,d=s?it(s):void 0,m=d?.scope===`project`&&t!==`project`||d?.scope===`user`&&t!==`user`,h=e.path.join(`.`),g=i(e.label),[_,v]=(0,Q.useState)(!1),y=(0,Q.useRef)(null);(0,Q.useEffect)(()=>()=>{y.current&&clearTimeout(y.current)},[]);let b=()=>{v(!0),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>v(!1),1200)},S=()=>{let e=n(h);return e&&b(),e},C=()=>a.getFieldState(h).isDirty?S():!0,w=()=>{if(e.control===`theme-tiles`){let e=o?.userBinding;if(!e)return;let t=e.patch({appearance:Ot()});t.ok?b():a.setError(h,{type:`manual`,message:wi(t.error,h)});return}let t=l===void 0?null:l;a.setValue(h,t,{shouldDirty:!1}),S()},T=x(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(ur,{control:a.control,name:h,render:({field:n})=>{let r=!m&&(l!==void 0||n.value!==void 0);return(0,$.jsxs)(cr,{className:T,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(fr,{className:`text-sm font-medium`,children:g}),r?(0,$.jsxs)(j,{children:[(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(O,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:w,"aria-label":i({id:`lhjq3G`,values:{labelText:g}}),children:(0,$.jsx)(ce,{className:`size-3.5`})})}),(0,$.jsx)(A,{children:(0,$.jsx)(f,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(mr,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(dr,{children:(0,$.jsx)(ji,{field:e,ctl:n,typeTag:c,enumOptions:u,onCommit:C,onSavedOutsideForm:b,onWriteRejected:e=>{a.setError(h,{type:`manual`,message:wi(e,h)})}})}),(0,$.jsx)(Fi,{visible:_,srOnly:e.control===`theme-tiles`})]}),(0,$.jsx)(hr,{"data-field-error":e.path.join(`.`)})]})}})}function ji({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,onSavedOutsideForm:a,onWriteRejected:o,...s}){"use no memo";let{_:c}=p(),{setTheme:l,systemTheme:u}=h(),d=Ct(),f=d?.merged??null;if(e.control===`language-select`)return(0,$.jsx)(ei,{...s,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=Rn(t.value)??`system`;n!==e&&Gr({from:n,to:e}),t.onChange(e),i()}});if(e.control===`theme-tiles`){let{id:t,...n}=s,r=f?.appearance?.customTheme,i=f?.appearance?.theme,p=Ve(i,u===`dark`);return(0,$.jsx)(di,{...n,firstItemId:t,appearance:f?.appearance,customSeed:r,slotMode:p,"aria-label":c(e.label),onAssign:(e,t,n,s)=>{let c=d?.userBinding;if(!c)return;let u={...n,[e]:t},f=e=>{let t=e[p];return t===`custom`?bt(kt(r)):yt(t,s)};Dt({selection:u,modePreference:i,slotMode:p,customSeed:r,themes:s});let m=f(u);m&&l(m);let h=c.patch({appearance:At(u)});if(h.ok){Jr(u),a();return}Dt({selection:n,modePreference:i,slotMode:p,customSeed:r,themes:s}),l(f(n)??i??`system`),o(h.error)}})}if(n===`boolean`)return(0,$.jsx)(J,{...s,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...a}=s,o=e.path[0]===`appearance`&&e.path[1]===`theme`;return(0,$.jsx)(ue,{...a,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(o&&l(e),t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":c(e.label),children:r.map((e,t)=>{let r=Di[e];return(0,$.jsx)(le,{value:e,id:t===0?n:void 0,className:r?`text-1sm`:`text-1sm capitalize`,children:r?c(r):e},e)})})}return n===`number`||n===`int`?(0,$.jsx)(Ni,{ctl:t,onCommit:i,...s}):n===`array`?(0,$.jsx)(Pi,{ctl:t,onCommit:i,...s}):(0,$.jsx)(Mi,{ctl:t,onCommit:i,...s})}function Mi({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(jn,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function Ni({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Q.useState)(e.value===void 0?``:String(e.value)),a=(0,Q.useRef)(e.value);(0,Q.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(jn,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function Pi({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
|
|
1
|
+
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{Qt as r,an as i,jn as a,kn as o,on as s,rn as c,sn as l,tn as u}from"./DocumentContext-BrnqRC7f.js";import{t as d}from"./react-f2sANaYj.js";import{n as f,r as p}from"./dist-Nvb76hAm.js";import{t as m}from"./useQuery-ZeEDLtxh.js";import{n as h}from"./dist-PQ5KMVDh.js";import{t as g}from"./compiler-runtime-BfE3aGVn.js";import{a as _,c as v,o as y,r as b}from"./local-menu-action-bus-Cypryz6Z.js";import{t as x}from"./utils-CPqDy6Hr.js";import{a as S,h as C,i as w,m as T,n as E,t as D}from"./ChangedOutsideBadge-DrITuwxs.js";import{t as O}from"./button-CA0dewJJ.js";import{i as k,n as A,t as j}from"./tooltip-DHXgxWLL.js";import{n as M,r as N,t as P}from"./collapsible-COrqeoHr.js";import{a as F,c as I,i as L,n as R,o as z,r as B,s as V,t as ee}from"./dialog-R8GugqUq.js";import{t as H}from"./checkbox-Bxl4H4lV.js";import{a as U,m as te,r as W,t as ne}from"./dropdown-menu-CLgDYkh1.js";import{t as G}from"./label-B5yNUINo.js";import{i as K,n as q,o as re,s as ie,t as ae}from"./select-CguJodwX.js";import{n as oe,t as se}from"./radio-group-BSCe7mNt.js";import{n as ce}from"./separator-vdmCepR4.js";import{t as J}from"./switch-B2sF5R0q.js";import{n as le,r as Y,t as ue}from"./toggle-group-CZcn-1gX.js";import{S as de,a as fe,c as pe,d as me,f as he,i as ge,l as _e,m as ve,n as ye,o as be,r as xe,s as Se,u as Ce,v as we,y as Te}from"./terminal-cli-display-Co0kpfr2.js";import{i as Ee}from"./terminal-telemetry-C-cKlmwu.js";import{$o as De,Ai as Oe,Do as ke,Fo as Ae,Ga as je,Go as Me,Gt as Ne,Ko as Pe,Kt as Fe,Lo as Ie,Mr as Le,No as Re,Po as ze,Ro as Be,Ss as Ve,Wo as He,Xa as Ue,Xo as We,Yo as Ge,Zo as Ke,bs as qe,gs as Je,hs as Ye,kn as Xe,ls as Ze,ms as Qe,os as $e,ps as et,qa as tt,rs as nt,sr as rt,ts as it,tt as at,xs as ot,ys as st,yt as ct}from"./dist-C27Q9mDy.js";import{t as lt}from"./trace-api-18gcBe0u.js";import{a as ut,c as dt,d as ft,g as pt,l as mt,n as ht,p as gt,u as _t}from"./use-settings-route-Di4sAvRi.js";import{t as vt}from"./dist-DUfEoSbR.js";import{n as X}from"./dist-B6jB2qbD2.js";import{a as yt,c as bt,d as xt,f as St,g as Ct,h as wt,i as Tt,l as Et,n as Dt,o as Ot,p as kt,s as At,u as jt}from"./use-apply-config-color-theme-BApSgC_I.js";import{t as Mt}from"./createLucideIcon-Bhw2PmPp.js";import{a as Nt,c as Pt,d as Ft,s as It,t as Lt}from"./EnableSyncConfirmDialog-BpR4lOGV.js";import{t as Rt}from"./arrow-up-right-CGe6dTck.js";import{t as zt}from"./RegisteredAgentIcon-BxpJAHOj.js";import{t as Bt}from"./check-CGfmW4da.js";import{t as Vt}from"./chevron-right-Diamp-K_.js";import{n as Ht,t as Ut}from"./lint-plugin-meta-CsGPauME.js";import{r as Wt,t as Gt}from"./CopyButton-CKyZY1PL.js";import{i as Kt,r as qt}from"./prop-types-CxA_rPl_.js";import{A as Jt,C as Yt,D as Xt,E as Zt,L as Qt,M as $t,N as en,P as tn,S as nn,V as rn,_ as an,b as on,d as sn,f as cn,g as ln,i as un,j as dn,k as fn,l as pn,n as mn,o as hn,u as gn,v as _n,x as vn,y as yn,z as bn}from"./auth-state-cache-BvGXSOYb.js";import{o as xn}from"./folder-config-api-BKVZKM0Y.js";import{t as Sn}from"./info-w0kv2CeC.js";import{t as Cn}from"./spinner-CHTY-VE-.js";import{t as wn}from"./square-pen-DdAKbKU7.js";import{t as Tn}from"./terminal-DRi0ugpC.js";import{t as En}from"./trash-2-BWJWOK8-.js";import{t as Dn}from"./triangle-alert-DV20-jn9.js";import{t as On}from"./x-BaJrHZK_.js";import{d as kn}from"./doc-paths-BVBn68AJ.js";import{t as An}from"./ConfigSharingInfoTooltip-CuqrTakc.js";import{t as jn}from"./input-BFt4qZaV.js";import{t as Mn}from"./badge-BYteLKha.js";import{i as Nn,o as Pn,r as Fn,t as In}from"./field-CvwbVfuf.js";import{a as Ln,n as Rn}from"./config-provider-C5Tk3I1Q.js";import{t as zn}from"./external-link-3El87eIe.js";import{t as Bn}from"./textarea-CzW0aR0j.js";import{t as Vn}from"./skeleton-BOVIbSHk.js";import{d as Hn,n as Un,r as Wn,t as Gn,u as Kn}from"./lint-config-client-kEetoezQ.js";import{_ as qn,a as Jn,d as Yn,f as Xn,g as Zn,h as Qn,i as $n,o as er,s as tr,t as nr,u as rr}from"./sortable.esm-Dd5A8_XI.js";import{t as ir}from"./open-managed-artifact-tab-b7h2CbkR.js";import{n as ar,r as or,t as sr}from"./input-group-ClrIuhWi.js";import{a as cr,f as lr,i as ur,n as dr,o as fr,p as pr,r as mr,s as hr,t as gr}from"./form-dlFqxdSN.js";import{r as _r,t as vr}from"./terminal-command-events-DXmeHtnk.js";import{t as yr}from"./tag-pill-input-Bcisv-E4.js";import{t as br}from"./markdownlint-rule-browser-Chpu90_w.js";import{i as xr,n as Sr}from"./schema-fields-view-intent-D0jz38_6.js";import{n as Cr,t as wr}from"./use-terminal-enabled-D26F4OF8.js";var Tr=Mt(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Er=Mt(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Dr=Mt(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Or=Mt(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=g(),Q=e(d(),1),$=n(),kr=`settings-sharing-title`;function Ar(){let e=(0,Z.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,$.jsx)(jr,{}):(0,$.jsx)(Mr,{}),e[0]=n):n=e[0],n}function jr(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`h3`,{id:kr,className:`text-base font-semibold`,children:(0,$.jsx)(f,{id:`cs4mps`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`section`,{"aria-labelledby":kr,className:`space-y-3`,children:(0,$.jsxs)(`div`,{className:`space-y-1`,children:[t,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})]})}),e[1]=n):n=e[1],n}function Mr(){let e=(0,Z.c)(39),{_:t}=p(),[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(null),c;e[0]===t?c=e[1]:(c=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r(Pr)}},e[0]=t,e[1]=c);let l=c,u;e[2]===l?u=e[3]:(u=()=>{l()},e[2]=l,e[3]=u);let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],e[4]=d):d=e[4],(0,Q.useEffect)(u,d);let m;e[5]!==t||e[6]!==i||e[7]!==l||e[8]!==n?(m=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),s(null);let o=null,c=null;try{o=await r.setMode(e)}catch(e){c=e}if(a(!1),c!==null){X.error(c instanceof Error?c.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(s({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`wdzBgi`}:{id:`k_pade`})),await l())},e[5]=t,e[6]=i,e[7]=l,e[8]=n,e[9]=m):m=e[9];let h=m,g;e[10]!==t||e[11]!==i||e[12]!==l||e[13]!==n?(g=async function(){let e=window.okDesktop?.sharing;if(!e||n===null||i)return;a(!0);let r=null,o=null;try{r=await e.setSkillsShared(!1)}catch(e){o=e}if(a(!1),o!==null){X.error(o instanceof Error?o.message:t({id:`onTlRk`}));return}if(r!==null){if(r.kind===`no-exclude`){let e=r.reason===`no-git`?t({id:`Xwump4`}):r.reason===`inaccessible`?t({id:`PlGC6r`}):t({id:`zcmYx4`});X.warning(t({id:`4h3e0H`,values:{detail:e}}));return}X.success(t({id:`P3S14k`})),await l()}},e[10]=t,e[11]=i,e[12]=l,e[13]=n,e[14]=g):g=e[14];let _=g;if(n===null){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":kr,className:`space-y-3`,children:[(0,$.jsx)(`h3`,{id:kr,className:`text-base font-semibold`,children:(0,$.jsx)(f,{id:`cs4mps`})}),(0,$.jsx)(Vn,{className:`h-24`})]}),e[15]=t):t=e[15],t}let v=n.mode===`no-git`,y;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`h3`,{id:kr,className:`text-base font-semibold`,children:(0,$.jsx)(f,{id:`cs4mps`})}),(0,$.jsx)(An,{})]}),e[16]=y):y=e[16];let b;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[y,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`N55YNr`})})]}),e[17]=b):b=e[17];let x;e[18]!==i||e[19]!==v||e[20]!==h||e[21]!==n.mode?(x=v?(0,$.jsx)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,$.jsx)(f,{id:`ju38ms`})}):(0,$.jsxs)(se,{value:n.mode,onValueChange:e=>void h(e),disabled:i,className:`gap-2`,"aria-labelledby":kr,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(oe,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(f,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`dJw2_7`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(oe,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(f,{id:`QjzFZj`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`un-K1H`})})]})]})]}),e[18]=i,e[19]=v,e[20]=h,e[21]=n.mode,e[22]=x):x=e[22];let S;e[23]!==i||e[24]!==_||e[25]!==n.mode||e[26]!==n.skillsShared?(S=n.mode===`local-only`&&n.skillsShared?(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-skills-exception`,children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(f,{id:`Kiytqd`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`K0FgsP`})})]}),(0,$.jsx)(O,{variant:`outline`,size:`sm`,disabled:i,onClick:()=>void _(),children:(0,$.jsx)(f,{id:`9uI_rE`})})]}):null,e[23]=i,e[24]=_,e[25]=n.mode,e[26]=n.skillsShared,e[27]=S):S=e[27];let C;e[28]===o?C=e[29]:(C=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(f,{id:`ZscwQ0`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>s(null),children:(0,$.jsx)(f,{id:`1QfxQT`})})]}),e[28]=o,e[29]=C);let w;e[30]!==o||e[31]!==n.mode||e[32]!==n.trackedUpstream?(w=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(f,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(Nr)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[30]=o,e[31]=n.mode,e[32]=n.trackedUpstream,e[33]=w):w=e[33];let T;return e[34]!==w||e[35]!==x||e[36]!==S||e[37]!==C?(T=(0,$.jsxs)(`section`,{"aria-labelledby":kr,className:`space-y-4`,"data-testid":`settings-sharing`,children:[b,x,S,C,w]}),e[34]=w,e[35]=x,e[36]=S,e[37]=C,e[38]=T):T=e[38],T}function Nr(e){return(0,$.jsx)(`li`,{children:e},e)}function Pr(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[],skillsShared:!1}}function Fr(e){let t=(0,Z.c)(35),{authQueryTransport:n,authTransport:r}=e,{_:i}=p(),a;t[0]===n?a=t[1]:(a=n??Qt(),t[0]=n,t[1]=a);let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={phase:`loading`},t[2]=s):s=t[2];let[c,l]=(0,Q.useState)(s),[u,d]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(null),v=(0,Q.useRef)(!1),y;t[3]===o?y=t[4]:(y=async function(){l({phase:`loading`});try{let e=await o.status();l({phase:`loaded`,result:e}),mn(e.authenticated)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),l({phase:`check-failed`})}},t[3]=o,t[4]=y);let b=y,x;t[5]===b?x=t[6]:(x=()=>{b()},t[5]=b,t[6]=x);let S;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[7]=S):S=t[7],(0,Q.useEffect)(x,S);let C;t[8]!==i||t[9]!==b||t[10]!==o?(C=async function(){if(v.current)return;v.current=!0,d(!1),h(!0),_(null);let e=null;try{let t=o.signout?await o.signout():{ok:!1,error:i({id:`8cpOa8`})};t.ok||(e=t.error??i({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=i({id:`8cpOa8`})}await b(),e&&_(e),h(!1),v.current=!1},t[8]=i,t[9]=b,t[10]=o,t[11]=C):C=t[11];let w=C,T;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(`h3`,{id:`settings-account-title`,className:`text-base font-semibold`,children:(0,$.jsx)(f,{id:`AeXO77`})}),t[12]=T):T=t[12];let E;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[T,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`E6lrpp`})})]}),t[13]=E):E=t[13];let D;t[14]!==g||t[15]!==m||t[16]!==w||t[17]!==b||t[18]!==c.phase||t[19]!==c.result?(D=c.phase===`loading`?(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(f,{id:`IWGfGF`})}),(0,$.jsx)(Vn,{className:`h-4 w-40`}),(0,$.jsx)(Vn,{className:`h-8 w-32`})]}):c.phase===`check-failed`?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`T_wG4n`})}),(0,$.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:(0,$.jsx)(f,{id:`KDw4GX`})})]}):c.result.authenticated?c.result.tier===`A`?(0,$.jsx)(Lr,{login:c.result.login}):(0,$.jsx)(Ir,{login:c.result.login,disconnecting:m,error:g,onDisconnect:()=>void w()}):(0,$.jsx)(Rr,{onConnect:()=>d(!0)}),t[14]=g,t[15]=m,t[16]=w,t[17]=b,t[18]=c.phase,t[19]=c.result,t[20]=D):D=t[20];let k;t[21]===b?k=t[22]:(k=e=>{d(e),e||b()},t[21]=b,t[22]=k);let A=c.phase===`loaded`?c.result.host:void 0,j=c.phase===`loaded`?c.result.ghAvailable:void 0,M;t[23]===b?M=t[24]:(M=()=>{b()},t[23]=b,t[24]=M);let N;t[25]!==u||t[26]!==r||t[27]!==k||t[28]!==A||t[29]!==j||t[30]!==M?(N=(0,$.jsx)(tn,{open:u,onOpenChange:k,transport:r,host:A,ghAvailable:j,onSuccess:M}),t[25]=u,t[26]=r,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N):N=t[31];let P;return t[32]!==N||t[33]!==D?(P=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[E,D,N]}),t[32]=N,t[33]=D,t[34]=P):P=t[34],P}function Ir(e){let t=(0,Z.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(f,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(f,{id:`nxlOpL`})}),t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[3]=o,t[4]=c);let l;t[5]===r?l=t[6]:(l=r?(0,$.jsx)(f,{id:`rppgXF`}):(0,$.jsx)(f,{id:`-K0AvT`}),t[5]=r,t[6]=l);let u;t[7]!==r||t[8]!==a||t[9]!==l?(u=(0,$.jsx)(O,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:l}),t[7]=r,t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==c||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(f,{id:`msOK6I`})}),t[14]=p):p=t[14];let m;t[15]===i?m=t[16]:(m=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=m);let h;return t[17]!==d||t[18]!==m?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[d,p,m]}),t[17]=d,t[18]=m,t[19]=h):h=t[19],h}function Lr(e){let t=(0,Z.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(f,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(f,{id:`ny6vNn`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r,i]})}),t[3]=r,t[4]=a),a}function Rr(e){let t=(0,Z.c)(5),{onConnect:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(f,{id:`S33tz3`})}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(f,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(f,{id:`5lWFkC`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(O,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function zr(e){return e.kind===`editor`?`editor:${e.id}`:e.kind===`skill`?`skill:${e.id}`:`path`}function Br(e){let t=(0,Z.c)(11),{testId:n,children:r}=e,{_:i}=p(),a;t[0]===i?a=t[1]:(a=i({id:`2B6eYX`}),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Sn,{className:`size-3.5`}),t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==n?(s=(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(O,{variant:`ghost`,size:`icon`,className:`mt-1.5 mr-1.5 h-6 w-6 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,"aria-label":a,"data-testid":n,children:o})}),t[3]=a,t[4]=n,t[5]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=(0,$.jsx)(A,{side:`left`,className:`max-w-sm text-left`,children:(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:r})}),t[6]=r,t[7]=c);let l;return t[8]!==s||t[9]!==c?(l=(0,$.jsxs)(j,{children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Vr(){let e=(0,Z.c)(38),{_:t}=p(),n=typeof window<`u`?window.okDesktop??null:null,[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(null),l,u;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{if(!n)return;let e=!1;return n.integrations.status().then(t=>{e||i(t)}).catch(()=>{e||o(!0)}),()=>{e=!0}},u=[n],e[0]=l,e[1]=u):(l=e[0],u=e[1]),(0,Q.useEffect)(l,u);let d;e[2]===t?d=e[3]:(d=async function(e,r){if(n){c(zr(e));try{let t=await n.integrations.setComponent({component:e,enabled:r});i(t.status),t.ok||X.error(t.error)}catch(e){let n=e;X.error(t({id:`gfdqcY`,values:{0:n instanceof Error?n.message:String(n)}}))}c(null)}},e[2]=t,e[3]=d);let m=d,h;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`h3`,{id:`settings-ai-tools-title`,className:`text-base font-semibold`,children:(0,$.jsx)(f,{id:`_5qBNl`})}),e[4]=h):h=e[4];let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[h,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(f,{id:`mLAjyL`})})]}),e[5]=g):g=e[5];let _=g;if(!n||a){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`ai-tools-unavailable`,children:(0,$.jsx)(f,{id:`O4PnDd`})})]}),e[6]=t):t=e[6],t}if(r===null){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsxs)(`div`,{className:`space-y-2`,"data-testid":`ai-tools-loading`,children:[(0,$.jsx)(Vn,{className:`h-10 w-full`}),(0,$.jsx)(Vn,{className:`h-10 w-full`}),(0,$.jsx)(Vn,{className:`h-10 w-full`})]})]}),e[7]=t):t=e[7],t}let v=s!==null||!r.available,y=r.path.shellDetected||r.path.installed,b;e[8]===r.available?b=e[9]:(b=!r.available&&(0,$.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,"data-testid":`ai-tools-read-only`,children:(0,$.jsx)(f,{id:`OplnBG`})}),e[8]=r.available,e[9]=b);let x;e[10]!==t||e[11]!==m||e[12]!==v||e[13]!==y||e[14]!==r.path.installed||e[15]!==r.path.rcFilesToTouch?(x=y&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(f,{id:`ALhMYW`})}),(0,$.jsxs)(`div`,{className:`flex items-start overflow-hidden rounded-md border border-border bg-card/50 hover:bg-accent`,children:[(0,$.jsxs)(G,{htmlFor:`ai-tools-path`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(H,{id:`ai-tools-path`,checked:r.path.installed,disabled:v,onCheckedChange:()=>void m({kind:`path`},!r.path.installed),className:`mt-0.5`,"data-testid":`ai-tools-path-checkbox`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(f,{id:`Fsx78O`,components:{0:(0,$.jsx)(`code`,{className:`inline-code`})}})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-path-status`,children:r.path.installed?t({id:`yhdqox`}):t({id:`04XyCH`,values:{0:r.path.rcFilesToTouch.join(`, `)}})})]})]}),(0,$.jsxs)(Br,{testId:`ai-tools-path-info`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(f,{id:`f9lQNJ`})}),r.path.rcFilesToTouch.map(Ur),(0,$.jsx)(`p`,{className:`pt-1`,children:(0,$.jsx)(f,{id:`CWzc2T`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]})]})]}),e[10]=t,e[11]=m,e[12]=v,e[13]=y,e[14]=r.path.installed,e[15]=r.path.rcFilesToTouch,e[16]=x):x=e[16];let S;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(f,{id:`psfGPX`})}),e[17]=S):S=e[17];let C;if(e[18]!==t||e[19]!==m||e[20]!==v||e[21]!==r.editors){let n;e[23]!==t||e[24]!==m||e[25]!==v?(n=e=>{let n=e.state===`installed`||e.state===`foreign`,r=v||e.state===`unmanageable`,i=e.state===`not-installed`&&!e.detected,a=`https://openknowledge.ai/docs/integrations/${Ue[e.id]}`,o=e.state===`installed`?t({id:`eQkgKV`}):e.state===`foreign`?t({id:`AczYxH`}):e.state===`unmanageable`?t({id:`LbmLyU`}):e.detected?t({id:`bBE5tC`}):null,s=e.state===`foreign`||e.state===`unmanageable`?`text-xs text-amber-600 dark:text-amber-400`:`text-xs text-muted-foreground`;return(0,$.jsxs)(`li`,{className:r?`flex items-start`:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(G,{htmlFor:`ai-tools-editor-${e.id}`,className:r?`flex flex-1 items-start gap-2.5 px-3 py-2.5 font-normal`:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(H,{id:`ai-tools-editor-${e.id}`,checked:n,disabled:r,onCheckedChange:()=>void m({kind:`editor`,id:e.id},!n),className:`mt-0.5`,"data-testid":`ai-tools-editor-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.label}),o!==null&&(0,$.jsx)(`span`,{className:s,"data-testid":`ai-tools-editor-status-${e.id}`,children:o})]})]}),i&&(0,$.jsxs)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>zn(e,a),onAuxClick:e=>zn(e,a),"aria-label":t({id:`D-Oh1s`,values:{0:e.label}}),className:`flex shrink-0 items-center gap-0.5 px-2 py-2.5 text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`ai-tools-editor-status-${e.id}`,children:[(0,$.jsx)(f,{id:`P_bX4O`}),(0,$.jsx)(Rt,{className:`size-3`,"aria-hidden":!0})]}),(0,$.jsxs)(Br,{testId:`ai-tools-editor-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(f,{id:`J2eKUI`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.configPath??t({id:`ndwmea`})})}),(0,$.jsx)(`p`,{className:`pt-1 opacity-70`,children:(0,$.jsx)(f,{id:`VIwCaD`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.entryLocator})})]})]},e.id)},e[23]=t,e[24]=m,e[25]=v,e[26]=n):n=e[26],C=r.editors.map(n),e[18]=t,e[19]=m,e[20]=v,e[21]=r.editors,e[22]=C}else C=e[22];let w;e[27]===C?w=e[28]:(w=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[S,(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:C})]}),e[27]=C,e[28]=w);let T;e[29]!==m||e[30]!==v||e[31]!==r.skills?(T=r.skills.length>0&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(f,{id:`28B21t`})}),(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:r.skills.map(e=>(0,$.jsxs)(`li`,{className:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(G,{htmlFor:`ai-tools-skill-${e.id}`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(H,{id:`ai-tools-skill-${e.id}`,checked:e.installed,disabled:v,onCheckedChange:()=>void m({kind:`skill`,id:e.id},!e.installed),className:`mt-0.5`,"data-testid":`ai-tools-skill-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(`code`,{children:e.name})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-skill-status-${e.id}`,children:e.id===`discovery`?(0,$.jsx)(f,{id:`0inVGS`}):(0,$.jsx)(f,{id:`FXk_zY`})})]})]}),(0,$.jsxs)(Br,{testId:`ai-tools-skill-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(f,{id:`HSh8u_`})}),e.paths.map(Hr)]})]},e.id))})]}),e[29]=m,e[30]=v,e[31]=r.skills,e[32]=T):T=e[32];let E;return e[33]!==T||e[34]!==b||e[35]!==x||e[36]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,b,x,w,T]}),e[33]=T,e[34]=b,e[35]=x,e[36]=w,e[37]=E):E=e[37],E}function Hr(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function Ur(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}var Wr=`open-knowledge-app`;function Gr({from:e,to:t}){try{lt.getTracer(Wr).startSpan(`ok.language.preferenceChanged`,{attributes:{"ok.language.from":e,"ok.language.to":t}}).end()}catch(e){console.warn(`[language-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}var Kr=`open-knowledge-app`;function qr(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function Jr(e){try{lt.getTracer(Kr).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":qr(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Yr=`system`;function Xr(e){return typeof e==`string`&&Me.includes(e)}function Zr(e){return Xr(e)?e:Yr}function Qr(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function $r(e){let t=(0,Z.c)(6),{choice:n}=e;if(n===Yr){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(f,{id:`D-NlUC`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=Qr(n),t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(`span`,{lang:n,className:`capitalize`,children:r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ei(e){let t=(0,Z.c)(22),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({value:o,onValueChange:r,onBlur:n,ref:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=Zr(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Zr(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,$.jsx)(ie,{children:(0,$.jsx)($r,{choice:c})}),t[10]=c,t[11]=u);let d;t[12]!==n||t[13]!==i||t[14]!==a||t[15]!==u?(d=(0,$.jsx)(re,{...a,ref:i,onBlur:n,size:`sm`,className:`w-48`,children:u}),t[12]=n,t[13]=i,t[14]=a,t[15]=u,t[16]=d):d=t[16];let f;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(q,{children:[(0,$.jsx)(K,{value:Yr,children:(0,$.jsx)($r,{choice:Yr})}),He.map(ti)]}),t[17]=f):f=t[17];let p;return t[18]!==c||t[19]!==l||t[20]!==d?(p=(0,$.jsxs)(ae,{value:c,onValueChange:l,children:[d,f]}),t[18]=c,t[19]=l,t[20]=d,t[21]=p):p=t[21],p}function ti(e){return(0,$.jsx)(K,{value:e,children:(0,$.jsx)($r,{choice:e})},e)}function ni(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function ri(e,t,n){return e.id===`custom`?ni(Ge(kt(t))):e.scheme?ni(Ge(e.scheme)):ni(jt(n))}function ii(e){let t=(0,Z.c)(38),{theme:n,customSeed:r,slotMode:i}=e,a,o,s,c,l,u,d,f,p,m;t[0]!==r||t[1]!==i||t[2]!==n?(a=ri(n,r,i),u=!0,d=``,f=`aspect-[4/3] w-full overflow-hidden rounded-md border`,p={backgroundColor:a.surface,borderColor:a.line},m=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(ai),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]);let h;t[13]!==o||t[14]!==s||t[15]!==c?(h=(0,$.jsx)(`div`,{className:o,style:s,children:c}),t[13]=o,t[14]=s,t[15]=c,t[16]=h):h=t[16];let g;t[17]===a.dots[1]?g=t[18]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[17]=a.dots[1],t[18]=g);let _;t[19]===a.line?_=t[20]:(_=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[19]=a.line,t[20]=_);let v;t[21]===a.dots[0]?v=t[22]:(v=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[21]=a.dots[0],t[22]=v);let y;t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[g,_,v]}),t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;t[27]!==h||t[28]!==y||t[29]!==l?(b=(0,$.jsxs)(`div`,{className:l,children:[h,y]}),t[27]=h,t[28]=y,t[29]=l,t[30]=b):b=t[30];let x;return t[31]!==b||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==p||t[36]!==m?(x=(0,$.jsxs)(`div`,{"aria-hidden":u,"data-theme-swatch":d,className:f,style:p,children:[m,b]}),t[31]=b,t[32]=u,t[33]=d,t[34]=f,t[35]=p,t[36]=m,t[37]=x):x=t[37],x}function ai(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function oi(e){return x(`size-6 min-w-6 rounded-md border p-0 transition-colors`,e?`border-primary bg-primary/15 text-primary hover:bg-primary/20 data-[state=on]:bg-primary/15`:`border-border/70 text-muted-foreground/70 hover:text-foreground`)}function si(e){return x(`size-3.5`,e&&`fill-current`)}function ci(e){let t=(0,Z.c)(32),{selection:n,themes:r,unavailableThemes:i,onAssign:o,editControl:s,deleteControl:c,createControl:l,slotMode:u,customSeed:d,firstItemId:f,"aria-label":m,"aria-describedby":h}=e,g=r===void 0?Pe:r,_;t[0]===i?_=t[1]:(_=i===void 0?[]:i,t[0]=i,t[1]=_);let y=_,b=u===void 0?`light`:u,{_:S}=p(),C;if(t[2]!==S||t[3]!==d||t[4]!==c||t[5]!==s||t[6]!==f||t[7]!==o||t[8]!==n||t[9]!==b||t[10]!==g){let e;t[12]!==S||t[13]!==d||t[14]!==c||t[15]!==s||t[16]!==f||t[17]!==o||t[18]!==n||t[19]!==b?(e=(e,t)=>{let r=n.light===e.id,i=n.dark===e.id,l=s?.themeIds.includes(e.id)??!1,u=c?.themeIds.includes(e.id)??!1,p=s?.selectedId===e.id,m=S(b===`light`?{id:`hgF0al`,values:{0:e.label}}:{id:`6Nea1q`,values:{0:e.label}});return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:x(`relative flex min-w-0 flex-col gap-1.5 rounded-lg border-2 p-1 text-left`,n[b]===e.id?`border-primary`:`border-transparent`),children:[(0,$.jsx)(O,{type:`button`,variant:`ghost`,"aria-label":m,"data-theme-focus-target":``,onClick:()=>o(b,e.id),className:`h-auto w-full cursor-pointer p-0 transition-opacity hover:bg-transparent hover:opacity-90`,children:(0,$.jsx)(ii,{theme:e,customSeed:d,slotMode:b})}),u?(0,$.jsx)(O,{type:`button`,variant:`outline`,size:`icon-sm`,title:S({id:`Y2tU6I`,values:{0:e.label}}),"aria-label":S({id:`Y2tU6I`,values:{0:e.label}}),className:`absolute top-2 end-2 z-10 border-border/80 bg-background/85 text-muted-foreground shadow-sm backdrop-blur-sm hover:border-destructive/50 hover:bg-destructive/15 hover:text-destructive focus-visible:border-destructive/50 focus-visible:text-destructive focus-visible:ring-destructive/20 dark:bg-background/80 dark:hover:bg-destructive/20`,onClick:async t=>{let n=t.currentTarget.closest(`fieldset`),r=n?.previousElementSibling?.querySelector(`[data-theme-focus-target]`)??n?.nextElementSibling?.querySelector(`[data-theme-focus-target]`);await c?.onDelete(e.id)!==!1&&r?.focus()},children:(0,$.jsx)(En,{"aria-hidden":!0})}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-1 px-0.5`,children:[(0,$.jsx)(`span`,{className:`truncate text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[l?(0,$.jsx)(Y,{className:oi(p),pressed:p,onPressedChange:t=>{s?.onSelect(t?e.id:null)},"aria-label":S(p?{id:`8x6zk9`,values:{0:e.label}}:{id:`N6j2JH`,values:{0:e.label}}),children:(0,$.jsx)(a,{className:`size-3.5`})}):null,(0,$.jsx)(Y,{id:t===0?f:void 0,className:oi(r),pressed:r,onPressedChange:t=>{t&&o(`light`,e.id)},"aria-label":S({id:`sq4WQH`,values:{0:e.label}}),children:(0,$.jsx)(Dr,{className:si(r)})}),(0,$.jsx)(Y,{className:oi(i),pressed:i,onPressedChange:t=>{t&&o(`dark`,e.id)},"aria-label":S({id:`lZvQrY`,values:{0:e.label}}),children:(0,$.jsx)(Er,{className:si(i)})})]})]})]},e.id)},t[12]=S,t[13]=d,t[14]=c,t[15]=s,t[16]=f,t[17]=o,t[18]=n,t[19]=b,t[20]=e):e=t[20],C=g.map(e),t[2]=S,t[3]=d,t[4]=c,t[5]=s,t[6]=f,t[7]=o,t[8]=n,t[9]=b,t[10]=g,t[11]=C}else C=t[11];let w;t[21]!==S||t[22]!==l?(w=l?(0,$.jsxs)(O,{type:`button`,variant:`ghost`,onClick:l.onCreate,className:`group h-auto min-w-0 flex-col items-stretch gap-1.5 rounded-lg border-2 border-transparent p-1 text-left text-muted-foreground hover:bg-transparent hover:text-foreground`,children:[(0,$.jsx)(`span`,{className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-dashed border-border bg-muted/10 transition-colors group-hover:border-foreground/40`,children:(0,$.jsx)(v,{"aria-hidden":!0,className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium`,children:S({id:`AJ7_B2`})})]}):null,t[21]=S,t[22]=l,t[23]=w):w=t[23];let T;t[24]===y?T=t[25]:(T=y.map(li),t[24]=y,t[25]=T);let E;return t[26]!==h||t[27]!==m||t[28]!==C||t[29]!==w||t[30]!==T?(E=(0,$.jsxs)(`fieldset`,{"aria-label":m,"aria-describedby":h,className:`grid w-full min-w-0 grid-cols-2 gap-2 sm:grid-cols-3`,children:[C,w,T]}),t[26]=h,t[27]=m,t[28]=C,t[29]=w,t[30]=T,t[31]=E):E=t[31],E}function li(e){return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:`flex min-w-0 flex-col gap-1.5 rounded-lg border-2 border-destructive/40 bg-destructive/5 p-1 text-left`,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-destructive/30 bg-muted/40 text-destructive`,children:(0,$.jsx)(Wt,{className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`px-0.5 text-xs font-medium text-destructive`,children:e.problem}),(0,$.jsx)(`span`,{className:`px-0.5 pb-0.5 text-xs text-muted-foreground`,children:e.detail})]},e.key)}var ui=12e3;function di(e){let t=(0,Z.c)(210),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({appearance:n,onAssign:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=p(),{themes:o,warnings:s,truncated:c,loadError:l,refresh:u,deleteTheme:d,restoreTheme:f,editingThemeId:m,themeEditorOpen:h,selectThemeToEdit:g}=Ln(),[_,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(``),[x,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(!1),T=(0,Q.useRef)(null),E,D;t[4]===u?(E=t[5],D=t[6]):(E=()=>{u()},D=[u],t[4]=u,t[5]=E,t[6]=D),(0,Q.useEffect)(E,D);let k;t[7]!==n||t[8]!==o?(k=st(n,o),t[7]=n,t[8]=o,t[9]=k):k=t[9];let A=k,j,M,N,P,B,H,U,te,W,ne,G,K,q,re,ie,ae,oe,se,ce,J,le;if(t[10]!==a||t[11]!==x||t[12]!==y||t[13]!==_||t[14]!==d||t[15]!==m||t[16]!==C||t[17]!==l||t[18]!==r||t[19]!==i||t[20]!==u||t[21]!==f||t[22]!==g||t[23]!==A||t[24]!==h||t[25]!==o||t[26]!==c||t[27]!==s){let e=De(y),n;t[49]===o?n=t[50]:(n=o.filter(gi),t[49]=o,t[50]=n);let p=n,E,D,k,z,Y,ue,de,fe,pe;if(t[51]!==a||t[52]!==y||t[53]!==d||t[54]!==m||t[55]!==p||t[56]!==C||t[57]!==l||t[58]!==r||t[59]!==i||t[60]!==u||t[61]!==f||t[62]!==g||t[63]!==A||t[64]!==h||t[65]!==o||t[66]!==c||t[67]!==s){let e=o.flatMap(hi),n;t[80]!==a||t[81]!==u||t[82]!==f?(n=async function(e){let t=await f({id:e.id,name:e.scheme.name,stem:e.stem,scheme:{...e.scheme,palette:{...e.scheme.palette}},extension:e.filename.endsWith(`.yml`)?`.yml`:`.yaml`});if(t.ok){await u(),X.success(a({id:`Kx881F`,values:{0:e.label}}));return}if(t.reason===`name-taken`){X.error(a({id:`oZUYMv`,values:{0:e.label}}));return}X.error(a({id:`7O7REc`,values:{0:e.label}}))},t[80]=a,t[81]=u,t[82]=f,t[83]=n):n=t[83];let _=n;k=async function(t){let n=e.find(e=>e.id===t);if(!n)return X.error(a({id:`ANFxWn`})),!1;let r=await d(n.id);if(!r.ok)return X.error(a({id:`kkux8f`,values:{0:n.label}})),!1;if(m===n.id&&g(null),await u(),!r.existed)return X(a({id:`ekSPiP`,values:{0:n.label}})),!0;let i={...n,filename:r.filename,label:r.scheme.name,scheme:r.scheme};return X(a({id:`YCmS3k`,values:{0:i.label}}),{duration:ui,action:{label:a({id:`9uI_rE`}),onClick:()=>_(i)}}),!0};let x;t[84]!==a||t[85]!==y||t[86]!==C||t[87]!==r||t[88]!==i||t[89]!==u||t[90]!==f||t[91]!==g||t[92]!==A||t[93]!==o?(x=async function(e){if(e.preventDefault(),C)return;let t=De(y);if(!t.ok){S(a({id:`RG3yW6`})),T.current?.focus();return}let n=i.slotMode??`light`,s=o.find(e=>e.id===A[n])?.scheme??kt(i.customSeed),c={name:t.name,variant:s.variant,palette:{...s.palette}};S(null),w(!0);let l=await f({id:t.id,name:t.name,scheme:c});if(!l.ok){S(l.reason===`name-taken`?a({id:`_IfSZn`}):l.reason===`name-invalid`?a({id:`qtnmEX`}):a({id:`DmkTrb`})),w(!1),T.current?.focus();return}let d={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>Ge(c)};r(n,l.id,A,[...o,d]),await u(),b(``),v(!1),w(!1),g(l.id)},t[84]=a,t[85]=y,t[86]=C,t[87]=r,t[88]=i,t[89]=u,t[90]=f,t[91]=g,t[92]=A,t[93]=o,t[94]=x):x=t[94],D=x;let j;if(t[95]!==a||t[96]!==s){let e;t[98]===a?e=t[99]:(e=e=>{let t;bb90:switch(e.code){case`unparseable`:t=a({id:`g12y1g`});break bb90;case`not-a-scheme`:t=a({id:`p7Utw8`});break bb90;case`missing-slots`:t=a({id:`GUZHkL`});break bb90;case`bad-hex`:t=a({id:`IMLUBh`});break bb90;case`empty`:t=a({id:`k_tFzX`});break bb90;case`too-long`:t=a({id:`FyyIjH`});break bb90;case`invalid-chars`:t=a({id:`JaU1ld`});break bb90;case`unsupported-extension-case`:t=a({id:`R30SFt`});break bb90;case`duplicate-identity`:t=a({id:`DUb7Ax`});break bb90;case`symlink`:t=a({id:`hFmYGU`});break bb90;case`not-regular-file`:t=a({id:`UH0Zqw`});break bb90;case`file-too-large`:t=a({id:`-othoN`});break bb90;case`read-failed`:t=a({id:`cLn264`});break bb90;default:t=a({id:`WBNpt9`,values:{0:e.code}})}return{key:e.filename,label:e.filename,problem:t,detail:e.conflictingFilenames?a({id:`QwG_zJ`,values:{0:e.conflictingFilenames.join(`, `)}}):a({id:`kwNS82`})}},t[98]=a,t[99]=e),j=s.map(e),t[95]=a,t[96]=s,t[97]=j}else j=t[97];let M=j;K=`flex w-full min-w-0 flex-col gap-2`,t[100]!==a||t[101]!==l||t[102]!==u?(q=l?(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{children:a({id:`hVzt9x`})}),(0,$.jsx)(O,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>void u(),children:a({id:`KDw4GX`})})]}):null,t[100]=a,t[101]=l,t[102]=u,t[103]=q):q=t[103];let N;t[104]!==a||t[105]!==c?(N=c?(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(Dn,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-amber-600`}),(0,$.jsx)(`span`,{children:a({id:`DLIljL`})})]}):null,t[104]=a,t[105]=c,t[106]=N):N=t[106],t[107]===N?re=t[108]:(re=(0,$.jsx)(`div`,{role:`status`,children:N}),t[107]=N,t[108]=re),E=ci,Y=i,ue=A,de=p,fe=M;let P;t[109]===o?P=t[110]:(P=o.filter(mi).map(pi),t[109]=o,t[110]=P);let F=h?m:null;t[111]!==g||t[112]!==P||t[113]!==F?(pe={themeIds:P,selectedId:F,onSelect:g},t[111]=g,t[112]=P,t[113]=F,t[114]=pe):pe=t[114],z=e.map(fi),t[51]=a,t[52]=y,t[53]=d,t[54]=m,t[55]=p,t[56]=C,t[57]=l,t[58]=r,t[59]=i,t[60]=u,t[61]=f,t[62]=g,t[63]=A,t[64]=h,t[65]=o,t[66]=c,t[67]=s,t[68]=E,t[69]=D,t[70]=k,t[71]=K,t[72]=q,t[73]=re,t[74]=z,t[75]=Y,t[76]=ue,t[77]=de,t[78]=fe,t[79]=pe}else E=t[68],D=t[69],k=t[70],K=t[71],q=t[72],re=t[73],z=t[74],Y=t[75],ue=t[76],de=t[77],fe=t[78],pe=t[79];let me;t[115]!==k||t[116]!==z?(me={themeIds:z,onDelete:k},t[115]=k,t[116]=z,t[117]=me):me=t[117];let he;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(he={onCreate:()=>v(!0)},t[118]=he):he=t[118];let ge;t[119]!==r||t[120]!==A||t[121]!==o?(ge=(e,t)=>r(e,t,A,o),t[119]=r,t[120]=A,t[121]=o,t[122]=ge):ge=t[122],t[123]!==E||t[124]!==Y||t[125]!==ue||t[126]!==de||t[127]!==fe||t[128]!==pe||t[129]!==me||t[130]!==ge?(ie=(0,$.jsx)(E,{...Y,selection:ue,themes:de,unavailableThemes:fe,editControl:pe,deleteControl:me,createControl:he,onAssign:ge}),t[123]=E,t[124]=Y,t[125]=ue,t[126]=de,t[127]=fe,t[128]=pe,t[129]=me,t[130]=ge,t[131]=ie):ie=t[131],B=ee,ne=_,t[132]===C?G=t[133]:(G=e=>{C||v(e)},t[132]=C,t[133]=G),P=L;let _e;t[134]===a?_e=t[135]:(_e=a({id:`Z_nNa2`}),t[134]=a,t[135]=_e);let ve;t[136]===_e?ve=t[137]:(ve=(0,$.jsx)(I,{children:_e}),t[136]=_e,t[137]=ve);let ye;t[138]===a?ye=t[139]:(ye=a({id:`nTM8ab`}),t[138]=a,t[139]=ye);let be;t[140]===ye?be=t[141]:(be=(0,$.jsx)(F,{children:ye}),t[140]=ye,t[141]=be),t[142]!==ve||t[143]!==be?(W=(0,$.jsxs)(V,{className:`gap-2`,children:[ve,be]}),t[142]=ve,t[143]=be,t[144]=W):W=t[144],N=R,H=`create-saved-theme-form`,U=!0,te=D,M=In,ce=x!==null;let xe;t[145]===a?xe=t[146]:(xe=a({id:`HZ7fEu`}),t[145]=a,t[146]=xe),t[147]===xe?J=t[148]:(J=(0,$.jsx)(Pn,{htmlFor:`create-saved-theme-name`,children:xe}),t[147]=xe,t[148]=J);let Se=x!==null,Ce=x?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,we;t[149]===x?we=t[150]:(we=e=>{b(e.target.value),x&&S(null)},t[149]=x,t[150]=we),t[151]!==y||t[152]!==C||t[153]!==Se||t[154]!==Ce||t[155]!==we?(le=(0,$.jsx)(jn,{ref:T,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:C,"aria-invalid":Se,"aria-describedby":Ce,onChange:we}),t[151]=y,t[152]=C,t[153]=Se,t[154]=Ce,t[155]=we,t[156]=le):le=t[156],j=Fn,ae=`create-saved-theme-help`,oe=`font-mono`,se=e.ok?a({id:`Yb82LN`,values:{0:e.stem}}):a({id:`4d0VYJ`}),t[10]=a,t[11]=x,t[12]=y,t[13]=_,t[14]=d,t[15]=m,t[16]=C,t[17]=l,t[18]=r,t[19]=i,t[20]=u,t[21]=f,t[22]=g,t[23]=A,t[24]=h,t[25]=o,t[26]=c,t[27]=s,t[28]=j,t[29]=M,t[30]=N,t[31]=P,t[32]=B,t[33]=H,t[34]=U,t[35]=te,t[36]=W,t[37]=ne,t[38]=G,t[39]=K,t[40]=q,t[41]=re,t[42]=ie,t[43]=ae,t[44]=oe,t[45]=se,t[46]=ce,t[47]=J,t[48]=le}else j=t[28],M=t[29],N=t[30],P=t[31],B=t[32],H=t[33],U=t[34],te=t[35],W=t[36],ne=t[37],G=t[38],K=t[39],q=t[40],re=t[41],ie=t[42],ae=t[43],oe=t[44],se=t[45],ce=t[46],J=t[47],le=t[48];let Y;t[157]!==j||t[158]!==ae||t[159]!==oe||t[160]!==se?(Y=(0,$.jsx)(j,{id:ae,className:oe,children:se}),t[157]=j,t[158]=ae,t[159]=oe,t[160]=se,t[161]=Y):Y=t[161];let ue;t[162]===x?ue=t[163]:(ue=x?(0,$.jsx)(Nn,{id:`create-saved-theme-error`,children:x}):null,t[162]=x,t[163]=ue);let de;t[164]!==M||t[165]!==Y||t[166]!==ue||t[167]!==ce||t[168]!==J||t[169]!==le?(de=(0,$.jsxs)(M,{"data-invalid":ce,children:[J,le,Y,ue]}),t[164]=M,t[165]=Y,t[166]=ue,t[167]=ce,t[168]=J,t[169]=le,t[170]=de):de=t[170];let fe;t[171]!==H||t[172]!==U||t[173]!==te||t[174]!==de?(fe=(0,$.jsx)(`form`,{id:H,noValidate:U,onSubmit:te,children:de}),t[171]=H,t[172]=U,t[173]=te,t[174]=de,t[175]=fe):fe=t[175];let pe;t[176]!==N||t[177]!==fe?(pe=(0,$.jsx)(N,{children:fe}),t[176]=N,t[177]=fe,t[178]=pe):pe=t[178];let me;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(me=()=>v(!1),t[179]=me):me=t[179];let he;t[180]===a?he=t[181]:(he=a({id:`dEgA5A`}),t[180]=a,t[181]=he);let ge;t[182]!==C||t[183]!==he?(ge=(0,$.jsx)(O,{type:`button`,variant:`outline`,disabled:C,onClick:me,children:he}),t[182]=C,t[183]=he,t[184]=ge):ge=t[184];let _e;t[185]!==a||t[186]!==C?(_e=a(C?{id:`_DwR-n`}:{id:`cuHhjo`}),t[185]=a,t[186]=C,t[187]=_e):_e=t[187];let ve;t[188]!==C||t[189]!==_e?(ve=(0,$.jsx)(O,{type:`submit`,form:`create-saved-theme-form`,disabled:C,children:_e}),t[188]=C,t[189]=_e,t[190]=ve):ve=t[190];let ye;t[191]!==ge||t[192]!==ve?(ye=(0,$.jsxs)(z,{children:[ge,ve]}),t[191]=ge,t[192]=ve,t[193]=ye):ye=t[193];let be;t[194]!==P||t[195]!==W||t[196]!==pe||t[197]!==ye?(be=(0,$.jsxs)(P,{children:[W,pe,ye]}),t[194]=P,t[195]=W,t[196]=pe,t[197]=ye,t[198]=be):be=t[198];let xe;t[199]!==B||t[200]!==ne||t[201]!==G||t[202]!==be?(xe=(0,$.jsx)(B,{open:ne,onOpenChange:G,children:be}),t[199]=B,t[200]=ne,t[201]=G,t[202]=be,t[203]=xe):xe=t[203];let Se;return t[204]!==K||t[205]!==q||t[206]!==re||t[207]!==ie||t[208]!==xe?(Se=(0,$.jsxs)(`div`,{className:K,children:[q,re,ie,xe]}),t[204]=K,t[205]=q,t[206]=re,t[207]=ie,t[208]=xe,t[209]=Se):Se=t[209],Se}function fi(e){return e.id}function pi(e){return e.id}function mi(e){return e.id.startsWith(`saved-`)}function hi(e){let t=Je(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function gi(e){return e.id!==`custom`}function _i(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:_i(r,t)}}function vi(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function yi(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function bi(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function xi(e){let t=(0,Z.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=lr(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{Si(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,Q.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>Ci(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function Si(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function Ci(e,t,n){let r=e.getValues(n),i=_i(Ei(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if($e(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:wi(a.error,n)});return!1}function wi(e,t){if($e(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>Ti(e,t));if(n)return n.message}return nt(e)}function Ti(e,t){return e.path.map(String).join(`.`)===t}function Ei(e){return e.split(`.`)}var Di={light:{id:`1njn7W`},dark:{id:`pvnfJD`},system:{id:`D-NlUC`}};function Oi(e){if(!$e(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function ki(){let e=(0,Z.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Vn,{className:`h-5 w-32`}),n=(0,$.jsx)(Vn,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Vn,{className:`h-9 w-full`}),(0,$.jsx)(Vn,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function Ai({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=p(),a=pr(),o=Ct(),s=qe(Ae,e.path),c=s?yi(s):void 0,l=s?vi(s):void 0,u=s?bi(s):void 0,d=s?it(s):void 0,m=d?.scope===`project`&&t!==`project`||d?.scope===`user`&&t!==`user`,h=e.path.join(`.`),g=i(e.label),[_,v]=(0,Q.useState)(!1),y=(0,Q.useRef)(null);(0,Q.useEffect)(()=>()=>{y.current&&clearTimeout(y.current)},[]);let b=()=>{v(!0),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>v(!1),1200)},S=()=>{let e=n(h);return e&&b(),e},C=()=>a.getFieldState(h).isDirty?S():!0,w=()=>{if(e.control===`theme-tiles`){let e=o?.userBinding;if(!e)return;let t=e.patch({appearance:Ot()});t.ok?b():a.setError(h,{type:`manual`,message:wi(t.error,h)});return}let t=l===void 0?null:l;a.setValue(h,t,{shouldDirty:!1}),S()},T=x(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(ur,{control:a.control,name:h,render:({field:n})=>{let r=!m&&(l!==void 0||n.value!==void 0);return(0,$.jsxs)(cr,{className:T,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(fr,{className:`text-sm font-medium`,children:g}),r?(0,$.jsxs)(j,{children:[(0,$.jsx)(k,{asChild:!0,children:(0,$.jsx)(O,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:w,"aria-label":i({id:`lhjq3G`,values:{labelText:g}}),children:(0,$.jsx)(ce,{className:`size-3.5`})})}),(0,$.jsx)(A,{children:(0,$.jsx)(f,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(mr,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(dr,{children:(0,$.jsx)(ji,{field:e,ctl:n,typeTag:c,enumOptions:u,onCommit:C,onSavedOutsideForm:b,onWriteRejected:e=>{a.setError(h,{type:`manual`,message:wi(e,h)})}})}),(0,$.jsx)(Fi,{visible:_,srOnly:e.control===`theme-tiles`})]}),(0,$.jsx)(hr,{"data-field-error":e.path.join(`.`)})]})}})}function ji({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,onSavedOutsideForm:a,onWriteRejected:o,...s}){"use no memo";let{_:c}=p(),{setTheme:l,systemTheme:u}=h(),d=Ct(),f=d?.merged??null;if(e.control===`language-select`)return(0,$.jsx)(ei,{...s,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=Rn(t.value)??`system`;n!==e&&Gr({from:n,to:e}),t.onChange(e),i()}});if(e.control===`theme-tiles`){let{id:t,...n}=s,r=f?.appearance?.customTheme,i=f?.appearance?.theme,p=Ve(i,u===`dark`);return(0,$.jsx)(di,{...n,firstItemId:t,appearance:f?.appearance,customSeed:r,slotMode:p,"aria-label":c(e.label),onAssign:(e,t,n,s)=>{let c=d?.userBinding;if(!c)return;let u={...n,[e]:t},f=e=>{let t=e[p];return t===`custom`?bt(kt(r)):yt(t,s)};Dt({selection:u,modePreference:i,slotMode:p,customSeed:r,themes:s});let m=f(u);m&&l(m);let h=c.patch({appearance:At(u)});if(h.ok){Jr(u),a();return}Dt({selection:n,modePreference:i,slotMode:p,customSeed:r,themes:s}),l(f(n)??i??`system`),o(h.error)}})}if(n===`boolean`)return(0,$.jsx)(J,{...s,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...a}=s,o=e.path[0]===`appearance`&&e.path[1]===`theme`;return(0,$.jsx)(ue,{...a,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(o&&l(e),t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":c(e.label),children:r.map((e,t)=>{let r=Di[e];return(0,$.jsx)(le,{value:e,id:t===0?n:void 0,className:r?`text-1sm`:`text-1sm capitalize`,children:r?c(r):e},e)})})}return n===`number`||n===`int`?(0,$.jsx)(Ni,{ctl:t,onCommit:i,...s}):n===`array`?(0,$.jsx)(Pi,{ctl:t,onCommit:i,...s}):(0,$.jsx)(Mi,{ctl:t,onCommit:i,...s})}function Mi({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(jn,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function Ni({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Q.useState)(e.value===void 0?``:String(e.value)),a=(0,Q.useRef)(e.value);(0,Q.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(jn,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function Pi({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
|
|
2
2
|
`):``,[i,a]=(0,Q.useState)(r),o=(0,Q.useRef)(r);(0,Q.useEffect)(()=>{let t=Array.isArray(e.value)?e.value.join(`
|
|
3
3
|
`):``;t!==o.current&&(a(t),o.current=t)},[e.value]);let s=()=>{let n=i.split(`
|
|
4
4
|
`).map(e=>e.trim()).filter(e=>e.length>0);e.onChange(n),t(),o.current=n.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-CA0dewJJ.js";import{a as ee,c as te,i as ne,n as re,o as ie,s as ae,t as oe}from"./dialog-R8GugqUq.js";import{n as s}from"./dist-B6jB2qbD2.js";import{t as c}from"./desktop-bridge-types-NXCK8Pd7.js";import{n as l,t as se}from"./git-branch-CCnsAeFH.js";import{t as u}from"./spinner-CHTY-VE-.js";import{n as ce,t as d}from"./miss-dialog-store-DzXIxgCB.js";import{r as f,t as p}from"./auth-prompt-store-C4YJf5De.js";import{a as m,n as h}from"./receive-store-BrOspwat.js";import{t as le}from"./share-metadata-rows-D5y9TY7o.js";var g=e(n(),1),ue=a();function de(e){let t=e.shareTargetExists,n=e.dirtyConflicts.conflicts,r=e.dirtyConflicts.files;return t&&!n?{kind:`A`,openCurrentEnabled:!0,switchEnabled:!0,conflictingFiles:r}:!t&&!n?{kind:`B`,openCurrentEnabled:!1,switchEnabled:!0,conflictingFiles:r}:t&&n?{kind:`C`,openCurrentEnabled:!0,switchEnabled:!1,conflictingFiles:r}:{kind:`D`,openCurrentEnabled:!1,switchEnabled:!1,conflictingFiles:r}}function fe(e){return e.detached?e.currentHeadSha:e.currentBranch??`HEAD`}function _(e){if(e.ok)return{action:`await-cc1`};switch(e.reason){case`dirty-conflict`:return{action:`rerender-conflict`,files:e.files??[]};case`branch-not-found`:return{action:`dismiss-with-toast`,reason:`branch-not-found`};case`fetch-failed`:case`checkout-failed`:return{action:`stay-with-toast`,reason:e.reason};case`branch-in-other-worktree`:{let t=e.otherWorktreePath;return t===void 0||t.length===0?{action:`stay-with-toast`,reason:`checkout-failed`}:{action:`pivot-to-other-worktree`,otherWorktreePath:t}}case`ff-diverged`:return{action:`branch-diverged`};default:{let t=e.reason;throw Error(`Unhandled CheckoutFailureReason: ${String(t)}`)}}}var pe={phase:`loading`};function me(e,t){return e.phase===`loading`?t===null?{phase:`error`}:{phase:`ready`,info:t}:e}function he(e,t){return e.phase!==`ready`&&e.phase!==`verdict`?e:{phase:`switching`,info:e.info,pendingDoc:t}}function ge(e){return e.phase===`ready`?{phase:`creating-worktree`,info:e.info}:e}function _e(e){return de(e).kind===`B`&&e.shareTargetOnOriginBranch===!1}function ve(e){return e.phase===`ready`?{phase:`verdict-pending`,info:e.info}:e}function ye(e,t){if(e.phase!==`verdict-pending`)return e;if(t===null||t.verdict===`unknown`||t.verdict===`changed-locally`)return{phase:`ready`,info:e.info};let n=t.verdict===`renamed`?{kind:`renamed`,renamedTo:t.renamedTo}:{kind:t.verdict};return{phase:`verdict`,info:e.info,resolution:n}}function be(e,t){if(e.phase!==`switching`)return{state:e};if(t===null)return{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}};let n=_(t);return n.action===`await-cc1`?{state:{phase:`awaiting-cc1-recycle`,pendingDoc:e.pendingDoc}}:n.action===`rerender-conflict`?{state:{phase:`ready`,info:{...e.info,dirtyConflicts:{conflicts:!0,files:n.files.slice()}}}}:n.action===`pivot-to-other-worktree`?{state:{phase:`branch-in-other-worktree`,info:e.info,otherWorktreePath:n.otherWorktreePath,pendingDoc:e.pendingDoc}}:n.action===`dismiss-with-toast`?{state:{phase:`dismissed`,reason:n.reason},sideEffect:{kind:`toast`,reason:n.reason}}:n.action===`branch-diverged`?{state:{phase:`verdict`,info:e.info,resolution:{kind:`diverged`}}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:n.reason}}}function xe(e,t){return e.phase===`creating-worktree`?t===null?{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}}:t.ok?{state:{phase:`opening-worktree`,path:t.path}}:t.reason===`branch-not-found`?{state:{phase:`dismissed`,reason:`branch-not-found`},sideEffect:{kind:`toast`,reason:`branch-not-found`}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,helper:t.helper,authFailed:t.reason===`fetch-failed`?t.authFailed:void 0}}:{state:e}}var v=t();function Se(e){return e!==null&&e.kind===`project-branch-switch`}function y(e){let t=(0,ue.c)(217),{bridge:n,store:a}=e,p=a===void 0?h:a,{_}=i(),y=(0,g.useSyncExternalStore)(p.subscribe,p.getSnapshot,Ae),[b,x]=(0,g.useState)(pe),je=(0,g.useRef)(!1),Me=(0,g.useRef)(!1),Ne=(0,g.useRef)(!1),Pe=(0,g.useRef)(null),Fe;t[0]===y?Fe=t[1]:(Fe=Se(y)?y:null,t[0]=y,t[1]=Fe);let S=Fe,Ie;t[2]!==_||t[3]!==S?.share.target.kind?(Ie=S?.share.target.kind===`folder`?_({id:`ugoTXs`}):_({id:`XH30C4`}),t[2]=_,t[3]=S?.share.target.kind,t[4]=Ie):Ie=t[4];let C=Ie,Le;t[5]===S?Le=t[6]:(Le=()=>{x(pe),je.current=!1,Me.current=!1,Ne.current=!1,Pe.current=S},t[5]=S,t[6]=Le);let Re;t[7]===y?Re=t[8]:(Re=[y],t[7]=y,t[8]=Re),(0,g.useEffect)(Le,Re);let ze;t[9]!==S||t[10]!==n?(ze=()=>{if(!S||je.current)return;je.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:S.projectPath,branch:S.share.branch,kind:S.share.target.kind,path:c(S.share.target)}).then(t=>{e||x(e=>me(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),x(ke))}),()=>{e=!0}},t[9]=S,t[10]=n,t[11]=ze):ze=t[11];let Be;t[12]===S?Be=t[13]:(Be=[S],t[12]=S,t[13]=Be),(0,g.useEffect)(ze,Be);let Ve;t[14]!==S||t[15]!==b.info||t[16]!==b.phase||t[17]!==n?(Ve=()=>{if(!S||b.phase!==`ready`||Ne.current||!_e(b.info))return;Ne.current=!0,x(ve);let e=S;n.project.fetchTargetStatus({projectPath:S.projectPath,branch:S.share.branch,kind:S.share.target.kind,path:c(S.share.target)}).then(t=>{Pe.current===e&&x(e=>ye(e,t))}).catch(t=>{Pe.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),x(Oe))})},t[14]=S,t[15]=b.info,t[16]=b.phase,t[17]=n,t[18]=Ve):Ve=t[18];let He;t[19]!==S||t[20]!==b.phase?(He=[b.phase,S],t[19]=S,t[20]=b.phase,t[21]=He):He=t[21],(0,g.useEffect)(Ve,He);let Ue;t[22]!==S||t[23]!==b.phase||t[24]!==b.resolution||t[25]!==p?(Ue=()=>{if(b.phase!==`verdict`)return;let{kind:e}=b.resolution;e!==`deleted`&&e!==`never-on-branch`||S&&(d.arm({kind:S.share.target.kind,path:c(S.share.target),branch:S.share.branch}),p.dismiss())},t[22]=S,t[23]=b.phase,t[24]=b.resolution,t[25]=p,t[26]=Ue):Ue=t[26];let We;t[27]!==S||t[28]!==b||t[29]!==p?(We=[b,S,p],t[27]=S,t[28]=b,t[29]=p,t[30]=We):We=t[30],(0,g.useEffect)(Ue,We);let Ge;t[31]!==b.phase||t[32]!==b.resolution?(Ge=()=>{b.phase===`verdict`&&console.log(m({verdict_cell:b.resolution.kind}))},t[31]=b.phase,t[32]=b.resolution,t[33]=Ge):Ge=t[33];let Ke;t[34]===b?Ke=t[35]:(Ke=[b],t[34]=b,t[35]=Ke),(0,g.useEffect)(Ge,Ke);let qe;t[36]!==_||t[37]!==S||t[38]!==b.pendingDoc||t[39]!==b.phase||t[40]!==n||t[41]!==p||t[42]!==C?(qe=()=>{if(b.phase!==`awaiting-cc1-recycle`||!S)return;let e=S.share.branch,t=b.pendingDoc;if(!e){p.dismiss();return}if(Me.current)return;Me.current=!0;let r=!1;return n.project.awaitBranchSwitched({projectPath:S.projectPath,branch:e,timeoutMs:3e4}).then(i=>{if(!r){if(i.ok){console.log(m({branch_dialog_action:`branch-switch-complete`,branch:e})),n.project.open({path:S.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:S.share.target.kind,path:t},pendingBranch:e}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=switch`,e instanceof Error?e.message:e),s.error(_({id:`gQV-9w`,values:{targetNoun:C}}))}),p.dismiss();return}console.log(m({branch_dialog_action:`branch-switch-timeout`,branch:e})),s.error(_({id:`LBwUR6`,values:{targetNoun:C}})),p.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),s.error(_({id:`Jw6EC4`,values:{targetNoun:C}})),p.dismiss())}),()=>{r=!0}},t[36]=_,t[37]=S,t[38]=b.pendingDoc,t[39]=b.phase,t[40]=n,t[41]=p,t[42]=C,t[43]=qe):qe=t[43];let Je;if(t[44]!==S||t[45]!==b.phase?(Je=[b.phase,S],t[44]=S,t[45]=b.phase,t[46]=Je):Je=t[46],(0,g.useEffect)(qe,Je),!S)return null;let{share:w,projectPath:T,currentBranch:Ye}=S,E=w.branch,Xe;t[47]!==_||t[48]!==n.project||t[49]!==T||t[50]!==E||t[51]!==p?(Xe=function(e,t,r){console.log(m({branch_dialog_action:`switch`,branch_action:`switch`,branch:E,verdict_cell:r})),x(t=>he(t,e)),n.project.runCheckout(t?{projectPath:T,branch:E,fastForward:!0}:{projectPath:T,branch:E}).then(e=>{let t=null,n=!1;x(r=>{let{state:i,sideEffect:a}=be(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?s.error(_({id:`NJyQi_`,values:{shareBranch:E}})):t===`fetch-failed`?s.error(_({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&s.error(_({id:`c863eW`,values:{shareBranch:E}})),n&&p.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),x(De),s.error(_({id:`c863eW`,values:{shareBranch:E}}))})},t[47]=_,t[48]=n.project,t[49]=T,t[50]=E,t[51]=p,t[52]=Xe):Xe=t[52];let D=Xe,Ze;t[53]!==b.info||t[54]!==b.phase||t[55]!==D||t[56]!==w.target?(Ze=function(){b.phase===`ready`&&de(b.info).switchEnabled&&D(c(w.target),!1)},t[53]=b.info,t[54]=b.phase,t[55]=D,t[56]=w.target,t[57]=Ze):Ze=t[57];let Qe=Ze,$e;t[58]!==b.phase||t[59]!==b.resolution||t[60]!==D||t[61]!==w.target?($e=function(){b.phase===`verdict`&&D(c(w.target),!0,b.resolution.kind)},t[58]=b.phase,t[59]=b.resolution,t[60]=D,t[61]=w.target,t[62]=$e):$e=t[62];let et=$e,tt;t[63]!==b.phase||t[64]!==b.resolution||t[65]!==D?(tt=function(){b.phase===`verdict`&&b.resolution.kind===`renamed`&&D(b.resolution.renamedTo,!0,b.resolution.kind)},t[63]=b.phase,t[64]=b.resolution,t[65]=D,t[66]=tt):tt=t[66];let nt=tt,rt;t[67]!==b.phase||t[68]!==b.resolution||t[69]!==D||t[70]!==w.target?(rt=function(){b.phase===`verdict`&&D(c(w.target),!1,b.resolution.kind)},t[67]=b.phase,t[68]=b.resolution,t[69]=D,t[70]=w.target,t[71]=rt):rt=t[71];let it=rt,at;t[72]!==_||t[73]!==n.project||t[74]!==T||t[75]!==w.target||t[76]!==E||t[77]!==p||t[78]!==C?(at=function(){console.log(m({branch_dialog_action:`open-current`,branch:E})),n.project.open({path:T,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:w.target.kind,path:c(w.target)}}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),s.error(_({id:`b5aNbi`,values:{targetNoun:C}}))}),p.dismiss()},t[72]=_,t[73]=n.project,t[74]=T,t[75]=w.target,t[76]=E,t[77]=p,t[78]=C,t[79]=at):at=t[79];let ot=at,st;t[80]!==_||t[81]!==E?(st=function(e,t,n){if(e===`fetch-failed`&&n){s.error(_({id:`gfb-CM`}),{action:{label:_({id:`5lWFkC`}),onClick:Ee}});return}switch(e){case`helper-not-found`:{let e=t??_({id:`cHhH3i`});s.error(_({id:`Z7x_Zh`,values:{tool:e}}));return}case`branch-not-found`:s.error(_({id:`NJyQi_`,values:{shareBranch:E}}));return;case`fetch-failed`:s.error(_({id:`bWLmRK`}));return;case`already-checked-out`:s.error(_({id:`ljHjfg`}));return;case`branch-exists`:s.error(_({id:`h3QZcB`,values:{shareBranch:E}}));return;case`path-exists`:s.error(_({id:`cN1Gcp`,values:{shareBranch:E}}));return;case`no-git`:s.error(_({id:`CFnavk`}));return;case`empty-repo`:s.error(_({id:`5IgYAM`}));return;case`invalid-branch`:s.error(_({id:`JfPuv7`,values:{shareBranch:E}}));return;case`proxy-null`:case`error`:s.error(_({id:`e8zYa8`,values:{shareBranch:E}}));return;default:throw Error(`Unhandled worktree failure reason: ${String(e)}`)}},t[80]=_,t[81]=E,t[82]=st):st=t[82];let ct=st,lt;t[83]!==_||t[84]!==n.project||t[85]!==w.target||t[86]!==E||t[87]!==ct||t[88]!==p?(lt=function(e){let t=null,r,i,a=!1,o=null;if(x(n=>{let{state:ee,sideEffect:te}=xe(n,e);return te&&(t=te.reason,r=te.helper,i=te.authFailed,a=ee.phase===`dismissed`),ee.phase===`opening-worktree`&&(o=ee.path),ee}),t!==null&&(console.log(m({branch_dialog_action:`open-worktree-failed:${t}`,branch:E})),ct(t,r,i)),o!==null){f();let e=o;n.project.open({path:e,target:`new-window`,entryPoint:`worktree`,pendingDeepLinkTarget:{kind:w.target.kind,path:c(w.target)},pendingBranch:E}).catch(t=>{console.warn(`[receive] worktree-open-failed branch_dialog_action=open-worktree`,t instanceof Error?t.message:t),s.error(_({id:`LdABLa`,values:{target:e}}))}),p.dismiss()}a&&p.dismiss()},t[83]=_,t[84]=n.project,t[85]=w.target,t[86]=E,t[87]=ct,t[88]=p,t[89]=lt):lt=t[89];let ut=lt,dt;t[90]!==ut||t[91]!==b.phase||t[92]!==n.worktree||t[93]!==E?(dt=function(){b.phase===`ready`&&(console.log(m({branch_dialog_action:`open-worktree`,branch:E})),x(ge),n.worktree.checkout({branch:E}).then(e=>{ut(e)}).catch(e=>{console.warn(`[receive] worktree-checkout rejected branch_dialog_action=open-worktree`,e instanceof Error?e.message:e),ut(null)}))},t[90]=ut,t[91]=b.phase,t[92]=n.worktree,t[93]=E,t[94]=dt):dt=t[94];let ft=dt,pt;t[95]!==_||t[96]!==b.otherWorktreePath||t[97]!==b.phase||t[98]!==n.project||t[99]!==w.target||t[100]!==E||t[101]!==p?(pt=function(){if(b.phase!==`branch-in-other-worktree`)return;let e=b.otherWorktreePath;console.log(m({branch_dialog_action:`pivot-to-other-worktree`,branch:E})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:w.target.kind,path:c(w.target)},pendingBranch:E}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),s.error(_({id:`LdABLa`,values:{target:e}}))}),p.dismiss()},t[95]=_,t[96]=b.otherWorktreePath,t[97]=b.phase,t[98]=n.project,t[99]=w.target,t[100]=E,t[101]=p,t[102]=pt):pt=t[102];let mt=pt,ht;t[103]!==b.phase||t[104]!==b.resolution||t[105]!==p?(ht=function(){console.log(m({branch_dialog_action:`cancel`,verdict_cell:b.phase===`verdict`?b.resolution.kind:void 0})),p.dismiss()},t[103]=b.phase,t[104]=b.resolution,t[105]=p,t[106]=ht):ht=t[106];let O=ht,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K,q;if(t[107]!==_||t[108]!==b.info||t[109]!==b.otherWorktreePath||t[110]!==b.phase||t[111]!==b.resolution||t[112]!==O||t[113]!==Ye||t[114]!==w.branch||t[115]!==w.owner||t[116]!==w.repo||t[117]!==w.target||t[118]!==E||t[119]!==C){K=b.phase===`ready`||b.phase===`switching`||b.phase===`creating-worktree`?de(b.info):null;let e;t[139]!==b.info||t[140]!==b.phase||t[141]!==Ye?(e=b.phase===`ready`||b.phase===`switching`||b.phase===`creating-worktree`?fe(b.info):Ye??`HEAD`,t[139]=b.info,t[140]=b.phase,t[141]=Ye,t[142]=e):e=t[142];let n=e;F=b.phase===`switching`||b.phase===`awaiting-cc1-recycle`,M=b.phase===`creating-worktree`;let i;t[143]===_?i=t[144]:(i=_({id:`OuY8t9`}),t[143]=_,t[144]=i),N=i;let a;t[145]===_?a=t[146]:(a=_({id:`XZkdtg`}),t[145]=_,t[146]=a),P=a;let o;t[147]===_?o=t[148]:(o=_({id:`VTulZj`}),t[147]=_,t[148]=o),q=o;let ie=b.phase===`loading`,s=b.phase===`error`;j=oe,W=!0,t[149]===O?G=t[150]:(G=e=>{e||O()},t[149]=O,t[150]=G),A=ne,z=`sm:max-w-xl`,B=`share-branch-switch-dialog`,V=Te,H=we;let l;t[151]===C?l=t[152]:(l=(0,v.jsx)(te,{children:(0,v.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:C}})}),t[151]=C,t[152]=l);let se=w.owner,ce=w.repo,d;t[153]===w.target?d=t[154]:(d=c(w.target),t[153]=w.target,t[154]=d);let f;t[155]!==w.owner||t[156]!==w.repo||t[157]!==d?(f=(0,v.jsx)(ee,{className:`sr-only`,children:(0,v.jsx)(r,{id:`f8jU-L`,values:{0:se,1:ce,2:d}})}),t[155]=w.owner,t[156]=w.repo,t[157]=d,t[158]=f):f=t[158],t[159]!==l||t[160]!==f?(U=(0,v.jsxs)(ae,{children:[l,f]}),t[159]=l,t[160]=f,t[161]=U):U=t[161],k=re;let p=w.owner,m=w.repo,h;t[162]===w.target?h=t[163]:(h=c(w.target),t[162]=w.target,t[163]=h),t[164]!==w.branch||t[165]!==w.owner||t[166]!==w.repo||t[167]!==w.target.kind||t[168]!==h?(I=(0,v.jsx)(`div`,{className:`mb-4`,children:(0,v.jsx)(le,{owner:p,repo:m,path:h,kind:w.target.kind,branch:w.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[164]=w.branch,t[165]=w.owner,t[166]=w.repo,t[167]=w.target.kind,t[168]=h,t[169]=I):I=t[169],L=b.phase===`branch-in-other-worktree`?(0,v.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,v.jsx)(`p`,{className:`leading-6`,children:(0,v.jsx)(r,{id:`yjExfe`,values:{shareBranch:E},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,v.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-branch-switch-in-other-worktree-path`,children:b.otherWorktreePath})]}):b.phase===`verdict-pending`?(0,v.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-pending`,role:`status`,"aria-live":`polite`,children:[(0,v.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,v.jsx)(r,{id:`c8jBgX`})]}):b.phase===`verdict`?b.resolution.kind===`on-origin`?(0,v.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,v.jsx)(r,{id:`Uay5NL`,values:{targetNoun:C,shareBranch:E},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):b.resolution.kind===`renamed`?(0,v.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,v.jsx)(r,{id:`P0HC30`,values:{0:b.resolution.renamedTo,targetNoun:C},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):b.resolution.kind===`diverged`?(0,v.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,v.jsx)(r,{id:`kLv8d3`,values:{shareBranch:E,targetNoun:C},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,v.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-handoff`,role:`status`,"aria-live":`polite`,children:[(0,v.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,v.jsx)(r,{id:`c8jBgX`})]}):ie?(0,v.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-loading`,role:`status`,"aria-live":`polite`,children:[(0,v.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,v.jsx)(r,{id:`jerqF0`})]}):s?(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,v.jsx)(r,{id:`w4hMYl`})}):K?.kind===`D`?(0,v.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,v.jsx)(r,{id:`DTI-fp`,values:{targetNoun:C,shareBranch:E},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):K?.kind===`B`?(0,v.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,v.jsx)(r,{id:`sZ2IOu`,values:{targetNoun:C,shareBranch:E,currentLabel:n},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,v.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,v.jsx)(r,{id:`_902BE`,values:{targetNoun:C,shareBranch:E,currentLabel:n},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),R=K&&!K.switchEnabled&&K.conflictingFiles.length>0?(0,v.jsxs)(`div`,{className:`mt-3 rounded-md border border-border bg-muted/30 p-3 text-1sm`,"data-testid":`share-branch-switch-conflict`,children:[(0,v.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,v.jsx)(r,{id:`n2lRue`})}),(0,v.jsx)(`ul`,{id:`share-receive-branch-conflict-files`,className:`mt-1 list-disc space-y-0.5 pl-5 text-muted-foreground`,children:K.conflictingFiles.map(Ce)})]}):null,t[107]=_,t[108]=b.info,t[109]=b.otherWorktreePath,t[110]=b.phase,t[111]=b.resolution,t[112]=O,t[113]=Ye,t[114]=w.branch,t[115]=w.owner,t[116]=w.repo,t[117]=w.target,t[118]=E,t[119]=C,t[120]=k,t[121]=A,t[122]=j,t[123]=M,t[124]=N,t[125]=P,t[126]=F,t[127]=I,t[128]=L,t[129]=R,t[130]=z,t[131]=B,t[132]=V,t[133]=H,t[134]=U,t[135]=W,t[136]=G,t[137]=K,t[138]=q}else k=t[120],A=t[121],j=t[122],M=t[123],N=t[124],P=t[125],F=t[126],I=t[127],L=t[128],R=t[129],z=t[130],B=t[131],V=t[132],H=t[133],U=t[134],W=t[135],G=t[136],K=t[137],q=t[138];let J;t[170]===F?J=t[171]:(J=F?(0,v.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-switching`,role:`status`,"aria-live":`polite`,children:[(0,v.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,v.jsx)(r,{id:`CU3AiE`})]}):null,t[170]=F,t[171]=J);let Y;t[172]===M?Y=t[173]:(Y=M?(0,v.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-creating-worktree`,role:`status`,"aria-live":`polite`,children:[(0,v.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,v.jsx)(r,{id:`PZtgO0`})]}):null,t[172]=M,t[173]=Y);let X;t[174]!==k||t[175]!==I||t[176]!==L||t[177]!==R||t[178]!==J||t[179]!==Y?(X=(0,v.jsxs)(k,{children:[I,L,R,J,Y]}),t[174]=k,t[175]=I,t[176]=L,t[177]=R,t[178]=J,t[179]=Y,t[180]=X):X=t[180];let gt;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,v.jsx)(r,{id:`dEgA5A`}),t[181]=gt):gt=t[181];let Z;t[182]===O?Z=t[183]:(Z=(0,v.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:O,"data-testid":`share-branch-switch-cancel`,children:gt}),t[182]=O,t[183]=Z);let Q;t[184]!==b.phase||t[185]!==b.resolution||t[186]!==M||t[187]!==ot||t[188]!==nt||t[189]!==ft||t[190]!==mt||t[191]!==it||t[192]!==Qe||t[193]!==et||t[194]!==N||t[195]!==P||t[196]!==F||t[197]!==K||t[198]!==q?(Q=b.phase===`branch-in-other-worktree`?(0,v.jsx)(o,{onClick:mt,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,v.jsx)(r,{id:`hyCxJY`})}):b.phase===`verdict`?b.resolution.kind===`on-origin`?(0,v.jsxs)(o,{onClick:et,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,v.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),(0,v.jsx)(r,{id:`uA_jXp`})]}):b.resolution.kind===`renamed`?(0,v.jsxs)(o,{onClick:nt,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,v.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),(0,v.jsx)(r,{id:`AItsE5`})]}):b.resolution.kind===`diverged`?(0,v.jsxs)(o,{onClick:it,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,v.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),P]}):null:(0,v.jsxs)(`div`,{className:`flex min-w-0 flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end sm:gap-2`,children:[K?.openCurrentEnabled?(0,v.jsxs)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:ot,disabled:F||M,"data-testid":`share-branch-switch-open-current`,children:[(0,v.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),N]}):null,(0,v.jsx)(o,{variant:`outline`,onClick:Qe,disabled:!K?.switchEnabled||F||M,"aria-disabled":!K?.switchEnabled||F||M,"aria-describedby":K&&!K.switchEnabled&&K.conflictingFiles.length>0?`share-receive-branch-conflict-files`:void 0,"data-testid":`share-branch-switch-switch`,children:F?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(u,{className:`size-3.5`,"aria-hidden":`true`}),P]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),P]})}),(0,v.jsx)(o,{onClick:ft,disabled:!K||F||M,"data-testid":`share-branch-switch-worktree`,children:M?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(u,{className:`size-3.5`,"aria-hidden":`true`}),q]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),q]})})]}),t[184]=b.phase,t[185]=b.resolution,t[186]=M,t[187]=ot,t[188]=nt,t[189]=ft,t[190]=mt,t[191]=it,t[192]=Qe,t[193]=et,t[194]=N,t[195]=P,t[196]=F,t[197]=K,t[198]=q,t[199]=Q):Q=t[199];let _t;t[200]!==Z||t[201]!==Q?(_t=(0,v.jsxs)(ie,{className:`sm:justify-between`,children:[Z,Q]}),t[200]=Z,t[201]=Q,t[202]=_t):_t=t[202];let $;t[203]!==A||t[204]!==z||t[205]!==B||t[206]!==V||t[207]!==H||t[208]!==U||t[209]!==X||t[210]!==_t?($=(0,v.jsxs)(A,{className:z,"data-testid":B,onInteractOutside:V,onPointerDownOutside:H,children:[U,X,_t]}),t[203]=A,t[204]=z,t[205]=B,t[206]=V,t[207]=H,t[208]=U,t[209]=X,t[210]=_t,t[211]=$):$=t[211];let vt;return t[212]!==j||t[213]!==W||t[214]!==G||t[215]!==$?(vt=(0,v.jsx)(j,{open:W,onOpenChange:G,children:$}),t[212]=j,t[213]=W,t[214]=G,t[215]=$,t[216]=vt):vt=t[216],vt}function Ce(e){return(0,v.jsx)(`li`,{children:(0,v.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function we(e){e.preventDefault()}function Te(e){e.preventDefault()}function Ee(){return p.request()}function De(e){return be(e,null).state}function Oe(e){return ye(e,null)}function ke(e){return me(e,null)}function Ae(){return null}export{y as ShareBranchSwitchDialog};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-CA0dewJJ.js";import{a as ee,c as te,i as ne,n as re,o as ie,s as ae,t as oe}from"./dialog-R8GugqUq.js";import{n as s}from"./dist-B6jB2qbD2.js";import{t as c}from"./desktop-bridge-types-NXCK8Pd7.js";import{n as l,t as se}from"./git-branch-CCnsAeFH.js";import{t as u}from"./spinner-CHTY-VE-.js";import{n as ce,t as d}from"./miss-dialog-store-DzXIxgCB.js";import{r as f,t as p}from"./auth-prompt-store-C4YJf5De.js";import{a as m,n as h}from"./receive-store-DjapXAoN.js";import{t as le}from"./share-metadata-rows-D5y9TY7o.js";var g=e(n(),1),ue=a();function de(e){let t=e.shareTargetExists,n=e.dirtyConflicts.conflicts,r=e.dirtyConflicts.files;return t&&!n?{kind:`A`,openCurrentEnabled:!0,switchEnabled:!0,conflictingFiles:r}:!t&&!n?{kind:`B`,openCurrentEnabled:!1,switchEnabled:!0,conflictingFiles:r}:t&&n?{kind:`C`,openCurrentEnabled:!0,switchEnabled:!1,conflictingFiles:r}:{kind:`D`,openCurrentEnabled:!1,switchEnabled:!1,conflictingFiles:r}}function fe(e){return e.detached?e.currentHeadSha:e.currentBranch??`HEAD`}function _(e){if(e.ok)return{action:`await-cc1`};switch(e.reason){case`dirty-conflict`:return{action:`rerender-conflict`,files:e.files??[]};case`branch-not-found`:return{action:`dismiss-with-toast`,reason:`branch-not-found`};case`fetch-failed`:case`checkout-failed`:return{action:`stay-with-toast`,reason:e.reason};case`branch-in-other-worktree`:{let t=e.otherWorktreePath;return t===void 0||t.length===0?{action:`stay-with-toast`,reason:`checkout-failed`}:{action:`pivot-to-other-worktree`,otherWorktreePath:t}}case`ff-diverged`:return{action:`branch-diverged`};default:{let t=e.reason;throw Error(`Unhandled CheckoutFailureReason: ${String(t)}`)}}}var pe={phase:`loading`};function me(e,t){return e.phase===`loading`?t===null?{phase:`error`}:{phase:`ready`,info:t}:e}function he(e,t){return e.phase!==`ready`&&e.phase!==`verdict`?e:{phase:`switching`,info:e.info,pendingDoc:t}}function ge(e){return e.phase===`ready`?{phase:`creating-worktree`,info:e.info}:e}function _e(e){return de(e).kind===`B`&&e.shareTargetOnOriginBranch===!1}function ve(e){return e.phase===`ready`?{phase:`verdict-pending`,info:e.info}:e}function ye(e,t){if(e.phase!==`verdict-pending`)return e;if(t===null||t.verdict===`unknown`||t.verdict===`changed-locally`)return{phase:`ready`,info:e.info};let n=t.verdict===`renamed`?{kind:`renamed`,renamedTo:t.renamedTo}:{kind:t.verdict};return{phase:`verdict`,info:e.info,resolution:n}}function be(e,t){if(e.phase!==`switching`)return{state:e};if(t===null)return{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}};let n=_(t);return n.action===`await-cc1`?{state:{phase:`awaiting-cc1-recycle`,pendingDoc:e.pendingDoc}}:n.action===`rerender-conflict`?{state:{phase:`ready`,info:{...e.info,dirtyConflicts:{conflicts:!0,files:n.files.slice()}}}}:n.action===`pivot-to-other-worktree`?{state:{phase:`branch-in-other-worktree`,info:e.info,otherWorktreePath:n.otherWorktreePath,pendingDoc:e.pendingDoc}}:n.action===`dismiss-with-toast`?{state:{phase:`dismissed`,reason:n.reason},sideEffect:{kind:`toast`,reason:n.reason}}:n.action===`branch-diverged`?{state:{phase:`verdict`,info:e.info,resolution:{kind:`diverged`}}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:n.reason}}}function xe(e,t){return e.phase===`creating-worktree`?t===null?{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}}:t.ok?{state:{phase:`opening-worktree`,path:t.path}}:t.reason===`branch-not-found`?{state:{phase:`dismissed`,reason:`branch-not-found`},sideEffect:{kind:`toast`,reason:`branch-not-found`}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,helper:t.helper,authFailed:t.reason===`fetch-failed`?t.authFailed:void 0}}:{state:e}}var v=t();function Se(e){return e!==null&&e.kind===`project-branch-switch`}function y(e){let t=(0,ue.c)(217),{bridge:n,store:a}=e,p=a===void 0?h:a,{_}=i(),y=(0,g.useSyncExternalStore)(p.subscribe,p.getSnapshot,Ae),[b,x]=(0,g.useState)(pe),je=(0,g.useRef)(!1),Me=(0,g.useRef)(!1),Ne=(0,g.useRef)(!1),Pe=(0,g.useRef)(null),Fe;t[0]===y?Fe=t[1]:(Fe=Se(y)?y:null,t[0]=y,t[1]=Fe);let S=Fe,Ie;t[2]!==_||t[3]!==S?.share.target.kind?(Ie=S?.share.target.kind===`folder`?_({id:`ugoTXs`}):_({id:`XH30C4`}),t[2]=_,t[3]=S?.share.target.kind,t[4]=Ie):Ie=t[4];let C=Ie,Le;t[5]===S?Le=t[6]:(Le=()=>{x(pe),je.current=!1,Me.current=!1,Ne.current=!1,Pe.current=S},t[5]=S,t[6]=Le);let Re;t[7]===y?Re=t[8]:(Re=[y],t[7]=y,t[8]=Re),(0,g.useEffect)(Le,Re);let ze;t[9]!==S||t[10]!==n?(ze=()=>{if(!S||je.current)return;je.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:S.projectPath,branch:S.share.branch,kind:S.share.target.kind,path:c(S.share.target)}).then(t=>{e||x(e=>me(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),x(ke))}),()=>{e=!0}},t[9]=S,t[10]=n,t[11]=ze):ze=t[11];let Be;t[12]===S?Be=t[13]:(Be=[S],t[12]=S,t[13]=Be),(0,g.useEffect)(ze,Be);let Ve;t[14]!==S||t[15]!==b.info||t[16]!==b.phase||t[17]!==n?(Ve=()=>{if(!S||b.phase!==`ready`||Ne.current||!_e(b.info))return;Ne.current=!0,x(ve);let e=S;n.project.fetchTargetStatus({projectPath:S.projectPath,branch:S.share.branch,kind:S.share.target.kind,path:c(S.share.target)}).then(t=>{Pe.current===e&&x(e=>ye(e,t))}).catch(t=>{Pe.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),x(Oe))})},t[14]=S,t[15]=b.info,t[16]=b.phase,t[17]=n,t[18]=Ve):Ve=t[18];let He;t[19]!==S||t[20]!==b.phase?(He=[b.phase,S],t[19]=S,t[20]=b.phase,t[21]=He):He=t[21],(0,g.useEffect)(Ve,He);let Ue;t[22]!==S||t[23]!==b.phase||t[24]!==b.resolution||t[25]!==p?(Ue=()=>{if(b.phase!==`verdict`)return;let{kind:e}=b.resolution;e!==`deleted`&&e!==`never-on-branch`||S&&(d.arm({kind:S.share.target.kind,path:c(S.share.target),branch:S.share.branch}),p.dismiss())},t[22]=S,t[23]=b.phase,t[24]=b.resolution,t[25]=p,t[26]=Ue):Ue=t[26];let We;t[27]!==S||t[28]!==b||t[29]!==p?(We=[b,S,p],t[27]=S,t[28]=b,t[29]=p,t[30]=We):We=t[30],(0,g.useEffect)(Ue,We);let Ge;t[31]!==b.phase||t[32]!==b.resolution?(Ge=()=>{b.phase===`verdict`&&console.log(m({verdict_cell:b.resolution.kind}))},t[31]=b.phase,t[32]=b.resolution,t[33]=Ge):Ge=t[33];let Ke;t[34]===b?Ke=t[35]:(Ke=[b],t[34]=b,t[35]=Ke),(0,g.useEffect)(Ge,Ke);let qe;t[36]!==_||t[37]!==S||t[38]!==b.pendingDoc||t[39]!==b.phase||t[40]!==n||t[41]!==p||t[42]!==C?(qe=()=>{if(b.phase!==`awaiting-cc1-recycle`||!S)return;let e=S.share.branch,t=b.pendingDoc;if(!e){p.dismiss();return}if(Me.current)return;Me.current=!0;let r=!1;return n.project.awaitBranchSwitched({projectPath:S.projectPath,branch:e,timeoutMs:3e4}).then(i=>{if(!r){if(i.ok){console.log(m({branch_dialog_action:`branch-switch-complete`,branch:e})),n.project.open({path:S.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:S.share.target.kind,path:t},pendingBranch:e}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=switch`,e instanceof Error?e.message:e),s.error(_({id:`gQV-9w`,values:{targetNoun:C}}))}),p.dismiss();return}console.log(m({branch_dialog_action:`branch-switch-timeout`,branch:e})),s.error(_({id:`LBwUR6`,values:{targetNoun:C}})),p.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),s.error(_({id:`Jw6EC4`,values:{targetNoun:C}})),p.dismiss())}),()=>{r=!0}},t[36]=_,t[37]=S,t[38]=b.pendingDoc,t[39]=b.phase,t[40]=n,t[41]=p,t[42]=C,t[43]=qe):qe=t[43];let Je;if(t[44]!==S||t[45]!==b.phase?(Je=[b.phase,S],t[44]=S,t[45]=b.phase,t[46]=Je):Je=t[46],(0,g.useEffect)(qe,Je),!S)return null;let{share:w,projectPath:T,currentBranch:Ye}=S,E=w.branch,Xe;t[47]!==_||t[48]!==n.project||t[49]!==T||t[50]!==E||t[51]!==p?(Xe=function(e,t,r){console.log(m({branch_dialog_action:`switch`,branch_action:`switch`,branch:E,verdict_cell:r})),x(t=>he(t,e)),n.project.runCheckout(t?{projectPath:T,branch:E,fastForward:!0}:{projectPath:T,branch:E}).then(e=>{let t=null,n=!1;x(r=>{let{state:i,sideEffect:a}=be(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?s.error(_({id:`NJyQi_`,values:{shareBranch:E}})):t===`fetch-failed`?s.error(_({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&s.error(_({id:`c863eW`,values:{shareBranch:E}})),n&&p.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),x(De),s.error(_({id:`c863eW`,values:{shareBranch:E}}))})},t[47]=_,t[48]=n.project,t[49]=T,t[50]=E,t[51]=p,t[52]=Xe):Xe=t[52];let D=Xe,Ze;t[53]!==b.info||t[54]!==b.phase||t[55]!==D||t[56]!==w.target?(Ze=function(){b.phase===`ready`&&de(b.info).switchEnabled&&D(c(w.target),!1)},t[53]=b.info,t[54]=b.phase,t[55]=D,t[56]=w.target,t[57]=Ze):Ze=t[57];let Qe=Ze,$e;t[58]!==b.phase||t[59]!==b.resolution||t[60]!==D||t[61]!==w.target?($e=function(){b.phase===`verdict`&&D(c(w.target),!0,b.resolution.kind)},t[58]=b.phase,t[59]=b.resolution,t[60]=D,t[61]=w.target,t[62]=$e):$e=t[62];let et=$e,tt;t[63]!==b.phase||t[64]!==b.resolution||t[65]!==D?(tt=function(){b.phase===`verdict`&&b.resolution.kind===`renamed`&&D(b.resolution.renamedTo,!0,b.resolution.kind)},t[63]=b.phase,t[64]=b.resolution,t[65]=D,t[66]=tt):tt=t[66];let nt=tt,rt;t[67]!==b.phase||t[68]!==b.resolution||t[69]!==D||t[70]!==w.target?(rt=function(){b.phase===`verdict`&&D(c(w.target),!1,b.resolution.kind)},t[67]=b.phase,t[68]=b.resolution,t[69]=D,t[70]=w.target,t[71]=rt):rt=t[71];let it=rt,at;t[72]!==_||t[73]!==n.project||t[74]!==T||t[75]!==w.target||t[76]!==E||t[77]!==p||t[78]!==C?(at=function(){console.log(m({branch_dialog_action:`open-current`,branch:E})),n.project.open({path:T,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:w.target.kind,path:c(w.target)}}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),s.error(_({id:`b5aNbi`,values:{targetNoun:C}}))}),p.dismiss()},t[72]=_,t[73]=n.project,t[74]=T,t[75]=w.target,t[76]=E,t[77]=p,t[78]=C,t[79]=at):at=t[79];let ot=at,st;t[80]!==_||t[81]!==E?(st=function(e,t,n){if(e===`fetch-failed`&&n){s.error(_({id:`gfb-CM`}),{action:{label:_({id:`5lWFkC`}),onClick:Ee}});return}switch(e){case`helper-not-found`:{let e=t??_({id:`cHhH3i`});s.error(_({id:`Z7x_Zh`,values:{tool:e}}));return}case`branch-not-found`:s.error(_({id:`NJyQi_`,values:{shareBranch:E}}));return;case`fetch-failed`:s.error(_({id:`bWLmRK`}));return;case`already-checked-out`:s.error(_({id:`ljHjfg`}));return;case`branch-exists`:s.error(_({id:`h3QZcB`,values:{shareBranch:E}}));return;case`path-exists`:s.error(_({id:`cN1Gcp`,values:{shareBranch:E}}));return;case`no-git`:s.error(_({id:`CFnavk`}));return;case`empty-repo`:s.error(_({id:`5IgYAM`}));return;case`invalid-branch`:s.error(_({id:`JfPuv7`,values:{shareBranch:E}}));return;case`proxy-null`:case`error`:s.error(_({id:`e8zYa8`,values:{shareBranch:E}}));return;default:throw Error(`Unhandled worktree failure reason: ${String(e)}`)}},t[80]=_,t[81]=E,t[82]=st):st=t[82];let ct=st,lt;t[83]!==_||t[84]!==n.project||t[85]!==w.target||t[86]!==E||t[87]!==ct||t[88]!==p?(lt=function(e){let t=null,r,i,a=!1,o=null;if(x(n=>{let{state:ee,sideEffect:te}=xe(n,e);return te&&(t=te.reason,r=te.helper,i=te.authFailed,a=ee.phase===`dismissed`),ee.phase===`opening-worktree`&&(o=ee.path),ee}),t!==null&&(console.log(m({branch_dialog_action:`open-worktree-failed:${t}`,branch:E})),ct(t,r,i)),o!==null){f();let e=o;n.project.open({path:e,target:`new-window`,entryPoint:`worktree`,pendingDeepLinkTarget:{kind:w.target.kind,path:c(w.target)},pendingBranch:E}).catch(t=>{console.warn(`[receive] worktree-open-failed branch_dialog_action=open-worktree`,t instanceof Error?t.message:t),s.error(_({id:`LdABLa`,values:{target:e}}))}),p.dismiss()}a&&p.dismiss()},t[83]=_,t[84]=n.project,t[85]=w.target,t[86]=E,t[87]=ct,t[88]=p,t[89]=lt):lt=t[89];let ut=lt,dt;t[90]!==ut||t[91]!==b.phase||t[92]!==n.worktree||t[93]!==E?(dt=function(){b.phase===`ready`&&(console.log(m({branch_dialog_action:`open-worktree`,branch:E})),x(ge),n.worktree.checkout({branch:E}).then(e=>{ut(e)}).catch(e=>{console.warn(`[receive] worktree-checkout rejected branch_dialog_action=open-worktree`,e instanceof Error?e.message:e),ut(null)}))},t[90]=ut,t[91]=b.phase,t[92]=n.worktree,t[93]=E,t[94]=dt):dt=t[94];let ft=dt,pt;t[95]!==_||t[96]!==b.otherWorktreePath||t[97]!==b.phase||t[98]!==n.project||t[99]!==w.target||t[100]!==E||t[101]!==p?(pt=function(){if(b.phase!==`branch-in-other-worktree`)return;let e=b.otherWorktreePath;console.log(m({branch_dialog_action:`pivot-to-other-worktree`,branch:E})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:w.target.kind,path:c(w.target)},pendingBranch:E}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),s.error(_({id:`LdABLa`,values:{target:e}}))}),p.dismiss()},t[95]=_,t[96]=b.otherWorktreePath,t[97]=b.phase,t[98]=n.project,t[99]=w.target,t[100]=E,t[101]=p,t[102]=pt):pt=t[102];let mt=pt,ht;t[103]!==b.phase||t[104]!==b.resolution||t[105]!==p?(ht=function(){console.log(m({branch_dialog_action:`cancel`,verdict_cell:b.phase===`verdict`?b.resolution.kind:void 0})),p.dismiss()},t[103]=b.phase,t[104]=b.resolution,t[105]=p,t[106]=ht):ht=t[106];let O=ht,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K,q;if(t[107]!==_||t[108]!==b.info||t[109]!==b.otherWorktreePath||t[110]!==b.phase||t[111]!==b.resolution||t[112]!==O||t[113]!==Ye||t[114]!==w.branch||t[115]!==w.owner||t[116]!==w.repo||t[117]!==w.target||t[118]!==E||t[119]!==C){K=b.phase===`ready`||b.phase===`switching`||b.phase===`creating-worktree`?de(b.info):null;let e;t[139]!==b.info||t[140]!==b.phase||t[141]!==Ye?(e=b.phase===`ready`||b.phase===`switching`||b.phase===`creating-worktree`?fe(b.info):Ye??`HEAD`,t[139]=b.info,t[140]=b.phase,t[141]=Ye,t[142]=e):e=t[142];let n=e;F=b.phase===`switching`||b.phase===`awaiting-cc1-recycle`,M=b.phase===`creating-worktree`;let i;t[143]===_?i=t[144]:(i=_({id:`OuY8t9`}),t[143]=_,t[144]=i),N=i;let a;t[145]===_?a=t[146]:(a=_({id:`XZkdtg`}),t[145]=_,t[146]=a),P=a;let o;t[147]===_?o=t[148]:(o=_({id:`VTulZj`}),t[147]=_,t[148]=o),q=o;let ie=b.phase===`loading`,s=b.phase===`error`;j=oe,W=!0,t[149]===O?G=t[150]:(G=e=>{e||O()},t[149]=O,t[150]=G),A=ne,z=`sm:max-w-xl`,B=`share-branch-switch-dialog`,V=Te,H=we;let l;t[151]===C?l=t[152]:(l=(0,v.jsx)(te,{children:(0,v.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:C}})}),t[151]=C,t[152]=l);let se=w.owner,ce=w.repo,d;t[153]===w.target?d=t[154]:(d=c(w.target),t[153]=w.target,t[154]=d);let f;t[155]!==w.owner||t[156]!==w.repo||t[157]!==d?(f=(0,v.jsx)(ee,{className:`sr-only`,children:(0,v.jsx)(r,{id:`f8jU-L`,values:{0:se,1:ce,2:d}})}),t[155]=w.owner,t[156]=w.repo,t[157]=d,t[158]=f):f=t[158],t[159]!==l||t[160]!==f?(U=(0,v.jsxs)(ae,{children:[l,f]}),t[159]=l,t[160]=f,t[161]=U):U=t[161],k=re;let p=w.owner,m=w.repo,h;t[162]===w.target?h=t[163]:(h=c(w.target),t[162]=w.target,t[163]=h),t[164]!==w.branch||t[165]!==w.owner||t[166]!==w.repo||t[167]!==w.target.kind||t[168]!==h?(I=(0,v.jsx)(`div`,{className:`mb-4`,children:(0,v.jsx)(le,{owner:p,repo:m,path:h,kind:w.target.kind,branch:w.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[164]=w.branch,t[165]=w.owner,t[166]=w.repo,t[167]=w.target.kind,t[168]=h,t[169]=I):I=t[169],L=b.phase===`branch-in-other-worktree`?(0,v.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,v.jsx)(`p`,{className:`leading-6`,children:(0,v.jsx)(r,{id:`yjExfe`,values:{shareBranch:E},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,v.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-branch-switch-in-other-worktree-path`,children:b.otherWorktreePath})]}):b.phase===`verdict-pending`?(0,v.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-pending`,role:`status`,"aria-live":`polite`,children:[(0,v.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,v.jsx)(r,{id:`c8jBgX`})]}):b.phase===`verdict`?b.resolution.kind===`on-origin`?(0,v.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,v.jsx)(r,{id:`Uay5NL`,values:{targetNoun:C,shareBranch:E},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):b.resolution.kind===`renamed`?(0,v.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,v.jsx)(r,{id:`P0HC30`,values:{0:b.resolution.renamedTo,targetNoun:C},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):b.resolution.kind===`diverged`?(0,v.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,v.jsx)(r,{id:`kLv8d3`,values:{shareBranch:E,targetNoun:C},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,v.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-handoff`,role:`status`,"aria-live":`polite`,children:[(0,v.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,v.jsx)(r,{id:`c8jBgX`})]}):ie?(0,v.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-loading`,role:`status`,"aria-live":`polite`,children:[(0,v.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,v.jsx)(r,{id:`jerqF0`})]}):s?(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,v.jsx)(r,{id:`w4hMYl`})}):K?.kind===`D`?(0,v.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,v.jsx)(r,{id:`DTI-fp`,values:{targetNoun:C,shareBranch:E},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):K?.kind===`B`?(0,v.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,v.jsx)(r,{id:`sZ2IOu`,values:{targetNoun:C,shareBranch:E,currentLabel:n},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,v.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,v.jsx)(r,{id:`_902BE`,values:{targetNoun:C,shareBranch:E,currentLabel:n},components:{0:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,v.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),R=K&&!K.switchEnabled&&K.conflictingFiles.length>0?(0,v.jsxs)(`div`,{className:`mt-3 rounded-md border border-border bg-muted/30 p-3 text-1sm`,"data-testid":`share-branch-switch-conflict`,children:[(0,v.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,v.jsx)(r,{id:`n2lRue`})}),(0,v.jsx)(`ul`,{id:`share-receive-branch-conflict-files`,className:`mt-1 list-disc space-y-0.5 pl-5 text-muted-foreground`,children:K.conflictingFiles.map(Ce)})]}):null,t[107]=_,t[108]=b.info,t[109]=b.otherWorktreePath,t[110]=b.phase,t[111]=b.resolution,t[112]=O,t[113]=Ye,t[114]=w.branch,t[115]=w.owner,t[116]=w.repo,t[117]=w.target,t[118]=E,t[119]=C,t[120]=k,t[121]=A,t[122]=j,t[123]=M,t[124]=N,t[125]=P,t[126]=F,t[127]=I,t[128]=L,t[129]=R,t[130]=z,t[131]=B,t[132]=V,t[133]=H,t[134]=U,t[135]=W,t[136]=G,t[137]=K,t[138]=q}else k=t[120],A=t[121],j=t[122],M=t[123],N=t[124],P=t[125],F=t[126],I=t[127],L=t[128],R=t[129],z=t[130],B=t[131],V=t[132],H=t[133],U=t[134],W=t[135],G=t[136],K=t[137],q=t[138];let J;t[170]===F?J=t[171]:(J=F?(0,v.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-switching`,role:`status`,"aria-live":`polite`,children:[(0,v.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,v.jsx)(r,{id:`CU3AiE`})]}):null,t[170]=F,t[171]=J);let Y;t[172]===M?Y=t[173]:(Y=M?(0,v.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-creating-worktree`,role:`status`,"aria-live":`polite`,children:[(0,v.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,v.jsx)(r,{id:`PZtgO0`})]}):null,t[172]=M,t[173]=Y);let X;t[174]!==k||t[175]!==I||t[176]!==L||t[177]!==R||t[178]!==J||t[179]!==Y?(X=(0,v.jsxs)(k,{children:[I,L,R,J,Y]}),t[174]=k,t[175]=I,t[176]=L,t[177]=R,t[178]=J,t[179]=Y,t[180]=X):X=t[180];let gt;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,v.jsx)(r,{id:`dEgA5A`}),t[181]=gt):gt=t[181];let Z;t[182]===O?Z=t[183]:(Z=(0,v.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:O,"data-testid":`share-branch-switch-cancel`,children:gt}),t[182]=O,t[183]=Z);let Q;t[184]!==b.phase||t[185]!==b.resolution||t[186]!==M||t[187]!==ot||t[188]!==nt||t[189]!==ft||t[190]!==mt||t[191]!==it||t[192]!==Qe||t[193]!==et||t[194]!==N||t[195]!==P||t[196]!==F||t[197]!==K||t[198]!==q?(Q=b.phase===`branch-in-other-worktree`?(0,v.jsx)(o,{onClick:mt,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,v.jsx)(r,{id:`hyCxJY`})}):b.phase===`verdict`?b.resolution.kind===`on-origin`?(0,v.jsxs)(o,{onClick:et,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,v.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),(0,v.jsx)(r,{id:`uA_jXp`})]}):b.resolution.kind===`renamed`?(0,v.jsxs)(o,{onClick:nt,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,v.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),(0,v.jsx)(r,{id:`AItsE5`})]}):b.resolution.kind===`diverged`?(0,v.jsxs)(o,{onClick:it,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,v.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),P]}):null:(0,v.jsxs)(`div`,{className:`flex min-w-0 flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end sm:gap-2`,children:[K?.openCurrentEnabled?(0,v.jsxs)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:ot,disabled:F||M,"data-testid":`share-branch-switch-open-current`,children:[(0,v.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),N]}):null,(0,v.jsx)(o,{variant:`outline`,onClick:Qe,disabled:!K?.switchEnabled||F||M,"aria-disabled":!K?.switchEnabled||F||M,"aria-describedby":K&&!K.switchEnabled&&K.conflictingFiles.length>0?`share-receive-branch-conflict-files`:void 0,"data-testid":`share-branch-switch-switch`,children:F?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(u,{className:`size-3.5`,"aria-hidden":`true`}),P]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),P]})}),(0,v.jsx)(o,{onClick:ft,disabled:!K||F||M,"data-testid":`share-branch-switch-worktree`,children:M?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(u,{className:`size-3.5`,"aria-hidden":`true`}),q]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),q]})})]}),t[184]=b.phase,t[185]=b.resolution,t[186]=M,t[187]=ot,t[188]=nt,t[189]=ft,t[190]=mt,t[191]=it,t[192]=Qe,t[193]=et,t[194]=N,t[195]=P,t[196]=F,t[197]=K,t[198]=q,t[199]=Q):Q=t[199];let _t;t[200]!==Z||t[201]!==Q?(_t=(0,v.jsxs)(ie,{className:`sm:justify-between`,children:[Z,Q]}),t[200]=Z,t[201]=Q,t[202]=_t):_t=t[202];let $;t[203]!==A||t[204]!==z||t[205]!==B||t[206]!==V||t[207]!==H||t[208]!==U||t[209]!==X||t[210]!==_t?($=(0,v.jsxs)(A,{className:z,"data-testid":B,onInteractOutside:V,onPointerDownOutside:H,children:[U,X,_t]}),t[203]=A,t[204]=z,t[205]=B,t[206]=V,t[207]=H,t[208]=U,t[209]=X,t[210]=_t,t[211]=$):$=t[211];let vt;return t[212]!==j||t[213]!==W||t[214]!==G||t[215]!==$?(vt=(0,v.jsx)(j,{open:W,onOpenChange:G,children:$}),t[212]=j,t[213]=W,t[214]=G,t[215]=$,t[216]=vt):vt=t[216],vt}function Ce(e){return(0,v.jsx)(`li`,{children:(0,v.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function we(e){e.preventDefault()}function Te(e){e.preventDefault()}function Ee(){return p.request()}function De(e){return be(e,null).state}function Oe(e){return ye(e,null)}function ke(e){return me(e,null)}function Ae(){return null}export{y as ShareBranchSwitchDialog};
|
package/dist/public/assets/{ShareReceiveDialog-BmMkjWTr.js → ShareReceiveDialog-DmLaRlCo.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-CA0dewJJ.js";import{a as ee,c as te,i as ne,n as re,o as s,s as c,t as l}from"./dialog-R8GugqUq.js";import{xn as u,yn as d}from"./dist-ILlrHFKs.js";import{n as f}from"./dist-B6jB2qbD2.js";import{t as p}from"./desktop-bridge-types-NXCK8Pd7.js";import{t as ie}from"./spinner-CHTY-VE-.js";import{a as ae,i as m,n as h,o as g,r as oe,s as _}from"./receive-store-BrOspwat.js";import{t as se}from"./share-metadata-rows-D5y9TY7o.js";var v=e(n(),1),y=a(),b=e=>({phase:`ready`,seed:e});function x(e){return e.phase===`ready`?{phase:`initializing`,seed:e.seed}:e}function S(e,t){return e.phase===`initializing`?t.ok?{phase:`opening`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:t.reason,message:t.message}:e}function C(e,t){return e.phase===`opening`?t.ok?{phase:`done`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:`network-error`,message:t.message}:e}function w(e){return e.phase===`done`||e.phase===`cancelled`||e.phase===`error`?e:{phase:`cancelled`,seed:e.seed}}var T=t();function E(e){return e!==null&&e.kind===`launcher-consent`}function D(e){return e!==null&&e.kind===`launcher-miss`}function O(e){let t=(0,y.c)(14),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?h:i,o=(0,v.useSyncExternalStore)(a.subscribe,a.getSnapshot,A),[ee,te]=(0,v.useState)(0),[ne,re]=(0,v.useState)(o);o!==ne&&(re(o),te(k));let s,c;t[0]!==o||t[1]!==a?(s=()=>{if(!o)return;let e=_(o);e&&(f.error(e.message),a.dismiss())},c=[o,a],t[0]=o,t[1]=a,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,v.useEffect)(s,c);let l;t[4]===o?l=t[5]:(l=D(o)?o:null,t[4]=o,t[5]=l);let u=l,d;t[6]===o?d=t[7]:(d=E(o)?o:null,t[6]=o,t[7]=d);let p=d??u;if(!p)return null;let ie;return t[8]!==p||t[9]!==n||t[10]!==r||t[11]!==ee||t[12]!==a?(ie=(0,T.jsx)(j,{payload:p,bridge:n,cloneController:r,store:a},ee),t[8]=p,t[9]=n,t[10]=r,t[11]=ee,t[12]=a,t[13]=ie):ie=t[13],ie}function k(e){return e+1}function A(){return null}function j(e){let t=(0,y.c)(165),{payload:n,bridge:a,cloneController:h,store:_}=e,{_:x}=i(),[w,O]=(0,v.useState)(!1),[k,A]=(0,v.useState)(null),[j,fe]=(0,v.useState)(!1),[N,pe]=(0,v.useState)(!1),[P,me]=(0,v.useState)(null),[F,I]=(0,v.useState)(null),he=(0,v.useRef)(!1),ge=(0,v.useRef)(null),_e,ve;t[0]===P?(_e=t[1],ve=t[2]):(_e=()=>{P&&ge.current?.focus()},ve=[P],t[0]=P,t[1]=_e,t[2]=ve),(0,v.useEffect)(_e,ve);let ye;t[3]!==F||t[4]!==n?(ye=()=>{E(n)&&F===null&&(console.warn(`[receive] q1_hit=true selection=branch_match_non_ok candidate=${n.candidatePath}`),I(b({candidatePath:n.candidatePath,branch:n.share.branch,targetPath:p(n.share.target),targetKind:n.share.target.kind,parentProjectName:n.parentProjectName})))},t[3]=F,t[4]=n,t[5]=ye):ye=t[5];let be;t[6]===n?be=t[7]:(be=[n],t[6]=n,t[7]=be),(0,v.useEffect)(ye,be);let xe;t[8]!==k||t[9]!==h||t[10]!==n?(xe=()=>{if(!h||!D(n)||k!==null||he.current)return;he.current=!0,fe(!0);let e=n.share.host;h.getAuthStatus(e).then(e=>{A(e)}).catch(t=>{console.warn(`[receive] auth pre-flight probe failed`,t instanceof Error?t.message:t),A({authenticated:!1,host:e})}).finally(()=>{fe(!1)})},t[8]=k,t[9]=h,t[10]=n,t[11]=xe):xe=t[11];let Se;t[12]!==k||t[13]!==n?(Se=[n,k],t[12]=k,t[13]=n,t[14]=Se):Se=t[14],(0,v.useEffect)(xe,Se);let L=D(n)?n:null,Ce=E(n)?n:null,R=L?.share??Ce?.share??null,z,B,V,H,we,Te,U,W;if(t[15]!==x||t[16]!==j||t[17]!==a||t[18]!==h||t[19]!==N||t[20]!==F||t[21]!==L||t[22]!==w||t[23]!==R||t[24]!==_){U=Symbol.for(`react.early_return_sentinel`);bb0:{let e=R?{host:R.host,owner:R.owner,repo:R.repo}:null,n;t[33]!==x||t[34]!==R?.target.kind?(n=R?.target.kind===`folder`?x({id:`ugoTXs`}):x({id:`XH30C4`}),t[33]=x,t[34]=R?.target.kind,t[35]=n):n=t[35],W=n,V=async function(){if(!L||!e)return;if(console.log(ae({q2_path:`clone`})),!h){f.info(x({id:`27XW26`}),{action:{label:x({id:`B3NAZC`}),onClick:()=>{a.navigator.open()}},duration:8e3});return}if(N)return;me(null),pe(!0);let t=oe(e),n;try{n=await h.runClone({url:t,branch:L.share.branch})}catch(e){let t=e;console.warn(`[receive] runClone threw unexpectedly`,t),pe(!1),me({detail:t instanceof Error?t.message:String(t)});return}if(pe(!1),n.kind===`error`){me({detail:n.detail??null});return}if(n.kind===`ok`){try{await a.project.open({path:n.dir,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:L.share.target.kind,path:p(L.share.target)}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] project open after clone failed`,t instanceof Error?t.message:t),f.error(x({id:`438Fca`}))}return}};let i;t[36]!==x||t[37]!==j||t[38]!==h?(i=async function(){if(!(!h||j)){fe(!0);try{let e=await h.startSignIn();fe(!1),e!==null&&A(e)}catch(e){let t=e;fe(!1),console.warn(`[receive] startSignIn failed`,t instanceof Error?t.message:t),f.error(x({id:`lzwo7p`}))}}},t[36]=x,t[37]=j,t[38]=h,t[39]=i):i=t[39],we=i,H=async function(){if(!(!L||!e||w)){me(null),O(!0),console.log(ae({q2_path:`local`}));try{for(;;){let t=await a.dialog.openFolder();if(!t)break;let n=await a.share.validateLocalFolder({folderPath:t,host:e.host,owner:e.owner,repo:e.repo});if(console.log(ae({folder_validate:n.kind})),n.kind===`ok`){let e=L.share.branch,n={currentBranch:null,headSha:null,detached:!1};try{n=await a.project.readHeadBranch(t)}catch(e){let t=e;console.warn(`[receive] local-folder readHeadBranch failed`,t instanceof Error?t.message:t)}let r=u(e,n)!==`true`;try{await a.project.open({path:t,target:`new-window`,entryPoint:`share-receive`,...r?{pendingShareBranchSwitch:{share:L.share,projectPath:t,currentBranch:n.currentBranch}}:{pendingDeepLinkTarget:{kind:L.share.target.kind,path:p(L.share.target)}}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] local-folder-open failed`,t instanceof Error?t.message:t),f.error(x({id:`phM8Kh`}))}break}let r=g(n,e);r&&f.error(r)}}catch(e){let t=e;console.warn(`[receive] local-folder-validate failed`,t instanceof Error?t.message:t),f.error(x({id:`rlUzXK`}))}O(!1)}};let m;t[40]!==x||t[41]!==a||t[42]!==F||t[43]!==_?(m=function(){if(F===null||F.phase!==`ready`)return;let e=F.seed;console.warn(`[receive] consent_dialog action=initialize worktree=${e.candidatePath}`),I(de),a.project.okInit({projectPath:e.candidatePath}).then(async t=>{if(t.ok===!0){I(e=>e===null?e:S(e,{ok:!0,projectPath:t.projectPath}));try{await a.project.open({path:t.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:e.targetKind,path:e.targetPath},pendingBranch:e.branch}),I(ue),_.dismiss()}catch(t){let n=t,r=n instanceof Error?n.message:String(n);I(e=>e===null?e:C(e,{ok:!1,message:r})),f.error(x({id:`nDT8qt`,values:{0:e.candidatePath}}))}return}let n=t.reason,r=t.message||`Initialization failed.`;I(e=>e===null?e:S(e,{ok:!1,reason:n,message:r})),f.error(r)}).catch(t=>{let n=t instanceof Error?t.message:String(t);I(e=>e===null?e:S(e,{ok:!1,reason:`network-error`,message:n})),f.error(x({id:`3Mwaly`,values:{0:e.candidatePath}}))})},t[40]=x,t[41]=a,t[42]=F,t[43]=_,t[44]=m):m=t[44];let v=m,y;t[45]!==F||t[46]!==_?(y=function(){F!==null&&console.warn(`[receive] consent_dialog action=cancel worktree=${F.seed.candidatePath}`),I(M),_.dismiss()},t[45]=F,t[46]=_,t[47]=y):y=t[47];let b=y;if(F!==null&&F.phase!==`cancelled`&&F.phase!==`done`&&R!==null){let e=F.seed,n=F.phase===`initializing`||F.phase===`opening`,i;t[48]===b?i=t[49]:(i=e=>{e||b()},t[48]=b,t[49]=i);let a;t[50]===W?a=t[51]:(a=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:W}})}),t[50]=W,t[51]=a);let u;t[52]===R.target?u=t[53]:(u=p(R.target)?`— ${p(R.target)}`:``,t[52]=R.target,t[53]=u);let d;t[54]!==R.owner||t[55]!==R.repo||t[56]!==u?(d=(0,T.jsx)(ee,{className:`sr-only`,children:(0,T.jsx)(r,{id:`pgq_xf`,values:{0:R.owner,1:R.repo,2:u}})}),t[54]=R.owner,t[55]=R.repo,t[56]=u,t[57]=d):d=t[57];let f=R.owner,ae=R.repo,m;t[58]===R.target?m=t[59]:(m=p(R.target),t[58]=R.target,t[59]=m);let h;t[60]!==R.branch||t[61]!==R.owner||t[62]!==R.repo||t[63]!==R.target.kind||t[64]!==m?(h=(0,T.jsx)(se,{owner:f,repo:ae,path:m,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[60]=R.branch,t[61]=R.owner,t[62]=R.repo,t[63]=R.target.kind,t[64]=m,t[65]=h):h=t[65];let g;t[66]!==a||t[67]!==d||t[68]!==h?(g=(0,T.jsxs)(c,{children:[a,d,h]}),t[66]=a,t[67]=d,t[68]=h,t[69]=g):g=t[69];let oe;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`KsAPaB`})}),t[70]=oe):oe=t[70];let _;t[71]===e.candidatePath?_=t[72]:(_=(0,T.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-receive-consent-path`,children:e.candidatePath}),t[71]=e.candidatePath,t[72]=_);let y;t[73]===e.parentProjectName?y=t[74]:(y=e.parentProjectName===null?null:(0,T.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,"data-testid":`share-receive-consent-parent`,children:(0,T.jsx)(r,{id:`JmfgFc`,values:{0:e.parentProjectName}})}),t[73]=e.parentProjectName,t[74]=y);let x;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`w7SsvI`})}),t[75]=x):x=t[75];let S;t[76]!==F.message||t[77]!==F.phase?(S=F.phase===`error`?(0,T.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,"data-testid":`share-receive-consent-error`,role:`alert`,children:F.message}):null,t[76]=F.message,t[77]=F.phase,t[78]=S):S=t[78];let C;t[79]!==_||t[80]!==y||t[81]!==S?(C=(0,T.jsxs)(re,{children:[oe,_,y,x,S]}),t[79]=_,t[80]=y,t[81]=S,t[82]=C):C=t[82];let w;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,T.jsx)(r,{id:`dEgA5A`}),t[83]=w):w=t[83];let E;t[84]===b?E=t[85]:(E=(0,T.jsx)(o,{variant:`ghost`,onClick:b,"data-testid":`share-receive-consent-cancel`,children:w}),t[84]=b,t[85]=E);let D=n||F.phase===`error`,O=n||F.phase===`error`,k;t[86]===n?k=t[87]:(k=n?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ie,{className:`mr-2 h-4 w-4`,"aria-hidden":`true`}),(0,T.jsx)(r,{id:`NKkZXl`})]}):(0,T.jsx)(r,{id:`NKkZXl`}),t[86]=n,t[87]=k);let A;t[88]!==v||t[89]!==D||t[90]!==O||t[91]!==k?(A=(0,T.jsx)(o,{onClick:v,disabled:D,"aria-disabled":O,"data-testid":`share-receive-consent-initialize`,children:k}),t[88]=v,t[89]=D,t[90]=O,t[91]=k,t[92]=A):A=t[92];let j;t[93]!==E||t[94]!==A?(j=(0,T.jsxs)(s,{children:[E,A]}),t[93]=E,t[94]=A,t[95]=j):j=t[95];let M;t[96]!==g||t[97]!==C||t[98]!==j?(M=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-consent-dialog`,onInteractOutside:le,onPointerDownOutside:ce,children:[g,C,j]}),t[96]=g,t[97]=C,t[98]=j,t[99]=M):M=t[99];let ue;t[100]!==i||t[101]!==M?(ue=(0,T.jsx)(l,{open:!0,onOpenChange:i,children:M}),t[100]=i,t[101]=M,t[102]=ue):ue=t[102],U=ue;break bb0}if(!L||!R||!e){U=null;break bb0}z=h!==void 0&&!N;let E;t[103]!==x||t[104]!==N?(E=x(N?{id:`YjhKI5`}:{id:`LE7t79`}),t[103]=x,t[104]=N,t[105]=E):E=t[105],B=E,Te=d(e)}t[15]=x,t[16]=j,t[17]=a,t[18]=h,t[19]=N,t[20]=F,t[21]=L,t[22]=w,t[23]=R,t[24]=_,t[25]=z,t[26]=B,t[27]=V,t[28]=H,t[29]=we,t[30]=Te,t[31]=U,t[32]=W}else z=t[25],B=t[26],V=t[27],H=t[28],we=t[29],Te=t[30],U=t[31],W=t[32];if(U!==Symbol.for(`react.early_return_sentinel`))return U;let Ee=Te,De=k?.authenticated?k.login:void 0,Oe;t[106]===P?Oe=t[107]:(Oe=P?.detail?m(P.detail):``,t[106]=P,t[107]=Oe);let ke=Oe,G;t[108]===_?G=t[109]:(G=e=>{e||_.dismiss()},t[108]=_,t[109]=G);let K;t[110]===W?K=t[111]:(K=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:W}})}),t[110]=W,t[111]=K);let q;t[112]===R.target?q=t[113]:(q=p(R.target)?` — ${p(R.target)}`:null,t[112]=R.target,t[113]=q);let J;t[114]!==R.owner||t[115]!==R.repo||t[116]!==q?(J=(0,T.jsxs)(ee,{className:`sr-only`,children:[R.owner,`/`,R.repo,q]}),t[114]=R.owner,t[115]=R.repo,t[116]=q,t[117]=J):J=t[117];let Ae=R.owner,je=R.repo,Y;t[118]===R.target?Y=t[119]:(Y=p(R.target),t[118]=R.target,t[119]=Y);let X;t[120]!==R.branch||t[121]!==R.owner||t[122]!==R.repo||t[123]!==R.target.kind||t[124]!==Y?(X=(0,T.jsx)(se,{owner:Ae,repo:je,path:Y,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[120]=R.branch,t[121]=R.owner,t[122]=R.repo,t[123]=R.target.kind,t[124]=Y,t[125]=X):X=t[125];let Z;t[126]!==K||t[127]!==J||t[128]!==X?(Z=(0,T.jsxs)(c,{children:[K,J,X]}),t[126]=K,t[127]=J,t[128]=X,t[129]=Z):Z=t[129];let Q;t[130]!==h||t[131]!==z||t[132]!==P||t[133]!==ke||t[134]!==B||t[135]!==N||t[136]!==V||t[137]!==H||t[138]!==w?(Q=P?(0,T.jsxs)(`div`,{ref:ge,tabIndex:-1,className:`rounded-lg border border-destructive/40 bg-destructive/5 p-4 outline-none`,"data-testid":`share-receive-clone-error`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,role:`alert`,children:(0,T.jsx)(r,{id:`aiArms`})}),ke?(0,T.jsxs)(`p`,{className:`mt-2 break-words text-xs text-destructive`,"data-testid":`share-receive-clone-error-message`,children:[(0,T.jsx)(r,{id:`4BITzH`}),` `,(0,T.jsxs)(`span`,{className:`font-mono text-foreground/80`,children:[`"`,ke,`"`]})]}):null,(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`Llyqvo`})}),(0,T.jsxs)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,"data-testid":`share-receive-clone-error-reasons`,children:[(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`6LbUG7`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`_pY_Vq`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`J6mxC1`})})]}),(0,T.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,T.jsx)(o,{onClick:()=>{V()},"data-testid":`share-receive-clone-retry`,children:(0,T.jsx)(r,{id:`KDw4GX`})}),(0,T.jsx)(o,{variant:`outline`,onClick:()=>{H()},disabled:w||N,"data-testid":`share-receive-error-local`,children:(0,T.jsx)(r,{id:`xFQRu4`})})]})]}):(0,T.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-clone`,className:`flex flex-col items-start gap-2 rounded-lg border border-primary/50 bg-primary/5 p-4 text-left transition hover:border-primary hover:bg-primary/10 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-primary/50 disabled:hover:bg-primary/5`,onClick:()=>{V()},disabled:h!==void 0&&!z,"aria-disabled":h!==void 0&&!z,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:B}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`fj5YiP`})})]}),(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-local`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-card p-4 text-left transition hover:border-foreground/50 hover:bg-accent focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,onClick:()=>{H()},disabled:w||N,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:(0,T.jsx)(r,{id:`HfI1dR`})}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`_qD6mn`})})]})]}),t[130]=h,t[131]=z,t[132]=P,t[133]=ke,t[134]=B,t[135]=N,t[136]=V,t[137]=H,t[138]=w,t[139]=Q):Q=t[139];let $;t[140]!==j||t[141]!==k||t[142]!==h||t[143]!==we||t[144]!==De?($=h?(0,T.jsx)(`div`,{className:`mt-3 flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-xs`,"data-testid":`share-receive-auth-banner`,role:`status`,"aria-live":`polite`,children:k===null?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`UDFrWm`})}):k.authenticated?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`VAHWL_`,values:{signedInLogin:De},components:{0:(0,T.jsx)(`span`,{className:`font-medium text-foreground/90`})}})}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`SgKLfA`})}),(0,T.jsx)(`button`,{type:`button`,"data-testid":`share-receive-signin`,className:`font-medium text-primary underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded`,onClick:()=>{we()},disabled:j,children:j?(0,T.jsx)(r,{id:`PKLY-1`}):(0,T.jsx)(r,{id:`3jod3l`})})]})}):null,t[140]=j,t[141]=k,t[142]=h,t[143]=we,t[144]=De,t[145]=$):$=t[145];let Me;t[146]!==P||t[147]!==Ee?(Me=P?null:(0,T.jsx)(`p`,{className:`mt-3 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`RJ3a8Z`,values:{lookingForUrl:Ee},components:{0:(0,T.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),t[146]=P,t[147]=Ee,t[148]=Me):Me=t[148];let Ne;t[149]!==Q||t[150]!==$||t[151]!==Me?(Ne=(0,T.jsxs)(re,{children:[Q,$,Me]}),t[149]=Q,t[150]=$,t[151]=Me,t[152]=Ne):Ne=t[152];let Pe;t[153]===_?Pe=t[154]:(Pe=()=>_.dismiss(),t[153]=_,t[154]=Pe);let Fe;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,T.jsx)(r,{id:`dEgA5A`}),t[155]=Fe):Fe=t[155];let Ie;t[156]===Pe?Ie=t[157]:(Ie=(0,T.jsx)(s,{children:(0,T.jsx)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:Pe,children:Fe})}),t[156]=Pe,t[157]=Ie);let Le;t[158]!==Z||t[159]!==Ne||t[160]!==Ie?(Le=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[Z,Ne,Ie]}),t[158]=Z,t[159]=Ne,t[160]=Ie,t[161]=Le):Le=t[161];let Re;return t[162]!==G||t[163]!==Le?(Re=(0,T.jsx)(l,{open:!0,onOpenChange:G,children:Le}),t[162]=G,t[163]=Le,t[164]=Re):Re=t[164],Re}function ce(e){return e.preventDefault()}function le(e){return e.preventDefault()}function M(e){return e===null?e:w(e)}function ue(e){return e===null?e:C(e,{ok:!0})}function de(e){return e===null?e:x(e)}export{O as ShareReceiveDialog};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-CA0dewJJ.js";import{a as ee,c as te,i as ne,n as re,o as s,s as c,t as l}from"./dialog-R8GugqUq.js";import{xn as u,yn as d}from"./dist-C27Q9mDy.js";import{n as f}from"./dist-B6jB2qbD2.js";import{t as p}from"./desktop-bridge-types-NXCK8Pd7.js";import{t as ie}from"./spinner-CHTY-VE-.js";import{a as ae,i as m,n as h,o as g,r as oe,s as _}from"./receive-store-DjapXAoN.js";import{t as se}from"./share-metadata-rows-D5y9TY7o.js";var v=e(n(),1),y=a(),b=e=>({phase:`ready`,seed:e});function x(e){return e.phase===`ready`?{phase:`initializing`,seed:e.seed}:e}function S(e,t){return e.phase===`initializing`?t.ok?{phase:`opening`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:t.reason,message:t.message}:e}function C(e,t){return e.phase===`opening`?t.ok?{phase:`done`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:`network-error`,message:t.message}:e}function w(e){return e.phase===`done`||e.phase===`cancelled`||e.phase===`error`?e:{phase:`cancelled`,seed:e.seed}}var T=t();function E(e){return e!==null&&e.kind===`launcher-consent`}function D(e){return e!==null&&e.kind===`launcher-miss`}function O(e){let t=(0,y.c)(14),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?h:i,o=(0,v.useSyncExternalStore)(a.subscribe,a.getSnapshot,A),[ee,te]=(0,v.useState)(0),[ne,re]=(0,v.useState)(o);o!==ne&&(re(o),te(k));let s,c;t[0]!==o||t[1]!==a?(s=()=>{if(!o)return;let e=_(o);e&&(f.error(e.message),a.dismiss())},c=[o,a],t[0]=o,t[1]=a,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,v.useEffect)(s,c);let l;t[4]===o?l=t[5]:(l=D(o)?o:null,t[4]=o,t[5]=l);let u=l,d;t[6]===o?d=t[7]:(d=E(o)?o:null,t[6]=o,t[7]=d);let p=d??u;if(!p)return null;let ie;return t[8]!==p||t[9]!==n||t[10]!==r||t[11]!==ee||t[12]!==a?(ie=(0,T.jsx)(j,{payload:p,bridge:n,cloneController:r,store:a},ee),t[8]=p,t[9]=n,t[10]=r,t[11]=ee,t[12]=a,t[13]=ie):ie=t[13],ie}function k(e){return e+1}function A(){return null}function j(e){let t=(0,y.c)(165),{payload:n,bridge:a,cloneController:h,store:_}=e,{_:x}=i(),[w,O]=(0,v.useState)(!1),[k,A]=(0,v.useState)(null),[j,fe]=(0,v.useState)(!1),[N,pe]=(0,v.useState)(!1),[P,me]=(0,v.useState)(null),[F,I]=(0,v.useState)(null),he=(0,v.useRef)(!1),ge=(0,v.useRef)(null),_e,ve;t[0]===P?(_e=t[1],ve=t[2]):(_e=()=>{P&&ge.current?.focus()},ve=[P],t[0]=P,t[1]=_e,t[2]=ve),(0,v.useEffect)(_e,ve);let ye;t[3]!==F||t[4]!==n?(ye=()=>{E(n)&&F===null&&(console.warn(`[receive] q1_hit=true selection=branch_match_non_ok candidate=${n.candidatePath}`),I(b({candidatePath:n.candidatePath,branch:n.share.branch,targetPath:p(n.share.target),targetKind:n.share.target.kind,parentProjectName:n.parentProjectName})))},t[3]=F,t[4]=n,t[5]=ye):ye=t[5];let be;t[6]===n?be=t[7]:(be=[n],t[6]=n,t[7]=be),(0,v.useEffect)(ye,be);let xe;t[8]!==k||t[9]!==h||t[10]!==n?(xe=()=>{if(!h||!D(n)||k!==null||he.current)return;he.current=!0,fe(!0);let e=n.share.host;h.getAuthStatus(e).then(e=>{A(e)}).catch(t=>{console.warn(`[receive] auth pre-flight probe failed`,t instanceof Error?t.message:t),A({authenticated:!1,host:e})}).finally(()=>{fe(!1)})},t[8]=k,t[9]=h,t[10]=n,t[11]=xe):xe=t[11];let Se;t[12]!==k||t[13]!==n?(Se=[n,k],t[12]=k,t[13]=n,t[14]=Se):Se=t[14],(0,v.useEffect)(xe,Se);let L=D(n)?n:null,Ce=E(n)?n:null,R=L?.share??Ce?.share??null,z,B,V,H,we,Te,U,W;if(t[15]!==x||t[16]!==j||t[17]!==a||t[18]!==h||t[19]!==N||t[20]!==F||t[21]!==L||t[22]!==w||t[23]!==R||t[24]!==_){U=Symbol.for(`react.early_return_sentinel`);bb0:{let e=R?{host:R.host,owner:R.owner,repo:R.repo}:null,n;t[33]!==x||t[34]!==R?.target.kind?(n=R?.target.kind===`folder`?x({id:`ugoTXs`}):x({id:`XH30C4`}),t[33]=x,t[34]=R?.target.kind,t[35]=n):n=t[35],W=n,V=async function(){if(!L||!e)return;if(console.log(ae({q2_path:`clone`})),!h){f.info(x({id:`27XW26`}),{action:{label:x({id:`B3NAZC`}),onClick:()=>{a.navigator.open()}},duration:8e3});return}if(N)return;me(null),pe(!0);let t=oe(e),n;try{n=await h.runClone({url:t,branch:L.share.branch})}catch(e){let t=e;console.warn(`[receive] runClone threw unexpectedly`,t),pe(!1),me({detail:t instanceof Error?t.message:String(t)});return}if(pe(!1),n.kind===`error`){me({detail:n.detail??null});return}if(n.kind===`ok`){try{await a.project.open({path:n.dir,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:L.share.target.kind,path:p(L.share.target)}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] project open after clone failed`,t instanceof Error?t.message:t),f.error(x({id:`438Fca`}))}return}};let i;t[36]!==x||t[37]!==j||t[38]!==h?(i=async function(){if(!(!h||j)){fe(!0);try{let e=await h.startSignIn();fe(!1),e!==null&&A(e)}catch(e){let t=e;fe(!1),console.warn(`[receive] startSignIn failed`,t instanceof Error?t.message:t),f.error(x({id:`lzwo7p`}))}}},t[36]=x,t[37]=j,t[38]=h,t[39]=i):i=t[39],we=i,H=async function(){if(!(!L||!e||w)){me(null),O(!0),console.log(ae({q2_path:`local`}));try{for(;;){let t=await a.dialog.openFolder();if(!t)break;let n=await a.share.validateLocalFolder({folderPath:t,host:e.host,owner:e.owner,repo:e.repo});if(console.log(ae({folder_validate:n.kind})),n.kind===`ok`){let e=L.share.branch,n={currentBranch:null,headSha:null,detached:!1};try{n=await a.project.readHeadBranch(t)}catch(e){let t=e;console.warn(`[receive] local-folder readHeadBranch failed`,t instanceof Error?t.message:t)}let r=u(e,n)!==`true`;try{await a.project.open({path:t,target:`new-window`,entryPoint:`share-receive`,...r?{pendingShareBranchSwitch:{share:L.share,projectPath:t,currentBranch:n.currentBranch}}:{pendingDeepLinkTarget:{kind:L.share.target.kind,path:p(L.share.target)}}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] local-folder-open failed`,t instanceof Error?t.message:t),f.error(x({id:`phM8Kh`}))}break}let r=g(n,e);r&&f.error(r)}}catch(e){let t=e;console.warn(`[receive] local-folder-validate failed`,t instanceof Error?t.message:t),f.error(x({id:`rlUzXK`}))}O(!1)}};let m;t[40]!==x||t[41]!==a||t[42]!==F||t[43]!==_?(m=function(){if(F===null||F.phase!==`ready`)return;let e=F.seed;console.warn(`[receive] consent_dialog action=initialize worktree=${e.candidatePath}`),I(de),a.project.okInit({projectPath:e.candidatePath}).then(async t=>{if(t.ok===!0){I(e=>e===null?e:S(e,{ok:!0,projectPath:t.projectPath}));try{await a.project.open({path:t.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:e.targetKind,path:e.targetPath},pendingBranch:e.branch}),I(ue),_.dismiss()}catch(t){let n=t,r=n instanceof Error?n.message:String(n);I(e=>e===null?e:C(e,{ok:!1,message:r})),f.error(x({id:`nDT8qt`,values:{0:e.candidatePath}}))}return}let n=t.reason,r=t.message||`Initialization failed.`;I(e=>e===null?e:S(e,{ok:!1,reason:n,message:r})),f.error(r)}).catch(t=>{let n=t instanceof Error?t.message:String(t);I(e=>e===null?e:S(e,{ok:!1,reason:`network-error`,message:n})),f.error(x({id:`3Mwaly`,values:{0:e.candidatePath}}))})},t[40]=x,t[41]=a,t[42]=F,t[43]=_,t[44]=m):m=t[44];let v=m,y;t[45]!==F||t[46]!==_?(y=function(){F!==null&&console.warn(`[receive] consent_dialog action=cancel worktree=${F.seed.candidatePath}`),I(M),_.dismiss()},t[45]=F,t[46]=_,t[47]=y):y=t[47];let b=y;if(F!==null&&F.phase!==`cancelled`&&F.phase!==`done`&&R!==null){let e=F.seed,n=F.phase===`initializing`||F.phase===`opening`,i;t[48]===b?i=t[49]:(i=e=>{e||b()},t[48]=b,t[49]=i);let a;t[50]===W?a=t[51]:(a=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:W}})}),t[50]=W,t[51]=a);let u;t[52]===R.target?u=t[53]:(u=p(R.target)?`— ${p(R.target)}`:``,t[52]=R.target,t[53]=u);let d;t[54]!==R.owner||t[55]!==R.repo||t[56]!==u?(d=(0,T.jsx)(ee,{className:`sr-only`,children:(0,T.jsx)(r,{id:`pgq_xf`,values:{0:R.owner,1:R.repo,2:u}})}),t[54]=R.owner,t[55]=R.repo,t[56]=u,t[57]=d):d=t[57];let f=R.owner,ae=R.repo,m;t[58]===R.target?m=t[59]:(m=p(R.target),t[58]=R.target,t[59]=m);let h;t[60]!==R.branch||t[61]!==R.owner||t[62]!==R.repo||t[63]!==R.target.kind||t[64]!==m?(h=(0,T.jsx)(se,{owner:f,repo:ae,path:m,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[60]=R.branch,t[61]=R.owner,t[62]=R.repo,t[63]=R.target.kind,t[64]=m,t[65]=h):h=t[65];let g;t[66]!==a||t[67]!==d||t[68]!==h?(g=(0,T.jsxs)(c,{children:[a,d,h]}),t[66]=a,t[67]=d,t[68]=h,t[69]=g):g=t[69];let oe;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`KsAPaB`})}),t[70]=oe):oe=t[70];let _;t[71]===e.candidatePath?_=t[72]:(_=(0,T.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-receive-consent-path`,children:e.candidatePath}),t[71]=e.candidatePath,t[72]=_);let y;t[73]===e.parentProjectName?y=t[74]:(y=e.parentProjectName===null?null:(0,T.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,"data-testid":`share-receive-consent-parent`,children:(0,T.jsx)(r,{id:`JmfgFc`,values:{0:e.parentProjectName}})}),t[73]=e.parentProjectName,t[74]=y);let x;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`w7SsvI`})}),t[75]=x):x=t[75];let S;t[76]!==F.message||t[77]!==F.phase?(S=F.phase===`error`?(0,T.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,"data-testid":`share-receive-consent-error`,role:`alert`,children:F.message}):null,t[76]=F.message,t[77]=F.phase,t[78]=S):S=t[78];let C;t[79]!==_||t[80]!==y||t[81]!==S?(C=(0,T.jsxs)(re,{children:[oe,_,y,x,S]}),t[79]=_,t[80]=y,t[81]=S,t[82]=C):C=t[82];let w;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,T.jsx)(r,{id:`dEgA5A`}),t[83]=w):w=t[83];let E;t[84]===b?E=t[85]:(E=(0,T.jsx)(o,{variant:`ghost`,onClick:b,"data-testid":`share-receive-consent-cancel`,children:w}),t[84]=b,t[85]=E);let D=n||F.phase===`error`,O=n||F.phase===`error`,k;t[86]===n?k=t[87]:(k=n?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ie,{className:`mr-2 h-4 w-4`,"aria-hidden":`true`}),(0,T.jsx)(r,{id:`NKkZXl`})]}):(0,T.jsx)(r,{id:`NKkZXl`}),t[86]=n,t[87]=k);let A;t[88]!==v||t[89]!==D||t[90]!==O||t[91]!==k?(A=(0,T.jsx)(o,{onClick:v,disabled:D,"aria-disabled":O,"data-testid":`share-receive-consent-initialize`,children:k}),t[88]=v,t[89]=D,t[90]=O,t[91]=k,t[92]=A):A=t[92];let j;t[93]!==E||t[94]!==A?(j=(0,T.jsxs)(s,{children:[E,A]}),t[93]=E,t[94]=A,t[95]=j):j=t[95];let M;t[96]!==g||t[97]!==C||t[98]!==j?(M=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-consent-dialog`,onInteractOutside:le,onPointerDownOutside:ce,children:[g,C,j]}),t[96]=g,t[97]=C,t[98]=j,t[99]=M):M=t[99];let ue;t[100]!==i||t[101]!==M?(ue=(0,T.jsx)(l,{open:!0,onOpenChange:i,children:M}),t[100]=i,t[101]=M,t[102]=ue):ue=t[102],U=ue;break bb0}if(!L||!R||!e){U=null;break bb0}z=h!==void 0&&!N;let E;t[103]!==x||t[104]!==N?(E=x(N?{id:`YjhKI5`}:{id:`LE7t79`}),t[103]=x,t[104]=N,t[105]=E):E=t[105],B=E,Te=d(e)}t[15]=x,t[16]=j,t[17]=a,t[18]=h,t[19]=N,t[20]=F,t[21]=L,t[22]=w,t[23]=R,t[24]=_,t[25]=z,t[26]=B,t[27]=V,t[28]=H,t[29]=we,t[30]=Te,t[31]=U,t[32]=W}else z=t[25],B=t[26],V=t[27],H=t[28],we=t[29],Te=t[30],U=t[31],W=t[32];if(U!==Symbol.for(`react.early_return_sentinel`))return U;let Ee=Te,De=k?.authenticated?k.login:void 0,Oe;t[106]===P?Oe=t[107]:(Oe=P?.detail?m(P.detail):``,t[106]=P,t[107]=Oe);let ke=Oe,G;t[108]===_?G=t[109]:(G=e=>{e||_.dismiss()},t[108]=_,t[109]=G);let K;t[110]===W?K=t[111]:(K=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:W}})}),t[110]=W,t[111]=K);let q;t[112]===R.target?q=t[113]:(q=p(R.target)?` — ${p(R.target)}`:null,t[112]=R.target,t[113]=q);let J;t[114]!==R.owner||t[115]!==R.repo||t[116]!==q?(J=(0,T.jsxs)(ee,{className:`sr-only`,children:[R.owner,`/`,R.repo,q]}),t[114]=R.owner,t[115]=R.repo,t[116]=q,t[117]=J):J=t[117];let Ae=R.owner,je=R.repo,Y;t[118]===R.target?Y=t[119]:(Y=p(R.target),t[118]=R.target,t[119]=Y);let X;t[120]!==R.branch||t[121]!==R.owner||t[122]!==R.repo||t[123]!==R.target.kind||t[124]!==Y?(X=(0,T.jsx)(se,{owner:Ae,repo:je,path:Y,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[120]=R.branch,t[121]=R.owner,t[122]=R.repo,t[123]=R.target.kind,t[124]=Y,t[125]=X):X=t[125];let Z;t[126]!==K||t[127]!==J||t[128]!==X?(Z=(0,T.jsxs)(c,{children:[K,J,X]}),t[126]=K,t[127]=J,t[128]=X,t[129]=Z):Z=t[129];let Q;t[130]!==h||t[131]!==z||t[132]!==P||t[133]!==ke||t[134]!==B||t[135]!==N||t[136]!==V||t[137]!==H||t[138]!==w?(Q=P?(0,T.jsxs)(`div`,{ref:ge,tabIndex:-1,className:`rounded-lg border border-destructive/40 bg-destructive/5 p-4 outline-none`,"data-testid":`share-receive-clone-error`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,role:`alert`,children:(0,T.jsx)(r,{id:`aiArms`})}),ke?(0,T.jsxs)(`p`,{className:`mt-2 break-words text-xs text-destructive`,"data-testid":`share-receive-clone-error-message`,children:[(0,T.jsx)(r,{id:`4BITzH`}),` `,(0,T.jsxs)(`span`,{className:`font-mono text-foreground/80`,children:[`"`,ke,`"`]})]}):null,(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`Llyqvo`})}),(0,T.jsxs)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,"data-testid":`share-receive-clone-error-reasons`,children:[(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`6LbUG7`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`_pY_Vq`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`J6mxC1`})})]}),(0,T.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,T.jsx)(o,{onClick:()=>{V()},"data-testid":`share-receive-clone-retry`,children:(0,T.jsx)(r,{id:`KDw4GX`})}),(0,T.jsx)(o,{variant:`outline`,onClick:()=>{H()},disabled:w||N,"data-testid":`share-receive-error-local`,children:(0,T.jsx)(r,{id:`xFQRu4`})})]})]}):(0,T.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-clone`,className:`flex flex-col items-start gap-2 rounded-lg border border-primary/50 bg-primary/5 p-4 text-left transition hover:border-primary hover:bg-primary/10 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-primary/50 disabled:hover:bg-primary/5`,onClick:()=>{V()},disabled:h!==void 0&&!z,"aria-disabled":h!==void 0&&!z,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:B}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`fj5YiP`})})]}),(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-local`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-card p-4 text-left transition hover:border-foreground/50 hover:bg-accent focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,onClick:()=>{H()},disabled:w||N,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:(0,T.jsx)(r,{id:`HfI1dR`})}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`_qD6mn`})})]})]}),t[130]=h,t[131]=z,t[132]=P,t[133]=ke,t[134]=B,t[135]=N,t[136]=V,t[137]=H,t[138]=w,t[139]=Q):Q=t[139];let $;t[140]!==j||t[141]!==k||t[142]!==h||t[143]!==we||t[144]!==De?($=h?(0,T.jsx)(`div`,{className:`mt-3 flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-xs`,"data-testid":`share-receive-auth-banner`,role:`status`,"aria-live":`polite`,children:k===null?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`UDFrWm`})}):k.authenticated?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`VAHWL_`,values:{signedInLogin:De},components:{0:(0,T.jsx)(`span`,{className:`font-medium text-foreground/90`})}})}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`SgKLfA`})}),(0,T.jsx)(`button`,{type:`button`,"data-testid":`share-receive-signin`,className:`font-medium text-primary underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded`,onClick:()=>{we()},disabled:j,children:j?(0,T.jsx)(r,{id:`PKLY-1`}):(0,T.jsx)(r,{id:`3jod3l`})})]})}):null,t[140]=j,t[141]=k,t[142]=h,t[143]=we,t[144]=De,t[145]=$):$=t[145];let Me;t[146]!==P||t[147]!==Ee?(Me=P?null:(0,T.jsx)(`p`,{className:`mt-3 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`RJ3a8Z`,values:{lookingForUrl:Ee},components:{0:(0,T.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),t[146]=P,t[147]=Ee,t[148]=Me):Me=t[148];let Ne;t[149]!==Q||t[150]!==$||t[151]!==Me?(Ne=(0,T.jsxs)(re,{children:[Q,$,Me]}),t[149]=Q,t[150]=$,t[151]=Me,t[152]=Ne):Ne=t[152];let Pe;t[153]===_?Pe=t[154]:(Pe=()=>_.dismiss(),t[153]=_,t[154]=Pe);let Fe;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,T.jsx)(r,{id:`dEgA5A`}),t[155]=Fe):Fe=t[155];let Ie;t[156]===Pe?Ie=t[157]:(Ie=(0,T.jsx)(s,{children:(0,T.jsx)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:Pe,children:Fe})}),t[156]=Pe,t[157]=Ie);let Le;t[158]!==Z||t[159]!==Ne||t[160]!==Ie?(Le=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[Z,Ne,Ie]}),t[158]=Z,t[159]=Ne,t[160]=Ie,t[161]=Le):Le=t[161];let Re;return t[162]!==G||t[163]!==Le?(Re=(0,T.jsx)(l,{open:!0,onOpenChange:G,children:Le}),t[162]=G,t[163]=Le,t[164]=Re):Re=t[164],Re}function ce(e){return e.preventDefault()}function le(e){return e.preventDefault()}function M(e){return e===null?e:w(e)}function ue(e){return e===null?e:C(e,{ok:!0})}function de(e){return e===null?e:x(e)}export{O as ShareReceiveDialog};
|
package/dist/public/assets/{ShareReceiveMissDialog-R20sy2ia.js → ShareReceiveMissDialog-eWc73H2u.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-R8GugqUq.js";import{a as l,i as u,n as d,r as f}from"./pending-receive-nav-store-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-R8GugqUq.js";import{a as l,i as u,n as d,r as f}from"./pending-receive-nav-store-Clqxh2Fp.js";import{t as p}from"./miss-dialog-store-DzXIxgCB.js";import{f as m,p as h}from"./doc-paths-BVBn68AJ.js";var g=r(),_=e(n(),1),v=t();function y(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function b(){let e=(0,g.c)(2),t=(0,_.useSyncExternalStore)(p.subscribe,p.getSnapshot,x);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,v.jsx)(S,{nav:t},t.path),e[0]=t,e[1]=n),n}function x(){return null}function S(e){let t=(0,g.c)(29),{nav:n}=e,{state:r,refetch:_}=l(n),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(){p.dismiss()},t[0]=b):b=t[0];let x=b,S;t[1]===n.path?S=t[2]:(S=function(){window.location.hash=h(u(n.path)),x()},t[1]=n.path,t[2]=S);let C=S,w;t[3]!==n.branch||t[4]!==n.kind?(w=function(e){d.arm({kind:n.kind,path:e,branch:n.branch}),window.location.hash=n.kind===`folder`?h(e):m(e),x()},t[3]=n.branch,t[4]=n.kind,t[5]=w):w=t[5];let T=w,E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e||x()},t[6]=E):E=t[6];let D=r.phase,O=r.phase===`resolved`?r.resolution.verdict:void 0,k;t[7]===n.path?k=t[8]:(k=y(n.path),t[7]=n.path,t[8]=k);let A;t[9]===k?A=t[10]:(A=(0,v.jsx)(s,{children:(0,v.jsx)(i,{className:`truncate`,children:k})}),t[9]=k,t[10]=A);let j=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,M;t[11]!==n.path||t[12]!==T?(M=()=>T(n.path),t[11]=n.path,t[12]=T,t[13]=M):M=t[13];let N;t[14]!==C||t[15]!==n||t[16]!==T||t[17]!==_||t[18]!==r||t[19]!==M?(N=(0,v.jsx)(f,{nav:n,state:r,onBrowseFolder:C,onOpenRenamed:T,onEnableAutoSync:x,onSyncCompleted:_,onPullApplied:M}),t[14]=C,t[15]=n,t[16]=T,t[17]=_,t[18]=r,t[19]=M,t[20]=N):N=t[20];let P;t[21]!==N||t[22]!==j?(P=(0,v.jsx)(o,{className:j,children:N}),t[21]=N,t[22]=j,t[23]=P):P=t[23];let F;return t[24]!==r.phase||t[25]!==P||t[26]!==O||t[27]!==A?(F=(0,v.jsx)(c,{open:!0,onOpenChange:E,children:(0,v.jsxs)(a,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":D,"data-verdict":O,children:[A,P]})}),t[24]=r.phase,t[25]=P,t[26]=O,t[27]=A,t[28]=F):F=t[28],F}export{b as ShareReceiveMissDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{t as r}from"./square-pen-DdAKbKU7.js";import{o as i}from"./skill-scope-
|
|
1
|
+
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{t as r}from"./square-pen-DdAKbKU7.js";import{o as i}from"./skill-scope-D6RlM0oa.js";import{t as a}from"./SkillModeBanner-cMF-HPLA.js";var o=n(),s=e();function c(e){let n=(0,o.c)(7),{name:c}=e,l;n[0]===c?l=n[1]:(l=i(c),n[0]=c,n[1]=l);let u;n[2]===l?u=n[3]:(u=(0,s.jsx)(`strong`,{className:`font-medium text-foreground`,children:l}),n[2]=l,n[3]=u);let d=u,f;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,s.jsx)(r,{className:`size-4`,"aria-hidden":!0}),n[4]=f):f=n[4];let p;return n[5]===d?p=n[6]:(p=(0,s.jsx)(a,{icon:f,children:(0,s.jsx)(t,{id:`i-wHEp`,values:{boldName:d}})}),n[5]=d,n[6]=p),p}export{c as SkillEditBanner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-CA0dewJJ.js";import{i as s,n as c,t as l}from"./tooltip-DHXgxWLL.js";import{a as u,c as d,i as f,n as p,o as m,s as h,t as g}from"./dialog-R8GugqUq.js";import{t as _}from"./switch-B2sF5R0q.js";import{t as v}from"./arrow-up-right-CGe6dTck.js";import{t as y}from"./spinner-CHTY-VE-.js";import{t as b}from"./refresh-cw-CR2QWccs.js";import{t as x}from"./undo-2-CMyZc9mZ.js";import{t as S}from"./use-skill-origin-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-CA0dewJJ.js";import{i as s,n as c,t as l}from"./tooltip-DHXgxWLL.js";import{a as u,c as d,i as f,n as p,o as m,s as h,t as g}from"./dialog-R8GugqUq.js";import{t as _}from"./switch-B2sF5R0q.js";import{t as v}from"./arrow-up-right-CGe6dTck.js";import{t as y}from"./spinner-CHTY-VE-.js";import{t as b}from"./refresh-cw-CR2QWccs.js";import{t as x}from"./undo-2-CMyZc9mZ.js";import{t as S}from"./use-skill-origin-B_Rm_rN6.js";import{t as C}from"./DiffView-BcZip7m3.js";var w=e(n(),1),T=a(),E=t();function D(e){let t=(0,T.c)(31),{open:n,onOpenChange:i,skillName:a,localBody:s,upstreamBody:c,applying:l,onTakeUpstream:_}=e,v;t[0]===a?v=t[1]:(v=(0,E.jsx)(d,{children:(0,E.jsx)(r,{id:`EPKVES`,values:{skillName:a}})}),t[0]=a,t[1]=v);let y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,E.jsx)(u,{children:(0,E.jsx)(r,{id:`kKw0H3`})}),t[2]=y):y=t[2];let b;t[3]===v?b=t[4]:(b=(0,E.jsxs)(h,{children:[v,y]}),t[3]=v,t[4]=b);let x;t[5]!==s||t[6]!==c?(x=(0,E.jsx)(p,{className:`min-h-0 flex-1 overflow-auto`,children:(0,E.jsx)(C,{oldContent:s,newContent:c,layout:`unified`})}),t[5]=s,t[6]=c,t[7]=x):x=t[7];let S;t[8]===i?S=t[9]:(S=()=>i(!1),t[8]=i,t[9]=S);let w;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,E.jsx)(r,{id:`Tq3pcs`}),t[10]=w):w=t[10];let D;t[11]!==l||t[12]!==S?(D=(0,E.jsx)(o,{variant:`outline`,onClick:S,disabled:l,children:w}),t[11]=l,t[12]=S,t[13]=D):D=t[13];let O;t[14]===l?O=t[15]:(O=l?(0,E.jsx)(r,{id:`JL3si7`}):(0,E.jsx)(r,{id:`qkqG0b`}),t[14]=l,t[15]=O);let k;t[16]!==l||t[17]!==_||t[18]!==O?(k=(0,E.jsx)(o,{onClick:_,disabled:l,children:O}),t[16]=l,t[17]=_,t[18]=O,t[19]=k):k=t[19];let A;t[20]!==D||t[21]!==k?(A=(0,E.jsxs)(m,{children:[D,k]}),t[20]=D,t[21]=k,t[22]=A):A=t[22];let j;t[23]!==A||t[24]!==b||t[25]!==x?(j=(0,E.jsxs)(f,{className:`flex max-h-[85vh] max-w-3xl flex-col`,children:[b,x,A]}),t[23]=A,t[24]=b,t[25]=x,t[26]=j):j=t[26];let M;return t[27]!==i||t[28]!==n||t[29]!==j?(M=(0,E.jsx)(g,{open:n,onOpenChange:i,children:j}),t[27]=i,t[28]=n,t[29]=j,t[30]=M):M=t[30],M}function O(e){let t=(0,T.c)(48),{scope:n,name:a}=e,{_:u}=i(),d;t[0]!==a||t[1]!==n?(d={scope:n,name:a},t[0]=a,t[1]=n,t[2]=d):d=t[2];let{origin:f,github:p,displaySource:m,importedTitle:h,canReimport:g,updateAvailable:C,modified:O,autoUpdate:k,gitTracked:A,setAutoUpdate:j,revertable:M,reimport:N,reimporting:P,previewUpdate:F,revert:I,reverting:L}=S(d),[R,z]=(0,w.useState)(null),B;t[3]!==O||t[4]!==F||t[5]!==N?(B=async function(){if(O){let e=await F();e&&z(e);return}await N()},t[3]=O,t[4]=F,t[5]=N,t[6]=B):B=t[6];let V=B,H;t[7]===N?H=t[8]:(H=async function(){await N(),z(null)},t[7]=N,t[8]=H);let U=H;if(!f)return null;let W;t[9]!==m||t[10]!==p||t[11]!==h?(W=p?(0,E.jsxs)(`a`,{href:p,target:`_blank`,rel:`noreferrer`,title:h??void 0,className:`hidden min-w-0 max-w-48 items-center gap-1 hover:text-foreground @xl/toolbar:flex`,children:[(0,E.jsx)(`span`,{className:`truncate`,children:m}),(0,E.jsx)(v,{className:`size-3 shrink-0`,"aria-hidden":!0})]}):(0,E.jsx)(`span`,{title:h??void 0,className:`hidden min-w-0 max-w-48 truncate @xl/toolbar:inline`,children:m}),t[9]=m,t[10]=p,t[11]=h,t[12]=W):W=t[12];let G;t[13]!==u||t[14]!==k||t[15]!==g||t[16]!==A||t[17]!==j?(G=g?(0,E.jsxs)(l,{children:[(0,E.jsx)(s,{asChild:!0,children:(0,E.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1`,children:[(0,E.jsx)(`label`,{htmlFor:`skill-auto-update-switch`,className:`hidden cursor-pointer @xl/toolbar:inline`,children:(0,E.jsx)(r,{id:`2M0JF6`})}),(0,E.jsx)(_,{id:`skill-auto-update-switch`,checked:k&&!A,disabled:A,onCheckedChange:e=>void j(e===!0),"aria-label":u({id:`o9fPtM`}),className:`scale-75`})]})}),(0,E.jsx)(c,{side:`bottom`,children:A?(0,E.jsx)(r,{id:`vy_VIN`}):k?(0,E.jsx)(r,{id:`vGQxBT`}):(0,E.jsx)(r,{id:`9p_QBN`})})]}):null,t[13]=u,t[14]=k,t[15]=g,t[16]=A,t[17]=j,t[18]=G):G=t[18];let K;t[19]===O?K=t[20]:(K=O?(0,E.jsxs)(l,{children:[(0,E.jsx)(s,{asChild:!0,children:(0,E.jsx)(`span`,{className:`shrink-0 rounded-sm bg-amber-500/15 px-1.5 py-0.5 font-medium text-[11px] text-amber-700 dark:text-amber-400`,children:(0,E.jsx)(r,{id:`tgWuMB`})})}),(0,E.jsx)(c,{side:`bottom`,children:(0,E.jsx)(r,{id:`s0Iold`})})]}):null,t[19]=O,t[20]=K);let q;t[21]!==u||t[22]!==g||t[23]!==O||t[24]!==P||t[25]!==I||t[26]!==M||t[27]!==L?(q=O&&g&&M?(0,E.jsxs)(l,{children:[(0,E.jsx)(o,{variant:`ghost`,size:`sm`,onClick:()=>void I(),disabled:L||P,"aria-label":u({id:`VxLvKE`}),className:`shrink-0 gap-1 text-muted-foreground px-2 text-xs hover:text-foreground`,asChild:!0,children:(0,E.jsxs)(s,{children:[L?(0,E.jsx)(y,{icon:x,className:`size-3`,"aria-hidden":!0}):(0,E.jsx)(x,{className:`size-3`,"aria-hidden":!0}),(0,E.jsx)(`span`,{className:`hidden @xl/toolbar:inline`,children:L?(0,E.jsx)(r,{id:`fIJtam`}):(0,E.jsx)(r,{id:`jJdwCB`})})]})}),(0,E.jsx)(c,{side:`bottom`,children:(0,E.jsx)(r,{id:`XSb9HS`})})]}):null,t[21]=u,t[22]=g,t[23]=O,t[24]=P,t[25]=I,t[26]=M,t[27]=L,t[28]=q):q=t[28];let J;t[29]!==u||t[30]!==g||t[31]!==V||t[32]!==P||t[33]!==L||t[34]!==C?(J=g&&C?(0,E.jsxs)(l,{children:[(0,E.jsx)(o,{variant:`ghost`,size:`sm`,onClick:()=>void V(),disabled:P||L,"aria-label":u({id:`GidGkh`}),className:`shrink-0 gap-1 text-muted-foreground px-2 text-xs hover:text-foreground`,asChild:!0,children:(0,E.jsxs)(s,{children:[P?(0,E.jsx)(y,{icon:b,className:`size-3`,"aria-hidden":!0}):(0,E.jsx)(b,{className:`size-3`,"aria-hidden":!0}),(0,E.jsx)(`span`,{className:`hidden @xl/toolbar:inline`,children:P?(0,E.jsx)(r,{id:`JL3si7`}):(0,E.jsx)(r,{id:`EkH9pt`})})]})}),(0,E.jsx)(c,{side:`bottom`,children:(0,E.jsx)(r,{id:`GidGkh`})})]}):null,t[29]=u,t[30]=g,t[31]=V,t[32]=P,t[33]=L,t[34]=C,t[35]=J):J=t[35];let Y;t[36]!==R||t[37]!==a||t[38]!==U||t[39]!==P?(Y=R?(0,E.jsx)(D,{open:!0,onOpenChange:e=>{e||z(null)},skillName:a,localBody:R.localBody,upstreamBody:R.upstreamBody,applying:P,onTakeUpstream:()=>void U()}):null,t[36]=R,t[37]=a,t[38]=U,t[39]=P,t[40]=Y):Y=t[40];let X;return t[41]!==W||t[42]!==G||t[43]!==K||t[44]!==q||t[45]!==J||t[46]!==Y?(X=(0,E.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-muted-foreground text-xs`,children:[W,G,K,q,J,Y]}),t[41]=W,t[42]=G,t[43]=K,t[44]=q,t[45]=J,t[46]=Y,t[47]=X):X=t[47],X}export{O as SkillOriginInline};
|
package/dist/public/assets/{SkillToolbarControls-B_RJpm5V.js → SkillToolbarControls-CF4GI3N4.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{_ as s,g as c,r as l}from"./ChangedOutsideBadge-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{_ as s,g as c,r as l}from"./ChangedOutsideBadge-DrITuwxs.js";import{t as u}from"./button-CA0dewJJ.js";import{a as d,c as f,l as p,m,o as h,r as g,t as _,u as v}from"./dropdown-menu-CLgDYkh1.js";import{a as y,i as b,n as x,o as S,r as C,s as w,t as T}from"./select-CguJodwX.js";import{a as E,d as D,f as O,i as k,p as A,u as j}from"./skill-actions-5PfZ_o96.js";import{t as M}from"./chevron-down-DabHDQTe.js";import{t as N}from"./list-plus-2r7_ATZj.js";import{f as P,i as F,t as I}from"./skill-scope-D6RlM0oa.js";import{t as L}from"./use-skills-D1P4d0d_.js";var R=a(),z=e(n(),1),B=t();function V(e){let t=(0,R.c)(52),{scope:n,name:a}=e,{_:s}=i(),d=L(),f=k(),p;t[0]!==a||t[1]!==n||t[2]!==d.data||t[3]!==d.status?(p=d.status===`ready`?d.data.find(e=>e.scope===n&&e.name===a):void 0,t[0]=a,t[1]=n,t[2]=d.data,t[3]=d.status,t[4]=p):p=t[4];let h=p,v;t[5]!==h||t[6]!==a||t[7]!==n?(v=h??{scope:n,name:a,path:a,description:``,installed:!1,hosts:[]},t[5]=h,t[6]=a,t[7]=n,t[8]=v):v=t[8];let y=v,[b,x]=(0,z.useState)(!1),S=A(y,f),{installed:C,installing:w,hostSet:T}=S,E=h===void 0&&!C,j;t[9]!==h||t[10]!==T?(j=h?F(h,[...T]):[],t[9]=h,t[10]=T,t[11]=j):j=t[11];let N=j,P;t[12]!==f||t[13]!==y?(P=()=>f.requestFileCreate(y),t[12]=f,t[13]=y,t[14]=P):P=t[14];let I;t[15]===s?I=t[16]:(I=s({id:`leF0i_`}),t[15]=s,t[16]=I);let V;t[17]===s?V=t[18]:(V=s({id:`leF0i_`}),t[17]=s,t[18]=V);let H;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,B.jsx)(c,{className:`size-4`,"aria-hidden":!0}),t[19]=H):H=t[19];let U;t[20]!==P||t[21]!==I||t[22]!==V?(U=(0,B.jsx)(u,{variant:`outline`,size:`icon-sm`,className:`shrink-0 text-muted-foreground`,onClick:P,title:I,"aria-label":V,"data-testid":`skill-editor-new-file`,children:H}),t[20]=P,t[21]=I,t[22]=V,t[23]=U):U=t[23];let W=E?`resolving`:`installed`,G=E?`border-border bg-muted/50 text-muted-foreground`:`border-primary/50 bg-primary/5 text-primary hover:bg-primary/10 hover:text-primary aria-expanded:bg-primary/10 aria-expanded:text-primary`,K;t[24]===G?K=t[25]:(K=o(`h-7 shrink-0 gap-1 rounded-lg border px-2 font-normal text-xs shadow-xs font-mono uppercase`,G),t[24]=G,t[25]=K);let q;t[26]!==N||t[27]!==w||t[28]!==E?(q=w?(0,B.jsx)(r,{id:`b4itZn`}):E?(0,B.jsx)(r,{id:`iKvAeG`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(r,{id:`eQkgKV`}),(0,B.jsx)(l,{hosts:N,className:`text-muted-foreground`})]}),t[26]=N,t[27]=w,t[28]=E,t[29]=q):q=t[29];let J;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,B.jsx)(M,{className:`size-4 shrink-0 opacity-50`,"aria-hidden":!0}),t[30]=J):J=t[30];let Y;t[31]!==w||t[32]!==K||t[33]!==q||t[34]!==W?(Y=(0,B.jsx)(m,{asChild:!0,children:(0,B.jsxs)(u,{variant:`outline`,size:`sm`,disabled:w,"data-testid":`skill-install-menu-trigger`,"data-state":W,className:K,children:[q,J]})}),t[31]=w,t[32]=K,t[33]=q,t[34]=W,t[35]=Y):Y=t[35];let X;t[36]!==f||t[37]!==y?(X=e=>f.requestForkResolve(y,e),t[36]=f,t[37]=y,t[38]=X):X=t[38];let Z;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(Z=()=>x(!1),t[39]=Z):Z=t[39];let Q;t[40]!==y||t[41]!==X||t[42]!==S?(Q=(0,B.jsx)(g,{align:`end`,className:D,children:(0,B.jsx)(O,{toggles:S,skill:y,onResolveFork:X,onRunStart:Z})}),t[40]=y,t[41]=X,t[42]=S,t[43]=Q):Q=t[43];let $;t[44]!==b||t[45]!==Y||t[46]!==Q?($=(0,B.jsxs)(_,{open:b,onOpenChange:x,children:[Y,Q]}),t[44]=b,t[45]=Y,t[46]=Q,t[47]=$):$=t[47];let ee;return t[48]!==f.dialogs||t[49]!==$||t[50]!==U?(ee=(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[U,$,f.dialogs]}),t[48]=f.dialogs,t[49]=$,t[50]=U,t[51]=ee):ee=t[51],ee}function H(e){let t=(0,R.c)(21),{value:n,onRequestMove:a,disabled:s,triggerClassName:c}=e,{_:l}=i(),u=P(),d;t[0]===a?d=t[1]:(d=e=>a(e),t[0]=a,t[1]=d);let f;t[2]===l?f=t[3]:(f=l({id:`oCHfGC`}),t[2]=l,t[3]=f);let p;t[4]===c?p=t[5]:(p=o(`w-auto gap-1 text-xs font-mono uppercase`,c),t[4]=c,t[5]=p);let m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,B.jsx)(w,{}),t[6]=m):m=t[6];let h;t[7]!==f||t[8]!==p?(h=(0,B.jsx)(S,{size:`sm`,"aria-label":f,"data-testid":`skill-level-select`,className:p,children:m}),t[7]=f,t[8]=p,t[9]=h):h=t[9];let g;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,B.jsx)(y,{children:(0,B.jsx)(r,{id:`oCHfGC`})}),t[10]=g):g=t[10];let _;t[11]===u?_=t[12]:(_=I.map(e=>(0,B.jsx)(b,{value:e,children:u[e]},e)),t[11]=u,t[12]=_);let v;t[13]===_?v=t[14]:(v=(0,B.jsx)(x,{align:`end`,children:(0,B.jsxs)(C,{children:[g,_]})}),t[13]=_,t[14]=v);let E;return t[15]!==s||t[16]!==d||t[17]!==h||t[18]!==v||t[19]!==n?(E=(0,B.jsxs)(T,{value:n,onValueChange:d,disabled:s,children:[h,v]}),t[15]=s,t[16]=d,t[17]=h,t[18]=v,t[19]=n,t[20]=E):E=t[20],E}function U(e){let t=(0,R.c)(12),{scope:n,name:r}=e,[i,a]=(0,z.useState)(null),o;t[0]===n?o=t[1]:(o=e=>{e!==n&&a(e)},t[0]=n,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==n?(s=i?{scope:n,name:r,toScope:i}:null,t[2]=r,t[3]=i,t[4]=n,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>!e&&a(null),t[6]=c):c=t[6];let l;t[7]===s?l=t[8]:(l=(0,B.jsx)(E,{target:s,onOpenChange:c}),t[7]=s,t[8]=l);let u;return t[9]!==o||t[10]!==l?(u={requestMove:o,dialog:l},t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function W(e){let t=(0,R.c)(45),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:c,problemCount:l,problemMessages:y}=e,{_:b}=i(),x=P(),S;t[0]!==a||t[1]!==n?(S={scope:n,name:a},t[0]=a,t[1]=n,t[2]=S):S=t[2];let C=U(S),w;t[3]!==C.requestMove||t[4]!==n?(w=(0,B.jsx)(H,{value:n,onRequestMove:C.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=C.requestMove,t[4]=n,t[5]=w):w=t[5];let T;t[6]!==a||t[7]!==n?(T=(0,B.jsx)(V,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=T):T=t[8];let E;t[9]!==w||t[10]!==T?(E=(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[w,T]}),t[9]=w,t[10]=T,t[11]=E):E=t[11];let D;t[12]!==c||t[13]!==l||t[14]!==y||t[15]!==o?(D=o?(0,B.jsx)(j,{onAddProperty:c,problemCount:l,problemMessages:y,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=c,t[13]=l,t[14]=y,t[15]=o,t[16]=D):D=t[16];let O;t[17]===b?O=t[18]:(O=b({id:`Yzs3QX`}),t[17]=b,t[18]=O);let k;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,B.jsx)(s,{className:`size-4`,"aria-hidden":!0}),t[19]=k):k=t[19];let A;t[20]===O?A=t[21]:(A=(0,B.jsx)(m,{asChild:!0,children:(0,B.jsx)(u,{variant:`ghost`,size:`icon`,"aria-label":O,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:k})}),t[20]=O,t[21]=A);let M;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,B.jsx)(h,{children:(0,B.jsx)(r,{id:`oCHfGC`})}),t[22]=M):M=t[22];let F;t[23]===C?F=t[24]:(F=e=>C.requestMove(e),t[23]=C,t[24]=F);let L;t[25]===x?L=t[26]:(L=I.map(e=>(0,B.jsx)(p,{value:e,children:x[e]},e)),t[25]=x,t[26]=L);let z;t[27]!==n||t[28]!==F||t[29]!==L?(z=(0,B.jsx)(f,{value:n,onValueChange:F,children:L}),t[27]=n,t[28]=F,t[29]=L,t[30]=z):z=t[30];let W;t[31]!==c||t[32]!==o?(W=o?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(v,{}),(0,B.jsxs)(d,{onSelect:c,children:[(0,B.jsx)(N,{}),(0,B.jsx)(r,{id:`81H_23`})]})]}):null,t[31]=c,t[32]=o,t[33]=W):W=t[33];let G;t[34]!==z||t[35]!==W?(G=(0,B.jsxs)(g,{align:`end`,className:`min-w-44`,children:[M,z,W]}),t[34]=z,t[35]=W,t[36]=G):G=t[36];let K;t[37]!==G||t[38]!==A?(K=(0,B.jsxs)(_,{children:[A,G]}),t[37]=G,t[38]=A,t[39]=K):K=t[39];let q;return t[40]!==C.dialog||t[41]!==K||t[42]!==E||t[43]!==D?(q=(0,B.jsxs)(B.Fragment,{children:[E,D,K,C.dialog]}),t[40]=C.dialog,t[41]=K,t[42]=E,t[43]=D,t[44]=q):q=t[44],q}export{W as SkillToolbarControls};
|