graview 0.1.67 → 0.1.68

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 (189) hide show
  1. package/dist/preview/{chunk.YCD4JSXD.js → chunk.2BMZPALF.js} +1 -1
  2. package/dist/preview/{chunk.SNHKYH72.js → chunk.2KCDLCB2.js} +1 -1
  3. package/dist/preview/{chunk.O2OL6RQQ.js → chunk.2ME4DVBI.js} +1 -1
  4. package/dist/preview/chunk.2TUEBU7X.js +8 -0
  5. package/dist/preview/{chunk.LYEGRY77.js → chunk.2U6HB4XU.js} +1 -1
  6. package/dist/preview/{chunk.7S6ZRMW4.js → chunk.32JE2WS7.js} +1 -1
  7. package/dist/preview/{chunk.RG5G6YQD.js → chunk.3DEWQDP7.js} +1 -1
  8. package/dist/preview/{chunk.GVT4UUQA.js → chunk.3JMQKANL.js} +1 -1
  9. package/dist/preview/{chunk.A5PSEU3W.js → chunk.3VEZ5MOC.js} +1 -1
  10. package/dist/preview/chunk.3WPCS6KP.js +1 -0
  11. package/dist/preview/{chunk.5R744JGZ.js → chunk.42C3FIKK.js} +1 -1
  12. package/dist/preview/{chunk.IAEGJDF3.js → chunk.42KHFGN6.js} +1 -1
  13. package/dist/preview/{chunk.DZMIYEHQ.js → chunk.4DXPPM6T.js} +1 -1
  14. package/dist/preview/chunk.4GVKKBQL.js +1 -0
  15. package/dist/preview/{chunk.KX5ZBHMA.js → chunk.4TT3ZHSJ.js} +1 -1
  16. package/dist/preview/{chunk.QXLJGHMC.js → chunk.4YAO3A5Q.js} +3 -3
  17. package/dist/preview/{chunk.Z4TY44CD.js → chunk.5JKUT2OM.js} +1 -1
  18. package/dist/preview/chunk.5L4ADKTW.js +1 -0
  19. package/dist/preview/{chunk.BKYZSV2Y.js → chunk.64LCHHZB.js} +1 -1
  20. package/dist/preview/{chunk.ZEZUKRC6.js → chunk.6AANHELP.js} +1 -1
  21. package/dist/preview/{chunk.ZAQ4IDX6.js → chunk.6DMCEBSO.js} +1 -1
  22. package/dist/preview/{chunk.NKLPL7QD.js → chunk.6IR5LBJU.js} +1 -1
  23. package/dist/preview/{chunk.X226YATK.js → chunk.6WB2TYK7.js} +1 -1
  24. package/dist/preview/chunk.6ZENHSTQ.js +1 -0
  25. package/dist/preview/{chunk.EJ2EZL2G.js → chunk.7K2V5FUB.js} +1 -1
  26. package/dist/preview/chunk.7OL6H4LF.js +1 -0
  27. package/dist/preview/{chunk.4W57E7AX.js → chunk.7TDML5YU.js} +1 -1
  28. package/dist/preview/{chunk.AJMVRFYX.js → chunk.7WPVLEX2.js} +2 -2
  29. package/dist/preview/{chunk.XSWSBTUO.js → chunk.7ZTGB4O7.js} +1 -1
  30. package/dist/preview/{chunk.FRQSLWP4.js → chunk.ACNOP2IU.js} +1 -1
  31. package/dist/preview/{chunk.N4ZKZ4GM.js → chunk.AENP662H.js} +1 -1
  32. package/dist/preview/{chunk.SFBHPYRD.js → chunk.AQ2PI6MR.js} +1 -1
  33. package/dist/preview/chunk.ARS4HJD2.js +1 -0
  34. package/dist/preview/{chunk.STPA7HBK.js → chunk.AWV57UBJ.js} +1 -1
  35. package/dist/preview/{chunk.D7NWMXSX.js → chunk.AYZL3LCR.js} +3 -3
  36. package/dist/preview/{chunk.URQTF5SY.js → chunk.BHJRT57H.js} +1 -1
  37. package/dist/preview/{chunk.7UHPHEH5.js → chunk.BPNW5KCP.js} +1 -1
  38. package/dist/preview/{chunk.TTSGCNPT.js → chunk.BQAFFEOA.js} +1 -1
  39. package/dist/preview/chunk.C2QKA6XY.js +1 -0
  40. package/dist/preview/{chunk.6KJGRM7A.js → chunk.CE3NKAF7.js} +1 -1
  41. package/dist/preview/{chunk.QRQ5WPZI.js → chunk.CFE3MHWZ.js} +1 -1
  42. package/dist/preview/{chunk.H6KIEDZN.js → chunk.CGBOPPNL.js} +1 -1
  43. package/dist/preview/{chunk.LP2ZMAT2.js → chunk.CNN32262.js} +1 -1
  44. package/dist/preview/{chunk.HJUZMOW2.js → chunk.DCLF4WWZ.js} +1 -1
  45. package/dist/preview/{chunk.GMLONS5L.js → chunk.DGDW54KE.js} +1 -1
  46. package/dist/preview/{chunk.3GNT5MKP.js → chunk.DLSS56EU.js} +1 -1
  47. package/dist/preview/{chunk.QAM76AXV.js → chunk.DMZRFXH7.js} +1 -1
  48. package/dist/preview/{chunk.Z2XUVJAL.js → chunk.DPHH5ZVL.js} +1 -1
  49. package/dist/preview/{chunk.Z27NSSYL.js → chunk.DZ6UDZOB.js} +2 -2
  50. package/dist/preview/{chunk.6W6XMLSF.js → chunk.E423JCOS.js} +1 -1
  51. package/dist/preview/{chunk.35KMZHB7.js → chunk.EB7PZJEO.js} +1 -1
  52. package/dist/preview/{chunk.V7H4BUEB.js → chunk.ECNGVD25.js} +1 -1
  53. package/dist/preview/{chunk.B7KZBT27.js → chunk.EGSOHTZZ.js} +1 -1
  54. package/dist/preview/{chunk.OCXY5DCD.js → chunk.EGVM24ND.js} +1 -1
  55. package/dist/preview/{chunk.UDHPMVC4.js → chunk.ENLIIZF2.js} +1 -1
  56. package/dist/preview/{chunk.H3EGBDW2.js → chunk.EP5JS7ZH.js} +1 -1
  57. package/dist/preview/{chunk.TI5FR2QQ.js → chunk.F5GNNVSQ.js} +1 -1
  58. package/dist/preview/chunk.FHQ25SWY.js +1 -0
  59. package/dist/preview/{chunk.F464JKHZ.js → chunk.FSW535EA.js} +1 -1
  60. package/dist/preview/{chunk.G5GVT6JY.js → chunk.FZELUSK5.js} +1 -1
  61. package/dist/preview/{chunk.UWS4RMM3.js → chunk.G2BDEWJC.js} +1 -1
  62. package/dist/preview/chunk.GF3ZCX46.js +2 -0
  63. package/dist/preview/{chunk.UW52CMGJ.js → chunk.GJTEV6CK.js} +1 -1
  64. package/dist/preview/{chunk.A7GVTE5Y.js → chunk.GKTQ5CZA.js} +2 -2
  65. package/dist/preview/{chunk.ZG5VGP5U.js → chunk.GONZB3J3.js} +1 -1
  66. package/dist/preview/{chunk.FLJXYESX.js → chunk.GRBWXTST.js} +1 -1
  67. package/dist/preview/{chunk.Z3O2VZAJ.js → chunk.GRTBEA7O.js} +1 -1
  68. package/dist/preview/{chunk.QNP5OR3P.js → chunk.H3IGXHZR.js} +2 -2
  69. package/dist/preview/{chunk.ILJDLBPJ.js → chunk.H3W5C3XQ.js} +1 -1
  70. package/dist/preview/{chunk.O5VFKVZS.js → chunk.H4VNIAHN.js} +1 -1
  71. package/dist/preview/{chunk.7ARRVNUR.js → chunk.HH4D3JEI.js} +1 -1
  72. package/dist/preview/{chunk.MUSMNKE4.js → chunk.HWFJQ42Y.js} +1 -1
  73. package/dist/preview/{chunk.37RFCHSS.js → chunk.HXTKBISQ.js} +1 -1
  74. package/dist/preview/{chunk.J2OPIS3H.js → chunk.I34BWUB4.js} +1 -1
  75. package/dist/preview/{chunk.ZAPS4J6G.js → chunk.I63462I3.js} +1 -1
  76. package/dist/preview/{chunk.6UQFV53C.js → chunk.IKKKHHRN.js} +1 -1
  77. package/dist/preview/{chunk.GRFD42WM.js → chunk.IPGLITWA.js} +1 -1
  78. package/dist/preview/{chunk.3NSV3WKM.js → chunk.IT5DVKXY.js} +2 -2
  79. package/dist/preview/{chunk.JQ2WNKDW.js → chunk.IXMIU4D4.js} +1 -1
  80. package/dist/preview/{chunk.JVB5KDSG.js → chunk.JCETQQ7J.js} +1 -1
  81. package/dist/preview/{chunk.M7KXQGQL.js → chunk.JGRSUTPJ.js} +1 -1
  82. package/dist/preview/{chunk.KFT7JIEH.js → chunk.JLDJZET2.js} +1 -1
  83. package/dist/preview/{chunk.JQ63N4MZ.js → chunk.JULD4XFB.js} +1 -1
  84. package/dist/preview/{chunk.LVOTLGJB.js → chunk.JV432T4Q.js} +1 -1
  85. package/dist/preview/{chunk.6SJEZWH3.js → chunk.KAM73WVF.js} +1 -1
  86. package/dist/preview/{chunk.AKJS2NUM.js → chunk.KUCBNMIY.js} +1 -1
  87. package/dist/preview/{chunk.DWM7AR5Y.js → chunk.L7XKYGV7.js} +1 -1
  88. package/dist/preview/{chunk.EP6Q32WT.js → chunk.LFFJB6D3.js} +1 -1
  89. package/dist/preview/{chunk.264PB572.js → chunk.LMTG5NPG.js} +1 -1
  90. package/dist/preview/{chunk.EGPCVMDU.js → chunk.LOKGUALC.js} +1 -1
  91. package/dist/preview/{chunk.FPHRAO3R.js → chunk.LZ6MSQ5O.js} +1 -1
  92. package/dist/preview/chunk.MBTEOF4R.js +1 -0
  93. package/dist/preview/{chunk.RJY7VJBH.js → chunk.MIOLBZBS.js} +1 -1
  94. package/dist/preview/{chunk.G3GFDVO2.js → chunk.MK5RPEB2.js} +1 -1
  95. package/dist/preview/{chunk.NSOPYIT4.js → chunk.MKL4THIV.js} +1 -1
  96. package/dist/preview/{chunk.FVQKSN33.js → chunk.MPWLDQOG.js} +1 -1
  97. package/dist/preview/chunk.MSUZAJ2K.js +4 -0
  98. package/dist/preview/{chunk.MSAYU25L.js → chunk.N5Z34V7U.js} +1 -1
  99. package/dist/preview/chunk.N64RVSH3.js +1 -0
  100. package/dist/preview/{chunk.HAOB6O72.js → chunk.ND3DEDWB.js} +1 -1
  101. package/dist/preview/{chunk.GFLH7RCI.js → chunk.NFTPJAMJ.js} +1 -1
  102. package/dist/preview/{chunk.QZQCQWQG.js → chunk.NRCWMYLH.js} +1 -1
  103. package/dist/preview/{chunk.47XEJZ3O.js → chunk.O2VXTYUJ.js} +1 -1
  104. package/dist/preview/{chunk.6N4PE3U5.js → chunk.O32F6LGK.js} +1 -1
  105. package/dist/preview/{chunk.PZ7KY6XH.js → chunk.O5FTWXA2.js} +1 -1
  106. package/dist/preview/{chunk.T2OUHRAA.js → chunk.ODYJEDIW.js} +1 -1
  107. package/dist/preview/{chunk.DKEIEH2D.js → chunk.OQ4ZO3YY.js} +1 -1
  108. package/dist/preview/chunk.PI4RFOBU.js +1 -0
  109. package/dist/preview/{chunk.E5PYNAYT.js → chunk.PIMAG4WT.js} +2 -2
  110. package/dist/preview/{chunk.EFVSZKB5.js → chunk.PLIV3IQK.js} +1 -1
  111. package/dist/preview/{chunk.77C556NM.js → chunk.PPCDPYYU.js} +1 -1
  112. package/dist/preview/{chunk.MW7R5G3C.js → chunk.PZQ5P6WK.js} +1 -1
  113. package/dist/preview/chunk.Q42R2KW4.js +1 -0
  114. package/dist/preview/{chunk.WEMUKZKH.js → chunk.Q4VFLLUT.js} +1 -1
  115. package/dist/preview/{chunk.SY5ID44D.js → chunk.Q6H5HESF.js} +1 -1
  116. package/dist/preview/chunk.QM54TGU6.js +3 -0
  117. package/dist/preview/{chunk.HN4ZJ4B4.js → chunk.QOQ26NXM.js} +1 -1
  118. package/dist/preview/{chunk.SJQPTDAT.js → chunk.QUETLFBJ.js} +1 -1
  119. package/dist/preview/{chunk.P2EKKKK2.js → chunk.QWLK3GKG.js} +1 -1
  120. package/dist/preview/{chunk.JEC5FDKX.js → chunk.QYPU444Y.js} +1 -1
  121. package/dist/preview/{chunk.TXZQEJ5T.js → chunk.QZP3ARLH.js} +1 -1
  122. package/dist/preview/{chunk.WALVW3KJ.js → chunk.R3GE37OI.js} +1 -1
  123. package/dist/preview/chunk.R66ZVMWB.js +1 -0
  124. package/dist/preview/{chunk.YZPESGCP.js → chunk.RQG672MJ.js} +1 -1
  125. package/dist/preview/chunk.RYA7A4NA.js +1 -0
  126. package/dist/preview/{chunk.LRNFE3UK.js → chunk.SADR3MQI.js} +1 -1
  127. package/dist/preview/{chunk.MJY4SLWA.js → chunk.SS6KL5NT.js} +1 -1
  128. package/dist/preview/chunk.SUG6LIOX.js +1 -0
  129. package/dist/preview/{chunk.SO6NT5K7.js → chunk.TFJA4QV4.js} +1 -1
  130. package/dist/preview/{chunk.D4WJ7OM5.js → chunk.TOUSIUJF.js} +1 -1
  131. package/dist/preview/{chunk.ARWO4WOV.js → chunk.TR4YFVZN.js} +1 -1
  132. package/dist/preview/{chunk.XFLGSUYO.js → chunk.TRNJKHIA.js} +1 -1
  133. package/dist/preview/{chunk.5AKZROMR.js → chunk.TVWK3SGD.js} +1 -1
  134. package/dist/preview/chunk.U7PAFLUM.js +1 -0
  135. package/dist/preview/{chunk.NKYWIGC7.js → chunk.UAMPR4MD.js} +1 -1
  136. package/dist/preview/{chunk.UGQYMN4J.js → chunk.UD7VLXPM.js} +1 -1
  137. package/dist/preview/{chunk.UQIPEMJ5.js → chunk.UFURYU4R.js} +1 -1
  138. package/dist/preview/{chunk.R6JBA7UK.js → chunk.UODTUBQ7.js} +1 -1
  139. package/dist/preview/{chunk.NRURQGXV.js → chunk.VES4XMZX.js} +1 -1
  140. package/dist/preview/{chunk.QWGWOEBZ.js → chunk.VLXLBGMY.js} +1 -1
  141. package/dist/preview/{chunk.IDALEKIW.js → chunk.VTDOWXCP.js} +1 -1
  142. package/dist/preview/{chunk.4EMKCKDB.js → chunk.VV5JAM5W.js} +1 -1
  143. package/dist/preview/{chunk.JU6UFWS3.js → chunk.VW632VNJ.js} +1 -1
  144. package/dist/preview/{chunk.25QFDTCU.js → chunk.WC5WE34A.js} +1 -1
  145. package/dist/preview/chunk.WN7SAAH6.js +1 -0
  146. package/dist/preview/{chunk.4UUJHLHR.js → chunk.WV45KLXC.js} +1 -1
  147. package/dist/preview/{chunk.NAXOXBOF.js → chunk.XDZDNZ7B.js} +1 -1
  148. package/dist/preview/{chunk.MAKCZ6B6.js → chunk.XFH6GHBQ.js} +1 -1
  149. package/dist/preview/{chunk.2VUX54XH.js → chunk.XRE7SHLD.js} +1 -1
  150. package/dist/preview/{chunk.J6HF7IRQ.js → chunk.XXCHO2A5.js} +1 -1
  151. package/dist/preview/{chunk.A4EZAGG7.js → chunk.Y7OGJOPA.js} +1 -1
  152. package/dist/preview/{chunk.6NG76MDA.js → chunk.YBQ5GVAX.js} +2 -2
  153. package/dist/preview/{chunk.QF5QB5YR.js → chunk.YL2RBZFE.js} +1 -1
  154. package/dist/preview/{chunk.RSQ432QN.js → chunk.YM6SWEUI.js} +1 -1
  155. package/dist/preview/{chunk.7BJRHPE3.js → chunk.Z2X7BFCB.js} +2 -2
  156. package/dist/preview/{chunk.VBLQJVQ5.js → chunk.Z67LBSQO.js} +1 -1
  157. package/dist/preview/{chunk.OHAO6KKH.js → chunk.ZKXIZBCN.js} +1 -1
  158. package/dist/preview/{chunk.BDNQMKDG.js → chunk.ZLEBOR5T.js} +1 -1
  159. package/dist/preview/{chunk.CKDCTFLU.js → chunk.ZLNUZ6LR.js} +1 -1
  160. package/dist/preview/chunk.ZMADWPJO.js +1 -0
  161. package/dist/preview/chunk.ZO6VMEPP.js +1 -0
  162. package/dist/preview/chunk.ZUG7U7AT.js +1 -0
  163. package/dist/preview/index.html +55 -55
  164. package/dist/preview/page.js +2 -2
  165. package/package.json +6 -6
  166. package/dist/preview/chunk.2FHIINXG.js +0 -2
  167. package/dist/preview/chunk.3ENPWZBG.js +0 -1
  168. package/dist/preview/chunk.3ZODN6BW.js +0 -1
  169. package/dist/preview/chunk.55G4IPOO.js +0 -1
  170. package/dist/preview/chunk.5J6DVR7S.js +0 -1
  171. package/dist/preview/chunk.7WHQWLL6.js +0 -1
  172. package/dist/preview/chunk.B5SJMCTT.js +0 -7
  173. package/dist/preview/chunk.CTUJZ3IV.js +0 -1
  174. package/dist/preview/chunk.CY7FFKEZ.js +0 -1
  175. package/dist/preview/chunk.DEKRFTRN.js +0 -4
  176. package/dist/preview/chunk.EBKH3ILT.js +0 -1
  177. package/dist/preview/chunk.FOUBDGL3.js +0 -1
  178. package/dist/preview/chunk.HB5NWHFP.js +0 -3
  179. package/dist/preview/chunk.HVBKI5ZO.js +0 -1
  180. package/dist/preview/chunk.I3SDKMQS.js +0 -1
  181. package/dist/preview/chunk.J5OLYVZ4.js +0 -1
  182. package/dist/preview/chunk.JKFVNQY7.js +0 -1
  183. package/dist/preview/chunk.KGMSSXZL.js +0 -1
  184. package/dist/preview/chunk.NXZL5CA2.js +0 -1
  185. package/dist/preview/chunk.PSNMZBVS.js +0 -1
  186. package/dist/preview/chunk.R7CRBRD4.js +0 -1
  187. package/dist/preview/chunk.RR25BGWP.js +0 -1
  188. package/dist/preview/chunk.T27QKVKP.js +0 -1
  189. package/dist/preview/chunk.T3WCRS6M.js +0 -1
