@inkeep/open-knowledge 0.84.0-beta.7 → 0.84.0-beta.8

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 (122) hide show
  1. package/dist/cli.mjs +6 -6
  2. package/dist/constants-BV_h1uxC.mjs +1 -0
  3. package/dist/index.mjs +1 -1
  4. package/dist/{init-8-Yjr5Ej.mjs → init-BgqVi-9O.mjs} +2 -2
  5. package/dist/init-Go0uTZtY.mjs +1 -0
  6. package/dist/{launch-json-removal-BFuH95hg.mjs → launch-json-removal-CnjxrLk6.mjs} +1 -1
  7. package/dist/{loader-DcRq1H4Q.mjs → loader-B8U9rhyX.mjs} +1 -1
  8. package/dist/loader-DLHNUQH5.mjs +1 -0
  9. package/dist/{preview-0clAS89Z.mjs → preview-CCxlCT_n.mjs} +1 -1
  10. package/dist/preview-DHqUdp0G.mjs +1 -0
  11. package/dist/public/assets/{AccountSection-DFq7FuUC.js → AccountSection-B014nDlY.js} +1 -1
  12. package/dist/public/assets/{ActivityModeContent-Qw7p8UOs.js → ActivityModeContent-DYdjlBFR.js} +1 -1
  13. package/dist/public/assets/{AddPropertiesButton-Dh6Fm4Po.js → AddPropertiesButton-DgNbHA4e.js} +1 -1
  14. package/dist/public/assets/{AgentDiffPane-B29Ed_RD.js → AgentDiffPane-9W2g7aLW.js} +1 -1
  15. package/dist/public/assets/{AttachmentsSection-DA2_-Gn5.js → AttachmentsSection-DgA2oYx3.js} +1 -1
  16. package/dist/public/assets/{CodeMirrorPropInput-IrOBMsvE.js → CodeMirrorPropInput-I8b5kl2c.js} +1 -1
  17. package/dist/public/assets/{ContentRulesSection-B4zlefzJ.js → ContentRulesSection-CEhqKazM.js} +1 -1
  18. package/dist/public/assets/{DocumentContext-BXjH29Cs.js → DocumentContext-BU6384lO.js} +1 -1
  19. package/dist/public/assets/{EditorModeToggle-8ThdSUWG.js → EditorModeToggle-Cf0LpUPt.js} +1 -1
  20. package/dist/public/assets/{ExcalidrawDocEditor-CaVG93br.js → ExcalidrawDocEditor-zIujqXar.js} +1 -1
  21. package/dist/public/assets/FeedbackForm-BkNTltaq.js +1 -0
  22. package/dist/public/assets/{ImportSkillDialog-D1JhpLRS.js → ImportSkillDialog-BsdzQosb.js} +1 -1
  23. package/dist/public/assets/{LinkPreviewsSection-CFpmMgh0.js → LinkPreviewsSection-bzaka6Vy.js} +1 -1
  24. package/dist/public/assets/{LintConfigEditor-D6XlhkOS.js → LintConfigEditor-Cc4OnPo8.js} +1 -1
  25. package/dist/public/assets/{LintingSection-Dq1Xf86R.js → LintingSection-BTbUA-sH.js} +1 -1
  26. package/dist/public/assets/ManagedArtifactProperties-BeqrkzNl.js +1 -0
  27. package/dist/public/assets/{ManagedArtifactProperties-M0jbm6fa.js → ManagedArtifactProperties-DZWmH30D.js} +1 -1
  28. package/dist/public/assets/{MermaidDocEditor-BaQSiXiQ.js → MermaidDocEditor-Cxe7FJmA.js} +1 -1
  29. package/dist/public/assets/{NetworkAccessSection-BtDnBnP4.js → NetworkAccessSection-Bco3oNmX.js} +1 -1
  30. package/dist/public/assets/{PropertyDisplayRow-HJoGUZP6.js → PropertyDisplayRow-kKXyb1ak.js} +1 -1
  31. package/dist/public/assets/{PublishToGitHubDialog-GNaWc3O5.js → PublishToGitHubDialog-BVIwcP34.js} +1 -1
  32. package/dist/public/assets/{SchemaConfigEditor-DKW7Pr4o.js → SchemaConfigEditor-DbK-MAfN.js} +1 -1
  33. package/dist/public/assets/{SearchSection-L9yddPoe.js → SearchSection--sZel4Z5.js} +1 -1
  34. package/dist/public/assets/{SessionsHost-ygPwASiG.js → SessionsHost-D9CZH55k.js} +2 -2
  35. package/dist/public/assets/{SettingsDialogBody-8HGynawA.js → SettingsDialogBody-D7gXHHaO.js} +2 -2
  36. package/dist/public/assets/{ShareReceiveMissDialog-VDisOula.js → ShareReceiveMissDialog-C4bznAx6.js} +1 -1
  37. package/dist/public/assets/{SharingSection-BvdibR47.js → SharingSection-Bjl_f8Kj.js} +1 -1
  38. package/dist/public/assets/{SkillToolbarControls-BRK7Q4pd.js → SkillToolbarControls-C6R2N9zy.js} +1 -1
  39. package/dist/public/assets/{SourceEditor-PtzKulZF.js → SourceEditor-DQP_Juhy.js} +1 -1
  40. package/dist/public/assets/{SpellingSettings-BSGcldGm.js → SpellingSettings-B_phbPpu.js} +1 -1
  41. package/dist/public/assets/SyncSection-BXeUGdb9.js +1 -0
  42. package/dist/public/assets/SyncStatusBadge-Du08o0Dw.js +1 -0
  43. package/dist/public/assets/{TerminalSection-D7urxrAA.js → TerminalSection--ns50F78.js} +1 -1
  44. package/dist/public/assets/{TerminalWindowApp-C73II7ky.js → TerminalWindowApp-DjqzdE_Z.js} +1 -1
  45. package/dist/public/assets/{TextDocEditor-BlwG9Qao.js → TextDocEditor-DalceEBj.js} +1 -1
  46. package/dist/public/assets/{ThemePluginSection-pfZen7P5.js → ThemePluginSection-B6zsULe5.js} +1 -1
  47. package/dist/public/assets/{ThreadView-DWVMMr4i.js → ThreadView-C5ldWBBV.js} +1 -1
  48. package/dist/public/assets/{TimelineDiffPane-DpyJq4Xx.js → TimelineDiffPane-C5cs7cZg.js} +1 -1
  49. package/dist/public/assets/{comment-chips-dZrIs5ND.js → comment-chips-DpZR-ILM.js} +1 -1
  50. package/dist/public/assets/{config-provider-kr9NPtRs.js → config-provider-Cu_pQedM.js} +1 -1
  51. package/dist/public/assets/config-schema-k_oWDqyF.js +1 -0
  52. package/dist/public/assets/{doc-undo-manager-pQLpJNya.js → doc-undo-manager--bnI6mEc.js} +1 -1
  53. package/dist/public/assets/field-controls-D-TNpiqz.js +1 -0
  54. package/dist/public/assets/{field-controls-xzrUdIed.js → field-controls-zCgHwN0u.js} +1 -1
  55. package/dist/public/assets/{index-CcIVaXXk.js → index-BUNWe98_.js} +7 -7
  56. package/dist/public/assets/{lint-config-client-DOb2qnaH.js → lint-config-client-t7VsdRdr.js} +1 -1
  57. package/dist/public/assets/{lint-plugins-9DXuUUjr.js → lint-plugins-CR0kd8mR.js} +1 -1
  58. package/dist/public/assets/{markdown-lint-KW1fm5Bw.js → markdown-lint-DvPODigW.js} +1 -1
  59. package/dist/public/assets/{markdownlint-rule-browser-BOTHY0Kh.js → markdownlint-rule-browser-DAxdd3Fq.js} +1 -1
  60. package/dist/public/assets/messages-2kQ70cnc.js +1 -0
  61. package/dist/public/assets/messages-6iQlSalY.js +1 -0
  62. package/dist/public/assets/messages-AZwAPuM-.js +1 -0
  63. package/dist/public/assets/messages-BFOwShYO.js +1 -0
  64. package/dist/public/assets/messages-BnxHXoYK.js +1 -0
  65. package/dist/public/assets/messages-C2KqS948.js +1 -0
  66. package/dist/public/assets/messages-CZk_YdoA.js +1 -0
  67. package/dist/public/assets/messages-CszehdID.js +1 -0
  68. package/dist/public/assets/messages-D7N1vQCQ.js +1 -0
  69. package/dist/public/assets/messages-DAEoyeao.js +1 -0
  70. package/dist/public/assets/messages-RoeLbbVl.js +1 -0
  71. package/dist/public/assets/messages-aTjgW69a.js +1 -0
  72. package/dist/public/assets/messages-jWN9SatD.js +1 -0
  73. package/dist/public/assets/pending-receive-nav-store-XWQOt6Fr.js +1 -0
  74. package/dist/public/assets/{progress-fuMc8jJV.js → progress-BhRFeByh.js} +1 -1
  75. package/dist/public/assets/{saved-themes-client-CLbzeYZC.js → saved-themes-client-BKjZgSZ2.js} +1 -1
  76. package/dist/public/assets/{schema-section-DXI6fq5P.js → schema-section-jPMt1scY.js} +1 -1
  77. package/dist/public/assets/{selection-context-5xOiHak2.js → selection-context-Cuv7GyoN.js} +1 -1
  78. package/dist/public/assets/{src-Cssj7pDE.js → src-B2A6Sl6H.js} +1 -1
  79. package/dist/public/assets/{typing-burst-detector-7wfQCn5k.js → typing-burst-detector-DsqIPsLN.js} +1 -1
  80. package/dist/public/assets/{uninstall-Q2nzmrZ_.js → uninstall-Br5i6Ave.js} +1 -1
  81. package/dist/public/assets/{use-activity-panel-BPL7lJya.js → use-activity-panel-Cn_JBE3I.js} +1 -1
  82. package/dist/public/assets/{use-apply-config-language-4xYH56WJ.js → use-apply-config-language-BNapdqrK.js} +2 -2
  83. package/dist/public/assets/{use-open-skill-aFfPS8sI.js → use-open-skill-Dz4e3fQ5.js} +1 -1
  84. package/dist/public/assets/{use-terminal-enabled-CER2zsVk.js → use-terminal-enabled-DuxifgTs.js} +1 -1
  85. package/dist/public/assets/{use-timeline-entry-diff-LgsLxlhH.js → use-timeline-entry-diff-BTyhkiHh.js} +1 -1
  86. package/dist/public/index.html +21 -21
  87. package/dist/public/uninstall.html +3 -3
  88. package/dist/{registry-probes-C-WlLUAh.mjs → registry-probes-DAls8wRU.mjs} +1 -1
  89. package/dist/{removal-file-path-B8spaBoU.mjs → removal-file-path-6F2vYdal.mjs} +1 -1
  90. package/dist/{repair-launch-json-DZnGOows.mjs → repair-launch-json-CVRIabb_.mjs} +1 -1
  91. package/dist/{repair-mcp-configs-D6rUVl4x.mjs → repair-mcp-configs-DzDCKebq.mjs} +1 -1
  92. package/dist/{src-B2Ehi2Aj.mjs → src-BftPhK_7.mjs} +1 -1
  93. package/dist/src-qQwctWcT.mjs +1 -0
  94. package/dist/start-BIRIWVlY.mjs +1 -0
  95. package/dist/{start-DZgmqmHk.mjs → start-Dw9RbsG0.mjs} +2 -2
  96. package/package.json +4 -4
  97. package/dist/constants-BPvXlOxK.mjs +0 -1
  98. package/dist/init-DEgRa7Oi.mjs +0 -1
  99. package/dist/loader-BQu_TRqW.mjs +0 -1
  100. package/dist/preview-D1tH992g.mjs +0 -1
  101. package/dist/public/assets/FeedbackForm-CM6E94Xl.js +0 -1
  102. package/dist/public/assets/ManagedArtifactProperties-xm0URUEF.js +0 -1
  103. package/dist/public/assets/SyncSection-CUBEjvyG.js +0 -1
  104. package/dist/public/assets/SyncStatusBadge-BAsATZXK.js +0 -1
  105. package/dist/public/assets/config-schema-CAyoZB9x.js +0 -1
  106. package/dist/public/assets/field-controls-D0PIbAOZ.js +0 -1
  107. package/dist/public/assets/messages-B873lb17.js +0 -1
  108. package/dist/public/assets/messages-BNkn5D4f.js +0 -1
  109. package/dist/public/assets/messages-BUvJUm4Q.js +0 -1
  110. package/dist/public/assets/messages-BWsM3wpe.js +0 -1
  111. package/dist/public/assets/messages-BfSogmKY.js +0 -1
  112. package/dist/public/assets/messages-Bn9WWUVr.js +0 -1
  113. package/dist/public/assets/messages-C572XTjB.js +0 -1
  114. package/dist/public/assets/messages-CDXbN2TY.js +0 -1
  115. package/dist/public/assets/messages-COfCWPbk.js +0 -1
  116. package/dist/public/assets/messages-D41opmU0.js +0 -1
  117. package/dist/public/assets/messages-D4Jxk56m.js +0 -1
  118. package/dist/public/assets/messages-D9BcyLGO.js +0 -1
  119. package/dist/public/assets/messages-Dgr-iymI.js +0 -1
  120. package/dist/public/assets/pending-receive-nav-store-BVl3nw0V.js +0 -1
  121. package/dist/src-kPpt9bL3.mjs +0 -1
  122. package/dist/start-BZbha1r-.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{t as r}from"./compiler-runtime-BfE3aGVn.js";import{a as i,i as a,n as o,o as s,r as c}from"./pending-receive-nav-store-BVl3nw0V.js";import{t as l}from"./miss-dialog-store-CsiJb9Ou.js";import{c as u,i as d,n as f,s as p,t as m}from"./dialog-BJEjKJjL.js";import{l as h,u as g}from"./doc-hash-BJkweiX9.js";var _=r(),v=e(n(),1),y=t();function b(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function x(){let e=(0,_.c)(2),t=(0,v.useSyncExternalStore)(l.subscribe,l.getSnapshot,S);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,y.jsx)(C,{nav:t},t.path),e[0]=t,e[1]=n),n}function S(){return null}function C(e){let t=(0,_.c)(28),{nav:n}=e,{state:r,refetch:v}=s(n),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){l.dismiss()},t[0]=x):x=t[0];let S=x,C;t[1]===n.path?C=t[2]:(C=function(){window.location.hash=g(i(n.path)),S()},t[1]=n.path,t[2]=C);let w=C,T;t[3]===n?T=t[4]:(T=function(e){c.arm(o(n,e)),window.location.hash=n.kind===`folder`?g(e):h(e),S()},t[3]=n,t[4]=T);let E=T,D;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||S()},t[5]=D):D=t[5];let O=r.phase,k=r.phase===`resolved`?r.resolution.verdict:void 0,A;t[6]===n.path?A=t[7]:(A=b(n.path),t[6]=n.path,t[7]=A);let j;t[8]===A?j=t[9]:(j=(0,y.jsx)(p,{children:(0,y.jsx)(u,{className:`truncate`,children:A})}),t[8]=A,t[9]=j);let M=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`,N;t[10]!==n.path||t[11]!==E?(N=()=>E(n.path),t[10]=n.path,t[11]=E,t[12]=N):N=t[12];let P;t[13]!==w||t[14]!==n||t[15]!==E||t[16]!==v||t[17]!==r||t[18]!==N?(P=(0,y.jsx)(a,{nav:n,state:r,onBrowseFolder:w,onOpenRenamed:E,onEnableAutoSync:S,onSyncCompleted:v,onPullApplied:N}),t[13]=w,t[14]=n,t[15]=E,t[16]=v,t[17]=r,t[18]=N,t[19]=P):P=t[19];let F;t[20]!==P||t[21]!==M?(F=(0,y.jsx)(f,{className:M,children:P}),t[20]=P,t[21]=M,t[22]=F):F=t[22];let I;return t[23]!==r.phase||t[24]!==F||t[25]!==k||t[26]!==j?(I=(0,y.jsx)(m,{open:!0,onOpenChange:D,children:(0,y.jsxs)(d,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":O,"data-verdict":k,children:[j,F]})}),t[23]=r.phase,t[24]=F,t[25]=k,t[26]=j,t[27]=I):I=t[27],I}export{x as ShareReceiveMissDialog};
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{a as i,i as a,n as o,o as s,r as c}from"./pending-receive-nav-store-XWQOt6Fr.js";import{t as l}from"./miss-dialog-store-CsiJb9Ou.js";import{c as u,i as d,n as f,s as p,t as m}from"./dialog-BJEjKJjL.js";import{l as h,u as g}from"./doc-hash-BJkweiX9.js";var _=r(),v=e(n(),1),y=t();function b(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function x(){let e=(0,_.c)(2),t=(0,v.useSyncExternalStore)(l.subscribe,l.getSnapshot,S);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,y.jsx)(C,{nav:t},t.path),e[0]=t,e[1]=n),n}function S(){return null}function C(e){let t=(0,_.c)(28),{nav:n}=e,{state:r,refetch:v}=s(n),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){l.dismiss()},t[0]=x):x=t[0];let S=x,C;t[1]===n.path?C=t[2]:(C=function(){window.location.hash=g(i(n.path)),S()},t[1]=n.path,t[2]=C);let w=C,T;t[3]===n?T=t[4]:(T=function(e){c.arm(o(n,e)),window.location.hash=n.kind===`folder`?g(e):h(e),S()},t[3]=n,t[4]=T);let E=T,D;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||S()},t[5]=D):D=t[5];let O=r.phase,k=r.phase===`resolved`?r.resolution.verdict:void 0,A;t[6]===n.path?A=t[7]:(A=b(n.path),t[6]=n.path,t[7]=A);let j;t[8]===A?j=t[9]:(j=(0,y.jsx)(p,{children:(0,y.jsx)(u,{className:`truncate`,children:A})}),t[8]=A,t[9]=j);let M=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`,N;t[10]!==n.path||t[11]!==E?(N=()=>E(n.path),t[10]=n.path,t[11]=E,t[12]=N):N=t[12];let P;t[13]!==w||t[14]!==n||t[15]!==E||t[16]!==v||t[17]!==r||t[18]!==N?(P=(0,y.jsx)(a,{nav:n,state:r,onBrowseFolder:w,onOpenRenamed:E,onEnableAutoSync:S,onSyncCompleted:v,onPullApplied:N}),t[13]=w,t[14]=n,t[15]=E,t[16]=v,t[17]=r,t[18]=N,t[19]=P):P=t[19];let F;t[20]!==P||t[21]!==M?(F=(0,y.jsx)(f,{className:M,children:P}),t[20]=P,t[21]=M,t[22]=F):F=t[22];let I;return t[23]!==r.phase||t[24]!==F||t[25]!==k||t[26]!==j?(I=(0,y.jsx)(m,{open:!0,onOpenChange:D,children:(0,y.jsxs)(d,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":O,"data-verdict":k,children:[j,F]})}),t[23]=r.phase,t[24]=F,t[25]=k,t[26]=j,t[27]=I):I=t[27],I}export{x as ShareReceiveMissDialog};
@@ -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{n as o,t as s}from"./radio-group-G1GR05Rb.js";import{t as c}from"./button-DzgjsZzC.js";import{n as l}from"./dist-BGzUo_18.js";import{t as u}from"./ConfigSharingInfoTooltip-B2YLIcK1.js";import{t as d}from"./skeleton-BPb29aFG.js";import{t as f}from"./SettingsSectionHeader-XnGFBVeB.js";var p=a(),m=e(n(),1),h=t(),g=`settings-sharing-title`;function _(){let e=(0,p.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,h.jsx)(v,{}):(0,h.jsx)(y,{}),e[0]=n):n=e[0],n}function v(){let e=(0,p.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsx)(r,{id:`cs4mps`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,h.jsx)(`section`,{"aria-labelledby":g,className:`space-y-3`,"data-field":`section:sharing`,children:(0,h.jsx)(f,{titleId:g,title:t,scope:`project`,level:`block`,children:(0,h.jsx)(r,{id:`7YRrJ9`,components:{0:(0,h.jsx)(`code`,{}),1:(0,h.jsx)(`code`,{}),2:(0,h.jsx)(`code`,{})}})})}),e[1]=n):n=e[1],n}function y(){let e=(0,p.c)(29),{_:t}=i(),[n,a]=(0,m.useState)(null),[_,v]=(0,m.useState)(!1),[y,S]=(0,m.useState)(null),C;e[0]===t?C=e[1]:(C=async function(){let e=window.okDesktop?.sharing;if(e)try{a(await e.status())}catch(e){let n=e;l.error(n instanceof Error?n.message:t({id:`K0N7zS`})),a(x)}},e[0]=t,e[1]=C);let w=C,T;e[2]===w?T=e[3]:(T=()=>{w()},e[2]=w,e[3]=T);let E;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],e[4]=E):E=e[4],(0,m.useEffect)(T,E);let D;e[5]!==t||e[6]!==_||e[7]!==w||e[8]!==n?(D=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||_||n.mode===e)return;v(!0),S(null);let i=null,a=null;try{i=await r.setMode(e)}catch(e){a=e}if(v(!1),a!==null){l.error(a instanceof Error?a.message:t({id:`qZv5ZR`}));return}i!==null&&(i.kind===`refused-tracked`?(S({tracked:i.tracked,remediation:i.remediation}),l.error(t({id:`z2JdQ-`}),{duration:5e3})):i.kind===`no-exclude`?l.warning(i.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:i.reason}})):l.success(t(e===`local-only`?{id:`wdzBgi`}:{id:`k_pade`})),await w())},e[5]=t,e[6]=_,e[7]=w,e[8]=n,e[9]=D):D=e[9];let O=D;if(n===null){let t;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsx)(f,{titleId:g,title:(0,h.jsx)(r,{id:`cs4mps`}),scope:`project`,level:`block`}),e[10]=t):t=e[10];let n;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,h.jsxs)(`section`,{"aria-labelledby":g,className:`space-y-3`,"data-field":`section:sharing`,children:[t,(0,h.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,h.jsx)(`span`,{className:`sr-only`,children:(0,h.jsx)(r,{id:`eQn7nI`})}),(0,h.jsx)(d,{className:`h-24`})]})]}),e[11]=n):n=e[11],n}let k=n.mode===`no-git`,A;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,h.jsx)(r,{id:`cs4mps`}),e[12]=A):A=e[12];let j;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,h.jsx)(f,{titleId:g,title:A,scope:`project`,level:`block`,adornment:(0,h.jsx)(u,{}),children:(0,h.jsx)(r,{id:`N55YNr`})}),e[13]=j):j=e[13];let M;e[14]!==_||e[15]!==k||e[16]!==O||e[17]!==n.mode?(M=k?(0,h.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,h.jsx)(r,{id:`ju38ms`})}):(0,h.jsxs)(s,{value:n.mode,onValueChange:e=>void O(e),disabled:_,className:`gap-2`,"aria-labelledby":g,"data-testid":`settings-sharing-radiogroup`,children:[(0,h.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,h.jsx)(o,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,h.jsxs)(`span`,{children:[(0,h.jsx)(`span`,{className:`font-medium`,children:(0,h.jsx)(r,{id:`QjzFZj`})}),(0,h.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,h.jsx)(r,{id:`un-K1H`})})]})]}),(0,h.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,h.jsx)(o,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,h.jsxs)(`span`,{children:[(0,h.jsx)(`span`,{className:`font-medium`,children:(0,h.jsx)(r,{id:`0Gd0NU`})}),(0,h.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,h.jsx)(r,{id:`dJw2_7`})})]})]})]}),e[14]=_,e[15]=k,e[16]=O,e[17]=n.mode,e[18]=M):M=e[18];let N;e[19]===y?N=e[20]:(N=y===null?null:(0,h.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,h.jsx)(`p`,{className:`font-semibold`,children:(0,h.jsx)(r,{id:`ZscwQ0`})}),(0,h.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:y.remediation}),(0,h.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>S(null),children:(0,h.jsx)(r,{id:`1QfxQT`})})]}),e[19]=y,e[20]=N);let P;e[21]!==y||e[22]!==n.mode||e[23]!==n.trackedUpstream?(P=n.trackedUpstream.length>0&&n.mode!==`no-git`&&y===null?(0,h.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,h.jsx)(`p`,{className:`font-medium`,children:(0,h.jsx)(r,{id:`LhWYpm`})}),(0,h.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(b)}),(0,h.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,h.jsx)(r,{id:`1XSMhZ`,components:{0:(0,h.jsx)(`code`,{}),1:(0,h.jsx)(`code`,{})}})})]}):null,e[21]=y,e[22]=n.mode,e[23]=n.trackedUpstream,e[24]=P):P=e[24];let F;return e[25]!==M||e[26]!==N||e[27]!==P?(F=(0,h.jsxs)(`section`,{"aria-labelledby":g,className:`space-y-4`,"data-testid":`settings-sharing`,"data-field":`section:sharing`,children:[j,M,N,P]}),e[25]=M,e[26]=N,e[27]=P,e[28]=F):F=e[28],F}function b(e){return(0,h.jsx)(`li`,{children:e},e)}function x(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}export{_ as SharingSection};
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{n as o,t as s}from"./radio-group-G1GR05Rb.js";import{t as c}from"./button-DzgjsZzC.js";import{n as l}from"./dist-BGzUo_18.js";import{t as u}from"./ConfigSharingInfoTooltip-B2YLIcK1.js";import{t as d}from"./skeleton-BPb29aFG.js";import{t as f}from"./SettingsSectionHeader-XnGFBVeB.js";var p=a(),m=e(n(),1),h=t(),g=`settings-sharing-title`;function _(){let e=(0,p.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,h.jsx)(v,{}):(0,h.jsx)(y,{}),e[0]=n):n=e[0],n}function v(){let e=(0,p.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsx)(r,{id:`cs4mps`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,h.jsx)(`section`,{"aria-labelledby":g,className:`space-y-3`,"data-field":`section:sharing`,children:(0,h.jsx)(f,{titleId:g,title:t,scope:`project`,level:`block`,children:(0,h.jsx)(r,{id:`7YRrJ9`,components:{0:(0,h.jsx)(`code`,{}),1:(0,h.jsx)(`code`,{}),2:(0,h.jsx)(`code`,{})}})})}),e[1]=n):n=e[1],n}function y(){let e=(0,p.c)(29),{_:t}=i(),[n,a]=(0,m.useState)(null),[_,v]=(0,m.useState)(!1),[y,S]=(0,m.useState)(null),C;e[0]===t?C=e[1]:(C=async function(){let e=window.okDesktop?.sharing;if(e)try{a(await e.status())}catch(e){let n=e;l.error(n instanceof Error?n.message:t({id:`K0N7zS`})),a(x)}},e[0]=t,e[1]=C);let w=C,T;e[2]===w?T=e[3]:(T=()=>{w()},e[2]=w,e[3]=T);let E;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],e[4]=E):E=e[4],(0,m.useEffect)(T,E);let D;e[5]!==t||e[6]!==_||e[7]!==w||e[8]!==n?(D=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||_||n.mode===e)return;v(!0),S(null);let i=null,a=null;try{i=await r.setMode(e)}catch(e){a=e}if(v(!1),a!==null){l.error(a instanceof Error?a.message:t({id:`qZv5ZR`}));return}i!==null&&(i.kind===`refused-tracked`?(S({tracked:i.tracked,remediation:i.remediation}),l.error(t({id:`z2JdQ-`}),{duration:5e3})):i.kind===`no-exclude`?l.warning(i.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:i.reason}})):l.success(t(e===`local-only`?{id:`wdzBgi`}:{id:`k_pade`})),await w())},e[5]=t,e[6]=_,e[7]=w,e[8]=n,e[9]=D):D=e[9];let O=D;if(n===null){let t;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsx)(f,{titleId:g,title:(0,h.jsx)(r,{id:`cs4mps`}),scope:`project`,level:`block`}),e[10]=t):t=e[10];let n;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,h.jsxs)(`section`,{"aria-labelledby":g,className:`space-y-3`,"data-field":`section:sharing`,children:[t,(0,h.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,h.jsx)(`span`,{className:`sr-only`,children:(0,h.jsx)(r,{id:`eQn7nI`})}),(0,h.jsx)(d,{className:`h-24`})]})]}),e[11]=n):n=e[11],n}let k=n.mode===`no-git`,A;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,h.jsx)(r,{id:`cs4mps`}),e[12]=A):A=e[12];let j;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,h.jsx)(f,{titleId:g,title:A,scope:`project`,level:`block`,adornment:(0,h.jsx)(u,{}),children:(0,h.jsx)(r,{id:`50gx7V`})}),e[13]=j):j=e[13];let M;e[14]!==_||e[15]!==k||e[16]!==O||e[17]!==n.mode?(M=k?(0,h.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,h.jsx)(r,{id:`ju38ms`})}):(0,h.jsxs)(s,{value:n.mode,onValueChange:e=>void O(e),disabled:_,className:`gap-2`,"aria-labelledby":g,"data-testid":`settings-sharing-radiogroup`,children:[(0,h.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,h.jsx)(o,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,h.jsxs)(`span`,{children:[(0,h.jsx)(`span`,{className:`font-medium`,children:(0,h.jsx)(r,{id:`QjzFZj`})}),(0,h.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,h.jsx)(r,{id:`un-K1H`})})]})]}),(0,h.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,h.jsx)(o,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,h.jsxs)(`span`,{children:[(0,h.jsx)(`span`,{className:`font-medium`,children:(0,h.jsx)(r,{id:`0Gd0NU`})}),(0,h.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,h.jsx)(r,{id:`dJw2_7`})})]})]})]}),e[14]=_,e[15]=k,e[16]=O,e[17]=n.mode,e[18]=M):M=e[18];let N;e[19]===y?N=e[20]:(N=y===null?null:(0,h.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,h.jsx)(`p`,{className:`font-semibold`,children:(0,h.jsx)(r,{id:`ZscwQ0`})}),(0,h.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:y.remediation}),(0,h.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>S(null),children:(0,h.jsx)(r,{id:`1QfxQT`})})]}),e[19]=y,e[20]=N);let P;e[21]!==y||e[22]!==n.mode||e[23]!==n.trackedUpstream?(P=n.trackedUpstream.length>0&&n.mode!==`no-git`&&y===null?(0,h.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,h.jsx)(`p`,{className:`font-medium`,children:(0,h.jsx)(r,{id:`LhWYpm`})}),(0,h.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(b)}),(0,h.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,h.jsx)(r,{id:`1XSMhZ`,components:{0:(0,h.jsx)(`code`,{}),1:(0,h.jsx)(`code`,{})}})})]}):null,e[21]=y,e[22]=n.mode,e[23]=n.trackedUpstream,e[24]=P):P=e[24];let F;return e[25]!==M||e[26]!==N||e[27]!==P?(F=(0,h.jsxs)(`section`,{"aria-labelledby":g,className:`space-y-4`,"data-testid":`settings-sharing`,"data-field":`section:sharing`,children:[j,M,N,P]}),e[25]=M,e[26]=N,e[27]=P,e[28]=F):F=e[28],F}function b(e){return(0,h.jsx)(`li`,{children:e},e)}function x(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}export{_ as SharingSection};
@@ -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{a as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./select-Bu4Wm3Rf.js";import{t as m}from"./button-DzgjsZzC.js";import{l as h,n as g,r as _,t as v}from"./AddPropertiesButton-Dh6Fm4Po.js";import{a as y,h as b,r as x,t as S,u as C}from"./dropdown-menu-DtLu9NwU.js";import{n as w}from"./file-plus-DKxOZh2k.js";import{t as T}from"./list-plus-CYMJBvrm.js";import{p as E,t as D}from"./skill-scope-qLtpopQG.js";var O=a(),k=t();function A(e){let t=(0,O.c)(21),{value:n,onRequestMove:a,disabled:m,triggerClassName:h}=e,{_:g}=i(),_=E(),v;t[0]===a?v=t[1]:(v=e=>a(e),t[0]=a,t[1]=v);let y;t[2]===g?y=t[3]:(y=g({id:`oCHfGC`}),t[2]=g,t[3]=y);let b;t[4]===h?b=t[5]:(b=o(`w-auto gap-1 text-xs font-mono uppercase`,h),t[4]=h,t[5]=b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,k.jsx)(f,{}),t[6]=x):x=t[6];let S;t[7]!==y||t[8]!==b?(S=(0,k.jsx)(u,{size:`sm`,"aria-label":y,"data-testid":`skill-level-select`,className:b,children:x}),t[7]=y,t[8]=b,t[9]=S):S=t[9];let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,k.jsx)(s,{children:(0,k.jsx)(r,{id:`oCHfGC`})}),t[10]=C):C=t[10];let w;t[11]===_?w=t[12]:(w=D.map(e=>(0,k.jsx)(c,{value:e,children:_[e]},e)),t[11]=_,t[12]=w);let T;t[13]===w?T=t[14]:(T=(0,k.jsx)(l,{align:`end`,children:(0,k.jsxs)(d,{children:[C,w]})}),t[13]=w,t[14]=T);let A;return t[15]!==m||t[16]!==v||t[17]!==S||t[18]!==T||t[19]!==n?(A=(0,k.jsxs)(p,{value:n,onValueChange:v,disabled:m,children:[S,T]}),t[15]=m,t[16]=v,t[17]=S,t[18]=T,t[19]=n,t[20]=A):A=t[20],A}var j=e(n(),1);function M(e){let t=(0,O.c)(12),{scope:n,name:r}=e,[i,a]=(0,j.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,k.jsx)(h,{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 N(e){let t=(0,O.c)(41),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:s,problemCount:c,problemMessages:l}=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 f=M(d),p;t[3]!==f.requestMove||t[4]!==n?(p=(0,k.jsx)(A,{value:n,onRequestMove:f.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=f.requestMove,t[4]=n,t[5]=p):p=t[5];let h;t[6]!==a||t[7]!==n?(h=(0,k.jsx)(_,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=h):h=t[8];let E;t[9]!==p||t[10]!==h?(E=(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,h]}),t[9]=p,t[10]=h,t[11]=E):E=t[11];let D;t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==o?(D=o?(0,k.jsx)(v,{onAddProperty:s,problemCount:c,problemMessages:l,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=s,t[13]=c,t[14]=l,t[15]=o,t[16]=D):D=t[16];let j;t[17]===u?j=t[18]:(j=u({id:`Yzs3QX`}),t[17]=u,t[18]=j);let N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,k.jsx)(w,{className:`size-4`,"aria-hidden":!0}),t[19]=N):N=t[19];let P;t[20]===j?P=t[21]:(P=(0,k.jsx)(b,{asChild:!0,children:(0,k.jsx)(m,{variant:`ghost`,size:`icon`,"aria-label":j,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:N})}),t[20]=j,t[21]=P);let F;t[22]===f?F=t[23]:(F=e=>f.requestMove(e),t[22]=f,t[23]=F);let I;t[24]!==n||t[25]!==F?(I=(0,k.jsx)(g,{value:n,onSelect:F}),t[24]=n,t[25]=F,t[26]=I):I=t[26];let L;t[27]!==s||t[28]!==o?(L=o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(C,{}),(0,k.jsxs)(y,{onSelect:s,children:[(0,k.jsx)(T,{}),(0,k.jsx)(r,{id:`81H_23`})]})]}):null,t[27]=s,t[28]=o,t[29]=L):L=t[29];let R;t[30]!==I||t[31]!==L?(R=(0,k.jsxs)(x,{align:`end`,className:`min-w-44`,children:[I,L]}),t[30]=I,t[31]=L,t[32]=R):R=t[32];let z;t[33]!==R||t[34]!==P?(z=(0,k.jsxs)(S,{children:[P,R]}),t[33]=R,t[34]=P,t[35]=z):z=t[35];let B;return t[36]!==f.dialog||t[37]!==z||t[38]!==E||t[39]!==D?(B=(0,k.jsxs)(k.Fragment,{children:[E,D,z,f.dialog]}),t[36]=f.dialog,t[37]=z,t[38]=E,t[39]=D,t[40]=B):B=t[40],B}export{N as SkillToolbarControls};
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{a as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./select-Bu4Wm3Rf.js";import{t as m}from"./button-DzgjsZzC.js";import{l as h,n as g,r as _,t as v}from"./AddPropertiesButton-DgNbHA4e.js";import{a as y,h as b,r as x,t as S,u as C}from"./dropdown-menu-DtLu9NwU.js";import{n as w}from"./file-plus-DKxOZh2k.js";import{t as T}from"./list-plus-CYMJBvrm.js";import{p as E,t as D}from"./skill-scope-qLtpopQG.js";var O=a(),k=t();function A(e){let t=(0,O.c)(21),{value:n,onRequestMove:a,disabled:m,triggerClassName:h}=e,{_:g}=i(),_=E(),v;t[0]===a?v=t[1]:(v=e=>a(e),t[0]=a,t[1]=v);let y;t[2]===g?y=t[3]:(y=g({id:`oCHfGC`}),t[2]=g,t[3]=y);let b;t[4]===h?b=t[5]:(b=o(`w-auto gap-1 text-xs font-mono uppercase`,h),t[4]=h,t[5]=b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,k.jsx)(f,{}),t[6]=x):x=t[6];let S;t[7]!==y||t[8]!==b?(S=(0,k.jsx)(u,{size:`sm`,"aria-label":y,"data-testid":`skill-level-select`,className:b,children:x}),t[7]=y,t[8]=b,t[9]=S):S=t[9];let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,k.jsx)(s,{children:(0,k.jsx)(r,{id:`oCHfGC`})}),t[10]=C):C=t[10];let w;t[11]===_?w=t[12]:(w=D.map(e=>(0,k.jsx)(c,{value:e,children:_[e]},e)),t[11]=_,t[12]=w);let T;t[13]===w?T=t[14]:(T=(0,k.jsx)(l,{align:`end`,children:(0,k.jsxs)(d,{children:[C,w]})}),t[13]=w,t[14]=T);let A;return t[15]!==m||t[16]!==v||t[17]!==S||t[18]!==T||t[19]!==n?(A=(0,k.jsxs)(p,{value:n,onValueChange:v,disabled:m,children:[S,T]}),t[15]=m,t[16]=v,t[17]=S,t[18]=T,t[19]=n,t[20]=A):A=t[20],A}var j=e(n(),1);function M(e){let t=(0,O.c)(12),{scope:n,name:r}=e,[i,a]=(0,j.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,k.jsx)(h,{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 N(e){let t=(0,O.c)(41),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:s,problemCount:c,problemMessages:l}=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 f=M(d),p;t[3]!==f.requestMove||t[4]!==n?(p=(0,k.jsx)(A,{value:n,onRequestMove:f.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=f.requestMove,t[4]=n,t[5]=p):p=t[5];let h;t[6]!==a||t[7]!==n?(h=(0,k.jsx)(_,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=h):h=t[8];let E;t[9]!==p||t[10]!==h?(E=(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,h]}),t[9]=p,t[10]=h,t[11]=E):E=t[11];let D;t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==o?(D=o?(0,k.jsx)(v,{onAddProperty:s,problemCount:c,problemMessages:l,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=s,t[13]=c,t[14]=l,t[15]=o,t[16]=D):D=t[16];let j;t[17]===u?j=t[18]:(j=u({id:`Yzs3QX`}),t[17]=u,t[18]=j);let N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,k.jsx)(w,{className:`size-4`,"aria-hidden":!0}),t[19]=N):N=t[19];let P;t[20]===j?P=t[21]:(P=(0,k.jsx)(b,{asChild:!0,children:(0,k.jsx)(m,{variant:`ghost`,size:`icon`,"aria-label":j,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:N})}),t[20]=j,t[21]=P);let F;t[22]===f?F=t[23]:(F=e=>f.requestMove(e),t[22]=f,t[23]=F);let I;t[24]!==n||t[25]!==F?(I=(0,k.jsx)(g,{value:n,onSelect:F}),t[24]=n,t[25]=F,t[26]=I):I=t[26];let L;t[27]!==s||t[28]!==o?(L=o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(C,{}),(0,k.jsxs)(y,{onSelect:s,children:[(0,k.jsx)(T,{}),(0,k.jsx)(r,{id:`81H_23`})]})]}):null,t[27]=s,t[28]=o,t[29]=L):L=t[29];let R;t[30]!==I||t[31]!==L?(R=(0,k.jsxs)(x,{align:`end`,className:`min-w-44`,children:[I,L]}),t[30]=I,t[31]=L,t[32]=R):R=t[32];let z;t[33]!==R||t[34]!==P?(z=(0,k.jsxs)(S,{children:[P,R]}),t[33]=R,t[34]=P,t[35]=z):z=t[35];let B;return t[36]!==f.dialog||t[37]!==z||t[38]!==E||t[39]!==D?(B=(0,k.jsxs)(k.Fragment,{children:[E,D,z,f.dialog]}),t[36]=f.dialog,t[37]=z,t[38]=E,t[39]=D,t[40]=B):B=t[40],B}export{N as SkillToolbarControls};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{At as n,Gt as r,Ln as i,Mn as a,Z as o,_t as s,bt as c,dn as l,kt as u,qt as ee,un as te,wt as d,yt as f}from"./DocumentContext-BXjH29Cs.js";import{t as p}from"./react-f2sANaYj.js";import{n as m}from"./dist-PQ5KMVDh.js";import{t as h}from"./compiler-runtime-BfE3aGVn.js";import{ht as g}from"./schemas-api-JUnildTL.js";import{i as _}from"./use-apply-config-theme-CYFG76sS.js";import{H as ne,I as v,L as re,N as ie,T as ae,b as y,c as oe,n as se,o as b,r as ce,t as le,v as x,w as ue,z as de}from"./typing-burst-detector-7wfQCn5k.js";import{Gn as fe,S,U as C,a as pe,at as w,i as me,o as he,qn as T,st as E}from"./CodeMirrorPropInput-IrOBMsvE.js";import{a as D,i as O}from"./constants-skills-BLHVRW90.js";import{t as k}from"./diagnostic-breadcrumb-Cr0C15nJ.js";import{n as A}from"./perf-DZJpLc5j.js";import{f as ge}from"./config-provider-kr9NPtRs.js";import{$ as j,At as M,Ct as N,E as P,J as F,K as I,Mt as L,N as R,Nt as z,Tt as _e,X as B,at as V,b as H,et as U,ft as ve,g as W,l as G,lt as ye,ot as K,pt as q,st as J,tt as Y,ut as X,v as be,wt as Z}from"./dist-D2SphF3p.js";import{i as xe,t as Se}from"./dist-DseqKdAU.js";import{i as Ce,n as we,o as Te,r as Ee}from"./dist-DKYEqMZn.js";import{o as De,r as Oe}from"./selection-context-5xOiHak2.js";import{C as ke,D as Ae,t as je}from"./markdown-lint-KW1fm5Bw.js";import{l as Me}from"./lint-config-client-DOb2qnaH.js";import{a as Ne,i as Pe,n as Fe,o as Ie,r as Le,s as Re,t as ze}from"./dist-CzJghaXH.js";import{n as Be,t as Ve}from"./src-Cssj7pDE.js";var Q=e(p(),1),He=h();function Ue(){let e=u();return e===null?null:new Set(e.keys())}function We(e,t,n){let r=[],i=R(e);if(n!=null){let a=[];for(let{from:e,to:n}of t)i.iterate({from:e,to:n,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return a.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>a.some(n=>e>=n.from&&t<=n.to);for(let{from:i,to:a}of t){let t=e.doc.sliceString(i,a);O.lastIndex=0;for(let e=O.exec(t);e!==null;e=O.exec(t)){let t=e[2];if(!D(t))continue;let a=i+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||r.push(I.mark({class:n.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:a,to:o}of t)i.iterate({from:a,to:o,enter(t){if(t.name!==`InlineCode`)return;let i=e.doc.sliceString(t.from,t.to),a=i.length-i.replace(/^`+/,``).length,o=i.length-i.replace(/`+$/,``).length,c=i.slice(a,i.length-o),l=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(c)?.[1];if(l!==void 0&&D(l)&&n!=null)return r.push(I.mark({class:n.has(l)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":l}}).range(t.from+a,t.to-o)),!1;let u=s.exec(c);if(u)return r.push(I.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":u[1]}}).range(t.from+a,t.to-o)),!1}});return r.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),I.set(r)}function Ge(e){let t=c(e);return t===null?[]:[B.fromClass(class{decorations;constructor(e){this.decorations=We(e.state,e.visibleRanges,Ue())}update(e){(e.docChanged||e.viewportChanged||R(e.startState)!==R(e.state))&&(this.decorations=We(e.view.state,e.view.visibleRanges,Ue()))}},{decorations:e=>e.decorations}),F.domEventHandlers({mousedown(r){let i=r.target?.closest?.(`[data-skill-ref]`),a=i instanceof HTMLElement?i.dataset.skillRef:void 0;if(a!==void 0){r.preventDefault();let e=u()?.get(a);return e===void 0?d():window.location.hash=n(a,e),!0}let o=r.target?.closest?.(`.cm-skill-path-link`),s=o instanceof HTMLElement?o.dataset.skillPath:void 0;return s===void 0?!1:(r.preventDefault(),window.location.hash=f(t,e,s),!0)}})]}var Ke=I.line({attributes:{dir:`auto`}});function qe(e){let t=new M;for(let n of e.visibleRanges)for(let r=n.from;r<=n.to;){let n=e.state.doc.lineAt(r);t.add(n.from,n.from,Ke),r=n.to+1}return t.finish()}var Je=B.fromClass(class{decorations;constructor(e){this.decorations=qe(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=qe(e.view))}},{decorations:e=>e.decorations}),Ye=[F.perLineTextDirection.of(!0),Je],Xe=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Ze=`cm-lint-local-target`;function Qe(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function $e(e,t){let n=W(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Xe.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function et(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function tt(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=$e(e,Qe(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:et(i.severity),message:y(i),source:`${i.source}/${i.code}`,markClass:Ze})}return r}var nt=L.define();function rt(e){let t={findings:[]};return[Pe(e=>w()?tt(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(nt)))}),B.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:nt.of(null)}),ze(n)},i=x(e,e=>{e.status===`loaded`&&r(e.findings)}),a=E(()=>r(t.findings));return{destroy(){i(),a()}}})]}function it(e,t){return e.enabled?[Fe(),Pe(async n=>at(n.state.doc,await ke(n.state.doc.toString(),e,t)),{delay:600})]:[]}function $(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function at(e,t){let n=[];for(let r of t){let t=$(e,r.range.start),i=$(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=ot(r);o&&(a.actions=[o]),n.push(a)}return n}function ot(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:$(n,e.range.start),to:$(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var st=[X(),K(),J(),be(),U(),Y(),_e.allowMultipleSelections.of(!0),P(),G(),Ee(),we(),q(),j(),V(),Ne(),ye.of([...Ce,...Se,...Re,...H,...Te,...Le])],ct=I.mark({class:`cm-link-ref-broken`}),lt=/^\s{0,3}\[([^\]]+)\]:\s/,ut=/\[([^\]]*)\]\[([^\]]*)\]/g,dt=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function ft(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function pt(e){let t=[];return R(e).iterate({enter(e){if(dt.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function mt(e){let t=new Set,n=[],r=e.doc,i=pt(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(ft(n.from,i))continue;let a=lt.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!ft(t.from,i)&&!lt.test(t.text))for(ut.lastIndex=0;;){let e=ut.exec(t.text);if(!e)break;let r=t.from+e.index;if(ft(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(ct.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),I.set(a)}var ht=z.define({create(e){return mt(e)},update(e,t){return t.docChanged?mt(t.state):e},provide:e=>F.decorations.from(e)}),gt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,_t=I.mark({class:`cm-del`}),vt=I.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),yt=I.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function bt(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function xt(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!g.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(g.test(r.text))return{from:t.from,to:r.to}}return null}function St(e,t){let n=[],r=R(e),i=xt(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(_t.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=gt.exec(r.text),a=i?i[1].length:2,o=I.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=bt(r.text),a=I.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(vt.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(yt.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(yt.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),I.set(n)}var Ct=class{decorations;constructor(e){this.decorations=St(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||R(e.startState)!==R(e.state))&&(this.decorations=St(e.view.state,e.view.visibleRanges))}},wt=B.fromClass(Ct,{decorations:e=>e.decorations});function Tt(){return[wt,ht]}function Et(e,t){let n=e.trackedOrigins;return n.has(t)?!0:t?n.has(t.constructor):!1}function Dt(e){let{docName:t,ytext:n,undoManager:r}=e,i=!1,a=!1,o=!1,s=(e,t)=>{i||Et(r,t.origin)||(a=!0)};return n.observe(s),{setSourceModeActive(e){if(!o&&e!==i){if(!e){i=!1,r.stopCapturing();return}a&&(r.clear(),A(`ok/source-undo/flip-clear`,{docName:t})),a=!1,i=!0}},destroy(){o||(o=!0,n.unobserve(s))}}}var Ot=new WeakMap;function kt(e){return B.define(t=>{let n=Dt(e);return Ot.set(t,n),{destroy(){n.destroy()}}})}function At(e,t){let n=Ot.get(e);if(!n)throw Error(`createSourceUndoFlipExtension is not installed on this EditorView`);n.setSourceModeActive(t)}var jt=t(),Mt=L.define();function Nt(e,t){try{At(t.view,!1)}finally{try{l(t)}finally{T(e,t.view)}}}function Pt(e,t,n){let r=b(e.state.doc),a=r[t.index],o={docName:n,mode:`source`,index:t.index,sourceHeadingCount:r.length};if(!a){k(se,{...o,outcome:`no-target`});return}let s=i(n,`outline`,()=>{e.dispatch({selection:Z.cursor(a.from),effects:F.scrollIntoView(a.from,{y:`start`})}),e.focus()});k(se,{...o,outcome:s?`scrolled`:`declined`,targetLine:e.state.doc.lineAt(a.from).number})}function Ft(e,t,n,r){requestAnimationFrame(()=>{if(!n())return;let a=e.state.doc,o=Math.min(t.offset,a.length);i(r,`raw-mdx`,()=>{e.dispatch({selection:Z.cursor(o),effects:F.scrollIntoView(o,{y:`center`})}),e.focus()})})}function It(e,t,n){let r=e.state.doc,a=Math.min(Math.max(t.line,1),r.lines),o=r.line(a),s=Math.min(o.from+Math.max(0,t.column-1),o.to);return i(n,`problems-row`,()=>{e.dispatch({selection:Z.cursor(s),effects:F.scrollIntoView(s,{y:`start`})}),e.focus()})}function Lt(e){let t=(0,He.c)(51),{docName:n,ytext:i,provider:s,placeholder:c,isSourceModeActive:l}=e,u=(0,Q.useRef)(null),d=(0,Q.useRef)(null),[f,p]=(0,Q.useState)(null);if(f)throw f;let{resolvedTheme:h}=m(),{merged:g}=_(),y=(0,Q.useRef)(l),b=g?.editor?.wordWrap??!0,{data:x}=Me(n),S;t[0]!==x?.effective||t[1]!==g?(S=x?.effective??(g?.contentRules?Ae(g.contentRules):je),t[0]=x?.effective,t[1]=g,t[2]=S):S=t[2];let C=S,w;t[3]===C?w=t[4]:(w=JSON.stringify(C),t[3]=C,t[4]=w);let T=w,E=(0,Q.useRef)(null),D;t[5]!==n||t[6]!==l||t[7]!==C||t[8]!==c||t[9]!==s||t[10]!==h||t[11]!==b||t[12]!==i?(D=()=>{let e=u.current;if(!e)return;let t=s.configuration.name??``,f,m=zt;try{f=te({docName:t,container:e,sizeStats:{viewCount:0,bytes:i.length},factory:e=>{let l=null,u=new ge(i);try{let te=o({ydoc:s.document,ytext:i,docName:t}),d=new N,f=new N,p=new N,g=new N,_=new F({state:_e.create({doc:i.toString(),extensions:[st,Ye,Ie({scrollToMatch:e=>a(t,`find-match`)?F.scrollIntoView(e,{y:`start`}):Mt.of(null)}),ye.of([xe]),Ve(i,s.awareness,{undoManager:u}),ye.of(Be),kt({docName:t,ytext:i,undoManager:u}),...me({themeCompartment:d,resolvedTheme:h,ydoc:s.document,wordWrapCompartment:f,wordWrap:b,currentDocName:t}),Tt(),Ge(t),ne(),g.of(it(C,n)),rt(n),te,F.updateListener.of(e=>{r(e)&&ee(t)}),F.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(l!==null&&clearTimeout(l),l=setTimeout(()=>{l=null,ue(t,`source`,ae(e.view)),Oe(t,`source`,De(e.view,t))},120))}),p.of(ve(c??``)),F.theme({"&":{height:`100%`}}),F.scrollMargins.of(Rt)]}),parent:e});ue(t,`source`,ae(_)),Oe(t,`source`,De(_,t));let v=_.contentDOM;return v.addEventListener(`keydown`,m),v.addEventListener(`paste`,m),v.addEventListener(`drop`,m),v.addEventListener(`cut`,m),{view:_,ydoc:s.document,ytext:i,provider:s,undoManager:u,themeCompartment:d,wordWrapCompartment:f,placeholderCompartment:p,lintCompartment:g}}catch(e){let t=e;throw u.destroy(),t}}}),E.current=f,d.current=f.view,At(f.view,l),fe(n,f.view,`sourceEditor`),le()&&f.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),E.current=null,d.current=null,p(t instanceof Error?t:Error(String(t)))}return()=>{let e=E.current;E.current=null,d.current=null,e&&Nt(n,e)}},t[5]=n,t[6]=l,t[7]=C,t[8]=c,t[9]=s,t[10]=h,t[11]=b,t[12]=i,t[13]=D):D=t[13];let O;t[14]!==s||t[15]!==i?(O=[i,s],t[14]=s,t[15]=i,t[16]=O):O=t[16],(0,Q.useEffect)(D,O);let A,j;t[17]===l?(A=t[18],j=t[19]):(A=()=>{y.current=l;let e=d.current;e&&At(e,l)},j=[l],t[17]=l,t[18]=A,t[19]=j),(0,Q.useEffect)(A,j);let M,P;t[20]===n?(M=t[21],P=t[22]):(M=()=>{},P=[n],t[20]=n,t[21]=M,t[22]=P),(0,Q.useEffect)(M,P);let I,L;t[23]===h?(I=t[24],L=t[25]):(L=()=>{let e=E.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(h===`dark`?pe:he)})},I=[h],t[23]=h,t[24]=I,t[25]=L),(0,Q.useEffect)(L,I);let R,z;t[26]===b?(R=t[27],z=t[28]):(R=()=>{let e=E.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(b?F.lineWrapping:[])})},z=[b],t[26]=b,t[27]=R,t[28]=z),(0,Q.useEffect)(R,z);let B,V;t[29]===c?(B=t[30],V=t[31]):(B=()=>{let e=E.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ve(c??``))})},V=[c],t[29]=c,t[30]=B,t[31]=V),(0,Q.useEffect)(B,V);let H;t[32]!==n||t[33]!==C?(H=()=>{let e=E.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(it(C,n))})},t[32]=n,t[33]=C,t[34]=H):H=t[34];let U;t[35]===T?U=t[36]:(U=[T],t[35]=T,t[36]=U),(0,Q.useEffect)(H,U);let W,G;t[37]!==n||t[38]!==l?(W=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||t.mode!==`source`||!l)return;let r=d.current;if(!r){k(se,{docName:n,mode:`source`,index:t.index,outcome:`no-view`});return}Pt(r,t,n),v(n)};return window.addEventListener(ce,e),()=>window.removeEventListener(ce,e)},G=[n,l],t[37]=n,t[38]=l,t[39]=W,t[40]=G):(W=t[39],G=t[40]),(0,Q.useEffect)(W,G);let K,q;t[41]!==n||t[42]!==l?(K=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||!l)return;let r=d.current;r&&It(r,t,n)&&v(n)};return window.addEventListener(oe,e),()=>window.removeEventListener(oe,e)},q=[n,l],t[41]=n,t[42]=l,t[43]=K,t[44]=q):(K=t[43],q=t[44]),(0,Q.useEffect)(K,q);let J,Y;t[45]!==n||t[46]!==l||t[47]!==s?(J=()=>{if(!l)return;let e=d.current;if(!e)return;let t=de(n);if(!t)return;if(t.kind!==`selection-offset`){re(n),t.kind===`outline`?Pt(e,t.detail,n):t.kind===`lint`?It(e,t.detail,n):t.kind===`raw-mdx`&&Ft(e,t.detail,()=>y.current,n);return}let r=!1,i=null;return queueMicrotask(()=>{if(r)return;let t=de(n);t?.kind===`selection-offset`&&(i=ie({view:e,docName:n,navigation:t,ydoc:s.document,transition:{from:`wysiwyg`,to:`source`}}),i&&re(n))}),()=>{r=!0,i?.cancel(`mode-flip`)}},Y=[n,l,s],t[45]=n,t[46]=l,t[47]=s,t[48]=J,t[49]=Y):(J=t[48],Y=t[49]),(0,Q.useEffect)(J,Y);let X;return t[50]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,jt.jsx)(`div`,{ref:u,className:`source-editor h-full pb-3`}),t[50]=X):X=t[50],X}function Rt(){return{top:S()}}function zt(){return C()}export{Lt as SourceEditor,Ft as applyRawMdxNavigation};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{At as n,Gt as r,Ln as i,Mn as a,Z as o,_t as s,bt as c,dn as l,kt as u,qt as ee,un as te,wt as d,yt as f}from"./DocumentContext-BU6384lO.js";import{t as p}from"./react-f2sANaYj.js";import{n as m}from"./dist-PQ5KMVDh.js";import{t as h}from"./compiler-runtime-BfE3aGVn.js";import{ht as g}from"./schemas-api-JUnildTL.js";import{i as _}from"./use-apply-config-theme-CYFG76sS.js";import{H as ne,I as v,L as re,N as ie,T as ae,b as y,c as oe,n as se,o as b,r as ce,t as le,v as x,w as ue,z as de}from"./typing-burst-detector-DsqIPsLN.js";import{Gn as fe,S,U as C,a as pe,at as w,i as me,o as he,qn as T,st as E}from"./CodeMirrorPropInput-I8b5kl2c.js";import{a as D,i as O}from"./constants-skills-BLHVRW90.js";import{t as k}from"./diagnostic-breadcrumb-Cr0C15nJ.js";import{n as A}from"./perf-DZJpLc5j.js";import{f as ge}from"./config-provider-Cu_pQedM.js";import{$ as j,At as M,Ct as N,E as P,J as F,K as I,Mt as L,N as R,Nt as z,Tt as _e,X as B,at as V,b as H,et as U,ft as ve,g as W,l as G,lt as ye,ot as K,pt as q,st as J,tt as Y,ut as X,v as be,wt as Z}from"./dist-D2SphF3p.js";import{i as xe,t as Se}from"./dist-DseqKdAU.js";import{i as Ce,n as we,o as Te,r as Ee}from"./dist-DKYEqMZn.js";import{o as De,r as Oe}from"./selection-context-Cuv7GyoN.js";import{C as ke,D as Ae,t as je}from"./markdown-lint-DvPODigW.js";import{l as Me}from"./lint-config-client-t7VsdRdr.js";import{a as Ne,i as Pe,n as Fe,o as Ie,r as Le,s as Re,t as ze}from"./dist-CzJghaXH.js";import{n as Be,t as Ve}from"./src-B2A6Sl6H.js";var Q=e(p(),1),He=h();function Ue(){let e=u();return e===null?null:new Set(e.keys())}function We(e,t,n){let r=[],i=R(e);if(n!=null){let a=[];for(let{from:e,to:n}of t)i.iterate({from:e,to:n,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return a.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>a.some(n=>e>=n.from&&t<=n.to);for(let{from:i,to:a}of t){let t=e.doc.sliceString(i,a);O.lastIndex=0;for(let e=O.exec(t);e!==null;e=O.exec(t)){let t=e[2];if(!D(t))continue;let a=i+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||r.push(I.mark({class:n.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:a,to:o}of t)i.iterate({from:a,to:o,enter(t){if(t.name!==`InlineCode`)return;let i=e.doc.sliceString(t.from,t.to),a=i.length-i.replace(/^`+/,``).length,o=i.length-i.replace(/`+$/,``).length,c=i.slice(a,i.length-o),l=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(c)?.[1];if(l!==void 0&&D(l)&&n!=null)return r.push(I.mark({class:n.has(l)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":l}}).range(t.from+a,t.to-o)),!1;let u=s.exec(c);if(u)return r.push(I.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":u[1]}}).range(t.from+a,t.to-o)),!1}});return r.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),I.set(r)}function Ge(e){let t=c(e);return t===null?[]:[B.fromClass(class{decorations;constructor(e){this.decorations=We(e.state,e.visibleRanges,Ue())}update(e){(e.docChanged||e.viewportChanged||R(e.startState)!==R(e.state))&&(this.decorations=We(e.view.state,e.view.visibleRanges,Ue()))}},{decorations:e=>e.decorations}),F.domEventHandlers({mousedown(r){let i=r.target?.closest?.(`[data-skill-ref]`),a=i instanceof HTMLElement?i.dataset.skillRef:void 0;if(a!==void 0){r.preventDefault();let e=u()?.get(a);return e===void 0?d():window.location.hash=n(a,e),!0}let o=r.target?.closest?.(`.cm-skill-path-link`),s=o instanceof HTMLElement?o.dataset.skillPath:void 0;return s===void 0?!1:(r.preventDefault(),window.location.hash=f(t,e,s),!0)}})]}var Ke=I.line({attributes:{dir:`auto`}});function qe(e){let t=new M;for(let n of e.visibleRanges)for(let r=n.from;r<=n.to;){let n=e.state.doc.lineAt(r);t.add(n.from,n.from,Ke),r=n.to+1}return t.finish()}var Je=B.fromClass(class{decorations;constructor(e){this.decorations=qe(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=qe(e.view))}},{decorations:e=>e.decorations}),Ye=[F.perLineTextDirection.of(!0),Je],Xe=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Ze=`cm-lint-local-target`;function Qe(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function $e(e,t){let n=W(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Xe.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function et(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function tt(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=$e(e,Qe(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:et(i.severity),message:y(i),source:`${i.source}/${i.code}`,markClass:Ze})}return r}var nt=L.define();function rt(e){let t={findings:[]};return[Pe(e=>w()?tt(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(nt)))}),B.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:nt.of(null)}),ze(n)},i=x(e,e=>{e.status===`loaded`&&r(e.findings)}),a=E(()=>r(t.findings));return{destroy(){i(),a()}}})]}function it(e,t){return e.enabled?[Fe(),Pe(async n=>at(n.state.doc,await ke(n.state.doc.toString(),e,t)),{delay:600})]:[]}function $(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function at(e,t){let n=[];for(let r of t){let t=$(e,r.range.start),i=$(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=ot(r);o&&(a.actions=[o]),n.push(a)}return n}function ot(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:$(n,e.range.start),to:$(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var st=[X(),K(),J(),be(),U(),Y(),_e.allowMultipleSelections.of(!0),P(),G(),Ee(),we(),q(),j(),V(),Ne(),ye.of([...Ce,...Se,...Re,...H,...Te,...Le])],ct=I.mark({class:`cm-link-ref-broken`}),lt=/^\s{0,3}\[([^\]]+)\]:\s/,ut=/\[([^\]]*)\]\[([^\]]*)\]/g,dt=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function ft(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function pt(e){let t=[];return R(e).iterate({enter(e){if(dt.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function mt(e){let t=new Set,n=[],r=e.doc,i=pt(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(ft(n.from,i))continue;let a=lt.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!ft(t.from,i)&&!lt.test(t.text))for(ut.lastIndex=0;;){let e=ut.exec(t.text);if(!e)break;let r=t.from+e.index;if(ft(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(ct.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),I.set(a)}var ht=z.define({create(e){return mt(e)},update(e,t){return t.docChanged?mt(t.state):e},provide:e=>F.decorations.from(e)}),gt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,_t=I.mark({class:`cm-del`}),vt=I.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),yt=I.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function bt(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function xt(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!g.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(g.test(r.text))return{from:t.from,to:r.to}}return null}function St(e,t){let n=[],r=R(e),i=xt(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(_t.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=gt.exec(r.text),a=i?i[1].length:2,o=I.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=bt(r.text),a=I.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(vt.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(yt.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(yt.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),I.set(n)}var Ct=class{decorations;constructor(e){this.decorations=St(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||R(e.startState)!==R(e.state))&&(this.decorations=St(e.view.state,e.view.visibleRanges))}},wt=B.fromClass(Ct,{decorations:e=>e.decorations});function Tt(){return[wt,ht]}function Et(e,t){let n=e.trackedOrigins;return n.has(t)?!0:t?n.has(t.constructor):!1}function Dt(e){let{docName:t,ytext:n,undoManager:r}=e,i=!1,a=!1,o=!1,s=(e,t)=>{i||Et(r,t.origin)||(a=!0)};return n.observe(s),{setSourceModeActive(e){if(!o&&e!==i){if(!e){i=!1,r.stopCapturing();return}a&&(r.clear(),A(`ok/source-undo/flip-clear`,{docName:t})),a=!1,i=!0}},destroy(){o||(o=!0,n.unobserve(s))}}}var Ot=new WeakMap;function kt(e){return B.define(t=>{let n=Dt(e);return Ot.set(t,n),{destroy(){n.destroy()}}})}function At(e,t){let n=Ot.get(e);if(!n)throw Error(`createSourceUndoFlipExtension is not installed on this EditorView`);n.setSourceModeActive(t)}var jt=t(),Mt=L.define();function Nt(e,t){try{At(t.view,!1)}finally{try{l(t)}finally{T(e,t.view)}}}function Pt(e,t,n){let r=b(e.state.doc),a=r[t.index],o={docName:n,mode:`source`,index:t.index,sourceHeadingCount:r.length};if(!a){k(se,{...o,outcome:`no-target`});return}let s=i(n,`outline`,()=>{e.dispatch({selection:Z.cursor(a.from),effects:F.scrollIntoView(a.from,{y:`start`})}),e.focus()});k(se,{...o,outcome:s?`scrolled`:`declined`,targetLine:e.state.doc.lineAt(a.from).number})}function Ft(e,t,n,r){requestAnimationFrame(()=>{if(!n())return;let a=e.state.doc,o=Math.min(t.offset,a.length);i(r,`raw-mdx`,()=>{e.dispatch({selection:Z.cursor(o),effects:F.scrollIntoView(o,{y:`center`})}),e.focus()})})}function It(e,t,n){let r=e.state.doc,a=Math.min(Math.max(t.line,1),r.lines),o=r.line(a),s=Math.min(o.from+Math.max(0,t.column-1),o.to);return i(n,`problems-row`,()=>{e.dispatch({selection:Z.cursor(s),effects:F.scrollIntoView(s,{y:`start`})}),e.focus()})}function Lt(e){let t=(0,He.c)(51),{docName:n,ytext:i,provider:s,placeholder:c,isSourceModeActive:l}=e,u=(0,Q.useRef)(null),d=(0,Q.useRef)(null),[f,p]=(0,Q.useState)(null);if(f)throw f;let{resolvedTheme:h}=m(),{merged:g}=_(),y=(0,Q.useRef)(l),b=g?.editor?.wordWrap??!0,{data:x}=Me(n),S;t[0]!==x?.effective||t[1]!==g?(S=x?.effective??(g?.contentRules?Ae(g.contentRules):je),t[0]=x?.effective,t[1]=g,t[2]=S):S=t[2];let C=S,w;t[3]===C?w=t[4]:(w=JSON.stringify(C),t[3]=C,t[4]=w);let T=w,E=(0,Q.useRef)(null),D;t[5]!==n||t[6]!==l||t[7]!==C||t[8]!==c||t[9]!==s||t[10]!==h||t[11]!==b||t[12]!==i?(D=()=>{let e=u.current;if(!e)return;let t=s.configuration.name??``,f,m=zt;try{f=te({docName:t,container:e,sizeStats:{viewCount:0,bytes:i.length},factory:e=>{let l=null,u=new ge(i);try{let te=o({ydoc:s.document,ytext:i,docName:t}),d=new N,f=new N,p=new N,g=new N,_=new F({state:_e.create({doc:i.toString(),extensions:[st,Ye,Ie({scrollToMatch:e=>a(t,`find-match`)?F.scrollIntoView(e,{y:`start`}):Mt.of(null)}),ye.of([xe]),Ve(i,s.awareness,{undoManager:u}),ye.of(Be),kt({docName:t,ytext:i,undoManager:u}),...me({themeCompartment:d,resolvedTheme:h,ydoc:s.document,wordWrapCompartment:f,wordWrap:b,currentDocName:t}),Tt(),Ge(t),ne(),g.of(it(C,n)),rt(n),te,F.updateListener.of(e=>{r(e)&&ee(t)}),F.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(l!==null&&clearTimeout(l),l=setTimeout(()=>{l=null,ue(t,`source`,ae(e.view)),Oe(t,`source`,De(e.view,t))},120))}),p.of(ve(c??``)),F.theme({"&":{height:`100%`}}),F.scrollMargins.of(Rt)]}),parent:e});ue(t,`source`,ae(_)),Oe(t,`source`,De(_,t));let v=_.contentDOM;return v.addEventListener(`keydown`,m),v.addEventListener(`paste`,m),v.addEventListener(`drop`,m),v.addEventListener(`cut`,m),{view:_,ydoc:s.document,ytext:i,provider:s,undoManager:u,themeCompartment:d,wordWrapCompartment:f,placeholderCompartment:p,lintCompartment:g}}catch(e){let t=e;throw u.destroy(),t}}}),E.current=f,d.current=f.view,At(f.view,l),fe(n,f.view,`sourceEditor`),le()&&f.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),E.current=null,d.current=null,p(t instanceof Error?t:Error(String(t)))}return()=>{let e=E.current;E.current=null,d.current=null,e&&Nt(n,e)}},t[5]=n,t[6]=l,t[7]=C,t[8]=c,t[9]=s,t[10]=h,t[11]=b,t[12]=i,t[13]=D):D=t[13];let O;t[14]!==s||t[15]!==i?(O=[i,s],t[14]=s,t[15]=i,t[16]=O):O=t[16],(0,Q.useEffect)(D,O);let A,j;t[17]===l?(A=t[18],j=t[19]):(A=()=>{y.current=l;let e=d.current;e&&At(e,l)},j=[l],t[17]=l,t[18]=A,t[19]=j),(0,Q.useEffect)(A,j);let M,P;t[20]===n?(M=t[21],P=t[22]):(M=()=>{},P=[n],t[20]=n,t[21]=M,t[22]=P),(0,Q.useEffect)(M,P);let I,L;t[23]===h?(I=t[24],L=t[25]):(L=()=>{let e=E.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(h===`dark`?pe:he)})},I=[h],t[23]=h,t[24]=I,t[25]=L),(0,Q.useEffect)(L,I);let R,z;t[26]===b?(R=t[27],z=t[28]):(R=()=>{let e=E.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(b?F.lineWrapping:[])})},z=[b],t[26]=b,t[27]=R,t[28]=z),(0,Q.useEffect)(R,z);let B,V;t[29]===c?(B=t[30],V=t[31]):(B=()=>{let e=E.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ve(c??``))})},V=[c],t[29]=c,t[30]=B,t[31]=V),(0,Q.useEffect)(B,V);let H;t[32]!==n||t[33]!==C?(H=()=>{let e=E.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(it(C,n))})},t[32]=n,t[33]=C,t[34]=H):H=t[34];let U;t[35]===T?U=t[36]:(U=[T],t[35]=T,t[36]=U),(0,Q.useEffect)(H,U);let W,G;t[37]!==n||t[38]!==l?(W=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||t.mode!==`source`||!l)return;let r=d.current;if(!r){k(se,{docName:n,mode:`source`,index:t.index,outcome:`no-view`});return}Pt(r,t,n),v(n)};return window.addEventListener(ce,e),()=>window.removeEventListener(ce,e)},G=[n,l],t[37]=n,t[38]=l,t[39]=W,t[40]=G):(W=t[39],G=t[40]),(0,Q.useEffect)(W,G);let K,q;t[41]!==n||t[42]!==l?(K=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||!l)return;let r=d.current;r&&It(r,t,n)&&v(n)};return window.addEventListener(oe,e),()=>window.removeEventListener(oe,e)},q=[n,l],t[41]=n,t[42]=l,t[43]=K,t[44]=q):(K=t[43],q=t[44]),(0,Q.useEffect)(K,q);let J,Y;t[45]!==n||t[46]!==l||t[47]!==s?(J=()=>{if(!l)return;let e=d.current;if(!e)return;let t=de(n);if(!t)return;if(t.kind!==`selection-offset`){re(n),t.kind===`outline`?Pt(e,t.detail,n):t.kind===`lint`?It(e,t.detail,n):t.kind===`raw-mdx`&&Ft(e,t.detail,()=>y.current,n);return}let r=!1,i=null;return queueMicrotask(()=>{if(r)return;let t=de(n);t?.kind===`selection-offset`&&(i=ie({view:e,docName:n,navigation:t,ydoc:s.document,transition:{from:`wysiwyg`,to:`source`}}),i&&re(n))}),()=>{r=!0,i?.cancel(`mode-flip`)}},Y=[n,l,s],t[45]=n,t[46]=l,t[47]=s,t[48]=J,t[49]=Y):(J=t[48],Y=t[49]),(0,Q.useEffect)(J,Y);let X;return t[50]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,jt.jsx)(`div`,{ref:u,className:`source-editor h-full pb-3`}),t[50]=X):X=t[50],X}function Rt(){return{top:S()}}function zt(){return C()}export{Lt as SourceEditor,Ft as applyRawMdxNavigation};