@inkeep/open-knowledge 0.48.0-beta.1 → 0.48.0-beta.2

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 (124) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +5 -0
  2. package/dist/{acp-harness-probe-KdzK_nVG.mjs → acp-harness-probe-DgjLEALo.mjs} +2 -2
  3. package/dist/cli.mjs +7 -7
  4. package/dist/constants-uLxFyV1-.mjs +2 -0
  5. package/dist/{git-handle-CUyNAEap.mjs → git-handle-D6plgfL-.mjs} +2 -2
  6. package/dist/git-handle-qS6DQPrF.mjs +1 -0
  7. package/dist/index.mjs +1 -1
  8. package/dist/{init-4B40_LE6.mjs → init-DKGnIaVq.mjs} +3 -3
  9. package/dist/init-mzZ0flqJ.mjs +1 -0
  10. package/dist/{launch-json-removal-D8Z9IWJ5.mjs → launch-json-removal-DaoUddem.mjs} +2 -2
  11. package/dist/{loader-BBHxBjdI.mjs → loader-B5E-OO52.mjs} +2 -2
  12. package/dist/loader-BHzsvYfj.mjs +1 -0
  13. package/dist/md-manager-CpKO8i9i.mjs +2 -0
  14. package/dist/{open-browser-Aovba9v3.mjs → open-browser-ifD987S6.mjs} +2 -2
  15. package/dist/parse-worker.mjs +1 -1
  16. package/dist/{preview-DMFkO0BT.mjs → preview-CKl5PSpe.mjs} +2 -2
  17. package/dist/preview-jJpFrlNd.mjs +1 -0
  18. package/dist/public/assets/{ActivityModeContent-DElDjMQi.js → ActivityModeContent-8B7wGd5y.js} +1 -1
  19. package/dist/public/assets/{AgentDiffPane-BXnh6IZy.js → AgentDiffPane-BeWRgbnA.js} +1 -1
  20. package/dist/public/assets/{AgentThreadClientBinder-Brm90-ol.js → AgentThreadClientBinder-FT8wNbjk.js} +1 -1
  21. package/dist/public/assets/{ChangedOutsideBadge-CCqFSOma.js → ChangedOutsideBadge-Bb-re-nG.js} +1 -1
  22. package/dist/public/assets/{CodeMirrorPropInput-6etVMk5Y.js → CodeMirrorPropInput-BQoCzCdy.js} +1 -1
  23. package/dist/public/assets/{DocumentContext-DZ-0wJn3.js → DocumentContext-CcK-mNAi.js} +2 -2
  24. package/dist/public/assets/{EditorModeToggle-dpdI7c8J.js → EditorModeToggle-NV902SqC.js} +1 -1
  25. package/dist/public/assets/{EnableSyncConfirmDialog-CcN3NQoS.js → EnableSyncConfirmDialog-B3txwN8d.js} +1 -1
  26. package/dist/public/assets/FeedbackForm-1y4YvRvd.js +1 -0
  27. package/dist/public/assets/{GraphPanel-CJ28D7JT.js → GraphPanel-z_BpNtFU.js} +1 -1
  28. package/dist/public/assets/{ImportSkillDialog-Bw_TVkG-.js → ImportSkillDialog-CyLMLgQN.js} +1 -1
  29. package/dist/public/assets/{LintConfigEditor-QwQ_k2mF.js → LintConfigEditor-SRropTDk.js} +1 -1
  30. package/dist/public/assets/ManagedArtifactProperties-CbgN40D5.js +1 -0
  31. package/dist/public/assets/{ManagedArtifactProperties-DgBhkiFq.js → ManagedArtifactProperties-DwV7emUI.js} +1 -1
  32. package/dist/public/assets/{McpConsentDialogBody-_hkAkOJt.js → McpConsentDialogBody-BiF_k0VW.js} +1 -1
  33. package/dist/public/assets/{MermaidDocEditor-TuxEUZia.js → MermaidDocEditor-DkkZ1470.js} +1 -1
  34. package/dist/public/assets/{ReportBugDialogBody-BhDpC1fr.js → ReportBugDialogBody-CtlgCQX3.js} +1 -1
  35. package/dist/public/assets/{SchemaConfigEditor-DkYNNeq1.js → SchemaConfigEditor-DOmoubBM.js} +1 -1
  36. package/dist/public/assets/{SessionsHost-GPNyRr88.js → SessionsHost-DCZv6SXD.js} +2 -2
  37. package/dist/public/assets/{SettingsDialogBody-o6gupviZ.js → SettingsDialogBody-BegCUhJP.js} +1 -1
  38. package/dist/public/assets/{ShareBranchSwitchDialog-DFzc-gYE.js → ShareBranchSwitchDialog-DYf_N6bq.js} +1 -1
  39. package/dist/public/assets/{ShareReceiveDialog-CzUcMJQj.js → ShareReceiveDialog-ayJ6qYFK.js} +1 -1
  40. package/dist/public/assets/{ShareReceiveMissDialog-zs6_W1s2.js → ShareReceiveMissDialog-OcYPcuBz.js} +1 -1
  41. package/dist/public/assets/{SkillEditBanner-CtIsKZqC.js → SkillEditBanner-DBJEqMg4.js} +1 -1
  42. package/dist/public/assets/{SkillOriginInline-B_ykYGnV.js → SkillOriginInline-FJ-Hk1Uz.js} +1 -1
  43. package/dist/public/assets/{SkillToolbarControls-BCrjuyrP.js → SkillToolbarControls-CKBT36Fc.js} +1 -1
  44. package/dist/public/assets/{SourceEditor-YiMuNyzK.js → SourceEditor-OE-lSW6p.js} +1 -1
  45. package/dist/public/assets/{TerminalPanel-Ckw7NJgs.js → TerminalPanel-DN4Eag17.js} +1 -1
  46. package/dist/public/assets/{TerminalWindowApp-QEz2qA6z.js → TerminalWindowApp-BAn1bShz.js} +1 -1
  47. package/dist/public/assets/{TextDocEditor-A618uCQG.js → TextDocEditor-gUC9Hdas.js} +1 -1
  48. package/dist/public/assets/{ThreadView-B8tJ50Me.js → ThreadView-CklwWwdl.js} +1 -1
  49. package/dist/public/assets/{TimelineDiffPane-DTURU8uv.js → TimelineDiffPane-R2I1Oytb.js} +1 -1
  50. package/dist/public/assets/{agent-diff-store-TLThEuR1.js → agent-diff-store-BABq_wfE.js} +1 -1
  51. package/dist/public/assets/{agent-visibility-CJRT86Ps.js → agent-visibility-p6xMSDdk.js} +1 -1
  52. package/dist/public/assets/{auth-state-cache-CUV5py1n.js → auth-state-cache-B-pK5XlG.js} +1 -1
  53. package/dist/public/assets/{client-version-BGy6p8DR.js → client-version-1hLDBtWZ.js} +1 -1
  54. package/dist/public/assets/{comment-chips-CLP1YOO3.js → comment-chips-DhFlg6Lg.js} +1 -1
  55. package/dist/public/assets/{config-context-CJhzNFRa.js → config-context-JFJadbOg.js} +1 -1
  56. package/dist/public/assets/{config-provider-CAnnyICp.js → config-provider-GgI7K6tF.js} +1 -1
  57. package/dist/public/assets/{dist-DRIvEATD2.js → dist-D0lKV18u2.js} +1 -1
  58. package/dist/public/assets/{doc-paths-Dolz4CVF.js → doc-paths-BuYvs-Sl.js} +1 -1
  59. package/dist/public/assets/{documents-events-Cur796tS.js → documents-events-CZXYlWJs.js} +1 -1
  60. package/dist/public/assets/{file-tree-adapter-Che6gyVJ.js → file-tree-adapter-VPm5Cnie.js} +1 -1
  61. package/dist/public/assets/{file-tree-utils-Dx2E4Vvj.js → file-tree-utils-DEJGOhLm.js} +1 -1
  62. package/dist/public/assets/{folder-config-api-CQN90p2h.js → folder-config-api-CkzVN79U.js} +1 -1
  63. package/dist/public/assets/{follow-file-DgmM8dO9.js → follow-file-Ad0qyANw.js} +1 -1
  64. package/dist/public/assets/{globals-DZBjun_8.js → globals-CGSd7dgM.js} +1 -1
  65. package/dist/public/assets/{index-DptqrcOr.js → index-D7Hnjtop.js} +108 -108
  66. package/dist/public/assets/{lint-config-client-ClA8dHKT.js → lint-config-client-CKLyoxWn.js} +1 -1
  67. package/dist/public/assets/{markdownlint-rule-browser-Bvzo7wkW.js → markdownlint-rule-browser-BJyF5XvC.js} +1 -1
  68. package/dist/public/assets/{navigation-targets-1hx64TtZ.js → navigation-targets-kcw1-114.js} +1 -1
  69. package/dist/public/assets/{open-managed-artifact-tab-D_X48qHc.js → open-managed-artifact-tab-CRB-rvl-.js} +1 -1
  70. package/dist/public/assets/{pending-receive-nav-store-Bo3Ua-lf.js → pending-receive-nav-store-yAE2j52e.js} +1 -1
  71. package/dist/public/assets/{prop-types-BCp8mkjK.js → prop-types-C-VFVfev.js} +1 -1
  72. package/dist/public/assets/{receive-store-C1kRoNkY.js → receive-store-C3RyDFMU.js} +1 -1
  73. package/dist/public/assets/{selection-context-B88baJld.js → selection-context-CojvRwo6.js} +1 -1
  74. package/dist/public/assets/skill-actions-BVQGnmjM.js +2 -0
  75. package/dist/public/assets/{skill-scope-CLRJjw_Z.js → skill-scope-DwDLnOOD.js} +1 -1
  76. package/dist/public/assets/{skills-api-aea_dEvN.js → skills-api-BBaU5yMj.js} +1 -1
  77. package/dist/public/assets/{src-DOgvhFVP.js → src-BFaead-K.js} +1 -1
  78. package/dist/public/assets/{tag-pill-input-BvX7HL8s.js → tag-pill-input-T8jCzKA4.js} +1 -1
  79. package/dist/public/assets/{target-navigation-intent-B_h4XcSC.js → target-navigation-intent-ur7EfH9N.js} +1 -1
  80. package/dist/public/assets/{terminal-launch-events-aBVjFCFq.js → terminal-launch-events-CIEJD8Ca.js} +1 -1
  81. package/dist/public/assets/{terminal-telemetry-CngOGgv4.js → terminal-telemetry-D3CzWhx2.js} +1 -1
  82. package/dist/public/assets/{typing-burst-detector-CW22FOCO.js → typing-burst-detector-DCq4EEJa.js} +1 -1
  83. package/dist/public/assets/{uninstall-CxAePTJn.js → uninstall-oyd1jRGx.js} +1 -1
  84. package/dist/public/assets/{use-activity-panel-CxBUL1ZK.js → use-activity-panel-BPsAzeX7.js} +1 -1
  85. package/dist/public/assets/{use-collab-url-ClVyXaaO.js → use-collab-url-oYOwLAYB.js} +1 -1
  86. package/dist/public/assets/{use-live-xterm-theme-CWY1S69J.js → use-live-xterm-theme-DEdN-vX3.js} +1 -1
  87. package/dist/public/assets/{use-open-skill-Dbt5PGnM.js → use-open-skill-Ljj3_grf.js} +1 -1
  88. package/dist/public/assets/{use-settings-route-DiW3HwVR.js → use-settings-route-B1Atzr9C.js} +1 -1
  89. package/dist/public/assets/{use-skill-directory-BTS6Ta12.js → use-skill-directory-Ie653N2P.js} +1 -1
  90. package/dist/public/assets/{use-skill-origin-DGZ1Tr76.js → use-skill-origin-LsbeWa_R.js} +1 -1
  91. package/dist/public/assets/{use-skills-DShP5obX.js → use-skills-CtCsB6PZ.js} +1 -1
  92. package/dist/public/assets/{use-terminal-enabled-B7N9LT7n.js → use-terminal-enabled-BArDTeSK.js} +1 -1
  93. package/dist/public/assets/{use-timeline-entry-diff-C3kywbnk.js → use-timeline-entry-diff-s1PlK0BB.js} +1 -1
  94. package/dist/public/assets/{use-workspace-DHRjFC5F.js → use-workspace-3mjuTrTC.js} +1 -1
  95. package/dist/public/index.html +44 -44
  96. package/dist/public/uninstall.html +3 -3
  97. package/dist/{repair-launch-json-D0XpWsZB.mjs → repair-launch-json-D2WeY50Y.mjs} +2 -2
  98. package/dist/{repair-mcp-configs-O3e_DJ8y.mjs → repair-mcp-configs-BJ9v8T7k.mjs} +2 -2
  99. package/dist/{repair-skills-uMI25lo9.mjs → repair-skills-Cm70zKLA.mjs} +2 -2
  100. package/dist/repair-skills-DT7FGT3w.mjs +1 -0
  101. package/dist/server-lock-CQ1oOrnO.mjs +1 -0
  102. package/dist/{server-lock-0ZJCFGpm.mjs → server-lock-DQJq-D9V.mjs} +2 -2
  103. package/dist/{skill-teardown-BysqkO8f.mjs → skill-teardown-BQ0YQ9rO.mjs} +2 -2
  104. package/dist/src-BTCvmkZK.mjs +2030 -0
  105. package/dist/{src-CqDqEFrf.mjs → src-BuZeH4bR.mjs} +1 -1
  106. package/dist/{src-QEvK7EiL.mjs → src-CmzmL097.mjs} +2 -2
  107. package/dist/{src-Q3KTb-Jc.mjs → src-y-VpYk60.mjs} +2 -2
  108. package/dist/start-BYT6GfDm.mjs +1 -0
  109. package/dist/{start-iIbl__y5.mjs → start-DT_8Fr-l.mjs} +3 -3
  110. package/dist/{write-project-skill-CBqErFFd.mjs → write-project-skill-DQTCLDNM.mjs} +2 -2
  111. package/package.json +5 -5
  112. package/dist/constants-CW4wJbbt.mjs +0 -2
  113. package/dist/git-handle-BDzYPMqO.mjs +0 -1
  114. package/dist/init-GbqX3ewY.mjs +0 -1
  115. package/dist/loader-DXq68CYf.mjs +0 -1
  116. package/dist/md-manager-CqoNGQPG.mjs +0 -2
  117. package/dist/preview-BbSUiZyW.mjs +0 -1
  118. package/dist/public/assets/FeedbackForm-DEEqm4xk.js +0 -1
  119. package/dist/public/assets/ManagedArtifactProperties-FuTMmYBX.js +0 -1
  120. package/dist/public/assets/skill-actions-Cn19hOx-.js +0 -2
  121. package/dist/repair-skills-DAEl0Z9J.mjs +0 -1
  122. package/dist/server-lock-BGdbKgXK.mjs +0 -1
  123. package/dist/src-U1nflDBi.mjs +0 -2030
  124. package/dist/start-LgMLernM.mjs +0 -1
