@aiquants/markdown 11.4.0 → 11.6.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.
Files changed (128) hide show
  1. package/README.md +64 -25
  2. package/dist/{abnfDiagram-VRR7QNED-CBHDWVyi.js → abnfDiagram-VRR7QNED-79-YSh_K.js} +3 -3
  3. package/dist/{abnfDiagram-VRR7QNED-RhtDe_7N.cjs → abnfDiagram-VRR7QNED-DWb-CgfE.cjs} +1 -1
  4. package/dist/{arc-DTM_h6lx.js → arc-7S4sKBip.js} +1 -1
  5. package/dist/{arc-CM3wvUZ0.cjs → arc-Ct7JgzbU.cjs} +1 -1
  6. package/dist/{architectureDiagram-ZJ3FMSHR-D2dRhNFv.cjs → architectureDiagram-ZJ3FMSHR-CqYSOu6T.cjs} +1 -1
  7. package/dist/{architectureDiagram-ZJ3FMSHR-NRi6G3X3.js → architectureDiagram-ZJ3FMSHR-DbazS36-.js} +2 -2
  8. package/dist/{blockDiagram-677ZJIJ3-CHxk95XA.cjs → blockDiagram-677ZJIJ3-BN9v9gZ-.cjs} +1 -1
  9. package/dist/{blockDiagram-677ZJIJ3-CV8nnIV7.js → blockDiagram-677ZJIJ3-yUFxR2AB.js} +3 -3
  10. package/dist/{c4Diagram-LMCZKHZV-DoD_wB8P.js → c4Diagram-LMCZKHZV-ChDvUvYJ.js} +2 -2
  11. package/dist/{c4Diagram-LMCZKHZV-BvbPlr0h.cjs → c4Diagram-LMCZKHZV-zoa11JBS.cjs} +1 -1
  12. package/dist/{channel-DqD7QHJJ.cjs → channel-B3Momvbx.cjs} +1 -1
  13. package/dist/{channel-CTUWcSTH.js → channel-CjnjBBm3.js} +1 -1
  14. package/dist/{chunk-2Q5K7J3B-BrFIRhHf.cjs → chunk-2Q5K7J3B-BFqqoKdy.cjs} +1 -1
  15. package/dist/{chunk-2Q5K7J3B-Cxwan1Kr.js → chunk-2Q5K7J3B-CU00N_PH.js} +1 -1
  16. package/dist/{chunk-32BRIVSS-BQp-ZQs_.cjs → chunk-32BRIVSS-D1kAmPLJ.cjs} +1 -1
  17. package/dist/{chunk-32BRIVSS-L7r_G8HL.js → chunk-32BRIVSS-n6Apfcwz.js} +1 -1
  18. package/dist/{chunk-5VM5RSS4-txcIZk2V.cjs → chunk-5VM5RSS4-BojaQz_F.cjs} +1 -1
  19. package/dist/{chunk-5VM5RSS4-D8617CsW.js → chunk-5VM5RSS4-Dq5Hynyb.js} +1 -1
  20. package/dist/{chunk-EX3LRPZG-DSgZX9T2.js → chunk-EX3LRPZG-D-MPeU_l.js} +4 -4
  21. package/dist/{chunk-EX3LRPZG-C9LWVILV.cjs → chunk-EX3LRPZG-DmcR2gTc.cjs} +1 -1
  22. package/dist/{chunk-JWPE2WC7-DPOD7SL9.cjs → chunk-JWPE2WC7-5XwT9koa.cjs} +1 -1
  23. package/dist/{chunk-JWPE2WC7-kIqdo6CF.js → chunk-JWPE2WC7-CRKJdMCc.js} +1 -1
  24. package/dist/{chunk-MOJQB5TN-DfEITzGw.js → chunk-MOJQB5TN-3vNO7Ocs.js} +1 -1
  25. package/dist/{chunk-MOJQB5TN-C3IjuSDY.cjs → chunk-MOJQB5TN-BAbxB6Wt.cjs} +1 -1
  26. package/dist/{chunk-PUDLZKDR-C7waD5EN.cjs → chunk-PUDLZKDR-B9uAx29J.cjs} +1 -1
  27. package/dist/{chunk-PUDLZKDR-DCpimEnH.js → chunk-PUDLZKDR-D44jrM4A.js} +6 -6
  28. package/dist/{chunk-RYQCIY6F-DD87UjzR.cjs → chunk-RYQCIY6F-Cv0NI4r5.cjs} +1 -1
  29. package/dist/{chunk-RYQCIY6F-xEZx-wfp.js → chunk-RYQCIY6F-DvNezuk8.js} +1 -1
  30. package/dist/{chunk-V7JOEXUC-CXNcuGNB.cjs → chunk-V7JOEXUC-B7-0gdwG.cjs} +1 -1
  31. package/dist/{chunk-V7JOEXUC-CzBsdP3-.js → chunk-V7JOEXUC-qDKOSk0E.js} +5 -5
  32. package/dist/{chunk-VR4S4FIN-Cl5yJ6D5.cjs → chunk-VR4S4FIN-DdEF58hd.cjs} +1 -1
  33. package/dist/{chunk-VR4S4FIN-CLDWDcHV.js → chunk-VR4S4FIN-DoAmSLKL.js} +1 -1
  34. package/dist/{chunk-XXDRQBXY-cbcKgiGG.cjs → chunk-XXDRQBXY-C7_R2ESl.cjs} +1 -1
  35. package/dist/{chunk-XXDRQBXY-DsBYLmqe.js → chunk-XXDRQBXY-CPc_CnDi.js} +1 -1
  36. package/dist/{classDiagram-v2-EOCWNBFH-D5ws8Gla.js → classDiagram-OUVF2IWQ-CDL6Y0zH.js} +2 -2
  37. package/dist/{classDiagram-OUVF2IWQ-DpeVtgCa.cjs → classDiagram-OUVF2IWQ-D8V_ia1T.cjs} +1 -1
  38. package/dist/{classDiagram-OUVF2IWQ-D5ws8Gla.js → classDiagram-v2-EOCWNBFH-CDL6Y0zH.js} +2 -2
  39. package/dist/{classDiagram-v2-EOCWNBFH-DpeVtgCa.cjs → classDiagram-v2-EOCWNBFH-D8V_ia1T.cjs} +1 -1
  40. package/dist/code-blocks-Cpo2S9jm.cjs +4 -0
  41. package/dist/{code-blocks-bgwDIVp1.js → code-blocks-Gfo7U6nu.js} +126 -119
  42. package/dist/code-blocks.cjs +1 -1
  43. package/dist/code-blocks.d.ts +8 -2
  44. package/dist/code-blocks.js +13 -12
  45. package/dist/components/spreadsheetModel.d.ts +5 -1
  46. package/dist/converter.wasm +0 -0
  47. package/dist/{cose-bilkent-JH36ORCC-B1gOmkEg.js → cose-bilkent-JH36ORCC-CgYGsvBY.js} +1 -1
  48. package/dist/{cose-bilkent-JH36ORCC-gLQPpHUk.cjs → cose-bilkent-JH36ORCC-D36mBTa1.cjs} +1 -1
  49. package/dist/{cynefinDiagram-TSTJHNR4-BYBWPdDO.cjs → cynefinDiagram-TSTJHNR4-BVD1jBRh.cjs} +1 -1
  50. package/dist/{cynefinDiagram-TSTJHNR4-919whoYx.js → cynefinDiagram-TSTJHNR4-C4ccvzDY.js} +2 -2
  51. package/dist/{dagre-VKFMJZFB-qi55jjuZ.cjs → dagre-VKFMJZFB-BZy2-Z-X.cjs} +1 -1
  52. package/dist/{dagre-VKFMJZFB-CkWSnQUL.js → dagre-VKFMJZFB-Chy7TpIo.js} +2 -2
  53. package/dist/{diagram-FQU43EPY-DSSMCztI.cjs → diagram-FQU43EPY-CGQQGMxC.cjs} +1 -1
  54. package/dist/{diagram-FQU43EPY-BO3iobOs.js → diagram-FQU43EPY-_vDqFQBf.js} +2 -2
  55. package/dist/{diagram-G47NLZAW-B09nXJfw.cjs → diagram-G47NLZAW-D_sO4PSP.cjs} +1 -1
  56. package/dist/{diagram-G47NLZAW-Cf0tc0aA.js → diagram-G47NLZAW-yxlia5t-.js} +3 -3
  57. package/dist/{diagram-NH7WQ7WH-Lyxwzvru.cjs → diagram-NH7WQ7WH-BRFc3dHy.cjs} +1 -1
  58. package/dist/{diagram-NH7WQ7WH-BB6RW17H.js → diagram-NH7WQ7WH-Bq2axsyf.js} +2 -2
  59. package/dist/{diagram-OA4YK3LP-JaYkBo12.js → diagram-OA4YK3LP-Bu2coUUB.js} +3 -3
  60. package/dist/{diagram-OA4YK3LP-vvSPKQUH.cjs → diagram-OA4YK3LP-DR8ONCwP.cjs} +1 -1
  61. package/dist/{diagram-WEI45ONY-BwyxNljM.cjs → diagram-WEI45ONY-2qs2PO34.cjs} +1 -1
  62. package/dist/{diagram-WEI45ONY-Ca5HRdQN.js → diagram-WEI45ONY-CO8Cka3N.js} +2 -2
  63. package/dist/{ebnfDiagram-CCIWWBDH-DdLMeyQC.cjs → ebnfDiagram-CCIWWBDH-CeglVg-X.cjs} +1 -1
  64. package/dist/{ebnfDiagram-CCIWWBDH-DiAw4CfJ.js → ebnfDiagram-CCIWWBDH-Cxh8ZtT_.js} +3 -3
  65. package/dist/{erDiagram-Q63AITRT-Bjm6ywZL.cjs → erDiagram-Q63AITRT-CAiZlm3_.cjs} +1 -1
  66. package/dist/{erDiagram-Q63AITRT-C3uAJSXI.js → erDiagram-Q63AITRT-YXK1aGTi.js} +4 -4
  67. package/dist/{extractHeadings-C13XIINZ.cjs → extractHeadings-B1AsuS3b.cjs} +71 -71
  68. package/dist/{extractHeadings-B6uw4Yra.js → extractHeadings-ChjUMVbw.js} +5542 -5486
  69. package/dist/flowDiagram-23GEKE2U-BVOD68W1.cjs +1 -0
  70. package/dist/flowDiagram-23GEKE2U-CEegkqrO.js +7 -0
  71. package/dist/{ganttDiagram-NO4QXBWP-DsgcCBX-.cjs → ganttDiagram-NO4QXBWP-UhNGYA_c.cjs} +1 -1
  72. package/dist/{ganttDiagram-NO4QXBWP-DYmXJjT_.js → ganttDiagram-NO4QXBWP-ztpU8x74.js} +2 -2
  73. package/dist/{gitGraphDiagram-IHSO6WYX-DrVk6UCc.js → gitGraphDiagram-IHSO6WYX-BVHyOXzC.js} +3 -3
  74. package/dist/{gitGraphDiagram-IHSO6WYX-Dif1CkFs.cjs → gitGraphDiagram-IHSO6WYX-BqmWDevH.cjs} +1 -1
  75. package/dist/index.cjs +1 -1
  76. package/dist/index.client.cjs +1 -1
  77. package/dist/index.client.js +2 -2
  78. package/dist/index.js +2 -2
  79. package/dist/{infoDiagram-FWYZ7A6U-sn774MmG.js → infoDiagram-FWYZ7A6U-CtPPZXcW.js} +1 -1
  80. package/dist/{infoDiagram-FWYZ7A6U-C0lktmoS.cjs → infoDiagram-FWYZ7A6U-u5jAW1BW.cjs} +1 -1
  81. package/dist/{ishikawaDiagram-FXEZZL3T-CO2dFzp0.js → ishikawaDiagram-FXEZZL3T-Brte0Ddn.js} +1 -1
  82. package/dist/{ishikawaDiagram-FXEZZL3T-FxqvFozF.cjs → ishikawaDiagram-FXEZZL3T-DSLCb5U8.cjs} +1 -1
  83. package/dist/{journeyDiagram-5HDEW3XC-DR9yN3TX.js → journeyDiagram-5HDEW3XC-BCAzbps1.js} +4 -4
  84. package/dist/{journeyDiagram-5HDEW3XC-BWtP4L5i.cjs → journeyDiagram-5HDEW3XC-Bbp04jQE.cjs} +1 -1
  85. package/dist/{kanban-definition-HUTT4EX6-C0ais5E8.js → kanban-definition-HUTT4EX6-CNyzanxy.js} +2 -2
  86. package/dist/{kanban-definition-HUTT4EX6-06pnLnb8.cjs → kanban-definition-HUTT4EX6-ChWKc0LP.cjs} +1 -1
  87. package/dist/{linear-C1ElxCAF.js → linear-Cqco96HS.js} +1 -1
  88. package/dist/{linear-BdAEOCTg.cjs → linear-DbIpUBgn.cjs} +1 -1
  89. package/dist/{mindmap-definition-LN4V7U3C-B2fkPG93.cjs → mindmap-definition-LN4V7U3C-BZd2a84K.cjs} +1 -1
  90. package/dist/{mindmap-definition-LN4V7U3C-DV9IVNXB.js → mindmap-definition-LN4V7U3C-DzKkbdiT.js} +3 -3
  91. package/dist/{pegDiagram-2B236MQR-mbYpu4tr.cjs → pegDiagram-2B236MQR-DrUVQFHJ.cjs} +1 -1
  92. package/dist/{pegDiagram-2B236MQR-BqyUnioq.js → pegDiagram-2B236MQR-wcsKpCXJ.js} +3 -3
  93. package/dist/{pieDiagram-ENE6RG2P-Bt1RRvjY.js → pieDiagram-ENE6RG2P-CiQf4zJi.js} +3 -3
  94. package/dist/{pieDiagram-ENE6RG2P-BRnxo4U8.cjs → pieDiagram-ENE6RG2P-Rr_wC5sF.cjs} +1 -1
  95. package/dist/{quadrantDiagram-ABIIQ3AL-Dw51VXFI.js → quadrantDiagram-ABIIQ3AL-Bpo7TY9t.js} +2 -2
  96. package/dist/{quadrantDiagram-ABIIQ3AL-BUFLtZUw.cjs → quadrantDiagram-ABIIQ3AL-CyWI3Wm4.cjs} +1 -1
  97. package/dist/{railroadDiagram-RFXS5EU6-UM6xkPjd.cjs → railroadDiagram-RFXS5EU6-BnBB57wY.cjs} +1 -1
  98. package/dist/{railroadDiagram-RFXS5EU6-CmOA5o_d.js → railroadDiagram-RFXS5EU6-C5ZXR4L6.js} +3 -3
  99. package/dist/{requirementDiagram-TGXJPOKE-Dqm0JbUO.js → requirementDiagram-TGXJPOKE-B0tl_Jwn.js} +3 -3
  100. package/dist/{requirementDiagram-TGXJPOKE-8ArbyRU3.cjs → requirementDiagram-TGXJPOKE-BwR88GAB.cjs} +1 -1
  101. package/dist/{sankeyDiagram-HTMAVEWB-DZ8GFTQp.cjs → sankeyDiagram-HTMAVEWB-DxHj5IG1.cjs} +1 -1
  102. package/dist/{sankeyDiagram-HTMAVEWB-B5vAZunk.js → sankeyDiagram-HTMAVEWB-yTsdOW_q.js} +1 -1
  103. package/dist/{sequenceDiagram-DBY2YBRQ-Gn5MDMnL.cjs → sequenceDiagram-DBY2YBRQ-DEO1ZsJr.cjs} +1 -1
  104. package/dist/{sequenceDiagram-DBY2YBRQ-uuuSzhVp.js → sequenceDiagram-DBY2YBRQ-z0fpzKzY.js} +3 -3
  105. package/dist/{sizeCapture-X5ZJPWSS-8MTcAVtS.js → sizeCapture-X5ZJPWSS-Aj3-106E.js} +1 -1
  106. package/dist/{sizeCapture-X5ZJPWSS-BYPlek4L.cjs → sizeCapture-X5ZJPWSS-bpuOXTvv.cjs} +1 -1
  107. package/dist/{stateDiagram-2N3HPSRC-DcMx4da-.cjs → stateDiagram-2N3HPSRC-CkFpvJ5I.cjs} +1 -1
  108. package/dist/{stateDiagram-2N3HPSRC-B26FS7jn.js → stateDiagram-2N3HPSRC-DGJO0Pvj.js} +2 -2
  109. package/dist/{stateDiagram-v2-6OUMAXLB-DwHp4lqJ.js → stateDiagram-v2-6OUMAXLB-D0YDxME7.js} +2 -2
  110. package/dist/{stateDiagram-v2-6OUMAXLB-ByTp0tao.cjs → stateDiagram-v2-6OUMAXLB-tnSDv_sy.cjs} +1 -1
  111. package/dist/styles/markdown.css +1 -1
  112. package/dist/styles/markdown.standalone.css +1 -1
  113. package/dist/{swimlanes-5IMT3BWC-COEdbJMp.cjs → swimlanes-5IMT3BWC-Bib1XFM-.cjs} +1 -1
  114. package/dist/{swimlanes-5IMT3BWC-SbQF6zqF.js → swimlanes-5IMT3BWC-iMCo0rMv.js} +3 -3
  115. package/dist/{swimlanesDiagram-G3AALYLV-DAdz3_b7.js → swimlanesDiagram-G3AALYLV-CXNOMTdt.js} +2 -2
  116. package/dist/{swimlanesDiagram-G3AALYLV-C0gqMROP.cjs → swimlanesDiagram-G3AALYLV-ywhyY4G6.cjs} +1 -1
  117. package/dist/{timeline-definition-FHXFAJF6-DZGHbSpR.cjs → timeline-definition-FHXFAJF6-fqq6Gi2A.cjs} +1 -1
  118. package/dist/{timeline-definition-FHXFAJF6-fmCUTBQj.js → timeline-definition-FHXFAJF6-zRLuqX2O.js} +2 -2
  119. package/dist/{vennDiagram-L72KCM5P-CsNtbCv1.cjs → vennDiagram-L72KCM5P-CAmFprGQ.cjs} +1 -1
  120. package/dist/{vennDiagram-L72KCM5P-DwEGVrpl.js → vennDiagram-L72KCM5P-Cjc5fQRJ.js} +1 -1
  121. package/dist/{wardleyDiagram-EHGQE667-BV41ARvm.js → wardleyDiagram-EHGQE667-Bo_e9LrE.js} +2 -2
  122. package/dist/{wardleyDiagram-EHGQE667-DJUb0osY.cjs → wardleyDiagram-EHGQE667-DqSV5RVx.cjs} +1 -1
  123. package/dist/{xychartDiagram-FW5EYKEG-B1Pmn4Zf.js → xychartDiagram-FW5EYKEG-ByrCKuTx.js} +2 -2
  124. package/dist/{xychartDiagram-FW5EYKEG-DD-HPA7H.cjs → xychartDiagram-FW5EYKEG-rY9U7Gaf.cjs} +1 -1
  125. package/package.json +9 -9
  126. package/dist/code-blocks-Bax5Xik7.cjs +0 -4
  127. package/dist/flowDiagram-23GEKE2U-C_wOwOVo.js +0 -7
  128. package/dist/flowDiagram-23GEKE2U-QtfsGltE.cjs +0 -1
