agent-whiteboard 1.0.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 (163) hide show
  1. package/CHANGELOG.md +470 -0
  2. package/LICENSE +21 -0
  3. package/README.md +313 -0
  4. package/bin/cli.js +30 -0
  5. package/dist/client/apple-touch-icon.png +0 -0
  6. package/dist/client/assets/KaTeX_AMS-Regular-0cdd387c.woff2 +0 -0
  7. package/dist/client/assets/KaTeX_AMS-Regular-30da91e8.woff +0 -0
  8. package/dist/client/assets/KaTeX_AMS-Regular-68534840.ttf +0 -0
  9. package/dist/client/assets/KaTeX_Caligraphic-Bold-07d8e303.ttf +0 -0
  10. package/dist/client/assets/KaTeX_Caligraphic-Bold-1ae6bd74.woff +0 -0
  11. package/dist/client/assets/KaTeX_Caligraphic-Bold-de7701e4.woff2 +0 -0
  12. package/dist/client/assets/KaTeX_Caligraphic-Regular-3398dd02.woff +0 -0
  13. package/dist/client/assets/KaTeX_Caligraphic-Regular-5d53e70a.woff2 +0 -0
  14. package/dist/client/assets/KaTeX_Caligraphic-Regular-ed0b7437.ttf +0 -0
  15. package/dist/client/assets/KaTeX_Fraktur-Bold-74444efd.woff2 +0 -0
  16. package/dist/client/assets/KaTeX_Fraktur-Bold-9163df9c.ttf +0 -0
  17. package/dist/client/assets/KaTeX_Fraktur-Bold-9be7ceb8.woff +0 -0
  18. package/dist/client/assets/KaTeX_Fraktur-Regular-1e6f9579.ttf +0 -0
  19. package/dist/client/assets/KaTeX_Fraktur-Regular-51814d27.woff2 +0 -0
  20. package/dist/client/assets/KaTeX_Fraktur-Regular-5e28753b.woff +0 -0
  21. package/dist/client/assets/KaTeX_Main-Bold-0f60d1b8.woff2 +0 -0
  22. package/dist/client/assets/KaTeX_Main-Bold-138ac28d.ttf +0 -0
  23. package/dist/client/assets/KaTeX_Main-Bold-c76c5d69.woff +0 -0
  24. package/dist/client/assets/KaTeX_Main-BoldItalic-70ee1f64.ttf +0 -0
  25. package/dist/client/assets/KaTeX_Main-BoldItalic-99cd42a3.woff2 +0 -0
  26. package/dist/client/assets/KaTeX_Main-BoldItalic-a6f7ec0d.woff +0 -0
  27. package/dist/client/assets/KaTeX_Main-Italic-0d85ae7c.ttf +0 -0
  28. package/dist/client/assets/KaTeX_Main-Italic-97479ca6.woff2 +0 -0
  29. package/dist/client/assets/KaTeX_Main-Italic-f1d6ef86.woff +0 -0
  30. package/dist/client/assets/KaTeX_Main-Regular-c2342cd8.woff2 +0 -0
  31. package/dist/client/assets/KaTeX_Main-Regular-c6368d87.woff +0 -0
  32. package/dist/client/assets/KaTeX_Main-Regular-d0332f52.ttf +0 -0
  33. package/dist/client/assets/KaTeX_Math-BoldItalic-850c0af5.woff +0 -0
  34. package/dist/client/assets/KaTeX_Math-BoldItalic-dc47344d.woff2 +0 -0
  35. package/dist/client/assets/KaTeX_Math-BoldItalic-f9377ab0.ttf +0 -0
  36. package/dist/client/assets/KaTeX_Math-Italic-08ce98e5.ttf +0 -0
  37. package/dist/client/assets/KaTeX_Math-Italic-7af58c5e.woff2 +0 -0
  38. package/dist/client/assets/KaTeX_Math-Italic-8a8d2445.woff +0 -0
  39. package/dist/client/assets/KaTeX_SansSerif-Bold-1ece03f7.ttf +0 -0
  40. package/dist/client/assets/KaTeX_SansSerif-Bold-e99ae511.woff2 +0 -0
  41. package/dist/client/assets/KaTeX_SansSerif-Bold-ece03cfd.woff +0 -0
  42. package/dist/client/assets/KaTeX_SansSerif-Italic-00b26ac8.woff2 +0 -0
  43. package/dist/client/assets/KaTeX_SansSerif-Italic-3931dd81.ttf +0 -0
  44. package/dist/client/assets/KaTeX_SansSerif-Italic-91ee6750.woff +0 -0
  45. package/dist/client/assets/KaTeX_SansSerif-Regular-11e4dc8a.woff +0 -0
  46. package/dist/client/assets/KaTeX_SansSerif-Regular-68e8c73e.woff2 +0 -0
  47. package/dist/client/assets/KaTeX_SansSerif-Regular-f36ea897.ttf +0 -0
  48. package/dist/client/assets/KaTeX_Script-Regular-036d4e95.woff2 +0 -0
  49. package/dist/client/assets/KaTeX_Script-Regular-1c67f068.ttf +0 -0
  50. package/dist/client/assets/KaTeX_Script-Regular-d96cdf2b.woff +0 -0
  51. package/dist/client/assets/KaTeX_Size1-Regular-6b47c401.woff2 +0 -0
  52. package/dist/client/assets/KaTeX_Size1-Regular-95b6d2f1.ttf +0 -0
  53. package/dist/client/assets/KaTeX_Size1-Regular-c943cc98.woff +0 -0
  54. package/dist/client/assets/KaTeX_Size2-Regular-2014c523.woff +0 -0
  55. package/dist/client/assets/KaTeX_Size2-Regular-a6b2099f.ttf +0 -0
  56. package/dist/client/assets/KaTeX_Size2-Regular-d04c5421.woff2 +0 -0
  57. package/dist/client/assets/KaTeX_Size3-Regular-500e04d5.ttf +0 -0
  58. package/dist/client/assets/KaTeX_Size3-Regular-6ab6b62e.woff +0 -0
  59. package/dist/client/assets/KaTeX_Size4-Regular-99f9c675.woff +0 -0
  60. package/dist/client/assets/KaTeX_Size4-Regular-a4af7d41.woff2 +0 -0
  61. package/dist/client/assets/KaTeX_Size4-Regular-c647367d.ttf +0 -0
  62. package/dist/client/assets/KaTeX_Typewriter-Regular-71d517d6.woff2 +0 -0
  63. package/dist/client/assets/KaTeX_Typewriter-Regular-e14fed02.woff +0 -0
  64. package/dist/client/assets/KaTeX_Typewriter-Regular-f01f3e87.ttf +0 -0
  65. package/dist/client/assets/arc-4691b008.js +1 -0
  66. package/dist/client/assets/architecture-7EHR7CIX-e08620e8.js +1 -0
  67. package/dist/client/assets/architectureDiagram-3BPJPVTR-9e2f2dbd.js +36 -0
  68. package/dist/client/assets/blockDiagram-GPEHLZMM-d9dd3f7a.js +132 -0
  69. package/dist/client/assets/bootstrap.min-21652813.js +6 -0
  70. package/dist/client/assets/c4Diagram-AAUBKEIU-4ed97d79.js +10 -0
  71. package/dist/client/assets/channel-9d07a35d.js +1 -0
  72. package/dist/client/assets/chunk-2J33WTMH-8049adc8.js +1 -0
  73. package/dist/client/assets/chunk-4BX2VUAB-fd7396be.js +1 -0
  74. package/dist/client/assets/chunk-55IACEB6-ae1ac93c.js +1 -0
  75. package/dist/client/assets/chunk-727SXJPM-7e3658d9.js +206 -0
  76. package/dist/client/assets/chunk-AQP2D5EJ-114f64b0.js +231 -0
  77. package/dist/client/assets/chunk-FMBD7UC4-f2647c5e.js +15 -0
  78. package/dist/client/assets/chunk-ND2GUHAM-0a2fcd8c.js +1 -0
  79. package/dist/client/assets/chunk-QZHKN3VN-d00b3f33.js +1 -0
  80. package/dist/client/assets/classDiagram-4FO5ZUOK-ebb5cc4a.js +1 -0
  81. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-ebb5cc4a.js +1 -0
  82. package/dist/client/assets/colors-98f238a0.js +1 -0
  83. package/dist/client/assets/cose-bilkent-S5V4N54A-1f808fd7.js +1 -0
  84. package/dist/client/assets/cytoscape.esm-1491e259.js +331 -0
  85. package/dist/client/assets/dagre-BM42HDAG-e8ec1c9d.js +4 -0
  86. package/dist/client/assets/defaultLocale-a8476f12.js +1 -0
  87. package/dist/client/assets/diagram-2AECGRRQ-83b385bf.js +43 -0
  88. package/dist/client/assets/diagram-5GNKFQAL-d9406c6a.js +10 -0
  89. package/dist/client/assets/diagram-KO2AKTUF-3db5b95a.js +3 -0
  90. package/dist/client/assets/diagram-LMA3HP47-fbd90397.js +24 -0
  91. package/dist/client/assets/diagram-OG6HWLK6-3c697534.js +24 -0
  92. package/dist/client/assets/embed-2b4adf34.js +201 -0
  93. package/dist/client/assets/erDiagram-TEJ5UH35-7f41448f.js +85 -0
  94. package/dist/client/assets/eventmodeling-FCH6USID-e6d9019e.js +1 -0
  95. package/dist/client/assets/flowDiagram-I6XJVG4X-38f05cc7.js +162 -0
  96. package/dist/client/assets/ganttDiagram-6RSMTGT7-39287f5a.js +292 -0
  97. package/dist/client/assets/gitGraph-WXDBUCRP-037e225a.js +1 -0
  98. package/dist/client/assets/gitGraphDiagram-PVQCEYII-3c2e3ef7.js +106 -0
  99. package/dist/client/assets/graph-f3dfaf53.js +1 -0
  100. package/dist/client/assets/index-4abf3da0.js +5 -0
  101. package/dist/client/assets/index-a1656aec.js +1 -0
  102. package/dist/client/assets/index-d674a6a4.css +1 -0
  103. package/dist/client/assets/info-J43DQDTF-51cd3390.js +1 -0
  104. package/dist/client/assets/infoDiagram-5YYISTIA-ef2826b7.js +2 -0
  105. package/dist/client/assets/init-a5b10ee5.js +1 -0
  106. package/dist/client/assets/ishikawaDiagram-YF4QCWOH-d0b8a2e0.js +70 -0
  107. package/dist/client/assets/journeyDiagram-JHISSGLW-586ffcf8.js +139 -0
  108. package/dist/client/assets/kanban-definition-UN3LZRKU-9e58e14f.js +89 -0
  109. package/dist/client/assets/katex-0cba7652.js +257 -0
  110. package/dist/client/assets/katex-4c9ea27f.js +257 -0
  111. package/dist/client/assets/layout-3a4eff80.js +1 -0
  112. package/dist/client/assets/linear-fed00341.js +1 -0
  113. package/dist/client/assets/mermaid-parser.core-7ee09942.js +173 -0
  114. package/dist/client/assets/mermaid.core-9fc8f6d2.js +306 -0
  115. package/dist/client/assets/mindmap-definition-RKZ34NQL-a40dd09f.js +96 -0
  116. package/dist/client/assets/ordinal-db88ae6f.js +1 -0
  117. package/dist/client/assets/packet-YPE3B663-f55b568a.js +1 -0
  118. package/dist/client/assets/pie-LRSECV5Y-88c1a5e6.js +1 -0
  119. package/dist/client/assets/pieDiagram-4H26LBE5-51aae5ea.js +30 -0
  120. package/dist/client/assets/quadrantDiagram-W4KKPZXB-bc4686f9.js +7 -0
  121. package/dist/client/assets/radar-GUYGQ44K-6ede145d.js +1 -0
  122. package/dist/client/assets/range-6bc2a9a0.js +1 -0
  123. package/dist/client/assets/requirementDiagram-4Y6WPE33-8466f5a1.js +84 -0
  124. package/dist/client/assets/sankeyDiagram-5OEKKPKP-fd54c1f6.js +40 -0
  125. package/dist/client/assets/sequenceDiagram-3UESZ5HK-baa63c66.js +162 -0
  126. package/dist/client/assets/stateDiagram-AJRCARHV-bb4f0d0b.js +1 -0
  127. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-9479cd12.js +1 -0
  128. package/dist/client/assets/step-171ad54a.js +1 -0
  129. package/dist/client/assets/time-043b3464.js +1 -0
  130. package/dist/client/assets/timeline-definition-PNZ67QCA-f64b58bd.js +120 -0
  131. package/dist/client/assets/treeView-BLDUP644-73ba1a83.js +1 -0
  132. package/dist/client/assets/treemap-LRROVOQU-98e47821.js +1 -0
  133. package/dist/client/assets/vennDiagram-CIIHVFJN-a410b1f7.js +34 -0
  134. package/dist/client/assets/wardley-L42UT6IY-a27badb9.js +1 -0
  135. package/dist/client/assets/wardleyDiagram-YWT4CUSO-527ffe52.js +78 -0
  136. package/dist/client/assets/xychartDiagram-2RQKCTM6-42b5914b.js +7 -0
  137. package/dist/client/favicon-16x16.png +0 -0
  138. package/dist/client/favicon-32x32.png +0 -0
  139. package/dist/client/favicon.ico +0 -0
  140. package/dist/client/icon-192.png +0 -0
  141. package/dist/client/icon-512.png +0 -0
  142. package/dist/client/index.html +18 -0
  143. package/dist/server/app.js +429 -0
  144. package/dist/server/channel.js +42 -0
  145. package/dist/server/events.js +90 -0
  146. package/dist/server/export-html.js +461 -0
  147. package/dist/server/index.js +79 -0
  148. package/dist/server/interaction.js +135 -0
  149. package/dist/server/mcp.js +421 -0
  150. package/dist/server/paths.js +11 -0
  151. package/dist/server/persist.js +56 -0
  152. package/dist/server/presentation.js +5 -0
  153. package/dist/server/render-core.js +213 -0
  154. package/dist/server/session.js +103 -0
  155. package/dist/server/slideshow.js +83 -0
  156. package/dist/server/snapshot-reader.js +190 -0
  157. package/dist/server/snapshot-writer.js +117 -0
  158. package/dist/server/snapshot.js +47 -0
  159. package/dist/server/step-frames-builder.js +70 -0
  160. package/dist/server/validate.js +140 -0
  161. package/dist/server/viewport-cache.js +69 -0
  162. package/dist/server/ws.js +71 -0
  163. package/package.json +92 -0
