@inkeep/open-knowledge 0.64.0-beta.4 → 0.64.0-beta.5

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.
Files changed (147) hide show
  1. package/dist/{acp-harness-probe-B0ZOHZTz.mjs → acp-harness-probe-Bz_Xfqhw.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-BgJb28Cb.mjs +2 -0
  4. package/dist/git-handle-Bh1alj7a.mjs +1 -0
  5. package/dist/{git-handle-29BNYqgw.mjs → git-handle-UnQwrdlT.mjs} +2 -2
  6. package/dist/index.d.mts +32 -19
  7. package/dist/index.mjs +157 -157
  8. package/dist/init-Cpnor43q.mjs +1 -0
  9. package/dist/{init-XAxC4-D4.mjs → init-JIlCRbdu.mjs} +3 -3
  10. package/dist/{launch-json-removal-1-8ZHJtz.mjs → launch-json-removal-D1H1a769.mjs} +2 -2
  11. package/dist/{loader-BAhIE_G7.mjs → loader-BkOiHFr0.mjs} +2 -2
  12. package/dist/loader-ROlCo-Nz.mjs +1 -0
  13. package/dist/md-manager-BJ88tow5.mjs +2 -0
  14. package/dist/{open-browser-aU_PSdrG.mjs → open-browser-CrMsTPIV.mjs} +2 -2
  15. package/dist/parse-worker.mjs +1 -1
  16. package/dist/{preview-W17sbyAM.mjs → preview-BF5V_rVP.mjs} +2 -2
  17. package/dist/preview-PgQuIcNJ.mjs +1 -0
  18. package/dist/public/assets/{ActivityModeContent-CTkq714U.js → ActivityModeContent-CauWCpUS.js} +1 -1
  19. package/dist/public/assets/{AddPropertiesButton-BPD1FL9u.js → AddPropertiesButton-BNouQBfs.js} +1 -1
  20. package/dist/public/assets/{AgentDiffPane-irQjcz1_.js → AgentDiffPane-DXQNRZ8O.js} +1 -1
  21. package/dist/public/assets/{AgentThreadClientBinder-BVL-74Xg.js → AgentThreadClientBinder-5zJFp5cf.js} +1 -1
  22. package/dist/public/assets/{BugReportHistory-DH6PeCd-.js → BugReportHistory-BATOeSHw.js} +1 -1
  23. package/dist/public/assets/{BugReportHistoryDialog-B8YFi-N2.js → BugReportHistoryDialog-sIMmVxt-.js} +1 -1
  24. package/dist/public/assets/CodeMirrorPropInput-DX8Yunfs.js +3 -0
  25. package/dist/public/assets/{ConsentDialogBody-oXXodDvV.js → ConsentDialogBody-C4z025ef.js} +1 -1
  26. package/dist/public/assets/DocumentContext-BV7jb-np.js +38 -0
  27. package/dist/public/assets/{EditorModeToggle-BaN2Oili.js → EditorModeToggle-B8yEewMp.js} +1 -1
  28. package/dist/public/assets/{EnableSyncConfirmDialog-xkXGTFo0.js → EnableSyncConfirmDialog-uAw_zEkg.js} +1 -1
  29. package/dist/public/assets/{ExcalidrawDocEditor-Dj9eB-pP.js → ExcalidrawDocEditor-DhTxtSyA.js} +1 -1
  30. package/dist/public/assets/FeedbackForm-DJ9TwFhA.js +1 -0
  31. package/dist/public/assets/{GraphPanel-DwUEHRhD.js → GraphPanel-Brg6YDja.js} +2 -2
  32. package/dist/public/assets/{ImportSkillDialog-DkMQKyPv.js → ImportSkillDialog-BYfuLW-m.js} +1 -1
  33. package/dist/public/assets/{LintConfigEditor-B-NsTPbc.js → LintConfigEditor-pJBzAP1G.js} +1 -1
  34. package/dist/public/assets/ManagedArtifactProperties-CFDGVAK1.js +1 -0
  35. package/dist/public/assets/{ManagedArtifactProperties-rX7XGDin.js → ManagedArtifactProperties-D1f8Frip.js} +1 -1
  36. package/dist/public/assets/{MermaidDocEditor-yQOGFE0A.js → MermaidDocEditor-DVxgZCM4.js} +1 -1
  37. package/dist/public/assets/{PropertyDisplayRow-Du0eofgg.js → PropertyDisplayRow-9aYyPFhc.js} +1 -1
  38. package/dist/public/assets/{ReportBugDialogBody-CSy9sPgF.js → ReportBugDialogBody-YQEEGPWa.js} +1 -1
  39. package/dist/public/assets/{ReportBugMenuTrigger-DcXixDKs.js → ReportBugMenuTrigger-BYHhqbyX.js} +2 -2
  40. package/dist/public/assets/{SchemaConfigEditor-Bw4WfNdB.js → SchemaConfigEditor-0hGeiywr.js} +1 -1
  41. package/dist/public/assets/{SessionsHost-Bb2LhY4k.js → SessionsHost-BegjN_Wv.js} +2 -2
  42. package/dist/public/assets/{SettingsDialogBody-BOlhS9Ub.js → SettingsDialogBody-Bng9Ek1r.js} +4 -4
  43. package/dist/public/assets/{ShareBranchSwitchDialog-MPieYF0-.js → ShareBranchSwitchDialog-DNMbGcR3.js} +1 -1
  44. package/dist/public/assets/{ShareReceiveDialog-Dv4IxMEt.js → ShareReceiveDialog-CxRzoJmJ.js} +1 -1
  45. package/dist/public/assets/{ShareReceiveMissDialog-BDMgkM4B.js → ShareReceiveMissDialog-C2M-0S6A.js} +1 -1
  46. package/dist/public/assets/{SkillCostValue-BN4Joz66.js → SkillCostValue-0sdQK-kg.js} +1 -1
  47. package/dist/public/assets/{SkillEditBanner-ojtVKJKQ.js → SkillEditBanner-BIAkDbBb.js} +1 -1
  48. package/dist/public/assets/SkillInstallMenu-C5Y79gdz.js +2 -0
  49. package/dist/public/assets/{SkillOriginInline-C997nHPd.js → SkillOriginInline-C35IR2C_.js} +1 -1
  50. package/dist/public/assets/{SkillToolbarControls-Dj-887tA.js → SkillToolbarControls-DEiTj33j.js} +1 -1
  51. package/dist/public/assets/{SlidesToolbarControls-DW6XStbl.js → SlidesToolbarControls-Bua5dOtR.js} +1 -1
  52. package/dist/public/assets/SourceEditor-DzxE90kB.js +1 -0
  53. package/dist/public/assets/{TerminalPanel-CT7hDlGm.js → TerminalPanel-EZTkF_Im.js} +3 -3
  54. package/dist/public/assets/{TerminalWindowApp-YPZsrULF.js → TerminalWindowApp-zabnp2hc.js} +1 -1
  55. package/dist/public/assets/{TextDocEditor-7bDJHloT.js → TextDocEditor-5pSurn6C.js} +1 -1
  56. package/dist/public/assets/{ThreadView-DP3_zX56.js → ThreadView-DY925XKN.js} +5 -5
  57. package/dist/public/assets/{TimelineDiffPane-DG4VaixQ.js → TimelineDiffPane-BOSthuzR.js} +1 -1
  58. package/dist/public/assets/{agent-diff-store-DikFdttU.js → agent-diff-store-CWlSMAcS.js} +1 -1
  59. package/dist/public/assets/auth-state-cache-DN_6SHvB.js +11 -0
  60. package/dist/public/assets/{bug-report-send-manager-Di-wNg5H.js → bug-report-send-manager-idwD-g0s.js} +1 -1
  61. package/dist/public/assets/client-version-BBQwLhqb.js +1 -0
  62. package/dist/public/assets/{comment-chips-BNT5yiMX.js → comment-chips-BtWBKUUL.js} +1 -1
  63. package/dist/public/assets/{config-provider-D9QQqC6e.js → config-provider-BXiukxwE.js} +2 -2
  64. package/dist/public/assets/{dist-DTZ5Uilk.js → dist-C_QZEaeX.js} +86 -86
  65. package/dist/public/assets/{doc-paths-CbSX4XTW.js → doc-paths-DMctW8qz.js} +1 -1
  66. package/dist/public/assets/{documents-events-DxL5ysM1.js → documents-events-CwqQxQT5.js} +1 -1
  67. package/dist/public/assets/{file-tree-adapter-Dfj6r2ub.js → file-tree-adapter-CpTo1U5h.js} +1 -1
  68. package/dist/public/assets/{file-tree-utils-Cs7B4muN.js → file-tree-utils-DrK6l51M.js} +1 -1
  69. package/dist/public/assets/{folder-config-api-DrObHnBt.js → folder-config-api-Dxuhqlqr.js} +1 -1
  70. package/dist/public/assets/i18n-CHdOLU04.js +1 -0
  71. package/dist/public/assets/index-CEIpyn32.js +2204 -0
  72. package/dist/public/assets/{launcher-selection-B27yBVlr.js → launcher-selection-Btzbq8G9.js} +1 -1
  73. package/dist/public/assets/lint-config-client-pNtVqn1v.js +1 -0
  74. package/dist/public/assets/{markdownlint-rule-browser-CLc72-TR.js → markdownlint-rule-browser-IpH2V17S.js} +1 -1
  75. package/dist/public/assets/page-list-cache-DambRQ7B.js +1 -0
  76. package/dist/public/assets/{pending-receive-nav-store-CakgGJjG.js → pending-receive-nav-store-DLOxz1b_.js} +1 -1
  77. package/dist/public/assets/{progress-BJuxWr77.js → progress-BtHJSSZk.js} +3 -3
  78. package/dist/public/assets/{project-paths-vxe5ndBy.js → project-paths-BN2qP-Oz.js} +1 -1
  79. package/dist/public/assets/{prop-types-DcE7SWmX.js → prop-types-Boc_oFTG.js} +1 -1
  80. package/dist/public/assets/{receive-store-CkD0UhDA.js → receive-store-Rla0xjPc.js} +1 -1
  81. package/dist/public/assets/{selection-context-BFI-bqiT.js → selection-context-C0Dh06ez.js} +1 -1
  82. package/dist/public/assets/{skill-scope-grqY_b8j.js → skill-scope-C2Q18Fyo.js} +1 -1
  83. package/dist/public/assets/{skills-api-DNXy9jz0.js → skills-api-Du0yE_Ea.js} +1 -1
  84. package/dist/public/assets/{src-DXdR4ZQN.js → src-XvoJ42p_.js} +1 -1
  85. package/dist/public/assets/startup-marks-Cw2UqI10.js +1 -0
  86. package/dist/public/assets/{tag-pill-input-D34lLgUq.js → tag-pill-input-BWs4IhME.js} +1 -1
  87. package/dist/public/assets/{target-navigation-intent-XZyK8hlI.js → target-navigation-intent-C_Ucfr51.js} +1 -1
  88. package/dist/public/assets/{telemetry-impl-CQvRl6_a.js → telemetry-impl-DLl1oxED.js} +1 -1
  89. package/dist/public/assets/{telemetry-startup-BZHG8uvV.js → telemetry-startup-k7vK2L8Z.js} +1 -1
  90. package/dist/public/assets/{terminal-cli-display-C3XNS9Zb.js → terminal-cli-display-CrkxgiPR.js} +1 -1
  91. package/dist/public/assets/typing-burst-detector-CtCPp1ik.js +8 -0
  92. package/dist/public/assets/{uninstall-Cl4LM0CB.js → uninstall-Be_VK869.js} +1 -1
  93. package/dist/public/assets/{use-activity-panel-BdGnO2Z6.js → use-activity-panel-Bat2VfJF.js} +1 -1
  94. package/dist/public/assets/{use-apply-config-color-theme-Bwj3f7UC.js → use-apply-config-color-theme-3_75T4Q8.js} +1 -1
  95. package/dist/public/assets/{use-collab-url-OrVAc6Wo.js → use-collab-url-9MxkxDjK.js} +1 -1
  96. package/dist/public/assets/{use-live-xterm-theme-5k6Gqiaw.js → use-live-xterm-theme-BjybDd5E.js} +1 -1
  97. package/dist/public/assets/{use-open-skill-DymWWnJ_.js → use-open-skill-B004qnQw.js} +1 -1
  98. package/dist/public/assets/{use-settings-route-BFU85dl8.js → use-settings-route-6Aa41RPQ.js} +1 -1
  99. package/dist/public/assets/{use-skill-origin-BTVSbkkb.js → use-skill-origin-C0RzVLGk.js} +1 -1
  100. package/dist/public/assets/{use-skills-Dn1UHdyr.js → use-skills-BkWQHhha.js} +1 -1
  101. package/dist/public/assets/{use-terminal-enabled-DkT9h5DB.js → use-terminal-enabled-ST2-eUch.js} +1 -1
  102. package/dist/public/assets/use-timeline-entry-diff-C-o8h9N3.js +6 -0
  103. package/dist/public/assets/{use-workspace-BfO5PsIE.js → use-workspace-7B06onC_.js} +1 -1
  104. package/dist/public/index.html +47 -47
  105. package/dist/public/uninstall.html +3 -3
  106. package/dist/{repair-launch-json-BLY6J8I2.mjs → repair-launch-json-BVjKD52o.mjs} +2 -2
  107. package/dist/{repair-mcp-configs-lXWW4hnd.mjs → repair-mcp-configs-BQ7U1U_I.mjs} +2 -2
  108. package/dist/repair-skills-DIytACob.mjs +1 -0
  109. package/dist/{repair-skills-CRG-r1Xh.mjs → repair-skills-DPyYfXHX.mjs} +2 -2
  110. package/dist/{resolve-project-root-urAKqvDX.mjs → resolve-project-root-suxWrGvT.mjs} +2 -2
  111. package/dist/{server-lock-_JWkU2Mh.mjs → server-lock-CcnGITIh.mjs} +2 -2
  112. package/dist/server-lock-D8d0WVYU.mjs +1 -0
  113. package/dist/{skill-teardown-CVMrfSeZ.mjs → skill-teardown-D4qifTbZ.mjs} +2 -2
  114. package/dist/src-7XhmCEkb.mjs +1 -0
  115. package/dist/{src-BRlSw7bk.mjs → src-C8wtGJxJ.mjs} +1 -1
  116. package/dist/{src-CjFV1e1Z.mjs → src-CNSuUQTi.mjs} +4 -4
  117. package/dist/{src-DhKkOAcb.mjs → src-CaLoSvK5.mjs} +2 -2
  118. package/dist/src-CnywvEPN.mjs +20 -0
  119. package/dist/{start-BaCKwcGO.mjs → start-ClCOtrI0.mjs} +3 -3
  120. package/dist/start-CxNMq7dN.mjs +1 -0
  121. package/package.json +4 -4
  122. package/dist/constants-C-QXBCBl.mjs +0 -2
  123. package/dist/git-handle-DfQBBy3_.mjs +0 -1
  124. package/dist/init-DPb4O5KS.mjs +0 -1
  125. package/dist/loader-DhmZ3k83.mjs +0 -1
  126. package/dist/md-manager-CZcRasmz.mjs +0 -2
  127. package/dist/preview-ztEEIVyt.mjs +0 -1
  128. package/dist/public/assets/CodeMirrorPropInput-kIJWwKe4.js +0 -3
  129. package/dist/public/assets/DocumentContext-6gn-Aiv8.js +0 -38
  130. package/dist/public/assets/FeedbackForm-BnoSzKB_.js +0 -1
  131. package/dist/public/assets/ManagedArtifactProperties-DL8NyQe3.js +0 -1
  132. package/dist/public/assets/SkillInstallMenu-B3V2W9x9.js +0 -2
  133. package/dist/public/assets/SourceEditor-YP4-TM8J.js +0 -1
  134. package/dist/public/assets/auth-state-cache-Oucukckm.js +0 -11
  135. package/dist/public/assets/client-version-DpPDNVRX.js +0 -1
  136. package/dist/public/assets/i18n-CP94ib4l.js +0 -1
  137. package/dist/public/assets/index-DxkeeuEK.js +0 -2204
  138. package/dist/public/assets/lint-config-client-DbEZKTUk.js +0 -1
  139. package/dist/public/assets/page-list-cache-4RZDQAIl.js +0 -1
  140. package/dist/public/assets/startup-marks-C-m5WZDP.js +0 -1
  141. package/dist/public/assets/typing-burst-detector-CHFv8DDa.js +0 -8
  142. package/dist/public/assets/use-timeline-entry-diff-CQ3Ngq3P.js +0 -6
  143. package/dist/repair-skills-BABpOhB_.mjs +0 -1
  144. package/dist/server-lock-C_5VGPQF.mjs +0 -1
  145. package/dist/src-BZeMIn4S.mjs +0 -1
  146. package/dist/src-Cv5CfSHR.mjs +0 -20
  147. package/dist/start-Bqguzc8D.mjs +0 -1
@@ -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{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./button-Cym3gapE.js";import{i as l,n as u,t as d}from"./tooltip-DttaCTqz.js";import{c as f}from"./select-XEGYznMI.js";import{n as p,t as m}from"./toggle-group-C2_37kV5.js";import{Yi as h,Zo as g,ws as _,xs as v}from"./dist-DTZ5Uilk.js";import{n as y}from"./dist-CJhtNlOm2.js";import{i as b}from"./use-apply-config-theme-CBmHKD_B.js";import{t as x}from"./file-tree-utils-Cs7B4muN.js";import"./config-provider-D9QQqC6e.js";import{Z as S,kt as C}from"./dist-BXlOzfrR.js";import{t as w}from"./cm-theme-CvD6eMwN.js";import{t as T}from"./asset-dispatch-CD6rGcnF.js";import{t as E}from"./dist-DnnH0RLX2.js";import{t as D}from"./text-viewer-languages-DRp_Y82n.js";var O=o(),k=e(n(),1),A=class extends Error{httpStatus;constructor(e,t){super(e),this.name=`ViewerTextLoadError`,this.httpStatus=t}};function j(e){let t=(0,O.c)(10),{_:n}=i(),r;t[0]===n?r=t[1]:(r=e=>n(e===413?{id:`C_WGy8`}:e===415?{id:`VM7H66`}:e===404?{id:`s0IDhW`}:e===400?{id:`N1mdmS`}:typeof e==`number`?{id:`96w9hU`,values:{status:e}}:{id:`ig5vUe`}),t[0]=n,t[1]=r);let a=r,{src:o,loadText:s}=e,c=(0,k.useRef)(s),l=(0,k.useRef)(a),u;t[2]!==s||t[3]!==a?(u=()=>{c.current=s,l.current=a},t[2]=s,t[3]=a,t[4]=u):u=t[4],(0,k.useEffect)(u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={status:`loading`},t[5]=d):d=t[5];let[f,p]=(0,k.useState)(d),m,h;return t[6]!==n||t[7]!==o?(m=()=>{let e=!1,t=new AbortController;p({status:`loading`});let r=c.current;return r?(r(t.signal).then(t=>{if(!e){if(t.ok){p({status:`loaded`,content:t.text});return}p({status:`error`,message:t.message??l.current(t.status),httpStatus:t.status})}}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||p({status:`error`,message:n({id:`ig5vUe`})})}),()=>{e=!0,t.abort()}):(fetch(o??``,{credentials:`same-origin`,signal:t.signal}).then(async e=>{if(!e.ok)throw new A(l.current(e.status),e.status);return e.text()}).then(t=>{e||p({status:`loaded`,content:t})}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||p({status:`error`,message:t instanceof Error?t.message:n({id:`ig5vUe`}),httpStatus:t instanceof A?t.httpStatus:void 0})}),()=>{e=!0,t.abort()})},h=[o,n],t[6]=n,t[7]=o,t[8]=m,t[9]=h):(m=t[8],h=t[9]),(0,k.useEffect)(m,h),f}var M=t();function N(e){let t=(0,O.c)(10),{fileName:n,dataAttr:i,extraAttrs:a}=e,o=`${i}-state`,s;t[0]!==i||t[1]!==o?(s={[i]:``,[o]:`loading`},t[0]=i,t[1]=o,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,M.jsx)(`span`,{children:(0,M.jsx)(r,{id:`Md709y`,values:{fileName:n}})}),t[3]=n,t[4]=c);let l;return t[5]!==a||t[6]!==n||t[7]!==s||t[8]!==c?(l=(0,M.jsx)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center bg-background text-muted-foreground text-sm`,"aria-label":n,...s,...a,children:c}),t[5]=a,t[6]=n,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function P(e){let t=(0,O.c)(16),{fileName:n,dataAttr:i,extraAttrs:a,message:o,openFile:s}=e,l=`${i}-state`,u;t[0]!==i||t[1]!==l?(u={[i]:``,[l]:`error`},t[0]=i,t[1]=l,t[2]=u):u=t[2];let d;t[3]===n?d=t[4]:(d=(0,M.jsx)(`div`,{className:`font-medium text-sm`,children:(0,M.jsx)(r,{id:`qdBUHP`,values:{fileName:n}})}),t[3]=n,t[4]=d);let f;t[5]===o?f=t[6]:(f=(0,M.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:o}),t[5]=o,t[6]=f);let p;t[7]===s?p=t[8]:(p=s?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`mt-2`,"data-testid":`viewer-open-file`,onClick:()=>{T({url:s.url,projectRelPath:s.projectRelPath,ext:s.ext,title:s.title,forceOsDelegation:!0})},children:(0,M.jsx)(r,{id:`9npOH9`})}):null,t[7]=s,t[8]=p);let m;return t[9]!==a||t[10]!==n||t[11]!==u||t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,M.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-2 bg-background p-4 text-center`,"aria-label":n,...u,...a,children:[d,f,p]}),t[9]=a,t[10]=n,t[11]=u,t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function F({assetPath:e,fileName:t,extension:n,httpStatus:r}){if(!e||r===404)return;let i=n.toLowerCase();return{projectRelPath:e,ext:i,title:t,url:h(`${g.has(i)?`/api/asset`:`/api/asset-text`}?path=${encodeURIComponent(e)}`)}}var I=w({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),L=w({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function R(e){let t=(0,O.c)(28),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({fileName:r,extension:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let o=(0,k.useRef)(null),s=(0,k.useRef)(null),{resolvedTheme:c}=a(),l=j(i),u=l.status===`loaded`?l.content:null,d,f;t[4]!==n||t[5]!==u||t[6]!==c?(d=()=>{if(!o.current||u===null)return;let e=n.toLowerCase(),t=v(e),r=c===`dark`?I:L,i=!1,a=null;return D(e,t).then(e=>{if(i||!o.current)return;let t=[E,...e?[e]:[],S.editable.of(!0),C.readOnly.of(!0),S.lineWrapping,r];a=new S({state:C.create({doc:u,extensions:t}),parent:o.current}),s.current=a}),()=>{i=!0,a?.destroy(),s.current=null}},f=[u,n,c],t[4]=n,t[5]=u,t[6]=c,t[7]=d,t[8]=f):(d=t[7],f=t[8]),(0,k.useEffect)(d,f);let p;t[9]===n?p=t[10]:(p={"data-text-viewer-extension":n},t[9]=n,t[10]=p);let m=p;if(l.status===`loading`){let e;return t[11]!==m||t[12]!==r?(e=(0,M.jsx)(N,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:m}),t[11]=m,t[12]=r,t[13]=e):e=t[13],e}if(l.status===`error`){let e=l.message,a;t[14]!==n||t[15]!==l.httpStatus||t[16]!==r||t[17]!==i.assetPath?(a=F({assetPath:i.assetPath,fileName:r,extension:n,httpStatus:l.httpStatus}),t[14]=n,t[15]=l.httpStatus,t[16]=r,t[17]=i.assetPath,t[18]=a):a=t[18];let o;return t[19]!==m||t[20]!==l.message||t[21]!==r||t[22]!==a?(o=(0,M.jsx)(P,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:m,message:e,openFile:a}),t[19]=m,t[20]=l.message,t[21]=r,t[22]=a,t[23]=o):o=t[23],o}let h;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,M.jsx)(`div`,{ref:o,className:`min-h-0 flex-1 overflow-auto`}),t[24]=h):h=t[24];let g;return t[25]!==n||t[26]!==r?(g=(0,M.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loaded`,"data-text-viewer-extension":n,children:h}),t[25]=n,t[26]=r,t[27]=g):g=t[27],g}function z(e){let t=(0,O.c)(29),{entry:n,className:r}=e,{_:a}=i(),{projectLocalBinding:o,projectLocalSynced:l,merged:u}=b();if(u===null||!l)return null;let d=u?.appearance?.sidebar,p=d?.showHiddenFiles??!1,m=d?.showOnlyMarkdownFiles??!1,h;t[0]!==n||t[1]!==p||t[2]!==m?(h=x(n,{showHiddenFiles:p,showOnlyMarkdownFiles:m}),t[0]=n,t[1]=p,t[2]=m,t[3]=h):h=t[3];let g=h;if(!g.hiddenFiles&&!g.onlyMarkdownFiles)return null;let v;t[4]!==a||t[5]!==o?(v=e=>{if(o===null)return;let t=o.patch({appearance:{sidebar:e}});t.ok||(console.warn(`[NotInSidebarIndicator] sidebar visibility flip rejected:`,_(t.error)),y.error(a({id:`P47EWZ`}),{description:_(t.error)}))},t[4]=a,t[5]=o,t[6]=v):v=t[6];let S=v,C;t[7]===r?C=t[8]:(C=s(`flex items-center gap-1.5 text-muted-foreground/70 text-xs`,r),t[7]=r,t[8]=C);let w;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,M.jsx)(f,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),t[9]=w):w=t[9];let T;t[10]===a?T=t[11]:(T=a({id:`j9tqwO`}),t[10]=a,t[11]=T);let E;t[12]===T?E=t[13]:(E=(0,M.jsx)(`span`,{className:`whitespace-nowrap`,children:T}),t[12]=T,t[13]=E);let D;t[14]!==a||t[15]!==g.hiddenFiles||t[16]!==S||t[17]!==o?(D=g.hiddenFiles?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`h-5 rounded-sm px-1.5 font-normal text-2xs text-muted-foreground hover:text-foreground`,disabled:o===null,onClick:()=>S({showHiddenFiles:!0}),"aria-label":a({id:`XcGbim`}),title:a({id:`XcGbim`}),"data-testid":`not-in-sidebar-flip-hidden-files`,children:a({id:`6KCH4m`})}):null,t[14]=a,t[15]=g.hiddenFiles,t[16]=S,t[17]=o,t[18]=D):D=t[18];let k;t[19]!==a||t[20]!==g.onlyMarkdownFiles||t[21]!==S||t[22]!==o?(k=g.onlyMarkdownFiles?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`h-5 rounded-sm px-1.5 font-normal text-2xs text-muted-foreground hover:text-foreground`,disabled:o===null,onClick:()=>S({showOnlyMarkdownFiles:!1}),"aria-label":a({id:`10g8I_`}),title:a({id:`10g8I_`}),"data-testid":`not-in-sidebar-flip-only-markdown`,children:a({id:`5-o4kO`})}):null,t[19]=a,t[20]=g.onlyMarkdownFiles,t[21]=S,t[22]=o,t[23]=k):k=t[23];let A;return t[24]!==k||t[25]!==C||t[26]!==E||t[27]!==D?(A=(0,M.jsxs)(`div`,{"data-testid":`not-in-sidebar-indicator`,className:C,children:[w,E,D,k]}),t[24]=k,t[25]=C,t[26]=E,t[27]=D,t[28]=A):A=t[28],A}var B={fill:`none`,height:24,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`},V=e=>{let t=(0,O.c)(15),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({color:a,size:o,strokeWidth:s,absoluteStrokeWidth:n,className:c,children:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`currentColor`:a,u=o===void 0?24:o,d=s===void 0?2:s,f=c===void 0?``:c,p=n?Number(d)*24/Number(u):d,m;return t[8]!==r||t[9]!==f||t[10]!==l||t[11]!==i||t[12]!==u||t[13]!==p?(m=(0,M.jsx)(`svg`,{"aria-hidden":`true`,...B,className:f,height:u,stroke:l,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:p,width:u,...i,children:r}),t[8]=r,t[9]=f,t[10]=l,t[11]=i,t[12]=u,t[13]=p,t[14]=m):m=t[14],m},H=e=>{let t=(0,O.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(`title`,{children:`Markdown`}),r=(0,M.jsx)(`path`,{d:`M232,48H24A16,16,0,0,0,8,64V192a16,16,0,0,0,16,16H232a16,16,0,0,0,16-16V64A16,16,0,0,0,232,48Zm0,144H24V64H232V192ZM128,104v48a8,8,0,0,1-16,0V123.31L93.66,141.66a8,8,0,0,1-11.32,0L64,123.31V152a8,8,0,0,1-16,0V104a8,8,0,0,1,13.66-5.66L88,124.69l26.34-26.35A8,8,0,0,1,128,104Zm77.66,18.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L168,132.69V104a8,8,0,0,1,16,0v28.69l10.34-10.35A8,8,0,0,1,205.66,122.34Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,M.jsxs)(V,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},U=e=>{let t=(0,O.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(`title`,{children:`Textbox`}),r=(0,M.jsx)(`path`,{d:`M112,40a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80v96a16,16,0,0,0,16,16h80v16a8,8,0,0,0,16,0V48A8,8,0,0,0,112,40ZM24,176V80h80v96ZM248,80v96a16,16,0,0,1-16,16H144a8,8,0,0,1,0-16h88V80H144a8,8,0,0,1,0-16h88A16,16,0,0,1,248,80ZM88,112a8,8,0,0,1-8,8H72v24a8,8,0,0,1-16,0V120H48a8,8,0,0,1,0-16H80A8,8,0,0,1,88,112Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,M.jsxs)(V,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function W(e){let t=(0,O.c)(48),{isSourceMode:n,onModeChange:a,sourceDisabled:o,wysiwygDisabled:s,wysiwygLabel:c,sourceLabel:f,wysiwygDisabledReason:h}=e,g=o===void 0?!1:o,_=s===void 0?!1:s,{_:v}=i(),y;t[0]!==v||t[1]!==c?(y=c??v({id:`ur2XSb`}),t[0]=v,t[1]=c,t[2]=y):y=t[2];let b=y,x;t[3]!==v||t[4]!==f?(x=f??v({id:`xbdtfY`}),t[3]=v,t[4]=f,t[5]=x):x=t[5];let S=x,C=(0,k.useId)(),w=_&&h?h:null,T=n?`source`:`wysiwyg`,E;t[6]===a?E=t[7]:(E=e=>{e&&a(e)},t[6]=a,t[7]=E);let D;t[8]===v?D=t[9]:(D=v({id:`n7aopT`}),t[8]=v,t[9]=D);let A=w?C:void 0,j;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,M.jsx)(U,{className:`size-4`}),t[10]=j):j=t[10];let N;t[11]!==A||t[12]!==_||t[13]!==b?(N=(0,M.jsx)(p,{value:`wysiwyg`,"aria-label":b,"aria-describedby":A,disabled:_,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:j}),t[11]=A,t[12]=_,t[13]=b,t[14]=N):N=t[14];let P;t[15]!==w||t[16]!==C?(P=w?(0,M.jsx)(`span`,{id:C,className:`sr-only`,children:w}):null,t[15]=w,t[16]=C,t[17]=P):P=t[17];let F;t[18]!==N||t[19]!==P?(F=(0,M.jsx)(l,{asChild:!0,children:(0,M.jsxs)(`div`,{children:[N,P]})}),t[18]=N,t[19]=P,t[20]=F):F=t[20];let I;t[21]!==_||t[22]!==h||t[23]!==c?(I=_&&h?h:c||(0,M.jsx)(r,{id:`Mb_20S`}),t[21]=_,t[22]=h,t[23]=c,t[24]=I):I=t[24];let L;t[25]===I?L=t[26]:(L=(0,M.jsx)(u,{side:`bottom`,children:I}),t[25]=I,t[26]=L);let R;t[27]!==F||t[28]!==L?(R=(0,M.jsxs)(d,{children:[F,L]}),t[27]=F,t[28]=L,t[29]=R):R=t[29];let z;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,M.jsx)(H,{className:`size-4`}),t[30]=z):z=t[30];let B;t[31]!==g||t[32]!==S?(B=(0,M.jsx)(l,{asChild:!0,children:(0,M.jsx)(`div`,{children:(0,M.jsx)(p,{value:`source`,"aria-label":S,disabled:g,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:z})})}),t[31]=g,t[32]=S,t[33]=B):B=t[33];let V;t[34]!==g||t[35]!==f?(V=g?(0,M.jsx)(r,{id:`G-JBA1`}):f||(0,M.jsx)(r,{id:`u6Hp4N`}),t[34]=g,t[35]=f,t[36]=V):V=t[36];let W;t[37]===V?W=t[38]:(W=(0,M.jsx)(u,{side:`bottom`,children:V}),t[37]=V,t[38]=W);let G;t[39]!==B||t[40]!==W?(G=(0,M.jsxs)(d,{children:[B,W]}),t[39]=B,t[40]=W,t[41]=G):G=t[41];let K;return t[42]!==R||t[43]!==G||t[44]!==T||t[45]!==E||t[46]!==D?(K=(0,M.jsxs)(m,{type:`single`,value:T,onValueChange:E,"aria-label":D,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 bg-muted p-0.5 data-[size=sm]:rounded-[10px]`,children:[R,G]}),t[42]=R,t[43]=G,t[44]=T,t[45]=E,t[46]=D,t[47]=K):K=t[47],K}export{F as a,j as c,R as i,H as n,P as o,z as r,N as s,W as t};
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{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./button-Cym3gapE.js";import{i as l,n as u,t as d}from"./tooltip-DttaCTqz.js";import{c as f}from"./select-XEGYznMI.js";import{n as p,t as m}from"./toggle-group-C2_37kV5.js";import{Qo as h,Ss as g,Ts as _,Xi as v}from"./dist-C_QZEaeX.js";import{n as y}from"./dist-CJhtNlOm2.js";import{i as b}from"./use-apply-config-theme-CBmHKD_B.js";import{t as x}from"./file-tree-utils-DrK6l51M.js";import"./config-provider-BXiukxwE.js";import{Z as S,kt as C}from"./dist-BXlOzfrR.js";import{t as w}from"./cm-theme-CvD6eMwN.js";import{t as T}from"./asset-dispatch-CD6rGcnF.js";import{t as E}from"./dist-DnnH0RLX2.js";import{t as D}from"./text-viewer-languages-DRp_Y82n.js";var O=o(),k=e(n(),1),A=class extends Error{httpStatus;constructor(e,t){super(e),this.name=`ViewerTextLoadError`,this.httpStatus=t}};function j(e){let t=(0,O.c)(10),{_:n}=i(),r;t[0]===n?r=t[1]:(r=e=>n(e===413?{id:`C_WGy8`}:e===415?{id:`VM7H66`}:e===404?{id:`s0IDhW`}:e===400?{id:`N1mdmS`}:typeof e==`number`?{id:`96w9hU`,values:{status:e}}:{id:`ig5vUe`}),t[0]=n,t[1]=r);let a=r,{src:o,loadText:s}=e,c=(0,k.useRef)(s),l=(0,k.useRef)(a),u;t[2]!==s||t[3]!==a?(u=()=>{c.current=s,l.current=a},t[2]=s,t[3]=a,t[4]=u):u=t[4],(0,k.useEffect)(u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={status:`loading`},t[5]=d):d=t[5];let[f,p]=(0,k.useState)(d),m,h;return t[6]!==n||t[7]!==o?(m=()=>{let e=!1,t=new AbortController;p({status:`loading`});let r=c.current;return r?(r(t.signal).then(t=>{if(!e){if(t.ok){p({status:`loaded`,content:t.text});return}p({status:`error`,message:t.message??l.current(t.status),httpStatus:t.status})}}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||p({status:`error`,message:n({id:`ig5vUe`})})}),()=>{e=!0,t.abort()}):(fetch(o??``,{credentials:`same-origin`,signal:t.signal}).then(async e=>{if(!e.ok)throw new A(l.current(e.status),e.status);return e.text()}).then(t=>{e||p({status:`loaded`,content:t})}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||p({status:`error`,message:t instanceof Error?t.message:n({id:`ig5vUe`}),httpStatus:t instanceof A?t.httpStatus:void 0})}),()=>{e=!0,t.abort()})},h=[o,n],t[6]=n,t[7]=o,t[8]=m,t[9]=h):(m=t[8],h=t[9]),(0,k.useEffect)(m,h),f}var M=t();function N(e){let t=(0,O.c)(10),{fileName:n,dataAttr:i,extraAttrs:a}=e,o=`${i}-state`,s;t[0]!==i||t[1]!==o?(s={[i]:``,[o]:`loading`},t[0]=i,t[1]=o,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,M.jsx)(`span`,{children:(0,M.jsx)(r,{id:`Md709y`,values:{fileName:n}})}),t[3]=n,t[4]=c);let l;return t[5]!==a||t[6]!==n||t[7]!==s||t[8]!==c?(l=(0,M.jsx)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center bg-background text-muted-foreground text-sm`,"aria-label":n,...s,...a,children:c}),t[5]=a,t[6]=n,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function P(e){let t=(0,O.c)(16),{fileName:n,dataAttr:i,extraAttrs:a,message:o,openFile:s}=e,l=`${i}-state`,u;t[0]!==i||t[1]!==l?(u={[i]:``,[l]:`error`},t[0]=i,t[1]=l,t[2]=u):u=t[2];let d;t[3]===n?d=t[4]:(d=(0,M.jsx)(`div`,{className:`font-medium text-sm`,children:(0,M.jsx)(r,{id:`qdBUHP`,values:{fileName:n}})}),t[3]=n,t[4]=d);let f;t[5]===o?f=t[6]:(f=(0,M.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:o}),t[5]=o,t[6]=f);let p;t[7]===s?p=t[8]:(p=s?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`mt-2`,"data-testid":`viewer-open-file`,onClick:()=>{T({url:s.url,projectRelPath:s.projectRelPath,ext:s.ext,title:s.title,forceOsDelegation:!0})},children:(0,M.jsx)(r,{id:`9npOH9`})}):null,t[7]=s,t[8]=p);let m;return t[9]!==a||t[10]!==n||t[11]!==u||t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,M.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-2 bg-background p-4 text-center`,"aria-label":n,...u,...a,children:[d,f,p]}),t[9]=a,t[10]=n,t[11]=u,t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function F({assetPath:e,fileName:t,extension:n,httpStatus:r}){if(!e||r===404)return;let i=n.toLowerCase();return{projectRelPath:e,ext:i,title:t,url:v(`${h.has(i)?`/api/asset`:`/api/asset-text`}?path=${encodeURIComponent(e)}`)}}var I=w({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),L=w({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function R(e){let t=(0,O.c)(28),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({fileName:r,extension:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let o=(0,k.useRef)(null),s=(0,k.useRef)(null),{resolvedTheme:c}=a(),l=j(i),u=l.status===`loaded`?l.content:null,d,f;t[4]!==n||t[5]!==u||t[6]!==c?(d=()=>{if(!o.current||u===null)return;let e=n.toLowerCase(),t=g(e),r=c===`dark`?I:L,i=!1,a=null;return D(e,t).then(e=>{if(i||!o.current)return;let t=[E,...e?[e]:[],S.editable.of(!0),C.readOnly.of(!0),S.lineWrapping,r];a=new S({state:C.create({doc:u,extensions:t}),parent:o.current}),s.current=a}),()=>{i=!0,a?.destroy(),s.current=null}},f=[u,n,c],t[4]=n,t[5]=u,t[6]=c,t[7]=d,t[8]=f):(d=t[7],f=t[8]),(0,k.useEffect)(d,f);let p;t[9]===n?p=t[10]:(p={"data-text-viewer-extension":n},t[9]=n,t[10]=p);let m=p;if(l.status===`loading`){let e;return t[11]!==m||t[12]!==r?(e=(0,M.jsx)(N,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:m}),t[11]=m,t[12]=r,t[13]=e):e=t[13],e}if(l.status===`error`){let e=l.message,a;t[14]!==n||t[15]!==l.httpStatus||t[16]!==r||t[17]!==i.assetPath?(a=F({assetPath:i.assetPath,fileName:r,extension:n,httpStatus:l.httpStatus}),t[14]=n,t[15]=l.httpStatus,t[16]=r,t[17]=i.assetPath,t[18]=a):a=t[18];let o;return t[19]!==m||t[20]!==l.message||t[21]!==r||t[22]!==a?(o=(0,M.jsx)(P,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:m,message:e,openFile:a}),t[19]=m,t[20]=l.message,t[21]=r,t[22]=a,t[23]=o):o=t[23],o}let h;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,M.jsx)(`div`,{ref:o,className:`min-h-0 flex-1 overflow-auto`}),t[24]=h):h=t[24];let _;return t[25]!==n||t[26]!==r?(_=(0,M.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loaded`,"data-text-viewer-extension":n,children:h}),t[25]=n,t[26]=r,t[27]=_):_=t[27],_}function z(e){let t=(0,O.c)(29),{entry:n,className:r}=e,{_:a}=i(),{projectLocalBinding:o,projectLocalSynced:l,merged:u}=b();if(u===null||!l)return null;let d=u?.appearance?.sidebar,p=d?.showHiddenFiles??!1,m=d?.showOnlyMarkdownFiles??!1,h;t[0]!==n||t[1]!==p||t[2]!==m?(h=x(n,{showHiddenFiles:p,showOnlyMarkdownFiles:m}),t[0]=n,t[1]=p,t[2]=m,t[3]=h):h=t[3];let g=h;if(!g.hiddenFiles&&!g.onlyMarkdownFiles)return null;let v;t[4]!==a||t[5]!==o?(v=e=>{if(o===null)return;let t=o.patch({appearance:{sidebar:e}});t.ok||(console.warn(`[NotInSidebarIndicator] sidebar visibility flip rejected:`,_(t.error)),y.error(a({id:`P47EWZ`}),{description:_(t.error)}))},t[4]=a,t[5]=o,t[6]=v):v=t[6];let S=v,C;t[7]===r?C=t[8]:(C=s(`flex items-center gap-1.5 text-muted-foreground/70 text-xs`,r),t[7]=r,t[8]=C);let w;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,M.jsx)(f,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),t[9]=w):w=t[9];let T;t[10]===a?T=t[11]:(T=a({id:`j9tqwO`}),t[10]=a,t[11]=T);let E;t[12]===T?E=t[13]:(E=(0,M.jsx)(`span`,{className:`whitespace-nowrap`,children:T}),t[12]=T,t[13]=E);let D;t[14]!==a||t[15]!==g.hiddenFiles||t[16]!==S||t[17]!==o?(D=g.hiddenFiles?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`h-5 rounded-sm px-1.5 font-normal text-2xs text-muted-foreground hover:text-foreground`,disabled:o===null,onClick:()=>S({showHiddenFiles:!0}),"aria-label":a({id:`XcGbim`}),title:a({id:`XcGbim`}),"data-testid":`not-in-sidebar-flip-hidden-files`,children:a({id:`6KCH4m`})}):null,t[14]=a,t[15]=g.hiddenFiles,t[16]=S,t[17]=o,t[18]=D):D=t[18];let k;t[19]!==a||t[20]!==g.onlyMarkdownFiles||t[21]!==S||t[22]!==o?(k=g.onlyMarkdownFiles?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`h-5 rounded-sm px-1.5 font-normal text-2xs text-muted-foreground hover:text-foreground`,disabled:o===null,onClick:()=>S({showOnlyMarkdownFiles:!1}),"aria-label":a({id:`10g8I_`}),title:a({id:`10g8I_`}),"data-testid":`not-in-sidebar-flip-only-markdown`,children:a({id:`5-o4kO`})}):null,t[19]=a,t[20]=g.onlyMarkdownFiles,t[21]=S,t[22]=o,t[23]=k):k=t[23];let A;return t[24]!==k||t[25]!==C||t[26]!==E||t[27]!==D?(A=(0,M.jsxs)(`div`,{"data-testid":`not-in-sidebar-indicator`,className:C,children:[w,E,D,k]}),t[24]=k,t[25]=C,t[26]=E,t[27]=D,t[28]=A):A=t[28],A}var B={fill:`none`,height:24,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`},V=e=>{let t=(0,O.c)(15),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({color:a,size:o,strokeWidth:s,absoluteStrokeWidth:n,className:c,children:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`currentColor`:a,u=o===void 0?24:o,d=s===void 0?2:s,f=c===void 0?``:c,p=n?Number(d)*24/Number(u):d,m;return t[8]!==r||t[9]!==f||t[10]!==l||t[11]!==i||t[12]!==u||t[13]!==p?(m=(0,M.jsx)(`svg`,{"aria-hidden":`true`,...B,className:f,height:u,stroke:l,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:p,width:u,...i,children:r}),t[8]=r,t[9]=f,t[10]=l,t[11]=i,t[12]=u,t[13]=p,t[14]=m):m=t[14],m},H=e=>{let t=(0,O.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(`title`,{children:`Markdown`}),r=(0,M.jsx)(`path`,{d:`M232,48H24A16,16,0,0,0,8,64V192a16,16,0,0,0,16,16H232a16,16,0,0,0,16-16V64A16,16,0,0,0,232,48Zm0,144H24V64H232V192ZM128,104v48a8,8,0,0,1-16,0V123.31L93.66,141.66a8,8,0,0,1-11.32,0L64,123.31V152a8,8,0,0,1-16,0V104a8,8,0,0,1,13.66-5.66L88,124.69l26.34-26.35A8,8,0,0,1,128,104Zm77.66,18.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L168,132.69V104a8,8,0,0,1,16,0v28.69l10.34-10.35A8,8,0,0,1,205.66,122.34Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,M.jsxs)(V,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},U=e=>{let t=(0,O.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(`title`,{children:`Textbox`}),r=(0,M.jsx)(`path`,{d:`M112,40a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80v96a16,16,0,0,0,16,16h80v16a8,8,0,0,0,16,0V48A8,8,0,0,0,112,40ZM24,176V80h80v96ZM248,80v96a16,16,0,0,1-16,16H144a8,8,0,0,1,0-16h88V80H144a8,8,0,0,1,0-16h88A16,16,0,0,1,248,80ZM88,112a8,8,0,0,1-8,8H72v24a8,8,0,0,1-16,0V120H48a8,8,0,0,1,0-16H80A8,8,0,0,1,88,112Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,M.jsxs)(V,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function W(e){let t=(0,O.c)(48),{isSourceMode:n,onModeChange:a,sourceDisabled:o,wysiwygDisabled:s,wysiwygLabel:c,sourceLabel:f,wysiwygDisabledReason:h}=e,g=o===void 0?!1:o,_=s===void 0?!1:s,{_:v}=i(),y;t[0]!==v||t[1]!==c?(y=c??v({id:`ur2XSb`}),t[0]=v,t[1]=c,t[2]=y):y=t[2];let b=y,x;t[3]!==v||t[4]!==f?(x=f??v({id:`xbdtfY`}),t[3]=v,t[4]=f,t[5]=x):x=t[5];let S=x,C=(0,k.useId)(),w=_&&h?h:null,T=n?`source`:`wysiwyg`,E;t[6]===a?E=t[7]:(E=e=>{e&&a(e)},t[6]=a,t[7]=E);let D;t[8]===v?D=t[9]:(D=v({id:`n7aopT`}),t[8]=v,t[9]=D);let A=w?C:void 0,j;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,M.jsx)(U,{className:`size-4`}),t[10]=j):j=t[10];let N;t[11]!==A||t[12]!==_||t[13]!==b?(N=(0,M.jsx)(p,{value:`wysiwyg`,"aria-label":b,"aria-describedby":A,disabled:_,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:j}),t[11]=A,t[12]=_,t[13]=b,t[14]=N):N=t[14];let P;t[15]!==w||t[16]!==C?(P=w?(0,M.jsx)(`span`,{id:C,className:`sr-only`,children:w}):null,t[15]=w,t[16]=C,t[17]=P):P=t[17];let F;t[18]!==N||t[19]!==P?(F=(0,M.jsx)(l,{asChild:!0,children:(0,M.jsxs)(`div`,{children:[N,P]})}),t[18]=N,t[19]=P,t[20]=F):F=t[20];let I;t[21]!==_||t[22]!==h||t[23]!==c?(I=_&&h?h:c||(0,M.jsx)(r,{id:`Mb_20S`}),t[21]=_,t[22]=h,t[23]=c,t[24]=I):I=t[24];let L;t[25]===I?L=t[26]:(L=(0,M.jsx)(u,{side:`bottom`,children:I}),t[25]=I,t[26]=L);let R;t[27]!==F||t[28]!==L?(R=(0,M.jsxs)(d,{children:[F,L]}),t[27]=F,t[28]=L,t[29]=R):R=t[29];let z;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,M.jsx)(H,{className:`size-4`}),t[30]=z):z=t[30];let B;t[31]!==g||t[32]!==S?(B=(0,M.jsx)(l,{asChild:!0,children:(0,M.jsx)(`div`,{children:(0,M.jsx)(p,{value:`source`,"aria-label":S,disabled:g,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:z})})}),t[31]=g,t[32]=S,t[33]=B):B=t[33];let V;t[34]!==g||t[35]!==f?(V=g?(0,M.jsx)(r,{id:`G-JBA1`}):f||(0,M.jsx)(r,{id:`u6Hp4N`}),t[34]=g,t[35]=f,t[36]=V):V=t[36];let W;t[37]===V?W=t[38]:(W=(0,M.jsx)(u,{side:`bottom`,children:V}),t[37]=V,t[38]=W);let G;t[39]!==B||t[40]!==W?(G=(0,M.jsxs)(d,{children:[B,W]}),t[39]=B,t[40]=W,t[41]=G):G=t[41];let K;return t[42]!==R||t[43]!==G||t[44]!==T||t[45]!==E||t[46]!==D?(K=(0,M.jsxs)(m,{type:`single`,value:T,onValueChange:E,"aria-label":D,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 bg-muted p-0.5 data-[size=sm]:rounded-[10px]`,children:[R,G]}),t[42]=R,t[43]=G,t[44]=T,t[45]=E,t[46]=D,t[47]=K):K=t[47],K}export{F as a,j as c,R as i,H as n,P as o,z as r,N as s,W as t};
@@ -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-Cym3gapE.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m}from"./dialog-Ba9N5nEw.js";import{Us as h,ws as g}from"./dist-DTZ5Uilk.js";import{n as _}from"./dist-CJhtNlOm2.js";import{v}from"./documents-events-DxL5ysM1.js";import{i as y}from"./use-apply-config-theme-CBmHKD_B.js";import{t as b}from"./createLucideIcon-BulbvLvN.js";import{t as x}from"./eye-7pio2q9G.js";import"./config-provider-D9QQqC6e.js";var S=b(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),C=b(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),w=b(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),T=b(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),E=b(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),D=a(),O=e(n(),1);async function k(){try{let e=await fetch(`/api/sync/status`);return e.ok?{status:await e.json()}:{status:null,error:`server`}}catch{return{status:null,error:`network`}}}function A(){return j().status}function j(){let e=(0,D.c)(8),[t,n]=(0,O.useState)(null),[r,i]=(0,O.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(){k().then(e=>{let{status:t,error:r}=e;i(r??null),t&&n(t)})},e[0]=a):a=e[0];let o=a,s,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{o()},c=[],e[1]=s,e[2]=c):(s=e[1],c=e[2]),(0,O.useEffect)(s,c);let l,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>v(e=>{e.includes(`sync-status`)&&o()}),u=[],e[3]=l,e[4]=u):(l=e[3],u=e[4]),(0,O.useEffect)(l,u);let d;return e[5]!==r||e[6]!==t?(d={status:t,fetchError:r},e[5]=r,e[6]=t,e[7]=d):d=e[7],d}var M=t();function N(e){let t=(0,D.c)(3),{children:n}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(`p`,{className:`flex items-center gap-1.5 font-mono text-xs font-semibold tracking-wider uppercase`,children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,className:`mb-[3px] flex items-center justify-center`,children:`◇`}),(0,M.jsx)(r,{id:`6s7LXO`})]}),t[0]=i):i=t[0];let a;return t[1]===n?a=t[2]:(a=(0,M.jsxs)(`div`,{role:`note`,className:`flex flex-col gap-5 text-sm`,children:[i,(0,M.jsx)(`div`,{className:`flex flex-col gap-5`,children:n})]}),t[1]=n,t[2]=a),a}function P(e){let t=(0,D.c)(10),{icon:n,title:r,body:i}=e,a;t[0]===r?a=t[1]:(a=(0,M.jsx)(`p`,{className:`font-medium`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,M.jsx)(`p`,{className:`text-muted-foreground`,children:i}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,M.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;return t[7]!==n||t[8]!==s?(c=(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[n,s]}),t[7]=n,t[8]=s,t[9]=c):c=t[9],c}function F(e){let t=(0,D.c)(4),{variant:n}=e;if((n===void 0?`full`:n)===`follow`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,M.jsx)(c,{children:(0,M.jsx)(r,{id:`W7mERj`})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsxs)(M.Fragment,{children:[e,(0,M.jsx)(s,{children:(0,M.jsx)(r,{id:`KmVekT`})})]}),t[1]=n):n=t[1],n}let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsx)(c,{children:(0,M.jsx)(r,{id:`Uo2Rj7`})}),t[2]=i):i=t[2];let a;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,M.jsxs)(M.Fragment,{children:[i,(0,M.jsx)(s,{children:(0,M.jsx)(r,{id:`n6hXUm`})})]}),t[3]=a):a=t[3],a}function I(e){let t=(0,D.c)(2),{variant:n}=e,r=n===void 0?`full`:n,i;return t[0]===r?i=t[1]:(i=(0,M.jsx)(N,{children:r===`follow`?(0,M.jsx)(R,{}):(0,M.jsx)(L,{})}),t[0]=r,t[1]=i),i}function L(){let e=(0,D.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(P,{icon:(0,M.jsx)(C,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`cdmk8A`}),body:(0,M.jsx)(r,{id:`YaeyFh`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(P,{icon:(0,M.jsx)(w,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`9i21pa`}),body:(0,M.jsx)(r,{id:`KIIamL`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(M.Fragment,{children:[t,n,(0,M.jsx)(P,{icon:(0,M.jsx)(x,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`8cpeU3`}),body:(0,M.jsx)(r,{id:`DELNQk`})})]}),e[2]=i):i=e[2],i}function R(){let e=(0,D.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(P,{icon:(0,M.jsx)(S,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`0xnQ_X`}),body:(0,M.jsx)(r,{id:`aCoQfY`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(P,{icon:(0,M.jsx)(E,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`5rnB76`}),body:(0,M.jsx)(r,{id:`kXNv8P`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(M.Fragment,{children:[t,n,(0,M.jsx)(P,{icon:(0,M.jsx)(T,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`oBK5fD`}),body:(0,M.jsx)(r,{id:`8Wav8y`})})]}),e[2]=i):i=e[2],i}function z(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=e?`full`:`off`,r=t.patch({autoSync:{mode:n,enabled:e}});return r.ok?{ok:!0}:{ok:!1,error:g(r.error)}},e[0]=t,e[1]=n),n}function B(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{mode:e,enabled:null}});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=n),n}function V(){let e=(0,D.c)(2),{projectBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{default:e}});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=n),n}function H(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=n),n}function U(e,t){let n=(0,D.c)(12),{_:r}=i(),[a,o]=(0,O.useState)(!1),s;n[0]!==r||n[1]!==e?(s=function(t){if(e===null)return _.error(r({id:`fiMNLl`})),!1;let n=e(t);if(!n.ok){console.error(`[sync] toggle failed:`,n.error);let e=n.error;return _.error(r(t?{id:`04RA0-`,values:{detail:e}}:{id:`qjHMHf`,values:{detail:e}})),!1}return!0},n[0]=r,n[1]=e,n[2]=s):s=n[2];let c=s,l;n[3]===c?l=n[4]:(l=function(e){if(e){o(!0);return}c(!1)},n[3]=c,n[4]=l);let u=l,d;n[5]!==c||n[6]!==t?(d=function(){c(!0)&&(o(!1),t?.onEnabled?.())},n[5]=c,n[6]=t,n[7]=d):d=n[7];let f=d,p;return n[8]!==a||n[9]!==f||n[10]!==u?(p={confirmOpen:a,setConfirmOpen:o,onToggleRequest:u,onConfirm:f},n[8]=a,n[9]=f,n[10]=u,n[11]=p):p=n[11],p}function W(e,t,n){let r=(0,D.c)(15),{_:a}=i(),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(null),u;r[0]!==a||r[1]!==n||r[2]!==e?(u=function(t){if(e===null)return _.error(a({id:`fiMNLl`})),!1;let r=e(t);if(!r.ok){console.error(`[sync] mode change failed:`,r.error);let e=r.error;return _.error(a({id:`nOEDQs`,values:{detail:e}})),!1}return n?.onApplied?.(t),!0},r[0]=a,r[1]=n,r[2]=e,r[3]=u):u=r[3];let d=u,f;r[4]!==d||r[5]!==t?(f=function(e){if(e!==t){if(e===`off`){d(`off`);return}l(e),s(!0)}},r[4]=d,r[5]=t,r[6]=f):f=r[6];let p=f,m;r[7]!==d||r[8]!==c?(m=function(){c!==null&&d(c)&&s(!1)},r[7]=d,r[8]=c,r[9]=m):m=r[9];let h=m,g;return r[10]!==o||r[11]!==h||r[12]!==p||r[13]!==c?(g={confirmOpen:o,setConfirmOpen:s,pendingMode:c,onModeSelect:p,onConfirm:h},r[10]=o,r[11]=h,r[12]=p,r[13]=c,r[14]=g):g=r[14],g}function G(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=n),n}function K(e,t){let n=(0,D.c)(18),{_:r}=i(),a=G(),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(null),u;n[0]===e?u=n[1]:(u=h(e)??`off`,n[0]=e,n[1]=u);let d=u,f;n[2]!==r||n[3]!==a?(f=function(e){if(a===null)return _.error(r({id:`fiMNLl`})),!1;let t=a(e);if(!t.ok){console.error(`[sync] badge control failed:`,t.error);let e=t.error;return _.error(r({id:`ZVOhXM`,values:{detail:e}})),!1}return!0},n[2]=r,n[3]=a,n[4]=f):f=n[4];let p=f,m;n[5]!==p||n[6]!==d?(m=function(e){if(e!==d){if(e===`off`){p({mode:`off`,enabled:null,resumeMode:null});return}l(e),s(!0)}},n[5]=p,n[6]=d,n[7]=m):m=n[7];let g=m,v;n[8]!==p||n[9]!==c?(v=function(){c!==null&&p({mode:c,enabled:null,resumeMode:null})&&(s(!1),l(null))},n[8]=p,n[9]=c,n[10]=v):v=n[10];let y=v,b=c===`follow`?t:0,x;return n[11]!==o||n[12]!==d||n[13]!==y||n[14]!==g||n[15]!==c||n[16]!==b?(x={mode:d,confirmOpen:o,setConfirmOpen:s,pendingMode:c,strandedCommitCount:b,onModeSelect:g,onConfirm:y},n[11]=o,n[12]=d,n[13]=y,n[14]=g,n[15]=c,n[16]=b,n[17]=x):x=n[17],x}async function q(e){let t=await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})});if(!t.ok)throw Error(`sync trigger failed: ${t.status}`)}function J(e){let t=(0,D.c)(24),{open:n,onOpenChange:i,onConfirm:a,variant:s,strandedCommitCount:c}=e,h=s===void 0?`full`:s,g=c===void 0?0:c,_=h===`follow`&&g>0,v;t[0]===h?v=t[1]:(v=(0,M.jsx)(p,{children:(0,M.jsx)(F,{variant:h})}),t[0]=h,t[1]=v);let y;t[2]===h?y=t[3]:(y=(0,M.jsx)(I,{variant:h}),t[2]=h,t[3]=y);let b;t[4]!==_||t[5]!==g?(b=_&&(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:(0,M.jsx)(r,{id:`caw8gO`,values:{strandedCommitCount:g}})}),t[4]=_,t[5]=g,t[6]=b):b=t[6];let x;t[7]!==y||t[8]!==b?(x=(0,M.jsxs)(u,{children:[y,b]}),t[7]=y,t[8]=b,t[9]=x):x=t[9];let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,M.jsx)(f,{asChild:!0,children:(0,M.jsx)(o,{variant:`outline`,children:(0,M.jsx)(r,{id:`dEgA5A`})})}),t[10]=S):S=t[10];let C;t[11]===h?C=t[12]:(C=h===`follow`?(0,M.jsx)(r,{id:`jTUxaN`}):(0,M.jsx)(r,{id:`pPiV8s`}),t[11]=h,t[12]=C);let w;t[13]!==a||t[14]!==C?(w=(0,M.jsxs)(d,{children:[S,(0,M.jsx)(o,{onClick:a,children:C})]}),t[13]=a,t[14]=C,t[15]=w):w=t[15];let T;t[16]!==v||t[17]!==x||t[18]!==w?(T=(0,M.jsxs)(l,{className:`sm:max-w-lg`,children:[v,x,w]}),t[16]=v,t[17]=x,t[18]=w,t[19]=T):T=t[19];let E;return t[20]!==i||t[21]!==n||t[22]!==T?(E=(0,M.jsx)(m,{open:n,onOpenChange:i,children:T}),t[20]=i,t[21]=n,t[22]=T,t[23]=E):E=t[23],E}export{S as _,V as a,W as c,I as d,N as f,T as g,j as h,U as i,B as l,A as m,q as n,z as o,P as p,K as r,H as s,J as t,F as u};
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-Cym3gapE.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m}from"./dialog-Ba9N5nEw.js";import{Ts as h,Ws as g}from"./dist-C_QZEaeX.js";import{n as _}from"./dist-CJhtNlOm2.js";import{v}from"./documents-events-CwqQxQT5.js";import{i as y}from"./use-apply-config-theme-CBmHKD_B.js";import{t as b}from"./createLucideIcon-BulbvLvN.js";import{t as x}from"./eye-7pio2q9G.js";import"./config-provider-BXiukxwE.js";var S=b(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),C=b(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),w=b(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),T=b(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),E=b(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),D=a(),O=e(n(),1);async function k(){try{let e=await fetch(`/api/sync/status`);return e.ok?{status:await e.json()}:{status:null,error:`server`}}catch{return{status:null,error:`network`}}}function A(){return j().status}function j(){let e=(0,D.c)(8),[t,n]=(0,O.useState)(null),[r,i]=(0,O.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(){k().then(e=>{let{status:t,error:r}=e;i(r??null),t&&n(t)})},e[0]=a):a=e[0];let o=a,s,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{o()},c=[],e[1]=s,e[2]=c):(s=e[1],c=e[2]),(0,O.useEffect)(s,c);let l,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>v(e=>{e.includes(`sync-status`)&&o()}),u=[],e[3]=l,e[4]=u):(l=e[3],u=e[4]),(0,O.useEffect)(l,u);let d;return e[5]!==r||e[6]!==t?(d={status:t,fetchError:r},e[5]=r,e[6]=t,e[7]=d):d=e[7],d}var M=t();function N(e){let t=(0,D.c)(3),{children:n}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(`p`,{className:`flex items-center gap-1.5 font-mono text-xs font-semibold tracking-wider uppercase`,children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,className:`mb-[3px] flex items-center justify-center`,children:`◇`}),(0,M.jsx)(r,{id:`6s7LXO`})]}),t[0]=i):i=t[0];let a;return t[1]===n?a=t[2]:(a=(0,M.jsxs)(`div`,{role:`note`,className:`flex flex-col gap-5 text-sm`,children:[i,(0,M.jsx)(`div`,{className:`flex flex-col gap-5`,children:n})]}),t[1]=n,t[2]=a),a}function P(e){let t=(0,D.c)(10),{icon:n,title:r,body:i}=e,a;t[0]===r?a=t[1]:(a=(0,M.jsx)(`p`,{className:`font-medium`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,M.jsx)(`p`,{className:`text-muted-foreground`,children:i}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,M.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;return t[7]!==n||t[8]!==s?(c=(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[n,s]}),t[7]=n,t[8]=s,t[9]=c):c=t[9],c}function F(e){let t=(0,D.c)(4),{variant:n}=e;if((n===void 0?`full`:n)===`follow`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,M.jsx)(c,{children:(0,M.jsx)(r,{id:`W7mERj`})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsxs)(M.Fragment,{children:[e,(0,M.jsx)(s,{children:(0,M.jsx)(r,{id:`KmVekT`})})]}),t[1]=n):n=t[1],n}let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsx)(c,{children:(0,M.jsx)(r,{id:`Uo2Rj7`})}),t[2]=i):i=t[2];let a;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,M.jsxs)(M.Fragment,{children:[i,(0,M.jsx)(s,{children:(0,M.jsx)(r,{id:`n6hXUm`})})]}),t[3]=a):a=t[3],a}function I(e){let t=(0,D.c)(2),{variant:n}=e,r=n===void 0?`full`:n,i;return t[0]===r?i=t[1]:(i=(0,M.jsx)(N,{children:r===`follow`?(0,M.jsx)(R,{}):(0,M.jsx)(L,{})}),t[0]=r,t[1]=i),i}function L(){let e=(0,D.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(P,{icon:(0,M.jsx)(C,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`cdmk8A`}),body:(0,M.jsx)(r,{id:`YaeyFh`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(P,{icon:(0,M.jsx)(w,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`9i21pa`}),body:(0,M.jsx)(r,{id:`KIIamL`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(M.Fragment,{children:[t,n,(0,M.jsx)(P,{icon:(0,M.jsx)(x,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`8cpeU3`}),body:(0,M.jsx)(r,{id:`DELNQk`})})]}),e[2]=i):i=e[2],i}function R(){let e=(0,D.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(P,{icon:(0,M.jsx)(S,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`0xnQ_X`}),body:(0,M.jsx)(r,{id:`aCoQfY`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(P,{icon:(0,M.jsx)(E,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`5rnB76`}),body:(0,M.jsx)(r,{id:`kXNv8P`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(M.Fragment,{children:[t,n,(0,M.jsx)(P,{icon:(0,M.jsx)(T,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`oBK5fD`}),body:(0,M.jsx)(r,{id:`8Wav8y`})})]}),e[2]=i):i=e[2],i}function z(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=e?`full`:`off`,r=t.patch({autoSync:{mode:n,enabled:e}});return r.ok?{ok:!0}:{ok:!1,error:h(r.error)}},e[0]=t,e[1]=n),n}function B(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{mode:e,enabled:null}});return n.ok?{ok:!0}:{ok:!1,error:h(n.error)}},e[0]=t,e[1]=n),n}function V(){let e=(0,D.c)(2),{projectBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{default:e}});return n.ok?{ok:!0}:{ok:!1,error:h(n.error)}},e[0]=t,e[1]=n),n}function H(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:h(n.error)}},e[0]=t,e[1]=n),n}function U(e,t){let n=(0,D.c)(12),{_:r}=i(),[a,o]=(0,O.useState)(!1),s;n[0]!==r||n[1]!==e?(s=function(t){if(e===null)return _.error(r({id:`fiMNLl`})),!1;let n=e(t);if(!n.ok){console.error(`[sync] toggle failed:`,n.error);let e=n.error;return _.error(r(t?{id:`04RA0-`,values:{detail:e}}:{id:`qjHMHf`,values:{detail:e}})),!1}return!0},n[0]=r,n[1]=e,n[2]=s):s=n[2];let c=s,l;n[3]===c?l=n[4]:(l=function(e){if(e){o(!0);return}c(!1)},n[3]=c,n[4]=l);let u=l,d;n[5]!==c||n[6]!==t?(d=function(){c(!0)&&(o(!1),t?.onEnabled?.())},n[5]=c,n[6]=t,n[7]=d):d=n[7];let f=d,p;return n[8]!==a||n[9]!==f||n[10]!==u?(p={confirmOpen:a,setConfirmOpen:o,onToggleRequest:u,onConfirm:f},n[8]=a,n[9]=f,n[10]=u,n[11]=p):p=n[11],p}function W(e,t,n){let r=(0,D.c)(15),{_:a}=i(),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(null),u;r[0]!==a||r[1]!==n||r[2]!==e?(u=function(t){if(e===null)return _.error(a({id:`fiMNLl`})),!1;let r=e(t);if(!r.ok){console.error(`[sync] mode change failed:`,r.error);let e=r.error;return _.error(a({id:`nOEDQs`,values:{detail:e}})),!1}return n?.onApplied?.(t),!0},r[0]=a,r[1]=n,r[2]=e,r[3]=u):u=r[3];let d=u,f;r[4]!==d||r[5]!==t?(f=function(e){if(e!==t){if(e===`off`){d(`off`);return}l(e),s(!0)}},r[4]=d,r[5]=t,r[6]=f):f=r[6];let p=f,m;r[7]!==d||r[8]!==c?(m=function(){c!==null&&d(c)&&s(!1)},r[7]=d,r[8]=c,r[9]=m):m=r[9];let h=m,g;return r[10]!==o||r[11]!==h||r[12]!==p||r[13]!==c?(g={confirmOpen:o,setConfirmOpen:s,pendingMode:c,onModeSelect:p,onConfirm:h},r[10]=o,r[11]=h,r[12]=p,r[13]=c,r[14]=g):g=r[14],g}function G(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:h(n.error)}},e[0]=t,e[1]=n),n}function K(e,t){let n=(0,D.c)(18),{_:r}=i(),a=G(),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(null),u;n[0]===e?u=n[1]:(u=g(e)??`off`,n[0]=e,n[1]=u);let d=u,f;n[2]!==r||n[3]!==a?(f=function(e){if(a===null)return _.error(r({id:`fiMNLl`})),!1;let t=a(e);if(!t.ok){console.error(`[sync] badge control failed:`,t.error);let e=t.error;return _.error(r({id:`ZVOhXM`,values:{detail:e}})),!1}return!0},n[2]=r,n[3]=a,n[4]=f):f=n[4];let p=f,m;n[5]!==p||n[6]!==d?(m=function(e){if(e!==d){if(e===`off`){p({mode:`off`,enabled:null,resumeMode:null});return}l(e),s(!0)}},n[5]=p,n[6]=d,n[7]=m):m=n[7];let h=m,v;n[8]!==p||n[9]!==c?(v=function(){c!==null&&p({mode:c,enabled:null,resumeMode:null})&&(s(!1),l(null))},n[8]=p,n[9]=c,n[10]=v):v=n[10];let y=v,b=c===`follow`?t:0,x;return n[11]!==o||n[12]!==d||n[13]!==y||n[14]!==h||n[15]!==c||n[16]!==b?(x={mode:d,confirmOpen:o,setConfirmOpen:s,pendingMode:c,strandedCommitCount:b,onModeSelect:h,onConfirm:y},n[11]=o,n[12]=d,n[13]=y,n[14]=h,n[15]=c,n[16]=b,n[17]=x):x=n[17],x}async function q(e){let t=await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})});if(!t.ok)throw Error(`sync trigger failed: ${t.status}`)}function J(e){let t=(0,D.c)(24),{open:n,onOpenChange:i,onConfirm:a,variant:s,strandedCommitCount:c}=e,h=s===void 0?`full`:s,g=c===void 0?0:c,_=h===`follow`&&g>0,v;t[0]===h?v=t[1]:(v=(0,M.jsx)(p,{children:(0,M.jsx)(F,{variant:h})}),t[0]=h,t[1]=v);let y;t[2]===h?y=t[3]:(y=(0,M.jsx)(I,{variant:h}),t[2]=h,t[3]=y);let b;t[4]!==_||t[5]!==g?(b=_&&(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:(0,M.jsx)(r,{id:`caw8gO`,values:{strandedCommitCount:g}})}),t[4]=_,t[5]=g,t[6]=b):b=t[6];let x;t[7]!==y||t[8]!==b?(x=(0,M.jsxs)(u,{children:[y,b]}),t[7]=y,t[8]=b,t[9]=x):x=t[9];let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,M.jsx)(f,{asChild:!0,children:(0,M.jsx)(o,{variant:`outline`,children:(0,M.jsx)(r,{id:`dEgA5A`})})}),t[10]=S):S=t[10];let C;t[11]===h?C=t[12]:(C=h===`follow`?(0,M.jsx)(r,{id:`jTUxaN`}):(0,M.jsx)(r,{id:`pPiV8s`}),t[11]=h,t[12]=C);let w;t[13]!==a||t[14]!==C?(w=(0,M.jsxs)(d,{children:[S,(0,M.jsx)(o,{onClick:a,children:C})]}),t[13]=a,t[14]=C,t[15]=w):w=t[15];let T;t[16]!==v||t[17]!==x||t[18]!==w?(T=(0,M.jsxs)(l,{className:`sm:max-w-lg`,children:[v,x,w]}),t[16]=v,t[17]=x,t[18]=w,t[19]=T):T=t[19];let E;return t[20]!==i||t[21]!==n||t[22]!==T?(E=(0,M.jsx)(m,{open:n,onOpenChange:i,children:T}),t[20]=i,t[21]=n,t[22]=T,t[23]=E):E=t[23],E}export{S as _,V as a,W as c,I as d,N as f,T as g,j as h,U as i,B as l,A as m,q as n,z as o,P as p,K as r,H as s,J as t,F as u};