package/README.md CHANGED
@@ -599,7 +599,7 @@ A fenced code block in the `spreadsheets` language renders as `SpreadsheetBlock`
599
599
  `@aiquants/spreadsheet`, and the info string after the language holds its options (the converter writes them as
600
600
  `data-code-meta`, see [Settings without React](#settings-without-react)).
601
601
 
602
- <!-- markdownlint-disable MD010 -- the example's cells are separated by real tabs (TSV) -->
602
+ <!-- markdownlint-disable MD010 -- the examples' cells are separated by real tabs (TSV) -->
603
603
  ````markdown
604
604
  ```spreadsheets header=1 footer=1 freeze=1 height=12
605
605
  Item Q1 Q2
@@ -608,6 +608,17 @@ Pears 80 95
608
608
  Total 200 235
609
609
  ```
610
610
  ````
611
+
612
+ A table drawn as on its original print — no toolbar, no column letters or row numbers, the columns fitted to their text,
613
+ at 71 % and every row shown, with the page scrolling past it:
614
+
615
+ ````markdown
616
+ ```spreadsheets header=1 footer=1 toolbar=0 headings=0 autofit=1 zoom=71 height=1000
617
+ Region Demand Note
618
+ Kanto 17,600 MT The largest market, served from three ports
619
+ Total 17,600 MT
620
+ ```
621
+ ````
611
622
  <!-- markdownlint-enable MD010 -->
612
623
 
613
624
  | Option | Value | Default | Effect |
@@ -615,11 +626,16 @@ Total 200 235
615
626
  | `header=N` | 0–128 | 0 | The first N rows are the table's column headers: frozen at the top, their cells `role="columnheader"`, drawn bold on the header-row surface (`--aqsp-header-row-*`, 7:1 for the text) |
616
627
  | `footer=N` | 0–128 | 0 | The last N rows are frozen at the bottom (totals) |
617
628
  | `freeze=N` | 0–128 | 0 | The first N columns are frozen at the start |
618
- | `height=N` | 1–100 | the rows, at most 15 | The rows the block's box shows; a larger value than the rows the grid shows (an editable table's spare row included) shows those rows |
629
+ | `height=N` | 1–1000 | the rows, at most 15 | The rows the block's box shows; a value that reaches the rows the grid shows (an editable table's spare row included) makes a box that shows every row (see the box below) |
630
+ | `zoom=N` | 25, 30, 35, 42, 50, 59, 71, 84, 100, 119, 141, 168, 200, 238, 283, 336, 400 | 100 | The zoom in percent the grid starts at: one of the grid's zoom steps as the toolbar shows them (`SPREADSHEET_ZOOM_STEP_PERCENTS`), since zooming in and out moves one step from where it is. The toolbar's percent and Ctrl+Alt+`0` still return to 100 % |
631
+ | `toolbar=N` | 0, 1 | 1 | 0 leaves out the toolbar and the table's size; the grid's own keys stay (Ctrl+C, Ctrl+Alt+`=` / `-` / `0`, Alt+wheel, Alt+Shift+Arrow and Alt+Shift+`=`), while full screen, saving and the size buttons go with it |
632
+ | `headings=N` | 0, 1 | 1 | 0 leaves out the column letters, the row numbers and their corner, in the grid and in the plain table (Excel's "headings"; `header=` is the table's own header rows) |
633
+ | `autofit=N` | 0, 1 | 0 | 1 fits every column to the widest text of all its rows (header rows in bold) when the grid loads, when the table or the options change, and when a web font finishes loading; a column without text keeps its width |
619
634
 