@@ -0,0 +1 @@
1
+ import{a as Y,b as O,d as Tn,e as q,c as K,f as Hn,g as sn,h as Jn,j as je,k as Zn,s as Re,o as Fe,l as Be,m as dn,n as Ge,p as cn,r as Qn,q as zn,t as De,u as Ye,v as Ue,U as Pn,S as Ln,w as ln,x as U,y as hn,z as N,A as ne,B as ee,C as Ve,D as We,E as qe,F as Ke,H as Nn,I as Xe,J as re,K as C,L as He,M as Je,N as B,O as te,P as ie,Q as Ze,R as vn,T as ae,V as Qe,W as oe,X as ze,Y as nr,Z as c,G as E,_ as er,i as x,$ as j,a0 as I,a1 as X}from"./graph-f3dfaf53.js";var rr=/\s/;function tr(n){for(var e=n.length;e--&&rr.test(n.charAt(e)););return e}var ir=/^\s+/;function ar(n){return n&&n.slice(0,tr(n)+1).replace(ir,"")}var In=0/0,or=/^[-+]0x[0-9a-f]+$/i,ur=/^0b[01]+$/i,fr=/^0o[0-7]+$/i,sr=parseInt;function dr(n){if(typeof n=="number")return n;if(Y(n))return In;if(O(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=O(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=ar(n);var r=ur.test(n);return r||fr.test(n)?sr(n.slice(2),r?2:8):or.test(n)?In:+n}var _n=1/0,cr=17976931348623157e292;function G(n){if(!n)return n===0?n:0;if(n=dr(n),n===_n||n===-_n){var e=n<0?-1:1;return e*cr}return n===n?n:0}function lr(n){var e=G(n),r=e%1;return e===e?r?e-r:e:0}var Cn=Object.create,hr=function(){function n(){}return function(e){if(!O(e))return{};if(Cn)return Cn(e);n.prototype=e;var r=new n;return n.prototype=void 0,r}}();const vr=hr;function ue(n,e){var r=-1,t=n.length;for(e||(e=Array(t));++r<t;)e[r]=n[r];return e}function H(n,e,r){e=="__proto__"&&Tn?Tn(n,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[e]=r}var pr=Object.prototype,br=pr.hasOwnProperty;function J(n,e,r){var t=n[e];(!(br.call(n,e)&&q(t,r))||r===void 0&&!(e in n))&&H(n,e,r)}function R(n,e,r,t){var i=!r;r||(r={});for(var o=-1,a=e.length;++o<a;){var u=e[o],f=t?t(r[u],n[u],u,r,n):void 0;f===void 0&&(f=n[u]),i?H(r,u,f):J(r,u,f)}return r}function S(n,e,r){if(!O(r))return!1;var t=typeof e;return(t=="number"?K(r)&&Hn(e,r.length):t=="string"&&e in r)?q(r[e],n):!1}function wr(n){return sn(function(e,r){var t=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=n.length>3&&typeof o=="function"?(i--,o):void 0,a&&S(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++t<i;){var u=r[t];u&&n(e,u,t,o)}return e})}function gr(n){var e=[];if(n!=null)for(var r in Object(n))e.push(r);return e}var mr=Object.prototype,yr=mr.hasOwnProperty;function xr(n){if(!O(n))return gr(n);var e=Jn(n),r=[];for(var t in n)t=="constructor"&&(e||!yr.call(n,t))||r.push(t);return r}function P(n){return K(n)?je(n,!0):xr(n)}function A(n){var e=n==null?0:n.length;return e?Zn(n,1):[]}function Or(n){return Re(Fe(n,void 0,A),n+"")}var Er=Be(Object.getPrototypeOf,Object);const pn=Er;var Tr="[object Object]",Pr=Function.prototype,Lr=Object.prototype,fe=Pr.toString,Nr=Lr.hasOwnProperty,Ir=fe.call(Object);function _r(n){if(!dn(n)||Ge(n)!=Tr)return!1;var e=pn(n);if(e===null)return!0;var r=Nr.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&fe.call(r)==Ir}function Cr(n,e){return n&&R(e,cn(e),n)}function Ar(n,e){return n&&R(e,P(e),n)}var se=typeof exports=="object"&&exports&&!exports.nodeType&&exports,An=se&&typeof module=="object"&&module&&!module.nodeType&&module,$r=An&&An.exports===se,$n=$r?Qn.Buffer:void 0,Sn=$n?$n.allocUnsafe:void 0;function de(n,e){if(e)return n.slice();var r=n.length,t=Sn?Sn(r):new n.constructor(r);return n.copy(t),t}function Sr(n,e){return R(n,zn(n),e)}var kr=Object.getOwnPropertySymbols,Mr=kr?function(n){for(var e=[];n;)Ye(e,zn(n)),n=pn(n);return e}:De;const ce=Mr;function jr(n,e){return R(n,ce(n),e)}function Rr(n){return Ue(n,P,ce)}var Fr=Object.prototype,Br=Fr.hasOwnProperty;function Gr(n){var e=n.length,r=new n.constructor(e);return e&&typeof n[0]=="string"&&Br.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function bn(n){var e=new n.constructor(n.byteLength);return new Pn(e).set(new Pn(n)),e}function Dr(n,e){var r=e?bn(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}var Yr=/\w*$/;function Ur(n){var e=new n.constructor(n.source,Yr.exec(n));return e.lastIndex=n.lastIndex,e}var kn=Ln?Ln.prototype:void 0,Mn=kn?kn.valueOf:void 0;function Vr(n){return Mn?Object(Mn.call(n)):{}}function le(n,e){var r=e?bn(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}var Wr="[object Boolean]",qr="[object Date]",Kr="[object Map]",Xr="[object Number]",Hr="[object RegExp]",Jr="[object Set]",Zr="[object String]",Qr="[object Symbol]",zr="[object ArrayBuffer]",nt="[object DataView]",et="[object Float32Array]",rt="[object Float64Array]",tt="[object Int8Array]",it="[object Int16Array]",at="[object Int32Array]",ot="[object Uint8Array]",ut="[object Uint8ClampedArray]",ft="[object Uint16Array]",st="[object Uint32Array]";function dt(n,e,r){var t=n.constructor;switch(e){case zr:return bn(n);case Wr:case qr:return new t(+n);case nt:return Dr(n,r);case et:case rt:case tt:case it:case at:case ot:case ut:case ft:case st:return le(n,r);case Kr:return new t;case Xr:case Zr:return new t(n);case Hr:return Ur(n);case Jr:return new t;case Qr:return Vr(n)}}function he(n){return typeof n.constructor=="function"&&!Jn(n)?vr(pn(n)):{}}var ct="[object Map]";function lt(n){return dn(n)&&ln(n)==ct}var jn=U&&U.isMap,ht=jn?hn(jn):lt;const vt=ht;var pt="[object Set]";function bt(n){return dn(n)&&ln(n)==pt}var Rn=U&&U.isSet,wt=Rn?hn(Rn):bt;const gt=wt;var mt=1,yt=2,xt=4,ve="[object Arguments]",Ot="[object Array]",Et="[object Boolean]",Tt="[object Date]",Pt="[object Error]",pe="[object Function]",Lt="[object GeneratorFunction]",Nt="[object Map]",It="[object Number]",be="[object Object]",_t="[object RegExp]",Ct="[object Set]",At="[object String]",$t="[object Symbol]",St="[object WeakMap]",kt="[object ArrayBuffer]",Mt="[object DataView]",jt="[object Float32Array]",Rt="[object Float64Array]",Ft="[object Int8Array]",Bt="[object Int16Array]",Gt="[object Int32Array]",Dt="[object Uint8Array]",Yt="[object Uint8ClampedArray]",Ut="[object Uint16Array]",Vt="[object Uint32Array]",b={};b[ve]=b[Ot]=b[kt]=b[Mt]=b[Et]=b[Tt]=b[jt]=b[Rt]=b[Ft]=b[Bt]=b[Gt]=b[Nt]=b[It]=b[be]=b[_t]=b[Ct]=b[At]=b[$t]=b[Dt]=b[Yt]=b[Ut]=b[Vt]=!0;b[Pt]=b[pe]=b[St]=!1;function D(n,e,r,t,i,o){var a,u=e&mt,f=e&yt,s=e&xt;if(r&&(a=i?r(n,t,i,o):r(n)),a!==void 0)return a;if(!O(n))return n;var d=N(n);if(d){if(a=Gr(n),!u)return ue(n,a)}else{var l=ln(n),h=l==pe||l==Lt;if(ne(n))return de(n,u);if(l==be||l==ve||h&&!i){if(a=f||h?{}:he(n),!u)return f?jr(n,Ar(a,n)):Sr(n,Cr(a,n))}else{if(!b[l])return i?n:{};a=dt(n,l,u)}}o||(o=new ee);var v=o.get(n);if(v)return v;o.set(n,a),gt(n)?n.forEach(function(m){a.add(D(m,e,r,m,n,o))}):vt(n)&&n.forEach(function(m,y){a.set(y,D(m,e,r,y,n,o))});var p=s?f?Rr:We:f?P:cn,w=d?void 0:p(n);return Ve(w||n,function(m,y){w&&(y=m,m=n[y]),J(a,y,D(m,e,r,y,n,o))}),a}var Wt=1,qt=4;function Kt(n){return D(n,Wt|qt)}var Xt=function(){return Qn.Date.now()};const Fn=Xt;var we=Object.prototype,Ht=we.hasOwnProperty,Jt=sn(function(n,e){n=Object(n);var r=-1,t=e.length,i=t>2?e[2]:void 0;for(i&&S(e[0],e[1],i)&&(t=1);++r<t;)for(var o=e[r],a=P(o),u=-1,f=a.length;++u<f;){var s=a[u],d=n[s];(d===void 0||q(d,we[s])&&!Ht.call(n,s))&&(n[s]=o[s])}return n});const Zt=Jt;function an(n,e,r){(r!==void 0&&!q(n[e],r)||r===void 0&&!(e in n))&&H(n,e,r)}function on(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Qt(n){return R(n,P(n))}function zt(n,e,r,t,i,o,a){var u=on(n,r),f=on(e,r),s=a.get(f);if(s){an(n,r,s);return}var d=o?o(u,f,r+"",n,e,a):void 0,l=d===void 0;if(l){var h=N(f),v=!h&&ne(f),p=!h&&!v&&qe(f);d=f,h||v||p?N(u)?d=u:Ke(u)?d=ue(u):v?(l=!1,d=de(f,!0)):p?(l=!1,d=le(f,!0)):d=[]:_r(f)||Nn(f)?(d=u,Nn(u)?d=Qt(u):(!O(u)||Xe(u))&&(d=he(f))):l=!1}l&&(a.set(f,d),i(d,f,t,o,a),a.delete(f)),an(n,r,d)}function ge(n,e,r,t,i){n!==e&&re(e,function(o,a){if(i||(i=new ee),O(o))zt(n,e,a,r,ge,t,i);else{var u=t?t(on(n,a),o,a+"",n,e,i):void 0;u===void 0&&(u=o),an(n,a,u)}},P)}function V(n){var e=n==null?0:n.length;return e?n[e-1]:void 0}function ni(n){return function(e,r,t){var i=Object(e);if(!K(e)){var o=C(r);e=cn(e),r=function(u){return o(i[u],u,i)}}var a=n(e,r,t);return a>-1?i[o?e[a]:a]:void 0}}var ei=Math.max;function ri(n,e,r){var t=n==null?0:n.length;if(!t)return-1;var i=r==null?0:lr(r);return i<0&&(i=ei(t+i,0)),He(n,C(e),i)}var ti=ni(ri);const wn=ti;function me(n,e){var r=-1,t=K(n)?Array(n.length):[];return Je(n,function(i,o,a){t[++r]=e(i,o,a)}),t}function g(n,e){var r=N(n)?B:me;return r(n,C(e))}function ii(n,e){return n==null?n:re(n,te(e),P)}function ai(n,e){return n&&ie(n,te(e))}function oi(n,e){return n>e}var ui=Object.prototype,fi=ui.hasOwnProperty;function si(n,e){return n!=null&&fi.call(n,e)}function ye(n,e){return n!=null&&Ze(n,e,si)}function xe(n,e){return n<e}function Z(n,e){var r={};return e=C(e),ie(n,function(t,i,o){H(r,i,e(t,i,o))}),r}function gn(n,e,r){for(var t=-1,i=n.length;++t<i;){var o=n[t],a=e(o);if(a!=null&&(u===void 0?a===a&&!Y(a):r(a,u)))var u=a,f=o}return f}function T(n){return n&&n.length?gn(n,vn,oi):void 0}var di=wr(function(n,e,r){ge(n,e,r)});const un=di;function k(n){return n&&n.length?gn(n,vn,xe):void 0}function mn(n,e){return n&&n.length?gn(n,C(e),xe):void 0}function ci(n,e,r,t){if(!O(n))return n;e=ae(e,n);for(var i=-1,o=e.length,a=o-1,u=n;u!=null&&++i<o;){var f=Qe(e[i]),s=r;if(f==="__proto__"||f==="constructor"||f==="prototype")return n;if(i!=a){var d=u[f];s=t?t(d,f,u):void 0,s===void 0&&(s=O(d)?d:Hn(e[i+1])?[]:{})}J(u,f,s),u=u[f]}return n}function li(n,e,r){for(var t=-1,i=e.length,o={};++t<i;){var a=e[t],u=oe(n,a);r(u,a)&&ci(o,ae(a,n),u)}return o}function hi(n,e){var r=n.length;for(n.sort(e);r--;)n[r]=n[r].value;return n}function vi(n,e){if(n!==e){var r=n!==void 0,t=n===null,i=n===n,o=Y(n),a=e!==void 0,u=e===null,f=e===e,s=Y(e);if(!u&&!s&&!o&&n>e||o&&a&&f&&!u&&!s||t&&a&&f||!r&&f||!i)return 1;if(!t&&!o&&!s&&n<e||s&&r&&i&&!t&&!o||u&&r&&i||!a&&i||!f)return-1}return 0}function pi(n,e,r){for(var t=-1,i=n.criteria,o=e.criteria,a=i.length,u=r.length;++t<a;){var f=vi(i[t],o[t]);if(f){if(t>=u)return f;var s=r[t];return f*(s=="desc"?-1:1)}}return n.index-e.index}function bi(n,e,r){e.length?e=B(e,function(o){return N(o)?function(a){return oe(a,o.length===1?o[0]:o)}:o}):e=[vn];var t=-1;e=B(e,hn(C));var i=me(n,function(o,a,u){var f=B(e,function(s){return s(o)});return{criteria:f,index:++t,value:o}});return hi(i,function(o,a){return pi(o,a,r)})}function wi(n,e){return li(n,e,function(r,t){return ze(n,t)})}var gi=Or(function(n,e){return n==null?{}:wi(n,e)});const W=gi;var mi=Math.ceil,yi=Math.max;function xi(n,e,r,t){for(var i=-1,o=yi(mi((e-n)/(r||1)),0),a=Array(o);o--;)a[t?o:++i]=n,n+=r;return a}function Oi(n){return function(e,r,t){return t&&typeof t!="number"&&S(e,r,t)&&(r=t=void 0),e=G(e),r===void 0?(r=e,e=0):r=G(r),t=t===void 0?e<r?1:-1:G(t),xi(e,r,t,n)}}var Ei=Oi();const _=Ei;var Ti=sn(function(n,e){if(n==null)return[];var r=e.length;return r>1&&S(n,e[0],e[1])?e=[]:r>2&&S(e[0],e[1],e[2])&&(e=[e[0]]),bi(n,Zn(e,1),[])});const F=Ti;var Pi=0;function yn(n){var e=++Pi;return nr(n)+e}function Li(n,e,r){for(var t=-1,i=n.length,o=e.length,a={};++t<i;){var u=t<o?e[t]:void 0;r(a,n[t],u)}return a}function Ni(n,e){return Li(n||[],e||[],J)}class Ii{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return Bn(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&Bn(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,t=r._prev;t!==r;)e.push(JSON.stringify(t,_i)),t=t._prev;return"["+e.join(", ")+"]"}}function Bn(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function _i(n,e){if(n!=="_next"&&n!=="_prev")return e}var Ci=er(1);function Ai(n,e){if(n.nodeCount()<=1)return[];var r=Si(n,e||Ci),t=$i(r.graph,r.buckets,r.zeroIdx);return A(g(t,function(i){return n.outEdges(i.v,i.w)}))}function $i(n,e,r){for(var t=[],i=e[e.length-1],o=e[0],a;n.nodeCount();){for(;a=o.dequeue();)z(n,e,r,a);for(;a=i.dequeue();)z(n,e,r,a);if(n.nodeCount()){for(var u=e.length-2;u>0;--u)if(a=e[u].dequeue(),a){t=t.concat(z(n,e,r,a,!0));break}}}return t}function z(n,e,r,t,i){var o=i?[]:void 0;return c(n.inEdges(t.v),function(a){var u=n.edge(a),f=n.node(a.v);i&&o.push({v:a.v,w:a.w}),f.out-=u,fn(e,r,f)}),c(n.outEdges(t.v),function(a){var u=n.edge(a),f=a.w,s=n.node(f);s.in-=u,fn(e,r,s)}),n.removeNode(t.v),o}function Si(n,e){var r=new E,t=0,i=0;c(n.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),c(n.edges(),function(u){var f=r.edge(u.v,u.w)||0,s=e(u),d=f+s;r.setEdge(u.v,u.w,d),i=Math.max(i,r.node(u.v).out+=s),t=Math.max(t,r.node(u.w).in+=s)});var o=_(i+t+3).map(function(){return new Ii}),a=t+1;return c(r.nodes(),function(u){fn(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function fn(n,e,r){r.out?r.in?n[r.out-r.in+e].enqueue(r):n[n.length-1].enqueue(r):n[0].enqueue(r)}function ki(n){var e=n.graph().acyclicer==="greedy"?Ai(n,r(n)):Mi(n);c(e,function(t){var i=n.edge(t);n.removeEdge(t),i.forwardName=t.name,i.reversed=!0,n.setEdge(t.w,t.v,i,yn("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Mi(n){var e=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,c(n.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?e.push(a):i(a.w)}),delete r[o])}return c(n.nodes(),i),e}function ji(n){c(n.edges(),function(e){var r=n.edge(e);if(r.reversed){n.removeEdge(e);var t=r.forwardName;delete r.reversed,delete r.forwardName,n.setEdge(e.w,e.v,r,t)}})}function $(n,e,r,t){var i;do i=yn(t);while(n.hasNode(i));return r.dummy=e,n.setNode(i,r),i}function Ri(n){var e=new E().setGraph(n.graph());return c(n.nodes(),function(r){e.setNode(r,n.node(r))}),c(n.edges(),function(r){var t=e.edge(r.v,r.w)||{weight:0,minlen:1},i=n.edge(r);e.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),e}function Oe(n){var e=new E({multigraph:n.isMultigraph()}).setGraph(n.graph());return c(n.nodes(),function(r){n.children(r).length||e.setNode(r,n.node(r))}),c(n.edges(),function(r){e.setEdge(r,n.edge(r))}),e}function Gn(n,e){var r=n.x,t=n.y,i=e.x-r,o=e.y-t,a=n.width/2,u=n.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var f,s;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),f=u*i/o,s=u):(i<0&&(a=-a),f=a,s=a*o/i),{x:r+f,y:t+s}}function Q(n){var e=g(_(Ee(n)+1),function(){return[]});return c(n.nodes(),function(r){var t=n.node(r),i=t.rank;x(i)||(e[i][t.order]=r)}),e}function Fi(n){var e=k(g(n.nodes(),function(r){return n.node(r).rank}));c(n.nodes(),function(r){var t=n.node(r);ye(t,"rank")&&(t.rank-=e)})}function Bi(n){var e=k(g(n.nodes(),function(o){return n.node(o).rank})),r=[];c(n.nodes(),function(o){var a=n.node(o).rank-e;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=n.graph().nodeRankFactor;c(r,function(o,a){x(o)&&a%i!==0?--t:t&&c(o,function(u){n.node(u).rank+=t})})}function Dn(n,e,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),$(n,"border",i,e)}function Ee(n){return T(g(n.nodes(),function(e){var r=n.node(e).rank;if(!x(r))return r}))}function Gi(n,e){var r={lhs:[],rhs:[]};return c(n,function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Di(n,e){var r=Fn();try{return e()}finally{console.log(n+" time: "+(Fn()-r)+"ms")}}function Yi(n,e){return e()}function Ui(n){function e(r){var t=n.children(r),i=n.node(r);if(t.length&&c(t,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)Yn(n,"borderLeft","_bl",r,i,o),Yn(n,"borderRight","_br",r,i,o)}}c(n.children(),e)}function Yn(n,e,r,t,i,o){var a={width:0,height:0,rank:o,borderType:e},u=i[e][o-1],f=$(n,"border",a,r);i[e][o]=f,n.setParent(f,t),u&&n.setEdge(u,f,{weight:1})}function Vi(n){var e=n.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&Te(n)}function Wi(n){var e=n.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&qi(n),(e==="lr"||e==="rl")&&(Ki(n),Te(n))}function Te(n){c(n.nodes(),function(e){Un(n.node(e))}),c(n.edges(),function(e){Un(n.edge(e))})}function Un(n){var e=n.width;n.width=n.height,n.height=e}function qi(n){c(n.nodes(),function(e){nn(n.node(e))}),c(n.edges(),function(e){var r=n.edge(e);c(r.points,nn),Object.prototype.hasOwnProperty.call(r,"y")&&nn(r)})}function nn(n){n.y=-n.y}function Ki(n){c(n.nodes(),function(e){en(n.node(e))}),c(n.edges(),function(e){var r=n.edge(e);c(r.points,en),Object.prototype.hasOwnProperty.call(r,"x")&&en(r)})}function en(n){var e=n.x;n.x=n.y,n.y=e}function Xi(n){n.graph().dummyChains=[],c(n.edges(),function(e){Hi(n,e)})}function Hi(n,e){var r=e.v,t=n.node(r).rank,i=e.w,o=n.node(i).rank,a=e.name,u=n.edge(e),f=u.labelRank;if(o!==t+1){n.removeEdge(e);var s=void 0,d,l;for(l=0,++t;t<o;++l,++t)u.points=[],s={width:0,height:0,edgeLabel:u,edgeObj:e,rank:t},d=$(n,"edge",s,"_d"),t===f&&(s.width=u.width,s.height=u.height,s.dummy="edge-label",s.labelpos=u.labelpos),n.setEdge(r,d,{weight:u.weight},a),l===0&&n.graph().dummyChains.push(d),r=d;n.setEdge(r,i,{weight:u.weight},a)}}function Ji(n){c(n.graph().dummyChains,function(e){var r=n.node(e),t=r.edgeLabel,i;for(n.setEdge(r.edgeObj,t);r.dummy;)i=n.successors(e)[0],n.removeNode(e),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),e=i,r=n.node(e)})}function xn(n){var e={};function r(t){var i=n.node(t);if(Object.prototype.hasOwnProperty.call(e,t))return i.rank;e[t]=!0;var o=k(g(n.outEdges(t),function(a){return r(a.w)-n.edge(a).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),i.rank=o}c(n.sources(),r)}function M(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen}function Pe(n){var e=new E({directed:!1}),r=n.nodes()[0],t=n.nodeCount();e.setNode(r,{});for(var i,o;Zi(e,n)<t;)i=Qi(e,n),o=e.hasNode(i.v)?M(n,i):-M(n,i),zi(e,n,o);return e}function Zi(n,e){function r(t){c(e.nodeEdges(t),function(i){var o=i.v,a=t===o?i.w:o;!n.hasNode(a)&&!M(e,i)&&(n.setNode(a,{}),n.setEdge(t,a,{}),r(a))})}return c(n.nodes(),r),n.nodeCount()}function Qi(n,e){return mn(e.edges(),function(r){if(n.hasNode(r.v)!==n.hasNode(r.w))return M(e,r)})}function zi(n,e,r){c(n.nodes(),function(t){e.node(t).rank+=r})}function na(){}na.prototype=new Error;function Le(n,e,r){N(e)||(e=[e]);var t=(n.isDirected()?n.successors:n.neighbors).bind(n),i=[],o={};return c(e,function(a){if(!n.hasNode(a))throw new Error("Graph does not have node: "+a);Ne(n,a,r==="post",o,t,i)}),i}function Ne(n,e,r,t,i,o){Object.prototype.hasOwnProperty.call(t,e)||(t[e]=!0,r||o.push(e),c(i(e),function(a){Ne(n,a,r,t,i,o)}),r&&o.push(e))}function ea(n,e){return Le(n,e,"post")}function ra(n,e){return Le(n,e,"pre")}L.initLowLimValues=En;L.initCutValues=On;L.calcCutValue=Ie;L.leaveEdge=Ce;L.enterEdge=Ae;L.exchangeEdges=$e;function L(n){n=Ri(n),xn(n);var e=Pe(n);En(e),On(e,n);for(var r,t;r=Ce(e);)t=Ae(e,n,r),$e(e,n,r,t)}function On(n,e){var r=ea(n,n.nodes());r=r.slice(0,r.length-1),c(r,function(t){ta(n,e,t)})}function ta(n,e,r){var t=n.node(r),i=t.parent;n.edge(r,i).cutvalue=Ie(n,e,r)}function Ie(n,e,r){var t=n.node(r),i=t.parent,o=!0,a=e.edge(r,i),u=0;return a||(o=!1,a=e.edge(i,r)),u=a.weight,c(e.nodeEdges(r),function(f){var s=f.v===r,d=s?f.w:f.v;if(d!==i){var l=s===o,h=e.edge(f).weight;if(u+=l?h:-h,aa(n,r,d)){var v=n.edge(r,d).cutvalue;u+=l?-v:v}}}),u}function En(n,e){arguments.length<2&&(e=n.nodes()[0]),_e(n,{},1,e)}function _e(n,e,r,t,i){var o=r,a=n.node(t);return e[t]=!0,c(n.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(e,u)||(r=_e(n,e,r,u,t))}),a.low=o,a.lim=r++,i?a.parent=i:delete a.parent,r}function Ce(n){return wn(n.edges(),function(e){return n.edge(e).cutvalue<0})}function Ae(n,e,r){var t=r.v,i=r.w;e.hasEdge(t,i)||(t=r.w,i=r.v);var o=n.node(t),a=n.node(i),u=o,f=!1;o.lim>a.lim&&(u=a,f=!0);var s=j(e.edges(),function(d){return f===Vn(n,n.node(d.v),u)&&f!==Vn(n,n.node(d.w),u)});return mn(s,function(d){return M(e,d)})}function $e(n,e,r,t){var i=r.v,o=r.w;n.removeEdge(i,o),n.setEdge(t.v,t.w,{}),En(n),On(n,e),ia(n,e)}function ia(n,e){var r=wn(n.nodes(),function(i){return!e.node(i).parent}),t=ra(n,r);t=t.slice(1),c(t,function(i){var o=n.node(i).parent,a=e.edge(i,o),u=!1;a||(a=e.edge(o,i),u=!0),e.node(i).rank=e.node(o).rank+(u?a.minlen:-a.minlen)})}function aa(n,e,r){return n.hasEdge(e,r)}function Vn(n,e,r){return r.low<=e.lim&&e.lim<=r.lim}function oa(n){switch(n.graph().ranker){case"network-simplex":Wn(n);break;case"tight-tree":fa(n);break;case"longest-path":ua(n);break;default:Wn(n)}}var ua=xn;function fa(n){xn(n),Pe(n)}function Wn(n){L(n)}function sa(n){var e=$(n,"root",{},"_root"),r=da(n),t=T(I(r))-1,i=2*t+1;n.graph().nestingRoot=e,c(n.edges(),function(a){n.edge(a).minlen*=i});var o=ca(n)+1;c(n.children(),function(a){Se(n,e,i,o,t,r,a)}),n.graph().nodeRankFactor=i}function Se(n,e,r,t,i,o,a){var u=n.children(a);if(!u.length){a!==e&&n.setEdge(e,a,{weight:0,minlen:r});return}var f=Dn(n,"_bt"),s=Dn(n,"_bb"),d=n.node(a);n.setParent(f,a),d.borderTop=f,n.setParent(s,a),d.borderBottom=s,c(u,function(l){Se(n,e,r,t,i,o,l);var h=n.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,w=h.borderTop?t:2*t,m=v!==p?1:i-o[a]+1;n.setEdge(f,v,{weight:w,minlen:m,nestingEdge:!0}),n.setEdge(p,s,{weight:w,minlen:m,nestingEdge:!0})}),n.parent(a)||n.setEdge(e,f,{weight:0,minlen:i+o[a]})}function da(n){var e={};function r(t,i){var o=n.children(t);o&&o.length&&c(o,function(a){r(a,i+1)}),e[t]=i}return c(n.children(),function(t){r(t,1)}),e}function ca(n){return X(n.edges(),function(e,r){return e+n.edge(r).weight},0)}function la(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,c(n.edges(),function(r){var t=n.edge(r);t.nestingEdge&&n.removeEdge(r)})}function ha(n,e,r){var t={},i;c(r,function(o){for(var a=n.parent(o),u,f;a;){if(u=n.parent(a),u?(f=t[u],t[u]=a):(f=i,i=a),f&&f!==a){e.setEdge(f,a);return}a=u}})}function va(n,e,r){var t=pa(n),i=new E({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return n.node(o)});return c(n.nodes(),function(o){var a=n.node(o),u=n.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),c(n[r](o),function(f){var s=f.v===o?f.w:f.v,d=i.edge(s,o),l=x(d)?0:d.weight;i.setEdge(s,o,{weight:n.edge(f).weight+l})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),i}function pa(n){for(var e;n.hasNode(e=yn("_root")););return e}function ba(n,e){for(var r=0,t=1;t<e.length;++t)r+=wa(n,e[t-1],e[t]);return r}function wa(n,e,r){for(var t=Ni(r,g(r,function(s,d){return d})),i=A(g(e,function(s){return F(g(n.outEdges(s),function(d){return{pos:t[d.w],weight:n.edge(d).weight}}),"pos")})),o=1;o<r.length;)o<<=1;var a=2*o-1;o-=1;var u=g(new Array(a),function(){return 0}),f=0;return c(i.forEach(function(s){var d=s.pos+o;u[d]+=s.weight;for(var l=0;d>0;)d%2&&(l+=u[d+1]),d=d-1>>1,u[d]+=s.weight;f+=s.weight*l})),f}function ga(n){var e={},r=j(n.nodes(),function(u){return!n.children(u).length}),t=T(g(r,function(u){return n.node(u).rank})),i=g(_(t+1),function(){return[]});function o(u){if(!ye(e,u)){e[u]=!0;var f=n.node(u);i[f.rank].push(u),c(n.successors(u),o)}}var a=F(r,function(u){return n.node(u).rank});return c(a,o),i}function ma(n,e){return g(e,function(r){var t=n.inEdges(r);if(t.length){var i=X(t,function(o,a){var u=n.edge(a),f=n.node(a.v);return{sum:o.sum+u.weight*f.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function ya(n,e){var r={};c(n,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};x(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),c(e.edges(),function(i){var o=r[i.v],a=r[i.w];!x(o)&&!x(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=j(r,function(i){return!i.indegree});return xa(t)}function xa(n){var e=[];function r(o){return function(a){a.merged||(x(a.barycenter)||x(o.barycenter)||a.barycenter>=o.barycenter)&&Oa(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&n.push(a)}}for(;n.length;){var i=n.pop();e.push(i),c(i.in.reverse(),r(i)),c(i.out,t(i))}return g(j(e,function(o){return!o.merged}),function(o){return W(o,["vs","i","barycenter","weight"])})}function Oa(n,e){var r=0,t=0;n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.vs=e.vs.concat(n.vs),n.barycenter=r/t,n.weight=t,n.i=Math.min(e.i,n.i),e.merged=!0}function Ea(n,e){var r=Gi(n,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")}),t=r.lhs,i=F(r.rhs,function(d){return-d.i}),o=[],a=0,u=0,f=0;t.sort(Ta(!!e)),f=qn(o,i,f),c(t,function(d){f+=d.vs.length,o.push(d.vs),a+=d.barycenter*d.weight,u+=d.weight,f=qn(o,i,f)});var s={vs:A(o)};return u&&(s.barycenter=a/u,s.weight=u),s}function qn(n,e,r){for(var t;e.length&&(t=V(e)).i<=r;)e.pop(),n.push(t.vs),r++;return r}function Ta(n){return function(e,r){return e.barycenter<r.barycenter?-1:e.barycenter>r.barycenter?1:n?r.i-e.i:e.i-r.i}}function ke(n,e,r,t){var i=n.children(e),o=n.node(e),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,f={};a&&(i=j(i,function(p){return p!==a&&p!==u}));var s=ma(n,i);c(s,function(p){if(n.children(p.v).length){var w=ke(n,p.v,r,t);f[p.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&La(p,w)}});var d=ya(s,r);Pa(d,f);var l=Ea(d,t);if(a&&(l.vs=A([a,l.vs,u]),n.predecessors(a).length)){var h=n.node(n.predecessors(a)[0]),v=n.node(n.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+v.order)/(l.weight+2),l.weight+=2}return l}function Pa(n,e){c(n,function(r){r.vs=A(r.vs.map(function(t){return e[t]?e[t].vs:t}))})}function La(n,e){x(n.barycenter)?(n.barycenter=e.barycenter,n.weight=e.weight):(n.barycenter=(n.barycenter*n.weight+e.barycenter*e.weight)/(n.weight+e.weight),n.weight+=e.weight)}function Na(n){var e=Ee(n),r=Kn(n,_(1,e+1),"inEdges"),t=Kn(n,_(e-1,-1,-1),"outEdges"),i=ga(n);Xn(n,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,f=0;f<4;++u,++f){Ia(u%2?r:t,u%4>=2),i=Q(n);var s=ba(n,i);s<o&&(f=0,a=Kt(i),o=s)}Xn(n,a)}function Kn(n,e,r){return g(e,function(t){return va(n,t,r)})}function Ia(n,e){var r=new E;c(n,function(t){var i=t.graph().root,o=ke(t,i,r,e);c(o.vs,function(a,u){t.node(a).order=u}),ha(t,r,o.vs)})}function Xn(n,e){c(e,function(r){c(r,function(t,i){n.node(t).order=i})})}function _a(n){var e=Aa(n);c(n.graph().dummyChains,function(r){for(var t=n.node(r),i=t.edgeObj,o=Ca(n,e,i.v,i.w),a=o.path,u=o.lca,f=0,s=a[f],d=!0;r!==i.w;){if(t=n.node(r),d){for(;(s=a[f])!==u&&n.node(s).maxRank<t.rank;)f++;s===u&&(d=!1)}if(!d){for(;f<a.length-1&&n.node(s=a[f+1]).minRank<=t.rank;)f++;s=a[f]}n.setParent(r,s),r=n.successors(r)[0]}})}function Ca(n,e,r,t){var i=[],o=[],a=Math.min(e[r].low,e[t].low),u=Math.max(e[r].lim,e[t].lim),f,s;f=r;do f=n.parent(f),i.push(f);while(f&&(e[f].low>a||u>e[f].lim));for(s=f,f=t;(f=n.parent(f))!==s;)o.push(f);return{path:i.concat(o.reverse()),lca:s}}function Aa(n){var e={},r=0;function t(i){var o=r;c(n.children(i),t),e[i]={low:o,lim:r++}}return c(n.children(),t),e}function $a(n,e){var r={};function t(i,o){var a=0,u=0,f=i.length,s=V(o);return c(o,function(d,l){var h=ka(n,d),v=h?n.node(h).order:f;(h||d===s)&&(c(o.slice(u,l+1),function(p){c(n.predecessors(p),function(w){var m=n.node(w),y=m.order;(y<a||v<y)&&!(m.dummy&&n.node(p).dummy)&&Me(r,w,p)})}),u=l+1,a=v)}),o}return X(e,t),r}function Sa(n,e){var r={};function t(o,a,u,f,s){var d;c(_(a,u),function(l){d=o[l],n.node(d).dummy&&c(n.predecessors(d),function(h){var v=n.node(h);v.dummy&&(v.order<f||v.order>s)&&Me(r,h,d)})})}function i(o,a){var u=-1,f,s=0;return c(a,function(d,l){if(n.node(d).dummy==="border"){var h=n.predecessors(d);h.length&&(f=n.node(h[0]).order,t(a,s,l,u,f),s=l,u=f)}t(a,s,a.length,f,o.length)}),a}return X(e,i),r}function ka(n,e){if(n.node(e).dummy)return wn(n.predecessors(e),function(r){return n.node(r).dummy})}function Me(n,e,r){if(e>r){var t=e;e=r,r=t}Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=n[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ma(n,e,r){if(e>r){var t=e;e=r,r=t}return!!n[e]&&Object.prototype.hasOwnProperty.call(n[e],r)}function ja(n,e,r,t){var i={},o={},a={};return c(e,function(u){c(u,function(f,s){i[f]=f,o[f]=f,a[f]=s})}),c(e,function(u){var f=-1;c(u,function(s){var d=t(s);if(d.length){d=F(d,function(w){return a[w]});for(var l=(d.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=d[h];o[s]===s&&f<a[p]&&!Ma(r,s,p)&&(o[p]=s,o[s]=i[s]=i[p],f=a[p])}}})}),{root:i,align:o}}function Ra(n,e,r,t,i){var o={},a=Fa(n,e,r,i),u=i?"borderLeft":"borderRight";function f(l,h){for(var v=a.nodes(),p=v.pop(),w={};p;)w[p]?l(p):(w[p]=!0,v.push(p),v=v.concat(h(p))),p=v.pop()}function s(l){o[l]=a.inEdges(l).reduce(function(h,v){return Math.max(h,o[v.v]+a.edge(v))},0)}function d(l){var h=a.outEdges(l).reduce(function(p,w){return Math.min(p,o[w.w]-a.edge(w))},Number.POSITIVE_INFINITY),v=n.node(l);h!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(o[l]=Math.max(o[l],h))}return f(s,a.predecessors.bind(a)),f(d,a.successors.bind(a)),c(t,function(l){o[l]=o[r[l]]}),o}function Fa(n,e,r,t){var i=new E,o=n.graph(),a=Ua(o.nodesep,o.edgesep,t);return c(e,function(u){var f;c(u,function(s){var d=r[s];if(i.setNode(d),f){var l=r[f],h=i.edge(l,d);i.setEdge(l,d,Math.max(a(n,s,f),h||0))}f=s})}),i}function Ba(n,e){return mn(I(e),function(r){var t=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return ii(r,function(o,a){var u=Va(n,a)/2;t=Math.max(o+u,t),i=Math.min(o-u,i)}),t-i})}function Ga(n,e){var r=I(e),t=k(r),i=T(r);c(["u","d"],function(o){c(["l","r"],function(a){var u=o+a,f=n[u],s;if(f!==e){var d=I(f);s=a==="l"?t-k(d):i-T(d),s&&(n[u]=Z(f,function(l){return l+s}))}})})}function Da(n,e){return Z(n.ul,function(r,t){if(e)return n[e.toLowerCase()][t];var i=F(g(n,t));return(i[1]+i[2])/2})}function Ya(n){var e=Q(n),r=un($a(n,e),Sa(n,e)),t={},i;c(["u","d"],function(a){i=a==="u"?e:I(e).reverse(),c(["l","r"],function(u){u==="r"&&(i=g(i,function(l){return I(l).reverse()}));var f=(a==="u"?n.predecessors:n.successors).bind(n),s=ja(n,i,r,f),d=Ra(n,i,s.root,s.align,u==="r");u==="r"&&(d=Z(d,function(l){return-l})),t[a+u]=d})});var o=Ba(n,t);return Ga(t,o),Da(t,n.graph().align)}function Ua(n,e,r){return function(t,i,o){var a=t.node(i),u=t.node(o),f=0,s;if(f+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":s=-a.width/2;break;case"r":s=a.width/2;break}if(s&&(f+=r?s:-s),s=0,f+=(a.dummy?e:n)/2,f+=(u.dummy?e:n)/2,f+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=u.width/2;break;case"r":s=-u.width/2;break}return s&&(f+=r?s:-s),s=0,f}}function Va(n,e){return n.node(e).width}function Wa(n){n=Oe(n),qa(n),ai(Ya(n),function(e,r){n.node(r).x=e})}function qa(n){var e=Q(n),r=n.graph().ranksep,t=0;c(e,function(i){var o=T(g(i,function(a){return n.node(a).height}));c(i,function(a){n.node(a).y=t+o/2}),t+=o+r})}function go(n,e){var r=e&&e.debugTiming?Di:Yi;r("layout",()=>{var t=r(" buildLayoutGraph",()=>to(n));r(" runLayout",()=>Ka(t,r)),r(" updateInputGraph",()=>Xa(n,t))})}function Ka(n,e){e(" makeSpaceForEdgeLabels",()=>io(n)),e(" removeSelfEdges",()=>vo(n)),e(" acyclic",()=>ki(n)),e(" nestingGraph.run",()=>sa(n)),e(" rank",()=>oa(Oe(n))),e(" injectEdgeLabelProxies",()=>ao(n)),e(" removeEmptyRanks",()=>Bi(n)),e(" nestingGraph.cleanup",()=>la(n)),e(" normalizeRanks",()=>Fi(n)),e(" assignRankMinMax",()=>oo(n)),e(" removeEdgeLabelProxies",()=>uo(n)),e(" normalize.run",()=>Xi(n)),e(" parentDummyChains",()=>_a(n)),e(" addBorderSegments",()=>Ui(n)),e(" order",()=>Na(n)),e(" insertSelfEdges",()=>po(n)),e(" adjustCoordinateSystem",()=>Vi(n)),e(" position",()=>Wa(n)),e(" positionSelfEdges",()=>bo(n)),e(" removeBorderNodes",()=>ho(n)),e(" normalize.undo",()=>Ji(n)),e(" fixupEdgeLabelCoords",()=>co(n)),e(" undoCoordinateSystem",()=>Wi(n)),e(" translateGraph",()=>fo(n)),e(" assignNodeIntersects",()=>so(n)),e(" reversePoints",()=>lo(n)),e(" acyclic.undo",()=>ji(n))}function Xa(n,e){c(n.nodes(),function(r){var t=n.node(r),i=e.node(r);t&&(t.x=i.x,t.y=i.y,e.children(r).length&&(t.width=i.width,t.height=i.height))}),c(n.edges(),function(r){var t=n.edge(r),i=e.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),n.graph().width=e.graph().width,n.graph().height=e.graph().height}var Ha=["nodesep","edgesep","ranksep","marginx","marginy"],Ja={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Za=["acyclicer","ranker","rankdir","align"],Qa=["width","height"],za={width:0,height:0},no=["minlen","weight","width","height","labeloffset"],eo={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ro=["labelpos"];function to(n){var e=new E({multigraph:!0,compound:!0}),r=tn(n.graph());return e.setGraph(un({},Ja,rn(r,Ha),W(r,Za))),c(n.nodes(),function(t){var i=tn(n.node(t));e.setNode(t,Zt(rn(i,Qa),za)),e.setParent(t,n.parent(t))}),c(n.edges(),function(t){var i=tn(n.edge(t));e.setEdge(t,un({},eo,rn(i,no),W(i,ro)))}),e}function io(n){var e=n.graph();e.ranksep/=2,c(n.edges(),function(r){var t=n.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function ao(n){c(n.edges(),function(e){var r=n.edge(e);if(r.width&&r.height){var t=n.node(e.v),i=n.node(e.w),o={rank:(i.rank-t.rank)/2+t.rank,e};$(n,"edge-proxy",o,"_ep")}})}function oo(n){var e=0;c(n.nodes(),function(r){var t=n.node(r);t.borderTop&&(t.minRank=n.node(t.borderTop).rank,t.maxRank=n.node(t.borderBottom).rank,e=T(e,t.maxRank))}),n.graph().maxRank=e}function uo(n){c(n.nodes(),function(e){var r=n.node(e);r.dummy==="edge-proxy"&&(n.edge(r.e).labelRank=r.rank,n.removeNode(e))})}function fo(n){var e=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=n.graph(),a=o.marginx||0,u=o.marginy||0;function f(s){var d=s.x,l=s.y,h=s.width,v=s.height;e=Math.min(e,d-h/2),r=Math.max(r,d+h/2),t=Math.min(t,l-v/2),i=Math.max(i,l+v/2)}c(n.nodes(),function(s){f(n.node(s))}),c(n.edges(),function(s){var d=n.edge(s);Object.prototype.hasOwnProperty.call(d,"x")&&f(d)}),e-=a,t-=u,c(n.nodes(),function(s){var d=n.node(s);d.x-=e,d.y-=t}),c(n.edges(),function(s){var d=n.edge(s);c(d.points,function(l){l.x-=e,l.y-=t}),Object.prototype.hasOwnProperty.call(d,"x")&&(d.x-=e),Object.prototype.hasOwnProperty.call(d,"y")&&(d.y-=t)}),o.width=r-e+a,o.height=i-t+u}function so(n){c(n.edges(),function(e){var r=n.edge(e),t=n.node(e.v),i=n.node(e.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(Gn(t,o)),r.points.push(Gn(i,a))})}function co(n){c(n.edges(),function(e){var r=n.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function lo(n){c(n.edges(),function(e){var r=n.edge(e);r.reversed&&r.points.reverse()})}function ho(n){c(n.nodes(),function(e){if(n.children(e).length){var r=n.node(e),t=n.node(r.borderTop),i=n.node(r.borderBottom),o=n.node(V(r.borderLeft)),a=n.node(V(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),c(n.nodes(),function(e){n.node(e).dummy==="border"&&n.removeNode(e)})}function vo(n){c(n.edges(),function(e){if(e.v===e.w){var r=n.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:n.edge(e)}),n.removeEdge(e)}})}function po(n){var e=Q(n);c(e,function(r){var t=0;c(r,function(i,o){var a=n.node(i);a.order=o+t,c(a.selfEdges,function(u){$(n,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function bo(n){c(n.nodes(),function(e){var r=n.node(e);if(r.dummy==="selfedge"){var t=n.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;n.setEdge(r.e,r.label),n.removeNode(e),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function rn(n,e){return Z(W(n,e),Number)}function tn(n){var e={};return c(n,function(r,t){e[t.toLowerCase()]=r}),e}export{D as b,go as l,g as m};
@@ -0,0 +1 @@
1
+ import{x as B,y as d,z as w,A as k,B as D}from"./step-171ad54a.js";import{i as F}from"./init-a5b10ee5.js";import{e as g,a as I,b as P,f as V}from"./defaultLocale-a8476f12.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function $(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===$?n:L,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function L(){return 0}function O(n){return n===null?NaN:+n}function*mn(n,r){if(r===void 0)for(let t of n)t!=null&&(t=+t)>=t&&(yield t);else{let t=-1;for(let e of n)(e=r(e,++t,n))!=null&&(e=+e)>=e&&(yield e)}}const j=R(M),T=j.right,gn=j.left;R(O).center;const C=T,E=Math.sqrt(50),G=Math.sqrt(10),H=Math.sqrt(2);function y(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=E?10:f>=G?5:f>=H?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?y(n,r,t*2):[o,c,i]}function J(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?y(r,n,t):y(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function p(n,r,t){return r=+r,n=+n,t=+t,y(n,r,t)[2]}function K(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?p(r,n,t):p(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function S(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function q(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Mn(n,r){return(q(r)?S:x)(n,r)}function x(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=N(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function Q(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function U(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=N(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function N(n,r){var t=typeof r,e;return r==null||t==="boolean"?B(r):(t==="number"?d:t==="string"?(e=w(r))?(r=e,k):D:r instanceof w?k:r instanceof Date?Q:q(r)?S:Array.isArray(r)?x:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?U:d)(n,r)}function W(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function X(n){return Math.max(0,-g(Math.abs(n)))}function Y(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Z(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function _(n){return function(){return n}}function b(n){return+n}var A=[0,1];function m(n){return n}function v(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:_(isNaN(r)?NaN:.5)}function nn(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function rn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=v(u,e),f=t(a,f)):(e=v(e,u),f=t(f,a)),function(o){return f(e(o))}}function en(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=v(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=C(n,o,1,e)-1;return f[c](u[c](o))}}function tn(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function un(){var n=A,r=A,t=N,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=nn(n[0],n[s-1])),o=s>2?en:rn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),d)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,b),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=W,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,z){return e=s,u=z,h()}}function an(){return un()(m,m)}function on(n,r,t,e){var u=K(n,r,t),f;switch(e=I(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=Y(u,a))&&(e.precision=f),P(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Z(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=X(u))&&(e.precision=f-(e.type==="%")*2);break}}return V(e)}function fn(n){var r=n.domain;return n.ticks=function(t){var e=r();return J(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return on(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=p(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function cn(){var n=an();return n.copy=function(){return tn(n,cn())},F.apply(n,arguments),fn(n)}export{tn as a,R as b,an as c,M as d,O as e,Mn as f,Q as g,S as h,N as i,W as j,b as k,cn as l,fn as m,mn as n,U as o,un as p,J as q,m as r,C as s,K as t,X as u,Z as v,Y as w,T as x,on as y,gn as z};