@@ -508,7 +508,7 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
508
508
  `);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function p0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!l0.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&p0(t)}}var m0=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),h0=()=>e=>{g0(e)};function g0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&g0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return _0(t)?[]:v0(t)?t.children:[t]})}}function _0(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function v0(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>m0.has(String(e))):!1}var y0=`docs-internal-guid-`;function b0(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var x0=()=>e=>{S0(e)};function S0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&S0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(C0(r)||w0(r)){b0(e,t);continue}t++}}function C0(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(y0)}function w0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var T0=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),E0=()=>e=>{D0(e)};function D0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&D0(t);for(let t of e.children)t.type===`element`&&O0(t)}}function O0(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!T0.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var k0=/^gmail_/,A0=()=>e=>{j0(e)};function j0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&j0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&M0(r,`gmail_quote`)&&(r.tagName=`blockquote`),N0(r),P0(r)){e.children.splice(t,1,...r.children);continue}t++}}function M0(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function N0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!k0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function P0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var F0=()=>e=>{I0(e)};function I0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&I0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(L0(t),[t])})}}function L0(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var R0=[`o:`,`w:`,`m:`,`v:`,`u1:`],z0=/^Mso[A-Z]/,B0=/^\s*\[if\s+[^\]]*\]/,V0=()=>e=>{H0(e)};function H0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&H0(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return B0.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return U0(t)?[]:(W0(t),[t])})}}function U0(e){return R0.some(t=>e.tagName.startsWith(t))}function W0(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!z0.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&z0.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);R0.some(e=>e===`${n}:`)&&delete t[e]}}var G0=/^c-(message_kit__|message__|compose|timestamp)/,K0=()=>e=>{q0(e)};function q0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&q0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return J0(t)?[]:(Y0(t),[t])})}}function J0(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function Y0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!G0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var X0=()=>e=>{Z0(e)};function Z0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&Z0(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;Q0(r)&&(e.children[t]=e2(r))}}}function Q0(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>$0(e))}function $0(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||$0(e))return!0}return!1}function e2(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>t2(e)).join(`
509
509
  `)}]}]}}function t2(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=t2(n));return t}var n2=new Set([`break`,`delete`,`emphasis`,`footnoteReference`,`html`,`image`,`imageReference`,`inlineCode`,`link`,`linkReference`,`strong`,`text`]);function r2(e){let t=e.children;Array.isArray(t)&&t.forEach((e,n)=>{if(e.type===`break`){t[n]={type:`html`,value:`<br />`};return}r2(e)})}function i2(e){let t=e.children;if(Array.isArray(t))for(let e of t)(e.type===`inlineCode`||e.type===`html`)&&(e.value.includes(`
510
510
  `)&&(e.value=e.value.replace(/[ \t]*\n[ \t]*/g,` `)),e.type===`html`&&e.value.includes(`|`)&&(e.value=e.value.replace(/\|/g,`\\|`))),i2(e)}function a2(e){D(e,`tableCell`,e=>{e.children.some(e=>!n2.has(e.type))&&(e.children=o2(e.children)),r2(e),i2(e)})}function o2(e){let t=[],n=0,r=()=>{t.length>0&&(n+=1)},i=e=>{for(;n>0;)t.push({type:`break`}),--n;t.push(e)},a=e=>{e.split(`