620
635
  - **Options are strict**: words are `key=value` separated by white space, each key at most once, each value a decimal integer
621
- without a sign or leading zeros. An unknown key, a repeated key, a malformed word or a value out of range shows an error in
622
- place of the table (`role="alert"`, naming the word and the ranges) and the rest of the document renders. Counts larger
636
+ without a sign or leading zeros. An unknown key, a repeated key, a malformed word, a value out of range or a `zoom` that is
637
+ not one of the steps shows an error in place of the table (`role="alert"`, naming the word, the ranges and the zoom steps)
638
+ and the rest of the document renders. Counts larger
623
639
  than the table follow the spreadsheet's own rules (everything frozen), so an edit that shrinks the table never turns it into
624
640
  an error.
625
641
  - **Size budget**: a body with more cells (rows times its widest row, counted with `measureTsv` without building the table)
@@ -627,9 +643,16 @@ Total 200 235
627
643
  (`role="alert"`, `data-aqmd-spreadsheet-error="size"`, the `tooLarge` label with the cells and the most) instead of a
628
644
  table the grid would refuse to operate on; its text stays in the document, and the grid is not loaded for it.
629
645
  - **The box** (`layout="inline"`, the default in a document): the block reserves the grid's height before the grid loads —
630
- the column-header band and the visible rows, both 24 px and scaled by the zoom, and the horizontal scroll bar
631
- (`@aiquants/spreadsheet/view`'s constants) — capped at the viewport's height less two 44 px bands, so the page can always
632
- be scrolled past it. `layout="fill"` lets a host that shows one table in a pane of its own (a file preview) give the
646
+ the column-letter band (when the headings show), the visible rows and the horizontal scroll bar, all scaled by the zoom
647
+ (the grid keeps its scroll bars inside its zoom, so they scale too; `@aiquants/spreadsheet/view`'s constants) — capped at
648
+ the viewport's height less two 44 px bands, so the page can always be scrolled past it. A box whose `height` reaches the
649
+ rows the grid shows shows every row instead (`data-aqmd-spreadsheet-whole` on the block): it takes their height, rounded
650
+ up plus 1 px (the grid's reported content height once it has loaded, so rows a reader makes taller still fit), with no
651
+ cap. Its rows never scroll, so the wheel and a finger's vertical swipe over the table reach the page, and a keyboard move
652
+ scrolls the page to the active cell; the 1 px keeps a fractional zoom's rounding from making the rows scrollable, which
653
+ would let the grid take the finger. The box is never wider than the table: once the grid has loaded, its width is the
654
+ grid's content width (`onContentSizeChange`, rounded up plus 1 px), at most the column's, and a wider table scrolls inside
655
+ it. The block and its toolbar keep the column's width, so zooming or resizing a column never moves a toolbar control. `layout="fill"` lets a host that shows one table in a pane of its own (a file preview) give the
633
656
  block the pane's height: the toolbar and the notice keep their own height and the box takes the rest, but never less
634
657
  than three rows (all the rows of a shorter table) at the grid's zoom, capped the same way. In a pane shorter than that
635
658
  the block grows past the pane, so a host that scrolls its pane reaches the whole table instead of a squeezed box.
@@ -638,8 +661,12 @@ Total 200 235
638
661
  the grid at once) and a reader without JavaScript still sees the data: the column letters (A to Z, more than the box shows
639
662
  at the default 100 px width) above the 64 px band of row numbers (both `aria-hidden`), 24 px rows, the header rows in
640
663
  `<thead>` as `th scope="col"`, and the footer rows at the bottom when the table holds more rows than the box shows, painted
641
- from the same `--aqsp-*` variables as the grid. A failed load keeps the plain table and shows the error with a retry
642
- button.
664
+ from the same `--aqsp-*` variables as the grid. It follows the options as the grid will: the block's zoom (CSS `zoom`, so
665
+ the box keeps the grid's height), no letters or numbers with `headings=0`, every row in a box that shows them all, and with
666
+ `autofit=1` each column at the width of its widest text plus the grid's 9 px (a column without text in the rows drawn keeps
667
+ 100 px; the plain table measures only the rows it draws, so a column may shift a little when the grid, which measures
668
+ every row, replaces it). Before the grid loads the box takes the column's width, with the plain table at its start. A
669
+ failed load keeps the plain table and shows the error with a retry button.
643
670
  - **Reading**: a read-only table (the default) is the grid's `readOnly` — every cell refuses edits and is announced as
644
671
  read-only — while selection, Ctrl+C (the grid's own copy: TSV in Excel's clipboard form and the interop HTML table),
645
672
  scrolling, the zoom, Excel's Ctrl+Arrow data edges, column and row sizes, the active row and column bands (on by default),
@@ -649,13 +676,16 @@ Total 200 235
649
676
  along the grid's geometric ladder, `SPREADSHEET_ZOOM_STEPS`: 2^(k/4) for k from −8 to 8, 25 % to 400 %, four steps to
650
677
  double. A column's width and a row's height change by dragging a header's 6 px edge (a double-click fits the column),
651
678
  by Alt+Shift+Arrow and Alt+Shift+`=` (fit), or by the toolbar's size controls.
652
- - **Toolbar** (44 × 44 px controls in a wrapping row above the box, the Mermaid toolbar's look; one tab stop whose controls
653
- the arrow keys, Home and End walk, the APG toolbar): zoom in, zoom out, the zoom in percent, which returns it to 100 % (the
654
- control is as wide as the widest percent, 400 %, so the row never shifts as the zoom changes), the bands toggle
655
- (`aria-pressed`), the size controls, copy the whole table, save as TSV (no byte order mark; the menu next to it saves with
656
- one, for Excel) and full screen, followed by the table's size. The size control discloses a row of five 44 × 44 px buttons
657
- under the toolbar that narrow, widen and fit the active column and make the active row shorter or taller, named after
658
- that column's letter and that row's number — the grid's keyboard size commands for a pointer, so no size needs a drag
679
+ - **Toolbar** (`toolbar=0` leaves it out; 44 × 44 px controls in a wrapping row above the box, the Mermaid toolbar's look; one tab stop whose controls
680
+ the arrow keys, Home and End walk, the APG toolbar): the table's size at the row's start, and at its end zoom in, zoom
681
+ out, the zoom in percent, which returns it to 100 % (the control is as wide as the widest percent, 400 %, so the row never
682
+ shifts as the zoom changes), the bands toggle (`aria-pressed`), the size controls, copy the whole table, save as TSV (no
683
+ byte order mark; the menu next to it saves with one, for Excel) and full screen. The size sits at the start so that its
684
+ text growing with the table never moves a control, and the controls wrap in groups (the zoom, the bands and the sizes,
685
+ the copy and the saves, full screen), so a narrow column never parts the percent from its zoom buttons or the menu from
686
+ its save. The size control discloses a row of five 44 × 44 px buttons under the toolbar, at the row's end too, that
687
+ narrow, widen and fit the active column and make the active row shorter or taller, named after that column's letter and
688
+ that row's number — the grid's keyboard size commands for a pointer, so no size needs a drag
659
689
  (WCAG 2.5.7); Escape in the row closes it and returns the focus to its control. The copy writes what the grid's own Ctrl+C
660
690
  writes: TSV in Excel's clipboard form as `text/plain` (only a cell holding a tab or a line break is quoted, so a
661
691
  plain-text target receives the cells as typed) and the interop HTML table, which carries the grid's own payload, as