@@ -1,4 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Yt,f as ct,g as Nn}from"./chunk.GVT4UUQA.js";import{h as Li}from"./chunk.J6HF7IRQ.js";import{e as Ai,q as sr,r as Pi}from"./chunk.LRNFE3UK.js";import{b as Hn}from"./chunk.YCD4JSXD.js";import{a as Fe,b as Zr,c as cn,d as Ci,e as Jr}from"./chunk.ZG5VGP5U.js";import{a as Oi}from"./chunk.URQTF5SY.js";import{a as Mi,b as Ei,c as Ri}from"./chunk.MSAYU25L.js";import{b as ki,d as Si}from"./chunk.EGPCVMDU.js";import{c as Go}from"./chunk.6N4PE3U5.js";import{A as xi,C as vi,a as fi,b as Kr,c as Ur,f as Xr,g as qr,h as Qr,i as mi,j as sn,k as dn,p as Gt,q as ln,r as yi,s as wi,z as bi}from"./chunk.QRQ5WPZI.js";import{A as si,B as di,C as li,D as ci,E as ui,f as Jo,g as on,h as ei,i as ti,j as ni,k as ri,m as ar,n as Tn,o as In,p as an,q as _r,r as oi,s as ii,z as ai}from"./chunk.RD2FSSLV.js";import{a as pi,b as gi}from"./chunk.37RFCHSS.js";import{b as hi}from"./chunk.JQ63N4MZ.js";import{A as wt,B as Fr,C as Ln,G as Oe,K as Ot,L as Uo,La as Cn,Qa as Vr,Ra as zr,Sa as zt,Ua as Gr,W as Ae,Y as or,Ya as Yr,Z as Wr,a as Ir,b as Nr,ba as jr,c as Hr,ca as ir,d as Yo,da as jt,e as _o,ea as ve,f as nr,ga as Vt,h as Ft,j as Et,k as Br,l as rr,la as Xo,m as An,ma as qo,p as Dr,pa as rn,r as Re,ra as Qo,s as He,t as Ko,u as Pn,v as Be,w as Wt,x as Rt,xa as Zo,y as $r}from"./chunk.A5PSEU3W.js";import{a as nn}from"./chunk.SDO3U72B.js";import{Rc as On,Yd as Tr,_d as jo,ga as Jn,ka as Fo,la as en,na as tn,oa as $t,oe as Vo,pa as er,rd as We,re as zo,ua as Wo,ye as tr}from"./chunk.ZEZUKRC6.js";import{b as de}from"./chunk.AJZBJBMO.js";var dr=de(Oe(),1);var Ti=de(Ae(),1);function lr(e){let t=(0,dr.useRef)(e);t.current=e;let n=(0,dr.useRef)(null),o=(0,dr.useRef)(new Map),r=n.current;if(r&&(r.outer===e||Ts(r.outer,e)))return r.outer=e,r.inner;let i=ct(e.view,null),s=(c,l,a)=>{let u=o.current.get(c);return u&&u.made===l?u.call:(o.current.set(c,{made:l,call:a}),a)},d=Object.fromEntries(Object.entries(e).map(([c,l])=>[c,c==="view"?i:c==="setView"?s(c,l,Cs(t)):typeof l=="function"?s(c,l,(...a)=>t.current[c](...a)):l]));return n.current={outer:e,inner:d},d}function Cs(e){return t=>e.current.setView(typeof t=="function"?t:n=>t.pan===void 0&&n.pan?{...t,pan:n.pan}:t)}function Ts(e,t){let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let o of n){if(o==="view"||o==="movedByHand")continue;let r=e[o],i=t[o];if(r!==i&&!(typeof r=="function"&&typeof i=="function"))return!1}return eo(e.view,t.view)}function eo(e,t){if(e===t)return!0;let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let o of n)if(o!=="pan"&&e[o]!==t[o])return!1;return!0}function Is({children:e}){let t=lr(ve());return(0,Ti.jsx)(or.Provider,{value:t,children:e})}var Ii={width:1200,height:760,focusSize:{width:1200,height:420},relationSize:{width:240,height:140},contextSize:{width:300,height:104},gap:16,unit:16};var Ni=(e,t)=>e?`${e.edgeKind}|${e.direction}`:`raised|${t}`,_t=(e,t,n)=>`${Fr}${e}|${t}|${n}`;function cr(e,t){let n=e.map(()=>0),o=e.map((s,d)=>({size:s,index:d})).sort((s,d)=>s.size-d.size||s.index-d.index),r=Math.max(t,e.length),i=e.length;for(let{size:s,index:d}of o){let c=Math.max(1,Math.floor(r/i));n[d]=Math.min(s,c),r-=n[d],i-=1}return n}function no(e){return Ni(e.via,e.node.kind)}function un(e,t,n=[]){let o=[],r=0;return e.forEach((i,s)=>{if(i<=0)return;let d=Math.min(t,Math.max(1,n[s]??1)),c=Math.max(i,d);if(o.length>0&&i<=t&&c<=r){o[o.length-1].push({run:s,cards:i,slots:c}),r-=c;return}let l=i,a=!0;for(;l>0;){let u=Math.min(t,l),m=a?Math.max(u,d):u;o.push([{run:s,cards:u,slots:m}]),l-=u,r=t-m,a=!1}}),o}function ro(e,t,n,o=[]){let r=cr(e,t*n);for(;un(r,t,o).length>n;){let i=-1;if(r.forEach((s,d)=>{s>1&&(i<0||s>r[i])&&(i=d)}),i<0)break;r[i]=r[i]-1}return r}function Ns(e,t,n){let o=r=>[t.chosen?.has(r.id)?0:1,t.hits?.has(r.id)?0:1,t.flagged?.has(r.id)?0:1,-(t.touched?.get(r.id)??0),-n.neighbors(r.id).length];return e.map((r,i)=>({node:r,index:i,key:o(r)})).sort((r,i)=>{for(let s=0;s<r.key.length;s++)if(r.key[s]!==i.key[s])return r.key[s]-i.key[s];return r.index-i.index}).map(r=>r.node)}var Hs=5,Bs=(e,t)=>{for(let n=0;n<e.length;n++)if(e[n]!==t[n])return e[n]<t[n];return!1};function Hi(e,t,n){if(e.length===0||t<2)return;let o=e[0].kind,r={schema:n.schema,graph:n.graph,...n.today?{today:n.today}:{}},i=[];for(let d of Ai(n.schema,o).groups)if(d.key!==n.exclude)if(d.buckets)for(let c of["decade","year","month"])i.push({by:d.key,bucket:c});else i.push({by:d.key});let s;return i.forEach((d,c)=>{let a=Li(e,{group:d},r).groups;if(a.length<2||a.length>t)return;let m=a.filter(b=>b.key!=="").reduce((b,h)=>b+h.nodes.length,0)/e.length;if(m<.5||a.some(b=>b.nodes.length>e.length*.75))return;let f=[-Math.round(m*100),Math.abs(a.length-Hs),c];(!s||Bs(f,s.score))&&(s={grouping:{by:d.by,...d.bucket?{bucket:d.bucket}:{},groups:a},score:f})}),s?.grouping}function oo(e,t){let n=h=>({id:h.node.id,kind:h.node.kind,node:h.node,...h.via?{via:h.via}:{}});if(e.length<=t.budget)return e.map(n);let o={...t.relevance,chosen:new Set([...t.relevance?.chosen??[],...t.selection??[]])},r=new Map;for(let h of e){let y=Ni(h.via,h.node.kind),M=r.get(y);M?M.push(h):r.set(y,[h])}let i=[...r.entries()].map(([h,y])=>({key:h,run:y,via:y[0].via,kinds:[...new Set(y.map(M=>M.node.kind))],members:[],whole:!1,extra:0})),s=cr(i.map(h=>h.run.length),t.budget);i.forEach((h,y)=>h.whole=h.run.length<=s[y]);let d=i.filter(h=>!h.whole),c=i.filter(h=>h.whole).reduce((h,y)=>h+y.run.length,0),l=Math.max(d.length,t.budget-c);for(let h of d){h.members=Ns(h.run.map(M=>M.node),o,t.graph);let y=l-(d.length-1);h.kinds.length>1&&h.kinds.length<=y?h.byKind=!0:h.kinds.length===1&&(h.grouping=Hi(h.members,y,{schema:t.schema,graph:t.graph,...h.via?{exclude:h.via.edgeKind}:{},...t.today?{today:t.today}:{}}))}let a=h=>h.byKind?h.kinds.length:h.grouping?h.grouping.groups.length:1;for(;d.reduce((h,y)=>h+a(y),0)>l;){let h=[...d].filter(y=>a(y)>1).sort((y,M)=>a(M)-a(y))[0];if(!h)break;h.grouping=void 0,h.byKind=!1}l-=d.reduce((h,y)=>h+a(y),0);let u=h=>h.byKind?h.kinds.some(y=>t.expanded.has(_t(y,h.key,"kind"))):h.grouping?.groups.some(y=>t.expanded.has(_t(h.kinds[0],h.key,to(h.grouping,y.key)))),m=d.filter(h=>!h.grouping&&!h.byKind?!0:u(h)),f=cr(m.map(h=>h.members.length),Math.max(0,l));m.forEach((h,y)=>h.extra=l>0?f[y]:0);let b=[];for(let h of i){let{key:y,via:M}=h;if(h.whole){b.push(...h.run.map(n));continue}let v=g=>({id:g.id,kind:g.kind,node:g,...M?{via:M}:{}}),w=new Map(h.run.map((g,S)=>[g.node.id,S])),x=(g,S,L)=>{let C=[...g.slice(0,S)].sort((ae,I)=>w.get(ae.id)-w.get(I.id));b.push(...C.map(v));let V=g.slice(S);if(V.length===0)return;let X=V[0].kind;b.push({id:_t(X,y,L?`more:${L}`:"more"),kind:X,...M?{via:M}:{},aggregate:{kind:X,memberIds:V.map(ae=>ae.id),label:S>0?`${V.length} more ${t.plural(X).toLowerCase()}`:`${V.length} ${t.plural(X).toLowerCase()}`,opens:{in:"picture",focus:Be(X),within:L?{filter:L}:{}}}})},O=M&&t.focusId?`${M.edgeKind}:${t.focusId}`:void 0;if(h.byKind){let g=h.kinds.find(S=>t.expanded.has(_t(S,y,"kind")));for(let S of h.kinds){let L=h.members.filter(C=>C.kind===S);if(S===g){let C=h.extra+1;L.length<=C?b.push(...L.map(v)):x(L,C-1,O);continue}b.push({id:_t(S,y,"kind"),kind:S,...M?{via:M}:{},aggregate:{kind:S,memberIds:L.map(C=>C.id),label:t.plural(S),opens:{in:"place"}}})}continue}let E=h.grouping;if(!E){x(h.members,h.extra,O);continue}let T=h.kinds[0],D=E.groups.find(g=>t.expanded.has(_t(T,y,to(E,g.key))));for(let g of E.groups){if(g===D){let S=h.members.filter(C=>g.nodes.includes(C)),L=h.extra+1;if(S.length<=L)b.push(...S.map(v));else{let C=g.key!==""&&!g.key.includes(",")&&!E.bucket,V=[O,C?`${E.by}:${g.key}`:void 0].filter(Boolean).join(",")||void 0;x(S,L-1,V)}continue}b.push({id:_t(T,y,to(E,g.key)),kind:T,...M?{via:M}:{},aggregate:{kind:T,memberIds:h.members.filter(S=>g.nodes.includes(S)).map(S=>S.id),label:g.label.charAt(0).toUpperCase()+g.label.slice(1),opens:{in:"place"}}})}}return b}var to=(e,t)=>`${e.by}${e.bucket?`:${e.bucket}`:""}=${t||"none"}`;var ur=300,Bi=12,hn=8,io=19;var hr=(e,t=1)=>(e.length*8.4+16)*t;function Bn(e){return e.description??`${e.direction==="in"?"\u2190":"\u2192"} ${Jn(e.edgeKind).toLowerCase()}`}function ao(e,t,n=1){let o=d=>hr(d,n),r=new Map;for(let d of e){let c=r.get(d.key);c?c.push(d):r.set(d.key,[d])}let i=[...r.values()].map(d=>{let c=Math.min(...d.map(a=>a.top)),l=d.filter(a=>a.top-c<=Bi);return{key:d[0].key,text:d[0].text,left:Math.min(...l.map(a=>a.left)),right:Math.max(...l.map(a=>a.right)),top:c}});i.sort((d,c)=>d.top-c.top||d.left-c.left);let s=i.map(d=>{let c=Math.max(d.right-d.left,Math.min(ur,o(d.text))),l=(d.left+d.right)/2;return{left:l-c/2,right:l+c/2}});return i.map((d,c)=>{let l=i.map((w,x)=>({other:w,at:x})).filter(({other:w})=>w!==d&&Math.abs(w.top-d.top)<=Bi),a=l.filter(({other:w})=>w.right<=d.left).map(({other:w,at:x})=>s[x].right+hn<=(w.right+d.left)/2?s[x].right+hn:(w.right+d.left+hn)/2),u=l.filter(({other:w})=>w.left>=d.right).map(({other:w,at:x})=>s[x].left-hn>=(d.right+w.left)/2?s[x].left-hn:(d.right+w.left-hn)/2),m=Math.max(t.left,...a),f=Math.min(t.right,...u),b=d.right-d.left,h=s[c].right-s[c].left,y=Math.max(b,Math.min(h,f-m)),M=(d.left+d.right)/2,v=b>=y?d.left:Math.max(m,Math.min(M-y/2,f-y));return{key:d.key,text:d.text,left:v,width:y,top:d.top}})}function $i(e,t,n,o,r=1){let i=d=>String(d).length*7.4,s=e.length*8.6+6+i(t)+14+(n>0?22+i(n):0);return{width:Math.max(s,o?184:0)*r,height:(o?38:22)*r,short:{width:s*r,height:22*r}}}function Kt(e,t,n=6){return e.x<t.x+t.width+n&&t.x<e.x+e.width+n&&e.y<t.y+t.height+n&&t.y<e.y+e.height+n}var so=(e,t,n,o)=>{let r=Math.max(e.x,Math.min(t.x,e.x+e.width)),i=Math.max(e.y,Math.min(t.y,e.y+e.height));return Math.abs(r-t.x)/n+Math.abs(i-t.y)/o<.92},Dn=4,Di=.45;function lo(e,t,n,o={},r={}){let i={};for(let k of e)i[k.kind]=k.count;let s={x:(o.left??0)+8,y:(o.top??0)+8,width:n.width-(o.left??0)-(o.right??0)-16,height:n.height-(o.top??0)-(o.bottom??0)-16},d=r.avoid??[],c=r.tilt??.5,l=k=>k.nameplate??{width:120,height:34,short:{width:90,height:20}},a=k=>e.map(R=>{let B=k.get(R.kind);return{card:R,plot:B,center:cn(B.col+B.side/2,B.row+B.side/2,1,c)}}),u=(k,R)=>{let B=1/0,G=-1/0,A=1/0,F=-1/0;for(let{card:z,plot:_,center:Z}of k){let ne=Z.x*R,J=Z.y*R,fe=_.side*R/2,ie=z.opened>0?l(z).width:l(z).short.width;B=Math.min(B,ne-Math.max(fe+(z.count>12?30:0),ie/2)),G=Math.max(G,ne+Math.max(fe,ie/2)),A=Math.min(A,J-fe*c-R*Di),F=Math.max(F,J+fe*c+Dn+l(z).short.height)}return{minX:B,maxX:G,minY:A,maxY:F}},m=k=>{let R=4,B=160;for(let G=0;G<24;G++){let A=(R+B)/2,F=u(k,A);F.maxX-F.minX<=s.width&&F.maxY-F.minY<=s.height?R=A:B=A}return R},f=k=>{let R={...r.order?{order:r.order}:{},counts:i,...r.plots?{plots:r.plots}:{},pitch:k},B=Zr(t,R),G=Zr(t,{...R,upright:!0}),A=m(a(B)),F=m(a(G)),z=n.height>n.width&&F>=A?G:B;return{map:z,fitted:z===G?F:A}},b=[],h=new Map,y=0,M=(k,R={x:0,y:0})=>{let B=u(b,k),G=s.x+s.width/2-(B.minX+B.maxX)/2+R.x,A=s.y+s.height/2-(B.minY+B.maxY)/2+R.y;return{originX:G,originY:A,cell:k}},v=k=>{let{originX:R,originY:B,cell:G}=k,A=b.map(({center:_})=>_.y),F=Math.max(...A),z=Math.min(...A);return b.map(({card:_,plot:Z,center:ne})=>{let J=R+ne.x*G,fe=B+ne.y*G,ie=Z.side*G/2,se=ie*c,we=F===z?.5:(ne.y-z)/(F-z);return{card:_,plot:Z,x:J,y:fe,halfW:ie,halfH:se,depth:1-we*.65}})},w=(k,R=!0)=>{let B=[];return[...k].sort((A,F)=>(F.card.weight??F.card.count)-(A.card.weight??A.card.count)||e.indexOf(A.card)-e.indexOf(F.card)).filter(A=>[l(A.card),l(A.card).short].some(F=>{let z=E(A,F),_=(!R||z.x>=0&&z.y>=0&&z.x+z.width<=n.width&&z.y+z.height<=n.height)&&!B.some(Z=>Kt(z,Z,4))&&!k.some(Z=>Z!==A&&so(z,Z,Z.halfW,Z.halfH))&&!d.some(Z=>Kt(z,Z,0));return _&&B.push(z),_})).length},x=k=>k.card.marquee?{x:k.x-k.card.marquee.width/2,y:k.y+k.halfH+Dn+l(k.card).height,width:k.card.marquee.width,height:k.card.marquee.height}:null,O=(k,R,B)=>B.some(G=>{if(G===R)return!1;let A=x(G);return A!==null&&Kt(k,A,4)}),E=(k,R,B="under")=>B==="aside"?{x:k.x+k.halfW+Dn,y:k.y-R.height/2,width:R.width,height:R.height}:B==="above"?{x:k.x-R.width/2,y:k.y-k.halfH-Dn-Di*S.cell-R.height,width:R.width,height:R.height}:{x:k.x-R.width/2,y:k.y+k.halfH+Dn,width:R.width,height:R.height},T=k=>k.some(R=>d.some(B=>so(B,R,R.halfW,R.halfH)||Kt(B,E(R,l(R.card).short),0))),D=k=>k.every(R=>{let B=E(R,l(R.card).short);return R.x-R.halfW>=0&&R.x+R.halfW<=n.width&&R.y-R.halfH>=0&&B.x>=0&&B.x+B.width<=n.width&&B.y+B.height<=n.height}),g={pitch:Fe,said:-1};for(let k of[Fe,Fe+1,Fe+2,Fe+3,Fe+5,Fe+7]){({map:h,fitted:y}=f(k)),b=a(h);let R=w(v(M(y)));if(R>g.said&&(g={pitch:k,said:R}),R===e.length)break}(g.pitch!==Fe+7||g.said!==e.length)&&({map:h,fitted:y}=f(g.pitch),b=a(h));let S=M(y);if(d.length>0&&T(v(S))){let k;for(let R=1;R>=.3&&!k;R-=.05){let B=y*R,G=Math.max(...d.map(F=>F.width))/2+B,A=Math.max(...d.map(F=>F.height))/2+B/2;for(let F of[0,.5,.75,1,1.25]){for(let[z,_]of[[1,0],[-1,0],[0,1],[0,-1],[1,1],[-1,1],[1,-1],[-1,-1]]){let Z=M(B,{x:z*G*F,y:_*A*F}),ne=v(Z);if(!T(ne)&&D(ne)){k=Z;break}if(F===0)break}if(k)break}}k&&(S=k)}let L=(k,R,B={x:n.width/2,y:n.height/2})=>({cell:k.cell*R,originX:B.x+(k.originX-B.x)*R,originY:B.y+(k.originY-B.y)*R}),C=k=>{let R=k,B=r.stood&&Math.abs(r.stood.cell-R.cell)<.01?r.stood:null;B&&(R={...R,originX:R.originX+B.x,originY:R.originY+B.y});let G={x:R.originX-(B?.x??0),y:R.originY-(B?.y??0)},A=v(R).filter(F=>r.keep?.includes(F.card.kind));if(A.length>0){let F=r.seen??n,z=A.flatMap(re=>[{x:re.x-re.halfW,y:re.y-re.halfH,width:re.halfW*2,height:re.halfH*2},E(re,l(re.card))]),_=r.seen?A.flatMap(re=>x(re)??[]):[],Z=re=>Math.max(...re.map(ee=>ee.y+ee.height))-Math.min(...re.map(ee=>ee.y)),ne=_.length>0&&Z([...z,..._])<=F.height-16?[...z,..._]:z,J=Math.min(...ne.map(re=>re.x)),fe=Math.max(...ne.map(re=>re.x+re.width)),ie=Math.min(...ne.map(re=>re.y)),se=Math.max(...ne.map(re=>re.y+re.height)),we=(re,ee,le)=>ee-re>le-16?le/2-(re+ee)/2:re<8?8-re:ee>le-8?le-8-ee:0;(!r.seen||se-ie<=F.height-16)&&(R={...R,originX:R.originX+we(J,fe,F.width),originY:R.originY+we(ie,se,F.height)})}return{where:R,stood:{x:R.originX-G.x,y:R.originY-G.y,cell:R.cell}}},V=1,X;if(w(v(S))<e.length){let k={said:w(v(S),!1),area:1/0,pitch:-1,by:1},R={map:h,shape:b,fitted:y,where:S};for(let B of[Fe,Fe+1,Fe+2,Fe+3,Fe+5,Fe+7]){({map:h,fitted:y}=f(B)),b=a(h);let G=M(y);for(let A=1;A<=3.001;A+=.1){let F=w(v(L(G,A)),!1),z=u(b,y*A),_=(z.maxX-z.minX)*(z.maxY-z.minY);if((F>k.said||F===k.said&&_<k.area)&&(k={said:F,area:_,pitch:B,by:A}),F===e.length)break}}k.pitch<0?{map:h,shape:b,fitted:y,where:S}=R:({map:h,fitted:y}=f(k.pitch),b=a(h),V=k.by,S=L(M(y),V)),{where:S,stood:X}=C(S)}else r.seen&&r.seen.height<n.height&&({where:S,stood:X}=C(S));let ae=r.zoom&&r.zoom!==1?r.zoom:1;ae!==1&&(S=L(S,ae,r.seen?{x:r.seen.width/2,y:r.seen.height/2}:void 0));let I=v(S),$=[],N=new Map,q=new Map,P=[...I].sort((k,R)=>(R.card.weight??R.card.count)-(k.card.weight??k.card.count)||e.indexOf(k.card)-e.indexOf(R.card));for(let k of P){let R=[["full",l(k.card),"under"],["short",l(k.card).short,"under"]],B="none",G=k===P[0],A=(z,_)=>R.filter(([Z])=>Z.startsWith(_)).map(([Z,ne,J])=>[Z,ne,J,z]),F=G?[...A(!1,"full"),...A(!1,"short"),...A(!0,"full"),...A(!0,"short")]:R.map(([z,_,Z])=>[z,_,Z,!1]);for(let[z,_,Z,ne]of F){let J=E(k,_,Z);if((ae!==1||V!==1||J.x>=0&&J.y>=0&&J.x+J.width<=n.width&&J.y+J.height<=n.height)&&!$.some(se=>Kt(J,se,4))&&(ne||!I.some(se=>se!==k&&so(J,se,se.halfW,se.halfH)))&&!O(J,k,I)&&!d.some(se=>Kt(J,se,0))){B=z,$.push(J),q.set(k.card.id,J);break}}N.set(k.card.id,B)}let j=I.map(k=>({id:k.card.id,x:k.x-k.halfW,y:k.y-k.halfH,width:k.halfW*2,height:k.halfH*2+(k.card.opened>0?Math.max(k.card.openedMin??0,k.card.opened):0),depth:k.depth,plot:k.plot,nameplate:N.get(k.card.id)??"none"})),W=u(b,S.cell),Q={cell:S.cell,originX:S.originX,originY:S.originY,pan:r.pan??{x:0,y:0},extent:{x:S.originX+W.minX,y:S.originY+W.minY,width:W.maxX-W.minX,height:W.maxY-W.minY},openedShare:1,...c!==.5?{tilt:c}:{},...X&&(X.x!==0||X.y!==0)?{stood:X}:{},...q.size>0?{nameplates:I.flatMap(k=>{let R=q.get(k.card.id);return R?[{id:k.card.id,x:R.x-(k.x-k.halfW),y:R.y-(k.y-k.halfH),width:R.width,height:R.height}]:[]})}:{},...I.some(k=>k.card.marquee)?{showings:I.flatMap(k=>{let R=x(k);return R?[{id:k.card.id,x:R.x-(k.x-k.halfW),y:R.y-(k.y-k.halfH),width:R.width,height:R.height}]:[]})}:{}};return{placed:j,frame:Q,map:h}}function At(e){let{width:t,height:n}=e.visible??e,o={x:t*.45,y:n*.45};if(!e.city)return o;let{extent:r}=e.city,i=24;return{x:Math.max(o.x,r.x+r.width-t+i,-r.x+i),y:Math.max(o.y,r.y+r.height-n+i,-r.y+i)}}var fr=48;function co(e){if(!e.city)return[];let{width:t,height:n}=e.visible??e,o=[];for(let r of e.nodes){if(!r.id.startsWith("kind:")||Math.round(r.plane)!==2)continue;let i=r.x+r.width/2,s=r.y+r.height/2,d=i<0?"left":i>t?"right":s<0?"top":s>n?"bottom":null;if(!d)continue;let c=d==="left"||d==="right",l=c?Math.max(0,Math.min(n,s)):Math.max(0,Math.min(t,i)),a=(f,b)=>f<b/4?b/4-f:f>b*3/4?b*3/4-f:0,u=(f,b)=>f<fr?fr-f:f>b-fr?b-fr-f:0,m=c?{x:a(i,t),y:u(s,n)}:{x:u(i,t),y:a(s,n)};o.push({id:r.id,kind:r.id.slice(5),side:d,along:l,by:m})}return o}function mr(e,t,n,o,r){return{x:e.x+(n.x-e.x-t.x-o.x)*(1-r),y:e.y+(n.y-e.y-t.y-o.y)*(1-r)}}var Ds={rankOf:()=>{},parentOf:()=>{}};function Fi(e,t){if(t.size===0)return Ds;let n=e.kinds,o=new Map,r=(l,a)=>{l!==a&&((o.get(l)??o.set(l,new Set).get(l)).add(a),(o.get(a)??o.set(a,new Set).get(a)).add(l))};for(let l of n){let a=e.tryDefinition(l);if(a)for(let u of Object.values(a.edges??{})){let m=u.to==="*"?n:u.to;for(let f of m)r(l,f)}}let i=new Map,s=new Map,d=[...t].filter(l=>n.includes(l));for(let l of d)i.set(l,0);let c=0;for(;d.length>0;){c+=1;let l=[];for(let a of[...d].sort((u,m)=>n.indexOf(u)-n.indexOf(m)))for(let u of[...o.get(a)??[]].sort((m,f)=>n.indexOf(m)-n.indexOf(f)))i.has(u)||(i.set(u,c),c===2&&s.set(u,a),l.push(u));d=l}return{rankOf:l=>{let a=i.get(l);if(a!==0)return a===1?"primary":"secondary"},parentOf:l=>s.get(l)}}function Wi(e,t,n,o,r={}){if(n){let i=new Map;for(let s of e.allEdges()){if(o&&s.kind!==o)continue;let d=s.from===n.id?s.to:s.to===n.id?s.from:null;if(d===null||d===n.id)continue;let c=e.getNode(d);if(!c||i.has(d))continue;let l=s.from===n.id?"out":"in",a=l==="out"?n.kind:c.kind,u=$s(t,a,s.kind,l);i.set(d,{node:c,via:{edgeKind:s.kind,direction:l,...u?{description:u}:{}}})}if(i.size>0){let s=d=>`${d.via.edgeKind}|${d.via.description??""}`;return[...i.values()].sort((d,c)=>(s(d)<s(c)?-1:s(d)>s(c)?1:0)||wt(d.node,c.node))}}if(n){let i=r[n.id]??[],s=new Set,d=[];for(let c of i){if(c===n.id||s.has(c))continue;let l=e.getNode(c);l&&(o&&o!=="judges"&&l.kind!==o||(s.add(c),d.push({node:l,via:{edgeKind:"judges",direction:"out",description:"what it finds wrong"}})))}if(d.length>0)return d.sort((c,l)=>wt(c.node,l.node))}return o?e.allNodes().filter(i=>i.kind===o).sort(wt).map(i=>({node:i})):[]}function $s(e,t,n,o){let i=e.tryDefinition(t)?.edges?.[n];return o==="out"?i?.description:i?.inverse}function ji(e,t,n){let o=new Map,r=[...t.values()].sort((l,a)=>l.plane-a.plane);for(let l of r)for(let a of l.aggregate?.memberIds??[])!t.has(a)&&!o.has(a)&&o.set(a,l.id);let i=l=>t.get(l)??t.get(o.get(l)??""),s=new Map,d=new Map,c=new Map;for(let l of e.allEdges()){let a=i(l.from),u=i(l.to);if(!a||!u||a.id===u.id&&!(n.overview&&a.aggregate&&a.plane===2))continue;let m=`${l.kind}:${a.id}:${u.id}`,f=s.get(m);if(f){let b=`${l.from}
2
- ${l.to}`,h=d.get(m);if(h.has(b))continue;if(h.add(b),c.get(m).push({from:l.from,to:l.to}),f.single){let{single:y,...M}=f;s.set(m,M)}continue}d.set(m,new Set([`${l.from}
3
- ${l.to}`])),c.set(m,[{from:l.from,to:l.to}]),s.set(m,{id:m,kind:l.kind,from:a.id,to:u.id,edges:[{from:l.from,to:l.to}],single:{from:l.from,to:l.to},...a.id===u.id?{loop:!0}:{},x1:a.x+a.width/2,y1:a.y+a.height/2,x2:u.x+u.width/2,y2:u.y+u.height/2})}return[...s.values()].map(l=>({...l,edges:c.get(l.id)})).sort(wt)}var zi=.85,Vi=60,uo=160;function Fs(e,t,n,o,r,i=zi){let s=e*t.width+Math.max(0,e-1)*n,d=Math.max(n,(o-s)/2);return Array.from({length:e},(c,l)=>({x:d+l*(t.width+n),y:r,depth:i}))}function pr(e,t,n,o={}){let r={...Ii,...o},i=Math.max(8,r.unit??16)/16,s=r.inset?.left??0,d=n.overview?Math.max(0,r.dock?.right??0):0,c=n.overview?Math.max(0,r.dock?.bottom??0):0,l=r.width-d-s-(r.inset?.right??0),a=[],u=new Map,m=p=>n.past===!0||Fo(t.tryDefinition(p.kind),p,r.today),f=new Set(o.hiddenKinds??[]),b=p=>!f.has(p.kind),h=n.focusId?Rt(n.focusId).filter(p=>t.tryDefinition(p)!==void 0).filter(p=>!f.has(p)):[];n.focusId&&Rt(n.focusId).length>0&&h.length===0&&(n={...n,focusId:null});let y=n.focusId?e.getNode(n.focusId):void 0;y&&!b(y)&&(n={...n,focusId:null},h=[]);let M=h.length>0?[...e.allNodes()].filter(p=>h.includes(p.kind)).sort(wt):[],v=M.filter(b).filter(m),w=M.length-v.length,x=n.focusId&&h.length===0?e.getNode(n.focusId):void 0,O=n.zoom===!0&&!n.overview&&n.focusId!==null,E=Math.max(56,r.height*.062),T=Math.min(r.height*.895,r.height-E),D=O?x!==void 0?{focusY:r.height*.03,focusH:r.height*.58,relationY:r.height*.645,relationH:r.height*.2,contextY:T,contextH:E}:{focusY:r.height*.03,focusH:r.height*.71,relationY:r.height*.765,relationH:r.height*.1,contextY:T,contextH:E}:x===void 0?{focusY:r.height*.045,focusH:r.height*.62,relationY:r.height*.68,relationH:r.height*.2,contextY:r.height*.918,contextH:r.height*.082}:(()=>{let p=r.height,Y=p*.04,U=Math.max(p*.42,Math.min(p*.56,300)),he=Y+U+p*.06;return{focusY:Y,focusH:U,relationY:he,relationH:Math.max(p*.12,p*.878-p*.068-he),contextY:p*.878,contextH:p*.092}})(),g=Math.min(r.headroom??0,D.focusY+D.focusH*.2),S=g>D.focusY?{...D,focusY:g,focusH:D.focusH-(g-D.focusY)}:D,L=p=>Math.min(r.gap*p,Math.round(l*.1)),C=O?Math.min(880,l-L(5)):Math.min(700,l-L(6)),V=O?l-L(5):Math.min(r.focusSize.width,l-L(6)),X=(p,Y,U)=>({width:p===0?Y:Math.min(Y,(l-r.gap*(p+1))/p),height:U}),ae=(p,Y,U)=>{let he=X(p,Y,U),Ee=Math.min(Y,uo*i,l-r.gap*2);return he.width>=Ee?he:{width:Ee,height:U}},I=p=>Math.max(1,Math.floor((l-r.gap)/(Math.min(p,uo*i,l-r.gap*2)+r.gap))),$=new Set(n.expanded),N=n.overview?[]:Wi(e,t,x,n.relation,r.judged).filter(p=>b(p.node)).filter(p=>m(p.node)),q=n.overview?0:Math.max(0,Vi*i-S.contextH),P=N.length>0?S.focusH:S.contextY-S.focusY-r.gap*2-q,j=V,W=r.height,Q=Math.min(l*.5/j,r.height*.48/W),k=j*Q,R=W*Q,B=new Set(o.plainGroups??[]),G=n.overview&&!x&&h.length>0&&n.focusId!==null,A=G&&h.length>0&&h.every(p=>B.has(p));if(G)for(let p of h)A&&o.besideTheMap!==!0?$.add(Re(p)):$.delete(Re(p));let F=G&&!A&&h.length===1?h[0]:void 0,z=F!==void 0&&(o.screens?.[F]?.length??0)>0,_,Z=n.overview===!0&&x!==void 0&&o.besideTheMap===!0;n.overview&&(x||h.length>0)&&n.focusId&&!A&&!z&&!(G&&o.besideTheMap===!0)&&!Z?(_={x:s+(l-k)/2,y:r.height*.53-R/2,width:k,height:R},St({id:n.focusId,kind:x?x.kind:h[0],plane:0,x:_.x,y:_.y,width:k,height:R,natural:{width:j,height:W},...x?{}:{aggregate:{kind:h.join("+"),memberIds:v.map(p=>p.id),label:o.plurals?.[n.focusId]??h.map(p=>$t(t,p)).join(" and "),...w>0?{retired:w}:{}}}})):n.overview||(x?St({id:x.id,kind:x.kind,plane:0,x:s+(l-C)/2,y:S.focusY,width:C,height:P}):h.length>0&&n.focusId&&St({id:n.focusId,kind:h[0],plane:0,x:s+(l-V)/2,y:S.focusY,width:V,height:P,aggregate:{kind:h.join("+"),memberIds:v.map(p=>p.id),label:o.plurals?.[n.focusId]??h.map(p=>$t(t,p)).join(" and "),...w>0?{retired:w}:{}}}));let ne=26,J=52,fe=22,ie=Math.round(r.relationSize.width*.75),se=Math.max(1,Math.floor((l-r.gap)/(ie+r.gap))),we=r.unit/16,De=new Map;for(let p of N){let Y=no(p),U=De.get(Y);U?U.push(p):De.set(Y,[p])}let re=[...De.values()],ee=re.length>1,le=Math.max(r.gap,fe*we),at=ee?le:r.gap,Ke=Math.max(2,Math.floor((S.relationH+at)/(ne*we+at))),bn=Math.min(r.relationSize.width,(l-r.gap*(se+1))/se)+r.gap,Ze=re.map(p=>{let Y=p[0].via;return!ee||!Y?1:Math.ceil((Math.min(ur*we,hr(Bn(Y),we))+r.gap)/bn)}),Te=re.map(p=>p.length),Tt=un(Te,se,Ze),Je=N.length>se*Ke||Tt.length>Ke,It={schema:t,graph:e,focusId:x?.id,expanded:$,...r.relevance?{relevance:r.relevance}:{},...n.selection?{selection:n.selection}:{},plural:p=>$t(t,p),...r.today?{today:r.today}:{}},Ue=Je||ee?le:r.gap,Le,Ie;if(!Je)Le=re.flat().map(p=>({id:p.node.id,kind:p.node.kind,node:p.node,...p.via?{via:p.via}:{}})),Ie=Tt;else{let p=Math.max(1,Math.floor((S.relationH+Ue)/(J*we+Ue))),U=un(Te.map(()=>1),se,Ze).length<=p?Ze:[],he=ro(Te,se,p,U),Ee=re.map((be,Ce)=>oo(be,{...It,budget:he[Ce]}));Le=Ee.flat(),Ie=un(Ee.map(be=>be.length),se,U)}let st=Ie.length,oe=st===1?S.relationH:(S.relationH-Ue*(st-1))/st,et=X(Math.max(...Ie.map(p=>p.reduce((Y,U)=>Y+U.slots,0)),1),Le.length<=2?Math.round(r.relationSize.width*1.35):r.relationSize.width,oe),pt=[];{let p=et.width+r.gap,Y=[],U=0,he=new Map;for(let be of Ie.flat())he.set(be.run,(he.get(be.run)??0)+be.cards);for(let be=0;be<re.length;be++)Y[be]=U,U+=he.get(be)??0;let Ee=re.map(()=>0);Ie.forEach((be,Ce)=>{let yt=be.reduce((Mt,Lr)=>Mt+Lr.slots,0),Qn=yt*et.width+Math.max(0,yt-1)*r.gap,Zn=s+Math.max(r.gap,(l-Qn)/2),As=S.relationY+Ce*(oe+Ue);for(let Mt of be){let Lr=Mt.slots*p-r.gap,Ps=Mt.cards*p-r.gap,Ls=Zn+(Lr-Ps)/2;for(let Cr=0;Cr<Mt.cards;Cr++)pt[Y[Mt.run]+Ee[Mt.run]++]={x:Ls+Cr*p,y:As};Zn+=Mt.slots*p}})}Le.forEach((p,Y)=>{let U=pt[Y];St({id:p.id,kind:p.kind,plane:1,x:U.x,y:U.y,width:et.width,height:et.height,...p.via?{via:p.via}:{},...p.aggregate?{aggregate:p.aggregate}:{},...Je&&!p.aggregate?{compact:!0}:{}})});let xn=new Set(u.keys());for(let p of v)xn.add(p.id);let xt=new Map;for(let p of e.allNodes()){let Y=xt.get(p.kind);Y?Y.push(p):xt.set(p.kind,[p])}let ue=new Set(h.length>0?h:x?[x.kind]:[]),Pe=[];for(let p of t.kinds){if(f.has(p))continue;let Y=xt.get(p)??[],U=Y.filter(m);Pe.push({id:Re(p),kind:p,members:U.sort(wt),retired:Y.length-U.length,...ue.has(p)?{focused:!0}:{}})}for(let p of Pe)p.kind===n.relation&&(p.raised=!0);Pe.sort(wt);let dt=Fi(t,ue),Nt=!n.overview&&t.kinds.some(p=>dt.rankOf(p)==="primary"),$e=[];for(let p of Pe)if(!n.overview&&$.has(p.id)&&p.members.length>0)for(let Y of p.members)$e.push({id:Y.id,kind:Y.kind});else{let Y=Nt?dt.rankOf(p.kind):void 0,U=Y==="secondary"?dt.parentOf(p.kind):void 0;$e.push({id:p.id,kind:p.kind,...p.raised?{raised:!0}:{},...p.focused?{focused:!0}:{},...n.overview&&$.has(p.id)?{opened:!0}:{},...Y?{rank:Y}:{},...U&&!$.has(Re(U))?{nestedUnder:Re(U)}:{},aggregate:{kind:p.kind,memberIds:p.members.map(he=>he.id),label:o.plurals?.[p.kind]??$t(t,p.kind),...p.retired>0?{retired:p.retired}:{}}})}let tt=2;if($e.length<=I((O?240:r.contextSize.width)*i))for(let p of $e)delete p.nestedUnder;let vn=new Map;for(let p of $e){if(p.nestedUnder===void 0)continue;let Y=vn.get(p.nestedUnder)??0;Y>=tt?delete p.nestedUnder:vn.set(p.nestedUnder,Y+1)}let Yn=$e.filter(p=>p.nestedUnder!==void 0),vt=$e.filter(p=>p.nestedUnder===void 0),kn=I((O?240:r.contextSize.width)*i),Sn=!n.overview&&vt.length>kn,_n=Math.max(0,kn-1),gt=p=>p.focused?0:p.raised?1:2,kt=new Set([...vt].map((p,Y)=>({item:p,at:Y})).sort((p,Y)=>gt(p.item)-gt(Y.item)||p.at-Y.at).slice(0,_n).map(({item:p})=>p.id)),Qt=new Set(Sn?vt.filter(p=>!kt.has(p.id)).map(p=>p.id):[]),Kn=Yn.filter(p=>!Qt.has(p.nestedUnder)),Un=Yn.filter(p=>Qt.has(p.nestedUnder)),Ht=Sn?[...vt.filter(p=>kt.has(p.id)),{id:Ko,kind:"",beyond:[...vt.filter(p=>Qt.has(p.id)),...Un].map(p=>p.kind)}]:vt,lt=n.overview?{width:Math.min(220,l/6.5),height:Math.min(92,r.height*.125)}:ae(Ht.length,(O?240:r.contextSize.width)*i,S.contextH),Mn=r.relevance?.flagged,nt=(p,Y)=>{let U=Jr(t,p);if(!U)return{};let he=U.values.map(()=>0),Ee=0;for(let be of Y){let Ce=U.values.indexOf(e.getNode(be)?.[U.field]);Ce<0?Ee++:he[Ce]++}return{states:{field:U.field,values:[...U.values.map((be,Ce)=>({value:be,tier:U.tiers[Ce],count:he[Ce]})),...Ee>0?[{value:null,tier:"waiting",count:Ee}]:[]]}}},En=[...n.selection??[],...n.focusId?[n.focusId]:[]].flatMap(p=>p.startsWith("kind:")?[p.slice(5)]:p.startsWith("aggregate:")&&!p.includes("|")?[p.slice(10)]:Z&&p===x?.id?[x.kind]:[]),Zt=c>0&&d===0&&En.length>0,Xe=n.overview?lo(Ht.map(p=>{let Y=p.aggregate?.memberIds??[],U=Mn?Y.filter(he=>Mn.has(he)).length:0;return{id:p.id,kind:p.kind,count:Y.length,opened:$.has(p.id)?dn(sn(Y.length))*i:0,openedMin:$.has(p.id)?dn(Math.min(Qr,sn(Y.length)))*i:0,nameplate:$i(p.aggregate?.label??$t(t,p.kind),Y.length,U,Jr(t,p.kind)!==void 0,i),weight:U*1e3+Y.length,...h.includes(p.kind)&&(o.screens?.[p.kind]?.length??0)>0?{marquee:{width:Ur+12,height:Xr(o.screens[p.kind].map(he=>he.title),Ur,o.nameWidth)+8}}:{}}}),t,{width:r.width-d,height:Zt?r.height:r.height-c},r.chrome?{...r.inset,right:Math.min(r.inset?.right??0,8)}:r.inset??{},{...r.cityOrder?{order:r.cityOrder}:{},...r.plots?{plots:r.plots}:{},...o.cityZoom&&o.cityZoom!==1?{zoom:o.cityZoom}:{},...o.cityStood?{stood:o.cityStood}:{},keep:En,...Zt?{seen:{width:r.width-d,height:r.height-c}}:{},...o.tilt!==void 0?{tilt:o.tilt}:{},pan:{x:n.pan?.x??0,y:n.pan?.y??0},..._||r.chrome?.length?{avoid:[..._?[_]:[],...(r.chrome??[]).filter(p=>!(Zt&&p.onSheet))]}:{}}):null,Xn=new Map(Xe?.placed.map(p=>[p.id,p.plot])??[]),Jt=new Map(Xe?.placed.map(p=>[p.id,p.nameplate])??[]),Bt=Xe?Xe.placed.map(({x:p,y:Y,depth:U,width:he,height:Ee})=>({x:p,y:Y,depth:U,width:he,height:Ee})):Fs(Ht.length,lt,r.gap,l,S.contextY,O?.97:zi).map(p=>({...p,x:p.x+s})),H=.74,me=.8,xe=52*i,Me=86*i,Ne=(p,Y)=>Math.min(1,p+(1-p)*Y),ze=new Map;Ht.forEach((p,Y)=>{let U=Bt[Y],he=U.width??lt.width,Ee=U.height??lt.height,be=p.rank==="secondary"?H:1,Ce=Xe?he:Math.max(Math.min(he,uo*i),he*be),yt=Xe?Ee:Math.max(Vi*i,Ee*be);ze.set(p.id,{x:U.x+(he-Ce)/2,y:U.y+(Ee-yt),depth:p.rank==="secondary"?Ne(U.depth,.5):U.depth,width:Ce,height:yt})});let qe=[],Dt=Bt[Bt.length-1],Rn=new Map;for(let p of Kn)Rn.set(p.nestedUnder,(Rn.get(p.nestedUnder)??0)+1);let qn=new Map;for(let p of Kn){let Y=ze.get(p.nestedUnder);if(Y){let U=Rn.get(p.nestedUnder)??1,he=qn.get(p.nestedUnder)??0;qn.set(p.nestedUnder,he+1);let Ee=.98,be=lt.width*me,Ce=Math.max(Me,Math.min(be,Y.width/(Ee*(U-1)+1))),yt=Math.max(xe,lt.height*me*(Ce/be)),Qn=Ce*Ee,Zn=(U-1)*Qn+Ce;qe.push({...p,x:Y.x+(Y.width-Zn)/2+he*Qn,y:Math.max(0,Y.y-yt+Math.min(yt*.5,16)),width:Ce,height:yt,depth:Ne(Y.depth,.8)})}else if(Dt){let U=lt.width*me,he=lt.height*me;qe.push({...p,x:Dt.x,y:Dt.y,width:U,height:he,depth:Ne(Dt.depth??1,.8)})}}for(let p of Ht)qe.push({...p,...ze.get(p.id)});return qe.forEach(p=>{St({id:p.id,kind:p.kind,plane:2,x:p.x,y:p.y,width:p.width,height:p.height,...p.aggregate?{aggregate:p.aggregate}:{},...p.raised?{raised:!0}:{},...p.focused?{focused:!0}:{},...p.opened?{opened:!0}:{},...p.opened?{openedRows:Math.max(1,Math.floor((Math.max(dn(Math.min(Qr,sn(p.aggregate?.memberIds.length??0))),dn(sn(p.aggregate?.memberIds.length??0))*(Xe?.frame.openedShare??1))-mi)/qr))}:{},...p.rank?{rank:p.rank}:{},...p.nestedUnder?{nestedUnder:p.nestedUnder}:{},...p.beyond?{beyond:p.beyond}:{},...Xn.has(p.id)?{plot:Xn.get(p.id)}:{},...Jt.has(p.id)?{nameplate:Jt.get(p.id)}:{},...Xe&&p.aggregate?nt(p.kind,p.aggregate.memberIds):{},depth:p.depth})}),{nodes:a,connectors:ji(e,u,n),width:r.width,height:r.height,...Xe?{city:Xe.frame}:{},...n.pan&&(n.pan.x!==0||n.pan.y!==0)?{pan:{x:n.pan.x,y:n.pan.y}}:{},...d>0||c>0?{visible:{width:r.width-d,height:r.height-c}}:{}};function St(p){let Y=n.overview&&He(p.id)!==null?void 0:n.pins[p.id],U=Y?{...p,x:Y.x,y:Y.y,pinned:!0}:{...p,pinned:!1},he=n.pan?{...U,x:U.x+n.pan.x,y:U.y+n.pan.y}:U;a.push(he),u.set(he.id,he)}}function ho(e,t,n){let o=e.nodes.find(d=>d.id===t);if(!o||o.screenOf!==void 0)return null;let r={...o,x:n.x,y:n.y,pinned:!0},i=r.x+r.width/2,s=r.y+r.height/2;return{...e,nodes:e.nodes.map(d=>d.id===t?r:d),connectors:e.connectors.map(d=>d.from===t?{...d,x1:i,y1:s}:d.to===t?{...d,x2:i,y2:s}:d)}}function fo(e,t){return t.x===0&&t.y===0?e:{...e,nodes:e.nodes.map(n=>({...n,x:n.x+t.x,y:n.y+t.y})),connectors:e.connectors.map(n=>({...n,x1:n.x1+t.x,y1:n.y1+t.y,x2:n.x2+t.x,y2:n.y2+t.y})),...e.city?{city:{...e.city,pan:{x:t.x,y:t.y}}}:{},pan:{x:t.x,y:t.y}}}var ke=(e,t,n)=>e+(t-e)*n;function Gi(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}var Yi=new WeakMap;function Ws(e){let t=Yi.get(e);if(t)return t;let n=new Map,o=new Map;for(let r of e.nodes){n.set(r.id,r);for(let i of r.aggregate?.memberIds??[]){let s=o.get(i);s?s.push(r):o.set(i,[r])}}return t={byId:n,groupsOf:o},Yi.set(e,t),t}var _i=new WeakMap;function Ki(e,t){let n=_i.get(t);if(n||_i.set(t,n=new WeakMap),n.has(e))return n.get(e);let o=js(e,t);return n.set(e,o),o}function js(e,t){let{byId:n,groupsOf:o}=Ws(t);if(e.screenOf!==void 0){let s=n.get(Re(e.screenOf));if(s)return{...e,x:s.x,y:s.y,width:s.width,height:s.height}}if(Wt(e.id)||He(e.id)!==null){let s=(e.aggregate?.memberIds??[]).map(a=>n.get(a)).filter(a=>a!==void 0);if(s.length===0)return null;let d=s.map(Gi),c=d.reduce((a,u)=>a+u.x,0)/d.length,l=d.reduce((a,u)=>a+u.y,0)/d.length;return{...e,x:c-e.width/2,y:l-e.height/2}}let r=o.get(e.id)?.find(s=>s.id===Re(e.kind)||s.id===Be(e.kind));if(!r)return null;let i=Gi(r);return{...e,x:i.x-e.width/2,y:i.y-e.height/2}}function ut(e,t,n){let o=Math.max(0,Math.min(1,n)),r=new Map(e.nodes.map(a=>[a.id,a])),i=new Map(t.nodes.map(a=>[a.id,a])),s=[];for(let[a,u]of r){let m=i.get(a);if(m){s.push(mo(u,m,o,1));continue}let f=Ki(u,t)??u;s.push(mo(u,f,o,1-o))}for(let[a,u]of i){if(r.has(a))continue;let m=Ki(u,e)??u;s.push(mo(m,u,o,o))}let d=new Map(e.connectors.map(a=>[a.id,a])),c=new Map(t.connectors.map(a=>[a.id,a])),l=[];for(let[a,u]of d){let m=c.get(a);l.push(m?{...Vs(u,m,o),opacity:1}:{...u,opacity:1-o})}for(let[a,u]of c)d.has(a)||l.push({...u,opacity:o});return{nodes:s.filter(a=>a.opacity>0).sort((a,u)=>a.id<u.id?-1:a.id>u.id?1:0),connectors:l.filter(a=>a.opacity>0).sort((a,u)=>a.id<u.id?-1:a.id>u.id?1:0),width:ke(e.width,t.width,o),height:ke(e.height,t.height,o),t:o,...Ui(e.city,t.city,o)?{city:Ui(e.city,t.city,o)}:{},...e.pan||t.pan?{pan:{x:ke(e.pan?.x??0,t.pan?.x??0,o),y:ke(e.pan?.y??0,t.pan?.y??0,o)}}:{}}}function Ui(e,t,n){return e?t?{cell:ke(e.cell,t.cell,n),...e.tilt!==void 0||t.tilt!==void 0?{tilt:ke(e.tilt??.5,t.tilt??.5,n)}:{},originX:ke(e.originX,t.originX,n),originY:ke(e.originY,t.originY,n),pan:{x:ke(e.pan.x,t.pan.x,n),y:ke(e.pan.y,t.pan.y,n)},extent:{x:ke(e.extent.x,t.extent.x,n),y:ke(e.extent.y,t.extent.y,n),width:ke(e.extent.width,t.extent.width,n),height:ke(e.extent.height,t.extent.height,n)}}:e:t}function mo(e,t,n,o){return{id:t.id,kind:t.kind,plane:ke(e.plane,t.plane,n),x:ke(e.x,t.x,n),y:ke(e.y,t.y,n),width:ke(e.width,t.width,n),height:ke(e.height,t.height,n),pinned:t.pinned,opacity:o,...t.aggregate?{aggregate:t.aggregate}:{},...t.via?{via:t.via}:{},...t.raised?{raised:!0}:{},...t.focused?{focused:!0}:{},...t.opened?{opened:!0}:{},...t.openedRows!==void 0?{openedRows:t.openedRows}:{},...t.compact?{compact:!0}:{},...t.rank?{rank:t.rank}:{},...t.nestedUnder?{nestedUnder:t.nestedUnder}:{},...t.beyond?{beyond:t.beyond}:{},...t.plot?{plot:t.plot}:{},...t.nameplate?{nameplate:t.nameplate}:{},...t.states?{states:t.states}:{},...t.screenOf?{screenOf:t.screenOf}:{},...t.depth===void 0?{}:{depth:ke(e.depth??1,t.depth,n)},...t.natural?{natural:t.natural}:{}}}function Vs(e,t,n){return{...t,x1:ke(e.x1,t.x1,n),y1:ke(e.y1,t.y1,n),x2:ke(e.x2,t.x2,n),y2:ke(e.y2,t.y2,n)}}function gr(e){let t=Math.max(0,Math.min(1,e));return t<.5?4*t*t*t:1-(-2*t+2)**3/2}function zs(e,t){let n=[];for(let r=0;r<e.length;r+=1){let i=e[r],s=e[(r+1)%e.length];if(i.y===s.y)continue;let d=Math.min(i.y,s.y),c=Math.max(i.y,s.y);t<d||t>=c||n.push(i.x+(t-i.y)/(s.y-i.y)*(s.x-i.x))}n.sort((r,i)=>r-i);let o={x0:0,x1:0};for(let r=0;r+1<n.length;r+=2){let i={x0:n[r],x1:n[r+1]};i.x1-i.x0>o.x1-o.x0&&(o=i)}return o}function Gs(e){let t=1/0,n=-1/0;for(let o of e)o.y<t&&(t=o.y),o.y>n&&(n=o.y);return{top:t,bottom:n}}function Ys(e){let t=0;for(let n=0;n<e.length;n+=1){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2}function _s(e){let t=0,n=0,o=0;for(let r=0;r<e.length;r+=1){let i=e[r],s=e[(r+1)%e.length],d=i.x*s.y-s.x*i.y;t+=d,n+=(i.x+s.x)*d,o+=(i.y+s.y)*d}if(Math.abs(t)<1e-9){let r=e.reduce((i,s)=>({x:i.x+s.x,y:i.y+s.y}),{x:0,y:0});return{x:r.x/e.length,y:r.y/e.length}}return{x:n/(3*t),y:o/(3*t)}}function Ks(e,t){let{room:n,height:o,size:r,floor:i,measure:s=Kr,lines:d=2}=t,c=(h,y)=>h.every(M=>s(M,y)<=n)&&h.length*y*1.15<=o;if(c([e],r))return{lines:[e],fontSize:r,whole:!0};let l=e.split(/\s+/);if(d>1&&l.length>1){let h=1,y=1/0,M=0;for(let w=0;w<l.length-1;w+=1){M+=l[w].length+1;let x=Math.abs(M-e.length/2);x<y&&(y=x,h=w+1)}let v=[l.slice(0,h).join(" "),l.slice(h).join(" ")];if(c(v,r))return{lines:v,fontSize:r,whole:!0};for(let w=r;w>=i;w-=r*.06)if(c(v,w))return{lines:v,fontSize:w,whole:!0}}for(let h=r;h>=i;h-=r*.06)if(c([e],h))return{lines:[e],fontSize:h,whole:!0};let a=s(e,i)/Math.max(1,e.length),u=Math.floor(n/a)-1;if(u<4||i*1.15>o)return null;let m=e.slice(0,u),f=m.lastIndexOf(" ");return{lines:[`${f>3?m.slice(0,f):m}\u2026`],fontSize:i,whole:!1}}var Us=(e,t)=>e.x0<t.x1&&t.x0<e.x1&&e.y0<t.y1&&t.y0<e.y1;var K=de(Oe(),1);var po=de(Oe(),1),Xs=500,qs=10;function Xi(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function Qs(e){let t=typeof getSelection=="function"?getSelection():null;return t!==null&&!t.isCollapsed&&t.containsNode(e,!0)}function Zs(e){return e.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??e.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0}function qi({swallow:e,setMenuAt:t,setSelection:n}){let o=(0,po.useRef)(0),r=(0,po.useRef)(null),i=()=>{r.current&&clearTimeout(r.current.timer),r.current=null},s=(d,c,l)=>{let a=Zs(d);a&&n([a]),t(a?{x:c,y:l,on:a}:{x:c,y:l})};return{onContextMenu:d=>{let c=d.target;d.shiftKey||d.altKey||Xi(c)||Qs(c)||(d.preventDefault(),!c.closest("[data-graview-popover], [data-graview-offstage]")&&(Date.now()-o.current<700||s(c,d.clientX,d.clientY)))},onPointerDown:d=>{if(i(),d.pointerType==="mouse"||!d.isPrimary)return;let c=d.target;if(Xi(c)||c.closest("[data-graview-popover], [data-graview-offstage], button, a, input, select, textarea"))return;let{clientX:l,clientY:a}=d;r.current={x:l,y:a,timer:setTimeout(()=>{r.current=null,o.current=Date.now(),e.current=!0,setTimeout(()=>e.current=!1,700),s(c,l,a)},Xs)}},onPointerMove:d=>{let c=r.current;c&&Math.hypot(d.clientX-c.x,d.clientY-c.y)>qs&&i()},onPointerUp:i}}var Pt=de(Oe(),1);function Qi(e){let[t,n]=(0,Pt.useState)(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(e).matches);return(0,Pt.useEffect)(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let o=window.matchMedia(e),r=()=>n(o.matches);return r(),o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}function Js(){let e=()=>typeof document>"u"?null:document.documentElement.getAttribute("data-graview-motion"),[t,n]=(0,Pt.useState)(e);return(0,Pt.useEffect)(()=>{if(typeof document>"u"||typeof MutationObserver>"u")return;let o=new MutationObserver(()=>n(e()));return o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-graview-motion"]}),n(e()),()=>o.disconnect()},[]),t}function Zi(e){let t=Qi("(prefers-reduced-motion: reduce)"),n=Qi("(prefers-reduced-transparency: reduce)"),o=Js();return ci({off:!e,reducedMotion:o==="reduce"||o!=="full"&&t,reducedTransparency:n})}var ed=ai*1.5,td=30;function Ji(e,t){let[n,o]=(0,Pt.useState)(!1),r=e&&!n;return(0,Pt.useEffect)(()=>{if(!r||!t||typeof requestAnimationFrame>"u")return;let i=[],s=0,d=0,c=l=>{if(s>0&&i.push(l-s),s=l,i.length>=td){if(!ui(i,ed)){o(!0);return}i.length=0}d=requestAnimationFrame(c)};return d=requestAnimationFrame(c),()=>cancelAnimationFrame(d)},[r,t]),r}var je=de(Oe(),1);var nd=520;function rd(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ea(e,t={}){let n=t.duration??nd,o=(t.enabled??!0)&&!rd(),r=t.settle??!0,i=(0,je.useRef)(e),[,s]=(0,je.useState)(()=>ut(e,e,1)),d=(0,je.useRef)(null);d.current??=ut(e,e,1);let c=(0,je.useRef)(null),l=(0,je.useRef)(null);!o&&l.current!==e&&(l.current=e,d.current=ut(e,e,1)),o&&(l.current=null);let a=(0,je.useRef)(null);return(0,je.useEffect)(()=>{if(!o||typeof requestAnimationFrame>"u"){if(i.current=e,l.current!==e){let v=ut(e,e,1);d.current=v,s(v)}if(typeof requestAnimationFrame>"u"||!r)return;let M=requestAnimationFrame(()=>{let v=ut(e,e,1);d.current=v,s(v)});return()=>cancelAnimationFrame(M)}if(i.current===e&&d.current.t>=1){if(!r)return;let M=requestAnimationFrame(()=>{let v=ut(e,e,1);d.current=v,s(v)});return()=>cancelAnimationFrame(M)}let u=performance.now(),f=a.current!==null&&d.current.t<1&&u-a.current<n?a.current:u;a.current=f;let b=gr(Math.min(1,(u-f)/n)),h=i.current,y=M=>{let v=Math.min(1,(M-f)/n),w=b>=1?1:(gr(v)-b)/(1-b),x=ut(h,e,Math.max(0,w));d.current=x,s(x),v<1?c.current=requestAnimationFrame(y):(a.current=null,i.current=e,c.current=requestAnimationFrame(()=>{let O=ut(e,e,1);d.current=O,s(O),c.current=null}))};return c.current=requestAnimationFrame(y),()=>{c.current!==null&&cancelAnimationFrame(c.current);let M=d.current;i.current={...e,...M.city?{city:M.city}:{},pan:M.pan??{x:0,y:0},nodes:M.nodes.map(v=>({...v,plane:Math.round(v.plane)})),connectors:M.connectors}}},[e,n,o,r]),d.current}function ta(e=1100){let{store:t}=ve(),[n,o]=(0,je.useState)(()=>new Set);return(0,je.useEffect)(()=>{let r=null,i=t.subscribe(s=>{o(new Set(s.touched)),r&&clearTimeout(r),r=setTimeout(()=>o(new Set),e)});return()=>{i(),r&&clearTimeout(r)}},[t,e]),n}var od={marks:new Map,acts:[]};function na(e=4e3){let{store:t}=ve(),[n,o]=(0,je.useState)(od);return(0,je.useEffect)(()=>{let r=null,i=t.subscribe((s,d)=>{o(c=>{let l=new Map(c.marks),a=[...c.acts];for(let u of d){if(u.undoes!==void 0){let b=a.find(y=>y.batch===u.undoes||y.wrote.length>0),h=a.filter(y=>u.writes.some(M=>y.wrote.includes(M)));for(let y of h.length>0?h:b?[b]:[]){for(let M of y.wrote)l.delete(M);a=a.filter(M=>M.batch!==y.batch)}continue}if(u.author.kind!=="agent")continue;let m=u.author.id??"the seat";for(let b of u.writes)l.set(b,m);a.find(b=>b.batch===u.batch)?a=a.map(b=>b.batch===u.batch?{...b,wrote:[...new Set([...b.wrote,...u.writes])]}:b):a=[{batch:u.batch,who:m,intent:u.batchIntent??u.intent,at:u.at,wrote:[...u.writes]},...a].slice(0,12)}return l.size===c.marks.size&&a===c.acts&&l.size===0?c:{marks:l,acts:a}}),r&&clearTimeout(r),r=setTimeout(()=>o(c=>c.marks.size===0?c:{...c,marks:new Map}),e)});return()=>{i(),r&&clearTimeout(r)}},[t,e]),n}var Ut=de(Ae(),1),rt=16;function ra({marks:e,questions:t=[],whereIs:n,stageRef:o,width:r,height:i}){if(e.size===0&&t.length===0)return null;let s=o.current,d=s?.getBoundingClientRect()??null,c=[];for(let[a,u]of e){let m=null;if(s&&d&&typeof CSS<"u"){let y=s.querySelector(`[data-graview-pick="${CSS.escape(a)}"]`)?.getBoundingClientRect();y&&y.width>0&&y.height>0&&(m={x:y.left-d.left,y:y.top-d.top,width:y.width,height:y.height})}if(m??=n(a),!m)continue;let f=Math.min(Math.max(m.x+m.width-rt/2,rt/2),r-rt/2),b=Math.min(Math.max(m.y-rt/4,rt/2),i-rt/2);c.push({id:a,who:u,x:f,y:b})}let l=[];for(let a of t){let u=n(a.id);u&&l.push({...a,x:Math.min(Math.max(u.x+u.width/2,rt),r-rt),y:Math.min(Math.max(u.y-rt/2,rt),i-rt)})}return c.length===0&&l.length===0?null:(0,Ut.jsxs)("div",{className:"graview-seat-marks","data-testid":"seat-marks","data-graview-seat-marks":c.length,children:[c.map(({id:a,who:u,x:m,y:f})=>(0,Ut.jsx)("span",{className:"graview-seat-mark","data-testid":"seat-mark","data-graview-seat-mark":a,"data-graview-seat-who":u,title:`${u} just changed this`,"aria-hidden":"true",style:{left:m,top:f,"--graview-hue":On(u)},children:"\u25C6"},a)),l.map(a=>(0,Ut.jsxs)("span",{className:"graview-seat-asking","data-testid":"seat-question","data-graview-seat-asking":a.id,title:a.asks,style:{left:a.x,top:a.y},children:[(0,Ut.jsx)("span",{"aria-hidden":"true",children:"?"}),(0,Ut.jsx)("span",{className:"graview-seat-asking-said",children:a.asks})]},`asking:${a.id}`))]})}var te=de(Ae(),1);function id({hue:e,mode:t}){let n=t==="docked";return(0,te.jsxs)("svg",{viewBox:"0 0 32 38","aria-hidden":"true",children:[(0,te.jsxs)("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round",strokeLinecap:"round",children:[(0,te.jsx)("line",{x1:"16",y1:"3.5",x2:"16",y2:"7"}),(0,te.jsx)("circle",{cx:"16",cy:"2.6",r:"1.5",fill:"none"}),(0,te.jsx)("path",{d:"M8 16 V12.5 C8 8.5 11.5 7 16 7 C20.5 7 24 8.5 24 12.5 V16 Z",fill:"currentColor",fillOpacity:"0.1"}),t==="refused"?(0,te.jsx)("line",{x1:"11",y1:"12.5",x2:"21",y2:"12.5",strokeWidth:"2"}):(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)("rect",{x:"10.2",y:"10.2",width:"11.6",height:"4.6",rx:"2.3",fill:"currentColor",fillOpacity:"0.14",strokeWidth:"1"}),(0,te.jsx)("circle",{cx:"13.4",cy:"12.5",r:"1.25",fill:"currentColor",stroke:"none",opacity:n?.45:1}),(0,te.jsx)("circle",{cx:"18.6",cy:"12.5",r:"1.25",fill:"currentColor",stroke:"none",opacity:n?.45:1}),t==="reading"?(0,te.jsx)("line",{x1:"10.2",y1:"12.5",x2:"21.8",y2:"12.5",strokeWidth:"0.8",opacity:"0.7"}):null]}),(0,te.jsx)("line",{x1:"16",y1:"16",x2:"16",y2:"18.5"}),(0,te.jsx)("polygon",{points:"16,18.5 24,22.5 16,26.5 8,22.5",fill:"currentColor",fillOpacity:"0.22"}),(0,te.jsx)("polygon",{points:"8,22.5 16,26.5 16,33.5 8,29.5",fill:"currentColor",fillOpacity:"0.08"}),(0,te.jsx)("polygon",{points:"24,22.5 16,26.5 16,33.5 24,29.5",fill:"currentColor",fillOpacity:"0.3"}),t==="writing"?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)("polyline",{points:"24,24 28.5,20.5"}),(0,te.jsx)("line",{x1:"27.5",y1:"19",x2:"30",y2:"21.5",strokeWidth:"1.8"})]}):(0,te.jsx)("line",{x1:"24",y1:"24",x2:"26.5",y2:"29"}),(0,te.jsx)("line",{x1:"8",y1:"24",x2:"5.5",y2:"29"}),(0,te.jsx)("path",{d:"M9.5 33.5 v2.2 h4"}),(0,te.jsx)("path",{d:"M22.5 33.5 v2.2 h-4"})]}),(0,te.jsx)("title",{children:`robot, ${t}`})]})}function ad({hue:e}){return(0,te.jsxs)("svg",{viewBox:"0 0 22 24","aria-hidden":"true",style:{color:`hsl(${Math.round(e)} 50% 48%)`},children:[(0,te.jsxs)("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round",strokeLinecap:"round",children:[(0,te.jsx)("circle",{cx:"11",cy:"6",r:"4.2"}),(0,te.jsx)("path",{d:"M3 23 C3 15.5 6 13 11 13 C16 13 19 15.5 19 23"})]}),(0,te.jsx)("title",{children:"somebody"})]})}function oa({width:e,whereIs:t}){let{who:n,following:o,follow:r}=ve(),i=yi([...n.values()],t,e);if(i.length===0)return null;let s=h=>{let y=tr(h.presence)||"somebody";return h.presence.kind==="agent"?y:`${y}'s agent`},d=new Map;for(let h of i){if(h.kind!=="robot")continue;let y=`${Math.round(h.point.x)}:${Math.round(h.point.y)}`;d.set(y,[...d.get(y)??[],s(h)])}let c=19,l=h=>h.length*9+4,a=[],u=new Map,m=new Set;for(let h of i){if(h.kind!=="robot"&&h.kind!=="person")continue;let y=`${Math.round(h.point.x)}:${Math.round(h.point.y)}`;if(h.kind==="robot"&&m.has(y))continue;h.kind==="robot"&&m.add(y);let M=h.kind==="robot"?[...new Set(d.get(y)??[])].join(" \xB7 "):tr(h.presence)||"somebody",v=l(M)/2,w=0;for(;a.some(x=>x.row===w&&Math.abs(x.y-h.point.y)<c&&x.left<h.point.x+v&&x.right>h.point.x-v);)w++;a.push({left:h.point.x-v,right:h.point.x+v,y:h.point.y,row:w}),u.set(`${h.kind}:${h.presence.participant}`,w)}let f=h=>{let y=u.get(h)??0;return y>0?{top:2+y*c}:void 0},b=new Set;return(0,te.jsx)("div",{className:"graview-occupants","data-testid":"occupants","data-graview-occupants":i.length,children:i.map((h,y)=>{if(h.kind==="over")return(0,te.jsx)("div",{className:"graview-presence-over","data-testid":"presence-over","data-graview-over-by":h.presence.participant,style:{left:h.box.x-3,top:h.box.y-3,width:h.box.width+6,height:h.box.height+6,"--graview-hue":h.presence.hue}},`over:${h.presence.participant}`);if(h.kind==="count")return(0,te.jsxs)("span",{className:"graview-figure-count","data-testid":"presence-count","data-graview-at":h.at,style:{left:h.point.x,top:h.point.y},title:`${h.n} more here`,children:["+",h.n]},`count:${h.at}:${y}`);let M=h.presence.hue,v=tr(h.presence)||"somebody";if(h.kind==="edge")return(0,te.jsxs)("button",{type:"button",className:"graview-figure-edge","data-testid":"presence-edge","data-graview-person":h.presence.participant,style:{right:`calc(${Math.max(8,e-h.point.x)}px + var(--graview-dock, 0px))`,top:h.point.y},onClick:()=>r(h.presence.participant),"aria-label":`${v} is somewhere else \u2014 press to go where they are`,children:["\u2192 ",v]},`edge:${h.presence.participant}`);if(h.kind==="robot"){let x=`${Math.round(h.point.x)}:${Math.round(h.point.y)}`;if(b.has(x))return null;b.add(x);let O=[...new Set(d.get(x)??[s(h)])].join(" \xB7 ");return(0,te.jsxs)("div",{className:"graview-figure","data-graview-figure":`theirs:${h.presence.participant}`,"data-graview-theirs":"","data-graview-mode":h.mode,"data-graview-at":h.presence.robot?.at??"",style:{transform:`translate(${h.point.x.toFixed(1)}px, ${h.point.y.toFixed(1)}px)`,"--graview-hue":M},children:[(0,te.jsx)("span",{className:"graview-figure-body",role:"img","aria-label":`${O} \u2014 ${h.mode}`,style:{cursor:"default"},children:(0,te.jsx)(id,{hue:M,mode:h.mode})}),(0,te.jsx)("span",{className:"graview-figure-name","data-graview-label":"",style:f(`robot:${h.presence.participant}`),children:O})]},`robot:${h.presence.participant}`)}let w=o?.participant===h.presence.participant;return(0,te.jsxs)("div",{className:"graview-figure","data-graview-figure":h.presence.participant,"data-graview-person":"","data-graview-at":h.at,"data-graview-audience":h.audience?"":void 0,"data-graview-followed":w?"":void 0,style:{transform:`translate(${h.point.x.toFixed(1)}px, ${h.point.y.toFixed(1)}px)`,"--graview-hue":M},children:[(0,te.jsx)("button",{type:"button",className:"graview-figure-body","aria-label":`${v} is here${w?". Press to stop following":". Press to go where they go"}`,"aria-pressed":w,onClick:x=>{x.stopPropagation(),r(w?null:h.presence.participant)},onPointerDown:x=>x.stopPropagation(),children:(0,te.jsx)(ad,{hue:M})}),(0,te.jsx)("span",{className:"graview-figure-name",style:f(`person:${h.presence.participant}`),children:v})]},`person:${h.presence.participant}`)})})}var fn=de(Oe(),1),Wn=de(Ae(),1),ia={left:"\u2190",right:"\u2192",top:"\u2191",bottom:"\u2193"},go=36,sd=140,Fn=56;function aa({result:e,schema:t,chrome:n=[],onGo:o}){let r=co(e);if(r.length===0||(e.visible??e).height<sd)return null;let i=a=>(a??[]).flatMap(u=>{let m=e.nodes.find(f=>f.id===u.id);return m?[{left:m.x+u.x,top:m.y+u.y,right:m.x+u.x+u.width,bottom:m.y+u.y+u.height}]:[]}),s=i(e.city?.showings),d=i(e.city?.nameplates),c=[...s,...d,...n.map(a=>({left:a.x,top:a.y,right:a.x+a.width,bottom:a.y+a.height}))],l=[];for(let a of["left","right","top","bottom"]){let u=e.visible??e,m=a==="left"||a==="right"?u.height:u.width,f=a==="left"||a==="right",b=a==="bottom"?cd:a==="top"?Fn:ud+Fn/2,h=-1/0,y=[],M=r.filter(v=>v.side===a).sort((v,w)=>v.along-w.along);for(let v of M){let w=er(t,v.kind),x=dd(w),O=f?yr:x/2,E=m-b-(f?0:O),T=Math.max(Fn,v.along,h+O+ld);if(T>E)continue;let{at:D,inset:g}=hd([...c,...y],a,T,x,u,m);if(D>E+.5)continue;h=D+O,y.push(sa(a,D,x,u,g));let S=a==="left"?{left:g,top:D,transform:"translateY(-50%)"}:a==="right"?{right:`calc(${g}px + var(--graview-dock, 0px))`,top:D,transform:"translateY(-50%)"}:a==="top"?{top:g,left:D,transform:"translateX(-50%)"}:{bottom:`calc(${g}px + var(--graview-scene-foot, var(--graview-sheet, 0px)))`,left:D,transform:"translateX(-50%)"};l.push((0,Wn.jsx)("button",{type:"button",className:"graview-edge-sign","data-graview-past-edge":v.id,"aria-label":`${w}, past the ${a} edge \u2014 bring it into view`,title:`${w} is past the ${a} edge`,tabIndex:-1,onPointerDown:L=>L.stopPropagation(),onClick:L=>{L.stopPropagation(),o(v.by)},style:{...fd,...S},children:a==="right"||a==="bottom"?`${w} ${ia[a]}`:`${ia[a]} ${w}`},v.id))}}return(0,Wn.jsx)(Wn.Fragment,{children:l})}var dd=e=>(e.length+2)*7.4+22,yr=go/2,$n=6,ld=6,cd=236,ud=56;function sa(e,t,n,o,r=$n){return e==="left"||e==="right"?{left:e==="left"?r:o.width-r-n,right:e==="left"?r+n:o.width-r,top:t-yr,bottom:t+yr}:{left:t-n/2,right:t+n/2,top:e==="top"?r:o.height-r-go,bottom:e==="top"?r+go:o.height-r}}function hd(e,t,n,o,r,i){let s=t==="left"||t==="right",d=h=>sa(t,h,o,r),c=h=>e.find(y=>{let M=d(h);return M.left<y.right&&y.left<M.right&&M.top<y.bottom&&y.top<M.bottom}),l=c(n);if(!l)return{at:n,inset:$n};let a=s?yr:o/2,u=h=>{let y=n;for(let M=0;M<12;M++){let v=c(y);if(!v)return y;if(y=h>0?(s?v.bottom:v.right)+a+4:(s?v.top:v.left)-a-4,y>i-Fn||y<Fn)return null}return null},m=u(1);if(m!==null)return{at:m,inset:$n};let f=u(-1);if(f!==null)return{at:f,inset:$n};let b=t==="left"?l.right:t==="right"?r.width-l.left:t==="top"?l.bottom:r.height-l.top;return{at:n,inset:Math.max($n,b+4)}}var fd={position:"absolute",zIndex:We.lines,minHeight:28,maxWidth:"40%",padding:"3px 10px",font:"inherit",fontSize:"0.75rem",letterSpacing:"0.04em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:6,boxShadow:"0 2px 8px rgb(0 0 0 / 0.12)",cursor:"pointer"};function da(e){let[t,n]=(0,fn.useState)(null);return(0,fn.useLayoutEffect)(()=>{let o=e.current,r=null;for(let d=o?.parentElement??null,c=0;d&&!r&&c<4;d=d.parentElement,c++)r=d.querySelector(":scope > [data-graview-scene-trail]");if(!o||!r)return;let i=()=>{let d=o.getBoundingClientRect(),c=r.getBoundingClientRect(),l=c.width>0&&c.height>0?{x:c.left-d.left,y:c.top-d.top,width:c.width,height:c.height}:null;n(a=>a===l||a&&l&&a.x===l.x&&a.y===l.y&&a.width===l.width&&a.height===l.height?a:l)};if(i(),typeof ResizeObserver>"u")return;let s=new ResizeObserver(i);return s.observe(r),()=>s.disconnect()},[e]),t}function la(e,t,n){let[o,r]=(0,fn.useState)([]);return(0,fn.useLayoutEffect)(()=>{let i=e.current;if(!i||!t)return;let s=[...i.querySelectorAll(".graview-drive-in")].flatMap(d=>{let c=d.closest("[data-graview-view]"),l=d.getBoundingClientRect();if(!c||l.width===0||l.height===0)return[];let a=c.getBoundingClientRect();return[{id:c.getAttribute("data-graview-view"),x:Math.round(l.left-a.left),y:Math.round(l.top-a.top),width:Math.round(l.width),height:Math.round(l.height)}]});r(d=>d.length===s.length&&d.every((c,l)=>c.id===s[l].id&&c.x===s[l].x&&c.y===s[l].y&&c.width===s[l].width&&c.height===s[l].height)?d:s)},[e,t,n]),o}function ca(e,t){return e.flatMap(n=>{let o=t.find(r=>r.id===n.id);return o?[{x:o.x+n.x,y:o.y+n.y,width:n.width,height:n.height}]:[]})}var Lt=de(Oe(),1),md=180;function ua({view:e,result:t,frame:n,panned:o,closer:r,screenId:i,setCamera:s}){let d=(0,Lt.useRef)(new Map),c=Math.round((t.nodes.find(u=>u.id===i)?.height??0)/16),l=(0,Lt.useRef)(e.overview??!1),a=(0,Lt.useRef)(null);if((0,Lt.useEffect)(()=>{if(!e.overview||!i||!t.city){if(l.current&&!e.overview)return;s(E=>E.x===0&&E.y===0?E:{x:0,y:0});return}let u=t.nodes.find(E=>E.id===i);if(!u)return;let m=r>1&&u.screenOf?t.nodes.find(E=>E.id===Re(u.screenOf)):void 0,f=m?{x:Math.min(u.x,m.x),y:Math.min(u.y,m.y),width:Math.max(u.x+u.width,m.x+m.width)-Math.min(u.x,m.x),height:Math.max(u.y+u.height,m.y+m.height)-Math.min(u.y,m.y)}:u;if(f.x>=0&&f.y>=0&&f.x+f.width<=t.width&&f.y+f.height<=t.height&&!m)return;let h=24,y=(E,T,D)=>E<h?h-E:E+T>D-h?D-h-(E+T):0,M=At(t),v=e.pan??{x:0,y:0},w=m?o.x+(t.width/2-(f.x+f.width/2)):o.x+y(f.x,f.width,t.width),x=t.height/2-(f.y+f.height/2),O=m?o.y+(u.y+x<h?h-u.y:x):o.y+y(f.y,f.height,t.height);s({x:(m?w:Math.max(-M.x,Math.min(M.x,w)))-v.x,y:(m?O:Math.max(-M.y,Math.min(M.y,O)))-v.y})},[i,e.overview,r,e.within?.view,c]),n.city){let u=new Map;for(let m of n.nodes){if(!m.plot||Math.round(m.plane)!==2)continue;let f=cn(m.plot.col+m.plot.side/2,m.plot.row+m.plot.side/2,n.city.cell,n.city.tilt);u.set(m.id,{x:n.city.originX+o.x+f.x,y:n.city.originY+o.y+f.y})}d.current=u}return(0,Lt.useEffect)(()=>{let u=e.overview??!1,m=l.current&&!u;if(l.current=u,u&&a.current&&(clearTimeout(a.current),a.current=null),!m)return;let f=e.focusId?Rt(e.focusId)[0]:void 0,b=f?d.current.get(Re(f)):void 0,h=t.nodes.find(y=>y.id===e.focusId);if(!b||!h){s({x:0,y:0});return}s({x:b.x-(h.x+h.width/2),y:b.y-(h.y+h.height/2)}),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,s({x:0,y:0})},md)},[e.overview]),(0,Lt.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),{gliding:()=>a.current!==null}}var br=de(Oe(),1),wr="[data-graview-view]";function pd(e,t){let n=null;for(let o=e?.closest(wr)??null;o&&t.contains(o);o=o.parentElement?.closest(wr)??null)n=o;return n}function ha(e,t,n=!1){let o=e.getBoundingClientRect(),r=o.bottom-t.bottom;if(n&&t.bottom>0){let i=e.querySelector(".graview-zoom")?.getBoundingClientRect();i&&i.height>0&&i.top<r&&i.bottom>r-i.height-24&&(r=Math.min(r,i.top))}return{left:o.left,top:o.top,right:o.right-t.right,bottom:r,box:o}}function fa(e,t,n){let o=(0,br.useRef)({dock:t,reveal:n});o.current={dock:t,reveal:n},(0,br.useEffect)(()=>{let r=e.current;if(!r)return;let i=l=>{let{dock:a}=o.current;if(l.key!=="Tab"||l.defaultPrevented||a.right<=0&&a.bottom<=0)return;let u=ha(r,a),m=[];for(let f of r.querySelectorAll(wr)){if(f.parentElement?.closest(wr)||f.inert||f.contains(document.activeElement))continue;let b=f.getBoundingClientRect(),h=Math.max(b.left,u.box.left),y=Math.min(b.right,u.box.right),M=Math.max(b.top,u.box.top),v=Math.min(b.bottom,u.box.bottom);y<=h||v<=M||!(a.right>0&&h>=u.right-1||a.bottom>0&&M>=u.bottom-1)||(f.inert=!0,m.push(f))}m.length!==0&&setTimeout(()=>{for(let f of m)f.inert=!1},0)},s=l=>{let a=l.target,u=pd(a,r);if(!u)return;let m=!0;try{m=a?.matches(":focus-visible")??!0}catch{}requestAnimationFrame(()=>{for(let f=u.parentElement;f;f=f===r?null:f.parentElement)f.scrollTop!==0&&(f.scrollTop=0),f.scrollLeft!==0&&(f.scrollLeft=0);m&&u.isConnected&&d(()=>u.isConnected&&u.contains(document.activeElement)&&c(u))})},d=(l,a=120)=>{let u=r.closest(".graview-ground")??r.querySelector(".graview-ground");!u||u.hasAttribute("data-graview-settled")||a<=0?l():requestAnimationFrame(()=>d(l,a-1))},c=l=>{let a=ha(r,o.current.dock,!0),u=l.getBoundingClientRect(),m=l.querySelector(".graview-drive-in")?.getBoundingClientRect(),f=m&&m.width>0&&m.height>0?m:null,b=12,h=f?{left:Math.min(u.left,f.left),right:Math.max(u.right,f.right),top:Math.min(u.top,f.top),bottom:Math.max(u.bottom,f.bottom)}:u,y=h.bottom-h.top<=a.bottom-a.top-2*b?h:u,M=(x,O,E,T)=>T-E>O-x-2*b||E<x+b?x+b-E:T>O-b?O-b-T:0,v=M(a.left,a.right,y.left,y.right),w=M(a.top,a.bottom,y.top,y.bottom);(Math.abs(v)>=1||Math.abs(w)>=1)&&o.current.reveal(Math.round(v),Math.round(w))};return document.addEventListener("keydown",i,!0),r.addEventListener("focusin",s),()=>{document.removeEventListener("keydown",i,!0),r.removeEventListener("focusin",s)}},[e])}var ce=de(Oe(),1);function pa(){let e=(0,ce.useRef)(null),[t,n]=(0,ce.useState)({right:0,bottom:0});return(0,ce.useLayoutEffect)(()=>{let o=e.current;if(!o)return;let r=()=>{let s=o.getBoundingClientRect(),d={right:Math.round(s.width),bottom:Math.round(s.height)};n(c=>c.right===d.right&&c.bottom===d.bottom?c:d)};if(r(),typeof ResizeObserver>"u")return;let i=new ResizeObserver(r);return i.observe(o),()=>i.disconnect()},[]),{probe:e,dock:t}}function ga(){let[e,t]=(0,ce.useState)(null),n=(0,ce.useRef)(null),o=(0,ce.useRef)(0),r=(0,ce.useCallback)(s=>{n.current=s,o.current===0&&(o.current=requestAnimationFrame(()=>{o.current=0,t(n.current)}))},[]),i=(0,ce.useCallback)(()=>{o.current!==0&&cancelAnimationFrame(o.current),o.current=0;let s=n.current;return n.current=null,s&&t(null),s},[]);return{held:e,place:r,release:i}}function ya({stage:e,pan:t,zoom:n,setView:o,settled:r,zoomTo:i}){let s=(0,ce.useRef)({x:0,y:0,s:1}),d=(0,ce.useRef)(0),c=(0,ce.useRef)(!1),l=(0,ce.useRef)(r);l.current=r;let a=(0,ce.useCallback)(()=>[...e.current?.querySelectorAll("[data-graview-world]")??[]],[e]),u=(0,ce.useCallback)(({x:w,y:x,s:O})=>{let E=O!==1?`translate3d(${w}px, ${x}px, 0) scale(${O})`:w===0&&x===0?"":`translate3d(${w}px, ${x}px, 0)`;for(let T of a())T.style.transform=E,T.style.transformOrigin=O!==1?"0 0":"";ma(e.current,w,x,O)},[a,e]),m=(0,ce.useCallback)(()=>{d.current===0&&(d.current=requestAnimationFrame(()=>{d.current=0,u(s.current)}))},[u]),f=(0,ce.useCallback)(()=>{c.current=!1;for(let w of a())w.style.transform="",w.style.transformOrigin="";ma(e.current,0,0,1),l.current()},[a,e]),b=(0,ce.useCallback)((w,x)=>{s.current={x:w.x-x.x,y:w.y-x.y,s:s.current.s},m()},[m]),h=(0,ce.useCallback)((w,x,O,E,T,D)=>{let{x:g,y:S,s:L}=s.current,C=Math.max(T,Math.min(D,L*w)),V=C/L;s.current={x:g*V+x.x*(1-V)+O,y:S*V+x.y*(1-V)+E,s:C},m()},[m]),y=(0,ce.useCallback)(()=>{let{x:w,y:x,s:O}=s.current;return w===0&&x===0&&O===1?!1:(d.current!==0&&cancelAnimationFrame(d.current),d.current=0,u({x:w,y:x,s:O}),s.current={x:0,y:0,s:1},c.current=!0,Math.abs(O-1)>1e-4?i.current(O,{x:w/(1-O),y:x/(1-O)}):o(E=>{let T=E.pan??{x:0,y:0};return ct(E,{x:T.x+w,y:T.y+x})}),window.setTimeout(()=>{c.current&&f()},300),!0)},[o,f,u,i]);(0,ce.useLayoutEffect)(()=>{c.current&&f()},[t,n,f]);let M=(0,ce.useCallback)(()=>{d.current!==0&&cancelAnimationFrame(d.current),d.current=0,s.current={x:0,y:0,s:1},f()},[f]),v=(0,ce.useCallback)(()=>s.current,[]);return{shiftTo:b,zoomBy:h,settle:y,drop:M,settling:c,offset:v}}function ma(e,t,n,o){for(let r of e?.querySelectorAll(":scope > .graview-lattice, :scope > .graview-measure")??[]){let i=o!==1&&r.classList.contains("graview-lattice")&&e?gd(e):null;i?r.style.setProperty("--graview-lattice-cell",`${(i.cell*o).toFixed(2)}px`):r.style.removeProperty("--graview-lattice-cell");let s=i?i.x*(o-1)+t:t,d=i?i.y*(o-1)+n:n;if(s===0&&d===0){r.style.removeProperty("--graview-hand-x"),r.style.removeProperty("--graview-hand-y");continue}r.style.setProperty("--graview-hand-x",`${s}px`),r.style.setProperty("--graview-hand-y",`${d}px`)}}function gd(e){let t=parseFloat(e.style.getPropertyValue("--graview-lattice-cell"));return Number.isFinite(t)?{cell:t,x:parseFloat(e.style.getPropertyValue("--graview-lattice-x"))||0,y:parseFloat(e.style.getPropertyValue("--graview-lattice-y"))||0}:null}var yd=4;function wd(e,t){for(let n=e;n&&n!==t;n=n.parentElement){let o=getComputedStyle(n);if(/(auto|scroll)/.test(o.overflowY)&&n.scrollHeight>n.clientHeight+1||/(auto|scroll)/.test(o.overflowX)&&n.scrollWidth>n.clientWidth+1)return!0}return!1}function wa({view:e,panned:t,limit:n,panWithin:o,moveByTransform:r,setView:i,setDragging:s,noteMoved:d,shift:c,district:l,pinching:a}){let u=(0,ce.useRef)(!1),m=(0,ce.useRef)(null),f=x=>{let O=e.pan??{x:0,y:0};m.current={kind:"pan",fromX:x.clientX,fromY:x.clientY,baseX:O.x,baseY:O.y,moved:!1}},b=x=>{x.button!==0||a.current||x.target.closest("[data-graview-view]")||f(x)},h=(x,O)=>{if(!(O.button!==0||a.current)&&!(O.pointerType!=="mouse"&&wd(O.target,O.currentTarget))){if(x.screenOf!==void 0&&!O.target.closest("[data-graview-grip]")){f(O);return}if(e.overview&&He(x.id)!==null){f(O);return}m.current={kind:"card",id:x.id,fromX:O.clientX,fromY:O.clientY,baseX:x.x-t.x,baseY:x.y-t.y,moved:!1}}},y=x=>{let O=m.current;m.current=null,l.release(),x?c.settle():c.drop(),O&&(u.current=!0,setTimeout(()=>u.current=!1,0)),c.settling.current||s(!1)};return{onGroundDown:b,onCardDown:h,onDragMove:x=>{let O=m.current;if(!O)return;if(a.current){y(!0);return}let E=x.clientX-O.fromX,T=x.clientY-O.fromY;if(!O.moved){if(Math.hypot(E,T)<yd)return;O.moved=!0,s(!0);try{x.currentTarget.setPointerCapture(x.pointerId)}catch{}}if(O.kind==="pan"){let D=o(n(),{x:O.baseX+E,y:O.baseY+T});r?c.shiftTo(D,e.pan??{x:0,y:0}):i(g=>ct(g,D))}else O.id&&l.place({id:O.id,x:O.baseX+E,y:O.baseY+T})},onDragUp:()=>{c.settle();let x=l.release();x&&i(O=>Nn(O,x.id,{x:x.x,y:x.y})),m.current?.moved&&(u.current=!0,setTimeout(()=>u.current=!1,0),d()),m.current=null,!c.settling.current&&s(!1)},onDragCancel:()=>{m.current&&y(!1)},swallow:u}}function ba({stage:e,view:t,setView:n}){let o=(0,ce.useRef)({view:t,charge:0,coolUntil:0,lastScale:1});o.current.view=t;let r=(0,ce.useRef)(()=>{}),i=(0,ce.useRef)(()=>{}),s=(0,ce.useRef)(()=>{}),d=(0,ce.useRef)(()=>{}),c=(0,ce.useRef)(!1),l=(0,ce.useRef)({fingers:new Map,pinch:null,owed:null,owing:0});return(0,ce.useEffect)(()=>{let a=e.current;if(!a)return;let u=(E,T)=>{let D=o.current;if(T<D.coolUntil)return;let g=D.view.overview??!1;E!==g&&(D.coolUntil=T+600,D.charge=0,n(An(D.view,E)))},m=E=>{let T=o.current,D=T.view.overview??!1;if(E.ctrlKey){if(E.preventDefault(),!D){if(T.charge+=E.deltaY,Math.abs(T.charge)<60)return;T.charge>0?u(!0,performance.now()):T.charge=0;return}s.current(Math.exp(-E.deltaY*.004),E.clientX,E.clientY,0,0);return}!D||E.target?.closest("[data-graview-view], .graview-scroll, [data-graview-overlay], .graview-zoom")||(E.preventDefault(),i.current(-E.deltaX,-E.deltaY))},f=l.current,b=f.fingers,h=()=>{f.owing=0;let E=f.owed;f.owed=null,E&&s.current(E.factor,E.x,E.y,E.dx,E.dy)},y=()=>{let[E,T]=[...b.values()];return{apart:Math.max(1,Math.hypot(E.x-T.x,E.y-T.y)),mid:{x:(E.x+T.x)/2,y:(E.y+T.y)/2}}},M=E=>{if(E.pointerType!=="touch"||(E.isPrimary&&(b.clear(),f.pinch=null,c.current=!1),b.set(E.pointerId,{x:E.clientX,y:E.clientY}),b.size!==2))return;let{apart:T,mid:D}=y();f.pinch={from:T,last:T,mid:D},c.current=!0},v=E=>{if(!b.has(E.pointerId))return;b.set(E.pointerId,{x:E.clientX,y:E.clientY});let T=f.pinch;if(!T||b.size!==2)return;let{apart:D,mid:g}=y();if(!(o.current.view.overview??!1))D/T.from<.72&&u(!0,performance.now());else{let L=f.owed??={factor:1,x:T.mid.x,y:T.mid.y,dx:0,dy:0};L.factor*=D/T.last,L.dx+=g.x-T.mid.x,L.dy+=g.y-T.mid.y,f.owing===0&&(f.owing=requestAnimationFrame(h))}T.last=D,T.mid=g},w=E=>{b.delete(E.pointerId)&&(b.size<2&&(f.pinch=null),!(b.size>0)&&(f.owing!==0&&cancelAnimationFrame(f.owing),h(),c.current=!1,d.current()))},x=E=>{E.preventDefault(),o.current.lastScale=1},O=E=>{if(E.preventDefault(),c.current||b.size>1)return;let T=o.current,D=E.scale??1;if(!(T.view.overview??!1)){D<.72&&u(!0,performance.now());return}let g=D/(T.lastScale||1);T.lastScale=D;let S=E;r.current(g,S.clientX,S.clientY)};return a.addEventListener("wheel",m,{passive:!1}),a.addEventListener("gesturestart",x),a.addEventListener("gesturechange",O),a.addEventListener("pointerdown",M),a.addEventListener("pointermove",v),a.addEventListener("pointerup",w),a.addEventListener("pointercancel",w),()=>{f.owing!==0&&(cancelAnimationFrame(f.owing),h()),a.removeEventListener("pointerdown",M),a.removeEventListener("pointermove",v),a.removeEventListener("pointerup",w),a.removeEventListener("pointercancel",w),a.removeEventListener("wheel",m),a.removeEventListener("gesturestart",x),a.removeEventListener("gesturechange",O)}},[n,e]),{zoomAbout:r,panBy:i,pinchBy:s,pinchDone:d,pinching:c}}var va=de(Oe(),1),bd=650,xd=400,yo="[data-graview-view]",ka="button, a, input, select, textarea, [role='button'], aside, section[aria-label], [data-graview-popover], [data-graview-offstage], [data-graview-overlay]";function vd(e,t){if(!(e instanceof Element)||e.closest("[data-graview-pick]"))return!1;let n=e.closest(ka);return n!==null&&n!==t&&t.contains(n)}function xa(e){return e instanceof Element?e.closest(yo):null}function kd(e,t,n){let o=null;for(let{id:r,box:i}of e.cards){if(t<i.left||t>i.right||n<i.top||n>i.bottom)continue;let s=i.width*i.height;(!o||s<o.area)&&(o={id:r,area:s})}return o?.id??null}function Sa(e,t){(0,va.useEffect)(()=>{let n=e.current;if(!n)return;let o=null,r=null,i=-1/0,s=!1,d=m=>{let f=o;if(o=null,r=null,!m.isPrimary||m.button!==0||!f||m.timeStamp-f.at>bd)return;let b=xa(m.target)?.getAttribute("data-graview-view")??null,h=kd(f,m.clientX,m.clientY);!(m.pointerType==="touch"&&f.on!==null&&h===f.on&&m.timeStamp-f.at<=xd)&&(h===b||vd(m.target,n)||h===null)||(m.stopPropagation(),r={to:h,double:h!==null&&h===f.on})},c=(m,f,b,h)=>{s=!0;try{m.dispatchEvent(new MouseEvent(f,{bubbles:!0,cancelable:!0,clientX:b.clientX,clientY:b.clientY,detail:h?2:1}))}finally{s=!1}},l=m=>{if(s)return;if(r){let{to:h,double:y}=r;r=null,i=m.timeStamp+500,m.stopPropagation(),m.preventDefault();let M=h===null?null:[...n.querySelectorAll(yo)].find(v=>v.getAttribute("data-graview-view")===h);h===null?c(n,"click",m,!1):M&&c(M,y?"dblclick":"click",m,y);return}if(t.current)return;let f=m.target instanceof Element?m.target.closest(ka):null;if(f&&f!==n&&n.contains(f)&&!m.target.closest("[data-graview-pick]"))return;let b=xa(m.target)?.getAttribute("data-graview-view")??null;o={at:m.timeStamp,on:b,cards:[...n.querySelectorAll(yo)].map(h=>({id:h.getAttribute("data-graview-view"),box:h.getBoundingClientRect()}))}},a=m=>{s||m.timeStamp>i||(m.stopPropagation(),m.preventDefault(),i=-1/0)},u=m=>{r&&m.stopPropagation()};return n.addEventListener("pointerdown",d,!0),n.addEventListener("pointerup",u,!0),n.addEventListener("click",l,!0),n.addEventListener("dblclick",a,!0),()=>{n.removeEventListener("pointerdown",d,!0),n.removeEventListener("pointerup",u,!0),n.removeEventListener("click",l,!0),n.removeEventListener("dblclick",a,!0)}},[e,t])}var Ma={directed:"You",autonomous:"An agent","co-edited":"You and an agent",rule:"A rule"};function wo(e,t){let n=new Set(e.map(r=>r.id)),o=new Set;for(let r of t){if(n.has(r)){o.add(r);continue}let i=e.find(s=>s.aggregate?.memberIds.includes(r));i&&o.add(i.id)}return o}function bo(e){return e.emphasized?e.stressed?.95:.08:e.anyChosen?e.mine?.9:.12:e.touches?Math.max(.34,.9-.09*Math.max(0,(e.siblings??1)-1)):.12}function xo(e){return e.edgeChosen?.9:e.lit?.78:e.own*(e.anyLit?e.kit.dim:e.kit.rest)}function ht(e,t){if(!e)return null;let n=Math.max(0,Math.min(2,Math.floor(e.plane))),o=Math.max(0,Math.min(2,Math.ceil(e.plane))),{scale:r}=n===o?on(n,t):ei(on(n,t),on(o,t),e.plane-n);return{x:e.x,y:e.y,width:e.width*r,height:e.height*r}}function mn(e,t){if(typeof getComputedStyle>"u"||getComputedStyle(e).visibility==="hidden")return null;let n=-1/0,o=-1/0,r=1/0,i=1/0,s=e.getBoundingClientRect();n=Math.max(n,s.left),o=Math.max(o,s.top),r=Math.min(r,s.right),i=Math.min(i,s.bottom);let d=e.parentElement;for(;d&&d!==t;){let l=getComputedStyle(d);if(l.overflowX!=="visible"||l.overflowY!=="visible"){let a=d.getBoundingClientRect();l.overflowX!=="visible"&&(n=Math.max(n,a.left),r=Math.min(r,a.right)),l.overflowY!=="visible"&&(o=Math.max(o,a.top),i=Math.min(i,a.bottom))}d=d.parentElement}if(r-n<=2||i-o<=2)return null;let c=t.getBoundingClientRect();return{x:n-c.left,y:o-c.top,width:r-n,height:i-o}}function Ve(e,t,n,o=!1){if(!e||typeof document>"u")return null;let r=e.querySelector(`[data-graview-view="${CSS.escape(t)}"]`);return r?mn(vo(r,n,o),e):null}function vo(e,t=!1,n=!1){return(t?e.querySelector(".graview-kind-block"):null)??e.querySelector('[data-graview-primitive="panel"], .graview-kind-face, .graview-kind-card')??(n?null:e.querySelector(':scope > [data-graview-primitive="chip"]'))??e}function xr(e,t,n,o,r){let i=l=>e.nodes.find(a=>a.id===l);if(r.startsWith("screen:")){let l=e.nodes.find(a=>a.id===Re(r.slice(7)));return l?Ve(t,l.id,!0)??ht(l,n):null}let s=i(r),d=He(r);if(!s&&d!==null&&(s=i(Be(d))),!s&&Wt(r)){let[l]=Rt(r);l&&(s=i(Re(l)))}if(!s){let l=o.places().find(a=>a.as===r);l&&(s=i(Be(l.kind))??i(Re(l.kind)))}if(s||(s=[...e.nodes].filter(l=>l.aggregate?.memberIds.includes(r)).sort((l,a)=>l.plane-a.plane)[0]),!s)return null;let c=e.city!==void 0;return Ve(t,s.id,c&&s.aggregate!==void 0&&Math.round(s.plane)===2)??ht(s,n)}var ft=de(Oe(),1);var Ye=de(Oe(),1);var Ge=de(Ae(),1);function Aa({title:e,name:t,path:n,maxHeight:o,children:r}){let i=(0,Ye.useContext)(qo),[s,d]=(0,Ye.useState)(void 0),[c,l]=(0,Ye.useState)(void 0),[a,u]=(0,Ye.useState)(void 0),[m,f]=(0,Ye.useState)(!1),[b,h]=(0,Ye.useState)(!1),y=(0,Ye.useRef)(null),M=(0,Ye.useRef)(null);(0,Ye.useLayoutEffect)(()=>{let S=y.current,L=M.current;if(!S||!L||typeof ResizeObserver>"u")return;let C=()=>{u(S.clientHeight),l(L.offsetHeight||void 0)};C();let V=new ResizeObserver(C);return V.observe(S),V.observe(L),()=>V.disconnect()},[]);let v=Math.max(s??0,c??0)||void 0,w=!m&&v!==void 0&&a!==void 0&&v>a+1,x=i&&n?n:void 0,O=x&&i?.href?i.href(x):void 0,E=S=>S.stopPropagation(),T=S=>{E(S),!(O&&(S.metaKey||S.ctrlKey||S.shiftKey||S.button!==0))&&(S.preventDefault(),x&&i?.open(x))},D=O?{href:O}:{role:"link",tabIndex:0},g={onPointerDown:E,onDoubleClick:E,onKeyDown:S=>{S.key!=="Enter"&&S.key!==" "||(E(S),S.key==="Enter"&&S.currentTarget.tagName==="A"&&!S.currentTarget.hasAttribute("href")&&(S.preventDefault(),S.currentTarget.click()))}};return(0,Ge.jsxs)("section",{"data-graview-preview":t,"aria-label":e,...m?{"data-graview-expanded":"","data-graview-overlay":""}:{},onKeyDown:m?S=>{S.key==="Escape"&&(S.stopPropagation(),f(!1))}:void 0,style:{...Sd,...m?Md:{}},children:[(0,Ge.jsxs)("div",{style:Ed,children:[(0,Ge.jsx)("strong",{style:Rd,children:e}),x?(0,Ge.jsx)("a",{"data-graview-preview-open":"",...D,"aria-label":`Open ${e}`,style:Ea,...g,onClick:T,children:"Open"}):w||m?(0,Ge.jsx)("button",{type:"button","data-graview-preview-expand":"","aria-expanded":m,"aria-label":`${m?"Collapse":"Expand"} ${e}`,style:{...Ea,...Ra},...g,onClick:S=>{E(S),f(L=>!L)},children:m?"Collapse":"Expand"}):null]}),(0,Ge.jsxs)("div",{ref:y,"data-graview-preview-body":"",...s!==void 0?{"data-graview-content-height":s}:{},...w?{"data-graview-more":""}:{},onFocus:()=>h(!0),onBlur:()=>h(!1),style:{...Od,...o!==void 0&&!m?{maxHeight:o}:{},...b?{overflowClipMargin:4}:{}},children:[(0,Ge.jsx)("div",{ref:M,"data-graview-preview-drawn":"",style:Ad,children:(0,Ge.jsx)(Xo.Provider,{value:d,children:r})}),w?(0,Ge.jsx)("div",{"aria-hidden":"true","data-graview-preview-fade":"",style:Pd}):null,w?x?(0,Ge.jsx)("a",{"data-graview-preview-more":"",...D,"aria-label":`More of ${e}`,style:Oa,...g,onClick:T,children:"More"}):(0,Ge.jsx)("button",{type:"button","data-graview-preview-more":"","aria-label":`More of ${e}`,style:{...Oa,...Ra},...g,onClick:S=>{E(S),f(!0)},children:"More"}):null]})]})}var Sd={display:"flex",flexDirection:"column",gap:"var(--graview-gap, 7px)",width:"100%",maxHeight:"100%",minHeight:0,padding:"var(--graview-pad, 15px)",boxSizing:"border-box",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge, #e4e0d8)",boxShadow:"var(--graview-lift-low)",background:"var(--graview-panel, #ffffff)",color:"var(--graview-ink, #1a1a1a)",overflow:"hidden"},Md={maxHeight:"none",position:"absolute",top:0,left:0,right:0,width:"auto"},Ed={display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:8,minWidth:0,flex:"0 0 auto"},Rd={fontFamily:"var(--graview-font-display, inherit)",fontSize:"0.9375rem",lineHeight:1.25,fontWeight:560,letterSpacing:"0.005em",minWidth:0,overflowWrap:"anywhere"},Ea={marginLeft:"auto",fontSize:"0.8125rem",fontWeight:560,color:"var(--graview-accent, #2f6f5e)",textDecoration:"none",textUnderlineOffset:"0.2em"},Ra={font:"inherit",fontSize:"0.8125rem",fontWeight:560,background:"none",border:0,padding:0,cursor:"pointer"},Od={position:"relative",flex:"0 1 auto",minHeight:0,overflowX:"visible",overflowY:"clip",minWidth:0},Ad={display:"flow-root",minWidth:0},Pd={position:"absolute",left:0,right:0,bottom:0,height:64,pointerEvents:"none",background:"linear-gradient(to bottom, transparent, var(--graview-panel, #ffffff) 66%)"},Oa={position:"absolute",right:0,bottom:0,lineHeight:1.5,fontSize:"0.8125rem",fontWeight:560,color:"var(--graview-accent, #2f6f5e)",textDecoration:"none",textUnderlineOffset:"0.2em"};var ge=de(Ae(),1),La=(0,ft.memo)(function({kinds:t}){let{store:n}=ve(),{view:o,go:r}=zr(),i=(0,ft.useRef)(null),s=Yr("districts",{align:"start"}),d=s.open,c=f=>er(n.schema,f),l=f=>n.graph.allNodes().filter(b=>b.kind===f).length,a=f=>!o.overview&&o.focusId===Be(f),u=t.filter(f=>!a(f)),m=f=>{s.setOpen(!1);let b=i.current?.querySelector(".graview-beyond-more")??null;a(f)||r(Et(o,Be(f))),b?.focus({preventScroll:!0});let h=`[data-graview-view="${Be(f)}"][tabindex], [data-graview-view="${Re(f)}"][tabindex]`,y=40,M=()=>{let v=document.querySelector(h);v?v.focus({preventScroll:!0}):--y>0&&requestAnimationFrame(M)};requestAnimationFrame(M)};return(0,ge.jsxs)("div",{ref:i,className:"graview-beyond","data-graview-beyond":t.length,"data-graview-beyond-open":d?"":void 0,children:[(0,ge.jsxs)("button",{type:"button",className:"graview-beyond-more","data-testid":"beyond-more",...s.trigger,"aria-haspopup":"menu",title:`${u.length} more district${u.length===1?"":"s"} \u2014 press to see them`,onPointerDown:f=>f.stopPropagation(),onClick:f=>{f.stopPropagation(),s.toggle()},children:[(0,ge.jsx)("span",{className:"graview-beyond-count",children:u.length})," ",(0,ge.jsxs)("span",{className:"graview-beyond-word",children:["more district",u.length===1?"":"s"]}),(0,ge.jsx)("span",{className:"graview-beyond-chevron","aria-hidden":"true",children:d?"\u25BE":"\u25B4"})]}),d?(0,ge.jsx)("ul",{...s.pane,className:"graview-beyond-list",role:"menu","aria-label":"The other districts","data-testid":"beyond-list",style:Gr,onPointerDown:f=>f.stopPropagation(),children:t.map(f=>(0,ge.jsx)("li",{role:"none",children:(0,ge.jsxs)("button",{type:"button",role:"menuitem","data-graview-pick":Re(f),"aria-current":a(f)?"location":void 0,title:a(f)?`${c(f)} \u2014 where you are`:`Go to ${c(f)}`,onPointerDown:b=>b.stopPropagation(),onClick:b=>{b.stopPropagation(),m(f)},children:[(0,ge.jsx)("span",{className:"graview-beyond-name",children:c(f)}),(0,ge.jsx)("span",{className:"graview-beyond-tally",children:a(f)?"here":l(f)})]})},f))}):null]})},(e,t)=>e.kinds.length===t.kinds.length&&e.kinds.every((n,o)=>n===t.kinds[o]));function Ca(e,t){if(e===t)return!0;let n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(o=>o==="x"||o==="y"||So(e[o],t[o]))}function So(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)!==Array.isArray(t)||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==Array.prototype)return!1;if(Array.isArray(e)){let r=t;if(e.length!==r.length)return!1;for(let i=0;i<e.length;i++)if(!So(e[i],r[i]))return!1;return!0}let o=Object.keys(e);return o.length!==Object.keys(t).length?!1:o.every(r=>So(e[r],t[r]))}var Ta=(0,ft.memo)(Ia,(e,t)=>e.mode===t.mode&&e.selected===t.selected&&e.fidelity===t.fidelity&&Ca(e.node,t.node));function Ia({node:e,mode:t,selected:n,fidelity:o}){let{store:r,views:i,view:s}=ve(),d=Vt(),c=gi(),l=pi(),a=e.aggregate||Wt(e.id)||He(e.id)!==null?"many":"one",u={cardinality:a,fidelity:o??Jo[Cd(e.plane)].fidelity},m=a==="many"&&e.id===s.focusId?s.within?.view:void 0,f=i.resolve(e.kind,u,m),b=f?.view,h=i.resolve(e.kind,{cardinality:"many",fidelity:"full"})?.view,y=h!==void 0&&h.generic!==!0,M=e.aggregate?.memberIds,v=(0,ft.useMemo)(()=>(M??[]).map(D=>r.graph.getNode(D)).filter(D=>D!==void 0),[M,r,d]),w={...e.aggregate?{nodes:v,label:f?.title??e.aggregate.label}:{node:r.graph.getNode(e.id)},fidelity:u.fidelity,cardinality:u.cardinality,mode:t,selected:n,implicated:c,flagged:l,...e.raised?{raised:!0}:{},...e.focused?{focused:!0}:{},...e.opened?{opened:!0}:{},...e.openedRows!==void 0?{openedRows:e.openedRows}:{},...e.plot?{plot:e.plot}:{},...e.nameplate?{nameplate:e.nameplate}:{},...e.states?{states:e.states}:{},...e.aggregate?.retired?{retired:e.aggregate.retired}:{},...e.rank?{rank:e.rank}:{},...e.nestedUnder?{nestedUnder:e.nestedUnder}:{},...y?{hasOwnView:!0}:{}};if(!b)return(0,ge.jsx)(Td,{node:e,props:w});let x=Zo(b),O=!e.aggregate&&w.node?w.node:void 0,E=x?O?{title:en(r.schema.tryDefinition(O.kind),O),name:O.id,path:jo(r.schema,O.kind,O.id)}:{title:w.label??e.kind,name:f?.title?Tr(f.title):"",path:f?.title?`/places/${Tr(f.title)}`:void 0}:void 0,T=[e.id,f?.title??"",u.fidelity,u.cardinality,t,n,e.raised??!1,e.focused??!1,e.opened??!1,e.openedRows??"",e.rank??"",e.nestedUnder??"",e.plot?`${e.plot.col},${e.plot.row},${e.plot.side}`:"",e.nameplate??"",e.states?e.states.values.map(D=>D.count).join(","):"",e.aggregate?ko(e.aggregate.memberIds):"",e.aggregate?.retired??"",c?ko(c):"",l?ko(l):"",y].join("|");return(0,ge.jsx)(Wr,{mode:t,children:(0,ge.jsx)(wi,{kind:w.label??e.kind,...f?.title?{view:f.title}:{},children:(0,ge.jsx)(Ld,{signature:T,graph:d,draw:()=>x&&E?(0,ge.jsx)(Aa,{...E,maxHeight:x.maxHeight,children:(0,ge.jsx)(b,{...w})}):(0,ge.jsx)(b,{...w})})},`${e.id}|${f?.title??""}`)})}var Ld=(0,ft.memo)(function({draw:t}){return(0,ge.jsx)(ge.Fragment,{children:t()})},(e,t)=>e.signature===t.signature&&e.graph===t.graph);function Cd(e){return Math.max(0,Math.min(2,Math.round(e)))}function Td({node:e,props:t}){return(0,ge.jsxs)("div",{style:{padding:8,font:"13px/1.4 system-ui",overflow:"hidden"},children:[(0,ge.jsx)("strong",{children:t.label??e.kind}),t.nodes?(0,ge.jsxs)("div",{children:[t.nodes.length," items"]}):(0,ge.jsx)("div",{children:e.id})]})}var Na=(0,ft.memo)(function({node:t}){let{store:n}=ve(),o=jt(),r=t.aggregate,i=r.opens,s=r.memberIds.length,d=tn(n.schema,r.kind,s),c=r.memberIds.slice(0,3).map(m=>{let f=n.graph.getNode(m),b=f?n.schema.tryDefinition(f.kind):void 0;return f?b?.label?b.label(f):String(f.label??m):m}),l=r.memberIds,a=(0,ft.useMemo)(()=>{let m=o?ir(o):null;return m?l.filter(f=>m.has(f)).length:0},[o,l]),u=i.in==="picture";return(0,ge.jsxs)("div",{className:"graview-band-group","data-graview-band":i.in,"data-graview-band-count":s,"data-graview-emphasis":o?a>0?"lit":"dimmed":void 0,title:u?`${r.label} \u2014 press twice to see them all, arranged`:`${r.label}: ${d} \u2014 press twice to open`,children:[(0,ge.jsxs)("span",{className:"graview-band-group-head",children:[(0,ge.jsx)("span",{className:"graview-band-group-name",children:r.label}),(0,ge.jsx)("span",{className:"graview-band-group-open","aria-hidden":"true",children:u?"\u2197":"\u25BE"})]}),(0,ge.jsxs)("span",{className:"graview-band-group-names",children:[u?null:(0,ge.jsxs)("span",{className:"graview-band-group-count",children:[d,a>0?` \xB7 ${a} match`:""," \xB7 "]}),c.join(" \xB7 "),s>c.length?" \u2026":""]})]})},(e,t)=>Ca(e.node,t.node)),Pa=new WeakMap;function ko(e){let t=Pa.get(e);if(t!==void 0)return t;let n=2166136261;for(let r of e){for(let i=0;i<r.length;i++)n=Math.imul(n^r.charCodeAt(i),16777619);n=Math.imul(n^44,16777619)}let o=`${e.length}:${(n>>>0).toString(36)}`;return Pa.set(e,o),o}var mt=de(Oe(),1);function Mo(e,t,n){let o=e.aggregate?[...e.aggregate.memberIds]:[e.id];return n?o.every(i=>t.includes(i))?t.filter(i=>!o.includes(i)):[...t,...o.filter(i=>!t.includes(i))]:o}function Ha(){let[e,t]=(0,mt.useState)(16);return(0,mt.useEffect)(()=>{if(typeof window>"u")return;let n=document.documentElement,o=()=>{let i=parseFloat(getComputedStyle(n).fontSize);Number.isFinite(i)&&t(s=>Math.abs(s-i)<.5?s:i)};o();let r=new MutationObserver(o);return r.observe(n,{attributes:!0,attributeFilter:["style"]}),window.addEventListener("resize",o),()=>{r.disconnect(),window.removeEventListener("resize",o)}},[]),e}function Ba(e){let[t,n]=(0,mt.useState)(null);return(0,mt.useLayoutEffect)(()=>{let o=e.current?.getBoundingClientRect();!o||o.width===0||o.height===0||n(r=>r??{width:Math.round(o.width),height:Math.round(o.height)})},[e]),(0,mt.useEffect)(()=>{let o=e.current;if(!o||typeof ResizeObserver>"u")return;let r=d=>{!d||d.width===0||d.height===0||n(c=>{let l={width:Math.round(d.width),height:Math.round(d.height)};return c&&c.width===l.width&&c.height===l.height?c:l})},i=new ResizeObserver(d=>r(d[0]?.contentRect)),s=()=>r(o.getBoundingClientRect());return i.observe(o),addEventListener("resize",s),()=>{i.disconnect(),removeEventListener("resize",s)}},[e]),t}var Id=120;function Da(e){let t=(0,mt.useRef)(null);if(e===null)return t.current?.size??null;let n=t.current,o=typeof innerHeight=="number"?innerHeight:0;if(n&&n.size.width===e.width&&n.size.height===e.height)return n.size;let r=n?e.height-n.size.height:0,i=typeof navigator<"u"&&(navigator.maxTouchPoints>0||typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches);return n&&i&&e.width===n.size.width&&r>0&&r<=Id&&Math.abs(o-n.screen-r)<=1?n.size:(t.current={size:e,screen:o},e)}function Eo(e,t){if(t==="dark")return`0 ${(10*e).toFixed(1)}px ${(34*e).toFixed(1)}px rgba(0,0,0,${(e+.12).toFixed(2)})`;let n=`0 ${(1+2*e).toFixed(1)}px ${(2+5*e).toFixed(1)}px rgba(20,30,32,${(.03+.06*e).toFixed(3)})`,o=`0 ${(6+26*e).toFixed(1)}px ${(18+60*e).toFixed(1)}px -${(10+10*e).toFixed(1)}px rgba(20,30,32,${(.1+.3*e).toFixed(3)})`;return`${n}, ${o}`}function $a(e){return`matrix3d(${e.join(",")})`}var ye=de(Oe(),1);var Ro=(e,t)=>t.some(n=>e.x>n.x&&e.x<n.x+n.width&&e.y>n.y&&e.y<n.y+n.height);function Oo(e,t){let n=[],o=[];for(let i=0;i<e.length-1;i++){let s=e[i],d=e[i+1],c=!Ro(s,t);c&&o.length===0&&o.push(s);for(let l=1;l<=48;l++){let a=l/48,u={x:s.x+(d.x-s.x)*a,y:s.y+(d.y-s.y)*a},m=!Ro(u,t);if(m===c)continue;let f=(l-1)/48,b=a;for(let M=0;M<10;M++){let v=(f+b)/2,w={x:s.x+(d.x-s.x)*v,y:s.y+(d.y-s.y)*v};!Ro(w,t)===c?f=v:b=v}let h=(f+b)/2,y={x:s.x+(d.x-s.x)*h,y:s.y+(d.y-s.y)*h};m?o=[y]:(o.push(y),o.length>=2&&n.push(o),o=[]),c=m}c&&o.push(d)}return o.length>=2&&n.push(o),n}function jn(e,t){let n=Math.abs(t.x-e.x);if(Math.abs(t.y-e.y)>n){if(n<2)return[e,t];let i=(e.y+t.y)/2;return[e,{x:e.x,y:i},{x:t.x,y:i},t]}let r=(e.x+t.x)/2;return Math.abs(t.x-e.x)<2?[e,t]:[e,{x:r,y:e.y},{x:r,y:t.y},t]}var Qe=e=>Math.round(e*100)/100,Ct=e=>e.map(t=>t.map((n,o)=>`${o===0?"M":"L"} ${Qe(n.x)} ${Qe(n.y)}`).join(" ")).join(" ");function Ao(e,t){if(e.length<3)return Ct([e]);let n=[`M ${Qe(e[0].x)} ${Qe(e[0].y)}`];for(let r=1;r<e.length-1;r++){let i=e[r-1],s=e[r],d=e[r+1],c=Math.hypot(s.x-i.x,s.y-i.y),l=Math.hypot(d.x-s.x,d.y-s.y),a=Math.min(t,c/2,l/2),u={x:s.x+(i.x-s.x)/(c||1)*a,y:s.y+(i.y-s.y)/(c||1)*a},m={x:s.x+(d.x-s.x)/(l||1)*a,y:s.y+(d.y-s.y)/(l||1)*a};n.push(`L ${Qe(u.x)} ${Qe(u.y)} Q ${Qe(s.x)} ${Qe(s.y)} ${Qe(m.x)} ${Qe(m.y)}`)}let o=e[e.length-1];return n.push(`L ${Qe(o.x)} ${Qe(o.y)}`),n.join(" ")}function Fa(e,t){return t==="orthogonal"?Ct([e]):Ao(e,10)}function Wa(e,t,n){if(e==="orthogonal"){let d=jn(t.p0,t.p1),c=d.slice(1).map((u,m)=>Math.hypot(u.x-d[m].x,u.y-d[m].y)),l=c.reduce((u,m)=>u+m,0)||1,a=n*l;for(let u=0;u<c.length;u++){let m=c[u];if(a<=m||u===c.length-1){let f=m===0?0:Math.min(1,a/m),b=d[u],h=d[u+1];return{x:b.x+(h.x-b.x)*f,y:b.y+(h.y-b.y)*f}}a-=m}return t.p1}let o=e==="straight"?{x:(t.p0.x+t.p1.x)/2,y:(t.p0.y+t.p1.y)/2}:t.c,r=(1-n)*(1-n),i=2*(1-n)*n,s=n*n;return{x:r*t.p0.x+i*o.x+s*t.p1.x,y:r*t.p0.y+i*o.y+s*t.p1.y}}function vr(e,t){return e!=="straight"?t:{...t,c:{x:(t.p0.x+t.p1.x)/2,y:(t.p0.y+t.p1.y)/2}}}function ja(e,t){let n=t.x-e.x,o=t.y-e.y,r=(n/2+o)/2,i=(o-n/2)/2;if(Math.abs(r)<1||Math.abs(i)<1)return[e,t];let s={x:e.x+2*r,y:e.y+r};return[e,s,t]}function Va(e){let t=[...e].sort((o,r)=>o.y-r.y||o.x-r.x),n=[];for(let o of t){let r=n.find(i=>o.y<i.bottom+3&&o.y+o.height>i.top-3);r?(r.boxes.push(o),r.top=Math.min(r.top,o.y),r.bottom=Math.max(r.bottom,o.y+o.height)):n.push({top:o.y,bottom:o.y+o.height,boxes:[o]})}for(let o of n)o.boxes.sort((r,i)=>r.x-i.x);return n.sort((o,r)=>o.top-r.top)}var Vn=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,Lo=(e,t)=>e.findIndex(n=>n.boxes.some(o=>Vn(o,t)));function za(e,t,n){return t<0?e[0].top-12*2:n>=e.length?e[e.length-1].bottom+12*2:(e[t].bottom+e[n].top)/2}function To(e,t){let n=[{from:-1/0,to:1/0}];for(let i of e){let s=[],d=-1/0;for(let l of i.boxes)s.push({from:d,to:l.x-12}),d=Math.max(d,l.x+l.width+12);s.push({from:d,to:1/0});let c=[];for(let l of n)for(let a of s){let u=Math.max(l.from,a.from),m=Math.min(l.to,a.to);m-u>=0&&c.push({from:u,to:m})}n=c}let o=t,r=1/0;for(let i of n){let s=Math.min(Math.max(t,i.from),i.to),d=i.from===-1/0||i.to===1/0,c=Math.abs(s-t)+(d?60:0);c<r&&(r=c,o=s)}return o}var ot=e=>({x:e.x,y:-(e.y+e.height),width:e.width,height:e.height}),kr=e=>e.map(t=>({x:t.x,y:-t.y}));function Co(e){let t=(o,r)=>Math.abs(o-r)<.5,n=e.filter((o,r)=>r===0||!(t(o.x,e[r-1].x)&&t(o.y,e[r-1].y)));return n.filter((o,r)=>{let i=n[r-1],s=n[r+1];return!i||!s||!(t(i.x,o.x)&&t(o.x,s.x)||t(i.y,o.y)&&t(o.y,s.y))})}function Io(e,t,n){let o=e.boxes.filter(l=>!Vn(l,t)&&l.y+l.height<=t.y+1&&l.x<t.x+t.width&&l.x+l.width>t.x),r=[{from:t.x+6,to:t.x+t.width-6}];for(let l of o)r=r.flatMap(a=>[{from:a.from,to:Math.min(a.to,l.x-12/2)},{from:Math.max(a.from,l.x+l.width+12/2),to:a.to}]).filter(a=>a.to>=a.from);let i=null;for(let l of r){let a=Math.min(Math.max(n,l.from),l.to);(i===null||Math.abs(a-n)<Math.abs(i-n))&&(i=a)}if(i!==null)return{x:i,tail:[{x:i,y:t.y}]};let s=n<t.x+t.width/2,d=To([e],s?t.x-12:t.x+t.width+12),c=t.y+t.height/2;return{x:d,tail:[{x:d,y:c},{x:d<t.x?t.x:t.x+t.width,y:c}]}}function Po(e,t,n){let o=Io({top:-e.bottom,bottom:-e.top,boxes:e.boxes.map(ot)},ot(t),n);return{x:o.x,head:kr(o.tail).reverse()}}function Ga(e,t,n,o){let r=t;for(;r>o&&!e[r-1].boxes.some(i=>n>i.x-12/2&&n<i.x+i.width+12/2);)r--;return r}var Ya=(e,t)=>(e%3-1)*Math.max(0,Math.min(4,t/2-3));function _a(e,t,n,o,r,i,s,d){let c=h=>h<0?e[0].top-n:e[h+1].top-e[h].bottom,l=h=>(h<0?(n+e[0].top)/2:za(e,h,h+1))+Ya(d,c(h)),a=Io(e[i],r,s),u=Ga(e,i,a.x,t+1),m=l(t);if(u===t+1)return Co([...o.head,{x:o.x,y:m},{x:a.x,y:m},...a.tail]);let f=To(e.slice(t+1,u),a.x),b=l(u-1);return Co([...o.head,{x:o.x,y:m},{x:f,y:m},{x:f,y:b},{x:a.x,y:b},...a.tail])}function pn(e,t,n,o=0){let r=Va(n.some(a=>Vn(a,e))&&n.some(a=>Vn(a,t))?n:[...n,e,t]),i=Lo(r,e),s=Lo(r,t),d=e.x+e.width/2,c=t.x+t.width/2;if(i===s){if(!(i<r.length-1||r.length===1))return kr(pn(ot(e),ot(t),n.map(ot),o));let u=za(r,i,i+1)+Ya(o,i<r.length-1?r[i+1].top-r[i].bottom:2*12),m=Po(r[i],e,c),f=Po(r[i],t,d);return Co([...m.head,{x:m.x,y:u},{x:f.x,y:u},...[...f.head].reverse()])}if(s<i)return kr(pn(ot(e),ot(t),n.map(ot),o));let l=Po(r[i],e,c);return _a(r,i,r[i].bottom,l,t,s,d,o)}function No(e,t,n,o=0){if(t.y+t.height<=e.y){let f=No(ot(e),ot(t),n.map(ot),o);return f?kr(f):null}let r=e.y+e.height;if(t.y<r)return null;let i=Va([...n.filter(f=>f.y>=r&&!Vn(f,t)),t]),s=Lo(i,t),d=t.x+t.width/2,c=Io(i[s],t,d),l=Ga(i,s,c.x,0),a=l===0?c.x:To(i.slice(0,l),c.x),u=Math.min(12,e.width/2),m=Math.min(Math.max(a,e.x+u),e.x+e.width-u);return _a(i,-1,r,{x:m,head:[{x:m,y:r}]},t,s,d,o)}function Ka(e,t=16){let n=new Map;for(let r of e){let i=r.a<r.b?`${r.a}\0${r.b}`:`${r.b}\0${r.a}`,s=n.get(i);s?s.push(r.key):n.set(i,[r.key])}let o=new Map;for(let r of n.values())r.forEach((i,s)=>o.set(i,(s-(r.length-1)/2)*t));return o}var _e=de(Ae(),1);function Bo(e,t,n,o){let r=[];for(let i of e.querySelectorAll("[data-graview-relation] > span")){let s=i.getBoundingClientRect();if(s.width<=0||s.height<=0)continue;let d=s.top-t.top,c=i.parentElement?.getAttribute("data-graview-relation"),l=1/0;for(let a of n){if(Math.round(a.plane)!==1||!a.via||`${a.via.edgeKind}|${a.via.direction}`!==c)continue;let u=o(a.id);u&&u.y>=d+s.height-1&&(l=Math.min(l,u.y))}r.push({x:s.left-t.left,y:d,width:s.width,height:l-d<=s.height*4?l-d:s.height})}return r}function Mr(e,t){let n=Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x),o=Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y);if(n>0&&o>0)return null;let r=n>.5*Math.min(e.width,t.width),i=!r&&o>.5*Math.min(e.height,t.height);if(r){let b={x:e.x+e.width,y:e.y+e.height/2},h={x:t.x+t.width,y:t.y+t.height/2};return{from:b,to:h,control:{x:Math.max(b.x,h.x)+18,y:(b.y+h.y)/2},mode:"stacked"}}if(i){let b={x:e.x+e.width/2,y:e.y},h={x:t.x+t.width/2,y:t.y};return{from:b,to:h,control:{x:(b.x+h.x)/2,y:Math.min(b.y,h.y)-18},mode:"abreast"}}let s={x:t.x+t.width/2,y:t.y+t.height/2},d={x:e.x+e.width/2,y:e.y+e.height/2},c=Sr(e,s),l=Sr(t,d),a=Math.hypot(l.x-c.x,l.y-c.y);if(a<8)return null;let u=Math.min(36,a*.12),m=-(l.y-c.y)/a,f=(l.x-c.x)/a;return{from:c,to:l,control:{x:(c.x+l.x)/2+m*u,y:(c.y+l.y)/2+f*u},mode:"direct"}}function Sr(e,t){let n=e.x+e.width/2,o=e.y+e.height/2,r=t.x-n,i=t.y-o;if(r===0&&i===0)return{x:n,y:o};let s=r===0?1/0:e.width/2/Math.abs(r),d=i===0?1/0:e.height/2/Math.abs(i),c=Math.min(s,d),l=Math.max(0,c*.98);return{x:n+r*l,y:o+i*l}}function Nd(e,t,n){let o=t.get(e.from),r=t.get(e.to);if(!o||!r)return!1;if(n)return!0;let i=Math.round(o.plane)===1||Math.round(r.plane)===1,s=d=>!!d.aggregate&&Math.round(d.plane)===2;return i&&!s(o)&&!s(r)}var Xa=e=>({clips:new Map,members:new Map,marks:new Map,...e?{owed:e}:{}});function qa(e,t){let n=Xa();for(let[o,r]of t){let i=e.querySelector(`[data-graview-view="${CSS.escape(o)}"]`);if(i!==null){for(let s of r)if(gn(e,i,s,n).length>0)return!0}}return!1}function Qa(e,t){let n=t.marks.get(e);if(n)return n;n=new Map;for(let o of e.querySelectorAll("[data-graview-pick], [data-graview-slot]"))for(let r of new Set([o.getAttribute("data-graview-pick"),o.getAttribute("data-graview-slot")])){if(r===null)continue;let i=n.get(r);i?i.push(o):n.set(r,[o])}return t.marks.set(e,n),n}function Hd(e,t){let n=t.clips.get(e);if(n===void 0){let o=getComputedStyle(e);n=o.overflow!=="visible"||o.overflowX!=="visible"||o.overflowY!=="visible"?e.getBoundingClientRect():null,t.clips.set(e,n)}return n}function Bd(e,t,n){let o=e.parentElement;for(;o!==null;){let r=Hd(o,n);if(r&&!(t.right>r.left+1&&t.left<r.right-1&&t.bottom>r.top+1&&t.top<r.bottom-1))return!1;if(o.hasAttribute("data-graview-view"))break;o=o.parentElement}return!0}function gn(e,t,n,o){if(!e||!t||typeof document>"u")return[];let r=o.members.get(t);r||o.members.set(t,r=new Map);let i=r.get(n);if(i)return i;let s=e.getBoundingClientRect(),d=[];for(let l of Qa(t,o).get(n)??[]){if(l.closest("[data-graview-offstage]"))continue;let a=l.getBoundingClientRect();a.width<=2||a.height<=2||Bd(l,a,o)&&d.push({x:a.left-s.left,y:a.top-s.top,width:a.width,height:a.height})}d.sort((l,a)=>l.width*l.height-a.width*a.height),r.set(n,d);let c=t.getAttribute("data-graview-view");return d.length===0&&o.owed&&c!==null&&o.owed.set(c,(o.owed.get(c)??new Set).add(n)),d}function Er(e,t,n,o,r,i){let s=new Map(e.map(w=>[w.id,w])),d=Xa(i),c=new Map,l=w=>{if(!n||typeof document>"u")return null;let x=c.get(w);return x===void 0&&(x=n.querySelector(`[data-graview-view="${CSS.escape(w)}"]`),c.set(w,x)),x},a=new Map;for(let w of e){let x=Ve(n,w.id,o)??ht(w,r);x&&a.set(w.id,x)}let u=new Map;if(n&&typeof document<"u"){let w=n.getBoundingClientRect();for(let x of n.querySelectorAll("[data-graview-pick], [data-graview-slot]")){if(x.closest("[data-graview-offstage]"))continue;let O=x.getAttribute("data-graview-pick")??x.getAttribute("data-graview-slot");if(O===null)continue;let E=x.getBoundingClientRect();if(E.width<=2||E.height<=2||E.width>w.width*.6&&E.height>w.height*.6)continue;let T=u.get(O),D={x:E.left-w.left,y:E.top-w.top,width:E.width,height:E.height};T?T.push(D):u.set(O,[D])}}let m=(w,x)=>{let O=[];for(let[E,T]of a)E!==w&&E!==x&&O.push(T);for(let[E,T]of u)E!==w&&E!==x&&O.push(...T);return O},f=w=>Math.round(s.get(w)?.plane??-1)===1,b=[];for(let w of e){let x=a.get(w.id);x&&Math.round(w.plane)===1&&b.push(x)}if(!o&&n&&typeof document<"u"){let w=n.getBoundingClientRect();b.push(...Bo(n,w,e,x=>a.get(x)))}let h=(w,x)=>!o&&f(w)&&f(x)?b:void 0,y=o?void 0:e.find(w=>Math.round(w.plane)===0&&!w.aggregate),M=(w,x,O,E)=>{if(!y)return{};let T=w.to===y.id&&O===y.id;if(!T&&!(w.from===y.id&&x===y.id))return{};let D=T?w.from:w.to,g=a.get(y.id),S=a.get(D);if(D===y.id||!f(D)||!g||!S)return{};let L=l(y.id),C=ae=>L!==null&&Qa(L,d).get(ae)?.some(I=>!I.closest("[data-graview-offstage]"))===!0,V=E.map(ae=>ae.from===y.id?ae.to:ae.from),X=V.length>0&&V.every(C);return{band:b,tie:{card:g,chip:S,cardIsTo:T,toward:D,holds:s.get(D)?.aggregate?.memberIds??[D]},...X?{said:V}:{}}},v=[];for(let w of t){if(!Nd(w,s,o))continue;let x=a.get(w.from),O=a.get(w.to);if(!x||!O)continue;let E=m(w.from,w.to),T=w.edges,D=o&&T.some(L=>L.from!==w.from&&gn(n,l(w.from),L.from,d).length>0||L.to!==w.to&&gn(n,l(w.to),L.to,d).length>0),g=h(w.from,w.to);if(o&&!D||w.loop||T.length===0){v.push({key:w.id,connector:w,edges:T,fromBox:x,toBox:O,fromAnchor:w.from,toAnchor:w.to,obstacles:E,hosts:[],...g?{band:g}:{},...M(w,w.from,w.to,T)});continue}let S=new Map;for(let L of T){let C=L.from===w.from?[]:gn(n,l(w.from),L.from,d),V=L.to===w.to?[]:gn(n,l(w.to),L.to,d),X=[w.from,w.to].find(R=>Math.round(s.get(R)?.plane??-1)===0);if(!o&&X!==void 0&&(X===w.from?L.from!==w.from:L.to!==w.to)&&gn(n,l(X),X===w.from?L.to:L.from,d).length>0)continue;let ae=X!==void 0?s.get(X):void 0;if(!o&&ae?.aggregate&&n&&(X===w.from?L.from!==w.from&&C.length===0:L.to!==w.to&&V.length===0))continue;let I=C.length>0?L.from:w.from,$=V.length>0?L.to:w.to,N=`${w.id}|${I}|${$}`,q=S.get(N);if(q){q.edges.push(L);continue}let P=C.length>0?C:[x],j=V.length>0?V:[O],W=P[0],Q=j[0],k=1/0;for(let R of P)for(let B of j){let G=Math.hypot(R.x+R.width/2-(B.x+B.width/2),R.y+R.height/2-(B.y+B.height/2));G<k&&(k=G,W=R,Q=B)}S.set(N,{edges:[L],fromBox:W,toBox:Q,fromAnchor:I,toAnchor:$})}for(let[L,C]of S)v.push({key:L,connector:w,obstacles:E,hosts:[...C.fromAnchor!==w.from?[x]:[],...C.toAnchor!==w.to?[O]:[]],...g?{band:g}:{},...C,...M(w,C.fromAnchor,C.toAnchor,C.edges)})}return v}function Za(e,t,n){let o=new Map(t.map(s=>[s.id,s])),r=new Map;for(let s of n){let d=o.get(s.id);d&&(d.x!==s.x||d.y!==s.y)&&r.set(s.id,{x:s.x-d.x,y:s.y-d.y})}if(r.size===0)return[...e];let i=(s,d)=>{let c=r.get(d);return c?{...s,x:s.x+c.x,y:s.y+c.y}:s};return e.map(s=>{let{from:d,to:c}=s.connector;if(!r.has(d)&&!r.has(c))return s;let l=i(s.fromBox,d),a=i(s.toBox,c),u=s.tie&&{...s.tie,card:i(s.tie.card,s.tie.cardIsTo?c:d),chip:i(s.tie.chip,s.tie.toward)},m=f=>f===s.fromBox?l:f===s.toBox?a:s.tie&&f===s.tie.chip?u.chip:f;return{...s,fromBox:l,toBox:a,...u?{tie:u}:{},...s.band?{band:s.band.map(m)}:{}}})}function Ho(e,t){let n=(1-t)*(1-t),o=2*(1-t)*t,r=t*t;return{x:n*e.p0.x+o*e.c.x+r*e.p1.x,y:n*e.p0.y+o*e.c.y+r*e.p1.y}}function Ua(e,t,n){let o=(1-t)*(1-n),r=(1-t)*n+t*(1-n),i=t*n;return{p0:Ho(e,t),c:{x:o*e.p0.x+r*e.c.x+i*e.p1.x,y:o*e.p0.y+r*e.c.y+i*e.p1.y},p1:Ho(e,n)}}function zn(e,t){let n=l=>t.some(a=>l.x>a.x&&l.x<a.x+a.width&&l.y>a.y&&l.y<a.y+a.height),o=l=>!n(Ho(e,l)),i=(l,a,u)=>{for(let m=0;m<10;m++){let f=(l+a)/2;o(f)===u?l=f:a=f}return(l+a)/2},s=[],d=null,c=o(0);c&&(d=0);for(let l=1;l<=64;l++){let a=l/64,u=o(a);if(u===c)continue;let m=i((l-1)/64,a,c);u?d=m:d!==null&&(m-d>.001&&s.push(Ua(e,d,m)),d=null),c=u}return d!==null&&1-d>.001&&s.push(Ua(e,d,1)),s}function Ja({strands:e,result:t,scheme:n,overview:o,selection:r,emphasis:i,stageRef:s,liveOf:d,onPickEdge:c,provisional:l,pointed:a=null}){let u=Gt(),m=new Set(t.nodes.filter(g=>g.plot!==void 0&&Math.round(g.plane)===2).map(g=>g.id)),f=g=>o&&t.city!==void 0&&m.has(g.from)&&m.has(g.to),b=wo(t.nodes,r),h=g=>b.size===0||b.has(g.from)||b.has(g.to),y=new Set(r.filter(g=>Ft(g)===null)),M=o?t.nodes.find(g=>Math.round(g.plane)===0):void 0,v=M?Ve(s.current,M.id,!1)??ht(M,n):null;if(e.length===0)return null;let w=g=>g.edges.some(S=>y.has(S.from)||y.has(S.to)),x=y.size>0&&e.some(w),O=new Map;for(let g of e)O.set(g.connector.id,(O.get(g.connector.id)??0)+1);let E=Ka(e.map(g=>({key:g.key,a:g.fromAnchor,b:g.toAnchor}))),T=new Set,D=e.map((g,S)=>{let{connector:L,fromBox:C,toBox:V}=g,X={x:C.x+C.width/2,y:C.y+C.height/2},ae={x:V.x+V.width/2,y:V.y+V.height/2},I=o?Sr(C,ae):X,$=o?Sr(V,X):ae,N=L.loop===!0,{connector:q,style:P}=ln(u,L.kind);if(!q.visible)return null;let j=N?Math.max(22,Math.min(C.width,C.height)*.3):0,W=N?{x:X.x+C.width*.22,y:X.y-C.height/2-j+7}:I,Q=(I.x+$.x)/2,k=(I.y+$.y)/2,R=Math.hypot($.x-I.x,$.y-I.y),B=Math.min(o?40:90,R*(o?.09:.16)),G=0,A=0;if(R>0){G=-($.y-I.y)/R,A=($.x-I.x)/R;let ue=Q-t.width/2,Pe=k-t.height/2;if(v&&!N){let dt=v.x+v.width/2,Nt=v.y+v.height/2;ue=Q-dt,Pe=k-Nt;let $e=Math.abs(G*(dt-I.x)+A*(Nt-I.y)),tt=Math.hypot(v.width/2,v.height/2)*.85+24,qt=((dt-I.x)*($.x-I.x)+(Nt-I.y)*($.y-I.y))/(R*R);$e<tt&&qt>.1&&qt<.9&&(B=Math.min(180,Math.max(B,(tt-$e)*2)))}G*ue+A*Pe<0&&(G=-G,A=-A)}B+=2*(E.get(g.key)??0);let F=vr(q.route,{p0:I,c:{x:Q+G*B,y:k+A*B},p1:$}),z=f(L),_=q.route==="orthogonal"||z,Z=(ue,Pe)=>z?ja(ue,Pe):jn(ue,Pe),ne=!N&&g.tie?No(g.tie.card,g.tie.chip,g.band??[],S):null,J=ne?g.tie.cardIsTo?ne.reverse():ne:!N&&g.band?pn(C,V,g.band,S):null,fe=N||_||J?[]:zn(F,[C,V,...g.obstacles]),ie=J?[J]:!N&&_?Oo(Z(I,$),[C,V,...g.obstacles]):[];if(!N&&fe.length===0&&ie.length===0)return null;let se=ie[ie.length-1],we=_||J?ie[0]?.[0]:fe[0]?.p0,De=_||J?se?.[se.length-1]:fe[fe.length-1]?.p1,re=ue=>ue.map(Pe=>`M ${Pe.p0.x} ${Pe.p0.y} Q ${Pe.c.x} ${Pe.c.y} ${Pe.p1.x} ${Pe.p1.y}`).join(" "),ee=`M ${W.x-j} ${W.y} A ${j} ${j} 0 1 1 ${W.x+j} ${W.y} A ${j} ${j} 0 0 1 ${W.x-j} ${W.y}`,le=N?ee:J?Fa(J,q.route):_?Ct(ie):re(fe),at=ue=>({x:ue.x-8,y:ue.y-8,width:ue.width+16,height:ue.height+16}),Ke=[C,V,...g.hosts,...g.obstacles].map(at),bn=N?ee:J?Ct(ie):_?Ct(Oo(Z(I,$),Ke)):re(zn(F,Ke)),Ze=g.edges.length===1?g.edges[0]:null,Te=Ze?Yt(L.kind,Ze.from,Ze.to):null,Tt=Te!==null&&r.includes(Te),Je=Te!==null?l?.get(Te):void 0,It=g.edges.some(ue=>y.has(ue.from)||y.has(ue.to)),Ue=g.tie?.toward??"",Le=g.tie!==void 0&&(a!==null&&(Ue===a||g.tie.holds.includes(a)||g.said?.includes(a)===!0)||y.has(Ue))&&!T.has(Ue);Le&&T.add(Ue);let Ie=!o&&y.size>0&&It||Le,st=i!==null&&L.kind===i||Tt,oe=d?.(L)!==void 0;if(o&&!oe||!o&&!oe&&y.size>0&&!It&&!st&&!Le||g.said!==void 0&&!Le&&!g.said.some(ue=>y.has(ue))&&!st)return null;let et=o?bo({emphasized:i!==null,stressed:st,anyChosen:x,mine:It,touches:h(L),siblings:O.get(L.id)??1}):xo({edgeChosen:Tt,lit:Ie,anyLit:x||i!==null,own:P.opacity,kit:u.emphasis}),pt=Ie&&we&&De?g.tie?g.tie.cardIsTo?we:De:g.edges.some(ue=>y.has(ue.from))?De:we:null,xn=(0,_e.jsxs)("g",{children:[(0,_e.jsx)("path",{"data-graview-connector":L.kind,"data-graview-edges":g.edges.length,"data-graview-from":g.fromAnchor,"data-graview-to":g.toAnchor,"data-graview-lit":Ie||void 0,"data-graview-activity":d?.(L)?.manner,"data-graview-provisional":Je!==void 0||void 0,opacity:et*(L.opacity??1)*(Je!==void 0?In:1),d:le,fill:"none",stroke:an(P),strokeWidth:(Ie?Math.max(1.6,_r(P,o)):_r(P,o))+(st?.6:0),strokeDasharray:Je!==void 0?Tn:ar[P.pattern],strokeLinecap:"round"}),pt?(0,_e.jsx)("circle",{cx:pt.x,cy:pt.y,r:2.6,fill:an(P),opacity:et}):null,N&&o?(0,_e.jsx)("text",{x:W.x,y:W.y-j-5,textAnchor:"middle",opacity:et,style:{font:"9px var(--graview-font-body, system-ui)",letterSpacing:"0.09em",textTransform:"uppercase",fill:"var(--graview-ink-faint)"},children:Jn(L.kind).toLowerCase()}):null]},g.key),xt=null;return Te&&c&&!N&&et>=.2&&(xt=(0,_e.jsx)("path",{"data-graview-edge":Te,className:"graview-edge-hit",d:bn,fill:"none",pathLength:1,strokeDasharray:"0.86",strokeDashoffset:-.07,stroke:"transparent",strokeWidth:14,style:{pointerEvents:"stroke",cursor:"pointer"},onClick:ue=>{ue.stopPropagation(),c(Te,{x:ue.clientX,y:ue.clientY})},onContextMenu:ue=>{ue.altKey||(ue.preventDefault(),ue.stopPropagation(),c(Te,{x:ue.clientX,y:ue.clientY}))},children:Je!==void 0?(0,_e.jsx)("title",{children:Je}):null},`hit:${g.key}`)),{key:g.key,line:xn,hit:xt}});return(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)("svg",{"aria-hidden":"true","data-graview-world":"",width:t.width,height:t.height,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:We.ties},children:D.map(g=>g?.line)}),D.some(g=>g?.hit)?(0,_e.jsx)("svg",{"data-graview-world":"",width:t.width,height:t.height,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:We.tieLabels},children:D.map(g=>g?.hit)}):null]})}function es(e,t,n){if(t.size===0||typeof MutationObserver>"u")return()=>{};let o=0,r=()=>{o=0,qa(e,t)&&n()},i=()=>{o===0&&(o=requestAnimationFrame(r))},s=({target:c})=>{for(let l=c instanceof Element?c:c.parentElement;l&&l!==e;l=l.parentElement)if(t.has(l.getAttribute("data-graview-view")??""))return!0;return!1},d=new MutationObserver(c=>{c.some(s)&&i()});return d.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-graview-pick","data-graview-slot","data-graview-offstage"]}),i(),()=>{d.disconnect(),cancelAnimationFrame(o)}}function Rr(e){return e<640?{left:8,right:56}:{left:8,right:Math.round(Math.min(128,e*.107))}}function Dd(e){return Math.min(260,16+e.length*6.6)}var Gn=(e,t)=>Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));function ns(e,t,n){let o=new Map;for(let s of e){let d=o.get(s.said);d?d.push(s):o.set(s.said,[s])}let r=[],i=[];for(let[s,d]of o){let c=d[0],l=Dd(s),{end:a,far:u}=c,m=y=>Math.max(0,Math.min(n.width-l,y)),f=[{x:m(a.x-l/2),y:u.y-22-6,width:l,height:22},{x:m(a.x-l/2),y:u.y+u.height+6,width:l,height:22},{x:u.x+u.width+6,y:a.y-22/2,width:l,height:22},{x:u.x-l-6,y:a.y-22/2,width:l,height:22}],b=f[0],h=1/0;for(let y of f){let v=y.x<0||y.y<0||y.x+y.width>n.width||y.y+y.height>n.height?1e9:0;for(let w of t)v+=Gn(y,w.title)*100+Gn(y,w.box);for(let w of r)v+=Gn(y,w)*100;if(v<h&&(h=v,b=y),v===0)break}r.push(b),i.push({said:s,keys:d.map(y=>y.key),...b})}return i}var ts=(e,t,n=2)=>t.x>=e.x-n&&t.x<=e.x+e.width+n&&t.y>=e.y-n&&t.y<=e.y+e.height+n;function Do(e,t){let n=new Set;for(let o of e)(t.edgeId&&o.edgeId===t.edgeId||t.point&&(ts(o.fromBox,t.point)||ts(o.toBox,t.point))||t.ids?.some(r=>o.ids.includes(r))||t.box&&(Gn(t.box,o.fromBox)>0||Gn(t.box,o.toBox)>0))&&n.add(o.key);return n}var Se=de(Ae(),1);function is(e){let t=Si(e);return t.length>0?new Map(t.map(n=>[Yt(n.edge.kind,n.edge.from,n.edge.to),ki(n)])):void 0}function as({frame:e,width:t,height:n,scheme:o,overview:r,selection:i,emphasis:s,stageRef:d,store:c,graphNodes:l,onPickEdge:a,liveOf:u,holding:m=!1,provisional:f,focusId:b=null,beside:h=!1}){let[y,M]=(0,ye.useState)(0),[v,w]=(0,ye.useState)(null),x=e.t<1,O=(0,ye.useRef)(""),E=(0,ye.useRef)([]),T=(0,ye.useRef)(new Map),D=()=>[...d.current?.querySelectorAll("[data-graview-relation] > span")??[]].map(I=>{let $=I.getBoundingClientRect();return`${Math.round($.left)},${Math.round($.top)},${Math.round($.width)}`}).join(" ");(0,ye.useLayoutEffect)(()=>{if(x||m)return;O.current=D(),E.current=e.nodes;let I=new Map;w(Er(e.nodes,e.connectors,d.current,r,o,I)),T.current=I},[e,x,m,i,r,l,o,y,d]),(0,ye.useEffect)(()=>{let I=d.current;if(!(x||m||I===null))return es(I,T.current,()=>M($=>$+1))},[v,x,m,d]),(0,ye.useEffect)(()=>{if(x||m||r||typeof requestAnimationFrame>"u")return;let I=requestAnimationFrame(()=>{D()!==O.current&&M($=>$+1)});return()=>cancelAnimationFrame(I)},[v]);let g=e.nodes.map(I=>I.id).join(`
4
- `);(0,ye.useLayoutEffect)(()=>{let I=d.current;if(I===null||typeof window>"u")return;let $=0,N=()=>{$===0&&($=requestAnimationFrame(()=>{$=0,M(P=>P+1)}))};I.addEventListener("scroll",N,{capture:!0,passive:!0}),window.addEventListener("resize",N,{passive:!0});let q=typeof ResizeObserver>"u"?null:new ResizeObserver(N);if(q){q.observe(I);for(let P of I.querySelectorAll("[data-graview-view]"))q.observe(P)}return()=>{$!==0&&cancelAnimationFrame($),I.removeEventListener("scroll",N,{capture:!0}),window.removeEventListener("resize",N),q?.disconnect()}},[d,g]);let S=(0,ye.useRef)(new WeakMap);(0,ye.useEffect)(()=>{let I=d.current;if(x||m||I===null||typeof ResizeObserver>"u")return;let $=0,N=new ResizeObserver(q=>{let P=!1;for(let{target:j,contentRect:W}of q){let Q=`${Math.round(W.width)}x${Math.round(W.height)}`;S.current.has(j)&&S.current.get(j)!==Q&&(P=!0),S.current.set(j,Q)}P&&$===0&&($=requestAnimationFrame(()=>{$=0,M(j=>j+1)}))});for(let q of I.querySelectorAll("[data-graview-view]")){let P=vo(q);P!==q&&N.observe(P)}return()=>{$!==0&&cancelAnimationFrame($),N.disconnect()}},[v,x,m,d]);let[L,C]=(0,ye.useState)(null),V=(v??[]).some(I=>I.tie!==void 0);if((0,ye.useEffect)(()=>{let I=d.current;if(!V||I===null)return;let $=q=>{let P=q.target?.closest?.("[data-graview-pick], [data-graview-view]");C(P?.getAttribute("data-graview-pick")??P?.getAttribute("data-graview-view")??null)},N=()=>C(null);return I.addEventListener("pointerover",$),I.addEventListener("focusin",$),I.addEventListener("pointerleave",N),I.addEventListener("focusout",N),()=>{I.removeEventListener("pointerover",$),I.removeEventListener("focusin",$),I.removeEventListener("pointerleave",N),I.removeEventListener("focusout",N)}},[V,d]),x)return null;let X=(v&&m?Za(v,E.current,e.nodes):v)??Er(e.nodes,e.connectors,null,r,o),ae=new Set;for(let I of X){if(I.edges.length===1){let $=I.edges[0];ae.add(`${I.connector.kind}|${$.from}|${$.to}`);continue}for(let $ of I.edges)(I.connector.from===$.from||I.connector.to===$.to)&&ae.add(`${I.connector.kind}|${$.from}|${$.to}`)}return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(Ja,{strands:X,result:e,scheme:o,overview:r,selection:i,emphasis:s,stageRef:d,onPickEdge:a,liveOf:u,pointed:L,...f?{provisional:f}:{}}),r&&Hn(i,{overview:r,focusId:b,beside:h},I=>c.graph.getNode(I)?.kind).records.length>0?(0,Se.jsx)(ye.Suspense,{fallback:null,children:(0,Se.jsx)(Fd,{frame:e,width:t,height:n,stageRef:d,tick:y,store:c,graphVersion:l,selection:i,view:{overview:r,focusId:b,beside:h},rulers:f?{...rs,unsureOf:(I,$,N)=>f.get(Yt(I,$,N))}:rs})}):null,r?null:(0,Se.jsx)(jd,{...f?{provisional:f}:{},stageRef:d,nodes:e.nodes,scheme:o,selection:i,store:c,graphNodes:l,overview:r,width:t,height:n,onPickEdge:a,alreadyDrawn:ae,tick:y})]})}var rs={visibleRect:mn,clipQuadratic:zn,unsureDash:Tn,unsureOpacity:In},$d=Cn(nn(()=>(__graviewPreload(import.meta.url,["./chunk.YCD4JSXD.js","./chunk.SO6NT5K7.js","./chunk.MUSMNKE4.js","./chunk.SJQPTDAT.js","./chunk.JQ63N4MZ.js","./chunk.Z3O2VZAJ.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.4EMKCKDB.js")))),Fd=$d.part((e,t)=>(0,Se.jsx)(e.RecordLinks,{...t}),{what:"The links",quiet:!0}),Wd=44;function jd({stageRef:e,nodes:t,scheme:n,selection:o,store:r,graphNodes:i,overview:s,width:d,height:c,onPickEdge:l,alreadyDrawn:a,tick:u,provisional:m}){let f=Gt(),b=(0,ye.useMemo)(()=>{if(o.length===0||o.length>4)return[];let g=new Set(o),S=[];for(let C of o){let V=Ft(C);V&&S.push({kind:V.kind,self:V.from,other:V.to})}for(let C of r.graph.allEdges()){let V=g.has(C.from)?C.from:g.has(C.to)?C.to:null;if(!V)continue;let X=V===C.from?C.to:C.from;g.has(X)||S.push({kind:C.kind,self:V,other:X})}if(S.length<=14)return S;let L=new Set(t.map(C=>C.id));return S.map((C,V)=>({tie:C,index:V,real:L.has(C.other)?0:1})).sort((C,V)=>C.real-V.real||C.index-V.index).slice(0,14).map(({tie:C})=>C)},[r,o,i,t]),h=()=>{if(b.length===0||typeof document>"u")return[];let g=e.current?.getBoundingClientRect();if(!g)return[];let S=[...e.current?.querySelectorAll("[data-graview-joins]")??[]].find(P=>{if(P.closest("[data-graview-offstage]"))return!1;try{let j=JSON.parse(P.getAttribute("data-graview-joins")??"[]");return j.length===o.length&&j.every(W=>o.includes(W))}catch{return!1}});if(S){let P=mn(S,e.current);if(!P)return[];let j=[];for(let W of o){let Q=t.find(G=>G.id===W);if(!Q)continue;let k=Ve(e.current,Q.id,s)??ht(Q,n),R=k?Mr(P,k):null;if(!k||!R)continue;let B=[...r.graph.allEdges()].find(G=>G.from===W&&o.includes(G.to)||G.to===W&&o.includes(G.from));j.push({key:`join:${W}`,self:W,other:"",others:1,kind:B?.kind??"",endX:R.to.x,endY:R.to.y,...R,fromBox:P,toBox:k,proxy:!1,edgeId:B?Yt(B.kind,B.from,B.to):null})}return j}let L=(P,j)=>{let W=e.current?.querySelectorAll(`[data-graview-pick="${CSS.escape(P)}"], [data-graview-slot="${CSS.escape(P)}"]`),Q=[];for(let k of W??[]){if(k.closest("[data-graview-offstage]")||j(k)||k.closest("[data-graview-mark]"))continue;let R=mn(k,e.current);R&&Q.push(R)}return Q.sort((k,R)=>k.width*k.height-R.width*R.height)},C=P=>t.find(j=>j.id===P)??t.find(j=>j.aggregate?.memberIds.includes(P)),V=P=>`[data-graview-pick="${CSS.escape(P)}"], [data-graview-slot="${CSS.escape(P)}"]`,X=(P,j)=>{let W=e.current;if(!W)return!1;for(let Q of W.querySelectorAll("[data-graview-view]")){let k=Q.querySelector(V(P));if(k===null||k.closest("[data-graview-offstage]"))continue;let R=Q.querySelector(V(j));if(R!==null&&!R.closest("[data-graview-offstage]"))return!0}return!1},ae=[];if(!s&&e.current){for(let j of t){if(Math.round(j.plane)!==1)continue;let W=Ve(e.current,j.id,!1);W&&ae.push(W)}let P=e.current;ae.push(...Bo(P,g,t,j=>Ve(P,j,!1)))}let I=new Map,$=[];for(let P of b){if(X(P.self,P.other))continue;let j=C(P.self),W=j?e.current?.querySelector(`[data-graview-view="${CSS.escape(j.id)}"]`):null,Q=!s&&j?.id===P.self&&Math.round(j.plane)===1?Ve(e.current,j.id,!1):null,k=Q?[Q]:L(P.self,()=>!1);if(!(k.length>0)&&j){let ee=Ve(e.current,j.id,!1)??ht(j,n);ee&&k.push(ee)}let B=t.find(ee=>ee.id===P.other),G=[],A=!1;if(B){let ee=Ve(e.current,B.id,s)??ht(B,n);ee&&G.push(ee)}else if(G.push(...L(P.other,ee=>W?W.contains(ee):!1)),G.length===0){let ee=C(P.other);if(ee&&(!j||ee.id!==j.id)){let le=Ve(e.current,ee.id,s)??ht(ee,n);le&&(G.push(le),A=!0)}}if(k.length===0||G.length===0||A&&s)continue;let F=k[0],z=G[0],_=1/0;for(let ee of k)for(let le of G){let at=Math.hypot(ee.x+ee.width/2-(le.x+le.width/2),ee.y+ee.height/2-(le.y+le.height/2));at<_&&(_=at,F=ee,z=le)}if(a?.has(`${P.kind}|${P.self}|${P.other}`)||a?.has(`${P.kind}|${P.other}|${P.self}`))continue;let Z=`${P.kind}:${Math.round(F.x)},${Math.round(F.y)}:${Math.round(z.x)},${Math.round(z.y)}`,ne=I.get(Z);if(ne){ne.others+=1;continue}let J=Mr(F,z);if(!J)continue;let{from:fe,control:ie}=J,se=Q&&F===Q?pn(F,z,ae,$.length):void 0,we=se?se[se.length-1]:J.to,De=[...r.graph.allEdges()].find(ee=>ee.kind===P.kind&&(ee.from===P.self&&ee.to===P.other||ee.from===P.other&&ee.to===P.self)),re={key:`${P.kind}:${P.self}:${P.other}`,self:P.self,other:P.other,others:1,kind:P.kind,endX:we.x,endY:we.y,from:fe,to:we,control:ie,fromBox:F,toBox:z,...se?{points:se}:{},proxy:A,edgeId:De?Yt(De.kind,De.from,De.to):null};I.set(Z,re),$.push(re)}let N=s?void 0:t.find(P=>Math.round(P.plane)===0&&!P.aggregate),q=P=>{let j=t.find(W=>W.id===P.other)??t.find(W=>W.aggregate?.memberIds.includes(P.other));return j!==void 0&&Math.round(j.plane)===1&&j.via?.edgeKind===P.kind};for(let P of $){if(N&&(P.self!==N.id||q(P)))continue;let j=[...r.graph.allEdges()].find(G=>G.kind===P.kind&&(G.from===P.self&&G.to===P.other||G.from===P.other&&G.to===P.self)),W=r.graph.getNode(P.self),Q=r.graph.getNode(P.other);if(!j||!W||!Q)continue;let k=j.from===P.self?"out":"in",R=hi(r.schema,k==="out"?W.kind:Q.kind,P.kind,k),B=P.proxy?(k==="out"?r.graph.out(P.self,P.kind):r.graph.in(P.self,P.kind)).filter(G=>G.kind===Q.kind).length:1;P.said=P.proxy?`${R}: ${tn(r.schema,Q.kind,Math.max(B,P.others))}`:`${R}: ${en(r.schema.tryDefinition(Q.kind),Q)}`}return $},[y,M]=(0,ye.useState)([]),[v,w]=(0,ye.useState)([]);(0,ye.useLayoutEffect)(()=>{let g=h();M(g),w(g.some(S=>S.said)?x(g):[])},[b,t,s,n,d,c,a,u,e]);let x=g=>{let S=e.current;if(!S)return[];let L=[];for(let C of S.querySelectorAll("[data-graview-view]")){let V=[...C.children].find(ae=>!ae.classList.contains("graview-kind-tag")),X=V?mn(V,S):null;X&&L.push({box:X,title:{...X,height:Math.min(X.height,Wd)}})}return ns(g.flatMap(C=>C.said?[{key:C.key,said:C.said,end:{x:C.endX,y:C.endY},far:C.toBox}]:[]),L,{width:d,height:c})},[O,E]=(0,ye.useState)(()=>new Set),T=(0,ye.useRef)([]);T.current=y.map(g=>({key:g.key,fromBox:g.fromBox,toBox:g.toBox,ids:[g.self,g.other],edgeId:g.edgeId}));let D=v.length>0;return(0,ye.useEffect)(()=>{let g=e.current;if(!g||!D)return;let S=N=>E(q=>q.size===N.size&&[...N].every(P=>q.has(P))?q:N),L=0,C=null,V=()=>{if(L=0,!C)return;let N=g.getBoundingClientRect(),q=C.target instanceof Element?C.target:null;S(Do(T.current,{point:{x:C.clientX-N.left,y:C.clientY-N.top},edgeId:q?.closest("[data-graview-edge]")?.getAttribute("data-graview-edge")??null}))},X=N=>{C=N,L||(L=requestAnimationFrame(V))},ae=()=>{C=null,S(new Set)},I=N=>{let q=N.target instanceof Element?N.target:null;if(!q)return;let P=g.getBoundingClientRect(),j=q.getBoundingClientRect(),W=q.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??q.closest("[data-graview-view]")?.getAttribute("data-graview-view");S(Do(T.current,{...W?{ids:[W]}:{},box:{x:j.left-P.left,y:j.top-P.top,width:j.width,height:j.height}}))},$=N=>{N.relatedTarget instanceof Node&&g.contains(N.relatedTarget)||S(new Set)};return g.addEventListener("pointermove",X,{passive:!0}),g.addEventListener("pointerleave",ae),g.addEventListener("focusin",I),g.addEventListener("focusout",$),()=>{L&&cancelAnimationFrame(L),g.removeEventListener("pointermove",X),g.removeEventListener("pointerleave",ae),g.removeEventListener("focusin",I),g.removeEventListener("focusout",$)}},[e,D]),y.length===0?null:(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)("svg",{"aria-hidden":y.some(g=>g.edgeId)?void 0:!0,"data-graview-ties":y.length,"data-graview-world":"",width:d,height:c,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:We.lines},children:y.map(g=>{let{connector:S,style:L}=ln(f,g.kind);if(!S.visible)return null;let C=g.edgeId?m?.get(g.edgeId):void 0,V={p0:g.from,c:g.control,p1:g.to},X=g.points?Ao(g.points,10):S.route==="orthogonal"?Ct([jn(g.from,g.to)]):(({p0:I,c:$,p1:N})=>`M ${I.x} ${I.y} Q ${$.x} ${$.y} ${N.x} ${N.y}`)(vr(S.route,V)),ae=null;if(g.edgeId&&l&&!g.proxy){let I=(N,q)=>q.x>=N.x&&q.x<=N.x+N.width&&q.y>=N.y&&q.y<=N.y+N.height,$=g.points?[...g.points]:[];for(let N=0;N<=(g.points?-1:40);N++){let q=Wa(S.route,V,N/40);I(g.fromBox,q)||I(g.toBox,q)||$.push(q)}$.length>=2&&(ae=(0,Se.jsx)("path",{"data-graview-edge":g.edgeId,className:"graview-edge-hit",d:`M ${$[0].x} ${$[0].y} ${$.slice(1).map(N=>`L ${N.x} ${N.y}`).join(" ")}`,fill:"none",pathLength:1,strokeDasharray:"0.86",strokeDashoffset:-.07,stroke:"transparent",strokeWidth:14,style:{pointerEvents:"stroke",cursor:"pointer"},onClick:N=>{N.stopPropagation(),l(g.edgeId,{x:N.clientX,y:N.clientY})},onContextMenu:N=>{N.altKey||(N.preventDefault(),N.stopPropagation(),l(g.edgeId,{x:N.clientX,y:N.clientY}))},children:C!==void 0?(0,Se.jsx)("title",{children:C}):null}))}return(0,Se.jsxs)("g",{opacity:(g.proxy?.32:.72)*(C!==void 0?In:1),children:[(0,Se.jsx)("path",{"data-graview-tie":g.kind,"data-graview-tie-proxy":g.proxy||void 0,"data-graview-provisional":C!==void 0||void 0,d:X,fill:"none",stroke:an(L),strokeWidth:g.proxy?1.1:1.6,strokeDasharray:C!==void 0?Tn:ar[L.pattern],strokeLinecap:"round"}),(0,Se.jsx)("circle",{cx:g.endX,cy:g.endY,r:g.proxy?2:2.6,fill:an(L)}),ae]},g.key)})}),(0,Se.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:We.tieLabels},children:v.map(g=>{let S=y.find(L=>L.key===g.keys[0]);return(0,Se.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":S?.kind,"data-graview-lands":S?.proxy?"district":"record","data-graview-said-for":g.keys.length,"data-graview-tie-said":g.keys.some(L=>O.has(L))?"shown":"waiting",style:{position:"absolute",left:g.x,top:g.y,transform:`translateX(min(0px, calc(${Math.round(d-g.x-8)}px - 100%)))`},children:g.said},g.said)})})]})}function os(){return typeof document>"u"?1:parseFloat(getComputedStyle(document.documentElement).fontSize)/16||1}function ss({nodes:e,scheme:t,width:n,stageRef:o,moving:r=!1,holding:i=!1}){let s=Gt(),[d,c]=(0,ye.useState)([]);(0,ye.useLayoutEffect)(()=>{r||i||c(l())},[e,r,i,t,n,o]);function l(){let u=[],m=[];for(let y of e){if(!y.via||Math.round(y.plane)!==1)continue;let M=Ve(o.current,y.id,!1,!0),{scale:v}=on(1,t);u.push({key:`${y.via.edgeKind}|${y.via.direction}`,text:Bn(y.via),left:M?.x??y.x,right:M?M.x+M.width:y.x+y.width*v,top:M?.y??y.y}),m.push(Math.round(y.y))}let f=new Map;u.forEach((y,M)=>f.set(m[M],Math.min(f.get(m[M])??1/0,y.top)));let b=u.map((y,M)=>({...y,top:f.get(m[M])??y.top})),h=Rr(n);return ao(b,{left:h.left,right:n-h.right},os())}if(d.length===0||!s.captions.visible||r)return null;let a=io*os();return(0,Se.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:We.lines},children:d.map(u=>{let{left:m,width:f}=u;return(0,Se.jsx)("div",{"data-graview-relation":u.key,title:u.text,style:{position:"absolute",left:m,width:f,textAlign:"center",top:Math.max(0,u.top-a),fontSize:"0.75rem",letterSpacing:"0.09em",textTransform:"uppercase",color:"var(--graview-ink-faint)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(0,Se.jsx)("span",{style:{background:"var(--graview-ground)",padding:"1px 7px",borderRadius:4},children:u.text})},u.key)})})}var Xt=de(Oe(),1);var zd=new Set;function ls(e,t,n,o,r,i,s=0,d=0){let{store:c,views:l,hiddenKinds:a}=ve(),u=jt(),m=(0,Xt.useContext)(rn),f=Vr(),b=(0,Xt.useMemo)(()=>{let v={};for(let w of f){if(w.subjectId===void 0)continue;let x=v[w.subjectId]??=[];for(let O of w.nodeIds)O!==w.subjectId&&!x.includes(O)&&x.push(O)}return v},[f]),h=(0,Xt.useMemo)(()=>({flagged:new Set(f.flatMap(v=>v.nodeIds)),touched:sr(c.log.all())}),[f,c,i]),y=(0,Xt.useMemo)(()=>({hits:u?ir(u):zd,...h}),[u,h]),M=(t?.width??1200)-r.right<640;return(0,Xt.useMemo)(()=>({...e,cityZoom:o,...m?{besideTheMap:!0}:{},...a.size>0?{hiddenKinds:[...a].sort()}:{},...Object.keys(b).length>0?{judged:b}:{},relevance:y,inset:M?{left:8,right:8,top:8,bottom:0}:{...Rr((t?.width??1200)-r.right),top:8,bottom:0},chrome:[{x:(t?.width??1200)-r.right-176,y:0,width:176,height:100},{...Yd(t,r),...r.bottom>0?{onSheet:!0}:{}}],...r.right>0||r.bottom>0?{dock:r}:{},...M||s>0?{headroom:M?Math.max(s,Gd):s}:{},unit:n,plainGroups:c.schema.kinds.filter(v=>Qo(l.lookup(v,{cardinality:"many",fidelity:"full"}))),cityOrder:zo(Oi({name:"scene",schema:c.schema,mutations:c.allMutations().filter(v=>!v.derived)}).order.map(v=>v.kind),l.arrangement?.()?.order),screens:l.places().reduce((v,w)=>((v[w.kind]??=[]).push({as:w.as,title:w.title,...w.across?{across:w.across}:{}}),v),{}),...t?{width:t.width,height:Math.max(0,t.height-Math.max(64,d))}:{}}),[e,t,n,c,l,a,b,y,o,m,r.right,r.bottom,s,d,M])}var Gd=60,ds=224;function Yd(e,t){let n=e?.width??1200,o=e?.height??800,r=58;return{x:n-t.right-ds,y:o-t.bottom-r,width:ds,height:r}}var bt=de(Oe(),1);var cs=de(Oe(),1);function Or(e){let t=e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-joins");if(!t)return null;try{let n=JSON.parse(t);return Array.isArray(n)&&n.length>0&&n.every(o=>typeof o=="string")?n:null}catch{return null}}function us(e){(0,cs.useEffect)(()=>{let t=e.current;if(!t)return;let n=()=>{for(let i of t.querySelectorAll("[data-graview-pick]"))i.getAttribute("tabindex")===null&&i.setAttribute("tabindex","0"),i.getAttribute("role")===null&&Kd(i)&&i.setAttribute("role","button")};if(n(),typeof MutationObserver>"u")return;let o=0,r=new MutationObserver(()=>{o===0&&(o=typeof requestAnimationFrame>"u"?0:requestAnimationFrame(()=>{o=0,n()}),o===0&&n())});return r.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-graview-pick"]}),()=>{r.disconnect(),o!==0&&cancelAnimationFrame(o)}},[e])}var _d=new Set(["div","span","p","figure","img","td","output","b","i","em","strong","small","canvas","g","polygon","circle","rect","path","ellipse","polyline","line","use"]);function Kd(e){return _d.has(e.localName.toLowerCase())}var yn=de(Oe(),1),Ud=4,hs={top:0,right:0,bottom:0,left:0};function fs(e,t){let[n,o]=(0,yn.useState)(null),r=(0,yn.useRef)(null);return r.current=n,(0,yn.useLayoutEffect)(()=>{let i=e.current;if(!t||!i){o(null);return}let s=()=>{let m=i.getBoundingClientRect(),f=i.offsetWidth>0?m.width/i.offsetWidth:1;if(!(f>0))return;let b=r.current??hs,h={top:m.top+b.top*f,right:m.right-b.right*f,bottom:m.bottom-b.bottom*f,left:m.left+b.left*f},y=0,M=0,v=0,w=0;for(let D of i.querySelectorAll("*")){let g=D.getBoundingClientRect();g.width===0&&g.height===0||(y=Math.max(y,h.top-g.top),M=Math.max(M,g.right-h.right),v=Math.max(v,g.bottom-h.bottom),w=Math.max(w,h.left-g.left))}let x=D=>D>.5?Math.ceil(D/f)+Ud:0,O={top:x(y),right:x(M),bottom:x(v),left:x(w)},E=r.current??hs;if(O.top===E.top&&O.right===E.right&&O.bottom===E.bottom&&O.left===E.left)return;let T=O.top+O.right+O.bottom+O.left===0;r.current=T?null:O,o(T?null:O)},d=0,c=()=>{d||(d=requestAnimationFrame(()=>{d=0,s()}))};s();let l=typeof MutationObserver>"u"?null:new MutationObserver(c);l?.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0});let a=typeof ResizeObserver>"u"?null:new ResizeObserver(c);a?.observe(i);let u=["pointerover","pointerout","focusin","focusout","transitionend","animationend"];for(let m of u)i.addEventListener(m,c);return()=>{d&&cancelAnimationFrame(d),l?.disconnect(),a?.disconnect();for(let m of u)i.removeEventListener(m,c)}},[e,t]),n}var wn=de(Ae(),1);function ms({node:e,useDom:t,blur:n,touched:o,frontY:r,centerY:i,screen:s,onDrawnHeight:d,crowded:c,activity:l,scheme:a,canvasWidth:u,canvasHeight:m,selected:f,onSelect:b,onPick:h,onTravel:y,onMenu:M,selection:v,onJackIn:w,onDragStart:x,onDragMove:O,onDragEnd:E,onDragCancel:T,swallowClick:D,children:g}){let{brand:S,store:L,actsDoor:C}=ve(),V=e.beyond?`${e.beyond.length} more district${e.beyond.length===1?"":"s"}`:e.aggregate?.opens?.in==="place"?`${e.aggregate.label}, ${tn(L.schema,e.aggregate.kind,e.aggregate.memberIds.length)}`:e.aggregate?e.aggregate.label:(()=>{let A=L.graph.getNode(e.id);return A?en(L.schema.tryDefinition(e.kind),A):e.id})(),[X,ae]=(0,bt.useState)(null),I=Math.round(e.plane)===0&&!e.aggregate;(0,bt.useLayoutEffect)(()=>{if(!I)return;let A=j.current;if(!A)return;let F=()=>{let _=[...A.children].find(ie=>ie.dataset.graviewKindtag===void 0);if(!_)return;let Z=A.getBoundingClientRect(),ne=_.getBoundingClientRect(),J=A.offsetWidth>0?Z.width/A.offsetWidth:1,fe={top:Math.round((ne.top-Z.top)/J)-9,right:Math.round((Z.right-ne.right)/J)+14};ae(ie=>ie&&ie.top===fe.top&&ie.right===fe.right?ie:fe)};if(typeof ResizeObserver>"u"){F();return}let z=new ResizeObserver(F);z.observe(A);for(let _ of A.children)z.observe(_);return()=>z.disconnect()},[I,e.id]);let $=ni({plane:e.plane,...e.depth!==void 0?{depth:e.depth}:{},onPlot:r!==void 0},a),N=$.style,q=ti(N,e.x,e.y,u,m),P=n?$.blur:0,j=(0,bt.useRef)(null);us(j);let W=fs(j,!t&&r!==void 0),Q=e.natural,k=Q?Math.min(e.width/Q.width,e.height/Q.height):1,R=(0,bt.useRef)(null);(0,bt.useEffect)(()=>{if(!s||!d)return;let A=R.current;if(!A||typeof ResizeObserver>"u")return;let F=()=>{let J=0,fe=0;for(let ie of A.children)if(!(!(ie instanceof HTMLElement)||ie.classList.contains("graview-screen-fullscreen"))){J=Math.max(J,ie.offsetTop+ie.offsetHeight);for(let se of[ie,...ie.querySelectorAll("*")]){let we=getComputedStyle(se).overflowY;(we==="auto"||we==="scroll")&&(fe+=se.scrollHeight-se.clientHeight)}}d(J+fe)},z=0,_=()=>{z||(z=requestAnimationFrame(()=>{z=0,F()}))};F();let Z=new ResizeObserver(_);Z.observe(A);for(let J of A.children)Z.observe(J);let ne=new MutationObserver(_);return ne.observe(A,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),()=>{z&&cancelAnimationFrame(z),Z.disconnect(),ne.disconnect(),d(void 0)}},[s,d,e.id]);let B={...r!==void 0?{"--graview-front-y":`${r.toFixed(1)}px`}:{},...i!==void 0?{"--graview-center-y":`${i.toFixed(1)}px`}:{}},G=t?{transform:$a(q),transformOrigin:"0 0",filter:P>0?`blur(${P}px)`:void 0,opacity:ri(N)*(e.opacity??1),"--graview-lift-low":Eo(N.shadow,a),...B}:{"--graview-lift-low":Eo(N.shadow,a),...B};return(0,wn.jsxs)("div",{ref:j,"data-graview-view":e.id,...t?{}:{drawable:""},...W?{[oi]:ii(W)}:{},"data-graview-plane":Math.round(e.plane),"data-graview-selected":f||void 0,"data-graview-touched":o||void 0,"data-graview-plot":r!==void 0?"":void 0,"data-graview-screen":s?"":void 0,"data-graview-record-focus":Math.round(e.plane)===0&&!e.aggregate&&!Q&&!s?"":void 0,"data-graview-nested":e.nestedUnder??void 0,"data-graview-crowded":c||void 0,"data-graview-pinned":e.pinned||void 0,"data-graview-activity":l?l.manner:void 0,"data-graview-wrote":l?.wrote||void 0,"data-graview-read":l&&!l.wrote?!0:void 0,"data-graview-broke":l?.broke||void 0,title:l?`${Ma[l.manner]} ${l.wrote?"changed this":"read this"}: ${l.intent}`:e.aggregate&&Math.round(e.plane)!==0?`Open ${e.aggregate.label}`:void 0,role:"group","aria-label":V,"aria-keyshortcuts":C&&!e.beyond?C.key:void 0,tabIndex:0,onPointerDown:x,onPointerMove:O,onPointerUp:E,onPointerCancel:T??E,onClick:A=>{if(D.current)return;let F=A.target?.closest("input, textarea, select, button, a[href], [contenteditable='true']");if(F&&!F.hasAttribute("data-graview-pick"))return;let z=A.metaKey||A.shiftKey,_=Ot(A.target);if(_&&_!==e.id){A.stopPropagation(),h(_,z,Or(A.target)??void 0);return}b(z)},onKeyDown:A=>{if(C&&!e.beyond&&A.key.toLowerCase()===C.key.toLowerCase()&&!A.metaKey&&!A.ctrlKey&&!A.altKey&&!A.target?.closest("input, textarea, select, [contenteditable='true']")){A.preventDefault(),A.stopPropagation();let ne=Ot(A.target)??e.id;v.includes(ne)||h(ne,!1),C.open(A.target instanceof HTMLElement?A.target:A.currentTarget);return}if(A.key!=="Enter"&&A.key!==" "||A.target?.closest("input, textarea, select, button, [contenteditable='true']"))return;let z=Ot(A.target);if(A.preventDefault(),A.stopPropagation(),!z||z===e.id){v.length===1&&v[0]===e.id&&!A.metaKey&&!A.shiftKey?w():b(A.metaKey||A.shiftKey);return}let _=Or(A.target);(_?v.length===_.length&&_.every(ne=>v.includes(ne)):v.length===1&&v[0]===z)&&!A.metaKey&&!A.shiftKey?y(z):h(z,A.metaKey||A.shiftKey,_??void 0)},onContextMenu:A=>{if(A.altKey)return;let F=Ot(A.target);A.preventDefault(),A.stopPropagation();let z=F&&F!==e.id||!e.aggregate?null:Uo(A.target,A.currentTarget,(ie,se)=>L.graph.neighbors(ie).some(we=>we.id===se),e.id),_=F&&F!==e.id?F:z??e.id;h(_,!1,(_===F?Or(A.target):null)??void 0);let Z=A.nativeEvent.composedPath?.()[0],{clientX:ne,clientY:J}=A,fe=()=>{let ie=xi(Z);M({x:ne,y:J,on:_,...ie?{section:ie,title:ie.name}:{}})};vi(Z)?bi().then(fe,fe):fe()},onDoubleClick:A=>{let F=Ot(A.target);if(F&&F!==e.id){A.stopPropagation(),y(F);return}w()},style:{position:"absolute",...t?{}:{pointerEvents:"none"},zIndex:e.opened?We.opened:We.card-Math.round(e.plane),left:t?0:Math.round(e.x)-(W?.left??0),top:t?0:Math.round(e.y)-(W?.top??0),width:Math.round(e.width)+(W?W.left+W.right:0),height:Math.round(e.height)+(W?W.top+W.bottom:0),...W?{padding:`${W.top}px ${W.right}px ${W.bottom}px ${W.left}px`}:{},boxSizing:"border-box",display:"flex",flexDirection:"column",justifyContent:"center",...G},children:[Q?(0,wn.jsx)("div",{ref:R,"data-graview-natural":`${Math.round(Q.width)}x${Math.round(Q.height)}`,style:{position:"absolute",left:W?`calc(50% + ${(W.left-W.right)/2}px)`:"50%",top:W?`calc(50% + ${(W.top-W.bottom)/2}px)`:"50%",width:Q.width,height:Q.height,transform:`translate(-50%, -50%) scale(${k})`,transformOrigin:"50% 50%",display:"flex",flexDirection:"column"},children:g}):g,Math.round(e.plane)===0&&!e.aggregate?(0,wn.jsxs)("span",{"data-graview-kindtag":"",className:"graview-kind-tag","aria-hidden":"true",style:{...X??{},"--graview-hue":Math.round(On(e.kind,S?.accents))},children:[(0,wn.jsx)("span",{style:{width:9,height:6,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",flex:"0 0 auto",background:`hsl(${Math.round(On(e.kind,S?.accents))} 55% var(--graview-tint-lightness) / 0.9)`}}),Wo(L.schema.tryDefinition(e.kind),e.kind)]}):null]})}var pe=de(Ae(),1);jr({search:Pi,touchWeights:sr});var Xd=e=>e?{activity:e}:{},qd=e=>`${Math.round(e.x)} ${Math.round(e.y)}`,ps=e=>e.stopPropagation(),Ar=.6,Pr=3,Qd=80,gs=e=>Math.round(e.plane)===1&&(e.compact===!0||e.width<175||e.height<Qd);function Zd(e){let[t,n]=(0,K.useState)(1),o=(0,K.useRef)(1);return(0,K.useEffect)(()=>{e||(o.current=1,n(1))},[e]),[t,o,n]}function Jd(e){let[t,n]=(0,K.useState)({x:0,y:0}),o=(0,K.useMemo)(()=>({x:(e.pan?.x??0)+t.x,y:(e.pan?.y??0)+t.y}),[e.pan,t]),r=(0,K.useMemo)(()=>t.x===0&&t.y===0?e:ct(e,o),[e,t,o]),i=(0,K.useRef)(t);i.current=t;let s=(0,K.useCallback)((d,c)=>{let l=i.current,a=(u,m,f)=>Math.max(Math.min(-u,m),Math.min(Math.max(u,m),f+m))-m;return{x:a(d.x,l.x,c.x),y:a(d.y,l.y,c.y)}},[]);return[o,r,s,i,n]}function el(e,t,n,o,r,i){let s=n!==null&&!t.overview,d=s?null:n,c=(0,K.useRef)(t);eo(c.current,t)||(c.current=t);let l=c.current,a=(0,K.useMemo)(()=>{let h=l.pan?{...l,pan:void 0}:l;return d?Nn(h,d.id,{x:d.x,y:d.y}):h},[l,d]),u=(0,K.useRef)(void 0),m=(0,K.useMemo)(()=>{let h=u.current?.stood,y=pr(e.graph,e.schema,a,h?{...o,cityStood:h}:o);return u.current=y.city,y},[e,a,o,r]),f=(0,K.useMemo)(()=>n&&s?ho(m,n.id,{x:n.x,y:n.y})??pr(e.graph,e.schema,Nn(a,n.id,{x:n.x,y:n.y}),o):m,[m,n,s,e,a,o]);return[(0,K.useMemo)(()=>fo(f,i??{x:0,y:0}),[f,i]),s]}function tl(e,t){let n=(0,K.useRef)(!1),o=(0,K.useRef)(!1),r=(0,K.useRef)(null),i=(0,K.useRef)(!1),s=(0,K.useCallback)(()=>{nl(e.current,{dragging:n.current,steering:o.current}),t.set(n.current||o.current||i.current)},[e,t]),d=(0,K.useCallback)(u=>{n.current!==u&&(n.current=u,s())},[s]),c=(0,K.useRef)(()=>!1),l=(0,K.useCallback)(()=>{o.current||(o.current=!0,s()),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,!c.current()&&(o.current=!1,s())},160)},[s]),a=(0,K.useCallback)(()=>{n.current=!1,o.current=!1,s()},[s]);return{dragging:n,steering:o,tweening:i,setDragging:d,steer:l,settleLive:c,settled:a}}function nl(e,{dragging:t,steering:n}){e&&(t||n?e.setAttribute("data-graview-hand",t?"drag":"wheel"):e.removeAttribute("data-graview-hand"),e.style.cursor=t?"grabbing":"grab",e.style.userSelect=t?"none":"")}function rl(e){let t=(0,K.useRef)(!1),n=e!==null&&!t.current;return(0,K.useEffect)(()=>{e!==null&&(t.current=!0)},[e]),n}function ol({registerScene:e,scheme:t,views:n},o,r){let i=(0,K.useRef)(o);i.current=o,(0,K.useEffect)(()=>(e({whereIs:s=>xr(i.current,r.current,t,n,s)}),()=>e(null)),[e,t,n])}function il(e,t){(0,K.useEffect)(()=>{let n;return e.onActive(o=>{let r=t.current;if(!r)return;let i=c=>{let l=r.getBoundingClientRect();e.set({x:c.clientX-l.left,y:c.clientY-l.top})},s=c=>{c.buttons===0&&i(c)},d=()=>e.set(null);o?(r.addEventListener("pointermove",s),r.addEventListener("pointerup",i),r.addEventListener("pointerleave",d),n=()=>{r.removeEventListener("pointermove",s),r.removeEventListener("pointerup",i),r.removeEventListener("pointerleave",d)}):(n?.(),n=void 0)})},[e])}function al(e,t,n,o,r,i,s,d){(0,K.useEffect)(()=>{let c=t.current;if(!c||!e)return;let l=new Set;for(let u of n.nodes)(o.has(u.id)||u.aggregate?.memberIds.some(m=>o.has(m)))&&l.add(u.id);let a=e({canvas:c,layout:n,dirty:l,hostOf:u=>(c.parentElement??c).querySelector(`[data-graview-view="${CSS.escape(u)}"]`),drawOnDom:r,blur:i,scheme:s,fallBack:d});return()=>{a?.()}},[e,n,o,r,i,s,d])}var sl=nn(()=>(__graviewPreload(import.meta.url,["./chunk.RD2FSSLV.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.QWGWOEBZ.js")));function dl(e,t){let[n]=(0,K.useState)(()=>{let a=si();return t?e==="dom"||e==="auto"&&a==="dom"?"dom":"gpu":li(e,{operator:a,present:di()})}),[o,r]=(0,K.useState)(!1),i=(0,K.useCallback)(()=>r(!0),[]),[s,d]=(0,K.useState)(null),c=n==="gpu"&&!t&&!o&&s===null;return(0,K.useEffect)(()=>{if(!c)return;let a=!0;return sl().then(u=>{a&&d(()=>u.attachGpu())},()=>{a&&r(!0)}),()=>{a=!1}},[c]),{attach:(n==="gpu"&&!o?t??s:null)??null,fallBack:i}}function ll(){let[e,t]=(0,K.useState)(()=>new Set),n=(0,K.useCallback)(o=>{t(r=>r.size===o.size&&[...o].every(i=>r.has(i))?r:new Set(o))},[]);return[e,n]}function cl(){let e=fi();return t=>{let n=t?e.get(t.id):void 0,o=t?.aggregate?.memberIds??[];if(!n&&o.length===0)return;let r=n,i=n?.wrote??!1,s=n?.read??!1,d=n?.broke??!1;for(let c of o){let l=e.get(c);l&&(i||=l.wrote,s||=l.read,d||=l.broke,(!r||l.at>r.at||l.at===r.at&&l.wrote&&!r.wrote)&&(r=l))}return r?{...r,wrote:i,read:s,broke:d}:void 0}}var ys=(e,t)=>e.includes(t)?e.filter(n=>n!==t):[...e,t];function ul(){let{views:e,view:t,setView:n,setSelection:o}=ve(),r=jt(),i=(0,K.useContext)(rn),s=d=>{if(He(d.id)===null&&!d.aggregate)return!1;let c=e.resolve(d.kind,{cardinality:"many",fidelity:"full"})?.view;return c!==void 0&&c.generic!==!0};return d=>({onSelect:c=>{if(Ln(d.id)){o(a=>c?ys(a,d.id):[d.id]);return}let l=d.aggregate?Pn(d.id):[];if(t.overview){o(a=>c?[...new Set([...a,d.id])]:[d.id]);return}if(l.length===1&&!c&&Math.round(d.plane)!==0){let a=l[0];n(u=>Br(u,u.relation===a?null:a));return}o(a=>Mo(d,a,c))},onPick:(c,l,a)=>o(u=>a?l?[...new Set([...u,...a])]:[...a]:l?ys(u,c):[c]),onTravel:c=>{n(l=>({...Et(l,c),relation:null})),o([c])},onJackIn:()=>{let c=d.aggregate?.opens;if(c){c.in==="place"?n(u=>Dr(u,d.id)):n(u=>Object.entries(c.within).reduce((m,[f,b])=>rr(m,f,b),Et(An(u,!1),c.focus))),o([]);return}let l=He(d.id),a=l!==null&&(r?.byKind[l]??0)>0;if(i&&l!==null&&t.overview&&!s(d)&&!(a&&t.q)){n(u=>rr({...Et(u,`aggregate:${l}`),relation:null},"view",null)),o([]);return}n(u=>$r(u,d.id,{ownPicture:s(d),...a&&u.q?{carry:u.q}:{}})),o(d.aggregate?[]:[d.id])}})}var hl=Cn(nn(()=>(__graviewPreload(import.meta.url,["./chunk.HJCQ6I3S.js","./chunk.YCD4JSXD.js","./chunk.A4EZAGG7.js","./chunk.ZG5VGP5U.js","./chunk.SO6NT5K7.js","./chunk.MUSMNKE4.js","./chunk.SJQPTDAT.js","./chunk.JQ63N4MZ.js","./chunk.Z3O2VZAJ.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HAOB6O72.js")))),fl=hl.part((e,t)=>(0,pe.jsx)(e.Ribbons,{...t}),{what:"The relations",quiet:!0}),ws="graview:map-from-above";function ml(){let[e,t]=(0,K.useState)(()=>{try{return globalThis.localStorage?.getItem(ws)==="1"}catch{return!1}}),n=(0,K.useCallback)(o=>{t(o);try{globalThis.localStorage?.setItem(ws,o?"1":"0")}catch{}},[]);return[e,n]}var bs=Cn(nn(()=>(__graviewPreload(import.meta.url,["./chunk.A4EZAGG7.js","./chunk.ZG5VGP5U.js","./chunk.37RFCHSS.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.FLJXYESX.js")))),pl=bs.part((e,t)=>(0,pe.jsx)(e.Plots,{...t}),{quiet:!0}),gl=bs.part((e,t)=>(0,pe.jsx)(e.WorkflowsLayer,{...t}),{quiet:!0});function yl({zoom:e,zoomBy:t,above:n,setAbove:o}){let r=(i,s,d,c)=>(0,pe.jsx)("button",{type:"button",className:"graview-zoom-button","data-testid":`zoom-${i}`,"aria-label":`Zoom ${i}`,title:`Zoom ${i} \u2014 or pinch, or ctrl+wheel`,disabled:c,onClick:()=>t(d),children:s});return(0,pe.jsxs)("div",{className:"graview-zoom","data-graview-foot":"",role:"group","aria-label":"Zoom",onPointerDown:ps,onClick:ps,children:[r("out","\u2212",1/1.25,e<=Ar+1e-6),(0,pe.jsxs)("span",{className:"graview-zoom-level","data-testid":"zoom-level","aria-live":"polite",children:[Math.round(e*100),"%"]}),r("in","+",1.25,e>=Pr-1e-6),(0,pe.jsx)("button",{type:"button",className:"graview-zoom-button graview-zoom-above","data-testid":"from-above","aria-pressed":n,title:n?"See the city at an angle again":"See the city from straight above",onClick:()=>o(!n),children:"From above"})]})}function wl({options:e,renderer:t="auto",attachRenderer:n,blur:o=!0,className:r,style:i,animate:s=!0,children:d}){let c=ve(),l=c.app?c.app.workflows??Go(c.app)?.workflows:void 0,{store:a,scheme:u,views:m,view:f,setView:b,selection:h,setSelection:y,setMenuAt:M,emphasis:v,brand:w,noteMoved:x,robots:O,motion:E}=c,T=(0,K.useContext)(rn),D=(0,K.useRef)(null),g=(0,K.useRef)(null),S=Ba(g),L=Da(S),C=Ha(),{zoomAbout:V,panBy:X,pinchBy:ae,pinchDone:I,pinching:$}=ba({stage:g,view:f,setView:b}),N=Vt(),q=1,[P,j,W]=Zd(f.overview),[Q,k]=ml(),R=(0,K.useMemo)(()=>Q?{...e,tilt:Ci}:e,[e,Q]),{probe:B,dock:G}=pa(),A=!f.overview&&(f.zoom||f.past||f.relation)?Math.ceil(14+34*C/16+6):0,F=S&&L?S.height-L.height:0,z=(0,K.useRef)(G);F<=0&&(z.current=G);let _=F>0?z.current:G,Z=!!f.overview&&_.bottom>0&&_.right===0&&(h.length>0||f.focusId!==void 0),ne=ls(R,L,C,q*P,_,N,A,f.overview?0:_.bottom),J=da(g),[fe,ie,se,we,De]=Jd(f),re=(0,K.useMemo)(()=>new Set(Object.keys(f.pins).filter(H=>He(H)===null)),[f.pins]),ee=ga(),[le,at]=el(a,f,ee.held,ne,N,ie.pan),Ke=tl(g,E),{setDragging:bn,steer:Ze,settleLive:Te,settled:Tt}=Ke,Je=Ke.dragging.current||Ke.steering.current,It=rl(L),Ue=(0,K.useRef)(()=>{}),Le=ya({stage:g,pan:f.pan,zoom:P,setView:b,settled:Tt,zoomTo:Ue}),Ie=(0,K.useRef)(!1);Le.settling.current||(Ie.current=!1);let st=Le.settling.current&&!Ie.current,oe=ea(le,{enabled:s&&!Je&&L!==null&&!It,settle:!st});Ke.tweening.current=oe.t<1;let et=la(g,oe.t>=1,le);(0,K.useEffect)(()=>E.set(Ke.dragging.current||Ke.steering.current||oe.t<1),[E,oe]);let pt=ta(),xn=na(),xt=ua({view:f,result:le,frame:oe,panned:fe,closer:q,screenId:null,setCamera:De});ol(c,oe,g),il(c.pointer,g);let[ue,Pe]=ll(),{attach:dt,fallBack:Nt}=dl(t,n),$e=Zi(o);al(dt,D,oe,pt,Pe,$e,u,Nt);let tt=dt===null,qt=Ji($e&&tt,oe.t<1),vn=cl();Te.current=Le.settle;let{onGroundDown:Yn,onCardDown:vt,onDragMove:kn,onDragUp:Sn,onDragCancel:_n,swallow:gt}=wa({view:f,panned:fe,limit:()=>At(le),panWithin:se,moveByTransform:!0,setView:b,setDragging:bn,noteMoved:x,shift:Le,district:ee,pinching:$}),kt=qi({swallow:gt,setMenuAt:M,setSelection:y});Sa(g,gt),V.current=(H,me,xe)=>{if(!f.overview)return;Te.current();let Me=j.current,Ne=Math.max(Ar,Math.min(Pr,Me*H));if(Math.abs(Ne-Me)<1e-4)return;j.current=Ne,Ie.current=!0,Ze(),W(Ne);let ze=g.current?.getBoundingClientRect(),qe=le.visible??le,Dt={x:qe.width/2,y:qe.height/2},Rn=ze&&me!==void 0&&xe!==void 0?{x:me-ze.left,y:xe-ze.top}:Dt,qn=Ne/Me;b(St=>ct(St,mr(St.pan??{x:0,y:0},we.current,Rn,Dt,qn))),x()},ae.current=(H,me,xe,Me,Ne)=>{if(!f.overview)return;Ze();let ze=g.current?.getBoundingClientRect(),qe=ze?{x:me-ze.left,y:xe-ze.top}:{x:0,y:0};Le.zoomBy(H,qe,Me,Ne,Ar/j.current,Pr/j.current),x()},I.current=()=>{Te.current()},Ue.current=(H,me)=>{let xe=j.current,Me=Math.max(Ar,Math.min(Pr,xe*H));j.current=Me,Ie.current=!0,W(Me);let Ne=le.visible??le,ze={x:Ne.width/2,y:Ne.height/2};b(qe=>ct(qe,mr(qe.pan??{x:0,y:0},we.current,me,ze,Me/xe)))};let Qt=(H,me,xe=At(le))=>b(Me=>ct(Me,se(xe,{x:(Me.pan?.x??0)+H,y:(Me.pan?.y??0)+me})));fa(g,G,(H,me)=>Qt(H,me)),X.current=(H,me)=>{Ze();let xe=At(le),Me=f.pan??{x:0,y:0},Ne=Le.offset();Le.shiftTo(se(xe,{x:Me.x+Ne.x+H,y:Me.y+Ne.y+me}),Me),x()};let Kn=ul(),Un=Gt(),Ht=(0,K.useCallback)(H=>ln(Un,H).connector.visible,[Un]),lt=H=>vn(oe.nodes.find(me=>me.id===H)),Mn=(H,me,xe,Me)=>H.originY+fe.y+cn(xe.col+xe.side/Me,xe.row+xe.side/Me,H.cell,H.tilt).y-me.y,nt={width:le.width,height:le.height},En={position:"relative",zIndex:We.stage,...nt},Zt=H=>xr(oe,g.current,u,m,H),Xe=H=>tt||ue.has(H),Xn=lr(c),Jt=H=>(0,pe.jsx)(or.Provider,{value:Xn,children:H}),Bt=oe.nodes.filter(H=>H.screenOf===void 0).map(H=>(0,pe.jsx)(ms,{node:H,crowded:gs(H),useDom:Xe(H.id),blur:qt||!tt&&$e,...H.plot&&oe.city&&Math.round(H.plane)===2?{frontY:Mn(oe.city,H,H.plot,1),centerY:Mn(oe.city,H,H.plot,2)}:{},touched:pt.has(H.id),...Xd(vn(H)),scheme:u,canvasWidth:le.width,canvasHeight:le.height,selected:h.includes(H.id),...Kn(H),onMenu:M,selection:h,onDragStart:me=>vt(H,me),onDragMove:kn,onDragEnd:Sn,onDragCancel:_n,swallowClick:gt,children:H.beyond?(0,pe.jsx)(La,{kinds:H.beyond}):H.aggregate?.opens?(0,pe.jsx)(Na,{node:H}):(0,pe.jsx)(Ta,{node:H,mode:"scene",selected:h.includes(H.id),...gs(H)?{fidelity:"glyph"}:{}})},H.id));return(0,pe.jsxs)("div",{ref:g,className:`graview-ground${r?` ${r}`:""}`,"data-graview-altitude":f.overview?"":void 0,"data-graview-reach":oe.city?qd(At(le)):void 0,"data-graview-settled":oe.t>=1&&!xt.gliding()?"":void 0,"data-graview-box":L?`${L.width}x${L.height}`:void 0,"data-graview-renderer":tt?"dom":"gpu","data-graview-blur":(tt?qt:$e)?"":void 0,onPointerDown:H=>{kt.onPointerDown(H),Yn(H)},onPointerMove:H=>{kt.onPointerMove(H),kn(H)},onPointerUp:()=>{kt.onPointerUp(),Sn()},onPointerCancel:()=>{kt.onPointerUp(),_n()},onContextMenu:kt.onContextMenu,onClick:H=>{gt.current||H.target.closest("[data-graview-view], button, aside, section[aria-label], [data-graview-offstage], a, input, select")||(y([]),M(null))},style:{position:"relative",width:"100%",height:"100%",cursor:"grab",touchAction:"none",overscrollBehavior:"contain","--graview-altitude":f.overview?1:0,...oe.city?{"--graview-lattice-cell":`${oe.city.cell.toFixed(2)}px`,"--graview-lattice-tilt":(oe.city.tilt??.5).toFixed(3),"--graview-lattice-x":`${(oe.city.originX+oe.city.pan.x).toFixed(1)}px`,"--graview-lattice-y":`${(oe.city.originY+oe.city.pan.y).toFixed(1)}px`}:{},overflow:"hidden",...i},children:[(0,pe.jsx)("div",{className:"graview-measure","aria-hidden":"true",style:{"--graview-world-x":`${(oe.pan?.x??0).toFixed(1)}px`,"--graview-world-y":`${(oe.pan?.y??0).toFixed(1)}px`}}),f.overview&&oe.city?(0,pe.jsx)(K.Suspense,{fallback:null,children:(0,pe.jsx)(fl,{frame:oe,...nt,pan:oe.city.pan,store:a,graphVersion:N,selection:h,view:{overview:f.overview,focusId:f.focusId,beside:T},emphasis:v,hiddenKinds:c.hiddenKinds,drawn:Ht})}):null,(0,pe.jsx)("div",{ref:B,"aria-hidden":"true",style:{position:"absolute",top:0,right:0,width:"var(--graview-dock, 0px)",height:"var(--graview-sheet, 0px)",visibility:"hidden",pointerEvents:"none"}}),oe.city?(0,pe.jsx)(K.Suspense,{fallback:null,children:(0,pe.jsx)(pl,{frame:oe,...nt,pan:oe.city?oe.city.pan:fe,brand:w,pinned:re,close:q*P>1.2,swallowed:gt,...f.overview?{chosen:Hn(h,{overview:f.overview,focusId:f.focusId,beside:T},H=>a.graph.getNode(H)?.kind).records}:{},onFocus:H=>{let me=He(H);me!==null&&b(xe=>Et(xe,Be(me)))}})}):null,f.overview&&oe.city&&l?(0,pe.jsx)(K.Suspense,{fallback:null,children:(0,pe.jsx)(gl,{frame:oe,...nt,pan:oe.city.pan,app:c.app,workflows:l,acts:a.allMutations(),runs:c.workflowRuns,graphVersion:N,hiddenKinds:c.hiddenKinds})}):null,tt?(0,pe.jsx)("div",{"data-graview-stage":"dom","data-graview-world":"",style:{...En,overflow:"hidden"},children:Jt(Bt)}):(0,pe.jsxs)("div",{"data-graview-world":"",style:En,children:[(0,pe.jsx)("div",{"data-graview-stage":"dom","data-graview-under-canvas":"",style:{position:"absolute",left:0,top:0,...nt,overflow:"hidden"},children:Jt(Bt.filter(H=>ue.has(String(H.key))))}),(0,pe.jsx)("canvas",{ref:D,"data-graview-stage":"gpu",content:"drawable",layoutsubtree:"",...nt,style:{display:"block",position:"relative",...nt},children:Jt(Bt.filter(H=>!ue.has(String(H.key))))})]}),f.overview?(0,pe.jsx)(aa,{result:le,schema:a.schema,chrome:[...ne.chrome??[],...J?[J]:[],...ca(et,le.nodes)],onGo:H=>{Qt(H.x,H.y),x()}}):null,f.overview&&!Z?(0,pe.jsx)(yl,{zoom:P,zoomBy:H=>V.current(H),above:Q,setAbove:k}):null,(0,pe.jsx)(as,{frame:oe,focusId:f.focusId,beside:T,holding:at,...nt,scheme:u,overview:!!f.overview,selection:h,emphasis:v,stageRef:g,store:a,graphNodes:N,...(H=>H?{provisional:H}:{})(is(a)),onPickEdge:(H,me)=>{gt.current||(y([H]),M(me?{...me,on:H}:null))},liveOf:H=>{let me=lt(H.from),xe=lt(H.to);return me?.wrote&&xe?.wrote?me.at>xe.at?me:xe:void 0}}),(0,pe.jsx)(oa,{width:le.width,whereIs:Zt}),(0,pe.jsx)(ra,{marks:xn.marks,questions:[...O.values()].filter(H=>H.mode==="asking"&&H.at!==null&&H.say).map(H=>({id:H.at,who:H.who,asks:H.say})),whereIs:Zt,stageRef:g,...nt}),(0,pe.jsx)(ss,{nodes:oe.nodes,moving:oe.t<1,holding:at,scheme:u,width:le.width,stageRef:g}),d,(0,pe.jsx)("div",{className:"graview-lattice","aria-hidden":"true"})]})}var it=de(Oe(),1);function bl(){return Ss(),null}var ks=()=>window.location.pathname.endsWith(Vo),xs=()=>(ks()?Yo:Hr)(window.location.hash),xl=e=>(ks()?_o:Nr)(e);function Ss(){let{view:e,setView:t,views:n,principal:o}=ve(),r=JSON.stringify(o),i=(0,it.useCallback)(a=>{let u=a.within?.view;if(u===void 0||a.focusId)return a;let m=n.places().find(f=>f.as===u);return m?{...a,focusId:Be(m.kind)}:a},[n]),s=(0,it.useRef)(!1);(0,it.useEffect)(()=>{if(typeof window>"u")return;let a=i(xs());!nr(a,Ir)&&!nr(a,e)&&(s.current=!0,t(a))},[]),(0,it.useEffect)(()=>{if(typeof window>"u")return;let a=()=>t(i(xs()));return window.addEventListener("popstate",a),window.addEventListener("hashchange",a),()=>{window.removeEventListener("popstate",a),window.removeEventListener("hashchange",a)}},[t,i]);let d=(0,it.useRef)(!1),c=(0,it.useRef)(null),l=(0,it.useRef)(r);(0,it.useEffect)(()=>{if(typeof window>"u")return;if(s.current){s.current=!1;return}let a=l.current!==r;l.current=r;let u=xl(e),m=u||`${window.location.pathname}${window.location.search}`;if((window.location.hash||(window.location.href.includes("#")?"#":""))===u){d.current=!0,c.current=e;return}if(!d.current){d.current=!0,c.current=e,window.history.replaceState({graview:zt.at},"",m);return}if(a||Ms(c.current,e)){window.history.replaceState({graview:zt.at},"",m),c.current=e;return}c.current=e,window.history.pushState({graview:++zt.at},"",m),zt.depth=zt.at,zt.tell()},[e,r])}function Ms(e,t){return e?e.focusId===t.focusId&&e.relation===t.relation&&(e.overview??!1)===(t.overview??!1)&&(e.zoom??!1)===(t.zoom??!1)&&(e.past??!1)===(t.past??!1)&&e.expanded.join(",")===t.expanded.join(",")&&(e.shown??[]).join(",")===(t.shown??[]).join(",")&&vl(e.within,t.within):!1}function vl(e,t){let n=o=>Object.entries(o??{}).sort(([r],[i])=>r.localeCompare(i)).map(([r,i])=>`${r}=${i}`).join("&");return n(vs(e))===n(vs(t))}function vs(e){if(!e||!("q"in e))return e;let{q:t,...n}=e;return n}var $o=de(Oe(),1);var Es=new WeakMap,kl=64,Rs=new WeakMap,Sl=0,Ml=e=>{if(e===void 0)return 0;let t=Rs.get(e);return t===void 0&&Rs.set(e,t=Sl+=1),t};function Os(e,t,n,o={}){let r=()=>{let l=[...new Set(t.flatMap(u=>Pn(u)))],a=t.map(u=>Ft(u)).filter(u=>u!==null);return Mi(e,t,{...n.principal?{principal:n.principal}:{},kindSelection:l,edgeSelection:a,...n.providers?{providers:n.providers}:{},...n.pins?{pins:n.pins}:{},...n.focus!==void 0?{focus:n.focus}:{},...o})};if(Object.keys(o).length>0)return r();let i=Es.get(e);if(!i){let l={kept:new Map,at:e.log.length};Es.set(e,i=l),e.subscribe(()=>l.kept.clear())}i.at!==e.log.length&&(i.kept.clear(),i.at=e.log.length);let s=JSON.stringify([t,n.principal??null,Ml(n.providers),n.pins??null,n.focus??null]),d=i.kept.get(s);if(d)return d;let c=r();return i.kept.set(s,c),i.kept.size>kl&&i.kept.delete(i.kept.keys().next().value),c}function El(e,t,n={}){return Os(e,t,n)}function Rl(e={}){let{store:t,selection:n,principal:o,providers:r}=ve(),{about:i,principal:s=o,providers:d=r,pins:c,focus:l,...a}=e,u=i??n,m=Vt();return(0,$o.useMemo)(()=>Os(t,u,{principal:s,providers:d,pins:c,focus:l},a),[t,u,e,m,s,d])}function Ol(){let{store:e,principal:t}=ve();return(0,$o.useMemo)(()=>({preview:(n,o)=>Ri(e,n,o??{},{pressed:t?{author:t}:{}}),apply:(n,o)=>Ei(e,n,o??{},{author:t})}),[e,t])}export{zs as a,Gs as b,Ys as c,_s as d,Ks as e,Us as f,Is as g,wl as h,bl as i,El as j,Rl as k,Ol as l};
@@ -1 +0,0 @@
1
- import{a as n}from"./chunk.QXLJGHMC.js";import"./chunk.DZMIYEHQ.js";import"./chunk.3GNT5MKP.js";import"./chunk.AJMVRFYX.js";import"./chunk.Q355UPFG.js";import{o as s}from"./chunk.GMLONS5L.js";import"./chunk.264PB572.js";import"./chunk.6NG76MDA.js";import"./chunk.35KMZHB7.js";import"./chunk.IAEGJDF3.js";import"./chunk.YZPESGCP.js";import"./chunk.SY5ID44D.js";import"./chunk.GVT4UUQA.js";import"./chunk.5R744JGZ.js";import"./chunk.O2OL6RQQ.js";import"./chunk.J6HF7IRQ.js";import"./chunk.LRNFE3UK.js";import"./chunk.MB7LKKUD.js";import"./chunk.T2OUHRAA.js";import"./chunk.GRFD42WM.js";import"./chunk.EP6Q32WT.js";import"./chunk.QAM76AXV.js";import"./chunk.Z27NSSYL.js";import"./chunk.PZ7KY6XH.js";import"./chunk.WEMUKZKH.js";import"./chunk.T27QKVKP.js";import"./chunk.LP2ZMAT2.js";import"./chunk.BJUUSIQY.js";import"./chunk.MSAYU25L.js";import"./chunk.EGPCVMDU.js";import"./chunk.XOZU4OFA.js";import"./chunk.H3EGBDW2.js";import"./chunk.WVUJXDXZ.js";import"./chunk.DWM7AR5Y.js";import"./chunk.6KJGRM7A.js";import"./chunk.WALVW3KJ.js";import"./chunk.SNHKYH72.js";import"./chunk.UGQYMN4J.js";import"./chunk.RG5G6YQD.js";import"./chunk.MIE4TJRW.js";import"./chunk.QRQ5WPZI.js";import"./chunk.RD2FSSLV.js";import"./chunk.37RFCHSS.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import{G as y,W as i}from"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import{b as r}from"./chunk.AJZBJBMO.js";var c=r(y(),1),e=r(i(),1);function v({store:d,views:t,as:a,scope:o}){let l=(0,c.useMemo)(()=>s({scope:`.${o}`}),[o]);return(0,e.jsxs)("div",{"data-testid":"embed-picture","data-embed-content":"",tabIndex:0,"aria-label":t.places().find(m=>m.as===a)?.title??"The picture",style:{flex:"1 1 auto",minHeight:0,display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,e.jsx)("style",{children:l}),(0,e.jsx)(n,{store:d,views:t,as:a})]})}export{v as PictureFace};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk.47XEJZ3O.js";import"./chunk.BKYZSV2Y.js";import"./chunk.LP2ZMAT2.js";import"./chunk.MSAYU25L.js";import"./chunk.EGPCVMDU.js";import"./chunk.H3EGBDW2.js";import"./chunk.DWM7AR5Y.js";import"./chunk.6KJGRM7A.js";import"./chunk.WALVW3KJ.js";import"./chunk.SNHKYH72.js";import"./chunk.UGQYMN4J.js";import"./chunk.RG5G6YQD.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};
@@ -1,3 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Ze,b as et}from"./chunk.OCXY5DCD.js";import{a as _e,b as Ve,c as je,d as Ye,e as Ke,f as Ge,g as Xe,j as Qe,p as Je,q as xe,r as le,s as Ce}from"./chunk.B5SJMCTT.js";import{d as qe}from"./chunk.ILJDLBPJ.js";import{A as Ue,x as Fe}from"./chunk.QRQ5WPZI.js";import{m as ze}from"./chunk.QNP5OR3P.js";import{G as ke,La as Se,W as V,ea as We}from"./chunk.A5PSEU3W.js";import{a as ve}from"./chunk.SDO3U72B.js";import{la as $e,td as O}from"./chunk.ZEZUKRC6.js";import{b as I}from"./chunk.AJZBJBMO.js";var p=I(ke(),1);var Y=I(ke(),1);var j=I(V(),1),M=e=>(e??"").replace(/\s+/g," ").trim();function Ct(e){let t=[e];e.shadowRoot&&t.push(e.shadowRoot);for(let i of e.querySelectorAll("[data-worker-view]"))i.shadowRoot&&t.push(i.shadowRoot);return t}function Pt(e){return e instanceof HTMLElement?e.innerText??e.textContent??"":[...e.children].map(t=>t instanceof HTMLElement?t.innerText??t.textContent??"":t.textContent??"").join(" ")}var Et=/^[\s·•|,:;–—\-+…✓✔×↓↑▸▾☆★⋯]*$/u;function Tt(e,t){let i=[],d=(e.ownerDocument??document).createTreeWalker(e,NodeFilter.SHOW_TEXT),c=new Map;for(let s=d.nextNode();s;s=d.nextNode()){let a=s.parentElement;if(!a||t.contains(a)||a.closest("button, input, select, textarea, [role='button'], nav, [hidden], [aria-hidden='true'], script, style"))continue;let o=a.closest("a[href]");o&&!o.contains(t)||c.set(a,(c.get(a)??"")+(s.textContent??""))}for(let[s,a]of[...c].flatMap(([o,l])=>l.split(/\s+·\s+/).map(n=>[o,n]))){let o=M(a);if(!(!o||o.length>40||Et.test(o)||!/[\p{L}\p{N}]/u.test(o)||s.getClientRects().length===0)&&(i.includes(o)||i.push(o),i.length>=6))break}return i}function Rt(e){let t=[],i=(e.ownerDocument??document).createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let d=i.nextNode();d;d=i.nextNode()){let c=M(d.textContent);c&&!d.parentElement?.closest("button, script, style, [hidden], [aria-hidden='true']")&&t.push(c)}return t}function tt(e,t){if(!e)return[];let i=[],d=c=>{let s=M(c);s.length>1&&s.length<80&&!i.some(a=>a.toLowerCase()===s.toLowerCase())&&i.push(s)};for(let c of e.querySelectorAll("[data-key], [data-record]")){let s=c.getAttribute("data-record")??c.getAttribute("data-key")??"",a=Rt(c),o=s&&t?t(s):void 0;if(o&&a.join(" ").toLowerCase().includes(M(o).toLowerCase()))d(o);else{if(!c.hasAttribute("data-record")&&c.querySelector("[data-record]"))continue;a.length===1&&d(a[0])}}return i.slice(0,40)}function nt(e){let t=[];for(let i of e)for(let d of[i,...i.querySelectorAll("*")]){if(!d.matches("h1, h2, h3, h4, h5, h6, [role='heading']"))continue;let c=d.cloneNode(!0);for(let a of c.querySelectorAll("span"))/^[\s·\d]+$/.test(a.textContent??"")&&a.remove();let s=M(c.textContent).replace(/^[▸▾]\s*/,"");s&&!t.includes(s)&&t.push(s)}return t}function de(e,t){if(!e?.isConnected)return{headings:[],records:[],text:""};let i=Ct(e),d=[],c=[];for(let l of i)for(let n of l.querySelectorAll("h1, h2, h3, [role='heading']")){if(n.closest("[data-graview-popover], [hidden], [aria-hidden='true'], nav"))continue;let g=n.cloneNode(!0);for(let y of g.querySelectorAll("span"))/^[\s·\d]+$/.test(y.textContent??"")&&y.remove();let r=M(g.textContent).replace(/^[▸▾]\s*/,"");r&&(d.push(r),c.push({element:n,said:r}))}let s=new Map;for(let l of t){let n=M(l).toLowerCase();if(!n||s.has(l))continue;let g;for(let r of i)for(let y of r.querySelectorAll("a, li, p, span, h2, h3, h4, strong, div, button, td"))M(y.textContent).toLowerCase()===n&&(!g||g.contains(y))&&(g=y);g&&s.set(l,g)}let a=[...s.values()],o=[];for(let[l,n]of s){let g=n;for(let h=n.parentElement;h&&h!==e&&!(h instanceof HTMLBodyElement)&&!(a.some(L=>L!==n&&h.contains(L))||h.matches("main, section, ul, ol, table, tbody, [data-graview-page]"));h=h.parentElement)g=h;let r,y=new Set(t.map(h=>M(h).toLowerCase()));for(let h of c)h.element.getRootNode()!==n.getRootNode()||g.contains(h.element)||h.element.contains(n)||y.has(h.said.toLowerCase())||h.element.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING&&(r=h.said);let b=n.getBoundingClientRect(),f=Number.parseFloat(getComputedStyle(n).fontSize)||16,C=g instanceof HTMLElement?g.innerText??g.textContent??"":g.textContent??"",B=n.matches("h1, [data-graview-page-title]")||n.closest("h1, [data-graview-page-title]")!==null,K=!B&&g!==n&&[...g.querySelectorAll("button, [role='button'], [role='checkbox'], [aria-pressed], input[type='checkbox'], [data-act]")].some(h=>!h.contains(n)&&!n.contains(h)),G=!B&&n.closest("a[href], [data-record]")!==null;o.push({label:l,top:Math.round(b.top),left:Math.round(b.left),size:f,facts:B?[]:Tt(g,n),row:M(C),...r?{under:r}:{},...K?{presses:K}:{},...G?{opens:G}:{}})}return o.sort((l,n)=>l.top-n.top||l.left-n.left),{headings:d,records:o,text:i.map(Pt).join(" ")}}function Dt(e,t,i=0){(0,Y.useLayoutEffect)(()=>{let d=0,c=()=>{let s=t.current,a=e?.isConnected?le([e]):null;if(s&&a){let o=Math.max(a.top,0),l=Math.min(a.bottom,innerHeight);s.style.display=l>o?"grid":"none",s.style.left=`${Math.round(a.left-i)}px`,s.style.top=`${Math.round(o-i)}px`,s.style.width=`${Math.round(a.width+2*i)}px`,s.style.height=`${Math.round(l-o+2*i)}px`}d=requestAnimationFrame(c)};return c(),()=>cancelAnimationFrame(d)},[e,t,i])}var Mt=`@keyframes graview-redesign{0%{background-position:100% 0}100%{background-position:-100% 0}}
2
- [data-graview-redesigning]{background:linear-gradient(90deg,var(--graview-ground) 0%,color-mix(in srgb,var(--graview-panel) 70%,var(--graview-accent) 6%) 50%,var(--graview-ground) 100%);background-size:200% 100%;animation:graview-redesign 1.6s linear infinite}
3
- @media (prefers-reduced-motion: reduce){[data-graview-redesigning]{animation:none}}`;function rt({over:e,name:t,said:i}){let d=(0,Y.useRef)(null);return Dt(e,d,2),(0,j.jsxs)("div",{ref:d,"data-graview-redesigning":"","data-testid":"redesigning","data-graview-popover":"",style:At,children:[(0,j.jsx)("style",{children:Mt}),(0,j.jsxs)("p",{role:"status","aria-live":"polite",style:Ht,children:[(0,j.jsx)("span",{"aria-hidden":"true",style:It,children:"\u2726"})," ",i??`Graview is redesigning \u201C${t}\u201D\u2026`]})]})}var At={position:"fixed",display:"none",placeItems:"center",boxSizing:"border-box",borderRadius:12,zIndex:O("popover"),pointerEvents:"auto",overflow:"hidden"},Ht={margin:0,padding:"8px 14px",borderRadius:999,fontSize:"0.9375rem",color:"var(--graview-ink)",background:"var(--graview-float, var(--graview-panel))",border:"1px solid var(--graview-edge)",boxShadow:"var(--graview-lift-low)",position:"sticky",top:16},It={color:"var(--graview-accent)"},xn={position:"fixed",left:"max(12px, calc(50% - 440px))",right:"max(12px, calc(50% - 440px))",bottom:12,zIndex:O("popover"),boxSizing:"border-box",display:"grid",gap:8,padding:"10px 12px",borderRadius:14,border:"1px solid var(--graview-edge)",background:"var(--graview-float, var(--graview-panel))",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem"};var ce={minHeight:34,padding:"0 12px",font:"inherit",borderRadius:8,cursor:"pointer"},Cn={...ce,color:"var(--graview-accent-ink, #fff)",background:"var(--graview-accent)",border:"1px solid var(--graview-accent)"},Pn={...ce,color:"var(--graview-ink)",background:"transparent",border:"1px solid var(--graview-edge)"};var En={...ce,minHeight:28,padding:"0 10px",borderRadius:999,border:0,color:"var(--graview-accent-ink, #fff)",background:"var(--graview-accent)"},Tn={...ce,minHeight:28,padding:"0 10px",borderRadius:999,border:0,color:"var(--graview-ink)",background:"transparent"};var P=I(ke(),1);var m=I(V(),1),Lt=640,Pe=372,Ot=1100,ot=()=>typeof innerWidth!="number"||innerWidth>=Ot?"side":innerWidth>=Lt?"drawer":"sheet";function Nt(){let e=document.querySelector('[data-testid="app-bar"]');return e||([...document.querySelectorAll("header")].find(t=>{let i=t.getBoundingClientRect();return i.top<=1&&i.width>=innerWidth*.8&&i.height>0})??null)}function Bt(e){let t=document.querySelector("[data-graview-page-main], main");for(;t?.parentElement&&t.parentElement!==document.body&&!(e&&t.parentElement.contains(e));)t=t.parentElement;return t}function $t(e){let[t,i]=(0,P.useState)(ot);return(0,P.useLayoutEffect)(()=>{let d=document.body.style,c=d.paddingBottom,s=null,a="",o=0,l=(g,r)=>{s&&s!==g&&(s.style.paddingRight=a),g&&g!==s&&(a=g.style.paddingRight),s=g,s&&(s.style.paddingRight=r?`${Pe}px`:a)},n=()=>{let g=ot();i(g);let r=Nt(),y=Math.max(0,Math.round(r?.getBoundingClientRect().bottom??0));e.current&&g!=="sheet"&&(e.current.style.top=`${y}px`),l(Bt(r),g==="side"),d.paddingBottom=g==="sheet"?`${Math.round((e.current?.getBoundingClientRect().height??0)+16)}px`:c,o=requestAnimationFrame(n)};return n(),()=>{cancelAnimationFrame(o),l(null,!1),d.paddingBottom=c}},[e]),t}var Wt=e=>`${Math.floor(e/6e4)}:${String(Math.floor(e%6e4/1e3)).padStart(2,"0")}`;function st(e){let t=(0,P.useRef)(null),i=(0,P.useRef)(null),d=(0,P.useRef)(null),[c,s]=(0,P.useState)(""),[,a]=(0,P.useState)(0),o=$t(t);(0,P.useEffect)(()=>{if(!e.working)return;let r=setInterval(()=>a(y=>y+1),1e3);return()=>clearInterval(r)},[e.working]),(0,P.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e.talk.length,e.steps.length]),(0,P.useEffect)(()=>{e.working||d.current?.focus({preventScroll:!0})},[e.working,e.phase]);let l=e.talk.map(r=>r.who).lastIndexOf("person"),n=e.steps.length>0?(0,m.jsx)("li",{"data-testid":"better-steps",style:Yt,children:(0,m.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:3},children:e.steps.map((r,y)=>{let b=e.working&&y===e.steps.length-1;return(0,m.jsxs)("li",{"data-testid":"better-step","data-step-kind":r.kind,style:{display:"flex",gap:6,alignItems:"baseline",color:b?"var(--graview-ink)":"var(--graview-ink-muted)"},children:[(0,m.jsx)("span",{"aria-hidden":"true",style:{width:14,flex:"none",color:r.kind==="check"||r.kind==="stuck"?"var(--graview-warn)":"var(--graview-accent)"},children:b?"\u2026":r.kind==="check"||r.kind==="stuck"?"!":"\u2713"}),(0,m.jsx)("span",{children:r.text})]},`s${y}`)})})}):null,g=e.talk.length===0;return(0,m.jsxs)("aside",{ref:t,role:"complementary","aria-label":`Change how \u201C${e.name}\u201D looks`,"data-testid":"better-panel","data-better-phase":e.phase,"data-better-dock":o,"data-graview-popover":"",style:o==="sheet"?Ft:o==="drawer"?zt:dt,children:[(0,m.jsxs)("header",{style:qt,children:[(0,m.jsxs)("p",{style:{margin:0,fontWeight:600},children:["Change how \u201C",e.name,"\u201D looks"]}),(0,m.jsx)("button",{type:"button","data-testid":"better-close","aria-label":"Close",onClick:e.close,style:Kt,children:"\xD7"})]}),(0,m.jsx)("p",{"data-testid":"better-scope",style:at,children:e.scope}),e.about?(0,m.jsxs)("p",{"data-testid":"better-about",style:Ut,children:["About: ",e.about]}):null,(0,m.jsxs)("ol",{ref:i,"data-testid":"better-talk",style:_t,children:[e.talk.map((r,y)=>(0,m.jsxs)(P.Fragment,{children:[(0,m.jsx)("li",{"data-testid":"better-message","data-who":r.who,style:r.who==="person"?Vt:jt,children:r.said}),y===l?n:null]},`t${y}`)),l<0?n:null]}),e.working?(0,m.jsxs)("div",{style:ee,children:[(0,m.jsxs)("p",{role:"status","aria-live":"polite","data-testid":"better-working",style:{margin:0,flex:1,color:"var(--graview-ink-muted)"},children:["Graview is working on \u201C",e.name,"\u201D \xB7 ",(0,m.jsx)("span",{"data-testid":"better-time",children:Wt(Date.now()-e.since)})]}),(0,m.jsx)("button",{type:"button","data-testid":"better-stop",onClick:e.stop,style:N,children:"Stop"})]}):null,e.draft&&!e.working?(0,m.jsxs)("div",{"data-testid":"better-draft",style:{flexShrink:0,display:"grid",gap:6},children:[(0,m.jsx)("p",{"data-testid":"better-changed",style:{margin:0},children:e.draft.said}),(0,m.jsxs)("div",{style:ee,children:[(0,m.jsx)("div",{role:"group","aria-label":"Compare",style:Xt,children:["Before","After"].map(r=>{let y=r==="Before"?e.draft.before:!e.draft.before;return(0,m.jsx)("button",{type:"button","data-testid":`better-${r.toLowerCase()}`,"aria-pressed":y,onClick:()=>e.compare(r==="Before"),style:y?Qt:Jt,children:r},r)})}),(0,m.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",gap:6},children:[(0,m.jsx)("button",{type:"button","data-testid":"better-keep",onClick:e.keep,style:it,children:"Keep"}),(0,m.jsx)("button",{type:"button","data-testid":"better-discard",onClick:e.discard,style:N,children:"Discard"})]})]})]}):null,e.stuck&&!e.working?(0,m.jsxs)("div",{"data-testid":"better-stuck",style:ee,children:[e.stuck.keepAnyway?(0,m.jsx)("button",{type:"button","data-testid":"better-keep-anyway",onClick:e.stuck.keepAnyway,style:N,children:"Keep anyway"}):null,(0,m.jsx)("button",{type:"button","data-testid":"better-stuck-stop",onClick:e.stuck.stop,style:N,children:"Stop"})]}):null,e.children,e.kept&&!e.working?(0,m.jsxs)("div",{"data-testid":"better-kept",style:ee,children:[(0,m.jsx)("p",{style:{margin:0,flex:1},children:e.kept.note?/^kept\b/i.test(e.kept.note.trim())?e.kept.note.trim():`Kept. ${e.kept.note}`:"Kept."}),e.kept.undo?(0,m.jsx)("button",{type:"button","data-testid":"better-undo",onClick:e.kept.undo,style:N,children:"Undo"}):null]}):null,g&&!e.working?(0,m.jsxs)("div",{style:ee,children:[(0,m.jsx)("button",{type:"button","data-testid":"better-just",onClick:e.just,style:N,children:"Make it easier to read"}),(0,m.jsx)("button",{type:"button","data-testid":"better-point",onClick:e.point,style:N,children:"Point at a part\u2026"})]}):null,e.pointed&&!e.working?(0,m.jsxs)("p",{"data-testid":"better-pointed",style:at,children:["You pointed at ",e.pointed,"."]}):null,(0,m.jsxs)("form",{onSubmit:r=>{r.preventDefault(),!(!c.trim()||e.working)&&(e.ask(c.trim()),s(""))},style:{flexShrink:0,display:"flex",gap:6},children:[(0,m.jsx)("label",{htmlFor:"graview-better-panel-words",style:ze,children:"Tell Graview what to change"}),(0,m.jsx)("input",{id:"graview-better-panel-words",ref:d,"data-testid":"better-words",value:c,disabled:e.working,onChange:r=>s(r.target.value),placeholder:g?"What should change?":"Tell Graview what to change\u2026",style:Gt}),(0,m.jsx)("button",{type:"submit",disabled:e.working||!c.trim(),"data-testid":"better-send",style:it,children:"Send"})]})]})}var lt={position:"fixed",zIndex:O("popover"),boxSizing:"border-box",display:"flex",flexDirection:"column",gap:10,padding:14,margin:0,fontSize:"0.875rem",lineHeight:1.45,color:"var(--graview-ink)",background:"var(--graview-panel)",overflow:"hidden"},dt={...lt,top:0,right:0,bottom:0,width:Pe,borderLeft:"1px solid var(--graview-edge)"},zt={...dt,width:`min(${Pe}px, 86vw)`,boxShadow:"var(--graview-lift-high, -12px 0 32px rgba(0,0,0,0.18))"},Ft={...lt,left:0,right:0,bottom:0,maxHeight:"55vh",borderTop:"1px solid var(--graview-edge)",borderRadius:"14px 14px 0 0",boxShadow:"var(--graview-lift-high, 0 -12px 32px rgba(0,0,0,0.18))"},Ut={flexShrink:0,margin:0,justifySelf:"start",alignSelf:"flex-start",padding:"2px 10px",borderRadius:999,fontSize:"0.8125rem",color:"var(--graview-ink)",background:"var(--graview-ground)",border:"1px solid var(--graview-edge)"},qt={flexShrink:0,display:"flex",alignItems:"center",gap:8,justifyContent:"space-between"},at={flexShrink:0,margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},_t={margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:8,overflowY:"auto",flex:"1 1 0",minHeight:0},ct={padding:"7px 10px",borderRadius:10,maxWidth:"88%",whiteSpace:"pre-wrap",flex:"none"},Vt={...ct,alignSelf:"flex-end",background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))"},jt={...ct,alignSelf:"flex-start",background:"var(--graview-ground)"},Yt={flex:"none",padding:"6px 10px",borderRadius:10,border:"1px dashed var(--graview-edge)",fontSize:"0.8125rem"},ee={flexShrink:0,display:"flex",flexWrap:"wrap",alignItems:"center",gap:6},ue={minHeight:32,padding:"0 12px",borderRadius:8,fontSize:"0.8125rem",cursor:"pointer"},it={...ue,color:"var(--graview-accent-ink, #fff)",background:"var(--graview-accent)",border:"1px solid var(--graview-accent)"},N={...ue,color:"var(--graview-ink)",background:"transparent",border:"1px solid var(--graview-edge)"},Kt={...N,minHeight:28,padding:"0 9px",fontSize:"1rem",lineHeight:1},Gt={flex:"1 1 auto",minWidth:0,minHeight:34,padding:"0 10px",borderRadius:8,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",fontSize:"0.875rem"},Xt={display:"inline-flex",border:"1px solid var(--graview-edge)",borderRadius:999,padding:2},Qt={...ue,minHeight:28,borderRadius:999,border:"none",color:"var(--graview-accent-ink, #fff)",background:"var(--graview-accent)"},Jt={...ue,minHeight:28,borderRadius:999,border:"none",color:"var(--graview-ink)",background:"transparent"};var x=I(V(),1);var Ee=Se(ve(()=>(__graviewPreload(import.meta.url,["./chunk.X226YATK.js","./chunk.BJUUSIQY.js","./chunk.6KJGRM7A.js","./chunk.Z3O2VZAJ.js","./chunk.QNP5OR3P.js","./chunk.4W57E7AX.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.CKDCTFLU.js")))),Zt=Ee.part((e,t)=>(0,x.jsx)(e.RateTelling,{...t}),{quiet:!0});function _n({ask:e,open:t,close:i}){return e?.part?(0,x.jsx)(tn,{ask:e,close:i},e.at):e?.section?(0,x.jsx)(ln,{ask:e,close:i},e.at):t?(0,x.jsx)(Ce,{elements:t}):null}var en=Se(ve(()=>(__graviewPreload(import.meta.url,["./chunk.HB5NWHFP.js","./chunk.OCXY5DCD.js","./chunk.B5SJMCTT.js","./chunk.NYLKG25K.js","./chunk.TBY5IR7C.js","./chunk.ILJDLBPJ.js","./chunk.X226YATK.js","./chunk.BJUUSIQY.js","./chunk.M7KXQGQL.js","./chunk.XOZU4OFA.js","./chunk.H3EGBDW2.js","./chunk.6KJGRM7A.js","./chunk.MIE4TJRW.js","./chunk.QRQ5WPZI.js","./chunk.RD2FSSLV.js","./chunk.37RFCHSS.js","./chunk.SO6NT5K7.js","./chunk.MUSMNKE4.js","./chunk.SJQPTDAT.js","./chunk.JQ63N4MZ.js","./chunk.Z3O2VZAJ.js","./chunk.QNP5OR3P.js","./chunk.4W57E7AX.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.2FHIINXG.js")))),tn=en.part((e,t)=>(0,x.jsx)(e.PageCard,{...t}),{what:"Make this better"}),nn=360,T=12;function Vn(e,t){let i={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},d=Math.min(nn,i.width-2*T),c=e.getBoundingClientRect().height,s=l=>Math.max(T,Math.min(l,i.height-c-T)),a=(i.width-d)/2,o=s(72);t&&t.width>0&&(t.right+T+d<=i.width-T?[a,o]=[t.right+T,s(t.top)]:t.left-T-d>=T?[a,o]=[t.left-T-d,s(t.top)]:(a=Math.max(T,Math.min(t.left,i.width-d-T)),o=t.bottom+T+c<=i.height-T?t.bottom+T:s(t.top-T-c))),e.style.left=`${Math.round(a)}px`,e.style.top=`${Math.round(o)}px`,e.style.width=`${Math.round(d)}px`}var rn=e=>e.map(t=>t.innerText??t.textContent??"").join(" ").replace(/\s+/g," ").trim(),ut=e=>{let t=e.getBoundingClientRect();return{tag:(e.getAttribute("data-graview-as")??e.localName).toLowerCase(),classes:[...e.classList],text:e.textContent??"",box:{left:t.left,top:t.top,width:t.width,height:t.height}}};function on(e,t,i){let d=[...e.querySelectorAll("*")].filter(a=>{let o=a.getBoundingClientRect();return o.width>0&&o.height>0});if(i){let a=d.filter(n=>{let g=n.getBoundingClientRect();return t.left>=g.left&&t.left<=g.right&&t.top>=g.top&&t.top<=g.bottom}),l=a.filter(n=>!a.some(g=>g!==n&&n.contains(g)))[0];if(!l)return[];for(let n=l;n&&n!==e;n=n.parentElement)if(n.classList.length>0||/^(h[1-6]|li|a|button|img|p|article|section)$/.test(n.localName))return[n];return[l]}let c=d.filter(a=>{let o=a.getBoundingClientRect();return o.left>=t.left-2&&o.right<=t.right+2&&o.top>=t.top-2&&o.bottom<=t.bottom+2}),s=c.filter(a=>!c.some(o=>o!==a&&o.contains(a)));for(;s.length===1;){let a=[...s[0].children].filter(o=>c.includes(o));if(a.length<2)break;s=a}return s}function an(e,t,i={}){let d=l=>({source:l.source,css:l.css,...l.root?{drawing:l.root}:{},...l.height!==void 0?{height:l.height}:{}}),c=et(d(e),d(t)),s=[];for(let l of c.unstyled)s.push(`The class \u201C${l.class}\u201D is still drawn and no rule styles it now.`);let a=l=>l.root?Ze(l.root).map(n=>n.name):[],o=e.root&&t.root?Ke(c.sectionsMissing.map(l=>l.name),a(e),a(t),i):c.sectionsMissing.map(l=>l.name);for(let l of o)s.push(`\u201C${l}\u201D is not drawn any more.`);return s}function sn(e,t,i,d,c,s){let a=d.drawing(),o=an({source:e,css:t.css,root:t.root,height:t.height},{source:c,css:a.css,root:a.root,height:a.height},s);for(let l of d.refused())i.includes(l)||o.push(l);return o}function ln({ask:e,close:t}){let{ai:i,aiDesk:d,aiHere:c,session:s,principal:a,keptViews:o,store:l}=We(),[n,g]=(0,p.useState)(e.section),r=_e(e.section),y=(0,p.useRef)(Fe(r)),b=(0,p.useRef)(null),[f,C]=(0,p.useState)(e.mode==="highlight"?{at:"highlighting"}:{at:"open"}),B=(0,p.useRef)(void 0),K=(0,p.useRef)(null),G=(0,p.useRef)(null),h=(0,p.useRef)([]),L=(0,p.useRef)([]),$=(0,p.useRef)([]),pe=(0,p.useRef)(Date.now()),W=(0,p.useRef)(null),te=(0,p.useRef)(null),ne=(0,p.useRef)(null),[ft,fe]=(0,p.useState)(!1),[me,re]=(0,p.useState)(!1),[,mt]=(0,p.useState)(0),oe=(0,p.useCallback)(()=>mt(u=>u+1),[]),[Te,ht]=(0,p.useState)(null),Re=(0,p.useRef)(null),A=(0,p.useCallback)(u=>{let w=Re.current;w&&i.told&&Ee.load().then(v=>v.changeTelling(i.told,w.id,{outcome:u}),()=>{})},[i.told]),De=(0,p.useCallback)((u,w,v,D,k,ye)=>{let ie=i.told;ie&&Ee.load().then(H=>{let Z=H.keepTelling(ie,{words:u,target:{on:"place",place:w.view},decided:v?{type:"refusal"}:{type:"view",section:w.name},slot:"full",stages:D.map(z=>({stage:z.stage==="thinking"?"full":"light",ms:z.ms,model:z.model})),ms:k,outcome:v?"abandoned":"previewed",interaction:ye},a);Re.current=Z??null,ht(Z??null)},()=>{})},[i.told,a]);(0,p.useEffect)(()=>()=>{W.current?.abort(),b.current?.dispose(),b.current=null},[]);let Me=f.at==="working";(0,p.useEffect)(()=>{if(Me)return c({participant:`agent:graview-for-${a.id??"anyone"}:${s}`,kind:"agent",name:"Graview",...a.id?{onBehalfOf:a.id}:{},over:null,robot:{at:null,mode:"thinking"}}),()=>c(null)},[Me]);let X=(0,p.useCallback)((u,w,v,D={})=>({id:qe(),at:new Date().toISOString(),by:a,target:{on:"place",place:n.view},targetLabel:y.current?.title??n.view,ask:{kind:"section",said:u},offered:[],outcome:w,stages:v.map(k=>({stage:k.stage,ms:k.ms,model:k.model})),usage:v.flatMap(k=>k.usage?[{tier:k.stage==="light"?"fast":"thinking",model:k.model,inputTokens:k.usage.inputTokens,outputTokens:k.usage.outputTokens}]:[]),...D}),[a,n.view]),F=(0,p.useCallback)(async u=>{b.current?.dispose();let v=y.current.draft(u);return b.current=v,await v.drawn,v},[]),U=(0,p.useCallback)(async()=>{let u=h.current.at(-1);re(!1),u?await F(u.source):(b.current?.dispose(),b.current=null)},[F]),E=(0,p.useCallback)((u,w)=>{L.current.push({who:u,said:w}),oe()},[oe]),Q=()=>L.current.filter(u=>u.who==="person").map(u=>u.said).join(" "),ae=(0,p.useCallback)(async u=>{let w=y.current;if(!w||f.at==="working")return;let v=te.current;te.current=null,v&&(ne.current=v),E("person",u),$.current=[],pe.current=Date.now(),C({at:"working"});let D=await w.source();if(D===void 0)return E("graview","This view can't be changed here."),C({at:"open"});B.current??=D;let k=w.drawing(),ye=w.refused(),ie=S=>{let q=l.graph.getNode(S);return q?$e(l.schema.tryDefinition(q.kind),q):void 0};K.current??=de(k.root?.parentElement??k.root??r,tt(k.root,ie)),G.current??=nt(n.elements);let H=K.current,Z=G.current,z=new AbortController;W.current=z;let kt=Date.now(),St=h.current.length,R=await Je({ai:i,part:{name:n.name,slot:"place"},manifest:{name:w.name,attach:"view",cardinality:"many"},talk:L.current,keep:{title:"",headings:H.headings,records:H.records.map(S=>S.label),says:Object.fromEntries(H.records.flatMap(S=>S.facts?.length||S.under?[[S.label,{...S.facts?.length?{shows:S.facts}:{},...S.under?{under:S.under}:{}}]]:[]))},current:h.current.at(-1)?.source??D,section:n.name,rewordable:Z,noun:"records",...ne.current?{about:ne.current}:{},host:{look:()=>xe(de(w.drawing().root?.parentElement??r,H.records.map(S=>S.label))),read:()=>({shows:rn(n.elements)}),draft:async S=>{fe(!0);try{let q=await w.check(S);if(q.length>0)return await U(),{findings:q,drew:void 0};let we=await F(S),{failed:Le}=await we.drawn;if(Le)return await U(),{findings:[`The view did not draw: ${Le}`],drew:void 0};await new Promise(_=>requestAnimationFrame(()=>requestAnimationFrame(_)));let Oe=we.drawing().root,be=de(Oe?.parentElement??Oe,H.records.map(_=>_.label)),xt=w.presses?await w.presses(S).catch(()=>{}):void 0,Ne={asked:Q(),mayReword:Z},Be=[...sn(B.current,k,ye,we,S,Ne),...Ge(H,be,Ne),...(xt?.problems??[]).slice(0,5).map(_=>`${_.control}: ${_.says}`)];return Be.length>0?await U():(h.current.push({source:S,said:Xe(n.name,H,be)??`\u201C${n.name}\u201D has changed. Compare Before and After.`,entry:X(`Make \u201C${n.name}\u201D better: ${Q()}`,"offered",[])}),re(!1)),{findings:Be,drew:xe(be)}}finally{fe(!1)}}},onEvent:S=>{$.current.at(-1)?.kind==="streaming"&&$.current.pop(),$.current.push(S),oe()},signal:z.signal});if(W.current!==z)return;W.current=null,$.current.at(-1)?.kind==="streaming"&&$.current.pop();let se=h.current.length>St,Ie=X(`Make \u201C${n.name}\u201D better: ${Q()}`,se?"offered":"failed",R.stages,se?{}:{failed:R.last?.findings.join(" ")??R.said});if(d.record(Ie),De(Q(),n,!se,R.stages,Date.now()-kt,Ie.id),E("graview",R.passed&&Qe.test(R.said)?"Here it is on the page.":R.said),R.ended==="stuck"&&!se)return C({at:"stuck",...R.keepable&&R.last?{source:R.last.source}:{}});C(h.current.length>0?{at:"draft"}:{at:"open"})},[i,d,F,X,f.at,r,oe,E,n,U,l,De]),he=(0,p.useCallback)(()=>{if(f.at!=="working")return;let u=W.current;W.current=null,u?.abort(),fe(!1);let w=new Date(pe.current).toISOString();h.current=h.current.filter(v=>v.entry.at<w),U(),E("graview","Stopped. The view is as it was."),C(h.current.length>0?{at:"draft"}:{at:"open"})},[f.at,E,U]),Ae=(0,p.useRef)(!1);(0,p.useEffect)(()=>{Ae.current||!(e.mode==="just"||e.mode==="describe"&&e.words)||(Ae.current=!0,ae(e.mode==="just"?"Make it easier to read at a glance":e.words))},[e.mode,e.words,ae]);let J=h.current.at(-1),yt=(0,p.useCallback)(async u=>{!J||u===me||(re(u),u?(b.current?.dispose(),b.current=null):await F(J.source))},[J,me,F]),He=(0,p.useCallback)(async u=>{u!==void 0&&f.at==="stuck"&&h.current.push({source:u,said:`\u201C${n.name}\u201D kept as it was last drafted.`,entry:X(`Make \u201C${n.name}\u201D better: ${Q()}`,"offered",[])});let w=h.current.at(-1);if(f.at!=="draft"&&!(u!==void 0&&f.at==="stuck")||!w||!o?.revise||!y.current)return;let v=y.current,D=await v.source()??"";C({at:"keeping"});try{let k=await o.revise({name:v.name,title:v.title,source:w.source,before:D,section:n.name,said:w.said});b.current?.dispose(),b.current=null,v.draw(w.source),d.record({...w.entry,outcome:"accepted"}),A("accepted"),h.current=[],C({at:"kept",source:D,...k&&k.note?{note:k.note}:{},answer:k,entry:w.entry})}catch{if(E("graview","It couldn't be kept."),u!==void 0)return h.current.pop(),C(h.current.length>0?{at:"draft"}:{at:"open"});C({at:"draft"})}},[f,o,d,n.name,A,E,X]),wt=(0,p.useCallback)(()=>{E("graview","Stopped. The view is as it was."),C(h.current.length>0?{at:"draft"}:{at:"open"})},[E]),bt=(0,p.useCallback)(()=>{b.current?.dispose(),b.current=null;let u=h.current.at(-1);u&&(d.record({...u.entry,outcome:"dismissed"}),A("declined")),h.current=[],re(!1),E("graview","Put back as it was."),C({at:"open"})},[d,A,E]),vt=(0,p.useCallback)(async()=>{if(f.at!=="kept"||!y.current)return;let u=y.current,w=await u.source()??"";try{f.answer&&typeof f.answer.undo=="function"?await f.answer.undo():await o?.revise?.({name:u.name,title:u.title,source:f.source,before:w,section:n.name,said:"Put back as it was.",undoes:!0}),u.draw(f.source===B.current?void 0:f.source),d.record({...f.entry,outcome:"dismissed"}),A("undone"),E("graview","Undone. The view is as it was."),C({at:"undone"})}catch{E("graview","It couldn't be put back.")}},[f,o,d,n.name,A,E]);return(0,p.useEffect)(()=>{let u=w=>{if(!(w.key!=="Escape"||f.at==="highlighting")){if(w.preventDefault(),f.at==="working")return he();h.current.length>0&&A("declined"),t(),e.returnTo?.focus?.()}};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[f.at,he,t,A,e.returnTo]),f.at==="highlighting"?(0,x.jsx)(dn,{box:r,root:r?.querySelector("[data-worker-view]")?.shadowRoot?.querySelector("[data-graview-view-root]")??void 0,whole:n.elements,cancel:()=>C({at:"open"}),chose:u=>{let w=u[0],v=w?Ue(w):void 0;g(v??n),te.current={name:Ye(u)??Ve(u.map(ut)),lines:je(u.map(ut))},C({at:"open"})}}):(0,x.jsxs)(x.Fragment,{children:[n.elements.length>0&&f.at==="open"&&L.current.length===0?(0,x.jsx)(Ce,{elements:n.elements}):null,ft?(0,x.jsx)(rt,{over:r,name:n.name,said:`Graview is drafting \u201C${n.name}\u201D\u2026`}):null,(0,x.jsx)(st,{name:n.name,scope:`This changes how \u201C${n.name}\u201D looks for everyone in this app.`,phase:f.at,talk:L.current,steps:$.current,since:pe.current,working:f.at==="working"||f.at==="keeping",...J&&f.at==="draft"?{draft:{said:J.said,before:me}}:{},...f.at==="kept"?{kept:{...f.note?{note:f.note}:{},undo:()=>void vt()}}:{},...f.at==="stuck"?{stuck:{...f.source!==void 0?{keepAnyway:()=>void He(f.source)}:{},stop:wt}}:{},about:(te.current??ne.current)?.name??n.name,ask:u=>void ae(u),just:()=>void ae("Make it easier to read at a glance"),point:()=>C({at:"highlighting"}),stop:he,compare:u=>void yt(u),keep:()=>void He(),discard:bt,close:()=>{W.current?.abort(),h.current.length>0&&A("declined"),t()},children:Te&&i.told&&f.at!=="working"?(0,x.jsx)(Zt,{told:i.told,telling:Te}):null})]})}function dn({box:e,root:t,whole:i,wholeSaid:d="The whole section",cancel:c,chose:s}){let a=(0,p.useRef)(null),[o,l]=(0,p.useState)(null);(0,p.useLayoutEffect)(()=>{let r=0,y=()=>{let b=e?le([e]):null,f=a.current;f&&b&&(f.style.left=`${Math.round(b.left-ge)}px`,f.style.top=`${Math.round(b.top-ge)}px`,f.style.width=`${Math.round(b.width+2*ge)}px`,f.style.height=`${Math.round(b.height+2*ge)}px`),r=requestAnimationFrame(y)};return y(),()=>cancelAnimationFrame(r)},[e]),(0,p.useEffect)(()=>{a.current?.focus()},[]);let n=r=>{if(!o||!t)return l(null);let y=Math.hypot(r.clientX-o.x0,r.clientY-o.y0)>4,b={left:Math.min(o.x0,r.clientX),top:Math.min(o.y0,r.clientY),right:Math.max(o.x0,r.clientX),bottom:Math.max(o.y0,r.clientY)};l(null);let f=on(t,b,!y);f.length>0&&s(f)},g=o?{left:Math.min(o.x0,o.x1),top:Math.min(o.y0,o.y1),width:Math.abs(o.x1-o.x0),height:Math.abs(o.y1-o.y0)}:null;return(0,x.jsxs)("div",{ref:a,tabIndex:-1,role:"application","aria-label":"Highlight the area to change: drag over it, or click one part","data-testid":"section-highlighter","data-graview-popover":"",onKeyDown:r=>{r.key==="Escape"&&(r.preventDefault(),r.stopPropagation(),c())},onMouseDown:r=>r.preventDefault(),onPointerDown:r=>{r.preventDefault(),r.currentTarget.setPointerCapture?.(r.pointerId),l({x0:r.clientX,y0:r.clientY,x1:r.clientX,y1:r.clientY})},onPointerMove:r=>l(y=>y&&{...y,x1:r.clientX,y1:r.clientY}),onPointerUp:n,onPointerCancel:()=>l(null),style:wn,children:[(0,x.jsxs)("p",{style:bn,children:["Drag over the part to change, or click one \xB7"," ",(0,x.jsx)("button",{type:"button",onPointerDown:r=>r.stopPropagation(),onClick:()=>s(i),style:gt,children:d})," ","\xB7"," ",(0,x.jsx)("button",{type:"button",onPointerDown:r=>r.stopPropagation(),onClick:c,style:gt,children:"Cancel"})]}),g?(0,x.jsx)("div",{"data-testid":"section-drag",style:{...vn,left:g.left-(a.current?.getBoundingClientRect().left??0),top:g.top-(a.current?.getBoundingClientRect().top??0),width:g.width,height:g.height}}):null]})}var cn={position:"fixed",zIndex:O("popover"),boxSizing:"border-box",display:"grid",gap:10,padding:12,borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-float, var(--graview-panel))",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",maxHeight:"calc(100dvh - 24px)",overflowY:"auto",fontSize:"0.875rem"},un={margin:0,fontSize:"0.9375rem"},gn={margin:0,color:"var(--graview-ink-muted)"},pn={margin:0,color:"var(--graview-ink)",fontStyle:"italic"},fn={display:"flex",flexWrap:"wrap",gap:8},mn={boxSizing:"border-box",width:"100%",height:36,padding:"0 10px",font:"inherit",fontSize:"max(1rem,16px)",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:8},pt={minHeight:36,padding:"0 14px",font:"inherit",borderRadius:8,cursor:"pointer"},hn={...pt,color:"var(--graview-accent-ink, #fff)",background:"var(--graview-accent)",border:"1px solid var(--graview-accent)"},yn={...pt,color:"var(--graview-ink)",background:"transparent",border:"1px solid var(--graview-edge)"},gt={font:"inherit",color:"inherit",background:"none",border:0,padding:0,textDecoration:"underline",cursor:"pointer"},ge=12,wn={userSelect:"none",WebkitUserSelect:"none",position:"fixed",zIndex:O("popover"),boxSizing:"border-box",cursor:"crosshair",touchAction:"none",outline:"2px dashed var(--graview-accent)",background:"color-mix(in srgb, var(--graview-accent) 6%, transparent)"},bn={position:"absolute",left:8,top:8,margin:0,padding:"4px 10px",borderRadius:999,fontSize:"0.8125rem",color:"var(--graview-ink)",background:"var(--graview-float, var(--graview-panel))",border:"1px solid var(--graview-edge)",boxShadow:"var(--graview-lift-low)",cursor:"default"},vn={position:"absolute",border:"2px solid var(--graview-accent)",background:"color-mix(in srgb, var(--graview-accent) 14%, transparent)",borderRadius:4,pointerEvents:"none"},jn={CARD:cn,HEAD:un,MUTED:gn,THINKING:pn,ROW:fn,FIELD:mn,PRIMARY:hn,QUIET:yn};export{de as a,rt as b,st as c,_n as d,Vn as e,ut as f,an as g,ln as h,dn as i,jn as j};
@@ -1 +0,0 @@
1
- import{a as b,b as c,c as d,d as e,e as f,f as g}from"./chunk.XSWSBTUO.js";import{a}from"./chunk.TBY5IR7C.js";import"./chunk.BIDL7GQD.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.6SJEZWH3.js";import"./chunk.6N4PE3U5.js";import"./chunk.WALVW3KJ.js";import"./chunk.SNHKYH72.js";import"./chunk.UGQYMN4J.js";import"./chunk.RG5G6YQD.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as PROPOSE_CHANGE,c as documentOfApp,a as mayChangeDeclaration,g as proposeReshape,e as readReshape,f as reshapeCard,d as reshapeQuestions};
@@ -1 +0,0 @@
1
- import{b as f}from"./chunk.QXLJGHMC.js";import"./chunk.DZMIYEHQ.js";import"./chunk.3GNT5MKP.js";import"./chunk.AJMVRFYX.js";import"./chunk.Q355UPFG.js";import{o as g}from"./chunk.GMLONS5L.js";import"./chunk.264PB572.js";import"./chunk.6NG76MDA.js";import"./chunk.35KMZHB7.js";import"./chunk.IAEGJDF3.js";import"./chunk.YZPESGCP.js";import"./chunk.SY5ID44D.js";import"./chunk.GVT4UUQA.js";import"./chunk.5R744JGZ.js";import"./chunk.O2OL6RQQ.js";import"./chunk.J6HF7IRQ.js";import"./chunk.LRNFE3UK.js";import"./chunk.MB7LKKUD.js";import"./chunk.T2OUHRAA.js";import"./chunk.GRFD42WM.js";import"./chunk.EP6Q32WT.js";import"./chunk.QAM76AXV.js";import"./chunk.Z27NSSYL.js";import"./chunk.PZ7KY6XH.js";import"./chunk.WEMUKZKH.js";import"./chunk.T27QKVKP.js";import"./chunk.LP2ZMAT2.js";import"./chunk.BJUUSIQY.js";import"./chunk.MSAYU25L.js";import"./chunk.EGPCVMDU.js";import"./chunk.XOZU4OFA.js";import"./chunk.H3EGBDW2.js";import"./chunk.WVUJXDXZ.js";import"./chunk.DWM7AR5Y.js";import"./chunk.6KJGRM7A.js";import"./chunk.WALVW3KJ.js";import"./chunk.SNHKYH72.js";import"./chunk.UGQYMN4J.js";import"./chunk.RG5G6YQD.js";import"./chunk.MIE4TJRW.js";import"./chunk.QRQ5WPZI.js";import"./chunk.RD2FSSLV.js";import"./chunk.37RFCHSS.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import{G as b,W as h}from"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import{ue as n}from"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var m=t(b(),1),a=t(h(),1);function P({store:c,auto:y,brand:i,views:u,presence:s,steering:r,overview:o,scope:d,titleLevel:w=2,quickAsk:l,props:e}){let v=(0,m.useMemo)(()=>g({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:y?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:v}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(f,{context:{store:c,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...o?{overview:o}:{},titleLevel:w,views:u,settings:e.app.settings??[],app:e.app,...s?{presence:s}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.timeZone?{timeZone:e.timeZone}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},dismissals:e.dismissals,whileAway:e.whileAway,...e.signIn?{signIn:e.signIn}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...r?{steering:r}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.hrefOf?{hrefOf:e.hrefOf}:e.routing==="address"?{}:{hrefOf:!1},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{P as PagesContent};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i}from"./chunk.SFBHPYRD.js";import"./chunk.ILJDLBPJ.js";import"./chunk.X226YATK.js";import"./chunk.BJUUSIQY.js";import"./chunk.MSAYU25L.js";import"./chunk.QF5QB5YR.js";import"./chunk.EGPCVMDU.js";import"./chunk.M7KXQGQL.js";import"./chunk.XOZU4OFA.js";import"./chunk.H3EGBDW2.js";import"./chunk.6KJGRM7A.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{i as GhostTray,h as InlineAiMenu,g as askAgain,c as askInline,a as askOf,b as drawPanel,d as heldSuggestion,e as suggestOnce,f as takeOffer};
@@ -1 +0,0 @@
1
- import{k as a,l as o}from"./chunk.IAEGJDF3.js";import"./chunk.YZPESGCP.js";import"./chunk.SY5ID44D.js";import"./chunk.GVT4UUQA.js";import"./chunk.O2OL6RQQ.js";import"./chunk.J6HF7IRQ.js";import"./chunk.LRNFE3UK.js";import"./chunk.EP6Q32WT.js";import"./chunk.QAM76AXV.js";import"./chunk.Z27NSSYL.js";import"./chunk.WEMUKZKH.js";import"./chunk.T27QKVKP.js";import"./chunk.WVUJXDXZ.js";import"./chunk.DWM7AR5Y.js";import"./chunk.6KJGRM7A.js";import"./chunk.WALVW3KJ.js";import"./chunk.SNHKYH72.js";import"./chunk.UGQYMN4J.js";import"./chunk.RG5G6YQD.js";import"./chunk.MIE4TJRW.js";import"./chunk.QRQ5WPZI.js";import"./chunk.RD2FSSLV.js";import"./chunk.37RFCHSS.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import{ya as n}from"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function p(e,i){let t=w.get(e);t||w.set(e,t=new Map);let r=t.get(i);return r||t.set(i,r=a(o(e,n(e)),e,i)),r}export{p as frameworkViews};
@@ -1 +0,0 @@
1
- import{d as b,e as c,f as d,g as e,h as f,i as g,j as h}from"./chunk.HB5NWHFP.js";import"./chunk.OCXY5DCD.js";import{s as a}from"./chunk.B5SJMCTT.js";import"./chunk.NYLKG25K.js";import"./chunk.TBY5IR7C.js";import"./chunk.ILJDLBPJ.js";import"./chunk.X226YATK.js";import"./chunk.BJUUSIQY.js";import"./chunk.M7KXQGQL.js";import"./chunk.XOZU4OFA.js";import"./chunk.H3EGBDW2.js";import"./chunk.6KJGRM7A.js";import"./chunk.MIE4TJRW.js";import"./chunk.QRQ5WPZI.js";import"./chunk.RD2FSSLV.js";import"./chunk.37RFCHSS.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{g as Highlighter,h as LOOK,f as SectionCard,b as SectionDrawn,a as SectionOutline,e as drawingFindings,c as placeBeside,d as readPart};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk.STPA7HBK.js";import"./chunk.6NG76MDA.js";import"./chunk.35KMZHB7.js";import"./chunk.DEKRFTRN.js";import"./chunk.BKYZSV2Y.js";import"./chunk.IAEGJDF3.js";import"./chunk.YZPESGCP.js";import"./chunk.SY5ID44D.js";import"./chunk.GVT4UUQA.js";import"./chunk.5R744JGZ.js";import"./chunk.O2OL6RQQ.js";import"./chunk.J6HF7IRQ.js";import"./chunk.LRNFE3UK.js";import"./chunk.HJCQ6I3S.js";import"./chunk.YCD4JSXD.js";import"./chunk.ZG5VGP5U.js";import"./chunk.EP6Q32WT.js";import"./chunk.QAM76AXV.js";import"./chunk.Z27NSSYL.js";import"./chunk.WEMUKZKH.js";import"./chunk.T27QKVKP.js";import"./chunk.URQTF5SY.js";import"./chunk.BIDL7GQD.js";import"./chunk.LP2ZMAT2.js";import"./chunk.MSAYU25L.js";import"./chunk.EGPCVMDU.js";import"./chunk.H3EGBDW2.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.6SJEZWH3.js";import"./chunk.6N4PE3U5.js";import"./chunk.B7KZBT27.js";import"./chunk.WVUJXDXZ.js";import"./chunk.DWM7AR5Y.js";import"./chunk.6KJGRM7A.js";import"./chunk.WALVW3KJ.js";import"./chunk.SNHKYH72.js";import"./chunk.UGQYMN4J.js";import"./chunk.RG5G6YQD.js";import"./chunk.MIE4TJRW.js";import"./chunk.QRQ5WPZI.js";import"./chunk.RD2FSSLV.js";import"./chunk.37RFCHSS.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};
@@ -1 +0,0 @@
1
- import{a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p}from"./chunk.5R744JGZ.js";import{a,b}from"./chunk.O2OL6RQQ.js";import"./chunk.J6HF7IRQ.js";import"./chunk.LRNFE3UK.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{j as ARRANGE_NARROW,o as ArrangeBar,e as CHIP_FIELDS,d as MANY_AT_THE_FAR_END,c as TYPED_FROM,p as arrangementCaption,a as arrangementOf,i as chipOffers,m as directionWords,g as farCount,f as farCounts,l as inSentence,h as offeredFilters,n as preloadArrangeLists,k as sayCondition,b as withArrangement};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk.BKYZSV2Y.js";import"./chunk.LP2ZMAT2.js";import"./chunk.H3EGBDW2.js";import"./chunk.DWM7AR5Y.js";import"./chunk.6KJGRM7A.js";import"./chunk.WALVW3KJ.js";import"./chunk.SNHKYH72.js";import"./chunk.UGQYMN4J.js";import"./chunk.RG5G6YQD.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{g as columnActs,d as columnChoices,c as columnMoves,b as columnOf,e as columnReach,f as columnSteps,j as describePlace,k as placeText,h as resolveFor,i as shadowedPageSlots,a as statusColumns};
@@ -1 +0,0 @@
1
- import{a as b,b as c,c as d,d as e,e as f}from"./chunk.6SJEZWH3.js";import"./chunk.6N4PE3U5.js";import"./chunk.WALVW3KJ.js";import"./chunk.UGQYMN4J.js";import"./chunk.RG5G6YQD.js";import{Nb as a}from"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{a as ActRefusal,e as compileDocumentWithoutCheck,d as effectsOf,f as inDocumentWords,c as kindShapes,b as readDocument};
@@ -1 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{G as k,La as o,W as n}from"./chunk.A5PSEU3W.js";import{a as t}from"./chunk.SDO3U72B.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.DWM7AR5Y.js","./chunk.6KJGRM7A.js","./chunk.WALVW3KJ.js","./chunk.SNHKYH72.js","./chunk.UGQYMN4J.js","./chunk.RG5G6YQD.js","./chunk.MIE4TJRW.js","./chunk.QRQ5WPZI.js","./chunk.RD2FSSLV.js","./chunk.37RFCHSS.js","./chunk.SO6NT5K7.js","./chunk.MUSMNKE4.js","./chunk.SJQPTDAT.js","./chunk.JQ63N4MZ.js","./chunk.Z3O2VZAJ.js","./chunk.QNP5OR3P.js","./chunk.4W57E7AX.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HN4ZJ4B4.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.MIE4TJRW.js","./chunk.QRQ5WPZI.js","./chunk.RD2FSSLV.js","./chunk.37RFCHSS.js","./chunk.SO6NT5K7.js","./chunk.MUSMNKE4.js","./chunk.SJQPTDAT.js","./chunk.JQ63N4MZ.js","./chunk.Z3O2VZAJ.js","./chunk.QNP5OR3P.js","./chunk.4W57E7AX.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.FRQSLWP4.js")))),I=d.part((e,r)=>e.drawLinkedRecord(r),{quiet:!0}),w=d.part((e,r)=>e.drawLinkedPicker(r),{what:"Picking a linked record"});var s=p(n(),1),m=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.MIE4TJRW.js","./chunk.QRQ5WPZI.js","./chunk.RD2FSSLV.js","./chunk.37RFCHSS.js","./chunk.SO6NT5K7.js","./chunk.MUSMNKE4.js","./chunk.SJQPTDAT.js","./chunk.JQ63N4MZ.js","./chunk.Z3O2VZAJ.js","./chunk.QNP5OR3P.js","./chunk.4W57E7AX.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.Z2XUVJAL.js")))),g=m.part((e,r)=>(0,s.jsx)(e.RepeatPicker,{...r}),{quiet:!0}),E=m.part((e,r)=>(0,s.jsx)(e.RepeatEditor,{...r}),{quiet:!0});var a=p(k(),1),i=p(n(),1),c=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.SO6NT5K7.js","./chunk.MUSMNKE4.js","./chunk.SJQPTDAT.js","./chunk.JQ63N4MZ.js","./chunk.Z3O2VZAJ.js","./chunk.QNP5OR3P.js","./chunk.4W57E7AX.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ARWO4WOV.js")))),l=c.part((e,r)=>(0,i.jsx)(e.WhenInput,{...r}),{quiet:!0});function M(e){return(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)("span",{"data-graview-when-arriving":"",style:{display:"inline-block",minHeight:24}}),children:(0,i.jsx)(l,{...e})})}var N=()=>c.load().then(()=>{},()=>{});export{y as a,I as b,w as c,g as d,E as e,M as f,N as g};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk.EFVSZKB5.js";import"./chunk.G3GFDVO2.js";import"./chunk.D4WJ7OM5.js";import"./chunk.QDVGHI7R.js";import"./chunk.AKJS2NUM.js";import"./chunk.M5FP4Y4Q.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{d as SAVE_DEBOUNCE_MS,i as accepts,a as createPressReader,f as createSaver,g as fillPrefills,h as judgePress,b as markPresses,k as prefillOf,c as quietPictures,e as saveDebounceOf,j as writesBack};