511
- `).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r(),i({type:`text`,value:t?`${n+a}${c} `:`${o} `}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}var s2=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},c2=[x0,V0,h0,A0,u0,X0,F0,K0,E0];function l2(e){D(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function u2(e){D(e,`list`,e=>{for(let t of e.children){let e=t.children.filter(e=>e.type!==`list`).length;t.spread=t.spread===!0&&e>1}e.spread=e.children.some(e=>e.spread===!0)})}var d2={u:p2(`u`),ins:p2(`ins`)},f2=`okUnderlineForm`;function p2(e){return(t,n)=>{let r={type:`emphasis`,children:t.all(n),data:{[f2]:e}};return t.patch(n,r),r}}function m2(e){let t=e=>{if(!Array.isArray(e.children))return;for(let n of e.children)t(n);let n=[];for(let t of e.children){let e=t.data?.[f2],r=t.children;if((e===`u`||e===`ins`)&&Array.isArray(r)){n.push({type:`html`,value:`<${e}>`}),n.push(...r),n.push({type:`html`,value:`</${e}>`});continue}n.push(t)}e.children=n};t(e)}function h2(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new s2(e.length,n);let r=le().use(Aj,{fragment:!0});for(let e of c2)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(qN,{handlers:d2});let i=r.parse(e),a=r.runSync(i);return u2(a),m2(a),l2(a),a}function g2(e){return a2(e),String(le().use(ue).use(bP,{bullet:`-`,rule:`-`,fences:!0}).stringify(e))}function _2(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}var v2=new Set([`sourceRaw`,`sourceDirty`,`position`]),y2=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),b2={type:`__br__`},x2=/^<br\s*\/?>$/i;function S2(e){let t=D2(e,S2);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:C2(t.content)}:t}function C2(e){let t=[];for(let n of e){let e=w2(n);e.length!==0&&(t.length>0&&t.push(b2),t.push(...e))}return t}function w2(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?C2(e.content):e.content}function T2(e){return e.type===`hardBreak`||e.type===b2.type||e.text!==void 0&&x2.test(e.text.trim())?b2:D2(e,T2)}var E2=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:S2},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:T2}];function D2(e,t){return e.content?{...e,content:e.content.map(t)}:e}function O2(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=k2(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:k2(e.attrs,t)})).sort((e,t)=>j2(e).localeCompare(j2(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>O2(e,t))),n}function k2(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(v2.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?A2(i,t):i)}return Object.keys(n).length>0?n:null}function A2(e,t){if(Array.isArray(e))return e.map(e=>A2(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=A2(i,t));return n}return e}function j2(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function M2(e){let t=``,n=e=>{if(e.text!==void 0&&(t+=e.text),e.content)for(let t of e.content)n(t)};return n(e),t.replace(/\s+/g,``)}function N2(e){let t=[],n=e=>{if(e.type&&y2.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function P2(e){let t=e,n=[];for(let e of E2){let r=j2(t),i=e.canonicalize(t);j2(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function F2(e,t,n={}){let r=P2(e),i=P2(t),a=[...new Set([...r.fired,...i.fired])];if(!_2(M2(r.normalized),M2(i.normalized)))return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let o=N2(r.normalized),s=N2(i.normalized);if(j2(o)!==j2(s))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${o.join(`, `)}] vs [${s.join(`, `)}]`};let c=O2(r.normalized,n.ignoreAttrs),l=O2(i.normalized,n.ignoreAttrs);return j2(c)===j2(l)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:I2(c,l)}}function I2(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(j2(a[e])!==j2(o[e]))return I2(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function L2(e,t,n){return!F2(e,t,{ignoreAttrs:n}).equivalent}var R2=new Set([`src`,`href`,`size`]),z2=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function B2(e){if(Array.isArray(e))return e.map(e=>B2(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))R2.has(n)||(t[n]=B2(r));return t}return e}function V2(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&z2.has(e.attrs.componentName)?B2(e):e.content?{...e,content:e.content.map(V2)}:e}function H2(e){if(Array.isArray(e))return e.map(e=>H2(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=H2(r));return t}return e}function U2(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=U2(t);if(e)return e}}function W2(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=U2(e.parse(r)),o=a?V2(H2(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?L2(n,V2(H2(e))):!1}}}function G2(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&K2(e.value.value,t))continue}let o=q2(e,t);r>=0?n[r]=o:n.push(o)}return n}function K2(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function q2(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function J2(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:G2(t,r),children:n.all(t),data:{}}}function Y2(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:G2(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}var X2=/^[A-Za-z0-9]{20,}$/,Z2=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function Q2(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function $2(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return X2.test(n)?n:null}function e4(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!Q2(t.hostname))return null;let n=$2(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&Z2.test(r)?r:null}}function t4(e){return e4(e)!==null}function n4(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function r4(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:n4(t.hostname)}var i4=/^[A-Za-z0-9_-]{11}$/;function a4(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function o4(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function s4(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return i4.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return i4.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function c4(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!a4(t.hostname))return null;let n=s4(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?o4(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}var l4=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],u4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:ed,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],d4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],f4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:td,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(r4(e.src)||t4(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:ed,hideWhen:e=>typeof e.src==`string`&&(r4(e.src)||t4(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&t4(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(r4(e.src)||t4(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(c4(e.src)!==null||r4(e.src)||t4(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],p4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:nd,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],m4=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],h4=[l4[0],l4[1],l4[4],l4[5],l4[6]],g4=[u4[0],u4[1],u4[7]],_4=[m4[0],m4[1],m4[4],m4[5]],v4=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],y4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],b4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],x4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],S4=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],C4=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],w4=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],T4=[w4[0]],E4=[w4[0]],D4=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],O4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],k4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],A4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:rd,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],j4=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],M4=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function N4(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function P4(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function F4(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var I4=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:l4,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>J2(`Callout`,e,t,l4)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:u4,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>J2(`img`,e,t,u4)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:f4,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>J2(`video`,e,t,f4)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:p4,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>J2(`audio`,e,t,p4)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:A4,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>J2(`Pdf`,e,t,A4)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:k4,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>J2(`File`,e,t,k4)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:d4,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>J2(`Embed`,e,t,d4)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:m4,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>J2(`Accordion`,e,t,m4)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:m4,icon:`ChevronRight`,category:`content`,displayName:`Toggle`,description:"Standalone expand/collapse block (Notion-style). Same render + props as `<Accordion>` — pick whichever vocabulary matches the vault.",searchTerms:[`toggle`,`collapsible`,`expand`,`details`,`disclosure`,`fold`],exampleBody:`Body content revealed when the toggle is expanded.`,serialize:(e,t)=>J2(`Toggle`,e,t,m4)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:S4,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
511
+ `).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r(),i({type:`text`,value:t?`${n+a}${c} `:`${o} `}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}var s2=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},c2=[x0,V0,h0,A0,u0,X0,F0,K0,E0];function l2(e){D(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function u2(e){D(e,`list`,e=>{for(let t of e.children){let e=t.children.filter(e=>e.type!==`list`).length;t.spread=t.spread===!0&&e>1}e.spread=e.children.some(e=>e.spread===!0)})}var d2={u:p2(`u`),ins:p2(`ins`)},f2=`okUnderlineForm`;function p2(e){return(t,n)=>{let r={type:`emphasis`,children:t.all(n),data:{[f2]:e}};return t.patch(n,r),r}}function m2(e){let t=e=>{if(!Array.isArray(e.children))return;for(let n of e.children)t(n);let n=[];for(let t of e.children){let e=t.data?.[f2],r=t.children;if((e===`u`||e===`ins`)&&Array.isArray(r)){n.push({type:`html`,value:`<${e}>`}),n.push(...r),n.push({type:`html`,value:`</${e}>`});continue}n.push(t)}e.children=n};t(e)}function h2(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new s2(e.length,n);let r=le().use(Aj,{fragment:!0});for(let e of c2)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(qN,{handlers:d2});let i=r.parse(e),a=r.runSync(i);return u2(a),m2(a),l2(a),a}function g2(e){return a2(e),String(le().use(ue).use(bP,{bullet:`-`,rule:`-`,fences:!0}).stringify(e))}function _2(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}var v2=new Set([`sourceRaw`,`sourceDirty`,`position`]),y2=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),b2={type:`__br__`},x2=/^<br\s*\/?>$/i;function S2(e){let t=D2(e,S2);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:C2(t.content)}:t}function C2(e){let t=[];for(let n of e){let e=w2(n);e.length!==0&&(t.length>0&&t.push(b2),t.push(...e))}return t}function w2(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?C2(e.content):e.content}function T2(e){return e.type===`hardBreak`||e.type===b2.type||e.text!==void 0&&x2.test(e.text.trim())?b2:D2(e,T2)}var E2=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:S2},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:T2}];function D2(e,t){return e.content?{...e,content:e.content.map(t)}:e}function O2(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=k2(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:k2(e.attrs,t)})).sort((e,t)=>j2(e).localeCompare(j2(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>O2(e,t))),n}function k2(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(v2.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?A2(i,t):i)}return Object.keys(n).length>0?n:null}function A2(e,t){if(Array.isArray(e))return e.map(e=>A2(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=A2(i,t));return n}return e}function j2(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function M2(e){let t=``,n=e=>{if(e.text!==void 0&&(t+=e.text),e.content)for(let t of e.content)n(t)};return n(e),t.replace(/\s+/g,``)}function N2(e){let t=[],n=e=>{if(e.type&&y2.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function P2(e){let t=e,n=[];for(let e of E2){let r=j2(t),i=e.canonicalize(t);j2(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function F2(e,t,n={}){let r=P2(e),i=P2(t),a=[...new Set([...r.fired,...i.fired])];if(!_2(M2(r.normalized),M2(i.normalized)))return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let o=N2(r.normalized),s=N2(i.normalized);if(j2(o)!==j2(s))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${o.join(`, `)}] vs [${s.join(`, `)}]`};let c=O2(r.normalized,n.ignoreAttrs),l=O2(i.normalized,n.ignoreAttrs);return j2(c)===j2(l)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:I2(c,l)}}function I2(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(j2(a[e])!==j2(o[e]))return I2(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function L2(e,t,n){return!F2(e,t,{ignoreAttrs:n}).equivalent}var R2=new Set([`src`,`href`,`size`]),z2=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function B2(e){if(Array.isArray(e))return e.map(e=>B2(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))R2.has(n)||(t[n]=B2(r));return t}return e}function V2(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&z2.has(e.attrs.componentName)?B2(e):e.content?{...e,content:e.content.map(V2)}:e}function H2(e){if(Array.isArray(e))return e.map(e=>H2(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=H2(r));return t}return e}function U2(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=U2(t);if(e)return e}}function W2(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=U2(e.parse(r)),o=a?V2(H2(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?L2(n,V2(H2(e))):!1}}}function G2(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&K2(e.value.value,t))continue}let o=q2(e,t);r>=0?n[r]=o:n.push(o)}return n}function K2(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function q2(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function J2(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:G2(t,r),children:n.all(t),data:{}}}function Y2(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:G2(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}var X2=/^[A-Za-z0-9]{20,}$/,Z2=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function Q2(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function $2(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return X2.test(n)?n:null}function e4(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!Q2(t.hostname))return null;let n=$2(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&Z2.test(r)?r:null}}function t4(e){return e4(e)!==null}function n4(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function r4(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:n4(t.hostname)}var i4=/^[A-Za-z0-9_-]{11}$/;function a4(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function o4(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function s4(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return i4.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return i4.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function c4(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!a4(t.hostname))return null;let n=s4(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?o4(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}var l4=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],u4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:ed,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],d4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],f4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:td,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(r4(e.src)||t4(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:ed,hideWhen:e=>typeof e.src==`string`&&(r4(e.src)||t4(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&t4(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(r4(e.src)||t4(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(c4(e.src)!==null||r4(e.src)||t4(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],p4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:nd,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],m4=[{name:`title`,type:`string`,required:!0,description:`Heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the block renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],h4=[l4[0],l4[1],l4[4],l4[5],l4[6]],g4=[u4[0],u4[1],u4[7]],_4=[m4[0],m4[1],m4[4],m4[5]],v4=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],y4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],b4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],x4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],S4=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],C4=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],w4=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],T4=[w4[0]],E4=[w4[0]],D4=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],O4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],k4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],A4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:rd,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],j4=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],M4=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function N4(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function P4(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function F4(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var I4=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:l4,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>J2(`Callout`,e,t,l4)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:u4,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>J2(`img`,e,t,u4)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:f4,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>J2(`video`,e,t,f4)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:p4,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>J2(`audio`,e,t,p4)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:A4,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>J2(`Pdf`,e,t,A4)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:k4,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>J2(`File`,e,t,k4)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:d4,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>J2(`Embed`,e,t,d4)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:m4,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>J2(`Accordion`,e,t,m4)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:m4,icon:`ChevronRight`,category:`content`,displayName:`Toggle`,description:"Standalone expand/collapse block (Notion-style). Same render + props as `<Accordion>` — pick whichever vocabulary matches the vault.",searchTerms:[`toggle`,`collapsible`,`expand`,`details`,`disclosure`,`fold`],exampleBody:`Body content revealed when the toggle is expanded.`,serialize:(e,t)=>J2(`Toggle`,e,t,m4)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:S4,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
512
512
  <Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>J2(`Tabs`,e,t,S4)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:C4,icon:`PanelTop`,category:`content`,displayName:`Tab`,description:"A single tab panel inside a `<Tabs>` container — carries the strip label and the block-content body.",searchTerms:[`tab`,`panel`],exampleBody:"Panel content — must be nested inside a `<Tabs>` parent.",serialize:(e,t)=>J2(`Tab`,e,t,C4)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:w4,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>J2(`Math`,e,t,w4)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:D4,icon:`Workflow`,category:`content`,displayName:`Mermaid`,placeholder:{label:`Add a Mermaid diagram`},description:"Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie). Authored exclusively as ` ```mermaid ` fenced code.",searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})},{name:`Mirror`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:j4,icon:`CopyPlus`,category:`content`,displayName:`Mirror`,description:"Render a read-only copy of a `<MirrorSource>` block from another doc. Use to keep the same content in sync across multiple docs without copy-paste — edits land at the source, every Mirror reflects the change.",searchTerms:[`mirror`,`sync`,`synced`,`transclude`,`embed`,`reference`,`shared block`],serialize:(e,t)=>J2(`Mirror`,e,t,j4)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:M4,icon:`GitBranch`,category:`content`,displayName:`Mirror Source`,description:'Mark a block as the source of truth for content that appears in multiple docs. Wrap any block content; `<Mirror src="…" anchor="<id>">` references render this verbatim read-only at every call-site. Edit here, propagate everywhere.',searchTerms:[`mirror source`,`sync source`,`source block`,`master block`,`shared`],exampleBody:"Authoritative content lives inside this block — edits here propagate to every `<Mirror>` that references this id.",serialize:(e,t)=>J2(`MirrorSource`,e,t,M4)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:h4,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:g4,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (`![alt](src "title")`) — read-only compat. Preserves `![alt](src)` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:y4,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:F4},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:b4,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:F4},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:x4,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:F4},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:O4,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:F4},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:_4,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${N4(n.name)}"`:``,a=n?.id?` id="${N4(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${P4(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`HtmlAlignBlock`,surface:`canonical`,hasChildren:!0,props:v4,icon:`AlignCenter`,category:`content`,displayName:`Align block`,description:"GitHub-style `<div align>` wrapper. Children render as normal blocks with the alignment applied; the `<div align>` syntax is preserved on round-trip.",searchTerms:[`align`,`center`,`centered`,`div`],serialize:(e,t)=>{let n=e.attrs.props,r=n?.tag===`center`?`center`:`div`,i=typeof n?.align==`string`&&n.align?n.align:null,a=typeof n?.sourceAttrs==`string`?n.sourceAttrs:``,o=/(\balign\s*=\s*)(?:"[^"]*"|'[^']*'|[^\s"'<>]+)/i;return i!==null&&(r===`div`||i!==`center`)?a=o.test(a)?a.replace(o,`$1"${N4(i)}"`):`${a} align="${N4(i)}"`:(i===null||r===`center`&&i===`center`)&&(a=a.replace(RegExp(`\\s*${o.source}`,`i`),``)),{type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<${r}${a}>`,closer:`</${r}>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:T4,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:E4,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})}],L4={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>J2(e.attrs.componentName||`*`,e,t)};function R4(){let e=new Map;e.set(`*`,L4);for(let t of I4)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var z4={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function B4(){z4.parseFallback.blockLevel++}function V4(){z4.parseFallback.wholeDoc++}function H4(){z4.parseFallback.wholeDocBudget++}function U4(e){z4.jsxRenderFailure[e]=(z4.jsxRenderFailure[e]??0)+1}function W4(e){z4.jsxAutoConvertFailed[e]=(z4.jsxAutoConvertFailed[e]??0)+1}function G4(e){z4.jsxAutoConvertSucceeded[e]=(z4.jsxAutoConvertSucceeded[e]??0)+1}function K4(e){z4.jsxPropDropped[e]=(z4.jsxPropDropped[e]??0)+1}function q4(e){z4.jsxMoveFailed[e]=(z4.jsxMoveFailed[e]??0)+1}function J4(e){z4.jsxStuckCopyFailed[e]=(z4.jsxStuckCopyFailed[e]??0)+1}function Y4(e){z4.jsxStuckDeleteFailed[e]=(z4.jsxStuckDeleteFailed[e]??0)+1}function X4(e){z4.jsxPopoverCloseRestoreFailed[e]=(z4.jsxPopoverCloseRestoreFailed[e]??0)+1}function Z4(e){z4.jsxKeyboardDeleteFailed[e]=(z4.jsxKeyboardDeleteFailed[e]??0)+1}function Q4(e){z4.blockGripClickSelectFailed[e]=(z4.blockGripClickSelectFailed[e]??0)+1}function $4(e){z4.jsxArrowNodeSelectFailed[e]=(z4.jsxArrowNodeSelectFailed[e]??0)+1}var e3=/^(`{3,}|~{3,})/gm;function t3(e){let t=[],n=null;for(let r of e.matchAll(e3)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function n3(e,t){return t.some(([t,n])=>e>=t&&e<n)}var r3=/`+/g;function i3(e){let t=[];r3.lastIndex=0;for(let n of e.matchAll(r3))t.push({offset:n.index,length:n[0].length});let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let i=e+1;i<t.length;i++){let a=t[i];if(a.length===r.length){n.push([r.offset,a.offset+a.length]),e=i;break}}}return n}var a3=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function o3(e){let t=t3(e),n=[];for(let r of e.matchAll(a3))n3(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
513
513
  `)}\n\n`:``}var s3=500,c3=1e3;function l3(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return p3(e,t.parse,0,n)}function u3(e){return e.calls>=c3?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=s3}var d3=500;function f3(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,d3),stack:e.stack?.split(`
514
514
  `).slice(0,4).join(`
@@ -1 +1 @@
1
- import{xa as e}from"./dist-DRIvEATD2.js";function t(t){return e.includes(t)}function n(e){if(e.startsWith(h)||e.startsWith(y)||e.startsWith(b)||e.startsWith(C)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=g(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function r(e){if(e.startsWith(h)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function i(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}var a=`__okHashHistoryEntry`;function o(e){return{...typeof e==`object`&&e?e:{},[a]:!0}}function s(e){return typeof e==`object`&&!!e&&e[a]===!0}function c(){s(window.history.state)||window.history.replaceState(o(window.history.state),``)}function l(e){let{pathname:t,search:n}=window.location;window.history.replaceState(o(window.history.state),``,`${t}${n}${e}`)}function u(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.pushState(o(window.history.state),``,`${t}${n}${e}`)}function d(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function f(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function p(e,t,n){if(e===`folder`)return f(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function m(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var h=`#/__asset__/`;function g(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function _(e){if(!e.startsWith(h))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function v(e){return`${h}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var y=`#/__skill-file__/`,b=`#/__skills__`;function x(){return b}function S(e){return e===b||e.startsWith(`${b}/`)}var C=`#/__skill-preview__/`,w=[`explore`,`detected`,`builtin`];function T(e){return e!==void 0&&w.includes(e)}var E=`project`;function D(e){return[e.flavor,e.source,e.name,e.subtitle,e.level??E].map(encodeURIComponent).join(`/`)}function O(e){if(!e)return null;let n;try{n=e.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<4||n.length>6)return null;let[r,i,a,o,s,c]=n;return!T(r)||!i||!a?null:{flavor:r,source:i,name:a,subtitle:o??``,...s&&t(s)?{level:s}:{},...c?{path:c}:{}}}function k(e){let t=D(e);return e.path&&(t+=`/${encodeURIComponent(e.path)}`),`${C}${t}`}function A(e){return e.startsWith(C)?O(e.slice(20)):null}var j=`:`;function M(e){let t=e.host===void 0?e.name:`${e.name}${j}${e.host}`;return`${y}${[e.scope,t].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function N(e){if(!e.startsWith(y))return null;let n=e.slice(17);if(!n)return null;let r;try{r=n.split(`/`).map(decodeURIComponent)}catch{return null}if(r.length<3)return null;let[i,a,...o]=r,s=o.join(`/`);if(!i||!a||!s||!t(i))return null;let c=a.indexOf(j),l=c===-1?a:a.slice(0,c),u=c===-1?void 0:a.slice(c+1);return l?{scope:i,name:l,path:s,...u?{host:u}:{}}:null}var P=/\.(md|mdx)$/i;function F(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function I(e){return F(e).replace(P,``)}function L(e){let t=F(e);return t?P.test(t)?t:`${t}.md`:`untitled.md`}function R(e){let t=I(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}export{S as C,A as S,m as _,_ as a,l as b,p as c,v as d,i as f,x as g,k as h,r as i,D as l,M as m,L as n,O as o,f as p,I as r,n as s,R as t,d as u,c as v,N as x,u as y};
1
+ import{xa as e}from"./dist-D0lKV18u2.js";function t(t){return e.includes(t)}function n(e){if(e.startsWith(h)||e.startsWith(y)||e.startsWith(b)||e.startsWith(C)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=g(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function r(e){if(e.startsWith(h)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function i(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}var a=`__okHashHistoryEntry`;function o(e){return{...typeof e==`object`&&e?e:{},[a]:!0}}function s(e){return typeof e==`object`&&!!e&&e[a]===!0}function c(){s(window.history.state)||window.history.replaceState(o(window.history.state),``)}function l(e){let{pathname:t,search:n}=window.location;window.history.replaceState(o(window.history.state),``,`${t}${n}${e}`)}function u(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.pushState(o(window.history.state),``,`${t}${n}${e}`)}function d(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function f(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function p(e,t,n){if(e===`folder`)return f(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function m(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var h=`#/__asset__/`;function g(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function _(e){if(!e.startsWith(h))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function v(e){return`${h}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var y=`#/__skill-file__/`,b=`#/__skills__`;function x(){return b}function S(e){return e===b||e.startsWith(`${b}/`)}var C=`#/__skill-preview__/`,w=[`explore`,`detected`,`builtin`];function T(e){return e!==void 0&&w.includes(e)}var E=`project`;function D(e){return[e.flavor,e.source,e.name,e.subtitle,e.level??E].map(encodeURIComponent).join(`/`)}function O(e){if(!e)return null;let n;try{n=e.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<4||n.length>6)return null;let[r,i,a,o,s,c]=n;return!T(r)||!i||!a?null:{flavor:r,source:i,name:a,subtitle:o??``,...s&&t(s)?{level:s}:{},...c?{path:c}:{}}}function k(e){let t=D(e);return e.path&&(t+=`/${encodeURIComponent(e.path)}`),`${C}${t}`}function A(e){return e.startsWith(C)?O(e.slice(20)):null}var j=`:`;function M(e){let t=e.host===void 0?e.name:`${e.name}${j}${e.host}`;return`${y}${[e.scope,t].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function N(e){if(!e.startsWith(y))return null;let n=e.slice(17);if(!n)return null;let r;try{r=n.split(`/`).map(decodeURIComponent)}catch{return null}if(r.length<3)return null;let[i,a,...o]=r,s=o.join(`/`);if(!i||!a||!s||!t(i))return null;let c=a.indexOf(j),l=c===-1?a:a.slice(0,c),u=c===-1?void 0:a.slice(c+1);return l?{scope:i,name:l,path:s,...u?{host:u}:{}}:null}var P=/\.(md|mdx)$/i;function F(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function I(e){return F(e).replace(P,``)}function L(e){let t=F(e);return t?P.test(t)?t:`${t}.md`:`untitled.md`}function R(e){let t=I(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}export{S as C,A as S,m as _,_ as a,l as b,p as c,v as d,i as f,x as g,k as h,r as i,D as l,M as m,L as n,O as o,f as p,I as r,n as s,R as t,d as u,c as v,N as x,u as y};
@@ -1 +1 @@
1
- import{k as e}from"./dist-DRIvEATD2.js";var t=`open-knowledge:documents-changed`,n=new Set(e.options);function r(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>n.has(e)))]}function i(e=[`files`]){window.dispatchEvent(new CustomEvent(t,{detail:{channels:r(e)}}))}function a(e){let n=t=>{e(r(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}var o=`open-knowledge:doc-persisted`;function s(e){window.dispatchEvent(new CustomEvent(o,{detail:{docName:e}}))}function c(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail?.docName;typeof n==`string`&&n.length>0&&e(n)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)}var l=`open-knowledge:branch-changed`;function u(e){window.dispatchEvent(new CustomEvent(l,{detail:{branch:e}}))}function d(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}var f=`open-knowledge:templates-changed`;function p(){window.dispatchEvent(new CustomEvent(f))}function m(e){let t=()=>e();return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}var h=`open-knowledge:skills-changed`;function g(){window.dispatchEvent(new CustomEvent(h))}function _(e){let t=()=>e();return window.addEventListener(h,t),()=>window.removeEventListener(h,t)}var v=new Set,y=(e,t)=>`${e}\u0000${t}`;function b(e,t){v.add(y(e,t)),g()}function x(e,t){v.delete(y(e,t))&&g()}function S(e){return v.size===0?e:e.filter(e=>!v.has(y(e.scope,e.name)))}export{i as a,x as c,a as d,_ as f,s as i,d as l,b as n,g as o,m as p,u as r,p as s,S as t,c as u};
1
+ import{k as e}from"./dist-D0lKV18u2.js";var t=`open-knowledge:documents-changed`,n=new Set(e.options);function r(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>n.has(e)))]}function i(e=[`files`]){window.dispatchEvent(new CustomEvent(t,{detail:{channels:r(e)}}))}function a(e){let n=t=>{e(r(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}var o=`open-knowledge:doc-persisted`;function s(e){window.dispatchEvent(new CustomEvent(o,{detail:{docName:e}}))}function c(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail?.docName;typeof n==`string`&&n.length>0&&e(n)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)}var l=`open-knowledge:branch-changed`;function u(e){window.dispatchEvent(new CustomEvent(l,{detail:{branch:e}}))}function d(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}var f=`open-knowledge:templates-changed`;function p(){window.dispatchEvent(new CustomEvent(f))}function m(e){let t=()=>e();return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}var h=`open-knowledge:skills-changed`;function g(){window.dispatchEvent(new CustomEvent(h))}function _(e){let t=()=>e();return window.addEventListener(h,t),()=>window.removeEventListener(h,t)}var v=new Set,y=(e,t)=>`${e}\u0000${t}`;function b(e,t){v.add(y(e,t)),g()}function x(e,t){v.delete(y(e,t))&&g()}function S(e){return v.size===0?e:e.filter(e=>!v.has(y(e.scope,e.name)))}export{i as a,x as c,a as d,_ as f,s as i,d as l,b as n,g as o,m as p,u as r,p as s,S as t,c as u};
@@ -1 +1 @@
1
- import{Co as e,Do as t,xo as n}from"./dist-DRIvEATD2.js";import{d as r,f as i,p as a}from"./doc-paths-Dolz4CVF.js";import{t as o}from"./file-tree-rename-validation-DEz_ryBu.js";import{c as s,l as c,s as l}from"./file-tree-utils-Dx2E4Vvj.js";import{a as u}from"./navigation-targets-1hx64TtZ.js";var d=`application/x-open-knowledge-sidebar-item+json`,f={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0};function p(e){return JSON.stringify(e)}function m(e){return e?Array.from(e.types).includes(d):!1}function ee(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:a(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:r(e.assetPath)}:{target:u(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:i(e.docName)}}function h(e){if(!e||!m(e))return null;let t=e.getData(d);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!g(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!_(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _(e){return typeof e==`string`&&Object.hasOwn(f,e)}var v=`.md`,y=/\.(md|mdx)$/i;function b(t,r=v){return y.test(t)||e(t)||n(t)?t:`${t}${r}`}function x(e){return $(e).replace(y,``)}function S(e,t){let n=$(e),r=k(t),i=t.find(e=>s(e)&&A(e,r)===n)??t.find(e=>s(e)&&w(e)===n);if(i)return i.docName;let a=x(n);return t.find(e=>{let t=w(e);return t!==n&&y.test(t)&&x(t)===a})&&y.test(n)?n:a}function C(e,t){let n=k(t);return t.find(t=>A(t,n)===e)??t.find(t=>w(t)===e)}function w(e){return c(e)?D(e.path):l(e)?e.path:b(e.docName,e.docExt)}function T(e){let t=$(e).match(y);return t?`.${t[1].toLowerCase()}`:void 0}function E(e){return $(e)}function D(e){let t=$(e.trim());return t?`${t}/`:``}function O(e){return e.endsWith(`/`)?E(e):x(e)}function k(e){let t=new Map;for(let n of e){if(!s(n))continue;let e=n.docName.match(y);if(!e)continue;let r=n.docName.slice(0,-e[0].length),i=t.get(r);i?i.add(e[0]):t.set(r,new Set([e[0]]))}return t}function A(e,t){let n=w(e);if(!s(e))return n;let r=e.docName.match(y);if(!r)return n;let i=e.docName.slice(0,-r[0].length);return(t.get(i)?.size??0)>1?n:`${e.docName}${e.docExt??v}`}function j(e){let t=k(e),n=new Set,r=[];for(let i of e){let e=A(i,t);n.has(e)||(n.add(e),r.push(e))}return r}function M(e){return[...e].sort().join(`\0`)}function N(e){return M(j(e))}function P(e,t={}){let n=new Set;for(let r of e){let e=(c(r)||l(r)?r.path:r.docName).split(`/`).filter(Boolean);if(!t.includeOkFolders&&e.includes(`.ok`))continue;if(c(r)){let e=D(r.path);e&&n.add(e)}let i=c(r)?e.length:e.length-1;for(let t=1;t<=i;t++)n.add(`${e.slice(0,t).join(`/`)}/`)}return[...n].sort()}function F(e){if(!e)return[];let t=$(e.replace(y,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function I(e,t,n){let r=T(e);if(r)return r;let i=n.find(e=>s(e)&&e.docName===t);return i?i.docExt??v:Q(e).includes(`.`)?void 0:v}function L(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!l(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function R(e,t,n){if(T(e))return null;let r=n.find(e=>l(e)&&e.path===t);return r?r.path:Q(e).includes(`.`)?t:L(t,n)}function z(e,t){let n=e.kind===`directory`,r=n?E(e.path):S(e.path,t);if(n)return{kind:`folder`,name:$(Q(e.path)).replace(y,``),path:r,treePath:V(e.path,!0)};let i=R(e.path,r,t);if(i)return{kind:`asset`,name:$(Q(i)),path:i,treePath:i};let a=I(e.path,r,t);return{kind:`file`,name:$(Q(e.path)).replace(y,``),path:r,treePath:V(e.path,!1),docExt:a}}function B(e){return e.kind===`directory`?E(e.path):e.path}function V(e,t){return t?D(e):y.test(e)?e:`${e}${v}`}function H(e,t,n){let r=D(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${v}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function U(e,t){return e===`file`?V(t,!1):`${E(t)}/index${v}`}function W(e,t){return t.kind===`root`||t.directoryPath==null?Q(e):`${t.directoryPath}${Q(e)}`}function G(e,t){if(t)return E(D(e));let n=x(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function K(e,t){let n=E(D(e));return n?`${n}/${t}`:t}function q(e,t,n){e.append(`parentDocName`,K(t,n)),e.append(`placement`,`parent-dir`)}function J(e,t){return(t.path??K(e,t.src)).replace(/^\/+/,``)}function Y(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function X(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function Z(e,n){let r=o(e).toLowerCase();if(r===``)return null;let i=new Date().toISOString();if(r===`.md`||r===`.mdx`)return{kind:`document`,docName:x(e),docExt:r,modified:i,size:n.size};let a=r.startsWith(`.`)?r.slice(1):r;return{kind:`asset`,path:e,assetExt:a,mediaKind:t(a),modified:i,size:n.size}}function Q(e){let t=$(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function $(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{h as A,z as C,d as D,J as E,m as O,S,O as T,G as _,U as a,E as b,j as c,w as d,X as f,V as g,Y as h,W as i,p as j,ee as k,N as l,D as m,P as n,H as o,C as p,F as r,b as s,q as t,Z as u,B as v,M as w,x,L as y};
1
+ import{Co as e,Do as t,xo as n}from"./dist-D0lKV18u2.js";import{d as r,f as i,p as a}from"./doc-paths-BuYvs-Sl.js";import{t as o}from"./file-tree-rename-validation-DEz_ryBu.js";import{c as s,l as c,s as l}from"./file-tree-utils-DEJGOhLm.js";import{a as u}from"./navigation-targets-kcw1-114.js";var d=`application/x-open-knowledge-sidebar-item+json`,f={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0};function p(e){return JSON.stringify(e)}function m(e){return e?Array.from(e.types).includes(d):!1}function ee(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:a(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:r(e.assetPath)}:{target:u(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:i(e.docName)}}function h(e){if(!e||!m(e))return null;let t=e.getData(d);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!g(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!_(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _(e){return typeof e==`string`&&Object.hasOwn(f,e)}var v=`.md`,y=/\.(md|mdx)$/i;function b(t,r=v){return y.test(t)||e(t)||n(t)?t:`${t}${r}`}function x(e){return $(e).replace(y,``)}function S(e,t){let n=$(e),r=k(t),i=t.find(e=>s(e)&&A(e,r)===n)??t.find(e=>s(e)&&w(e)===n);if(i)return i.docName;let a=x(n);return t.find(e=>{let t=w(e);return t!==n&&y.test(t)&&x(t)===a})&&y.test(n)?n:a}function C(e,t){let n=k(t);return t.find(t=>A(t,n)===e)??t.find(t=>w(t)===e)}function w(e){return c(e)?D(e.path):l(e)?e.path:b(e.docName,e.docExt)}function T(e){let t=$(e).match(y);return t?`.${t[1].toLowerCase()}`:void 0}function E(e){return $(e)}function D(e){let t=$(e.trim());return t?`${t}/`:``}function O(e){return e.endsWith(`/`)?E(e):x(e)}function k(e){let t=new Map;for(let n of e){if(!s(n))continue;let e=n.docName.match(y);if(!e)continue;let r=n.docName.slice(0,-e[0].length),i=t.get(r);i?i.add(e[0]):t.set(r,new Set([e[0]]))}return t}function A(e,t){let n=w(e);if(!s(e))return n;let r=e.docName.match(y);if(!r)return n;let i=e.docName.slice(0,-r[0].length);return(t.get(i)?.size??0)>1?n:`${e.docName}${e.docExt??v}`}function j(e){let t=k(e),n=new Set,r=[];for(let i of e){let e=A(i,t);n.has(e)||(n.add(e),r.push(e))}return r}function M(e){return[...e].sort().join(`\0`)}function N(e){return M(j(e))}function P(e,t={}){let n=new Set;for(let r of e){let e=(c(r)||l(r)?r.path:r.docName).split(`/`).filter(Boolean);if(!t.includeOkFolders&&e.includes(`.ok`))continue;if(c(r)){let e=D(r.path);e&&n.add(e)}let i=c(r)?e.length:e.length-1;for(let t=1;t<=i;t++)n.add(`${e.slice(0,t).join(`/`)}/`)}return[...n].sort()}function F(e){if(!e)return[];let t=$(e.replace(y,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function I(e,t,n){let r=T(e);if(r)return r;let i=n.find(e=>s(e)&&e.docName===t);return i?i.docExt??v:Q(e).includes(`.`)?void 0:v}function L(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!l(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function R(e,t,n){if(T(e))return null;let r=n.find(e=>l(e)&&e.path===t);return r?r.path:Q(e).includes(`.`)?t:L(t,n)}function z(e,t){let n=e.kind===`directory`,r=n?E(e.path):S(e.path,t);if(n)return{kind:`folder`,name:$(Q(e.path)).replace(y,``),path:r,treePath:V(e.path,!0)};let i=R(e.path,r,t);if(i)return{kind:`asset`,name:$(Q(i)),path:i,treePath:i};let a=I(e.path,r,t);return{kind:`file`,name:$(Q(e.path)).replace(y,``),path:r,treePath:V(e.path,!1),docExt:a}}function B(e){return e.kind===`directory`?E(e.path):e.path}function V(e,t){return t?D(e):y.test(e)?e:`${e}${v}`}function H(e,t,n){let r=D(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${v}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function U(e,t){return e===`file`?V(t,!1):`${E(t)}/index${v}`}function W(e,t){return t.kind===`root`||t.directoryPath==null?Q(e):`${t.directoryPath}${Q(e)}`}function G(e,t){if(t)return E(D(e));let n=x(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function K(e,t){let n=E(D(e));return n?`${n}/${t}`:t}function q(e,t,n){e.append(`parentDocName`,K(t,n)),e.append(`placement`,`parent-dir`)}function J(e,t){return(t.path??K(e,t.src)).replace(/^\/+/,``)}function Y(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function X(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function Z(e,n){let r=o(e).toLowerCase();if(r===``)return null;let i=new Date().toISOString();if(r===`.md`||r===`.mdx`)return{kind:`document`,docName:x(e),docExt:r,modified:i,size:n.size};let a=r.startsWith(`.`)?r.slice(1):r;return{kind:`asset`,path:e,assetExt:a,mediaKind:t(a),modified:i,size:n.size}}function Q(e){let t=$(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function $(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{h as A,z as C,d as D,J as E,m as O,S,O as T,G as _,U as a,E as b,j as c,w as d,X as f,V as g,Y as h,W as i,p as j,ee as k,N as l,D as m,P as n,H as o,C as p,F as r,b as s,q as t,Z as u,B as v,M as w,x,L as y};
@@ -1 +1 @@
1
- import{Pa as e,mr as t}from"./dist-DRIvEATD2.js";function n(e){return e.kind===`asset`}function r(e){return e.kind===`document`}function i(e){return e.kind===`folder`}function a(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??o(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function o(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function s(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function c(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function l(e){return e.split(`/`).some(e=>e.toLowerCase()===`.ok`)}function u(e,t){return t&&e!==`document`&&e!==`folder`}function d(e,n){return!n&&t(e)}function f(e,n={}){let{showHiddenFiles:r=!1,showOnlyMarkdownFiles:i=!1,showOkFolders:a=!1}=n;return e.filter(e=>{let n=e.docName??e.path??``;if(n===``||u(e.kind,i))return!1;let o=n.split(`/`),s=o.indexOf(`.ok`);if(s!==-1){if(!a)return!1;let e=o.slice(0,s).join(`/`);return r||e===``||!t(e)}return!d(n,r)})}function p(t,n={}){let{showHiddenFiles:r=!1,showOnlyMarkdownFiles:i=!1}=n,a=t.docName??t.path??``;return a===``||e(a)||l(a)?{hiddenFiles:!1,onlyMarkdownFiles:!1}:{hiddenFiles:d(a,r),onlyMarkdownFiles:u(t.kind,i)}}function m(e){let{visibility:t={},unfilteredRootEntryCount:n,knownPageCount:r}=e;return(n>0||r>0)&&(t.showOnlyMarkdownFiles??!1)?`filtered-to-zero`:`true-empty`}export{f as a,r as c,a as d,c as i,i as l,m as n,l as o,s as r,n as s,p as t,o as u};
1
+ import{Pa as e,mr as t}from"./dist-D0lKV18u2.js";function n(e){return e.kind===`asset`}function r(e){return e.kind===`document`}function i(e){return e.kind===`folder`}function a(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??o(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function o(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function s(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function c(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function l(e){return e.split(`/`).some(e=>e.toLowerCase()===`.ok`)}function u(e,t){return t&&e!==`document`&&e!==`folder`}function d(e,n){return!n&&t(e)}function f(e,n={}){let{showHiddenFiles:r=!1,showOnlyMarkdownFiles:i=!1,showOkFolders:a=!1}=n;return e.filter(e=>{let n=e.docName??e.path??``;if(n===``||u(e.kind,i))return!1;let o=n.split(`/`),s=o.indexOf(`.ok`);if(s!==-1){if(!a)return!1;let e=o.slice(0,s).join(`/`);return r||e===``||!t(e)}return!d(n,r)})}function p(t,n={}){let{showHiddenFiles:r=!1,showOnlyMarkdownFiles:i=!1}=n,a=t.docName??t.path??``;return a===``||e(a)||l(a)?{hiddenFiles:!1,onlyMarkdownFiles:!1}:{hiddenFiles:d(a,r),onlyMarkdownFiles:u(t.kind,i)}}function m(e){let{visibility:t={},unfilteredRootEntryCount:n,knownPageCount:r}=e;return(n>0||r>0)&&(t.showOnlyMarkdownFiles??!1)?`filtered-to-zero`:`true-empty`}export{f as a,r as c,a as d,c as i,i as l,m as n,l as o,s as r,n as s,p as t,o as u};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-BbgVV4EV.js";import{t}from"./parse-api-error-BFe1cdS7.js";import{s as n}from"./documents-events-Cur796tS.js";var r=e(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]);async function i(e){return t(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function a(e,t){try{let n=await fetch(`/api/folder-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e,frontmatter:t})});return n.ok?{ok:!0}:{ok:!1,error:await i(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function o(e){try{let t=await fetch(`/api/template`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function s(e,t){try{let r=`?folder=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,a=await fetch(`/api/template${r}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await i(a)};let o=await a.json().catch(()=>null);return n(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function c(e){try{let t=await fetch(`/api/template`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,committed:r?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(e){try{let t=await fetch(`/api/template/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,path:r?.path??``,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{o as a,a as i,l as n,r as o,c as r,s as t};
1
+ import{t as e}from"./createLucideIcon-BbgVV4EV.js";import{t}from"./parse-api-error-BFe1cdS7.js";import{s as n}from"./documents-events-CZXYlWJs.js";var r=e(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]);async function i(e){return t(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function a(e,t){try{let n=await fetch(`/api/folder-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e,frontmatter:t})});return n.ok?{ok:!0}:{ok:!1,error:await i(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function o(e){try{let t=await fetch(`/api/template`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function s(e,t){try{let r=`?folder=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,a=await fetch(`/api/template${r}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await i(a)};let o=await a.json().catch(()=>null);return n(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function c(e){try{let t=await fetch(`/api/template`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,committed:r?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(e){try{let t=await fetch(`/api/template/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,path:r?.path??``,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{o as a,a as i,l as n,r as o,c as r,s as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{zn as n}from"./DocumentContext-DZ-0wJn3.js";import{t as r}from"./react-f2sANaYj.js";import{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{r as s,t as c}from"./button-RQ5o7P7w.js";import{t as l}from"./separator-C4EdGs_S.js";import{t as u}from"./x-B3zGPHCO.js";var d=a(),f=t(),p=s(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function m(e){let t=(0,d.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=o(p({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let s;return t[7]!==r||t[8]!==i||t[9]!==a?(s=(0,f.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":r,className:a,...i}),t[7]=r,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function h(e){let t=(0,d.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,s;t[4]===n?s=t[5]:(s=o(`relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto`,n),t[4]=n,t[5]=s);let c;return t[6]!==a||t[7]!==r||t[8]!==s?(c=(0,f.jsx)(l,{"data-slot":`button-group-separator`,orientation:a,className:s,...r}),t[6]=a,t[7]=r,t[8]=s,t[9]=c):c=t[9],c}var g=`button, a[href], [role="menuitem"], [role="button"], input, textarea, select, [contenteditable="true"]`;function _(e,t){e.target instanceof HTMLElement&&(!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.contains(e.target)||e.target.closest(g)||(e.preventDefault(),t.current?.focus()))}var v=e(r(),1);function y(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function b(e){let t=(0,d.c)(21),{path:r,onRemove:a}=e,{_:o}=i(),s,l;t[0]!==o||t[1]!==r?(s=y(r),l=o({id:`hnq8fP`,values:{label:s}}),t[0]=o,t[1]=r,t[2]=s,t[3]=l):(s=t[2],l=t[3]);let p=l,m=`composer-context-chip-file-${r}`,h;t[4]===a?h=t[5]:(h=e=>{(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),a())},t[4]=a,t[5]=h);let g;t[6]===r?g=t[7]:(g=(0,f.jsx)(`span`,{className:`absolute top-1/2 left-1/2 inline-flex size-3 -translate-x-1/2 -translate-y-1/2 opacity-100 transition-opacity duration-150 ease-out group-hover/chip:opacity-0 group-focus-within/chip:opacity-0 motion-reduce:transition-none`,children:(0,f.jsx)(n,{path:r,className:`size-3`,showExtensionBadge:!1})}),t[6]=r,t[7]=g);let _;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,f.jsx)(u,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-150 ease-out group-hover/chip:opacity-100 group-focus-within/chip:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0}),t[8]=_):_=t[8];let v;t[9]!==a||t[10]!==p||t[11]!==h||t[12]!==g?(v=(0,f.jsxs)(c,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":p,onClick:a,onKeyDown:h,className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[g,_]}),t[9]=a,t[10]=p,t[11]=h,t[12]=g,t[13]=v):v=t[13];let b;t[14]===s?b=t[15]:(b=(0,f.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[14]=s,t[15]=b);let x;return t[16]!==r||t[17]!==m||t[18]!==v||t[19]!==b?(x=(0,f.jsxs)(`span`,{"data-testid":m,title:r,className:`group/chip inline-flex max-w-[14rem] items-center gap-1 rounded-md border bg-muted/40 py-0.5 pr-1.5 pl-1 text-muted-foreground text-xs`,children:[v,b]}),t[16]=r,t[17]=m,t[18]=v,t[19]=b,t[20]=x):x=t[20],x}function x(e){let t=(0,d.c)(13),{files:n,onRemoveFile:r,className:i,children:a}=e,s;t[0]===n?s=t[1]:(s=n===void 0?[]:n,t[0]=n,t[1]=s);let c=s;if(c.length===0&&v.Children.toArray(a).length===0)return null;let l;t[2]===i?l=t[3]:(l=o(`flex flex-wrap items-center gap-1`,i),t[2]=i,t[3]=l);let u;if(t[4]!==c||t[5]!==r){let e;t[7]===r?e=t[8]:(e=e=>(0,f.jsx)(b,{path:e,onRemove:()=>r?.(e)},e),t[7]=r,t[8]=e),u=c.map(e),t[4]=c,t[5]=r,t[6]=u}else u=t[6];let p;return t[9]!==a||t[10]!==l||t[11]!==u?(p=(0,f.jsxs)(`div`,{className:l,"data-testid":`composer-context-chips`,children:[u,a]}),t[9]=a,t[10]=l,t[11]=u,t[12]=p):p=t[12],p}function S(){let e=(0,d.c)(2),[t,n]=(0,v.useState)(C),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);n(e.matches);let t=e=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,v.useEffect)(r,i),t}function C(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var w=`ok-acp-follow-file-v1`;function T(){try{return localStorage.getItem(w)!==`0`}catch{return!0}}function E(e){try{localStorage.setItem(w,e?`1`:`0`)}catch{}}function D(e){return e===``||e.startsWith(`/`)||e.startsWith(`\\`)||e.split(`/`).some(e=>e===``||e.startsWith(`.`))?null:e}function O(e,t){let n=t.pathSeparator,r=e=>n===`\\`?e.replaceAll(`\\`,`/`):e,i=r(t.contentDir).replace(/\/$/,``),a=r(e);if(!a.startsWith(`${i}/`))return null;let o=a.slice(i.length+1),s=/\.(md|mdx)$/.exec(o);return s===null?null:D(o.slice(0,-s[0].length))}function k(e,t){let n=e[t];return typeof n==`string`&&n!==``?n:null}var A=new Set([`cat`,`ls`,`grep`,`rg`,`find`,`head`,`tail`,`wc`,`sort`,`uniq`,`cut`,`sed`,`awk`,`bat`,`less`,`more`]);function j(e,t){let n=[],r=/"([^"]*)"|'([^']*)'|(\S+)/g,i=r.exec(e);for(;i!==null;)n.push(i[1]??i[2]??i[3]??``),i=r.exec(e);let a=n[0];if(a===void 0||!A.has(a))return null;for(let e of n.slice(1)){if(e.startsWith(`-`)||/[*?[\]]/.test(e))continue;let n=/\.(md|mdx)$/i.exec(e);if(n===null)continue;if(e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)){if(t!==null){let n=O(e,t);if(n!==null)return n}continue}let r=D(e.replace(/^\.\//,``).slice(0,-n[0].length));if(r!==null)return r}return null}function M(e){if(typeof e!=`object`||!e)return null;let t=e,n=k(t,`tool`)??k(t,`name`),r=t;if(typeof t.arguments==`object`&&t.arguments!==null)r=t.arguments;else if(typeof t.arguments==`string`)try{let e=JSON.parse(t.arguments);typeof e==`object`&&e&&(r=e)}catch{}return{tool:n,args:r}}function N(e,t,n,r){let i=M(e);if(i===null)return null;let{tool:a,args:o}=i;if(a===`delete`||a===null&&/\bdelete\b/i.test(t))return null;let s=typeof o.document==`object`&&o.document!==null?o.document:null,c=null;if(Array.isArray(o.documents))for(let e=o.documents.length-1;e>=0;e--){let t=o.documents[e];if(typeof t==`object`&&t){c=t;break}}let l=(s===null?null:k(s,`path`))??(c===null?null:k(c,`path`))??k(o,`to`)??k(o,`docName`);if(l!==null)return D(l.replace(/\.(md|mdx)$/,``));let u=k(o,`command`);if(u!==null){let e=j(u,n);return e!==null&&r.commandTargetExists!==void 0&&!r.commandTargetExists(e)?null:e}return null}function P(e,t,n={}){if(e.toolKind===`delete`)return null;let r=N(e.rawInput,e.title,t,n);if(r!==null)return r;if(t===null)return null;for(let n=e.locations.length-1;n>=0;n--){let r=e.locations[n];if(r===void 0)continue;let i=O(r.path,t);if(i!==null)return i}return null}function F(e,t,n={}){let r=null;for(let i of e){if(i.kind!==`tool_call`)continue;let e=P(i,t,n);e!==null&&(r=e)}return r}export{S as a,m as c,E as i,h as l,T as n,x as o,D as r,_ as s,F as t};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{zn as n}from"./DocumentContext-CcK-mNAi.js";import{t as r}from"./react-f2sANaYj.js";import{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{r as s,t as c}from"./button-RQ5o7P7w.js";import{t as l}from"./separator-C4EdGs_S.js";import{t as u}from"./x-B3zGPHCO.js";var d=a(),f=t(),p=s(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function m(e){let t=(0,d.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=o(p({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let s;return t[7]!==r||t[8]!==i||t[9]!==a?(s=(0,f.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":r,className:a,...i}),t[7]=r,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function h(e){let t=(0,d.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,s;t[4]===n?s=t[5]:(s=o(`relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto`,n),t[4]=n,t[5]=s);let c;return t[6]!==a||t[7]!==r||t[8]!==s?(c=(0,f.jsx)(l,{"data-slot":`button-group-separator`,orientation:a,className:s,...r}),t[6]=a,t[7]=r,t[8]=s,t[9]=c):c=t[9],c}var g=`button, a[href], [role="menuitem"], [role="button"], input, textarea, select, [contenteditable="true"]`;function _(e,t){e.target instanceof HTMLElement&&(!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.contains(e.target)||e.target.closest(g)||(e.preventDefault(),t.current?.focus()))}var v=e(r(),1);function y(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function b(e){let t=(0,d.c)(21),{path:r,onRemove:a}=e,{_:o}=i(),s,l;t[0]!==o||t[1]!==r?(s=y(r),l=o({id:`hnq8fP`,values:{label:s}}),t[0]=o,t[1]=r,t[2]=s,t[3]=l):(s=t[2],l=t[3]);let p=l,m=`composer-context-chip-file-${r}`,h;t[4]===a?h=t[5]:(h=e=>{(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),a())},t[4]=a,t[5]=h);let g;t[6]===r?g=t[7]:(g=(0,f.jsx)(`span`,{className:`absolute top-1/2 left-1/2 inline-flex size-3 -translate-x-1/2 -translate-y-1/2 opacity-100 transition-opacity duration-150 ease-out group-hover/chip:opacity-0 group-focus-within/chip:opacity-0 motion-reduce:transition-none`,children:(0,f.jsx)(n,{path:r,className:`size-3`,showExtensionBadge:!1})}),t[6]=r,t[7]=g);let _;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,f.jsx)(u,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-150 ease-out group-hover/chip:opacity-100 group-focus-within/chip:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0}),t[8]=_):_=t[8];let v;t[9]!==a||t[10]!==p||t[11]!==h||t[12]!==g?(v=(0,f.jsxs)(c,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":p,onClick:a,onKeyDown:h,className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[g,_]}),t[9]=a,t[10]=p,t[11]=h,t[12]=g,t[13]=v):v=t[13];let b;t[14]===s?b=t[15]:(b=(0,f.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[14]=s,t[15]=b);let x;return t[16]!==r||t[17]!==m||t[18]!==v||t[19]!==b?(x=(0,f.jsxs)(`span`,{"data-testid":m,title:r,className:`group/chip inline-flex max-w-[14rem] items-center gap-1 rounded-md border bg-muted/40 py-0.5 pr-1.5 pl-1 text-muted-foreground text-xs`,children:[v,b]}),t[16]=r,t[17]=m,t[18]=v,t[19]=b,t[20]=x):x=t[20],x}function x(e){let t=(0,d.c)(13),{files:n,onRemoveFile:r,className:i,children:a}=e,s;t[0]===n?s=t[1]:(s=n===void 0?[]:n,t[0]=n,t[1]=s);let c=s;if(c.length===0&&v.Children.toArray(a).length===0)return null;let l;t[2]===i?l=t[3]:(l=o(`flex flex-wrap items-center gap-1`,i),t[2]=i,t[3]=l);let u;if(t[4]!==c||t[5]!==r){let e;t[7]===r?e=t[8]:(e=e=>(0,f.jsx)(b,{path:e,onRemove:()=>r?.(e)},e),t[7]=r,t[8]=e),u=c.map(e),t[4]=c,t[5]=r,t[6]=u}else u=t[6];let p;return t[9]!==a||t[10]!==l||t[11]!==u?(p=(0,f.jsxs)(`div`,{className:l,"data-testid":`composer-context-chips`,children:[u,a]}),t[9]=a,t[10]=l,t[11]=u,t[12]=p):p=t[12],p}function S(){let e=(0,d.c)(2),[t,n]=(0,v.useState)(C),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);n(e.matches);let t=e=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,v.useEffect)(r,i),t}function C(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var w=`ok-acp-follow-file-v1`;function T(){try{return localStorage.getItem(w)!==`0`}catch{return!0}}function E(e){try{localStorage.setItem(w,e?`1`:`0`)}catch{}}function D(e){return e===``||e.startsWith(`/`)||e.startsWith(`\\`)||e.split(`/`).some(e=>e===``||e.startsWith(`.`))?null:e}function O(e,t){let n=t.pathSeparator,r=e=>n===`\\`?e.replaceAll(`\\`,`/`):e,i=r(t.contentDir).replace(/\/$/,``),a=r(e);if(!a.startsWith(`${i}/`))return null;let o=a.slice(i.length+1),s=/\.(md|mdx)$/.exec(o);return s===null?null:D(o.slice(0,-s[0].length))}function k(e,t){let n=e[t];return typeof n==`string`&&n!==``?n:null}var A=new Set([`cat`,`ls`,`grep`,`rg`,`find`,`head`,`tail`,`wc`,`sort`,`uniq`,`cut`,`sed`,`awk`,`bat`,`less`,`more`]);function j(e,t){let n=[],r=/"([^"]*)"|'([^']*)'|(\S+)/g,i=r.exec(e);for(;i!==null;)n.push(i[1]??i[2]??i[3]??``),i=r.exec(e);let a=n[0];if(a===void 0||!A.has(a))return null;for(let e of n.slice(1)){if(e.startsWith(`-`)||/[*?[\]]/.test(e))continue;let n=/\.(md|mdx)$/i.exec(e);if(n===null)continue;if(e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)){if(t!==null){let n=O(e,t);if(n!==null)return n}continue}let r=D(e.replace(/^\.\//,``).slice(0,-n[0].length));if(r!==null)return r}return null}function M(e){if(typeof e!=`object`||!e)return null;let t=e,n=k(t,`tool`)??k(t,`name`),r=t;if(typeof t.arguments==`object`&&t.arguments!==null)r=t.arguments;else if(typeof t.arguments==`string`)try{let e=JSON.parse(t.arguments);typeof e==`object`&&e&&(r=e)}catch{}return{tool:n,args:r}}function N(e,t,n,r){let i=M(e);if(i===null)return null;let{tool:a,args:o}=i;if(a===`delete`||a===null&&/\bdelete\b/i.test(t))return null;let s=typeof o.document==`object`&&o.document!==null?o.document:null,c=null;if(Array.isArray(o.documents))for(let e=o.documents.length-1;e>=0;e--){let t=o.documents[e];if(typeof t==`object`&&t){c=t;break}}let l=(s===null?null:k(s,`path`))??(c===null?null:k(c,`path`))??k(o,`to`)??k(o,`docName`);if(l!==null)return D(l.replace(/\.(md|mdx)$/,``));let u=k(o,`command`);if(u!==null){let e=j(u,n);return e!==null&&r.commandTargetExists!==void 0&&!r.commandTargetExists(e)?null:e}return null}function P(e,t,n={}){if(e.toolKind===`delete`)return null;let r=N(e.rawInput,e.title,t,n);if(r!==null)return r;if(t===null)return null;for(let n=e.locations.length-1;n>=0;n--){let r=e.locations[n];if(r===void 0)continue;let i=O(r.path,t);if(i!==null)return i}return null}function F(e,t,n={}){let r=null;for(let i of e){if(i.kind!==`tool_call`)continue;let e=P(i,t,n);e!==null&&(r=e)}return r}export{S as a,m as c,E as i,h as l,T as n,x as o,D as r,_ as s,F as t};