@@ -728,12 +758,19 @@ Total 200 235
728
758
  `data-aqmd-spreadsheet-fullscreen` (a host gives the double-click and the keys inside an editable or full-screen table to
729
759
  the grid).
730
760
  - **Known limits**: formulas are not calculated (a cell starting with `=` shows as written); a tap does not start editing (the
731
- spreadsheet's rule); a finger swipe that starts over a scrollable table does not scroll the page; Tab moves inside the grid
732
- and Escape leaves it; column widths, row heights and the zoom are not saved (a reload resets all three; the grid also
733
- resets the widths when the column count changes and the heights when the row count changes, an edit that adds or removes a
734
- column or a row included); printing shows the visible part of the grid only; the toolbar's copy uses the asynchronous
735
- clipboard, which browsers grant only to a secure page (https or localhost) and with their permission (Ctrl+C in the grid
736
- works anywhere).
761
+ spreadsheet's rule); a finger swipe that starts over a table whose rows scroll does not scroll the page (a box that shows
762
+ every row never scrolls its rows, so a swipe over it does); Tab moves inside the grid and Escape leaves it; column widths,
763
+ row heights and the zoom are not saved (a reload resets all three; the grid also resets the widths when the column count
764
+ changes and the heights when the row count changes, an edit that adds or removes a column or a row included); with
765
+ `autofit=1` a reader's resize lasts until the table or the options change, and the fit is skipped (the default widths
766
+ stay) when the cells it measures — an editable table's spare row and column included — pass the grid's operation budget;
767
+ printing shows the visible part of the grid only; the toolbar's copy uses the asynchronous clipboard, which browsers grant
768
+ only to a secure page (https or localhost) and with their permission (Ctrl+C in the grid works anywhere).
769
+ - **What the display options trade**: `zoom` below 100 shrinks the text (WCAG 1.4.4): a reader zooms back with the toolbar or
770
+ the grid's keys, but with `toolbar=0` a reader with only a pointer has the page's own zoom left. `headings=0` removes the
771
+ header edges a pointer drags, so a column's or a row's size changes by Alt+Shift+Arrow or, with the toolbar, by its size
772
+ buttons (WCAG 2.5.7). The cells, their roles and the header rows read the same with or without the headings, which are
773
+ presentation only.
737
774
 
