@inkeep/open-knowledge 0.87.0-beta.2 → 0.87.0-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.
- package/dist/cli.mjs +6 -6
- package/dist/constants-D5N3ATV7.mjs +1 -0
- package/dist/{dist-0gI1oLbO.mjs → dist-Nf304EbD.mjs} +1 -1
- package/dist/{dist-_mI3Jjf-.mjs → dist-WUkQ-0NU.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-DIAKdBV0.mjs → init-D2HMy-rO.mjs} +2 -2
- package/dist/init-DOe_gwkN.mjs +1 -0
- package/dist/{launch-json-removal-DJC4Yapa.mjs → launch-json-removal-BV1cuUR3.mjs} +1 -1
- package/dist/loader-aSv2-dxV.mjs +1 -0
- package/dist/{loader-CnGe_Flu.mjs → loader-elHDFVY8.mjs} +1 -1
- package/dist/{open-browser-3bURxjbo.mjs → open-browser-DpCYxQUn.mjs} +1 -1
- package/dist/preview-CGs0H5zJ.mjs +1 -0
- package/dist/{preview-c3qAKdkh.mjs → preview-CdgarkKG.mjs} +1 -1
- package/dist/public/assets/{AccountSection-Bo4dPyFQ.js → AccountSection-Da9eATrG.js} +1 -1
- package/dist/public/assets/{ActivityModeContent-CfexCY5K.js → ActivityModeContent-BUaojt46.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-DhN1KHUi.js → AddPropertiesButton-Dv_aXLmb.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-B4ONrFEX.js → AgentDiffPane-CCqjs0BK.js} +1 -1
- package/dist/public/assets/{AttachmentsSection-CCkTnF8H.js → AttachmentsSection-BFWpP5m2.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-C14KgbUB.js → CodeMirrorPropInput-Du6DOr8I.js} +1 -1
- package/dist/public/assets/{ContentRulesSection-B9osiZ5e.js → ContentRulesSection-BZ3w3iWW.js} +1 -1
- package/dist/public/assets/{DocumentContext-B534Taw0.js → DocumentContext-BxX9aCXl.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-lBQIZux4.js → EditorModeToggle-DKB6AYHP.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-DiwiWo-5.js → ExcalidrawDocEditor-DIhUGVEU.js} +1 -1
- package/dist/public/assets/FeedbackForm-DnDW5ZvG.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-gWGVsUXL.js → ImportSkillDialog-B10-vVW-.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-BCYSzx82.js → LinkPreviewsSection-edg0Suk2.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-d7iNbkFu.js → LintConfigEditor-DKzvWSti.js} +1 -1
- package/dist/public/assets/{LintingSection-BfQJhSqK.js → LintingSection-BtAmeAqv.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-CU_Aac_w.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-CgYx_raS.js → ManagedArtifactProperties-slr2G0kW.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-hIN30U4A.js → MermaidDocEditor-BzEE2qez.js} +1 -1
- package/dist/public/assets/{NetworkAccessSection-Bc1mBEpU.js → NetworkAccessSection-BZ_Zx0UF.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-DYZRoIHn.js → PropertyDisplayRow-BAj6XpXT.js} +1 -1
- package/dist/public/assets/{PublishToGitHubDialog-CWgik3XO.js → PublishToGitHubDialog-Cuvbd1PX.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-kryiWiDK.js → SchemaConfigEditor-DxbIHZRY.js} +1 -1
- package/dist/public/assets/{SearchSection-Cj7FdFQQ.js → SearchSection-q7b2zzwT.js} +1 -1
- package/dist/public/assets/{SessionsHost-B9gM79-g.js → SessionsHost-BWDzIa8M.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-CdmGZmCh.js → SettingsDialogBody-CldIUNBc.js} +2 -2
- package/dist/public/assets/{ShareReceiveMissDialog-BydqiR7F.js → ShareReceiveMissDialog-D6VhxJ_Y.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-KYUxZQNe.js → SkillToolbarControls-CWAXROAl.js} +1 -1
- package/dist/public/assets/{SourceEditor-BIPGmkaK.js → SourceEditor-B4RY78dW.js} +1 -1
- package/dist/public/assets/{SyncSection-CPLGR0K4.js → SyncSection-docw4lTk.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-Co74i3q_.js → SyncStatusBadge-1UDFY6j9.js} +1 -1
- package/dist/public/assets/{TerminalSection-DEVYY41F.js → TerminalSection-CN0hq8qQ.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-XRrhf3K3.js → TerminalWindowApp-DFda7-xy.js} +1 -1
- package/dist/public/assets/{TextDocEditor-Eqrxtsiw.js → TextDocEditor--_7fvg_B.js} +1 -1
- package/dist/public/assets/{ThreadView-CDE0BRUz.js → ThreadView-BQ2Y4JH_.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-CLScmppv.js → TimelineDiffPane-BF6Iafy6.js} +1 -1
- package/dist/public/assets/{client-version-V5JX2_9H.js → client-version-C11DEAPt.js} +1 -1
- package/dist/public/assets/{comment-chips-B6PiUF0P.js → comment-chips-yh6f0zsl.js} +1 -1
- package/dist/public/assets/{config-provider-CY8rv6VT.js → config-provider-UObpGf2E.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-BgNKZ6KQ.js → doc-undo-manager-SN41xWWj.js} +1 -1
- package/dist/public/assets/globals-Bwyn_Aih.css +1 -0
- package/dist/public/assets/{index-zyBtEQ0N.js → index-BhuCGeYi.js} +8 -8
- package/dist/public/assets/{lint-plugins-D1JSXJl8.js → lint-plugins-Cxz_4JIJ.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-DDsjXMmg.js → pending-receive-nav-store-a1lp2fF8.js} +1 -1
- package/dist/public/assets/{preferred-session-events-YlTzEpA1.js → preferred-session-events-DzTVah4z.js} +1 -1
- package/dist/public/assets/{progress-fe7kZ4GR.js → progress-CcPmHzZx.js} +1 -1
- package/dist/public/assets/{selection-context-CJj4QU9m.js → selection-context-DGCAU79Q.js} +1 -1
- package/dist/public/assets/{src-DHA7yznt.js → src-Dj0cdtcD.js} +1 -1
- package/dist/public/assets/{telemetry-impl-BoQfVHFh.js → telemetry-impl-DsSo3nZ4.js} +1 -1
- package/dist/public/assets/{telemetry-startup-BePJfd1G.js → telemetry-startup-2MOj_oCR.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-DEB_IQXO.js → typing-burst-detector-fvuDVIJb.js} +1 -1
- package/dist/public/assets/{uninstall-DnITG12q.js → uninstall-DyYmGM9i.js} +1 -1
- package/dist/public/assets/{use-activity-panel-DmN2jwm1.js → use-activity-panel-yAZjRfm-.js} +1 -1
- package/dist/public/assets/{use-open-skill-D8ppWfzv.js → use-open-skill-CtacPC1u.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-CnYgBQu6.js → use-terminal-enabled-Bq2DLqc4.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-Bj9IKZ0j.js → use-timeline-entry-diff-D9RvUmWs.js} +1 -1
- package/dist/public/index.html +21 -21
- package/dist/public/uninstall.html +3 -3
- package/dist/{registry-probes-DjoTkaRp.mjs → registry-probes-bwpVPMUz.mjs} +1 -1
- package/dist/{removal-file-path-C3qKjXP1.mjs → removal-file-path-2sXE6n01.mjs} +1 -1
- package/dist/{repair-launch-json-BLLbBwuS.mjs → repair-launch-json-ClWuGwZf.mjs} +1 -1
- package/dist/{repair-mcp-configs-Du599MHw.mjs → repair-mcp-configs-C3RWrRWR.mjs} +1 -1
- package/dist/src-CSO0D5AA.mjs +1 -0
- package/dist/{src-CV7s8o8N.mjs → src-d571WNqx.mjs} +1 -1
- package/dist/{start-WZZeXyQg.mjs → start-C4mELfrM.mjs} +3 -3
- package/dist/start-gWQOJ8F1.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-BHRHFiiA.mjs +0 -1
- package/dist/init-D8PiEGEU.mjs +0 -1
- package/dist/loader-CjDr4LBh.mjs +0 -1
- package/dist/preview-Bb3fqNig.mjs +0 -1
- package/dist/public/assets/FeedbackForm-DN-7wKfh.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-D0kvL_kU.js +0 -1
- package/dist/public/assets/globals-kLKgmkBv.css +0 -1
- package/dist/src-C3wvr_Qn.mjs +0 -1
- package/dist/start-B6ETYSpw.mjs +0 -1
- /package/dist/public/assets/{globals-CcgTjZMO.js → globals-DcxxoWPt.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./prod-CN58f7_5.js","./chunk-CYidjpOJ.js","./preload-helper-Chd9yIcd.js","./chunk-RM4UPSZO-CKzZrDwB.js","./chunk-A66AFZZU-CtSzOsb0.js","./chunk-SRAX5OIU-krA6W3W1.js","./chunk-7XWMRXBY-CAvIqV-I.js","./chunk-FLYJHZSQ-CyYmWqgr.js","./dist-LjMlqXYz.js","./mermaid.core-CyLGJzps.js","./chunk-4I5QYGJK-Dp669PmE.js","./src-CP90en3s.js","./src-BCu1z_qw.js","./chunk-Y2CYZVJY-DouB_olA.js","./chunk-I66GZJ75-Mkx0wAj8.js","./chunk-NSK5VX7P-BytRcAia.js","./dist-CM2pf1Me.js","./chunk-WRU74C26-D5Y_Dzwm.js","./chunk-3NCLNEKW-D5wa2WAP.js","./chunk-7BUUIJ7U-2u7V-5wt.js","./chunk-7Z6QIM7H-riu23jJK.js","./line-BsarArEL.js","./path-B8QeBUOS.js","./array-BFOVqSYU.js","./chunk-QR6OTTB3-D8za8qsa.js","./chunk-UBXNYLIW-BikKpxC2.js","./chunk-W5SLKNZC-D_CrJ8tI.js","./rough.esm-cBAxAxzT.js","./chunk-J7OUQ5F2-B_dGIV0c.js","./chunk-ZIRB5QZD-BC43nZIY.js","./dist-BzicVdNV.js","./dist-DTFuvKje.js","./dist-CSCUSbQc.js","./react-f2sANaYj.js","./react-dom-DPxgxlDT.js","./jsx-runtime-BUgB2tll.js","./dist-d2WYntJB.js","./dist-DXjgFhPl2.js","./floating-ui.dom-BYl7JZd0.js","./dist-CRjqnzU7.js","./dist-uiDX6Nr9.js","./dist-CxbWbOvU.js","./es2015-Dtr4fzLT.js","./dist-BKgU0kag.js","./dist-C0nuYMFu.js","./dist-Cj3Bpren.js","./dist-wWBxplcG2.js","./with-selector-zVo3Fruj.js","./pdf-iRjqhv9l.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./preload-helper-Chd9yIcd.js";import{t as r}from"./jsx-runtime-BUgB2tll.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{n as s}from"./dist-PQ5KMVDh.js";import{t as c}from"./react-dom-DPxgxlDT.js";import{t as l}from"./compiler-runtime-BfE3aGVn.js";import{t as u}from"./react-error-boundary-6ac6QM6R.js";import{t as d}from"./utils-CPqDy6Hr.js";import{t as f}from"./kbd-Cg1nrB7U.js";import{i as p}from"./dist-CSCUSbQc.js";import{l as m,n as h}from"./dist-DTFuvKje.js";import{i as g,n as _,t as v}from"./tooltip-Bz6z4_se.js";import{n as y,r as b,t as x}from"./collapsible-BKbszYZV.js";import{c as S,i as C,o as w,s as T}from"./electron-drag-strip-D9GZhMg_.js";import{a as E,d as D,f as O,i as k,l as A,r as j}from"./floating-ui.dom-BYl7JZd0.js";import{i as M,n as N,o as P,s as F,t as I}from"./select-pACXgFe2.js";import{t as L}from"./switch-BKZTXkzu.js";import{t as ee}from"./button-DzgjsZzC.js";import{d as R,f as te,g as ne,l as re,m as ie,o as ae,p as oe,u as se}from"./constants-upload-CVKO8P4d.js";import{n as z}from"./dist-BGzUo_18.js";import{G as B,H as ce,O as le,T as V,X as H,Y as U,_t as W,at as G,bt as ue,ct as K,f as de,ft as fe,h as pe,ht as q,i as me,it as J,j as he,m as ge,n as _e,ot as ve,pt as ye,r as be,rt as xe,st as Se,ut as Ce,vt as we,x as Te,y as Ee,yt as De,z as Oe}from"./dist-Dc8tD1th.js";import{t as Y}from"./dist-C_FzPxEX2.js";import{p as ke,u as Ae,v as je}from"./schemas-B93JY9Ef.js";import{_ as Me,d as Ne,f as Pe,g as Fe,h as Ie,o as Le,s as Re,t as ze}from"./constants-cc1-Bt4QPTUe.js";import{b as Be,i as Ve,o as He,v as Ue}from"./documents-events-ddyuXdQl.js";import{a as We,i as Ge,n as Ke,t as qe}from"./_envelope-q8XHEv4O-C-Qnl5Tu.js";import{E as Je,T as Ye,b as Xe,d as Ze,i as Qe,l as $e,m as et,o as tt,s as nt,vt as rt,yt as it}from"./schemas-api-CL5ZXlEj.js";import"./constants-editors-DmmORwNP.js";import{t as at}from"./note-window-mode-CI3Yju9B.js";import{a as ot,i as st,n as ct,r as lt}from"./local-menu-action-bus-Dyh2UJJF.js";import{i as ut}from"./use-apply-config-theme-CYFG76sS.js";import{t as dt}from"./parse-api-error-CeEVOj25.js";import{t as ft}from"./createLucideIcon-DdBzwsHe.js";import{n as pt,t as mt}from"./git-branch-CeTudSak.js";import{n as ht,t as gt}from"./arrow-up-BGHhPj4y.js";import{a as _t,c as vt,d as yt,i as bt,l as xt,n as St,r as Ct,s as wt,t as Tt,u as Et}from"./Mermaid-DqNhHNi1.js";import{t as Dt}from"./check-B2OLRY33.js";import{t as Ot}from"./chevron-down-CEv6N8LG.js";import{t as kt}from"./chevron-right-Bofu4lib.js";import{t as At}from"./circle-alert-eBm4JPxY.js";import{t as jt}from"./circle-check-nK1yRBIw.js";import{t as Mt}from"./copy-DpWa6i2v.js";import{t as Nt}from"./download-BouT3__0.js";import{i as Pt,o as Ft,t as It}from"./ime-composition-DSJh5ynW.js";import{n as Lt,t as Rt}from"./settings-2-DoBlNQMk.js";import{$ as zt,$n as Bt,$t as Vt,An as Ht,B as Ut,Bt as Wt,Cn as Gt,Ct as Kt,Dn as qt,Dt as Jt,En as Yt,Et as Xt,F as Zt,Fn as Qt,Ft as $t,G as en,Gt as tn,H as nn,Hn as rn,Ht as an,It as on,J as sn,Jn as cn,Jt as ln,K as un,Kn as dn,Kt as fn,L as pn,Lt as mn,M as hn,Mn as gn,Mt as _n,N as vn,Nn as yn,Nt as bn,On as xn,Pn as Sn,Pt as Cn,Q as wn,Qn as Tn,Qt as En,R as Dn,Rt as On,S as kn,Sn as An,St as jn,Tn as Mn,Tt as Nn,U as Pn,Ut as Fn,Vt as In,W as Ln,Wn as Rn,Wt as zn,Xn as Bn,Xt as Vn,Y as Hn,Yt as Un,Zn as Wn,Zt as Gn,_n as Kn,_r as qn,_t as Jn,an as Yn,ar as Xn,at as Zn,bn as Qn,br as $n,c as er,cn as tr,cr as nr,d as rr,dn as ir,dr as ar,dt as or,en as sr,er as cr,et as lr,fn as ur,fr as dr,ft as fr,gn as pr,gr as mr,gt as hr,hn as gr,in as _r,ir as vr,j as yr,jn as br,k as xr,kn as Sr,ln as Cr,lr as wr,lt as Tr,m as Er,mn as Dr,mr as Or,mt as kr,n as Ar,nn as jr,nr as Mr,nt as Nr,on as Pr,or as Fr,ot as Ir,p as Lr,pn as Rr,pr as zr,pt as Br,q as Vr,qn as Hr,qt as Ur,r as Wr,rn as Gr,rr as Kr,rt as qr,s as Jr,sn as Yr,sr as Xr,t as Zr,tn as Qr,un as $r,ur as ei,ut as ti,vn as ni,vr as ri,wn as ii,xn as ai,xt as oi,yn as si,yr as ci,z as li,zt as ui}from"./CodeMirrorPropInput-C14KgbUB.js";import{t as di}from"./folder-open-COGOeTzI.js";import{n as fi}from"./prop-types-ZtKgQMRh.js";import{t as pi}from"./hash-C4CJQURT.js";import{t as mi}from"./info-CyR0W2SK.js";import{t as hi}from"./spinner-Bx8xD6f8.js";import{t as gi}from"./maximize-2-DjzhPUDZ.js";import{t as _i}from"./minus-DdRxss3A.js";import{t as vi}from"./paperclip-BHdV1F_7.js";import{n as yi,t as bi}from"./plus-zPnYzcqL.js";import{t as xi}from"./search-CFu4WXqc.js";import{t as Si}from"./sparkles-BS2TX_Um.js";import{t as Ci}from"./trash-2-CchZ0T47.js";import{t as wi}from"./triangle-alert-BXrUEeRU.js";import{t as Ti}from"./x-DM2drskU.js";import{t as Ei}from"./utils-random-uuid-D7CMpgvf.js";import{t as Di}from"./badge-BIamhtRR.js";import{a as Oi,c as ki,i as Ai,n as ji,o as Mi,r as Ni,s as Pi,t as Fi}from"./dialog-BJEjKJjL.js";import{a as Ii,i as Li}from"./constants-skills-BLHVRW90.js";import{i as Ri,r as zi,t as Bi}from"./bridge-BMIee44l.js";import{n as Vi,t as Hi}from"./storage-scope-GPc8n3Ml.js";import{t as Ui}from"./use-workspace-h2j0Puyv.js";import{b as Wi,c as Gi,d as Ki,f as qi,h as Ji,i as Yi,l as Xi,n as Zi,o as Qi,r as $i,u as ea,y as ta}from"./doc-hash-BJkweiX9.js";import{n as X,r as na}from"./perf-CPPbaRwr.js";import{m as ra,t as ia}from"./use-apply-config-color-theme-Bpi7AD0s.js";import{a as aa,i as oa,n as sa,t as ca}from"./popover-Mb1GgB61.js";import{D as la,L as ua,O as da,T as fa,Y as pa,Z as ma,et as ha,f as ga,k as _a,n as va,o as ya,u as ba,v as xa,x as Sa}from"./config-provider-CY8rv6VT.js";import{r as Ca}from"./saved-themes-client-BPWMEtsb.js";import{t as wa}from"./trace-api-BSvaJNnr.js";import{t as Ta}from"./propagation-api-B1IlUKzT.js";import{t as Ea}from"./context-api-B9rp0hJb.js";import{i as Da,n as Oa,o as ka}from"./css-color-to-hex-Csde6-Qs.js";import{a as Aa}from"./client-version-V5JX2_9H.js";import{n as ja,t as Ma}from"./reveal-editor-ChTC5Vss.js";import{t as Na}from"./input-BsFOyzfK.js";import{n as Pa,r as Fa}from"./external-link-8lDpeCuR.js";import{s as Ia}from"./skill-scope-DOTLd4gL.js";import{A as La,C as Ra,M as za,S as Ba,_ as Va,c as Ha,g as Ua,h as Wa,j as Ga,k as Ka,l as qa,m as Ja,n as Ya,u as Xa,v as Za,w as Qa,x as $a,y as eo}from"./navigation-targets-DSSJ_2xi.js";import{r as to}from"./doc-paths-DiEZR__C.js";import{n as no}from"./use-collab-url-BWFGjvvU.js";import{t as ro}from"./known-skill-dirs-WpNGuhvr.js";import{E as io,Ft as ao,J as oo,M as so,Tt as co,c as lo,f as uo,l as fo,lt as po,ut as mo}from"./dist-BosZaL03.js";import{a as ho,i as go,o as _o}from"./cm-theme-Dml6DrPs.js";import{R as vo,V as yo,a as bo,c as xo,g as So,t as Co,v as wo,z as To}from"./lib-CHTgVmKZ.js";import{a as Eo,n as Do,o as Oo,t as ko}from"./lib-DggJrklf.js";import{n as Ao}from"./syntax-YjkwC8Y2.js";import{t as jo}from"./excalidraw-scene-7qRUVF00.js";import{i as Mo,n as No}from"./page-list-cache-p7dO1d0k.js";import{n as Po,r as Fo}from"./PageListContext-CbzXXblg.js";import{t as Io}from"./startup-marks-Cb3e8PuI.js";import{t as Lo}from"./lib-qLdVx2Nx.js";import{t as Ro}from"./lib-BiDTxxNs.js";import{D as zo,_ as Bo}from"./skills-api-CCijBzjo.js";import{i as Vo,n as Ho,r as Uo,t as Wo}from"./dist-DTvyxWzB.js";import{t as Go}from"./dist-CBBf5U_8.js";import{n as Ko}from"./dist-DL4JUOn7.js";import{n as qo}from"./dist-urhiDaCp.js";import{n as Jo}from"./dist-BjL32yBS.js";import{n as Yo}from"./dist-Jw9rDwKW.js";import{n as Xo}from"./dist-DxN51Ana2.js";import{t as Zo}from"./stex-BAMK64Qm.js";import{t as Qo}from"./file-tree-rename-validation-DAMy4Ak1.js";import{t as $o}from"./CopyButton-BTy3joJd.js";import{n as es}from"./single-file-mode-_W9sHrBm.js";(function(){var e=[`user-blocking`,`user-visible`,`background`];class t{constructor(){this.t=new MessageChannel,this.i=this.t.port2,this.l={},this.o=1,this.t.port1.onmessage=e=>this.h(e)}u(e){var t=this.o++;return this.l[t]=e,this.i.postMessage(t),t}p(e){delete this.l[e]}h(e){var t=e.data;if(t in this.l){var n=this.l[t];delete this.l[t],n()}}}function n(){return n.v||=new t,n.v}class r{constructor(e,t,n){n===void 0&&(n=0),this.k=e,this.T=null,this.C=null,this.m=!1,this._(t,n)}isIdleCallback(){return this.T===0}I(){return this.T===2}cancel(){if(!this.m)switch(this.m=!0,this.T){case 0:cancelIdleCallback(this.C);break;case 1:clearTimeout(this.C);break;case 2:n().p(this.C);break;default:throw TypeError(`Unknown CallbackType`)}}_(t,r){if(r&&r>0)return this.T=1,void(this.C=setTimeout(()=>{this.P()},r));if(!e.includes(t))throw TypeError(`Invalid task priority : `+t);t===`background`&&typeof requestIdleCallback==`function`?(this.T=0,this.C=requestIdleCallback(()=>{this.P()})):typeof MessageChannel==`function`?(this.T=2,this.C=n().u(()=>{this.P()})):(this.T=1,this.C=setTimeout(()=>{this.P()}))}P(){this.m||this.k()}}var i=0;class a{constructor(){this.j=null,this.M=null}isEmpty(){return this.j==null}push(e){if(typeof e!=`object`)throw TypeError(`Task must be an Object`);e.A=i++,this.isEmpty()?(e.N=null,this.j=e):(e.N=this.M,this.M.O=e),e.O=null,this.M=e}takeNextTask(){if(this.isEmpty())return null;var e=this.j;return this.q(e),e}merge(e,t){if(typeof t!=`function`)throw TypeError(`Must provide a selector function.`);if(e==null)throw Error(`sourceQueue cannot be null`);for(var n=this.j,r=null,i=e.j;i;){var a=i;if(i=i.O,t(a)){for(e.q(a);n&&n.A<a.A;)r=n,n=n.O;this.D(a,r),r=a}}}D(e,t){if(t!=this.M){var n=t?t.O:this.j;e.O=n,n.N=e,e.N=t,t==null?this.j=e:t.O=e}else this.push(e)}q(e){if(e==null)throw Error(`Expected task to be non-null`);e===this.j&&(this.j=e.O),e===this.M&&(this.M=this.M.N),e.O&&(e.O.N=e.N),e.N&&(e.N.O=e.O)}}class o extends Event{constructor(t,n){if(!n||!e.includes(n.previousPriority))throw TypeError(`Invalid task priority: '`+n.previousPriority+`'`);super(t),this.previousPriority=n.previousPriority}}class s extends AbortController{constructor(t){if(t===void 0&&(t={}),super(),t??={},typeof t!=`object`)throw TypeError(`'init' is not an object`);var n,r,i=t.priority===void 0?`user-visible`:t.priority;if(!e.includes(i))throw TypeError(`Invalid task priority: '`+i+`'`);this.H=i,this.R=!1,r=(n=this).signal,Object.defineProperties(r,{priority:{get:function(){return n.H},enumerable:!0},onprioritychange:{value:null,writable:!0,enumerable:!0}}),r.addEventListener(`prioritychange`,e=>{r.onprioritychange&&r.onprioritychange(e)})}setPriority(t){if(!e.includes(t))throw TypeError(`Invalid task priority: `+t);if(this.R)throw new DOMException(``,`NotAllowedError`);if(this.signal.priority!==t){this.R=!0;var n=this.H;this.H=t;var r=new o(`prioritychange`,{previousPriority:n});this.signal.dispatchEvent(r),this.R=!1}}}self.scheduler===void 0?(self.scheduler=new class{constructor(){this.S={},e.forEach(e=>{this.S[e]=[new a,new a]}),this.U=null,this.W=new WeakMap}yield(){return this.B(()=>{},{priority:`user-visible`},!0)}postTask(e,t){return this.B(e,t,!1)}B(t,n,r){if((n=Object.assign({},n)).signal!==void 0){if(n.signal===null||!(`aborted`in n.signal)||typeof n.signal.addEventListener!=`function`)return Promise.reject(TypeError(`'signal' is not a valid 'AbortSignal'`));if(n.signal&&n.signal.priority&&!e.includes(n.signal.priority))return Promise.reject(TypeError(`Invalid task priority: '`+n.signal.priority+`'`))}if(n.priority!==void 0&&(n.priority===null||!e.includes(n.priority)))return Promise.reject(TypeError(`Invalid task priority: '`+n.priority+`'`));if(n.delay===void 0&&(n.delay=0),n.delay=Number(n.delay),n.delay<0)return Promise.reject(TypeError(`'delay' must be a positive number.`));var i={callback:t,options:n,resolve:null,reject:null,hostCallback:null,abortCallback:null,onTaskCompleted:function(){this.options.signal&&this.abortCallback&&(this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null)},onTaskAborted:function(){this.hostCallback&&=(this.hostCallback.cancel(),null),this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null,this.reject(this.options.signal.reason)},isAborted:function(){return this.options.signal&&this.options.signal.aborted},isContinuation:r},a=new Promise((e,t)=>{i.resolve=e,i.reject=t});return this._(i),a}_(e){var t=e.options.signal;if(t){if(t.aborted)return void e.reject(t.reason);e.abortCallback=()=>{e.onTaskAborted()},t.addEventListener(`abort`,e.abortCallback)}e.options.delay>0?e.hostCallback=new r(()=>{e.hostCallback=null,this.F(e)},null,e.options.delay):(this.G(e),this.J())}F(e){this.G(e),this.U&&=(this.U.cancel(),null),this.K()}L(e){var t=this.W.get(e);if(t===void 0)throw Error(`Attempting to change priority on an unregistered signal`);if(t!==e.priority){for(var n=0;n<2;n++)this.S[e.priority][n].merge(this.S[t][n],t=>t.options.signal===e);this.W.set(e,e.priority)}}K(){this.U=null,this.V(),this.J()}J(){var{priority:e}=this.X();e!=null&&(e!==`background`&&this.U&&this.U.isIdleCallback()&&(this.U.cancel(),this.U=null),this.U||=new r(()=>{this.K()},e,0))}G(t){var n;if(!e.includes(n=t.options.priority?t.options.priority:t.options.signal&&t.options.signal.priority?t.options.signal.priority:`user-visible`))throw TypeError(`Invalid task priority: `+n);if(t.options.signal&&t.options.signal.priority){var r=t.options.signal;this.W.has(r)||(r.addEventListener(`prioritychange`,()=>{this.L(r)}),this.W.set(r,r.priority))}this.S[n][+!t.isContinuation].push(t)}V(){var e=null;do{var{priority:t,type:n}=this.X();if(t==null)return;e=this.S[t][n].takeNextTask()}while(e.isAborted());try{var r=e.callback();e.resolve(r)}catch(t){e.reject(t)}finally{e.onTaskCompleted()}}X(){for(var t=0;t<e.length;t++)for(var n=e[t],r=0;r<2;r++)if(!this.S[n][r].isEmpty())return{priority:n,type:r};return{priority:null,type:0}}},self.TaskController=s,self.TaskPriorityChangeEvent=o):self.scheduler.yield||(self.scheduler.yield=function(){return self.scheduler.postTask(()=>{},{priority:`user-blocking`})})})();var Z=e(i(),1),ts=e(c(),1),Q=l(),ns=null,rs=!1,is=!1;function as(e){return e instanceof Error&&e.message?e.message:String(e)}function os(e){let t=as(e);if(t===ns){rs=!0,is=!0;return}ns=t,rs=!1,is=!1}function ss(){return rs}function cs(){rs=!1,ns=null}function ls(){let e=is;return is=!1,e}var $=r(),us=`open-knowledge:doc-panel-tab`,ds=null;function fs(){return typeof window>`u`?new EventTarget:window}function ps(){let e=ds;return ds=null,e}var ms=null,hs=null;function gs(){ms=null,hs?.(),hs=null}function _s(e){let t=null,n=null,r=null,i=()=>{typeof cancelAnimationFrame==`function`&&(t!==null&&cancelAnimationFrame(t),n!==null&&cancelAnimationFrame(n)),r!==null&&clearTimeout(r),hs===i&&(hs=null)},a=()=>{ms===e&&(ms=null),i()};return typeof requestAnimationFrame==`function`?(t=requestAnimationFrame(()=>{t=null,n=requestAnimationFrame(()=>{n=null,a()})}),r=setTimeout(a,250)):r=setTimeout(a,0),i}function vs(e){return typeof window>`u`||e===window}function ys(e){if(ms?.tab!==e)return null;let{request:t}=ms;return gs(),t}function bs(e,t={},n=fs()){if(vs(n)&&(ds=e,gs(),t.scope!==void 0||t.focus!==void 0)){let n={tab:e,request:t};ms=n,hs=_s(n)}n.dispatchEvent(new CustomEvent(us,{detail:{tab:e,...t}}))}function xs(e,t=fs()){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n?.tab&&e(n.tab,{scope:n.scope,focus:n.focus})};return t.addEventListener(us,n),()=>t.removeEventListener(us,n)}async function Ss(e,t){let n=await fetch(e,{...t,headers:{"content-type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok){let e=Ke.safeParse(r);throw Error(e.success?e.data.title??e.data.detail:`comments request failed (${n.status})`)}return r}function Cs(e){return Ss(`/api/comment`,{method:`POST`,body:JSON.stringify(e)})}function ws(e,t){let n=e.safeParse(t);if(!n.success)throw Error(`The server returned a response this build cannot read.`);return n.data}function Ts(e){let t=tt.safeParse(e);if(!t.success)throw Error(`The server returned a comment thread this build cannot read.`);return t.data}function Es(e){let t=[];for(let n of e){let e=tt.safeParse(n);e.success?t.push(e.data):console.warn(`[comments] skipped a thread this build cannot read`,e.error.issues)}return t}async function Ds(e){let{threads:t}=await Ss(e===void 0?`/api/comments`:`/api/comments?doc=${encodeURIComponent(e)}`);return Es(t)}function Os(e){return Ss(`/api/comments`,{method:`POST`,body:JSON.stringify(e)}).then(Ts)}function ks(e,t){return Cs({action:`edit`,id:e,body:t}).then(Ts)}function As(e){return Cs({action:`reopen`,id:e}).then(Ts)}function js(e,t){return Cs({action:`replace`,id:e,...t}).then(Ts)}function Ms(e){return Cs({action:`queue`,id:e}).then(e=>ws(Je,e))}function Ns(e){return Cs({action:`unqueue`,id:e}).then(Ts)}function Ps(e){return Ss(`/api/comment?id=${encodeURIComponent(e)}`,{method:`DELETE`}).then(e=>ws(Ze,e))}function Fs(e){return Cs({action:`dispatch-prepare-batch`,ids:e}).then(e=>ws(Ye,e))}function Is(e){return Cs({action:`dispatch-complete-batch`,ids:e}).then(e=>ws(nt,e))}var Ls=`open-knowledge:comments-scope`,Rs=typeof window>`u`?new EventTarget:window,zs=null;function Bs(){let e=zs;return zs=null,e}function Vs(e){let t=t=>{zs=null,e(t.detail)};return Rs.addEventListener(Ls,t),()=>Rs.removeEventListener(Ls,t)}function Hs(e,t){t!==void 0&&typeof window<`u`&&ot({kind:`reveal-comments`,docName:t,scope:e===`project`?`queue`:`doc`},window)||(zs=e,bs(`comments`),Rs.dispatchEvent(new CustomEvent(Ls,{detail:e})))}function Us(e){Hs(`project`,e)}var Ws=Object.freeze([]),Gs=Object.freeze([]),Ks=new Map,qs=[],Js=new Set,Ys=new Set,Xs=!1,Zs=new Set,Qs=0,$s=0;function ec(){for(let e of Js)e()}function tc(){Qs+=1,ec()}function nc(){$s+=1,ec()}function rc(e){return{id:e.threadId,docName:e.docName,target:e.target,anchor:e.anchor===null?null:{quote:e.anchor.exact,prefix:e.anchor.prefix,suffix:e.anchor.suffix,start:e.anchor.start,end:e.anchor.end},status:e.state===`anchored`?`open`:e.state,body:e.latestComment,createdAt:e.createdAt,updatedAt:e.updatedAt??e.createdAt,queued:e.queued}}async function ic(){return(await Ds()).map(rc).sort((e,t)=>t.createdAt-e.createdAt)}async function ac(e){e!==void 0&&Ys.add(e);let t=await ic();qs=t,Xs=!0;for(let e of Ys)Ks.set(e,t.filter(t=>t.docName===e));tc(),oc(t)}function oc(e){Zc!==null&&(e.some(e=>e.id===Zc&&e.status===`open`)||ul(null))}var sc=!1;function cc(){sc||typeof window>`u`||(sc=!0,Ue(e=>{e.includes(`comments`)&&ac().catch(()=>void 0)}))}function lc(e){cc(),!Ys.has(e)&&(Ys.add(e),ac(e).catch(()=>{Ys.delete(e)}))}function uc(){cc(),!Xs&&(Xs=!0,ac().catch(()=>{Xs=!1}))}function dc(e){return lc(e),Ks.get(e)??Ws}function fc(e){return Js.add(e),()=>{Js.delete(e)}}function pc(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=()=>dc(e),t[0]=e,t[1]=n),(0,Z.useSyncExternalStore)(fc,n,mc)}function mc(){return Ws}function hc(){return uc(),qs}function gc(){return(0,Z.useSyncExternalStore)(fc,hc,_c)}function _c(){return Ws}function vc(e){for(let t of Ks.values()){let n=t.find(t=>t.id===e);if(n)return n}return qs.find(t=>t.id===e)??null}function yc(e){Os({docName:e.docName,quote:e.quote,prefix:e.prefix,suffix:e.suffix,body:e.body,queue:!0}).then(t=>{if(ac(e.docName).catch(()=>void 0),e.onCreated!==void 0){e.onCreated(t.threadId);return}Hs(`doc`,e.docName),fl()}).catch(e=>{z.error(e instanceof Error&&e.message?Y._({id:`q3W2nd`,values:{0:e.message}}):Y._({id:`SRBk2G`}))})}function bc(e){Os({docName:e.docName,propertyKey:e.propertyKey,propertyPath:e.propertyPath,quote:e.quote,body:e.body,queue:!0}).then(()=>{ac(e.docName).catch(()=>void 0),Hs(`doc`,e.docName),fl()}).catch(e=>{z.error(e instanceof Error&&e.message?Y._({id:`q3W2nd`,values:{0:e.message}}):Y._({id:`SRBk2G`}))})}function xc(e,t,n){e.then(()=>{ac(t).catch(()=>void 0)},e=>{z.error(e instanceof Error&&e.message?`${n} ${e.message}`:n),ac(t).catch(()=>void 0)})}function Sc(e,t){let n=vc(e)?.docName;xc(ks(e,t),n,Y._({id:`kzpkcn`}))}function Cc(e){let t=vc(e)?.docName;Ic(e),xc(As(e),t,Y._({id:`lISYEX`}))}function wc(e){let t=vc(e)?.docName;xc(Ps(e),t,Y._({id:`IxHMdF`}))}function Tc(e,t,n){let r=vc(e)?.docName;xc(js(e,{quote:t,prefix:n?.prefix,suffix:n?.suffix}),r,Y._({id:`mlvM8g`}))}var Ec=Gs,Dc=-1,Oc=Gs,kc=-1,Ac=-1;function jc(){if(uc(),Dc!==Qs){let e=qs.filter(e=>e.queued&&e.status!==`resolved`).sort((e,t)=>e.createdAt-t.createdAt).map(e=>e.id);Ec=e.length===0?Gs:e,Dc=Qs}return Ec}function Mc(){let e=jc();if(kc!==Qs||Ac!==$s){let t=e.filter(e=>!Zs.has(e));Oc=t.length===0?Gs:t,kc=Qs,Ac=$s}return Oc}function Nc(){return(0,Z.useSyncExternalStore)(fc,Mc,Pc)}function Pc(){return Gs}function Fc(e){return Mc().filter(t=>vc(t)?.docName===e)}function Ic(e){if(!Zs.has(e))return;let t=new Set(Zs);t.delete(e),Zs=t,nc()}function Lc(e){let t=vc(e)?.docName;Ic(e),xc(Ms(e),t,Y._({id:`S-7ej_`}))}function Rc(e){let t=vc(e)?.docName;xc(Ns(e),t,Y._({id:`PTUuoc`}))}function zc(e){Mc().includes(e)?Rc(e):Lc(e)}function Bc(e,t){let n=new Set(Mc()),r=e.filter(e=>n.has(e)!==t);if(r.length!==0){if(t&&Zs.size>0){let e=new Set(Zs);for(let t of r)e.delete(t);Zs=e,nc()}Promise.all(r.map(e=>(t?Ms(e):Ns(e)).then(()=>!0,()=>!1))).then(e=>{let t=e.filter(e=>!e).length;t>0&&z.error(Y._({id:`wqD3pI`,values:{0:r.length,failed:t}})),ac().catch(()=>void 0)})}}var Vc=!1;async function Hc({compose:e,threadIds:t,resolve:n=!0}){let r=t??Mc();if(r.length===0||Vc)return[];Vc=!0;try{return await Uc(r,e,n)}finally{Vc=!1}}async function Uc(e,t,n){let r;try{r=await Fs(e)}catch(e){return z.error(e instanceof Error&&e.message?Y._({id:`cVKnqL`,values:{0:e.message}}):Y._({id:`7FA2iI`})),[]}tc();let i=r.results.flatMap(e=>e.ok?[{threadId:e.threadId,payload:e.payload}]:[]);if(i.length===0)return await ac().catch(()=>void 0),[];let a=!1;try{a=await t(i)}catch(e){console.warn(`[comments] dispatch compose failed; leaving threads queued`,e),a=!1}let o=a?i.map(e=>e.threadId):[];return o.length>0&&n&&await Is(o).catch(()=>{z.error(Y._({id:`JyM0gO`}))}),await ac().catch(()=>void 0),o}var Wc=`open-knowledge:comment-focus-thread`,Gc=`open-knowledge:comment-open-thread`,Kc=`open-knowledge:comment-start`,qc=`open-knowledge:comment-posted`,Jc=typeof window>`u`?new EventTarget:window;function Yc(e){Jc.dispatchEvent(new CustomEvent(Wc,{detail:e}))}function Xc(e){let t=t=>e(t.detail);return Jc.addEventListener(Wc,t),()=>Jc.removeEventListener(Wc,t)}var Zc=null,Qc=null,$c=null,el=new Set;function tl(){let e=Qc??Zc;if(e!==$c){$c=e;for(let e of el)e()}}function nl(){return $c}function rl(e){Qc=e,tl()}function il(e){Qc===e&&(Qc=null,tl())}function al(e){return el.add(e),()=>{el.delete(e)}}function ol(){return(0,Z.useSyncExternalStore)(cl,ll,sl)}function sl(){return null}function cl(e){return dl(()=>e())}function ll(){return Zc}function ul(e){Zc=e,tl(),e!==null&&bs(`comments`),Jc.dispatchEvent(new CustomEvent(Gc,{detail:e}))}function dl(e){let t=t=>e(t.detail);return Jc.addEventListener(Gc,t),()=>Jc.removeEventListener(Gc,t)}function fl(){Jc.dispatchEvent(new CustomEvent(qc))}function pl(e){let t=()=>e();return Jc.addEventListener(qc,t),()=>Jc.removeEventListener(qc,t)}function ml(){Jc.dispatchEvent(new CustomEvent(Kc))}function hl(e){let t=()=>e();return Jc.addEventListener(Kc,t),()=>Jc.removeEventListener(Kc,t)}var gl=ft(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),_l=ft(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),vl=ft(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),yl=ft(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),bl=ft(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),xl=ft(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Sl=ft(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Cl=ft(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),wl=ft(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Tl=ft(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),El=ft(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Dl=ft(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Ol=ft(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),kl=ft(`file-image`,[[`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`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),Al=ft(`file-up`,[[`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:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),jl=ft(`file`,[[`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`}]]),Ml=ft(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Nl=ft(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),Pl=ft(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),Fl=ft(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),Il=ft(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),Ll=ft(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Rl=ft(`layout-panel-top`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}]]),zl=ft(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Bl=ft(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),Vl=[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]],Hl=ft(`link-2`,Vl),Ul=ft(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),Wl=ft(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),Gl=ft(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Kl=ft(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),ql=ft(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),Jl=ft(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),Yl=ft(`pen-tool`,[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`,key:`nt11vn`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`,key:`15qc1e`}],[`path`,{d:`m2.3 2.3 7.286 7.286`,key:`1wuzzi`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]),Xl=ft(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),Zl=ft(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),Ql=ft(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),$l=ft(`sigma`,[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]),eu=ft(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),tu=ft(`square-play`,[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}]]),nu=ft(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),ru=ft(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),iu=ft(`text-align-center`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]]),au=ft(`text-align-end`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]]),ou=ft(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),su=ft(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),cu=ft(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),lu=ft(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),uu=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(void 0,{granularity:`grapheme`}):null})();function du(e){return e>=56320&&e<=57343}function fu(e){return e>=55296&&e<=56319}function pu(e,t){if(uu){let n=uu.segment(e).containing(t);return n===void 0?t:n.index}return du(e.charCodeAt(t))&&fu(e.charCodeAt(t-1))?t-1:t}function mu(e,t){if(uu){let n=uu.segment(e).containing(t);return n===void 0||n.index===t?t:n.index+n.segment.length}return du(e.charCodeAt(t))&&fu(e.charCodeAt(t-1))?t+1:t}function hu(e,t){return e.length<=t?e:t<=0?``:e.slice(0,pu(e,t))}function gu(e,t){return e.length<=t?e:t<=0?``:e.slice(mu(e,e.length-t))}var _u=new Map,vu=new Set;function yu(){for(let e of vu)e()}function bu(e,t){_u.set(e,t),yu()}function xu(e,t){_u.get(e)===t&&(_u.delete(e),yu())}function Su(e){return _u.get(e)??null}function Cu(e){let t=_u.get(e);if(!t||t.isDestroyed)return null;let n=mr(t)?.dom;return n?.isConnected&&n.getClientRects().length>0?t:null}function wu(e){return vu.add(e),()=>vu.delete(e)}function Tu(e,t){let n=e.attrs[t];return typeof n==`string`?n:``}function Eu(e,t){let n=e.attrs.props;if(typeof n!=`object`||!n)return``;let r=n[t];return typeof r==`string`?r:``}var Du=[`children`,`chart`,`formula`,`alt`,`name`,`alias`,`target`];function Ou(e){for(let t of Du){let n=Eu(e,t);if(n.length>0)return n}return Tu(e,`sourceRaw`)}function ku(e){switch(e.type.name){case`wikiLink`:return Tu(e,`alias`)||Tu(e,`target`);case`wikiLinkEmbed`:return Tu(e,`target`);case`tag`:return`#${Tu(e,`value`)}`;case`mathInline`:return Tu(e,`formula`);case`image`:case`imageReference`:return Tu(e,`alt`);case`footnoteReference`:return Tu(e,`label`)||Tu(e,`identifier`);case`jsxComponent`:case`jsxInline`:return e.content.size===0?Ou(e):``;default:return``}}function Au(e,t,n,r=`
|
|
2
|
+
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./preload-helper-Chd9yIcd.js";import{t as r}from"./jsx-runtime-BUgB2tll.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{n as s}from"./dist-PQ5KMVDh.js";import{t as c}from"./react-dom-DPxgxlDT.js";import{t as l}from"./compiler-runtime-BfE3aGVn.js";import{t as u}from"./react-error-boundary-6ac6QM6R.js";import{t as d}from"./utils-CPqDy6Hr.js";import{t as f}from"./kbd-Cg1nrB7U.js";import{i as p}from"./dist-CSCUSbQc.js";import{l as m,n as h}from"./dist-DTFuvKje.js";import{i as g,n as _,t as v}from"./tooltip-Bz6z4_se.js";import{n as y,r as b,t as x}from"./collapsible-BKbszYZV.js";import{c as S,i as C,o as w,s as T}from"./electron-drag-strip-D9GZhMg_.js";import{a as E,d as D,f as O,i as k,l as A,r as j}from"./floating-ui.dom-BYl7JZd0.js";import{i as M,n as N,o as P,s as F,t as I}from"./select-pACXgFe2.js";import{t as L}from"./switch-BKZTXkzu.js";import{t as ee}from"./button-DzgjsZzC.js";import{d as R,f as te,g as ne,l as re,m as ie,o as ae,p as oe,u as se}from"./constants-upload-CVKO8P4d.js";import{n as z}from"./dist-BGzUo_18.js";import{G as B,H as ce,O as le,T as V,X as H,Y as U,_t as W,at as G,bt as ue,ct as K,f as de,ft as fe,h as pe,ht as q,i as me,it as J,j as he,m as ge,n as _e,ot as ve,pt as ye,r as be,rt as xe,st as Se,ut as Ce,vt as we,x as Te,y as Ee,yt as De,z as Oe}from"./dist-Dc8tD1th.js";import{t as Y}from"./dist-C_FzPxEX2.js";import{p as ke,u as Ae,v as je}from"./schemas-B93JY9Ef.js";import{_ as Me,d as Ne,f as Pe,g as Fe,h as Ie,o as Le,s as Re,t as ze}from"./constants-cc1-Bt4QPTUe.js";import{b as Be,i as Ve,o as He,v as Ue}from"./documents-events-ddyuXdQl.js";import{a as We,i as Ge,n as Ke,t as qe}from"./_envelope-q8XHEv4O-C-Qnl5Tu.js";import{E as Je,T as Ye,b as Xe,d as Ze,i as Qe,l as $e,m as et,o as tt,s as nt,vt as rt,yt as it}from"./schemas-api-CL5ZXlEj.js";import"./constants-editors-DmmORwNP.js";import{t as at}from"./note-window-mode-CI3Yju9B.js";import{a as ot,i as st,n as ct,r as lt}from"./local-menu-action-bus-Dyh2UJJF.js";import{i as ut}from"./use-apply-config-theme-CYFG76sS.js";import{t as dt}from"./parse-api-error-CeEVOj25.js";import{t as ft}from"./createLucideIcon-DdBzwsHe.js";import{n as pt,t as mt}from"./git-branch-CeTudSak.js";import{n as ht,t as gt}from"./arrow-up-BGHhPj4y.js";import{a as _t,c as vt,d as yt,i as bt,l as xt,n as St,r as Ct,s as wt,t as Tt,u as Et}from"./Mermaid-DqNhHNi1.js";import{t as Dt}from"./check-B2OLRY33.js";import{t as Ot}from"./chevron-down-CEv6N8LG.js";import{t as kt}from"./chevron-right-Bofu4lib.js";import{t as At}from"./circle-alert-eBm4JPxY.js";import{t as jt}from"./circle-check-nK1yRBIw.js";import{t as Mt}from"./copy-DpWa6i2v.js";import{t as Nt}from"./download-BouT3__0.js";import{i as Pt,o as Ft,t as It}from"./ime-composition-DSJh5ynW.js";import{n as Lt,t as Rt}from"./settings-2-DoBlNQMk.js";import{$ as zt,$n as Bt,$t as Vt,An as Ht,B as Ut,Bt as Wt,Cn as Gt,Ct as Kt,Dn as qt,Dt as Jt,En as Yt,Et as Xt,F as Zt,Fn as Qt,Ft as $t,G as en,Gt as tn,H as nn,Hn as rn,Ht as an,It as on,J as sn,Jn as cn,Jt as ln,K as un,Kn as dn,Kt as fn,L as pn,Lt as mn,M as hn,Mn as gn,Mt as _n,N as vn,Nn as yn,Nt as bn,On as xn,Pn as Sn,Pt as Cn,Q as wn,Qn as Tn,Qt as En,R as Dn,Rt as On,S as kn,Sn as An,St as jn,Tn as Mn,Tt as Nn,U as Pn,Ut as Fn,Vt as In,W as Ln,Wn as Rn,Wt as zn,Xn as Bn,Xt as Vn,Y as Hn,Yt as Un,Zn as Wn,Zt as Gn,_n as Kn,_r as qn,_t as Jn,an as Yn,ar as Xn,at as Zn,bn as Qn,br as $n,c as er,cn as tr,cr as nr,d as rr,dn as ir,dr as ar,dt as or,en as sr,er as cr,et as lr,fn as ur,fr as dr,ft as fr,gn as pr,gr as mr,gt as hr,hn as gr,in as _r,ir as vr,j as yr,jn as br,k as xr,kn as Sr,ln as Cr,lr as wr,lt as Tr,m as Er,mn as Dr,mr as Or,mt as kr,n as Ar,nn as jr,nr as Mr,nt as Nr,on as Pr,or as Fr,ot as Ir,p as Lr,pn as Rr,pr as zr,pt as Br,q as Vr,qn as Hr,qt as Ur,r as Wr,rn as Gr,rr as Kr,rt as qr,s as Jr,sn as Yr,sr as Xr,t as Zr,tn as Qr,un as $r,ur as ei,ut as ti,vn as ni,vr as ri,wn as ii,xn as ai,xt as oi,yn as si,yr as ci,z as li,zt as ui}from"./CodeMirrorPropInput-Du6DOr8I.js";import{t as di}from"./folder-open-COGOeTzI.js";import{n as fi}from"./prop-types-ZtKgQMRh.js";import{t as pi}from"./hash-C4CJQURT.js";import{t as mi}from"./info-CyR0W2SK.js";import{t as hi}from"./spinner-Bx8xD6f8.js";import{t as gi}from"./maximize-2-DjzhPUDZ.js";import{t as _i}from"./minus-DdRxss3A.js";import{t as vi}from"./paperclip-BHdV1F_7.js";import{n as yi,t as bi}from"./plus-zPnYzcqL.js";import{t as xi}from"./search-CFu4WXqc.js";import{t as Si}from"./sparkles-BS2TX_Um.js";import{t as Ci}from"./trash-2-CchZ0T47.js";import{t as wi}from"./triangle-alert-BXrUEeRU.js";import{t as Ti}from"./x-DM2drskU.js";import{t as Ei}from"./utils-random-uuid-D7CMpgvf.js";import{t as Di}from"./badge-BIamhtRR.js";import{a as Oi,c as ki,i as Ai,n as ji,o as Mi,r as Ni,s as Pi,t as Fi}from"./dialog-BJEjKJjL.js";import{a as Ii,i as Li}from"./constants-skills-BLHVRW90.js";import{i as Ri,r as zi,t as Bi}from"./bridge-BMIee44l.js";import{n as Vi,t as Hi}from"./storage-scope-GPc8n3Ml.js";import{t as Ui}from"./use-workspace-h2j0Puyv.js";import{b as Wi,c as Gi,d as Ki,f as qi,h as Ji,i as Yi,l as Xi,n as Zi,o as Qi,r as $i,u as ea,y as ta}from"./doc-hash-BJkweiX9.js";import{n as X,r as na}from"./perf-CPPbaRwr.js";import{m as ra,t as ia}from"./use-apply-config-color-theme-Bpi7AD0s.js";import{a as aa,i as oa,n as sa,t as ca}from"./popover-Mb1GgB61.js";import{D as la,L as ua,O as da,T as fa,Y as pa,Z as ma,et as ha,f as ga,k as _a,n as va,o as ya,u as ba,v as xa,x as Sa}from"./config-provider-UObpGf2E.js";import{r as Ca}from"./saved-themes-client-BPWMEtsb.js";import{t as wa}from"./trace-api-BSvaJNnr.js";import{t as Ta}from"./propagation-api-B1IlUKzT.js";import{t as Ea}from"./context-api-B9rp0hJb.js";import{i as Da,n as Oa,o as ka}from"./css-color-to-hex-Csde6-Qs.js";import{a as Aa}from"./client-version-C11DEAPt.js";import{n as ja,t as Ma}from"./reveal-editor-ChTC5Vss.js";import{t as Na}from"./input-BsFOyzfK.js";import{n as Pa,r as Fa}from"./external-link-8lDpeCuR.js";import{s as Ia}from"./skill-scope-DOTLd4gL.js";import{A as La,C as Ra,M as za,S as Ba,_ as Va,c as Ha,g as Ua,h as Wa,j as Ga,k as Ka,l as qa,m as Ja,n as Ya,u as Xa,v as Za,w as Qa,x as $a,y as eo}from"./navigation-targets-DSSJ_2xi.js";import{r as to}from"./doc-paths-DiEZR__C.js";import{n as no}from"./use-collab-url-BWFGjvvU.js";import{t as ro}from"./known-skill-dirs-WpNGuhvr.js";import{E as io,Ft as ao,J as oo,M as so,Tt as co,c as lo,f as uo,l as fo,lt as po,ut as mo}from"./dist-BosZaL03.js";import{a as ho,i as go,o as _o}from"./cm-theme-Dml6DrPs.js";import{R as vo,V as yo,a as bo,c as xo,g as So,t as Co,v as wo,z as To}from"./lib-CHTgVmKZ.js";import{a as Eo,n as Do,o as Oo,t as ko}from"./lib-DggJrklf.js";import{n as Ao}from"./syntax-YjkwC8Y2.js";import{t as jo}from"./excalidraw-scene-7qRUVF00.js";import{i as Mo,n as No}from"./page-list-cache-p7dO1d0k.js";import{n as Po,r as Fo}from"./PageListContext-CbzXXblg.js";import{t as Io}from"./startup-marks-Cb3e8PuI.js";import{t as Lo}from"./lib-qLdVx2Nx.js";import{t as Ro}from"./lib-BiDTxxNs.js";import{D as zo,_ as Bo}from"./skills-api-CCijBzjo.js";import{i as Vo,n as Ho,r as Uo,t as Wo}from"./dist-DTvyxWzB.js";import{t as Go}from"./dist-CBBf5U_8.js";import{n as Ko}from"./dist-DL4JUOn7.js";import{n as qo}from"./dist-urhiDaCp.js";import{n as Jo}from"./dist-BjL32yBS.js";import{n as Yo}from"./dist-Jw9rDwKW.js";import{n as Xo}from"./dist-DxN51Ana2.js";import{t as Zo}from"./stex-BAMK64Qm.js";import{t as Qo}from"./file-tree-rename-validation-DAMy4Ak1.js";import{t as $o}from"./CopyButton-BTy3joJd.js";import{n as es}from"./single-file-mode-_W9sHrBm.js";(function(){var e=[`user-blocking`,`user-visible`,`background`];class t{constructor(){this.t=new MessageChannel,this.i=this.t.port2,this.l={},this.o=1,this.t.port1.onmessage=e=>this.h(e)}u(e){var t=this.o++;return this.l[t]=e,this.i.postMessage(t),t}p(e){delete this.l[e]}h(e){var t=e.data;if(t in this.l){var n=this.l[t];delete this.l[t],n()}}}function n(){return n.v||=new t,n.v}class r{constructor(e,t,n){n===void 0&&(n=0),this.k=e,this.T=null,this.C=null,this.m=!1,this._(t,n)}isIdleCallback(){return this.T===0}I(){return this.T===2}cancel(){if(!this.m)switch(this.m=!0,this.T){case 0:cancelIdleCallback(this.C);break;case 1:clearTimeout(this.C);break;case 2:n().p(this.C);break;default:throw TypeError(`Unknown CallbackType`)}}_(t,r){if(r&&r>0)return this.T=1,void(this.C=setTimeout(()=>{this.P()},r));if(!e.includes(t))throw TypeError(`Invalid task priority : `+t);t===`background`&&typeof requestIdleCallback==`function`?(this.T=0,this.C=requestIdleCallback(()=>{this.P()})):typeof MessageChannel==`function`?(this.T=2,this.C=n().u(()=>{this.P()})):(this.T=1,this.C=setTimeout(()=>{this.P()}))}P(){this.m||this.k()}}var i=0;class a{constructor(){this.j=null,this.M=null}isEmpty(){return this.j==null}push(e){if(typeof e!=`object`)throw TypeError(`Task must be an Object`);e.A=i++,this.isEmpty()?(e.N=null,this.j=e):(e.N=this.M,this.M.O=e),e.O=null,this.M=e}takeNextTask(){if(this.isEmpty())return null;var e=this.j;return this.q(e),e}merge(e,t){if(typeof t!=`function`)throw TypeError(`Must provide a selector function.`);if(e==null)throw Error(`sourceQueue cannot be null`);for(var n=this.j,r=null,i=e.j;i;){var a=i;if(i=i.O,t(a)){for(e.q(a);n&&n.A<a.A;)r=n,n=n.O;this.D(a,r),r=a}}}D(e,t){if(t!=this.M){var n=t?t.O:this.j;e.O=n,n.N=e,e.N=t,t==null?this.j=e:t.O=e}else this.push(e)}q(e){if(e==null)throw Error(`Expected task to be non-null`);e===this.j&&(this.j=e.O),e===this.M&&(this.M=this.M.N),e.O&&(e.O.N=e.N),e.N&&(e.N.O=e.O)}}class o extends Event{constructor(t,n){if(!n||!e.includes(n.previousPriority))throw TypeError(`Invalid task priority: '`+n.previousPriority+`'`);super(t),this.previousPriority=n.previousPriority}}class s extends AbortController{constructor(t){if(t===void 0&&(t={}),super(),t??={},typeof t!=`object`)throw TypeError(`'init' is not an object`);var n,r,i=t.priority===void 0?`user-visible`:t.priority;if(!e.includes(i))throw TypeError(`Invalid task priority: '`+i+`'`);this.H=i,this.R=!1,r=(n=this).signal,Object.defineProperties(r,{priority:{get:function(){return n.H},enumerable:!0},onprioritychange:{value:null,writable:!0,enumerable:!0}}),r.addEventListener(`prioritychange`,e=>{r.onprioritychange&&r.onprioritychange(e)})}setPriority(t){if(!e.includes(t))throw TypeError(`Invalid task priority: `+t);if(this.R)throw new DOMException(``,`NotAllowedError`);if(this.signal.priority!==t){this.R=!0;var n=this.H;this.H=t;var r=new o(`prioritychange`,{previousPriority:n});this.signal.dispatchEvent(r),this.R=!1}}}self.scheduler===void 0?(self.scheduler=new class{constructor(){this.S={},e.forEach(e=>{this.S[e]=[new a,new a]}),this.U=null,this.W=new WeakMap}yield(){return this.B(()=>{},{priority:`user-visible`},!0)}postTask(e,t){return this.B(e,t,!1)}B(t,n,r){if((n=Object.assign({},n)).signal!==void 0){if(n.signal===null||!(`aborted`in n.signal)||typeof n.signal.addEventListener!=`function`)return Promise.reject(TypeError(`'signal' is not a valid 'AbortSignal'`));if(n.signal&&n.signal.priority&&!e.includes(n.signal.priority))return Promise.reject(TypeError(`Invalid task priority: '`+n.signal.priority+`'`))}if(n.priority!==void 0&&(n.priority===null||!e.includes(n.priority)))return Promise.reject(TypeError(`Invalid task priority: '`+n.priority+`'`));if(n.delay===void 0&&(n.delay=0),n.delay=Number(n.delay),n.delay<0)return Promise.reject(TypeError(`'delay' must be a positive number.`));var i={callback:t,options:n,resolve:null,reject:null,hostCallback:null,abortCallback:null,onTaskCompleted:function(){this.options.signal&&this.abortCallback&&(this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null)},onTaskAborted:function(){this.hostCallback&&=(this.hostCallback.cancel(),null),this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null,this.reject(this.options.signal.reason)},isAborted:function(){return this.options.signal&&this.options.signal.aborted},isContinuation:r},a=new Promise((e,t)=>{i.resolve=e,i.reject=t});return this._(i),a}_(e){var t=e.options.signal;if(t){if(t.aborted)return void e.reject(t.reason);e.abortCallback=()=>{e.onTaskAborted()},t.addEventListener(`abort`,e.abortCallback)}e.options.delay>0?e.hostCallback=new r(()=>{e.hostCallback=null,this.F(e)},null,e.options.delay):(this.G(e),this.J())}F(e){this.G(e),this.U&&=(this.U.cancel(),null),this.K()}L(e){var t=this.W.get(e);if(t===void 0)throw Error(`Attempting to change priority on an unregistered signal`);if(t!==e.priority){for(var n=0;n<2;n++)this.S[e.priority][n].merge(this.S[t][n],t=>t.options.signal===e);this.W.set(e,e.priority)}}K(){this.U=null,this.V(),this.J()}J(){var{priority:e}=this.X();e!=null&&(e!==`background`&&this.U&&this.U.isIdleCallback()&&(this.U.cancel(),this.U=null),this.U||=new r(()=>{this.K()},e,0))}G(t){var n;if(!e.includes(n=t.options.priority?t.options.priority:t.options.signal&&t.options.signal.priority?t.options.signal.priority:`user-visible`))throw TypeError(`Invalid task priority: `+n);if(t.options.signal&&t.options.signal.priority){var r=t.options.signal;this.W.has(r)||(r.addEventListener(`prioritychange`,()=>{this.L(r)}),this.W.set(r,r.priority))}this.S[n][+!t.isContinuation].push(t)}V(){var e=null;do{var{priority:t,type:n}=this.X();if(t==null)return;e=this.S[t][n].takeNextTask()}while(e.isAborted());try{var r=e.callback();e.resolve(r)}catch(t){e.reject(t)}finally{e.onTaskCompleted()}}X(){for(var t=0;t<e.length;t++)for(var n=e[t],r=0;r<2;r++)if(!this.S[n][r].isEmpty())return{priority:n,type:r};return{priority:null,type:0}}},self.TaskController=s,self.TaskPriorityChangeEvent=o):self.scheduler.yield||(self.scheduler.yield=function(){return self.scheduler.postTask(()=>{},{priority:`user-blocking`})})})();var Z=e(i(),1),ts=e(c(),1),Q=l(),ns=null,rs=!1,is=!1;function as(e){return e instanceof Error&&e.message?e.message:String(e)}function os(e){let t=as(e);if(t===ns){rs=!0,is=!0;return}ns=t,rs=!1,is=!1}function ss(){return rs}function cs(){rs=!1,ns=null}function ls(){let e=is;return is=!1,e}var $=r(),us=`open-knowledge:doc-panel-tab`,ds=null;function fs(){return typeof window>`u`?new EventTarget:window}function ps(){let e=ds;return ds=null,e}var ms=null,hs=null;function gs(){ms=null,hs?.(),hs=null}function _s(e){let t=null,n=null,r=null,i=()=>{typeof cancelAnimationFrame==`function`&&(t!==null&&cancelAnimationFrame(t),n!==null&&cancelAnimationFrame(n)),r!==null&&clearTimeout(r),hs===i&&(hs=null)},a=()=>{ms===e&&(ms=null),i()};return typeof requestAnimationFrame==`function`?(t=requestAnimationFrame(()=>{t=null,n=requestAnimationFrame(()=>{n=null,a()})}),r=setTimeout(a,250)):r=setTimeout(a,0),i}function vs(e){return typeof window>`u`||e===window}function ys(e){if(ms?.tab!==e)return null;let{request:t}=ms;return gs(),t}function bs(e,t={},n=fs()){if(vs(n)&&(ds=e,gs(),t.scope!==void 0||t.focus!==void 0)){let n={tab:e,request:t};ms=n,hs=_s(n)}n.dispatchEvent(new CustomEvent(us,{detail:{tab:e,...t}}))}function xs(e,t=fs()){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n?.tab&&e(n.tab,{scope:n.scope,focus:n.focus})};return t.addEventListener(us,n),()=>t.removeEventListener(us,n)}async function Ss(e,t){let n=await fetch(e,{...t,headers:{"content-type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok){let e=Ke.safeParse(r);throw Error(e.success?e.data.title??e.data.detail:`comments request failed (${n.status})`)}return r}function Cs(e){return Ss(`/api/comment`,{method:`POST`,body:JSON.stringify(e)})}function ws(e,t){let n=e.safeParse(t);if(!n.success)throw Error(`The server returned a response this build cannot read.`);return n.data}function Ts(e){let t=tt.safeParse(e);if(!t.success)throw Error(`The server returned a comment thread this build cannot read.`);return t.data}function Es(e){let t=[];for(let n of e){let e=tt.safeParse(n);e.success?t.push(e.data):console.warn(`[comments] skipped a thread this build cannot read`,e.error.issues)}return t}async function Ds(e){let{threads:t}=await Ss(e===void 0?`/api/comments`:`/api/comments?doc=${encodeURIComponent(e)}`);return Es(t)}function Os(e){return Ss(`/api/comments`,{method:`POST`,body:JSON.stringify(e)}).then(Ts)}function ks(e,t){return Cs({action:`edit`,id:e,body:t}).then(Ts)}function As(e){return Cs({action:`reopen`,id:e}).then(Ts)}function js(e,t){return Cs({action:`replace`,id:e,...t}).then(Ts)}function Ms(e){return Cs({action:`queue`,id:e}).then(e=>ws(Je,e))}function Ns(e){return Cs({action:`unqueue`,id:e}).then(Ts)}function Ps(e){return Ss(`/api/comment?id=${encodeURIComponent(e)}`,{method:`DELETE`}).then(e=>ws(Ze,e))}function Fs(e){return Cs({action:`dispatch-prepare-batch`,ids:e}).then(e=>ws(Ye,e))}function Is(e){return Cs({action:`dispatch-complete-batch`,ids:e}).then(e=>ws(nt,e))}var Ls=`open-knowledge:comments-scope`,Rs=typeof window>`u`?new EventTarget:window,zs=null;function Bs(){let e=zs;return zs=null,e}function Vs(e){let t=t=>{zs=null,e(t.detail)};return Rs.addEventListener(Ls,t),()=>Rs.removeEventListener(Ls,t)}function Hs(e,t){t!==void 0&&typeof window<`u`&&ot({kind:`reveal-comments`,docName:t,scope:e===`project`?`queue`:`doc`},window)||(zs=e,bs(`comments`),Rs.dispatchEvent(new CustomEvent(Ls,{detail:e})))}function Us(e){Hs(`project`,e)}var Ws=Object.freeze([]),Gs=Object.freeze([]),Ks=new Map,qs=[],Js=new Set,Ys=new Set,Xs=!1,Zs=new Set,Qs=0,$s=0;function ec(){for(let e of Js)e()}function tc(){Qs+=1,ec()}function nc(){$s+=1,ec()}function rc(e){return{id:e.threadId,docName:e.docName,target:e.target,anchor:e.anchor===null?null:{quote:e.anchor.exact,prefix:e.anchor.prefix,suffix:e.anchor.suffix,start:e.anchor.start,end:e.anchor.end},status:e.state===`anchored`?`open`:e.state,body:e.latestComment,createdAt:e.createdAt,updatedAt:e.updatedAt??e.createdAt,queued:e.queued}}async function ic(){return(await Ds()).map(rc).sort((e,t)=>t.createdAt-e.createdAt)}async function ac(e){e!==void 0&&Ys.add(e);let t=await ic();qs=t,Xs=!0;for(let e of Ys)Ks.set(e,t.filter(t=>t.docName===e));tc(),oc(t)}function oc(e){Zc!==null&&(e.some(e=>e.id===Zc&&e.status===`open`)||ul(null))}var sc=!1;function cc(){sc||typeof window>`u`||(sc=!0,Ue(e=>{e.includes(`comments`)&&ac().catch(()=>void 0)}))}function lc(e){cc(),!Ys.has(e)&&(Ys.add(e),ac(e).catch(()=>{Ys.delete(e)}))}function uc(){cc(),!Xs&&(Xs=!0,ac().catch(()=>{Xs=!1}))}function dc(e){return lc(e),Ks.get(e)??Ws}function fc(e){return Js.add(e),()=>{Js.delete(e)}}function pc(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=()=>dc(e),t[0]=e,t[1]=n),(0,Z.useSyncExternalStore)(fc,n,mc)}function mc(){return Ws}function hc(){return uc(),qs}function gc(){return(0,Z.useSyncExternalStore)(fc,hc,_c)}function _c(){return Ws}function vc(e){for(let t of Ks.values()){let n=t.find(t=>t.id===e);if(n)return n}return qs.find(t=>t.id===e)??null}function yc(e){Os({docName:e.docName,quote:e.quote,prefix:e.prefix,suffix:e.suffix,body:e.body,queue:!0}).then(t=>{if(ac(e.docName).catch(()=>void 0),e.onCreated!==void 0){e.onCreated(t.threadId);return}Hs(`doc`,e.docName),fl()}).catch(e=>{z.error(e instanceof Error&&e.message?Y._({id:`q3W2nd`,values:{0:e.message}}):Y._({id:`SRBk2G`}))})}function bc(e){Os({docName:e.docName,propertyKey:e.propertyKey,propertyPath:e.propertyPath,quote:e.quote,body:e.body,queue:!0}).then(()=>{ac(e.docName).catch(()=>void 0),Hs(`doc`,e.docName),fl()}).catch(e=>{z.error(e instanceof Error&&e.message?Y._({id:`q3W2nd`,values:{0:e.message}}):Y._({id:`SRBk2G`}))})}function xc(e,t,n){e.then(()=>{ac(t).catch(()=>void 0)},e=>{z.error(e instanceof Error&&e.message?`${n} ${e.message}`:n),ac(t).catch(()=>void 0)})}function Sc(e,t){let n=vc(e)?.docName;xc(ks(e,t),n,Y._({id:`kzpkcn`}))}function Cc(e){let t=vc(e)?.docName;Ic(e),xc(As(e),t,Y._({id:`lISYEX`}))}function wc(e){let t=vc(e)?.docName;xc(Ps(e),t,Y._({id:`IxHMdF`}))}function Tc(e,t,n){let r=vc(e)?.docName;xc(js(e,{quote:t,prefix:n?.prefix,suffix:n?.suffix}),r,Y._({id:`mlvM8g`}))}var Ec=Gs,Dc=-1,Oc=Gs,kc=-1,Ac=-1;function jc(){if(uc(),Dc!==Qs){let e=qs.filter(e=>e.queued&&e.status!==`resolved`).sort((e,t)=>e.createdAt-t.createdAt).map(e=>e.id);Ec=e.length===0?Gs:e,Dc=Qs}return Ec}function Mc(){let e=jc();if(kc!==Qs||Ac!==$s){let t=e.filter(e=>!Zs.has(e));Oc=t.length===0?Gs:t,kc=Qs,Ac=$s}return Oc}function Nc(){return(0,Z.useSyncExternalStore)(fc,Mc,Pc)}function Pc(){return Gs}function Fc(e){return Mc().filter(t=>vc(t)?.docName===e)}function Ic(e){if(!Zs.has(e))return;let t=new Set(Zs);t.delete(e),Zs=t,nc()}function Lc(e){let t=vc(e)?.docName;Ic(e),xc(Ms(e),t,Y._({id:`S-7ej_`}))}function Rc(e){let t=vc(e)?.docName;xc(Ns(e),t,Y._({id:`PTUuoc`}))}function zc(e){Mc().includes(e)?Rc(e):Lc(e)}function Bc(e,t){let n=new Set(Mc()),r=e.filter(e=>n.has(e)!==t);if(r.length!==0){if(t&&Zs.size>0){let e=new Set(Zs);for(let t of r)e.delete(t);Zs=e,nc()}Promise.all(r.map(e=>(t?Ms(e):Ns(e)).then(()=>!0,()=>!1))).then(e=>{let t=e.filter(e=>!e).length;t>0&&z.error(Y._({id:`wqD3pI`,values:{0:r.length,failed:t}})),ac().catch(()=>void 0)})}}var Vc=!1;async function Hc({compose:e,threadIds:t,resolve:n=!0}){let r=t??Mc();if(r.length===0||Vc)return[];Vc=!0;try{return await Uc(r,e,n)}finally{Vc=!1}}async function Uc(e,t,n){let r;try{r=await Fs(e)}catch(e){return z.error(e instanceof Error&&e.message?Y._({id:`cVKnqL`,values:{0:e.message}}):Y._({id:`7FA2iI`})),[]}tc();let i=r.results.flatMap(e=>e.ok?[{threadId:e.threadId,payload:e.payload}]:[]);if(i.length===0)return await ac().catch(()=>void 0),[];let a=!1;try{a=await t(i)}catch(e){console.warn(`[comments] dispatch compose failed; leaving threads queued`,e),a=!1}let o=a?i.map(e=>e.threadId):[];return o.length>0&&n&&await Is(o).catch(()=>{z.error(Y._({id:`JyM0gO`}))}),await ac().catch(()=>void 0),o}var Wc=`open-knowledge:comment-focus-thread`,Gc=`open-knowledge:comment-open-thread`,Kc=`open-knowledge:comment-start`,qc=`open-knowledge:comment-posted`,Jc=typeof window>`u`?new EventTarget:window;function Yc(e){Jc.dispatchEvent(new CustomEvent(Wc,{detail:e}))}function Xc(e){let t=t=>e(t.detail);return Jc.addEventListener(Wc,t),()=>Jc.removeEventListener(Wc,t)}var Zc=null,Qc=null,$c=null,el=new Set;function tl(){let e=Qc??Zc;if(e!==$c){$c=e;for(let e of el)e()}}function nl(){return $c}function rl(e){Qc=e,tl()}function il(e){Qc===e&&(Qc=null,tl())}function al(e){return el.add(e),()=>{el.delete(e)}}function ol(){return(0,Z.useSyncExternalStore)(cl,ll,sl)}function sl(){return null}function cl(e){return dl(()=>e())}function ll(){return Zc}function ul(e){Zc=e,tl(),e!==null&&bs(`comments`),Jc.dispatchEvent(new CustomEvent(Gc,{detail:e}))}function dl(e){let t=t=>e(t.detail);return Jc.addEventListener(Gc,t),()=>Jc.removeEventListener(Gc,t)}function fl(){Jc.dispatchEvent(new CustomEvent(qc))}function pl(e){let t=()=>e();return Jc.addEventListener(qc,t),()=>Jc.removeEventListener(qc,t)}function ml(){Jc.dispatchEvent(new CustomEvent(Kc))}function hl(e){let t=()=>e();return Jc.addEventListener(Kc,t),()=>Jc.removeEventListener(Kc,t)}var gl=ft(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),_l=ft(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),vl=ft(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),yl=ft(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),bl=ft(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),xl=ft(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Sl=ft(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Cl=ft(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),wl=ft(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Tl=ft(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),El=ft(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Dl=ft(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Ol=ft(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),kl=ft(`file-image`,[[`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`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),Al=ft(`file-up`,[[`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:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),jl=ft(`file`,[[`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`}]]),Ml=ft(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Nl=ft(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),Pl=ft(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),Fl=ft(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),Il=ft(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),Ll=ft(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Rl=ft(`layout-panel-top`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}]]),zl=ft(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Bl=ft(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),Vl=[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]],Hl=ft(`link-2`,Vl),Ul=ft(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),Wl=ft(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),Gl=ft(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Kl=ft(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),ql=ft(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),Jl=ft(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),Yl=ft(`pen-tool`,[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`,key:`nt11vn`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`,key:`15qc1e`}],[`path`,{d:`m2.3 2.3 7.286 7.286`,key:`1wuzzi`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]),Xl=ft(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),Zl=ft(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),Ql=ft(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),$l=ft(`sigma`,[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]),eu=ft(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),tu=ft(`square-play`,[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}]]),nu=ft(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),ru=ft(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),iu=ft(`text-align-center`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]]),au=ft(`text-align-end`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]]),ou=ft(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),su=ft(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),cu=ft(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),lu=ft(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),uu=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(void 0,{granularity:`grapheme`}):null})();function du(e){return e>=56320&&e<=57343}function fu(e){return e>=55296&&e<=56319}function pu(e,t){if(uu){let n=uu.segment(e).containing(t);return n===void 0?t:n.index}return du(e.charCodeAt(t))&&fu(e.charCodeAt(t-1))?t-1:t}function mu(e,t){if(uu){let n=uu.segment(e).containing(t);return n===void 0||n.index===t?t:n.index+n.segment.length}return du(e.charCodeAt(t))&&fu(e.charCodeAt(t-1))?t+1:t}function hu(e,t){return e.length<=t?e:t<=0?``:e.slice(0,pu(e,t))}function gu(e,t){return e.length<=t?e:t<=0?``:e.slice(mu(e,e.length-t))}var _u=new Map,vu=new Set;function yu(){for(let e of vu)e()}function bu(e,t){_u.set(e,t),yu()}function xu(e,t){_u.get(e)===t&&(_u.delete(e),yu())}function Su(e){return _u.get(e)??null}function Cu(e){let t=_u.get(e);if(!t||t.isDestroyed)return null;let n=mr(t)?.dom;return n?.isConnected&&n.getClientRects().length>0?t:null}function wu(e){return vu.add(e),()=>vu.delete(e)}function Tu(e,t){let n=e.attrs[t];return typeof n==`string`?n:``}function Eu(e,t){let n=e.attrs.props;if(typeof n!=`object`||!n)return``;let r=n[t];return typeof r==`string`?r:``}var Du=[`children`,`chart`,`formula`,`alt`,`name`,`alias`,`target`];function Ou(e){for(let t of Du){let n=Eu(e,t);if(n.length>0)return n}return Tu(e,`sourceRaw`)}function ku(e){switch(e.type.name){case`wikiLink`:return Tu(e,`alias`)||Tu(e,`target`);case`wikiLinkEmbed`:return Tu(e,`target`);case`tag`:return`#${Tu(e,`value`)}`;case`mathInline`:return Tu(e,`formula`);case`image`:case`imageReference`:return Tu(e,`alt`);case`footnoteReference`:return Tu(e,`label`)||Tu(e,`identifier`);case`jsxComponent`:case`jsxInline`:return e.content.size===0?Ou(e):``;default:return``}}function Au(e,t,n,r=`
|
|
3
3
|
`,{inlineOnly:i=!1}={}){let a=``,o=!0;return e.nodesBetween(t,n,(e,s)=>{let c=e.isText?(e.text??``).slice(Math.max(t,s)-s,n-s):i&&e.isBlock?``:ku(e);return e.isBlock&&(e.isTextblock||c.length>0)&&r&&(o?o=!1:a+=r),a+=c,!0},0),a}function ju(e,t){if(!t)return{kind:`absent`};if(t.getClientRects().length===0)return{kind:`unmeasurable`};let n=e.getBoundingClientRect().top;return{kind:`measured`,contentPos:t.getBoundingClientRect().top-n+e.scrollTop}}function Mu(e,t,n){if(t===null)return e;switch(n.kind){case`measured`:return n.contentPos+t;case`absent`:return e;case`unmeasurable`:return null;default:return Ru(n)}}var Nu=`[contenteditable]`;function Pu(e){let t=e.getBoundingClientRect().top,{scrollTop:n}=e,r=null;for(let i of Array.from(e.querySelectorAll(Nu))){if(i.parentElement?.closest(Nu)||i.getClientRects().length===0)continue;let e=i.getBoundingClientRect().bottom-t+n;(r===null||e>r)&&(r=e)}return r}function Fu(e,t,n){return t===null?e:Math.min(e,Math.max(0,t-n))}function Iu(e,t,n){return(t??n)>e}function Lu(e){switch(e.kind){case`measured`:case`absent`:return!0;case`unmeasurable`:return!1;default:return Ru(e)}}function Ru(e){throw Error(`Unhandled AnchorMeasurement variant: ${JSON.stringify(e)}`)}function zu(e,t){return Math.abs(e-t)<=1}function Bu(e,t){return t-e>1}var Vu=1e4;function Hu(e,t,n){let r=t-n;return r<=0?0:Math.max(0,Math.min(1,e/r))}var Uu=new Map;function Wu(e,t){if(Uu.delete(e),Uu.set(e,t),Uu.size>256){let e=Uu.keys().next().value;e!==void 0&&Uu.delete(e)}}function Gu(e){return Uu.get(e)}var Ku=`data-ok-body-anchor`;function qu(e){let t=e.anchor??e.container.querySelector(`[data-ok-body-anchor]`),n=ju(e.container,t),r=n.kind===`measured`?n.contentPos:0;Wu(e.docName,{offset:e.targetScrollTop-r,mode:e.mode,fraction:Hu(e.targetScrollTop,e.container.scrollHeight,e.container.clientHeight)})}var Ju=new Map,Yu=0;function Xu(e,t){let n=Ju.get(e)??{landing:0,navigation:0};n[t]+=1,Ju.set(e,n);let r=Yu,i=!1;return{release(){if(i||(i=!0,r!==Yu))return;let n=Ju.get(e);n&&(n[t]=Math.max(0,n[t]-1),n.landing===0&&n.navigation===0&&Ju.delete(e))}}}function Zu(e){let t=Ju.get(e);return t?t.landing>0?`landing`:t.navigation>0?`navigation`:null:null}function Qu(e){return Zu(e)!==null}var $u=new Map;function ed(e,t){let n=$u.get(e)??new Set;return n.add(t),$u.set(e,n),{release(){let n=$u.get(e);n&&(n.delete(t),n.size===0&&$u.delete(e))}}}var td=600,nd=`ok/scroll-nav/declined`,rd=new Map;function id(e,t){let n=rd.get(e)??new Set;if(rd.delete(e),rd.set(e,n),rd.size>32){let e=rd.keys().next().value;e!==void 0&&rd.delete(e)}return n.has(t)?!1:(n.add(t),!0)}var ad=new Set;function od(e){let t=Xu(e,`navigation`),n=setTimeout(()=>{ad.delete(n),t.release()},td);ad.add(n)}function sd(e,t){let n=$u.get(e),r=n?Array.from(n):[];for(let n of r)if(!n.yieldsToNavigation)return id(e,t)&&X(nd,{docName:e,seam:t,ownerCount:r.length}),!1;rd.delete(e),od(e);for(let e of r)e.supersede();return!0}function cd(e,t,n){return sd(e,t)?(n(),!0):!1}var ld=!1;function ud(e){ld=e}function dd(){return ld}var fd=new Map,pd=null;function md(){return na(`PREWARM_CORRELATION_WINDOW_MS`,5e3)}function hd(){if(pd!==null)return;let e=Math.max(50,Math.floor(md()/2));pd=setTimeout(()=>{pd=null,gd(Date.now()),fd.size>0&&hd()},e)}function gd(e){let t=md();for(let[n,r]of fd)e-r.emittedAt>=t&&(fd.delete(n),X.count(`ok/sidebar/prewarm`,{hit:!1}))}function _d(e,t,n=Date.now()){fd.has(e)&&X.count(`ok/sidebar/prewarm`,{hit:!1}),fd.set(e,{poolEventId:t,emittedAt:n}),hd()}function vd(e,t,n=Date.now()){let r=fd.get(e);return!r||r.poolEventId!==t||n-r.emittedAt>=md()?!1:(fd.delete(e),X(`ok/sidebar/prewarm-clicked`,{docName:e,t:n,poolEventId:t}),X.count(`ok/sidebar/prewarm`,{hit:!0}),!0)}var yd=6e3,bd=6e4;function xd(e,t){let n=e.filter(e=>t-e<bd);return n.push(t),{times:n,escalate:n.length>=2}}function Sd(e,t){return e==null?`hidden`:e.kind===`refused`?`refused`:t?`hidden`:`switch`}var Cd=new Set,wd=null;function Td(){for(let e of Cd)e()}function Ed(e){return wd===e?!0:(wd=e,Td(),!0)}function Dd(){return wd}function Od(e){return Cd.add(e),()=>{Cd.delete(e)}}ke({event:Ae(`ok-branch-switched-clear-failed`),branch:je(),docName:je(),reason:je()});async function kd(e,t){if(e.isMismatchRecycleInFlight()){console.warn(JSON.stringify({event:`ok-branch-switched-deferred-to-mismatch-recycle`,branch:t}));return}let n=[];for(let[r,i]of e.entries)i.kind===`active`&&i.persistence!==null&&n.push(i.persistence.clearData().catch(e=>{let n={event:`ok-branch-switched-clear-failed`,docName:r,branch:t,reason:e instanceof Error?e.message:String(e)};console.warn(JSON.stringify(n))}));await Promise.all(n),e.clearBufferedUpdates(),e.recycleAllEntries()}var Ad=null,jd=null,Md=new Set;function Nd(e,t){return e.runtimeVersion===t.runtimeVersion&&e.protocolVersion===t.protocolVersion}function Pd(e){if(Ad===null||jd===null){Ad=e,jd=e;return}if(Nd(jd,e))return;jd=e;let t={loaded:Ad,current:e,drifted:!Nd(Ad,e)};for(let e of Md)try{e(t)}catch(e){console.warn(`[server-version-store] subscriber threw:`,e)}}function Fd(e){return Md.add(e),()=>{Md.delete(e)}}function Id(e){let t=!1;return()=>{t?e():t=!0}}function Ld(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}async function Rd(e,t=``){let n;try{n=await fetch(`${t}/api/server-info`,{signal:AbortSignal.timeout(5e3)})}catch{return}if(!n.ok)return;let r;try{r=await n.json()}catch{return}let i=Ge.safeParse(r);if(!i.success){console.warn(JSON.stringify({event:`ok-server-info-schema-mismatch`,issues:i.error.issues}));return}if(e.setExpectedServerInstanceId(i.data.serverInstanceId),Ca(i.data.serverInstanceId),Pd({runtimeVersion:i.data.runtimeVersion??null,protocolVersion:i.data.protocolVersion??null}),i.data.currentBranch!==void 0&&e.compareAndUpdateObservedBranch(i.data.currentBranch)&&(kd(e,i.data.currentBranch),Ve(i.data.currentBranch)),i.data.currentDiskAckSVs!==void 0){let t={};for(let[e,n]of Object.entries(i.data.currentDiskAckSVs))try{t[e]=Ld(n)}catch{}e.observeDiskAckBatch(t)}}var zd=`ok-tab-session-restore-recovered`;function Bd(){z(Y._({id:`HdS4Ft`}),{id:zd,description:Y._({id:`AR4s_6`}),duration:1/0})}var Vd=null;function Hd(e){Vd=e}function Ud(e){let t=Vd;return Vd=null,t!==null&&Ji(e,t)}function Wd(e){return[...new Set(e)]}function Gd(e){return{async reconcileLocalRename({renamed:t,renamedFolders:n=[],renamedAssets:r=[],additionalRemovedDocNames:i=[]}){e.captureRenameSnapshots(t);let a=e.getActivePoolDocName(),o=[];for(let{fromDocName:n,toDocName:r}of t)o.push(n),a!==r&&e.hasPooledDocument(r)&&o.push(r);o.push(...i),await Promise.all(Wd(o).map(t=>e.closeAndClear(t))),e.remapTabs({renamed:t,renamedFolders:n,renamedAssets:r})},async reconcileLocalRemoval({tabIdsToClose:t,docNamesToClear:n}){e.closeTabs(t),await Promise.all(Wd(n).map(t=>e.closeAndClear(t)))},async reconcileAuthRename({fromDocName:t,toDocName:n}){let r=e.getActivePoolDocName()===t,i=[{fromDocName:t,toDocName:n}];e.captureRenameSnapshots(i),await Promise.all([e.closeAndClear(t),e.closeAndClear(n)]),r&&e.openAndActivate(n),e.remapTabs({renamed:i,renamedFolders:[],renamedAssets:[]});let a=e.remapActiveTargetForRename(t,n);(r||a)&&e.navigateToDocument(n)},async reconcileAuthRemoval({docName:t}){let n=e.getActivePoolDocName()===t;await e.closeAndClear(t),e.removeDocumentTab(t),e.clearActiveTargetForRemoval(t),n&&e.showDocumentDeletedState?.(t)!==!0&&e.navigateHome()}}}var Kd=new Map;function qd(e){return Kd.get(e)}function Jd(e,t){Kd.set(e,t)}function Yd(e){Kd.delete(e)}var Xd=`open-knowledge-app`,Zd=new Map,Qd=new Set,$d=1024,ef=1024;function tf(){return wa.getTracer(Xd)}function nf(e,t,n){if(Qd.has(e))return null;let r=Zd.get(e);if(r)return r;if(Zd.size>=ef){let e=Zd.keys().next().value;if(e!==void 0){let t=Zd.get(e);Zd.delete(e);try{t?.span.end()}catch(e){console.warn(`[otel-spans] eviction span.end failed:`,e instanceof Error?e:String(e))}}}let i={span:tf().startSpan(`ok.cold-mount`,{attributes:{"mount.id":e,...t},startTime:n}),startTimeMs:n};return Zd.set(e,i),i}function rf(e,t,n,r,i){try{let a=nf(e,n,r),o=a?wa.setSpan(Ea.active(),a.span):Ea.active();tf().startSpan(t,{attributes:{"mount.id":e,...n},startTime:r},o).end(i??Date.now())}catch(e){console.warn(`[otel-spans] emitColdMountChild failed:`,e instanceof Error?e:String(e))}}function af(e,t){try{let n=Zd.get(e);if(n&&(Zd.delete(e),n.span.end(t??Date.now())),!Qd.has(e)){if(Qd.size>=$d){let e=Qd.values().next().value;e!==void 0&&Qd.delete(e)}Qd.add(e)}}catch(e){console.warn(`[otel-spans] finalizeColdMountSpan failed:`,e instanceof Error?e:String(e))}}var of=class extends Error{docName;constructor(e){super(`Mount aborted for "${e}"`),this.name=`MountAbortError`,this.docName=e}};function sf(){return na(`MOUNT_STALLED_THRESHOLD_MS`,1e4)}function cf(e){e.stalledHandle!==null&&(clearTimeout(e.stalledHandle),e.stalledHandle=null)}function lf(e,t,n){if(e.stalledMarkEmitted)return;e.stalledMarkEmitted=!0;let r=n-e.createdAt;X(`ok/mount/stalled`,{docName:t,mountId:e.mountId,elapsedMs:r})}var uf=new Map,df=new Set;function ff(e){df.add(e);for(let[t,n]of uf)if(n.stalledMarkEmitted&&!n.settled)try{e(t,n.mountId)}catch{}return()=>{df.delete(e)}}function pf(e,t){for(let n of df)try{n(e,t.mountId)}catch{}}var mf=!1;function hf(){typeof document>`u`||document.visibilityState===`visible`&&vf(Date.now())}function gf(){mf||typeof document>`u`||typeof document.addEventListener==`function`&&(document.addEventListener(`visibilitychange`,hf),mf=!0)}function _f(){mf&&(typeof document>`u`||typeof document.removeEventListener==`function`&&(document.removeEventListener(`visibilitychange`,hf),mf=!1))}function vf(e){let t=sf();for(let[n,r]of uf)r.settled||r.stalledMarkEmitted||e-r.createdAt<t||(lf(r,n,e),pf(n,r))}function yf(e){let{docName:t,mountId:n,construct:r,sizeStats:i}=e,a=uf.get(t);if(a)return a.promise;let o=new AbortController,s=Date.now(),c=()=>{},l=()=>{},u=new Promise((e,t)=>{c=e,l=t}),d={promise:u,rejectFn:l,controller:o,mountId:n,createdAt:s,settled:!1,resolved:!1,preMountEditor:null,stalledHandle:null,stalledMarkEmitted:!1};return d.stalledHandle=setTimeout(()=>{d.settled||(lf(d,t,Date.now()),pf(t,d))},sf()),o.signal.addEventListener(`abort`,()=>{d.settled||(d.settled=!0,cf(d),d.preMountEditor&&=(Cf(t,d.preMountEditor,`aborted`),null),uf.delete(t),uf.size===0&&_f(),X(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`aborted`}),l(new of(t)),af(d.mountId))}),uf.set(t,d),gf(),X(`ok/mount/create`,{docName:t,mountId:d.mountId}),wf({docName:t,construct:r,sizeStats:i,entry:d,resolveFn:c,rejectFn:l}).catch(e=>{if(d.preMountEditor&&=(Cf(t,d.preMountEditor,`backstop`),null),d.settled){X(`ok/mount/post-settle-throw`,{docName:t,mountId:d.mountId,message:e instanceof Error?e.message:String(e)});return}d.settled=!0,cf(d);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`unhandled-body-throw`,message:n.message}),l(n),af(d.mountId)}),u}function bf(e){return uf.get(e)?.resolved===!0}function xf(e){return uf.get(e)?.controller??null}function Sf(e){let t=uf.get(e);t&&(t.settled=!0,cf(t),t.preMountEditor&&=(Cf(e,t.preMountEditor,`aborted`),null),uf.delete(e),uf.size===0&&_f(),X(`ok/mount/invalidate`,{docName:e,mountId:t.mountId}),af(t.mountId),t.controller.abort())}function Cf(e,t,n){let r=Tf(t);try{t.destroy()}catch(t){X(`ok/mount/destroy-failed`,{docName:e,stage:n,message:t instanceof Error?t.message:String(t)})}r&&(r.restore=void 0)}async function wf(e){let{docName:t,construct:n,sizeStats:r,entry:i,resolveFn:a,rejectFn:o}=e,s=document.createElement(`div`);if(lp(t)!==void 0){let e=Kf({docName:t,container:s,factory:()=>{throw Error(`mount-promise: V2 cache contract violation — factory invoked on HIT for "${t}"`)}});i.settled=!0,i.resolved=!0,cf(i),a(e);return}if(await scheduler.yield(),i.controller.signal.aborted)return;let c=null;try{c=n()}catch(e){i.settled=!0,cf(i);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`construct-failed`,message:n.message}),o(n),af(i.mountId);return}if(i.preMountEditor=c.editor,await scheduler.yield(),i.controller.signal.aborted){i.preMountEditor=null;return}try{c.editor.mount(s)}catch(e){Cf(t,c.editor,`mount-failed`),i.preMountEditor=null,i.settled=!0,cf(i);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`mount-failed`,message:n.message}),o(n),af(i.mountId);return}let l;try{l=Kf({docName:t,container:s,sizeStats:r,factory:()=>c})}catch(e){Cf(t,c.editor,`v2-register-failed`),i.preMountEditor=null,i.settled=!0,cf(i);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`v2-register-failed`,message:n.message}),o(n),af(i.mountId);return}i.preMountEditor=null,i.settled=!0,i.resolved=!0,cf(i);let u=Date.now()-i.createdAt;X(`ok/mount/resolve`,{docName:t,mountId:i.mountId,elapsedMs:u}),X.histogram(`ok/mount/resolve-elapsed-ms`,{docName:t,mountId:i.mountId},u),a(l);let d=Date.now();rf(i.mountId,`ok.mount-promise`,{"doc.name":t,elapsed_ms:u},i.createdAt,d),af(i.mountId,d)}function Tf(e){try{let t=e.state;return Bt.getState(t)?.undoManager??null}catch(e){return X(`ok/cache/undo-manager-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}var Ef=na(`MAX_CACHE`,10),Df=na(`VIEW_COUNT_CACHE_THRESHOLD`,50),Of=na(`BYTES_CACHE_THRESHOLD`,8e6);function kf(e){return!(e.viewCount>0&&e.viewCount>=Df||e.bytes>Of)}var Af=new Map,jf=new Map,Mf=new Map;function Nf(e,t){if(Mf.size>=Ef){let e=Mf.keys().next().value;e!==void 0&&Mf.delete(e)}Mf.set(e,t),X(`ok/cache/snapshot-stored`,{toDocName:e,htmlBytes:t.html.length,hasScroll:t.scrollTop>0,hasSelection:t.selection!==null})}function Pf(e){return Mf.get(e)??null}function Ff(e){if(!Mf.has(e))return;let t=Mf.get(e)??null;Mf.delete(e),X(`ok/cache/snapshot-consumed`,{docName:e,hit:t!==null,hasScroll:t!==null&&t.scrollTop>0,hasSelection:t!==null&&t.selection!==null})}function If(){if(typeof document>`u`)return null;let e=document.querySelectorAll(Lf);for(let t of e)if(t.getClientRects().length>0)return t;return null}var Lf=`[data-testid="editor-scroll-container"]`;function Rf(e){return e.closest(Lf)}function zf(){try{return If()?.scrollTop??0}catch(e){return X(`ok/cache/snapshot-scroll-read-failed`,{message:e instanceof Error?e.message:String(e)}),0}}function Bf(e){try{let t=e.state.selection;return t instanceof K?{type:`text`,anchor:t.anchor,head:t.head}:t instanceof xe?{type:`node`,from:t.from}:null}catch(e){return X(`ok/cache/snapshot-selection-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}function Vf(e){for(let t of e)try{let e=lp(t.fromDocName);if(e&&!e.editor.isDestroyed){if(e.ytext.length===0){X(`ok/cache/snapshot-skipped-empty`,{fromDocName:t.fromDocName});continue}if(!ie(t.toDocName)){X(`ok/cache/snapshot-skipped-class-change`,{fromDocName:t.fromDocName,toDocName:t.toDocName});continue}Nf(t.toDocName,{html:e.editor.getHTML(),scrollTop:zf(),selection:Bf(e.editor)})}else X(`ok/cache/snapshot-skipped`,{fromDocName:t.fromDocName})}catch(e){X(`ok/cache/snapshot-capture-failed`,{fromDocName:t.fromDocName,message:e instanceof Error?e.message:String(e)})}}var Hf=[],Uf=[],Wf=new Set;function Gf(){if(typeof document>`u`)return null;let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-parking`,``),e.style.display=`none`,e.style.position=`absolute`,e.style.left=`-99999px`,e}function Kf(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!kf(i)){let e=r(n);return X(`ok/cache/miss`,{docName:t,mountId:qd(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`}),{editor:e.editor,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null,__uncached:!0}}let a=Af.get(t);if(a){if(X(`ok/cache/reparent-start`,{docName:t,mountId:qd(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),tp(a,n),a.activeMountKey=t,rp(Hf,t),Zu(t)!==`landing`&&(n.scrollTop=a.scrollTop),a.hadFocus)try{a.editor.commands.focus()}catch{}return X(`ok/cache/reparent-end`,{docName:t,mountId:qd(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),X(`ok/cache/hit`,{docName:t,mountId:qd(t),kind:`tiptap`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:qd(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`tiptap`}),a}for(;Af.size>=Ef;){let e=ip(Hf,t);if(!e)break;Jf(e)}let o=r(n),s={editor:o.editor,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null};return Af.set(t,s),rp(Hf,t),X(`ok/cache/miss`,{docName:t,mountId:qd(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`tiptap`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:qd(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`tiptap`}),s}function qf(e){let t=e.activeMountKey;if(e.__uncached){t&&Sf(t);let n=Tf(e.editor);try{e.editor.destroy()}catch(e){X(`ok/cache/park-destroy-failed`,{docName:t??``,kind:`tiptap`,stage:`editor`,message:e instanceof Error?e.message:String(e)})}n&&(n.restore=void 0),e.activeMountKey=null;return}let n=$f(e.editor);if(n){e.hadFocus=ep(n.dom),e.scrollTop=(n.scrollDOM??n.dom.parentElement??n.dom).scrollTop??0;let t=n.dom.parentElement;t&&t.removeChild(n.dom),e.parkingNode||=Gf(),e.parkingNode&&e.parkingNode.appendChild(n.dom)}e.activeMountKey=null}function Jf(e){Sf(e);let t=Af.get(e);if(!t)return!1;let n=Tf(t.editor);try{t.editor.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`editor`,message:t instanceof Error?t.message:String(t)})}n&&(n.restore=void 0);try{t.provider.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}Af.delete(e);let r=Hf.indexOf(e);return r!==-1&&Hf.splice(r,1),X(`ok/cache/evict`,{docName:e,kind:`tiptap`}),!0}function Yf(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!kf(i)){let e=r(n);return X(`ok/cache/miss`,{docName:t,mountId:qd(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`,kind:`cm`}),{view:e.view,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,undoManager:e.undoManager,themeCompartment:e.themeCompartment,wordWrapCompartment:e.wordWrapCompartment,placeholderCompartment:e.placeholderCompartment,lintCompartment:e.lintCompartment,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null,__uncached:!0}}let a=jf.get(t);if(a){if(X(`ok/cache/reparent-start`,{docName:t,mountId:qd(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),np(a,n),a.activeMountKey=t,rp(Uf,t),Zu(t)!==`landing`&&(n.scrollTop=a.scrollTop),a.hadFocus)try{a.view.focus()}catch{}return X(`ok/cache/reparent-end`,{docName:t,mountId:qd(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),X(`ok/cache/hit`,{docName:t,mountId:qd(t),kind:`cm`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:qd(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`cm`}),a}for(;jf.size>=Ef;){let e=ip(Uf,t);if(!e)break;Qf(e)}let o=r(n),s={view:o.view,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,undoManager:o.undoManager,themeCompartment:o.themeCompartment,wordWrapCompartment:o.wordWrapCompartment,placeholderCompartment:o.placeholderCompartment,lintCompartment:o.lintCompartment,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null};return jf.set(t,s),rp(Uf,t),X(`ok/cache/miss`,{docName:t,mountId:qd(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`cm`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:qd(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`cm`}),s}function Xf(e){if(e.__uncached){try{e.view.destroy()}catch(t){X(`ok/cache/park-destroy-failed`,{docName:e.activeMountKey??``,kind:`cm`,stage:`view`,message:t instanceof Error?t.message:String(t)})}Zf(e,e.activeMountKey??``,`park-destroy-failed`),e.activeMountKey=null;return}let t=e.view.dom;e.hadFocus=ep(t),e.scrollTop=(e.view.scrollDOM??t).scrollTop??0;let n=t.parentElement;n&&n.removeChild(t),e.parkingNode||=Gf(),e.parkingNode&&e.parkingNode.appendChild(t),e.activeMountKey=null}function Zf(e,t,n){let r=e.undoManager;if(r){e.undoManager=void 0;try{r.clear(),r.destroy()}catch(e){X(`ok/cache/${n}`,{docName:t,kind:`cm`,stage:`undo-manager`,message:e instanceof Error?e.message:String(e)})}}}function Qf(e){let t=jf.get(e);if(!t)return!1;rn(e,t.view);try{t.view.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`view`,message:t instanceof Error?t.message:String(t)})}Zf(t,e,`evict-failed`);try{t.provider.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}jf.delete(e);let n=Uf.indexOf(e);return n!==-1&&Uf.splice(n,1),X(`ok/cache/evict`,{docName:e,kind:`cm`}),!0}function $f(e){return e.editorView??null}function ep(e){if(typeof document>`u`)return!1;let t=document.activeElement;return t?t===e?!0:e.contains(t):!1}function tp(e,t){let n=$f(e.editor);if(!n)return;let r=n.dom,i=r.parentElement;i&&i!==t&&i.removeChild(r),r.parentElement!==t&&t.appendChild(r)}function np(e,t){let n=e.view.dom,r=n.parentElement;r&&r!==t&&r.removeChild(n),n.parentElement!==t&&t.appendChild(n)}function rp(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.push(t)}function ip(e,t){for(let n of e)if(n!==t&&!Wf.has(n))return n;X(`ok/cache/evict-fallback-activity-saturated`,{mountingDocName:t,lruLength:e.length,activityMountCount:Wf.size});for(let n of e)if(n!==t)return n;return null}function ap(e){let t=Wf,n=new Set(e);for(let e of t){if(n.has(e))continue;let t=sp(e);if(t)try{t.disconnect(),X(`ok/cache/disconnect`,{docName:e})}catch(t){X(`ok/cache/disconnect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}}for(let e of n){if(t.has(e))continue;let n=sp(e);if(!n)continue;let r=t=>{X(`ok/cache/connect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})};try{let t=n.connect();t&&typeof t.then==`function`?t.then(()=>X(`ok/cache/connect`,{docName:e}),e=>r(e)):X(`ok/cache/connect`,{docName:e})}catch(e){r(e)}}Wf=n}var op=null;function sp(e){let t=Af.get(e);if(t)return t.provider;let n=jf.get(e);if(n)return n.provider;if(op){let t=op.entries.get(e);if(t)return t.provider}return null}function cp(e){op=e;let t=e.onEvict(e=>{Jf(e),Qf(e)});return()=>{t(),op===e&&(op=null)}}function lp(e){return Af.get(e)}var up=`pane-main`;function dp(e){return mp(e)&&!e.includes(`\0doc-tab:`)}function fp(e){return e.startsWith(`\0`)}function pp(e){return typeof e==`string`&&!!e}function mp(e){return typeof e==`string`&&!!e}function hp(e){return typeof e==`number`&&Number.isFinite(e)&&e>0}function gp(e,t=new Set){if(!Array.isArray(e))return[];let n=new Set,r=[];for(let i of e)!dp(i)||n.has(i)||!fp(i)&&t.has(i)||(n.add(i),fp(i)||t.add(i),r.push(i));return r}function _p(e,t){if(!Array.isArray(e))return[];let n=new Set(t),r=new Set,i=[];for(let t of e)!mp(t)||!n.has(t)||r.has(t)||(r.add(t),i.push(t));return i}function vp(e,t){return mp(t)&&e.includes(t)?t:null}function yp(e,t,n){if(!t||!n.has(t))return t;let r=e.indexOf(t);for(let t=r+1;t<e.length;t++)if(!n.has(e[t]))return e[t]??null;for(let t=r-1;t>=0;t--)if(!n.has(e[t]))return e[t]??null;return null}function bp(e,t=new Set){if(!pp(e.id))return null;let n=gp(e.openTabs,t),r=Array.isArray(e.newTabIds)?e.newTabIds.filter(e=>mp(e)&&!n.includes(e)):[],i=vp(n,e.activeTabId),a=mp(e.activeNewTabId)&&r.includes(e.activeNewTabId)?e.activeNewTabId:null,o=i??(a===null?n[0]??null:null),s=o===null?a??r[0]??null:null,c=_p(e.pinnedTabIds,n),l=dp(e.previewTabId)&&n.includes(e.previewTabId)&&!c.includes(e.previewTabId)?e.previewTabId:null;return{id:e.id,openTabs:n,pinnedTabIds:c,activeTabId:o,previewTabId:l,newTabIds:r,activeNewTabId:s,activeTarget:o!==null&&o===i?e.activeTarget??null:null,size:hp(e.size)?e.size:1}}function xp(e){if(e.length===0)return[];let t=e.reduce((e,t)=>e+(hp(t.size)?t.size:0),0);if(t<=0){let t=100/e.length;return e.map(e=>({...e,size:t}))}return e.map(e=>({...e,size:(hp(e.size)?e.size:0)/t*100}))}function Sp(e,t=100){return{id:e,openTabs:[],pinnedTabIds:[],activeTabId:null,previewTabId:null,newTabIds:[],activeNewTabId:null,activeTarget:null,size:t}}function Cp(e=()=>up){let t=Sp(e());return{panes:[t],focusedPaneId:t.id}}function wp(e){let t=e.panes.map(e=>({...e,previewTabId:null,newTabIds:[],activeNewTabId:null,activeTarget:null}));return{panes:t,focusedPaneId:t.some(t=>t.id===e.focusedPaneId)?e.focusedPaneId:t[0]?.id??up}}function Tp(e){let t=Dp(e);return{panes:t.panes.map(({id:e,openTabs:t,pinnedTabIds:n,activeTabId:r,size:i})=>({id:e,openTabs:t,pinnedTabIds:n,activeTabId:r,size:i})),focusedPaneId:t.focusedPaneId}}function Ep(e,t=()=>up){let n=()=>{let e=t();return{panes:[{id:e,openTabs:[],pinnedTabIds:[],activeTabId:null,size:100}],focusedPaneId:e}};if(typeof e!=`object`||!e)return n();let r=e;if(!Array.isArray(r.panes))return n();let i=new Set,a=[];for(let[e,t]of r.panes.entries()){if(typeof t!=`object`||!t)continue;let n=t;!pp(n.id)||i.has(n.id)||(i.add(n.id),a.push({pane:n,id:n.id,visualIndex:e}))}if(a.length===0)return n();let o=pp(r.focusedPaneId)?r.focusedPaneId:null,s=[...a].sort((e,t)=>e.id===o?-1:t.id===o?1:e.visualIndex-t.visualIndex),c=new Set,l=new Map;for(let{pane:e,id:t}of s){let n=gp(e.openTabs,c),r=vp(n,e.activeTabId);l.set(t,{id:t,openTabs:n,pinnedTabIds:_p(e.pinnedTabIds,n),activeTabId:r??n[0]??null,size:hp(e.size)?e.size:1})}let u=a.flatMap(({id:e})=>{let t=l.get(e);return t&&t.openTabs.length>0?[t]:[]});if(u.length===0)return n();let d=xp(u);return{panes:d,focusedPaneId:o&&d.some(e=>e.id===o)?o:d[0].id}}function Dp(e){let t=new Set,n=new Set,r=e.panes.flatMap(e=>{if(!pp(e.id)||t.has(e.id))return[];let r=bp(e,n);return r?(t.add(r.id),[r]):[]});if(r.length===0)return Cp();let i=xp(r);return{panes:i,focusedPaneId:i.some(t=>t.id===e.focusedPaneId)?e.focusedPaneId:i[0].id}}function Op(e){return e.panes.find(t=>t.id===e.focusedPaneId)??e.panes[0]??Sp(up)}function kp(e,t){return e.panes.some(e=>e.id===t)?{...e,focusedPaneId:t}:e}function Ap(e,t){let n=e.panes.find(t=>t.id===e.focusedPaneId);return n?.openTabs.includes(t)||n?.newTabIds.includes(t)?n:e.panes.find(e=>e.openTabs.includes(t)||e.newTabIds.includes(t))??null}function jp(e,t){return dp(t)?Ap(e,t):null}function Mp(e){return e.panes.flatMap(e=>e.openTabs)}function Np(e){let t=new Set(Mp(e));return e.panes.flatMap(e=>e.pinnedTabIds.filter(e=>t.has(e)))}function Pp(e,t,n){return{...e,panes:e.panes.map(e=>e.id===t?n(e):e)}}function Fp(e,t,n,r){let i=e.panes.find(e=>e.id===t);if(!i)return e;let a=new Set(i.openTabs),o=n.filter(e=>a.has(e));for(let e of i.openTabs)o.includes(e)||o.push(e);let s=new Set(i.pinnedTabIds),c=o.indexOf(r),l=c>=0&&c<i.pinnedTabIds.length,u=i.openTabs.includes(r)?o.filter(e=>e===r?l:s.has(e)):i.pinnedTabIds;return Pp(e,t,e=>({...e,openTabs:o,pinnedTabIds:u,previewTabId:e.previewTabId===r?null:e.previewTabId}))}function Ip(e,t){let n=e.newTabIds.indexOf(t);if(n>=0){let r=e.newTabIds.filter(e=>e!==t),i=e.activeNewTabId===t,a=i?r[n]??r[n-1]??null:e.activeNewTabId,o=i&&a===null?e.openTabs[e.openTabs.length-1]??null:e.activeTabId;return{...e,newTabIds:r,activeNewTabId:a,activeTabId:o,activeTarget:a===null&&o===e.activeTabId?e.activeTarget:null}}if(e.openTabs.indexOf(t)<0)return e;let r=new Set([t]),i=yp(e.openTabs,e.activeTabId,r),a=e.activeTabId===t&&i===null?e.activeNewTabId??e.newTabIds[e.newTabIds.length-1]??null:e.activeNewTabId;return{...e,openTabs:e.openTabs.filter(e=>e!==t),pinnedTabIds:e.pinnedTabIds.filter(e=>e!==t),activeTabId:i,activeNewTabId:a,previewTabId:e.previewTabId===t?null:e.previewTabId,activeTarget:a===null&&i===e.activeTabId?e.activeTarget:null}}function Lp(e){let t=e.panes.filter(e=>e.openTabs.length||e.newTabIds.length);if(t.length===0)return Cp(()=>e.focusedPaneId||up);let n=xp(t);return{panes:n,focusedPaneId:n.some(t=>t.id===e.focusedPaneId)?e.focusedPaneId:n[0].id}}function Rp(e,t){let n=e.panes.flatMap(e=>{let n=new Set([...e.openTabs,...e.newTabIds]),r=(t.get(e.id)??[]).filter((e,t,r)=>n.has(e)&&r.indexOf(e)===t);if(r.length===0)return[];let i=new Set(r),a=e.openTabs.filter(e=>i.has(e)),o=e.newTabIds.filter(e=>i.has(e)),s=(e.activeTabId&&i.has(e.activeTabId)?e.activeTabId:null)??(e.activeNewTabId&&i.has(e.activeNewTabId)?e.activeNewTabId:null)??r[0],c=a.includes(s)?s:null,l=o.includes(s)?s:null;return[{...e,openTabs:a,pinnedTabIds:e.pinnedTabIds.filter(e=>i.has(e)),activeTabId:c,previewTabId:e.previewTabId&&i.has(e.previewTabId)?e.previewTabId:null,newTabIds:o,activeNewTabId:l,activeTarget:c===e.activeTabId?e.activeTarget:null}]});if(n.length===0)return Cp(()=>e.focusedPaneId||up);let r=xp(n);return{panes:r,focusedPaneId:r.some(t=>t.id===e.focusedPaneId)?e.focusedPaneId:r[0].id}}function zp(e,t,n){let r=new Set(t),i=Math.max(0,Math.min(n,e.length)),a=0;for(let t=0;t<i;t+=1){let n=e[t];n&&r.has(n)&&(a+=1)}return a}function Bp(e,t,n,r){let i=Ap(e,t),a=e.panes.find(e=>e.id===n);if(!i||!a)return e;let o=i.newTabIds.includes(t);if(i.id===a.id){if(o){let a=i.newTabIds.filter(e=>e!==t),o=Math.max(0,Math.min(r,a.length));return Pp(e,n,e=>({...e,newTabIds:[...a.slice(0,o),t,...a.slice(o)],activeNewTabId:t,activeTabId:null,activeTarget:null}))}let a=i.openTabs.filter(e=>e!==t),s=Math.max(0,Math.min(r,a.length));return Fp(e,n,[...a.slice(0,s),t,...a.slice(s)],t)}let s=i.pinnedTabIds.includes(t),c=Ip(i,t),l=Math.max(0,Math.min(r,o?a.newTabIds.length:a.openTabs.length)),u=o?{...a,newTabIds:[...a.newTabIds.slice(0,l),t,...a.newTabIds.slice(l)],activeNewTabId:t,activeTabId:null,activeTarget:null}:{...a,openTabs:[...a.openTabs.slice(0,l),t,...a.openTabs.slice(l)],pinnedTabIds:s?[...a.pinnedTabIds,t]:a.pinnedTabIds,activeNewTabId:null,activeTabId:t,activeTarget:null},d=e.panes.map(e=>e.id===i.id?c:e.id===a.id?u:e);return kp(Lp({...e,panes:d}),a.id)}function Vp(e,t,n,r,i){let a=Ap(e,t),o=e.panes.find(e=>e.id===n);if(!a||!o)return e;if(a.id===o.id&&a.openTabs.length+a.newTabIds.length===1)return kp(e,a.id);let s=i();if(!pp(s)||e.panes.some(e=>e.id===s))return e;let c=a.pinnedTabIds.includes(t),l=Ip(a,t),u=a.id===o.id?l:o,d=u.size/2,f={...u,size:d},p=a.newTabIds.includes(t),m={...Sp(s,d),openTabs:p?[]:[t],pinnedTabIds:c&&!p?[t]:[],activeTabId:p?null:t,previewTabId:null,newTabIds:p?[t]:[],activeNewTabId:p?t:null},h=e.panes.map(e=>e.id===a.id?l:e),g=h.findIndex(e=>e.id===o.id);if(g<0)return e;h[g]=f;let _=r===`left`?g:g+1,v=[...h.slice(0,_),m,...h.slice(_)];return kp(Lp({...e,panes:v}),s)}function Hp(e,t,n){let r=new Set(n),i=e.panes.find(e=>e.id===t);if(!i||r.size===0)return e;let a=yp(i.openTabs,i.activeTabId,r);return Lp(Pp(e,t,e=>{let t={...e,openTabs:e.openTabs.filter(e=>!r.has(e)),pinnedTabIds:e.pinnedTabIds.filter(e=>!r.has(e)),activeTabId:a,previewTabId:e.previewTabId&&r.has(e.previewTabId)?null:e.previewTabId,activeTarget:a===e.activeTabId?e.activeTarget:null};return e.newTabIds.reduce((e,t)=>r.has(t)?Ip(e,t):e,t)}))}function Up(e,t){let n=new Map,r=new Set;for(let i of e.panes)for(let e of i.openTabs){let a=t(e),o=dp(a)?a:null;n.set(e,o),o&&!fp(o)&&i.pinnedTabIds.includes(e)&&r.add(o)}let i=new Set,a=e.panes.map(e=>{let t=new Map,a=new Set,o=[];for(let r of e.openTabs){let e=n.get(r);!e||a.has(e)||!fp(e)&&i.has(e)||(a.add(e),fp(e)||i.add(e),t.set(r,e),o.push(e))}let s=new Set(e.pinnedTabIds.flatMap(e=>t.get(e)??[])),c=o.filter(e=>fp(e)?s.has(e):r.has(e)),l=e.activeTabId?t.get(e.activeTabId)??null:null,u=e.previewTabId&&t.get(e.previewTabId)===e.previewTabId?e.previewTabId:null;return{...e,openTabs:o,pinnedTabIds:c,activeTabId:l,previewTabId:u&&!c.includes(u)?u:null,activeTarget:l!==null&&l===e.activeTabId?e.activeTarget:null}});return Lp({...e,panes:a})}function Wp(e,t){return Up(e,e=>t(e)?e:null)}function Gp(e){return{workspace:e,openedTabId:null,replacedPreviewTabId:null,consumedNewTabId:null}}function Kp(e,t={openedTabId:null,replacedPreviewTabId:null,consumedNewTabId:null}){return{workspace:Dp(e),...t}}function qp(e,t,n){let r=e.panes.find(e=>e.id===t);return r?r.newTabIds.includes(n)?kp(Pp(e,t,e=>({...e,activeTabId:null,activeNewTabId:n,activeTarget:null})),t):r.openTabs.includes(n)?kp(Pp(e,t,e=>({...e,activeTabId:n,activeNewTabId:null,activeTarget:e.activeTabId===n?e.activeTarget:null})),t):e:e}function Jp(e,t){switch(t.type){case`open-target`:{if(!dp(t.tabId))return Gp(e);let n=e.panes.find(e=>e.id===t.paneId);if(!n)return Gp(e);let r=t.consumeActiveNewTab&&n.activeNewTabId?n.activeNewTabId:null,i=r===null?e:Pp(e,n.id,e=>Ip(e,r)),a=i.panes.find(e=>e.id===t.paneId&&e.openTabs.includes(t.tabId))??Ap(i,t.tabId),o=a!==null&&a.id!==t.paneId&&t.existingTabBehavior===`open-in-pane`&&fp(t.tabId);if(a&&!o)return a.id!==t.paneId&&t.existingTabBehavior===`open-in-pane`?(i=Bp(i,t.tabId,t.paneId,n.openTabs.length),i=Pp(i,t.paneId,e=>({...e,activeTarget:t.target,previewTabId:t.disposition===`permanent`&&e.previewTabId===t.tabId?null:e.previewTabId})),Kp(i,{openedTabId:t.tabId,replacedPreviewTabId:null,consumedNewTabId:r})):(i=Pp(i,a.id,e=>({...e,activeTabId:t.tabId,activeNewTabId:null,activeTarget:t.target,previewTabId:t.disposition===`permanent`&&e.previewTabId===t.tabId?null:e.previewTabId})),i=kp(i,a.id),i=Lp(i),Kp(i,{openedTabId:t.tabId,replacedPreviewTabId:null,consumedNewTabId:r}));let s=i.panes.find(e=>e.id===t.paneId);if(!s)return Gp(e);let c=t.disposition===`preview`?s.previewTabId:null;return i=Pp(i,t.paneId,e=>{let n=c?e.openTabs.indexOf(c):-1,r=c?e.openTabs.filter(e=>e!==c):e.openTabs,i=n<0?[...r,t.tabId]:[...r.slice(0,n),t.tabId,...r.slice(n)];return{...e,openTabs:i,pinnedTabIds:e.pinnedTabIds.filter(e=>e!==c),activeTabId:t.tabId,activeNewTabId:null,activeTarget:t.target,previewTabId:t.disposition===`preview`?t.tabId:e.previewTabId}}),i=kp(i,t.paneId),Kp(i,{openedTabId:t.tabId,replacedPreviewTabId:c,consumedNewTabId:r})}case`activate-tab`:return Kp(qp(e,t.paneId,t.tabId));case`promote-preview`:return Kp(Pp(e,t.paneId,e=>({...e,previewTabId:e.previewTabId===t.tabId?null:e.previewTabId})));case`promote-all-previews`:return Kp({...e,panes:e.panes.map(e=>({...e,previewTabId:null}))});case`open-new-tab`:{if(!mp(t.tabId))return Gp(e);let n=Ap(e,t.tabId);return n?Kp(qp(e,n.id,t.tabId)):e.panes.some(e=>e.id===t.paneId)?Kp(kp(Pp(e,t.paneId,e=>({...e,newTabIds:[...e.newTabIds,t.tabId],activeTabId:null,activeNewTabId:t.tabId,activeTarget:null})),t.paneId)):Gp(e)}case`close-tabs`:return Kp(Hp(e,t.paneId,t.tabIds));case`pin-tab`:return Kp(Pp(e,t.paneId,e=>e.openTabs.includes(t.tabId)?{...e,pinnedTabIds:e.pinnedTabIds.includes(t.tabId)?e.pinnedTabIds:[...e.pinnedTabIds,t.tabId],previewTabId:e.previewTabId===t.tabId?null:e.previewTabId}:e));case`unpin-tab`:return Kp(Pp(e,t.paneId,e=>({...e,pinnedTabIds:e.pinnedTabIds.filter(e=>e!==t.tabId)})));case`reorder-tabs`:return Kp(Fp(e,t.paneId,t.tabIds,t.draggedTabId));case`move-tab`:return Kp(Bp(e,t.tabId,t.paneId,t.index));case`split-tab`:return Kp(Vp(e,t.tabId,t.paneId,t.side,()=>t.newPaneId));case`resize-panes`:return t.sizes.length!==e.panes.length||t.sizes.some(e=>!hp(e))?Gp(e):Kp({...e,panes:e.panes.map((e,n)=>({...e,size:t.sizes[n]??e.size}))});case`remap-tabs`:return Kp(Up(e,t.remap));case`prune-tabs`:return Kp(Wp(e,t.keep));default:return Gp(e)}}function Yp(e,t,n=25){return!pp(t.paneId)||!mp(t.tabId)||n<=0?[...e]:[t,...e.filter(e=>e.tabId!==t.tabId)].slice(0,n)}function Xp(e){return Le.includes(e)}function Zp(){return Bm(Ep(null),null)}var Qp=new Set,$p=`ok-editor-tabs-v1:`,em=`\0folder:`,tm=`\0asset:`,nm=`\0skill-file:`,rm=`\0skill-preview:`,im=/\.(md|mdx)$/i;function am(e){return im.test(e)?e.replace(im,``):null}function om(e,t){let n=am(e);return n===null?!1:t.some(t=>t!==e&&am(t)===n)}function sm(e,t=[]){let n=wm(e);if(n.kind===`asset`&&oe(n.assetPath))return ym(n.assetPath);if(n.kind!==`doc`||om(e,t))return e;let r=e,i=am(r);for(;i!==null&&i.length>0;)r=i,i=am(r);return r}function cm(e,t){return Array.isArray(e)?e.map(e=>typeof e==`string`?sm(e,t):e):e}function lm(e){return e.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e.openTabs;return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]})}function um(e){let t={...e},n=Array.isArray(e.panes)?lm(e.panes):[];return Array.isArray(e.panes)&&(t.panes=e.panes.map(e=>{if(typeof e!=`object`||!e)return e;let t=e;return{...t,openTabs:cm(t.openTabs,n),pinnedTabIds:cm(t.pinnedTabIds,n),activeTabId:typeof t.activeTabId==`string`?sm(t.activeTabId,n):t.activeTabId}})),t}function dm(e){if(typeof e!=`string`||e.length===0||e.includes(`\0doc-tab:`))return!1;let t=e;return t.startsWith(em)?t.length>8:t.startsWith(tm)?t.length>7:t.startsWith(nm)?mm(t)!==null:t.startsWith(rm)?vm(t)!==null:!0}var fm=`:`;function pm(e){let t=e.host===void 0?e.name:`${e.name}${fm}${e.host}`;return`${nm}${e.scope}/${t}/${e.path}`}function mm(e){if(!e.startsWith(nm))return null;let t=e.slice(12).split(`/`);if(t.length<3)return null;let[n,r,...i]=t,a=i.join(`/`);if(!n||!r||!a||!Xp(n))return null;let o=r.indexOf(fm),s=o===-1?r:r.slice(0,o),c=o===-1?void 0:r.slice(o+1);return s?{scope:n,name:s,path:a,...c?{host:c}:{}}:null}function hm(e){return`${rm}${Qi(e)}`}function gm(e,t,n){return t.flavor===`explore`?[]:e.filter(e=>{if(e===n)return!1;let r=wm(e);return r.kind===`skill-preview`&&r.flavor===t.flavor&&r.name===t.name&&r.subtitle===t.subtitle&&r.level===t.level})}function _m(e,t,n,r,i){for(let a of e){let e=wm(a);if(e.kind===`skill-preview`&&e.flavor===t&&e.name===n&&e.subtitle===r&&e.level===i)return a}return null}function vm(e){return e.startsWith(rm)?$i(e.slice(15)):null}function ym(e){return e}function bm(e){return`${em}${e}`}function xm(e){return`${tm}${e}`}function Sm(e,t){let n=Ha(e);if(n){let e=Ia(n);return{baseName:e,extension:``,label:e,prefix:``}}let r=Pe(e);if(r){let e=r.rel?r.rel.split(`/`).pop()??r.rel:Ia(r.name);return{baseName:e,extension:``,label:e,prefix:``}}let i=Me(e);if(i)return{baseName:i.name,extension:``,label:i.name,prefix:``};let a=e.lastIndexOf(`/`),o=a<0?e:e.slice(a+1),s=im.test(t)&&im.test(o)?``:t,c=`${o}${s}`;return a<0?{baseName:o,extension:s,label:c,prefix:``}:{baseName:o,extension:s,label:c,prefix:`${e.slice(0,a)}/`}}function Cm(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return ym(e.docName);case`folder`:return bm(e.folderPath);case`missing`:return ym(e.target);case`asset`:return xm(e.assetPath);case`skill-file`:return pm(e);case`skills`:return null;case`skill-preview`:return hm(e)}}function wm(e){let t=e;if(t.startsWith(em))return{kind:`folder`,folderPath:t.slice(8)};if(t.startsWith(tm))return{kind:`asset`,assetPath:t.slice(7)};let n=vm(t);if(n)return{kind:`skill-preview`,...n};let r=mm(t);return r?{kind:`skill-file`,...r}:{kind:`doc`,docName:t}}function Tm(e){let t=wm(e);return t.kind===`doc`?t.docName:null}function Em(e,t){return e===`suppressed`?!1:e===`applied`||t>0}function Dm(e){return Fe(e)!=null||Ie(e)?.kind===`skill`||Pe(e)!=null}var Om=/(?:^|\/)\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function km(e){if(Om.test(e))return!0;let t=ro();if(t.size===0)return!1;for(let n=e.lastIndexOf(`/`);n>0;n=e.lastIndexOf(`/`,n-1))if(t.has(e.slice(0,n)))return!0;return!1}function Am(e,t){if(!Array.isArray(e)||t<=0)return[];let n=[],r=new Set;for(let i of e)if(dm(i)&&!r.has(i)&&(r.add(i),n.push(i),n.length>=t))break;return n}function jm(e,t,n){if(t<=0)return[];let r=new Set(Am(n,2**53-1)),i=Am(e,2**53-1);if(r.size===0&&i.length<=t)return i;let a=[],o=0;for(let e=i.length-1;e>=0;e--){let n=i[e];if(r.has(n)){a.push(n);continue}o>=t||(o++,a.push(n))}return a.reverse()}function Mm(e,t){let n=new Set(Am(t,2**53-1));return Am(e,2**53-1).filter(e=>!n.has(e))}function Nm(e,t,n){let r=Am(t,2**53-1),i=new Set(r),a=new Set(n),o=new Set,s=[];for(let t of e)o.has(t)||!i.has(t)&&!a.has(t)||(o.add(t),s.push(t));for(let e of[...r,...n])o.has(e)||(o.add(e),s.push(e));return s}function Pm(e,{pages:t,folderPaths:n,assetPaths:r,filePaths:i,keepMissingDocName:a=null,keepHashDocName:o=null,keepFolderPaths:s=Qp}){return Am(e,2**53-1).filter(e=>{let c=wm(e);if(c.kind===`folder`)return Ka(n,c.folderPath)!==void 0||s.has(c.folderPath);if(c.kind===`asset`)return Ka(r,c.assetPath)!==void 0||i!==void 0&&Ka(i,c.assetPath)!==void 0;if(c.kind===`skill-file`||c.kind===`skill-preview`||c.kind===`doc`&&Fe(c.docName)?.kind===`skill`)return!0;let l=am(c.docName);return t.has(c.docName)||l!==null&&t.has(l)||Ne(c.docName)||Me(c.docName)!==null||c.docName===a||c.docName===o})}function Fm(e,t,n,r=[],i=[],a=[]){if(t.length===0&&r.length===0&&a.length===0)return Am(e,n);let o=new Map(t.map(e=>[e.fromDocName,e.toDocName])),s=new Map(a.flatMap(e=>{let t=am(e.fromPath);return t?[[t,e.toPath]]:[]})),c=new Map(a.flatMap(e=>{let t=am(e.toPath);return t?[[e.fromPath,t]]:[]})),l=e=>Rm(Lm(e,r),a),u=(e,t)=>{let n=o.get(e);if(n)return n;let r=s.get(e);return r?xm(r):t},d=e=>{let t=c.get(e);return t?ym(t):xm(l(e))},f=[],p=new Set;for(let t of e){if(!dm(t))continue;let e=wm(t),a=e.kind===`doc`?u(e.docName,t):e.kind===`folder`?bm(Lm(e.folderPath,r)):e.kind===`asset`?d(e.assetPath):t;if(!p.has(a)&&(p.add(a),f.push(a),i.length===0&&f.length>=n))break}return i.length===0?f:jm(f,n,i.flatMap(e=>{if(!dm(e))return[];let t=wm(e);return[t.kind===`doc`?u(t.docName,e):t.kind===`folder`?bm(Lm(t.folderPath,r)):t.kind===`asset`?d(t.assetPath):e]}))}function Im(e,t,n=[],r=[]){return Fm(e,t,2**53-1,n,[],r)}function Lm(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function Rm(e,t){for(let{fromPath:n,toPath:r}of t)if(e===n)return r;return e}function zm(e){if(typeof e!=`object`||!e)return Zp();let t=um(e);return Array.isArray(t.panes)?Bm(Ep(t),typeof t.updatedAt==`string`?t.updatedAt:null):Zp()}function Bm(e,t){return{updatedAt:t,panes:e.panes,focusedPaneId:e.focusedPaneId}}function Vm(e,t=()=>new Date){return Bm(Tp(e),t().toISOString())}function Hm(e){return`${$p}${e}`}function Um(e,t){return e===`editor`||e===`note`?null:Hm(t)}function Wm(e,t){if(!e)return Zp();try{let n=e.getItem(t);return n?zm(JSON.parse(n)):Zp()}catch(e){return console.warn(`[editor-tabs] failed to read local tab session:`,e),Zp()}}function Gm(e,t,n){if(e)try{e.setItem(t,JSON.stringify(zm(n)))}catch(e){console.warn(`[editor-tabs] failed to write local tab session:`,e)}}var Km=null;function qm(e){return Km=e,()=>{Km===e&&(Km=null)}}function Jm(e){e&&Km?.(e)}function Ym(e){e&&Jm(ym(e))}function Xm(e,t){let n=e=>(e.ok&&Ym(t),e);return{...e,current:()=>e.current(),subscribe:t=>e.subscribe(t),dispose:()=>e.dispose(),patch:t=>n(e.patch(t)),rename:(t,r,i)=>n(e.rename(t,r,i)),reorder:t=>n(e.reorder(t)),patchPath:(t,r)=>n(e.patchPath(t,r)),deletePath:t=>n(e.deletePath(t)),renamePath:(t,r,i)=>n(e.renamePath(t,r,i)),reorderPath:(t,r)=>n(e.reorderPath(t,r)),reorderSeqPath:(t,r)=>n(e.reorderSeqPath(t,r))}}function Zm(e){return e.docChanged?yn(e):!1}function Qm(e){return e.docChanged?e.transactions.some(e=>e.annotation(ao.userEvent)!==void 0):!1}var $m=`epoch`,eh=e=>pa((t,n)=>{e.onerror=e=>n(Error(e.target.error)),e.onsuccess=e=>t(e.target.result)}),th=(e,t)=>pa((n,r)=>{let i=indexedDB.open(e);i.onupgradeneeded=e=>t(e.target.result),i.onerror=e=>r(ha(e.target.error)),i.onsuccess=e=>{let t=e.target.result;t.onversionchange=()=>{t.close()},n(t)}}),nh=e=>eh(indexedDB.deleteDatabase(e)),rh=(e,t)=>t.forEach(t=>e.createObjectStore.apply(e,t)),ih=(e,t,n=`readwrite`)=>{let r=e.transaction(t,n);return t.map(e=>hh(r,e))},ah=(e,t)=>eh(e.count(t)),oh=(e,t)=>eh(e.get(t)),sh=(e,t)=>eh(e.delete(t)),ch=(e,t,n)=>eh(e.put(t,n)),lh=(e,t)=>eh(e.add(t)),uh=(e,t,n)=>eh(e.getAll(t,n)),dh=(e,t,n)=>{let r=null;return mh(e,t,e=>(r=e,!1),n).then(()=>r)},fh=(e,t=null)=>dh(e,t,`prev`),ph=(e,t)=>pa((n,r)=>{e.onerror=r,e.onsuccess=async e=>{let r=e.target.result;if(r===null||await t(r)===!1)return n();r.continue()}}),mh=(e,t,n,r=`next`)=>ph(e.openKeyCursor(t,r),e=>n(e.key)),hh=(e,t)=>e.objectStore(t),gh=(e,t)=>IDBKeyRange.upperBound(e,t),_h=(e,t)=>IDBKeyRange.lowerBound(e,t),vh=`custom`,yh=`updates`,bh=(e,t=()=>{},n=()=>{})=>{let[r]=ih(e.db,[yh]);return uh(r,_h(e._dbref,!1)).then(i=>{e._destroyed||(t(r),ua(e.doc,()=>{i.forEach(t=>xa(e.doc,t))},e,!1),n(r))}).then(()=>fh(r).then(t=>{e._dbref=t+1})).then(()=>ah(r).then(t=>{e._dbsize=t})).then(()=>r)},xh=(e,t=!0)=>bh(e).then(n=>{(t||e._dbsize>=500)&&lh(n,da(e.doc)).then(()=>sh(n,gh(e._dbref,!0))).then(()=>ah(n).then(t=>{e._dbsize=t}))}),Sh=class extends ma{constructor(e,t){super(),this.doc=t,this.name=e,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=th(e,e=>rh(e,[[`updates`,{autoIncrement:!0}],[`custom`]])),this.whenSynced=pa(e=>this.on(`synced`,()=>e(this))),this._db.then(e=>{this.db=e,bh(this,async e=>{await ah(e)>0&&lh(e,da(t))},()=>{if(this._destroyed)return this;this.synced=!0,this.emit(`synced`,[this])})}),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(e,t)=>{if(this.db&&t!==this){let[t]=ih(this.db,[yh]);lh(t,e).catch(e=>{globalThis.__okYdbWriteWarned||(globalThis.__okYdbWriteWarned=!0,console.warn(JSON.stringify({event:`ok-ydb-write-failed`,cause:e?.name??`unknown`,message:e?.message??String(e)})))}),++this._dbsize>=500&&(this._storeTimeoutId!==null&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout(()=>{xh(this,!1),this._storeTimeoutId=null},this._storeTimeout))}},t.on(`update`,this._storeUpdate),this.destroy=this.destroy.bind(this),t.on(`destroy`,this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off(`update`,this._storeUpdate),this.doc.off(`destroy`,this.destroy),this._destroyed=!0,this._db.then(e=>{e.close()})}clearData(){return this.destroy().then(()=>{nh(this.name)})}get(e){return this._db.then(t=>{let[n]=ih(t,[vh],`readonly`);return oh(n,e)})}set(e,t){return this._db.then(n=>{let[r]=ih(n,[vh]);return ch(r,t,e)})}del(e){return this._db.then(t=>{let[n]=ih(t,[vh]);return sh(n,e)})}},Ch=`updates`,wh=`custom`;function Th(){return!0}var Eh=class{_idb;_dbName;whenSynced;constructor({branch:e,serverInstanceId:t,docName:n,doc:r}){if(typeof t!=`string`||t.length===0)throw Error(`createClientPersistence: serverInstanceId is required and must be non-empty`);this._dbName=`ok-ydoc:${e}:${t}:${n}`;let i=Th()?0:performance.now();this._idb=new Sh(this._dbName,r),this.whenSynced=this._idb.whenSynced.then(()=>{if(!Th()){let e=performance.now();X(`ok/pool/idb-whensynced`,{docName:n,durationMs:Math.round((e-i)*1e3)/1e3},{startTime:i,duration:e-i})}return this})}get synced(){return this._idb.synced}async destroy(){let e=Th()?0:performance.now();try{await this._idb.destroy()}finally{if(!Th()){let t=performance.now();X(`ok/pool/idb-destroy`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}async flushFullState(){this._idb.db===null&&await this.whenSynced;let e=this._idb.db;if(e===null)return;let t=this._idb;await new Promise((n,r)=>{let i=e.transaction(Ch,`readwrite`),a=i.objectStore(Ch),o=a.getAll();o.onerror=()=>r(o.error??Error(`flushFullState getAll failed`)),o.onsuccess=()=>{try{ua(t.doc,()=>{for(let e of o.result)xa(t.doc,e)},t,!1);let e=a.add(da(t.doc));e.onerror=()=>r(e.error??Error(`flushFullState add failed`)),e.onsuccess=()=>{a.delete(IDBKeyRange.upperBound(e.result,!0)),typeof i.commit==`function`&&i.commit()}}catch(e){r(e instanceof Error?e:Error(String(e)));try{i.abort()}catch{}}},i.oncomplete=()=>n(),i.onabort=()=>r(i.error??Error(`flushFullState transaction aborted`))})}async clearData(){let e=Th()?0:performance.now();try{await this._idb.destroy();let e=this._dbName;await new Promise((t,n)=>{let r=indexedDB.deleteDatabase(e);r.onsuccess=()=>t(),r.onerror=()=>n(r.error),r.onblocked=()=>{console.warn(JSON.stringify({event:`ok-client-persistence-clear-blocked`,dbName:e}))}})}finally{if(!Th()){let t=performance.now();X(`ok/pool/idb-cleardata`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}};function Dh(e){return new Eh(e)}async function Oh(e){if(typeof indexedDB>`u`)return null;let t=`ok-ydoc:${e.branch}:${e.serverInstanceId}:${e.docName}`;if(typeof indexedDB.databases==`function`&&!(await indexedDB.databases()).some(e=>e.name===t))return null;let n=await new Promise((e,n)=>{let r=indexedDB.open(t);r.onupgradeneeded=()=>{let e=r.result;e.objectStoreNames.contains(Ch)||e.createObjectStore(Ch,{autoIncrement:!0}),e.objectStoreNames.contains(wh)||e.createObjectStore(wh)},r.onsuccess=()=>e(r.result),r.onerror=()=>n(r.error)});try{if(!n.objectStoreNames.contains(Ch))return null;let e=await new Promise((e,t)=>{let r=n.transaction(Ch,`readonly`).objectStore(Ch).getAll();r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)});if(e.length===0)return null;let t=new ba;try{ua(t,()=>{for(let n of e)xa(t,n)});let n=t.getMap(`lifecycle`).get($m);return typeof n==`string`&&n.length>0?n:null}finally{t.destroy()}}finally{n.close()}}function kh(e){return _a(e)}function Ah(e,t){return t===null?da(e):da(e,t)}function jh(e,t){if(e===null)return t;if(t===null)return e;let n=la(e),r=la(t),i=new Map;for(let[e,t]of n)i.set(e,t);for(let[e,t]of r){let n=i.get(e);(n===void 0||t>n)&&i.set(e,t)}return _a(i)}function Mh(e){let t={};if(Ta.inject(Ea.active(),t),!t.traceparent)return e;let n=e.includes(`?`)?`&`:`?`,r=[`traceparent=${encodeURIComponent(t.traceparent)}`];return t.tracestate&&r.push(`tracestate=${encodeURIComponent(t.tracestate)}`),`${e}${n}${r.join(`&`)}`}var Nh=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i})=>new J({key:e||new G(`fileHandler`),props:{handleDrop(e,n){if(!r||!n.dataTransfer?.files.length)return!1;let a=e.posAtCoords({left:n.clientX,top:n.clientY}),o=Array.from(n.dataTransfer.files);return i&&(o=o.filter(e=>i.includes(e.type))),o.length===0?!1:(n.preventDefault(),n.stopPropagation(),r(t,o,a?.pos||0),!0)},handlePaste(e,r){if(!n||!r.clipboardData?.files.length)return!1;let a=Array.from(r.clipboardData.files),o=r.clipboardData.getData(`text/html`);return i&&(a=a.filter(e=>i.includes(e.type))),!(a.length===0||(r.preventDefault(),r.stopPropagation(),n(t,a,o),o.length>0))}}}),Ph=_e.create({name:`fileHandler`,addOptions(){return{onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}},addProseMirrorPlugins(){return[Nh({key:new G(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}});function Fh(e,t){let{state:n,view:r}=e;if(!n.selection.empty||!r.endOfTextblock(t))return!1;let i=n.selection.$head,a=t===`down`||t===`right`,o=null,s=-1;if(a){let e=i.after();if(e>=n.doc.content.size)return!1;o=n.doc.nodeAt(e),s=e}else{let e=i.before();if(e<=0||(o=n.doc.resolve(e).nodeBefore,!o))return!1;s=e-o.nodeSize}if(!o||o.type.name!==`jsxComponent`||o.childCount!==0||!xe.isSelectable(o))return!1;try{let t=xe.create(n.doc,s);return e.view.dispatch(n.tr.setSelection(t).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return vr(t),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:t,tier:`L0`,reason:e.message.slice(0,500)})),!0}}function Ih(e){let{state:t,view:n}=e;if(!(t.selection instanceof K)||!t.selection.empty||!n.endOfTextblock(`up`))return!1;let r=t.selection.$head,i=-1;for(let e=r.depth-1;e>=1;e--)if(r.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;for(let e=r.depth;e>i;e--)if(r.index(e-1)!==0)return!1;let a=r.before(i);try{let n=t.doc.resolve(a),r=ve.findFrom(n,-1,!0);return!r||!(r instanceof K)?!1:(e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0)}catch(e){if(!(e instanceof RangeError))throw e;return vr(`up`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`up`,tier:`L2c`,reason:e.message.slice(0,500)})),!0}}function Lh(e,t){let{state:n,view:r}=e;if(!(n.selection instanceof K)||!n.selection.empty||!r.endOfTextblock(t))return!1;let i=n.selection.$head,a=t===`down`||t===`right`,o=null,s=-1;if(a){let e=i.after();if(e>=n.doc.content.size)return!1;o=n.doc.nodeAt(e),s=e}else{let e=i.before();if(e<=0||(o=n.doc.resolve(e).nodeBefore,!o))return!1;s=e-o.nodeSize}if(!o||o.type.name!==`jsxComponent`||o.childCount===0)return!1;let c=s+o.nodeSize;try{let t=a?s+1:c-1,r=ve.findFrom(n.doc.resolve(t),a?1:-1,!0);return!r||!(r instanceof K)||r.$head.pos<=s||r.$head.pos>=c?!1:(e.view.dispatch(n.tr.setSelection(r).scrollIntoView()),!0)}catch(e){if(!(e instanceof RangeError))throw e;return vr(t),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:t,tier:`L2d`,reason:e.message.slice(0,500)})),!0}}var Rh=_e.create({name:`keyboardNav`,priority:50,addKeyboardShortcuts(){return{Escape:({editor:e})=>{let{state:t}=e;if(t.selection instanceof xe){if(t.selection.$from.depth===0)return e.commands.blur(),!0;let n=t.selection.from+t.selection.node.nodeSize,r=t.doc.resolve(Math.min(n,t.doc.content.size)),i=K.near(r);return e.view.dispatch(t.tr.setSelection(i)),!0}return t.selection instanceof K?e.commands.selectParentNode():!1},ArrowUp:({editor:e})=>{if(Fh(e,`up`)||Ih(e)||Lh(e,`up`))return!0;let{state:t}=e;if(!(t.selection instanceof xe))return!1;let n=t.selection.from,r=t.doc.resolve(n);if(r.index(r.depth)===0)return!1;let i=r.before(r.depth);if(i<=0)return!1;let a=t.doc.resolve(i-1).nodeBefore;if(!a||i-1-a.nodeSize+1<0)return!1;try{let n=xe.create(t.doc,i-a.nodeSize);return e.view.dispatch(t.tr.setSelection(n).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return vr(`up`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`up`,tier:`L2`,reason:e.message.slice(0,500)})),!1}},ArrowDown:({editor:e})=>{if(Fh(e,`down`)||Lh(e,`down`))return!0;let{state:t}=e;if(!(t.selection instanceof xe))return!1;let n=t.selection.from+t.selection.node.nodeSize;if(n>=t.doc.content.size)return!1;try{if(!t.doc.nodeAt(n))return!1;let r=xe.create(t.doc,n);return e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return vr(`down`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`down`,tier:`L2`,reason:e.message.slice(0,500)})),!1}},ArrowLeft:({editor:e})=>Fh(e,`left`)||Lh(e,`left`),ArrowRight:({editor:e})=>Fh(e,`right`)||Lh(e,`right`),Enter:({editor:e})=>{let{state:t}=e;if(!(t.selection instanceof K)||!t.selection.empty)return!1;let n=t.selection.$from,r=n.parent;if(r.type.name!==`paragraph`||r.textContent!==``||n.depth<2)return!1;let i=-1;for(let e=n.depth-1;e>=1;e--)if(n.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;let a=n.node(i);if(n.index(i)!==a.childCount-1)return!1;let o=n.after(i);if(o>t.doc.content.size)return!1;let s=t.tr,c=n.before(n.depth),l=n.after(n.depth);s.delete(c,l);let u=o-(l-c),d=t.schema.nodes.paragraph.create();s.insert(u,d);let f=u+1;return s.setSelection(K.create(s.doc,f)),e.view.dispatch(s.scrollIntoView()),!0}}}}),zh={query:``,options:{caseSensitive:!1,wholeWord:!1},activeIndex:0,matches:[]},Bh=/[A-Za-z0-9_]/;function Vh(e){return e!==void 0&&Bh.test(e)}function Hh(e,t,n){return!Vh(e[t-1])&&!Vh(e[n])}function Uh(e,t,n){if(t.length===0)return[];let r=n.caseSensitive?e:e.toLocaleLowerCase(),i=n.caseSensitive?t:t.toLocaleLowerCase(),a=[],o=0;for(;o<=r.length-i.length;){let t=r.indexOf(i,o);if(t===-1)break;let s=t+i.length;(!n.wholeWord||Hh(e,t,s))&&a.push({start:t,end:s,text:e.slice(t,s)}),o=s}return a}function Wh(e,t,n){if(t.length===0)return[];let r=[];return e.descendants((e,i)=>{if(!(!e.isText||typeof e.text!=`string`))for(let a of Uh(e.text,t,n))r.push({from:i+a.start,to:i+a.end,text:a.text})}),r}var Gh=new G(`findReplace`);function Kh(e,t){return t<=0||!Number.isFinite(e)?0:Math.min(Math.max(Math.trunc(e),0),t-1)}function qh(e,t,n,r){let i=Wh(e.doc,t,n);return{query:t,options:n,activeIndex:Kh(r,i.length),matches:i}}function Jh(e,t,n){return t<=0?0:(Kh(e,t)+n+t)%t}function Yh(e,t,n){if(e.length===0)return 0;let r=t+n,i=e.findIndex(e=>e.from>=r);return i===-1?0:i}function Xh(e,t,n){if(t.matches.length===0)return null;let r=e.tr;for(let e of[...t.matches].reverse())r.insertText(n,e.from,e.to);let i=Wh(r.doc,t.query,t.options),a=Kh(0,i.length),o=i[a];return r.setMeta(Gh,{type:`setActiveIndex`,activeIndex:a}),o&&r.setSelection(K.create(r.doc,o.from,o.to)),r.scrollIntoView()}function Zh(e,t){let n=Gh.getState(e)?.matches[t];return n?e.tr.setMeta(Gh,{type:`setActiveIndex`,activeIndex:t}).setSelection(K.create(e.doc,n.from,n.to)).scrollIntoView():null}function Qh(e){return Gh.getState(e)??zh}function $h(){return new J({key:Gh,state:{init:()=>zh,apply(e,t,n,r){let i=e.getMeta(Gh);if(i?.type===`clear`)return zh;let a=t.query,o=t.options,s=t.activeIndex;if(i?.type===`setQuery`)a=i.query,o={...o,...i.options},s=i.activeIndex??0;else if(i?.type===`setOptions`)o={...o,...i.options},s=i.activeIndex??s;else if(i?.type===`setActiveIndex`)s=i.activeIndex;else if(!e.docChanged)return t;return a.length===0?{query:a,options:o,activeIndex:0,matches:[]}:qh(r,a,o,s)}},props:{decorations(e){let t=Gh.getState(e);return!t||t.matches.length===0?null:H.create(e.doc,t.matches.map((e,n)=>U.inline(e.from,e.to,{class:n===t.activeIndex?`ok-find-match ok-find-match-active`:`ok-find-match`})))}}})}var eg=_e.create({name:`findReplace`,addCommands(){return{setFindQuery:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(Gh,{type:`setQuery`,query:e,options:t?.options,activeIndex:t?.activeIndex})),!0),setFindOptions:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(Gh,{type:`setOptions`,options:e,activeIndex:t})),!0),setActiveFindIndex:e=>({state:t,dispatch:n})=>(n&&n(t.tr.setMeta(Gh,{type:`setActiveIndex`,activeIndex:e})),!0),selectNextFindMatch:()=>({state:e,dispatch:t})=>{let n=Qh(e),r=Zh(e,Jh(n.activeIndex,n.matches.length,1));return r?(t?.(r),!0):!1},selectPreviousFindMatch:()=>({state:e,dispatch:t})=>{let n=Qh(e),r=Zh(e,Jh(n.activeIndex,n.matches.length,-1));return r?(t?.(r),!0):!1},replaceCurrentFindMatch:e=>({state:t,dispatch:n})=>{let r=Qh(t),i=r.matches[r.activeIndex];if(!i||!n)return!1;let a=t.tr.insertText(e,i.from,i.to),o=Wh(a.doc,r.query,r.options),s=Yh(o,i.from,e.length),c=o[s];return a.setMeta(Gh,{type:`setActiveIndex`,activeIndex:s}),c&&a.setSelection(K.create(a.doc,c.from,c.to)),a.scrollIntoView(),n(a),!0},replaceAllFindMatches:e=>({state:t,dispatch:n})=>{let r=Qh(t);if(!n)return!1;let i=Xh(t,r,e);return i?(n(i),!0):!1},clearFindMatches:()=>({state:e,dispatch:t})=>(t&&t(e.tr.setMeta(Gh,{type:`clear`})),!0)}},addProseMirrorPlugins(){return[$h()]}}),tg=/^(https?:\/\/|www(?=\.))((?:[-.\w]|[^\s\p{P}\p{S}\p{Cc}])+)([^ \t\r\n]*)/iu,ng=/^([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/,rg=/[-\d_]$/,ig=/[\p{L}\p{N}]/u,ag=tr.map(e=>`${e}:`);function og(e){let t=e.toLowerCase();return ag.some(e=>t.startsWith(e))}function sg(e,t){let n=0;for(let r of e)r===t&&n++;return n}function cg(e){let t=e.split(`.`),n=t[t.length-1],r=t[t.length-2];return!(n&&(/_/.test(n)||!ig.test(n))||r&&(/_/.test(r)||!ig.test(r)))}function lg(e){return e.split(`.`).length>=2&&cg(e)}function ug(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,``];let n=e.slice(0,t.index),r=t[0],i=r.indexOf(`)`),a=sg(n,`(`),o=sg(n,`)`);for(;i!==-1&&a>o;)n+=r.slice(0,i+1),r=r.slice(i+1),i=r.indexOf(`)`),o++;return[n,r]}function dg(e){let t=tg.exec(e);if(!t)return null;let n=t[1],r=t[2],i=t[3],a=``,o=/^w/i.test(n);if(o&&(r=n+r,n=``,a=`http://`),o?!lg(r):!cg(r))return null;let[s]=ug(r+i);if(!s)return null;let c=n+s,l=a+n+s;return og(l)?{href:l,text:c}:null}function fg(e){let t=ng.exec(e);if(!t)return null;let n=t[1],r=t[2];if(rg.test(r))return null;let i=`${n}@${r}`,a=`mailto:${i}`;return og(a)?{href:a,text:i}:null}function pg(e){return e?dg(e)??fg(e):null}function mg(e,t){let n=Bt.getState(e.state)?.undoManager;n?.stopCapturing();try{e.dispatch(t)}finally{n?.stopCapturing()}}var hg=`\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000`,gg=RegExp(`[${hg}]`),_g=RegExp(`[${hg}]$`),vg=`link`,yg=`gfm-autolink`,bg=`preventAutolink`,xg=new G(`gfmAutolink`);function Sg(e,t,n){let r=[],i=Ee(de(e.doc,[...n]));for(let{newRange:e}of i){let n=pe(t.doc,e,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=t.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length===1){let r=t.doc.textBetween(e.from,e.to,` `,` `);if(!_g.test(r))continue;i=n[0],a=t.doc.textBetween(i.pos,e.to,void 0,` `)}if(!i||!a||Nn(i.node))continue;let o=a.split(gg).filter(Boolean),s=o[o.length-1];if(!s)continue;let c=pg(s);if(!c)continue;let l=i.pos+a.lastIndexOf(s)+1,u=l+c.text.length;r.push({from:l,to:u,href:c.href,text:c.text})}return r}function Cg(e={}){let t=e.isActiveEditor??(e=>e.hasFocus()),n=null,r=!1,i=[],a=()=>{r=!1;let e=n,a=i.splice(0,i.length);if(!e||e.isDestroyed||e.composing||!t(e))return;let o=e.state.schema.marks[vg];if(!o)return;let s=e.state.tr,c=!1,l=e.state.doc.content.size;for(let t of a){let{from:n,to:r,href:i,text:a}=t;n<0||r>l||n>=r||e.state.doc.textBetween(n,r)===a&&(Te(n,r,e.state.doc).some(e=>e.mark.type===o)||Xt(e.state,n,r)||(s=s.addMark(n,r,o.create({href:i,linkStyle:yg})),c=!0))}if(c){s=s.setMeta(bg,!0);try{mg(e,s)}catch(e){console.warn(`[gfm-autolink] linkify dispatch failed`,{candidates:a.map(e=>({from:e.from,to:e.to,href:e.href}))},e)}}};return new J({key:xg,view(e){return n=e,{destroy(){n=null,i.length=0,r=!1}}},appendTransaction(e,o,s){if(!e.every(yn)||e.some(e=>e.getMeta(`preventAutolink`))||!(e.some(e=>e.docChanged)&&!o.doc.eq(s.doc))||!n||!t(n))return null;let c=Sg(o,s,e);return c.length===0?null:(i.push(...c),r||(r=!0,queueMicrotask(a)),null)}})}var wg=_e.create({name:`gfmAutolink`,addOptions(){return{isActiveEditor:void 0}},addProseMirrorPlugins(){return[Cg({isActiveEditor:this.options.isActiveEditor})]}});function Tg(){return Y._({id:`jTVuAv`})}var Eg=1e3,Dg=class extends Error{kind;constructor(e,t){super(e),this.name=`UploadFailedError`,this.kind=t}};async function Og(e,t,n=Eg){if(t<=0)return{readable:!0,bytesRead:0};let r,i=new Promise(e=>{r=setTimeout(()=>e({readable:!1,bytesRead:0,timedOut:!0}),n)}),a=(async()=>{try{let t=await e.slice(0,1).arrayBuffer();return{readable:t.byteLength===1,bytesRead:t.byteLength}}catch(e){return{readable:!1,bytesRead:0,error:e instanceof Error?`${e.name}: ${e.message}`:String(e)}}})();try{return await Promise.race([a,i])}finally{clearTimeout(r)}}function kg(e){return e.readable?`network`:`file-unreadable`}function Ag(e,t){return e===`single-file-mode`?Tg():e===`file-unreadable`?Y._({id:`YxZDGh`,values:{fileName:t}}):Y._({id:`H0VUMo`,values:{fileName:t}})}async function jg(e){let{file:t,sizeAtDrop:n,error:r}=e,i=await Og(t,n),a=kg(i);return{kind:a,message:Ag(a,t.name),log:{kind:a,name:t.name,type:t.type,sizeAtDrop:n,sizeAtSend:t.size,bytesRead:i.bytesRead,readError:i.error,readTimedOut:i.timedOut,error:r instanceof Error?`${r.name}: ${r.message}`:String(r)}}}var Mg=new G(`imageUpload`);function Ng(e){let t=document.createElement(`div`);t.className=`image-upload-skeleton w-full h-40 rounded-md bg-muted animate-pulse motion-reduce:animate-none my-2`,t.setAttribute(`data-upload-widget`,`loading`),t.setAttribute(`role`,`status`);let n=e?.name;return t.setAttribute(`aria-label`,n?Y._({id:`KDuPiY`,values:{fileName:n}}):Y._({id:`bGa3Fk`})),t}var Pg=new J({key:Mg,state:{init(){return{decorations:H.empty,uploads:new Map}},apply(e,t){let n=t.decorations.map(e.mapping,e.doc),r=new Map;for(let[n,i]of t.uploads)r.set(n,e.mapping.map(i));let i=e.getMeta(Mg);if(!i)return{decorations:n,uploads:r};if(i.type===`add`){let t=U.widget(i.pos,i.widget,{id:i.id,stopEvent:()=>!0}),a=n.add(e.doc,[t]),o=new Map(r);return o.set(i.id,e.mapping.map(i.pos)),{decorations:a,uploads:o}}if(i.type===`remove`){let e=n.find(void 0,void 0,e=>e.id===i.id),t=n.remove(e),a=new Map(r);return a.delete(i.id),{decorations:t,uploads:a}}return{decorations:n,uploads:r}}},props:{decorations(e){return Mg.getState(e)?.decorations??H.empty}}});function Fg(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function Ig(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function Lg(e){return e.split(`/`).filter(e=>e!==``)}function Rg(e,t){let n=Fg(e),r=Fg(t),i=Ig(e);if(n===r)return i;let a=Lg(r),o=Lg(n),s=0;for(;s<a.length&&s<o.length&&a[s]===o[s];)s++;let c=a.length-s,l=o.slice(s);return c===0?`./${[...l,i].join(`/`)}`:[...Array(c).fill(`..`),...l,i].join(`/`)}function zg(e){return Kt(e)}function Bg(e,t){return{type:`jsxComponent`,attrs:{componentName:e===`jsx-img`?`img`:e===`jsx-video`?`video`:`audio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:e===`jsx-img`?{src:t}:{src:t,controls:!0}}}}function Vg(e){let t=Mn(e);return t===`md`||t===`mdx`?{kind:`wiki-link`,ext:t}:se.has(t)?{kind:`jsx-img`,ext:t}:R.has(t)?{kind:`jsx-video`,ext:t}:ae.has(t)?{kind:`jsx-audio`,ext:t}:re.has(t)?{kind:`jsx-file`,ext:t}:te.has(t)?{kind:`wikiembed`,ext:t}:{kind:`markdown-link`,ext:t}}function Hg(e){return Qt(e)?(z.error(Tg()),!1):!0}async function Ug(e,t,n){if(!Hg(t))return;let r=zg(t),i=r?`${r}.md`:``;if(!i){z.error(Y._({id:`z5pqI8`}));return}let a=Ei(),o=e.size,s=Ng(e);t.view.dispatch(t.state.tr.setMeta(Mg,{type:`add`,id:a,pos:n,widget:s}));let c=new FormData;c.append(`file`,e),c.append(`parentDocName`,i);let l;try{l=await fetch(`/api/upload`,{method:`POST`,body:c})}catch(n){let r;try{r=await jg({file:e,sizeAtDrop:o,error:n})}catch(e){console.error(`[uploadAndInsert] upload failed, and diagnosing it failed too`,{docName:i,networkError:n,reportError:e})}r&&console.error(`[uploadAndInsert] upload failed before reaching the server`,{...r.log,docName:i}),Wg(t,a,r?.message);return}let u;try{u=await l.json()}catch(e){console.error(`[uploadAndInsert] Response is not JSON:`,e),Wg(t,a);return}if(!l.ok){let e=Ke.safeParse(u);if(!e.success){let n=new oi(`Upload response did not match ProblemDetails.`,{cause:e.error,status:l.status});console.error(`[uploadAndInsert] Server error (unparseable):`,n),Wg(t,a);return}console.error(`[uploadAndInsert] Server error:`,e.data),Wg(t,a,e.data.title);return}let d=We.safeParse(u);if(!d.success){let e=new oi(`Upload success response did not match UploadAssetSuccess.`,{cause:d.error,status:l.status});console.error(`[uploadAndInsert] Response missing src:`,e),Wg(t,a);return}let f=d.data,p=f.src,m=f.deduped===!0,h=Fg(i),g=typeof f.path==`string`&&f.path.length>0?f.path:h?`${h}/${p}`:p;m&&z.info(Y._({id:`VbqhBI`,values:{assetContentPath:g}}));let _=Vg(e.name),{state:v}=t,y=Mg.getState(v)?.uploads.get(a)??n,b=v.tr.setMeta(Mg,{type:`remove`,id:a}),x=Rg(g,i),S=`/${g}`;if(_.kind===`jsx-file`){if(!v.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),Wg(t,a);return}let n={type:`jsxComponent`,attrs:{componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:{src:S,target:p,alias:null,anchor:null,size:Pr(e.size)}}};t.chain().command(({tr:e})=>(e.setMeta(Mg,{type:`remove`,id:a}),!0)).focus().insertContentAt(y,n).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(y);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(xe.create(e.doc,n)),!0}).run();return}if(_.kind===`jsx-img`||_.kind===`jsx-video`||_.kind===`jsx-audio`){if(!v.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),Wg(t,a);return}let e=Bg(_.kind,S);t.chain().command(({tr:e})=>(e.setMeta(Mg,{type:`remove`,id:a}),!0)).focus().insertContentAt(y,e).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(y);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(xe.create(e.doc,n)),!0}).run();return}if(_.kind===`wikiembed`){let e=v.schema.nodes.wikiLinkEmbed;if(!e){console.error(`[uploadAndInsert] wikiLinkEmbed node missing from schema`),Wg(t,a);return}b.insert(y,e.create({target:p,alias:null,anchor:null,resolvedSrc:S}))}else if(_.kind===`wiki-link`){let n=v.schema.nodes.wikiLink;if(!n){console.error(`[uploadAndInsert] wikiLink node missing from schema`),Wg(t,a);return}let r=jn(e.name.replace(/\.(md|mdx)$/i,``));r?b.insert(y,n.create(r)):b.insert(y,v.schema.text(e.name))}else{let t=v.schema.marks.link;if(t){let n=v.schema.text(e.name,[t.create({href:x})]);b.insert(y,n)}else b.insert(y,v.schema.text(e.name))}t.view.dispatch(b)}function Wg(e,t,n){e.view.dispatch(e.state.tr.setMeta(Mg,{type:`remove`,id:t})),z.error(n??Y._({id:`b3Thhd`}))}var Gg=/\[([^\]]+)\]\(([^)\s]+)\)$/,Kg=`link`;function qg(e,t,n,r,i){if(e.isDestroyed||e.composing)return;let{state:a}=e,o=a.schema.marks[Kg];if(!o)return;let s=t+n.length;if(t<0||s>a.doc.content.size||a.doc.textBetween(t,s)!==n||a.doc.rangeHasMark(t,s,o))return;let c=a.schema.text(r,[o.create({href:i})]);try{mg(e,a.tr.replaceRangeWith(t,s,c))}catch(e){console.warn(`[inline-link-rule] collapse dispatch failed`,{from:t,text:r,href:i},e)}}var Jg=_e.create({name:`inlineLinkInputRule`,addInputRules(){let e=this.editor;return[new be({find:Gg,handler:({state:t,range:n,match:r})=>{let i=r[1],a=r[2];if(!i||!a||!ln(a))return null;let o=t.schema.marks[Kg];if(!o||t.doc.rangeHasMark(n.from,n.to,o))return null;let s=n.from,c=r[0],l=e.view;return queueMicrotask(()=>qg(l,s,c,i,a)),null}})]}}),Yg=`mathInline`,Xg=/\$\$([^$\n]+)\$\$$/,Zg=/(?<![\w$])\$([^\s$\n](?:[^$\n]*[^\s$\n])?)\$$/;function Qg(e,t,n){let r=t.exec(e);if(!r)return null;let i=r[1];return i?{formula:i,delimiter:n,literalLength:r[0].length}:null}function $g(e,t,n){if(e.isDestroyed||e.composing)return;let{state:r}=e,i=r.schema.nodes[Yg];if(!i)return;let a=t+n.literalLength;if(t<0||a>r.doc.content.size)return;let o=`${n.delimiter}${n.formula}${n.delimiter}`;if(r.doc.textBetween(t,a)!==o)return;let s=!1;if(r.doc.nodesBetween(t,a,e=>(e.isInline&&!e.isText&&(s=!0),!s)),s)return;let c=i.create({formula:n.formula,sourceDelimiter:n.delimiter});try{mg(e,r.tr.replaceRangeWith(t,a,c))}catch(e){console.warn(`[math-input-rule] collapse dispatch failed`,{from:t,formula:n.formula,delimiter:n.delimiter},e)}}function e_(e,t,n){return new be({find:t,handler:({state:r,range:i,match:a})=>{let o=Qg(a[0],t,n);if(!o||!r.schema.nodes[Yg])return null;let s=i.from,c=e.view;return queueMicrotask(()=>$g(c,s,o)),null}})}var t_=_e.create({name:`mathInputRule`,addInputRules(){return[e_(this.editor,Xg,`$$`),e_(this.editor,Zg,`$`)]}}),n_=`ok-landing-flash`;function r_(e,t,n,r){if(r===`clamped`||r===`ordinal`)return null;let i=Math.max(0,Math.min(t,e)),a=Math.max(i,Math.min(n,e));return a<=i?null:{from:i,to:a}}var i_=new G(`okLandingFlash`),a_=new WeakMap;function o_(){return new J({key:i_,state:{init:()=>H.empty,apply(e,t){let n=e.getMeta(i_),r=t.map(e.mapping,e.doc);return n?.clear&&(r=H.empty),n?.add&&n.add.to>n.add.from&&(r=H.create(e.doc,[U.inline(n.add.from,n.add.to,{class:n_})])),r}},props:{decorations(e){return i_.getState(e)}},view(e){return{destroy(){let t=a_.get(e);t!==void 0&&(clearTimeout(t),a_.delete(e))}}}})}var s_=_e.create({name:`okLandingFlash`,addProseMirrorPlugins(){return[o_()]}}),c_=new Set;function l_(e){c_.add(e)}function u_(e){return c_.delete(e)}var d_=new G(`markIdentity`);function f_(){return{byId:new Map,counter:0}}function p_(e,t,n,r,i){let a=[];for(let e of t.byId.values()){let t=i?i.map(e.from,-1):e.from,n=i?i.map(e.to,1):e.to;n<=t||a.push({id:e.id,markType:e.markType,attrs:e.attrs,from:t,to:n})}let o=new Map,s=new Set,c=t.counter;return e.descendants((e,t)=>{if(!(!e.isInline||e.marks.length===0))for(let i of e.marks){if(!n.has(i.type.name)||r&&!r(i))continue;let l=null;for(let e of a)if(!s.has(e.id)&&e.markType===i.type.name&&m_(e.attrs,i.attrs)&&!(t<e.from||t>=e.to)){l=e.id;break}let u=l??`m${++c}`;s.add(u);let d=t,f=t+e.nodeSize,p=o.get(u);p?p.to=Math.max(p.to,f):o.set(u,{id:u,markType:i.type.name,attrs:i.attrs,from:d,to:f})}}),{byId:o,counter:c}}function m_(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(n!==i&&(typeof n!=`object`||!n||typeof i!=`object`||!i||!((Array.isArray(n)&&Array.isArray(i)||!Array.isArray(n)&&!Array.isArray(i)&&Object.getPrototypeOf(n)===Object.prototype&&Object.getPrototypeOf(i)===Object.prototype)&&m_(n,i))))return!1}return!0}function h_(e,t,n,r){let i=new Set(t.byId.keys());for(let[r,i]of t.byId)e.has(r)||n?.(i);for(let t of e)i.has(t)||r?.(t);return i}function g_(e,t,n){let r=d_.getState(e);if(!r)return null;for(let e of r.byId.values())if(e.markType===n&&e.from<=t&&t<e.to)return e.id;return null}function __(e){let{markTypes:t,predicate:n,onRegister:r,onDeregister:i}=e,a=new Set(t);return new J({key:d_,state:{init(e,t){return p_(t.doc,f_(),a,n)},apply(e,t,r,i){return e.docChanged?p_(i.doc,t,a,n,e.mapping):t}},view(){let e=new Set;return{update(t){let n=d_.getState(t.state);n&&(e=h_(e,n,r,i))},destroy(){for(let t of e)i?.(t);e=new Set}}}})}var v_=300,y_=150,b_=500,x_=class{registry=new Map;_activeNodeId=null;listeners=new Set;_snapshot={activeNodeId:null,active:null};register(e){this.registry.set(e.nodeId,e),this._activeNodeId===e.nodeId&&this.refreshSnapshot()}deregister(e){this.registry.delete(e)&&this._activeNodeId===e&&(this._activeNodeId=null,this.refreshSnapshot())}setActiveNode(e){this._activeNodeId!==e&&(e!==null&&!this.registry.has(e)||(this._activeNodeId=e,this.refreshSnapshot()))}getActiveNode(){return this._activeNodeId}getRegistration(e){return this.registry.get(e)}hasRegistration(e){return this.registry.has(e)}clear(){this.registry.clear(),this._activeNodeId=null,this.refreshSnapshot()}getSnapshot=()=>this._snapshot;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});refreshSnapshot(){let e=this._activeNodeId==null?null:this.registry.get(this._activeNodeId)??null;this._snapshot={activeNodeId:this._activeNodeId,active:e};for(let e of this.listeners)e()}};function S_(e,t){let n=e??null;for(;n&&typeof n==`object`;){let e=n.getAttribute;if(typeof e==`function`){let r=e.call(n,`data-mark-id`);if(r&&t.hasRegistration(r))return r;let i=e.call(n,`data-node-id`);if(i&&t.hasRegistration(i))return i}n=n.parentElement??null}return null}function C_(e){return e?e.closest(`[data-ok-prop-panel]`)!==null:!1}function w_(){return typeof document>`u`?!1:document.querySelector(`[data-ok-layer-spawned]`)!==null}var T_=e=>{let t=(0,Q.c)(18),{store:n}=e,r;t[0]===n?r=t[1]:(r=()=>n.getSnapshot(),t[0]=n,t[1]=r);let[i,a]=(0,Z.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>(a(n.getSnapshot()),n.subscribe(()=>{a(n.getSnapshot())})),s=[n],t[2]=n,t[3]=o,t[4]=s),(0,Z.useEffect)(o,s);let{active:c}=i;if(!c)return null;let l;t[5]===n?l=t[6]:(l=()=>n.setActiveNode(null),t[5]=n,t[6]=l);let u,d,f;if(t[7]!==c.controls||t[8]!==c.nodeId||t[9]!==c.type||t[10]!==l){let e={nodeId:c.nodeId,type:c.type,deactivate:l};u=c.controls.propPanel?.(e),d=c.controls.toolbar?.(e),f=c.controls.breadcrumb?.(e),t[7]=c.controls,t[8]=c.nodeId,t[9]=c.type,t[10]=l,t[11]=u,t[12]=d,t[13]=f}else u=t[11],d=t[12],f=t[13];let p;return t[14]!==u||t[15]!==d||t[16]!==f?(p=(0,$.jsxs)($.Fragment,{children:[u,d,f]}),t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p};function E_(e){return e.editorView?.dom??null}function D_(e,t){let n=e;for(;n;){if(n.getAttribute?.(`data-mark-id`)===t||n.getAttribute?.(`data-node-id`)===t)return!0;n=n.parentElement}return!1}function O_(e){let{editor:t}=e,n=new x_,r=E_(t),i=!1,a=null,o=null,s=null,c=null,l=null,u=()=>{a!==null&&(clearTimeout(a),a=null),s=null},d=()=>{o!==null&&(clearTimeout(o),o=null)},f=()=>{c!==null&&(clearTimeout(c),c=null)},p=e=>{if(n.getActiveNode()===e){d();return}s===e&&a!==null||(u(),d(),s=e,a=setTimeout(()=>{a=null,s=null,n.setActiveNode(e)},v_))},m=()=>{n.getActiveNode()!==null&&o===null&&(o=setTimeout(()=>{o=null,!w_()&&n.setActiveNode(null)},y_))},h={kind:`none`},g=!1,_=e=>{try{g=!0,e.focus({preventScroll:!0})}catch{}finally{g=!1}},v=n.subscribe(()=>{let e=n.getActiveNode();if(e!==null){if(typeof document<`u`){let t=document.activeElement;h=t&&D_(t,e)?{kind:`activator`,element:t}:{kind:`none`}}else h={kind:`none`};return}let i=h;if(h={kind:`none`},typeof document>`u`)return;if(i.kind===`none`){if(!document.activeElement?.closest(`[data-ok-prop-panel], [data-ok-layer-spawned], [data-ok-interaction-layer]`))return}else if(document.contains(i.element)&&typeof i.element.focus==`function`){_(i.element);return}let a=r??E_(t);a&&typeof a.focus==`function`&&_(a)}),y=e=>{let t=e;if(t.button!==2){if(t.metaKey||t.ctrlKey||t.button===1){u(),t.button===1&&t.preventDefault?.();return}if(t.pointerType===`touch`){let t=S_(e.target,n);if(t===null)return;f(),c=setTimeout(()=>{c=null,l=t,n.setActiveNode(t)},b_);return}u()}},b=()=>{f()},x=e=>{e.pointerType===`touch`&&c!==null&&f()},S=e=>{let t=e;if(t.button===2||t.type===`click`&&t.button===1)return;let r=S_(e.target,n);if(r===null)return;if(l!==null){let e=l===r;if(l=null,e){t.preventDefault?.();return}}let i=t.metaKey||t.ctrlKey||t.button===1,a=n.getRegistration(r);if(a?.handlePrimary&&a.handlePrimary({nodeId:r,type:a.type,newTab:i})){t.preventDefault?.(),i||(u(),d(),n.getActiveNode()===r&&n.setActiveNode(null));return}i||(u(),d(),n.setActiveNode(r))},C=e=>{let t=e;if(t.key===`Escape`){n.getActiveNode()!==null&&(u(),d(),n.setActiveNode(null),t.preventDefault?.());return}if(t.key===`Tab`&&!t.shiftKey&&!t.altKey&&!t.metaKey&&!t.ctrlKey){let r=S_(e.target,n);if(r!==null&&n.getActiveNode()===r){let e=document.querySelector(`[data-ok-prop-panel]`);if(e){let n=e.querySelector(`button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex="-1"])`);if(n){t.preventDefault?.(),n.focus();return}}}return}let r=t.key===`Enter`,i=t.key===` `||t.key===`Spacebar`;if(!r&&!i)return;let a=S_(e.target,n);if(a===null||i&&((e.target instanceof Element?e.target:null)?.closest(`[data-mark-id], [data-node-id]`)??null)?.getAttribute(`role`)===`link`)return;let o=n.getRegistration(a);if(t.preventDefault?.(),o?.handlePrimary&&o.handlePrimary({nodeId:a,type:o.type,newTab:!1})){u(),d(),n.getActiveNode()===a&&n.setActiveNode(null);return}n.setActiveNode(a)},w=e=>{let t=e;if(t.pointerType!==`mouse`)return;let r=t.target;if(!(r instanceof Element))return;if(C_(r)){d();return}let i=S_(r,n);i!==null&&p(i)},T=e=>{let t=e;if(t.pointerType!==`mouse`)return;let r=t.target,i=t.relatedTarget;if(!(r instanceof Element))return;let a=i instanceof Element?i:null,o=S_(r,n);if(o!==null){if(a&&C_(a)){d();return}if(a&&S_(a,n)===o)return;s===o&&u(),m();return}if(C_(r)){if(a&&C_(a))return;let e=n.getActiveNode();if(e!==null&&a&&S_(a,n)===e)return;m()}},E=e=>{if(g)return;let t=e.target;if(!(t instanceof Element))return;let r=S_(t,n);r!==null&&(u(),d(),n.setActiveNode(r))},D=e=>{let t=e;if(n.getActiveNode()===null)return;let r=t.relatedTarget,i=r instanceof Element?r:null;i&&C_(i)||i&&S_(i,n)!==null||m()},O=e=>{if(n.getActiveNode()===null)return;let t=e.target;t&&(r?.contains(t)||t instanceof Element&&(t.closest(`[data-ok-interaction-layer]`)||t.closest(`[data-ok-prop-panel]`)||t.closest(`[data-ok-layer-spawned]`))||(u(),d(),n.setActiveNode(null)))},k=()=>{i||(r=E_(t),r&&(r.addEventListener(`pointerdown`,y,!0),r.addEventListener(`pointerup`,b,!0),r.addEventListener(`pointercancel`,b,!0),r.addEventListener(`pointermove`,x,!0),r.addEventListener(`click`,S,!0),r.addEventListener(`auxclick`,S,!0),r.addEventListener(`keydown`,C,!0),typeof document<`u`&&(document.addEventListener(`pointerover`,w,!0),document.addEventListener(`pointerout`,T,!0),document.addEventListener(`focusin`,E,!0),document.addEventListener(`focusout`,D,!0),document.addEventListener(`pointerdown`,O,!0)),i=!0))},A=()=>{i&&=(r?.removeEventListener(`pointerdown`,y,!0),r?.removeEventListener(`pointerup`,b,!0),r?.removeEventListener(`pointercancel`,b,!0),r?.removeEventListener(`pointermove`,x,!0),r?.removeEventListener(`click`,S,!0),r?.removeEventListener(`auxclick`,S,!0),r?.removeEventListener(`keydown`,C,!0),typeof document<`u`&&(document.removeEventListener(`pointerover`,w,!0),document.removeEventListener(`pointerout`,T,!0),document.removeEventListener(`focusin`,E,!0),document.removeEventListener(`focusout`,D,!0),document.removeEventListener(`pointerdown`,O,!0)),!1)};return k(),{register(e){n.register(e),i||k()},deregister(e){n.deregister(e)},setActiveNode(e){n.setActiveNode(e)},getActiveNode(){return n.getActiveNode()},getRegistration(e){return n.getRegistration(e)},destroy(){A(),u(),d(),f(),v(),n.clear()},store:n}}var k_=e=>{let t=(0,Q.c)(2),{store:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{"data-ok-interaction-layer":``,className:`contents`,children:(0,$.jsx)(T_,{store:n})}),t[0]=n,t[1]=r),r},A_=new WeakMap;function j_(e){let t=A_.get(e);if(t)return t;let n=O_({editor:e});return A_.set(e,n),e.on(`destroy`,()=>{n.destroy(),A_.delete(e)}),n}var M_={AlignCenter:iu,AppWindow:pt,ChevronRight:kt,CopyPlus:El,FileText:$n,Film:ci,GitBranch:mt,Image:ri,LayoutPanelTop:Rl,MessageSquareWarning:Kl,PanelTop:Jl,Paperclip:vi,PenTool:Yl,Sigma:$l,SquarePlay:tu,Volume2:qn,Workflow:cu,ZoomIn:yt};function N_(e){return e&&Object.hasOwn(M_,e)?M_[e]:_l}var P_={Info:mi,Lightbulb:zl,MessageSquareWarning:Kl,AlertTriangle:wi,AlertOctagon:ql,ClipboardList:Sl,BookOpen:gl,ListTodo:Wl,CircleCheck:jt,CircleHelp:bl,CircleX:xl,Zap:lu,Bug:vl,FlaskConical:Ml,Quote:Xl,ChevronRight:kt},F_=Object.entries(P_).sort(([e],[t])=>e.localeCompare(t));function I_(e){if(!e||!e.startsWith(`lucide:`))return null;let t=e.slice(7);return Object.hasOwn(P_,t)?P_[t]??null:null}function L_(e){let t=(0,Q.c)(24),n;t[0]===e.icon?n=t[1]:(n=I_(e.icon),t[0]=e.icon,t[1]=n);let r=n,i=r?`custom`:void 0,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(kt,{size:14,className:`accordion-chevron`,"aria-hidden":`true`}),t[2]=a):a=t[2];let o;t[3]===r?o=t[4]:(o=r?(0,$.jsx)(r,{size:16,className:`accordion-icon`,"aria-hidden":`true`}):null,t[3]=r,t[4]=o);let s=e.title??`Accordion`,c;t[5]===s?c=t[6]:(c=(0,$.jsx)(`span`,{className:`accordion-title`,children:s}),t[5]=s,t[6]=c);let l;t[7]===e.description?l=t[8]:(l=e.description?(0,$.jsx)(`span`,{className:`accordion-description`,children:e.description}):null,t[7]=e.description,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`span`,{className:`accordion-title-group`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;t[12]!==o||t[13]!==u?(d=(0,$.jsxs)(`summary`,{className:`accordion-summary`,contentEditable:!1,children:[a,o,u]}),t[12]=o,t[13]=u,t[14]=d):d=t[14];let f;t[15]===e.children?f=t[16]:(f=(0,$.jsx)(`div`,{className:`accordion-body`,children:e.children}),t[15]=e.children,t[16]=f);let p;return t[17]!==e.defaultOpen||t[18]!==e.id||t[19]!==e.name||t[20]!==i||t[21]!==d||t[22]!==f?(p=(0,$.jsxs)(`details`,{className:`accordion`,"data-accordion-icon":i,open:e.defaultOpen,id:e.id,name:e.name,children:[d,f]}),t[17]=e.defaultOpen,t[18]=e.id,t[19]=e.name,t[20]=i,t[21]=d,t[22]=f,t[23]=p):p=t[23],p}var R_={center:`text-center`,left:`text-left`,right:`text-right`,justify:`text-justify`};function z_(e){let t=(0,Q.c)(5),n=R_[e.align??``]??null,r;t[0]===n?r=t[1]:(r=d(`prose-no-margin`,n),t[0]=n,t[1]=r);let i;return t[2]!==e.children||t[3]!==r?(i=(0,$.jsx)(`div`,{"data-component-type":`align-block`,className:r,children:e.children}),t[2]=e.children,t[3]=r,t[4]=i):i=t[4],i}function B_(e){return e!==!1}function V_(e){let t=(0,Q.c)(12),n;t[0]===e.src?n=t[1]:(n=e.src===void 0?void 0:go(e.src),t[0]=e.src,t[1]=n);let r=e.title,i;t[2]===e.controls?i=t[3]:(i=B_(e.controls),t[2]=e.controls,t[3]=i);let a;return t[4]!==e.autoplay||t[5]!==e.loop||t[6]!==e.muted||t[7]!==e.preload||t[8]!==e.title||t[9]!==n||t[10]!==i?(a=(0,$.jsx)(`audio`,{className:`ok-audio`,src:n,title:r,controls:i,autoPlay:e.autoplay,loop:e.loop,muted:e.muted,preload:e.preload}),t[4]=e.autoplay,t[5]=e.loop,t[6]=e.muted,t[7]=e.preload,t[8]=e.title,t[9]=n,t[10]=i,t[11]=a):a=t[11],a}var H_={note:mi,tip:zl,important:Kl,warning:wi,caution:ql,abstract:Sl,info:gl,todo:Wl,success:jt,question:bl,failure:xl,danger:lu,bug:vl,example:Ml,quote:Xl};function U_(e,t){return I_(e)??H_[t]}var W_=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]);function G_(e){return typeof e==`string`&&W_.has(e)?e:`note`}function K_(e){let t=(0,Q.c)(29),n,r;t[0]!==e.icon||t[1]!==e.type?(r=G_(e.type),n=U_(e.icon,r),t[0]=e.icon,t[1]=e.type,t[2]=n,t[3]=r):(n=t[2],r=t[3]);let i=n,o;t[4]===e.color?o=t[5]:(o=e.color?{"--callout-type-color":e.color}:{},t[4]=e.color,t[5]=o);let s=o,c;t[6]!==i||t[7]!==e.title?(c=e.title||i?(0,$.jsxs)(`span`,{className:`callout-header`,contentEditable:!1,children:[(0,$.jsx)(i,{size:16,className:`callout-icon`,"aria-hidden":`true`}),e.title?(0,$.jsx)(`span`,{className:`callout-title`,children:e.title}):null]}):null,t[6]=i,t[7]=e.title,t[8]=c):c=t[8];let l=c;if(e.collapsible){let n=e.defaultOpen??!0,i;t[9]===l?i=t[10]:(i=l??(0,$.jsx)(`span`,{className:`callout-title`,children:(0,$.jsx)(a,{id:`URmyfc`})}),t[9]=l,t[10]=i);let o;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Ot,{size:16,className:`callout-chevron`,"aria-hidden":`true`}),t[11]=o):o=t[11];let c;t[12]===i?c=t[13]:(c=(0,$.jsxs)(`summary`,{className:`callout-summary`,contentEditable:!1,children:[i,o]}),t[12]=i,t[13]=c);let u;t[14]===e.children?u=t[15]:(u=(0,$.jsx)(`div`,{className:`callout-body`,children:e.children}),t[14]=e.children,t[15]=u);let d;return t[16]!==n||t[17]!==s||t[18]!==c||t[19]!==u||t[20]!==r?(d=(0,$.jsxs)(`details`,{className:`callout callout-collapsible`,"data-callout-type":r,open:n,style:s,children:[c,u]}),t[16]=n,t[17]=s,t[18]=c,t[19]=u,t[20]=r,t[21]=d):d=t[21],d}let u;t[22]===e.children?u=t[23]:(u=(0,$.jsx)(`div`,{className:`callout-body`,children:e.children}),t[22]=e.children,t[23]=u);let d;return t[24]!==l||t[25]!==s||t[26]!==u||t[27]!==r?(d=(0,$.jsxs)(`div`,{className:`callout callout-static`,"data-callout-type":r,style:s,children:[l,u]}),t[24]=l,t[25]=s,t[26]=u,t[27]=r,t[28]=d):d=t[28],d}function q_(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function J_(e){if(typeof e!=`string`||e.length===0)return e;let t=xn(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(Sr(e)){let t=q_(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=br(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var Y_=[{key:`tl`,dx:-1,dy:-1,cursor:`nwse-resize`,className:`ok-resize-handle ok-resize-handle--tl`},{key:`t`,dx:0,dy:-1,cursor:`ns-resize`,className:`ok-resize-handle ok-resize-handle--t`},{key:`tr`,dx:1,dy:-1,cursor:`nesw-resize`,className:`ok-resize-handle ok-resize-handle--tr`},{key:`r`,dx:1,dy:0,cursor:`ew-resize`,className:`ok-resize-handle ok-resize-handle--r`},{key:`br`,dx:1,dy:1,cursor:`nwse-resize`,className:`ok-resize-handle ok-resize-handle--br`},{key:`b`,dx:0,dy:1,cursor:`ns-resize`,className:`ok-resize-handle ok-resize-handle--b`},{key:`bl`,dx:-1,dy:1,cursor:`nesw-resize`,className:`ok-resize-handle ok-resize-handle--bl`},{key:`l`,dx:-1,dy:0,cursor:`ew-resize`,className:`ok-resize-handle ok-resize-handle--l`}];function X_(e){let t=(0,Q.c)(7),{targetRef:n,onResize:r,onResizeEnd:i,bounds:a}=e,{_:s}=o(),c=(0,Z.useRef)(null),l;t[0]!==a?.maxHeight||t[1]!==a?.maxWidth||t[2]!==a?.minHeight||t[3]!==a?.minWidth?(l=function(e,t){let n=t===`w`?a?.minWidth??64:a?.minHeight??64,r=t===`w`?a?.maxWidth??1/0:a?.maxHeight??1/0;return Math.max(n,Math.min(r,e))},t[0]=a?.maxHeight,t[1]=a?.maxWidth,t[2]=a?.minHeight,t[3]=a?.minWidth,t[4]=l):l=t[4];let u=l,f=function(e,t){let a=n.current;if(!a)return;e.preventDefault(),e.stopPropagation();let o=a.getBoundingClientRect();c.current={handle:t,startX:e.clientX,startY:e.clientY,startWidth:o.width,startHeight:o.height,latestWidth:o.width,latestHeight:o.height,hasMoved:!1};let s=e.currentTarget;try{s.setPointerCapture(e.pointerId)}catch{}document.body.style.setProperty(`cursor`,t.cursor),document.body.style.setProperty(`user-select`,`none`);let l=function(e){let t=c.current;if(!t)return;let n=(e.clientX-t.startX)*t.handle.dx,i=(e.clientY-t.startY)*t.handle.dy,a=t.handle.dx===0?t.startWidth:u(t.startWidth+n,`w`),o=t.handle.dy===0?t.startHeight:u(t.startHeight+i,`h`);t.latestWidth=a,t.latestHeight=o,t.hasMoved=!0,r({width:a,height:o})};function d(){let e=c.current;if(!e)return;let t={width:e.latestWidth,height:e.latestHeight},n=e.hasMoved;c.current=null,document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`),window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,d),window.removeEventListener(`pointercancel`,d),n&&i?.(t)}window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,d),window.addEventListener(`pointercancel`,d)},p=Y_.map(e=>{let t=e.key;return(0,$.jsx)(`button`,{type:`button`,className:d(e.className),"aria-label":s({id:`NxW-md`,values:{handleKey:t}}),tabIndex:-1,style:{cursor:e.cursor},onPointerDown:t=>f(t,e)},t)}),m;return t[5]===p?m=t[6]:(m=(0,$.jsx)(`div`,{className:`ok-resize-overlay`,contentEditable:!1,"aria-hidden":`true`,children:p}),t[5]=p,t[6]=m),m}var Z_=`26rem`,Q_=`Embedded content`,$_=/^https?:\/\//i;function ev(e){try{return new URL(e).origin!==window.location.origin}catch{return!1}}function tv(e){return!(typeof e!=`string`||!$_.test(e)||!ev(e))}function nv(e){let t=(0,Q.c)(24),{src:n,title:r,width:i,height:a}=e,o=(0,Z.useRef)(null),s=xt(),c=i||void 0,l=a||Z_,u;t[0]!==c||t[1]!==l?(u={width:c,height:l},t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,f,p;if(t[3]!==a||t[4]!==i?(f=()=>{let e=o.current;e&&(e.style.width=i||``,e.style.height=a||Z_)},p=[i,a],t[3]=a,t[4]=i,t[5]=f,t[6]=p):(f=t[5],p=t[6]),(0,Z.useEffect)(f,p),!tv(n)){let e=`Embed a URL`;typeof n==`string`&&n.length>0&&(e=$_.test(n)?`Embed only supports cross-origin URLs`:`URL must start with http:// or https://`);let r;return t[7]===e?r=t[8]:(r=(0,$.jsx)(`div`,{className:`ok-embed ok-embed--placeholder`,contentEditable:!1,children:(0,$.jsx)(`span`,{children:e})}),t[7]=e,t[8]=r),r}let m;t[9]===s?m=t[10]:(m=e=>{if(!s)return;let{editor:t,getPos:n}=s,r=n();if(typeof r==`number`)try{let n=t.state.doc.nodeAt(r);if(n?.type.name!==`jsxComponent`)return;let i={...n.attrs.props??{},width:`${Math.round(e.width)}px`,height:`${Math.round(e.height)}px`};t.view.dispatch(t.state.tr.setNodeMarkup(r,null,{...n.attrs,props:i,sourceDirty:!0}))}catch(e){let t=e;if(t instanceof RangeError)return;throw t}},t[9]=s,t[10]=m);let h=m,g;t[11]===n?g=t[12]:(g=J_(n),t[11]=n,t[12]=g);let _=g,v=_===n?`no-referrer`:`strict-origin-when-cross-origin`,y=r||Q_,b;t[13]!==_||t[14]!==v||t[15]!==y?(b=(0,$.jsx)(`iframe`,{title:y,src:_,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation`,referrerPolicy:v,loading:`lazy`,className:`ok-embed-frame`}),t[13]=_,t[14]=v,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==s||t[18]!==h?(x=s?(0,$.jsx)(X_,{targetRef:o,bounds:{minWidth:192,maxWidth:2e3,minHeight:128,maxHeight:Math.round(window.innerHeight*.9)},onResize:e=>{let t=o.current;t&&(t.style.width=`${e.width}px`,t.style.height=`${e.height}px`)},onResizeEnd:h}):null,t[17]=s,t[18]=h,t[19]=x):x=t[19];let S;return t[20]!==d||t[21]!==x||t[22]!==b?(S=(0,$.jsxs)(`div`,{className:`ok-embed`,style:d,ref:o,contentEditable:!1,children:[b,x]}),t[20]=d,t[21]=x,t[22]=b,t[23]=S):S=t[23],S}function rv(e){return e===Re}var iv=new Set(ze);function av(e){return iv.has(e)}var ov=new Map,sv=1e4,cv=(0,Z.createContext)(!0);function lv(){return{ok:!1,reason:`refused`}}function uv(){return(0,Z.use)(cv)?dv:lv}function dv(e,t){if(rv(t)||av(t))return{ok:!1,reason:`inadmissible`};let n=`${e}|${t}`,r=ov.get(n);if(r)return r.refcount+=1,{ok:!0,entry:r};if(ov.size>=30)return console.warn(`[LiveDoc] provider pool at capacity (30); refusing "${t}". Live by-reference embeds and mirrors across all visible documents share this pool.`),{ok:!1,reason:`at-capacity`};let i=new ba,a=new ya({url:e,name:t,document:i}),o=new Set,s={provider:a,ySource:i.getText(`source`),refcount:1,synced:!1,subscribe:e=>(o.add(e),()=>{o.delete(e)})};return a.on(`synced`,()=>{s.synced=!0;for(let e of o)e.onSynced()}),s.ySource.observe(()=>{for(let e of o)e.onUpdate()}),ov.set(n,s),{ok:!0,entry:s}}function fv(e,t){let n=`${e}|${t}`,r=ov.get(n);if(r&&(--r.refcount,r.refcount<=0)){try{r.provider.destroy()}catch(e){console.warn(`[LiveDoc] provider.destroy() failed during release`,{docName:t,err:e})}ov.delete(n)}}function pv(e,t){return e.kind!==t.kind||e.kind===`ready`&&t.kind===`ready`&&e.text!==t.text?t:e}function mv(e,t){switch(t){case`at-capacity`:return{kind:`at-capacity`};case`inadmissible`:return{kind:`unreachable`};case`refused`:return console.warn(`[LiveDoc] live-document access is off here; refused`,{docName:e}),{kind:`loading`}}}function hv(e,t){let n=(0,Q.c)(10),r=t===void 0?0:t,{collabUrl:i}=no(),a=uv(),o;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={kind:`loading`},n[0]=o):o=n[0];let[s,c]=(0,Z.useState)(o),l;n[1]!==a||n[2]!==i||n[3]!==e?(l=()=>{if(!e){c({kind:`unreachable`});return}if(!i){c({kind:`loading`});return}c(gv);let t=a(i,e);if(!t.ok){c(mv(e,t.reason));return}let{entry:n}=t,r=()=>{let e=n.ySource.toString(),t=e?{kind:`ready`,text:e}:n.synced?{kind:`empty`}:{kind:`loading`};c(e=>pv(e,t))},o=null,s=n.subscribe({onUpdate:()=>{o&&clearTimeout(o),o=setTimeout(()=>{o=null,r()},150)},onSynced:()=>{o&&=(clearTimeout(o),null),r()}}),l=!1,u=()=>{l||(l=!0,o&&=(clearTimeout(o),null),s(),fv(i,e))},d=setTimeout(()=>{n.synced||(c({kind:`unreachable`}),u())},sv);return r(),()=>{clearTimeout(d),u()}},n[1]=a,n[2]=i,n[3]=e,n[4]=l):l=n[4];let u;return n[5]!==a||n[6]!==i||n[7]!==e||n[8]!==r?(u=[i,e,r,a],n[5]=a,n[6]=i,n[7]=e,n[8]=r,n[9]=u):u=n[9],(0,Z.useEffect)(l,u),s}function gv(e){return pv(e,{kind:`loading`})}var _v=30,vv=[];function yv(e){if(typeof document>`u`)return!1;for(let t of document.images)if(t.getAttribute(`src`)===e)return!0;return!1}function bv(e){vv.push(e);let t=0;for(;vv.length>_v&&t<vv.length;){let e=vv.shift();if(!e)break;if(t+=1,yv(e)){vv.push(e);continue}URL.revokeObjectURL(e)}}function xv(e){let t=vv.indexOf(e);t>=0&&vv.splice(t,1),URL.revokeObjectURL(e)}var Sv=wt(()=>n(()=>import(`./prod-CN58f7_5.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47]),import.meta.url)),Cv=new Set([`http:`,`https:`,`file:`]);function wv(e,t=typeof window<`u`&&window.location?.href?window.location.href:`http://localhost/`){try{let n=new URL(t),r=new URL(e,n);if(!Cv.has(r.protocol)||!(r.protocol===`file:`?n.protocol===`file:`:r.origin===n.origin))return null;let i=r.pathname.split(`/`).filter(e=>e.length>0).map(e=>decodeURIComponent(e));if(i.length===0||i.some(e=>e===`..`||e===`.`||e.includes(`/`)||e.includes(`\\`)||/[\u0000-\u001f]/.test(e)))return null;let a=i.join(`/`);return oe(a)?a:null}catch{return null}}function Tv(e){return typeof e==`string`&&wv(e)!==null}function Ev(e){let t=(0,Q.c)(82),{src:n,title:r,className:i,expandOpen:s,onExpandOpenChange:c}=e,l=s===void 0?!1:s,{_:u}=o(),f=_t(),[p,m]=(0,Z.useState)(0),h;t[0]===n?h=t[1]:(h=n?wv(n):null,t[0]=n,t[1]=h);let g=h,_=hv(g,p),[v,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(null),[S,C]=(0,Z.useState)(null),w=(0,Z.useRef)(null),T=(0,Z.useRef)(!1),E,D;t[2]===g?(E=t[3],D=t[4]):(E=()=>{g&&(Sv().catch(Av),bt().catch(kv))},D=[g],t[2]=g,t[3]=E,t[4]=D),(0,Z.useEffect)(E,D);let O;t[5]!==g||t[6]!==_.kind||t[7]!==_.text||t[8]!==v?(O=()=>{if(_.kind!==`ready`||!g||v&&v.docName===g&&v.text===_.text)return;let e=!1;return(async()=>{let t=JSON.parse(_.text);if(!(typeof t==`object`&&t&&Array.isArray(t.elements)))throw Error(`not an Excalidraw scene (no elements array)`);let n;try{n=await Sv()}catch(t){let n=t;if(e)return;console.warn(`[ExcalidrawEmbed] excalidraw module failed to load:`,g,n),T.current=!1,y(null),C({docName:g,kind:`module-load`});return}let r=jo(n,t);e||(y({docName:g,text:_.text,value:r}),C(null))})().catch(t=>{e||(console.warn(`[ExcalidrawEmbed] failed to parse board:`,g,t),T.current=!1,y(null),C({docName:g,kind:`parse`}))}),()=>{e=!0}},t[5]=g,t[6]=_.kind,t[7]=_.text,t[8]=v,t[9]=O):O=t[9];let k;t[10]!==g||t[11]!==_||t[12]!==v?(k=[_,g,v],t[10]=g,t[11]=_,t[12]=v,t[13]=k):k=t[13],(0,Z.useEffect)(O,k);let A=(0,Z.useRef)(!1),j=(0,Z.useRef)(!1),[M,N]=(0,Z.useState)(0),P=(0,Z.useRef)(null),F;t[14]!==g||t[15]!==f||t[16]!==v||t[17]!==b?(F=()=>{if(!v||!g||v.docName!==g||b&&b.docName===v.docName&&b.sceneValue===v.value&&b.colorMode===f)return;if(A.current){j.current=!0;return}let e=!1;return A.current=!0,(async()=>{let t;try{t=await Sv()}catch(t){let n=t;if(e)return;console.warn(`[ExcalidrawEmbed] excalidraw module failed to load:`,g,n),T.current=!1,x(null),C({docName:g,kind:`module-load`});return}let n=await t.exportToSvg({elements:v.value.elements,appState:{...v.value.appState,exportWithDarkMode:f===`dark`,exportBackground:!1},files:v.value.files});if(e)return;let r=new XMLSerializer().serializeToString(n),i=URL.createObjectURL(new Blob([r],{type:`image/svg+xml`})),a=P.current;P.current=i,bv(i),a&&xv(a),x({docName:v.docName,url:i,sceneValue:v.value,colorMode:f}),C(null)})().catch(t=>{e||(console.warn(`[ExcalidrawEmbed] failed to export board snapshot:`,g,t),T.current=!1,x(null),C({docName:g,kind:`export`}))}).finally(()=>{A.current=!1,j.current&&(j.current=!1,N(Ov))}),()=>{e=!0}},t[14]=g,t[15]=f,t[16]=v,t[17]=b,t[18]=F):F=t[18];let I;t[19]!==g||t[20]!==f||t[21]!==M||t[22]!==v||t[23]!==b?(I=[v,f,g,b,M],t[19]=g,t[20]=f,t[21]=M,t[22]=v,t[23]=b,t[24]=I):I=t[24],(0,Z.useEffect)(F,I);let L=S&&S.docName===g?S:null,R=L!==null||_.kind===`unreachable`||_.kind===`at-capacity`,te=b&&b.docName===g?b:null,ne=te!==null&&!R,re,ie;t[25]===R?(re=t[26],ie=t[27]):(ie=()=>{!R&&T.current&&(T.current=!1,w.current?.focus())},re=[R],t[25]=R,t[26]=re,t[27]=ie),(0,Z.useEffect)(ie,re);let ae=R||_.kind===`empty`,oe,se;if(t[28]!==ae||t[29]!==l||t[30]!==c?(oe=()=>{l&&ae&&c?.(!1)},se=[l,ae,c],t[28]=ae,t[29]=l,t[30]=c,t[31]=oe,t[32]=se):(oe=t[31],se=t[32]),(0,Z.useEffect)(oe,se),!n){let e;t[33]===i?e=t[34]:(e=d(`excalidraw-embed flex min-h-16 w-full items-center justify-center rounded-md border border-dashed border-border/60 bg-muted/10 px-3 py-6 text-sm text-muted-foreground`,i),t[33]=i,t[34]=e);let n;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(a,{id:`WH3roC`}),t[35]=n):n=t[35];let r;return t[36]===e?r=t[37]:(r=(0,$.jsx)(`div`,{className:e,"data-component-type":`excalidraw`,children:n}),t[36]=e,t[37]=r),r}if(_.kind===`empty`){let e;t[38]===i?e=t[39]:(e=d(`excalidraw-embed flex min-h-16 w-full items-center justify-center rounded-md border border-dashed border-border/60 bg-muted/10 px-3 py-6 text-sm text-muted-foreground`,i),t[38]=i,t[39]=e);let n;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(a,{id:`AaC-CE`}),t[40]=n):n=t[40];let r;return t[41]===e?r=t[42]:(r=(0,$.jsx)(`div`,{className:e,"data-component-type":`excalidraw`,children:n}),t[41]=e,t[42]=r),r}let z=!R&&!te,B;t[43]!==u||t[44]!==L?.kind||t[45]!==_.kind?(B=_.kind===`at-capacity`?u({id:`dT-HIQ`}):_.kind===`unreachable`?u({id:`4Vgtaz`}):L?.kind===`module-load`?u({id:`pGYklE`}):L?.kind===`parse`?u({id:`LPLWpO`}):u({id:`U4ZE26`}),t[43]=u,t[44]=L?.kind,t[45]=_.kind,t[46]=B):B=t[46];let ce=B,le=R&&_.kind!==`at-capacity`&&g!==null,V;t[47]===i?V=t[48]:(V=d(`excalidraw-embed relative w-full overflow-hidden rounded-md border border-border/60 bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,i),t[47]=i,t[48]=V);let H=z?!0:void 0,U;t[49]!==g||t[50]!==ce||t[51]!==le||t[52]!==R||t[53]!==n?(U=R?(0,$.jsxs)(`div`,{role:`alert`,className:`m-2 flex items-start gap-2 rounded border border-destructive/30 bg-destructive/5 px-3 py-2 text-[12px] text-destructive`,children:[(0,$.jsx)(wi,{className:`size-3.5 shrink-0 mt-0.5`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`font-medium`,children:(0,$.jsx)(a,{id:`eh3QBq`})}),(0,$.jsx)(`div`,{className:`mt-1`,children:ce}),(0,$.jsx)(`div`,{className:`mt-1 break-words font-mono text-[11px] opacity-90`,children:g??n})]}),le?(0,$.jsx)(ee,{type:`button`,size:`sm`,variant:`outline`,className:`shrink-0 border-destructive/40 text-destructive hover:text-destructive`,"data-testid":`excalidraw-embed-retry`,onClick:()=>{T.current=!0,C(null),y(null),x(null),m(Dv)},children:(0,$.jsx)(a,{id:`KDw4GX`})}):null]}):null,t[49]=g,t[50]=ce,t[51]=le,t[52]=R,t[53]=n,t[54]=U):U=t[54];let W;t[55]!==u||t[56]!==g||t[57]!==te||t[58]!==R||t[59]!==r?(W=te&&!R?(0,$.jsx)(`div`,{className:`flex min-h-16 w-full items-center justify-center p-3`,"data-testid":`excalidraw-embed-snapshot`,children:(0,$.jsx)(`img`,{src:te.url,alt:r||u({id:`d-RYHO`}),draggable:!1,className:`h-auto max-h-[60vh] max-w-full`,onError:()=>{console.warn(`[ExcalidrawEmbed] snapshot image failed to decode:`,g,te?.url),g&&(T.current=!1,C({docName:g,kind:`export`}))}})}):null,t[55]=u,t[56]=g,t[57]=te,t[58]=R,t[59]=r,t[60]=W):W=t[60];let G;t[61]===z?G=t[62]:(G=z?(0,$.jsx)(`div`,{className:`m-3 min-h-16 animate-pulse rounded-md bg-muted/40`,"aria-hidden":`true`}):null,t[61]=z,t[62]=G);let ue;t[63]!==u||t[64]!==g||t[65]!==R?(ue=g&&!R?(0,$.jsx)(ee,{asChild:!0,size:`icon-sm`,variant:`secondary`,className:`absolute top-2 right-2 border-border`,title:u({id:`6M2L3X`}),"data-testid":`excalidraw-embed-open`,children:(0,$.jsx)(`a`,{href:Xi(g),"aria-label":u({id:`6M2L3X`}),children:(0,$.jsx)(Ol,{className:`size-4`,"aria-hidden":`true`})})}):null,t[63]=u,t[64]=g,t[65]=R,t[66]=ue):ue=t[66];let K=l&&ne,de;t[67]===c?de=t[68]:(de=e=>c?.(e),t[67]=c,t[68]=de);let fe=te?.url??null,pe;t[69]!==K||t[70]!==de||t[71]!==fe||t[72]!==r?(pe=(0,$.jsx)(Pv,{open:K,onOpenChange:de,snapshotUrl:fe,title:r}),t[69]=K,t[70]=de,t[71]=fe,t[72]=r,t[73]=pe):pe=t[73];let q;return t[74]!==V||t[75]!==H||t[76]!==U||t[77]!==W||t[78]!==G||t[79]!==ue||t[80]!==pe?(q=(0,$.jsxs)(`div`,{ref:w,tabIndex:-1,className:V,"data-component-type":`excalidraw`,"aria-busy":H,children:[U,W,G,ue,pe]}),t[74]=V,t[75]=H,t[76]=U,t[77]=W,t[78]=G,t[79]=ue,t[80]=pe,t[81]=q):q=t[81],q}function Dv(e){return e+1}function Ov(e){return e+1}function kv(){}function Av(){}var jv=.5,Mv=4,Nv=.25;function Pv(e){let t=(0,Q.c)(33),{open:n,onOpenChange:r,snapshotUrl:i,title:a}=e,{_:s}=o(),c=(0,Z.useRef)(null),[l,u]=(0,Z.useState)(!1),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>{if(!e)return;let t=!1;bt().then(n=>{t||(c.current=n(e,{canvas:!0,cursor:`default`,maxScale:Mv,minScale:jv,step:Nv,noBind:!0,touchAction:`auto`}),u(!1))}).catch(e=>{console.warn(`[ExcalidrawEmbed] panzoom setup failed:`,e),t||u(!0)});let n=e=>{let t=c.current;if(!t)return;if(e.preventDefault(),e.ctrlKey||e.metaKey){t.zoomWithWheel(e);return}let n=typeof t.getScale==`function`?t.getScale():1,r=n>0?n:1;t.pan(-e.deltaX/r,-e.deltaY/r,{relative:!0})},r=e.parentElement;return r?.addEventListener(`wheel`,n,{passive:!1}),()=>{t=!0,r?.removeEventListener(`wheel`,n),c.current?.destroy(),c.current=null}},t[0]=d):d=t[0];let f=d,p;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(p={"--tw-enter-scale":`0.92`,"--tw-exit-scale":`0.92`},t[1]=p):p=t[1];let m;t[2]!==s||t[3]!==a?(m=a||s({id:`d-RYHO`}),t[2]=s,t[3]=a,t[4]=m):m=t[4];let h;t[5]===m?h=t[6]:(h=(0,$.jsx)(ki,{className:`sr-only`,children:m}),t[5]=m,t[6]=h);let g;t[7]===s?g=t[8]:(g=s({id:`F8DaWi`}),t[7]=s,t[8]=g);let _;t[9]===g?_=t[10]:(_=(0,$.jsx)(`span`,{className:`absolute top-2 left-3 flex h-7 items-center text-xs text-muted-foreground`,children:g}),t[9]=g,t[10]=_);let v;t[11]!==s||t[12]!==i||t[13]!==a?(v=i?(0,$.jsx)(`img`,{ref:f,src:i,alt:a||s({id:`d-RYHO`}),draggable:!1,className:`max-h-full max-w-full`}):null,t[11]=s,t[12]=i,t[13]=a,t[14]=v):v=t[14];let y;t[15]===v?y=t[16]:(y=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,"data-testid":`excalidraw-lightbox-canvas`,children:v}),t[15]=v,t[16]=y);let b;t[17]===s?b=t[18]:(b=s({id:`iBei3o`}),t[17]=s,t[18]=b);let x;t[19]!==l||t[20]!==b?(x=(0,$.jsx)(Ct,{panzoomRef:c,label:b,testId:`excalidraw-lightbox-actions`,unavailable:l}),t[19]=l,t[20]=b,t[21]=x):x=t[21];let S;t[22]!==x||t[23]!==y?(S=(0,$.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 overflow-hidden`,children:[y,x]}),t[22]=x,t[23]=y,t[24]=S):S=t[24];let C;t[25]!==S||t[26]!==h||t[27]!==_?(C=(0,$.jsxs)(Ai,{className:`h-[calc(100dvh-5rem)] w-[calc(100dvw-5rem)] max-w-none gap-0 p-2 pt-10 duration-200 sm:max-w-none`,style:p,children:[h,_,S]}),t[25]=S,t[26]=h,t[27]=_,t[28]=C):C=t[28];let w;return t[29]!==r||t[30]!==n||t[31]!==C?(w=(0,$.jsx)(Fi,{open:n,onOpenChange:r,children:C}),t[29]=r,t[30]=n,t[31]=C,t[32]=w):w=t[32],w}function Fv(e){if(!e)return``;let t,n=null;try{let r=new URL(e,`https://placeholder.local`);n=r.protocol,t=r.pathname}catch{t=e.split(`?`)[0]??e}if(n===`data:`||n===`blob:`)return``;let r=t.split(`/`),i=r[r.length-1]??``;try{return decodeURIComponent(i)}catch{return i}}function Iv(e){let t=(0,Q.c)(18),n;t[0]!==e.name||t[1]!==e.src?(n=e.name?.trim()||Fv(e.src)||`Untitled file`,t[0]=e.name,t[1]=e.src,t[2]=n):n=t[2];let r=n,i=e.size?.trim()?e.size:null,a;t[3]===e.src?a=t[4]:(a=e.src?go(e.src):void 0,t[3]=e.src,t[4]=a);let o=a,s;t[5]===o?s=t[6]:(s=e=>{e.stopPropagation(),e.preventDefault(),o&&window.open(o,`_blank`,`noopener,noreferrer`)},t[5]=o,t[6]=s);let c=s,l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(Al,{className:`ok-file-icon`,"aria-hidden":`true`}),t[7]=l):l=t[7];let u;t[8]===r?u=t[9]:(u=(0,$.jsx)(`span`,{className:`ok-file-name`,children:r}),t[8]=r,t[9]=u);let d;t[10]===i?d=t[11]:(d=i?(0,$.jsx)(`span`,{className:`ok-file-size`,children:i}):null,t[10]=i,t[11]=d);let f;return t[12]!==c||t[13]!==o||t[14]!==e.title||t[15]!==u||t[16]!==d?(f=(0,$.jsxs)(`a`,{href:o,title:e.title,className:`ok-file-attachment`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:Lv,onClick:c,children:[l,u,d]}),t[12]=c,t[13]=o,t[14]=e.title,t[15]=u,t[16]=d,t[17]=f):f=t[17],f}function Lv(e){return e.stopPropagation()}function Rv(){return Z.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-unzoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},Z.createElement(`path`,{d:`M 14.144531 1.148438 L 9 6.292969 L 9 3 L 8 3 L 8 8 L 13 8 L 13 7 L 9.707031 7 L 14.855469 1.851563 Z M 8 8 L 3 8 L 3 9 L 6.292969 9 L 1.148438 14.144531 L 1.851563 14.855469 L 7 9.707031 L 7 13 L 8 13 Z`}))}function zv(){return Z.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-zoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},Z.createElement(`path`,{d:`M 9 1 L 9 2 L 12.292969 2 L 2 12.292969 L 2 9 L 1 9 L 1 14 L 6 14 L 6 13 L 2.707031 13 L 13 2.707031 L 13 6 L 14 6 L 14 1 Z`}))}function Bv(e){return typeof Element>`u`?!1:e instanceof Element}var Vv=(e,t)=>Bv(t)&&t.tagName.toUpperCase()===e,Hv=e=>Vv(`DIV`,e)||Vv(`SPAN`,e),Uv=e=>Vv(`IMG`,e),Wv=e=>e.complete&&e.naturalHeight!==0,Gv=e=>Vv(`SVG`,e),Kv=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),qv=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:i})=>{let a=Kv({height:r,offset:n,width:i}),o=i>r?i/t:r/e;return a>1?o:a*o},Jv=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:i,targetWidth:a})=>e===0||t===0?1:!n&&i!==0&&a!==0?qv({containerHeight:e,containerWidth:t,offset:r,targetHeight:i,targetWidth:a}):Kv({height:e,offset:r,width:t}),Yv=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,Xv=e=>{if(e!==null){if(Uv(e))return e.currentSrc===``?void 0:e.currentSrc;if(Hv(e)){let{backgroundImage:t}=window.getComputedStyle(e);if(t!==``)return Yv.exec(t)?.[1]}}},Zv=e=>{if(e!==null)return Uv(e)?e.alt:e.getAttribute(`aria-label`)??void 0},Qv=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s})=>{let c=Jv({containerHeight:e,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s});return{top:n,left:t,width:r*c,height:e*c,transform:`translate(0,0) scale(${1/c})`}},$v=({position:e,relativeNum:t})=>{let n=parseFloat(e);return e.endsWith(`%`)?t*n/100:n},ey=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,objectFit:a,objectPosition:o,offset:s,targetHeight:c,targetWidth:l})=>{let u=a;if(u===`scale-down`&&(u=l<=r&&c<=e?`none`:`contain`),u===`cover`||u===`contain`){let a=r/l,d=e/c,f=u===`cover`?Math.max(a,d):Math.min(a,d),[p=`50%`,m=`50%`]=o.split(` `),h=$v({position:p,relativeNum:r-l*f}),g=$v({position:m,relativeNum:e-c*f}),_=Jv({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+g,left:t+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(u===`none`){let[a=`50%`,u=`50%`]=o.split(` `),d=$v({position:a,relativeNum:r-l}),f=$v({position:u,relativeNum:e-c}),p=Jv({containerHeight:c,containerWidth:l,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+f,left:t+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else if(u===`fill`){let t=r/l,n=e/c,a=Math.max(t,n),o=Jv({containerHeight:c*a,containerWidth:l*a,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{width:r*o,height:e*o,transform:`translate(0,0) scale(${1/o})`}}else return{}},ty=({backgroundPosition:e,backgroundSize:t,containerHeight:n,containerLeft:r,containerTop:i,containerWidth:a,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l})=>{if(t===`cover`||t===`contain`){let u=a/l,d=n/c,f=t===`cover`?Math.max(u,d):Math.min(u,d),[p=`50%`,m=`50%`]=e.split(` `),h=$v({position:p,relativeNum:a-l*f}),g=$v({position:m,relativeNum:n-c*f}),_=Jv({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+g,left:r+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(t===`auto`){let[t=`50%`,u=`50%`]=e.split(` `),d=$v({position:t,relativeNum:a-l}),f=$v({position:u,relativeNum:n-c}),p=Jv({containerHeight:c,containerWidth:l,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+f,left:r+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else{let[u=`50%`,d=`50%`]=t.split(` `),f=$v({position:u,relativeNum:a}),p=$v({position:d,relativeNum:n}),m=f/l,h=p/c,g=Math.min(m,h),[_=`50%`,v=`50%`]=e.split(` `),y=$v({position:_,relativeNum:a-l*g}),b=$v({position:v,relativeNum:n-c*g}),x=Jv({containerHeight:c*g,containerWidth:l*g,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+b,left:r+y,width:l*g*x,height:c*g*x,transform:`translate(0,0) scale(${1/x})`}}},ny=/\.svg$/i,ry=({hasZoomImg:e,imgSrc:t,isSvg:n,isZoomed:r,loadedImgEl:i,offset:a,shouldRefresh:o,targetEl:s})=>{let c=n||t?.slice(0,18)===`data:image/svg+xml`||e||t!==void 0&&ny.test(t),l=s.getBoundingClientRect(),u=window.getComputedStyle(s),d=i!=null&&Hv(s),f=i!=null&&!d,p=i!=null&&i.naturalHeight!==0?i.naturalHeight:l.height,m=i!=null&&i.naturalWidth!==0?i.naturalWidth:l.width,h=Qv({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}),g=f?ey({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,objectFit:u.objectFit,objectPosition:u.objectPosition,offset:a,targetHeight:p,targetWidth:m}):void 0,_=d?ty({backgroundPosition:u.backgroundPosition,backgroundSize:u.backgroundSize,containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}):void 0,v={...h,...g,..._};if(r){let e=window.innerWidth/2,t=window.innerHeight/2,n=parseFloat(String(v.left??0))+parseFloat(String(v.width??0))/2,r=parseFloat(String(v.top??0))+parseFloat(String(v.height??0))/2,i=e-n,a=t-r;o&&(v.transitionDuration=`0.01ms`),v.transform=`translate(${i}px,${a}px) scale(1)`}return v},iy=e=>{if(e==null)return{};if(Gv(e)){let{parentElement:t}=e,n=e.getBoundingClientRect();if(t==null)return{height:n.height,left:n.left,width:n.width,top:n.top};{let e=t.getBoundingClientRect();return{height:n.height,left:e.left-n.left,top:e.top-n.top,width:n.width}}}else return{height:e.offsetHeight,left:e.offsetLeft,width:e.offsetWidth,top:e.offsetTop}},ay=e=>{let t=`-zoom`,n=[`clip-path`,`fill`,`mask`,`marker-start`,`marker-mid`,`marker-end`],r=new Map;if(e.hasAttribute(`id`)){let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}e.querySelectorAll(`[id]`).forEach(e=>{let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}),r.forEach((t,r)=>{let i=`url(#${r})`,a=`url(#${t})`,o=n.map(e=>`[${e}="${i}"]`).join(`, `);e.querySelectorAll(o).forEach(e=>{n.forEach(t=>{e.getAttribute(t)===i&&e.setAttribute(t,a)})})}),e.querySelectorAll(`style`).forEach(e=>{r.forEach((t,n)=>{let{textContent:r}=e;if(r!==``){let i=e;i.textContent=r.replaceAll(`#${n}`,`#${t}`)}})})},oy=[`img`,`svg`,`[role="img"]`,`[data-zoom]`].map(e=>`${e}:not([aria-hidden="true"])`).join(`,`),sy={overflow:``,width:``};function cy(){let e=document.querySelector(`[data-rmiz-portal]`);if(e!=null)return e;let t=document.createElement(`div`);return t.setAttribute(`data-rmiz-portal`,``),document.body.appendChild(t),t}function ly(e){e.preventDefault()}function uy(e){return Z.createElement(dy,{...e})}var dy=class extends Z.Component{constructor(){super(...arguments),this.state={id:``,isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:`UNLOADED`,shouldRefresh:!1,styleGhost:{}},this.refContent=Z.createRef(),this.refDialog=Z.createRef(),this.refModalContent=Z.createRef(),this.refModalImg=Z.createRef(),this.refWrap=Z.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=sy,this.styleModalImg={},this.handleModalStateChange=e=>{let{state:{modalState:t}}=this;e!==`LOADING`&&t===`LOADING`?(this.loadZoomImg(),window.addEventListener(`resize`,this.handleResize,{passive:!0}),window.addEventListener(`touchstart`,this.handleTouchStart,{passive:!0}),window.addEventListener(`touchmove`,this.handleTouchMove,{passive:!0}),window.addEventListener(`touchend`,this.handleTouchEnd,{passive:!0}),window.addEventListener(`touchcancel`,this.handleTouchCancel,{passive:!0}),document.addEventListener(`keydown`,this.handleKeyDown,!0)):e!==`LOADED`&&t===`LOADED`?window.addEventListener(`wheel`,this.handleWheel,{passive:!0}):e!==`UNLOADING`&&t===`UNLOADING`?(this.ensureImgTransitionEnd(),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),document.removeEventListener(`keydown`,this.handleKeyDown,!0)):e!==`UNLOADED`&&t===`UNLOADED`&&(this.bodyScrollEnable(),window.removeEventListener(`resize`,this.handleResize),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),this.refDialog.current?.close())},this.setId=()=>{let e=()=>Math.random().toString(16).slice(-4);this.setState({id:e()+e()+e()})},this.setAndTrackImg=()=>{let{refContent:{current:e}}=this;e!=null&&(this.imgEl=e.querySelector(oy),this.imgEl===null?this.contentNotFoundChangeObserver??(this.contentNotFoundChangeObserver=new MutationObserver(this.setAndTrackImg),this.contentNotFoundChangeObserver.observe(e,{childList:!0,subtree:!0})):(this.contentNotFoundChangeObserver?.disconnect(),this.imgEl.addEventListener(`load`,this.handleImgLoad),this.imgEl.addEventListener(`click`,this.handleZoom),this.state.loadedImgEl??this.handleImgLoad(),this.imgElResizeObserver=new ResizeObserver(e=>{let[t]=e;t?.target!==void 0&&(this.imgEl=t.target,this.setState({styleGhost:iy(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver??(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:iy(this.imgEl)})}),this.contentChangeObserver.observe(e,{attributes:!0,childList:!0,subtree:!0}))))},this.handleIfZoomChanged=e=>{let{props:{isZoomed:t}}=this;!e&&t?this.zoom():e&&!t&&this.unzoom()},this.handleImgLoad=()=>{let e=Xv(this.imgEl);if(e==null||e===``)return;let t=new Image,{imgEl:n}=this;if(Uv(n)){let{sizes:e,srcset:r,crossOrigin:i}=n;t.sizes=e,t.srcset=r,t.crossOrigin=i}t.src=e;let r=()=>{this.setState({loadedImgEl:t,styleGhost:iy(this.imgEl)})};t.decode().then(r).catch(()=>{if(Wv(t)){r();return}t.onload=r})},this.handleZoom=e=>{this.props.isDisabled!==!0&&this.hasImage()&&this.props.onZoomChange?.(!0,{event:e})},this.handleUnzoom=e=>{this.props.isDisabled!==!0&&this.props.onZoomChange?.(!1,{event:e})},this.handleBtnUnzoomClick=e=>{e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e)},this.handleDialogClick=e=>{(e.target===this.refModalContent.current||e.target===this.refModalImg.current)&&(e.stopPropagation(),this.handleUnzoom(e))},this.handleDialogClose=e=>{e.stopPropagation(),this.handleUnzoom(e)},this.handleKeyDown=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e))},this.handleWheel=e=>{e.ctrlKey||(e.stopPropagation(),queueMicrotask(()=>{this.handleUnzoom(e)}))},this.handleTouchStart=e=>{if(e.touches.length>1){this.isScaling=!0;return}let{changedTouches:t}=e,[n]=t;if(t.length===1&&n!==void 0){let{screenY:e}=n;this.touchYStart=e}},this.handleTouchMove=e=>{let t=window.visualViewport?.scale??1,{changedTouches:n}=e,[r]=n;if(this.props.canSwipeToUnzoom&&!this.isScaling&&t<=1&&this.touchYStart!=null&&r!==void 0){let{screenY:t}=r;this.touchYEnd=t;let n=Math.max(this.touchYStart,this.touchYEnd),i=Math.min(this.touchYStart,this.touchYEnd);Math.abs(n-i)>this.props.swipeToUnzoomThreshold&&(this.touchYStart=void 0,this.touchYEnd=void 0,this.handleUnzoom(e))}},this.handleTouchEnd=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleTouchCancel=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleResize=()=>{this.setState({shouldRefresh:!0})},this.hasImage=()=>this.imgEl!==null&&(this.state.loadedImgEl!==void 0||Gv(this.imgEl))&&window.getComputedStyle(this.imgEl).display!==`none`,this.zoom=()=>{this.bodyScrollDisable(),this.refDialog.current?.showModal(),this.refModalImg.current?.addEventListener(`transitionend`,this.handleImgTransitionEnd),this.setState({modalState:`LOADING`})},this.unzoom=()=>{this.setState({modalState:`UNLOADING`})},this.handleImgTransitionEnd=()=>{clearTimeout(this.timeoutTransitionEnd),this.state.modalState===`LOADING`?this.setState({modalState:`LOADED`}):this.state.modalState===`UNLOADING`&&this.setState({shouldRefresh:!1,modalState:`UNLOADED`})},this.ensureImgTransitionEnd=()=>{if(this.refModalImg.current!==null){let{transitionDuration:e}=window.getComputedStyle(this.refModalImg.current),t=parseFloat(e);if(t!==0&&!Number.isNaN(t)){let n=t*(e.endsWith(`ms`)?1:1e3)+50;this.timeoutTransitionEnd=setTimeout(this.handleImgTransitionEnd,n)}}},this.bodyScrollDisable=()=>{this.prevBodyAttrs={overflow:document.body.style.overflow,width:document.body.style.width};let{body:{clientWidth:e}}=document;document.body.style.overflow=`hidden`,document.body.style.width=`${e}px`},this.bodyScrollEnable=()=>{let{prevBodyAttrs:{overflow:e,width:t}}=this;document.body.style.width=t,document.body.style.overflow=e,this.prevBodyAttrs=sy},this.loadZoomImg=()=>{let{props:{zoomImg:e}}=this;if(e==null)return;let{src:t}=e;if(t!==void 0&&t!==``){let n=new Image;n.sizes=e.sizes??``,n.srcset=e.srcSet??``,n.crossOrigin=e.crossOrigin??void 0,n.src=t;let r=()=>{this.setState({isZoomImgLoaded:!0})};n.decode().then(r).catch(()=>{if(Wv(n)){r();return}n.onload=r})}},this.UNSAFE_handleSvg=()=>{let{imgEl:e,refModalImg:t,styleModalImg:n}=this;if(Gv(e)){let r=e.cloneNode(!0);ay(r),r.style.width=`${n.width??0}px`,r.style.height=`${n.height??0}px`,r.addEventListener(`click`,this.handleUnzoom),t.current?.firstChild?.remove(),t.current?.appendChild(r)}}}render(){let{handleBtnUnzoomClick:e,handleDialogClick:t,handleDialogClose:n,handleUnzoom:r,handleZoom:i,imgEl:a,props:{a11yNameButtonUnzoom:o,a11yNameButtonZoom:s,children:c,classDialog:l,IconUnzoom:u,IconZoom:d,isZoomed:f,wrapElement:p,ZoomContent:m,zoomImg:h,zoomMargin:g},refContent:_,refDialog:v,refModalContent:y,refModalImg:b,refWrap:x,state:{id:S,isZoomImgLoaded:C,loadedImgEl:w,modalState:T,shouldRefresh:E,styleGhost:D}}=this,O=`rmiz-modal-${S}`,k=`rmiz-modal-img-${S}`,A=Hv(a),j=Uv(a),M=Gv(a),N=Zv(a),P=Xv(a),F=j?a.sizes:void 0,I=j?a.srcset:void 0,L=j?a.crossOrigin:void 0,ee=h?.src!==void 0&&h.src!==``,R=this.hasImage(),te=N!==void 0&&N!==``?`${s}: ${N}`:s,ne=T===`LOADING`||T===`LOADED`,re=R?`found`:`not-found`,ie=T===`UNLOADED`||T===`UNLOADING`?`hidden`:`visible`,ae={visibility:T===`UNLOADED`?`visible`:`hidden`};this.styleModalImg=R&&a!==null?ry({hasZoomImg:ee,imgSrc:P,isSvg:M,isZoomed:f&&ne,loadedImgEl:w,offset:g,shouldRefresh:E,targetEl:a}):{};let oe=null;if(R){let t=j||A?Z.createElement(`img`,{alt:N,crossOrigin:L,sizes:F,src:P,srcSet:I,...C&&T===`LOADED`?h:{},"data-rmiz-modal-img":``,height:this.styleModalImg.height??void 0,id:k,ref:b,style:this.styleModalImg,width:this.styleModalImg.width??void 0}):M?Z.createElement(`div`,{"data-rmiz-modal-img":!0,ref:b,style:this.styleModalImg}):null,n=Z.createElement(`button`,{"aria-label":o,"data-rmiz-btn-unzoom":``,onClick:e,type:`button`},Z.createElement(u,null));oe=m==null?Z.createElement(Z.Fragment,null,t,n):Z.createElement(m,{buttonUnzoom:n,modalState:T,img:t,isZoomImgLoaded:C,onUnzoom:r})}return Z.createElement(p,{"aria-owns":R?O:void 0,"data-rmiz":``,ref:x},Z.createElement(p,{"data-rmiz-content":re,ref:_,style:ae},c),R&&Z.createElement(p,{"data-rmiz-ghost":``,style:D},Z.createElement(`button`,{"aria-label":te,"data-rmiz-btn-zoom":``,onClick:i,type:`button`},Z.createElement(d,null))),R&&ts.createPortal(Z.createElement(`dialog`,{"aria-labelledby":k,"aria-modal":`true`,className:l,"data-rmiz-modal":``,id:O,onClick:t,onClose:n,onCancel:ly,ref:v,role:`dialog`},Z.createElement(`div`,{"data-rmiz-modal-overlay":ie}),Z.createElement(`div`,{"data-rmiz-modal-content":``,ref:y},oe)),cy()))}componentDidMount(){this.setId(),this.setAndTrackImg(),this.handleImgLoad(),this.UNSAFE_handleSvg()}componentWillUnmount(){this.state.modalState!==`UNLOADED`&&this.bodyScrollEnable(),this.contentChangeObserver?.disconnect(),this.contentNotFoundChangeObserver?.disconnect(),this.imgElResizeObserver?.disconnect(),this.imgEl?.removeEventListener(`load`,this.handleImgLoad),this.imgEl?.removeEventListener(`click`,this.handleZoom),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),window.removeEventListener(`resize`,this.handleResize),document.removeEventListener(`keydown`,this.handleKeyDown,!0)}componentDidUpdate(e,t){this.handleModalStateChange(t.modalState),this.UNSAFE_handleSvg(),this.handleIfZoomChanged(e.isZoomed)}};dy.defaultProps={a11yNameButtonUnzoom:`Minimize image`,a11yNameButtonZoom:`Expand image`,canSwipeToUnzoom:!0,IconUnzoom:Rv,IconZoom:zv,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:`div`,zoomMargin:0};function fy({onZoomChange:e,...t}){let[n,r]=Z.useState(!1),i=Z.useCallback((t,{event:n})=>{r(t),e?.(t,{event:n})},[e]);return Z.createElement(uy,{...t,isZoomed:n,onZoomChange:i})}var py=e(t(((e,t)=>{(function(e){let n=`(0?\\d+|0x[a-f0-9]+)`,r={fourOctet:RegExp(`^${n}\\.${n}\\.${n}\\.${n}$`,`i`),threeOctet:RegExp(`^${n}\\.${n}\\.${n}$`,`i`),twoOctet:RegExp(`^${n}\\.${n}$`,`i`),longValue:RegExp(`^${n}$`,`i`)},i=RegExp(`^0[0-7]+$`,`i`),a=RegExp(`^0x[a-f0-9]+$`,`i`),o=`%[0-9a-z]{1,}`,s=`(?:[0-9a-f]+::?)+`,c={zoneIndex:new RegExp(o,`i`),native:RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,`i`),deprecatedTransitional:RegExp(`^(?:::)(${n}\\.${n}\\.${n}\\.${n}(${o})?)$`,`i`),transitional:RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\.${n}\\.${n}\\.${n}(${o})?$`,`i`)};function l(e,t){if(e.indexOf(`::`)!==e.lastIndexOf(`::`))return null;let n=0,r=-1,i=(e.match(c.zoneIndex)||[])[0],a,o;for(i&&(i=i.substring(1),e=e.replace(/%.+$/,``));(r=e.indexOf(`:`,r+1))>=0;)n++;if(e.substr(0,2)===`::`&&n--,e.substr(-2,2)===`::`&&n--,n>t)return null;for(o=t-n,a=`:`;o--;)a+=`0:`;return e=e.replace(`::`,a),e[0]===`:`&&(e=e.slice(1)),e[e.length-1]===`:`&&(e=e.slice(0,-1)),t=(function(){let t=e.split(`:`),n=[];for(let e=0;e<t.length;e++)n.push(parseInt(t[e],16));return n})(),{parts:t,zoneId:i}}function u(e,t,n,r){if(e.length!==t.length)throw Error(`ipaddr: cannot match CIDR for objects with different lengths`);let i=0,a;for(;r>0;){if(a=n-r,a<0&&(a=0),e[i]>>a!==t[i]>>a)return!1;r-=n,i+=1}return!0}function d(e){if(a.test(e))return parseInt(e,16);if(e[0]===`0`&&!isNaN(parseInt(e[1],10))){if(i.test(e))return parseInt(e,8);throw Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}let p={};p.IPv4=(function(){function e(e){if(e.length!==4)throw Error(`ipaddr: ipv4 octet count should be 4`);let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw Error(`ipaddr: ipv4 octet should fit in 8 bits`);this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return`ipv4`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv4`)throw Error(`ipaddr: cannot match ipv4 address with non-ipv4 one`);return u(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r,i,a;for(r=3;r>=0;--r)if(i=this.octets[r],i in n){if(a=n[i],t&&a!==0)return null;a!==8&&(t=!0),e+=a}else return null;return 32-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(`.`)},e})(),p.IPv4.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<4;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.isIPv4=function(e){return this.parser(e)!==null},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!!(p.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){let t=e.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(e)||!t?!1:p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<4;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.parse=function(e){let t=this.parser(e);if(t===null)throw Error(`ipaddr: string is not formatted like an IPv4 Address`);return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){let e=parseInt(t[2]);if(e>=0&&e<=32){let n=[this.parse(t[1]),e];return Object.defineProperty(n,`toString`,{value:function(){return this.join(`/`)}}),n}}throw Error(`ipaddr: string is not formatted like an IPv4 CIDR range`)},p.IPv4.parser=function(e){let t,n,i;if(t=e.match(r.fourOctet))return(function(){let e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r})();if(t=e.match(r.longValue)){if(i=d(t[1]),i>4294967295||i<0)throw Error(`ipaddr: address outside defined range`);return(function(){let e=[],t;for(t=0;t<=24;t+=8)e.push(i>>t&255);return e})().reverse()}else if(t=e.match(r.twoOctet))return(function(){let e=t.slice(1,4),n=[];if(i=d(e[1]),i>16777215||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(i>>16&255),n.push(i>>8&255),n.push(i&255),n})();else if(t=e.match(r.threeOctet))return(function(){let e=t.slice(1,5),n=[];if(i=d(e[2]),i>65535||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(d(e[1])),n.push(i>>8&255),n.push(i&255),n})();else return null},p.IPv4.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>32)throw Error(`ipaddr: invalid IPv4 prefix length`);let t=[0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.IPv6=(function(){function e(e,t){let n,r;if(e.length===16)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else if(e.length===8)this.parts=e;else throw Error(`ipaddr: ipv6 part count should be 8 or 16`);for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw Error(`ipaddr: ipv6 part should fit in 16 bits`);t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],deprecatedSiteLocal:[new e([65216,0,0,0,0,0,0,0]),10],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[[new e([100,65435,0,0,0,0,0,0]),96],[new e([100,65435,1,0,0,0,0,0]),48]],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecatedOrchid:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],segmentRouting:[new e([24320,0,0,0,0,0,0,0]),16],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32],[new e([16383,0,0,0,0,0,0,0]),20]]},e.prototype.isIPv4MappedAddress=function(){return this.range()===`ipv4Mapped`},e.prototype.kind=function(){return`ipv6`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv6`)throw Error(`ipaddr: cannot match ipv6 address with non-ipv6 one`);return u(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r,i;for(let a=7;a>=0;--a)if(r=this.parts[a],r in n){if(i=n[r],t&&i!==0)return null;i!==16&&(t=!0),e+=i}else return null;return 128-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e,t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(e&255);return t},e.prototype.toFixedLengthString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw Error(`ipaddr: trying to convert a generic ipv6 address to ipv4`);let e=this.parts.slice(-2),t=e[0],n=e[1];return new p.IPv4([t>>8,t&255,n>>8,n&255])},e.prototype.toNormalizedString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){let e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString(),n=0,r=-1,i;for(;i=e.exec(t);)i[0].length>r&&(n=i.index,r=i[0].length);return r<0?t:`${t.substring(0,n)}::${t.substring(n+r)}`},e.prototype.toString=function(){return this.toRFC5952String()},e})(),p.IPv6.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<16;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.isIPv6=function(e){return this.parser(e)!==null},p.IPv6.isValid=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{let t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<16;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.parse=function(e){let t=this.parser(e);if(t.parts===null)throw Error(`ipaddr: string is not formatted like an IPv6 Address`);return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,`toString`,{value:function(){return this.join(`/`)}}),r;throw Error(`ipaddr: string is not formatted like an IPv6 CIDR range`)},p.IPv6.parser=function(e){let t,n,r,i,a,o;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return l(e,8);if((r=e.match(c.transitional))&&(o=r[6]||``,t=r[1],r[1].endsWith(`::`)||(t=t.slice(0,-1)),t=l(t+o,6),t.parts)){for(a=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<a.length;n++)if(i=a[n],!(0<=i&&i<=255))return null;return t.parts.push(a[0]<<8|a[1]),t.parts.push(a[2]<<8|a[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>128)throw Error(`ipaddr: invalid IPv6 prefix length`);let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){let t=e.length;if(t===4)return new p.IPv4(e);if(t===16)return new p.IPv6(e);throw Error(`ipaddr: the binary input is neither an IPv6 nor IPv4 address`)},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw Error(`ipaddr: the address has neither IPv6 nor IPv4 format`)},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch{try{return p.IPv4.parseCIDR(e)}catch{throw Error(`ipaddr: the address has neither IPv6 nor IPv4 CIDR format`)}}},p.process=function(e){let t=this.parse(e);return t.kind()===`ipv6`&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,n){let r,i,a,o;for(i in n??=`unicast`,t)if(Object.prototype.hasOwnProperty.call(t,i)){for(a=t[i],a[0]&&!(a[0]instanceof Array)&&(a=[a]),r=0;r<a.length;r++)if(o=a[r],e.kind()===o[0].kind()&&e.match.apply(e,o))return i}return n},t!==void 0&&t.exports?t.exports=p:e.ipaddr=p})(e)}))(),1),my=new Set([`href`,`src`,`srcset`,`poster`,`formaction`,`xlink:href`]),hy=new Set([`aria-label`,`aria-description`,`title`]),gy=/(?:[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s"'<>]+|(?:javascript|vbscript|data|file|chrome-extension|moz-extension):[^\s"'<>]*)/gi,_y=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,vy=/\bexpression\s*\(/i,yy=/(oklch|oklab|lab|lch)\(\s*([^)]+)\s*\)/gi,by=`data-clipboard-omit`;function xy(e){let t=e.trim();return t===``||Cr.test(t)?!0:$r(t)}function Sy(e){let t=e.split(`,`);for(let e of t){let t=e.trim();if(t!==``&&!xy(t.split(/\s+/)[0]??``))return!1}return!0}function Cy(e,t){let n=!1,r=e.replace(gy,e=>xy(e)?e:(n=!0,`[blocked]`));return t?.reportNoChange&&!n?null:r}function wy(e){let t=e.toLowerCase();return t.length>=3&&t.startsWith(`on`)}function Ty(e){return e.length>1e4||_y.test(e)||vy.test(e)?``:e}function Ey(e){let t=e.indexOf(`/`),n=(t===-1?e:e.slice(0,t)).trim(),r=t===-1?null:e.slice(t+1).trim(),i=n.split(/[\s,]+/).filter(e=>e.length>0);if(i.length!==3)return null;let a=Dy(i[0],1),o=Dy(i[1],1),s=Dy(i[2],1);if(Number.isNaN(a)||Number.isNaN(o)||Number.isNaN(s))return null;let c=null;if(r!==null){if(c=Dy(r,1),Number.isNaN(c))return null;c=Math.max(0,Math.min(1,c))}return[a,o,s,c]}function Dy(e,t){return e===`none`?0:e.endsWith(`%`)?Number.parseFloat(e.slice(0,-1))/100*t:Number.parseFloat(e)}function Oy(e,t,n){let r=n*Math.PI/180;return[e,t*Math.cos(r),t*Math.sin(r)]}function ky(e,t,n){let r=e+.3963377774*t+.2158037573*n,i=e-.1055613458*t-.0638541728*n,a=e-.0894841775*t-1.291485548*n,o=r**3,s=i**3,c=a**3;return[4.0767416621*o-3.3077115913*s+.2309699292*c,-1.2684380046*o+2.6097574011*s-.3413193965*c,-.0041960863*o-.7034186147*s+1.707614701*c]}function Ay(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function jy(e){return Number.isFinite(e)?Math.max(0,Math.min(255,Math.round(e*255))):0}function My(e,t,n,r){let i=e.toLowerCase(),a,o,s;i===`oklch`?[a,o,s]=Oy(t,n,r):i===`oklab`?[a,o,s]=[t,n,r]:i===`lch`?[a,o,s]=Oy(t/100,n/100,r):[a,o,s]=[t/100,n/100,r/100];let[c,l,u]=ky(a,o,s);return[jy(Ay(c)),jy(Ay(l)),jy(Ay(u))]}function Ny(e){if(e.length>1e4)return e;let t=e.toLowerCase();return!t.includes(`oklch`)&&!t.includes(`oklab`)&&!t.includes(`lab`)&&!t.includes(`lch`)?e:e.replace(yy,(e,t,n)=>{let r=Ey(n);if(r===null)return e;let[i,a,o,s]=r,[c,l,u]=My(t,i,a,o);return s===null?`rgb(${c}, ${l}, ${u})`:`rgba(${c}, ${l}, ${u}, ${s})`})}var Py=new Set([`mailto`,`tel`,`sms`,`ftp`,`ftps`]);function Fy(e){let t=e.trim();if(t.startsWith(`#`))return{portable:!0};if($r(t))return t.startsWith(`/`)?{portable:!1,reason:`server-absolute`}:{portable:!1,reason:`relative`};let n=new URL(t),r=n.protocol.slice(0,-1).toLowerCase();if(Py.has(r))return{portable:!0};if(r!==`http`&&r!==`https`)return{portable:!1,reason:`other`};let i=n.hostname.toLowerCase();if(i===``)return{portable:!1,reason:`other`};let a=i.endsWith(`.`)?i.slice(0,-1):i;if(a===`localhost`||a.endsWith(`.localhost`))return{portable:!1,reason:`localhost`};let o=i.startsWith(`[`)&&i.endsWith(`]`)?i.slice(1,-1):i;return py.IPv4.isValid(o)?py.IPv4.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:py.IPv6.isValid(o)?py.IPv6.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:{portable:!0}}function Iy(e,t){return typeof e==`number`&&typeof t==`number`&&e>0&&t>0}function Ly(e,t,n){return Iy(e,t)?{...n,width:`${e}px`,aspectRatio:`${e} / ${t}`}:n}function Ry(e){let t=(0,Q.c)(75),n,r,i,a,s,c,l,u,f,p,m,h,g;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13]):({width:g,height:r,loadingTestId:f,slotTestId:p,slotClassName:c,className:n,onLoad:s,onError:a,src:l,style:u,alt:m,targetExistence:h,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g);let _=f===void 0?`image-loading-skeleton`:f,v=p===void 0?`image-slot`:p,y=m===void 0?``:m,b=h===void 0?`unknown`:h,{_:x}=o(),S=(0,Z.useRef)(null),[C,w]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(!1),[D,O]=(0,Z.useState)(0),k;t[14]!==r||t[15]!==g?(k=Iy(g,r),t[14]=r,t[15]=g,t[16]=k):k=t[16];let A=k,j;t[17]!==r||t[18]!==u||t[19]!==g?(j=Ly(g,r,u),t[17]=r,t[18]=u,t[19]=g,t[20]=j):j=t[20];let M=j,N;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>{let e=S.current;if(e?.complete){if(w(!0),E(!1),typeof e.decode==`function`){let t=!1;return e.decode().then(By,()=>{t||E(!0)}),()=>{t=!0}}}else w(!1),E(!1)},t[21]=N):N=t[21];let P;t[22]!==D||t[23]!==l?(P=[l,D],t[22]=D,t[23]=l,t[24]=P):P=t[24],(0,Z.useLayoutEffect)(N,P);let F=(0,Z.useRef)(b),I,L;t[25]===b?(I=t[26],L=t[27]):(L=()=>{let e=F.current;F.current=b,e===`missing`&&b!==`missing`&&(w(!1),E(!1),O(zy))},I=[b],t[25]=b,t[26]=I,t[27]=L),(0,Z.useEffect)(L,I);let ee=b===`missing`?`not-found`:T?`undisplayable`:null,R=y&&y.length>0?y:l??``,te;t[28]!==x||t[29]!==ee?(te=x(ee===`not-found`?{id:`1pdLQw`}:{id:`XGKy1z`}),t[28]=x,t[29]=ee,t[30]=te):te=t[30];let ne=te,re;t[31]!==x||t[32]!==ee||t[33]!==R?(re=x(ee===`not-found`?{id:`kI5pWt`,values:{errorLabel:R}}:{id:`VZg6Gn`,values:{errorLabel:R}}),t[31]=x,t[32]=ee,t[33]=R,t[34]=re):re=t[34];let ie=re,ae=ee?`true`:void 0,oe=ee??void 0,se=!A&&!C&&!ee&&`aspect-[16/9] w-full max-w-full`,z;t[35]!==c||t[36]!==se?(z=d(`relative inline-block overflow-hidden`,se,c),t[35]=c,t[36]=se,t[37]=z):z=t[37];let B;t[38]!==x||t[39]!==ee||t[40]!==C||t[41]!==_?(B=!C&&!ee&&(0,$.jsx)(`span`,{"data-testid":_,role:`status`,"aria-busy":`true`,"aria-label":x({id:`N1YYa7`}),className:`absolute inset-0 animate-pulse rounded-md bg-muted motion-reduce:animate-none`}),t[38]=x,t[39]=ee,t[40]=C,t[41]=_,t[42]=B):B=t[42];let ce=ee?!0:void 0,le=C?`opacity-100`:`opacity-0`,V;t[43]!==n||t[44]!==le?(V=d(`block max-w-full transition-opacity motion-reduce:transition-none`,le,n),t[43]=n,t[44]=le,t[45]=V):V=t[45];let H;t[46]===s?H=t[47]:(H=e=>{w(!0),E(!1),s?.(e)},t[46]=s,t[47]=H);let U;t[48]===a?U=t[49]:(U=e=>{w(!0),E(!0),a?.(e)},t[48]=a,t[49]=U);let W;t[50]!==y||t[51]!==r||t[52]!==i||t[53]!==D||t[54]!==l||t[55]!==ce||t[56]!==V||t[57]!==H||t[58]!==U||t[59]!==g?(W=(0,Z.createElement)(`img`,{...i,key:D,ref:S,src:l,alt:y,width:g,height:r,hidden:ce,className:V,onLoad:H,onError:U}),t[50]=y,t[51]=r,t[52]=i,t[53]=D,t[54]=l,t[55]=ce,t[56]=V,t[57]=H,t[58]=U,t[59]=g,t[60]=W):W=t[60];let G;t[61]!==ie||t[62]!==ee||t[63]!==ne||t[64]!==l?(G=ee&&(0,$.jsxs)(`span`,{role:`img`,"aria-label":ie,"data-clipboard-omit":`true`,className:`ok-image-error-placeholder box-border inline-grid max-w-full grid-cols-[auto_minmax(0,1fr)] items-start gap-x-2 rounded-md border border-dashed px-2 py-1 text-foreground`,children:[(0,$.jsx)(Il,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`ok-image-error-message block text-xs font-medium`,children:ne}),l?(0,$.jsx)(`span`,{className:`ok-image-error-target block max-w-[24ch] truncate font-mono text-xs`,title:l,children:l}):null]})]}),t[61]=ie,t[62]=ee,t[63]=ne,t[64]=l,t[65]=G):G=t[65];let ue;return t[66]!==M||t[67]!==v||t[68]!==ae||t[69]!==oe||t[70]!==z||t[71]!==B||t[72]!==W||t[73]!==G?(ue=(0,$.jsxs)(`span`,{"data-testid":v,"data-image-error":ae,"data-image-error-kind":oe,className:z,style:M,children:[B,W,G]}),t[66]=M,t[67]=v,t[68]=ae,t[69]=oe,t[70]=z,t[71]=B,t[72]=W,t[73]=G,t[74]=ue):ue=t[74],ue}function zy(e){return e+1}function By(){}function Vy(e,t,n,r){return Qa(e,t,{literal:!1})===null?`unknown`:or(e,t,n,r,{literal:!1})?`exists`:`missing`}function Hy(e){let t=(0,Q.c)(4),n=Po();if(e===void 0||e===``)return`missing`;if(n===null||n.loading)return`unknown`;let r;return t[0]!==n.assetPaths||t[1]!==n.filePaths||t[2]!==e?(r=Vy(e,``,n.assetPaths,n.filePaths),t[0]=n.assetPaths,t[1]=n.filePaths,t[2]=e,t[3]=r):r=t[3],r}function Uy(e){return e??`lazy`}function Wy(e){if(typeof e!=`string`)return e;let t=Number(e);return Number.isFinite(t)&&t>0?t:e}function Gy(e){let t=(0,Q.c)(22),n=Hy(e.src),r;t[0]===e.src?r=t[1]:(r=e.src===void 0?void 0:go(e.src),t[0]=e.src,t[1]=r);let i=e.alt??``,a;t[2]===e.width?a=t[3]:(a=Wy(e.width),t[2]=e.width,t[3]=a);let o;t[4]===e.height?o=t[5]:(o=Wy(e.height),t[4]=e.height,t[5]=o);let s=e.title,c;t[6]===e.loading?c=t[7]:(c=Uy(e.loading),t[6]=e.loading,t[7]=c);let l;return t[8]!==e.crossorigin||t[9]!==e.decoding||t[10]!==e.fetchpriority||t[11]!==e.referrerpolicy||t[12]!==e.sizes||t[13]!==e.srcset||t[14]!==e.title||t[15]!==r||t[16]!==i||t[17]!==a||t[18]!==o||t[19]!==c||t[20]!==n?(l=(0,$.jsx)(Ry,{src:r,alt:i,width:a,height:o,title:s,loading:c,srcSet:e.srcset,sizes:e.sizes,decoding:e.decoding,fetchPriority:e.fetchpriority,crossOrigin:e.crossorigin,referrerPolicy:e.referrerpolicy,targetExistence:n}),t[8]=e.crossorigin,t[9]=e.decoding,t[10]=e.fetchpriority,t[11]=e.referrerpolicy,t[12]=e.sizes,t[13]=e.srcset,t[14]=e.title,t[15]=r,t[16]=i,t[17]=a,t[18]=o,t[19]=c,t[20]=n,t[21]=l):l=t[21],l}function Ky(e){let t=(0,Q.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={sizes:void 0},t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,$.jsx)(fy,{wrapElement:`span`,zoomMargin:20,zoomImg:n,children:(0,$.jsx)(Gy,{...e})}),t[1]=e,t[2]=r),r}var qy=(0,Z.lazy)(async()=>{let{default:e}=await n(async()=>{let{default:e}=await import(`./katex-Diqujmde.js`);return{default:e}},[],import.meta.url);function t(t){let n=(0,Q.c)(7),r;n[0]===t.formula?r=n[1]:(r=e.renderToString(t.formula,{displayMode:!0,throwOnError:!1,strict:`ignore`,trust:!1}),n[0]=t.formula,n[1]=r);let i=r,a;n[2]===i?a=n[3]:(a={__html:i},n[2]=i,n[3]=a);let o;return n[4]!==t.id||n[5]!==a?(o=(0,$.jsx)(`div`,{className:`math math-display`,"data-component-type":`math`,id:t.id,dangerouslySetInnerHTML:a}),n[4]=t.id,n[5]=a,n[6]=o):o=n[6],o}return{default:t}});function Jy(e){let t=(0,Q.c)(3),n=e.formula||`\xA0`,r;return t[0]!==e.id||t[1]!==n?(r=(0,$.jsx)(`div`,{className:`math math-placeholder`,"data-component-type":`math`,id:e.id,children:n}),t[0]=e.id,t[1]=n,t[2]=r):r=t[2],r}function Yy(e){let t=(0,Q.c)(6),n=e.formula??``;if(!n){let r;return t[0]!==n||t[1]!==e.id?(r=(0,$.jsx)(Jy,{formula:n,id:e.id}),t[0]=n,t[1]=e.id,t[2]=r):r=t[2],r}let r;return t[3]!==n||t[4]!==e.id?(r=(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(Jy,{formula:n,id:e.id}),children:(0,$.jsx)(qy,{formula:n,id:e.id})}),t[3]=n,t[4]=e.id,t[5]=r):r=t[5],r}function Xy(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return Ro(e,n)}}var Zy=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]),Qy=new Map(qt.flatMap(e=>e.surface===`compat`&&Zy.has(e.rendersAs)?[[e.name,e]]:[]));function $y(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function eb(e){let t=e.name;if(!t||!Zy.has(t))return null;let n=$y(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function tb(e){let t=e.name;if(!t)return null;let n=Qy.get(t);if(!n)return null;let r=$y(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var nb=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:za(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},rb=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:za(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},ib=(e,t)=>{let n=t,r=eb(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=tb(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},ab=(e,t)=>{let n=t,r=eb(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=tb(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},ob=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},sb=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},cb=(e,t)=>{let n=t,r={type:`element`,tagName:n.data?.sourceForm===`ins`?`ins`:`u`,properties:{},children:e.all(n)};return e.patch(t,r),e.applyData(t,r)};function lb(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(lb).join(``):``}var ub={wikiLink:nb,wikiLinkEmbed:rb,mdxJsxFlowElement:ib,mdxJsxTextElement:ab,rawMdxFallback:ob,mark:sb,underline:cb,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:lb(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:lb(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},db=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,fb=/\bexpression\s*\(/i,pb=1e4;function mb(e){return!(e.length>pb||db.test(e)||fb.test(e))}function hb(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!ir(e.split(/\s+/)[0]??``))return!1}return!0}var gb={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},_b=new Set([`href`,`src`]),vb=Oo(`<>`),yb=()=>e=>{vo(e,`element`,e=>{let t=gb[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?Dr(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(_b.has(e))if(t===`<>`||t===vb)r=``;else{let e=Dr(t);r=e===t?t:Oo(e)}else r=Dr(t);r!==t&&(n[e]=r)}})},bb=()=>e=>{vo(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!ir(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!ir(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!ir(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!hb(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!hb(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!ir(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!mb(r)&&delete n.style})};function xb(e){let t=bo().use(ko,{handlers:ub}).use(yb).use(bb).use(Xy),n=t.runSync(e);return String(t.stringify(n))}function Sb(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(Cb(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(Cb(e.slice(r),r>0,!1)),n.join(``)}function Cb(e,t,n){let r=0,i=e.length,a=e=>e===9||e===32;for(;t&&r<i&&a(e.charCodeAt(r));)r++;for(;n&&i>r&&a(e.charCodeAt(i-1));)i--;return i>r?e.slice(r,i):``}var wb=/\r?\n|\r/,Tb=(e,t)=>{let n=Sb(String(t.value));if(!wb.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(wb),i=[];for(let e=0;e<r.length;e++)e>0&&i.push({type:`element`,tagName:`br`,properties:{},children:[]}),r[e].length>0&&i.push({type:`text`,value:r[e]});return i};function Eb(e){let t=bo().use(Co).use(Ao,[`yaml`]).use(Kn).use(xo).use(ni).use(Qn).use(ai).use(si).use(ko,{handlers:{...ub,text:Tb}}).use(yb).use(bb).use(Xy);return String(t.processSync(pr(gr(e))))}function Db(e,t){if(e.type===`mdxJsxFlowElement`){let n=e;if(n.name===`MirrorSource`){for(let e of n.attributes??[])if(e.type===`mdxJsxAttribute`&&e.name===`id`&&typeof e.value==`string`&&e.value===t)return n}}let n=e.children;if(Array.isArray(n))for(let e of n){let n=Db(e,t);if(n)return n}return null}function Ob(e){return xb({type:`root`,children:e.children??[]})}function kb(e){switch(e){case`at-capacity`:return{kind:`at-capacity`};case`inadmissible`:return{kind:`source-removed`};case`refused`:return{kind:`loading`}}}function Ab(e,t){let n=(0,Q.c)(9),{collabUrl:r}=no(),i=uv(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={kind:`loading`},n[0]=a):a=n[0];let[o,s]=(0,Z.useState)(a),c=(0,Z.useRef)(t),l=(0,Z.useRef)(null),u,d;n[1]!==i||n[2]!==r||n[3]!==e?(u=()=>{if(!e){s({kind:`empty-props`});return}if(!r){s({kind:`loading`});return}let t=i(r,e);if(!t.ok){console.warn(`[Mirror] live-doc pool refused subscription`,{src:e,reason:t.reason}),s(kb(t.reason));return}let{entry:n}=t,a=()=>{let t=c.current;if(!t){s({kind:`empty-props`});return}let r=n.ySource.toString();if(!r){s(n.synced?{kind:`source-removed`}:{kind:`loading`});return}let i;try{i=ti().parseToMdast(r)}catch(n){console.warn(`[Mirror] parseToMdast failed`,{src:e,anchor:t,err:n}),s({kind:`source-removed`});return}let a=Db(i,t);if(!a){s({kind:`anchor-not-found`});return}let o;try{o=Ob(a)}catch(n){console.warn(`[Mirror] renderMirrorSubtree failed`,{src:e,anchor:t,err:n}),s({kind:`anchor-not-found`});return}s(e=>e.kind===`ready`&&e.html===o?e:{kind:`ready`,html:o})},o=null,u=n.subscribe({onUpdate:()=>{o&&clearTimeout(o),o=setTimeout(()=>{o=null,a()},150)},onSynced:()=>{o&&=(clearTimeout(o),null),a()}});l.current=a;let d=setTimeout(()=>{n.synced||s({kind:`source-removed`})},sv);return a(),()=>{clearTimeout(d),o&&clearTimeout(o),u(),l.current=null,fv(r,e)}},d=[r,e,i],n[1]=i,n[2]=r,n[3]=e,n[4]=u,n[5]=d):(u=n[4],d=n[5]),(0,Z.useEffect)(u,d);let f,p;return n[6]===t?(f=n[7],p=n[8]):(f=()=>{c.current=t,l.current?.()},p=[t],n[6]=t,n[7]=f,n[8]=p),(0,Z.useEffect)(f,p),o}function jb(e){let t=(0,Q.c)(8),n=`ok-mirror-state flex items-start gap-2 rounded-md border border-dashed px-3 py-2 text-sm ${e.tone===`error`?`border-destructive/40 text-destructive`:`border-border text-muted-foreground`}`,r;t[0]===e.tone?r=t[1]:(r=e.tone===`error`?(0,$.jsx)(Bl,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}):(0,$.jsx)(Hl,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}),t[0]=e.tone,t[1]=r);let i;t[2]===e.children?i=t[3]:(i=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.children}),t[2]=e.children,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,$.jsxs)(`div`,{className:n,children:[r,i]}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Mb(e){let t=(0,Q.c)(35),n=e.src??``,r=e.anchor??``,i=Ab(n,r);if(i.kind===`empty-props`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(jb,{tone:`placeholder`,children:(0,$.jsx)(a,{id:`3SDfZl`,components:{0:(0,$.jsx)(`span`,{className:`font-medium`}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{}),3:(0,$.jsx)(`code`,{})}})}),t[0]=e):e=t[0],e}if(i.kind===`loading`){let e=n&&r?`${n}#${r}`:``,i;t[1]===e?i=t[2]:(i={mirrorRef:e},t[1]=e,t[2]=i);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o={0:(0,$.jsx)(`code`,{})},t[3]=o):o=t[3];let s;return t[4]===i?s=t[5]:(s=(0,$.jsx)(jb,{tone:`placeholder`,children:(0,$.jsx)(a,{id:`92rbk2`,values:i,components:o})}),t[4]=i,t[5]=s),s}if(i.kind===`source-removed`){let e;t[6]===n?e=t[7]:(e={src:n},t[6]=n,t[7]=e);let r;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,$.jsx)(`span`,{className:`font-medium`}),1:(0,$.jsx)(`code`,{})},t[8]=r):r=t[8];let i;return t[9]===e?i=t[10]:(i=(0,$.jsx)(jb,{tone:`error`,children:(0,$.jsx)(a,{id:`Ud0Pj9`,values:e,components:r})}),t[9]=e,t[10]=i),i}if(i.kind===`at-capacity`){let e;t[11]===n?e=t[12]:(e={src:n},t[11]=n,t[12]=e);let r;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,$.jsx)(`span`,{className:`font-medium`}),1:(0,$.jsx)(`code`,{})},t[13]=r):r=t[13];let i;return t[14]===e?i=t[15]:(i=(0,$.jsx)(jb,{tone:`error`,children:(0,$.jsx)(a,{id:`SWTmnY`,values:e,components:r})}),t[14]=e,t[15]=i),i}if(i.kind===`anchor-not-found`){let e=`<MirrorSource id="${r}">`,i;t[16]!==e||t[17]!==n?(i={mirrorSourceTag:e,src:n},t[16]=e,t[17]=n,t[18]=i):i=t[18];let o;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(o={0:(0,$.jsx)(`span`,{className:`font-medium`}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})},t[19]=o):o=t[19];let s;return t[20]===i?s=t[21]:(s=(0,$.jsx)(jb,{tone:`error`,children:(0,$.jsx)(a,{id:`mqSwZH`,values:i,components:o})}),t[20]=i,t[21]=s),s}let o;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Mt,{className:`size-3`,"aria-hidden":`true`}),t[22]=o):o=t[22];let s;t[23]===n?s=t[24]:(s={src:n},t[23]=n,t[24]=s);let c;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(c={0:(0,$.jsx)(`code`,{className:`font-mono`})},t[25]=c):c=t[25];let l;t[26]===s?l=t[27]:(l=(0,$.jsxs)(`div`,{className:`ok-mirror-badge pointer-events-none absolute -top-2.5 left-2 flex items-center gap-1 rounded-md bg-background px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity [.jsx-component-wrapper:hover_&]:opacity-100 [.jsx-component-wrapper[data-selected="true"]_&]:opacity-100`,"aria-hidden":`true`,children:[o,(0,$.jsx)(`span`,{children:(0,$.jsx)(a,{id:`wQp1V3`,values:s,components:c})})]}),t[26]=s,t[27]=l);let u;t[28]===i.html?u=t[29]:(u=(0,$.jsx)(`div`,{dangerouslySetInnerHTML:{__html:i.html}}),t[28]=i.html,t[29]=u);let d;return t[30]!==r||t[31]!==n||t[32]!==l||t[33]!==u?(d=(0,$.jsxs)(`div`,{className:`ok-mirror-resolved relative -mx-3 prose-no-margin rounded-md border border-dashed border-transparent px-3 py-2 transition-colors [.jsx-component-wrapper:hover_&]:border-border/40 [.jsx-component-wrapper[data-selected="true"]_&]:border-border/40`,"data-mirror-src":n,"data-mirror-anchor":r,children:[l,u]}),t[30]=r,t[31]=n,t[32]=l,t[33]=u,t[34]=d):d=t[34],d}function Nb(e){let t=(0,Q.c)(15),{_:n}=o(),r=e.id??``,i;t[0]!==n||t[1]!==r?(i=r||n({id:`12F9WL`}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let s=i,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(El,{className:`size-3`,"aria-hidden":`true`}),t[3]=c):c=t[3];let l;t[4]===s?l=t[5]:(l={label:s},t[4]=s,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u={0:(0,$.jsx)(`code`,{className:`font-mono`})},t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,$.jsxs)(`div`,{className:`ok-mirror-source-badge pointer-events-none absolute -top-2.5 left-2 flex items-center gap-1 rounded-md bg-background px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity [.jsx-component-wrapper:hover_&]:opacity-100 [.jsx-component-wrapper[data-selected="true"]_&]:opacity-100`,children:[c,(0,$.jsx)(`span`,{children:(0,$.jsx)(a,{id:`Zon_qG`,values:l,components:u})})]}),t[7]=l,t[8]=d);let f;t[9]===e.children?f=t[10]:(f=(0,$.jsx)(`div`,{children:e.children}),t[9]=e.children,t[10]=f);let p;return t[11]!==r||t[12]!==d||t[13]!==f?(p=(0,$.jsxs)(`div`,{className:`ok-mirror-source relative -mx-3 rounded-md border border-dashed border-transparent px-3 py-1 transition-colors [.jsx-component-wrapper:hover_&]:border-border/50 [.jsx-component-wrapper[data-selected="true"]_&]:border-border/50`,"data-mirror-source-id":r,children:[d,f]}),t[11]=r,t[12]=d,t[13]=f,t[14]=p):p=t[14],p}function Pb(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}var Fb=24,Ib=24,Lb=12,Rb=.1;function zb(e,t,n,r){if(n<=0&&(e===`fit-width`||e===`two-odd`||e===`two-even`)||r<=0&&e===`fit-height`)return 1;switch(e){case`fit-width`:return Math.max(Rb,(n-Fb)/t.naturalWidth);case`fit-height`:return Math.max(Rb,(r-Ib)/t.naturalHeight);case`single`:return 1;case`two-odd`:case`two-even`:return Math.max(Rb,((n-Fb)/2-Lb)/t.naturalWidth)}}var Bb=600,Vb=.5,Hb=3,Ub=.25,Wb=null;function Gb(){return Wb||(Wb=(async()=>{let e=await n(()=>import(`./pdf-iRjqhv9l.js`),__vite__mapDeps([48,2]),import.meta.url);if(!e.GlobalWorkerOptions.workerSrc){let t=(await n(async()=>{let{default:e}=await import(`./pdf.worker-Dxt9N0ez.js`);return{default:e}},[],import.meta.url)).default;e.GlobalWorkerOptions.workerSrc=t}return e})(),Wb.catch(()=>{Wb=null})),Wb}function Kb(e){return e instanceof Error&&e.name===`RenderingCancelledException`}function qb(e){let t=(0,Q.c)(96),n,r;if(t[0]!==e.anchor||t[1]!==e.fillContainer){let{height:i,viewerFragment:a}=Pb(e.anchor);n=i===null?e.fillContainer?`100%`:`${Bb}px`:`${i}px`,r=ex(a),t[0]=e.anchor,t[1]=e.fillContainer,t[2]=n,t[3]=r}else n=t[2],r=t[3];let i=r,s=(0,Z.useRef)(null),c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],t[4]=c):c=t[4];let l=(0,Z.useRef)(c),u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[5]=u):u=t[5];let d=(0,Z.useRef)(u),f=(0,Z.useRef)(null),p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],t[6]=p):p=t[6];let[m,h]=(0,Z.useState)(p),[g,_]=(0,Z.useState)(!0),[v,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(i??1),[S,C]=(0,Z.useState)(String(i??1)),[w,T]=(0,Z.useState)(1),[E,D]=(0,Z.useState)(`fit-width`),[O,k]=(0,Z.useState)(!1),[A,j]=(0,Z.useState)(!1),[M,N]=(0,Z.useState)(0),[P,F]=(0,Z.useState)(0),{_:I}=o(),L=m.length,ee,R;t[7]!==I||t[8]!==e.src?(ee=()=>{if(!e.src){_(!1);return}let t=go(e.src),n=!1,r=null;return _(!0),y(null),(async()=>{try{let e=(await Gb()).getDocument({url:t});r=e;let i=await e.promise;if(n){await e.destroy();return}f.current=i;let a=[];for(let e=1;e<=i.numPages;e++){if(n)return;let t=(await i.getPage(e)).getViewport({scale:1});a.push({pageNumber:e,naturalWidth:t.width,naturalHeight:t.height})}if(n)return;h(a)}catch(e){let t=e;if(n)return;y(t instanceof Error?t.message:I({id:`jRHdCz`})),_(!1)}})(),()=>{n=!0,r?.destroy().catch(Qb),r=null,f.current=null}},R=[e.src,I],t[7]=I,t[8]=e.src,t[9]=ee,t[10]=R):(ee=t[9],R=t[10]),(0,Z.useEffect)(ee,R);let te,ne;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(te=()=>{let e=s.current;if(!e)return;let t=()=>{N(e.clientWidth),F(e.clientHeight)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},ne=[],t[11]=te,t[12]=ne):(te=t[11],ne=t[12]),(0,Z.useEffect)(te,ne);let re,ie;t[13]!==I||t[14]!==P||t[15]!==M||t[16]!==E||t[17]!==m||t[18]!==w?(re=()=>{let e=f.current;if(!e||m.length===0||M===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of m){if(t)return;let a=l.current[i.pageNumber-1];if(!a)continue;let o=zb(E,i,M,P)*w,s=await e.getPage(i.pageNumber);if(t)return;let c=s.getViewport({scale:o});a.width=Math.floor(c.width*r),a.height=Math.floor(c.height*r),a.style.width=`${c.width}px`,a.style.height=`${c.height}px`;let u=a.getContext(`2d`);u&&(u.setTransform(r,0,0,r,0,0),n=s.render({canvas:a,canvasContext:u,viewport:c}),await n.promise,n=null)}t||_(!1)}catch(e){let n=e;if(t||Kb(n))return;console.warn(`[Pdf] page render failed:`,n),y(n instanceof Error?n.message:I({id:`_TF8ep`})),_(!1)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},ie=[m,E,w,M,P,I],t[13]=I,t[14]=P,t[15]=M,t[16]=E,t[17]=m,t[18]=w,t[19]=re,t[20]=ie):(re=t[19],ie=t[20]),(0,Z.useEffect)(re,ie);let ae,oe;t[21]!==m||t[22]!==O?(ae=()=>{if(!O)return;let e=f.current;if(!e||m.length===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of m){if(t)return;let a=d.current[i.pageNumber-1];if(!a)continue;let o=120/i.naturalWidth,s=await e.getPage(i.pageNumber);if(t)return;let c=s.getViewport({scale:o});a.width=Math.floor(c.width*r),a.height=Math.floor(c.height*r),a.style.width=`${c.width}px`,a.style.height=`${c.height}px`;let l=a.getContext(`2d`);l&&(l.setTransform(r,0,0,r,0,0),n=s.render({canvas:a,canvasContext:l,viewport:c}),await n.promise,n=null)}}catch(e){let t=e;Kb(t)||console.warn(`[Pdf] thumbnail render failed:`,t)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},oe=[O,m],t[21]=m,t[22]=O,t[23]=ae,t[24]=oe):(ae=t[23],oe=t[24]),(0,Z.useEffect)(ae,oe);let se,z;t[25]!==g||t[26]!==i?(se=()=>{if(g||!i)return;let e=s.current,t=l.current[i-1];e&&t&&(e.scrollTop=t.offsetTop-e.offsetTop)},z=[g,i],t[25]=g,t[26]=i,t[27]=se,t[28]=z):(se=t[27],z=t[28]),(0,Z.useEffect)(se,z);let B,ce;t[29]===m?(B=t[30],ce=t[31]):(B=()=>{let e=s.current;if(!e||m.length===0)return;let t=!1,n=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let n=e.scrollTop,r=1;for(let t of m){let i=l.current[t.pageNumber-1];i&&i.offsetTop-e.offsetTop<=n+40&&(r=t.pageNumber)}x(r),C(String(r))}))};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},ce=[m],t[29]=m,t[30]=B,t[31]=ce),(0,Z.useEffect)(B,ce);let le,V;t[32]===A?(le=t[33],V=t[34]):(le=()=>{if(!A)return;let e=e=>{let t=e.target,n=s.current?.closest(`.ok-pdf`);if(!n||!t||!n.contains(t)){j(!1);return}let r=n.querySelector(`.ok-pdf-layout-menu`);r&&!r.contains(t)&&j(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},V=[A],t[32]=A,t[33]=le,t[34]=V),(0,Z.useEffect)(le,V);let H;t[35]===L?H=t[36]:(H=e=>{let t=Math.max(1,Math.min(L||1,e));x(t),C(String(t));let n=s.current,r=l.current[t-1];n&&r&&n.scrollTo({top:r.offsetTop-n.offsetTop,behavior:`smooth`})},t[35]=L,t[36]=H);let U=H,W;t[37]!==b||t[38]!==U||t[39]!==S?(W=()=>{let e=Number.parseInt(S,10);if(Number.isNaN(e)){C(String(b));return}U(e)},t[37]=b,t[38]=U,t[39]=S,t[40]=W):W=t[40];let G=W,ue;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ue=()=>T(Zb),t[41]=ue):ue=t[41];let K=ue,de;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>T(Xb),t[42]=de):de=t[42];let fe=de,pe;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>{D(e),j(!1),T(1)},t[43]=pe):pe=t[43];let q=pe,me;t[44]===n?me=t[45]:(me={height:n},t[44]=n,t[45]=me);let J;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(J=()=>k(Yb),t[46]=J):J=t[46];let he;t[47]!==I||t[48]!==O?(he=I(O?{id:`JK-Ave`}:{id:`iEYxO4`}),t[47]=I,t[48]=O,t[49]=he):he=t[49];let ge;t[50]===I?ge=t[51]:(ge=I({id:`zo3Dl7`}),t[50]=I,t[51]=ge);let _e;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(st,{size:14,"aria-hidden":`true`}),t[52]=_e):_e=t[52];let ve;t[53]!==O||t[54]!==he||t[55]!==ge?(ve=(0,$.jsx)(`button`,{type:`button`,onClick:J,"aria-label":he,"aria-pressed":O,className:`ok-pdf-btn`,title:ge,children:_e}),t[53]=O,t[54]=he,t[55]=ge,t[56]=ve):ve=t[56];let ye=e.title??`PDF`,be;t[57]===ye?be=t[58]:(be=(0,$.jsx)(`span`,{className:`ok-pdf-title`,children:ye}),t[57]=ye,t[58]=be);let xe;t[59]!==I||t[60]!==A||t[61]!==E||t[62]!==S||t[63]!==G||t[64]!==L||t[65]!==w?(xe=L>0&&(0,$.jsxs)(`div`,{className:`ok-pdf-controls`,children:[(0,$.jsx)(`form`,{className:`ok-pdf-page-form`,onSubmit:e=>{e.preventDefault(),G()},children:(0,$.jsx)(`input`,{type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,className:`ok-pdf-page-input`,value:S,onChange:e=>C(e.target.value.replace(/[^0-9]/g,``)),onBlur:G,"aria-label":I({id:`xsZhu-`})})}),(0,$.jsx)(`span`,{className:`ok-pdf-page-of`,children:(0,$.jsx)(a,{id:`1GhYxC`,values:{totalPages:L}})}),(0,$.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,$.jsx)(`button`,{type:`button`,onClick:fe,disabled:w<=Vb,"aria-label":I({id:`FjkaiT`}),className:`ok-pdf-btn`,title:I({id:`FjkaiT`}),children:(0,$.jsx)(Et,{size:14,"aria-hidden":`true`})}),(0,$.jsxs)(`span`,{className:`ok-pdf-zoom-display`,"aria-live":`polite`,children:[Math.round(w*100),`%`]}),(0,$.jsx)(`button`,{type:`button`,onClick:K,disabled:w>=Hb,"aria-label":I({id:`AWOSPo`}),className:`ok-pdf-btn`,title:I({id:`AWOSPo`}),children:(0,$.jsx)(yt,{size:14,"aria-hidden":`true`})}),(0,$.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,$.jsxs)(`div`,{className:`ok-pdf-layout-menu`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>j(Jb),"aria-label":I({id:`GQDSBN`}),"aria-haspopup":`menu`,"aria-expanded":A,className:`ok-pdf-btn`,title:I({id:`rdU729`}),children:(0,$.jsx)(Ot,{size:14,"aria-hidden":`true`})}),A&&(0,$.jsxs)(`div`,{role:`menu`,className:`ok-pdf-menu`,children:[(0,$.jsx)($b,{label:I({id:`vIxrEk`}),active:E===`fit-width`,onSelect:()=>q(`fit-width`)}),(0,$.jsx)($b,{label:I({id:`YlDuro`}),active:E===`fit-height`,onSelect:()=>q(`fit-height`)}),(0,$.jsx)(`hr`,{className:`ok-pdf-menu-divider`}),(0,$.jsx)($b,{label:I({id:`BGHHtQ`}),active:E===`single`,onSelect:()=>q(`single`)}),(0,$.jsx)($b,{label:I({id:`xK291b`}),active:E===`two-odd`,onSelect:()=>q(`two-odd`)}),(0,$.jsx)($b,{label:I({id:`NSnIUP`}),active:E===`two-even`,onSelect:()=>q(`two-even`)})]})]})]}),t[59]=I,t[60]=A,t[61]=E,t[62]=S,t[63]=G,t[64]=L,t[65]=w,t[66]=xe):xe=t[66];let Se;t[67]!==ve||t[68]!==be||t[69]!==xe?(Se=(0,$.jsxs)(`div`,{className:`ok-pdf-toolbar`,contentEditable:!1,children:[ve,be,xe]}),t[67]=ve,t[68]=be,t[69]=xe,t[70]=Se):Se=t[70];let Ce;t[71]!==I||t[72]!==b||t[73]!==U||t[74]!==m||t[75]!==O?(Ce=O&&(0,$.jsx)(`aside`,{className:`ok-pdf-sidebar`,"aria-label":I({id:`nzaV6Q`}),children:m.map((e,t)=>{let{pageNumber:n}=e;return(0,$.jsxs)(`button`,{type:`button`,className:`ok-pdf-thumb`,"data-active":b===n||void 0,onClick:()=>U(n),"aria-label":I({id:`qioCwA`,values:{pageNumber:n}}),children:[(0,$.jsx)(`canvas`,{ref:e=>{d.current[t]=e},className:`ok-pdf-thumb-canvas`}),(0,$.jsx)(`span`,{className:`ok-pdf-thumb-num`,children:n})]},n)})}),t[71]=I,t[72]=b,t[73]=U,t[74]=m,t[75]=O,t[76]=Ce):Ce=t[76];let we;t[77]===g?we=t[78]:(we=g&&(0,$.jsx)(`div`,{className:`ok-pdf-loading`,children:(0,$.jsx)(a,{id:`T-654M`})}),t[77]=g,t[78]=we);let Te;t[79]===v?Te=t[80]:(Te=v&&(0,$.jsx)(`div`,{className:`ok-pdf-error`,children:(0,$.jsx)(a,{id:`WamGNs`,values:{error:v}})}),t[79]=v,t[80]=Te);let Ee;t[81]!==I||t[82]!==L?(Ee=Array.from({length:L},(e,t)=>{let n=t+1;return(0,$.jsx)(`canvas`,{ref:e=>{l.current[t]=e},className:`ok-pdf-page`,"aria-label":I({id:`XtRoxT`,values:{pageNumber:n}})},n)}),t[81]=I,t[82]=L,t[83]=Ee):Ee=t[83];let De;t[84]!==E||t[85]!==we||t[86]!==Te||t[87]!==Ee?(De=(0,$.jsxs)(`div`,{className:`ok-pdf-pages`,ref:s,"data-layout":E,children:[we,Te,Ee]}),t[84]=E,t[85]=we,t[86]=Te,t[87]=Ee,t[88]=De):De=t[88];let Oe;t[89]!==Ce||t[90]!==De?(Oe=(0,$.jsxs)(`div`,{className:`ok-pdf-body`,children:[Ce,De]}),t[89]=Ce,t[90]=De,t[91]=Oe):Oe=t[91];let Y;return t[92]!==me||t[93]!==Se||t[94]!==Oe?(Y=(0,$.jsxs)(`div`,{className:`ok-pdf`,style:me,children:[Se,Oe]}),t[92]=me,t[93]=Se,t[94]=Oe,t[95]=Y):Y=t[95],Y}function Jb(e){return!e}function Yb(e){return!e}function Xb(e){return Math.max(Vb,+(e-Ub).toFixed(2))}function Zb(e){return Math.min(Hb,+(e+Ub).toFixed(2))}function Qb(){}function $b(e){let t=(0,Q.c)(10),n=e.active||void 0,r;t[0]===e.active?r=t[1]:(r=e.active&&(0,$.jsx)(Dt,{size:14}),t[0]=e.active,t[1]=r);let i;t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{className:`ok-pdf-menu-check`,"aria-hidden":`true`,children:r}),t[2]=r,t[3]=i);let a;return t[4]!==e.active||t[5]!==e.label||t[6]!==e.onSelect||t[7]!==n||t[8]!==i?(a=(0,$.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.active,className:`ok-pdf-menu-item`,"data-active":n,onClick:e.onSelect,children:[i,e.label]}),t[4]=e.active,t[5]=e.label,t[6]=e.onSelect,t[7]=n,t[8]=i,t[9]=a):a=t[9],a}function ex(e){if(!e)return null;for(let t of e.split(`&`)){let e=t.indexOf(`=`);if(!(e<0)&&t.slice(0,e)===`page`){let n=Number.parseInt(t.slice(e+1),10);if(!Number.isNaN(n)&&n>=1)return n}}return null}function tx(e){let t=(0,Q.c)(10),{label:n,id:r,children:i}=e,a=(0,Z.useId)(),o;t[0]!==r||t[1]!==a?(o=r||`tab-panel-${a.replace(/:/g,``)}`,t[0]=r,t[1]=a,t[2]=o):o=t[2];let s=o,c=`${s}-tab`,l;t[3]===n?l=t[4]:(l=n?.trim()||`Tab`,t[3]=n,t[4]=l);let u=l,d;return t[5]!==i||t[6]!==s||t[7]!==u||t[8]!==c?(d=(0,$.jsx)(`section`,{className:`tab-panel`,id:s,role:`tabpanel`,"aria-labelledby":c,"data-tab-label":u,"data-tab-id":s,children:i}),t[5]=i,t[6]=s,t[7]=u,t[8]=c,t[9]=d):d=t[9],d}var nx=`:scope > .component-children > [data-node-view-content-react] > .react-renderer`;function rx(e){return Array.from(e.querySelectorAll(nx)).map((e,t)=>{let n=e.querySelector(`[data-tab-label]`);return{index:t,label:(n?.getAttribute(`data-tab-label`))?.trim()||`Tab ${t+1}`,panelId:n?.getAttribute(`data-tab-id`)??null}})}function ix(e,t){let n=Array.from(e.querySelectorAll(nx))[t];return n?n.querySelector(`[data-jsx-gear]`):null}function ax(e){let t=(0,Q.c)(31),{id:n,children:r}=e,[i,a]=(0,Z.useState)(0),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[0]=s):s=t[0];let[c,l]=(0,Z.useState)(s),u=(0,Z.useRef)(null),d=(0,Z.useRef)(null),f=(0,Z.useRef)(0),p=xt(),m=p?.addChild!=null,{_:h}=o(),g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=u.current;if(!e)return;let t=rx(e);l(e=>{if(e.length!==t.length)return t;for(let n=0;n<e.length;n++)if(e[n].label!==t[n].label||e[n].panelId!==t[n].panelId)return t;return e})},t[1]=g):g=t[1],(0,Z.useLayoutEffect)(g);let _,v;t[2]===c.length?(_=t[3],v=t[4]):(_=()=>{c.length>f.current&&c.length>0&&a(c.length-1),f.current=c.length},v=[c.length],t[2]=c.length,t[3]=_,t[4]=v),(0,Z.useLayoutEffect)(_,v);let y;t[5]===n?y=t[6]:(y=()=>{let e=()=>{let e=window.location.hash.slice(1);if(!e)return;if(n&&e===n){a(0);return}let t=u.current;if(!t)return;let r=rx(t).findIndex(t=>t.panelId===e);r<0||(a(r),queueMicrotask(()=>{t.ownerDocument.getElementById(e)?.scrollIntoView({block:`start`,behavior:`auto`})}))};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},t[5]=n,t[6]=y),(0,Z.useLayoutEffect)(y);let b=c.length===0?0:Math.min(Math.max(i,0),c.length-1),x;t[7]!==c.length||t[8]!==b?(x=e=>{if(c.length===0)return;let t=null;e.key===`ArrowRight`?t=(b+1)%c.length:e.key===`ArrowLeft`?t=(b-1+c.length)%c.length:e.key===`Home`?t=0:e.key===`End`&&(t=c.length-1),t!==null&&(e.preventDefault(),a(t),(d.current?.querySelectorAll(`[role="tab"]`))?.[t]?.focus())},t[7]=c.length,t[8]=b,t[9]=x):x=t[9];let S=x,C=n?`Tabs: ${n}`:`Tabs`,w;t[10]!==c||t[11]!==b?(w=c.map(e=>(0,$.jsx)(`button`,{id:e.panelId?`${e.panelId}-tab`:void 0,type:`button`,role:`tab`,className:`tabs-strip-pill`,"data-active":e.index===b,"aria-selected":e.index===b,"aria-controls":e.panelId??void 0,tabIndex:e.index===b?0:-1,onMouseDown:sx,onClick:()=>{if(e.index!==b){a(e.index);return}let t=u.current;t&&ix(t,e.index)?.click()},children:e.label},e.index)),t[10]=c,t[11]=b,t[12]=w):w=t[12];let T;t[13]!==S||t[14]!==C||t[15]!==w?(T=(0,$.jsx)(`div`,{ref:d,role:`tablist`,"aria-label":C,className:`tabs-tablist`,onKeyDown:S,children:w}),t[13]=S,t[14]=C,t[15]=w,t[16]=T):T=t[16];let E;t[17]!==h||t[18]!==m||t[19]!==p?(E=m&&(0,$.jsx)(`button`,{type:`button`,className:`tabs-strip-add`,"aria-label":h({id:`hjO0Mq`}),title:h({id:`hjO0Mq`}),onMouseDown:ox,onClick:()=>p?.addChild?.(),"data-tabs-strip-add":``,children:`+`}),t[17]=h,t[18]=m,t[19]=p,t[20]=E):E=t[20];let D;t[21]!==E||t[22]!==T?(D=(0,$.jsxs)(`div`,{className:`tabs-strip`,contentEditable:!1,children:[T,E]}),t[21]=E,t[22]=T,t[23]=D):D=t[23];let O;t[24]!==r||t[25]!==b?(O=(0,$.jsx)(`div`,{ref:u,className:`tabs-content`,"data-active-index":b,children:r}),t[24]=r,t[25]=b,t[26]=O):O=t[26];let k;return t[27]!==n||t[28]!==D||t[29]!==O?(k=(0,$.jsxs)(`div`,{className:`tabs`,id:n,children:[D,O]}),t[27]=n,t[28]=D,t[29]=O,t[30]=k):k=t[30],k}function ox(e){return e.preventDefault()}function sx(e){return e.preventDefault()}var cx=typeof global<`u`&&{}.toString.call(global)===`[object global]`,lx=typeof Bun<`u`,ux=typeof Deno<`u`,dx=typeof WebSocketPair==`function`&&caches?.default!==void 0,fx=cx||lx||ux||dx;function px(e,t){return e.indexOf(t.toLowerCase())===0?e:`${t.toLowerCase()}${e.substr(0,1).toUpperCase()}${e.substr(1)}`}function mx(e){return!!(e&&e.nodeType===1&&`nodeName`in e&&e.ownerDocument&&e.ownerDocument.defaultView)}function hx(e){return!isNaN(parseFloat(e))&&isFinite(e)&&Math.floor(e)==e}function gx(e){return/^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(e)}function _x(e){return/^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(e)}function vx(e){let t=(e||``).match(/^(?:https?:)?(?:\/\/)?([^/?]+)/),n=(t&&t[1]||``).replace(`player.`,``);for(let e of[`.videoji.hk`,`.vimeo.work`,`.videoji.cn`])if(n.endsWith(e))return n;return`vimeo.com`}function yx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.id,n=e.url,r=t||n;if(!r)throw Error(`An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.`);if(hx(r))return`https://vimeo.com/${r}`;if(gx(r))return r.replace(`http:`,`https:`);throw TypeError(t?`“${t}” is not a valid video id.`:`“${r}” is not a vimeo.com url.`)}var bx=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`addEventListener`,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:`removeEventListener`,a=typeof t==`string`?[t]:t;return a.forEach(t=>{e[r](t,n)}),{cancel:()=>a.forEach(t=>e[i](t,n))}};function xx(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;if(!e||!t||typeof t.querySelectorAll!=`function`)return null;let n=t.querySelectorAll(`iframe`);for(let t=0;t<n.length;t++)if(n[t]&&n[t].contentWindow===e)return n[t];return null}var Sx=Array.prototype.indexOf!==void 0,Cx=typeof window<`u`&&window.postMessage!==void 0;if(!fx&&(!Sx||!Cx))throw Error(`Sorry, the Vimeo Player API is not available in this browser.`);var wx=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function Tx(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){if(e.WeakMap)return;var t=Object.prototype.hasOwnProperty,n=Object.defineProperty&&function(){try{return Object.defineProperty({},`x`,{value:1}).x===1}catch{}}(),r=function(e,t,r){n?Object.defineProperty(e,t,{configurable:!0,writable:!0,value:r}):e[t]=r};e.WeakMap=function(){function e(){if(this===void 0)throw TypeError(`Constructor WeakMap requires 'new'`);if(r(this,`_id`,a(`_WeakMap`)),arguments.length>0)throw TypeError(`WeakMap iterable is not supported`)}r(e.prototype,`delete`,function(e){if(n(this,`delete`),!i(e))return!1;var t=e[this._id];return t&&t[0]===e?(delete e[this._id],!0):!1}),r(e.prototype,`get`,function(e){if(n(this,`get`),i(e)){var t=e[this._id];if(t&&t[0]===e)return t[1]}}),r(e.prototype,`has`,function(e){if(n(this,`has`),!i(e))return!1;var t=e[this._id];return!!(t&&t[0]===e)}),r(e.prototype,`set`,function(e,t){if(n(this,`set`),!i(e))throw TypeError(`Invalid value used as weak map key`);var a=e[this._id];return a&&a[0]===e?(a[1]=t,this):(r(e,this._id,[e,t]),this)});function n(e,n){if(!i(e)||!t.call(e,`_id`))throw TypeError(n+` method called on incompatible receiver `+typeof e)}function a(e){return e+`_`+o()+`.`+o()}function o(){return Math.random().toString().substring(2)}return r(e,`_polyfill`,!0),e}();function i(e){return Object(e)===e}})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:wx);var Ex=Tx(function(e){(function(t,n,r){n[t]=n[t]||r(),e.exports&&=n[t]})(`Promise`,wx,function(){var e,t,n,r=Object.prototype.toString,i=typeof setImmediate<`u`?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},`x`,{}),e=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:r!==!1})}}catch{e=function(e,t,n){return e[t]=n,e}}n=function(){var e,n,r;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,a){r=new i(t,a),n?n.next=r:e=r,n=r,r=void 0},drain:function(){var r=e;for(e=n=t=void 0;r;)r.fn.call(r.self),r=r.next}}}();function a(e,r){n.add(e,r),t||=i(n.drain)}function o(e){var t,n=typeof e;return e!=null&&(n==`object`||n==`function`)&&(t=e.then),typeof t==`function`?t:!1}function s(){for(var e=0;e<this.chain.length;e++)c(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function c(e,t,n){var r,i;try{t===!1?n.reject(e.msg):(r=t===!0?e.msg:t.call(void 0,e.msg),r===n.promise?n.reject(TypeError(`Promise-chain cycle`)):(i=o(r))?i.call(r,n.resolve,n.reject):n.resolve(r))}catch(e){n.reject(e)}}function l(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=o(e))?a(function(){var r=new f(n);try{t.call(e,function(){l.apply(r,arguments)},function(){u.apply(r,arguments)})}catch(e){u.call(r,e)}}):(n.msg=e,n.state=1,n.chain.length>0&&a(s,n))}catch(e){u.call(new f(n),e)}}}function u(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function d(e,t,n,r){for(var i=0;i<t.length;i++)(function(i){e.resolve(t[i]).then(function(e){n(i,e)},r)})(i)}function f(e){this.def=e,this.triggered=!1}function p(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function m(e){if(typeof e!=`function`)throw TypeError(`Not a function`);if(this.__NPO__!==0)throw TypeError(`Not a promise`);this.__NPO__=1;var t=new p(this);this.then=function(e,n){var r={success:typeof e==`function`?e:!0,failure:typeof n==`function`?n:!1};return r.promise=new this.constructor(function(e,t){if(typeof e!=`function`||typeof t!=`function`)throw TypeError(`Not a function`);r.resolve=e,r.reject=t}),t.chain.push(r),t.state!==0&&a(s,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){l.call(t,e)},function(e){u.call(t,e)})}catch(e){u.call(t,e)}}var h=e({},`constructor`,m,!1);return m.prototype=h,e(h,`__NPO__`,0,!1),e(m,`resolve`,function(e){var t=this;return e&&typeof e==`object`&&e.__NPO__===1?e:new t(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);t(e)})}),e(m,`reject`,function(e){return new this(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);n(e)})}),e(m,`all`,function(e){var t=this;return r.call(e)==`[object Array]`?e.length===0?t.resolve([]):new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);var i=e.length,a=Array(i),o=0;d(t,e,function(e,t){a[e]=t,++o===i&&n(a)},r)}):t.reject(TypeError(`Not an array`))}),e(m,`race`,function(e){var t=this;return r.call(e)==`[object Array]`?new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);d(t,e,function(e,t){n(t)},r)}):t.reject(TypeError(`Not an array`))}),m})}),Dx=new WeakMap;function Ox(e,t,n){let r=Dx.get(e.element)||{};t in r||(r[t]=[]),r[t].push(n),Dx.set(e.element,r)}function kx(e,t){return(Dx.get(e.element)||{})[t]||[]}function Ax(e,t,n){let r=Dx.get(e.element)||{};if(!r[t])return!0;if(!n)return r[t]=[],Dx.set(e.element,r),!0;let i=r[t].indexOf(n);return i!==-1&&r[t].splice(i,1),Dx.set(e.element,r),r[t]&&r[t].length===0}function jx(e,t){let n=kx(e,t);if(n.length<1)return!1;let r=n.shift();return Ax(e,t,r),r}function Mx(e,t){let n=Dx.get(e);Dx.set(t,n),Dx.delete(e)}function Nx(e){if(typeof e==`string`)try{e=JSON.parse(e)}catch(e){return console.warn(e),{}}return e}function Px(e,t,n){if(!e.element.contentWindow||!e.element.contentWindow.postMessage)return;let r={method:t};n!==void 0&&(r.value=n);let i=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,`$1`));i>=8&&i<10&&(r=JSON.stringify(r)),e.element.contentWindow.postMessage(r,e.origin)}function Fx(e,t){t=Nx(t);let n=[],r;if(t.event)t.event===`error`&&kx(e,t.data.method).forEach(n=>{let r=Error(t.data.message);r.name=t.data.name,n.reject(r),Ax(e,t.data.method,n)}),n=kx(e,`event:${t.event}`),r=t.data;else if(t.method){let i=jx(e,t.method);i&&(n.push(i),r=t.value)}n.forEach(t=>{try{if(typeof t==`function`){t.call(e,r);return}t.resolve(r)}catch{}})}var Ix=`airplay.audio_tracks.audiotrack.autopause.autoplay.background.byline.cc.chapter_id.chapters.chromecast.color.colors.controls.disable_context_menu.dnt.end_time.fullscreen.height.id.initial_quality.interactive_params.keyboard.loop.maxheight.max_quality.maxwidth.min_quality.muted.play_button_position.playsinline.portrait.preload.progress_bar.quality.quality_selector.responsive.skipping_forward.speed.start_time.texttrack.thumbnail_id.title.transcript.transparent.unmute_button.url.vimeo_logo.volume.watch_full_video.width`.split(`.`);function Lx(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ix.reduce((t,n)=>{let r=e.getAttribute(`data-vimeo-${n}`);return(r||r===``)&&(t[n]=r===``?1:r),t},t)}function Rx(e,t){let{html:n}=e;if(!t)throw TypeError(`An element must be provided`);if(t.getAttribute(`data-vimeo-initialized`)!==null)return t.querySelector(`iframe`);let r=document.createElement(`div`);return r.innerHTML=n,t.appendChild(r.firstChild),t.setAttribute(`data-vimeo-initialized`,`true`),t.querySelector(`iframe`)}function zx(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((r,i)=>{if(!gx(e))throw TypeError(`“${e}” is not a vimeo.com url.`);let a=`https://${vx(e)}/api/oembed.json?url=${encodeURIComponent(e)}`;for(let e in t)t.hasOwnProperty(e)&&(a+=`&${e}=${encodeURIComponent(t[e])}`);let o=`XDomainRequest`in window?new XDomainRequest:new XMLHttpRequest;o.open(`GET`,a,!0),o.onload=function(){if(o.status===404){i(Error(`“${e}” was not found.`));return}if(o.status===403){i(Error(`“${e}” is not embeddable.`));return}try{let t=JSON.parse(o.responseText);if(t.domain_status_code===403){Rx(t,n),i(Error(`“${e}” is not embeddable.`));return}r(t)}catch(e){i(e)}},o.onerror=function(){let e=o.status?` (${o.status})`:``;i(Error(`There was an error fetching the embed code from Vimeo${e}.`))},o.send()})}function Bx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,t=[].slice.call(e.querySelectorAll(`[data-vimeo-id], [data-vimeo-url]`)),n=e=>{`console`in window&&console.error&&console.error(`There was an error creating an embed: ${e}`)};t.forEach(e=>{try{if(e.getAttribute(`data-vimeo-defer`)!==null)return;let t=Lx(e);zx(yx(t),t,e).then(t=>Rx(t,e)).catch(n)}catch(e){n(e)}})}function Vx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoPlayerResizeEmbeds_||(window.VimeoPlayerResizeEmbeds_=!0,window.addEventListener(`message`,t=>{if(!gx(t.origin)||!t.data||t.data.event!==`spacechange`)return;let n=t.source?xx(t.source,e):null;if(n){let e=n.parentElement;e.style.paddingBottom=`${t.data.data[0].bottom}px`}}))}function Hx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoSeoMetadataAppended||(window.VimeoSeoMetadataAppended=!0,window.addEventListener(`message`,t=>{if(!gx(t.origin))return;let n=Nx(t.data);if(!n||n.event!==`ready`)return;let r=t.source?xx(t.source,e):null;r&&_x(r.src)&&new Zx(r).callMethod(`appendVideoMetadata`,window.location.href)}))}function Ux(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(window.VimeoCheckedUrlTimeParam)return;window.VimeoCheckedUrlTimeParam=!0;let t=e=>{`console`in window&&console.error&&console.error(`There was an error getting video Id: ${e}`)};window.addEventListener(`message`,n=>{if(!gx(n.origin))return;let r=Nx(n.data);if(!r||r.event!==`ready`)return;let i=n.source?xx(n.source,e):null;if(i&&_x(i.src)){let e=new Zx(i);e.getVideoId().then(t=>{let n=RegExp(`[?&]vimeo_t_${t}=([^&#]*)`).exec(window.location.href);if(n&&n[1]){let t=decodeURI(n[1]);e.setCurrentTime(t)}}).catch(t)}})}function Wx(){window.VimeoDRMEmbedsUpdated||(window.VimeoDRMEmbedsUpdated=!0,window.addEventListener(`message`,e=>{if(!gx(e.origin))return;let t=Nx(e.data);if(!t||t.event!==`drminitfailed`)return;let n=e.source?xx(e.source):null;if(!n)return;let r=n.getAttribute(`allow`)||``;if(!r.includes(`encrypted-media`)){n.setAttribute(`allow`,`${r}; encrypted-media`);let e=new URL(n.getAttribute(`src`));e.searchParams.set(`forcereload`,`drm`),n.setAttribute(`src`,e.toString());return}}))}function Gx(){let e=function(){let e,t=[[`requestFullscreen`,`exitFullscreen`,`fullscreenElement`,`fullscreenEnabled`,`fullscreenchange`,`fullscreenerror`],[`webkitRequestFullscreen`,`webkitExitFullscreen`,`webkitFullscreenElement`,`webkitFullscreenEnabled`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`webkitRequestFullScreen`,`webkitCancelFullScreen`,`webkitCurrentFullScreenElement`,`webkitCancelFullScreen`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`mozRequestFullScreen`,`mozCancelFullScreen`,`mozFullScreenElement`,`mozFullScreenEnabled`,`mozfullscreenchange`,`mozfullscreenerror`],[`msRequestFullscreen`,`msExitFullscreen`,`msFullscreenElement`,`msFullscreenEnabled`,`MSFullscreenChange`,`MSFullscreenError`]],n=0,r=t.length,i={};for(;n<r;n++)if(e=t[n],e&&e[1]in document){for(n=0;n<e.length;n++)i[t[0][n]]=e[n];return i}return!1}(),t={fullscreenchange:e.fullscreenchange,fullscreenerror:e.fullscreenerror},n={request(t){return new Promise((r,i)=>{let a=function(){n.off(`fullscreenchange`,a),r()};n.on(`fullscreenchange`,a),t||=document.documentElement;let o=t[e.requestFullscreen]();o instanceof Promise&&o.then(a).catch(i)})},exit(){return new Promise((t,r)=>{if(!n.isFullscreen){t();return}let i=function(){n.off(`fullscreenchange`,i),t()};n.on(`fullscreenchange`,i);let a=document[e.exitFullscreen]();a instanceof Promise&&a.then(i).catch(r)})},on(e,n){let r=t[e];r&&document.addEventListener(r,n)},off(e,n){let r=t[e];r&&document.removeEventListener(r,n)}};return Object.defineProperties(n,{isFullscreen:{get(){return!!document[e.fullscreenElement]}},element:{enumerable:!0,get(){return document[e.fullscreenElement]}},isEnabled:{enumerable:!0,get(){return!!document[e.fullscreenEnabled]}}}),n}var Kx={role:`viewer`,autoPlayMuted:!0,allowedDrift:.3,maxAllowedDrift:1,minCheckInterval:.1,maxRateAdjustment:.2,maxTimeToCatchUp:1},qx=class extends EventTarget{logger;constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;super(),this.logger=r,this.init(t,e,{...Kx,...n})}disconnect(){this.dispatchEvent(new Event(`disconnect`))}async init(e,t,n){if(await this.waitForTOReadyState(e,`open`),n.role===`viewer`){await this.updatePlayer(e,t,n);let r=bx(e,`change`,()=>this.updatePlayer(e,t,n)),i=this.maintainPlaybackPosition(e,t,n);this.addEventListener(`disconnect`,()=>{i.cancel(),r.cancel()})}else{await this.updateTimingObject(e,t);let n=bx(t,[`seeked`,`play`,`pause`,`ratechange`],()=>this.updateTimingObject(e,t),`on`,`off`);this.addEventListener(`disconnect`,()=>n.cancel())}}async updateTimingObject(e,t){let[n,r,i]=await Promise.all([t.getCurrentTime(),t.getPaused(),t.getPlaybackRate()]);e.update({position:n,velocity:r?0:i})}async updatePlayer(e,t,n){let{position:r,velocity:i}=e.query();typeof r==`number`&&t.setCurrentTime(r),typeof i==`number`&&(i===0?await t.getPaused()===!1&&t.pause():i>0&&(await t.getPaused()===!0&&(await t.play().catch(async e=>{e.name===`NotAllowedError`&&n.autoPlayMuted&&(await t.setMuted(!0),await t.play().catch(e=>console.error(`Couldn't play the video from TimingSrcConnector. Error:`,e)))}),this.updatePlayer(e,t,n)),await t.getPlaybackRate()!==i&&t.setPlaybackRate(i)))}maintainPlaybackPosition(e,t,n){let{allowedDrift:r,maxAllowedDrift:i,minCheckInterval:a,maxRateAdjustment:o,maxTimeToCatchUp:s}=n,c=Math.min(s,Math.max(a,i))*1e3,l=async()=>{if(e.query().velocity===0||await t.getPaused()===!0)return;let n=e.query().position-await t.getCurrentTime(),a=Math.abs(n);if(this.log(`Drift: ${n}`),a>i)await this.adjustSpeed(t,0),t.setCurrentTime(e.query().position),this.log(`Resync by currentTime`);else if(a>r){let e=a/s,r=o,i=e<r?(r-e)/2:r;await this.adjustSpeed(t,i*Math.sign(n)),this.log(`Resync by playbackRate`)}},u=setInterval(()=>l(),c);return{cancel:()=>clearInterval(u)}}log(e){this.logger?.(`TimingSrcConnector: ${e}`)}speedAdjustment=0;adjustSpeed=async(e,t)=>{if(this.speedAdjustment===t)return;let n=await e.getPlaybackRate()-this.speedAdjustment+t;this.log(`New playbackRate: ${n}`),await e.setPlaybackRate(n),this.speedAdjustment=t};waitForTOReadyState(e,t){return new Promise(n=>{let r=()=>{e.readyState===t?n():e.addEventListener(`readystatechange`,r,{once:!0})};r()})}},Jx=new WeakMap,Yx=new WeakMap,Xx={},Zx=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(window.jQuery&&e instanceof jQuery&&(e.length>1&&window.console&&console.warn&&console.warn(`A jQuery object with multiple elements was passed, using the first element.`),e=e[0]),typeof document<`u`&&typeof e==`string`&&(e=document.getElementById(e)),!mx(e))throw TypeError(`You must pass either a valid element or a valid id.`);if(e.nodeName!==`IFRAME`){let t=e.querySelector(`iframe`);t&&(e=t)}if(e.nodeName===`IFRAME`&&!gx(e.getAttribute(`src`)||``))throw Error(`The player element passed isn’t a Vimeo embed.`);if(Jx.has(e))return Jx.get(e);this._window=e.ownerDocument.defaultView,this.element=e,this.origin=`*`;let n=new Ex((n,r)=>{if(this._onMessage=e=>{if(!gx(e.origin)||this.element.contentWindow!==e.source)return;this.origin===`*`&&(this.origin=e.origin);let t=Nx(e.data);if(t&&t.event===`error`&&t.data&&t.data.method===`ready`){let e=Error(t.data.message);e.name=t.data.name,r(e);return}let i=t&&t.event===`ready`,a=t&&t.method===`ping`;if(i||a){this.element.setAttribute(`data-ready`,`true`),n();return}Fx(this,t)},this._window.addEventListener(`message`,this._onMessage),this.element.nodeName!==`IFRAME`){let n=Lx(e,t);zx(yx(n),n,e).then(t=>{let n=Rx(t,e);return this.element=n,this._originalElement=e,Mx(e,n),Jx.set(this.element,this),t}).catch(r)}});if(Yx.set(this,n),Jx.set(this.element,this),this.element.nodeName===`IFRAME`&&Px(this,`ping`),Xx.isEnabled){let e=()=>Xx.exit();this.fullscreenchangeHandler=()=>{Xx.isFullscreen?Ox(this,`event:exitFullscreen`,e):Ax(this,`event:exitFullscreen`,e),this.ready().then(()=>{Px(this,`fullscreenchange`,Xx.isFullscreen)})},Xx.on(`fullscreenchange`,this.fullscreenchangeHandler)}return this}static isVimeoUrl(e){return gx(e)}callMethod(e){var t=[...arguments].slice(1);if(e==null)throw TypeError(`You must pass a method name.`);return new Ex((n,r)=>this.ready().then(()=>{Ox(this,e,{resolve:n,reject:r}),t.length===0?t={}:t.length===1&&(t=t[0]),Px(this,e,t)}).catch(r))}get(e){return new Ex((t,n)=>(e=px(e,`get`),this.ready().then(()=>{Ox(this,e,{resolve:t,reject:n}),Px(this,e)}).catch(n)))}set(e,t){return new Ex((n,r)=>{if(e=px(e,`set`),t==null)throw TypeError(`There must be a value to set.`);return this.ready().then(()=>{Ox(this,e,{resolve:n,reject:r}),Px(this,e,t)}).catch(r)})}on(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(!t)throw TypeError(`You must pass a callback function.`);if(typeof t!=`function`)throw TypeError(`The callback must be a function.`);kx(this,`event:${e}`).length===0&&this.callMethod(`addEventListener`,e).catch(()=>{}),Ox(this,`event:${e}`,t)}off(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(t&&typeof t!=`function`)throw TypeError(`The callback must be a function.`);Ax(this,`event:${e}`,t)&&this.callMethod(`removeEventListener`,e).catch(e=>{})}loadVideo(e){return this.callMethod(`loadVideo`,e)}ready(){let e=Yx.get(this)||new Ex((e,t)=>{t(Error(`Unknown player. Probably unloaded.`))});return Ex.resolve(e)}addCuePoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.callMethod(`addCuePoint`,{time:e,data:t})}removeCuePoint(e){return this.callMethod(`removeCuePoint`,e)}enableTextTrack(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`enableTextTrack`,{language:e,kind:t,showing:n})}disableTextTrack(){return this.callMethod(`disableTextTrack`)}selectAudioTrack(e,t){if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`selectAudioTrack`,{language:e,kind:t})}selectDefaultAudioTrack(){return this.callMethod(`selectDefaultAudioTrack`)}pause(){return this.callMethod(`pause`)}play(){return this.callMethod(`play`)}requestFullscreen(){return Xx.isEnabled?Xx.request(this.element):this.callMethod(`requestFullscreen`)}exitFullscreen(){return Xx.isEnabled?Xx.exit():this.callMethod(`exitFullscreen`)}getFullscreen(){return Xx.isEnabled?Ex.resolve(Xx.isFullscreen):this.get(`fullscreen`)}requestPictureInPicture(){return this.callMethod(`requestPictureInPicture`)}exitPictureInPicture(){return this.callMethod(`exitPictureInPicture`)}getPictureInPicture(){return this.get(`pictureInPicture`)}remotePlaybackPrompt(){return this.callMethod(`remotePlaybackPrompt`)}unload(){return this.callMethod(`unload`)}destroy(){return new Ex(e=>{if(Yx.delete(this),Jx.delete(this.element),this._originalElement&&(Jx.delete(this._originalElement),this._originalElement.removeAttribute(`data-vimeo-initialized`)),this.element&&this.element.nodeName===`IFRAME`&&this.element.parentNode&&(this.element.parentNode.parentNode&&this._originalElement&&this._originalElement!==this.element.parentNode?this.element.parentNode.parentNode.removeChild(this.element.parentNode):this.element.parentNode.removeChild(this.element)),this.element&&this.element.nodeName===`DIV`&&this.element.parentNode){this.element.removeAttribute(`data-vimeo-initialized`);let e=this.element.querySelector(`iframe`);e&&e.parentNode&&(e.parentNode.parentNode&&this._originalElement&&this._originalElement!==e.parentNode?e.parentNode.parentNode.removeChild(e.parentNode):e.parentNode.removeChild(e))}this._window.removeEventListener(`message`,this._onMessage),Xx.isEnabled&&Xx.off(`fullscreenchange`,this.fullscreenchangeHandler),e()})}getAutopause(){return this.get(`autopause`)}setAutopause(e){return this.set(`autopause`,e)}getBuffered(){return this.get(`buffered`)}getCameraProps(){return this.get(`cameraProps`)}setCameraProps(e){return this.set(`cameraProps`,e)}getChapters(){return this.get(`chapters`)}getCurrentChapter(){return this.get(`currentChapter`)}getColor(){return this.get(`color`)}getColors(){return Ex.all([this.get(`colorOne`),this.get(`colorTwo`),this.get(`colorThree`),this.get(`colorFour`)])}setColor(e){return this.set(`color`,e)}setColors(e){if(!Array.isArray(e))return new Ex((e,t)=>t(TypeError(`Argument must be an array.`)));let t=new Ex(e=>e(null)),n=[e[0]?this.set(`colorOne`,e[0]):t,e[1]?this.set(`colorTwo`,e[1]):t,e[2]?this.set(`colorThree`,e[2]):t,e[3]?this.set(`colorFour`,e[3]):t];return Ex.all(n)}getCuePoints(){return this.get(`cuePoints`)}getCurrentTime(){return this.get(`currentTime`)}setCurrentTime(e){return this.set(`currentTime`,e)}getDuration(){return this.get(`duration`)}getEnded(){return this.get(`ended`)}getLoop(){return this.get(`loop`)}setLoop(e){return this.set(`loop`,e)}setMuted(e){return this.set(`muted`,e)}getMuted(){return this.get(`muted`)}getPaused(){return this.get(`paused`)}getPlaybackRate(){return this.get(`playbackRate`)}setPlaybackRate(e){return this.set(`playbackRate`,e)}getPlayed(){return this.get(`played`)}getQualities(){return this.get(`qualities`)}getQuality(){return this.get(`quality`)}setQuality(e){return this.set(`quality`,e)}getRemotePlaybackAvailability(){return this.get(`remotePlaybackAvailability`)}getRemotePlaybackState(){return this.get(`remotePlaybackState`)}getSeekable(){return this.get(`seekable`)}getSeeking(){return this.get(`seeking`)}getTextTracks(){return this.get(`textTracks`)}getAudioTracks(){return this.get(`audioTracks`)}getEnabledAudioTrack(){return this.get(`enabledAudioTrack`)}getDefaultAudioTrack(){return this.get(`defaultAudioTrack`)}getVideoEmbedCode(){return this.get(`videoEmbedCode`)}getVideoId(){return this.get(`videoId`)}getVideoTitle(){return this.get(`videoTitle`)}getVideoWidth(){return this.get(`videoWidth`)}getVideoHeight(){return this.get(`videoHeight`)}getVideoUrl(){return this.get(`videoUrl`)}getVolume(){return this.get(`volume`)}setVolume(e){return this.set(`volume`,e)}async setTimingSrc(e,t){if(!e)throw TypeError(`A Timing Object must be provided.`);await this.ready();let n=new qx(this,e,t);return Px(this,`notifyTimingObjectConnect`),n.addEventListener(`disconnect`,()=>Px(this,`notifyTimingObjectDisconnect`)),n}};fx||(Xx=Gx(),Bx(),Vx(),Hx(),Ux(),Wx());function Qx(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$x(e,t)}function $x(e,t){return $x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$x(e,t)}var eS={play:`onPlay`,playing:`onPlaying`,pause:`onPause`,ended:`onEnd`,timeupdate:`onTimeUpdate`,progress:`onProgress`,seeked:`onSeeked`,texttrackchange:`onTextTrackChange`,cuechange:`onCueChange`,cuepoint:`onCuePoint`,volumechange:`onVolumeChange`,playbackratechange:`onPlaybackRateChange`,error:`onError`,loaded:`onLoaded`},tS=function(e){function t(t){var n=e.call(this,t)||this;return n.refContainer=n.refContainer.bind(n),n}Qx(t,e);var n=t.prototype;return n.componentDidMount=function(){this.createPlayer()},n.componentDidUpdate=function(e){var t=this,n=Object.keys(this.props).filter(function(n){return t.props[n]!==e[n]});this.updateProps(n)},n.componentWillUnmount=function(){this.player.destroy()},n.getInitialOptions=function(){var e,t=this.props.video,n=/^https?:/i.test(t)?`url`:`id`;return e={},e[n]=t,e.width=this.props.width,e.height=this.props.height,e.autopause=this.props.autopause,e.autoplay=this.props.autoplay,e.byline=this.props.showByline,e.color=this.props.color,e.controls=this.props.controls,e.loop=this.props.loop,e.portrait=this.props.showPortrait,e.title=this.props.showTitle,e.muted=this.props.muted,e.background=this.props.background,e.responsive=this.props.responsive,e.dnt=this.props.dnt,e.speed=this.props.speed,e.keyboard=this.props.keyboard,e.pip=this.props.pip,e.playsinline=this.props.playsInline,e.quality=this.props.quality,e.texttrack=this.props.textTrack,e.transparent=this.props.transparent,e},n.updateProps=function(e){var t=this,n=this.player;e.forEach(function(e){var r=t.props[e];switch(e){case`autopause`:n.setAutopause(r);break;case`color`:n.setColor(r);break;case`loop`:n.setLoop(r);break;case`volume`:n.setVolume(r);break;case`paused`:n.getPaused().then(function(e){return r&&!e?n.pause():!r&&e?n.play():null});break;case`width`:case`height`:n.element[e]=r;break;case`video`:if(r){var i=t.props.start,a=n.loadVideo(r);typeof i==`number`&&a.then(function(){n.setCurrentTime(i)})}else n.unload();break;case`playbackRate`:n.setPlaybackRate(r);break;case`quality`:n.setQuality(r);break}})},n.createPlayer=function(){var e=this,t=this.props,n=t.start,r=t.volume,i=t.playbackRate;this.player=new Zx(this.container,this.getInitialOptions()),Object.keys(eS).forEach(function(t){var n=eS[t];e.player.on(t,function(t){var r=e.props[n];r&&r(t)})});var a=this.props,o=a.onError,s=a.onReady;this.player.ready().then(function(){s&&s(e.player)},function(e){if(o)o(e);else throw e}),typeof n==`number`&&this.player.setCurrentTime(n),typeof r==`number`&&this.updateProps([`volume`]),typeof i==`number`&&this.updateProps([`playbackRate`])},n.refContainer=function(e){this.container=e},n.render=function(){var e=this.props,t=e.id,n=e.className,r=e.style;return Z.createElement(`div`,{id:t,className:n,style:r,ref:this.refContainer})},t}(Z.Component);tS.defaultProps={autopause:!0,autoplay:!1,showByline:!0,controls:!0,loop:!1,showPortrait:!0,showTitle:!0,muted:!1,background:!1,responsive:!1,dnt:!1,speed:!1,keyboard:!0,pip:!1,playsInline:!0,transparent:!0};var nS={default:120,mqdefault:320,hqdefault:480,sddefault:640,maxresdefault:1280},rS=(e,t,n,r=`maxresdefault`)=>{let[i,a]=(0,Z.useState)(``);return(0,Z.useEffect)(()=>{let i=`https://img.youtube.com/${t}/${e}/${r}.${n}`,o=`https://img.youtube.com/${t}/${e}/hqdefault.${n}`,s=nS[r],c=new Image;c.onload=()=>{c.width<s?a(o):a(i)},c.onerror=()=>a(o),c.src=i},[e,t,n,r]),i};function iS(e,t,n,r,i){let a={"@context":`https://schema.org`,"@type":`VideoObject`,name:i?.name||t,thumbnailUrl:[i?.thumbnailUrl||n],embedUrl:i?.embedUrl||`${r}/embed/${e}`,contentUrl:i?.contentUrl||`https://www.youtube.com/watch?v=${e}`,...i?.description&&{description:i.description},...i?.uploadDate&&{uploadDate:i.uploadDate},...i?.duration&&{duration:i.duration}};return JSON.stringify(a)}function aS(e,t){let[n,r]=Z.useState(!1),[i,a]=Z.useState(e.alwaysLoadIframe||!1),o=encodeURIComponent(e.id),s=typeof e.playlistCoverId==`string`?encodeURIComponent(e.playlistCoverId):null,c=e.title,l=e.poster||`hqdefault`,u=e.announce||`Watch`,d=e.alwaysLoadIframe?e.autoplay&&e.muted:!0,f=Z.useMemo(()=>{let t=new URLSearchParams({...e.muted?{mute:`1`}:{},...d?{autoplay:`1`}:{},...e.enableJsApi?{enablejsapi:`1`}:{},...e.enableJsApi&&typeof window<`u`?{origin:window.location.origin}:{},...e.playlist?{list:o}:{}});return e.params&&new URLSearchParams(e.params.startsWith(`&`)?e.params.slice(1):e.params).forEach((e,n)=>{t.append(n,e)}),t},[e.muted,d,e.enableJsApi,e.playlist,o,e.params]),p=Z.useMemo(()=>e.cookie?`https://www.youtube.com`:`https://www.youtube-nocookie.com`,[e.cookie]),m=Z.useMemo(()=>e.playlist?`${p}/embed/videoseries?${f.toString()}`:`${p}/embed/${o}?${f.toString()}`,[e.playlist,p,o,f]),h=!e.thumbnail&&!e.playlist&&l===`maxresdefault`,g=e.webp?`webp`:`jpg`,_=e.webp?`vi_webp`:`vi`,v=h?rS(e.id,_,g,l):null,y=Z.useMemo(()=>e.thumbnail||v||`https://i.ytimg.com/${_}/${e.playlist?s:o}/${l}.${g}`,[e.thumbnail,v,_,e.playlist,s,o,l,g]),b=e.activatedClass||`lyt-activated`,x=e.adNetwork||!1,S=e.aspectHeight||9,C=e.aspectWidth||16,w=e.iframeClass||``,T=e.playerClass||`lty-playbtn`,E=e.wrapperClass||`yt-lite`,D=Z.useCallback(e.onIframeAdded||function(){},[e.onIframeAdded]),O=e.rel?`prefetch`:`preload`,k=e.containerElement||`article`,A=e.noscriptFallback!==!1,j=()=>{n||r(!0)},M=()=>{i||a(!0)};return Z.useEffect(()=>{i&&(D(),e.focusOnLoad&&typeof t==`object`&&t?.current&&t.current.focus())},[i,D,e.focusOnLoad,t]),Z.useEffect(()=>{if(!i||!e.enableJsApi||!(e.onReady||e.onStateChange||e.onError||e.onPlay||e.onPause||e.onEnd||e.onBuffering||e.onPlaybackRateChange||e.onPlaybackQualityChange))return;let n=!1,r=!1,a=r=>{if(r.origin!==`https://www.youtube.com`&&r.origin!==`https://www.youtube-nocookie.com`)return;let i;try{i=typeof r.data==`string`?JSON.parse(r.data):r.data}catch{return}switch(i.event){case`onReady`:n||(n=!0,e.onReady&&e.onReady({videoId:e.id,title:c}));break;case`infoDelivery`:if(i.info?.playerState!==void 0){let n=i.info.playerState;switch(e.onStateChange&&e.onStateChange({state:n,currentTime:i.info.currentTime,duration:i.info.duration}),n){case 1:e.onPlay?.();break;case 2:e.onPause?.();break;case 0:e.onEnd?.(),e.stopOnEnd&&typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"command","func":"stopVideo","args":""}`,`*`);break;case 3:e.onBuffering?.();break}}i.info?.playbackRate!==void 0&&e.onPlaybackRateChange?.(i.info.playbackRate),i.info?.playbackQuality!==void 0&&e.onPlaybackQualityChange?.(i.info.playbackQuality);break;case`onStateChange`:if(i.info?.playerState!==void 0){let n=i.info.playerState;switch(e.onStateChange&&e.onStateChange({state:n,currentTime:i.info.currentTime,duration:i.info.duration}),n){case 1:e.onPlay?.();break;case 2:e.onPause?.();break;case 0:e.onEnd?.(),e.stopOnEnd&&typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"command","func":"stopVideo","args":""}`,`*`);break;case 3:e.onBuffering?.();break}}break;case`onError`:if(i.info&&`errorCode`in i.info){let t=i.info.errorCode;e.onError&&e.onError(t)}break;case`onPlaybackRateChange`:i.info?.playbackRate!==void 0&&e.onPlaybackRateChange?.(i.info.playbackRate);break;case`onPlaybackQualityChange`:i.info?.playbackQuality!==void 0&&e.onPlaybackQualityChange?.(i.info.playbackQuality);break}};window.addEventListener(`message`,a);let s=[],l=()=>{typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"listening","id":"`+o+`"}`,`*`)},u=()=>{r||(r=!0,l(),[100,300,600,1200,2400].forEach(e=>{s.push(setTimeout(l,e))}))};return typeof t==`object`&&t?.current?(t.current.addEventListener(`load`,u),t.current.contentDocument?.readyState===`complete`&&u()):[200,500,1e3,2e3,3e3].forEach(e=>{s.push(setTimeout(l,e))}),()=>{window.removeEventListener(`message`,a),s.forEach(clearTimeout),typeof t==`object`&&t?.current&&t.current.removeEventListener(`load`,u)}},[i,e.enableJsApi,e.onReady,e.onStateChange,e.onError,e.onPlay,e.onPause,e.onEnd,e.onBuffering,e.onPlaybackRateChange,e.onPlaybackQualityChange,e.stopOnEnd,e.id,o,c,t]),(0,$.jsxs)($.Fragment,{children:[!e.lazyLoad&&(0,$.jsx)(`link`,{rel:O,href:y,as:`image`}),(0,$.jsx)($.Fragment,{children:n&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`link`,{rel:`preconnect`,href:p}),(0,$.jsx)(`link`,{rel:`preconnect`,href:`https://www.google.com`}),x&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`link`,{rel:`preconnect`,href:`https://static.doubleclick.net`}),(0,$.jsx)(`link`,{rel:`preconnect`,href:`https://googleads.g.doubleclick.net`})]})]})}),e.seo&&!e.playlist&&(0,$.jsx)(`script`,{type:`application/ld+json`,dangerouslySetInnerHTML:{__html:iS(e.id,c,y,p,e.seo)}}),A&&!e.playlist&&(0,$.jsx)(`noscript`,{children:(0,$.jsxs)(`a`,{href:`https://www.youtube.com/watch?v=${e.id}`,"aria-label":`Watch ${c} on YouTube`,children:[`Watch "`,c,`" on YouTube`]})}),(0,$.jsxs)(k,{onPointerOver:j,onClick:M,className:`${E} ${i?b:``}`,"data-title":c,role:!i&&!e.lazyLoad?`img`:void 0,"aria-label":i?void 0:`${c} - YouTube video preview`,style:{...!e.lazyLoad&&{backgroundImage:`url(${y})`},"--aspect-ratio":`${S/C*100}%`,...e.style||{}},children:[e.lazyLoad&&!i&&(0,$.jsx)(`img`,{src:y,alt:`${c} - YouTube thumbnail`,className:`lty-thumbnail`,loading:`lazy`}),e.playlist&&!i&&(0,$.jsx)(`div`,{className:`lty-playlist-icon`,"aria-hidden":`true`}),!(e.hideButtonOnActivate&&i)&&(0,$.jsx)(`button`,{type:`button`,className:T,"aria-label":`${u} ${c}`,"aria-hidden":i||void 0,tabIndex:i?-1:0,onClick:M,children:(0,$.jsx)(`span`,{className:`lty-visually-hidden`,children:u})}),i&&(0,$.jsx)(`iframe`,{ref:t,className:w,title:c,width:`560`,height:`315`,allow:`accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,src:m,referrerPolicy:e.referrerPolicy||`strict-origin-when-cross-origin`})]})]})}var oS=Z.forwardRef(aS);function sS(e){return e!==!1}function cS(e,t){let n=[];return t.startSeconds!==null&&n.push(`start=${t.startSeconds}`),e.controls===!1&&n.push(`controls=0`),e.loop===!0&&n.push(`loop=1`,`playlist=${t.id}`),e.playsinline===!0&&n.push(`playsinline=1`),n.length>0?n.join(`&`):void 0}function lS(e){if(e.width!==void 0)return{width:e.width}}function uS(e){if(!(e.width===void 0||e.height===void 0))return{aspectRatio:`${e.width} / ${e.height}`}}function dS(e){let t=(0,Q.c)(23),n=(0,Z.useRef)(null),r=e.title??`Vimeo video player`,i;t[0]===r?i=t[1]:(i=e=>{let t=e;n.current=t,t.element&&(t.element.title=r)},t[0]=r,t[1]=i);let a=i,o,s;t[2]===r?(o=t[3],s=t[4]):(o=()=>{let e=n.current;e?.element&&(e.element.title=r)},s=[r],t[2]=r,t[3]=o,t[4]=s),(0,Z.useEffect)(o,s);let c;t[5]===e?c=t[6]:(c=lS(e),t[5]=e,t[6]=c);let l=e.width===void 0,u=e.autoplay===!0,d=e.muted===!0,f=e.muted===!0?0:1,p=e.loop===!0,m=e.controls!==!1,h=e.playsinline!==!1,g;t[7]!==a||t[8]!==e.height||t[9]!==e.src||t[10]!==e.width||t[11]!==h||t[12]!==l||t[13]!==u||t[14]!==d||t[15]!==f||t[16]!==p||t[17]!==m?(g=(0,$.jsx)(tS,{video:e.src,responsive:l,width:e.width,height:e.height,autoplay:u,muted:d,volume:f,loop:p,controls:m,playsInline:h,onReady:a}),t[7]=a,t[8]=e.height,t[9]=e.src,t[10]=e.width,t[11]=h,t[12]=l,t[13]=u,t[14]=d,t[15]=f,t[16]=p,t[17]=m,t[18]=g):g=t[18];let _;return t[19]!==e.title||t[20]!==g||t[21]!==c?(_=(0,$.jsx)(`div`,{className:`ok-video ok-video-vimeo`,style:c,title:e.title,children:g}),t[19]=e.title,t[20]=g,t[21]=c,t[22]=_):_=t[22],_}function fS(e){let t=(0,Q.c)(17),n;t[0]===e.src?n=t[1]:(n=br(e.src),t[0]=e.src,t[1]=n);let r=n;if(!r)return null;let i;t[2]!==r.startRaw||t[3]!==e.autoplay||t[4]!==e.muted?(i=[],r.startRaw!==null&&i.push(`t=${r.startRaw}`),e.autoplay===!0&&i.push(`autoplay=true`),e.muted===!0&&i.push(`muted=true`),t[2]=r.startRaw,t[3]=e.autoplay,t[4]=e.muted,t[5]=i):i=t[5];let a=i.length>0?`https://www.loom.com/embed/${r.id}?${i.join(`&`)}`:`https://www.loom.com/embed/${r.id}`,o;t[6]===e?o=t[7]:(o=lS(e),t[6]=e,t[7]=o);let s=e.title??`Loom video player`,c;t[8]!==a||t[9]!==e.height||t[10]!==e.width||t[11]!==s?(c=(0,$.jsx)(`iframe`,{className:`ok-video-loom-iframe`,src:a,title:s,width:e.width,height:e.height,allow:`autoplay; fullscreen`,referrerPolicy:`strict-origin-when-cross-origin`,allowFullScreen:!0}),t[8]=a,t[9]=e.height,t[10]=e.width,t[11]=s,t[12]=c):c=t[12];let l;return t[13]!==e.title||t[14]!==o||t[15]!==c?(l=(0,$.jsx)(`div`,{className:`ok-video ok-video-loom`,style:o,title:e.title,children:c}),t[13]=e.title,t[14]=o,t[15]=c,t[16]=l):l=t[16],l}function pS(e){let t=(0,Q.c)(29);if(e.src!==void 0&&Ht(e.src)){let n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(fS,{...e,src:e.src}),t[0]=e,t[1]=n),n}if(e.src!==void 0&&Sr(e.src)){let n;return t[2]===e?n=t[3]:(n=(0,$.jsx)(dS,{...e,src:e.src}),t[2]=e,t[3]=n),n}let n;if(t[4]!==e){n=Symbol.for(`react.early_return_sentinel`);bb0:{let r=e.src===void 0?null:xn(e.src);if(r!==null){let i=e.autoplay===!0&&e.muted===!0,a=e.width!==void 0&&e.height!==void 0,o=lS(e),s;t[6]===e.poster?s=t[7]:(s=e.poster===void 0?void 0:go(e.poster),t[6]=e.poster,t[7]=s);let c=(0,$.jsx)(oS,{id:r.id,title:e.title??`YouTube video player`,cookie:!r.noCookie,params:cS(e,r),muted:e.muted===!0,autoplay:e.autoplay===!0,alwaysLoadIframe:i,thumbnail:s,aspectWidth:a?Number(e.width):void 0,aspectHeight:a?Number(e.height):void 0,style:uS(e)}),l;t[8]!==o||t[9]!==c?(l=(0,$.jsx)(`div`,{className:`ok-video ok-video-youtube`,style:o,children:c}),t[8]=o,t[9]=c,t[10]=l):l=t[10],n=l;break bb0}}t[4]=e,t[5]=n}else n=t[5];if(n!==Symbol.for(`react.early_return_sentinel`))return n;let r;t[11]===e.src?r=t[12]:(r=e.src===void 0?void 0:go(e.src),t[11]=e.src,t[12]=r);let i=e.title,a;t[13]===e.controls?a=t[14]:(a=sS(e.controls),t[13]=e.controls,t[14]=a);let o;t[15]===e.poster?o=t[16]:(o=e.poster===void 0?void 0:go(e.poster),t[15]=e.poster,t[16]=o);let s;return t[17]!==e.autoplay||t[18]!==e.height||t[19]!==e.loop||t[20]!==e.muted||t[21]!==e.playsinline||t[22]!==e.preload||t[23]!==e.title||t[24]!==e.width||t[25]!==r||t[26]!==a||t[27]!==o?(s=(0,$.jsx)(`video`,{className:`ok-video`,src:r,title:i,controls:a,autoPlay:e.autoplay,muted:e.muted,loop:e.loop,playsInline:e.playsinline,poster:o,preload:e.preload,width:e.width,height:e.height}),t[17]=e.autoplay,t[18]=e.height,t[19]=e.loop,t[20]=e.muted,t[21]=e.playsinline,t[22]=e.preload,t[23]=e.title,t[24]=e.width,t[25]=r,t[26]=a,t[27]=o,t[28]=s):s=t[28],s}function mS(e){let t=(0,Q.c)(2),n;return t[0]===e.children?n=t[1]:(n=(0,$.jsx)(`div`,{className:`prose-no-margin`,children:e.children}),t[0]=e.children,t[1]=n),n}var hS={Callout:K_,img:Ky,video:pS,audio:V_,Pdf:qb,File:Iv,Embed:nv,Excalidraw:Ev,Accordion:L_,Toggle:e=>(0,$.jsx)(L_,{...e,title:e.title??`Toggle`}),HtmlAlignBlock:z_,Tabs:ax,Tab:tx,Math:Yy,MermaidFence:St,Mirror:Mb,MirrorSource:Nb,"*":mS};function gS(e){let t=new Set;for(let n of e)n.type===`reactnode`&&t.add(n.name);return t}var _S=Yt(),vS=new Map;function yS(e){if(e.surface===`compat`){let t=hS[e.rendersAs];if(!t)throw Error(`Compat descriptor '${e.name}' declares rendersAs: '${e.rendersAs}', but no React component is registered under that name in componentMap. Add the canonical component before registering the compat descriptor.`);return{Component:t,reactNodePropNames:gS(e.props)}}let t=hS[e.name];return t?{Component:t,reactNodePropNames:gS(e.props)}:null}for(let[e,t]of _S.entries()){let n=yS(t);n&&vS.set(e,n)}function bS(e,t){return{...e,Component:t.Component,reactNodePropNames:t.reactNodePropNames}}function xS(e){let t=_S.getOrWildcard(e),n=vS.get(t.name)??vS.get(`*`);if(!n)throw Error(`No React component registered for ${t.name} (and no '*' wildcard)`);return bS(t,n)}function SS(){let e=[];for(let[t,n]of _S.entries()){if(t===`*`)continue;let r=vS.get(t);r&&e.push(bS(n,r))}return e}var CS=``+new URL(`image-preview-BJSGEOo4.png`,import.meta.url).href,wS=``+new URL(`video-preview-vLovc_Vy.png`,import.meta.url).href,TS={Callout:{description:{id:`322lyb`},props:()=>({type:`note`,title:Y._({id:`6s7LXO`})}),children:()=>Y._({id:`64sesb`})},Accordion:{description:{id:`mWVJRX`},props:()=>({title:Y._({id:`z9NwEu`}),defaultOpen:!0}),children:()=>Y._({id:`8uGMP8`})},Toggle:{description:{id:`cT_pW4`},props:()=>({title:Y._({id:`z9NwEu`}),defaultOpen:!0}),children:()=>Y._({id:`8uGMP8`})},img:{description:{id:`VUijjF`},props:()=>({src:CS,alt:Y._({id:`R9dK63`})})},video:{description:{id:`e1hptq`},props:()=>({controls:!0,poster:wS})},audio:{description:{id:`9jnjV0`},props:()=>({controls:!0})},Math:{description:{id:`Y-Urt2`},props:()=>({formula:`c = \\pm\\sqrt{a^2 + b^2}`})},Excalidraw:{description:{id:`qi17kj`},render:()=>(0,$.jsx)(`div`,{className:`flex h-full w-full items-center justify-center rounded-md border border-border bg-background p-3`,children:(0,$.jsxs)(`svg`,{viewBox:`0 0 120 60`,className:`h-full w-auto`,"aria-hidden":`true`,children:[(0,$.jsx)(`rect`,{x:`6`,y:`10`,width:`46`,height:`26`,rx:`6`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,className:`text-muted-foreground`}),(0,$.jsx)(`ellipse`,{cx:`92`,cy:`38`,rx:`20`,ry:`12`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,className:`text-muted-foreground/70`}),(0,$.jsx)(`path`,{d:`M52 23 C 66 23, 70 34, 72 36`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,className:`text-muted-foreground/50`})]})})},Embed:{description:{id:`jTLWxh`},render:()=>(0,$.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border bg-muted/40 px-2 py-1.5`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,$.jsx)(`span`,{className:`ml-1.5 flex-1 truncate rounded-sm bg-background px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`https://example.com/embed`})]}),(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1.5 px-3 py-2`,children:[(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1.5 w-full rounded-sm bg-muted-foreground/20`}),(0,$.jsx)(`span`,{className:`h-1.5 w-5/6 rounded-sm bg-muted-foreground/20`}),(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]})]})},Pdf:{description:{id:`Fqr8BP`},render:()=>(0,$.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-border bg-muted/40 px-1.5 py-1`,children:[(0,$.jsxs)(`svg`,{viewBox:`0 0 12 12`,className:`size-3 text-muted-foreground`,"aria-hidden":`true`,children:[(0,$.jsx)(`title`,{children:`Thumbnails`}),(0,$.jsx)(`rect`,{x:`1`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,$.jsx)(`rect`,{x:`7`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,$.jsx)(`rect`,{x:`1`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,$.jsx)(`rect`,{x:`7`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`})]}),(0,$.jsxs)(`span`,{className:`ml-1 flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,$.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5 font-mono`,children:`2`}),(0,$.jsx)(`span`,{children:`/ 12`})]}),(0,$.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 text-[10px] font-mono text-muted-foreground`,children:[(0,$.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`−`}),(0,$.jsx)(`span`,{children:`100%`}),(0,$.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`+`})]})]}),(0,$.jsxs)(`div`,{className:`flex flex-1 gap-1 p-1.5`,children:[(0,$.jsxs)(`div`,{className:`flex w-6 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`}),(0,$.jsx)(`span`,{className:`h-3 rounded-sm border border-foreground/60 bg-background`}),(0,$.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`})]}),(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1 rounded-sm bg-background p-1.5`,children:[(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-sm bg-foreground/50`}),(0,$.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1 w-5/6 rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1 w-2/3 rounded-sm bg-muted-foreground/30`})]})]})]})},MermaidFence:{description:{id:`z0a2EA`},render:()=>(0,$.jsxs)(`svg`,{viewBox:`0 0 200 120`,className:`h-full w-full text-foreground`,"aria-hidden":`true`,preserveAspectRatio:`xMidYMid meet`,children:[(0,$.jsx)(`title`,{children:`Mermaid flowchart preview`}),(0,$.jsx)(`defs`,{children:(0,$.jsx)(`marker`,{id:`mermaid-preview-arrow`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,$.jsx)(`path`,{d:`M 0 0 L 10 5 L 0 10 z`,fill:`currentColor`})})}),(0,$.jsx)(`rect`,{x:`14`,y:`20`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,$.jsx)(`text`,{x:`42`,y:`38`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Start`}),(0,$.jsx)(`polygon`,{points:`100,18 140,50 100,82 60,50`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,$.jsx)(`text`,{x:`100`,y:`54`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Ready?`}),(0,$.jsx)(`rect`,{x:`130`,y:`84`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,$.jsx)(`text`,{x:`158`,y:`102`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`End`}),(0,$.jsx)(`line`,{x1:`70`,y1:`34`,x2:`80`,y2:`40`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,$.jsx)(`line`,{x1:`124`,y1:`62`,x2:`138`,y2:`82`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,$.jsx)(`text`,{x:`138`,y:`74`,fontSize:`8`,fill:`currentColor`,opacity:`0.6`,children:`yes`})]})},Tabs:{description:{id:`75Y1dk`},render:()=>(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`flex gap-1 border-b border-border pb-1`,children:[(0,$.jsx)(`span`,{className:`rounded-md bg-foreground/10 px-2 py-0.5 text-xs font-medium text-foreground`,children:`Tab 1`}),(0,$.jsx)(`span`,{className:`rounded-md px-2 py-0.5 text-xs text-muted-foreground`,children:`Tab 2`})]}),(0,$.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:(0,$.jsx)(a,{id:`m6YGpY`})})]})},Mirror:{description:{id:`_WPP7e`},render:()=>(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/40 px-2 py-1.5`,children:[(0,$.jsxs)(`span`,{className:`absolute -top-2 right-1.5 flex items-center gap-1 rounded-md bg-background px-1 text-[10px] text-muted-foreground`,children:[(0,$.jsx)(Ol,{className:`size-2.5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:(0,$.jsx)(a,{id:`EL_YRd`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})})]}),(0,$.jsx)(`span`,{className:`block h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`mt-1 block h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]}),(0,$.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,$.jsx)(a,{id:`qNOgUu`})})]})},MirrorSource:{description:{id:`epuNYK`},render:()=>(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/50 px-2 py-1.5`,children:[(0,$.jsxs)(`span`,{className:`absolute -top-2 left-1.5 flex items-center gap-1 rounded-md bg-background px-1 text-[10px] text-muted-foreground`,children:[(0,$.jsx)(El,{className:`size-2.5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:(0,$.jsx)(a,{id:`maDWIB`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})})]}),(0,$.jsx)(`span`,{className:`block h-1.5 w-4/5 rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`mt-1 block h-1.5 w-3/5 rounded-sm bg-muted-foreground/20`})]}),(0,$.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,$.jsx)(a,{id:`emgiet`})})]})}};function ES(e){let t={};for(let n of e.props)n.type!==`reactnode`&&`defaultValue`in n&&n.defaultValue!==void 0&&(t[n.name]=n.defaultValue);return t}function DS(e){let t=xS(e),n=ES(t);return{type:`jsxComponent`,attrs:{componentName:t.name,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:n},content:t.hasChildren?[{type:`paragraph`}]:void 0}}var OS=new Set;function kS(e){OS.add(e)}function AS(e){if(typeof e==`number`)return OS.delete(e);let t=OS.values().next();return t.done?!1:(OS.delete(t.value),!0)}function jS(e,t,n){n.props.some(e=>!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`)?(kS(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)})):n.hasChildren?e.commands.setTextSelection(t+2):(kS(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)}))}function MS(e){return({chain:t,state:n,editor:r,afterCommit:i})=>{let a=new WeakSet;n.doc.descendants(t=>{t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&a.add(t)});let o=DS(e.name);if(e.name===`Tabs`){let e=DS(`Tab`),t=DS(`Tab`),n=e.attrs,r=t.attrs;n.props={...n.props,label:`Tab 1`},r.props={...r.props,label:`Tab 2`},o.content=[e,t]}t().insertContent(o).run(),i(()=>{let t=-1;r.state.doc.descendants((n,r)=>{if(t>=0)return!1;n.type.name===`jsxComponent`&&n.attrs.componentName===e.name&&!a.has(n)&&(t=r)}),!(t<0)&&jS(r,t,e)})}}var NS=new Set([`File`,`Tab`]);function PS(){return[{name:`component-File`,label:Y._({id:`J2eKUI`}),icon:Al,category:`media`,aliases:[`file`,`attachment`,`download`,`upload`,`document`,`doc`,`docx`,`zip`],description:"Attach a downloadable file (`.pdf` / `.docx` / `.zip` / …)",insertsBlockComponent:!0,command:IS,preview:{description:Y._({id:`t-JXbf`}),render:()=>(0,$.jsxs)(`div`,{className:`flex w-full items-baseline gap-2 rounded-md px-2 py-1.5`,children:[(0,$.jsx)(Al,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:`quarterly-report.pdf`}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:`1.4 MB`})]})}}]}function FS(){return[...SS().filter(e=>e.surface===`canonical`&&!NS.has(e.name)).map(e=>{let t=TS[e.name],n=e.Component,r=t?{description:Y._(t.description),render:t.render??(()=>(0,$.jsx)(n,{...t.props?.(),children:t.children?.()}))}:void 0;return{name:`component-${e.name}`,label:e.displayName??e.name,icon:N_(e.icon),category:e.category??`content`,command:MS(e),aliases:e.searchTerms,description:e.description,insertsBlockComponent:!0,preview:r}}),...PS()]}function IS({editor:e}){if(!Hg(e))return;let t=document.createElement(`input`);t.type=`file`,t.accept=`*/*`,t.style.display=`none`,t.addEventListener(`change`,()=>{let n=t.files?.[0];if(n){let t=e.state.selection.from;Ug(n,e,t)}t.remove()},{once:!0}),t.addEventListener(`cancel`,()=>t.remove(),{once:!0}),document.body.appendChild(t),t.click()}function LS(){return[{name:`link`,label:Y._({id:`yzF66j`}),icon:Hl,category:`insert`,aliases:[`url`,`href`,`external`,`web`,`hyperlink`,`wiki`,`wikilink`,`[[`,`internal`,`page`,`backlink`,`cross-link`],description:`Link to a page or external URL`,preview:{description:Y._({id:`5WDhAk`}),render:()=>(0,$.jsx)(`p`,{className:`leading-7 text-sm`,children:(0,$.jsx)(a,{id:`u-9fWA`,components:{0:(0,$.jsx)(`span`,{className:`font-medium text-azure-blue underline underline-offset-2 dark:text-sky-blue`})}})})},command:({chain:e,state:t,editor:n,afterCommit:r})=>{let i=t.selection.from;e().insertContent({type:`text`,text:`link`,marks:[{type:`link`,attrs:{href:``}}]}).run(),r(()=>{let e=g_(n.state,i,`link`);e&&(l_(e),requestAnimationFrame(()=>{j_(n).setActiveNode(e)}))})}},{name:`component-Tag`,label:Y._({id:`UL8A9w`}),icon:pi,category:`content`,aliases:[`#`,`hashtag`,`label`],description:"Inline tag (`#tagname`) for cross-doc linking",preview:{description:Y._({id:`5ClEAu`}),render:()=>(0,$.jsx)(`p`,{className:`text-sm leading-7`,children:(0,$.jsx)(a,{id:`KZLdgR`,components:{0:(0,$.jsx)(`a`,{className:`tag pointer-events-none`})}})})},command:({chain:e})=>{e().insertTag(``).run()}}]}var RS=[{id:`chart`,title:`Chart`,description:`A bar chart whose series colors track the OK chart palette.`,html:`<div style="font-family:system-ui,sans-serif;padding:20px;color:var(--foreground)">
|
|
4
4
|
<h3 style="margin:0 0 14px;font-size:15px;font-weight:600">Revenue by region</h3>
|
|
5
5
|
<div id="bars" style="display:flex;align-items:flex-end;gap:14px;height:170px"></div>
|