@inkeep/open-knowledge 0.86.15 → 0.86.16

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 (103) hide show
  1. package/dist/assets/skills/project/references/media-and-assets.md +1 -1
  2. package/dist/cli.mjs +6 -6
  3. package/dist/config-schema.json +1 -1
  4. package/dist/config.project.schema.json +1 -1
  5. package/dist/constants-CqNABsZB.mjs +1 -0
  6. package/dist/{dist-fzYMjYEW.mjs → dist-BNPpubXf.mjs} +1 -1
  7. package/dist/{dist-CerHybyM.mjs → dist-CvZCvtXe.mjs} +4 -4
  8. package/dist/index.mjs +2 -2
  9. package/dist/init-C99xOULP.mjs +1 -0
  10. package/dist/{init-D_Mnfn9S.mjs → init-RmBoT2PK.mjs} +2 -2
  11. package/dist/{launch-json-removal-DF78Zb2V.mjs → launch-json-removal-CctovJFV.mjs} +1 -1
  12. package/dist/loader-BVSrV694.mjs +1 -0
  13. package/dist/{loader-EPi5ZErh.mjs → loader-CPblhk01.mjs} +1 -1
  14. package/dist/{md-manager-BGnqyqi1-B6Vk34FK.mjs → md-manager-BGnqyqi1-DRBNLmLZ.mjs} +1 -1
  15. package/dist/{open-browser-BL65djdM.mjs → open-browser-DU_gU7KC.mjs} +1 -1
  16. package/dist/parse-worker.mjs +1 -1
  17. package/dist/preview-DkSS1KD_.mjs +1 -0
  18. package/dist/{preview-D9iu9mhV.mjs → preview-rK0HPHCM.mjs} +1 -1
  19. package/dist/public/assets/{AccountSection-BG0_TO2e.js → AccountSection-CQ3MoAiu.js} +1 -1
  20. package/dist/public/assets/{ActivityModeContent-DX7qnelJ.js → ActivityModeContent-7yA_LDxD.js} +1 -1
  21. package/dist/public/assets/{AddPropertiesButton-ISpK9Zho.js → AddPropertiesButton-bukgzoDX.js} +1 -1
  22. package/dist/public/assets/{AgentDiffPane-BUMpUwLF.js → AgentDiffPane-stzSbdBy.js} +1 -1
  23. package/dist/public/assets/{AttachmentsSection-CN5du-Ku.js → AttachmentsSection-8I8Nxe0M.js} +1 -1
  24. package/dist/public/assets/{CodeMirrorPropInput-Bbv8fSFU.js → CodeMirrorPropInput-CezfVY4H.js} +1 -1
  25. package/dist/public/assets/{ContentRulesSection-C9IeMwCS.js → ContentRulesSection-Ci2czTjF.js} +1 -1
  26. package/dist/public/assets/{DocumentContext-Di4xaMwl.js → DocumentContext-BB0nKfep.js} +1 -1
  27. package/dist/public/assets/{EditorModeToggle-AVuI8ebZ.js → EditorModeToggle-DYuuX6dO.js} +1 -1
  28. package/dist/public/assets/{ExcalidrawDocEditor-Ce86s-v8.js → ExcalidrawDocEditor-4yYSBe14.js} +1 -1
  29. package/dist/public/assets/FeedbackForm-Cfrx5H9R.js +1 -0
  30. package/dist/public/assets/{ImportSkillDialog-YCivM6Y8.js → ImportSkillDialog-CbVOxKm9.js} +1 -1
  31. package/dist/public/assets/{LinkPreviewsSection-DgK68AAA.js → LinkPreviewsSection-eJeiL-G6.js} +1 -1
  32. package/dist/public/assets/{LintConfigEditor-CEnWskLc.js → LintConfigEditor-B08bIlPA.js} +1 -1
  33. package/dist/public/assets/{LintingSection-DfdRWFJl.js → LintingSection-CgdZ2qC8.js} +1 -1
  34. package/dist/public/assets/{ManagedArtifactProperties-GW5LIoca.js → ManagedArtifactProperties-CHNAj6L4.js} +1 -1
  35. package/dist/public/assets/ManagedArtifactProperties-sRiQX_v3.js +1 -0
  36. package/dist/public/assets/{MermaidDocEditor-pBnfScXw.js → MermaidDocEditor-BfwKbHcc.js} +1 -1
  37. package/dist/public/assets/{NetworkAccessSection-COAzJ4e0.js → NetworkAccessSection-B_pi2Qal.js} +1 -1
  38. package/dist/public/assets/{PropertyDisplayRow-DoYx80d4.js → PropertyDisplayRow-Ch2yOLBv.js} +1 -1
  39. package/dist/public/assets/{PublishToGitHubDialog-J-VGefwl.js → PublishToGitHubDialog-Buo-KPJx.js} +1 -1
  40. package/dist/public/assets/{SchemaConfigEditor-BXEY5Lpc.js → SchemaConfigEditor-iDGqAzG4.js} +1 -1
  41. package/dist/public/assets/{SearchSection-DfIFmawW.js → SearchSection-C1RHTjy5.js} +1 -1
  42. package/dist/public/assets/{SessionsHost-DaPpTHog.js → SessionsHost-BQ-iaohc.js} +2 -2
  43. package/dist/public/assets/{SettingsDialogBody-CYvW19u7.js → SettingsDialogBody-DoYZUwsg.js} +2 -2
  44. package/dist/public/assets/{ShareReceiveMissDialog-Cw9ITE2h.js → ShareReceiveMissDialog-DzZbDaXI.js} +1 -1
  45. package/dist/public/assets/{SkillToolbarControls-CuTnMhoM.js → SkillToolbarControls-ChlOZJXQ.js} +1 -1
  46. package/dist/public/assets/{SourceEditor-DzijW0O3.js → SourceEditor-CofwPhEl.js} +1 -1
  47. package/dist/public/assets/{SpellingSettings-DH0T6Q-0.js → SpellingSettings-D6u6jJWL.js} +1 -1
  48. package/dist/public/assets/{SyncSection-D-yuvsEP.js → SyncSection-DLhKIpvC.js} +1 -1
  49. package/dist/public/assets/{SyncStatusBadge-DDXV7fc_.js → SyncStatusBadge-wVSPKrjz.js} +1 -1
  50. package/dist/public/assets/{TerminalSection-B35_ovK-.js → TerminalSection-xlIDaFSJ.js} +1 -1
  51. package/dist/public/assets/{TerminalWindowApp-DVlYGRoh.js → TerminalWindowApp-CHxli66i.js} +1 -1
  52. package/dist/public/assets/{TextDocEditor-D9oE75zl.js → TextDocEditor-DBbmicjx.js} +1 -1
  53. package/dist/public/assets/{ThemePluginSection-1CRBX5E8.js → ThemePluginSection-08z6uhJY.js} +1 -1
  54. package/dist/public/assets/{ThreadView-BQnQfd0I.js → ThreadView-DdYuP5Fq.js} +1 -1
  55. package/dist/public/assets/{TimelineDiffPane-Dri7SUVQ.js → TimelineDiffPane-BIGIL6Fc.js} +1 -1
  56. package/dist/public/assets/{client-version-BYVa8AIr.js → client-version-nR7-m4d2.js} +1 -1
  57. package/dist/public/assets/{comment-chips-EHSRiXz3.js → comment-chips-CwpaKWgF.js} +1 -1
  58. package/dist/public/assets/{config-provider-kLYQhPYp.js → config-provider-maC-s8nJ.js} +1 -1
  59. package/dist/public/assets/config-schema-BranunPO.js +1 -0
  60. package/dist/public/assets/{doc-undo-manager-HTjJCKce.js → doc-undo-manager-CMNnHa17.js} +1 -1
  61. package/dist/public/assets/{field-controls-e2mA3LBp.js → field-controls-7M8rxNa1.js} +1 -1
  62. package/dist/public/assets/field-controls-B4v3SIzn.js +1 -0
  63. package/dist/public/assets/{index-9UmK6oDx.js → index-1J1mB1rq.js} +8 -8
  64. package/dist/public/assets/{lint-config-client-Wa2rYzej.js → lint-config-client-BXxJgiMj.js} +1 -1
  65. package/dist/public/assets/{lint-plugins-B9OFl9DC.js → lint-plugins-IzY40E-g.js} +1 -1
  66. package/dist/public/assets/{markdown-lint-BgDulTY0.js → markdown-lint-CnxqlpxD.js} +1 -1
  67. package/dist/public/assets/{markdownlint-rule-browser-a9COyrB0.js → markdownlint-rule-browser-Ca0LiFxs.js} +1 -1
  68. package/dist/public/assets/{pending-receive-nav-store-DRuzqurs.js → pending-receive-nav-store-CtyTO1zl.js} +1 -1
  69. package/dist/public/assets/{preferred-session-events-Cwvz3DYB.js → preferred-session-events-BEFdeskN.js} +1 -1
  70. package/dist/public/assets/{progress-DJDyKmOT.js → progress-CjLBpKVA.js} +1 -1
  71. package/dist/public/assets/saved-themes-client-L2ZZOn0Z.js +1 -0
  72. package/dist/public/assets/{schema-section-D0TwA1wk.js → schema-section-BCQI08Fz.js} +1 -1
  73. package/dist/public/assets/{selection-context-BiltXMSS.js → selection-context-QohlVBby.js} +1 -1
  74. package/dist/public/assets/{src-CpVL1MXA.js → src-eD2YcFLO.js} +1 -1
  75. package/dist/public/assets/{telemetry-impl-tfAX1CTp.js → telemetry-impl-DbEbLICB.js} +1 -1
  76. package/dist/public/assets/{telemetry-startup-Kz3A4OMo.js → telemetry-startup-Bklp1VJg.js} +1 -1
  77. package/dist/public/assets/{typing-burst-detector-DCLWi61a.js → typing-burst-detector-l0s7Bvng.js} +1 -1
  78. package/dist/public/assets/{use-activity-panel-Betx0VB5.js → use-activity-panel-MWNz0jP2.js} +1 -1
  79. package/dist/public/assets/{use-open-skill-Qib9eMlk.js → use-open-skill-w9Yc1dgu.js} +1 -1
  80. package/dist/public/assets/{use-terminal-enabled-CVVMal6F.js → use-terminal-enabled-D4Z_JsJ9.js} +1 -1
  81. package/dist/public/assets/{use-timeline-entry-diff-C2kQsAEV.js → use-timeline-entry-diff-CgmegStH.js} +1 -1
  82. package/dist/public/index.html +21 -21
  83. package/dist/{registry-probes-xhAfEfyJ.mjs → registry-probes-CQJWD_N1.mjs} +1 -1
  84. package/dist/{removal-file-path-Cck6aRSq.mjs → removal-file-path-FZgRZJMq.mjs} +1 -1
  85. package/dist/{repair-launch-json-CwNpvI1_.mjs → repair-launch-json-YXWJ7404.mjs} +1 -1
  86. package/dist/{repair-mcp-configs-BJuIMxPX.mjs → repair-mcp-configs-qFDKov51.mjs} +1 -1
  87. package/dist/schemas/v0/config.project.schema.json +1 -1
  88. package/dist/{src-P3X9-4mK.mjs → src-B4Ppfouc.mjs} +1 -1
  89. package/dist/src-BgQTBEn_.mjs +1 -0
  90. package/dist/start-BBEHhUC8.mjs +1 -0
  91. package/dist/{start-W6HfLGEn.mjs → start-BOXkkd5Z.mjs} +3 -3
  92. package/package.json +4 -4
  93. package/dist/constants-Big4uVC4.mjs +0 -1
  94. package/dist/init-DpWQMxOd.mjs +0 -1
  95. package/dist/loader-D5rR-ONY.mjs +0 -1
  96. package/dist/preview-ClW6A8dv.mjs +0 -1
  97. package/dist/public/assets/FeedbackForm-BZSwiBHE.js +0 -1
  98. package/dist/public/assets/ManagedArtifactProperties-CPP8NsrT.js +0 -1
  99. package/dist/public/assets/config-schema-B4_7xb9l.js +0 -1
  100. package/dist/public/assets/field-controls-B1UqOPPr.js +0 -1
  101. package/dist/public/assets/saved-themes-client-CdTWCmn6.js +0 -1
  102. package/dist/src-DkA3OkNb.mjs +0 -1
  103. package/dist/start-Bqg3TrSD.mjs +0 -1
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dist-D5mDCusD.js","./chunk-CYidjpOJ.js","./dist-D2SphF3p.js","./w3c-keyname-C7Rznu6R.js","./dist-BxTTaZ5o.js","./dist-BkE9d74i.js","./dist-DWPb_cwe.js","./dist-DKYEqMZn.js","./dist-B1FVlkOu.js","./stex-CUzil_LB.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{r as i}from"./dist-Nvb76hAm.js";import{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./react-dom-DPxgxlDT.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{n as c,t as l}from"./with-selector-zVo3Fruj.js";import{a as u,d,i as f,l as p,r as m,u as h}from"./floating-ui.dom-DkPPH5vF.js";import{a as g,d as _,g as v,i as y,l as b,n as x,o as S,r as C,t as w,u as T}from"./constants-upload-CVKO8P4d.js";import{$ as ee,A as te,B as ne,C as re,F as ie,G as ae,K as E,L as D,N as oe,P as se,Q as ce,R as le,S as ue,T as de,U as fe,V as pe,W as me,X as he,Y as ge,_ as _e,a as ve,at as O,b as ye,bt as k,c as be,ct as A,d as xe,et as Se,f as Ce,g as we,gt as Te,h as Ee,ht as De,it as j,k as M,l as Oe,mt as ke,n as N,nt as Ae,o as P,ot as je,p as Me,q as Ne,r as Pe,rt as Fe,s as Ie,st as Le,t as Re,tt as ze,u as Be,ut as Ve,v as He,vt as F,w as Ue,x as We,y as Ge,z as I}from"./dist-Dc8tD1th.js";import{t as Ke}from"./dist-C_FzPxEX2.js";import{t as qe}from"./util-doc-name-DRKmy6g9.js";import{n as Je}from"./_envelope-q8XHEv4O-C-Qnl5Tu.js";import{C as Ye,a as Xe,g as Ze,w as Qe}from"./schemas-api-CzN0ZSyO.js";import{t as $e}from"./note-window-mode-CI3Yju9B.js";import{i as et}from"./use-apply-config-theme-CYFG76sS.js";import{t as tt}from"./createLucideIcon-DdBzwsHe.js";import{t as nt}from"./folder-open-COGOeTzI.js";import{t as rt}from"./trash-2-CchZ0T47.js";import{n as it,r as at}from"./structural-freshness-CIbkMFA3-CWi_lyiW.js";import{c as ot,d as st,l as ct}from"./doc-hash-BJkweiX9.js";import{_ as lt,b as ut,d as dt,f as ft,g as pt,h as mt,j as ht,k as gt,o as _t,p as vt,v as yt,w as bt,x as xt}from"./navigation-targets-CcY2FHJZ.js";import{t as St}from"./doc-paths-cEiFVCxr.js";import{$ as Ct,A as wt,B as Tt,C as Et,E as Dt,G as Ot,I as kt,J as At,K as jt,M as Mt,N as Nt,P as Pt,Q as Ft,R as It,S as Lt,T as Rt,W as zt,X as Bt,_ as Vt,at as Ht,b as Ut,c as Wt,d as Gt,et as Kt,f as qt,g as Jt,h as Yt,it as Xt,j as Zt,l as Qt,m as $t,nt as en,ot as tn,p as nn,q as rn,s as an,tt as on,u as sn,w as cn,x as ln,y as un,z as dn}from"./config-provider-kLYQhPYp.js";import{At as fn,Ct as pn,E as mn,F as hn,G as gn,I as L,J as _n,K as vn,M as yn,Mt as bn,Nt as xn,P as R,Tt as Sn,X as Cn,a as z,c as wn,f as Tn,l as En,lt as Dn,o as On,r as kn,t as An,ut as jn}from"./dist-D2SphF3p.js";import{A as Mn,C as Nn,E as Pn,H as Fn,I as In,L as Ln,M as Rn,N as zn,O as Bn,P as Vn,R as B,S as Hn,T as Un,_ as Wn,a as Gn,b as Kn,c as qn,h as Jn,k as Yn,m as Xn,o as Zn,t as Qn,x as $n,y as er,z as tr}from"./lib-QQS1Brzc.js";import{t as nr}from"./ccount-BoHE53_k.js";import{n as rr,r as ir}from"./lib-DlDYgFfS.js";import{c as ar,f as or,n as sr,r as cr,t as lr,u as ur}from"./trim-lines-DfV8CCf7.js";import{u as dr}from"./space-separated-tokens-l9yufOSK.js";import{n as fr,t as pr}from"./syntax-CKL08zSk.js";import{n as mr,r as hr,t as gr}from"./cm-theme-o8S36rrW.js";import{i as _r,n as vr}from"./page-list-cache-B9RqU_KB.js";import{t as yr}from"./documents-fetch-Y7Dt9_Tn.js";import{i as br,n as xr,r as Sr,t as Cr}from"./dist-DseqKdAU.js";import{n as wr,r as Tr,t as Er}from"./dist-BxTTaZ5o.js";import{t as Dr}from"./dist-CjyZozAk.js";import{n as Or}from"./dist-C2Kstufe.js";import{n as kr}from"./dist-BvhrN0Uj.js";import{n as Ar}from"./dist-D5mDCusD.js";import{i as jr,n as Mr,r as Nr}from"./dist-BpU-J2LR.js";import{n as Pr}from"./dist-BkE9d74i.js";import{t as Fr}from"./stex-CUzil_LB.js";import{n as Ir,r as Lr}from"./external-link-CldCnbtR.js";var Rr=tt(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),zr=tt(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Br=tt(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),Vr=tt(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Hr=tt(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),V=n(),H=e(r(),1),Ur=e(o(),1),Wr=s(),Gr=c();function Kr(e){return e.editorView}var qr=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function Jr(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function Yr(e){let t=Jr(e);return t!==null&&qr.has(t)}function Xr(e){let t=Jr(e);return t===null?null:qr.get(t)??null}var Zr=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function Qr(e){Zr.lastIndex=0;let t=e.match(Zr);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=Xr(e);if(t===null)return null;n+=t}return n}var $r=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},ei=/[\uD800-\uDBFF]/,ti=/[\uDC00-\uDFFF]/,ni=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&ei.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&ti.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},ri=(e,t)=>e>>>t|e<<32-t,ii=e=>ri(e,2)^ri(e,13)^ri(e,22),ai=e=>ri(e,6)^ri(e,11)^ri(e,25),oi=e=>ri(e,7)^ri(e,18)^e>>>3,si=e=>ri(e,17)^ri(e,19)^e>>>10,ci=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),li=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ui=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(li),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=si(t[e-2])+t[e-7]+oi(t[e-15])+t[e-16];let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7];for(let e=0,u,d;e<64;e++)u=l+ai(o)+(o&s^~o&c)+ci[e]+t[e]>>>0,d=ii(n)+(n&r^n&i^r&i)>>>0,l=c,c=s,s=o,o=a+u>>>0,a=i,i=r,r=n,n=u+d>>>0;e[0]+=n,e[1]+=r,e[2]+=i,e[3]+=a,e[4]+=o,e[5]+=s,e[6]+=c,e[7]+=l}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=128<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<n*8;n||(this._W[r-(t%4==0?0:1)]|=128<<(3-t%4)*8),this._W[14]=e.byteLength/Kt,this._W[15]=e.byteLength*8,this._updateHash();let i=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)i[e*4+t]=this._H[e]>>>(3-t)*8;return i}},di=e=>new ui().digest(e),U=new O(`y-sync`),fi=new O(`y-undo`),pi=new O(`yjs-cursor`),mi=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},hi=e=>Ot(mi(di(zt(e)))),gi=()=>({mapping:new Map,isOMark:new Map}),_i=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!Mt(t.ds,e.id),vi=[{light:`#ecd44433`,dark:`#ecd444`}],yi=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=Xt();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,Bt(t))}return e.get(n)},bi=(e,{colors:t=vi,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new wi(e,a),c=new j({props:{editable:e=>{let t=U.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:U,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(U);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return t.addToHistory=e.getMeta(`addToHistory`)!==!1,t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&dn(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=fi.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},U)})}},destroy:()=>{s.destroy()}})});return c},xi=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new Ae(e.doc));else if(t.type===`node`){let r=na(n.doc,n.type,t.anchor,n.mapping);e.setSelection(Si(e,r))}else{let r=na(n.doc,n.type,t.anchor,n.mapping),i=na(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(A.between(e.doc.resolve(r),e.doc.resolve(i)))}},Si=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?Fe.create(e.doc,t):A.near(n)},Ci=(e,t)=>({type:t.selection.jsonID,anchor:ea(t.selection.anchor,e.type,e.mapping),head:ea(t.selection.head,e.type,e.mapping)}),wi=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=$r(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=Ci(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(jt&&this._domSelectionInView===null&&(dn(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=Tt.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=Dt(Lt(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(U,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>Ei(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new k(F.from(e),0,0));t.setMeta(U,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>Ei(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new k(F.from(t),0,0));if(e){let t=en(on(e.anchor,0),n.doc.content.size),r=en(on(e.head,0),n.doc.content.size);n.setSelection(A.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(U,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=kt(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&Ct(),r=new sn({gc:!1}),un(r,t),t=kt(r),un(r,e),e=kt(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[wt(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{Pt(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:yi(n.colorMapping,n.colors,r)}},s=It(i,new nn(t.ds,e.sv)).map(n=>!n._item.deleted||_i(n._item,e)||_i(n._item,t)?Ei(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,o):null).filter(e=>e!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new k(F.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(U,{isChangeOrigin:!0}))},U)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=U.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);Pt(t,t.deleteSet,e=>{if(e.constructor===Gt){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>Ti(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new k(F.from(n),0,0));xi(r,this.beforeTransactionSelection,this),r=r.setMeta(U,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof $t}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{qi(this.doc,this.type,e,this),this.beforeTransactionSelection=Ci(this,this.prosemirrorView.state)},U)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},Ti=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof Jt)return Ei(e,t,n,r,i,a);throw Ft()}return o},Ei=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof Jt){let s=Ti(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof Yt&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let c=Di(e,t,n,r,i,a);c!==null&&c.forEach(e=>{e!==null&&o.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(s):It(e,new nn(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(_i(e._item,r)?_i(e._item,i)||(s.ychange=a?a(`added`,e._item.id):{type:`added`}):s.ychange=a?a(`removed`,e._item.id):{type:`removed`});let c=Ii(s),l=Gi(c.marks,t),u=t.node(e.nodeName,c.plain,o,l.length?l:void 0);return n.mapping.set(e,u),u}catch(r){console.warn(`[y-prosemirror] schema.node(`+e.nodeName+`) threw:`,String(r&&r.message||r));let i=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};if(t.nodes[e.nodeName]&&t.nodes[e.nodeName].spec&&t.nodes[e.nodeName].spec.inline)i.inline++;else if(i.block++,t.nodes.rawMdxFallback)try{let i=t.node(`rawMdxFallback`,{reason:String(r&&r.message||r)},[t.text(e.nodeName)]);return n.mapping.set(e,i),i}catch(e){console.warn(`[y-prosemirror] rawMdxFallback substitution also failed:`,String(e&&e.message||e))}return n.mapping.delete(e),null}},Di=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,Gi(n.attributes,t)))}}catch(e){console.warn(`[y-prosemirror] schema.text() threw:`,String(e&&e.message||e));let t=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};return t.inline++,null}return o},Oi=(e,t)=>{let n=new Vt,r=e.map(e=>({insert:e.text,attributes:Ki(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},ki=(e,t)=>{let n=new Jt(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}let r=Ki(e.marks||[],t);for(let e in r)n.setAttribute(Fi+e,{...r[e]});return n.insert(0,Ni(e).map(e=>Ai(e,t))),t.mapping.set(n,e),n},Ai=(e,t)=>e instanceof Array?Oi(e,t):ki(e,t),ji=e=>typeof e==`object`&&!!e,Mi=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===Object.keys(t).filter(e=>t[e]!==null).length;for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||ji(o)&&ji(s)&&Mi(o,s)}return r},Ni=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},Pi=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&At(e.attributes||{}).length===t[n].marks.length&&rn(e.attributes,(e,r)=>{let i=Wi(r),a=t[n].marks;return a.find(e=>e.type.name===i)?Mi(e,a.find(e=>e.type.name===i)?.attrs):!1}))},Fi=`ymark:`,Ii=e=>{let t={},n={};for(let r in e)r.startsWith(Fi)?n[r.slice(6)]=e[r]:t[r]=e[r];return{plain:t,marks:n}},Li=(e,t)=>{let n=Object.keys(e);return n.length===t.length?n.every(n=>{let r=Wi(n),i=t.find(e=>e.type.name===r);return i?Mi(e[n],i.attrs):!1}):!1},Ri=(e,t)=>{if(e instanceof Jt&&!(t instanceof Array)&&Ji(e,t)){let n=Ni(t),r=Ii(e.getAttributes());return e._length===n.length&&Li(r.marks,t.marks)&&Mi(r.plain,t.attrs)&&e.toArray().every((e,t)=>Ri(e,n[t]))}return e instanceof Vt&&t instanceof Array&&Pi(e,t)},zi=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),Bi=(e,t,n)=>{let r=e.toArray(),i=Ni(t),a=i.length,o=r.length,s=en(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(zi(n.mapping.get(e),t))u=!0;else if(!Ri(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(zi(n.mapping.get(e),t))u=!0;else if(!Ri(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},Vi=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof Wt?t+=n.content.str:n.content instanceof an&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},Hi=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=Vi(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,Ki(e.marks,n))})),{insert:o,remove:s,index:c}=ni(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},Ui=/(.*)(--[a-zA-Z0-9+/=]{8})$/,Wi=e=>Ui.exec(e)?.[1]??e,Gi=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(Wi(r),e[r]));return n},Ki=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=tn(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${hi(e.toJSON())}`:e.type.name]=e.attrs}}),n},qi=(e,t,n,r)=>{if(t instanceof Jt&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof Jt){let e=t.getAttributes(),i=n.attrs;for(let n in i)i[n]===null?t.removeAttribute(n):e[n]!==i[n]&&n!==`ychange`&&t.setAttribute(n,i[n]);for(let n in e)i[n]===void 0&&!n.startsWith(Fi)&&t.removeAttribute(n);let a=Ki(n.marks||[],r);for(let n in a){let r=e[Fi+n];(r===void 0||!Mi(r,a[n]))&&t.setAttribute(Fi+n,{...a[n]})}for(let n in e)n.startsWith(Fi)&&a[n.slice(6)]===void 0&&t.removeAttribute(n)}let i=Ni(n),a=i.length,o=t.toArray(),s=o.length,c=en(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!zi(r.mapping.get(e),t))if(Ri(e,t))r.mapping.set(e,t);else break}for(;u+l+1<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!zi(r.mapping.get(e),t))if(Ri(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof Vt&&c instanceof Array)Pi(n,c)||Hi(n,c,r),l+=1;else{let i=n instanceof Jt&&Ji(n,c),a=d instanceof Jt&&Ji(d,f);if(i&&a){let e=Bi(n,c,r),t=Bi(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(qi(e,n,c,r),l+=1):a?(qi(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[Ai(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof Vt?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(Ai(i[t],r));t.insert(l,e)}},U)},Ji=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,Yi=null,Xi=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=U.getState(this.view.state);if(e&&e.binding&&!e.binding.isDestroyed){let e=this.view.state.tr;e.setMeta(this.key,this.value),this.view.dispatch(e)}}},Zi=class e{constructor(e=[]){this.entries=e}getFirst(){return this.entries[0]}dequeueFirst(){return this.entries.shift()}isEmpty(){return this.entries.length===0}static fromViewsToUpdate(){let t=Yi;Yi=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new Xi(t,r,e))})}),new e(n)}},Qi=(e=Zi.fromViewsToUpdate(),t=!1)=>{let n=!0;for(;!e.isEmpty();){let r=e.getFirst();try{r.apply()}catch(r){if(r instanceof RangeError){t&&n&&e.dequeueFirst(),e.isEmpty()||dn(0,()=>Qi(e,!0));return}throw r}n=!1,e.dequeueFirst()}},$i=(e,t,n)=>{Yi||(Yi=new Map,dn(0,Qi)),tn(Yi,e,Ht).set(t,n)},ea=(e,t,n)=>{if(e===0)return Rt(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof Vt){if(r._length>=e)return Rt(r,e,-1);if(e-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,e--;while(r!==t&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==t&&(r=r._item===null?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&e<i)r=r._first.content.type,e--;else{if(e===1&&r._length===0&&i>1)return new qt(r._item===null?null:r._item.id,r._item===null?Zt(r):null,null);if(e-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(e===0)return r=r._item===null?r:r._item.parent,new qt(r._item===null?null:r._item.id,r._item===null?Zt(r):null,null);do r=r._item.parent,e--;while(r!==t&&r._item.next===null);r!==t&&(r=r._item.next.content.type)}}}if(r===null)throw Ct();if(e===0&&r.constructor!==Vt&&r!==t)return ta(r._item.parent,r._item)}return Rt(t,t._length,-1)},ta=(e,t)=>{let n=null,r=null;return e._item===null?r=Zt(e):n=Et(e._item.id.client,e._item.id.clock),new qt(n,r,t.id)},na=(e,t,n,r)=>{let i=ln(n,e);if(i===null||i.type!==t&&!Nt(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===Vt)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;if(t++,n instanceof Vt)o+=n._length;else{let e=r.get(n);if(e==null)return null;o+=e.nodeSize}}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;if(!t.deleted)if(e instanceof Vt)o+=e._length;else{let t=r.get(e);if(t==null)return null;o+=t.nodeSize}t=t.right}}a=e}return o-1},ra=(e,t)=>{let n=e.toArray().map(e=>Ei(e,t,gi())).filter(e=>e!==null);return F.fromArray(n)},ia=(e,t)=>t.topNodeType.create(null,ra(e,t)),aa=(e,t)=>{let n=gi(),r=e.toArray().map(e=>Ei(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,F.fromArray(r)),meta:n,mapping:n.mapping}},oa=(e,t,n)=>e!==t,sa=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(`⁠`),i=document.createTextNode(`⁠`);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},ca=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),la=/^#[0-9a-fA-F]{6}$/,ua=(e,t,n,r,i)=>{let a=U.getState(e);if(a==null||a.doc==null||a.binding==null)return he.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?he.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:la.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=na(o,a.type,cn(t.cursor.anchor),a.binding.mapping),u=na(o,a.type,cn(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=on(e.doc.content.size-1,0);l=en(l,t),u=en(u,t),s.push(ge.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=en(l,u),o=on(l,u);s.push(ge.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),he.create(e.doc,s))},da=(e,{awarenessStateFilter:t=oa,cursorBuilder:n=sa,selectionBuilder:r=ca,getSelection:i=e=>e.selection}={},a=`cursor`)=>new j({key:pi,state:{init(i,a){return ua(a,e,t,n,r)},apply(i,a,o,s){let c=U.getState(s),l=i.getMeta(pi);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?ua(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>pi.getState(e)},view:t=>{let n=()=>{t.docView&&$i(t,pi,{awarenessUpdated:!0})},r=()=>{let n=U.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=ea(o.anchor,n.type,n.binding.mapping),c=ea(o.head,n.type,n.binding.mapping);(r.cursor==null||!Ut(cn(r.cursor.anchor),s)||!Ut(cn(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&na(n.doc,n.type,cn(r.cursor.anchor),n.binding.mapping)!==null&&e.setLocalStateField(a,null)};return e.on(`change`,n),t.dom.addEventListener(`focusin`,r),t.dom.addEventListener(`focusout`,r),{update:r,destroy:()=>{t.dom.removeEventListener(`focusin`,r),t.dom.removeEventListener(`focusout`,r),e.off(`change`,n),e.setLocalStateField(a,null)}}}}),fa=e=>{let t=fi.getState(e).undoManager;if(t!=null)return t.undo(),!0},pa=e=>{let t=fi.getState(e).undoManager;if(t!=null)return t.redo(),!0},ma=new Set([`paragraph`]),ha=(e,t)=>!(e instanceof Gt)||!(e.content instanceof Qt)||!(e.content.type instanceof Yt||e.content.type instanceof Jt&&t.has(e.content.type.nodeName))||e.content.type._length===0,ga=({protectedNodes:e=ma,trackedOrigins:t=[],undoManager:n=null}={})=>new j({key:fi,state:{init:(r,i)=>{let a=U.getState(i),o=n||new $t(a.type,{trackedOrigins:new Set([U].concat(t)),deleteFilter:t=>ha(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=U.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:Ci(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=U.getState(e.state),n=fi.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,fi.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}}),_a=new Map,va=new Set;function ya(){for(let e of va)e()}function ba(e,t,n){_a.set(e,{view:t,host:n}),ya()}function xa(e,t){_a.get(e)?.view===t&&(_a.delete(e),ya())}function Sa(e){let t=_a.get(e);return t?.host===`sourceEditor`?t.view:null}function Ca(e){return _a.get(e)??null}function wa(e){return va.add(e),()=>{va.delete(e)}}var Ta=new WeakMap,Ea=new WeakMap;function Da(e,t){Ta.set(e,t)}function Oa(e){return Ta.get(e)??!1}function ka(e,t){Ea.set(e,t)}function Aa(e){return Ea.get(e)??!1}function ja(e){return!Oa(e)}var Ma=`autonomousFragmentEdit/swap`;function Na(e){return e.setMeta(Ma,!0)}function Pa(e,t,n){return n===t.textContent?Na(e):e}function Fa(e){return e.getMeta(Ma)===!0}function Ia(e){return!e.getMeta(U)&&!Fa(e)}var La=/^[A-Za-z0-9]{20,}$/,Ra=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function za(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function Ba(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return La.test(n)?n:null}function Va(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:`||!za(t.hostname))return null;let n=Ba(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&Ra.test(r)?r:null}}function Ha(e){return Va(e)!==null}function Ua(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function Wa(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:Ua(t.hostname)}var Ga=/^[A-Za-z0-9_-]{11}$/;function Ka(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 qa(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 Ja(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return Ga.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return Ga.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function Ya(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:`||!Ka(t.hostname))return null;let n=Ja(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?qa(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}function Xa(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`&&Za(e.value.value,t))continue}let o=Qa(e,t);r>=0?n[r]=o:n.push(o)}return n}function Za(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function Qa(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 $a(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:Xa(t,r),children:n.all(t),data:{}}}function eo(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:Xa(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}var to=[{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`}],no=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:x,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}],ro=[{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}],io=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:y,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`&&(Wa(e.src)||Ha(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:x,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(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`&&Ha(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`&&(Wa(e.src)||Ha(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`&&(Ya(e.src)!==null||Wa(e.src)||Ha(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],ao=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:w,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`}],oo=[{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`}],so=[to[0],to[1],to[4],to[5],to[6]],co=[no[0],no[1],no[7]],lo=[oo[0],oo[1],oo[4],oo[5]],uo=[{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.`}],fo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],po=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],mo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],ho=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],go=[{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`)"}],_o=[{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."}],vo=[_o[0]],yo=[_o[0]],bo=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],xo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],So=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],Co=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:C,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`)"}],wo=[{name:`src`,type:`string`,required:!0,description:"Path to the `.excalidraw` board this embed renders",autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded board`}],To=[{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."}],Eo=[{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 Do(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Oo(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function ko(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=typeof t?.sourceTarget==`string`?t.sourceTarget:null,o=typeof t?.sourceAnchor==`string`?t.sourceAnchor:null,s=typeof t?.sourceAlias==`string`?t.sourceAlias:null,c=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:c,data:{target:n,anchor:i,alias:r,sourceTarget:a,sourceAnchor:o,sourceAlias:s},children:[{type:`text`,value:c}]}}var Ao=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:to,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)=>$a(`Callout`,e,t,to)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:no,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)=>$a(`img`,e,t,no)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:io,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)=>$a(`video`,e,t,io)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:ao,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)=>$a(`audio`,e,t,ao)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Co,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)=>$a(`Pdf`,e,t,Co)},{name:`Excalidraw`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:wo,icon:`PenTool`,category:`embed`,displayName:`Excalidraw`,description:"Embedded snapshot of an `.excalidraw` board, linking to its canvas editor",searchTerms:[`excalidraw`,`board`,`whiteboard`,`sketch`,`drawing`,`canvas`],serialize:(e,t)=>$a(`Excalidraw`,e,t,wo)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:So,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)=>$a(`File`,e,t,So)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:ro,icon:`AppWindow`,category:`embed`,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)=>$a(`Embed`,e,t,ro)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:oo,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)=>$a(`Accordion`,e,t,oo)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:oo,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)=>$a(`Toggle`,e,t,oo)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:ho,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>
2
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{r as i}from"./dist-Nvb76hAm.js";import{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./react-dom-DPxgxlDT.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{n as c,t as l}from"./with-selector-zVo3Fruj.js";import{a as u,d,i as f,l as p,r as m,u as h}from"./floating-ui.dom-DkPPH5vF.js";import{a as g,d as _,g as v,i as y,l as b,n as x,o as S,r as C,t as w,u as T}from"./constants-upload-CVKO8P4d.js";import{$ as ee,A as te,B as ne,C as re,F as ie,G as ae,K as E,L as D,N as oe,P as se,Q as ce,R as le,S as ue,T as de,U as fe,V as pe,W as me,X as he,Y as ge,_ as _e,a as ve,at as O,b as ye,bt as k,c as be,ct as A,d as xe,et as Se,f as Ce,g as we,gt as Te,h as Ee,ht as De,it as j,k as M,l as Oe,mt as ke,n as N,nt as Ae,o as P,ot as je,p as Me,q as Ne,r as Pe,rt as Fe,s as Ie,st as Le,t as Re,tt as ze,u as Be,ut as Ve,v as He,vt as F,w as Ue,x as We,y as Ge,z as I}from"./dist-Dc8tD1th.js";import{t as Ke}from"./dist-C_FzPxEX2.js";import{t as qe}from"./util-doc-name-DRKmy6g9.js";import{n as Je}from"./_envelope-q8XHEv4O-C-Qnl5Tu.js";import{C as Ye,a as Xe,g as Ze,w as Qe}from"./schemas-api-CzN0ZSyO.js";import{t as $e}from"./note-window-mode-CI3Yju9B.js";import{i as et}from"./use-apply-config-theme-CYFG76sS.js";import{t as tt}from"./createLucideIcon-DdBzwsHe.js";import{t as nt}from"./folder-open-COGOeTzI.js";import{t as rt}from"./trash-2-CchZ0T47.js";import{n as it,r as at}from"./structural-freshness-CIbkMFA3-CWi_lyiW.js";import{c as ot,d as st,l as ct}from"./doc-hash-BJkweiX9.js";import{_ as lt,b as ut,d as dt,f as ft,g as pt,h as mt,j as ht,k as gt,o as _t,p as vt,v as yt,w as bt,x as xt}from"./navigation-targets-CcY2FHJZ.js";import{t as St}from"./doc-paths-cEiFVCxr.js";import{$ as Ct,A as wt,B as Tt,C as Et,E as Dt,G as Ot,I as kt,J as At,K as jt,M as Mt,N as Nt,P as Pt,Q as Ft,R as It,S as Lt,T as Rt,W as zt,X as Bt,_ as Vt,at as Ht,b as Ut,c as Wt,d as Gt,et as Kt,f as qt,g as Jt,h as Yt,it as Xt,j as Zt,l as Qt,m as $t,nt as en,ot as tn,p as nn,q as rn,s as an,tt as on,u as sn,w as cn,x as ln,y as un,z as dn}from"./config-provider-maC-s8nJ.js";import{At as fn,Ct as pn,E as mn,F as hn,G as gn,I as L,J as _n,K as vn,M as yn,Mt as bn,Nt as xn,P as R,Tt as Sn,X as Cn,a as z,c as wn,f as Tn,l as En,lt as Dn,o as On,r as kn,t as An,ut as jn}from"./dist-D2SphF3p.js";import{A as Mn,C as Nn,E as Pn,H as Fn,I as In,L as Ln,M as Rn,N as zn,O as Bn,P as Vn,R as B,S as Hn,T as Un,_ as Wn,a as Gn,b as Kn,c as qn,h as Jn,k as Yn,m as Xn,o as Zn,t as Qn,x as $n,y as er,z as tr}from"./lib-QQS1Brzc.js";import{t as nr}from"./ccount-BoHE53_k.js";import{n as rr,r as ir}from"./lib-DlDYgFfS.js";import{c as ar,f as or,n as sr,r as cr,t as lr,u as ur}from"./trim-lines-DfV8CCf7.js";import{u as dr}from"./space-separated-tokens-l9yufOSK.js";import{n as fr,t as pr}from"./syntax-CKL08zSk.js";import{n as mr,r as hr,t as gr}from"./cm-theme-o8S36rrW.js";import{i as _r,n as vr}from"./page-list-cache-B9RqU_KB.js";import{t as yr}from"./documents-fetch-Y7Dt9_Tn.js";import{i as br,n as xr,r as Sr,t as Cr}from"./dist-DseqKdAU.js";import{n as wr,r as Tr,t as Er}from"./dist-BxTTaZ5o.js";import{t as Dr}from"./dist-CjyZozAk.js";import{n as Or}from"./dist-C2Kstufe.js";import{n as kr}from"./dist-BvhrN0Uj.js";import{n as Ar}from"./dist-D5mDCusD.js";import{i as jr,n as Mr,r as Nr}from"./dist-BpU-J2LR.js";import{n as Pr}from"./dist-BkE9d74i.js";import{t as Fr}from"./stex-CUzil_LB.js";import{n as Ir,r as Lr}from"./external-link-CldCnbtR.js";var Rr=tt(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),zr=tt(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Br=tt(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),Vr=tt(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Hr=tt(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),V=n(),H=e(r(),1),Ur=e(o(),1),Wr=s(),Gr=c();function Kr(e){return e.editorView}var qr=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function Jr(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function Yr(e){let t=Jr(e);return t!==null&&qr.has(t)}function Xr(e){let t=Jr(e);return t===null?null:qr.get(t)??null}var Zr=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function Qr(e){Zr.lastIndex=0;let t=e.match(Zr);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=Xr(e);if(t===null)return null;n+=t}return n}var $r=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},ei=/[\uD800-\uDBFF]/,ti=/[\uDC00-\uDFFF]/,ni=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&ei.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&ti.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},ri=(e,t)=>e>>>t|e<<32-t,ii=e=>ri(e,2)^ri(e,13)^ri(e,22),ai=e=>ri(e,6)^ri(e,11)^ri(e,25),oi=e=>ri(e,7)^ri(e,18)^e>>>3,si=e=>ri(e,17)^ri(e,19)^e>>>10,ci=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),li=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ui=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(li),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=si(t[e-2])+t[e-7]+oi(t[e-15])+t[e-16];let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7];for(let e=0,u,d;e<64;e++)u=l+ai(o)+(o&s^~o&c)+ci[e]+t[e]>>>0,d=ii(n)+(n&r^n&i^r&i)>>>0,l=c,c=s,s=o,o=a+u>>>0,a=i,i=r,r=n,n=u+d>>>0;e[0]+=n,e[1]+=r,e[2]+=i,e[3]+=a,e[4]+=o,e[5]+=s,e[6]+=c,e[7]+=l}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=128<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<n*8;n||(this._W[r-(t%4==0?0:1)]|=128<<(3-t%4)*8),this._W[14]=e.byteLength/Kt,this._W[15]=e.byteLength*8,this._updateHash();let i=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)i[e*4+t]=this._H[e]>>>(3-t)*8;return i}},di=e=>new ui().digest(e),U=new O(`y-sync`),fi=new O(`y-undo`),pi=new O(`yjs-cursor`),mi=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},hi=e=>Ot(mi(di(zt(e)))),gi=()=>({mapping:new Map,isOMark:new Map}),_i=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!Mt(t.ds,e.id),vi=[{light:`#ecd44433`,dark:`#ecd444`}],yi=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=Xt();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,Bt(t))}return e.get(n)},bi=(e,{colors:t=vi,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new wi(e,a),c=new j({props:{editable:e=>{let t=U.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:U,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(U);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return t.addToHistory=e.getMeta(`addToHistory`)!==!1,t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&dn(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=fi.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},U)})}},destroy:()=>{s.destroy()}})});return c},xi=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new Ae(e.doc));else if(t.type===`node`){let r=na(n.doc,n.type,t.anchor,n.mapping);e.setSelection(Si(e,r))}else{let r=na(n.doc,n.type,t.anchor,n.mapping),i=na(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(A.between(e.doc.resolve(r),e.doc.resolve(i)))}},Si=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?Fe.create(e.doc,t):A.near(n)},Ci=(e,t)=>({type:t.selection.jsonID,anchor:ea(t.selection.anchor,e.type,e.mapping),head:ea(t.selection.head,e.type,e.mapping)}),wi=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=$r(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=Ci(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(jt&&this._domSelectionInView===null&&(dn(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=Tt.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=Dt(Lt(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(U,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>Ei(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new k(F.from(e),0,0));t.setMeta(U,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>Ei(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new k(F.from(t),0,0));if(e){let t=en(on(e.anchor,0),n.doc.content.size),r=en(on(e.head,0),n.doc.content.size);n.setSelection(A.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(U,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=kt(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&Ct(),r=new sn({gc:!1}),un(r,t),t=kt(r),un(r,e),e=kt(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[wt(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{Pt(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:yi(n.colorMapping,n.colors,r)}},s=It(i,new nn(t.ds,e.sv)).map(n=>!n._item.deleted||_i(n._item,e)||_i(n._item,t)?Ei(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,o):null).filter(e=>e!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new k(F.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(U,{isChangeOrigin:!0}))},U)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=U.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);Pt(t,t.deleteSet,e=>{if(e.constructor===Gt){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>Ti(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new k(F.from(n),0,0));xi(r,this.beforeTransactionSelection,this),r=r.setMeta(U,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof $t}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{qi(this.doc,this.type,e,this),this.beforeTransactionSelection=Ci(this,this.prosemirrorView.state)},U)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},Ti=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof Jt)return Ei(e,t,n,r,i,a);throw Ft()}return o},Ei=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof Jt){let s=Ti(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof Yt&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let c=Di(e,t,n,r,i,a);c!==null&&c.forEach(e=>{e!==null&&o.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(s):It(e,new nn(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(_i(e._item,r)?_i(e._item,i)||(s.ychange=a?a(`added`,e._item.id):{type:`added`}):s.ychange=a?a(`removed`,e._item.id):{type:`removed`});let c=Ii(s),l=Gi(c.marks,t),u=t.node(e.nodeName,c.plain,o,l.length?l:void 0);return n.mapping.set(e,u),u}catch(r){console.warn(`[y-prosemirror] schema.node(`+e.nodeName+`) threw:`,String(r&&r.message||r));let i=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};if(t.nodes[e.nodeName]&&t.nodes[e.nodeName].spec&&t.nodes[e.nodeName].spec.inline)i.inline++;else if(i.block++,t.nodes.rawMdxFallback)try{let i=t.node(`rawMdxFallback`,{reason:String(r&&r.message||r)},[t.text(e.nodeName)]);return n.mapping.set(e,i),i}catch(e){console.warn(`[y-prosemirror] rawMdxFallback substitution also failed:`,String(e&&e.message||e))}return n.mapping.delete(e),null}},Di=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,Gi(n.attributes,t)))}}catch(e){console.warn(`[y-prosemirror] schema.text() threw:`,String(e&&e.message||e));let t=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};return t.inline++,null}return o},Oi=(e,t)=>{let n=new Vt,r=e.map(e=>({insert:e.text,attributes:Ki(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},ki=(e,t)=>{let n=new Jt(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}let r=Ki(e.marks||[],t);for(let e in r)n.setAttribute(Fi+e,{...r[e]});return n.insert(0,Ni(e).map(e=>Ai(e,t))),t.mapping.set(n,e),n},Ai=(e,t)=>e instanceof Array?Oi(e,t):ki(e,t),ji=e=>typeof e==`object`&&!!e,Mi=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===Object.keys(t).filter(e=>t[e]!==null).length;for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||ji(o)&&ji(s)&&Mi(o,s)}return r},Ni=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},Pi=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&At(e.attributes||{}).length===t[n].marks.length&&rn(e.attributes,(e,r)=>{let i=Wi(r),a=t[n].marks;return a.find(e=>e.type.name===i)?Mi(e,a.find(e=>e.type.name===i)?.attrs):!1}))},Fi=`ymark:`,Ii=e=>{let t={},n={};for(let r in e)r.startsWith(Fi)?n[r.slice(6)]=e[r]:t[r]=e[r];return{plain:t,marks:n}},Li=(e,t)=>{let n=Object.keys(e);return n.length===t.length?n.every(n=>{let r=Wi(n),i=t.find(e=>e.type.name===r);return i?Mi(e[n],i.attrs):!1}):!1},Ri=(e,t)=>{if(e instanceof Jt&&!(t instanceof Array)&&Ji(e,t)){let n=Ni(t),r=Ii(e.getAttributes());return e._length===n.length&&Li(r.marks,t.marks)&&Mi(r.plain,t.attrs)&&e.toArray().every((e,t)=>Ri(e,n[t]))}return e instanceof Vt&&t instanceof Array&&Pi(e,t)},zi=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),Bi=(e,t,n)=>{let r=e.toArray(),i=Ni(t),a=i.length,o=r.length,s=en(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(zi(n.mapping.get(e),t))u=!0;else if(!Ri(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(zi(n.mapping.get(e),t))u=!0;else if(!Ri(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},Vi=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof Wt?t+=n.content.str:n.content instanceof an&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},Hi=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=Vi(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,Ki(e.marks,n))})),{insert:o,remove:s,index:c}=ni(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},Ui=/(.*)(--[a-zA-Z0-9+/=]{8})$/,Wi=e=>Ui.exec(e)?.[1]??e,Gi=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(Wi(r),e[r]));return n},Ki=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=tn(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${hi(e.toJSON())}`:e.type.name]=e.attrs}}),n},qi=(e,t,n,r)=>{if(t instanceof Jt&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof Jt){let e=t.getAttributes(),i=n.attrs;for(let n in i)i[n]===null?t.removeAttribute(n):e[n]!==i[n]&&n!==`ychange`&&t.setAttribute(n,i[n]);for(let n in e)i[n]===void 0&&!n.startsWith(Fi)&&t.removeAttribute(n);let a=Ki(n.marks||[],r);for(let n in a){let r=e[Fi+n];(r===void 0||!Mi(r,a[n]))&&t.setAttribute(Fi+n,{...a[n]})}for(let n in e)n.startsWith(Fi)&&a[n.slice(6)]===void 0&&t.removeAttribute(n)}let i=Ni(n),a=i.length,o=t.toArray(),s=o.length,c=en(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!zi(r.mapping.get(e),t))if(Ri(e,t))r.mapping.set(e,t);else break}for(;u+l+1<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!zi(r.mapping.get(e),t))if(Ri(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof Vt&&c instanceof Array)Pi(n,c)||Hi(n,c,r),l+=1;else{let i=n instanceof Jt&&Ji(n,c),a=d instanceof Jt&&Ji(d,f);if(i&&a){let e=Bi(n,c,r),t=Bi(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(qi(e,n,c,r),l+=1):a?(qi(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[Ai(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof Vt?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(Ai(i[t],r));t.insert(l,e)}},U)},Ji=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,Yi=null,Xi=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=U.getState(this.view.state);if(e&&e.binding&&!e.binding.isDestroyed){let e=this.view.state.tr;e.setMeta(this.key,this.value),this.view.dispatch(e)}}},Zi=class e{constructor(e=[]){this.entries=e}getFirst(){return this.entries[0]}dequeueFirst(){return this.entries.shift()}isEmpty(){return this.entries.length===0}static fromViewsToUpdate(){let t=Yi;Yi=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new Xi(t,r,e))})}),new e(n)}},Qi=(e=Zi.fromViewsToUpdate(),t=!1)=>{let n=!0;for(;!e.isEmpty();){let r=e.getFirst();try{r.apply()}catch(r){if(r instanceof RangeError){t&&n&&e.dequeueFirst(),e.isEmpty()||dn(0,()=>Qi(e,!0));return}throw r}n=!1,e.dequeueFirst()}},$i=(e,t,n)=>{Yi||(Yi=new Map,dn(0,Qi)),tn(Yi,e,Ht).set(t,n)},ea=(e,t,n)=>{if(e===0)return Rt(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof Vt){if(r._length>=e)return Rt(r,e,-1);if(e-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,e--;while(r!==t&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==t&&(r=r._item===null?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&e<i)r=r._first.content.type,e--;else{if(e===1&&r._length===0&&i>1)return new qt(r._item===null?null:r._item.id,r._item===null?Zt(r):null,null);if(e-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(e===0)return r=r._item===null?r:r._item.parent,new qt(r._item===null?null:r._item.id,r._item===null?Zt(r):null,null);do r=r._item.parent,e--;while(r!==t&&r._item.next===null);r!==t&&(r=r._item.next.content.type)}}}if(r===null)throw Ct();if(e===0&&r.constructor!==Vt&&r!==t)return ta(r._item.parent,r._item)}return Rt(t,t._length,-1)},ta=(e,t)=>{let n=null,r=null;return e._item===null?r=Zt(e):n=Et(e._item.id.client,e._item.id.clock),new qt(n,r,t.id)},na=(e,t,n,r)=>{let i=ln(n,e);if(i===null||i.type!==t&&!Nt(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===Vt)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;if(t++,n instanceof Vt)o+=n._length;else{let e=r.get(n);if(e==null)return null;o+=e.nodeSize}}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;if(!t.deleted)if(e instanceof Vt)o+=e._length;else{let t=r.get(e);if(t==null)return null;o+=t.nodeSize}t=t.right}}a=e}return o-1},ra=(e,t)=>{let n=e.toArray().map(e=>Ei(e,t,gi())).filter(e=>e!==null);return F.fromArray(n)},ia=(e,t)=>t.topNodeType.create(null,ra(e,t)),aa=(e,t)=>{let n=gi(),r=e.toArray().map(e=>Ei(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,F.fromArray(r)),meta:n,mapping:n.mapping}},oa=(e,t,n)=>e!==t,sa=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(`⁠`),i=document.createTextNode(`⁠`);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},ca=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),la=/^#[0-9a-fA-F]{6}$/,ua=(e,t,n,r,i)=>{let a=U.getState(e);if(a==null||a.doc==null||a.binding==null)return he.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?he.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:la.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=na(o,a.type,cn(t.cursor.anchor),a.binding.mapping),u=na(o,a.type,cn(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=on(e.doc.content.size-1,0);l=en(l,t),u=en(u,t),s.push(ge.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=en(l,u),o=on(l,u);s.push(ge.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),he.create(e.doc,s))},da=(e,{awarenessStateFilter:t=oa,cursorBuilder:n=sa,selectionBuilder:r=ca,getSelection:i=e=>e.selection}={},a=`cursor`)=>new j({key:pi,state:{init(i,a){return ua(a,e,t,n,r)},apply(i,a,o,s){let c=U.getState(s),l=i.getMeta(pi);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?ua(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>pi.getState(e)},view:t=>{let n=()=>{t.docView&&$i(t,pi,{awarenessUpdated:!0})},r=()=>{let n=U.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=ea(o.anchor,n.type,n.binding.mapping),c=ea(o.head,n.type,n.binding.mapping);(r.cursor==null||!Ut(cn(r.cursor.anchor),s)||!Ut(cn(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&na(n.doc,n.type,cn(r.cursor.anchor),n.binding.mapping)!==null&&e.setLocalStateField(a,null)};return e.on(`change`,n),t.dom.addEventListener(`focusin`,r),t.dom.addEventListener(`focusout`,r),{update:r,destroy:()=>{t.dom.removeEventListener(`focusin`,r),t.dom.removeEventListener(`focusout`,r),e.off(`change`,n),e.setLocalStateField(a,null)}}}}),fa=e=>{let t=fi.getState(e).undoManager;if(t!=null)return t.undo(),!0},pa=e=>{let t=fi.getState(e).undoManager;if(t!=null)return t.redo(),!0},ma=new Set([`paragraph`]),ha=(e,t)=>!(e instanceof Gt)||!(e.content instanceof Qt)||!(e.content.type instanceof Yt||e.content.type instanceof Jt&&t.has(e.content.type.nodeName))||e.content.type._length===0,ga=({protectedNodes:e=ma,trackedOrigins:t=[],undoManager:n=null}={})=>new j({key:fi,state:{init:(r,i)=>{let a=U.getState(i),o=n||new $t(a.type,{trackedOrigins:new Set([U].concat(t)),deleteFilter:t=>ha(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=U.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:Ci(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=U.getState(e.state),n=fi.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,fi.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}}),_a=new Map,va=new Set;function ya(){for(let e of va)e()}function ba(e,t,n){_a.set(e,{view:t,host:n}),ya()}function xa(e,t){_a.get(e)?.view===t&&(_a.delete(e),ya())}function Sa(e){let t=_a.get(e);return t?.host===`sourceEditor`?t.view:null}function Ca(e){return _a.get(e)??null}function wa(e){return va.add(e),()=>{va.delete(e)}}var Ta=new WeakMap,Ea=new WeakMap;function Da(e,t){Ta.set(e,t)}function Oa(e){return Ta.get(e)??!1}function ka(e,t){Ea.set(e,t)}function Aa(e){return Ea.get(e)??!1}function ja(e){return!Oa(e)}var Ma=`autonomousFragmentEdit/swap`;function Na(e){return e.setMeta(Ma,!0)}function Pa(e,t,n){return n===t.textContent?Na(e):e}function Fa(e){return e.getMeta(Ma)===!0}function Ia(e){return!e.getMeta(U)&&!Fa(e)}var La=/^[A-Za-z0-9]{20,}$/,Ra=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function za(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function Ba(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return La.test(n)?n:null}function Va(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:`||!za(t.hostname))return null;let n=Ba(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&Ra.test(r)?r:null}}function Ha(e){return Va(e)!==null}function Ua(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function Wa(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:Ua(t.hostname)}var Ga=/^[A-Za-z0-9_-]{11}$/;function Ka(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 qa(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 Ja(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return Ga.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return Ga.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function Ya(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:`||!Ka(t.hostname))return null;let n=Ja(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?qa(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}function Xa(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`&&Za(e.value.value,t))continue}let o=Qa(e,t);r>=0?n[r]=o:n.push(o)}return n}function Za(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function Qa(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 $a(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:Xa(t,r),children:n.all(t),data:{}}}function eo(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:Xa(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}var to=[{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`}],no=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:x,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}],ro=[{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}],io=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:y,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`&&(Wa(e.src)||Ha(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:x,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(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`&&Ha(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`&&(Wa(e.src)||Ha(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`&&(Ya(e.src)!==null||Wa(e.src)||Ha(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],ao=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:w,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`}],oo=[{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`}],so=[to[0],to[1],to[4],to[5],to[6]],co=[no[0],no[1],no[7]],lo=[oo[0],oo[1],oo[4],oo[5]],uo=[{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.`}],fo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],po=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],mo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],ho=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],go=[{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`)"}],_o=[{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."}],vo=[_o[0]],yo=[_o[0]],bo=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],xo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],So=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],Co=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:C,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`)"}],wo=[{name:`src`,type:`string`,required:!0,description:"Path to the `.excalidraw` board this embed renders",autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded board`}],To=[{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."}],Eo=[{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 Do(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Oo(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function ko(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=typeof t?.sourceTarget==`string`?t.sourceTarget:null,o=typeof t?.sourceAnchor==`string`?t.sourceAnchor:null,s=typeof t?.sourceAlias==`string`?t.sourceAlias:null,c=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:c,data:{target:n,anchor:i,alias:r,sourceTarget:a,sourceAnchor:o,sourceAlias:s},children:[{type:`text`,value:c}]}}var Ao=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:to,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)=>$a(`Callout`,e,t,to)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:no,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)=>$a(`img`,e,t,no)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:io,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)=>$a(`video`,e,t,io)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:ao,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)=>$a(`audio`,e,t,ao)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Co,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)=>$a(`Pdf`,e,t,Co)},{name:`Excalidraw`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:wo,icon:`PenTool`,category:`embed`,displayName:`Excalidraw`,description:"Embedded snapshot of an `.excalidraw` board, linking to its canvas editor",searchTerms:[`excalidraw`,`board`,`whiteboard`,`sketch`,`drawing`,`canvas`],serialize:(e,t)=>$a(`Excalidraw`,e,t,wo)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:So,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)=>$a(`File`,e,t,So)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:ro,icon:`AppWindow`,category:`embed`,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)=>$a(`Embed`,e,t,ro)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:oo,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)=>$a(`Accordion`,e,t,oo)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:oo,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)=>$a(`Toggle`,e,t,oo)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:ho,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>
3
3
  <Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>$a(`Tabs`,e,t,ho)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:go,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)=>$a(`Tab`,e,t,go)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:_o,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)=>$a(`Math`,e,t,_o)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:bo,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:To,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)=>$a(`Mirror`,e,t,To)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:Eo,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)=>$a(`MirrorSource`,e,t,Eo)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:so,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:co,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:fo,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:ko},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:po,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:ko},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:mo,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:ko},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:xo,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:ko},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:lo,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="${Do(n.name)}"`:``,a=n?.id?` id="${Do(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${Oo(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:uo,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"${Do(i)}"`):`${a} align="${Do(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:vo,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:yo,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??``})}],jo={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>$a(e.attrs.componentName||`*`,e,t)};function Mo(){let e=new Map;e.set(`*`,jo);for(let t of Ao)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 No=ve.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function Po(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||Fo(n)===r?!0:Qr(e)===t}function Fo(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}function Io(e,t){let{target:n,anchor:r,alias:i}=e;if(!t.separatorCrossed)return e;if(r!==null){let e=Bo(r);return{target:n,anchor:e.length>0?e:null,alias:i===null?null:Vo(i)}}return{target:Bo(n),anchor:null,alias:i===null?null:Vo(i)}}function Lo(e,t,n){let r=e.trim();return r===t?!0:n===`alias`?Vo(r)===t:Bo(r)===t}function Ro(e,t,n){return typeof e==`string`&&Lo(e,t,n)?e:t}function zo(e){return Bo(e.trim())===``}function Bo(e){return e.endsWith(`\\`)?e.slice(0,-1):e}function Vo(e){return e.replace(/\\\|/g,`|`)}function Ho(e){let t=``,n=0;for(let r of e)r===`\\`?n++:(r===`|`&&n%2==0&&(t+=`\\`),n=0),t+=r;return t}function Uo(e){return e.replace(/\|/g,`\\|`)}function Wo(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function Go(e){return e.includes("`")?`~`:"`"}function Ko(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
4
4
  `)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}var qo=new Set([`break`,`delete`,`emphasis`,`footnoteReference`,`html`,`image`,`imageReference`,`inlineCode`,`link`,`linkReference`,`strong`,`text`]);function Jo(e){let t=e.children;Array.isArray(t)&&t.forEach((e,n)=>{if(e.type===`break`){t[n]={type:`html`,value:`<br />`};return}Jo(e)})}function Yo(e){let t=e.children;if(Array.isArray(t))for(let e of t)(e.type===`inlineCode`||e.type===`html`)&&(e.value.includes(`
5
5
  `)&&(e.value=e.value.replace(/[ \t]*\n[ \t]*/g,` `)),e.type===`html`&&e.value.includes(`|`)&&(e.value=Uo(e.value))),Yo(e)}function Xo(e){B(e,`tableCell`,e=>{e.children.some(e=>!qo.has(e.type))&&(e.children=Zo(e.children)),Jo(e),Yo(e)})}function Zo(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(`
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t,r as n}from"./dist-Nvb76hAm.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{t as i}from"./label-CvMpFFbN.js";import{i as a,n as o,o as s,s as c,t as l}from"./select-Bu4Wm3Rf.js";import{t as u}from"./switch-BKZTXkzu.js";import{n as d}from"./dist-BGzUo_18.js";import{n as f}from"./config-errors-tVoeK4OC.js";import{i as p}from"./use-apply-config-theme-CYFG76sS.js";import"./saved-themes-client-CdTWCmn6.js";import"./config-provider-kLYQhPYp.js";import"./markdown-lint-BgDulTY0.js";import{t as m}from"./SettingsSectionHeader-DBUjTOcT.js";var h=r(),g=e();function _(){let e=(0,h.c)(40),{_:r}=n(),{projectConfig:_,projectSynced:v,projectBinding:y}=p(),b=v&&y!==null,x=_?.validation?.links??`warning`,S=_?.validation?.fileTreeIndicators!==!1,C=_?.validation?.suppressLogLinkAdvisories??!0,w;e[0]!==r||e[1]!==y?(w=function(e){if(y===null){d.error(r({id:`dVaXnv`}));return}let t=y.patch({validation:e});t.ok||d.error(r({id:`NrFwux`,values:{0:f(t.error)}}))},e[0]=r,e[1]=y,e[2]=w):w=e[2];let T=w,E;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,g.jsx)(t,{id:`OPOiKn`}),e[3]=E):E=e[3];let D;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,g.jsx)(m,{titleId:`settings-content-rules-title`,title:E,scope:`project`,level:`block`,children:(0,g.jsx)(t,{id:`ge05IJ`})}),e[4]=D):D=e[4];let O;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,g.jsx)(i,{htmlFor:`settings-content-rules-links`,className:`text-sm font-medium`,children:(0,g.jsx)(t,{id:`8ruqQi`})}),e[5]=O):O=e[5];let k;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,g.jsxs)(`div`,{className:`min-w-0`,children:[O,(0,g.jsx)(`p`,{id:`settings-content-rules-links-description`,className:`text-1sm text-muted-foreground`,children:(0,g.jsx)(t,{id:`iqr14Z`})})]}),e[6]=k):k=e[6];let A;e[7]===T?A=e[8]:(A=e=>T({links:e}),e[7]=T,e[8]=A);let j=!b,M;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,g.jsx)(s,{id:`settings-content-rules-links`,"aria-describedby":`settings-content-rules-links-description`,className:`w-36 shrink-0`,"data-testid":`settings-content-rules-links`,children:(0,g.jsx)(c,{})}),e[9]=M):M=e[9];let N;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,g.jsx)(a,{value:`off`,children:(0,g.jsx)(t,{id:`Nwbs0q`})}),e[10]=N):N=e[10];let P;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,g.jsx)(a,{value:`warning`,children:(0,g.jsx)(t,{id:`r6y-jM`})}),e[11]=P):P=e[11];let F;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,g.jsxs)(o,{children:[N,P,(0,g.jsx)(a,{value:`error`,children:(0,g.jsx)(t,{id:`SlfejT`})})]}),e[12]=F):F=e[12];let I;e[13]!==x||e[14]!==A||e[15]!==j?(I=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-3`,children:[k,(0,g.jsxs)(l,{value:x,onValueChange:A,disabled:j,children:[M,F]})]}),e[13]=x,e[14]=A,e[15]=j,e[16]=I):I=e[16];let L;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,g.jsx)(i,{htmlFor:`settings-content-rules-log-links`,className:`text-sm font-medium`,children:(0,g.jsx)(t,{id:`ea7AYn`})}),e[17]=L):L=e[17];let R;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,g.jsxs)(`div`,{className:`min-w-0`,children:[L,(0,g.jsx)(`p`,{id:`settings-content-rules-log-links-description`,className:`text-1sm text-muted-foreground`,children:(0,g.jsx)(t,{id:`nnhrHd`})})]}),e[18]=R):R=e[18];let z=!b,B;e[19]===T?B=e[20]:(B=e=>T({suppressLogLinkAdvisories:e}),e[19]=T,e[20]=B);let V;e[21]!==C||e[22]!==z||e[23]!==B?(V=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-3`,children:[R,(0,g.jsx)(u,{id:`settings-content-rules-log-links`,"aria-describedby":`settings-content-rules-log-links-description`,checked:C,disabled:z,onCheckedChange:B,"data-testid":`settings-content-rules-log-links`})]}),e[21]=C,e[22]=z,e[23]=B,e[24]=V):V=e[24];let H;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,g.jsx)(i,{htmlFor:`settings-content-rules-indicators`,className:`text-sm font-medium`,children:(0,g.jsx)(t,{id:`x3kWeu`})}),e[25]=H):H=e[25];let U;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,g.jsxs)(`div`,{className:`min-w-0`,children:[H,(0,g.jsx)(`p`,{id:`settings-content-rules-indicators-description`,className:`text-1sm text-muted-foreground`,children:(0,g.jsx)(t,{id:`ktspdq`})})]}),e[26]=U):U=e[26];let W=!b,G;e[27]===T?G=e[28]:(G=e=>T({fileTreeIndicators:e}),e[27]=T,e[28]=G);let K;e[29]!==S||e[30]!==W||e[31]!==G?(K=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-3`,children:[U,(0,g.jsx)(u,{id:`settings-content-rules-indicators`,"aria-describedby":`settings-content-rules-indicators-description`,checked:S,disabled:W,onCheckedChange:G,"data-testid":`settings-content-rules-indicators`})]}),e[29]=S,e[30]=W,e[31]=G,e[32]=K):K=e[32];let q;e[33]!==I||e[34]!==V||e[35]!==K?(q=(0,g.jsxs)(`div`,{className:`divide-y rounded-md border`,children:[I,V,K]}),e[33]=I,e[34]=V,e[35]=K,e[36]=q):q=e[36];let J;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`settings-content-rules-plugins-note`,children:(0,g.jsx)(t,{id:`YDL7N6`})}),e[37]=J):J=e[37];let Y;return e[38]===q?Y=e[39]:(Y=(0,g.jsxs)(`section`,{"aria-labelledby":`settings-content-rules-title`,className:`space-y-4`,"data-testid":`settings-content-rules`,"data-field":`section:content-rules`,children:[D,q,J]}),e[38]=q,e[39]=Y),Y}export{_ as ContentRulesSection};
1
+ import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t,r as n}from"./dist-Nvb76hAm.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{t as i}from"./label-CvMpFFbN.js";import{i as a,n as o,o as s,s as c,t as l}from"./select-Bu4Wm3Rf.js";import{t as u}from"./switch-BKZTXkzu.js";import{n as d}from"./dist-BGzUo_18.js";import{n as f}from"./config-errors-tVoeK4OC.js";import{i as p}from"./use-apply-config-theme-CYFG76sS.js";import"./saved-themes-client-L2ZZOn0Z.js";import"./config-provider-maC-s8nJ.js";import"./markdown-lint-CnxqlpxD.js";import{t as m}from"./SettingsSectionHeader-DBUjTOcT.js";var h=r(),g=e();function _(){let e=(0,h.c)(40),{_:r}=n(),{projectConfig:_,projectSynced:v,projectBinding:y}=p(),b=v&&y!==null,x=_?.validation?.links??`warning`,S=_?.validation?.fileTreeIndicators!==!1,C=_?.validation?.suppressLogLinkAdvisories??!0,w;e[0]!==r||e[1]!==y?(w=function(e){if(y===null){d.error(r({id:`dVaXnv`}));return}let t=y.patch({validation:e});t.ok||d.error(r({id:`NrFwux`,values:{0:f(t.error)}}))},e[0]=r,e[1]=y,e[2]=w):w=e[2];let T=w,E;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,g.jsx)(t,{id:`OPOiKn`}),e[3]=E):E=e[3];let D;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,g.jsx)(m,{titleId:`settings-content-rules-title`,title:E,scope:`project`,level:`block`,children:(0,g.jsx)(t,{id:`ge05IJ`})}),e[4]=D):D=e[4];let O;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,g.jsx)(i,{htmlFor:`settings-content-rules-links`,className:`text-sm font-medium`,children:(0,g.jsx)(t,{id:`8ruqQi`})}),e[5]=O):O=e[5];let k;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,g.jsxs)(`div`,{className:`min-w-0`,children:[O,(0,g.jsx)(`p`,{id:`settings-content-rules-links-description`,className:`text-1sm text-muted-foreground`,children:(0,g.jsx)(t,{id:`iqr14Z`})})]}),e[6]=k):k=e[6];let A;e[7]===T?A=e[8]:(A=e=>T({links:e}),e[7]=T,e[8]=A);let j=!b,M;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,g.jsx)(s,{id:`settings-content-rules-links`,"aria-describedby":`settings-content-rules-links-description`,className:`w-36 shrink-0`,"data-testid":`settings-content-rules-links`,children:(0,g.jsx)(c,{})}),e[9]=M):M=e[9];let N;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,g.jsx)(a,{value:`off`,children:(0,g.jsx)(t,{id:`Nwbs0q`})}),e[10]=N):N=e[10];let P;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,g.jsx)(a,{value:`warning`,children:(0,g.jsx)(t,{id:`r6y-jM`})}),e[11]=P):P=e[11];let F;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,g.jsxs)(o,{children:[N,P,(0,g.jsx)(a,{value:`error`,children:(0,g.jsx)(t,{id:`SlfejT`})})]}),e[12]=F):F=e[12];let I;e[13]!==x||e[14]!==A||e[15]!==j?(I=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-3`,children:[k,(0,g.jsxs)(l,{value:x,onValueChange:A,disabled:j,children:[M,F]})]}),e[13]=x,e[14]=A,e[15]=j,e[16]=I):I=e[16];let L;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,g.jsx)(i,{htmlFor:`settings-content-rules-log-links`,className:`text-sm font-medium`,children:(0,g.jsx)(t,{id:`ea7AYn`})}),e[17]=L):L=e[17];let R;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,g.jsxs)(`div`,{className:`min-w-0`,children:[L,(0,g.jsx)(`p`,{id:`settings-content-rules-log-links-description`,className:`text-1sm text-muted-foreground`,children:(0,g.jsx)(t,{id:`nnhrHd`})})]}),e[18]=R):R=e[18];let z=!b,B;e[19]===T?B=e[20]:(B=e=>T({suppressLogLinkAdvisories:e}),e[19]=T,e[20]=B);let V;e[21]!==C||e[22]!==z||e[23]!==B?(V=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-3`,children:[R,(0,g.jsx)(u,{id:`settings-content-rules-log-links`,"aria-describedby":`settings-content-rules-log-links-description`,checked:C,disabled:z,onCheckedChange:B,"data-testid":`settings-content-rules-log-links`})]}),e[21]=C,e[22]=z,e[23]=B,e[24]=V):V=e[24];let H;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,g.jsx)(i,{htmlFor:`settings-content-rules-indicators`,className:`text-sm font-medium`,children:(0,g.jsx)(t,{id:`x3kWeu`})}),e[25]=H):H=e[25];let U;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,g.jsxs)(`div`,{className:`min-w-0`,children:[H,(0,g.jsx)(`p`,{id:`settings-content-rules-indicators-description`,className:`text-1sm text-muted-foreground`,children:(0,g.jsx)(t,{id:`ktspdq`})})]}),e[26]=U):U=e[26];let W=!b,G;e[27]===T?G=e[28]:(G=e=>T({fileTreeIndicators:e}),e[27]=T,e[28]=G);let K;e[29]!==S||e[30]!==W||e[31]!==G?(K=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-3`,children:[U,(0,g.jsx)(u,{id:`settings-content-rules-indicators`,"aria-describedby":`settings-content-rules-indicators-description`,checked:S,disabled:W,onCheckedChange:G,"data-testid":`settings-content-rules-indicators`})]}),e[29]=S,e[30]=W,e[31]=G,e[32]=K):K=e[32];let q;e[33]!==I||e[34]!==V||e[35]!==K?(q=(0,g.jsxs)(`div`,{className:`divide-y rounded-md border`,children:[I,V,K]}),e[33]=I,e[34]=V,e[35]=K,e[36]=q):q=e[36];let J;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`settings-content-rules-plugins-note`,children:(0,g.jsx)(t,{id:`YDL7N6`})}),e[37]=J):J=e[37];let Y;return e[38]===q?Y=e[39]:(Y=(0,g.jsxs)(`section`,{"aria-labelledby":`settings-content-rules-title`,className:`space-y-4`,"data-testid":`settings-content-rules`,"data-field":`section:content-rules`,children:[D,q,J]}),e[38]=q,e[39]=Y),Y}export{_ as ContentRulesSection};