738
775
  ### Viewer toolbar
739
776
 
@@ -908,7 +945,7 @@ placeholder without a value stays as written, so a misspelt one shows rather tha
908
945
  | `cellAnnouncement`, `readOnlyCellAnnouncement`, `emptyCell` | A cell's announcement (`{cell}` as `B2`, `{value}`) and an empty cell's value | {cell}, {value} / {cell}, {value}, read-only / blank | {cell}、{value} / {cell}、{value}、読み取り専用 / 空白 |
909
946
  | `selectionAnnouncement` | A selection's announcement (`{range}` as `A1` or `A1:C3`) | {range} selected | {range} を選択 |
910
947
  | `readOnly`, `formatRefused`, `fenceRefused`, `editConflict`, `unwritable` | The notices of a refused edit | Why the edit was not saved, one text per reason | 同じ |
911
- | `optionsError` | The error of an option that cannot be read (`{word}`, `{frozenMax}`, `{heightMax}`) | The table option “{word}” cannot be read. … | 表の指定「{word}」を読めません。… |
948
+ | `optionsError` | The error of an option that cannot be read (`{word}`, `{frozenMax}`, `{heightMax}`, `{zoomSteps}`) | The table option “{word}” cannot be read. … | 表の指定「{word}」を読めません。… |
912
949
  | `tooLarge` | The error of a table past the budget (`{cells}`, `{max}`) | This table has {cells} cells, more than the {max} a table shows. Its text is still in the document. | この表のセルは {cells} 個で、表が見せられる {max} 個を超えます。表の文字は文書の中にあります。 |
