@bendyline/gezel-service 1.0.7 → 1.1.0
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/bin/gezeld.js +6253 -3616
- package/dist/handboek-content/whats-new/1.26224.md +1 -0
- package/dist/handboek-content/whats-new/1.26226.md +1 -0
- package/dist/handboek-content/whats-new/1.26231.md +1 -0
- package/dist/handboek-content/whats-new/1.26234.md +1 -0
- package/dist/handboek-content/whats-new/1.26237.md +1 -0
- package/dist/handboek-content/whats-new/1.26244.md +2 -1
- package/dist/handboek-content/whats-new/1.26247.md +88 -0
- package/dist/handboek-content/whats-new/whats-new-index.md +1 -0
- package/dist/index-store/static-index-worker.js +17 -1
- package/dist/index.d.ts +473 -209
- package/dist/index.js +6251 -3614
- package/dist/memory/embed-worker.js +58 -2
- package/dist/memory/image-embed-worker.js +8 -0
- package/dist/providers/llama-cpp/gguf-metadata-worker.js +2 -0
- package/dist/providers/mlx/python/gezel_mlx_server.py +18 -18
- package/dist/ui/assets/AmbientDashboardCard-Cf5fi_fY.js +1 -0
- package/dist/ui/assets/{AudioEngineSettings-BDrNIGGm.js → AudioEngineSettings-D3L7HOHe.js} +1 -1
- package/dist/ui/assets/{BenchmarksView-CHyujjs8.js → BenchmarksView-B68hrLCl.js} +1 -1
- package/dist/ui/assets/CatalogBrowser-DEM9t7Es.js +1 -0
- package/dist/ui/assets/{ChannelsSettings-Be_W1mr8.js → ChannelsSettings-DtK_k0Ul.js} +1 -1
- package/dist/ui/assets/ChatTimelineView-CQ4Sf4Ip.js +7 -0
- package/dist/ui/assets/ConfirmDialog-Dt1ed4Fh.js +1 -0
- package/dist/ui/assets/ConnectedAppsPanel-Cl8LEkrt.js +1 -0
- package/dist/ui/assets/CraftbookEditor-DEQRlQ2p.js +1 -0
- package/dist/ui/assets/{CraftbookScriptEditorView-DXIZYZT3.js → CraftbookScriptEditorView-DhXkkIdK.js} +1 -1
- package/dist/ui/assets/{CraftbookTabContent-Bm7t_b37.js → CraftbookTabContent-_oIdpQTG.js} +1 -1
- package/dist/ui/assets/{CraftbookToolsetSetup-DTEA-3K3.js → CraftbookToolsetSetup-BKg136L1.js} +1 -1
- package/dist/ui/assets/{CraftbooksView-C4X99TTe.js → CraftbooksView-Dm2zH-nW.js} +2 -2
- package/dist/ui/assets/{DiffpackReviewView-ClcNxtmF.js → DiffpackReviewView-EFLGJnwr.js} +1 -1
- package/dist/ui/assets/DocumentDetail-ClDRj2N-.js +1 -0
- package/dist/ui/assets/DocumentsView-ny9oieg2.js +1 -0
- package/dist/ui/assets/DropdownMenu-S4d9-3j3.js +1 -0
- package/dist/ui/assets/Ds4Settings-CeWlm5Vf.js +1 -0
- package/dist/ui/assets/EmbeddedChat-Hjrrgpao.js +1 -0
- package/dist/ui/assets/{FaceRecognitionCard-D3hdc7uU.js → FaceRecognitionCard-D7ufKqjI.js} +1 -1
- package/dist/ui/assets/FileMapView-DRjf59RH.js +1 -0
- package/dist/ui/assets/{FoldersSettings-BcNzl4vT.js → FoldersSettings-DDUhaFio.js} +1 -1
- package/dist/ui/assets/GezelDetail-Cph6pVGb.js +1 -0
- package/dist/ui/assets/{GezelJsonEditor-fOvYclu9.js → GezelJsonEditor-7vDGyBib.js} +1 -1
- package/dist/ui/assets/{GezellenView-BTzhHrxi.js → GezellenView-DQhcO1CP.js} +1 -1
- package/dist/ui/assets/{GildeUpdatesCard-Bq6XEpLP.js → GildeUpdatesCard-UKKNm_U8.js} +1 -1
- package/dist/ui/assets/{GithubSignInChip-CnlTCG8G.js → GithubSignInChip-DjM3qZsL.js} +1 -1
- package/dist/ui/assets/{HandboekMediaProvider-BfQW8_Nr.js → HandboekMediaProvider-DixaXTAH.js} +1 -1
- package/dist/ui/assets/HandboekView-BeNQqho9.js +1 -0
- package/dist/ui/assets/HistoryView-E2szGNGS.js +1 -0
- package/dist/ui/assets/{HomeView-CB_5TJIp.css → HomeView-CNeqCFPc.css} +1 -1
- package/dist/ui/assets/HomeView-CkiS3DXy.js +1 -0
- package/dist/ui/assets/{ImageEngineSettings-BpMfQy4f.js → ImageEngineSettings-BCKT7Gvi.js} +1 -1
- package/dist/ui/assets/{ImageRecognitionSettings-Ct-7-Oas.js → ImageRecognitionSettings-DD6syFez.js} +1 -1
- package/dist/ui/assets/IncompleteDownloads-BiPaaahS.js +1 -0
- package/dist/ui/assets/InstallProgressRow-DyKOI4MU.js +1 -0
- package/dist/ui/assets/KnowledgeCatalogsCard-B132vzRa.js +1 -0
- package/dist/ui/assets/KnowledgeView-CtPuIlN4.js +1 -0
- package/dist/ui/assets/LlamaCppSettings-D6zHcu4W.js +1 -0
- package/dist/ui/assets/{MarkdownField-D-0Zw7gM.js → MarkdownField-CK8K3fzj.js} +1 -1
- package/dist/ui/assets/MemoriesTree-DzjXzIrM.js +1 -0
- package/dist/ui/assets/{MicrophoneSettings-BIaFxyY_.js → MicrophoneSettings-1FH83SCq.js} +1 -1
- package/dist/ui/assets/MlxSettings-BYxUqFnJ.js +1 -0
- package/dist/ui/assets/ModelPicker-DoXPfQkQ.js +1 -0
- package/dist/ui/assets/{NewScriptDialog-D-gkY8TS.js → NewScriptDialog-C5X-7PMt.js} +1 -1
- package/dist/ui/assets/NewTaskDialog-Cyqtmigv.js +2 -0
- package/dist/ui/assets/{OllamaSettings-oIE2Mech.js → OllamaSettings-DkjmA-sB.js} +1 -1
- package/dist/ui/assets/ProjectChat-YEqUME6k.js +5 -0
- package/dist/ui/assets/{ProjectConnectionsTab-BZqp-oKI.js → ProjectConnectionsTab-dFCJpW93.js} +1 -1
- package/dist/ui/assets/ProjectGitStatusBar-CjZxG54t.js +1 -0
- package/dist/ui/assets/{ProjectGithubView-w8suLCsA.js → ProjectGithubView-CQ4-tmPx.js} +1 -1
- package/dist/ui/assets/{ProjectMailTab-DGo7eyB8.js → ProjectMailTab-NaScsZJf.js} +1 -1
- package/dist/ui/assets/ProjectOverviewView-ChjxbQas.js +1 -0
- package/dist/ui/assets/{ProjectTimeline-DRe3D9qY.js → ProjectTimeline-BZpdCisR.js} +1 -1
- package/dist/ui/assets/ProjectsView-J77ECk6V.js +7 -0
- package/dist/ui/assets/{RecommendedBadge-BKiDixnB.js → RecommendedBadge-D0m68PAu.js} +1 -1
- package/dist/ui/assets/{RemoteServersPanel-DGyl6-Rg.js → RemoteServersPanel-BdLOoORu.js} +1 -1
- package/dist/ui/assets/ScriptEditorTabs-BFvIiDFZ.js +2 -0
- package/dist/ui/assets/ScriptEditorView-B09rm1vz.js +5 -0
- package/dist/ui/assets/{ScriptsView-WQc28TmQ.js → ScriptsView-BvNAJXpo.js} +1 -1
- package/dist/ui/assets/{SecurityComplianceSettings-DsMEA4J3.js → SecurityComplianceSettings-DzGOnptO.js} +1 -1
- package/dist/ui/assets/SessionSwitcher-6okzcxT7.js +1 -0
- package/dist/ui/assets/SettingsView-Dur4dLhW.js +3 -0
- package/dist/ui/assets/SquisqIntegration-6v3yNOIP.js +2 -0
- package/dist/ui/assets/{StorageCleanupDialog-DHqwyMZZ.js → StorageCleanupDialog-OQlomMJD.js} +1 -1
- package/dist/ui/assets/{StorageUsageCard-CdT6SU51.js → StorageUsageCard-f6c6qTbM.js} +1 -1
- package/dist/ui/assets/Tabs-jE0Z5Tzd.js +1 -0
- package/dist/ui/assets/TaskTabContent-0w3kAUWR.js +1 -0
- package/dist/ui/assets/TasksView-BVMT4BAY.js +1 -0
- package/dist/ui/assets/{TerminalCodeEditor-77pBm6f3.js → TerminalCodeEditor-DO7zLKy-.js} +2 -2
- package/dist/ui/assets/ToolsetsEditor-Bb1wD5mV.js +8 -0
- package/dist/ui/assets/TransformToolbarButton-BWYkEB0d.js +5 -0
- package/dist/ui/assets/UnrecognizedModels-HtdMZUqK.js +1 -0
- package/dist/ui/assets/{VideoEngineSettings-DzMeINuv.js → VideoEngineSettings-Dq8Nw_tK.js} +1 -1
- package/dist/ui/assets/{WorkspaceIndexPane-DU4yd4Ai.js → WorkspaceIndexPane-fpDz4MwZ.js} +1 -1
- package/dist/ui/assets/{api-BX5xXiFs.js → api-BPraLwsh.js} +1 -1
- package/dist/ui/assets/chat-thread-memory-Be48zsyG.js +1 -0
- package/dist/ui/assets/chunk-6ECMNUIP-DDVjPyfK.js +15 -0
- package/dist/ui/assets/{chunk-6N2J7C2B-B5QIrD9m.js → chunk-6N2J7C2B-CsppiLVr.js} +1 -1
- package/dist/ui/assets/{chunk-A6N6IN3I-DXok09eC.js → chunk-A6N6IN3I-ofeM4l8g.js} +1 -1
- package/dist/ui/assets/chunk-B7GEAZBI-Divd2h1k.js +1 -0
- package/dist/ui/assets/chunk-DXYWKZ52-BXcAlClu.js +1 -0
- package/dist/ui/assets/chunk-FLR2ARKC-D7wrvQgT.js +2 -0
- package/dist/ui/assets/chunk-IIQYS2YH-DKZhWMpn.js +1 -0
- package/dist/ui/assets/{chunk-ILCJ3WFD-WRukZ7R1.js → chunk-ILCJ3WFD-CLZxw4Ge.js} +3 -3
- package/dist/ui/assets/chunk-OBADJV7C-CDVOcmYt.js +1 -0
- package/dist/ui/assets/chunk-Q77KNJIN-BIDRf0aP.js +6 -0
- package/dist/ui/assets/chunk-S5PCVMKU-Df5XzhSE.js +6 -0
- package/dist/ui/assets/chunk-UBFT2CDQ-FexGDigd.js +31 -0
- package/dist/ui/assets/{chunk-USU6HTKB-D5FmDzJU.js → chunk-USU6HTKB-B_p-YcDp.js} +1 -1
- package/dist/ui/assets/chunk-VKXOZTYP-BoVvWSBR.js +5 -0
- package/dist/ui/assets/{chunk-6RQOV3B3-CwvKotJw.js → chunk-VPWPEMZJ-DRKoa_j0.js} +1 -1
- package/dist/ui/assets/{chunk-WATAOG4Y-DXg2lov5.js → chunk-WATAOG4Y-C1EXVPmG.js} +1 -1
- package/dist/ui/assets/{container-B7jJtK5V.js → container-Ce94efbg.js} +1 -1
- package/dist/ui/assets/csv-62UGQMzZ.js +1 -0
- package/dist/ui/assets/data-B2kHjlc5.js +1 -0
- package/dist/ui/assets/dist-B9-VrAP8.js +2 -0
- package/dist/ui/assets/dist-BaHut5iX.js +2 -0
- package/dist/ui/assets/dist-BqGwkOe5.js +225 -0
- package/dist/ui/assets/dist-ZnIgkoEi.js +4 -0
- package/dist/ui/assets/{dist-BHl1ZAVG.js → dist-l6uUFZMV.js} +2 -2
- package/dist/ui/assets/dist-pLLFUPO-.js +1 -0
- package/dist/ui/assets/{doc-s6H7T0IO.js → doc-Dr5K49bx.js} +28 -28
- package/dist/ui/assets/document-companion-BQk2kS0F.js +1 -0
- package/dist/ui/assets/document-import-QoM9UxJr.js +1 -0
- package/dist/ui/assets/docx-sXa1Rf41.js +2 -0
- package/dist/ui/assets/{epub-B98SgHBz.js → epub-RopMP0ec.js} +4 -4
- package/dist/ui/assets/{export-options-Bu-tI6og.js → export-options-f7PKjEBb.js} +1 -1
- package/dist/ui/assets/extract-UTAOG7LV-4WDRw1o4.js +1 -0
- package/dist/ui/assets/file-browser-c2tf4MIb.js +5 -0
- package/dist/ui/assets/html-BGVOMhkv.js +253 -0
- package/dist/ui/assets/icons-DWaUNQbT.js +1 -0
- package/dist/ui/assets/images-JLBFCDD4-6JitW0hD.js +1 -0
- package/dist/ui/assets/index-B8NcxqcR.css +1 -0
- package/dist/ui/assets/index-C0DYtvfg.js +34 -0
- package/dist/ui/assets/index-J8TOMdvV.js +2 -0
- package/dist/ui/assets/{infer-kCLH1C8z.js → infer-LEGOsu64.js} +2 -2
- package/dist/ui/assets/ironcalc-BAi5gOlE.js +3 -0
- package/dist/ui/assets/layouts-2A7QNF6Y-CVwP7noP.js +1 -0
- package/dist/ui/assets/{mail-link-CI6YD6k2.js → mail-link-DXkmCd5b.js} +1 -1
- package/dist/ui/assets/markdown-baseline-9B52XlX2.js +1 -0
- package/dist/ui/assets/{markdown-Bi9b5f5Y.js → markdown-ryKA_OmY.js} +1 -1
- package/dist/ui/assets/materialize-A34OZGEU-xNNKzytx.js +1 -0
- package/dist/ui/assets/model-inventory-ykSm_IT5.js +1 -0
- package/dist/ui/assets/{model-quantization-BDzrELN_.js → model-quantization-CLO7XLoF.js} +1 -1
- package/dist/ui/assets/{monaco-base-BiVSa1J-.js → monaco-base-B1H1U1Sw.js} +1 -1
- package/dist/ui/assets/{monaco-setup-UeltVkg_.js → monaco-setup-DjhrGQui.js} +1 -1
- package/dist/ui/assets/{new-project-meta-0xhggGA_.js → new-project-meta-_f9sfcRX.js} +1 -1
- package/dist/ui/assets/outside-in-D73N1g_b.js +3 -0
- package/dist/ui/assets/{pdf-DgTjy3rN.js → pdf-BOjVDlCK.js} +3 -3
- package/dist/ui/assets/{pending-drafts-YVW6X55O.js → pending-drafts-B11MKQ9R.js} +1 -1
- package/dist/ui/assets/{poppetje-Ce-02Aqi.js → poppetje-DLB8uevw.js} +2 -2
- package/dist/ui/assets/pptx-BuxyNxQh.js +6 -0
- package/dist/ui/assets/primitives-CWrGZpPI.js +41 -0
- package/dist/ui/assets/run-export-ChaMXrKS.js +23 -0
- package/dist/ui/assets/squisq-formats-aAdypXoy.js +1 -0
- package/dist/ui/assets/standalone-source-q_Zzd1bd.js +11 -0
- package/dist/ui/assets/storage-D8pE2zg0.js +1 -0
- package/dist/ui/assets/styles-BhnF3s2q.css +1 -0
- package/dist/ui/assets/styles-CKVKwqoQ.js +550 -0
- package/dist/ui/assets/table-fcouR4db.js +1 -0
- package/dist/ui/assets/{terminal-monaco-setup-DNoK2tN4.js → terminal-monaco-setup-BAzrVzeR.js} +1 -1
- package/dist/ui/assets/{useCompactLayout-BarJPYcv.js → useCompactLayout-Dtolvzye.js} +0 -0
- package/dist/ui/assets/{useCopilotAvailability-BH1nLXQI.js → useCopilotAvailability-3xZvKgTF.js} +1 -1
- package/dist/ui/assets/{useDiffpacks-CK8W_OD_.js → useDiffpacks-Dsnr0wtX.js} +1 -1
- package/dist/ui/assets/{useGitSync-DWxX5-7K.js → useGitSync-BCTptQsp.js} +1 -1
- package/dist/ui/assets/{useShowWorkInProgressFeatures-DwwviLRO.js → useShowWorkInProgressFeatures-BhDNuQiU.js} +1 -1
- package/dist/ui/assets/{useTotalRamBytes-WoN_mi-V.js → useTotalRamBytes-DIx-_pf8.js} +1 -1
- package/dist/ui/assets/wasm-DdxEDD2H.js +1 -0
- package/dist/ui/assets/wasm_bg-DW9Xt_vt.wasm +0 -0
- package/dist/ui/assets/xlsx-DyBGuAO1.js +4 -0
- package/dist/ui/index.html +19 -18
- package/package.json +11 -11
- package/dist/ui/assets/AmbientDashboardCard-C1Ee-FKZ.js +0 -1
- package/dist/ui/assets/CatalogBrowser-Bz8ZtxPn.js +0 -1
- package/dist/ui/assets/ChatTimelineView-Do9EryEH.js +0 -7
- package/dist/ui/assets/ConfirmDialog-BHFs6vmJ.js +0 -1
- package/dist/ui/assets/ConnectedAppsPanel-BtMayq0R.js +0 -1
- package/dist/ui/assets/CraftbookEditor-D5jTzWwF.js +0 -1
- package/dist/ui/assets/DocumentDetail-CPU51d04.js +0 -1
- package/dist/ui/assets/DocumentsView-B6OyjvJ0.js +0 -1
- package/dist/ui/assets/DropdownMenu-D5fCzIrh.js +0 -1
- package/dist/ui/assets/Ds4Settings-CrUM_KGP.js +0 -1
- package/dist/ui/assets/EmbeddedChat-ue9ia-WY.js +0 -1
- package/dist/ui/assets/FileMapView-CxvfDLGA.js +0 -1
- package/dist/ui/assets/GezelDetail-DHuqBK55.js +0 -1
- package/dist/ui/assets/HandboekView-CPnnyj29.js +0 -1
- package/dist/ui/assets/HistoryView-B4VAfEMe.js +0 -1
- package/dist/ui/assets/HomeView-ccH60J6f.js +0 -1
- package/dist/ui/assets/KnowledgeCatalogsCard-Bi5Rx9Iz.js +0 -1
- package/dist/ui/assets/KnowledgeView-DAwjwLZo.js +0 -1
- package/dist/ui/assets/LlamaCppSettings-Ceyk9pDP.js +0 -1
- package/dist/ui/assets/MemoriesTree-BKZEPJpm.js +0 -1
- package/dist/ui/assets/MlxSettings-CG3wfuc3.js +0 -1
- package/dist/ui/assets/ModelPicker-CCBVjLMS.js +0 -1
- package/dist/ui/assets/NewPathDialog-D4jnNBfP.js +0 -1
- package/dist/ui/assets/NewTaskDialog-Ox9D612Z.js +0 -2
- package/dist/ui/assets/ProjectChat-DMwKnkW-.js +0 -5
- package/dist/ui/assets/ProjectGitStatusBar-C6bkCSby.js +0 -1
- package/dist/ui/assets/ProjectOverviewView-NNwXd_QQ.js +0 -1
- package/dist/ui/assets/ProjectsView-SBPgYOq8.js +0 -7
- package/dist/ui/assets/ScriptEditorTabs-paocQ6dj.js +0 -2
- package/dist/ui/assets/ScriptEditorView-N9zSLqqi.js +0 -5
- package/dist/ui/assets/SessionSwitcher-C8te7YSe.js +0 -1
- package/dist/ui/assets/SettingsView-Brl4JQkW.js +0 -3
- package/dist/ui/assets/Tabs-BAY1Q79B.js +0 -1
- package/dist/ui/assets/TaskTabContent-CNPJ4DQj.js +0 -1
- package/dist/ui/assets/TasksView-DuMjFS8S.js +0 -1
- package/dist/ui/assets/ToolsetsEditor-BdxHnIBj.js +0 -8
- package/dist/ui/assets/TransformToolbarButton-CVg5nz36.js +0 -5
- package/dist/ui/assets/UnrecognizedModels-Cw9Ku_bW.js +0 -1
- package/dist/ui/assets/chat-thread-memory-CZGcwgGo.js +0 -1
- package/dist/ui/assets/chunk-6ECMNUIP-C1kohb1U.js +0 -15
- package/dist/ui/assets/chunk-AONELFLA-Cv2nS9ga.js +0 -1
- package/dist/ui/assets/chunk-IIQYS2YH-Dxg6MAfT.js +0 -1
- package/dist/ui/assets/chunk-MIKKUKOD-XIkmalSN.js +0 -31
- package/dist/ui/assets/chunk-NNJLSQPW-DJA6camf.js +0 -5
- package/dist/ui/assets/chunk-S5PCVMKU-DbCZ5AUH.js +0 -6
- package/dist/ui/assets/csv-xmd1_Aqd.js +0 -4
- package/dist/ui/assets/dist-BPx-FyRH.js +0 -222
- package/dist/ui/assets/dist-Bvo52IGx.js +0 -1
- package/dist/ui/assets/dist-D5aoNQwk.js +0 -2
- package/dist/ui/assets/docx-Cj4A9MhC.js +0 -2
- package/dist/ui/assets/extract-UTAOG7LV-C4b7ycaL.js +0 -1
- package/dist/ui/assets/file-browser-80qWoVju.js +0 -5
- package/dist/ui/assets/html-C9TlzI57.js +0 -253
- package/dist/ui/assets/icons-C9dD-bDi.js +0 -1
- package/dist/ui/assets/images-ESPQKVTW-D7SgdVJ_.js +0 -1
- package/dist/ui/assets/index-D1m4Wx8V.css +0 -1
- package/dist/ui/assets/index-DXWR4qW1.js +0 -34
- package/dist/ui/assets/layouts-2A7QNF6Y-De2t-YXl.js +0 -1
- package/dist/ui/assets/markdown-baseline-HMqF2ChK.js +0 -1
- package/dist/ui/assets/outside-in-BFVUUcLa.js +0 -3
- package/dist/ui/assets/pptx-6ChgUEf4.js +0 -6
- package/dist/ui/assets/primitives-DEsn1shf.js +0 -41
- package/dist/ui/assets/run-export-BrYhHj1O.js +0 -23
- package/dist/ui/assets/standalone-source-D6mbpa3h.js +0 -11
- package/dist/ui/assets/storage-fn4FCEVK.js +0 -1
- package/dist/ui/assets/styles-C0EoNJbk.css +0 -1
- package/dist/ui/assets/styles-CKr_yrbn.js +0 -541
- package/dist/ui/assets/xlsx-DH7sTb3W.js +0 -4
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-CJfks21t.js","assets/preload-helper-Czpn1I53.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-UMNXGZaF.js","assets/rolldown-runtime-aKtaBQYM.js","assets/chunk-I66GZJ75-LdZkBIbB.js","assets/chunk-NSK5VX7P-52z7Dk2L.js","assets/dist-qx0Iv9vM.js","assets/chunk-3NCLNEKW-lEIanHax.js","assets/chunk-4I5QYGJK-CM-bp6pS.js","assets/chunk-WRU74C26-DepDkkds.js","assets/chunk-7BUUIJ7U-Bb538aSH.js","assets/chunk-UBXNYLIW-BndvwrJT.js","assets/chunk-W5SLKNZC-DYPZQgVw.js","assets/chunk-QR6OTTB3-BCXb4Qaf.js","assets/rough.esm-CSKSodPl.js","assets/chunk-7Z6QIM7H-BQaDNVzL.js","assets/line-CFHPqps4.js","assets/path-BWPyau1x.js","assets/array-BifhSqXX.js","assets/chunk-J7OUQ5F2-CYJFmXpz.js","assets/chunk-ZIRB5QZD-C6fEPe3t.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-CEpd2cAX.js";import{$ as r,F as i,Lt as a,T as o,Vt as s,W as c,_ as l,d as u,ft as d,p as f,pt as p,st as m,u as h,v as g,vt as _,w as v,zt as y}from"./doc-Dr5K49bx.js";import{f as b,s as x}from"./chunk-O7JILDEF-CqcO1qaI.js";import{n as S}from"./chunk-BAOV476U-CEOFYt8X.js";import{s as C}from"./chunk-4VOD55SX-BFSSw0c8.js";import{O as w,d as T,o as E}from"./chunk-GAZKTT4R-BkP6-w3z.js";import{F as D,I as O,n as ee}from"./chunk-UBFT2CDQ-FexGDigd.js";import{a as k,i as te,n as A,t as ne}from"./chunk-7ZAAICW4-BsCpYJH6.js";import{c as j,i as M,n as re}from"./markdown-ryKA_OmY.js";import{n as ie}from"./schemas-JY4jmLbC.js";import{t as N}from"./preload-helper-Czpn1I53.js";import"./inlineIconMarker-BQI2HLeD.js";import{t as ae}from"./chunk-TT6ENR6T-CaYjVwjm.js";var P=e(t(),1),F=n(),I=null,oe={startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0,deterministicIds:!1,logLevel:`error`};async function se(){return I||=N(async()=>{let{default:e}=await import(`./mermaid.core-CJfks21t.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])).then(({default:e})=>e).catch(e=>{throw I=null,e}),I}function ce(e){let t=globalThis,n=(t.__squisqMermaidWorkQueue??Promise.resolve()).then(e,e);return t.__squisqMermaidWorkQueue=n.then(()=>void 0,()=>void 0),n}function le(e,t,n,r=E){return ce(async()=>{let i=await se();i.initialize({...oe,theme:`base`,themeVariables:ie(r)});let{svg:a,diagramType:o}=await i.render(e,t,n);return{svg:a,diagramType:o}})}function ue(e){return(e instanceof Error?e.message:String(e)).split(/\r?\n/).map(e=>e.trimEnd()).filter(Boolean).slice(0,6).join(`
|
|
3
|
+
`)||`Unknown Mermaid rendering error.`}var de=0;function fe({source:e,className:t,ariaLabel:n=`Mermaid diagram`,theme:r=E}){let[i,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(``),[c,l]=(0,P.useState)(!0);return(0,P.useEffect)(()=>{let t=!0,n=`squisq-rich-mermaid-${++de}`;return l(!0),s(``),le(n,e,void 0,r).then(e=>{t&&a(e.svg)}).catch(e=>{t&&(a(``),s(ue(e)))}).finally(()=>{t&&l(!1)}),()=>{t=!1}},[e,r]),(0,F.jsxs)(`div`,{className:[`squisq-mermaid-rendered`,t].filter(Boolean).join(` `),role:`img`,"aria-label":n,style:{background:r.colors.backgroundLight,color:r.colors.text},children:[c&&(0,F.jsx)(`div`,{className:`squisq-mermaid-render-status`,children:`Rendering diagram…`}),!c&&o&&(0,F.jsxs)(`div`,{className:`squisq-mermaid-render-error`,role:`alert`,children:[(0,F.jsx)(`strong`,{children:`Mermaid could not render this diagram.`}),(0,F.jsx)(`pre`,{children:o})]}),!c&&!o&&i&&(0,F.jsx)(`div`,{className:`squisq-mermaid-render-svg`,dangerouslySetInnerHTML:{__html:i}})]})}var pe=(0,P.createContext)(null),me=(0,P.createContext)(re);function he(){return(0,P.useContext)(me)}function ge(){return(0,P.useContext)(pe)}function L(e,t){let n=ge(),r=he(),i=typeof e==`string`?e:``,a=!i||/^(?:[a-z][a-z0-9+.-]*:|\/\/|\/)/i.test(i),o=(0,P.useMemo)(()=>{let e=a?i:`${t.replace(/\/$/,``)}/${i}`;return j(e,r)?e:``},[a,i,t,r]),s=!a&&!!n,[c,l]=(0,P.useState)(o);return(0,P.useEffect)(()=>{if(!s){l(o);return}let e=!1;return l(o),n.resolveUrl(i).then(t=>{e||l(j(t,r)?t:``)},()=>{e||l(o)}),()=>{e=!0}},[s,n,i,o,r]),s?c:o}function R(e,t){return typeof e==`number`?e:e.endsWith(`%`)?parseFloat(e)/100*t:parseFloat(e)}function z(e,t,n){switch(e){case`center`:return{x:-t/2,y:-n/2};case`top-right`:return{x:-t,y:0};case`bottom-left`:return{x:0,y:-n};case`bottom-right`:return{x:-t,y:-n};default:return{x:0,y:0}}}function _e({layer:e,basePath:t,viewport:n,blockTime:r,animationsEnabled:i=!0}){let{content:a,position:o,animation:s}=e,c=R(o.x,n.width),u=R(o.y,n.height),d=o.width?R(o.width,n.width):n.width,p=o.height?R(o.height,n.height):n.height,m=z(o.anchor,d,p),h=c+m.x,g=u+m.y,_=L(a.src,t),v=l(s,r),y=f(a.treatment,a.blur),b=ve(a.fit),x=a.fit===`cover`,S=s&&ye.has(s.type);if(x&&xe(n,d,p,i,s)){let t=Se(s),n=Ce(S?s:void 0),r=S?{className:``,style:{}}:v;return(0,F.jsx)(`g`,{className:`block-layer block-layer--image ${r.className}`,style:r.style,"data-layer-id":e.id,"data-image-framing":`portrait-pan`,children:(0,F.jsx)(`foreignObject`,{x:h,y:g,width:d,height:p,children:(0,F.jsx)(`div`,{style:{width:`${d}px`,height:`${p}px`,overflow:`hidden`},children:(0,F.jsx)(`img`,{src:_,alt:a.alt||``,className:t,style:{width:`${d}px`,height:`${p}px`,objectFit:`cover`,objectPosition:`center`,display:`block`,pointerEvents:`none`,...y?{filter:y}:{},...a.blur&&a.blur>0?{transform:`scale(1.06)`}:{},...n}})})})})}if(x&&S&&s){let t=l(we(s),r);return(0,F.jsx)(`g`,{className:`block-layer block-layer--image`,"data-layer-id":e.id,children:(0,F.jsx)(`foreignObject`,{x:h,y:g,width:d,height:p,children:(0,F.jsx)(`div`,{style:{width:`${d}px`,height:`${p}px`,overflow:`hidden`},children:(0,F.jsx)(`img`,{src:_,alt:a.alt||``,className:t.className,style:{width:`${d}px`,height:`${p}px`,objectFit:`cover`,objectPosition:`center`,display:`block`,pointerEvents:`none`,transformOrigin:`center center`,...y?{filter:y}:{},...t.style}})})})})}return x?(0,F.jsx)(`g`,{className:`block-layer block-layer--image ${v.className}`,style:v.style,"data-layer-id":e.id,children:(0,F.jsx)(`foreignObject`,{x:h,y:g,width:d,height:p,children:(0,F.jsx)(`img`,{src:_,alt:a.alt||``,style:{width:`${d}px`,height:`${p}px`,objectFit:`cover`,objectPosition:`center`,display:`block`,pointerEvents:`none`,...y?{filter:y}:{},...a.blur&&a.blur>0?{transform:`scale(1.06)`}:{}}})})}):(0,F.jsx)(`g`,{className:`block-layer block-layer--image ${v.className}`,style:v.style,"data-layer-id":e.id,children:(0,F.jsx)(`image`,{href:_,x:h,y:g,width:d,height:p,preserveAspectRatio:b,style:{pointerEvents:`none`,...y?{filter:y}:{}}})})}function ve(e){switch(e){case`cover`:return`xMidYMid slice`;case`fill`:return`none`;default:return`xMidYMid meet`}}var ye=new Set([`panLeft`,`panRight`,`slowZoom`,`zoomIn`,`zoomOut`]),be=.83;function xe(e,t,n,r,i){return!r||i?.type===`none`||e.width/e.height>=be?!1:t>=e.width*.7&&n>=e.height*.7}function Se(e){return e?.type===`panRight`||e?.type===`slowZoom`&&e.panDirection===`right`?`squisq-image--portrait-pan-left`:`squisq-image--portrait-pan-right`}function Ce(e){return{"--portrait-pan-duration":`${e?.duration??12}s`,"--portrait-pan-delay":`${e?.delay??0}s`,"--portrait-pan-easing":e?.easing??`ease-in-out`}}function we(e){switch(e.type){case`panLeft`:return{...e,type:`slowZoom`,panDirection:`left`};case`panRight`:return{...e,type:`slowZoom`,panDirection:`right`};case`zoomIn`:return{...e,type:`slowZoom`,direction:`in`};case`zoomOut`:return{...e,type:`slowZoom`,direction:`out`};default:return e}}function Te(e,t){if(!e||e===`solid`)return;let n=Math.max(1,t??1);return e===`dotted`?`${n} ${n*2}`:`${n*3} ${n*2}`}function Ee(e=0){let t=e*Math.PI/180,n=Math.sin(t),r=Math.cos(t);return{x1:.5-n/2,y1:.5-r/2,x2:.5+n/2,y2:.5+r/2}}function De(e){return`squisq-grad-${e}`}function Oe(e,t,n,r){if(r){let t=`squisq-pattern-${e}`;return{fill:`url(#${t})`,def:ke(t,r)}}if(n){let t=De(e),r=Ee(n.angle);return{fill:`url(#${t})`,def:(0,F.jsxs)(`linearGradient`,{id:t,x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:n.from}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:n.to})]})}}return{fill:t,def:null}}function ke(e,t){let n=t.size??24,r=t.opacity??1,i=t.color;return(0,F.jsxs)(`pattern`,{id:e,width:n,height:n,patternUnits:`userSpaceOnUse`,patternTransform:t.kind===`diagonal`?`rotate(45)`:void 0,children:[t.kind===`dots`&&(0,F.jsx)(`circle`,{cx:n/2,cy:n/2,r:Math.max(1,n/12),fill:i,opacity:r}),t.kind===`grid`&&(0,F.jsx)(`path`,{d:`M ${n} 0 L 0 0 0 ${n}`,fill:`none`,stroke:i,strokeWidth:1,opacity:r}),t.kind===`diagonal`&&(0,F.jsx)(`line`,{x1:0,y1:0,x2:0,y2:n,stroke:i,strokeWidth:1,opacity:r})]})}function Ae(e,t){if(!t||t.type!==`noise`)return{filterAttr:void 0,def:null};let n=`squisq-noise-${e}`,r=t.opacity??.05;return{filterAttr:`url(#${n})`,def:(0,F.jsxs)(`filter`,{id:n,x:`0%`,y:`0%`,width:`100%`,height:`100%`,children:[(0,F.jsx)(`feTurbulence`,{type:`fractalNoise`,baseFrequency:t.baseFrequency??.8,numOctaves:2,stitchTiles:`stitch`,result:`noise`}),(0,F.jsx)(`feColorMatrix`,{in:`noise`,type:`saturate`,values:`0`,result:`mono`}),(0,F.jsx)(`feComponentTransfer`,{in:`mono`,result:`faded`,children:(0,F.jsx)(`feFuncA`,{type:`linear`,slope:r,intercept:0})}),(0,F.jsx)(`feComposite`,{in:`faded`,in2:`SourceGraphic`,operator:`in`})]})}}function je(e){return e.layer.content.html?.trim()?(0,F.jsx)(Ie,{...e}):ne(e.layer.content.text??``)?(0,F.jsx)(Pe,{...e}):(0,F.jsx)(Fe,{...e})}function Me(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function Ne(e){return te(e).map(e=>e.type===`icon`?`<i class="${A(e.family,e.name)}" aria-hidden="true"></i>`:Me(e.text).replace(/\n/g,`<br>`)).join(``)}function Pe({layer:e,viewport:t,blockTime:n}){let{content:r,position:i,animation:a}=e,{text:o,style:s}=r,c=R(i.x,t.width),u=R(i.y,t.height),d=i.width==null?t.width:R(i.width,t.width),f=i.anchor??`top-left`,p=s.lineHeight||1.4,m=s.fontSize*p,h=s.padding??0,g=k(o??``),_=g.split(`
|
|
4
|
+
`).flatMap(e=>We(e,s.fontSize,d)),v=i.height==null?Math.max(m,_.length*m)+h*2:R(i.height,t.height),y=c-B(f,d,`x`),b=u-B(f,v,`y`),x=l(a,n),S=(0,P.useMemo)(()=>Ne(o??``),[o]),C={boxSizing:`border-box`,width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,justifyContent:s.verticalAlign===`top`?`flex-start`:s.verticalAlign===`bottom`?`flex-end`:`center`,padding:h,color:s.color,fontSize:`${s.fontSize}px`,fontFamily:s.fontFamily||`system-ui, -apple-system, "Segoe UI", Roboto, sans-serif`,fontWeight:s.fontWeight||`normal`,fontStyle:s.fontStyle||`normal`,lineHeight:p,textAlign:s.textAlign??`left`,...s.shadow?{textShadow:`0 2px 3px rgba(0,0,0,0.7)`}:{},...x.style};return(0,F.jsx)(`g`,{className:`block-layer block-layer--text ${x.className}`,"data-layer-id":e.id,children:(0,F.jsx)(`foreignObject`,{x:y,y:b,width:d,height:v,style:{overflow:`visible`},children:(0,F.jsx)(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,style:C,children:(0,F.jsx)(`div`,{style:{width:`100%`,whiteSpace:`pre-wrap`,wordBreak:`break-word`},"aria-label":g,dangerouslySetInnerHTML:{__html:S}})})})})}function Fe({layer:e,viewport:t,blockTime:n}){let r=`${(0,P.useId)().replace(/:/g,``)}-${e.id}`,{content:i,position:a,animation:o}=e,{text:s,style:c}=i,u=R(a.x,t.width),d=R(a.y,t.height),f=a.width==null?void 0:R(a.width,t.width),p=a.height==null?void 0:R(a.height,t.height),m=f,h=ze(c.textAlign,a.anchor),g=Be(c.verticalAlign,a.anchor),_=a.anchor??`top-left`,v=Ve(u,f,_,h),y=He(d,p,_,g),b=l(o,n),x=(s??``).split(`
|
|
5
|
+
`),S=m?x.reduce((e,t)=>e.concat(We(t,c.fontSize,m)),[]):x;if(c.maxLines&&S.length>c.maxLines){S=S.slice(0,c.maxLines);let e=S[S.length-1];S[S.length-1]=e.replace(/\s*$/,``)+`...`}let C=c.lineHeight||1.4,w=c.fontSize*C,T=c.shrinkToFit===!0,E=T&&g===`middle`?-((S.length-1)/2)*w:0,D=(0,P.useRef)(null),[O,ee]=(0,P.useState)(null);(0,P.useLayoutEffect)(()=>{if(!T){ee(null);return}let e=D.current;if(!e||typeof e.getBBox!=`function`)return;let n=()=>{try{let n=e.getBBox();if(n.width<=0||n.height<=0)return;let r=f??t.width,i=p??t.height,a=Math.min(1,r/n.width,i/n.height);ee(a<.995?{scale:a,cx:n.x+n.width/2,cy:n.y+n.height/2}:null)}catch{}};n();let r=e.ownerDocument?.fonts;if(r&&r.status!==`loaded`){let e=!1;return r.ready.then(()=>{e||n()}),()=>{e=!0}}},[T,S.join(`
|
|
6
|
+
`),f,p,t.width,t.height,c.fontSize,c.fontFamily,c.fontWeight]);let k=O?`translate(${O.cx} ${O.cy}) scale(${O.scale}) translate(${-O.cx} ${-O.cy})`:void 0,te={fontSize:`${c.fontSize}px`,fontFamily:c.fontFamily||`system-ui, -apple-system, "Segoe UI", Roboto, sans-serif`,fontWeight:c.fontWeight||`normal`,fontStyle:c.fontStyle||`normal`,fill:c.color,...b.style},A=c.shadow?`shadow-${r}`:void 0;return(0,F.jsxs)(`g`,{className:`block-layer block-layer--text ${b.className}`,"data-layer-id":e.id,children:[c.shadow&&(0,F.jsx)(`defs`,{children:(0,F.jsx)(`filter`,{id:A,x:`-20%`,y:`-20%`,width:`140%`,height:`140%`,children:(0,F.jsx)(`feDropShadow`,{dx:`0`,dy:`2`,stdDeviation:`3`,floodColor:`rgba(0,0,0,0.7)`})})}),(0,F.jsx)(Re,{layerId:r,style:c,box:f!=null&&p!=null?{x:u-B(_,f,`x`),y:d-B(_,p,`y`),width:f,height:p}:{x:v-(c.padding||16),y:y-c.fontSize-(c.padding||16),width:Ue(S,c)+(c.padding||16)*2,height:S.length*w+(c.padding||16)*2}}),(0,F.jsx)(`text`,{ref:D,x:v,y,textAnchor:h,dominantBaseline:g,style:te,filter:A?`url(#${A})`:void 0,transform:k,children:S.map((e,t)=>(0,F.jsxs)(`tspan`,{x:v,dy:t===0?E:w,children:[e||`\xA0`,` `]},t))})]})}function Ie({layer:e,viewport:t,blockTime:n}){let{content:r,position:i,animation:a}=e,{html:o,style:s}=r,c=R(i.x,t.width),u=R(i.y,t.height),d=i.width==null?t.width:R(i.width,t.width),f=i.height==null?s.fontSize*(s.lineHeight||1.4)*2:R(i.height,t.height),p=i.anchor??`top-left`,m=c-B(p,d,`x`),h=u-B(p,f,`y`),g=(0,P.useMemo)(()=>b(D(x(o??``))),[o]),_=l(a,n),v=s.verticalAlign===`middle`?`center`:s.verticalAlign===`bottom`?`flex-end`:`flex-start`,y=!!(s.borderColor&&(s.borderWidth??0)>0),S={boxSizing:`border-box`,width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,justifyContent:v,padding:s.padding??0,color:s.color,fontSize:`${s.fontSize}px`,fontFamily:s.fontFamily||`system-ui, -apple-system, "Segoe UI", Roboto, sans-serif`,fontWeight:s.fontWeight||`normal`,fontStyle:s.fontStyle||`normal`,lineHeight:s.lineHeight||1.4,textAlign:s.textAlign??`left`,overflow:`hidden`,...s.background?{background:s.background}:{},...y?{border:`${s.borderWidth}px ${s.borderStyle??`solid`} ${s.borderColor}`,borderRadius:4}:{},...s.shadow?{textShadow:`0 2px 3px rgba(0,0,0,0.7)`}:{},..._.style},C=`squisq-rich-text-${Le(e.id)}`,w=`.${C}{margin:0}.${C} p{margin:0 0 .4em}.${C} h1,.${C} h2,.${C} h3,.${C} h4,.${C} h5,.${C} h6{margin:0 0 .3em;line-height:1.2}.${C} ul,.${C} ol{margin:0 0 .7em;padding-left:1.2em;list-style-position:${s.textAlign===`center`||s.textAlign===`right`?`inside`:`outside`}}.${C} li{margin:0}.${C} li>p{display:inline;margin:0}.${C} *:first-child{margin-top:0}.${C} *:last-child{margin-bottom:0}.${C} a{color:inherit;text-decoration:underline}`;return(0,F.jsx)(`g`,{className:`block-layer block-layer--text ${_.className}`,"data-layer-id":e.id,children:(0,F.jsx)(`foreignObject`,{x:m,y:h,width:d,height:f,color:s.color,style:{color:s.color},children:(0,F.jsxs)(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,style:S,children:[(0,F.jsx)(`style`,{children:w}),(0,F.jsx)(`div`,{className:C,"aria-label":r.text,style:{width:`100%`,color:s.color,whiteSpace:`pre-wrap`,wordBreak:`break-word`},dangerouslySetInnerHTML:{__html:g}})]})})})}function Le(e){return e.replace(/[^a-zA-Z0-9_-]/g,`-`)}function Re({layerId:e,style:t,box:n}){let r=!!(t.background||t.backgroundGradient),i=!!(t.borderColor&&(t.borderWidth??0)>0);if(!r&&!i)return null;let{fill:a,def:o}=Oe(e,t.background,t.backgroundGradient),s=Te(t.borderStyle,t.borderWidth);return(0,F.jsxs)(F.Fragment,{children:[o&&(0,F.jsx)(`defs`,{children:o}),(0,F.jsx)(`rect`,{x:n.x,y:n.y,width:n.width,height:n.height,fill:r?a:`none`,fillOpacity:r?t.backgroundOpacity:void 0,stroke:i?t.borderColor:void 0,strokeWidth:i?t.borderWidth:void 0,strokeDasharray:i?s:void 0,rx:4,ry:4})]})}function ze(e,t){return e===`center`?`middle`:e===`right`?`end`:e===`left`?`start`:t?.includes(`right`)?`end`:t===`center`?`middle`:`start`}function Be(e,t){return e===`top`?`text-before-edge`:e===`middle`?`middle`:e===`bottom`||t?.includes(`bottom`)?`text-after-edge`:t===`center`?`middle`:`text-before-edge`}function Ve(e,t,n,r){if(t==null)return e;let i=e-B(n,t,`x`);return r===`middle`?i+t/2:r===`end`?i+t:i}function He(e,t,n,r){if(t==null)return e;let i=e-B(n,t,`y`);return r===`middle`?i+t/2:r===`text-after-edge`?i+t:i}function B(e,t,n){return e===`center`?t/2:n===`x`?e.includes(`right`)?t:0:e.includes(`bottom`)?t:0}function Ue(e,t){return Math.max(...e.map(e=>e.length))*t.fontSize*.55}function We(e,t,n){if(!e.trim())return[``];let r=t*.5,i=Math.floor(n/r);if(i<=0)return[e];let a=e.split(/\s+/),o=[],s=``;for(let e of a){let t=s?`${s} ${e}`:e;if(t.length<=i)s=t;else if(s&&o.push(s),e.length>i){let t=e;for(;t.length>i;)o.push(t.slice(0,i)),t=t.slice(i);s=t}else s=e}return s&&o.push(s),o.length>0?o:[``]}var Ge=1;function Ke({layer:e,viewport:t,blockTime:n}){let{content:r,position:i,animation:a}=e,o=`${(0,P.useId)().replace(/:/g,``)}-${e.id}`,s=R(i.x,t.width),c=R(i.y,t.height),u=i.width?R(i.width,t.width):100,d=i.height?R(i.height,t.height):100,f=z(i.anchor,u,d),p=s+f.x,m=c+f.y,h=r.shape===`rect`&&p===0&&m===0&&u===t.width&&d===t.height&&!r.stroke&&!r.borderRadius?Ge:0,g=p-h,_=m-h,v=u+h*2,y=d+h*2,b=l(a,n),x=r.fill||`none`,S=typeof x==`string`&&x.includes(`gradient(`);if(r.shape===`rect`&&S&&!r.gradient)return(0,F.jsx)(`g`,{className:`block-layer block-layer--shape ${b.className}`,style:b.style,"data-layer-id":e.id,children:(0,F.jsx)(`foreignObject`,{x:g,y:_,width:v,height:y,children:(0,F.jsx)(`div`,{style:{width:`${v}px`,height:`${y}px`,background:x,borderRadius:r.borderRadius?`${r.borderRadius}px`:void 0,pointerEvents:`none`}})})});let{fill:C,def:w}=Oe(o,x,r.gradient,r.pattern),{filterAttr:T,def:E}=Ae(o,r.filter),D=Te(r.borderStyle,r.strokeWidth),O={fill:C,fillOpacity:r.fillOpacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeDasharray:D,...T?{filter:T}:{}};return(0,F.jsxs)(`g`,{className:`block-layer block-layer--shape ${b.className}`,style:b.style,"data-layer-id":e.id,children:[(w||E)&&(0,F.jsxs)(`defs`,{children:[w,E]}),r.shape===`rect`&&(0,F.jsx)(`rect`,{x:g,y:_,width:v,height:y,rx:r.borderRadius,ry:r.borderRadius,...O}),r.shape===`circle`&&(0,F.jsx)(`circle`,{cx:p+u/2,cy:m+d/2,r:Math.min(u,d)/2,...O}),r.shape===`line`&&(0,F.jsx)(`line`,{x1:p,y1:m,x2:p+u,y2:m+d,stroke:r.stroke||`#ffffff`,strokeWidth:r.strokeWidth||2,strokeDasharray:D})]})}function qe(e,t){let{content:n,position:r}=e;if(!n.shapeKind)return n.d;let i=r.width?R(r.width,t.width):0,a=r.height?R(r.height,t.height):0,o=R(r.x,t.width),c=R(r.y,t.height),l=z(r.anchor,i,a);return s(n.shapeKind,o+l.x,c+l.y,i,a)??n.d}function Je(e){return e.arrow}function Ye(e,t,n){return e||(t===`both`||t===n?`arrow`:`none`)}function Xe({layer:e,viewport:t,blockTime:n}){let{content:r,animation:i,id:a}=e,o=`${(0,P.useId)().replace(/:/g,``)}-${a}`,s=qe(e,t),c=r.stroke??`#1e293b`,u=r.strokeWidth??2,{fill:d,def:f}=Oe(o,r.fill??`none`,r.gradient),p=r.borderStyle?Te(r.borderStyle,u):r.dasharray,m=l(i,n),h=`marker-start-${o}`,g=`marker-end-${o}`,_=Je(r),v=y(Ye(r.startMarker,_,`start`),`start`),b=y(Ye(r.endMarker,_,`end`),`end`);return(0,F.jsxs)(`g`,{className:`block-layer block-layer--path ${m.className}`,style:m.style,"data-layer-id":a,children:[(0,F.jsxs)(`defs`,{children:[f,b&&(0,F.jsx)(Ze,{id:g,dir:`end`,d:b.d,filled:b.filled,stroke:c}),v&&(0,F.jsx)(Ze,{id:h,dir:`start`,d:v.d,filled:v.filled,stroke:c})]}),(0,F.jsx)(`path`,{d:s,stroke:c,strokeWidth:u,fill:d,fillOpacity:r.fillOpacity,strokeDasharray:p,markerStart:v?`url(#${h})`:void 0,markerEnd:b?`url(#${g})`:void 0})]})}function Ze({id:e,dir:t,d:n,filled:r,stroke:i}){return(0,F.jsx)(`marker`,{id:e,viewBox:`0 0 10 10`,refX:t===`end`?9:1,refY:5,markerWidth:4,markerHeight:4,orient:`auto-start-reverse`,markerUnits:`strokeWidth`,children:(0,F.jsx)(`path`,{d:n,fill:r?i:`none`,stroke:r?`none`:i,strokeWidth:r?void 0:1.5})})}var Qe={terrain:{url:`https://tile.opentopomap.org/{z}/{x}/{y}.png`,attribution:`Map: OpenTopoMap (CC-BY-SA)`,maxZoom:17},road:{url:`https://tile.openstreetmap.org/{z}/{x}/{y}.png`,attribution:`© OpenStreetMap contributors`,maxZoom:19},satellite:{url:`https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}`,attribution:`Imagery: Esri, Maxar, Earthstar`,maxZoom:18},toner:{url:`https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png`,attribution:`Map: Stadia Maps, Stamen Design`,maxZoom:20},watercolor:{url:`https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg`,attribution:`Map: Stadia Maps, Stamen Design`,maxZoom:16}};function $e(e,t,n){let r=2**n,i=Math.floor((t+180)/360*r),a=e*Math.PI/180;return{x:i,y:Math.floor((1-Math.log(Math.tan(a)+1/Math.cos(a))/Math.PI)/2*r)}}function et(e,t,n,r=256){let i=2**n,a=(t+180)/360*i,o=e*Math.PI/180,s=(1-Math.log(Math.tan(o)+1/Math.cos(o))/Math.PI)/2*i;return{x:(a-Math.floor(a))*r,y:(s-Math.floor(s))*r}}function tt(e,t,n,r,i,a=256){let o=$e(e,t,n),s=et(e,t,n,a),c=Math.ceil(r/a)+1,l=Math.ceil(i/a)+1,u=o.x-Math.floor(c/2),d=o.y-Math.floor(l/2),f=r/2-s.x,p=i/2-s.y,m=[];for(let e=0;e<l;e++)for(let t=0;t<c;t++){let n=u+t,r=d+e,i=f+(n-o.x)*a,s=p+(r-o.y)*a;m.push({x:n,y:r,screenX:i,screenY:s})}return m}function nt(e,t,n,r){return e.url.replace(`{z}`,String(r)).replace(`{x}`,String(t)).replace(`{y}`,String(n))}async function rt(e){return new Promise((t,n)=>{let r=new Image;r.crossOrigin=`anonymous`,r.onload=()=>t(r),r.onerror=()=>n(Error(`Failed to load tile: ${e}`)),r.src=e})}async function it(e){let{center:t,zoom:n,style:r,width:i,height:a,markers:o=[],showAttribution:s=!0}=e,c=Qe[r],l=c.tileSize||256,u=Math.min(n,c.maxZoom);if(!j(nt(c,0,0,u),e.policy))throw new M(`RESOURCE_BLOCKED`,`Map tiles for style "${r}" are blocked by the resource policy (${c.url}). Composing a map contacts the tile host; supply the map as \`staticSrc\` to render it without any remote request.`);let d=document.createElement(`canvas`);d.width=i,d.height=a;let f=d.getContext(`2d`);if(!f)throw Error(`Failed to get canvas context`);f.fillStyle=r===`toner`?`#ffffff`:`#e5e7eb`,f.fillRect(0,0,i,a);let p=tt(t.lat,t.lng,u,i,a,l).map(async e=>{let t=nt(c,e.x,e.y,u);try{let n=await rt(t);f.drawImage(n,e.screenX,e.screenY,l,l)}catch(e){console.warn(`Tile load failed: ${t}`,e)}});await Promise.all(p);for(let e of o)at(f,e,t,u,i,a,l);return s&&st(f,c.attribution,i,a),d.toDataURL(`image/png`)}function at(e,t,n,r,i,a,o){let s=$e(n.lat,n.lng,r),c=$e(t.lat,t.lng,r),l=et(n.lat,n.lng,r,o),u=et(t.lat,t.lng,r,o),d=(c.x-s.x)*o+(u.x-l.x),f=(c.y-s.y)*o+(u.y-l.y),p=i/2+d,m=a/2+f,h=t.color||`#ef4444`,g=t.icon||`pin`;e.save(),g===`pin`?(e.fillStyle=h,e.beginPath(),e.arc(p,m-12,8,Math.PI,0,!1),e.lineTo(p,m),e.closePath(),e.fill(),e.fillStyle=`#ffffff`,e.beginPath(),e.arc(p,m-12,3,0,Math.PI*2),e.fill()):g===`circle`?(e.fillStyle=h,e.beginPath(),e.arc(p,m,8,0,Math.PI*2),e.fill(),e.strokeStyle=`#ffffff`,e.lineWidth=2,e.stroke()):g===`star`&&(e.fillStyle=h,ot(e,p,m,5,10,5),e.fill()),t.label&&(e.fillStyle=`#1f2937`,e.font=`bold 12px system-ui, sans-serif`,e.textAlign=`center`,e.fillText(t.label,p,m+20)),e.restore()}function ot(e,t,n,r,i,a){let o=Math.PI/2*3,s=Math.PI/r;e.beginPath(),e.moveTo(t,n-i);for(let c=0;c<r;c++)e.lineTo(t+Math.cos(o)*i,n+Math.sin(o)*i),o+=s,e.lineTo(t+Math.cos(o)*a,n+Math.sin(o)*a),o+=s;e.lineTo(t,n-i),e.closePath()}function st(e,t,n,r){e.save(),e.fillStyle=`rgba(255, 255, 255, 0.8)`,e.font=`10px system-ui, sans-serif`;let i=e.measureText(t).width;e.fillRect(n-i-8-4,r-16,i+8,14),e.fillStyle=`#374151`,e.textAlign=`right`,e.fillText(t,n-4-4,r-5),e.restore()}function ct({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:i,position:a,animation:o}=e,s=`map-clip-${(0,P.useId)().replace(/:/g,``)}-${e.id}`,[c,u]=(0,P.useState)(null),[d,f]=(0,P.useState)(!0),[p,m]=(0,P.useState)(null),[h,g]=(0,P.useState)(!1),_=R(a.x,n.width),v=R(a.y,n.height),y=a.width?R(a.width,n.width):n.width,b=a.height?R(a.height,n.height):n.height,x=z(a.anchor,y,b),S=_+x.x,C=v+x.y,w=L(i.staticSrc??``,t),T=he();(0,P.useEffect)(()=>{let e=!1;if(i.staticSrc){u(w||null),f(!1);return}return f(!0),m(null),g(!1),it({center:i.center,zoom:i.zoom,style:i.style,width:y,height:b,markers:i.markers,showAttribution:i.showAttribution!==!1,policy:T}).then(t=>{e||(u(t),f(!1))}).catch(t=>{if(!e){let e=t instanceof M;e||console.error(`Failed to compose map:`,t),m(t instanceof Error?t.message:String(t)),g(e),f(!1)}}),()=>{e=!0}},[i.center,i.zoom,i.style,i.staticSrc,w,i.markers,i.showAttribution,y,b,t,T]);let E=l(o,r);return d?(0,F.jsxs)(`g`,{className:`block-layer block-layer--map ${E.className}`,style:E.style,"data-layer-id":e.id,children:[(0,F.jsx)(`rect`,{x:S,y:C,width:y,height:b,fill:`#e5e7eb`}),(0,F.jsx)(`text`,{x:S+y/2,y:C+b/2,textAnchor:`middle`,dominantBaseline:`middle`,fill:`#9ca3af`,fontSize:`24`,fontFamily:`system-ui, sans-serif`,children:`Loading map...`})]}):p||!c?(0,F.jsxs)(`g`,{className:`block-layer block-layer--map ${E.className}`,style:E.style,"data-layer-id":e.id,children:[(0,F.jsx)(`rect`,{x:S,y:C,width:y,height:b,fill:h?`#f3f4f6`:`#fef2f2`}),(0,F.jsx)(`text`,{x:S+y/2,y:C+b/2,textAnchor:`middle`,dominantBaseline:`middle`,fill:h?`#6b7280`:`#dc2626`,fontSize:`18`,fontFamily:`system-ui, sans-serif`,children:h?`Map unavailable offline`:`Map failed to load`})]}):(0,F.jsxs)(`g`,{className:`block-layer block-layer--map ${E.className}`,style:E.style,"data-layer-id":e.id,children:[(0,F.jsx)(`defs`,{children:(0,F.jsx)(`clipPath`,{id:s,children:(0,F.jsx)(`rect`,{x:S,y:C,width:y,height:b})})}),(0,F.jsx)(`g`,{clipPath:`url(#${s})`,children:(0,F.jsx)(`image`,{href:c,x:S,y:C,width:y,height:b,preserveAspectRatio:`xMidYMid slice`,style:{pointerEvents:`none`}})})]})}var lt=.2;function ut({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:i,muted:a=!1}){let{content:o,position:s}=e,c=(0,P.useRef)(null),l=(0,P.useRef)(!1),u=o.startAt??0,d=r<u,f=R(s.x,n.width),p=R(s.y,n.height),m=s.width?R(s.width,n.width):n.width,h=s.height?R(s.height,n.height):n.height,g=z(s.anchor,m,h),_=f+g.x,v=p+g.y,y=L(o.src,t),b=L(o.posterSrc||``,t),x=o.posterSrc?b:void 0;return(0,P.useEffect)(()=>{let e=c.current;if(!e)return;if(e.currentTime=o.clipStart,l.current=!0,i){let t=e.play();t&&t.catch(()=>{})}let t=()=>{e.currentTime>=o.clipEnd&&(e.pause(),e.currentTime=o.clipEnd)};return e.addEventListener(`timeupdate`,t),()=>{e.removeEventListener(`timeupdate`,t),e.pause()}},[y,o.clipStart,o.clipEnd]),(0,P.useEffect)(()=>{let e=c.current;if(!e||!l.current)return;let t=d?o.clipStart:Math.min(o.clipEnd,o.clipStart+Math.max(0,r-u));if(e.dataset.captureSequential!==`true`&&Math.abs(e.currentTime-t)>lt&&(e.currentTime=t),d){e.pause();return}if(t>=o.clipEnd){e.pause();return}if(i){let t=e.play();t&&t.catch(()=>{})}else e.dataset.captureSequential!==`true`&&e.pause()},[i,d,r,u,y,o.clipStart,o.clipEnd]),(0,F.jsx)(`g`,{className:`block-layer block-layer--video`,"data-layer-id":e.id,children:(0,F.jsx)(`foreignObject`,{x:_,y:v,width:m,height:h,children:(0,F.jsx)(`video`,{ref:c,src:y,poster:x,muted:a,playsInline:!0,preload:`auto`,"data-clip-start":o.clipStart,"data-clip-end":o.clipEnd,"data-start-at":u,style:{width:`${m}px`,height:`${h}px`,objectFit:o.fit||`cover`,objectPosition:`center`,display:`block`,pointerEvents:`none`}})})})}function dt({layer:e,viewport:t,blockTime:n}){let{content:r,position:i,animation:a}=e,{headers:o,rows:s,align:c,style:u}=r,d=R(i.x,t.width),f=R(i.y,t.height),p=i.width?R(i.width,t.width):t.width,m=i.height?R(i.height,t.height):t.height,h=z(i.anchor,p,m),g=d+h.x,_=f+h.y,v=l(a,n),y=e=>{let t=c?.[e];return t?{textAlign:t}:void 0},b=u.borderRadius??8;return(0,F.jsx)(`g`,{className:`block-layer block-layer--table ${v.className}`,style:v.style,"data-layer-id":e.id,children:(0,F.jsx)(`foreignObject`,{x:g,y:_,width:p,height:m,children:(0,F.jsx)(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,style:{width:`${p}px`,height:`${m}px`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`16px`,boxSizing:`border-box`},children:(0,F.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`separate`,borderSpacing:0,fontSize:`${u.fontSize}px`,fontFamily:u.fontFamily??`system-ui, sans-serif`,overflow:`hidden`,borderRadius:`${b}px`,border:`1px solid ${u.borderColor}`},children:[o.length>0&&(0,F.jsx)(`thead`,{children:(0,F.jsx)(`tr`,{children:o.map((e,t)=>(0,F.jsx)(`th`,{style:{background:u.headerBackground,color:u.headerColor,fontFamily:u.headerFontFamily??u.fontFamily??`system-ui, sans-serif`,fontWeight:600,padding:`12px 16px`,borderBottom:`2px solid ${u.borderColor}`,borderRight:t<o.length-1?`1px solid ${u.borderColor}`:void 0,...y(t)},children:e},t))})}),s.length>0&&(0,F.jsx)(`tbody`,{children:s.map((e,t)=>(0,F.jsx)(`tr`,{children:e.map((n,r)=>(0,F.jsx)(`td`,{style:{background:u.cellBackground,color:u.cellColor,padding:`10px 16px`,borderBottom:t<s.length-1?`1px solid ${u.borderColor}`:void 0,borderRight:r<e.length-1?`1px solid ${u.borderColor}`:void 0,...y(r)},children:n},r))},t))})]})})})})}function ft(e,t){let n=e&&e.trim()?e.trim():t,r=n.indexOf(`:`);return r>0?`fa-${n.slice(0,r).replace(/^fa-/,``)} fa-${n.slice(r+1)}`:`fa-solid fa-${n}`}function pt({layer:e,viewport:t,blockTime:n}){let{content:r,position:i,animation:a}=e,{items:o,style:s}=r,c=R(i.x,t.width),u=R(i.y,t.height),d=i.width?R(i.width,t.width):t.width,f=i.height?R(i.height,t.height):t.height,p=z(i.anchor,d,f),m=l(a,n);return(0,F.jsx)(`g`,{className:`block-layer block-layer--tree ${m.className}`,style:m.style,"data-layer-id":e.id,children:(0,F.jsx)(`foreignObject`,{x:c+p.x,y:u+p.y,width:d,height:f,children:(0,F.jsx)(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,className:`squisq-treelayer`,style:{width:`${d}px`,height:`${f}px`,display:`flex`,flexDirection:`column`,justifyContent:`center`,padding:`24px 32px`,boxSizing:`border-box`,fontFamily:s.fontFamily??`system-ui, sans-serif`,fontSize:`${s.fontSize}px`,lineHeight:1.7,overflow:`hidden`},children:(0,F.jsx)(mt,{items:o,depth:0,style:s})})})})}function mt({items:e,depth:t,style:n}){return(0,F.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,paddingLeft:t===0?0:`${n.indentPx}px`,borderLeft:t===0?`none`:`1px solid ${n.connectorColor}`},children:e.map(e=>(0,F.jsx)(ht,{item:e,style:n},e.id))})}function ht({item:e,style:t}){let n=e.children.length>0,[r,i]=(0,P.useState)(!1),a=e.isDir||n,o=a?ft(t.folderIcon,r?`folder`:`folder-open`):ft(t.fileIcon,`file`);return(0,F.jsxs)(`li`,{style:{position:`relative`},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:`8px`,padding:`1px 0`},children:[n?(0,F.jsx)(`button`,{type:`button`,"aria-label":r?`Expand`:`Collapse`,onClick:()=>i(e=>!e),style:{flex:`0 0 auto`,width:`1em`,border:`none`,background:`transparent`,cursor:`pointer`,color:t.connectorColor,padding:0,fontSize:`0.8em`},children:(0,F.jsx)(`i`,{className:`fa-solid ${r?`fa-chevron-right`:`fa-chevron-down`}`,"aria-hidden":`true`})}):(0,F.jsx)(`span`,{style:{flex:`0 0 auto`,width:`1em`}}),(0,F.jsx)(`i`,{className:o,"aria-hidden":`true`,style:{flex:`0 0 auto`,color:t.iconColor,width:`1.2em`,textAlign:`center`}}),(0,F.jsx)(`span`,{style:{color:a?t.dirColor:t.rowColor,fontWeight:a?600:400},children:e.label}),e.comment?(0,F.jsx)(`span`,{style:{color:t.commentColor,fontSize:`0.85em`,fontStyle:`italic`},children:e.comment}):null]}),n&&!r?(0,F.jsx)(mt,{items:e.children,depth:1,style:t}):null]})}function gt({layer:e,viewport:t,blockTime:n,theme:r}){let{position:i,content:a,animation:o}=e,s=R(i.width??t.width,t.width),c=R(i.height??t.height,t.height),u=R(i.x,t.width),d=R(i.y,t.height),f=i.anchor??`top-left`;f===`center`?(u-=s/2,d-=c/2):(f.endsWith(`right`)&&(u-=s),f.startsWith(`bottom`)&&(d-=c));let p=l(o,n),m={boxSizing:`border-box`,width:`100%`,height:`100%`,padding:a.padding??16,borderRadius:16,background:a.background,color:a.foreground,overflow:`hidden`};return(0,F.jsx)(`g`,{className:`block-layer block-layer--mermaid ${p.className}`,"data-layer-id":e.id,style:p.style,children:(0,F.jsx)(`foreignObject`,{x:u,y:d,width:s,height:c,children:(0,F.jsx)(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,className:`squisq-mermaid-layer-frame`,style:m,children:(0,F.jsx)(fe,{source:a.source,ariaLabel:`Mermaid diagram on slide`,theme:r})})})})}var _t=(0,P.createContext)(null);function vt(){return(0,P.useContext)(_t)}function yt({src:e,basePath:t=``,width:n,height:r,poster:i,controls:a=!0,preload:o=`metadata`,className:s}){let c=L(e,t),l=L(i??``,t),u=i?l:void 0;return c?(0,F.jsx)(`span`,{className:`squisq-inline-video-player ${s??``}`.trim(),children:(0,F.jsx)(`video`,{src:c,poster:u,controls:a,preload:o,width:n,height:r,playsInline:!0})}):null}function bt({src:e,basePath:t=``,controls:n=!0,preload:r=`metadata`,className:i}){let a=L(e,t);return a?(0,F.jsx)(`span`,{className:`squisq-inline-audio-player ${i??``}`.trim(),children:(0,F.jsx)(`audio`,{src:a,controls:n,preload:r})}):null}var V={htmlPolicy:`sanitize`},xt={idle:`Copy`,copying:`Copying…`,copied:`Copied`,failed:`Copy failed`};async function St(e,t,n){if(n){await n(e,t===void 0?{}:{language:t});return}if(typeof navigator>`u`||!navigator.clipboard?.writeText)throw Error(`Clipboard access is unavailable in this host`);await navigator.clipboard.writeText(e)}function Ct({value:e,language:t,ctx:n}){let[r,i]=(0,P.useState)(`idle`),a=(0,P.useRef)();(0,P.useEffect)(()=>()=>{a.current!==void 0&&clearTimeout(a.current)},[]);let o=(0,F.jsx)(`pre`,{className:`squisq-md-code-block`,children:(0,F.jsx)(`code`,{className:t?`language-${t}`:void 0,children:e})});if(!n.showCodeCopyButton)return o;let s=async()=>{if(r!==`copying`){i(`copying`);try{await St(e,t??void 0,n.onCopyCode),i(`copied`)}catch{i(`failed`)}a.current!==void 0&&clearTimeout(a.current),a.current=setTimeout(()=>i(`idle`),1600)}};return(0,F.jsxs)(`div`,{className:`squisq-md-code-frame`,children:[o,(0,F.jsx)(`button`,{type:`button`,className:`squisq-md-code-copy`,"data-copy-state":r,disabled:r===`copying`,onClick:()=>void s(),"aria-label":`Copy code to clipboard`,children:xt[r]})]})}var wt=class extends P.Component{constructor(){super(...arguments),this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};function Tt({node:e,lang:t,ctx:n}){let r=n.fenceRenderers?.[t];return r?(0,F.jsx)(`div`,{className:`squisq-md-fence-widget squisq-md-fence-widget-${t}`,"data-fence-lang":t,children:r({lang:t,...e.meta==null?{}:{meta:e.meta},value:e.value,...n.theme?{theme:n.theme}:{},mode:`read`})}):null}function H(e,t=``,n=V){return e.map((e,r)=>{let i=`${t}i${r}`;switch(e.type){case`text`:return e.value.includes(`
|
|
7
|
+
`)?(0,F.jsx)(P.Fragment,{children:e.value.split(`
|
|
8
|
+
`).map((e,t)=>(0,F.jsxs)(P.Fragment,{children:[t>0&&(0,F.jsx)(`br`,{}),e]},t))},i):(0,F.jsx)(P.Fragment,{children:e.value},i);case`emphasis`:return(0,F.jsx)(`em`,{className:`squisq-md-em`,children:H(e.children,i,n)},i);case`strong`:return(0,F.jsx)(`strong`,{className:`squisq-md-strong`,children:H(e.children,i,n)},i);case`delete`:return(0,F.jsx)(`del`,{className:`squisq-md-del`,children:H(e.children,i,n)},i);case`superscript`:return(0,F.jsx)(`sup`,{className:`squisq-md-sup`,children:H(e.children,i,n)},i);case`subscript`:return(0,F.jsx)(`sub`,{className:`squisq-md-sub`,children:H(e.children,i,n)},i);case`inlineCode`:return(0,F.jsx)(`code`,{className:`squisq-md-inline-code`,children:e.value},i);case`link`:{if(n.accessoryPaths?.has(e.url))return(0,F.jsxs)(`span`,{className:`squisq-md-attachment`,"data-attachment-path":e.url,title:e.title??`Attachment: ${e.url}`,children:[(0,F.jsx)(`i`,{className:`fa-solid fa-paperclip`,"aria-hidden":`true`}),(0,F.jsx)(`span`,{className:`squisq-md-attachment-label`,children:H(e.children,i,n)})]},i);let t=O(e.url,`link`,{extraLinkSchemes:n.linkSchemes});return t?(0,F.jsx)(`a`,{className:`squisq-md-link`,href:t,title:e.title??void 0,target:`_blank`,rel:`noopener noreferrer`,children:H(e.children,i,n)},i):(0,F.jsx)(`span`,{className:`squisq-md-link squisq-md-link--blocked`,children:H(e.children,i,n)},i)}case`image`:return(0,F.jsx)(kt,{src:e.url,alt:e.alt??``,title:e.title??void 0},i);case`break`:return(0,F.jsx)(`br`,{},i);case`inlineMath`:return(0,F.jsx)(`code`,{className:`squisq-md-inline-math`,children:e.value},i);case`inlineIcon`:return(0,F.jsx)(`i`,{className:`fa-${e.family} fa-${e.name}`,"data-icon":e.token,"aria-hidden":`true`},i);case`htmlInline`:return n.htmlPolicy===`strip`?null:(0,F.jsx)(`span`,{className:`squisq-md-html-inline`,children:It(At(e.htmlChildren,n.htmlPolicy),`${i}h`,n)},i);case`footnoteReference`:return(0,F.jsx)(`sup`,{className:`squisq-md-footnote-ref`,children:(0,F.jsxs)(`a`,{href:`#fn-${e.identifier}`,children:[`[`,e.label??e.identifier,`]`]})},i);case`linkReference`:return(0,F.jsx)(`span`,{className:`squisq-md-link-ref`,children:H(e.children,i,n)},i);case`imageReference`:return(0,F.jsxs)(`span`,{className:`squisq-md-image-ref`,children:[`[`,e.alt??e.identifier,`]`]},i);case`textDirective`:return(0,F.jsx)(`span`,{className:`squisq-md-text-directive`,"data-directive":e.name,children:H(e.children,i,n)},i);case`mention`:return(0,F.jsxs)(`span`,{className:`squisq-md-mention mention`,"data-mention":`true`,"data-kind":e.targetKind,"data-id":e.targetId,"data-label":e.displayName,children:[`@`,e.displayName]},i);default:return null}})}function Et(e,t,n=V){switch(e.type){case`paragraph`:return(0,F.jsx)(`p`,{className:`squisq-md-p`,children:H(e.children,t,n)},t);case`heading`:return(0,F.jsx)(`h${e.depth}`,{className:`squisq-md-heading squisq-md-h${e.depth}`,children:H(e.children,t,n)},t);case`blockquote`:return(0,F.jsx)(`blockquote`,{className:`squisq-md-blockquote`,children:U(e.children,t,n)},t);case`list`:return e.ordered?(0,F.jsx)(`ol`,{className:`squisq-md-list squisq-md-ol`,start:e.start??void 0,children:e.children.map((e,r)=>Dt(e,`${t}li${r}`,n))},t):(0,F.jsx)(`ul`,{className:`squisq-md-list squisq-md-ul`,children:e.children.map((e,r)=>Dt(e,`${t}li${r}`,n))},t);case`code`:{let r=e.lang?.trim().toLowerCase();return r&&n.fenceRenderers?.[r]?(0,F.jsx)(wt,{fallback:(0,F.jsx)(Ct,{value:e.value,language:e.lang,ctx:n}),children:(0,F.jsx)(Tt,{node:e,lang:r,ctx:n})},t):r===`mermaid`?(0,F.jsx)(fe,{source:e.value,className:`squisq-md-mermaid`,ariaLabel:`Mermaid diagram`,theme:n.theme},t):(0,F.jsx)(Ct,{value:e.value,language:e.lang,ctx:n},t)}case`thematicBreak`:return(0,F.jsx)(`hr`,{className:`squisq-md-hr`},t);case`table`:return Ot(e.children,e.align,t,n);case`htmlBlock`:return n.htmlPolicy===`strip`?null:(0,F.jsx)(`div`,{className:`squisq-md-html-block`,children:It(At(e.htmlChildren,n.htmlPolicy),`${t}h`,n)},t);case`math`:return(0,F.jsx)(`pre`,{className:`squisq-md-math-block`,children:(0,F.jsx)(`code`,{children:e.value})},t);case`definition`:return null;case`footnoteDefinition`:return(0,F.jsxs)(`div`,{className:`squisq-md-footnote-def`,id:`fn-${e.identifier}`,children:[(0,F.jsx)(`sup`,{children:e.label??e.identifier}),U(e.children,t,n)]},t);case`containerDirective`:return(0,F.jsxs)(`div`,{className:`squisq-md-directive squisq-md-directive-${e.name}`,"data-directive":e.name,children:[e.label&&(0,F.jsx)(`div`,{className:`squisq-md-directive-label`,children:e.label}),U(e.children,t,n)]},t);case`leafDirective`:return(0,F.jsx)(`div`,{className:`squisq-md-directive squisq-md-directive-${e.name}`,"data-directive":e.name,children:H(e.children,t,n)},t);case`definitionList`:return(0,F.jsx)(`dl`,{className:`squisq-md-dl`,children:e.children.map((e,r)=>e.type===`definitionTerm`?(0,F.jsx)(`dt`,{className:`squisq-md-dt`,children:H(e.children,`${t}dt${r}`,n)},`${t}dt${r}`):(0,F.jsx)(`dd`,{className:`squisq-md-dd`,children:U(e.children,`${t}dd${r}`,n)},`${t}dd${r}`))},t);default:return null}}function Dt(e,t,n=V){let r=e.checked!==null&&e.checked!==void 0;return(0,F.jsxs)(`li`,{className:`squisq-md-li${r?` squisq-md-task`:``}`,children:[r&&(0,F.jsx)(`input`,{type:`checkbox`,checked:!!e.checked,readOnly:!0,className:`squisq-md-checkbox`}),U(e.children,t,n)]},t)}function Ot(e,t,n,r=V){let[i,...a]=e;return(0,F.jsxs)(`table`,{className:`squisq-md-table`,children:[i&&(0,F.jsx)(`thead`,{children:(0,F.jsx)(`tr`,{children:i.children.map((e,i)=>(0,F.jsx)(`th`,{className:`squisq-md-th`,style:t?.[i]?{textAlign:t[i]}:void 0,children:H(e.children,`${n}th${i}`,r)},`${n}th${i}`))})}),a.length>0&&(0,F.jsx)(`tbody`,{children:a.map((e,i)=>(0,F.jsx)(`tr`,{children:e.children.map((e,a)=>(0,F.jsx)(`td`,{className:`squisq-md-td`,style:t?.[a]?{textAlign:t[a]}:void 0,children:H(e.children,`${n}td${i}-${a}`,r)},`${n}td${i}-${a}`))},`${n}tr${i}`))})]},n)}function U(e,t=``,n=V){return e.map((e,r)=>Et(e,`${t}b${r}`,n))}function kt({src:e,alt:t,title:n}){let r=O(e,`media`),i=L(r??``,`.`);return r?(0,F.jsx)(`img`,{className:`squisq-md-image`,src:i,alt:t,title:n}):null}function At(e,t){return t===`strip`?[]:t===`trusted`?e:D(e)}var jt=new Set([`base`,`embed`,`iframe`,`link`,`meta`,`object`,`script`,`style`,`title`]),Mt={class:`className`,id:`id`,title:`title`,style:`style`,width:`width`,height:`height`,src:`src`,alt:`alt`,loading:`loading`,decoding:`decoding`,href:`href`,target:`target`,rel:`rel`},Nt=new Set([``,`_self`,`_parent`,`_top`]);function Pt(e,t){let n={};for(let[r,i]of Object.entries(e)){let e=Mt[r];if(e){if(e===`style`){n[`data-style`]=i;continue}if(e===`href`){let e=O(i,`link`,{extraLinkSchemes:t.linkSchemes});e&&(n.href=e);continue}if(e===`src`){let e=O(i,`media`);e&&(n.src=e);continue}n[e]=i}}if(typeof n.target==`string`&&!Nt.has(n.target.toLowerCase())){let e=(typeof n.rel==`string`?n.rel:``).split(/\s+/).filter(e=>e&&e.toLowerCase()!==`opener`);e.some(e=>e.toLowerCase()===`noopener`)||e.push(`noopener`),n.rel=e.join(` `)}return n}function Ft(e,t,n){let r=e.tagName.toLowerCase();if(jt.has(r))return null;if(r===`video`){let n=O(e.attributes.src??``,`media`)??``,r=O(e.attributes.poster??``,`media`)??void 0;return(0,F.jsx)(yt,{src:n,width:e.attributes.width,height:e.attributes.height,poster:r,controls:`controls`in e.attributes,preload:e.attributes.preload===`none`||e.attributes.preload===`metadata`||e.attributes.preload===`auto`?e.attributes.preload:void 0},t)}if(r===`audio`)return(0,F.jsx)(bt,{src:O(e.attributes.src??``,`media`)??``,controls:`controls`in e.attributes,preload:e.attributes.preload===`none`||e.attributes.preload===`metadata`||e.attributes.preload===`auto`?e.attributes.preload:void 0},t);let i=r,a=Pt(e.attributes,n);return e.selfClosing?(0,F.jsx)(i,{...a},t):(0,F.jsx)(i,{...a,children:It(e.children,`${t}c`,n)},t)}function It(e,t,n=V){return e.map((e,r)=>{let i=`${t}${r}`;switch(e.type){case`htmlElement`:return Ft(e,i,n);case`htmlText`:return(0,F.jsx)(P.Fragment,{children:e.value},i);case`htmlComment`:return null;default:return null}})}var Lt=new Set,Rt=e=>e.size===0?e:Lt;function W({nodes:e,className:t,htmlPolicy:n=`sanitize`,linkSchemes:r,theme:i,showCodeCopyButton:a=!1,onCopyCode:o,fenceRenderers:s}){let c=vt(),l=ge(),[u,d]=(0,P.useState)(Lt);return(0,P.useEffect)(()=>{if(!l){d(Rt);return}let e=!1;return l.listMedia().then(t=>{e||d(new Set(t.map(e=>e.name)))},()=>{e||d(Rt)}),()=>{e=!0}},[l]),!e||e.length===0?null:(0,F.jsx)(`div`,{className:`squisq-md ${t||``}`,children:U(e,``,{htmlPolicy:n,linkSchemes:r,theme:i,showCodeCopyButton:a,onCopyCode:o,accessoryPaths:u,fenceRenderers:s??c??void 0})})}function zt(e){return e?Object.keys(e).map(e=>e.trim().toLowerCase()):[]}var Bt={width:1920,height:1080};function Vt({block:e,blockTime:t,basePath:n,isEntering:r=!1,isExiting:i=!1,transition:a,viewport:o=Bt,isPlaying:s,muted:c=!1,animationsEnabled:l=!0,theme:u}){let d=``,f={},p=l?a??e.transition:void 0;p&&r?(d=g(p.type,!0,p.direction),f[`--transition-duration`]=`${C(p)}s`):p&&i&&(d=g(p.type,!1,p.direction),f[`--transition-duration`]=`${C(p)}s`);let m=`vb-clip-${(0,P.useId)().replace(/:/g,``)}-${e.id}`;return(0,F.jsxs)(`svg`,{className:`block-svg ${d}`,style:f,viewBox:`0 0 ${o.width} ${o.height}`,preserveAspectRatio:`xMidYMid meet`,overflow:`hidden`,"data-block-id":e.id,children:[(0,F.jsx)(`defs`,{children:(0,F.jsx)(`clipPath`,{id:m,children:(0,F.jsx)(`rect`,{x:`0`,y:`0`,width:o.width,height:o.height})})}),(0,F.jsx)(`g`,{clipPath:`url(#${m})`,children:(e.layers??[]).map(e=>(0,F.jsx)(Ht,{layer:e,basePath:n,viewport:o,blockTime:t,isPlaying:s,muted:c,animationsEnabled:l,theme:u},e.id))})]})}function Ht({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:i,muted:a,animationsEnabled:o,theme:s}){let c=o||!e.animation?e:{...e,animation:void 0};switch(c.type){case`image`:return(0,F.jsx)(_e,{layer:c,basePath:t,viewport:n,blockTime:r,animationsEnabled:o});case`text`:return(0,F.jsx)(je,{layer:c,viewport:n,blockTime:r});case`shape`:return(0,F.jsx)(Ke,{layer:c,viewport:n,blockTime:r});case`path`:return(0,F.jsx)(Xe,{layer:c,viewport:n,blockTime:r});case`map`:return(0,F.jsx)(ct,{layer:c,basePath:t,viewport:n,blockTime:r});case`video`:return(0,F.jsx)(ut,{layer:c,basePath:t,viewport:n,blockTime:r,isPlaying:i,muted:a});case`table`:return(0,F.jsx)(dt,{layer:c,viewport:n,blockTime:r});case`tree`:return(0,F.jsx)(pt,{layer:c,viewport:n,blockTime:r});case`mermaid`:return(0,F.jsx)(gt,{layer:c,viewport:n,blockTime:r,theme:s});default:return console.warn(`Unknown layer type: ${c.type}`),null}}var Ut=(0,P.createContext)({theme:E,pageStyle:i(E),basePath:`/`,viewport:S.landscape,renderContext:{theme:E},animationsEnabled:!0,imageDisplayMode:`inline`,showCodeCopyButton:!1});function G(){return(0,P.useContext)(Ut)}function Wt({section:e}){let{renderContext:t,basePath:n,animationsEnabled:r,theme:i}=G(),a=e.slots.media,o=a?.type===`canvas`?a:void 0,s=(0,P.useMemo)(()=>{if(!o)return null;let{layers:n}=p(o.block,{...t,blockIndex:e.index});return{...o.block,layers:n}},[o,t,e.index]);if(!o||!s)return null;let c=o.aspect;return(0,F.jsx)(`div`,{className:`squisq-page-canvas${e.hints?.frame===`terminal`?` squisq-page-canvas--terminal squisq-page-canvas--framed`:` squisq-page-canvas--framed`}`,style:{aspectRatio:`${c.width} / ${c.height}`,maxHeight:`min(70vh, 720px)`,maxWidth:`calc(min(70vh, 720px) * ${(c.width/Math.max(1,c.height)).toFixed(4)})`},children:(0,F.jsx)(Vt,{block:s,blockTime:0,basePath:n,viewport:{width:c.width,height:c.height},animationsEnabled:r,theme:i})})}function K({media:e,eager:t,className:n}){let{basePath:r}=G(),i=O(e.src,`media`),a=L(i??``,r);return i?(0,F.jsx)(`img`,{className:n,src:a,alt:e.alt,loading:t?`eager`:`lazy`,decoding:`async`,width:e.width,height:e.height}):null}function Gt({media:e}){let{basePath:t}=G(),n=O(e.src,`media`),r=L(n??``,t),i=e.posterSrc?O(e.posterSrc,`media`):void 0,a=L(i??``,t);return n?(0,F.jsx)(`video`,{src:r,poster:i?a:void 0,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:`metadata`}):null}function q({section:e}){return e.slots.eyebrow?(0,F.jsx)(`span`,{className:`squisq-page-eyebrow`,children:e.slots.eyebrow}):null}function Kt({media:e}){return!e||e.type===`canvas`||!e.credit?null:(0,F.jsxs)(`span`,{className:`squisq-page-media-credit`,children:[e.credit,e.license?` \xB7 ${e.license}`:``]})}function qt({section:e}){let{pageStyle:t}=G(),n=e.slots.media,r=n?.type===`image`?n:void 0,i=t.tokens.heroStyle,a=(0,F.jsxs)(`div`,{className:`squisq-page-hero-body`,children:[(0,F.jsx)(q,{section:e}),(0,F.jsx)(`h1`,{className:`squisq-page-hero-title`,children:e.slots.title}),e.slots.subtitle&&(0,F.jsx)(`p`,{className:`squisq-page-hero-subtitle`,children:e.slots.subtitle})]});return r&&i===`split`?(0,F.jsxs)(`div`,{className:`squisq-page-hero-grid`,children:[a,(0,F.jsxs)(`div`,{className:`squisq-page-hero-media squisq-page-media-frame`,children:[(0,F.jsx)(K,{media:r,eager:!0}),(0,F.jsx)(Kt,{media:r})]})]}):(0,F.jsxs)(F.Fragment,{children:[r&&e.background===`media`&&(0,F.jsx)(`div`,{className:`squisq-page-hero-backdrop`,children:(0,F.jsx)(K,{media:r,eager:!0})}),a]})}function Jt({section:e}){let t=e.slots.media,n=t?.type===`image`?t:void 0;return(0,F.jsxs)(F.Fragment,{children:[n&&e.background===`media`&&(0,F.jsx)(`div`,{className:`squisq-page-hero-backdrop`,children:(0,F.jsx)(K,{media:n})}),(0,F.jsxs)(`div`,{className:`squisq-page-banner-body`,children:[(0,F.jsx)(q,{section:e}),(0,F.jsx)(`h2`,{className:`squisq-page-section-title squisq-page-banner-title`,children:e.slots.title})]})]})}function Yt({section:e}){let t=e.slots.items??[],n=e.variant===`comparison`,r=t.map(e=>typeof e.value==`number`?e.value:Number.parseFloat(String(e.value??``))),i=Math.max(1,...r.filter(e=>Number.isFinite(e)));return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`squisq-page-stats`,children:t.map((e,t)=>(0,F.jsxs)(`div`,{className:`squisq-page-stat${n?` squisq-page-stat--bars`:``}`,children:[(0,F.jsx)(`span`,{className:`squisq-page-stat-value`,children:e.value}),n&&Number.isFinite(r[t])&&(0,F.jsx)(`div`,{className:`squisq-page-stat-bar`,style:{width:`${Math.max(4,r[t]/i*100)}%`}}),e.title&&(0,F.jsx)(`span`,{className:`squisq-page-stat-title`,children:e.title}),e.body&&(0,F.jsx)(`span`,{className:`squisq-page-stat-body`,children:e.body})]},t))}),e.slots.meta&&(0,F.jsx)(`div`,{className:`squisq-page-stat-meta`,children:e.slots.meta})]})}function Xt({section:e}){let t=e.slots.media;return(0,F.jsxs)(F.Fragment,{children:[e.background===`media`&&t&&t.type!==`canvas`&&(0,F.jsx)(`div`,{className:`squisq-page-quote-backdrop`,children:t.type===`image`?(0,F.jsx)(K,{media:t}):(0,F.jsx)(Gt,{media:t})}),e.slots.title&&(0,F.jsx)(`h2`,{className:`squisq-page-section-title`,children:e.slots.title}),(0,F.jsxs)(`figure`,{className:`squisq-page-quote-figure`,style:{margin:0},children:[(0,F.jsx)(`blockquote`,{className:`squisq-page-quote`,children:e.slots.body?.text}),e.slots.attribution&&(0,F.jsx)(`figcaption`,{className:`squisq-page-quote-attribution`,children:e.slots.attribution})]})]})}function Zt({section:e,flip:t}){let n=e.slots.media,r=n?.type===`image`?n:void 0;return(0,F.jsxs)(`div`,{className:`squisq-page-feature${(t?e.variant!==`media-right`:e.variant===`media-right`)?` squisq-page-feature--media-right`:``}`,children:[(0,F.jsxs)(`div`,{className:`squisq-page-feature-media squisq-page-media-frame`,children:[r&&(0,F.jsx)(K,{media:r}),(0,F.jsx)(Kt,{media:r})]}),(0,F.jsxs)(`div`,{className:`squisq-page-feature-text`,children:[(0,F.jsx)(q,{section:e}),e.slots.title&&(0,F.jsx)(`h3`,{className:`squisq-page-section-title squisq-page-feature-title`,children:e.slots.title}),e.slots.body?.text&&(0,F.jsx)(`p`,{className:`squisq-page-feature-body`,children:e.slots.body.text})]})]})}function Qt({section:e}){let{basePath:t}=G(),n=e.slots.media;return!n||n.type===`canvas`?null:(0,F.jsxs)(`figure`,{className:`squisq-page-figure`,children:[(0,F.jsx)(`div`,{className:`squisq-page-media-frame`,children:n.type===`image`?(0,F.jsx)(K,{media:n}):(0,F.jsx)(yt,{src:n.src,poster:n.posterSrc,basePath:t})}),(e.slots.caption||n.credit)&&(0,F.jsxs)(`figcaption`,{children:[e.slots.caption,n.credit&&(0,F.jsxs)(F.Fragment,{children:[e.slots.caption?` `:``,(0,F.jsx)(Kt,{media:n})]})]})]})}function $t({section:e}){let t=e.slots.items??[];return t.length===0?(0,F.jsxs)(`div`,{className:`squisq-page-gallery-empty`,children:[e.slots.title&&(0,F.jsx)(`h2`,{className:`squisq-page-section-title`,children:e.slots.title}),e.slots.body?.text&&(0,F.jsx)(`p`,{children:e.slots.body.text}),e.slots.caption&&(0,F.jsx)(`div`,{className:`squisq-page-gallery-caption`,children:e.slots.caption})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`squisq-page-gallery`,children:t.map((e,t)=>e.media?.type===`image`?(0,F.jsx)(`div`,{className:`squisq-page-media-frame`,children:(0,F.jsx)(K,{media:e.media})},t):null)}),e.slots.caption&&(0,F.jsx)(`div`,{className:`squisq-page-gallery-caption`,children:e.slots.caption})]})}function en({section:e}){let t=e.slots.media,n=t?.type===`image`?t:void 0,r=e.hints?.framing;return(0,F.jsxs)(`div`,{className:`squisq-page-callout`,"data-hint-framing":typeof r==`string`?r:void 0,children:[n&&(0,F.jsx)(`div`,{className:`squisq-page-media-frame`,children:(0,F.jsx)(K,{media:n})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(q,{section:e}),e.slots.title&&(0,F.jsx)(`h3`,{className:`squisq-page-callout-title`,children:e.slots.title}),e.slots.body?.text&&(0,F.jsx)(`p`,{className:`squisq-page-callout-body`,children:e.slots.body.text}),e.slots.meta&&(0,F.jsx)(`div`,{className:`squisq-page-callout-meta`,children:e.slots.meta})]})]})}function tn({section:e}){let{theme:t}=G(),n=e.slots.items??[];return(0,F.jsxs)(F.Fragment,{children:[e.slots.title&&(0,F.jsx)(`h2`,{className:`squisq-page-section-title squisq-page-cards-title`,children:e.slots.title}),(0,F.jsx)(`div`,{className:`squisq-page-cards`,children:n.map((e,n)=>{let r=e.accentScheme?t.colorSchemes?.[e.accentScheme]:void 0;return(0,F.jsxs)(`div`,{className:`squisq-page-card`,style:r?{"--squisq-page-card-accent":r.accent}:void 0,children:[e.title&&(0,F.jsx)(`h3`,{className:`squisq-page-card-title`,children:e.title}),e.body&&(0,F.jsx)(`p`,{className:`squisq-page-card-body`,children:e.body})]},n)})})]})}function nn({section:e}){let{theme:t,showCodeCopyButton:n,onCopyCode:r,fenceRenderers:i,htmlPolicy:a,linkSchemes:o}=G(),s=e.slots.items??[];return(0,F.jsxs)(F.Fragment,{children:[e.slots.title&&(0,F.jsx)(`h2`,{className:`squisq-page-section-title squisq-page-items-title`,children:e.slots.title}),(0,F.jsx)(`ol`,{className:`squisq-page-items`,children:s.map((e,s)=>(0,F.jsx)(`li`,{children:(0,F.jsx)(`div`,{className:`squisq-page-item-body`,children:e.markdown?(0,F.jsx)(W,{nodes:e.markdown,theme:t,showCodeCopyButton:n,onCopyCode:r,fenceRenderers:i,htmlPolicy:a,linkSchemes:o}):e.body})},s))})]})}function rn({section:e}){let t=e.slots.milestone;return t?(0,F.jsxs)(`div`,{className:`squisq-page-milestone`,"data-mood":t.mood,children:[(0,F.jsx)(`div`,{className:`squisq-page-milestone-date`,children:t.date}),(0,F.jsx)(`div`,{className:`squisq-page-milestone-rail`,"aria-hidden":`true`}),(0,F.jsxs)(`div`,{className:`squisq-page-milestone-body`,children:[t.description,t.footer&&(0,F.jsx)(`div`,{className:`squisq-page-milestone-footer`,children:t.footer})]})]}):null}function an({section:e}){let t=e.slots.table;if(!t)return null;let n=e=>t.align?.[e]??void 0;return(0,F.jsxs)(F.Fragment,{children:[e.slots.title&&(0,F.jsx)(`h2`,{className:`squisq-page-section-title squisq-page-table-title`,children:e.slots.title}),(0,F.jsx)(`div`,{className:`squisq-page-table-scroll`,children:(0,F.jsxs)(`table`,{className:`squisq-page-table`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsx)(`tr`,{children:t.headers.map((e,t)=>(0,F.jsx)(`th`,{style:{textAlign:n(t)},children:e},t))})}),(0,F.jsx)(`tbody`,{children:t.rows.map((e,t)=>(0,F.jsx)(`tr`,{children:e.map((e,t)=>(0,F.jsx)(`td`,{style:{textAlign:n(t)},children:e},t))},t))})]})})]})}function on({section:e,block:t}){let{theme:n,showCodeCopyButton:r,onCopyCode:i,fenceRenderers:a,htmlPolicy:o,linkSchemes:s}=G(),c=e.slots.title!==void 0&&t?.sourceHeading?(0,F.jsx)(W,{nodes:[t.sourceHeading],theme:n,showCodeCopyButton:r,onCopyCode:i,htmlPolicy:o,linkSchemes:s}):null,l=e.slots.body?.markdown??t?.contents;return(0,F.jsxs)(`div`,{className:`squisq-page-prose`,children:[c,l&&l.length>0&&(0,F.jsx)(W,{nodes:l,theme:n,showCodeCopyButton:r,onCopyCode:i,fenceRenderers:a,htmlPolicy:o,linkSchemes:s})]})}function sn({section:e}){return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(q,{section:e}),e.slots.title&&(0,F.jsx)(`h2`,{className:`squisq-page-section-title`,children:e.slots.title}),e.slots.body?.text&&(0,F.jsx)(`p`,{children:e.slots.body.text})]})}function cn(e,t){return e.kind===`hero`&&e.background===`media`&&e.slots.media?.type===`image`&&t!==`split`}function ln(e){let t=e.accent.scheme;if(t)return{"--squisq-page-accent":t.accent,"--squisq-page-accent-bg":t.bg,"--squisq-page-accent-text":t.text}}function un(e,t){let{section:n,block:r}=e;switch(n.kind){case`hero`:return(0,F.jsx)(qt,{section:n,block:r});case`banner`:return(0,F.jsx)(Jt,{section:n,block:r});case`stat-band`:return(0,F.jsx)(Yt,{section:n,block:r});case`quote-band`:return(0,F.jsx)(Xt,{section:n,block:r});case`feature-split`:return(0,F.jsx)(Zt,{section:n,block:r,flip:t});case`media-figure`:return(0,F.jsx)(Qt,{section:n,block:r});case`gallery`:return(0,F.jsx)($t,{section:n,block:r});case`callout`:return(0,F.jsx)(en,{section:n,block:r});case`card-grid`:return(0,F.jsx)(tn,{section:n,block:r});case`item-list`:return(0,F.jsx)(nn,{section:n,block:r});case`timeline-rail`:return(0,F.jsx)(rn,{section:n,block:r});case`table-section`:return(0,F.jsx)(an,{section:n,block:r});case`canvas-embed`:return(0,F.jsx)(Wt,{section:n});case`footer`:return(0,F.jsx)(sn,{section:n,block:r});default:return(0,F.jsx)(on,{section:n,block:r})}}function dn({entry:e,featureFlip:t,isLeadProse:n}){let{pageStyle:r,theme:i,showCodeCopyButton:a,onCopyCode:o,fenceRenderers:s,htmlPolicy:c,linkSchemes:l}=G(),{section:u}=e,d=u.slots.richContent?.markdown,f=[`squisq-linear-section`,`squisq-page-section`,`squisq-page-section--${u.kind}`,`squisq-page-section--bg-${u.background}`,`squisq-page-section--em-${u.emphasis}`];u.variant&&f.push(`squisq-page-section--v-${u.variant}`),cn(u,r.tokens.heroStyle)&&f.push(`squisq-page-section--hero-media`);let p={};return u.hints?.vignette&&(p[`data-hint-vignette`]=``),u.hints?.dropCap&&n&&(p[`data-hint-drop-cap`]=``),(0,F.jsx)(`section`,{className:f.join(` `),"data-section-kind":u.kind,"data-block-id":u.blockId,"data-block-index":u.index,"data-template":u.template,style:ln(u),...p,children:(0,F.jsxs)(`div`,{className:`squisq-page-section-inner`,children:[un(e,t),d&&d.length>0&&(0,F.jsx)(`div`,{className:`squisq-page-rich-content`,children:(0,F.jsx)(W,{nodes:d,theme:i,showCodeCopyButton:a,onCopyCode:o,fenceRenderers:s,htmlPolicy:c,linkSchemes:l})})]})})}function fn({doc:e,markdown:t,basePath:n=`/`,viewport:r,className:a,theme:s,surface:c,animationsEnabled:l=!0,thinMargins:f=!1,imageDisplayMode:p=`inline`,globalKeyboardShortcuts:m=!1,showCover:g=!0,transformPage:_,showCodeCopyButton:y=!1,onCopyCode:b,fenceRenderers:x,htmlPolicy:C,linkSchemes:D}){let O=(0,P.useRef)(null),k=r??S.landscape,te=(0,P.useMemo)(()=>!e&&t!==void 0?d(ee(t)):void 0,[e,t]),A=e??te,ne=ae(c===`auto`),j=c===`auto`?ne:c,M=(0,P.useMemo)(()=>{let e=s??E;return j?T(e,j):e},[s,j]),re=(0,P.useMemo)(()=>i(M,_),[M,_]),ie=(0,P.useMemo)(()=>zt(x),[x]),N=(0,P.useMemo)(()=>A?v(A,{theme:M,viewport:k,customTemplates:A.customTemplates,cover:g!==!1&&A.startBlock,transformPage:_,...ie.length>0?{widgetFenceLangs:ie}:{}}):[],[A,M,k,g,_,ie]),I=(0,P.useMemo)(()=>({theme:M,viewport:k,totalBlocks:N.length,persistentLayers:M.persistentLayers,customTemplates:A?.customTemplates}),[M,k,N.length,A?.customTemplates]),oe=(0,P.useMemo)(()=>({theme:M,pageStyle:re,basePath:n,viewport:k,renderContext:I,animationsEnabled:l,imageDisplayMode:p,showCodeCopyButton:y,onCopyCode:b,fenceRenderers:x,htmlPolicy:C,linkSchemes:D}),[M,re,n,k,I,l,p,y,b,x,C,D]),{featureOrdinals:se,leadProseIndex:ce}=(0,P.useMemo)(()=>{let e=new Map,t=0,n=-1;for(let r of N)r.section.kind===`feature-split`&&e.set(r.section.index,t++),n<0&&r.section.kind===`prose`&&(n=r.section.index);return{featureOrdinals:e,leadProseIndex:n}},[N]);if((0,P.useEffect)(()=>{if(!m)return;let e=e=>{if(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.key!==`ArrowDown`&&e.key!==`ArrowUp`||(e.target instanceof Element?e.target:null)?.closest(`input, textarea, select, [contenteditable]:not([contenteditable="false"]), [role="textbox"], [role="combobox"], [role="listbox"], [role="menu"], [role="dialog"], [aria-modal="true"], .monaco-editor`))return;let t=O.current;if(!t)return;e.preventDefault();let n=Math.max(64,Math.round(t.clientHeight*.12));t.scrollBy({top:e.key===`ArrowDown`?n:-n,behavior:`smooth`})};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[m]),!A)return(0,F.jsx)(`div`,{ref:O,className:`squisq-linear squisq-linear--empty ${a||``}`});let le=M.colors.background,ue=M.colors.text,de=M.colors.textMuted,fe=M.colors.primary,pe=w(M.typography.bodyFont,`system-ui, sans-serif`),me=w(M.typography.titleFont,`Georgia, serif`),he=M.typography.lineHeight??1.65,ge=[`squisq-linear-content`,`squisq-md`,`squisq-page`,f?`squisq-linear-content--thin squisq-page--thin`:``,p===`thumbnail`?`squisq-linear-content--thumbnail-images squisq-page--thumbnail-images`:``].filter(Boolean).join(` `);return(0,F.jsx)(`div`,{ref:O,className:`squisq-linear ${a||``}`,role:`region`,"aria-label":`Document page`,tabIndex:f?void 0:0,style:{width:`100%`,height:f?`auto`:`100%`,overflowY:f?`visible`:`auto`,overflowX:`hidden`,background:le,containerType:`inline-size`,containerName:`squisq-page`},children:(0,F.jsxs)(`div`,{className:ge,...o(re),style:{lineHeight:he,fontSize:`16px`,fontFamily:pe,color:ue,...u(M,re),"--squisq-linear-title-font":me,"--squisq-linear-body-font":pe,"--squisq-linear-text":ue,"--squisq-linear-muted":de,"--squisq-linear-primary":fe,"--squisq-linear-bg":le},children:[(0,F.jsx)(`style`,{"data-squisq-page":``,children:h}),(0,F.jsx)(Ut.Provider,{value:oe,children:N.map(e=>{let t=se.get(e.section.index)??0;return(0,F.jsx)(dn,{entry:e,featureFlip:!!e.section.hints?.alternate&&t%2==1,isLeadProse:e.section.index===ce},`${e.section.blockId}-${e.section.index}`)})})]})})}var pn=Object.freeze({frameSize:1024,hopSec:.02,bandLowHz:250,bandHighHz:3e3}),mn=Object.freeze({warmupMs:200,alphaDown:.3,alphaUp:.005,enterRatio:3,exitRatio:2.5,enterFrames:2,hangoverMs:300,noiseRebaselineSec:1.5,floorMin:1e-9}),hn=Object.freeze({envelopeHz:16,minInterOnsetMs:110,prominenceRatio:1.3,minRelPeak:.1,peakRefTauSec:3}),gn=Object.freeze({baseWpm:150,voiceBlend:.6,minRateMult:.5,maxRateMult:3,rateEmaTauSec:.7,velSlewTauSec:.15,haltTauSec:.085,kP:.14,kI:.02,intClamp:4,maxCorrection:.6,sylWindowWords:8,resyncSyllables:8}),_n=Object.freeze({maxDurationSec:7200,maxPcmSamples:2e8,maxScriptTokens:25e4,hopSec:.01,gapMinSec:.35,bandRadiusSec:1.5,bandRadiusNoTraceSec:3,matchTimeWeight:1,pauseToSylCost:2,sylToGapCost:1.5,deleteCost:.8,insertCost:.8,blockSnapWindowSec:.8,tailPadSec:.4});function vn(e,t){let n=2*Math.PI*t/e,r=Math.cos(n),i=Math.sin(n)/(2*Math.SQRT1_2),a=1+i;return{b0:(1+r)/2/a,b1:-(1+r)/a,b2:(1+r)/2/a,a1:-2*r/a,a2:(1-i)/a}}function yn(e,t){let n=2*Math.PI*t/e,r=Math.cos(n),i=Math.sin(n)/(2*Math.SQRT1_2),a=1+i;return{b0:(1-r)/2/a,b1:(1-r)/a,b2:(1-r)/2/a,a1:-2*r/a,a2:(1-i)/a}}function bn(e,t=pn.bandLowHz,n=pn.bandHighHz){return{coeffs:{hp:vn(e,t),lp:yn(e,n)},hp:{x1:0,x2:0,y1:0,y2:0},lp:{x1:0,x2:0,y1:0,y2:0}}}function xn(e,t,n,r){let{x1:i,x2:a,y1:o,y2:s}=t,{b0:c,b1:l,b2:u,a1:d,a2:f}=e;for(let e=0;e<n.length;e++){let t=n[e],p=c*t+l*i+u*a-d*o-f*s;r[e]=p,a=i,i=t,s=o,o=p}return{x1:i,x2:a,y1:o,y2:s}}function Sn(e,t,n){let r=xn(e.coeffs.hp,e.hp,t,n),i=xn(e.coeffs.lp,e.lp,n,n);return{coeffs:e.coeffs,hp:r,lp:i}}function Cn(e,t){let n={...pn,...t};return{sampleRate:e,config:n,hopSamples:Math.max(1,Math.round(n.hopSec*e)),bandpass:bn(e,n.bandLowHz,n.bandHighHz),rawCarry:new Float32Array,bandCarry:new Float32Array,carryStartSample:0}}function wn(e,t){if(e.length===0)return t;let n=new Float32Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}function Tn(e,t,n,r,i,a){let o=0,s=0,c=0,l=e[n];for(let i=0;i<r;i++){let r=e[n+i],a=t[n+i];o+=r*r,s+=a*a,i>0&&(r>=0&&l<0||r<0&&l>=0)&&c++,l=r}return{tSec:(i+r/2)/a,rms:Math.sqrt(o/r),bandEnergy:s/r,zcr:r>1?c/(r-1):0}}function En(e,t){let n=new Float32Array(t.length),r=Sn(e.bandpass,t,n),i=wn(e.rawCarry,t),a=wn(e.bandCarry,n),{frameSize:o}=e.config,s=[],c=0;for(;i.length-c>=o;)s.push(Tn(i,a,c,o,e.carryStartSample+c,e.sampleRate)),c+=e.hopSamples;return{state:{...e,bandpass:r,rawCarry:i.slice(c),bandCarry:a.slice(c),carryStartSample:e.carryStartSample+c},frames:s}}function Dn(e,t,n){return En(Cn(t,n),e).frames}function On(e){let t={...mn,...e};return{noiseFloor:t.floorMin,speaking:!1,enterStreak:0,subExitSince:null,noDipSince:null,warmupUntilSec:t.warmupMs/1e3,seeded:!1,lastTSec:0}}function kn(e,t,n){let r={...mn,...n},i=Math.max(0,t.bandEnergy),a=e.seeded?e.noiseFloor:Math.max(i,r.floorMin);if(e.seeded)if(e.speaking)i<a&&(a+=(i-a)*r.alphaDown);else{let e=i<a?r.alphaDown:r.alphaUp;a+=(i-a)*e}a<r.floorMin&&(a=r.floorMin);let o=e.speaking,s=e.enterStreak,c=e.subExitSince,l=e.noDipSince;return t.tSec<e.warmupUntilSec?(o=!1,s=0,c=null,l=null):o?(i>=a*r.exitRatio?c=null:(c===null&&(c=t.tSec),t.tSec-c>=r.hangoverMs/1e3&&(o=!1,c=null,l=null,s=0)),o&&(i<=a*r.enterRatio?l=t.tSec:l!==null&&t.tSec-l>=r.noiseRebaselineSec&&(a=Math.max(i,r.floorMin),o=!1,c=null,l=null,s=0))):(l=null,i>a*r.enterRatio?(s+=1,s>=r.enterFrames&&(o=!0,c=null,l=t.tSec)):s=0),{noiseFloor:a,speaking:o,enterStreak:s,subExitSince:c,noDipSince:l,warmupUntilSec:e.warmupUntilSec,seeded:!0,lastTSec:t.tSec}}function An(e){return{env:0,prevEnv:0,prevPrevEnv:0,prevTSec:0,valley:1/0,lastOnsetTSec:-1/0,peakRef:0,lastTSec:0,framesSeen:0}}function jn(e,t,n,r){let i={...hn,...r},a=Math.sqrt(Math.max(0,t.bandEnergy)),o=e.framesSeen>0?Math.max(0,t.tSec-e.lastTSec):0,s=e.framesSeen>0?e.env+(a-e.env)*(1-Math.exp(-2*Math.PI*i.envelopeHz*o)):a,c=Math.max(s,e.peakRef*Math.exp(-(o||0)/i.peakRefTauSec)),l=null,u=e.framesSeen>0?e.valley:s,d=e.lastOnsetTSec;return e.framesSeen>=2&&e.prevEnv>=e.prevPrevEnv&&e.prevEnv>s&&n&&e.prevTSec-d>=i.minInterOnsetMs/1e3&&e.prevEnv>=u*i.prominenceRatio&&e.prevEnv>=c*i.minRelPeak&&(l=e.prevTSec,d=e.prevTSec,u=e.prevEnv),u=Math.min(u,s),{state:{env:s,prevEnv:s,prevPrevEnv:e.framesSeen>0?e.prevEnv:s,prevTSec:t.tSec,valley:u,lastOnsetTSec:d,peakRef:c,lastTSec:t.tSec,framesSeen:e.framesSeen+1},onset:l}}function Mn(e,t,n){let r=An(n),i=[];for(let a=0;a<e.length;a++){let o=jn(r,e[a],t[a]??!1,n);r=o.state,o.onset!==null&&i.push(o.onset)}return i}function Nn(e=0){return{wordPos:e,velocityWps:0,emaSylPerSec:0,lastOnsetTSec:null,cumDetectedSyl:0,anchorExpectedSyl:0,errIntegral:0,silenceSec:0,lastTSec:null,halted:!0}}function J(e,t,n){return e<t?t:e>n?n:e}function Pn(e,t,n){let r=e.tokens.length;if(r===0)return 1.4;let i=J(Math.floor(t),0,r-1),a=0,o=0;for(let t=i;t<r&&o<n;t++)e.tokens[t].spoken&&(a+=e.tokens[t].syllables,o+=1);return o>0?Math.max(1,a/o):1.4}function Fn(e,t,n,i){let a={...gn,...i},o=a.baseWpm/60,s=J(t.tSec-(e.lastTSec??t.tSec),0,.25),c=e.emaSylPerSec,l=e.lastOnsetTSec,u=e.cumDetectedSyl;for(let e=0;e<t.onsets;e++){if(l!==null){let e=t.tSec-l;if(e>0){let t=J(1/e,.5,12),n=1-Math.exp(-e/a.rateEmaTauSec);c=c===0?t:c+(t-c)*n}}l=t.tSec,u+=1}let d=Pn(n,e.wordPos,a.sylWindowWords),f=c>0?c/d:o,p=J(a.voiceBlend*f+(1-a.voiceBlend)*o,o*a.minRateMult,o*a.maxRateMult),m=r(n,e.wordPos)-(e.anchorExpectedSyl+u),h=J(Math.min(0,e.errIntegral+m*s),-a.intClamp,0),g=m<0?J(a.kP*-m+a.kI*-h,0,a.maxCorrection):0,v=e.velocityWps,y=e.silenceSec;if(t.speaking){y=0;let e=Math.max(0,p*(1+g));v+=(e-v)*(1-Math.exp(-s/a.velSlewTauSec))}else y+=s,v*=Math.exp(-s/a.haltTauSec),v<.02&&(v=0);let b=e.wordPos;return m<-a.resyncSyllables&&(b=Math.max(b,_(n,e.anchorExpectedSyl+u)),h=0),b=J(b+v*s,0,n.tokens.length),{wordPos:b,velocityWps:v,emaSylPerSec:c,lastOnsetTSec:l,cumDetectedSyl:u,anchorExpectedSyl:e.anchorExpectedSyl,errIntegral:h,silenceSec:y,lastTSec:t.tSec,halted:!t.speaking&&v===0}}function In(e,t,n){let i=J(t,0,n.tokens.length);return{...e,wordPos:i,anchorExpectedSyl:r(n,i),cumDetectedSyl:0,errIntegral:0}}function Ln(e,t,n){let r=n??{};return{script:t,config:r,features:Cn(e,r.feature),vad:On(r.vad),nuclei:An(r.nuclei),pacing:Nn(0),lastFrame:null,tSec:0}}function Rn(e,t){let{state:n,frames:r}=En(e.features,t),i=e.vad,a=e.nuclei,o=e.pacing,s=e.lastFrame;for(let t of r){i=kn(i,t,e.config.vad);let n=jn(a,t,i.speaking,e.config.nuclei);a=n.state,o=Fn(o,{tSec:t.tSec,speaking:i.speaking,onsets:n.onset===null?0:1},e.script,e.config.pacing),s=t}return{...e,features:n,vad:i,nuclei:a,pacing:o,lastFrame:s,tSec:e.tSec+t.length/e.features.sampleRate}}function zn(e,t){return{...e,pacing:In(e.pacing,t,e.script)}}var Bn=60;function Vn(e,t){let n={..._n,...t},{pcm:r,sampleRate:i,script:a}=e;if(e.signal?.throwIfAborted(),!Number.isFinite(i)||i<=0)throw RangeError(`sampleRate must be a positive finite number`);if(r.length>n.maxPcmSamples)throw RangeError(`Narration take exceeds the ${n.maxPcmSamples}-sample safety limit`);if(a.tokens.length>n.maxScriptTokens)throw RangeError(`Narration script exceeds the ${n.maxScriptTokens}-token safety limit`);let o=r.length/Math.max(1,i);if(o>n.maxDurationSec)throw RangeError(`Narration take exceeds the ${n.maxDurationSec}-second safety limit`);if(a.tokens.length===0||o<=0)return{words:[],blocks:[],detectedSyllables:0,cost:0};let s=Dn(r,i,{hopSec:n.hopSec});e.signal?.throwIfAborted();let c=Hn(s),l=Mn(s,c),u=Un(s,c,n.gapMinSec),d=Wn(s,c);if(l.length===0)return $n(a,d>0?d:o,o,n,0);let f=[...l.map(e=>({kind:`syl`,tSec:e,startSec:e,endSec:e})),...u].sort((e,t)=>e.tSec-t.tSec),p=Math.min(Bn,e.trace&&e.trace.samples.length>=2?n.bandRadiusSec:Math.max(n.bandRadiusNoTraceSec,.1*o)),m=Gn(a,o,e.trace),{matchedEventBySlot:h,cost:g}=Jn(m,f,p,n),_=Zn(a,m,f,h);return{words:_,blocks:Qn(a,_,u,o,d,n),detectedSyllables:l.length,cost:g}}function Hn(e){let t=On(),n=Array(e.length);for(let r=0;r<e.length;r++)t=kn(t,e[r]),n[r]=t.speaking;return n}function Un(e,t,n){let r=[],i=-1;for(let a=0;a<=e.length;a++){let o=a<e.length&&!t[a];if(o&&i===-1)i=a;else if(!o&&i!==-1){let t=e[i].tSec,o=e[a-1].tSec;o-t>=n&&r.push({kind:`gap`,tSec:(t+o)/2,startSec:t,endSec:o}),i=-1}}return r}function Wn(e,t){for(let n=e.length-1;n>=0;n--)if(t[n])return e[n].tSec;return 0}function Gn(e,t,n){let r=[];for(let t=0;t<e.tokens.length;t++){let n=e.tokens[t];for(let e=0;e<n.syllables;e++)r.push({kind:`syl`,tokenIndex:t,slotIndex:e,priorSec:0});n.pauseAfter>=2&&r.push({kind:`pause`,tokenIndex:t,slotIndex:-1,priorSec:0})}if(n!==void 0&&n.samples.length>=2)Kn(r,e,n,t);else{let n=Math.max(1,e.totalSyllables);for(let i of r)i.priorSec=(i.kind===`pause`?e.cumulativeSyllables[i.tokenIndex+1]:e.cumulativeSyllables[i.tokenIndex]+i.slotIndex)/n*t}let i=0;for(let e of r)e.priorSec<i&&(e.priorSec=i),e.priorSec>t&&(e.priorSec=t),i=e.priorSec;return r}function Kn(e,t,n,r){let i=[],a=[],o=0;for(let e of n.samples)o=Math.max(o,e.wordPos),i.push(e.tMs/1e3),a.push(o);let s=0;for(let n of e){let e=t.tokens[n.tokenIndex],o=n.kind===`pause`?n.tokenIndex+1:n.tokenIndex+n.slotIndex/Math.max(1,e.syllables);for(;s<a.length-1&&a[s+1]<o;)s++;let c;if(a[s]>=o)c=i[s];else if(s>=a.length-1)c=i[i.length-1];else{let e=a[s+1]-a[s],t=e>0?(o-a[s])/e:0;c=i[s]+t*(i[s+1]-i[s])}n.priorSec=Math.min(Math.max(0,c),r)}}function qn(e,t,n,r){return e.kind===`syl`?t.kind===`syl`?r.matchTimeWeight*Math.abs(t.tSec-e.priorSec)/Math.max(1e-6,n):r.sylToGapCost:t.kind===`gap`?0:r.pauseToSylCost}function Jn(e,t,n,r){let i=e.length,a=t.length,o=1/0,s=t.map(e=>e.tSec),c=new Int32Array(i+1),l=new Int32Array(i+1);for(let t=1;t<=i;t++){let r=e[t-1].priorSec;c[t]=Yn(s,r-n),l[t]=Xn(s,r+n)}c[0]=0,l[0]=i>=1?l[1]:a;for(let e=1;e<=i;e++)c[e]<c[e-1]&&(c[e]=c[e-1]),c[e]>l[e-1]+1&&(c[e]=l[e-1]+1),c[e]>a&&(c[e]=a),l[e]<l[e-1]&&(l[e]=l[e-1]),l[e]<c[e]&&(l[e]=c[e]),l[e]>a&&(l[e]=a);l[i]=a,c[i]>a&&(c[i]=a);let u=Array(i+1),d=new Float64Array(l[0]-c[0]+1);{let e=new Uint8Array(l[0]-c[0]+1);for(let t=c[0];t<=l[0];t++)d[t-c[0]]=t*r.insertCost,e[t-c[0]]=2;u[0]=e}for(let a=1;a<=i;a++){let i=l[a]-c[a]+1,s=new Float64Array(i).fill(o),f=new Uint8Array(i),p=e[a-1];for(let e=c[a];e<=l[a];e++){let i=e-c[a],u=o,m=1;if(e>=1&&e-1>=c[a-1]&&e-1<=l[a-1]){let i=d[e-1-c[a-1]]+qn(p,t[e-1],n,r);i<u&&(u=i,m=0)}if(e>=c[a-1]&&e<=l[a-1]){let t=d[e-c[a-1]]+r.deleteCost;t<u&&(u=t,m=1)}if(e-1>=c[a]){let e=s[i-1]+r.insertCost;e<u&&(u=e,m=2)}s[i]=u,f[i]=m}u[a]=f,d=s}let f=new Int32Array(i).fill(-1),p=i,m=a,h=d[a-c[i]]??0;for(;p>0||m>0;){let e=u[p],t=m-c[p],n=t>=0&&t<e.length?e[t]:p>0?1:2;if(n===0&&p>0&&m>0)f[p-1]=m-1,p--,m--;else if(n===1&&p>0)p--;else if(m>0)m--;else if(p>0)p--;else break}return{matchedEventBySlot:f,cost:Number.isFinite(h)?h:0}}function Yn(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1;e[i]<t?n=i+1:r=i}return n}function Xn(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1;e[i]<=t?n=i+1:r=i}return n}function Zn(e,t,n,r){let i=e.tokens.length,a=Array(i);for(let e=0;e<t.length;e++){let i=r[e];if(i<0)continue;let o=t[e];if(o.kind!==`syl`||a[o.tokenIndex]!==void 0)continue;let s=n[i];a[o.tokenIndex]=s.kind===`gap`?s.endSec:s.tSec}let o=Array(i),s=-1,c=0;for(let e=0;e<i;e++){if(a[e]===void 0)continue;let t=a[e];for(let n=s+1;n<e;n++){let r=(n-s)/(e-s),i=s>=0?c:t;o[n]={tokenIndex:n,tSec:i+(t-i)*(s>=0?r:0),interpolated:!0}}o[e]={tokenIndex:e,tSec:t,interpolated:!1},s=e,c=t}for(let e=s+1;e<i;e++)o[e]={tokenIndex:e,tSec:c,interpolated:!0};if(s===-1)for(let e=0;e<i;e++)o[e]={tokenIndex:e,tSec:0,interpolated:!0};let l=0;for(let e of o)l=Math.max(l,e.tSec),e.tSec=l;return o}function Qn(e,t,n,r,i,a){let o=[],s=n.map(e=>e.endSec),c=0;for(let n=0;n<e.blocks.length;n++){let r=e.blocks[n],i=t[r.tokenStart],l=n===0?0:i?.tSec??c;if(n>0){let e=Xn(s,l)-1;e>=0&&l-s[e]<=a.blockSnapWindowSec&&s[e]>c&&(l=s[e]),l<c&&(l=c)}o.push({blockId:r.blockId,...r.heading===void 0?{}:{heading:r.heading},blockIndex:n,charStart:r.charStart,charEnd:r.charEnd,startSec:l,endSec:l}),c=l}for(let e=0;e<o.length-1;e++)o[e].endSec=o[e+1].startSec;if(o.length>0){let e=o[o.length-1],t=Math.min(r,(i>0?i:r)+a.tailPadSec);r-t<=1&&(t=r),e.endSec=Math.max(e.startSec,t)}return o}function $n(e,t,n,r,i){let a=Math.max(1,e.totalSyllables),o=e.tokens.map((n,r)=>({tokenIndex:r,tSec:e.cumulativeSyllables[r]/a*t,interpolated:!0}));return{words:o,blocks:Qn(e,o,[],n,t,r),detectedSyllables:i,cost:0}}var er=Object.freeze([]);function tr(e,t,n){if(!t||!Number.isFinite(n))return e;for(let n of e)if(n.blockId===t)return e;let r=e.length>0?e[e.length-1].atMs:0;return[...e,{blockId:t,atMs:Math.max(n,r,0)}]}function nr(e){return Number.isFinite(e)&&e>=0?e:0}function rr(e,t,n){let r=new Map,i=0;for(let a of e){if(!t.has(a.blockId)||r.has(a.blockId))continue;let e=Number.isFinite(a.atMs)?a.atMs/1e3:i,o=Math.min(n,Math.max(i,e));r.set(a.blockId,o),i=o}let a=r.keys().next();return a.done||r.set(a.value,0),r}function ir(e,t,n,r){let i=nr(n),a=m(e.blocks),o=c(e,r?.script),s=new Map(o.blocks.map(e=>[e.blockId,e])),l=rr(t,new Set(a.map(e=>e.id)),i),u=Array(a.length),d=i;for(let e=a.length-1;e>=0;e--){let t=l.get(a[e].id);t===void 0?u[e]=d:(u[e]=t,d=t)}let f=[],p=0;for(let e=0;e<a.length;e++){let t=a[e],n=s.get(t.id),r=n?n.charStart:p,o=n?n.charEnd:p;p=o;let c=u[e],l=e+1<a.length?u[e+1]:i;f.push({blockId:t.id,...t.title?{heading:t.title}:{},blockIndex:e,charStart:r,charEnd:o,startSec:c,endSec:Math.max(c,Math.min(l,i))})}return{version:3,sourceText:o.sourceText,duration:i,bookmarks:[],blocks:f,generator:{name:r?.generatorName??`squisq-recorder`,method:`presenter-advance`}}}function ar(e,t){let n=m(e.blocks),r=new Set(t.map(e=>e.blockId)),i=[],a=0;for(let e of n)r.has(e.id)?a++:i.push(e.title||e.id);return{total:n.length,shown:a,unshown:n.length-a,unshownHeadings:i}}var or=Object.freeze([`American`,`British`,`Australian`,`Canadian`,`Indian`]),sr=Object.freeze({Spelling:`spelling`,Typo:`spelling`,Agreement:`grammar`,BoundaryError:`grammar`,Capitalization:`grammar`,Eggcorn:`grammar`,Grammar:`grammar`,Malapropism:`grammar`,Miscellaneous:`grammar`,Nonstandard:`grammar`,Punctuation:`grammar`,Repetition:`grammar`,Usage:`grammar`,WordChoice:`grammar`,WordOrder:`grammar`,Enhancement:`style`,Formatting:`style`,Readability:`style`,Redundancy:`style`,Regionalism:`style`,Style:`style`});function cr(e){return sr[e]??`style`}var lr=/\{\[[^\n]*?\]\}/g;function ur(e){let t=[];return{text:e.replace(lr,(e,n)=>(t.push({start:n,end:n+e.length}),` `.repeat(e.length))),blanked:t}}function dr(e){let t=[],n=[],r=``;for(let i of e)r.length>0&&(r+=`
|
|
9
|
+
|
|
10
|
+
`),t.push(r.length),n.push(i.length),r+=i;return{text:r,starts:t,lengths:n}}function fr(e,t,n){if(n<=t)return null;let{starts:r,lengths:i}=e,a=0,o=r.length-1,s=-1;for(;a<=o;){let e=a+o>>1;r[e]<=t?(s=e,a=e+1):o=e-1}if(s<0)return null;let c=r[s],l=c+i[s];return t>=l||n>l?null:{segmentIndex:s,start:t-c,end:n-c}}var pr=Object.freeze({enabled:{canonical:`squisq-proofing`,legacy:`proofing`},dialect:{canonical:`squisq-proof-dialect`,legacy:`proof-dialect`},dictionary:{canonical:`squisq-proof-dictionary`,legacy:`proof-dictionary`}}),mr=Object.freeze({enabled:!0,dialect:`American`});function hr(e,t){if(e)return Object.prototype.hasOwnProperty.call(e,t.canonical)?e[t.canonical]:e[t.legacy]}function gr(e){if(typeof e==`boolean`)return e;if(typeof e!=`string`)return;let t=e.trim().toLowerCase();if([`true`,`yes`,`on`].includes(t))return!0;if([`false`,`no`,`off`].includes(t))return!1}function _r(e){if(typeof e!=`string`)return;let t=e.trim().toLowerCase();return or.find(e=>e.toLowerCase()===t)}function vr(e){let t=[];if(typeof e==`string`)t.push(...e.split(/[,\s]+/));else if(Array.isArray(e))for(let n of e)typeof n==`string`&&t.push(...n.split(/[,\s]+/));let n=new Set,r=[];for(let e of t){let t=e.trim();t.length===0||n.has(t)||(n.add(t),r.push(t))}return r}function yr(e){let t=vr([...e]);return t.length>0?t.join(`, `):null}function br(e){return{enabled:gr(hr(e,pr.enabled)),dialect:_r(hr(e,pr.dialect)),dictionary:vr(hr(e,pr.dictionary))}}var xr=/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/;function Y(e){return e<10?`0${e}`:String(e)}function Sr(e){return String(e.getUTCFullYear()).padStart(4,`0`)+Y(e.getUTCMonth()+1)+Y(e.getUTCDate())+`T`+Y(e.getUTCHours())+Y(e.getUTCMinutes())+Y(e.getUTCSeconds())+`Z`}function Cr(e){let t=xr.exec(e);if(!t)return null;let[,n,r,i,a,o,s]=t,c=Date.UTC(Number(n),Number(r)-1,Number(i),Number(a),Number(o),Number(s));return Number.isNaN(c)?null:new Date(c)}var wr=new TextDecoder,Tr=new TextEncoder,Er=`.gitignore`,Dr=`.versions/`,Or=/^(!?)\/?\.versions\/?$/;async function kr(e){let t=await e.readFile(Er),n=t?wr.decode(t):``;for(let e of n.split(/\r?\n/))if(Or.test(e.trim()))return;let r=n.includes(`\r
|
|
11
|
+
`)?`\r
|
|
12
|
+
`:`
|
|
13
|
+
`,i=`${n}${n.length>0&&!n.endsWith(`
|
|
14
|
+
`)?r:``}${Dr}${r}`;await e.writeFile(Er,Tr.encode(i),`text/plain`)}var Ar=new TextDecoder,jr=new TextEncoder,Mr=/[<>:"/\\|?*]/,Nr=/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i,Pr=new WeakMap;function Fr(e){if(e.length===0||e.length>200||e===`.`||e===`..`||e.endsWith(`.`)||e.endsWith(` `)||Mr.test(e)||[...e].some(e=>{let t=e.codePointAt(0);return t<32||t===127})||Nr.test(e))throw TypeError(`Invalid snapshot basename: ${JSON.stringify(e)}`)}function X(e,t,n,r=0){if(Fr(t),!Number.isFinite(n.getTime()))throw TypeError(`Snapshot date must be valid`);if(!Number.isInteger(r)||r<0)throw RangeError(`Snapshot collision must be a non-negative integer`);let i=Sr(n),a=r>0?`-${r+1}`:``;return`${e.prefix}${t}.${i}${a}.${e.extension}`}function Ir(e,t){if(!t.startsWith(e.prefix))return null;let n=`.${e.extension}`,r=t.slice(e.prefix.length);if(!r.endsWith(n))return null;let i=r.slice(0,-n.length),a=i.lastIndexOf(`.`);if(a<=0)return null;let o=i.slice(0,a),s=i.slice(a+1),c=s.indexOf(`-`),l=s,u=0;if(c>=0){l=s.slice(0,c);let e=Number(s.slice(c+1));if(!Number.isInteger(e)||e<2)return null;u=e-1}let d=Cr(l);return d?{basename:o,timestamp:d,collision:u}:null}async function Lr(e,t,n){let r=await e.listFiles(t.prefix),i=[];for(let e of r){let r=Ir(t,e.path);!r||n!==void 0&&r.basename!==n||i.push({path:e.path,basename:r.basename,timestamp:r.timestamp,size:e.size,collision:r.collision})}return i.sort((e,t)=>t.timestamp.getTime()-e.timestamp.getTime()||t.collision-e.collision),i}async function Rr(e,t){let n=typeof t==`string`?t:t.path,r=await e.readFile(n);return r?Ar.decode(r):null}async function zr(e,t,n){return Br(e,async()=>{let r=await Lr(e,t,n.basename);if(!n.force&&r.length>0&&await Rr(e,r[0])===n.content)return await kr(e),{saved:!1,version:null,reason:`unchanged`};let i=n.now??new Date,a=jr.encode(n.content);await kr(e);let o=0,s=X(t,n.basename,i,o);if(e.writeFileExclusive)for(;!await e.writeFileExclusive(s,a,n.mimeType);)o+=1,s=X(t,n.basename,i,o);else{for(;await e.exists(s);)o+=1,s=X(t,n.basename,i,o);await e.writeFile(s,a,n.mimeType)}return{saved:!0,version:{path:s,basename:n.basename,timestamp:i,size:a.byteLength,collision:o},reason:`saved`}})}async function Br(e,t){let n=e.mutationLock??e,r=Pr.get(n)??Promise.resolve(),i,a=new Promise(e=>{i=e}),o=r.catch(()=>void 0).then(()=>a);Pr.set(n,o),await r.catch(()=>void 0);try{return await t()}finally{i(),Pr.get(n)===o&&Pr.delete(n)}}function Vr(e){let t=new Map;for(let n of e){let e=t.get(n.basename);e?e.push(n):t.set(n.basename,[n])}return t}function Hr(e,t){return e.filter(e=>t.has(e))}async function Ur(e,t,n,r){if(n.type===`keep-last-n`&&(!Number.isSafeInteger(n.n)||n.n<0))throw RangeError(`keep-last-n requires a non-negative safe integer`);if(n.type===`older-than`&&!Number.isFinite(n.date.getTime()))throw TypeError(`older-than requires a valid date`);let i=await Lr(e,t,r),a=new Set;for(let e of Vr(i).values())if(n.type===`keep-last-n`)for(let t of e.slice(n.n))a.add(t);else if(n.type===`older-than`){let t=n.date.getTime();for(let n of e)n.timestamp.getTime()<t&&a.add(n)}else for(let t of e)n.keep(t,e)||a.add(t);let o=Hr(i,a);return await Gr(e,o),o}async function Wr(e,t,n={},r){let i=n.windowMs??6e4;if(!Number.isFinite(i)||i<0)throw RangeError(`windowMs must be a non-negative finite number`);let a=await Lr(e,t,r),o=new Set;for(let e of Vr(a).values()){let t=e[0];for(let n=1;n<e.length;n++){let r=e[n];t.timestamp.getTime()-r.timestamp.getTime()<=i?o.add(r):t=r}}let s=Hr(a,o);return await Gr(e,s),s}async function Gr(e,t){for(let n of t)await e.removeFile(n.path)}var Kr=`.versions/`,Z=Object.freeze({prefix:Kr,extension:`md`});function qr(e){let t=e.lastIndexOf(`/`),n=t>=0?e.slice(t+1):e,r=n.lastIndexOf(`.`);return r>0?n.slice(0,r):n}function Jr(e,t,n=0){return X(Z,e,t,n)}function Yr(e){return Ir(Z,e)}var Xr=`.versions/data/`;function Zr(e,t,n=0){let r=e.lastIndexOf(`.`),i=r>0?e.slice(r+1).toLowerCase():`bin`,a=(r>0?e.slice(0,r):e).replace(/\//g,`__`);return X({prefix:Xr,extension:i},a,t,n)}async function Qr(e,t){if(t)return t;let n=await e.getDocumentPath();return n?qr(n):null}async function $r(e){return await e.getDocumentPath()??`index.md`}async function ei(e,t){return Lr(e,Z,t)}async function ti(e,t){return Rr(e,t)}async function ni(e,t={}){let n=t.content??await e.readDocument();if(n==null)return{saved:!1,version:null,reason:`no-document`};let r=await Qr(e,t.basename);return r?zr(e,Z,{content:n,basename:r,mimeType:`text/markdown`,now:t.now,force:t.force}):{saved:!1,version:null,reason:`no-document`}}async function ri(e,t,n={}){let r=await ti(e,t);if(r===null)return{reverted:!1,snapshotted:null,reason:`missing-snapshot`};let i=null;if(n.snapshotCurrent!==!1){let t={};n.content!==void 0&&(t.content=n.content),n.basename!==void 0&&(t.basename=n.basename);let r=await ni(e,t);if(!r.saved&&r.reason!==`unchanged`)return{reverted:!1,snapshotted:null,reason:`snapshot-failed`};i=r.version}let a=await $r(e);return await e.writeDocument(r,a),{reverted:!0,snapshotted:i}}async function ii(e,t,n){return Ur(e,Z,t,n)}async function ai(e,t={},n){return Wr(e,Z,t,n)}var oi=class{constructor(e,t={}){this.container=e,this.basename=t.basename}saveVersion(e={}){return ni(this.container,{basename:this.basename,...e})}listVersions(){return ei(this.container,this.basename)}readVersion(e){return ti(this.container,e)}revertToVersion(e,t){return ri(this.container,e,{basename:this.basename,...t})}pruneVersions(e){return ii(this.container,e,this.basename)}coalesceVersions(e){return ai(this.container,e,this.basename)}},si=`state.json`,ci=`assets/`;function li(){return`layer-${Math.random().toString(36).slice(2,10)}`}function ui(e,t,n={}){let r=(n.now??new Date).toISOString();return{version:1,canvas:{width:e,height:t,background:n.background??`transparent`},layers:[],meta:{sourcePath:n.sourcePath,createdAt:r,updatedAt:r}}}function di(e,t){let n=t.id?t:{...t,id:li()};return Q({...e,layers:[...e.layers,n]})}function fi(e,t){let n=e.layers.filter(e=>e.id!==t);return n.length===e.layers.length?e:Q({...e,layers:n})}function pi(e,t,n){let r=e.layers.findIndex(e=>e.id===t);if(r<0)return e;let i=Math.max(0,Math.min(e.layers.length-1,Math.floor(n)));if(i===r)return e;let a=e.layers.slice(),[o]=a.splice(r,1);return a.splice(i,0,o),Q({...e,layers:a})}function mi(e,t,n){let r=!1,i=e.layers.map(e=>e.id===t?(r=!0,{...e,...n}):e);return r?Q({...e,layers:i}):e}function hi(e,t){return Q({...e,canvas:t})}function Q(e,t=new Date){return{...e,meta:{...e.meta,createdAt:e.meta?.createdAt??t.toISOString(),updatedAt:t.toISOString()}}}var gi=new TextDecoder,_i=new TextEncoder;async function vi(e,t=si){let n=await e.readFile(t);if(!n)return null;let r=gi.decode(n),i;try{i=JSON.parse(r)}catch(e){let n=e instanceof Error?e.message:String(e);throw Error(`readImageEditDoc: ${t} is not valid JSON: ${n}`)}return bi(i,t),i}async function yi(e,t,n=si){let r=JSON.stringify(t,null,2);await e.writeFile(n,_i.encode(r),`application/json`)}function bi(e,t,n=`readImageEditDoc`){if(!e||typeof e!=`object`)throw Error(`${n}: ${t} root must be an object`);let r=e;if(r.version!==1)throw Error(`${n}: ${t} has unsupported schema version ${String(r.version)} (expected 1)`);if(!r.canvas||typeof r.canvas.width!=`number`||typeof r.canvas.height!=`number`)throw Error(`${n}: ${t} canvas.width/height must be numbers`);if(!Array.isArray(r.layers))throw Error(`${n}: ${t} layers must be an array`);r.layers.forEach((e,n)=>Si(e,n,t))}var xi=new Set([`image`,`text`,`shape`,`path`]);function Si(e,t,n){let r=`${n} layers[${t}]`;if(!e||typeof e!=`object`)throw Error(`readImageEditDoc: ${r} must be an object`);let i=e;if(typeof i.id!=`string`)throw Error(`readImageEditDoc: ${r} must have a string id`);if(typeof i.type!=`string`||!xi.has(i.type))throw Error(`readImageEditDoc: ${r} type must be one of image|text|shape, got ${String(i.type)}`);let a=i.position;if(!a||typeof a!=`object`||typeof a.x!=`number`&&typeof a.x!=`string`||typeof a.y!=`number`&&typeof a.y!=`string`)throw Error(`readImageEditDoc: ${r} position must have numeric or string x and y`);let o=i.content;if(!o||typeof o!=`object`)throw Error(`readImageEditDoc: ${r} content must be an object`);let s=o;if(i.type===`image`&&typeof s.src!=`string`)throw Error(`readImageEditDoc: ${r} (image) content.src must be a string`);if(i.type===`text`&&typeof s.text!=`string`)throw Error(`readImageEditDoc: ${r} (text) content.text must be a string`);if(i.type===`shape`&&typeof s.shape!=`string`)throw Error(`readImageEditDoc: ${r} (shape) content.shape must be a string`);if(i.type===`path`&&typeof s.d!=`string`)throw Error(`readImageEditDoc: ${r} (path) content.d must be a string`)}var Ci=Object.freeze({prefix:`.versions/`,extension:`json`});async function wi(e,t){return Lr(e,Ci,t)}async function Ti(e,t){return Rr(e,t)}async function Ei(e,t){let n=await Ti(e,t);if(n===null)return null;let r=typeof t==`string`?t:t.path,i;try{i=JSON.parse(n)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`readImageEditVersion: ${r} is not valid JSON: ${t}`)}return bi(i,r,`readImageEditVersion`),i}async function Di(e,t={}){let n=t.stateFilename??`state.json`,r=t.doc??await vi(e,n);if(!r)return{saved:!1,version:null,reason:`no-state`};let i=t.basename??`state`;return zr(e,Ci,{content:JSON.stringify(r,null,2),basename:i,mimeType:`application/json`,now:t.now,force:t.force})}async function Oi(e,t,n={}){let r=await Ei(e,t);if(!r)return{reverted:!1,snapshotted:null,reason:`missing-snapshot`};let i=null;if(n.snapshotCurrent!==!1){let t={stateFilename:n.stateFilename};n.doc!==void 0&&(t.doc=n.doc);let r=await Di(e,t);if(!r.saved&&r.reason!==`unchanged`)return{reverted:!1,snapshotted:null,reason:`snapshot-failed`};i=r.version}return await yi(e,r,n.stateFilename),{reverted:!0,snapshotted:i}}async function ki(e,t,n){return Ur(e,Ci,t,n)}async function Ai(e,t={},n){return Wr(e,Ci,t,n)}var ji=class{constructor(e,t={}){this.container=e,this.basename=t.basename,this.stateFilename=t.stateFilename}saveVersion(e={}){return Di(this.container,{basename:this.basename,stateFilename:this.stateFilename,...e})}listVersions(){return wi(this.container,this.basename)}readVersion(e){return Ei(this.container,e)}revertToVersion(e,t={}){return Oi(this.container,e,{stateFilename:this.stateFilename,...t})}pruneVersions(e){return ki(this.container,e,this.basename)}coalesceVersions(e={}){return Ai(this.container,e,this.basename)}},Mi={png:`image/png`,jpeg:`image/jpeg`,webp:`image/webp`};async function Ni(e,t,n={}){let r=n.format??`png`,i=n.quality??.92,a=n.scale??1,o=Mi[r],s=await Pi(e,t),c=Math.max(1,Math.round(e.canvas.width*a)),l=Math.max(1,Math.round(e.canvas.height*a)),u=await qi(s),d=Ji(c,l),f=d.getContext(`2d`);if(!f)throw Error(`exportImageEditDoc: 2D canvas context unavailable`);return r===`jpeg`&&(f.fillStyle=e.canvas.background&&e.canvas.background!==`transparent`?e.canvas.background:`#ffffff`,f.fillRect(0,0,c,l)),f.drawImage(u,0,0,c,l),Yi(d,o,i)}async function Pi(e,t){let{width:n,height:r,background:i}=e.canvas,a=i&&i!==`transparent`?`<rect width="${n}" height="${r}" fill="${$(i)}"/>`:``,o=[];for(let n of e.layers)n.visible!==!1&&o.push(await Fi(n,e.canvas,t));return`<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="${n}" height="${r}" viewBox="0 0 ${n} ${r}">`+a+o.join(``)+`</svg>`}async function Fi(e,t,n){let r=e.opacity??1,i=r<1?` opacity="${r}"`:``,a=await Ii(e,t,n);return`<g data-layer-id="${$(e.id)}"${i}>${a}</g>`}async function Ii(e,t,n){let{x:r,y:i,w:a,h:o}=Vi(e.position,t);if(e.type===`image`){let t=await Wi(n,e.content.src);return`<image x="${r}" y="${i}" width="${a}" height="${o}" preserveAspectRatio="${Bi(e.content.fit)}" xlink:href="${$(t)}"/>`}if(e.type===`shape`){let t=e.content,n=t.fill??`none`,s=t.stroke?` stroke="${$(t.stroke)}"`:``,c=t.strokeWidth?` stroke-width="${t.strokeWidth}"`:``;if(t.shape===`rect`){let e=t.borderRadius?` rx="${t.borderRadius}" ry="${t.borderRadius}"`:``;return`<rect x="${r}" y="${i}" width="${a}" height="${o}" fill="${$(n)}"${s}${c}${e}/>`}if(t.shape===`circle`){let e=Math.min(a,o)/2;return`<circle cx="${r+a/2}" cy="${i+o/2}" r="${e}" fill="${$(n)}"${s}${c}/>`}return`<line x1="${r}" y1="${i}" x2="${r+a}" y2="${i+o}"${s}${c}/>`}if(e.type===`path`)return Li(e,r,i,a,o);let s=e.content,c=s.style,l=c.lineHeight??1.4,u=c.fontSize*l,d=(s.text??``).split(`
|
|
15
|
+
`).map((e,t)=>`<tspan x="${r}" dy="${t===0?0:u}">${Xi(e)}</tspan>`).join(``),f=c.fontFamily??`sans-serif`,p=c.fontWeight??`normal`,m=c.textAlign===`center`?`middle`:c.textAlign===`right`?`end`:`start`;return`<text x="${r}" y="${i+c.fontSize}" font-family="${$(f)}" font-size="${c.fontSize}" font-weight="${p}" fill="${$(c.color)}" text-anchor="${m}">`+d+`</text>`}function Li(e,t,n,r,i){let a=e.content,o=a.shapeKind?s(a.shapeKind,t,n,r,i)??a.d:a.d,c=a.stroke??`#1e293b`,l=a.strokeWidth??2,u=a.fill??`none`,d=a.dasharray?` stroke-dasharray="${$(a.dasharray)}"`:``,f=a.arrow,p=Ri(a.startMarker,f,`start`),m=Ri(a.endMarker,f,`end`),h=y(p,`start`),g=y(m,`end`),_=`marker-start-${e.id}`,v=`marker-end-${e.id}`,b=h||g?`<defs>${h?zi(_,`start`,h,c):``}${g?zi(v,`end`,g,c):``}</defs>`:``,x=h?` marker-start="url(#${_})"`:``,S=g?` marker-end="url(#${v})"`:``;return b+`<path d="${$(o)}" fill="${$(u)}" stroke="${$(c)}" stroke-width="${l}"${d}${x}${S}/>`}function Ri(e,t,n){return e||(t===`both`||t===n?`arrow`:`none`)}function zi(e,t,n,r){let i=t===`end`?9:1,a=n.filled?`fill="${$(r)}"`:`fill="none" stroke="${$(r)}" stroke-width="1.5"`;return`<marker id="${$(e)}" viewBox="0 0 10 10" refX="${i}" refY="5" markerWidth="4" markerHeight="4" orient="auto-start-reverse" markerUnits="strokeWidth"><path d="${$(n.d)}" ${a}/></marker>`}function Bi(e){return e===`cover`?`xMidYMid slice`:e===`fill`?`none`:`xMidYMid meet`}function Vi(e,t){let n=Hi(e.x,t.width),r=Hi(e.y,t.height),i=e.width===void 0?t.width:Hi(e.width,t.width),a=e.height===void 0?t.height:Hi(e.height,t.height),o=Ui(e.anchor,i,a);return{x:n+o.x,y:r+o.y,w:i,h:a}}function Hi(e,t){return typeof e==`number`?e:e.endsWith(`%`)?parseFloat(e)/100*t:parseFloat(e)||0}function Ui(e,t,n){switch(e){case`center`:return{x:-t/2,y:-n/2};case`top-right`:return{x:-t,y:0};case`bottom-left`:return{x:0,y:-n};case`bottom-right`:return{x:-t,y:-n};default:return{x:0,y:0}}}async function Wi(e,t){if(/^(data:|https?:|blob:)/.test(t))return t;let n=await e.readFile(t);if(!n)throw Error(`exportImageEditDoc: missing asset "${t}"`);return Gi(n,(await e.listFiles(t)).find(e=>e.path===t)?.mimeType??Ki(t))}function Gi(e,t){return`data:${t};base64,${a(new Uint8Array(e))}`}function Ki(e){let t=e.lastIndexOf(`.`);switch(t>=0?e.slice(t).toLowerCase():``){case`.png`:return`image/png`;case`.jpg`:case`.jpeg`:return`image/jpeg`;case`.webp`:return`image/webp`;case`.gif`:return`image/gif`;case`.svg`:return`image/svg+xml`;default:return`application/octet-stream`}}async function qi(e){let t=new Blob([e],{type:`image/svg+xml;charset=utf-8`}),n=URL.createObjectURL(t);try{return await new Promise((e,t)=>{let r=new Image;r.onload=()=>e(r),r.onerror=()=>t(Error(`exportImageEditDoc: SVG image failed to load`)),r.src=n})}finally{URL.revokeObjectURL(n)}}function Ji(e,t){if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(e,t);let n=document.createElement(`canvas`);return n.width=e,n.height=t,n}async function Yi(e,t,n){return`convertToBlob`in e?e.convertToBlob({type:t,quality:n}):new Promise((r,i)=>{e.toBlob(e=>{e?r(e):i(Error(`exportImageEditDoc: canvas.toBlob returned null`))},t,n)})}function $(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function Xi(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}export{er as A,zt as B,ur as C,fr as D,yr as E,Rn as F,Ke as G,_e as H,zn as I,ut as J,dt as K,tr as L,Vn as M,ir as N,br as O,Ln as P,he as Q,Vt as R,pr as S,cr as T,ct as U,W as V,Xe as W,ge as X,pe as Y,L as Z,Zr as _,ui as a,mr as b,fi as c,Q as d,mi as f,Kr as g,oi as h,di as i,ar as j,mn as k,pi as l,Xr as m,si as n,Ni as o,yi as p,je as q,ji as r,vi as s,ci as t,hi as u,Jr as v,dr as w,or as x,Yr as y,fn as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,D as t,K as n,Q as r,T as i,Z as a,at as o,k as s,nt as c,ot as l,q as u,rt as d,tt as f}from"./chunk-S5PCVMKU-DbCZ5AUH.js";var p={cx:12192e3,cy:6858e3},m=new Set([`dt`,`ftr`,`sldNum`,`hdr`]),h=12,g=4,_=128,v=2,y={x:5,y:4,w:90,h:16.7},b={x:5,y:23.3,w:90,h:66},x=44,S=24,C=22;async function w(e,t){l(t),e>0&&e%_===0&&(await new Promise(e=>setTimeout(e,0)),l(t))}function T(e,n){let r=e.getElementsByTagNameNS(t,n);return r.length>0?r[0]:null}function E(e,t){let n=e.getElementsByTagNameNS(i,t);return n.length>0?n[0]:null}function D(e,t){let n=e?.getAttribute(t);if(!n)return;let r=parseInt(n,10);return Number.isFinite(r)?r:void 0}function O(e,t){let n=e/t*100;return Math.round(Math.max(-10,Math.min(110,n))*100)/100}function k(e,t){return{x:O(e.x,t.cx),y:O(e.y,t.cy),w:O(e.cx,t.cx),h:O(e.cy,t.cy)}}function A(e){let t=T(e,`spPr`);if(!t)return null;let n=E(t,`xfrm`);if(!n)return null;let r=E(n,`off`),i=E(n,`ext`),a=D(r,`x`),o=D(r,`y`),s=D(i,`cx`),c=D(i,`cy`);return a===void 0||o===void 0||s===void 0||c===void 0||s<=0||c<=0?null:{x:a,y:o,cx:s,cy:c}}function ee(e){switch(e){case`title`:case`ctrTitle`:return`title`;case`subTitle`:return`subtitle`;case``:case`body`:case`obj`:return`text`;case`pic`:case`clipArt`:case`media`:return`picture`;case`tbl`:return`table`;case`chart`:case`dgm`:return`chart`;default:return`other`}}function j(e){switch(e){case`ctrTitle`:return`title`;case``:case`subTitle`:case`obj`:case`pic`:case`clipArt`:case`media`:case`tbl`:case`chart`:case`dgm`:return`body`;default:return e}}function M(e){let t=E(e,`lvl1pPr`);if(!t)return;let n={},r=t.getAttribute(`algn`);r===`ctr`?n.align=`center`:r===`r`?n.align=`right`:r===`l`&&(n.align=`left`);let i=E(t,`defRPr`),a=D(i,`sz`);a!==void 0&&a>0&&(n.fontSizePt=a/100);let o=i?.getAttribute(`b`);return o===`1`||o===`true`?n.bold=!0:(o===`0`||o===`false`)&&(n.bold=!1),Object.keys(n).length>0?n:void 0}function N(e,t){return e?t?{fontSizePt:e.fontSizePt??t.fontSizePt,bold:e.bold??t.bold,align:e.align??t.align,anchor:e.anchor??t.anchor}:e:t}async function P(e,n,r){l(r);let i={name:``,exact:new Map,baseIdx:new Map,base:new Map},a=await c(e,n);if(!a)return i;i.name=T(a,`cSld`)?.getAttribute(`name`)?.trim()??``;let o=T(a,`txStyles`);if(o){let e=T(o,`titleStyle`),t=T(o,`bodyStyle`);e&&(i.titleStyle=M(e)),t&&(i.bodyStyle=M(t))}let s=a.getElementsByTagNameNS(t,`sp`);for(let e=0;e<s.length;e++){await w(e,r);let t=s[e],n=T(t,`ph`);if(!n)continue;let a=n.getAttribute(`type`)??``,o=D(n,`idx`)??0,c={rect:A(t)},l=T(t,`txBody`),u=l?E(l,`lstStyle`):null;u&&(c.style=M(u));let d=`${a||`body`}:${o}`;i.exact.has(d)||i.exact.set(d,c);let f=j(a),p=`${f}:${o}`;i.baseIdx.has(p)||i.baseIdx.set(p,c),i.base.has(f)||i.base.set(f,c)}return i}function F(e,t){let n=E(e,`srgbClr`)?.getAttribute(`val`);if(n&&/^[0-9a-fA-F]{6}$/.test(n))return`#${n.toLowerCase()}`;let r=E(e,`schemeClr`)?.getAttribute(`val`);if(r&&t.schemeColors?.[r])return t.schemeColors[r]}function I(e,t){for(let n=0;n<e.childNodes.length;n++){let r=e.childNodes[n];if(r&&r.nodeType===1&&r.localName===t){let e=r;if(e.namespaceURI===`http://schemas.openxmlformats.org/drawingml/2006/main`)return e}}return null}function L(e,t,n,r){let i=A(e);if(!i)return null;let a=T(e,`spPr`);if(!a)return null;let o=E(a,`prstGeom`)?.getAttribute(`prst`);if(o===`line`||o===`straightConnector1`){let e=I(a,`ln`),o=e?I(e,`solidFill`):null,s=o?F(o,r):void 0;if(!s)return null;let c=D(e,`w`),l=c?Math.max(1,Math.min(40,Math.round(c/12700*n))):2;return{shape:`line`,rect:k(i,t),stroke:s,strokeWidthPx:l}}if(o===`rect`||o===`roundRect`){let e=I(a,`solidFill`),n=e?F(e,r):void 0;return!n||i.cx*i.cy/(t.cx*t.cy)*100<v?null:{shape:`rect`,rect:k(i,t),fill:n,...o===`roundRect`?{borderRadius:8}:{}}}return null}async function R(n,i,a,s,d,p,h){l(h);let _=await c(n,i);if(!_)return null;let v=T(_,`cSld`)?.getAttribute(`name`)?.trim()??``,x=_.documentElement?.getAttribute(`type`)??void 0,S,C,O=e(await f(n,i),u);if(O){S=o(r(i),O.target);let e=p.get(S);e||(e=P(n,S,h),p.set(S,e)),C=await e}let F=[],I=[],R=_.getElementsByTagNameNS(t,`sp`);for(let e=0;e<R.length;e++){await w(e,h);let t=R[e],n=T(t,`ph`);if(!n){if(I.length<g){let e=L(t,a,s,d);e&&I.push(e)}continue}let r=n.getAttribute(`type`)??``;if(m.has(r))continue;let i=D(n,`idx`)??0,o=ee(r),c=A(t),l=!1;if(!c&&C){let e=j(r),t=C.exact.get(`${r||`body`}:${i}`)??C.baseIdx.get(`${e}:${i}`)??C.base.get(e);t?.rect&&(c=t.rect,l=!0)}let u=c?k(c,a):o===`title`?{...y}:{...b},f=T(t,`txBody`),p=f?E(f,`lstStyle`):null,_=p?M(p):void 0;if(C){let e=j(r),t=C.exact.get(`${r||`body`}:${i}`)??C.baseIdx.get(`${e}:${i}`);_=N(_,t?.style),_=N(_,o===`title`||o===`subtitle`?C.titleStyle:C.bodyStyle)}let v=f?E(f,`bodyPr`):null,x=v?.getAttribute(`anchor`);(x===`t`||x===`ctr`||x===`b`)&&(_={..._??{},anchor:x===`t`?`top`:x===`ctr`?`middle`:`bottom`});let S=n.getAttribute(`orient`),O=v?.getAttribute(`vert`),P=S===`vert`||!!O&&O!==`horz`;F.push({kind:o,rawType:r,idx:i,rect:u,inheritedFromMaster:l,vertical:P,..._?{textStyle:_}:{}})}return{partPath:i,name:v,...x?{typeAttr:x}:{},...S?{masterPath:S}:{},...C?.name?{masterName:C.name}:{},placeholders:F,decorations:I,slideCount:0}}function z(e,t,n,r){return Math.max(0,Math.min(e+t,n+r)-Math.max(e,n))}function B(e,t){let n=z(e.x,e.w,t.x,t.w),r=z(e.y,e.h,t.y,t.h);return n<=.15*Math.min(e.w,t.w)&&r>=.5*Math.min(e.h,t.h)&&e.w>=25&&t.w>=25}function te(e,t){let n=z(e.x,e.w,t.x,t.w);return z(e.y,e.h,t.y,t.h)<=.15*Math.min(e.h,t.h)&&n>=.5*Math.min(e.w,t.w)&&e.y<t.y}function V(e){return e.w>=85&&e.h>=80}function H(e,t){return Math.abs(e.w-t.w)<=.15*Math.max(e.w,t.w)}function ne(e,t){return z(e.x,e.w,t.x,t.w)>2&&z(e.y,e.h,t.y,t.h)>2}function U(e){return e.x+e.w/2}var re=new Set([`titleOnly`,`tx`,`obj`,`objOnly`,`objTx`,`txOverObj`,`objOverTx`,`tbl`,`chart`,`dgm`,`txAndChart`,`chartAndTx`,`vertTitleAndTxOverChart`,`txAndTwoObj`,`twoObjAndTx`,`twoObjOverTx`,`objAndTwoObj`,`twoObjAndObj`,`fourObj`,`vertTx`,`vertTitleAndTx`,`clipArtAndVertTx`]);function ie(e){return!e||e===`cust`?null:e===`title`?{kind:`builtin`,template:`title`,paramSpec:`titleSubtitle`}:e===`secHead`?{kind:`builtin`,template:`sectionHeader`}:e===`blank`?{kind:`skip`}:re.has(e)?{kind:`plain`}:e===`picTx`?{kind:`feature-by-geometry`}:e===`clipArtAndTx`||e===`mediaAndTx`?{kind:`builtin`,template:`leftFeature`,paramSpec:`featureImage`}:e===`txAndClipArt`||e===`txAndMedia`?{kind:`builtin`,template:`rightFeature`,paramSpec:`featureImage`}:e===`twoColTx`||e===`twoObj`||e===`txAndObj`||e===`objAndTx`?{kind:`custom-two-column`}:e===`twoTxTwoObj`?{kind:`comparison`}:null}var ae={"title slide":{kind:`builtin`,template:`title`,paramSpec:`titleSubtitle`},"section header":{kind:`builtin`,template:`sectionHeader`},"two content":{kind:`custom-two-column`},comparison:{kind:`comparison`},"content with caption":{kind:`custom-caption`},"picture with caption":{kind:`feature-by-geometry`},"title and content":{kind:`plain`},"title only":{kind:`plain`},blank:{kind:`skip`},"vertical title and text":{kind:`plain`},"title and vertical text":{kind:`plain`}};function oe(e){return ae[e.trim().toLowerCase()]??null}function W(e){return e.placeholders.filter(e=>e.kind!==`title`&&e.kind!==`subtitle`)}function G(e){if(e.placeholders.some(e=>e.vertical))return{kind:`plain`};let t=e.placeholders.some(e=>e.kind===`title`),n=W(e);if(n.length===0)return t?{kind:`plain`}:{kind:`skip`};let r=n.filter(e=>e.kind===`text`),i=n.filter(e=>e.kind===`picture`),a=n.filter(e=>e.kind!==`text`&&e.kind!==`picture`);return i.length===0&&a.length===0?r.length===1?{kind:`plain`}:r.length===2&&B(r[0].rect,r[1].rect)?H(r[0].rect,r[1].rect)?{kind:`custom-two-column`}:{kind:`custom-caption`}:r.length===4&&K(r)?{kind:`comparison`}:{kind:`plain`}:i.length===1&&a.length===0?r.length===0?V(i[0].rect)?{kind:`builtin`,template:`imageWithCaption`,paramSpec:`featureImage`}:{kind:`custom-generic`}:{kind:`feature-by-geometry`}:i.length>=2&&i.length<=4&&r.length===0&&a.length===0&&i.every((e,t)=>i.every((n,r)=>t===r||!ne(e.rect,n.rect)))?{kind:`builtin`,template:`photoGrid`,paramSpec:`photoGridGate`}:{kind:`plain`}}function K(e){if(e.length!==4)return null;let t=[...e].sort((e,t)=>U(e.rect)-U(t.rect)),n=[t[0],t[1]],r=[t[2],t[3]],i=e=>Math.abs(U(e[0].rect)-U(e[1].rect));if(i(n)>10||i(r)>10||U(r[0].rect)-U(n[1].rect)<=10)return null;let a=e=>{let t=[...e].sort((e,t)=>e.rect.y-t.rect.y),n=t[0],r=t[1];return n.rect.h>20||n.rect.y+n.rect.h>r.rect.y+2?null:[n.idx,r.idx]},o=a(n),s=a(r);return o&&s?{left:o,right:s}:null}function se(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function q(e){return{x:`${e.x}%`,y:`${e.y}%`,width:`${e.w}%`,height:`${e.h}%`}}function ce(e,t,n){return Math.max(16,Math.min(140,Math.round((e&&e>0?e:t)*n)))}function J(e,t,n,r,i){let a=r===`title`?x:r===`subtitle`?S:C,o={fontSize:ce(t.textStyle?.fontSizePt,a,i.pxPerPt),color:i.hints.text??`#1a1a1a`,lineHeight:r===`title`?1.15:1.4,...r===`title`?{fontWeight:t.textStyle?.bold===!1?`normal`:`bold`}:t.textStyle?.bold?{fontWeight:`bold`}:{},...t.textStyle?.align?{textAlign:t.textStyle.align}:{},...t.textStyle?.anchor?{verticalAlign:t.textStyle.anchor}:{}};return{id:e,type:`text`,position:q(t.rect),content:{text:n,style:o}}}function le(e,t,n){return{id:e,type:`image`,position:q(t.rect),content:{src:`{image:${n}}`,alt:`{image:${n}}`,fit:`cover`}}}function Y(e){return e.decorations.map((e,t)=>({id:`decor-${t+1}`,type:`shape`,position:q(e.rect),content:e.shape===`line`?{shape:`line`,stroke:e.stroke,strokeWidth:e.strokeWidthPx??2}:{shape:`rect`,fill:e.fill,...e.borderRadius?{borderRadius:e.borderRadius}:{}}}))}function X(e){return e.placeholders.find(e=>e.kind===`title`)}function Z(){return{kind:`title`,rawType:`title`,idx:0,rect:{...y},inheritedFromMaster:!1,vertical:!1}}function ue(e,t){let n=W(e).filter(e=>e.kind===`text`),r,i,a=[...n].sort((e,t)=>e.rect.x-t.rect.x);a.length>=2&&B(a[0].rect,a[a.length-1].rect)?(r=a[0],i=a[a.length-1]):(r={...Z(),kind:`text`,rawType:`body`,rect:{x:5,y:23.3,w:43,h:66}},i={...r,rect:{x:52,y:23.3,w:43,h:66}});let o=Math.max(0,Math.round((i.rect.x-(r.rect.x+r.rect.w))*100)/100),s=[...Y(e)],c=X(e)??Z();s.push(J(`title`,c,`{title}`,`title`,t));let l={...J(`column`,r,`{item}`,`body`,t),repeat:{source:`listItems`,direction:`row`,gap:o,max:2}};return s.push(l),s}function de(e,t){let n=[...W(e).filter(e=>e.kind===`text`)].sort((e,t)=>t.rect.w-e.rect.w),r=n[0],i=n[1],a=[...Y(e)],o=X(e)??Z();return a.push(J(`title`,o,`{title}`,`title`,t)),r&&a.push(J(`body`,r,`{content}`,`body`,t)),i&&a.push(J(`caption`,i,`{attr:caption|}`,`body`,t)),a}function fe(e,t){let n=[...Y(e)],r=X(e);r&&n.push(J(`title`,r,`{title}`,`title`,t));let i=W(e);i.filter(e=>e.kind===`picture`).sort((e,t)=>e.idx-t.idx||e.rect.y-t.rect.y).forEach((e,t)=>n.push(le(`image-${t}`,e,t)));let a=i.filter(e=>e.kind===`text`);a.length>0&&n.push(J(`body`,a[0],`{content}`,`body`,t)),a.length>1&&t.notes.push(`${a.length-1} additional text region(s) could not be bound \u2014 the token grammar has no per-region address; full text stays in the markdown body.`);let o=i.filter(e=>e.kind===`table`||e.kind===`chart`||e.kind===`other`);return o.length>0&&t.notes.push(`${o.length} table/chart placeholder(s) dropped (content flows as markdown).`),n}function pe(e){return e.some(e=>e.type===`text`||e.type===`image`)}function me(e){let t=W(e),n=t.find(e=>e.kind===`picture`);if(!n)return{kind:`plain`};let r=t.filter(e=>e.kind===`text`),i=r.find(e=>B(n.rect,e.rect));return i?{kind:`builtin`,template:U(n.rect)<U(i.rect)?`leftFeature`:`rightFeature`,paramSpec:`featureImage`}:r.some(e=>te(n.rect,e.rect))||V(n.rect)?{kind:`builtin`,template:`imageWithCaption`,paramSpec:`featureImage`}:{kind:`builtin`,template:`leftFeature`,paramSpec:`featureImage`}}function Q(e){return ie(e.typeAttr)??oe(e.name)??G(e)}function he(e,t,n,r){switch(t.kind){case`plain`:case`skip`:return{kind:t.kind};case`builtin`:return t;case`feature-by-geometry`:return me(e);case`comparison`:{let t=K(W(e).filter(e=>e.kind===`text`));return t?{kind:`builtin`,template:`twoColumn`,paramSpec:`comparisonPairs`,columns:t}:{kind:`plain`}}case`custom-two-column`:case`custom-caption`:case`custom-generic`:case`by-geometry`:{let i=t.kind===`custom-two-column`?ue(e,n):t.kind===`custom-caption`?de(e,n):fe(e,n);return pe(i)?{kind:`custom`,def:{name:r,label:e.name||`Imported layout`,description:`Imported from PowerPoint layout "${e.name||r}"${e.masterName?` (master "${e.masterName}")`:``}`,viewport:n.viewport,layers:i}}:{kind:`plain`}}}}async function ge(e,t){l(t);let n=await c(e,`ppt/presentation.xml`),r=n?T(n,`sldSz`):null,i=D(r,`cx`),a=D(r,`cy`);return i&&a&&i>0&&a>0?{cx:i,cy:a}:{...p}}async function _e(e,n){l(n);let r=await c(e,`ppt/presentation.xml`);if(!r)return[];let i=await f(e,`ppt/presentation.xml`),u=new Map(i.map(e=>[e.id,e.target])),d=[],p=r.getElementsByTagNameNS(t,`sldId`);for(let e=0;e<p.length;e++){await w(e,n);let t=a(p[e],s,`id`,`r:id`),r=t?u.get(t):void 0;r&&d.push(o(`ppt`,r))}return d}function ve(e){return e.cy>e.cx?{width:1080,height:Math.round(1080*e.cy/e.cx)}:{width:Math.round(1080*e.cx/e.cy),height:1080}}async function $(t,i={}){l(i.signal);let a=[],s=i.colors??{},c=i.maxTemplates??h,u=await ge(t,i.signal),d=ve(u),p=d.height/(u.cy/12700),m=await _e(t,i.signal),g=new Map,_=new Map,v=[];for(let a=0;a<m.length;a++){await w(a,i.signal);let s=m[a],c=e(await f(t,s),n);if(!c)continue;let l=o(r(s),c.target);g.set(s,l),_.has(l)||v.push(l),_.set(l,(_.get(l)??0)+1)}if(i.includeUnused){let e=[],n=0;for(let[r,a]of t.contentTypes.overrides)await w(n++,i.signal),a===`application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml`&&!_.has(r)&&e.push(r);e.sort(),v.push(...e)}let y=new Map,b=[],x=new Set;for(let e=0;e<v.length;e++){await w(e,i.signal);let n=v[e],r=await R(t,n,u,p,s,y,i.signal);if(!r){a.push(`layout ${n} could not be read; its slides import plain`);continue}r.slideCount=_.get(n)??0;let o=se(r.name)||`layout-${e+1}`,c=`pptx-${o}`;for(let e=2;x.has(c);e++)c=`pptx-${o}-${e}`;let l=[],f={hints:s,pxPerPt:p,viewport:d,notes:l},m=he(r,Q(r),f,c);m.kind===`custom`&&x.add(c),b.push({extracted:r,verdict:m,notes:l})}let S=b.filter(e=>e.verdict.kind===`custom`);if(S.length>c){let e=[...S].sort((e,t)=>t.extracted.slideCount-e.extracted.slideCount).slice(c);for(let t=0;t<e.length;t++){await w(t,i.signal);let n=e[t];n.verdict={kind:`plain`},n.notes.push(`dropped: more inferred layouts than the template cap`)}a.push(`deck defines ${S.length} distinctive layouts; kept the ${c} most used as custom templates`)}let C=new Map(b.map(e=>[e.extracted.partPath,e]));return l(i.signal),{slideSize:u,layouts:b,byLayoutPath:C,layoutPathBySlide:g,warnings:a}}async function ye(e,t={}){l(t.signal);let n=await $(await d(e,t),t),r=[];for(let e=0;e<n.layouts.length;e++){await w(e,t.signal);let{extracted:i,verdict:a,notes:o}=n.layouts[e];r.push({layoutPath:i.partPath,name:i.name||`Layout ${e+1}`,...i.masterName?{masterName:i.masterName}:{},...i.typeAttr?{typeAttr:i.typeAttr}:{},slideCount:i.slideCount,verdict:a.kind,...a.kind===`builtin`?{builtinTemplate:a.template}:{},...a.kind===`custom`?{customTemplate:a.def}:{},...o.length>0?{notes:o}:{}})}return{layouts:r,slideSize:n.slideSize}}export{ye as n,$ as t};
|
|
1
|
+
import{$ as e,D as t,K as n,Q as r,T as i,Z as a,at as o,k as s,nt as c,ot as l,q as u,rt as d,tt as f}from"./chunk-S5PCVMKU-Df5XzhSE.js";var p={cx:12192e3,cy:6858e3},m=new Set([`dt`,`ftr`,`sldNum`,`hdr`]),h=12,g=4,_=128,v=2,y={x:5,y:4,w:90,h:16.7},b={x:5,y:23.3,w:90,h:66},x=44,S=24,C=22;async function w(e,t){l(t),e>0&&e%_===0&&(await new Promise(e=>setTimeout(e,0)),l(t))}function T(e,n){let r=e.getElementsByTagNameNS(t,n);return r.length>0?r[0]:null}function E(e,t){let n=e.getElementsByTagNameNS(i,t);return n.length>0?n[0]:null}function D(e,t){let n=e?.getAttribute(t);if(!n)return;let r=parseInt(n,10);return Number.isFinite(r)?r:void 0}function O(e,t){let n=e/t*100;return Math.round(Math.max(-10,Math.min(110,n))*100)/100}function k(e,t){return{x:O(e.x,t.cx),y:O(e.y,t.cy),w:O(e.cx,t.cx),h:O(e.cy,t.cy)}}function A(e){let t=T(e,`spPr`);if(!t)return null;let n=E(t,`xfrm`);if(!n)return null;let r=E(n,`off`),i=E(n,`ext`),a=D(r,`x`),o=D(r,`y`),s=D(i,`cx`),c=D(i,`cy`);return a===void 0||o===void 0||s===void 0||c===void 0||s<=0||c<=0?null:{x:a,y:o,cx:s,cy:c}}function ee(e){switch(e){case`title`:case`ctrTitle`:return`title`;case`subTitle`:return`subtitle`;case``:case`body`:case`obj`:return`text`;case`pic`:case`clipArt`:case`media`:return`picture`;case`tbl`:return`table`;case`chart`:case`dgm`:return`chart`;default:return`other`}}function j(e){switch(e){case`ctrTitle`:return`title`;case``:case`subTitle`:case`obj`:case`pic`:case`clipArt`:case`media`:case`tbl`:case`chart`:case`dgm`:return`body`;default:return e}}function M(e){let t=E(e,`lvl1pPr`);if(!t)return;let n={},r=t.getAttribute(`algn`);r===`ctr`?n.align=`center`:r===`r`?n.align=`right`:r===`l`&&(n.align=`left`);let i=E(t,`defRPr`),a=D(i,`sz`);a!==void 0&&a>0&&(n.fontSizePt=a/100);let o=i?.getAttribute(`b`);return o===`1`||o===`true`?n.bold=!0:(o===`0`||o===`false`)&&(n.bold=!1),Object.keys(n).length>0?n:void 0}function N(e,t){return e?t?{fontSizePt:e.fontSizePt??t.fontSizePt,bold:e.bold??t.bold,align:e.align??t.align,anchor:e.anchor??t.anchor}:e:t}async function P(e,n,r){l(r);let i={name:``,exact:new Map,baseIdx:new Map,base:new Map},a=await c(e,n);if(!a)return i;i.name=T(a,`cSld`)?.getAttribute(`name`)?.trim()??``;let o=T(a,`txStyles`);if(o){let e=T(o,`titleStyle`),t=T(o,`bodyStyle`);e&&(i.titleStyle=M(e)),t&&(i.bodyStyle=M(t))}let s=a.getElementsByTagNameNS(t,`sp`);for(let e=0;e<s.length;e++){await w(e,r);let t=s[e],n=T(t,`ph`);if(!n)continue;let a=n.getAttribute(`type`)??``,o=D(n,`idx`)??0,c={rect:A(t)},l=T(t,`txBody`),u=l?E(l,`lstStyle`):null;u&&(c.style=M(u));let d=`${a||`body`}:${o}`;i.exact.has(d)||i.exact.set(d,c);let f=j(a),p=`${f}:${o}`;i.baseIdx.has(p)||i.baseIdx.set(p,c),i.base.has(f)||i.base.set(f,c)}return i}function F(e,t){let n=E(e,`srgbClr`)?.getAttribute(`val`);if(n&&/^[0-9a-fA-F]{6}$/.test(n))return`#${n.toLowerCase()}`;let r=E(e,`schemeClr`)?.getAttribute(`val`);if(r&&t.schemeColors?.[r])return t.schemeColors[r]}function I(e,t){for(let n=0;n<e.childNodes.length;n++){let r=e.childNodes[n];if(r&&r.nodeType===1&&r.localName===t){let e=r;if(e.namespaceURI===`http://schemas.openxmlformats.org/drawingml/2006/main`)return e}}return null}function L(e,t,n,r){let i=A(e);if(!i)return null;let a=T(e,`spPr`);if(!a)return null;let o=E(a,`prstGeom`)?.getAttribute(`prst`);if(o===`line`||o===`straightConnector1`){let e=I(a,`ln`),o=e?I(e,`solidFill`):null,s=o?F(o,r):void 0;if(!s)return null;let c=D(e,`w`),l=c?Math.max(1,Math.min(40,Math.round(c/12700*n))):2;return{shape:`line`,rect:k(i,t),stroke:s,strokeWidthPx:l}}if(o===`rect`||o===`roundRect`){let e=I(a,`solidFill`),n=e?F(e,r):void 0;return!n||i.cx*i.cy/(t.cx*t.cy)*100<v?null:{shape:`rect`,rect:k(i,t),fill:n,...o===`roundRect`?{borderRadius:8}:{}}}return null}async function R(n,i,a,s,d,p,h){l(h);let _=await c(n,i);if(!_)return null;let v=T(_,`cSld`)?.getAttribute(`name`)?.trim()??``,x=_.documentElement?.getAttribute(`type`)??void 0,S,C,O=e(await f(n,i),u);if(O){S=o(r(i),O.target);let e=p.get(S);e||(e=P(n,S,h),p.set(S,e)),C=await e}let F=[],I=[],R=_.getElementsByTagNameNS(t,`sp`);for(let e=0;e<R.length;e++){await w(e,h);let t=R[e],n=T(t,`ph`);if(!n){if(I.length<g){let e=L(t,a,s,d);e&&I.push(e)}continue}let r=n.getAttribute(`type`)??``;if(m.has(r))continue;let i=D(n,`idx`)??0,o=ee(r),c=A(t),l=!1;if(!c&&C){let e=j(r),t=C.exact.get(`${r||`body`}:${i}`)??C.baseIdx.get(`${e}:${i}`)??C.base.get(e);t?.rect&&(c=t.rect,l=!0)}let u=c?k(c,a):o===`title`?{...y}:{...b},f=T(t,`txBody`),p=f?E(f,`lstStyle`):null,_=p?M(p):void 0;if(C){let e=j(r),t=C.exact.get(`${r||`body`}:${i}`)??C.baseIdx.get(`${e}:${i}`);_=N(_,t?.style),_=N(_,o===`title`||o===`subtitle`?C.titleStyle:C.bodyStyle)}let v=f?E(f,`bodyPr`):null,x=v?.getAttribute(`anchor`);(x===`t`||x===`ctr`||x===`b`)&&(_={..._??{},anchor:x===`t`?`top`:x===`ctr`?`middle`:`bottom`});let S=n.getAttribute(`orient`),O=v?.getAttribute(`vert`),P=S===`vert`||!!O&&O!==`horz`;F.push({kind:o,rawType:r,idx:i,rect:u,inheritedFromMaster:l,vertical:P,..._?{textStyle:_}:{}})}return{partPath:i,name:v,...x?{typeAttr:x}:{},...S?{masterPath:S}:{},...C?.name?{masterName:C.name}:{},placeholders:F,decorations:I,slideCount:0}}function z(e,t,n,r){return Math.max(0,Math.min(e+t,n+r)-Math.max(e,n))}function B(e,t){let n=z(e.x,e.w,t.x,t.w),r=z(e.y,e.h,t.y,t.h);return n<=.15*Math.min(e.w,t.w)&&r>=.5*Math.min(e.h,t.h)&&e.w>=25&&t.w>=25}function te(e,t){let n=z(e.x,e.w,t.x,t.w);return z(e.y,e.h,t.y,t.h)<=.15*Math.min(e.h,t.h)&&n>=.5*Math.min(e.w,t.w)&&e.y<t.y}function V(e){return e.w>=85&&e.h>=80}function H(e,t){return Math.abs(e.w-t.w)<=.15*Math.max(e.w,t.w)}function ne(e,t){return z(e.x,e.w,t.x,t.w)>2&&z(e.y,e.h,t.y,t.h)>2}function U(e){return e.x+e.w/2}var re=new Set([`titleOnly`,`tx`,`obj`,`objOnly`,`objTx`,`txOverObj`,`objOverTx`,`tbl`,`chart`,`dgm`,`txAndChart`,`chartAndTx`,`vertTitleAndTxOverChart`,`txAndTwoObj`,`twoObjAndTx`,`twoObjOverTx`,`objAndTwoObj`,`twoObjAndObj`,`fourObj`,`vertTx`,`vertTitleAndTx`,`clipArtAndVertTx`]);function ie(e){return!e||e===`cust`?null:e===`title`?{kind:`builtin`,template:`title`,paramSpec:`titleSubtitle`}:e===`secHead`?{kind:`builtin`,template:`sectionHeader`}:e===`blank`?{kind:`skip`}:re.has(e)?{kind:`plain`}:e===`picTx`?{kind:`feature-by-geometry`}:e===`clipArtAndTx`||e===`mediaAndTx`?{kind:`builtin`,template:`leftFeature`,paramSpec:`featureImage`}:e===`txAndClipArt`||e===`txAndMedia`?{kind:`builtin`,template:`rightFeature`,paramSpec:`featureImage`}:e===`twoColTx`||e===`twoObj`||e===`txAndObj`||e===`objAndTx`?{kind:`custom-two-column`}:e===`twoTxTwoObj`?{kind:`comparison`}:null}var ae={"title slide":{kind:`builtin`,template:`title`,paramSpec:`titleSubtitle`},"section header":{kind:`builtin`,template:`sectionHeader`},"two content":{kind:`custom-two-column`},comparison:{kind:`comparison`},"content with caption":{kind:`custom-caption`},"picture with caption":{kind:`feature-by-geometry`},"title and content":{kind:`plain`},"title only":{kind:`plain`},blank:{kind:`skip`},"vertical title and text":{kind:`plain`},"title and vertical text":{kind:`plain`}};function oe(e){return ae[e.trim().toLowerCase()]??null}function W(e){return e.placeholders.filter(e=>e.kind!==`title`&&e.kind!==`subtitle`)}function G(e){if(e.placeholders.some(e=>e.vertical))return{kind:`plain`};let t=e.placeholders.some(e=>e.kind===`title`),n=W(e);if(n.length===0)return t?{kind:`plain`}:{kind:`skip`};let r=n.filter(e=>e.kind===`text`),i=n.filter(e=>e.kind===`picture`),a=n.filter(e=>e.kind!==`text`&&e.kind!==`picture`);return i.length===0&&a.length===0?r.length===1?{kind:`plain`}:r.length===2&&B(r[0].rect,r[1].rect)?H(r[0].rect,r[1].rect)?{kind:`custom-two-column`}:{kind:`custom-caption`}:r.length===4&&K(r)?{kind:`comparison`}:{kind:`plain`}:i.length===1&&a.length===0?r.length===0?V(i[0].rect)?{kind:`builtin`,template:`imageWithCaption`,paramSpec:`featureImage`}:{kind:`custom-generic`}:{kind:`feature-by-geometry`}:i.length>=2&&i.length<=4&&r.length===0&&a.length===0&&i.every((e,t)=>i.every((n,r)=>t===r||!ne(e.rect,n.rect)))?{kind:`builtin`,template:`photoGrid`,paramSpec:`photoGridGate`}:{kind:`plain`}}function K(e){if(e.length!==4)return null;let t=[...e].sort((e,t)=>U(e.rect)-U(t.rect)),n=[t[0],t[1]],r=[t[2],t[3]],i=e=>Math.abs(U(e[0].rect)-U(e[1].rect));if(i(n)>10||i(r)>10||U(r[0].rect)-U(n[1].rect)<=10)return null;let a=e=>{let t=[...e].sort((e,t)=>e.rect.y-t.rect.y),n=t[0],r=t[1];return n.rect.h>20||n.rect.y+n.rect.h>r.rect.y+2?null:[n.idx,r.idx]},o=a(n),s=a(r);return o&&s?{left:o,right:s}:null}function se(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function q(e){return{x:`${e.x}%`,y:`${e.y}%`,width:`${e.w}%`,height:`${e.h}%`}}function ce(e,t,n){return Math.max(16,Math.min(140,Math.round((e&&e>0?e:t)*n)))}function J(e,t,n,r,i){let a=r===`title`?x:r===`subtitle`?S:C,o={fontSize:ce(t.textStyle?.fontSizePt,a,i.pxPerPt),color:i.hints.text??`#1a1a1a`,lineHeight:r===`title`?1.15:1.4,...r===`title`?{fontWeight:t.textStyle?.bold===!1?`normal`:`bold`}:t.textStyle?.bold?{fontWeight:`bold`}:{},...t.textStyle?.align?{textAlign:t.textStyle.align}:{},...t.textStyle?.anchor?{verticalAlign:t.textStyle.anchor}:{}};return{id:e,type:`text`,position:q(t.rect),content:{text:n,style:o}}}function le(e,t,n){return{id:e,type:`image`,position:q(t.rect),content:{src:`{image:${n}}`,alt:`{image:${n}}`,fit:`cover`}}}function Y(e){return e.decorations.map((e,t)=>({id:`decor-${t+1}`,type:`shape`,position:q(e.rect),content:e.shape===`line`?{shape:`line`,stroke:e.stroke,strokeWidth:e.strokeWidthPx??2}:{shape:`rect`,fill:e.fill,...e.borderRadius?{borderRadius:e.borderRadius}:{}}}))}function X(e){return e.placeholders.find(e=>e.kind===`title`)}function Z(){return{kind:`title`,rawType:`title`,idx:0,rect:{...y},inheritedFromMaster:!1,vertical:!1}}function ue(e,t){let n=W(e).filter(e=>e.kind===`text`),r,i,a=[...n].sort((e,t)=>e.rect.x-t.rect.x);a.length>=2&&B(a[0].rect,a[a.length-1].rect)?(r=a[0],i=a[a.length-1]):(r={...Z(),kind:`text`,rawType:`body`,rect:{x:5,y:23.3,w:43,h:66}},i={...r,rect:{x:52,y:23.3,w:43,h:66}});let o=Math.max(0,Math.round((i.rect.x-(r.rect.x+r.rect.w))*100)/100),s=[...Y(e)],c=X(e)??Z();s.push(J(`title`,c,`{title}`,`title`,t));let l={...J(`column`,r,`{item}`,`body`,t),repeat:{source:`listItems`,direction:`row`,gap:o,max:2}};return s.push(l),s}function de(e,t){let n=[...W(e).filter(e=>e.kind===`text`)].sort((e,t)=>t.rect.w-e.rect.w),r=n[0],i=n[1],a=[...Y(e)],o=X(e)??Z();return a.push(J(`title`,o,`{title}`,`title`,t)),r&&a.push(J(`body`,r,`{content}`,`body`,t)),i&&a.push(J(`caption`,i,`{attr:caption|}`,`body`,t)),a}function fe(e,t){let n=[...Y(e)],r=X(e);r&&n.push(J(`title`,r,`{title}`,`title`,t));let i=W(e);i.filter(e=>e.kind===`picture`).sort((e,t)=>e.idx-t.idx||e.rect.y-t.rect.y).forEach((e,t)=>n.push(le(`image-${t}`,e,t)));let a=i.filter(e=>e.kind===`text`);a.length>0&&n.push(J(`body`,a[0],`{content}`,`body`,t)),a.length>1&&t.notes.push(`${a.length-1} additional text region(s) could not be bound \u2014 the token grammar has no per-region address; full text stays in the markdown body.`);let o=i.filter(e=>e.kind===`table`||e.kind===`chart`||e.kind===`other`);return o.length>0&&t.notes.push(`${o.length} table/chart placeholder(s) dropped (content flows as markdown).`),n}function pe(e){return e.some(e=>e.type===`text`||e.type===`image`)}function me(e){let t=W(e),n=t.find(e=>e.kind===`picture`);if(!n)return{kind:`plain`};let r=t.filter(e=>e.kind===`text`),i=r.find(e=>B(n.rect,e.rect));return i?{kind:`builtin`,template:U(n.rect)<U(i.rect)?`leftFeature`:`rightFeature`,paramSpec:`featureImage`}:r.some(e=>te(n.rect,e.rect))||V(n.rect)?{kind:`builtin`,template:`imageWithCaption`,paramSpec:`featureImage`}:{kind:`builtin`,template:`leftFeature`,paramSpec:`featureImage`}}function Q(e){return ie(e.typeAttr)??oe(e.name)??G(e)}function he(e,t,n,r){switch(t.kind){case`plain`:case`skip`:return{kind:t.kind};case`builtin`:return t;case`feature-by-geometry`:return me(e);case`comparison`:{let t=K(W(e).filter(e=>e.kind===`text`));return t?{kind:`builtin`,template:`twoColumn`,paramSpec:`comparisonPairs`,columns:t}:{kind:`plain`}}case`custom-two-column`:case`custom-caption`:case`custom-generic`:case`by-geometry`:{let i=t.kind===`custom-two-column`?ue(e,n):t.kind===`custom-caption`?de(e,n):fe(e,n);return pe(i)?{kind:`custom`,def:{name:r,label:e.name||`Imported layout`,description:`Imported from PowerPoint layout "${e.name||r}"${e.masterName?` (master "${e.masterName}")`:``}`,viewport:n.viewport,layers:i}}:{kind:`plain`}}}}async function ge(e,t){l(t);let n=await c(e,`ppt/presentation.xml`),r=n?T(n,`sldSz`):null,i=D(r,`cx`),a=D(r,`cy`);return i&&a&&i>0&&a>0?{cx:i,cy:a}:{...p}}async function _e(e,n){l(n);let r=await c(e,`ppt/presentation.xml`);if(!r)return[];let i=await f(e,`ppt/presentation.xml`),u=new Map(i.map(e=>[e.id,e.target])),d=[],p=r.getElementsByTagNameNS(t,`sldId`);for(let e=0;e<p.length;e++){await w(e,n);let t=a(p[e],s,`id`,`r:id`),r=t?u.get(t):void 0;r&&d.push(o(`ppt`,r))}return d}function ve(e){return e.cy>e.cx?{width:1080,height:Math.round(1080*e.cy/e.cx)}:{width:Math.round(1080*e.cx/e.cy),height:1080}}async function $(t,i={}){l(i.signal);let a=[],s=i.colors??{},c=i.maxTemplates??h,u=await ge(t,i.signal),d=ve(u),p=d.height/(u.cy/12700),m=await _e(t,i.signal),g=new Map,_=new Map,v=[];for(let a=0;a<m.length;a++){await w(a,i.signal);let s=m[a],c=e(await f(t,s),n);if(!c)continue;let l=o(r(s),c.target);g.set(s,l),_.has(l)||v.push(l),_.set(l,(_.get(l)??0)+1)}if(i.includeUnused){let e=[],n=0;for(let[r,a]of t.contentTypes.overrides)await w(n++,i.signal),a===`application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml`&&!_.has(r)&&e.push(r);e.sort(),v.push(...e)}let y=new Map,b=[],x=new Set;for(let e=0;e<v.length;e++){await w(e,i.signal);let n=v[e],r=await R(t,n,u,p,s,y,i.signal);if(!r){a.push(`layout ${n} could not be read; its slides import plain`);continue}r.slideCount=_.get(n)??0;let o=se(r.name)||`layout-${e+1}`,c=`pptx-${o}`;for(let e=2;x.has(c);e++)c=`pptx-${o}-${e}`;let l=[],f={hints:s,pxPerPt:p,viewport:d,notes:l},m=he(r,Q(r),f,c);m.kind===`custom`&&x.add(c),b.push({extracted:r,verdict:m,notes:l})}let S=b.filter(e=>e.verdict.kind===`custom`);if(S.length>c){let e=[...S].sort((e,t)=>t.extracted.slideCount-e.extracted.slideCount).slice(c);for(let t=0;t<e.length;t++){await w(t,i.signal);let n=e[t];n.verdict={kind:`plain`},n.notes.push(`dropped: more inferred layouts than the template cap`)}a.push(`deck defines ${S.length} distinctive layouts; kept the ${c} most used as custom templates`)}let C=new Map(b.map(e=>[e.extracted.partPath,e]));return l(i.signal),{slideSize:u,layouts:b,byLayoutPath:C,layoutPathBySlide:g,warnings:a}}async function ye(e,t={}){l(t.signal);let n=await $(await d(e,t),t),r=[];for(let e=0;e<n.layouts.length;e++){await w(e,t.signal);let{extracted:i,verdict:a,notes:o}=n.layouts[e];r.push({layoutPath:i.partPath,name:i.name||`Layout ${e+1}`,...i.masterName?{masterName:i.masterName}:{},...i.typeAttr?{typeAttr:i.typeAttr}:{},slideCount:i.slideCount,verdict:a.kind,...a.kind===`builtin`?{builtinTemplate:a.template}:{},...a.kind===`custom`?{customTemplate:a.def}:{},...o.length>0?{notes:o}:{}})}return{layouts:r,slideSize:n.slideSize}}export{ye as n,$ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{I as e}from"./chunk-UBFT2CDQ-FexGDigd.js";import"./markdown-ryKA_OmY.js";import{a as t}from"./chunk-JU2RHXUB-ClblWDJZ.js";var n=class{constructor(){this.next=new Map}alloc(e=``){let t=this.next.get(e)??1;return this.next.set(e,t+1),`rId${t}`}},r=/^#?([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/,i=/^#?([0-9a-fA-F]{6})$/,a=/^#?([0-9a-fA-F]{6})[0-9a-fA-F]{2}$/;function o(e,t=`000000`){return s(e)||(s(t)??`000000`)}function s(e){if(typeof e!=`string`)return;let t=e.trim(),n=i.exec(t);if(n)return n[1].toUpperCase();let o=a.exec(t);if(o)return o[1].toUpperCase();let s=r.exec(t);if(s){let[,e,t,n]=s;return`${e}${e}${t}${t}${n}${n}`.toUpperCase()}}function c(t,n={}){if(typeof t!=`string`)return null;let r=t.trim();if(!r||l(r))return null;if(r.startsWith(`#`))return/^#[^\s]*$/.test(r)?r:null;if(/^(?:\\\\|\/\/|\/|[a-z]:[\\/])/i.test(r))return null;if(/^[a-z][a-z0-9+.-]*:/i.test(r))return e(r);if(!n.allowRelative||r.includes(`\\`))return null;let i;try{i=decodeURIComponent(r)}catch{return null}return l(i)||i.includes(`\\`)||i.startsWith(`//`)?null:r}function l(e){for(let t of e){let e=t.charCodeAt(0);if(e<=31||e===127)return!0}return!1}function u(e,t,n={}){let r=``;for(let i of e)r+=d(i,t,n);return r}function d(e,n,r){switch(e.type){case`text`:return n.run(e.value,r);case`strong`:return u(e.children,n,{...r,bold:!0});case`emphasis`:return u(e.children,n,{...r,italic:!0});case`delete`:return u(e.children,n,{...r,strike:!0});case`superscript`:return u(e.children,n,{...r,vertAlign:`superscript`});case`subscript`:return u(e.children,n,{...r,vertAlign:`subscript`});case`inlineCode`:return n.run(e.value,{...r,code:!0});case`inlineMath`:return n.run(e.value,{...r,code:!0});case`htmlInline`:return n.run(t(e.rawHtml),r);case`link`:return n.link(e,r);case`image`:return n.image(e,r);case`inlineIcon`:return n.icon(e,r);case`break`:return n.lineBreak();case`footnoteReference`:return n.footnoteRef?n.footnoteRef(e):``;default:return``}}export{c as a,s as i,d as n,o,u as r,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,bmp:`image/bmp`,svg:`image/svg+xml`,tiff:`image/tiff`,tif:`image/tiff`,ico:`image/x-icon`,avif:`image/avif`,emf:`image/emf`,wmf:`image/wmf`,mp3:`audio/mpeg`,wav:`audio/wav`,ogg:`audio/ogg`,mp4:`video/mp4`,webm:`video/webm`,csv:`text/csv`,tsv:`text/tab-separated-values`,xlsx:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,parquet:`application/vnd.apache.parquet`};function t(t){return e[t.replace(/^\./,``).toLowerCase()]??`application/octet-stream`}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as e}from"./doc-Dr5K49bx.js";import"./markdown-ryKA_OmY.js";function t(e,t){return((e??``).split(/[\\/]/).pop()?.trim()??``)||t}function n(e){return e.replace(/\.[^.]+$/,``).normalize(`NFKD`).replace(/\p{Mark}+/gu,``).toLocaleLowerCase(`en-US`).replace(/[^\p{Letter}\p{Number}]+/gu,`-`).replace(/^-+|-+$/g,``)||`document`}function r(r,i){let a=t(r,i),o=n(a);return{slug:o,markdownFilename:`${o}.md`,fileName:a,sidecarPath:`${e(o)}${a}`}}function i(e){return{type:`document`,children:[{type:`heading`,depth:1,children:[{type:`text`,value:e.fileName.replace(/\.[^.]+$/,``)}],templateAnnotation:{template:`dataTable`,params:{src:e.sidecarPath}}},{type:`paragraph`,children:[{type:`link`,url:e.sidecarPath,children:[{type:`text`,value:e.fileName}]}]}]}}export{i,r as n,t as r,n as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{y as e}from"./doc-Dr5K49bx.js";import{t}from"./preload-helper-Czpn1I53.js";import{a as n,t as r}from"./chunk-Q77KNJIN-BIDRf0aP.js";import{d as i,g as a,o}from"./chunk-OBADJV7C-CDVOcmYt.js";import{i as s,n as c}from"./table-fcouR4db.js";function l(e,t,n){if(!n.sort&&!n.filter)return{body:t};let{view:r,issues:i}=s(n.sort,n.filter,e),a=c(e,t,r),o=a.rows.length!==a.unfilteredRowCount;return{body:a.rows,...o?{unfilteredTotalRows:a.unfilteredRowCount}:{},...i.length>0?{viewIssues:i}:{}}}function u(e,t){let n=e.reduce((e,t)=>Math.max(e,t.length),0),r=e=>e.length===n?e:[...e,...Array(n-e.length).fill(``)],i=t.headerRow!==!1,a=i&&e.length>0?r(e[0]):Array.from({length:n},(e,t)=>o(t)),{body:s,unfilteredTotalRows:c,viewIssues:u}=l(a,(i?e.slice(1):e).map(r),t);return{headers:a,rows:s.slice(0,t.maxRows),totalRows:s.length,totalCols:n,...c===void 0?{}:{unfilteredTotalRows:c},...u?{viewIssues:u}:{}}}var d={extensions:[`csv`,`tsv`],async read(e,t){let i=new TextDecoder().decode(e),a=i.slice(0,i.indexOf(`
|
|
2
|
+
`)+1||i.length);return u(n(i,a.includes(` `)&&!a.includes(`,`)?` `:`,`,r),t)}};function f(e){let t=i(e.anchor);if(!t)return null;let n=e.rows.length+ +!!e.hasHeader;return{top:t.row,left:t.col,bottom:t.row+Math.max(n-1,0),right:t.col+Math.max(e.columns.length-1,0)}}function p(e,t){if(e.length===0)return null;if(t){let n=e.find(e=>e.anchor.toUpperCase()===t.toUpperCase());if(n)return n;let r=i(t);if(r){let t=e.find(e=>{let t=f(e);return!!t&&r.row>=t.top&&r.row<=t.bottom&&r.col>=t.left&&r.col<=t.right});if(t)return t}}return e.reduce((e,t)=>t.rows.length*t.columns.length>e.rows.length*e.columns.length?t:e)}function m(e){return e===null?``:typeof e==`string`?e:String(e)}var h={extensions:[`xlsx`],async read(e,t){let n=await a(e,{...t.sheet===void 0?{}:{sheet:t.sheet}});if(t.sheet!==void 0&&n.length===0)throw Error(`worksheet "${t.sheet}" not found or holds no tabular data`);let r=p(n,t.anchor);if(!r)throw Error(`no tabular data found in workbook`);let s=i(r.anchor),c=t.headerRow===!1&&r.hasHeader,u=c?r.columns.map((e,t)=>o((s?.col??0)+t)):r.columns.map(e=>e.name),{body:d,unfilteredTotalRows:f,viewIssues:h}=l(u,c?[r.columns.map(e=>e.name),...r.rows.map(e=>e.map(m))]:r.rows.map(e=>e.map(m)),t);return{headers:u,rows:d.slice(0,t.maxRows),totalRows:d.length,totalCols:r.columns.length,...f===void 0?{}:{unfilteredTotalRows:f},...h?{viewIssues:h}:{}}}},g={extensions:[`parquet`],async read(e,n){let r;try{r=await t(()=>import(`./squisq-formats-aAdypXoy.js`),[])}catch{throw Error(`parquet support is not installed (missing optional dependency "hyparquet")`)}let i=e instanceof ArrayBuffer?e:new Uint8Array(e).slice().buffer,a=r.parquetMetadata(i),o=Number(a.num_rows),s=r.parquetSchema(a).children.map(e=>e.element.name),c=!!(n.sort||n.filter),u=[];await r.parquetRead({file:i,metadata:a,rowStart:0,rowEnd:c?o:Math.min(n.maxRows,o),onComplete(e){for(let t of e)u.push(t.map(e=>e==null?``:String(e)))}});let{body:d,unfilteredTotalRows:f,viewIssues:p}=l(s,u,n);return{headers:s,rows:d.slice(0,n.maxRows),totalRows:c?d.length:o,totalCols:s.length,...f===void 0?{}:{unfilteredTotalRows:f},...p?{viewIssues:p}:{}}}};function _(){return[d,h,g]}function v(e){return{type:`tableRow`,children:e.map(e=>({type:`tableCell`,children:e?[{type:`text`,value:e}]:[]}))}}function y(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n>0?t.slice(n+1).toLowerCase():``}async function b(t,n,r){let i=_(),a=[],o=!1;for(let s of t.children){if(a.push(s),s.type!==`heading`)continue;let t=s.templateAnnotation?.params,c=t?.src;if(!c||!e(c))continue;let l=t?.sheet&&t?.anchor?`${t.sheet}!${t.anchor}`:c;if(!n){r?.(`Data reference "${c}" could not be embedded: the export has no source container to read it from.`);continue}let u=y(c),d=i.find(e=>e.extensions.includes(u));if(!d){r?.(`Data reference "${c}" could not be embedded: no reader for ".${u}".`);continue}let f=null;try{f=await n.readFile(c)}catch{f=null}if(!f){r?.(`Data reference "${c}" could not be embedded: file not found in container.`);continue}try{let e=await d.read(f,{maxRows:1/0,...t?.sheet?{sheet:t.sheet}:{},...t?.anchor?{anchor:t.anchor}:{},...t?.headerRow===void 0?{}:{headerRow:t.headerRow!==`false`},...t?.sort?{sort:t.sort}:{},...t?.filter?{filter:t.filter}:{}}),n={type:`table`,children:[v(e.headers),...e.rows.map(v)]};a.push(n),o=!0,u===`xlsx`&&r?.(`Region ${l} exported as values; formulas in the sidecar workbook were not carried over.`)}catch(e){r?.(`Data reference "${c}" could not be embedded: ${e instanceof Error?e.message:String(e)}`)}}return o?{...t,children:a}:t}export{h as a,g as i,_ as n,b as r,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e}from"./index-C0DYtvfg.js";import"./storage-D8pE2zg0.js";async function t(t,n){let r=new e;await r.writeDocument(t);for(let[e,{data:t,mimeType:i}]of n)await r.writeFile(e,new Uint8Array(t),i);return r}export{t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./jszip.min-DhiFe-R7.js";import{n}from"./chunk-7AWFHP5U-MiVVPFTx.js";import{
|
|
2
|
-
`)}function v(e){let t=[
|
|
3
|
-
`)}function y(e){let t=[
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./jszip.min-DhiFe-R7.js";import{n}from"./chunk-7AWFHP5U-MiVVPFTx.js";import{A as r,C as i,N as a,P as o,S as s,_ as c,t as l,w as u,x as d}from"./chunk-S5PCVMKU-Df5XzhSE.js";import{n as f,t as p}from"./chunk-JU2RHXUB-ClblWDJZ.js";var m=e(t(),1);function h(){let e=[],t=[],r;return{addPart(t,r,i){n(t),e.push({path:t,content:r,contentType:i})},addBinaryPart(t,r,i){n(t),e.push({path:t,binaryContent:r,contentType:i})},addRelationship(e,r){e&&n(e),t.push({sourcePart:e,relationship:r})},setCoreProperties(e){r=e},async toBlob(){return g(e,t,r).generateAsync({type:`blob`})},async toArrayBuffer(){return g(e,t,r).generateAsync({type:`arraybuffer`})}}}function g(e,t,n){let r=new m.default,i=t.slice();for(let t of e)t.content===void 0?t.binaryContent!==void 0&&r.file(t.path,t.binaryContent):r.file(t.path,t.content);if(n){let e=y(n);if(r.file(`docProps/core.xml`,e),!i.some(({sourcePart:e,relationship:t})=>e===``&&t.type===`http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties`)){let e=new Set(i.map(({relationship:e})=>e.id)),t=100;for(;e.has(`rId${t}`);)t++;i.push({sourcePart:``,relationship:{id:`rId${t}`,type:o,target:`docProps/core.xml`}})}}r.file(`[Content_Types].xml`,_(e,n));let a=S(i);for(let[e,t]of a){let n=e===``?`_rels/.rels`:x(e);r.file(n,v(t))}return r}function _(e,t){let n=[f()];n.push(`<Types xmlns="${d}">`);let r=new Map;r.set(`rels`,c),r.set(`xml`,`application/xml`);for(let t of e)if(t.binaryContent!==void 0){let e=b(t.path);e&&!r.has(e)&&r.set(e,t.contentType)}for(let[e,t]of r)n.push(` <Default Extension="${p(e)}" ContentType="${p(t)}"/>`);for(let t of e)t.content!==void 0&&n.push(` <Override PartName="/${p(t.path)}" ContentType="${p(t.contentType)}"/>`);return t&&n.push(` <Override PartName="/docProps/core.xml" ContentType="${l}"/>`),n.push(`</Types>`),n.join(`
|
|
2
|
+
`)}function v(e){let t=[f()];t.push(`<Relationships xmlns="${r}">`);for(let n of e){let e=[`Id="${p(n.id)}"`,`Type="${p(n.type)}"`,`Target="${p(n.target)}"`];n.targetMode&&e.push(`TargetMode="${p(n.targetMode)}"`),t.push(` <Relationship ${e.join(` `)}/>`)}return t.push(`</Relationships>`),t.join(`
|
|
3
|
+
`)}function y(e){let t=[f()];return t.push(`<cp:coreProperties xmlns:cp="${s}" xmlns:dc="${i}" xmlns:dcterms="${u}" xmlns:xsi="${a}">`),e.title&&t.push(` <dc:title>${p(e.title)}</dc:title>`),e.subject&&t.push(` <dc:subject>${p(e.subject)}</dc:subject>`),e.creator&&t.push(` <dc:creator>${p(e.creator)}</dc:creator>`),e.description&&t.push(` <dc:description>${p(e.description)}</dc:description>`),e.keywords&&t.push(` <cp:keywords>${p(e.keywords)}</cp:keywords>`),e.lastModifiedBy&&t.push(` <cp:lastModifiedBy>${p(e.lastModifiedBy)}</cp:lastModifiedBy>`),e.revision&&t.push(` <cp:revision>${p(e.revision)}</cp:revision>`),e.created&&t.push(` <dcterms:created xsi:type="dcterms:W3CDTF">${p(e.created)}</dcterms:created>`),e.modified&&t.push(` <dcterms:modified xsi:type="dcterms:W3CDTF">${p(e.modified)}</dcterms:modified>`),t.push(`</cp:coreProperties>`),t.join(`
|
|
4
4
|
`)}function b(e){let t=e.lastIndexOf(`.`);if(t!==-1)return e.substring(t+1).toLowerCase()}function x(e){let t=e.lastIndexOf(`/`);return t===-1?`_rels/${e}.rels`:`${e.substring(0,t)}/_rels/${e.substring(t+1)}.rels`}function S(e){let t=new Map;for(let{sourcePart:n,relationship:r}of e){let e=t.get(n);e||(e=[],t.set(n,e)),e.push(r)}return t}export{h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as e}from"./markdown-ryKA_OmY.js";import{I as t}from"./index-C0DYtvfg.js";import"./storage-D8pE2zg0.js";import{n}from"./chunk-DXYWKZ52-BXcAlClu.js";import{Q as r,it as i,j as a,k as o,nt as s,rt as c,tt as l}from"./chunk-S5PCVMKU-Df5XzhSE.js";var u=16383,d=1048575,f=Object.freeze({text:``,kind:`empty`});function p(e){return e.text!==``||e.formula!==void 0}function m(e){let t=e+1,n=``;for(;t>0;){let e=(t-1)%26;n=String.fromCharCode(65+e)+n,t=Math.floor((t-1)/26)}return n}function h(e){let t=0;for(let n of e.toUpperCase())t=t*26+(n.charCodeAt(0)-64);return t-1}function g(e){let t=/^\$?([A-Za-z]+)/.exec(e);return t?h(t[1]):0}function _(e){let t=/^\$?([A-Za-z]{1,3})\$?([0-9]{1,7})$/.exec(e.trim());if(!t)return null;let n=h(t[1]),r=Number.parseInt(t[2],10)-1;return!Number.isFinite(r)||r<0||r>1048575||n<0||n>16383?null:{row:r,col:n}}function v(e,t){return`${m(t)}${e+1}`}function y(e){let t=e.split(`:`);if(t.length>2)return null;let n=_(t[0]??``);if(!n)return null;let r=t.length===2?_(t[1]):n;return r?{top:Math.min(n.row,r.row),left:Math.min(n.col,r.col),bottom:Math.max(n.row,r.row),right:Math.max(n.col,r.col)}:null}var b=/(\$?)([A-Za-z]{1,3})(\$?)([0-9]{1,7})/y,x=/[A-Za-z0-9_.]/;function S(e,t,n){if(t===0&&n===0)return e;let r=``,i=0;for(;i<e.length;){let a=e[i];if(a===`"`){let t=i;for(i++;i<e.length;)if(e[i]===`"`)if(e[i+1]===`"`)i+=2;else{i++;break}else i++;r+=e.slice(t,i);continue}if(a===`'`){let t=i;for(i++;i<e.length;)if(e[i]===`'`)if(e[i+1]===`'`)i+=2;else{i++;break}else i++;r+=e.slice(t,i);continue}if(a===`[`){let t=i,n=0;for(;i<e.length;){if(e[i]===`[`)n++;else if(e[i]===`]`&&(n--,n===0)){i++;break}i++}r+=e.slice(t,i);continue}b.lastIndex=i;let o=b.exec(e);if(o){let a=i>0?e[i-1]:``,s=e[i+o[0].length]??``,c=h(o[2]),l=Number.parseInt(o[4],10)-1;if(!x.test(a)&&!x.test(s)&&s!==`(`&&c<=16383&&l>=0&&l<=1048575){let e=o[1]===`$`?c:c+n,a=o[3]===`$`?l:l+t;e<0||e>16383||a<0||a>1048575?r+=`#REF!`:r+=`${o[1]}${m(e)}${o[3]}${a+1}`,i+=o[0].length;continue}}r+=a,i++}return r}var ee=64,te=2e3,C=2,ne=4e6,re=8;function w(e){e?.throwIfAborted()}function ie(e,t){return e.left<=t.right&&t.left<=e.right&&e.top<=t.bottom&&t.top<=e.bottom}function ae(e,t){return{top:Math.min(e.top,t.top),left:Math.min(e.left,t.left),bottom:Math.max(e.bottom,t.bottom),right:Math.max(e.right,t.right)}}function T(e){return(e.bottom-e.top+1)*(e.right-e.left+1)}function oe(e,t,n){let r=[];for(let i=t.top;i<=t.bottom;i++){let a=e[i]??[],o=[];for(let e=t.left;e<=t.right;e++)o.push(a[e]??n);r.push(o)}return r}function E(e,t=[],n={}){let r=n.signal,i=n.maxRegionsPerSheet??ee,a=n.maxRegionCandidates??te,o=n.minRegionCells??C,s=n.maxMaskCells??ne,c=[],l=e.length,u=0;for(let t of e)u=Math.max(u,t.length);if(l===0||u===0)return{regions:[],strays:[],warnings:c,degraded:!1};if(l*u>s)return c.push(`Used range spans ${l}\xD7${u} cells, past the ${s}-cell detection limit; imported as a single grid instead.`),{regions:[],strays:[],warnings:c,degraded:!0};let d=new Uint8Array(l*u);for(let t=0;t<l;t++){w(r);let n=e[t];for(let e=0;e<n.length;e++)p(n[e])&&(d[t*u+e]=1)}for(let n of t){let t=e[n.top]?.[n.left];if(!t||!p(t))continue;let r=Math.min(n.bottom,l-1),i=Math.min(n.right,u-1);for(let e=Math.max(0,n.top);e<=r;e++)for(let t=Math.max(0,n.left);t<=i;t++)d[e*u+t]=1}let f=new Uint8Array(l*u),m=[],h=[];for(let e=0;e<l;e++){w(r);for(let t=0;t<u;t++){let n=e*u+t;if(d[n]===0||f[n]===1)continue;if(m.length>=a)return c.push(`Sheet has more than ${a} data islands; imported as a single grid instead.`),{regions:[],strays:[],warnings:c,degraded:!0};f[n]=1,h.length=0,h.push(n);let r=e,i=e,o=t,s=t;for(;h.length>0;){let e=h.pop(),t=e/u|0,n=e-t*u;t<r&&(r=t),t>i&&(i=t),n<o&&(o=n),n>s&&(s=n);for(let e=-1;e<=1;e++){let r=t+e;if(!(r<0||r>=l))for(let e=-1;e<=1;e++){let t=n+e;if(t<0||t>=u)continue;let i=r*u+t;d[i]===0||f[i]===1||(f[i]=1,h.push(i))}}}m.push({top:r,left:o,bottom:i,right:s})}}for(let e=0;e<re;e++){w(r);let e=[],t=!1;for(let n of m){let r=n,i=-1;for(let n=0;n<e.length;n++)ie(e[n],r)&&(r=ae(e[n],r),i<0?(i=n,e[n]=r):(e[i]=r,e.splice(n,1),n--),t=!0);i<0&&e.push(r)}if(m=e,!t)break}m.sort((e,t)=>e.top-t.top||e.left-t.left);let g=new Map,_=new Set;for(let t=0;t<m.length;t++){let n=m[t];if(!(_.has(t)||T(n)<o))for(let r=0;r<m.length;r++){if(r===t||_.has(r)||g.has(t))continue;let i=m[r];if(i.top!==i.bottom||i.bottom>=n.top||n.top-i.bottom>2||i.left<n.left||i.right>n.right)continue;let a=D(e,i);a!==null&&(g.set(t,a),_.add(r))}}let v=[],y=[];for(let t=0;t<m.length;t++){if(_.has(t))continue;let n=m[t];if(T(n)<o){y.push(n);continue}if(v.length>=i){y.push(n);continue}let r=g.get(t);if(r===void 0){let t=se(e,n);t&&(r=t.caption,n=t.rect)}v.push(r===void 0?{rect:n}:{rect:n,title:r.text,titleCell:{row:r.row,col:r.col}})}let b=m.filter((e,t)=>!_.has(t)&&T(e)>=o).length;b>i&&c.push(`Sheet has ${b} data islands; the first ${i} became tables and the rest were folded into the loose-cells table.`);let x=[];for(let t of y)for(let n=t.top;n<=t.bottom;n++)for(let r=t.left;r<=t.right;r++){let t=e[n]?.[r];t&&p(t)&&x.push({row:n,col:r,cell:t})}return x.sort((e,t)=>e.row-t.row||e.col-t.col),{regions:v,strays:x,warnings:c,degraded:!1}}function D(e,t){let n=null;for(let r=t.top;r<=t.bottom;r++)for(let i=t.left;i<=t.right;i++){let t=e[r]?.[i];if(!(!t||t.text===``)){if(n!==null)return null;n={text:t.text,row:r,col:i}}}return n}function se(e,t){if(t.bottom-t.top<2)return null;let n=D(e,{...t,bottom:t.top});if(n===null)return null;let r=0;for(let n=t.left;n<=t.right;n++)(e[t.top+1]?.[n]?.text??``)!==``&&r++;return r<2?null:{caption:n,rect:{...t,top:t.top+1}}}function O(e){let t=e,n=``;do n=String.fromCharCode(65+t%26)+n,t=Math.floor(t/26)-1;while(t>=0);return n}function ce(e,t){return`${O(t)}${e+1}`}function le(e){if(e.length<2)return!1;let t=e[0];return!t||t.length===0?!1:t.every(e=>e.kind===`string`)}function ue(e){return e.kind===`empty`||e.kind===`error`?null:e.value===void 0?e.text===``?null:e.text:e.value}function de(e){let t=new Map,n=0;for(let r of e)r!==`empty`&&(t.set(r,(t.get(r)??0)+1),n+=1);if(n===0)return`empty`;let r=`string`,i=0;for(let[e,n]of t)n>i&&(r=e,i=n);return i*2>n?r:`mixed`}function fe(e,t){let n=[];for(let r=t.top;r<=t.bottom;r++){let i=[];for(let n=t.left;n<=t.right;n++)i.push(e[r]?.[n]??{text:``,kind:`empty`});n.push(i)}return n}function k(e,t,n,r,i){let a=fe(t,n);if(a.length===0)return null;let o=le(a),s=o?a.slice(1):a;if(s.length<i||!s.some(e=>e.some(p)))return null;let c=a.reduce((e,t)=>Math.max(e,t.length),0),l=[];for(let e=0;e<c;e++){let t=o?a[0]?.[e]?.text??``:``;l.push({name:t.trim()||O(n.left+e),kind:de(s.map(t=>t[e]?.kind??`empty`))})}return{sheet:e,anchor:ce(n.top,n.left),...r?{title:r}:{},columns:l,hasHeader:o,rows:s.map(e=>Array.from({length:c},(t,n)=>ue(e[n]??{text:``,kind:`empty`})))}}function A(e,t,n=[],r={}){if(t.length===0)return[];let i=r.minRows??1,a=E(t,n,{...r.maxRegionsPerSheet===void 0?{}:{maxRegionsPerSheet:r.maxRegionsPerSheet},...r.minRegionCells===void 0?{}:{minRegionCells:r.minRegionCells},...r.signal?{signal:r.signal}:{}});if(a.degraded||a.regions.length===0){let n=k(e,t,{top:0,left:0,bottom:t.length-1,right:t.reduce((e,t)=>Math.max(e,t.length),1)-1},void 0,i);return n?[n]:[]}let o=[];for(let n of a.regions){let r=k(e,t,n.rect,n.title,i);r&&o.push(r)}return o}var j=`xl/workbook.xml`;function pe(e,t,n,r){return e.getAttributeNS(t,n)??e.getAttribute(r)}function me(e,t){if(t.startsWith(`/`))return t.replace(/^\//,``);let n=e?e.split(`/`):[];for(let e of t.split(`/`))e===`..`?n.pop():e!==`.`&&n.push(e);return n.join(`/`)}async function M(e,t){let n=await s(e,t);if(!n)throw Error(`Invalid XLSX package: workbook part "${t}" could not be parsed.`);let i=await l(e,t),c=new Map(i.map(e=>[e.id,e.target])),u=[],d=n.getElementsByTagNameNS(a,`sheet`);for(let e=0;e<d.length;e++){let n=d[e],i=n.getAttribute(`name`)??`Sheet${e+1}`,a=pe(n,o,`id`,`r:id`),s=a?c.get(a):void 0;s&&u.push({name:i,path:me(r(t),s)})}return u}async function N(e,t){let n=await s(e,t);if(!n)throw Error(`Invalid XLSX package: workbook part "${t}" could not be parsed.`);let r=await M(e,t),i=n.getElementsByTagNameNS(a,`workbookPr`)[0]?.getAttribute(`date1904`),o=n.getElementsByTagNameNS(a,`calcPr`)[0]?.getAttribute(`fullCalcOnLoad`);return{sheets:r,date1904:i===`1`||i===`true`,fullCalcOnLoad:o===`1`||o===`true`}}function he(e,t){for(let n=e.parentNode;n&&n!==t;n=n.parentNode){if(n.nodeType!==1)continue;let e=n;if(e.localName===`rPh`&&e.namespaceURI===`http://schemas.openxmlformats.org/spreadsheetml/2006/main`)return!0}return!1}function ge(e){let t=e.getElementsByTagNameNS(a,`rPr`)[0];if(!t)return null;let n=t.getElementsByTagNameNS(a,`vertAlign`)[0]?.getAttribute(`val`);return n===`superscript`||n===`subscript`?n:null}function P(e){let t=e.getElementsByTagNameNS(a,`t`),n=[],r=``,i=!1;for(let a=0;a<t.length;a++){let o=t[a];if(he(o,e))continue;let s=o.textContent??``;if(s===``)continue;r+=s;let c=o.parentNode,l=c&&c.localName===`r`?c:null,u=l?ge(l):null;u?(i=!0,n.push({type:u,children:[{type:`text`,value:s}]})):n.push({type:`text`,value:s})}return i?{text:r,rich:F(n)}:{text:r}}function F(e){let t=[];for(let n of e){let e=t[t.length-1];n.type===`text`&&e?.type===`text`?e.value+=n.value:t.push(n)}return t}async function I(e){let t=await s(e,`xl/sharedStrings.xml`);if(!t)return[];let n=t.getElementsByTagNameNS(a,`si`),r=[];for(let e=0;e<n.length;e++)r.push(P(n[e]));return r}var L=Object.freeze({9:`0%`,10:`0.00%`,14:`mm-dd-yy`,15:`d-mmm-yy`,16:`d-mmm`,17:`mmm-yy`,18:`h:mm AM/PM`,19:`h:mm:ss AM/PM`,20:`h:mm`,21:`h:mm:ss`,22:`m/d/yy h:mm`,45:`mm:ss`,46:`[h]:mm:ss`,47:`mmss.0`});async function R(e){let t=await s(e,`xl/styles.xml`);if(!t)return[];let n=new Map,r=t.getElementsByTagNameNS(a,`numFmt`);for(let e=0;e<r.length;e++){let t=r[e],i=Number.parseInt(t.getAttribute(`numFmtId`)??``,10),a=t.getAttribute(`formatCode`);Number.isFinite(i)&&a&&n.set(i,a)}let i=t.getElementsByTagNameNS(a,`cellXfs`)[0];if(!i)return[];let o=i.getElementsByTagNameNS(a,`xf`),c=[];for(let e=0;e<o.length;e++){let t=Number.parseInt(o[e].getAttribute(`numFmtId`)??`0`,10);c.push({numFmtId:t,formatCode:n.get(t)??L[t]??`General`})}return c}function z(e){return e.split(`;`,1)[0].replace(/"(?:[^"]|"")*"/g,``).replace(/\\./g,``).replace(/[_*]./g,``).replace(/\[(?!h+\]|m+\]|s+\])[^\]]*\]/gi,``).toLowerCase()}function B(e){let t=z(e);if(t===`general`)return`general`;if(t.includes(`%`))return`percent`;if(/^0+$/.test(t))return`zero-pad`;let n=/[yd]/.test(t),r=/[hs]|\[[hms]+\]/.test(t);return n&&r?`datetime`:n?`date`:r?`time`:`general`}function V(e){return String(e).padStart(2,`0`)}function H(e,t){let n=Math.floor(e);if(!t&&n===60)return`1900-02-29`;let r=t?Date.UTC(1904,0,1):Date.UTC(1899,11,31),i=!t&&n>60?n-1:n,a=new Date(r+i*864e5);return Number.isFinite(a.getTime())?`${a.getUTCFullYear()}-${V(a.getUTCMonth()+1)}-${V(a.getUTCDate())}`:null}function U(e,t,n){let r=Math.round((e-Math.floor(e))*86400),i=n?Math.floor(e*24):Math.floor(r/3600)%24,a=Math.floor(r/60)%60,o=r%60;return`${V(i)}:${V(a)}${t?`:${V(o)}`:``}`}function W(e,t,n,r){if(!Number.isFinite(e))return null;let i=n?z(n.formatCode):``;if(t===`time`)return U(e,/s/.test(i),/\[[h]+\]/.test(i));let a=H(e,r);return a?t===`datetime`?`${a} ${U(e,/s/.test(i),!1)}`:a:null}function _e(e,t,n){if(!t)return e;let r=Number(e);if(!Number.isFinite(r))return e;let i=z(t.formatCode),a=B(t.formatCode);if(a===`date`)return H(r,n)??e;if(a===`time`)return U(r,/s/.test(i),/\[[h]+\]/.test(i));if(a===`datetime`){let t=H(r,n);return t?`${t} ${U(r,/s/.test(i),!1)}`:e}if(a===`percent`){let e=/0\.(0+)%/.exec(i)?.[1]?.length??0;return`${(r*100).toFixed(e)}%`}if(a===`zero-pad`&&Number.isInteger(r)){let e=i.length;return`${r<0?`-`:``}${String(Math.abs(r)).padStart(e,`0`)}`}return e}function ve(e,t,n,r){let i=e.getElementsByTagNameNS(a,`f`),o=i.length?i[0]:null;if(!o)return{text:``};let s=(o.textContent??``).trim();if(o.getAttribute(`t`)!==`shared`)return{text:s};let c=o.getAttribute(`si`);if(c===null)return{text:s};if(s!==``)return r.sharedFormulas.set(c,{text:s,row:t,col:n}),{text:s,sharedRole:`master`};let l=r.sharedFormulas.get(c);if(!l)return{text:``,sharedRole:`follower`};try{return{text:S(l.text,t-l.row,n-l.col),sharedRole:`follower`}}catch{return{text:``,sharedRole:`follower`}}}function ye(e,t,n,r){let{text:i,sharedRole:o}=ve(e,t,n,r),s=(e,t,n)=>{let r={text:e,kind:e===``?`empty`:t};return i!==``&&(r.formula=i),o!==void 0&&(r.sharedFormulaRole=o),n!==void 0&&r.kind!==`empty`&&(r.value=n),r},c=e=>{let t=s(e.text,`string`,e.text);return e.rich&&t.kind!==`empty`&&(t.richText=e.rich),t},l=e.getAttribute(`t`);if(l===`inlineStr`){let t=e.getElementsByTagNameNS(a,`is`)[0];return c(t?P(t):{text:``})}let u=e.getElementsByTagNameNS(a,`v`),d=u.length?u[0].textContent??``:``;if(d===``)return s(``,`empty`);if(l===`s`)return c(r.shared[Number.parseInt(d,10)]??{text:``});if(l===`b`)return s(d===`1`?`TRUE`:`FALSE`,`bool`,d===`1`);if(l===`e`)return s(d,`error`);if(l===`str`)return s(d,`string`,d);let f=r.styles[Number.parseInt(e.getAttribute(`s`)??`0`,10)],p=_e(d,f,r.date1904),m=f?B(f.formatCode):`general`,h=m===`date`||m===`time`||m===`datetime`?`date`:`number`,g=Number(d);return h===`date`?s(p,h,W(g,m,f,r.date1904)??p):s(p,h,Number.isFinite(g)?g:d)}async function G(e,t,n,r,i){let o=await s(e,t);if(!o)return{cells:[],merges:[]};let c={shared:n,styles:r,date1904:i,sharedFormulas:new Map},l=o.getElementsByTagNameNS(a,`row`),u=new Map,d=-1,m=0;for(let e=0;e<l.length;e++){let t=l[e],n=Number.parseInt(t.getAttribute(`r`)??``,10),r=Number.isFinite(n)&&n>0?n-1:m;m=r+1;let i=t.getElementsByTagNameNS(a,`c`),o=[];for(let e=0;e<i.length;e++){let t=i[e],n=t.getAttribute(`r`),a=n?g(n):o.length;for(;o.length<a;)o.push(f);o[a]=ye(t,r,a,c)}u.set(r,o),o.some(p)&&(d=Math.max(d,r))}let h=[];for(let e=0;e<=d;e++)h.push(u.get(e)??[]);let _=[],v=o.getElementsByTagNameNS(a,`mergeCell`);for(let e=0;e<v.length;e++){let t=y(v[e].getAttribute(`ref`)??``);t&&_.push(t)}return{cells:h,merges:_}}function K(e){let t=e.reduce((e,t)=>Math.max(e,t.length),1);return{type:`table`,children:e.map((e,n)=>{let r=[];for(let i=0;i<t;i++)r.push({type:`tableCell`,...n===0?{isHeader:!0}:{},children:e[i]??[]});return{type:`tableRow`,children:r}})}}function be(e){return K(e.map(e=>e.map(e=>e?[{type:`text`,value:e}]:[])))}function q(e){return K(e.map(e=>e.map(J)))}function xe(e){if(e.length<2)return!1;let t=e[0];return t.length!==0&&t.every(e=>e.kind===`string`)}function Se(e,t){if(!e.some(e=>e.some(e=>e.formula)))return null;let n=[];for(let e=t.left;e<=t.right;e++)n.push(m(e));return be([n,...e.map(e=>e.map(e=>e.formula?`=${e.formula}`:``))])}function J(e){return e.richText??(e.text?[{type:`text`,value:e.text}]:[])}function Y(e){return e?[{type:`text`,value:e}]:[]}function Ce(e){let t=e.some(e=>e.cell.formula),n=t?[`Cell`,`Value`,`Formula`]:[`Cell`,`Value`],r=e.map(e=>{let n=Y(v(e.row,e.col)),r=J(e.cell);return t?[n,r,Y(e.cell.formula?`=${e.cell.formula}`:``)]:[n,r]});return K([n.map(Y),...r])}function X(e,t,n){return{type:`heading`,depth:e,children:[{type:`text`,value:t}],templateAnnotation:{template:`dataTable`,params:n}}}async function we(e,t={}){let n=await c(e,t),r=i(n,j,`XLSX`),[{sheets:a,date1904:o},s,l]=await Promise.all([N(n,r),I(n),R(n)]),u=a;if(t.sheet!==void 0){let e=typeof t.sheet==`number`?a[t.sheet]:a.find(e=>e.name===t.sheet);u=e?[e]:[]}let d=[];for(let e of u){let{cells:r,merges:i}=await G(n,e.path,s,l,o);d.push(...A(e.name,r,i,t))}return d}async function Te(e,t={}){let n=await c(e,t),r=i(n,j,`XLSX`),[{sheets:a,date1904:o,fullCalcOnLoad:s},l,u]=await Promise.all([N(n,r),I(n),R(n)]),d=a;if(t.sheet!==void 0){let e=typeof t.sheet==`number`?a[t.sheet]:a.find(e=>e.name===t.sheet);d=e?[e]:[]}let f=[];for(let e of d){let{cells:t,merges:r}=await G(n,e.path,l,u,o);f.push({name:e.name,cells:t,merges:r})}return{sheets:f,date1904:o,fullCalcOnLoad:s}}async function Ee(e,t={}){return $(e,t,void 0)}function De(e,t,n){if(e.mode===`always`)return!0;let r=t.bottom-t.top+1,i=t.right-t.left+1;return r-+!!n>e.maxInlineRows||r*i>e.maxInlineCells}function Z(e,t){if(e.mode===`always`)return!0;let n=t.reduce((e,t)=>Math.max(e,t.length),0);return t.length-1>e.maxInlineRows||t.length*n>e.maxInlineCells}function Q(e){return{type:`paragraph`,children:[{type:`link`,url:e.src,children:[{type:`text`,value:e.fileName}]}]}}async function $(e,t,n){let r=await c(e,t),a=i(r,j,`XLSX`),[{sheets:o,date1904:s},l,u]=await Promise.all([N(r,a),I(r),R(r)]),d=o;if(t.sheet!==void 0){let e=typeof t.sheet==`number`?o[t.sheet]:o.find(e=>e.name===t.sheet);d=e?[e]:[]}let p=[],m=d.length===1&&t.sheet!==void 0,h=t.regions!==!1,g=t.formulas!==!1;for(let e of d){let{cells:i,merges:a}=await G(r,e.path,l,u,s);if(m||p.push({type:`heading`,depth:1,children:[{type:`text`,value:e.name}]}),i.length===0)continue;if(!h){if(n&&Z(n,i)){p.push(X(m?1:2,e.name,{src:n.src,sheet:e.name}),Q(n)),n.used=!0;continue}p.push(q(i));continue}let o=E(i,a,{...t.maxRegionsPerSheet===void 0?{}:{maxRegionsPerSheet:t.maxRegionsPerSheet},...t.minRegionCells===void 0?{}:{minRegionCells:t.minRegionCells},...t.signal?{signal:t.signal}:{}});for(let t of o.warnings)console.warn(`XLSX import: ${e.name}: ${t}`);if(o.degraded||o.regions.length===0&&o.strays.length===0){if(n&&Z(n,i)){p.push(X(m?1:2,e.name,{src:n.src,sheet:e.name}),Q(n)),n.used=!0;continue}p.push(q(i));continue}let c=m?1:2;for(let t of o.regions){let r=oe(i,t.rect,f),a=v(t.rect.top,t.rect.left),o=t.title??`${e.name} \u2014 ${a}`,s=xe(r);if(n&&De(n,t.rect,s)){p.push(X(c,o,{src:n.src,sheet:e.name,anchor:a,...s?{}:{headerRow:`false`},...t.titleCell?{titleAnchor:v(t.titleCell.row,t.titleCell.col)}:{}}),Q(n)),n.used=!0;continue}if(p.push(X(c,o,{sheet:e.name,anchor:a,...s?{}:{headerRow:`false`},...t.titleCell?{titleAnchor:v(t.titleCell.row,t.titleCell.col)}:{}}),q(r)),!g)continue;let l=Se(r,t.rect);l&&p.push(X(c,`${o} \u2014 formulas`,{sheet:e.name,anchor:a,role:`formulas`}),l)}o.strays.length>0&&p.push(X(c,`${e.name} \u2014 loose cells`,{sheet:e.name,role:`loose`}),Ce(o.strays))}return{type:`document`,children:p}}var Oe=`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`;async function ke(r,i={}){let a=n(i.sourceName,`workbook.xlsx`),o=i.sidecar??`auto`,s=o===`never`?void 0:{src:a.sidecarPath,fileName:a.fileName,mode:o,maxInlineRows:i.maxInlineRows??100,maxInlineCells:i.maxInlineCells??2e3,used:!1},c=await $(r,i,s),l=new t;if(await l.writeDocument(e(c),a.markdownFilename),s?.used){let e=r instanceof Blob?await r.arrayBuffer():r;await l.writeFile(a.sidecarPath,e,Oe)}return l}export{m as a,A as c,_ as d,R as f,we as g,Ee as h,h as i,M as l,ke as m,d as n,O as o,Te as p,g as r,v as s,u as t,B as u};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import"./doc-Dr5K49bx.js";import{l as e}from"./markdown-ryKA_OmY.js";import{I as t}from"./index-C0DYtvfg.js";import"./storage-D8pE2zg0.js";import{i as n,n as r}from"./chunk-DXYWKZ52-BXcAlClu.js";var i=1e5,a=1e4,o=1024*1024,s=Object.freeze({maxCells:2e7,maxRows:2e6});async function c(e){return typeof e==`string`?e:typeof Blob<`u`&&e instanceof Blob?e.text():new TextDecoder().decode(new Uint8Array(e))}function l(e){if([...e].length!==1||/["\r\n\uFEFF]/u.test(e))throw TypeError(`CSV delimiter must be exactly one character and cannot be a quote, line break, or BOM`);return e}function u(e,t=`,`,n={}){t=l(t);let r=d(`maxCells`,n.maxCells??i),s=d(`maxRows`,n.maxRows??a),c=d(`maxFieldChars`,n.maxFieldChars??o),u=[],f=[],p=``,m=!1,h=!1,g=0,_=()=>{if(++g>r)throw RangeError(`CSV exceeds the ${r}-cell safety limit`);f.push(p),p=``},v=()=>{if(u.length>=s)throw RangeError(`CSV exceeds the ${s}-row safety limit`);_(),u.push(f),f=[]};for(let r=0;r<e.length;r++){r&16383||n.signal?.throwIfAborted();let i=e[r];if(t.length===2&&e.slice(r,r+2)===t&&(i=t,r++),m){if(i===`"`)e[r+1]===`"`?(p+=`"`,r++):m=!1;else if(p+=i,p.length>c)throw RangeError(`CSV field exceeds the ${c}-character safety limit`);continue}if(i===`"`){m=!0,h=!0;continue}if(i===t){h=!0,_();continue}if(i===`
|
|
2
|
+
`||i===`\r`){i===`\r`&&e[r+1]===`
|
|
3
|
+
`&&r++,v(),h=!1;continue}if(h=!0,p+=i,p.length>c)throw RangeError(`CSV field exceeds the ${c}-character safety limit`)}return(p!==``||f.length>0||h)&&v(),u}function d(e,t){if(!Number.isSafeInteger(t)||t<0)throw RangeError(`${e} must be a non-negative safe integer`);return t}function f(e,t){let n=e.reduce((e,t)=>Math.max(e,t.length),1);return{type:`table`,children:e.map((e,r)=>{let i=[];for(let a=0;a<n;a++){let n=e[a]??``;i.push({type:`tableCell`,...t&&r===0?{isHeader:!0}:{},children:n?[{type:`text`,value:n}]:[]})}return{type:`tableRow`,children:i}})}}async function p(e,t={}){let n=u((await c(e)).replace(/^\uFEFF/,``),t.delimiter??`,`,t),r=t.hasHeader??!0;return{type:`document`,children:n.length>0?[f(n,r)]:[]}}async function m(i,a={}){let o=r(a.sourceName,`data.csv`),s=a.sidecar??`auto`,l=(await c(i)).replace(/^\uFEFF/,``),u=a.maxInlineRows??100,d=a.maxInlineBytes??256*1024,f=typeof i==`string`?new TextEncoder().encode(i).buffer:i instanceof Blob?await i.arrayBuffer():i,m=s===`always`;if(!m&&s===`auto`){let e=a.hasHeader??!0,t=(l.match(/\n/g)??[]).length+(l.endsWith(`
|
|
4
|
+
`)||!l?0:1),n=Math.max(t-+!!e,0);m=f.byteLength>d||n>u}let h=m?n(o):await p(l,a),g=new t;return await g.writeDocument(e(h),o.markdownFilename),m&&await g.writeFile(o.sidecarPath,f,`text/csv`),g}function h(e,t={}){let n=l(t.delimiter??`,`),r=t.newline??`
|
|
5
|
+
`,i=t.formulaHandling??`preserve`,a=e.map(e=>e.map(e=>g(v(e,i),n)).join(n)).join(r);return t.trailingNewline===!1?a:`${a}${r}`}function g(e,t){return e.includes(`"`)||e.includes(t)||/[\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}var _=/^[\t\r\n \uFEFF]*[=+\-@]/;function v(e,t){return t===`preserve`||!_.test(e)?e:`'${e}`}function y(e){let t=e=>e.map(e=>{let n=e;return n.value===void 0?Array.isArray(n.children)?t(n.children):``:n.value}).join(``);return t(e.children)}function b(e,t={}){let n=l(t.delimiter??`,`),r=t.formulaHandling??`escape`,a=e.children.filter(e=>e.type===`table`),o=t.tableIndex??0;if(t.tableIndex!==void 0&&(!Number.isInteger(o)||o<0||o>=a.length))throw Error(`CSV export: tableIndex ${o} is out of range \u2014 the document contains ${a.length} table(s).`);let s=a[o];if(!s)return``;let c=d(`maxCells`,t.maxCells??i);if(s.children.reduce((e,t)=>e+t.children.length,0)>c)throw RangeError(`CSV exceeds the ${c}-cell safety limit`);return s.children.map((e,i)=>(i&255||t.signal?.throwIfAborted(),e.children.map(e=>g(v(y(e),r),n)).join(n))).join(`\r
|
|
6
|
+
`)}export{u as a,b as i,m as n,h as o,p as r,s as t};
|