@inkeep/open-knowledge 0.88.6-beta.2 → 0.88.6-beta.3

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 (84) hide show
  1. package/dist/cli.mjs +59 -59
  2. package/dist/constants-qWODYpdZ.mjs +1 -0
  3. package/dist/{dist-CWmsgB4D.mjs → dist-Br5t34YL.mjs} +1 -1
  4. package/dist/{dist-BO5LOWYA.mjs → dist-DFlcDcjF.mjs} +1 -1
  5. package/dist/index.mjs +2 -2
  6. package/dist/{init-DEZvHVW0.mjs → init-CFqa1MvX.mjs} +2 -2
  7. package/dist/init-D5UpQ70d.mjs +1 -0
  8. package/dist/{launch-json-removal-BiFnBtfK.mjs → launch-json-removal-BiiU2YFK.mjs} +1 -1
  9. package/dist/loader-B2fGi6oQ.mjs +1 -0
  10. package/dist/{loader-CiUplufh.mjs → loader-CpSE6Pb3.mjs} +1 -1
  11. package/dist/{open-browser-DUUDzeiw.mjs → open-browser-BgcinSRG.mjs} +1 -1
  12. package/dist/preview-DSJofhni.mjs +1 -0
  13. package/dist/{preview-BGT8FQ6l.mjs → preview-W1qLrOTN.mjs} +1 -1
  14. package/dist/public/assets/{AccountSection-B533_CFl.js → AccountSection-LJRd8sB4.js} +1 -1
  15. package/dist/public/assets/{ActivityModeContent-Bm2TgMK9.js → ActivityModeContent-CQSexLMh.js} +1 -1
  16. package/dist/public/assets/{AddPropertiesButton-DkHyn0cf.js → AddPropertiesButton-CFKmvgxU.js} +1 -1
  17. package/dist/public/assets/{AgentDiffPane-BodTaWgj.js → AgentDiffPane-_ihWGbD_.js} +1 -1
  18. package/dist/public/assets/{AttachmentsSection-64MnxUzI.js → AttachmentsSection-DBsgV2Bw.js} +1 -1
  19. package/dist/public/assets/{CodeMirrorPropInput-BpVp-E5x.js → CodeMirrorPropInput-CijXVQab.js} +1 -1
  20. package/dist/public/assets/{ContentRulesSection-DmWfN_iy.js → ContentRulesSection-C6MePblA.js} +1 -1
  21. package/dist/public/assets/{DocumentContext-Cdsi5u2c.js → DocumentContext-Ckv8SUWG.js} +1 -1
  22. package/dist/public/assets/{EditorModeToggle-DVVGiGDr.js → EditorModeToggle-N2hyqb1I.js} +1 -1
  23. package/dist/public/assets/{ExcalidrawDocEditor-CXmmiQYE.js → ExcalidrawDocEditor-CP2HLZRg.js} +1 -1
  24. package/dist/public/assets/FeedbackForm-DvbVD7xY.js +1 -0
  25. package/dist/public/assets/{ImportSkillDialog-D94_dDU2.js → ImportSkillDialog-B6FRcFBN.js} +1 -1
  26. package/dist/public/assets/{LinkPreviewsSection-BcBB5Mr2.js → LinkPreviewsSection-C4BQkoW1.js} +1 -1
  27. package/dist/public/assets/{LintConfigEditor-dTqg6HBx.js → LintConfigEditor-BZ5RnGQH.js} +1 -1
  28. package/dist/public/assets/{LintingSection-CNCSP8QA.js → LintingSection-gYcf6zSw.js} +1 -1
  29. package/dist/public/assets/{ManagedArtifactProperties-BwRDC8sA.js → ManagedArtifactProperties-7BpPCdWC.js} +1 -1
  30. package/dist/public/assets/ManagedArtifactProperties-C21i-wVX.js +1 -0
  31. package/dist/public/assets/{MermaidDocEditor-C1OgCPt4.js → MermaidDocEditor-D8S17k_t.js} +1 -1
  32. package/dist/public/assets/{NetworkAccessSection-DkX1Ccg2.js → NetworkAccessSection-CfSEDmXg.js} +1 -1
  33. package/dist/public/assets/{PropertyDisplayRow-vYb8HrL-.js → PropertyDisplayRow-BoNQImBU.js} +1 -1
  34. package/dist/public/assets/{PublishToGitHubDialog-Cp8YBcmH.js → PublishToGitHubDialog-Bc5NpD70.js} +1 -1
  35. package/dist/public/assets/{SchemaConfigEditor-WGJhlBCs.js → SchemaConfigEditor-DXzybru5.js} +1 -1
  36. package/dist/public/assets/{SearchSection-2P2_lNpn.js → SearchSection-C19oEXnN.js} +1 -1
  37. package/dist/public/assets/{SessionsHost-Dp9DeiAL.js → SessionsHost-Dq18GV-Q.js} +2 -2
  38. package/dist/public/assets/{SettingsDialogBody-e6zwfLq2.js → SettingsDialogBody-CKMzthec.js} +2 -2
  39. package/dist/public/assets/{ShareReceiveMissDialog-C3LqR6yF.js → ShareReceiveMissDialog-CjeRKStG.js} +1 -1
  40. package/dist/public/assets/{SkillToolbarControls-CwJU-tSi.js → SkillToolbarControls-Bw0kbj8T.js} +1 -1
  41. package/dist/public/assets/{SourceEditor-CH7OXRAW.js → SourceEditor-Cdd0XUzF.js} +1 -1
  42. package/dist/public/assets/{SyncSection-BJcZEjza.js → SyncSection-uN1z_93L.js} +1 -1
  43. package/dist/public/assets/{SyncStatusBadge-B50CKijD.js → SyncStatusBadge-DKqP2nFA.js} +1 -1
  44. package/dist/public/assets/{TerminalSection-izE_v8FN.js → TerminalSection-OQKUYevA.js} +1 -1
  45. package/dist/public/assets/{TerminalWindowApp-C1epN9CZ.js → TerminalWindowApp-CYJ1Jbl1.js} +1 -1
  46. package/dist/public/assets/{TextDocEditor-C3xrbdGv.js → TextDocEditor-O7zcpBhs.js} +1 -1
  47. package/dist/public/assets/{ThreadView-DeLnbOfd.js → ThreadView-DXAtEUVo.js} +1 -1
  48. package/dist/public/assets/{TimelineDiffPane-PhoLGDyW.js → TimelineDiffPane-DfckigW2.js} +1 -1
  49. package/dist/public/assets/{client-version-Bn38fidh.js → client-version-BJc8f8RK.js} +1 -1
  50. package/dist/public/assets/{comment-chips-BulsIGPm.js → comment-chips-D5QcVI38.js} +1 -1
  51. package/dist/public/assets/{config-provider-CbxzkzQ_.js → config-provider-B2uReVA0.js} +1 -1
  52. package/dist/public/assets/{doc-undo-manager-D2TgPcLo.js → doc-undo-manager-eVCrXF_j.js} +1 -1
  53. package/dist/public/assets/{index-CMyXHFY-.js → index-DixZkzDK.js} +7 -7
  54. package/dist/public/assets/{lint-plugins-9842_I0-.js → lint-plugins-BkTeSxCo.js} +1 -1
  55. package/dist/public/assets/{pending-receive-nav-store-BMCbYLuG.js → pending-receive-nav-store-Iv87HrBp.js} +1 -1
  56. package/dist/public/assets/{preferred-session-events-BAlt9BzP.js → preferred-session-events-xfa2uZrO.js} +1 -1
  57. package/dist/public/assets/{progress-COOClRZR.js → progress-BrArAZHf.js} +1 -1
  58. package/dist/public/assets/{selection-context-BILpjCfJ.js → selection-context-Dbqj5HIF.js} +1 -1
  59. package/dist/public/assets/{src-CwpH-C2-.js → src-CY4cyl93.js} +1 -1
  60. package/dist/public/assets/{telemetry-impl-BY6m4dQu.js → telemetry-impl-CzmRwkV2.js} +1 -1
  61. package/dist/public/assets/{telemetry-startup-BXj909u4.js → telemetry-startup-6UOhK4H3.js} +1 -1
  62. package/dist/public/assets/{typing-burst-detector-CvX8VoiX.js → typing-burst-detector-43TkkCGr.js} +1 -1
  63. package/dist/public/assets/{use-activity-panel-BCtT92Ba.js → use-activity-panel-Bqo7iLoL.js} +1 -1
  64. package/dist/public/assets/{use-open-skill-DhY4Y0NP.js → use-open-skill-DiaFh1sV.js} +1 -1
  65. package/dist/public/assets/{use-terminal-enabled-eL9XPx7R.js → use-terminal-enabled-D67U-_lT.js} +1 -1
  66. package/dist/public/assets/{use-timeline-entry-diff-CjTYJ45T.js → use-timeline-entry-diff-KpbAdkg7.js} +1 -1
  67. package/dist/public/index.html +19 -19
  68. package/dist/{registry-probes-bcwiwmsg.mjs → registry-probes-DwE2ywLj.mjs} +1 -1
  69. package/dist/{removal-file-path-vEg6Crwy.mjs → removal-file-path-BB7PGKh9.mjs} +1 -1
  70. package/dist/{repair-launch-json-DiAuyB8X.mjs → repair-launch-json-BGnKoX_8.mjs} +1 -1
  71. package/dist/{repair-mcp-configs-BF5SpuqE.mjs → repair-mcp-configs-CnuXQsDL.mjs} +1 -1
  72. package/dist/src-CMSKsmsA.mjs +1 -0
  73. package/dist/{src-CIxs_FQO.mjs → src-CbDiPIIp.mjs} +1 -1
  74. package/dist/{start-D3SEY0yE.mjs → start-Bs7pMN0A.mjs} +3 -3
  75. package/dist/start-Dx5wqmPM.mjs +1 -0
  76. package/package.json +4 -4
  77. package/dist/constants-t9AfZY26.mjs +0 -1
  78. package/dist/init-CTAfywlr.mjs +0 -1
  79. package/dist/loader-BVV3rwB9.mjs +0 -1
  80. package/dist/preview-785_n4-9.mjs +0 -1
  81. package/dist/public/assets/FeedbackForm-BSIF07lL.js +0 -1
  82. package/dist/public/assets/ManagedArtifactProperties-CcAxjAa9.js +0 -1
  83. package/dist/src-C6vKy7oA.mjs +0 -1
  84. package/dist/start-DqBQYZEF.mjs +0 -1
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-C-bZ6dxH.js","./dist-Nvb76hAm.js","./chunk-CYidjpOJ.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./pierre-theme-DJrzB4rV.js","./preload-helper-Chd9yIcd.js","./engine-compile-DfjLNowR.js","./lib-D3PsW6H5.js","./ccount-s_UaBrax.js","./lib-Csk2IQWH.js","./space-separated-tokens-B2o5P1Kh.js","./lib-DxyUjQpt.js","./ok-syntax-theme-CmGxcKkF.js","./MultiFileDiff-_0SJNK0c.js","./react-error-boundary-6ac6QM6R.js","./compiler-runtime-BfE3aGVn.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{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./overlay-layers-CKMAjef3.js";import{i as ee,n as te,t as ne}from"./tooltip-BjuCvy5N.js";import{n as c,t as l}from"./toggle-group-B7p69Qfd.js";import{t as re}from"./button-DzgjsZzC.js";import{t as u}from"./spinner-Bx8xD6f8.js";import{t as d}from"./panel-right-close-Bsh1pCmh.js";import{t as f}from"./panel-right-open-D4M8nGPT.js";import{t as ie}from"./x-wldAHzfP.js";import{o as ae,r as p,t as oe}from"./agent-diff-store-BScyIbOO.js";import{t as se}from"./lru-string-cache-2BECYUJH.js";import{t as ce}from"./use-activity-panel-BCtT92Ba.js";import{a as le,c as ue,d as de,o as fe,s as pe,t as me}from"./use-timeline-entry-diff-CjTYJ45T.js";var he=o(),m=e(r(),1),h=n(),ge=(0,m.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-C-bZ6dxH.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url)).ActivityPanelDiffView})),_e=64,ve={changes:[],unparseable:null};function g(e){let t=(0,he.c)(145),{view:n,isPanelCollapsed:r,onTogglePanel:o,onDestinationComplete:se,onDestinationFailed:_e}=e,{_:g}=a(),{agentId:_,agentName:v,agentColor:y,agentIcon:b,docName:x,keptCount:S}=n,[C]=(0,m.useState)(be),xe=(0,m.useRef)(null),Se=(0,m.useRef)(null),[w,Ce]=(0,m.useState)(`rendered`),we;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(we={status:`loading`,key:null,diff:``,before:``,after:``,properties:ve},t[0]=we):we=t[0];let[T,Te]=(0,m.useState)(we),E=`${_}\0${x}\0${S}`,Ee;t[1]===se?Ee=t[2]:(Ee=()=>{se?.(Se.current??void 0)},t[1]=se,t[2]=Ee);let De=(0,m.useEffectEvent)(Ee),D;t[3]===_e?D=t[4]:(D=()=>_e?.(),t[3]=_e,t[4]=D);let Oe=(0,m.useEffectEvent)(D),ke=(0,m.useRef)(null),Ae;t[5]!==De||t[6]!==E||t[7]!==Oe||t[8]!==T.key||t[9]!==T.status||t[10]!==n?(Ae=()=>{ke.current!==n&&T.key===E&&(T.status===`ready`?(ke.current=n,De()):T.status===`error`&&(ke.current=n,Oe()))},t[5]=De,t[6]=E,t[7]=Oe,t[8]=T.key,t[9]=T.status,t[10]=n,t[11]=Ae):Ae=t[11];let je;t[12]!==E||t[13]!==T||t[14]!==n?(je=[T,E,n],t[12]=E,t[13]=T,t[14]=n,t[15]=je):je=t[15],(0,m.useEffect)(Ae,je);let Me,Ne;t[16]!==_||t[17]!==C||t[18]!==x||t[19]!==S?(Me=()=>{let e=!1;Te({status:`loading`,key:null,diff:``,before:``,after:``,properties:ve});let t=`${_}\0${x}\0${S}`,n=C.get(t);if(n!==void 0){Te({status:`ready`,key:t,...JSON.parse(n)});return}return ce(_,x,S).then(n=>{e||(C.set(t,JSON.stringify(n)),Te({status:`ready`,key:t,...n}))}).catch(n=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:_,docName:x,keptCount:S,err:n}),Te({status:`error`,key:t,diff:``,before:``,after:``,properties:ve}))}),()=>{e=!0}},Ne=[_,x,S,C],t[16]=_,t[17]=C,t[18]=x,t[19]=S,t[20]=Me,t[21]=Ne):(Me=t[20],Ne=t[21]),(0,m.useEffect)(Me,Ne);let Pe;t[22]!==T.after||t[23]!==T.before||t[24]!==T.status?(Pe=T.status===`ready`?ue(T.before,T.after):null,t[22]=T.after,t[23]=T.before,t[24]=T.status,t[25]=Pe):Pe=t[25];let Fe=Pe,Ie=T.status===`ready`?`${w}:${S}:${T.diff}`:``,Le,Re;t[26]===Ie?(Le=t[27],Re=t[28]):(Re=()=>{let e=xe.current;if(Ie===``||!e)return;let t=!1,n=null,r,i,a=()=>{if(t)return;s.sync();let r=e.querySelector(`[data-property-change]`)??e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??le(e)[0];if(!r)return;t=!0,n?.disconnect(),s.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},o=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(a)})},120))},s=fe(e,o);n=new MutationObserver(o),n.observe(e,{childList:!0,subtree:!0}),o();let ee=setTimeout(()=>{n?.disconnect(),s.disconnect()},5e3);return()=>{n?.disconnect(),s.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(ee)}},Le=[Ie],t[26]=Ie,t[27]=Le,t[28]=Re),(0,m.useEffect)(Re,Le);let O,ze;t[29]===S?(O=t[30],ze=t[31]):(O=()=>{let e=e=>{if(e.key===`Escape`&&e.defaultPrevented||s())return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`Escape`?oe():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),p(S+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),p(S-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},ze=[S],t[29]=S,t[30]=O,t[31]=ze),(0,m.useEffect)(O,ze);let k,A,j,M,N,P,F,I,L,R;if(t[32]!==g||t[33]!==y||t[34]!==b||t[35]!==v||t[36]!==x||t[37]!==T.diff||t[38]!==T.properties.changes.length||t[39]!==T.properties.unparseable||t[40]!==T.status){let e=T.status===`ready`?me(T.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0,r=T.properties.changes.length;k=T.properties.changes.length>0||T.properties.unparseable!==null,L=`absolute inset-0 z-20 flex flex-col bg-background`,R=`agent-diff-pane`,N=`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`;let a;t[51]===g?a=t[52]:(a=g({id:`b18t0_`}),t[51]=g,t[52]=a);let o;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,h.jsx)(ie,{className:`size-4`}),t[53]=o):o=t[53];let s;t[54]===a?s=t[55]:(s=(0,h.jsx)(ee,{asChild:!0,children:(0,h.jsx)(re,{ref:Se,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-close`,"aria-label":a,onClick:ye,children:o})}),t[54]=a,t[55]=s);let c;t[56]===g?c=t[57]:(c=g({id:`b18t0_`}),t[56]=g,t[57]=c);let l;t[58]===c?l=t[59]:(l=(0,h.jsx)(te,{side:`bottom`,children:c}),t[58]=c,t[59]=l),t[60]!==s||t[61]!==l?(P=(0,h.jsxs)(ne,{children:[s,l]}),t[60]=s,t[61]=l,t[62]=P):P=t[62];let u;t[63]===y?u=t[64]:(u={backgroundColor:y},t[63]=y,t[64]=u);let d;t[65]===b?d=t[66]:(d=(0,h.jsx)(ae,{icon:b,width:13,height:13}),t[65]=b,t[66]=d),t[67]!==u||t[68]!==d?(F=(0,h.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-white`,style:u,children:d}),t[67]=u,t[68]=d,t[69]=F):F=t[69];let f;t[70]===x?f=t[71]:(f=(0,h.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:x}),t[70]=x,t[71]=f);let p;t[72]===v?p=t[73]:(p=(0,h.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:v}),t[72]=v,t[73]=p),t[74]!==f||t[75]!==p?(I=(0,h.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[f,p]}),t[74]=f,t[75]=p,t[76]=I):I=t[76],A=`ml-auto flex flex-wrap items-center justify-end gap-2`,t[77]===r?j=t[78]:(j=r>0&&(0,h.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,"data-testid":`agent-diff-property-stat`,children:(0,h.jsx)(i,{id:`UI0WPT`,values:{propertyCount:r}})}),t[77]=r,t[78]=j),M=n&&(0,h.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`agent-diff-stat`,"aria-label":g({id:`8lwQlE`,values:{0:e.additions,1:e.deletions}}),children:[(0,h.jsxs)(`span`,{"aria-hidden":`true`,className:`text-success`,children:[`+`,e.additions]}),` `,(0,h.jsxs)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:[`−`,e.deletions]})]}),t[32]=g,t[33]=y,t[34]=b,t[35]=v,t[36]=x,t[37]=T.diff,t[38]=T.properties.changes.length,t[39]=T.properties.unparseable,t[40]=T.status,t[41]=k,t[42]=A,t[43]=j,t[44]=M,t[45]=N,t[46]=P,t[47]=F,t[48]=I,t[49]=L,t[50]=R}else k=t[41],A=t[42],j=t[43],M=t[44],N=t[45],P=t[46],F=t[47],I=t[48],L=t[49],R=t[50];let Be;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(Be=e=>{(e===`rendered`||e===`source`)&&Ce(e)},t[79]=Be):Be=t[79];let z;t[80]===g?z=t[81]:(z=g({id:`ZW3mlR`}),t[80]=g,t[81]=z);let Ve;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,h.jsx)(c,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-rendered`,children:(0,h.jsx)(i,{id:`4z_1j2`})}),t[82]=Ve):Ve=t[82];let He;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,h.jsx)(c,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-source`,children:(0,h.jsx)(i,{id:`wdxz7K`})}),t[83]=He):He=t[83];let B;t[84]!==w||t[85]!==z?(B=(0,h.jsxs)(l,{type:`single`,value:w,onValueChange:Be,"aria-label":z,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[Ve,He]}),t[84]=w,t[85]=z,t[86]=B):B=t[86];let V;t[87]!==g||t[88]!==r?(V=g(r?{id:`6iDEWA`}:{id:`170Js2`}),t[87]=g,t[88]=r,t[89]=V):V=t[89];let Ue=!r,H;t[90]===r?H=t[91]:(H=r?(0,h.jsx)(f,{className:`size-4`}):(0,h.jsx)(d,{className:`size-4`}),t[90]=r,t[91]=H);let U;t[92]!==o||t[93]!==V||t[94]!==Ue||t[95]!==H?(U=(0,h.jsx)(ee,{asChild:!0,children:(0,h.jsx)(re,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-toggle-panel`,"aria-label":V,"aria-expanded":Ue,onClick:o,children:H})}),t[92]=o,t[93]=V,t[94]=Ue,t[95]=H,t[96]=U):U=t[96];let W;t[97]!==g||t[98]!==r?(W=g(r?{id:`6iDEWA`}:{id:`170Js2`}),t[97]=g,t[98]=r,t[99]=W):W=t[99];let G;t[100]===W?G=t[101]:(G=(0,h.jsx)(te,{side:`bottom`,children:W}),t[100]=W,t[101]=G);let K;t[102]!==U||t[103]!==G?(K=(0,h.jsxs)(ne,{children:[U,G]}),t[102]=U,t[103]=G,t[104]=K):K=t[104];let q;t[105]!==A||t[106]!==j||t[107]!==M||t[108]!==B||t[109]!==K?(q=(0,h.jsxs)(`div`,{className:A,children:[j,M,B,K]}),t[105]=A,t[106]=j,t[107]=M,t[108]=B,t[109]=K,t[110]=q):q=t[110];let J;t[111]!==N||t[112]!==P||t[113]!==F||t[114]!==I||t[115]!==q?(J=(0,h.jsxs)(`div`,{className:N,children:[P,F,I,q]}),t[111]=N,t[112]=P,t[113]=F,t[114]=I,t[115]=q,t[116]=J):J=t[116];let Y;t[117]===T.status?Y=t[118]:(Y=T.status===`loading`&&(0,h.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,h.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,h.jsx)(i,{id:`38foVZ`})]}),t[117]=T.status,t[118]=Y);let X;t[119]===T.status?X=t[120]:(X=T.status===`error`&&(0,h.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,h.jsx)(i,{id:`vvWZnu`})}),t[119]=T.status,t[120]=X);let Z;t[121]!==T.properties||t[122]!==T.status?(Z=T.status===`ready`&&(0,h.jsx)(de,{delta:T.properties}),t[121]=T.properties,t[122]=T.status,t[123]=Z):Z=t[123];let Q;t[124]!==_||t[125]!==x||t[126]!==k||t[127]!==S||t[128]!==w||t[129]!==Fe||t[130]!==T.after||t[131]!==T.before||t[132]!==T.diff||t[133]!==T.status?(Q=T.status===`ready`&&(w===`rendered`&&Fe?.ok?(0,h.jsx)(pe,{diff:Fe,docName:x}):T.diff===``?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:S===0?(0,h.jsx)(i,{id:`klPS-L`}):k?(0,h.jsx)(i,{id:`15ZHCt`}):(0,h.jsx)(i,{id:`k7Hoig`})}),(0,h.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:T.after})]}):(0,h.jsx)(m.Suspense,{fallback:(0,h.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,h.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,h.jsx)(i,{id:`EDm3wJ`})]}),children:(0,h.jsx)(ge,{before:T.before,after:T.after,cacheKey:`${_}@${x}@v${S}`})})),t[124]=_,t[125]=x,t[126]=k,t[127]=S,t[128]=w,t[129]=Fe,t[130]=T.after,t[131]=T.before,t[132]=T.diff,t[133]=T.status,t[134]=Q):Q=t[134];let $;t[135]!==Y||t[136]!==X||t[137]!==Z||t[138]!==Q?($=(0,h.jsxs)(`div`,{ref:xe,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[Y,X,Z,Q]}),t[135]=Y,t[136]=X,t[137]=Z,t[138]=Q,t[139]=$):$=t[139];let We;return t[140]!==L||t[141]!==R||t[142]!==J||t[143]!==$?(We=(0,h.jsxs)(`div`,{className:L,"data-testid":R,children:[J,$]}),t[140]=L,t[141]=R,t[142]=J,t[143]=$,t[144]=We):We=t[144],We}function ye(){return oe()}function be(){return new se(_e)}export{g as AgentDiffPane};
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{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./overlay-layers-CKMAjef3.js";import{i as ee,n as te,t as ne}from"./tooltip-BjuCvy5N.js";import{n as c,t as l}from"./toggle-group-B7p69Qfd.js";import{t as re}from"./button-DzgjsZzC.js";import{t as u}from"./spinner-Bx8xD6f8.js";import{t as d}from"./panel-right-close-Bsh1pCmh.js";import{t as f}from"./panel-right-open-D4M8nGPT.js";import{t as ie}from"./x-wldAHzfP.js";import{o as ae,r as p,t as oe}from"./agent-diff-store-BScyIbOO.js";import{t as se}from"./lru-string-cache-2BECYUJH.js";import{t as ce}from"./use-activity-panel-Bqo7iLoL.js";import{a as le,c as ue,d as de,o as fe,s as pe,t as me}from"./use-timeline-entry-diff-KpbAdkg7.js";var he=o(),m=e(r(),1),h=n(),ge=(0,m.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-C-bZ6dxH.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url)).ActivityPanelDiffView})),_e=64,ve={changes:[],unparseable:null};function g(e){let t=(0,he.c)(145),{view:n,isPanelCollapsed:r,onTogglePanel:o,onDestinationComplete:se,onDestinationFailed:_e}=e,{_:g}=a(),{agentId:_,agentName:v,agentColor:y,agentIcon:b,docName:x,keptCount:S}=n,[C]=(0,m.useState)(be),xe=(0,m.useRef)(null),Se=(0,m.useRef)(null),[w,Ce]=(0,m.useState)(`rendered`),we;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(we={status:`loading`,key:null,diff:``,before:``,after:``,properties:ve},t[0]=we):we=t[0];let[T,Te]=(0,m.useState)(we),E=`${_}\0${x}\0${S}`,Ee;t[1]===se?Ee=t[2]:(Ee=()=>{se?.(Se.current??void 0)},t[1]=se,t[2]=Ee);let De=(0,m.useEffectEvent)(Ee),D;t[3]===_e?D=t[4]:(D=()=>_e?.(),t[3]=_e,t[4]=D);let Oe=(0,m.useEffectEvent)(D),ke=(0,m.useRef)(null),Ae;t[5]!==De||t[6]!==E||t[7]!==Oe||t[8]!==T.key||t[9]!==T.status||t[10]!==n?(Ae=()=>{ke.current!==n&&T.key===E&&(T.status===`ready`?(ke.current=n,De()):T.status===`error`&&(ke.current=n,Oe()))},t[5]=De,t[6]=E,t[7]=Oe,t[8]=T.key,t[9]=T.status,t[10]=n,t[11]=Ae):Ae=t[11];let je;t[12]!==E||t[13]!==T||t[14]!==n?(je=[T,E,n],t[12]=E,t[13]=T,t[14]=n,t[15]=je):je=t[15],(0,m.useEffect)(Ae,je);let Me,Ne;t[16]!==_||t[17]!==C||t[18]!==x||t[19]!==S?(Me=()=>{let e=!1;Te({status:`loading`,key:null,diff:``,before:``,after:``,properties:ve});let t=`${_}\0${x}\0${S}`,n=C.get(t);if(n!==void 0){Te({status:`ready`,key:t,...JSON.parse(n)});return}return ce(_,x,S).then(n=>{e||(C.set(t,JSON.stringify(n)),Te({status:`ready`,key:t,...n}))}).catch(n=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:_,docName:x,keptCount:S,err:n}),Te({status:`error`,key:t,diff:``,before:``,after:``,properties:ve}))}),()=>{e=!0}},Ne=[_,x,S,C],t[16]=_,t[17]=C,t[18]=x,t[19]=S,t[20]=Me,t[21]=Ne):(Me=t[20],Ne=t[21]),(0,m.useEffect)(Me,Ne);let Pe;t[22]!==T.after||t[23]!==T.before||t[24]!==T.status?(Pe=T.status===`ready`?ue(T.before,T.after):null,t[22]=T.after,t[23]=T.before,t[24]=T.status,t[25]=Pe):Pe=t[25];let Fe=Pe,Ie=T.status===`ready`?`${w}:${S}:${T.diff}`:``,Le,Re;t[26]===Ie?(Le=t[27],Re=t[28]):(Re=()=>{let e=xe.current;if(Ie===``||!e)return;let t=!1,n=null,r,i,a=()=>{if(t)return;s.sync();let r=e.querySelector(`[data-property-change]`)??e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??le(e)[0];if(!r)return;t=!0,n?.disconnect(),s.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},o=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(a)})},120))},s=fe(e,o);n=new MutationObserver(o),n.observe(e,{childList:!0,subtree:!0}),o();let ee=setTimeout(()=>{n?.disconnect(),s.disconnect()},5e3);return()=>{n?.disconnect(),s.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(ee)}},Le=[Ie],t[26]=Ie,t[27]=Le,t[28]=Re),(0,m.useEffect)(Re,Le);let O,ze;t[29]===S?(O=t[30],ze=t[31]):(O=()=>{let e=e=>{if(e.key===`Escape`&&e.defaultPrevented||s())return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`Escape`?oe():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),p(S+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),p(S-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},ze=[S],t[29]=S,t[30]=O,t[31]=ze),(0,m.useEffect)(O,ze);let k,A,j,M,N,P,F,I,L,R;if(t[32]!==g||t[33]!==y||t[34]!==b||t[35]!==v||t[36]!==x||t[37]!==T.diff||t[38]!==T.properties.changes.length||t[39]!==T.properties.unparseable||t[40]!==T.status){let e=T.status===`ready`?me(T.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0,r=T.properties.changes.length;k=T.properties.changes.length>0||T.properties.unparseable!==null,L=`absolute inset-0 z-20 flex flex-col bg-background`,R=`agent-diff-pane`,N=`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`;let a;t[51]===g?a=t[52]:(a=g({id:`b18t0_`}),t[51]=g,t[52]=a);let o;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,h.jsx)(ie,{className:`size-4`}),t[53]=o):o=t[53];let s;t[54]===a?s=t[55]:(s=(0,h.jsx)(ee,{asChild:!0,children:(0,h.jsx)(re,{ref:Se,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-close`,"aria-label":a,onClick:ye,children:o})}),t[54]=a,t[55]=s);let c;t[56]===g?c=t[57]:(c=g({id:`b18t0_`}),t[56]=g,t[57]=c);let l;t[58]===c?l=t[59]:(l=(0,h.jsx)(te,{side:`bottom`,children:c}),t[58]=c,t[59]=l),t[60]!==s||t[61]!==l?(P=(0,h.jsxs)(ne,{children:[s,l]}),t[60]=s,t[61]=l,t[62]=P):P=t[62];let u;t[63]===y?u=t[64]:(u={backgroundColor:y},t[63]=y,t[64]=u);let d;t[65]===b?d=t[66]:(d=(0,h.jsx)(ae,{icon:b,width:13,height:13}),t[65]=b,t[66]=d),t[67]!==u||t[68]!==d?(F=(0,h.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-white`,style:u,children:d}),t[67]=u,t[68]=d,t[69]=F):F=t[69];let f;t[70]===x?f=t[71]:(f=(0,h.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:x}),t[70]=x,t[71]=f);let p;t[72]===v?p=t[73]:(p=(0,h.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:v}),t[72]=v,t[73]=p),t[74]!==f||t[75]!==p?(I=(0,h.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[f,p]}),t[74]=f,t[75]=p,t[76]=I):I=t[76],A=`ml-auto flex flex-wrap items-center justify-end gap-2`,t[77]===r?j=t[78]:(j=r>0&&(0,h.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,"data-testid":`agent-diff-property-stat`,children:(0,h.jsx)(i,{id:`UI0WPT`,values:{propertyCount:r}})}),t[77]=r,t[78]=j),M=n&&(0,h.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`agent-diff-stat`,"aria-label":g({id:`8lwQlE`,values:{0:e.additions,1:e.deletions}}),children:[(0,h.jsxs)(`span`,{"aria-hidden":`true`,className:`text-success`,children:[`+`,e.additions]}),` `,(0,h.jsxs)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:[`−`,e.deletions]})]}),t[32]=g,t[33]=y,t[34]=b,t[35]=v,t[36]=x,t[37]=T.diff,t[38]=T.properties.changes.length,t[39]=T.properties.unparseable,t[40]=T.status,t[41]=k,t[42]=A,t[43]=j,t[44]=M,t[45]=N,t[46]=P,t[47]=F,t[48]=I,t[49]=L,t[50]=R}else k=t[41],A=t[42],j=t[43],M=t[44],N=t[45],P=t[46],F=t[47],I=t[48],L=t[49],R=t[50];let Be;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(Be=e=>{(e===`rendered`||e===`source`)&&Ce(e)},t[79]=Be):Be=t[79];let z;t[80]===g?z=t[81]:(z=g({id:`ZW3mlR`}),t[80]=g,t[81]=z);let Ve;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,h.jsx)(c,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-rendered`,children:(0,h.jsx)(i,{id:`4z_1j2`})}),t[82]=Ve):Ve=t[82];let He;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,h.jsx)(c,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-source`,children:(0,h.jsx)(i,{id:`wdxz7K`})}),t[83]=He):He=t[83];let B;t[84]!==w||t[85]!==z?(B=(0,h.jsxs)(l,{type:`single`,value:w,onValueChange:Be,"aria-label":z,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[Ve,He]}),t[84]=w,t[85]=z,t[86]=B):B=t[86];let V;t[87]!==g||t[88]!==r?(V=g(r?{id:`6iDEWA`}:{id:`170Js2`}),t[87]=g,t[88]=r,t[89]=V):V=t[89];let Ue=!r,H;t[90]===r?H=t[91]:(H=r?(0,h.jsx)(f,{className:`size-4`}):(0,h.jsx)(d,{className:`size-4`}),t[90]=r,t[91]=H);let U;t[92]!==o||t[93]!==V||t[94]!==Ue||t[95]!==H?(U=(0,h.jsx)(ee,{asChild:!0,children:(0,h.jsx)(re,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-toggle-panel`,"aria-label":V,"aria-expanded":Ue,onClick:o,children:H})}),t[92]=o,t[93]=V,t[94]=Ue,t[95]=H,t[96]=U):U=t[96];let W;t[97]!==g||t[98]!==r?(W=g(r?{id:`6iDEWA`}:{id:`170Js2`}),t[97]=g,t[98]=r,t[99]=W):W=t[99];let G;t[100]===W?G=t[101]:(G=(0,h.jsx)(te,{side:`bottom`,children:W}),t[100]=W,t[101]=G);let K;t[102]!==U||t[103]!==G?(K=(0,h.jsxs)(ne,{children:[U,G]}),t[102]=U,t[103]=G,t[104]=K):K=t[104];let q;t[105]!==A||t[106]!==j||t[107]!==M||t[108]!==B||t[109]!==K?(q=(0,h.jsxs)(`div`,{className:A,children:[j,M,B,K]}),t[105]=A,t[106]=j,t[107]=M,t[108]=B,t[109]=K,t[110]=q):q=t[110];let J;t[111]!==N||t[112]!==P||t[113]!==F||t[114]!==I||t[115]!==q?(J=(0,h.jsxs)(`div`,{className:N,children:[P,F,I,q]}),t[111]=N,t[112]=P,t[113]=F,t[114]=I,t[115]=q,t[116]=J):J=t[116];let Y;t[117]===T.status?Y=t[118]:(Y=T.status===`loading`&&(0,h.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,h.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,h.jsx)(i,{id:`38foVZ`})]}),t[117]=T.status,t[118]=Y);let X;t[119]===T.status?X=t[120]:(X=T.status===`error`&&(0,h.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,h.jsx)(i,{id:`vvWZnu`})}),t[119]=T.status,t[120]=X);let Z;t[121]!==T.properties||t[122]!==T.status?(Z=T.status===`ready`&&(0,h.jsx)(de,{delta:T.properties}),t[121]=T.properties,t[122]=T.status,t[123]=Z):Z=t[123];let Q;t[124]!==_||t[125]!==x||t[126]!==k||t[127]!==S||t[128]!==w||t[129]!==Fe||t[130]!==T.after||t[131]!==T.before||t[132]!==T.diff||t[133]!==T.status?(Q=T.status===`ready`&&(w===`rendered`&&Fe?.ok?(0,h.jsx)(pe,{diff:Fe,docName:x}):T.diff===``?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:S===0?(0,h.jsx)(i,{id:`klPS-L`}):k?(0,h.jsx)(i,{id:`15ZHCt`}):(0,h.jsx)(i,{id:`k7Hoig`})}),(0,h.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:T.after})]}):(0,h.jsx)(m.Suspense,{fallback:(0,h.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,h.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,h.jsx)(i,{id:`EDm3wJ`})]}),children:(0,h.jsx)(ge,{before:T.before,after:T.after,cacheKey:`${_}@${x}@v${S}`})})),t[124]=_,t[125]=x,t[126]=k,t[127]=S,t[128]=w,t[129]=Fe,t[130]=T.after,t[131]=T.before,t[132]=T.diff,t[133]=T.status,t[134]=Q):Q=t[134];let $;t[135]!==Y||t[136]!==X||t[137]!==Z||t[138]!==Q?($=(0,h.jsxs)(`div`,{ref:xe,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[Y,X,Z,Q]}),t[135]=Y,t[136]=X,t[137]=Z,t[138]=Q,t[139]=$):$=t[139];let We;return t[140]!==L||t[141]!==R||t[142]!==J||t[143]!==$?(We=(0,h.jsxs)(`div`,{className:L,"data-testid":R,children:[J,$]}),t[140]=L,t[141]=R,t[142]=J,t[143]=$,t[144]=We):We=t[144],We}function ye(){return oe()}function be(){return new se(_e)}export{g as AgentDiffPane};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import"./constants-upload-DZP-sCdl.js";import{n as s}from"./dist-BGzUo_18.js";import{n as c}from"./config-errors-CHiUH8-1.js";import"./constants-cc1-Bt4QPTUe.js";import{i as l}from"./use-apply-config-theme-CYFG76sS.js";import{i as ee,t as te}from"./field-DtEiTjHS.js";import"./config-provider-CbxzkzQ_.js";import{S as u,b as d,s as ne,v as re,y as ie}from"./saved-themes-client-CERsocAi.js";import{t as ae}from"./input-CgydZJoC.js";import{n as oe}from"./config-validation-events-88awVkQh.js";import{t as se}from"./SettingsSectionHeader-2iTSJQHd.js";import"./config-schema-JSuM1ay_.js";import{a as ce,i as le,n as ue,t as de}from"./field-controls-BUVPC8fp.js";var f=a(),p=e(n(),1),m=t(),h=`content.attachmentFolderPath`,fe=`notes/meeting.md`,g=`image.png`,pe=`https://openknowledge.ai/docs/features/assets-and-embeds#attachment-folder`;function me(e){let t=re(e,fe);return t===``?g:`${t}/${g}`}function _(){let e=(0,f.c)(6),{projectBinding:t,projectConfig:n,projectSynced:r}=l();if(!t||!r||!n){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,m.jsx)(ue,{}),e[0]=t):t=e[0],t}let i=n.content.attachmentFolderPath??`./{{filename}}.assets`,a;e[1]===i?a=e[2]:(a=d(i),e[1]=i,e[2]=a);let o=a,s;return e[3]!==o||e[4]!==t?(s=(0,m.jsx)(v,{binding:t,value:o}),e[3]=o,e[4]=t,e[5]=s):s=e[5],s}function v(e){let t=(0,f.c)(54),{binding:n,value:a}=e,{_:l}=i(),[u,d]=(0,p.useState)(a),[ne,re]=(0,p.useState)(a),[ue,g]=(0,p.useState)(!1);ne!==a&&(re(a),d(a),g(!1));let[_,v]=(0,p.useState)(0),[y,b]=(0,p.useState)(null),[x,S]=(0,p.useState)(!1),[_e,ve]=(0,p.useState)(!1),C=(0,p.useRef)(null),w=(0,p.useRef)(null),T,E;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>()=>{C.current&&clearTimeout(C.current),w.current&&clearTimeout(w.current)},E=[],t[0]=T,t[1]=E):(T=t[0],E=t[1]),(0,p.useEffect)(T,E);let D,O;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>oe(e=>{if(e.docName!==`__config__/project`||le(e.error)!==h)return;let t=ce(e.error,h);s.error(c(e.error),{duration:8e3}),b(t),ve(!0),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{ve(!1),b(null)},600)}),O=[],t[2]=D,t[3]=O):(D=t[2],O=t[3]),(0,p.useEffect)(D,O);let k;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{S(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>S(!1),1200)},t[4]=k):k=t[4];let ye=k,A=u!==a,j;t[5]===u?j=t[6]:(j=ie(u),t[5]=u,t[6]=j);let M=j,N=M!==null||y!==null,P=ue||y!==null,F;t[7]!==l||t[8]!==n||t[9]!==u||t[10]!==M||t[11]!==A?(F=()=>{if(!A)return;if(M){g(!0);return}let e=n.patch({content:{attachmentFolderPath:u}});if(e.ok){b(null),ye();return}let t=ce(e.error,h);b(t),s.error(l({id:`eQxm13`,values:{detail:t}}))},t[7]=l,t[8]=n,t[9]=u,t[10]=M,t[11]=A,t[12]=F):F=t[12];let I=F,L;t[13]===u?L=t[14]:(L=me(u),t[13]=u,t[14]=L);let R=L,be=`settings-attachments-description ${N?`settings-attachments-path-error`:`settings-attachments-path-example`}`,z;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,m.jsx)(r,{id:`w_Sphq`}),t[15]=z):z=t[15];let B;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,m.jsx)(se,{titleId:`settings-attachments-title`,title:z,scope:`project`,level:`block`,docUrl:pe,descriptionId:`settings-attachments-description`,children:(0,m.jsx)(r,{id:`z882yj`})}),t[16]=B):B=t[16];let xe=_e&&`animate-settings-flash`,V;t[17]===xe?V=t[18]:(V=o(xe),t[17]=xe,t[18]=V);let H,U,W;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>{d(e.target.value),g(!1),b(null),v(e.target.scrollLeft)},U=e=>v(e.currentTarget.scrollLeft),W=e=>v(e.currentTarget.scrollLeft),t[19]=H,t[20]=U,t[21]=W):(H=t[19],U=t[20],W=t[21]);let G;t[22]===I?G=t[23]:(G=e=>{e.key!==`Enter`||e.nativeEvent.isComposing||(e.preventDefault(),I())},t[22]=I,t[23]=G);let K;t[24]!==I||t[25]!==be||t[26]!==u||t[27]!==N||t[28]!==G?(K=(0,m.jsx)(ae,{"aria-labelledby":`settings-attachments-title`,dir:`ltr`,value:u,spellCheck:!1,autoComplete:`off`,"aria-invalid":N,"aria-describedby":be,onChange:H,onScroll:U,onSelect:W,onBlur:I,onKeyDown:G,className:`font-mono text-sm text-transparent caret-foreground md:text-sm`,"data-testid":`settings-attachments-path`}),t[24]=I,t[25]=be,t[26]=u,t[27]=N,t[28]=G,t[29]=K):K=t[29];let q;t[30]!==u||t[31]!==_?(q=(0,m.jsx)(ge,{value:u,scrollLeft:_}),t[30]=u,t[31]=_,t[32]=q):q=t[32];let J;t[33]!==K||t[34]!==q?(J=(0,m.jsxs)(`div`,{className:`relative max-w-md`,children:[K,q]}),t[33]=K,t[34]=q,t[35]=J):J=t[35];let Y;t[36]!==P||t[37]!==M||t[38]!==R||t[39]!==N||t[40]!==y?(Y=N?(0,m.jsx)(ee,{role:P?`alert`:void 0,id:`settings-attachments-path-error`,"data-field-error":h,"data-testid":`settings-attachments-path-error`,children:M?(0,m.jsx)(he,{problem:M}):y},P?`announced`:`typing`):(0,m.jsx)(`p`,{className:`text-1sm text-muted-foreground`,id:`settings-attachments-path-example`,"data-testid":`settings-attachments-preview`,children:(0,m.jsx)(r,{id:`sTgmyi`,values:{exampleDoc:fe,exampleFile:R},components:{0:(0,m.jsx)(`code`,{dir:`ltr`}),1:(0,m.jsx)(`code`,{dir:`ltr`})}})}),t[36]=P,t[37]=M,t[38]=R,t[39]=N,t[40]=y,t[41]=Y):Y=t[41];let X;t[42]===x?X=t[43]:(X=(0,m.jsx)(de,{visible:x}),t[42]=x,t[43]=X);let Z;t[44]!==Y||t[45]!==X?(Z=(0,m.jsxs)(`div`,{className:`flex min-h-5 items-center gap-2`,children:[Y,X]}),t[44]=Y,t[45]=X,t[46]=Z):Z=t[46];let Q;t[47]!==N||t[48]!==J||t[49]!==Z?(Q=(0,m.jsxs)(te,{"data-invalid":N,className:`gap-2`,children:[J,Z]}),t[47]=N,t[48]=J,t[49]=Z,t[50]=Q):Q=t[50];let $;return t[51]!==V||t[52]!==Q?($=(0,m.jsxs)(`section`,{"aria-labelledby":`settings-attachments-title`,className:`flex flex-col gap-3`,"data-testid":`settings-attachments`,children:[B,(0,m.jsx)(`div`,{className:V,"data-field":h,"data-scope":`project`,children:Q})]}),t[51]=V,t[52]=Q,t[53]=$):$=t[53],$}function he(e){let t=(0,f.c)(25),{problem:n}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`{{filename}}`}),t[0]=i):i=t[0];let a=i;switch(n.kind){case`empty`:case`missing-prefix`:case`outside-project`:{let e;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`./`}),t[1]=e):e=t[1];let n=e,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`/`}),t[2]=i):i=t[2];let a=i,o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`..`}),t[3]=o):o=t[3];let s=o,c;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,m.jsx)(r,{id:`wi7z3q`,values:{documentPrefix:n,rootPrefix:a,parentFolder:s}}),t[4]=c):c=t[4],c}case`reserved-character`:{let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`< > : " \\ | ? *`}),t[5]=e):e=t[5];let n=e,i;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(r,{id:`6br5wc`,values:{reserved:n}}),t[6]=i):i=t[6],i}case`surrounding-space`:{let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(r,{id:`ZZNgjA`}),t[7]=e):e=t[7],e}case`empty-folder-name`:{let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(r,{id:`xfMk60`}),t[8]=e):e=t[8],e}case`trailing-slash`:{let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(r,{id:`kJdwE7`}),t[9]=e):e=t[9],e}case`single-brace`:{let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(r,{id:`-du53a`,values:{filenameVariable:a}}),t[10]=e):e=t[10],e}case`unknown-variable`:{let e;t[11]===n.variables?e=t[12]:(e=n.variables.join(`, `),t[11]=n.variables,t[12]=e);let i;t[13]===e?i=t[14]:(i=(0,m.jsx)(`bdi`,{dir:`ltr`,children:e}),t[13]=e,t[14]=i);let a=i,o;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,m.jsx)(`bdi`,{dir:`ltr`,children:ne.map(y).join(`, `)}),t[15]=o):o=t[15];let s=o,c;return t[16]!==s||t[17]!==a?(c=(0,m.jsx)(r,{id:`9R-mxL`,values:{unknownList:a,supportedVariables:s}}),t[16]=s,t[17]=a,t[18]=c):c=t[18],c}case`unclosed-braces`:{let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`{{`}),t[19]=e):e=t[19];let n=e,i;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`}}`}),t[20]=i):i=t[20];let a=i,o;return t[21]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,m.jsx)(r,{id:`Jl3Qmh`,values:{open:n,close:a}}),t[21]=o):o=t[21],o}case`repeated-variable`:{let e;return t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(r,{id:`urWO5h`,values:{filenameVariable:a}}),t[22]=e):e=t[22],e}default:{let e;return t[23]===n?e=t[24]:(e=b(n),t[23]=n,t[24]=e),e}}}function y(e){return`{{${e}}}`}function b(e){throw Error(`unhandled attachment path problem: ${JSON.stringify(e)}`)}function ge(e){let t=(0,f.c)(7),{value:n,scrollLeft:r}=e,i=`translateX(${-r}px)`,a;t[0]===i?a=t[1]:(a={transform:i},t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=u(n).map(x),t[2]=n,t[3]=o);let s;return t[4]!==a||t[5]!==o?(s=(0,m.jsx)(`div`,{"aria-hidden":`true`,dir:`ltr`,"data-testid":`settings-attachments-path-highlight`,className:`pointer-events-none absolute inset-0 flex items-center overflow-hidden rounded-lg border border-transparent px-2.5 font-mono text-sm whitespace-pre forced-colors:hidden`,children:(0,m.jsx)(`span`,{style:a,children:o})}),t[4]=a,t[5]=o,t[6]=s):s=t[6],s}function x(e){return(0,m.jsx)(S,{part:e},e.start)}function S(e){let t=(0,f.c)(8),{part:n}=e;switch(n.kind){case`text`:{let e;return t[0]===n.text?e=t[1]:(e=(0,m.jsx)(`span`,{children:n.text}),t[0]=n.text,t[1]=e),e}case`variable`:{let e;return t[2]===n.text?e=t[3]:(e=(0,m.jsx)(`span`,{"data-token":`known`,className:`rounded-sm bg-primary/15 text-foreground ring-1 ring-primary/40`,children:n.text}),t[2]=n.text,t[3]=e),e}case`unknown-variable`:{let e;return t[4]===n.text?e=t[5]:(e=(0,m.jsx)(`span`,{"data-token":`unknown`,className:`text-destructive underline decoration-destructive decoration-wavy underline-offset-4`,children:n.text}),t[4]=n.text,t[5]=e),e}default:{let e;return t[6]===n?e=t[7]:(e=_e(n),t[6]=n,t[7]=e),e}}}function _e(e){throw Error(`unhandled attachment path part: ${JSON.stringify(e)}`)}export{_ as AttachmentsSection};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import"./constants-upload-DZP-sCdl.js";import{n as s}from"./dist-BGzUo_18.js";import{n as c}from"./config-errors-CHiUH8-1.js";import"./constants-cc1-Bt4QPTUe.js";import{i as l}from"./use-apply-config-theme-CYFG76sS.js";import{i as ee,t as te}from"./field-DtEiTjHS.js";import"./config-provider-B2uReVA0.js";import{S as u,b as d,s as ne,v as re,y as ie}from"./saved-themes-client-CERsocAi.js";import{t as ae}from"./input-CgydZJoC.js";import{n as oe}from"./config-validation-events-88awVkQh.js";import{t as se}from"./SettingsSectionHeader-2iTSJQHd.js";import"./config-schema-JSuM1ay_.js";import{a as ce,i as le,n as ue,t as de}from"./field-controls-BUVPC8fp.js";var f=a(),p=e(n(),1),m=t(),h=`content.attachmentFolderPath`,fe=`notes/meeting.md`,g=`image.png`,pe=`https://openknowledge.ai/docs/features/assets-and-embeds#attachment-folder`;function me(e){let t=re(e,fe);return t===``?g:`${t}/${g}`}function _(){let e=(0,f.c)(6),{projectBinding:t,projectConfig:n,projectSynced:r}=l();if(!t||!r||!n){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,m.jsx)(ue,{}),e[0]=t):t=e[0],t}let i=n.content.attachmentFolderPath??`./{{filename}}.assets`,a;e[1]===i?a=e[2]:(a=d(i),e[1]=i,e[2]=a);let o=a,s;return e[3]!==o||e[4]!==t?(s=(0,m.jsx)(v,{binding:t,value:o}),e[3]=o,e[4]=t,e[5]=s):s=e[5],s}function v(e){let t=(0,f.c)(54),{binding:n,value:a}=e,{_:l}=i(),[u,d]=(0,p.useState)(a),[ne,re]=(0,p.useState)(a),[ue,g]=(0,p.useState)(!1);ne!==a&&(re(a),d(a),g(!1));let[_,v]=(0,p.useState)(0),[y,b]=(0,p.useState)(null),[x,S]=(0,p.useState)(!1),[_e,ve]=(0,p.useState)(!1),C=(0,p.useRef)(null),w=(0,p.useRef)(null),T,E;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>()=>{C.current&&clearTimeout(C.current),w.current&&clearTimeout(w.current)},E=[],t[0]=T,t[1]=E):(T=t[0],E=t[1]),(0,p.useEffect)(T,E);let D,O;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>oe(e=>{if(e.docName!==`__config__/project`||le(e.error)!==h)return;let t=ce(e.error,h);s.error(c(e.error),{duration:8e3}),b(t),ve(!0),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{ve(!1),b(null)},600)}),O=[],t[2]=D,t[3]=O):(D=t[2],O=t[3]),(0,p.useEffect)(D,O);let k;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{S(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>S(!1),1200)},t[4]=k):k=t[4];let ye=k,A=u!==a,j;t[5]===u?j=t[6]:(j=ie(u),t[5]=u,t[6]=j);let M=j,N=M!==null||y!==null,P=ue||y!==null,F;t[7]!==l||t[8]!==n||t[9]!==u||t[10]!==M||t[11]!==A?(F=()=>{if(!A)return;if(M){g(!0);return}let e=n.patch({content:{attachmentFolderPath:u}});if(e.ok){b(null),ye();return}let t=ce(e.error,h);b(t),s.error(l({id:`eQxm13`,values:{detail:t}}))},t[7]=l,t[8]=n,t[9]=u,t[10]=M,t[11]=A,t[12]=F):F=t[12];let I=F,L;t[13]===u?L=t[14]:(L=me(u),t[13]=u,t[14]=L);let R=L,be=`settings-attachments-description ${N?`settings-attachments-path-error`:`settings-attachments-path-example`}`,z;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,m.jsx)(r,{id:`w_Sphq`}),t[15]=z):z=t[15];let B;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,m.jsx)(se,{titleId:`settings-attachments-title`,title:z,scope:`project`,level:`block`,docUrl:pe,descriptionId:`settings-attachments-description`,children:(0,m.jsx)(r,{id:`z882yj`})}),t[16]=B):B=t[16];let xe=_e&&`animate-settings-flash`,V;t[17]===xe?V=t[18]:(V=o(xe),t[17]=xe,t[18]=V);let H,U,W;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>{d(e.target.value),g(!1),b(null),v(e.target.scrollLeft)},U=e=>v(e.currentTarget.scrollLeft),W=e=>v(e.currentTarget.scrollLeft),t[19]=H,t[20]=U,t[21]=W):(H=t[19],U=t[20],W=t[21]);let G;t[22]===I?G=t[23]:(G=e=>{e.key!==`Enter`||e.nativeEvent.isComposing||(e.preventDefault(),I())},t[22]=I,t[23]=G);let K;t[24]!==I||t[25]!==be||t[26]!==u||t[27]!==N||t[28]!==G?(K=(0,m.jsx)(ae,{"aria-labelledby":`settings-attachments-title`,dir:`ltr`,value:u,spellCheck:!1,autoComplete:`off`,"aria-invalid":N,"aria-describedby":be,onChange:H,onScroll:U,onSelect:W,onBlur:I,onKeyDown:G,className:`font-mono text-sm text-transparent caret-foreground md:text-sm`,"data-testid":`settings-attachments-path`}),t[24]=I,t[25]=be,t[26]=u,t[27]=N,t[28]=G,t[29]=K):K=t[29];let q;t[30]!==u||t[31]!==_?(q=(0,m.jsx)(ge,{value:u,scrollLeft:_}),t[30]=u,t[31]=_,t[32]=q):q=t[32];let J;t[33]!==K||t[34]!==q?(J=(0,m.jsxs)(`div`,{className:`relative max-w-md`,children:[K,q]}),t[33]=K,t[34]=q,t[35]=J):J=t[35];let Y;t[36]!==P||t[37]!==M||t[38]!==R||t[39]!==N||t[40]!==y?(Y=N?(0,m.jsx)(ee,{role:P?`alert`:void 0,id:`settings-attachments-path-error`,"data-field-error":h,"data-testid":`settings-attachments-path-error`,children:M?(0,m.jsx)(he,{problem:M}):y},P?`announced`:`typing`):(0,m.jsx)(`p`,{className:`text-1sm text-muted-foreground`,id:`settings-attachments-path-example`,"data-testid":`settings-attachments-preview`,children:(0,m.jsx)(r,{id:`sTgmyi`,values:{exampleDoc:fe,exampleFile:R},components:{0:(0,m.jsx)(`code`,{dir:`ltr`}),1:(0,m.jsx)(`code`,{dir:`ltr`})}})}),t[36]=P,t[37]=M,t[38]=R,t[39]=N,t[40]=y,t[41]=Y):Y=t[41];let X;t[42]===x?X=t[43]:(X=(0,m.jsx)(de,{visible:x}),t[42]=x,t[43]=X);let Z;t[44]!==Y||t[45]!==X?(Z=(0,m.jsxs)(`div`,{className:`flex min-h-5 items-center gap-2`,children:[Y,X]}),t[44]=Y,t[45]=X,t[46]=Z):Z=t[46];let Q;t[47]!==N||t[48]!==J||t[49]!==Z?(Q=(0,m.jsxs)(te,{"data-invalid":N,className:`gap-2`,children:[J,Z]}),t[47]=N,t[48]=J,t[49]=Z,t[50]=Q):Q=t[50];let $;return t[51]!==V||t[52]!==Q?($=(0,m.jsxs)(`section`,{"aria-labelledby":`settings-attachments-title`,className:`flex flex-col gap-3`,"data-testid":`settings-attachments`,children:[B,(0,m.jsx)(`div`,{className:V,"data-field":h,"data-scope":`project`,children:Q})]}),t[51]=V,t[52]=Q,t[53]=$):$=t[53],$}function he(e){let t=(0,f.c)(25),{problem:n}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`{{filename}}`}),t[0]=i):i=t[0];let a=i;switch(n.kind){case`empty`:case`missing-prefix`:case`outside-project`:{let e;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`./`}),t[1]=e):e=t[1];let n=e,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`/`}),t[2]=i):i=t[2];let a=i,o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`..`}),t[3]=o):o=t[3];let s=o,c;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,m.jsx)(r,{id:`wi7z3q`,values:{documentPrefix:n,rootPrefix:a,parentFolder:s}}),t[4]=c):c=t[4],c}case`reserved-character`:{let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`< > : " \\ | ? *`}),t[5]=e):e=t[5];let n=e,i;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(r,{id:`6br5wc`,values:{reserved:n}}),t[6]=i):i=t[6],i}case`surrounding-space`:{let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(r,{id:`ZZNgjA`}),t[7]=e):e=t[7],e}case`empty-folder-name`:{let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(r,{id:`xfMk60`}),t[8]=e):e=t[8],e}case`trailing-slash`:{let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(r,{id:`kJdwE7`}),t[9]=e):e=t[9],e}case`single-brace`:{let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(r,{id:`-du53a`,values:{filenameVariable:a}}),t[10]=e):e=t[10],e}case`unknown-variable`:{let e;t[11]===n.variables?e=t[12]:(e=n.variables.join(`, `),t[11]=n.variables,t[12]=e);let i;t[13]===e?i=t[14]:(i=(0,m.jsx)(`bdi`,{dir:`ltr`,children:e}),t[13]=e,t[14]=i);let a=i,o;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,m.jsx)(`bdi`,{dir:`ltr`,children:ne.map(y).join(`, `)}),t[15]=o):o=t[15];let s=o,c;return t[16]!==s||t[17]!==a?(c=(0,m.jsx)(r,{id:`9R-mxL`,values:{unknownList:a,supportedVariables:s}}),t[16]=s,t[17]=a,t[18]=c):c=t[18],c}case`unclosed-braces`:{let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`{{`}),t[19]=e):e=t[19];let n=e,i;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(`bdi`,{dir:`ltr`,children:`}}`}),t[20]=i):i=t[20];let a=i,o;return t[21]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,m.jsx)(r,{id:`Jl3Qmh`,values:{open:n,close:a}}),t[21]=o):o=t[21],o}case`repeated-variable`:{let e;return t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(r,{id:`urWO5h`,values:{filenameVariable:a}}),t[22]=e):e=t[22],e}default:{let e;return t[23]===n?e=t[24]:(e=b(n),t[23]=n,t[24]=e),e}}}function y(e){return`{{${e}}}`}function b(e){throw Error(`unhandled attachment path problem: ${JSON.stringify(e)}`)}function ge(e){let t=(0,f.c)(7),{value:n,scrollLeft:r}=e,i=`translateX(${-r}px)`,a;t[0]===i?a=t[1]:(a={transform:i},t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=u(n).map(x),t[2]=n,t[3]=o);let s;return t[4]!==a||t[5]!==o?(s=(0,m.jsx)(`div`,{"aria-hidden":`true`,dir:`ltr`,"data-testid":`settings-attachments-path-highlight`,className:`pointer-events-none absolute inset-0 flex items-center overflow-hidden rounded-lg border border-transparent px-2.5 font-mono text-sm whitespace-pre forced-colors:hidden`,children:(0,m.jsx)(`span`,{style:a,children:o})}),t[4]=a,t[5]=o,t[6]=s):s=t[6],s}function x(e){return(0,m.jsx)(S,{part:e},e.start)}function S(e){let t=(0,f.c)(8),{part:n}=e;switch(n.kind){case`text`:{let e;return t[0]===n.text?e=t[1]:(e=(0,m.jsx)(`span`,{children:n.text}),t[0]=n.text,t[1]=e),e}case`variable`:{let e;return t[2]===n.text?e=t[3]:(e=(0,m.jsx)(`span`,{"data-token":`known`,className:`rounded-sm bg-primary/15 text-foreground ring-1 ring-primary/40`,children:n.text}),t[2]=n.text,t[3]=e),e}case`unknown-variable`:{let e;return t[4]===n.text?e=t[5]:(e=(0,m.jsx)(`span`,{"data-token":`unknown`,className:`text-destructive underline decoration-destructive decoration-wavy underline-offset-4`,children:n.text}),t[4]=n.text,t[5]=e),e}default:{let e;return t[6]===n?e=t[7]:(e=_e(n),t[6]=n,t[7]=e),e}}}function _e(e){throw Error(`unhandled attachment path part: ${JSON.stringify(e)}`)}export{_ as AttachmentsSection};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dist-CNHpRWc3.js","./chunk-CYidjpOJ.js","./dist-CoJBCixp.js","./w3c-keyname-C7Rznu6R.js","./dist-B1rPVlDX.js","./dist-DLTuJxuQ2.js","./dist-p2hXHa0R.js","./dist-kajsw8zD.js","./dist-CKEXRmEK.js","./stex-CmWau-0j.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,f,i as p,l as m,r as h}from"./floating-ui.dom-BYl7JZd0.js";import{_ as g,a as _,d as v,f as y,i as b,n as x,o as S,r as C,t as w,u as T}from"./constants-upload-DZP-sCdl.js";import{$ as ee,A as E,B as te,C as ne,F as re,G as ie,K as D,L as O,N as ae,P as oe,Q as se,R as ce,S as le,T as ue,U as de,V as fe,W as pe,X as me,Y as he,_ as ge,a as _e,at as k,b as ve,bt as A,c as ye,ct as j,d as be,et as xe,f as Se,g as Ce,gt as we,h as Te,ht as Ee,it as M,k as N,l as De,mt as Oe,n as P,nt as ke,o as F,ot as Ae,p as je,q as Me,r as Ne,rt as Pe,s as Fe,st as Ie,t as Le,tt as Re,u as ze,ut as Be,v as Ve,vt as I,w as He,x as Ue,y as We,z as L}from"./dist-Dc8tD1th.js";import{t as Ge}from"./dist-C_FzPxEX2.js";import{t as Ke}from"./util-doc-name-DRKmy6g9.js";import{r as qe}from"./_envelope-DuFpUEag-C9dastPz.js";import{E as Je,T as Ye,a as Xe,v as Ze}from"./schemas-api-a9pvDgLB.js";import{t as Qe}from"./note-window-mode-CI3Yju9B.js";import{i as $e}from"./use-apply-config-theme-CYFG76sS.js";import{t as et}from"./createLucideIcon-DdBzwsHe.js";import{t as tt}from"./folder-open-COGOeTzI.js";import{t as nt}from"./trash-2-Blf9Cydx.js";import{a as rt,c as it,i as at,n as ot,o as st,r as ct,s as lt}from"./structural-freshness-C6rR7cV3-VXiZX15w.js";import{f as ut,g as dt,l as ft,u as pt}from"./doc-hash-i74qqRXc.js";import{$ as mt,A as ht,B as gt,C as _t,E as vt,G as yt,I as bt,J as xt,K as St,M as Ct,N as wt,P as Tt,Q as Et,R as Dt,S as Ot,T as kt,W as At,X as jt,_ as Mt,at as Nt,b as Pt,c as Ft,d as It,f as Lt,g as Rt,h as zt,it as Bt,j as Vt,l as Ht,m as Ut,nt as Wt,ot as Gt,p as Kt,q as qt,rt as Jt,s as Yt,tt as Xt,u as Zt,w as Qt,x as $t,y as en,z as tn}from"./config-provider-CbxzkzQ_.js";import{n as nn,r as rn}from"./external-link-DxgIpECR.js";import{_ as an,b as on,d as sn,f as cn,g as ln,h as un,j as dn,k as fn,o as pn,p as mn,v as hn,w as gn,x as _n}from"./navigation-targets-Cu84E97-.js";import{t as vn}from"./doc-paths-C1iU3JM4.js";import{At as yn,Ct as bn,E as xn,F as Sn,G as Cn,I as R,J as wn,K as Tn,M as En,Mt as Dn,Nt as On,P as z,Tt as kn,X as An,a as B,c as jn,f as Mn,l as Nn,lt as Pn,o as Fn,r as In,t as Ln,ut as Rn}from"./dist-CoJBCixp.js";import{a as zn,d as Bn,f as Vn,g as Hn,h as V,i as Un,m as Wn,o as Gn,p as Kn,r as qn,t as Jn,u as Yn}from"./cm-theme-DpKmjLo0.js";import{A as Xn,C as Zn,E as Qn,H as $n,I as er,L as tr,M as nr,N as rr,O as ir,P as ar,R as H,S as or,T as sr,_ as cr,a as lr,b as ur,c as dr,h as fr,k as pr,m as mr,o as hr,t as gr,x as _r,y as vr,z as yr}from"./lib-CZXZ01YL.js";import{t as br}from"./ccount-s_UaBrax.js";import{n as xr,r as Sr}from"./lib-Csk2IQWH.js";import{c as Cr,f as wr,n as Tr,r as Er,t as Dr,u as Or}from"./trim-lines-CzojgEjk.js";import{u as kr}from"./space-separated-tokens-B2o5P1Kh.js";import{n as Ar,t as jr}from"./syntax-UjZu5532.js";import{i as Mr,n as Nr}from"./page-list-cache-duzt_bxz.js";import{t as Pr}from"./documents-fetch-ZX1mUge_.js";import{i as Fr,n as Ir,r as Lr,t as Rr}from"./dist-W5hM-kQ3.js";import{n as zr,r as Br,t as Vr}from"./dist-B1rPVlDX.js";import{t as Hr}from"./dist-BtC2yORW.js";import{n as Ur}from"./dist-OHM7P10P.js";import{n as Wr}from"./dist-ldcsP3Wx.js";import{n as Gr}from"./dist-CNHpRWc3.js";import{i as Kr,n as qr,r as Jr}from"./dist-OiK6QmuG.js";import{n as Yr}from"./dist-DLTuJxuQ2.js";import{t as Xr}from"./stex-CmWau-0j.js";var Zr=et(`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`}]]),Qr=et(`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`}]]),$r=et(`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`}]]),ei=et(`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`}]]),ti=et(`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`}]]),U=n(),W=e(r(),1),ni=e(o(),1),ri=s(),ii=c();function ai(e){return e.editorView}var oi=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function si(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 ci(e){let t=si(e);return t!==null&&oi.has(t)}function li(e){let t=si(e);return t===null?null:oi.get(t)??null}var ui=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function di(e){ui.lastIndex=0;let t=e.match(ui);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=li(e);if(t===null)return null;n+=t}return n}var G={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxActionAborted:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},jsxChromeDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function fi(){G.parseFallback.blockLevel++}function pi(){G.parseFallback.wholeDoc++}function mi(){G.parseFallback.wholeDocBudget++}function hi(e){G.jsxRenderFailure[e]=(G.jsxRenderFailure[e]??0)+1}function gi(e){G.jsxAutoConvertFailed[e]=(G.jsxAutoConvertFailed[e]??0)+1}function _i(e){G.jsxAutoConvertSucceeded[e]=(G.jsxAutoConvertSucceeded[e]??0)+1}function vi(e){G.jsxActionAborted[e]=(G.jsxActionAborted[e]??0)+1}function yi(e){G.jsxPropDropped[e]=(G.jsxPropDropped[e]??0)+1}function bi(e){G.jsxMoveFailed[e]=(G.jsxMoveFailed[e]??0)+1}function xi(e){G.jsxStuckCopyFailed[e]=(G.jsxStuckCopyFailed[e]??0)+1}function Si(e){G.jsxStuckDeleteFailed[e]=(G.jsxStuckDeleteFailed[e]??0)+1}function Ci(e){G.jsxPopoverCloseRestoreFailed[e]=(G.jsxPopoverCloseRestoreFailed[e]??0)+1}function wi(e){G.jsxKeyboardDeleteFailed[e]=(G.jsxKeyboardDeleteFailed[e]??0)+1}function Ti(e){G.jsxChromeDeleteFailed[e]=(G.jsxChromeDeleteFailed[e]??0)+1}function Ei(e){G.blockGripClickSelectFailed[e]=(G.blockGripClickSelectFailed[e]??0)+1}function Di(e){G.jsxArrowNodeSelectFailed[e]=(G.jsxArrowNodeSelectFailed[e]??0)+1}var Oi=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},ki=/[\uD800-\uDBFF]/,Ai=/[\uDC00-\uDFFF]/,ji=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&ki.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&&Ai.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},Mi=(e,t)=>e>>>t|e<<32-t,Ni=e=>Mi(e,2)^Mi(e,13)^Mi(e,22),Pi=e=>Mi(e,6)^Mi(e,11)^Mi(e,25),Fi=e=>Mi(e,7)^Mi(e,18)^e>>>3,Ii=e=>Mi(e,17)^Mi(e,19)^e>>>10,Li=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]),Ri=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),zi=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(Ri),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=Ii(t[e-2])+t[e-7]+Fi(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+Pi(o)+(o&s^~o&c)+Li[e]+t[e]>>>0,d=Ni(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/Bt,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}},Bi=e=>new zi().digest(e),K=new k(`y-sync`),Vi=new k(`y-undo`),Hi=new k(`yjs-cursor`),Ui=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},Wi=e=>yt(Ui(Bi(At(e)))),Gi=()=>({mapping:new Map,isOMark:new Map}),Ki=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!Ct(t.ds,e.id),qi=[{light:`#ecd44433`,dark:`#ecd444`}],Ji=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=Jt();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,jt(t))}return e.get(n)},Yi=(e,{colors:t=qi,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new $i(e,a),c=new M({props:{editable:e=>{let t=K.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:K,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(K);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)&&tn(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=Vi.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)},K)})}},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 ke(e.doc));else if(t.type===`node`){let r=ja(n.doc,n.type,t.anchor,n.mapping);e.setSelection(Zi(e,r))}else{let r=ja(n.doc,n.type,t.anchor,n.mapping),i=ja(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(j.between(e.doc.resolve(r),e.doc.resolve(i)))}},Zi=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?Pe.create(e.doc,t):j.near(n)},Qi=(e,t)=>({type:t.selection.jsonID,anchor:ka(t.selection.anchor,e.type,e.mapping),head:ka(t.selection.head,e.type,e.mapping)}),$i=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=Oi(),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=Qi(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()?(St&&this._domSelectionInView===null&&(tn(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=gt.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||=vt(Ot(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(K,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>ta(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(e),0,0));t.setMeta(K,{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=>ta(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(t),0,0));if(e){let t=Gt(Nt(e.anchor,0),n.doc.content.size),r=Gt(Nt(e.head,0),n.doc.content.size);n.setSelection(j.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(K,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=bt(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&Wt(),r=new Zt({gc:!1}),en(r,t),t=bt(r),en(r,e),e=bt(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[ht(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{Tt(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:Ji(n.colorMapping,n.colors,r)}},s=Dt(i,new Kt(t.ds,e.sv)).map(n=>!n._item.deleted||Ki(n._item,e)||Ki(n._item,t)?ta(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 A(I.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(K,{isChangeOrigin:!0}))},K)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=K.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);Tt(t,t.deleteSet,e=>{if(e.constructor===It){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=>ea(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(n),0,0));Xi(r,this.beforeTransactionSelection,this),r=r.setMeta(K,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof Ut}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{Sa(this.doc,this.type,e,this),this.beforeTransactionSelection=Qi(this,this.prosemirrorView.state)},K)}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))}},ea=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof Rt)return ta(e,t,n,r,i,a);throw Xt()}return o},ta=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof Rt){let s=ea(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof zt&&!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=na(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):Dt(e,new Kt(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(Ki(e._item,r)?Ki(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=da(s),l=ba(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}},na=(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,ba(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},ra=(e,t)=>{let n=new Mt,r=e.map(e=>({insert:e.text,attributes:xa(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},ia=(e,t)=>{let n=new Rt(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}let r=xa(e.marks||[],t);for(let e in r)n.setAttribute(ua+e,{...r[e]});return n.insert(0,ca(e).map(e=>aa(e,t))),t.mapping.set(n,e),n},aa=(e,t)=>e instanceof Array?ra(e,t):ia(e,t),oa=e=>typeof e==`object`&&!!e,sa=(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||oa(o)&&oa(s)&&sa(o,s)}return r},ca=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},la=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&xt(e.attributes||{}).length===t[n].marks.length&&qt(e.attributes,(e,r)=>{let i=ya(r),a=t[n].marks;return a.find(e=>e.type.name===i)?sa(e,a.find(e=>e.type.name===i)?.attrs):!1}))},ua=`ymark:`,da=e=>{let t={},n={};for(let r in e)r.startsWith(ua)?n[r.slice(6)]=e[r]:t[r]=e[r];return{plain:t,marks:n}},fa=(e,t)=>{let n=Object.keys(e);return n.length===t.length?n.every(n=>{let r=ya(n),i=t.find(e=>e.type.name===r);return i?sa(e[n],i.attrs):!1}):!1},pa=(e,t)=>{if(e instanceof Rt&&!(t instanceof Array)&&Ca(e,t)){let n=ca(t),r=da(e.getAttributes());return e._length===n.length&&fa(r.marks,t.marks)&&sa(r.plain,t.attrs)&&e.toArray().every((e,t)=>pa(e,n[t]))}return e instanceof Mt&&t instanceof Array&&la(e,t)},ma=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),ha=(e,t,n)=>{let r=e.toArray(),i=ca(t),a=i.length,o=r.length,s=Gt(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(ma(n.mapping.get(e),t))u=!0;else if(!pa(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(ma(n.mapping.get(e),t))u=!0;else if(!pa(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},ga=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof Ft?t+=n.content.str:n.content instanceof Yt&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},_a=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=ga(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,xa(e.marks,n))})),{insert:o,remove:s,index:c}=ji(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})))},va=/(.*)(--[a-zA-Z0-9+/=]{8})$/,ya=e=>va.exec(e)?.[1]??e,ba=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(ya(r),e[r]));return n},xa=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=mt(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${Wi(e.toJSON())}`:e.type.name]=e.attrs}}),n},Sa=(e,t,n,r)=>{if(t instanceof Rt&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof Rt){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(ua)&&t.removeAttribute(n);let a=xa(n.marks||[],r);for(let n in a){let r=e[ua+n];(r===void 0||!sa(r,a[n]))&&t.setAttribute(ua+n,{...a[n]})}for(let n in e)n.startsWith(ua)&&a[n.slice(6)]===void 0&&t.removeAttribute(n)}let i=ca(n),a=i.length,o=t.toArray(),s=o.length,c=Gt(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!ma(r.mapping.get(e),t))if(pa(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(!ma(r.mapping.get(e),t))if(pa(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 Mt&&c instanceof Array)la(n,c)||_a(n,c,r),l+=1;else{let i=n instanceof Rt&&Ca(n,c),a=d instanceof Rt&&Ca(d,f);if(i&&a){let e=ha(n,c,r),t=ha(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(Sa(e,n,c,r),l+=1):a?(Sa(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[aa(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof Mt?(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(aa(i[t],r));t.insert(l,e)}},K)},Ca=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,wa=null,Ta=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=K.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)}}},Ea=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=wa;wa=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new Ta(t,r,e))})}),new e(n)}},Da=(e=Ea.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()||tn(0,()=>Da(e,!0));return}throw r}n=!1,e.dequeueFirst()}},Oa=(e,t,n)=>{wa||(wa=new Map,tn(0,Da)),mt(wa,e,Et).set(t,n)},ka=(e,t,n)=>{if(e===0)return kt(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof Mt){if(r._length>=e)return kt(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 Lt(r._item===null?null:r._item.id,r._item===null?Vt(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 Lt(r._item===null?null:r._item.id,r._item===null?Vt(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 Wt();if(e===0&&r.constructor!==Mt&&r!==t)return Aa(r._item.parent,r._item)}return kt(t,t._length,-1)},Aa=(e,t)=>{let n=null,r=null;return e._item===null?r=Vt(e):n=_t(e._item.id.client,e._item.id.clock),new Lt(n,r,t.id)},ja=(e,t,n,r)=>{let i=$t(n,e);if(i===null||i.type!==t&&!wt(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===Mt)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 Mt)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 Mt)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},Ma=(e,t)=>{let n=e.toArray().map(e=>ta(e,t,Gi())).filter(e=>e!==null);return I.fromArray(n)},Na=(e,t)=>t.topNodeType.create(null,Ma(e,t)),Pa=(e,t)=>{let n=Gi(),r=e.toArray().map(e=>ta(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,I.fromArray(r)),meta:n,mapping:n.mapping}},Fa=(e,t,n)=>e!==t,Ia=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},La=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),Ra=/^#[0-9a-fA-F]{6}$/,za=(e,t,n,r,i)=>{let a=K.getState(e);if(a==null||a.doc==null||a.binding==null)return me.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?me.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`:Ra.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=ja(o,a.type,Qt(t.cursor.anchor),a.binding.mapping),u=ja(o,a.type,Qt(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=Nt(e.doc.content.size-1,0);l=Gt(l,t),u=Gt(u,t),s.push(he.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=Gt(l,u),o=Nt(l,u);s.push(he.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),me.create(e.doc,s))},Ba=(e,{awarenessStateFilter:t=Fa,cursorBuilder:n=Ia,selectionBuilder:r=La,getSelection:i=e=>e.selection}={},a=`cursor`)=>new M({key:Hi,state:{init(i,a){return za(a,e,t,n,r)},apply(i,a,o,s){let c=K.getState(s),l=i.getMeta(Hi);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?za(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>Hi.getState(e)},view:t=>{let n=()=>{t.docView&&Oa(t,Hi,{awarenessUpdated:!0})},r=()=>{let n=K.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=ka(o.anchor,n.type,n.binding.mapping),c=ka(o.head,n.type,n.binding.mapping);(r.cursor==null||!Pt(Qt(r.cursor.anchor),s)||!Pt(Qt(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&ja(n.doc,n.type,Qt(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)}}}}),Va=e=>{let t=Vi.getState(e).undoManager;if(t!=null)return t.undo(),!0},Ha=e=>{let t=Vi.getState(e).undoManager;if(t!=null)return t.redo(),!0},Ua=new Set([`paragraph`]),Wa=(e,t)=>!(e instanceof It)||!(e.content instanceof Ht)||!(e.content.type instanceof zt||e.content.type instanceof Rt&&t.has(e.content.type.nodeName))||e.content.type._length===0,Ga=({protectedNodes:e=Ua,trackedOrigins:t=[],undoManager:n=null}={})=>new M({key:Vi,state:{init:(r,i)=>{let a=K.getState(i),o=n||new Ut(a.type,{trackedOrigins:new Set([K].concat(t)),deleteFilter:t=>Wa(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=K.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:Qi(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=K.getState(e.state),n=Vi.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,Vi.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()}}}}),Ka=new Map,qa=new Set;function Ja(){for(let e of qa)e()}function Ya(e,t,n){Ka.set(e,{view:t,host:n}),Ja()}function Xa(e,t){Ka.get(e)?.view===t&&(Ka.delete(e),Ja())}function Za(e){let t=Ka.get(e);return t?.host===`sourceEditor`?t.view:null}function Qa(e){return Ka.get(e)??null}function $a(e){return qa.add(e),()=>{qa.delete(e)}}var eo=new WeakMap,to=new WeakMap;function no(e,t){eo.set(e,t)}function ro(e){return eo.get(e)??!1}function io(e,t){to.set(e,t)}function ao(e){return to.get(e)??!1}function oo(e){return!ro(e)}var so=`autonomousFragmentEdit/swap`;function co(e){return e.setMeta(so,!0)}function lo(e,t,n){return n===t.textContent?co(e):e}function uo(e){return e.getMeta(so)===!0}function fo(e){return!e.getMeta(K)&&!uo(e)}var po=/^[A-Za-z0-9]{20,}$/,mo=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function ho(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function go(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return po.test(n)?n:null}function _o(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:`||!ho(t.hostname))return null;let n=go(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&mo.test(r)?r:null}}function vo(e){return _o(e)!==null}function yo(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function bo(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:yo(t.hostname)}var xo=/^[A-Za-z0-9_-]{11}$/;function So(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 Co(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 wo(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return xo.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return xo.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function To(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:`||!So(t.hostname))return null;let n=wo(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?Co(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}function Eo(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`&&Do(e.value.value,t))continue}let o=Oo(e,t);r>=0?n[r]=o:n.push(o)}return n}function Do(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function Oo(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 ko(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:Eo(t,r),children:n.all(t),data:{}}}function Ao(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:Eo(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}var jo=[{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`}],Mo=[{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}],No=[{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}],Po=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:b,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`&&(bo(e.src)||vo(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`&&(bo(e.src)||vo(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`&&vo(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`&&(bo(e.src)||vo(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`&&(To(e.src)!==null||bo(e.src)||vo(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],Fo=[{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`}],Io=[{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`}],Lo=[jo[0],jo[1],jo[4],jo[5],jo[6]],Ro=[Mo[0],Mo[1],Mo[7]],zo=[Io[0],Io[1],Io[4],Io[5]],Bo=[{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.`}],Vo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],Ho=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],Uo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],Wo=[{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`)"}],Ko=[{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."}],qo=[Ko[0]],Jo=[Ko[0]],Yo=[{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]]`)"}],Zo=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],Qo=[{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`)"}],$o=[{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`}],es=[{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."}],ts=[{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 ns(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function rs(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function is(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 as=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:jo,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)=>ko(`Callout`,e,t,jo)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Mo,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)=>ko(`img`,e,t,Mo)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Po,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)=>ko(`video`,e,t,Po)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Fo,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)=>ko(`audio`,e,t,Fo)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Qo,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)=>ko(`Pdf`,e,t,Qo)},{name:`Excalidraw`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:$o,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)=>ko(`Excalidraw`,e,t,$o)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Zo,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)=>ko(`File`,e,t,Zo)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:No,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)=>ko(`Embed`,e,t,No)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:Io,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)=>ko(`Accordion`,e,t,Io)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:Io,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)=>ko(`Toggle`,e,t,Io)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:Wo,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,f,i as p,l as m,r as h}from"./floating-ui.dom-BYl7JZd0.js";import{_ as g,a as _,d as v,f as y,i as b,n as x,o as S,r as C,t as w,u as T}from"./constants-upload-DZP-sCdl.js";import{$ as ee,A as E,B as te,C as ne,F as re,G as ie,K as D,L as O,N as ae,P as oe,Q as se,R as ce,S as le,T as ue,U as de,V as fe,W as pe,X as me,Y as he,_ as ge,a as _e,at as k,b as ve,bt as A,c as ye,ct as j,d as be,et as xe,f as Se,g as Ce,gt as we,h as Te,ht as Ee,it as M,k as N,l as De,mt as Oe,n as P,nt as ke,o as F,ot as Ae,p as je,q as Me,r as Ne,rt as Pe,s as Fe,st as Ie,t as Le,tt as Re,u as ze,ut as Be,v as Ve,vt as I,w as He,x as Ue,y as We,z as L}from"./dist-Dc8tD1th.js";import{t as Ge}from"./dist-C_FzPxEX2.js";import{t as Ke}from"./util-doc-name-DRKmy6g9.js";import{r as qe}from"./_envelope-DuFpUEag-C9dastPz.js";import{E as Je,T as Ye,a as Xe,v as Ze}from"./schemas-api-a9pvDgLB.js";import{t as Qe}from"./note-window-mode-CI3Yju9B.js";import{i as $e}from"./use-apply-config-theme-CYFG76sS.js";import{t as et}from"./createLucideIcon-DdBzwsHe.js";import{t as tt}from"./folder-open-COGOeTzI.js";import{t as nt}from"./trash-2-Blf9Cydx.js";import{a as rt,c as it,i as at,n as ot,o as st,r as ct,s as lt}from"./structural-freshness-C6rR7cV3-VXiZX15w.js";import{f as ut,g as dt,l as ft,u as pt}from"./doc-hash-i74qqRXc.js";import{$ as mt,A as ht,B as gt,C as _t,E as vt,G as yt,I as bt,J as xt,K as St,M as Ct,N as wt,P as Tt,Q as Et,R as Dt,S as Ot,T as kt,W as At,X as jt,_ as Mt,at as Nt,b as Pt,c as Ft,d as It,f as Lt,g as Rt,h as zt,it as Bt,j as Vt,l as Ht,m as Ut,nt as Wt,ot as Gt,p as Kt,q as qt,rt as Jt,s as Yt,tt as Xt,u as Zt,w as Qt,x as $t,y as en,z as tn}from"./config-provider-B2uReVA0.js";import{n as nn,r as rn}from"./external-link-DxgIpECR.js";import{_ as an,b as on,d as sn,f as cn,g as ln,h as un,j as dn,k as fn,o as pn,p as mn,v as hn,w as gn,x as _n}from"./navigation-targets-Cu84E97-.js";import{t as vn}from"./doc-paths-C1iU3JM4.js";import{At as yn,Ct as bn,E as xn,F as Sn,G as Cn,I as R,J as wn,K as Tn,M as En,Mt as Dn,Nt as On,P as z,Tt as kn,X as An,a as B,c as jn,f as Mn,l as Nn,lt as Pn,o as Fn,r as In,t as Ln,ut as Rn}from"./dist-CoJBCixp.js";import{a as zn,d as Bn,f as Vn,g as Hn,h as V,i as Un,m as Wn,o as Gn,p as Kn,r as qn,t as Jn,u as Yn}from"./cm-theme-DpKmjLo0.js";import{A as Xn,C as Zn,E as Qn,H as $n,I as er,L as tr,M as nr,N as rr,O as ir,P as ar,R as H,S as or,T as sr,_ as cr,a as lr,b as ur,c as dr,h as fr,k as pr,m as mr,o as hr,t as gr,x as _r,y as vr,z as yr}from"./lib-CZXZ01YL.js";import{t as br}from"./ccount-s_UaBrax.js";import{n as xr,r as Sr}from"./lib-Csk2IQWH.js";import{c as Cr,f as wr,n as Tr,r as Er,t as Dr,u as Or}from"./trim-lines-CzojgEjk.js";import{u as kr}from"./space-separated-tokens-B2o5P1Kh.js";import{n as Ar,t as jr}from"./syntax-UjZu5532.js";import{i as Mr,n as Nr}from"./page-list-cache-duzt_bxz.js";import{t as Pr}from"./documents-fetch-ZX1mUge_.js";import{i as Fr,n as Ir,r as Lr,t as Rr}from"./dist-W5hM-kQ3.js";import{n as zr,r as Br,t as Vr}from"./dist-B1rPVlDX.js";import{t as Hr}from"./dist-BtC2yORW.js";import{n as Ur}from"./dist-OHM7P10P.js";import{n as Wr}from"./dist-ldcsP3Wx.js";import{n as Gr}from"./dist-CNHpRWc3.js";import{i as Kr,n as qr,r as Jr}from"./dist-OiK6QmuG.js";import{n as Yr}from"./dist-DLTuJxuQ2.js";import{t as Xr}from"./stex-CmWau-0j.js";var Zr=et(`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`}]]),Qr=et(`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`}]]),$r=et(`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`}]]),ei=et(`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`}]]),ti=et(`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`}]]),U=n(),W=e(r(),1),ni=e(o(),1),ri=s(),ii=c();function ai(e){return e.editorView}var oi=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function si(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 ci(e){let t=si(e);return t!==null&&oi.has(t)}function li(e){let t=si(e);return t===null?null:oi.get(t)??null}var ui=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function di(e){ui.lastIndex=0;let t=e.match(ui);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=li(e);if(t===null)return null;n+=t}return n}var G={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxActionAborted:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},jsxChromeDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function fi(){G.parseFallback.blockLevel++}function pi(){G.parseFallback.wholeDoc++}function mi(){G.parseFallback.wholeDocBudget++}function hi(e){G.jsxRenderFailure[e]=(G.jsxRenderFailure[e]??0)+1}function gi(e){G.jsxAutoConvertFailed[e]=(G.jsxAutoConvertFailed[e]??0)+1}function _i(e){G.jsxAutoConvertSucceeded[e]=(G.jsxAutoConvertSucceeded[e]??0)+1}function vi(e){G.jsxActionAborted[e]=(G.jsxActionAborted[e]??0)+1}function yi(e){G.jsxPropDropped[e]=(G.jsxPropDropped[e]??0)+1}function bi(e){G.jsxMoveFailed[e]=(G.jsxMoveFailed[e]??0)+1}function xi(e){G.jsxStuckCopyFailed[e]=(G.jsxStuckCopyFailed[e]??0)+1}function Si(e){G.jsxStuckDeleteFailed[e]=(G.jsxStuckDeleteFailed[e]??0)+1}function Ci(e){G.jsxPopoverCloseRestoreFailed[e]=(G.jsxPopoverCloseRestoreFailed[e]??0)+1}function wi(e){G.jsxKeyboardDeleteFailed[e]=(G.jsxKeyboardDeleteFailed[e]??0)+1}function Ti(e){G.jsxChromeDeleteFailed[e]=(G.jsxChromeDeleteFailed[e]??0)+1}function Ei(e){G.blockGripClickSelectFailed[e]=(G.blockGripClickSelectFailed[e]??0)+1}function Di(e){G.jsxArrowNodeSelectFailed[e]=(G.jsxArrowNodeSelectFailed[e]??0)+1}var Oi=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},ki=/[\uD800-\uDBFF]/,Ai=/[\uDC00-\uDFFF]/,ji=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&ki.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&&Ai.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},Mi=(e,t)=>e>>>t|e<<32-t,Ni=e=>Mi(e,2)^Mi(e,13)^Mi(e,22),Pi=e=>Mi(e,6)^Mi(e,11)^Mi(e,25),Fi=e=>Mi(e,7)^Mi(e,18)^e>>>3,Ii=e=>Mi(e,17)^Mi(e,19)^e>>>10,Li=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]),Ri=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),zi=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(Ri),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=Ii(t[e-2])+t[e-7]+Fi(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+Pi(o)+(o&s^~o&c)+Li[e]+t[e]>>>0,d=Ni(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/Bt,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}},Bi=e=>new zi().digest(e),K=new k(`y-sync`),Vi=new k(`y-undo`),Hi=new k(`yjs-cursor`),Ui=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},Wi=e=>yt(Ui(Bi(At(e)))),Gi=()=>({mapping:new Map,isOMark:new Map}),Ki=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!Ct(t.ds,e.id),qi=[{light:`#ecd44433`,dark:`#ecd444`}],Ji=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=Jt();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,jt(t))}return e.get(n)},Yi=(e,{colors:t=qi,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new $i(e,a),c=new M({props:{editable:e=>{let t=K.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:K,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(K);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)&&tn(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=Vi.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)},K)})}},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 ke(e.doc));else if(t.type===`node`){let r=ja(n.doc,n.type,t.anchor,n.mapping);e.setSelection(Zi(e,r))}else{let r=ja(n.doc,n.type,t.anchor,n.mapping),i=ja(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(j.between(e.doc.resolve(r),e.doc.resolve(i)))}},Zi=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?Pe.create(e.doc,t):j.near(n)},Qi=(e,t)=>({type:t.selection.jsonID,anchor:ka(t.selection.anchor,e.type,e.mapping),head:ka(t.selection.head,e.type,e.mapping)}),$i=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=Oi(),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=Qi(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()?(St&&this._domSelectionInView===null&&(tn(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=gt.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||=vt(Ot(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(K,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>ta(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(e),0,0));t.setMeta(K,{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=>ta(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(t),0,0));if(e){let t=Gt(Nt(e.anchor,0),n.doc.content.size),r=Gt(Nt(e.head,0),n.doc.content.size);n.setSelection(j.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(K,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=bt(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&Wt(),r=new Zt({gc:!1}),en(r,t),t=bt(r),en(r,e),e=bt(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[ht(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{Tt(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:Ji(n.colorMapping,n.colors,r)}},s=Dt(i,new Kt(t.ds,e.sv)).map(n=>!n._item.deleted||Ki(n._item,e)||Ki(n._item,t)?ta(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 A(I.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(K,{isChangeOrigin:!0}))},K)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=K.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);Tt(t,t.deleteSet,e=>{if(e.constructor===It){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=>ea(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(n),0,0));Xi(r,this.beforeTransactionSelection,this),r=r.setMeta(K,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof Ut}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{Sa(this.doc,this.type,e,this),this.beforeTransactionSelection=Qi(this,this.prosemirrorView.state)},K)}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))}},ea=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof Rt)return ta(e,t,n,r,i,a);throw Xt()}return o},ta=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof Rt){let s=ea(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof zt&&!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=na(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):Dt(e,new Kt(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(Ki(e._item,r)?Ki(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=da(s),l=ba(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}},na=(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,ba(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},ra=(e,t)=>{let n=new Mt,r=e.map(e=>({insert:e.text,attributes:xa(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},ia=(e,t)=>{let n=new Rt(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}let r=xa(e.marks||[],t);for(let e in r)n.setAttribute(ua+e,{...r[e]});return n.insert(0,ca(e).map(e=>aa(e,t))),t.mapping.set(n,e),n},aa=(e,t)=>e instanceof Array?ra(e,t):ia(e,t),oa=e=>typeof e==`object`&&!!e,sa=(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||oa(o)&&oa(s)&&sa(o,s)}return r},ca=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},la=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&xt(e.attributes||{}).length===t[n].marks.length&&qt(e.attributes,(e,r)=>{let i=ya(r),a=t[n].marks;return a.find(e=>e.type.name===i)?sa(e,a.find(e=>e.type.name===i)?.attrs):!1}))},ua=`ymark:`,da=e=>{let t={},n={};for(let r in e)r.startsWith(ua)?n[r.slice(6)]=e[r]:t[r]=e[r];return{plain:t,marks:n}},fa=(e,t)=>{let n=Object.keys(e);return n.length===t.length?n.every(n=>{let r=ya(n),i=t.find(e=>e.type.name===r);return i?sa(e[n],i.attrs):!1}):!1},pa=(e,t)=>{if(e instanceof Rt&&!(t instanceof Array)&&Ca(e,t)){let n=ca(t),r=da(e.getAttributes());return e._length===n.length&&fa(r.marks,t.marks)&&sa(r.plain,t.attrs)&&e.toArray().every((e,t)=>pa(e,n[t]))}return e instanceof Mt&&t instanceof Array&&la(e,t)},ma=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),ha=(e,t,n)=>{let r=e.toArray(),i=ca(t),a=i.length,o=r.length,s=Gt(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(ma(n.mapping.get(e),t))u=!0;else if(!pa(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(ma(n.mapping.get(e),t))u=!0;else if(!pa(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},ga=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof Ft?t+=n.content.str:n.content instanceof Yt&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},_a=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=ga(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,xa(e.marks,n))})),{insert:o,remove:s,index:c}=ji(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})))},va=/(.*)(--[a-zA-Z0-9+/=]{8})$/,ya=e=>va.exec(e)?.[1]??e,ba=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(ya(r),e[r]));return n},xa=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=mt(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${Wi(e.toJSON())}`:e.type.name]=e.attrs}}),n},Sa=(e,t,n,r)=>{if(t instanceof Rt&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof Rt){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(ua)&&t.removeAttribute(n);let a=xa(n.marks||[],r);for(let n in a){let r=e[ua+n];(r===void 0||!sa(r,a[n]))&&t.setAttribute(ua+n,{...a[n]})}for(let n in e)n.startsWith(ua)&&a[n.slice(6)]===void 0&&t.removeAttribute(n)}let i=ca(n),a=i.length,o=t.toArray(),s=o.length,c=Gt(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!ma(r.mapping.get(e),t))if(pa(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(!ma(r.mapping.get(e),t))if(pa(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 Mt&&c instanceof Array)la(n,c)||_a(n,c,r),l+=1;else{let i=n instanceof Rt&&Ca(n,c),a=d instanceof Rt&&Ca(d,f);if(i&&a){let e=ha(n,c,r),t=ha(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(Sa(e,n,c,r),l+=1):a?(Sa(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[aa(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof Mt?(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(aa(i[t],r));t.insert(l,e)}},K)},Ca=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,wa=null,Ta=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=K.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)}}},Ea=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=wa;wa=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new Ta(t,r,e))})}),new e(n)}},Da=(e=Ea.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()||tn(0,()=>Da(e,!0));return}throw r}n=!1,e.dequeueFirst()}},Oa=(e,t,n)=>{wa||(wa=new Map,tn(0,Da)),mt(wa,e,Et).set(t,n)},ka=(e,t,n)=>{if(e===0)return kt(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof Mt){if(r._length>=e)return kt(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 Lt(r._item===null?null:r._item.id,r._item===null?Vt(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 Lt(r._item===null?null:r._item.id,r._item===null?Vt(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 Wt();if(e===0&&r.constructor!==Mt&&r!==t)return Aa(r._item.parent,r._item)}return kt(t,t._length,-1)},Aa=(e,t)=>{let n=null,r=null;return e._item===null?r=Vt(e):n=_t(e._item.id.client,e._item.id.clock),new Lt(n,r,t.id)},ja=(e,t,n,r)=>{let i=$t(n,e);if(i===null||i.type!==t&&!wt(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===Mt)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 Mt)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 Mt)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},Ma=(e,t)=>{let n=e.toArray().map(e=>ta(e,t,Gi())).filter(e=>e!==null);return I.fromArray(n)},Na=(e,t)=>t.topNodeType.create(null,Ma(e,t)),Pa=(e,t)=>{let n=Gi(),r=e.toArray().map(e=>ta(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,I.fromArray(r)),meta:n,mapping:n.mapping}},Fa=(e,t,n)=>e!==t,Ia=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},La=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),Ra=/^#[0-9a-fA-F]{6}$/,za=(e,t,n,r,i)=>{let a=K.getState(e);if(a==null||a.doc==null||a.binding==null)return me.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?me.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`:Ra.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=ja(o,a.type,Qt(t.cursor.anchor),a.binding.mapping),u=ja(o,a.type,Qt(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=Nt(e.doc.content.size-1,0);l=Gt(l,t),u=Gt(u,t),s.push(he.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=Gt(l,u),o=Nt(l,u);s.push(he.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),me.create(e.doc,s))},Ba=(e,{awarenessStateFilter:t=Fa,cursorBuilder:n=Ia,selectionBuilder:r=La,getSelection:i=e=>e.selection}={},a=`cursor`)=>new M({key:Hi,state:{init(i,a){return za(a,e,t,n,r)},apply(i,a,o,s){let c=K.getState(s),l=i.getMeta(Hi);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?za(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>Hi.getState(e)},view:t=>{let n=()=>{t.docView&&Oa(t,Hi,{awarenessUpdated:!0})},r=()=>{let n=K.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=ka(o.anchor,n.type,n.binding.mapping),c=ka(o.head,n.type,n.binding.mapping);(r.cursor==null||!Pt(Qt(r.cursor.anchor),s)||!Pt(Qt(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&ja(n.doc,n.type,Qt(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)}}}}),Va=e=>{let t=Vi.getState(e).undoManager;if(t!=null)return t.undo(),!0},Ha=e=>{let t=Vi.getState(e).undoManager;if(t!=null)return t.redo(),!0},Ua=new Set([`paragraph`]),Wa=(e,t)=>!(e instanceof It)||!(e.content instanceof Ht)||!(e.content.type instanceof zt||e.content.type instanceof Rt&&t.has(e.content.type.nodeName))||e.content.type._length===0,Ga=({protectedNodes:e=Ua,trackedOrigins:t=[],undoManager:n=null}={})=>new M({key:Vi,state:{init:(r,i)=>{let a=K.getState(i),o=n||new Ut(a.type,{trackedOrigins:new Set([K].concat(t)),deleteFilter:t=>Wa(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=K.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:Qi(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=K.getState(e.state),n=Vi.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,Vi.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()}}}}),Ka=new Map,qa=new Set;function Ja(){for(let e of qa)e()}function Ya(e,t,n){Ka.set(e,{view:t,host:n}),Ja()}function Xa(e,t){Ka.get(e)?.view===t&&(Ka.delete(e),Ja())}function Za(e){let t=Ka.get(e);return t?.host===`sourceEditor`?t.view:null}function Qa(e){return Ka.get(e)??null}function $a(e){return qa.add(e),()=>{qa.delete(e)}}var eo=new WeakMap,to=new WeakMap;function no(e,t){eo.set(e,t)}function ro(e){return eo.get(e)??!1}function io(e,t){to.set(e,t)}function ao(e){return to.get(e)??!1}function oo(e){return!ro(e)}var so=`autonomousFragmentEdit/swap`;function co(e){return e.setMeta(so,!0)}function lo(e,t,n){return n===t.textContent?co(e):e}function uo(e){return e.getMeta(so)===!0}function fo(e){return!e.getMeta(K)&&!uo(e)}var po=/^[A-Za-z0-9]{20,}$/,mo=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function ho(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function go(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return po.test(n)?n:null}function _o(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:`||!ho(t.hostname))return null;let n=go(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&mo.test(r)?r:null}}function vo(e){return _o(e)!==null}function yo(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function bo(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:yo(t.hostname)}var xo=/^[A-Za-z0-9_-]{11}$/;function So(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 Co(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 wo(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return xo.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return xo.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function To(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:`||!So(t.hostname))return null;let n=wo(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?Co(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}function Eo(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`&&Do(e.value.value,t))continue}let o=Oo(e,t);r>=0?n[r]=o:n.push(o)}return n}function Do(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function Oo(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 ko(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:Eo(t,r),children:n.all(t),data:{}}}function Ao(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:Eo(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}var jo=[{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`}],Mo=[{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}],No=[{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}],Po=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:b,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`&&(bo(e.src)||vo(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`&&(bo(e.src)||vo(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`&&vo(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`&&(bo(e.src)||vo(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`&&(To(e.src)!==null||bo(e.src)||vo(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],Fo=[{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`}],Io=[{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`}],Lo=[jo[0],jo[1],jo[4],jo[5],jo[6]],Ro=[Mo[0],Mo[1],Mo[7]],zo=[Io[0],Io[1],Io[4],Io[5]],Bo=[{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.`}],Vo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],Ho=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],Uo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],Wo=[{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`)"}],Ko=[{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."}],qo=[Ko[0]],Jo=[Ko[0]],Yo=[{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]]`)"}],Zo=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],Qo=[{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`)"}],$o=[{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`}],es=[{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."}],ts=[{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 ns(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function rs(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function is(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 as=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:jo,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)=>ko(`Callout`,e,t,jo)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Mo,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)=>ko(`img`,e,t,Mo)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Po,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)=>ko(`video`,e,t,Po)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Fo,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)=>ko(`audio`,e,t,Fo)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Qo,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)=>ko(`Pdf`,e,t,Qo)},{name:`Excalidraw`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:$o,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)=>ko(`Excalidraw`,e,t,$o)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Zo,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)=>ko(`File`,e,t,Zo)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:No,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)=>ko(`Embed`,e,t,No)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:Io,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)=>ko(`Accordion`,e,t,Io)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:Io,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)=>ko(`Toggle`,e,t,Io)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:Wo,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)=>ko(`Tabs`,e,t,Wo)},{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)=>ko(`Tab`,e,t,Go)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Ko,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)=>ko(`Math`,e,t,Ko)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Yo,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:es,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)=>ko(`Mirror`,e,t,es)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:ts,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)=>ko(`MirrorSource`,e,t,ts)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:Lo,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:Ro,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:st(t?.src??``,t?.sourceUrl),alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:Vo,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:is},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:Ho,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:is},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:Uo,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:is},{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:is},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:zo,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="${ns(n.name)}"`:``,a=n?.id?` id="${ns(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${rs(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:Bo,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"${ns(i)}"`):`${a} align="${ns(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:qo,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:Jo,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??``})}],os={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>ko(e.attrs.componentName||`*`,e,t)};function ss(){let e=new Map;e.set(`*`,os);for(let t of as)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 cs=_e.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 ls(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||us(n)===r?!0:di(e)===t}function us(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}function ds(e,t){let{target:n,anchor:r,alias:i}=e;if(!t.separatorCrossed)return e;if(r!==null){let e=hs(r);return{target:n,anchor:e.length>0?e:null,alias:i===null?null:gs(i)}}return{target:hs(n),anchor:null,alias:i===null?null:gs(i)}}function fs(e,t,n){let r=e.trim();return r===t?!0:n===`alias`?gs(r)===t:hs(r)===t}function ps(e,t,n){return typeof e==`string`&&fs(e,t,n)?e:t}function ms(e){return hs(e.trim())===``}function hs(e){return e.endsWith(`\\`)?e.slice(0,-1):e}function gs(e){return e.replace(/\\\|/g,`|`)}function _s(e){let t=``,n=0;for(let r of e)r===`\\`?n++:(r===`|`&&n%2==0&&(t+=`\\`),n=0),t+=r;return t}function vs(e){return e.replace(/\|/g,`\\|`)}function ys(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function bs(e){return e.includes("`")?`~`:"`"}function xs(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 Ss=new Set([`break`,`delete`,`emphasis`,`footnoteReference`,`html`,`image`,`imageReference`,`inlineCode`,`link`,`linkReference`,`strong`,`text`]);function Cs(e){let t=e.children;Array.isArray(t)&&t.forEach((e,n)=>{if(e.type===`break`){t[n]={type:`html`,value:`<br />`};return}Cs(e)})}function ws(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=vs(e.value))),ws(e)}function Ts(e){H(e,`tableCell`,e=>{e.children.some(e=>!Ss.has(e.type))&&(e.children=Es(e.children)),Cs(e),ws(e)})}function Es(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-Bx_fIuqY.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-CHiUH8-1.js";import{i as p}from"./use-apply-config-theme-CYFG76sS.js";import"./config-provider-CbxzkzQ_.js";import"./saved-themes-client-CERsocAi.js";import"./markdown-lint-Gr2dt_mE.js";import{t as m}from"./SettingsSectionHeader-2iTSJQHd.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-Bx_fIuqY.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-CHiUH8-1.js";import{i as p}from"./use-apply-config-theme-CYFG76sS.js";import"./config-provider-B2uReVA0.js";import"./saved-themes-client-CERsocAi.js";import"./markdown-lint-Gr2dt_mE.js";import{t as m}from"./SettingsSectionHeader-2iTSJQHd.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};