913
950
  | `loadFailed`, `retry` | The error of a failed load and its retry button | Could not load the spreadsheet. Check the connection and retry. / Retry | 表を読み込めませんでした。接続を確かめて再試行してください。 / 再試行 |
914
951
 
@@ -934,8 +971,10 @@ The viewer's `blockFailed` (the renderer's `blockFailedLabel`; built in: "This b
934
971
  (`data-code-meta`, the attribute the converter writes on a fenced block's `code` for the info string after the language,
935
972
  read as text only), `SPREADSHEETS_LANGUAGE`, `parseSpreadsheetOptions` (the one reader of a table's options; an invalid
936
973
  word throws `SpreadsheetOptionsError`, a `RangeError` whose `word` names it), `SPREADSHEET_OPTION_RULES` (each option's
937
- field, range and value when absent) and the limits `DEFAULT_SPREADSHEET_VISIBLE_ROWS` (15), `MAX_SPREADSHEET_VISIBLE_ROWS`
938
- (100) and `MAX_SPREADSHEET_FROZEN_TRACKS` (128). A host's own sanitizer keeps `data-code-meta` on `code` with this name.
974
+ field, range, the only values it takes inside the range — `steps`, `null` for any — and value when absent),
975
+ `SPREADSHEET_ZOOM_STEP_PERCENTS` (the percents `zoom=` takes: the grid's zoom steps as the toolbar shows them) and the
976
+ limits `DEFAULT_SPREADSHEET_VISIBLE_ROWS` (15), `MAX_SPREADSHEET_VISIBLE_ROWS` (1000) and `MAX_SPREADSHEET_FROZEN_TRACKS`
977
+ (128). A host's own sanitizer keeps `data-code-meta` on `code` with this name.
939
978
  It also holds the table block's label catalogs (`SPREADSHEET_BLOCK_LABEL_CATALOGS`) and the placeholders each label's
940
979
  text takes (`SPREADSHEET_BLOCK_LABEL_PLACEHOLDERS`), so a host can derive its own label keys and texts from them.
941
980
 
@@ -1,6 +1,6 @@
1
- import { g as p, r as u, d as a } from "./chunk-MOJQB5TN-DfEITzGw.js";
2
- import { p as f } from "./chunk-JWPE2WC7-kIqdo6CF.js";
3
- import { _ as n, U as o } from "./extractHeadings-B6uw4Yra.js";
1
+ import { g as p, r as u, d as a } from "./chunk-MOJQB5TN-3vNO7Ocs.js";
2
+ import { p as f } from "./chunk-JWPE2WC7-CRKJdMCc.js";
3
+ import { _ as n, U as o } from "./extractHeadings-ChjUMVbw.js";
4
4
  import { M as c, b as d } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
5
5
  var v = d().RailroadAbnf.parser.LangiumParser, i = /* @__PURE__ */ n((e) => {
6
6
  const r = e.alternatives.map(g);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chunk-MOJQB5TN-C3IjuSDY.cjs"),u=require("./chunk-JWPE2WC7-DPOD7SL9.cjs"),n=require("./extractHeadings-C13XIINZ.cjs"),i=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var p=i.createRailroadAbnfServices().RailroadAbnf.parser.LangiumParser,o=n.__name(e=>{const r=e.alternatives.map(c);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),c=n.__name(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),f=n.__name(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),d=n.__name(e=>{const r=b(e.primary);if(!e.repeat)return r;const{min:t,max:s}=f(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),b=n.__name(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return o(e.element);case"AbnfOptionalGroup":return{type:"optional",element:o(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),g=n.__name(e=>({name:e.name,definition:o(e.definition)}),"transformRule"),v=n.__name(e=>{u.populateCommonDb(e,a.db),e.title&&a.db.setTitle(e.title),e.rules.map(r=>a.db.addRule(g(r)))},"populateDb"),y={parse:n.__name(e=>{a.db.clear(),n.log.debug("[ABNF Parser] Starting Langium parse");const r=p.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new i.MermaidParseError(r);const t=r.value;n.log.debug("[ABNF Parser] Parsed rules:",t.rules.length),v(t),n.log.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a.db}},_={parser:y,db:a.db,renderer:a.renderer,styles:a.getStyles};exports.diagram=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chunk-MOJQB5TN-BAbxB6Wt.cjs"),u=require("./chunk-JWPE2WC7-5XwT9koa.cjs"),n=require("./extractHeadings-B1AsuS3b.cjs"),i=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var p=i.createRailroadAbnfServices().RailroadAbnf.parser.LangiumParser,o=n.__name(e=>{const r=e.alternatives.map(c);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),c=n.__name(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),f=n.__name(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),d=n.__name(e=>{const r=b(e.primary);if(!e.repeat)return r;const{min:t,max:s}=f(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),b=n.__name(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return o(e.element);case"AbnfOptionalGroup":return{type:"optional",element:o(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),g=n.__name(e=>({name:e.name,definition:o(e.definition)}),"transformRule"),v=n.__name(e=>{u.populateCommonDb(e,a.db),e.title&&a.db.setTitle(e.title),e.rules.map(r=>a.db.addRule(g(r)))},"populateDb"),y={parse:n.__name(e=>{a.db.clear(),n.log.debug("[ABNF Parser] Starting Langium parse");const r=p.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new i.MermaidParseError(r);const t=r.value;n.log.debug("[ABNF Parser] Parsed rules:",t.rules.length),v(t),n.log.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a.db}},_={parser:y,db:a.db,renderer:a.renderer,styles:a.getStyles};exports.diagram=_;
@@ -1,4 +1,4 @@
1
- import { aF as ln, aG as an, aH as y, aI as tn, aJ as M, aK as I, aL as _, aM as un, aN as rn, aO as j, aP as o, aQ as H, aR as sn, aS as on, aT as fn } from "./extractHeadings-B6uw4Yra.js";
1
+ import { aF as ln, aG as an, aH as y, aI as tn, aJ as M, aK as I, aL as _, aM as un, aN as rn, aO as j, aP as o, aQ as H, aR as sn, aS as on, aT as fn } from "./extractHeadings-ChjUMVbw.js";
2
2
  function cn(l) {
3
3
  return l.innerRadius;
4
4
  }
@@ -1 +1 @@
1
- "use strict";const n=require("./extractHeadings-C13XIINZ.cjs");function $(o){return o.innerRadius}function b(o){return o.outerRadius}function k(o){return o.startAngle}function _(o){return o.endAngle}function nn(o){return o&&o.padAngle}function en(o,x,D,P,h,v,S,s){var E=D-o,r=P-x,e=S-h,p=s-v,i=p*E-e*r;if(!(i*i<n.epsilon))return i=(e*(x-v)-p*(o-h))/i,[o+i*E,x+i*r]}function M(o,x,D,P,h,v,S){var s=o-D,E=x-P,r=(S?v:-v)/n.sqrt(s*s+E*E),e=r*E,p=-r*s,i=o+e,u=x+p,c=D+e,f=P+p,j=(i+c)/2,l=(u+f)/2,y=c-i,g=f-u,A=y*y+g*g,R=h-v,T=i*f-c*u,H=(g<0?-1:1)*n.sqrt(n.max(0,R*R*A-T*T)),I=(T*g-y*H)/A,O=(-T*y-g*H)/A,q=(T*g+y*H)/A,d=(-T*y+g*H)/A,m=I-j,a=O-l,t=q-j,z=d-l;return m*m+a*a>t*t+z*z&&(I=q,O=d),{cx:I,cy:O,x01:-e,y01:-p,x11:I*(h/R-1),y11:O*(h/R-1)}}function an(){var o=$,x=b,D=n.constant(0),P=null,h=k,v=_,S=nn,s=null,E=n.withPath(r);function r(){var e,p,i=+o.apply(this,arguments),u=+x.apply(this,arguments),c=h.apply(this,arguments)-n.halfPi,f=v.apply(this,arguments)-n.halfPi,j=n.abs(f-c),l=f>c;if(s||(s=e=E()),u<i&&(p=u,u=i,i=p),!(u>n.epsilon))s.moveTo(0,0);else if(j>n.tau-n.epsilon)s.moveTo(u*n.cos(c),u*n.sin(c)),s.arc(0,0,u,c,f,!l),i>n.epsilon&&(s.moveTo(i*n.cos(f),i*n.sin(f)),s.arc(0,0,i,f,c,l));else{var y=c,g=f,A=c,R=f,T=j,H=j,I=S.apply(this,arguments)/2,O=I>n.epsilon&&(P?+P.apply(this,arguments):n.sqrt(i*i+u*u)),q=n.min(n.abs(u-i)/2,+D.apply(this,arguments)),d=q,m=q,a,t;if(O>n.epsilon){var z=n.asin(O/i*n.sin(I)),F=n.asin(O/u*n.sin(I));(T-=z*2)>n.epsilon?(z*=l?1:-1,A+=z,R-=z):(T=0,A=R=(c+f)/2),(H-=F*2)>n.epsilon?(F*=l?1:-1,y+=F,g-=F):(H=0,y=g=(c+f)/2)}var B=u*n.cos(y),C=u*n.sin(y),G=i*n.cos(R),J=i*n.sin(R);if(q>n.epsilon){var K=u*n.cos(g),L=u*n.sin(g),N=i*n.cos(A),Q=i*n.sin(A),w;if(j<n.pi)if(w=en(B,C,N,Q,K,L,G,J)){var U=B-w[0],V=C-w[1],W=K-w[0],X=L-w[1],Y=1/n.sin(n.acos((U*W+V*X)/(n.sqrt(U*U+V*V)*n.sqrt(W*W+X*X)))/2),Z=n.sqrt(w[0]*w[0]+w[1]*w[1]);d=n.min(q,(i-Z)/(Y-1)),m=n.min(q,(u-Z)/(Y+1))}else d=m=0}H>n.epsilon?m>n.epsilon?(a=M(N,Q,B,C,u,m,l),t=M(K,L,G,J,u,m,l),s.moveTo(a.cx+a.x01,a.cy+a.y01),m<q?s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,u,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),!l),s.arc(t.cx,t.cy,m,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):(s.moveTo(B,C),s.arc(0,0,u,y,g,!l)):s.moveTo(B,C),!(i>n.epsilon)||!(T>n.epsilon)?s.lineTo(G,J):d>n.epsilon?(a=M(G,J,K,L,i,-d,l),t=M(B,C,N,Q,i,-d,l),s.lineTo(a.cx+a.x01,a.cy+a.y01),d<q?s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,i,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),l),s.arc(t.cx,t.cy,d,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):s.arc(0,0,i,R,A,l)}if(s.closePath(),e)return s=null,e+""||null}return r.centroid=function(){var e=(+o.apply(this,arguments)+ +x.apply(this,arguments))/2,p=(+h.apply(this,arguments)+ +v.apply(this,arguments))/2-n.pi/2;return[n.cos(p)*e,n.sin(p)*e]},r.innerRadius=function(e){return arguments.length?(o=typeof e=="function"?e:n.constant(+e),r):o},r.outerRadius=function(e){return arguments.length?(x=typeof e=="function"?e:n.constant(+e),r):x},r.cornerRadius=function(e){return arguments.length?(D=typeof e=="function"?e:n.constant(+e),r):D},r.padRadius=function(e){return arguments.length?(P=e==null?null:typeof e=="function"?e:n.constant(+e),r):P},r.startAngle=function(e){return arguments.length?(h=typeof e=="function"?e:n.constant(+e),r):h},r.endAngle=function(e){return arguments.length?(v=typeof e=="function"?e:n.constant(+e),r):v},r.padAngle=function(e){return arguments.length?(S=typeof e=="function"?e:n.constant(+e),r):S},r.context=function(e){return arguments.length?(s=e??null,r):s},r}exports.d3arc=an;
1
+ "use strict";const n=require("./extractHeadings-B1AsuS3b.cjs");function $(o){return o.innerRadius}function b(o){return o.outerRadius}function k(o){return o.startAngle}function _(o){return o.endAngle}function nn(o){return o&&o.padAngle}function en(o,x,D,P,h,v,S,s){var E=D-o,r=P-x,e=S-h,p=s-v,i=p*E-e*r;if(!(i*i<n.epsilon))return i=(e*(x-v)-p*(o-h))/i,[o+i*E,x+i*r]}function M(o,x,D,P,h,v,S){var s=o-D,E=x-P,r=(S?v:-v)/n.sqrt(s*s+E*E),e=r*E,p=-r*s,i=o+e,u=x+p,c=D+e,f=P+p,j=(i+c)/2,l=(u+f)/2,y=c-i,g=f-u,A=y*y+g*g,R=h-v,T=i*f-c*u,H=(g<0?-1:1)*n.sqrt(n.max(0,R*R*A-T*T)),I=(T*g-y*H)/A,O=(-T*y-g*H)/A,q=(T*g+y*H)/A,d=(-T*y+g*H)/A,m=I-j,a=O-l,t=q-j,z=d-l;return m*m+a*a>t*t+z*z&&(I=q,O=d),{cx:I,cy:O,x01:-e,y01:-p,x11:I*(h/R-1),y11:O*(h/R-1)}}function an(){var o=$,x=b,D=n.constant(0),P=null,h=k,v=_,S=nn,s=null,E=n.withPath(r);function r(){var e,p,i=+o.apply(this,arguments),u=+x.apply(this,arguments),c=h.apply(this,arguments)-n.halfPi,f=v.apply(this,arguments)-n.halfPi,j=n.abs(f-c),l=f>c;if(s||(s=e=E()),u<i&&(p=u,u=i,i=p),!(u>n.epsilon))s.moveTo(0,0);else if(j>n.tau-n.epsilon)s.moveTo(u*n.cos(c),u*n.sin(c)),s.arc(0,0,u,c,f,!l),i>n.epsilon&&(s.moveTo(i*n.cos(f),i*n.sin(f)),s.arc(0,0,i,f,c,l));else{var y=c,g=f,A=c,R=f,T=j,H=j,I=S.apply(this,arguments)/2,O=I>n.epsilon&&(P?+P.apply(this,arguments):n.sqrt(i*i+u*u)),q=n.min(n.abs(u-i)/2,+D.apply(this,arguments)),d=q,m=q,a,t;if(O>n.epsilon){var z=n.asin(O/i*n.sin(I)),F=n.asin(O/u*n.sin(I));(T-=z*2)>n.epsilon?(z*=l?1:-1,A+=z,R-=z):(T=0,A=R=(c+f)/2),(H-=F*2)>n.epsilon?(F*=l?1:-1,y+=F,g-=F):(H=0,y=g=(c+f)/2)}var B=u*n.cos(y),C=u*n.sin(y),G=i*n.cos(R),J=i*n.sin(R);if(q>n.epsilon){var K=u*n.cos(g),L=u*n.sin(g),N=i*n.cos(A),Q=i*n.sin(A),w;if(j<n.pi)if(w=en(B,C,N,Q,K,L,G,J)){var U=B-w[0],V=C-w[1],W=K-w[0],X=L-w[1],Y=1/n.sin(n.acos((U*W+V*X)/(n.sqrt(U*U+V*V)*n.sqrt(W*W+X*X)))/2),Z=n.sqrt(w[0]*w[0]+w[1]*w[1]);d=n.min(q,(i-Z)/(Y-1)),m=n.min(q,(u-Z)/(Y+1))}else d=m=0}H>n.epsilon?m>n.epsilon?(a=M(N,Q,B,C,u,m,l),t=M(K,L,G,J,u,m,l),s.moveTo(a.cx+a.x01,a.cy+a.y01),m<q?s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,u,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),!l),s.arc(t.cx,t.cy,m,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):(s.moveTo(B,C),s.arc(0,0,u,y,g,!l)):s.moveTo(B,C),!(i>n.epsilon)||!(T>n.epsilon)?s.lineTo(G,J):d>n.epsilon?(a=M(G,J,K,L,i,-d,l),t=M(B,C,N,Q,i,-d,l),s.lineTo(a.cx+a.x01,a.cy+a.y01),d<q?s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,i,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),l),s.arc(t.cx,t.cy,d,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):s.arc(0,0,i,R,A,l)}if(s.closePath(),e)return s=null,e+""||null}return r.centroid=function(){var e=(+o.apply(this,arguments)+ +x.apply(this,arguments))/2,p=(+h.apply(this,arguments)+ +v.apply(this,arguments))/2-n.pi/2;return[n.cos(p)*e,n.sin(p)*e]},r.innerRadius=function(e){return arguments.length?(o=typeof e=="function"?e:n.constant(+e),r):o},r.outerRadius=function(e){return arguments.length?(x=typeof e=="function"?e:n.constant(+e),r):x},r.cornerRadius=function(e){return arguments.length?(D=typeof e=="function"?e:n.constant(+e),r):D},r.padRadius=function(e){return arguments.length?(P=e==null?null:typeof e=="function"?e:n.constant(+e),r):P},r.startAngle=function(e){return arguments.length?(h=typeof e=="function"?e:n.constant(+e),r):h},r.endAngle=function(e){return arguments.length?(v=typeof e=="function"?e:n.constant(+e),r):v},r.padAngle=function(e){return arguments.length?(S=typeof e=="function"?e:n.constant(+e),r):S},r.context=function(e){return arguments.length?(s=e??null,r):s},r}exports.d3arc=an;