graview 0.1.63 → 0.1.65

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 (225) hide show
  1. package/dist/preview/chunk.2P34ML3O.js +111 -0
  2. package/dist/preview/{chunk.A2R53GWF.js → chunk.2PK335JQ.js} +1 -1
  3. package/dist/preview/{chunk.NIAM7OTV.js → chunk.2QQ37RCZ.js} +1 -1
  4. package/dist/preview/{chunk.FGDGTES4.js → chunk.2TZSLREX.js} +2 -2
  5. package/dist/preview/chunk.2UW5CRHF.js +1 -0
  6. package/dist/preview/{chunk.H7AH3IW4.js → chunk.2YMO7ZVX.js} +1 -1
  7. package/dist/preview/chunk.33ULA3CG.js +1 -0
  8. package/dist/preview/{chunk.HMMK7LCL.js → chunk.35E75QJ7.js} +1 -1
  9. package/dist/preview/chunk.3CJLAJXP.js +25 -0
  10. package/dist/preview/chunk.3IJSB5ET.js +1 -0
  11. package/dist/preview/{chunk.OM2NIQWA.js → chunk.3IZEZPJB.js} +1 -1
  12. package/dist/preview/chunk.3KO35VN4.js +1 -0
  13. package/dist/preview/{chunk.Q2EGESEZ.js → chunk.3KUYB5ZT.js} +1 -1
  14. package/dist/preview/chunk.3RFAUIGT.js +1 -0
  15. package/dist/preview/{chunk.Q4GJIJAU.js → chunk.3WP66LB5.js} +1 -1
  16. package/dist/preview/{chunk.2RASWDMQ.js → chunk.44ZHHPPJ.js} +2 -2
  17. package/dist/preview/chunk.4GJ7F4SP.js +35 -0
  18. package/dist/preview/{chunk.4MEQUUG4.js → chunk.4IJTPV5X.js} +1 -1
  19. package/dist/preview/{chunk.DWK3GXRR.js → chunk.4JFBLVXJ.js} +1 -1
  20. package/dist/preview/{chunk.XUXZW7DU.js → chunk.4O3C2LJF.js} +1 -1
  21. package/dist/preview/chunk.4PCVQEVI.js +1 -0
  22. package/dist/preview/{chunk.WBS7ND2C.js → chunk.5FQSYMAE.js} +1 -1
  23. package/dist/preview/chunk.5M34BJIQ.js +1 -0
  24. package/dist/preview/chunk.5NCLZ4NZ.js +1 -0
  25. package/dist/preview/{chunk.36OE6RKG.js → chunk.5THLLSS4.js} +1 -1
  26. package/dist/preview/chunk.5YNLFOBJ.js +5 -0
  27. package/dist/preview/{chunk.DZSZUX34.js → chunk.64FCAUAJ.js} +1 -1
  28. package/dist/preview/chunk.6RZHKQP3.js +1 -0
  29. package/dist/preview/chunk.6YDC6IDA.js +1 -0
  30. package/dist/preview/{chunk.BN7C5ZYX.js → chunk.74B6KQF4.js} +1 -1
  31. package/dist/preview/chunk.77XQEDT5.js +1 -0
  32. package/dist/preview/chunk.7E4CSXBT.js +1 -0
  33. package/dist/preview/chunk.7HPQI5SY.js +1 -0
  34. package/dist/preview/{chunk.Y4ZM75WL.js → chunk.7IGD2K4M.js} +1 -1
  35. package/dist/preview/{chunk.2F4AZZQR.js → chunk.7Q43N5JS.js} +1 -1
  36. package/dist/preview/{chunk.KB5BCW23.js → chunk.7VQ3C7F4.js} +1 -1
  37. package/dist/preview/{chunk.MT5DXJKN.js → chunk.A4VA3DU5.js} +1 -1
  38. package/dist/preview/{chunk.6Z2GHQQH.js → chunk.AB4RZSYW.js} +31 -23
  39. package/dist/preview/chunk.ABSY3UZF.js +1 -0
  40. package/dist/preview/chunk.ARHAD5IS.js +1 -0
  41. package/dist/preview/chunk.BOC2EOGB.js +9 -0
  42. package/dist/preview/chunk.BR6TINGU.js +1 -0
  43. package/dist/preview/{chunk.B5PJCYBU.js → chunk.BU5PVRX7.js} +1 -1
  44. package/dist/preview/{chunk.PDMX3GTL.js → chunk.BUQKRXI6.js} +1 -1
  45. package/dist/preview/{chunk.RUFYORIJ.js → chunk.C437FVD7.js} +1 -1
  46. package/dist/preview/chunk.CD6YWH6T.js +3 -0
  47. package/dist/preview/chunk.CDEAAWPS.js +1 -0
  48. package/dist/preview/{chunk.XUO67YMT.js → chunk.CGQ6KXVK.js} +1 -1
  49. package/dist/preview/{chunk.WYPCLZL7.js → chunk.CPYBJNHP.js} +1 -1
  50. package/dist/preview/{chunk.FXCQJPN4.js → chunk.CS72MISN.js} +2 -2
  51. package/dist/preview/chunk.CXJJB3MK.js +1 -0
  52. package/dist/preview/{chunk.CAXILB7K.js → chunk.CXLQPE4J.js} +1 -1
  53. package/dist/preview/{chunk.REUMBCSV.js → chunk.DA4RSHLW.js} +1 -1
  54. package/dist/preview/{chunk.YXAKHXYB.js → chunk.DICM56FT.js} +1 -1
  55. package/dist/preview/{chunk.ZSGDVNVN.js → chunk.DJMSXXP4.js} +1 -1
  56. package/dist/preview/{chunk.ZY7US4Y7.js → chunk.DJPNVXBQ.js} +1 -1
  57. package/dist/preview/chunk.DJVHKBEI.js +1 -0
  58. package/dist/preview/chunk.E5WJSTOV.js +1 -0
  59. package/dist/preview/{chunk.KPQLM4TM.js → chunk.F2TWV4TX.js} +1 -1
  60. package/dist/preview/chunk.F5VEHAP2.js +1 -0
  61. package/dist/preview/{chunk.GHN62OMG.js → chunk.FDWRH5P2.js} +1 -1
  62. package/dist/preview/chunk.FEGSYSA7.js +1 -0
  63. package/dist/preview/{chunk.T3JIZNE7.js → chunk.FHHVW2WB.js} +1 -1
  64. package/dist/preview/chunk.FOSY7MZF.js +2 -0
  65. package/dist/preview/{chunk.ZZAI57VI.js → chunk.FXG5AJF6.js} +1 -1
  66. package/dist/preview/{chunk.K7TK3KRB.js → chunk.G3Q5IMM3.js} +1 -1
  67. package/dist/preview/{chunk.KXFNRJ46.js → chunk.GPCKOYSF.js} +1 -1
  68. package/dist/preview/{chunk.YOUB3J3Y.js → chunk.HJS3LTSR.js} +1 -1
  69. package/dist/preview/chunk.HJUXC5GM.js +1 -0
  70. package/dist/preview/chunk.HNMSYQRA.js +1 -0
  71. package/dist/preview/chunk.HWLRKOI3.js +1 -0
  72. package/dist/preview/{chunk.BQM3YAMR.js → chunk.IFBGYFS4.js} +1 -1
  73. package/dist/preview/chunk.IHUMKFYH.js +10 -0
  74. package/dist/preview/{chunk.AW26EETU.js → chunk.IJ3YDBWI.js} +1 -1
  75. package/dist/preview/{chunk.SMHP2CQH.js → chunk.IMKD6QQG.js} +1 -1
  76. package/dist/preview/{chunk.75GENXGP.js → chunk.INTJD5WG.js} +1 -1
  77. package/dist/preview/chunk.IQ54QTA5.js +1 -0
  78. package/dist/preview/{chunk.MIE3ODQ2.js → chunk.IQC3GOXO.js} +1 -1
  79. package/dist/preview/{chunk.2PJ6STKA.js → chunk.IR4OW67N.js} +1 -1
  80. package/dist/preview/{chunk.72YXFJKC.js → chunk.ISN2QTVL.js} +1 -1
  81. package/dist/preview/{chunk.Q4MI53KK.js → chunk.J24YPQ5I.js} +5 -5
  82. package/dist/preview/chunk.J545NAMY.js +1 -0
  83. package/dist/preview/{chunk.57YDGGJK.js → chunk.J6KNEI5R.js} +1 -1
  84. package/dist/preview/chunk.K3JARAWU.js +1 -0
  85. package/dist/preview/{chunk.MY5HJW2Z.js → chunk.KHAVEYT7.js} +1 -1
  86. package/dist/preview/{chunk.STDJ6XG5.js → chunk.KIQXTQDU.js} +1 -1
  87. package/dist/preview/chunk.KROR65KD.js +2 -0
  88. package/dist/preview/chunk.KV7GZBJ6.js +50 -0
  89. package/dist/preview/{chunk.CGK2PY76.js → chunk.L6FGKJ5H.js} +1 -1
  90. package/dist/preview/chunk.L7NJLZWV.js +1 -0
  91. package/dist/preview/{chunk.HOFATBGD.js → chunk.LGRQDILY.js} +1 -1
  92. package/dist/preview/{chunk.IEDCFSN5.js → chunk.LKK5YF2H.js} +1 -1
  93. package/dist/preview/chunk.LON75VHP.js +1 -0
  94. package/dist/preview/chunk.LQWVJQ5X.js +18 -0
  95. package/dist/preview/{chunk.PDS4HT46.js → chunk.LVD3V77M.js} +1 -1
  96. package/dist/preview/{chunk.JIEDJEHK.js → chunk.LY5CY7GE.js} +1 -1
  97. package/dist/preview/{chunk.OXWOUE3W.js → chunk.M5W2RHC6.js} +1 -1
  98. package/dist/preview/chunk.M6BTLH24.js +1 -0
  99. package/dist/preview/chunk.MAGKI4PD.js +1 -0
  100. package/dist/preview/chunk.MD36ZSM5.js +74 -0
  101. package/dist/preview/chunk.MFZJVHWP.js +1 -0
  102. package/dist/preview/{chunk.VCTAFSZ5.js → chunk.MH46V556.js} +1 -1
  103. package/dist/preview/chunk.MHTA4HYB.js +19 -0
  104. package/dist/preview/{chunk.QSPLKCTX.js → chunk.N2FNHRI2.js} +1 -1
  105. package/dist/preview/chunk.N2YM247R.js +1 -0
  106. package/dist/preview/chunk.N35SJWAM.js +1 -0
  107. package/dist/preview/chunk.NBVPWLRY.js +3 -0
  108. package/dist/preview/{chunk.NEPQBMFT.js → chunk.NKYYDFIX.js} +1 -1
  109. package/dist/preview/chunk.NSO6RUKW.js +1 -0
  110. package/dist/preview/{chunk.OIMGD7FR.js → chunk.O2W5JTWA.js} +1 -1
  111. package/dist/preview/chunk.OHMHPTEW.js +1 -0
  112. package/dist/preview/{chunk.XBYJCGPU.js → chunk.P6TZGR3A.js} +1 -1
  113. package/dist/preview/{chunk.KQPKYWDM.js → chunk.PTQPS2FJ.js} +1 -1
  114. package/dist/preview/chunk.PV2I4UPH.js +1 -0
  115. package/dist/preview/chunk.QFQSSZN7.js +1 -0
  116. package/dist/preview/{chunk.OTSBF367.js → chunk.QO5RXOCS.js} +2 -2
  117. package/dist/preview/{chunk.VZDHRY3U.js → chunk.QSDBF7VL.js} +1 -1
  118. package/dist/preview/{chunk.V4HVFLFQ.js → chunk.R2TSTDS3.js} +1 -1
  119. package/dist/preview/{chunk.34DRUCH2.js → chunk.RFVOXX3P.js} +1 -1
  120. package/dist/preview/chunk.RSS6OHXG.js +1 -0
  121. package/dist/preview/{chunk.XYGNS637.js → chunk.S2DOVJRL.js} +1 -1
  122. package/dist/preview/chunk.S3EEY7T3.js +1 -0
  123. package/dist/preview/chunk.SBCAYTMT.js +1 -0
  124. package/dist/preview/chunk.SMTGRCMG.js +3 -0
  125. package/dist/preview/{chunk.NTC2H5ZX.js → chunk.SOMRYDDH.js} +1 -1
  126. package/dist/preview/{chunk.4EXC26LI.js → chunk.SPCAMQJE.js} +1 -1
  127. package/dist/preview/{chunk.SGPXYDSG.js → chunk.T3KNLP7C.js} +1 -1
  128. package/dist/preview/chunk.TBY5IR7C.js +1 -0
  129. package/dist/preview/chunk.TCZIZ2PU.js +1 -0
  130. package/dist/preview/{chunk.PWAP2GJS.js → chunk.TUCSUZNO.js} +1 -1
  131. package/dist/preview/{chunk.DIFIHNR3.js → chunk.TY74U3EI.js} +1 -1
  132. package/dist/preview/chunk.U74PTRHJ.js +1 -0
  133. package/dist/preview/chunk.UAORKZLO.js +1 -0
  134. package/dist/preview/chunk.UDVTPI2W.js +1 -0
  135. package/dist/preview/{chunk.OMRQTLI5.js → chunk.UETLP5KC.js} +1 -1
  136. package/dist/preview/chunk.UHI3X2YD.js +1 -0
  137. package/dist/preview/chunk.UL62ELNR.js +1 -0
  138. package/dist/preview/chunk.VRYSZYAD.js +1 -0
  139. package/dist/preview/{chunk.CI4RZL4Z.js → chunk.VUZFLDOX.js} +1 -1
  140. package/dist/preview/chunk.X2NGFOAF.js +1 -0
  141. package/dist/preview/chunk.XE762VL2.js +2 -0
  142. package/dist/preview/{chunk.QS32TO4N.js → chunk.XSWR5LI4.js} +1 -1
  143. package/dist/preview/{chunk.JVDPRQ7J.js → chunk.XTTESA7X.js} +1 -1
  144. package/dist/preview/chunk.Y2RZ5B4U.js +1 -0
  145. package/dist/preview/chunk.Y7QDQ3WF.js +1 -0
  146. package/dist/preview/{chunk.O3YIWIVQ.js → chunk.YKMBXMZE.js} +1 -1
  147. package/dist/preview/chunk.Z34KASY7.js +1 -0
  148. package/dist/preview/{chunk.XCWZFLIB.js → chunk.ZDUTEM3Z.js} +1 -1
  149. package/dist/preview/{chunk.EJ4MSVX2.js → chunk.ZJFXM3LE.js} +1 -1
  150. package/dist/preview/chunk.ZMGKWMID.js +1 -0
  151. package/dist/preview/{chunk.AHPYNDVA.js → chunk.ZMWAZACO.js} +1 -1
  152. package/dist/preview/chunk.ZT5YQSSP.js +21 -0
  153. package/dist/preview/{chunk.B46UZHGW.js → chunk.ZTN7BS5O.js} +1 -1
  154. package/dist/preview/{chunk.HRNNRA2I.js → chunk.ZYNC73DJ.js} +1 -1
  155. package/dist/preview/chunk.ZZM75ZTN.js +4 -0
  156. package/dist/preview/index.html +56 -56
  157. package/dist/preview/page.js +2 -2
  158. package/dist/preview/splash.js +3 -3
  159. package/package.json +6 -6
  160. package/dist/preview/chunk.24HNOLUS.js +0 -3
  161. package/dist/preview/chunk.25CQCCLN.js +0 -1
  162. package/dist/preview/chunk.26H33GJC.js +0 -50
  163. package/dist/preview/chunk.2KIWGQXC.js +0 -2
  164. package/dist/preview/chunk.33XNYHI6.js +0 -1
  165. package/dist/preview/chunk.37FLKAVZ.js +0 -1
  166. package/dist/preview/chunk.3JCHJLH6.js +0 -1
  167. package/dist/preview/chunk.3OQ6S6H4.js +0 -1
  168. package/dist/preview/chunk.47QEWSSE.js +0 -1
  169. package/dist/preview/chunk.4DAKQXDG.js +0 -1
  170. package/dist/preview/chunk.4TH3CGAZ.js +0 -1
  171. package/dist/preview/chunk.5GC4VAHU.js +0 -1
  172. package/dist/preview/chunk.5QXQ7PBI.js +0 -35
  173. package/dist/preview/chunk.6CSHRMJC.js +0 -1
  174. package/dist/preview/chunk.6HKWAHPT.js +0 -1
  175. package/dist/preview/chunk.6XHPBJ5F.js +0 -1
  176. package/dist/preview/chunk.6YK5E7ZQ.js +0 -4
  177. package/dist/preview/chunk.735AFUP5.js +0 -1
  178. package/dist/preview/chunk.ATDIDPKZ.js +0 -1
  179. package/dist/preview/chunk.AWUO3M5D.js +0 -1
  180. package/dist/preview/chunk.BF3EZCG3.js +0 -1
  181. package/dist/preview/chunk.BKQICGFW.js +0 -1
  182. package/dist/preview/chunk.C65EHQ7V.js +0 -1
  183. package/dist/preview/chunk.CCQMDZHO.js +0 -1
  184. package/dist/preview/chunk.CYTTZOYL.js +0 -25
  185. package/dist/preview/chunk.D5LOTCBU.js +0 -3
  186. package/dist/preview/chunk.DBFJVVWF.js +0 -1
  187. package/dist/preview/chunk.DDFRFSVN.js +0 -1
  188. package/dist/preview/chunk.E3XJMO7Q.js +0 -1
  189. package/dist/preview/chunk.EJ2WE764.js +0 -18
  190. package/dist/preview/chunk.ERPILTRY.js +0 -1
  191. package/dist/preview/chunk.FFXBDOKA.js +0 -1
  192. package/dist/preview/chunk.FNVGNISQ.js +0 -3
  193. package/dist/preview/chunk.G2JAYG2Z.js +0 -1
  194. package/dist/preview/chunk.H5SN46VK.js +0 -1
  195. package/dist/preview/chunk.HSMJHCR3.js +0 -1
  196. package/dist/preview/chunk.JNIDS66Z.js +0 -1
  197. package/dist/preview/chunk.JO3BBRSR.js +0 -1
  198. package/dist/preview/chunk.KL5H7KEV.js +0 -1
  199. package/dist/preview/chunk.KZUMXT5J.js +0 -74
  200. package/dist/preview/chunk.MAHNJO6U.js +0 -1
  201. package/dist/preview/chunk.MBB5A6BT.js +0 -1
  202. package/dist/preview/chunk.MENLUNM5.js +0 -1
  203. package/dist/preview/chunk.N3T2O6EW.js +0 -9
  204. package/dist/preview/chunk.NWWJNNEK.js +0 -2
  205. package/dist/preview/chunk.O67JXUVG.js +0 -1
  206. package/dist/preview/chunk.QAMW5QDT.js +0 -19
  207. package/dist/preview/chunk.R4HDKNT3.js +0 -88
  208. package/dist/preview/chunk.SJUXFPTI.js +0 -1
  209. package/dist/preview/chunk.SME4HD5I.js +0 -1
  210. package/dist/preview/chunk.SSAETRHR.js +0 -5
  211. package/dist/preview/chunk.T535ZLRM.js +0 -1
  212. package/dist/preview/chunk.UAVK54Z6.js +0 -1
  213. package/dist/preview/chunk.V6IL7CIZ.js +0 -1
  214. package/dist/preview/chunk.WNS5LEO5.js +0 -1
  215. package/dist/preview/chunk.WUVXIUA7.js +0 -1
  216. package/dist/preview/chunk.XCEZCOX4.js +0 -1
  217. package/dist/preview/chunk.XIW4SZHD.js +0 -1
  218. package/dist/preview/chunk.YZBJUAS6.js +0 -1
  219. package/dist/preview/chunk.Z2ZQJ3DD.js +0 -1
  220. package/dist/preview/chunk.ZELWW7UA.js +0 -21
  221. package/dist/preview/chunk.ZLTHWCKL.js +0 -2
  222. package/dist/preview/chunk.ZP7JEVVU.js +0 -1
  223. package/dist/preview/chunk.ZRH5X3MR.js +0 -1
  224. package/dist/preview/chunk.ZVG4FXJK.js +0 -1
  225. /package/dist/preview/{chunk.GZHZLJBF.js → chunk.MIE4TJRW.js} +0 -0
@@ -0,0 +1 @@
1
+ import"./chunk.MIE4TJRW.js";import{o as D}from"./chunk.CXJJB3MK.js";import"./chunk.OJGHDWI6.js";import"./chunk.74B6KQF4.js";import"./chunk.DA4RSHLW.js";import{a as $}from"./chunk.FOSY7MZF.js";import"./chunk.NBVPWLRY.js";import"./chunk.S3EEY7T3.js";import"./chunk.MD36ZSM5.js";import"./chunk.L6FGKJ5H.js";import{G as P,V as C}from"./chunk.3CJLAJXP.js";import"./chunk.SDO3U72B.js";import{Ua as w,Wa as R,_a as c,ba as S}from"./chunk.J24YPQ5I.js";import"./chunk.FQLNBIQ5.js";import{b as k}from"./chunk.AJZBJBMO.js";var m=k(P(),1);var e=k(C(),1),W=[["","Does not repeat"],["day","Daily"],["week","Weekly"],["month","Monthly"],["year","Yearly"]],E=r=>`${r}${r%100>=11&&r%100<=13?"th":["th","st","nd","rd"][r%10]??"th"}`,v={display:"flex",flexWrap:"wrap",gap:"6px 12px",alignItems:"center"};function N({value:r,onChange:d,start:p,label:s,name:l="repeat"}){let f=(0,m.useId)(),a=c(r)?r:void 0,i=typeof p=="string"&&/^\d{4}-\d{2}-\d{2}/.test(p)?p:void 0,u=i?w[new Date(`${i.slice(0,10)}T00:00:00Z`).getUTCDay()]:void 0,o=t=>{let n={...a??{every:"week"},...t};for(let b of Object.keys(n))n[b]===void 0&&delete n[b];d(n)},y=a?.every??"week",g=a?.on??(u?[u]:[]);return(0,e.jsxs)("fieldset",{"data-graview-part":"field","data-graview-field":"repeat","data-graview-repeat":l,style:{display:"grid",gap:8,border:"1px solid var(--graview-edge)",borderRadius:8,padding:"8px 12px",margin:0,minWidth:0},children:[(0,e.jsx)("legend",{"data-graview-part":"label",style:{padding:"0 4px"},children:s}),(0,e.jsxs)("div",{style:v,children:[(0,e.jsx)("label",{htmlFor:`${f}-every`,children:"Repeats"}),(0,e.jsx)("select",{id:`${f}-every`,name:`${l}.every`,value:a?.every??"",onChange:t=>{let n=t.target.value;d(n===""?void 0:{...a?.interval?{interval:a.interval}:{},...a?.until?{until:a.until}:{},every:n})},"data-graview-part":"control",children:W.map(([t,n])=>(0,e.jsx)("option",{value:t,children:n},t))}),a?(0,e.jsxs)("label",{style:v,children:["every",(0,e.jsx)("input",{type:"number",min:1,max:99,name:`${l}.interval`,"aria-label":`Every how many ${y}s`,value:a.interval??1,onChange:t=>o({interval:Number(t.target.value)>1?Math.min(99,Math.round(Number(t.target.value))):void 0}),style:{width:"4.5em"},"data-graview-part":"control"}),y,(a.interval??1)>1?"s":""]}):null]}),a?.every==="week"?(0,e.jsxs)("div",{role:"group","aria-label":"On",style:v,children:[(0,e.jsx)("span",{"aria-hidden":"true",children:"On"}),w.map((t,n)=>(0,e.jsxs)("label",{style:{display:"inline-flex",gap:4,alignItems:"center",minHeight:24},children:[(0,e.jsx)("input",{type:"checkbox",name:`${l}.on`,value:t,checked:g.includes(t),onChange:b=>{let h=w.filter(x=>x===t?b.target.checked:g.includes(x));o({on:h.length===0||h.length===1&&h[0]===u?void 0:h})}}),S(n,"short")]},t))]}):null,a?.every==="month"?(0,e.jsxs)("label",{style:v,children:["On",(0,e.jsxs)("select",{name:`${l}.on`,value:a.on?.[0]===-1?"last":"",onChange:t=>o({on:t.target.value==="last"?[-1]:void 0}),"data-graview-part":"control",children:[(0,e.jsx)("option",{value:"",children:i?`the ${E(Number(i.slice(8,10)))}`:"the same day"}),(0,e.jsx)("option",{value:"last",children:"the last day"})]})]}):null,a?(0,e.jsxs)("label",{style:v,children:["Until",(0,e.jsx)("input",{type:"date",name:`${l}.until`,value:a.until??"",onChange:t=>o({until:t.target.value||void 0}),"data-graview-part":"control"})]}):null,(0,e.jsx)("p",{"aria-live":"polite","data-graview-repeat-said":"",style:{margin:0,color:"var(--graview-ink-dim)",fontSize:"0.8125rem"},children:a?$(i??"",a):"Does not repeat"})]})}function K({nodeId:r,field:d,start:p,value:s,label:l}){let{fields:f,commit:a}=D(r),i=f.find(t=>t.field===R(d)&&t.takesValue&&t.open.length===0),[u,o]=(0,m.useState)(!1),[y,g]=(0,m.useState)(c(s)?s:void 0);return i?u?(0,e.jsxs)("form",{onSubmit:t=>{t.preventDefault(),o(!1),a(i,y??null)},style:{display:"grid",gap:6,marginTop:6},children:[(0,e.jsx)(N,{value:y,onChange:g,start:p,label:l,name:R(d)}),(0,e.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,e.jsx)("button",{type:"submit","data-graview-repeat-keep":d,children:"Keep"}),(0,e.jsx)("button",{type:"button",onClick:()=>o(!1),children:"Cancel"})]})]}):(0,e.jsx)("button",{type:"button","data-graview-repeat-open":d,onClick:()=>(g(c(s)?s:void 0),o(!0)),style:{marginInlineStart:8,fontSize:"0.75rem",padding:"1px 8px",borderRadius:999,minHeight:24},children:c(s)?"Change how it repeats":"Repeat\u2026"}):null}export{K as RepeatEditor,N as RepeatPicker};
@@ -1 +1 @@
1
- import{b as cn,c as un}from"./chunk.H7AH3IW4.js";import{j as x}from"./chunk.2KIWGQXC.js";import{c as Z}from"./chunk.D5LOTCBU.js";import{Ac as Q,Ed as dn,Mc as U,dc as on,ec as E,fb as V,ga as H,la as T,ma as K,mc as rn,na as en,nc as an,oa as tn,ra as sn,sa as J,ta as G}from"./chunk.Q4MI53KK.js";function fn(){return{name:"insight",derive({store:n,nodes:d,kindSelection:t}){let f=[],v=l=>T(n.schema.tryDefinition(l.kind),l);for(let l of d){if([...n.schema.edgeKinds].reduce((c,w)=>c+n.graph.out(l.id,w).length+n.graph.in(l.id,w).length,0)===0){f.push({id:`insight:island:${l.id}`,text:`${v(l)} is connected to nothing yet`,nodeIds:[l.id]});continue}for(let c of n.schema.edgeKinds){let w=n.graph.in(l.id,c).length;if(w<3)continue;let s=[...n.graph.allEdges()].filter(a=>a.kind===c),e=s.length;e>=4&&w/e>.6&&f.push({id:`insight:load:${l.id}:${c}`,text:`${v(l)} ${vn(n,s,c,w)}`,nodeIds:[l.id]})}}for(let l of t){if(n.graph.nodesOfKind(l).length>0)continue;let A=n.schema.definitions.filter(c=>c.kind!==l).filter(c=>Object.values(c.edges).some(w=>w.to!=="*"&&w.to.includes(l))).map(c=>c.plural??`${c.kind}s`);A.length>0&&f.push({id:`insight:gap:${l}`,text:`Nothing here yet, though ${A.join(" and ")} expect to connect to these`,nodeIds:[]})}return{observations:f}}}}function vn(n,d,t,f){let v=new Set(d.map(s=>n.graph.getNode(s.from)?.kind).filter(s=>s!==void 0)),l=v.size===1?[...v][0]:void 0,A=d.length,c=Z(n.schema,l??[...v][0]??"",t,"in"),w=s=>l?en(n.schema,l,s):String(s);return f===A?`${c}: all ${w(f)}`:`${c}: ${f} of the ${w(A)}`}function ln(n){let d=new Map;if(n.length===0)return d;let t=n.slice(-512),f=new Set;for(let l of t)l.undoes&&f.add(l.undoes);let v=n[n.length-1].seq;for(let l of t){if(!l.mutation||f.has(l.id))continue;let A=Math.pow(.5,(v-l.seq)/64);d.set(l.mutation.name,(d.get(l.mutation.name)??0)+A)}return d}function hn(n){return 8*(n/(n+1))}var bn=100;function gn(){return{name:"invariant",derive({store:n,selection:d,nodes:t,violations:f}){let v=s=>T(n.schema.tryDefinition(s.kind),s),l=new Set(d),A=f.filter(s=>s.nodeIds.some(e=>l.has(e))||s.subjectId!==void 0&&l.has(s.subjectId)),c=[],w=[];A.forEach((s,e)=>{w.push({id:`violation:${s.invariant}:${e}`,text:s.message,nodeIds:s.nodeIds}),s.repairs.forEach((a,h)=>{c.push({id:`invariant:${s.invariant}:${e}:${h}`,label:a.label,provider:"invariant",mutation:a.mutation,args:a.args??{},open:(a.missing??[]).map(m=>{let r=n.allMutations().find(g=>g.name===a.mutation);if(!r)return{name:m};let o=E(r.input).find(g=>g.name===m),k=o?o.kinds.includes("*")?n.graph.allNodes().map(g=>g.id):o.kinds.flatMap(g=>n.graph.nodesOfKind(g).map($=>$.id)):void 0;return{name:m,shape:x(r.input,m),...o?{kinds:o.kinds}:{},...k?{candidates:k}:{}}}),score:bn-h-(a.missing?.length??0),why:s.message,nodeIds:s.nodeIds,...s.subjectId===void 0?{}:{subjectId:s.subjectId}})})});for(let s of t){let e=n.allInvariants().filter(a=>{if(a.scope==="graph")return!1;let h=a.scope;return h.kind!==s.kind?!1:h.match?h.match(s):!0});e.length!==0&&(A.some(a=>a.subjectId===s.id||a.nodeIds.includes(s.id))||w.push({id:`holds:${s.id}`,text:`${v(s)} holds \u2014 nothing currently breaks ${e.length===1?"it":`any of its ${e.length} rules`}`,nodeIds:[s.id]}))}return{affordances:c,observations:w}}}}var X=40;function pn(){return{name:"schema",derive({store:n,selection:d,nodes:t,kindSelection:f,edgeSelection:v,principal:l}){let A=(e,a)=>l!==void 0&&!n.permits({name:e,args:a},l).ok,c=[];if(t.length===0&&v.length>0){for(let e of v){let a=n.graph.getNode(e.from),h=n.graph.getNode(e.to);if(!a||!h)continue;let m=un(n,e);m?.provisional&&c.push({id:`schema:edge:${Q}:${e.kind}:${e.from}:${e.to}`,label:"Keep this link",provider:"schema",mutation:Q,args:{kind:e.kind,from:e.from,to:e.to},open:[],score:64,why:cn(m),nodeIds:[e.from,e.to]});for(let r of n.allMutations()){let o=(r.connects??[]).includes(e.kind),k=(r.severs??[]).includes(e.kind);if(!o&&!k||r.derived?.relation!==void 0&&r.derived.kind!==a.kind)continue;let g={},$=[],j=E(r.input);for(let p of j){let S=p.kinds.includes("*")||p.kinds.includes(a.kind),P=p.kinds.includes("*")||p.kinds.includes(h.kind),y=S&&!j.some(I=>I!==p&&(I.kinds.includes(a.kind)||I.kinds.includes("*")));S&&!P?g[p.name]=e.from:P&&!S?g[p.name]=e.to:S&&P&&y?g[p.name]=e.from:$.push({name:p.name,kinds:p.kinds,candidates:[e.from,e.to],shape:x(r.input,p.name)})}for(let p of q(r.input,""))p in g||$.some(S=>S.name===p)||$.push({name:p,shape:x(r.input,p)});$.every(p=>p.optional===!0?!0:p.kinds!==void 0?(p.candidates?.length??0)>0:(p.candidates?.length??0)>0||p.shape!==void 0&&p.shape.type!=="unknown")&&(o&&!k&&$.length===0||c.push({id:`schema:edge:${r.name}:${e.kind}:${e.from}:${e.to}`,label:K(r),provider:"schema",mutation:r.name,args:g,open:$,...r.destructive?{destructive:!0}:{},score:(k?62:58)-$.length,why:`this line is "${Z(n.schema,n.graph.getNode(e.from)?.kind??"",e.kind,"out")}"`,nodeIds:[e.from,e.to]}))}}return{affordances:c}}if(t.length===0&&f.length>0){let e=new Set(f),a=[];for(let h of n.allMutations()){if(!(h.creates??[]).some(o=>e.has(o)))continue;let m=[];for(let o of E(h.input)){let k=o.kinds.includes("*")?n.graph.allNodes().map(g=>g.id):o.kinds.flatMap(g=>n.graph.nodesOfKind(g).map($=>$.id));m.push({name:o.name,kinds:o.kinds,candidates:k,shape:x(h.input,o.name),...o.optional?{optional:!0}:{}})}for(let o of q(h.input,""))m.some(k=>k.name===o)||m.push({name:o,shape:x(h.input,o)});if(!m.every(o=>o.optional===!0?!0:o.kinds!==void 0?(o.candidates?.length??0)>0:(o.candidates?.length??0)>0||o.shape!==void 0&&o.shape.type!=="unknown")&&!A(h.name,{})){let o=m.filter(k=>k.optional!==!0&&k.kinds!==void 0&&!k.kinds.includes("*")&&(k.candidates?.length??0)===0);if(o.length>0){let k=[...new Set(o.flatMap(g=>g.kinds??[]))].map(g=>J(G(n.schema.tryDefinition(g),g)));a.push({id:`schema:waits:${h.name}`,text:`"${h.title??h.name}" cannot begin until there is ${k.length===1?k[0]:`${k.slice(0,-1).join(", ")} and ${k[k.length-1]}`}.`,nodeIds:[]})}continue}c.push({id:`schema:add:${h.name}`,label:K(h),provider:"schema",mutation:h.name,args:{},open:m,score:X-m.length,why:`this makes ${(h.creates??[]).filter(o=>e.has(o)).map(o=>J(G(n.schema.tryDefinition(o),o))).join(", ")}`,nodeIds:[]})}return{affordances:c,observations:a}}if(t.length===0)return{};let w=new Set(t.map(e=>e.kind)),s=(e,a,h)=>{let m=[];for(let r of n.graph.allEdges()){if(!a.includes(r.kind))continue;let o=r.from===e?r.to:r.to===e?r.from:null;if(!o)continue;let k=n.graph.getNode(o);k&&(!h.includes("*")&&!h.includes(k.kind)||m.includes(o)||m.push(o))}return m};for(let e of n.allMutations()){let a=e.subject;if(!a||!(a.kinds==="*"?!0:[...w].every(u=>a.kinds.includes(u))))continue;let m=e.derived?.act;if((m==="archive"||m==="merge")&&t.some(u=>V(u))||m==="unarchive"&&!t.some(u=>V(u))||m==="leave-alone"&&t.every(u=>U(n,u.id))||m==="allow-tidying"&&!t.some(u=>U(n,u.id)))continue;let r=t.length===1?t[0].id:null,o=e.severs??[],k=e.connects??[];if(r&&o.length>0&&k.length===0&&s(r,o,["*"]).length===0)continue;let g=[];for(let u of E(e.input)){if(u.name===a.arg)continue;let p=u.kinds.includes("*")?n.graph.allNodes().map(S=>S.id):u.kinds.flatMap(S=>n.graph.nodesOfKind(S).map(P=>P.id));if(r&&k.length>0){let S=new Set(s(r,k,u.kinds));p=p.filter(P=>!S.has(P))}else r&&o.length>0&&(p=s(r,o,u.kinds));g.push({name:u.name,kinds:u.kinds,candidates:p.filter(S=>!d.includes(S)),shape:x(e.input,u.name),...u.optional?{optional:!0}:{}})}for(let u of q(e.input,a.arg))g.some(p=>p.name===u)||g.push({name:u,shape:x(e.input,u)});if(g.length===0&&r){let u=Sn(e.input,a.arg);if(u.length>0&&!wn(n,e.name,{[a.arg]:r}))for(let p of u){let S=E(e.input).find(P=>P.name===p);g.push({name:p,optional:!0,...S?{kinds:S.kinds}:{},shape:x(e.input,p)})}}if(!g.every(u=>u.optional===!0?!0:u.kinds!==void 0?(u.candidates?.length??0)>0:(u.candidates?.length??0)>0||u.shape!==void 0&&u.shape.type!=="unknown")&&!A(e.name,r?{[a.arg]:r}:{}))continue;let j=t.map(u=>({[a.arg]:u.id}));g.length===0&&!j.some(u=>n.wouldChange({name:e.name,args:u}))||c.push({id:`schema:${e.name}`,label:t.length>1?`${K(e)} (${t.length})`:K(e),provider:"schema",mutation:e.name,args:j[0]??{},open:g,...e.destructive?{destructive:!0}:{},...e.derived?.act==="archive"||e.derived?.act==="merge"||e.derived?.act==="leave-alone"||e.derived?.act==="allow-tidying"?{setsAside:!0}:{},...o.length>0||k.length>0?{ties:!0}:{},...t.length>1?{batch:j}:{},score:X-g.length,why:t.length>1?`all ${t.length} selected nodes are ${[...w].map(u=>tn(n.schema,u).toLowerCase()).join(" or ")}`:`this is ${J(G(n.schema.tryDefinition(t[0].kind),t[0].kind))}`,nodeIds:t.map(u=>u.id)})}if(t.length===1){let e=t[0];for(let a of n.allMutations()){let h=a.subject,m=a.severs??[],r=a.connects??[];if(!h||m.length===0&&r.length===0)continue;let o=h.kinds==="*"?"*":h.kinds;if(o==="*"||o.includes(e.kind))continue;let k=E(a.input),g=k.find(y=>y.name!==h.arg&&(y.kinds.includes("*")||y.kinds.includes(e.kind)));if(!g)continue;let $=o,j=$.includes("*")?n.graph.allNodes().map(y=>y.id):$.flatMap(y=>n.graph.nodesOfKind(y).map(I=>I.id)),u=new Set(s(e.id,r.length>0?r:m,$)),p=r.length>0?j.filter(y=>!u.has(y)):j.filter(y=>u.has(y));if(p.length===0)continue;let S=[{name:h.arg,kinds:$,candidates:p,shape:x(a.input,h.arg)}];for(let y of k){if(y.name===g.name||y.name===h.arg)continue;let I=y.kinds.includes("*")?n.graph.allNodes().map(L=>L.id):y.kinds.flatMap(L=>n.graph.nodesOfKind(L).map(O=>O.id));S.push({name:y.name,kinds:y.kinds,candidates:I,shape:x(a.input,y.name),...y.optional?{optional:!0}:{}})}for(let y of q(a.input,g.name))y===h.arg||S.some(I=>I.name===y)||S.push({name:y,shape:x(a.input,y)});S.every(y=>y.optional===!0?!0:y.kinds!==void 0?(y.candidates?.length??0)>0:(y.candidates?.length??0)>0||y.shape!==void 0&&y.shape.type!=="unknown")&&c.push({id:`schema:tie:${a.name}:${e.id}`,label:a.fromTheOtherEnd??K(a),provider:"schema",mutation:a.name,args:{[g.name]:e.id},open:S,ties:!0,...a.destructive?{destructive:!0}:{},score:X-S.length+2,why:`${m.length>0?"this one is on":"this one could join"} ${S[0].candidates.length===1?"it":"one of these"}`,nodeIds:[e.id]})}}return{affordances:c}}}}function Sn(n,d){let t=n.shape;return t?Object.entries(t).filter(([f,v])=>f!==d&&v.safeParse(void 0).success).map(([f])=>f):[]}function wn(n,d,t){try{return n.preview({name:d,args:t}),!0}catch{return!1}}function q(n,d){let t=n.shape;return t?Object.entries(t).filter(([f,v])=>f!==d&&!v.safeParse(void 0).success).map(([f])=>f):[]}var An=70,$n=80,On=new Set(["id","kind"]);function mn(){return{name:"structure",derive({store:n,nodes:d}){let t=c=>T(n.schema.tryDefinition(c.kind),c);if(d.length<2)return{};let f=[],v=[],l=d.map(c=>c.id);for(let c of n.schema.edgeKinds){let w=In(d.map(e=>new Set([...n.graph.out(e.id,c).map(a=>a.id),...n.graph.in(e.id,c).map(a=>a.id)])));for(let e of w){let a=n.graph.getNode(e);a&&f.push({id:`shared:${c}:${e}`,text:`all ${d.length} share "${t(a)}" (${H(c).toLowerCase()})`,nodeIds:[...l,e]})}let s=new Map;for(let e of d)for(let a of[...n.graph.out(e.id,c),...n.graph.in(e.id,c)])s.set(a.id,(s.get(a.id)??0)+1);for(let[e,a]of s){if(a!==d.length-1||d.length<3||l.includes(e))continue;let h=n.graph.getNode(e);if(!h)continue;let m=d.find(r=>![...n.graph.out(r.id,c),...n.graph.in(r.id,c)].some(o=>o.id===e));if(m&&(f.push({id:`near-shared:${c}:${e}`,text:`all but "${t(m)}" share "${t(h)}" (${H(c).toLowerCase()})`,nodeIds:[...l,e]}),!(!n.schema.edgeAllowed(c,m.kind,h.kind)&&!n.schema.edgeAllowed(c,h.kind,m.kind))))for(let r of n.allMutations()){let o=r.subject;if(!o||o.kinds!=="*"&&!o.kinds.includes(m.kind)||(r.connects!==void 0||r.severs!==void 0)&&!(r.connects??[]).includes(c))continue;let g=Pn(r.input,h.kind);g&&v.push({id:`structure:join:${r.name}:${m.id}:${e}`,label:`${K(r)}: bring "${t(m)}" in line with the others`,provider:"structure",mutation:r.name,args:{[o.arg]:m.id,[g]:e},open:[],score:An,why:`every other selected node is connected to "${t(h)}"`,nodeIds:[m.id,e]})}}}let A=new Map;for(let c of d)A.set(c.kind,[...A.get(c.kind)??[],c]);for(let[c,w]of A){if(w.length<2)continue;let s=w,e=w.map(r=>r.id),a=A.size>1?`${c}:`:"",h=new Set;for(let r of s)for(let o of Object.keys(r))On.has(o)||h.add(o);let m=r=>n.schema.definitions.find(o=>o.kind===r);for(let r of[...h].sort()){let o=m(s[0].kind),k=sn(o,r).toLowerCase(),g=o?.display?.format?.[r],$=O=>{if(!g)return O;try{return String(g(JSON.parse(O)))}catch{return O}},j=s.map(O=>O[r]),u=new Map;if(j.forEach((O,R)=>{let D=JSON.stringify(O??null),M=u.get(D);M?M.push(s[R]):u.set(D,[s[R]])}),u.size===1){let O=[...u.keys()][0];if(O==="null")continue;f.push({id:`agree:${a}${r}`,text:`all ${s.length} share the ${k} ${$(O)}`,nodeIds:e});continue}if(s.length<3||u.size!==2)continue;let p=[...u.entries()].sort((O,R)=>R[1].length-O[1].length),[S,P]=p[0],[,y]=p[1];if(y.length!==1||S==="null")continue;let I=y[0],L=JSON.parse(S);f.push({id:`odd-one-out:${a}${r}`,text:`${P.length} share the ${k} ${$(S)}; "${t(I)}" does not`,nodeIds:e});for(let O of n.allMutations()){let R=O.subject;if(!R||R.kinds!=="*"&&!R.kinds.includes(I.kind))continue;let D=kn(O.input);if(!D||!(r in D))continue;let M={[R.arg]:I.id,[r]:L},C=!0;for(let[W,z]of Object.entries(D)){if(W in M||z.safeParse(void 0).success)continue;let B=I[W];if(B===void 0){C=!1;break}M[W]=B}!C||!O.input.safeParse(M).success||v.push({id:`structure:align:${O.name}:${r}:${I.id}`,label:`Align the ${k} of "${t(I)}" with the other ${P.length}`,provider:"structure",mutation:O.name,args:M,open:[],score:$n,why:`${P.length} of ${s.length} share the ${k} ${$(S)}`,nodeIds:e})}}}return{affordances:v,observations:f}}}}function In(n){if(n.length===0)return[];let[d,...t]=n;return[...d].filter(f=>t.every(v=>v.has(f))).sort()}function kn(n){return n.shape??null}function Pn(n,d){let t=kn(n);if(!t)return null;for(let[f]of Object.entries(t)){let v=on(t[f]);if(v&&(v.includes("*")||v.includes(d)))return f}return null}function jn(){return[gn(),mn(),pn(),fn()]}function Xn(n,d,t={}){let f=yn(),v=t.providers??jn(),l=d.map(i=>n.graph.getNode(i)).filter(i=>i!==void 0),A={store:n,selection:d,nodes:l,kindSelection:t.kindSelection??[],edgeSelection:t.edgeSelection??[],violations:n.violations(t.context),context:t.context??{},principal:t.principal??{kind:"human"}},c=[],w=[];for(let i of v){let b=i.derive(A);c.push(...b.affordances??[]),w.push(...b.observations??[])}let s=new Map(n.allMutations().map(i=>[i.name,i]));c.forEach((i,b)=>{let N=i.open.length>1?s.get(i.mutation):void 0;N&&(c[b]={...i,open:an(i.open,rn(n.schema,N))})});let e=new Set(n.allMutations().filter(i=>i.pinned).map(i=>i.name)),a=new Set(t.pins?.pinned??[]),h=new Set(t.pins?.unpinned??[]),m=i=>a.has(i.mutation)?"user":e.has(i.mutation)&&!h.has(i.mutation)?"declared":void 0,r=i=>{let b=m(i);return b?{...i,pinned:b}:i},o=new Map;for(let[i,b]of ln(n.log.all()))o.set(i,hn(b));let k=i=>i.pinned==="user"?0:i.pinned==="declared"?1:2,g=i=>i.score+(o.get(i.mutation)??0),$=new Map(n.allMutations().map(i=>[i.name,i])),j=new Map,u=i=>{let b=$.get(i.mutation);if(!b)return[];let N=j.get(i.mutation);N||(N=E(b.input).map(F=>F.name),j.set(i.mutation,N));let _=[];for(let F of i.batch??[i.args])for(let Y of N){let nn=F[Y]??i.args[Y];typeof nn=="string"&&_.push(nn)}return _},p=t.focus,S=4,P=i=>i.open.length>0?1:0,y=i=>{if(p===void 0)return S;let b=u(i);return b.length>0?b.includes(p)?I(i,0):S:i.nodeIds.includes(p)||i.subjectId===p?I(i,1):S},I=(i,b)=>i.provider==="invariant"?b:2+P(i),L=i=>i.setsAside?1:0,O=Nn(c).map(r),R=new Map(O.map((i,b)=>[i,b])),D=O.sort((i,b)=>{let N=Number(i.destructive??!1)-Number(b.destructive??!1);if(N!==0)return N;let _=L(i)-L(b);if(_!==0)return _;let F=y(i)-y(b);return F!==0?F:y(i)<2?R.get(i)-R.get(b):+(b.provider==="invariant")-+(i.provider==="invariant")||k(i)-k(b)||g(b)-g(i)||i.id.localeCompare(b.id)}),M=t.principal??{kind:"human"},C=[],W=[];for(let i of D){let b=n.permits({name:i.mutation,args:{...i.args,...i.batch?.[0]??{}}},M);if(b.ok)C.push(i);else{let N=Rn(n,i,M);if(N==="done")continue;N?C.push(N):W.push({...i,refusal:b.refusal})}}let z=C.map((i,b)=>({...i,rank:b})),B=W.map((i,b)=>({...i,rank:C.length+b}));return{affordances:t.limit===void 0?z:z.slice(0,t.limit),withheld:B,observations:xn(w),ms:yn()-f}}function Nn(n){let d=new Map;for(let t of n){let f=[t.mutation,JSON.stringify(t.args),JSON.stringify(t.batch??null)].join("|"),v=d.get(f);(!v||t.score>v.score)&&d.set(f,t)}return[...d.values()]}function xn(n){let d=new Map;for(let t of n)d.set(t.text,t);return[...d.values()]}function yn(){return typeof performance<"u"?performance.now():Date.now()}function Yn(n,d,t={},f={}){let v=(d.batch??[d.args]).map(A=>({name:d.mutation,args:{...d.args,...A,...t}})),l=n.allMutations().find(A=>A.name===d.mutation);return n.applyAll(v,{...l?.describe?{}:{intent:d.label},...f.author?{author:f.author}:{}})}function ne(n,d,t={},f={}){try{return n.preview({name:d.mutation,args:{...d.args,...t}})}catch(v){throw f.pressed&&dn(v,f.pressed.author?.id),v}}function Rn(n,d,t){let f=n.allMutations().find(s=>s.name===d.mutation)?.subject,v=f!==void 0&&d.args[f.arg]===void 0,l=v?d.open.find(s=>s.name===f.arg):d.open.find(s=>s.name!==f?.arg&&s.candidates);if(!l?.candidates)return;let A=s=>n.permits({name:d.mutation,args:{...d.args,...d.batch?.[0]??{},[l.name]:s}},t).ok,c=l.candidates.filter(A),w=t.id===void 0?void 0:n.graph.getNode(t.id);if(c.length===0){let s=v?f.kinds:"*";return w!==void 0&&(s==="*"||s.includes(w.kind))&&A(w.id)?"done":void 0}return c.length===1&&c[0]===t.id?{...d,args:{...d.args,[l.name]:t.id},open:d.open.filter(s=>s!==l)}:{...d,open:d.open.map(s=>s===l?{...s,candidates:c}:s)}}export{Xn as a,Yn as b,ne as c};
1
+ import{b as cn,c as un}from"./chunk.2YMO7ZVX.js";import{j as x}from"./chunk.FOSY7MZF.js";import{b as Z}from"./chunk.NBVPWLRY.js";import{Ac as Q,Gd as dn,Mc as U,dc as on,ec as E,fb as V,ga as H,la as T,ma as K,mc as rn,na as en,nc as an,oa as tn,ra as sn,sa as J,ta as G}from"./chunk.J24YPQ5I.js";function fn(){return{name:"insight",derive({store:n,nodes:d,kindSelection:t}){let f=[],v=l=>T(n.schema.tryDefinition(l.kind),l);for(let l of d){if([...n.schema.edgeKinds].reduce((c,w)=>c+n.graph.out(l.id,w).length+n.graph.in(l.id,w).length,0)===0){f.push({id:`insight:island:${l.id}`,text:`${v(l)} is connected to nothing yet`,nodeIds:[l.id]});continue}for(let c of n.schema.edgeKinds){let w=n.graph.in(l.id,c).length;if(w<3)continue;let s=[...n.graph.allEdges()].filter(a=>a.kind===c),e=s.length;e>=4&&w/e>.6&&f.push({id:`insight:load:${l.id}:${c}`,text:`${v(l)} ${vn(n,s,c,w)}`,nodeIds:[l.id]})}}for(let l of t){if(n.graph.nodesOfKind(l).length>0)continue;let A=n.schema.definitions.filter(c=>c.kind!==l).filter(c=>Object.values(c.edges).some(w=>w.to!=="*"&&w.to.includes(l))).map(c=>c.plural??`${c.kind}s`);A.length>0&&f.push({id:`insight:gap:${l}`,text:`Nothing here yet, though ${A.join(" and ")} expect to connect to these`,nodeIds:[]})}return{observations:f}}}}function vn(n,d,t,f){let v=new Set(d.map(s=>n.graph.getNode(s.from)?.kind).filter(s=>s!==void 0)),l=v.size===1?[...v][0]:void 0,A=d.length,c=Z(n.schema,l??[...v][0]??"",t,"in"),w=s=>l?en(n.schema,l,s):String(s);return f===A?`${c}: all ${w(f)}`:`${c}: ${f} of the ${w(A)}`}function ln(n){let d=new Map;if(n.length===0)return d;let t=n.slice(-512),f=new Set;for(let l of t)l.undoes&&f.add(l.undoes);let v=n[n.length-1].seq;for(let l of t){if(!l.mutation||f.has(l.id))continue;let A=Math.pow(.5,(v-l.seq)/64);d.set(l.mutation.name,(d.get(l.mutation.name)??0)+A)}return d}function hn(n){return 8*(n/(n+1))}var bn=100;function gn(){return{name:"invariant",derive({store:n,selection:d,nodes:t,violations:f}){let v=s=>T(n.schema.tryDefinition(s.kind),s),l=new Set(d),A=f.filter(s=>s.nodeIds.some(e=>l.has(e))||s.subjectId!==void 0&&l.has(s.subjectId)),c=[],w=[];A.forEach((s,e)=>{w.push({id:`violation:${s.invariant}:${e}`,text:s.message,nodeIds:s.nodeIds}),s.repairs.forEach((a,h)=>{c.push({id:`invariant:${s.invariant}:${e}:${h}`,label:a.label,provider:"invariant",mutation:a.mutation,args:a.args??{},open:(a.missing??[]).map(m=>{let r=n.allMutations().find(g=>g.name===a.mutation);if(!r)return{name:m};let o=E(r.input).find(g=>g.name===m),k=o?o.kinds.includes("*")?n.graph.allNodes().map(g=>g.id):o.kinds.flatMap(g=>n.graph.nodesOfKind(g).map($=>$.id)):void 0;return{name:m,shape:x(r.input,m),...o?{kinds:o.kinds}:{},...k?{candidates:k}:{}}}),score:bn-h-(a.missing?.length??0),why:s.message,nodeIds:s.nodeIds,...s.subjectId===void 0?{}:{subjectId:s.subjectId}})})});for(let s of t){let e=n.allInvariants().filter(a=>{if(a.scope==="graph")return!1;let h=a.scope;return h.kind!==s.kind?!1:h.match?h.match(s):!0});e.length!==0&&(A.some(a=>a.subjectId===s.id||a.nodeIds.includes(s.id))||w.push({id:`holds:${s.id}`,text:`${v(s)} holds \u2014 nothing currently breaks ${e.length===1?"it":`any of its ${e.length} rules`}`,nodeIds:[s.id]}))}return{affordances:c,observations:w}}}}var X=40;function pn(){return{name:"schema",derive({store:n,selection:d,nodes:t,kindSelection:f,edgeSelection:v,principal:l}){let A=(e,a)=>l!==void 0&&!n.permits({name:e,args:a},l).ok,c=[];if(t.length===0&&v.length>0){for(let e of v){let a=n.graph.getNode(e.from),h=n.graph.getNode(e.to);if(!a||!h)continue;let m=un(n,e);m?.provisional&&c.push({id:`schema:edge:${Q}:${e.kind}:${e.from}:${e.to}`,label:"Keep this link",provider:"schema",mutation:Q,args:{kind:e.kind,from:e.from,to:e.to},open:[],score:64,why:cn(m),nodeIds:[e.from,e.to]});for(let r of n.allMutations()){let o=(r.connects??[]).includes(e.kind),k=(r.severs??[]).includes(e.kind);if(!o&&!k||r.derived?.relation!==void 0&&r.derived.kind!==a.kind)continue;let g={},$=[],j=E(r.input);for(let p of j){let S=p.kinds.includes("*")||p.kinds.includes(a.kind),P=p.kinds.includes("*")||p.kinds.includes(h.kind),y=S&&!j.some(I=>I!==p&&(I.kinds.includes(a.kind)||I.kinds.includes("*")));S&&!P?g[p.name]=e.from:P&&!S?g[p.name]=e.to:S&&P&&y?g[p.name]=e.from:$.push({name:p.name,kinds:p.kinds,candidates:[e.from,e.to],shape:x(r.input,p.name)})}for(let p of q(r.input,""))p in g||$.some(S=>S.name===p)||$.push({name:p,shape:x(r.input,p)});$.every(p=>p.optional===!0?!0:p.kinds!==void 0?(p.candidates?.length??0)>0:(p.candidates?.length??0)>0||p.shape!==void 0&&p.shape.type!=="unknown")&&(o&&!k&&$.length===0||c.push({id:`schema:edge:${r.name}:${e.kind}:${e.from}:${e.to}`,label:K(r),provider:"schema",mutation:r.name,args:g,open:$,...r.destructive?{destructive:!0}:{},score:(k?62:58)-$.length,why:`this line is "${Z(n.schema,n.graph.getNode(e.from)?.kind??"",e.kind,"out")}"`,nodeIds:[e.from,e.to]}))}}return{affordances:c}}if(t.length===0&&f.length>0){let e=new Set(f),a=[];for(let h of n.allMutations()){if(!(h.creates??[]).some(o=>e.has(o)))continue;let m=[];for(let o of E(h.input)){let k=o.kinds.includes("*")?n.graph.allNodes().map(g=>g.id):o.kinds.flatMap(g=>n.graph.nodesOfKind(g).map($=>$.id));m.push({name:o.name,kinds:o.kinds,candidates:k,shape:x(h.input,o.name),...o.optional?{optional:!0}:{}})}for(let o of q(h.input,""))m.some(k=>k.name===o)||m.push({name:o,shape:x(h.input,o)});if(!m.every(o=>o.optional===!0?!0:o.kinds!==void 0?(o.candidates?.length??0)>0:(o.candidates?.length??0)>0||o.shape!==void 0&&o.shape.type!=="unknown")&&!A(h.name,{})){let o=m.filter(k=>k.optional!==!0&&k.kinds!==void 0&&!k.kinds.includes("*")&&(k.candidates?.length??0)===0);if(o.length>0){let k=[...new Set(o.flatMap(g=>g.kinds??[]))].map(g=>J(G(n.schema.tryDefinition(g),g)));a.push({id:`schema:waits:${h.name}`,text:`"${h.title??h.name}" cannot begin until there is ${k.length===1?k[0]:`${k.slice(0,-1).join(", ")} and ${k[k.length-1]}`}.`,nodeIds:[]})}continue}c.push({id:`schema:add:${h.name}`,label:K(h),provider:"schema",mutation:h.name,args:{},open:m,score:X-m.length,why:`this makes ${(h.creates??[]).filter(o=>e.has(o)).map(o=>J(G(n.schema.tryDefinition(o),o))).join(", ")}`,nodeIds:[]})}return{affordances:c,observations:a}}if(t.length===0)return{};let w=new Set(t.map(e=>e.kind)),s=(e,a,h)=>{let m=[];for(let r of n.graph.allEdges()){if(!a.includes(r.kind))continue;let o=r.from===e?r.to:r.to===e?r.from:null;if(!o)continue;let k=n.graph.getNode(o);k&&(!h.includes("*")&&!h.includes(k.kind)||m.includes(o)||m.push(o))}return m};for(let e of n.allMutations()){let a=e.subject;if(!a||!(a.kinds==="*"?!0:[...w].every(u=>a.kinds.includes(u))))continue;let m=e.derived?.act;if((m==="archive"||m==="merge")&&t.some(u=>V(u))||m==="unarchive"&&!t.some(u=>V(u))||m==="leave-alone"&&t.every(u=>U(n,u.id))||m==="allow-tidying"&&!t.some(u=>U(n,u.id)))continue;let r=t.length===1?t[0].id:null,o=e.severs??[],k=e.connects??[];if(r&&o.length>0&&k.length===0&&s(r,o,["*"]).length===0)continue;let g=[];for(let u of E(e.input)){if(u.name===a.arg)continue;let p=u.kinds.includes("*")?n.graph.allNodes().map(S=>S.id):u.kinds.flatMap(S=>n.graph.nodesOfKind(S).map(P=>P.id));if(r&&k.length>0){let S=new Set(s(r,k,u.kinds));p=p.filter(P=>!S.has(P))}else r&&o.length>0&&(p=s(r,o,u.kinds));g.push({name:u.name,kinds:u.kinds,candidates:p.filter(S=>!d.includes(S)),shape:x(e.input,u.name),...u.optional?{optional:!0}:{}})}for(let u of q(e.input,a.arg))g.some(p=>p.name===u)||g.push({name:u,shape:x(e.input,u)});if(g.length===0&&r){let u=Sn(e.input,a.arg);if(u.length>0&&!wn(n,e.name,{[a.arg]:r}))for(let p of u){let S=E(e.input).find(P=>P.name===p);g.push({name:p,optional:!0,...S?{kinds:S.kinds}:{},shape:x(e.input,p)})}}if(!g.every(u=>u.optional===!0?!0:u.kinds!==void 0?(u.candidates?.length??0)>0:(u.candidates?.length??0)>0||u.shape!==void 0&&u.shape.type!=="unknown")&&!A(e.name,r?{[a.arg]:r}:{}))continue;let j=t.map(u=>({[a.arg]:u.id}));g.length===0&&!j.some(u=>n.wouldChange({name:e.name,args:u}))||c.push({id:`schema:${e.name}`,label:t.length>1?`${K(e)} (${t.length})`:K(e),provider:"schema",mutation:e.name,args:j[0]??{},open:g,...e.destructive?{destructive:!0}:{},...e.derived?.act==="archive"||e.derived?.act==="merge"||e.derived?.act==="leave-alone"||e.derived?.act==="allow-tidying"?{setsAside:!0}:{},...o.length>0||k.length>0?{ties:!0}:{},...t.length>1?{batch:j}:{},score:X-g.length,why:t.length>1?`all ${t.length} selected nodes are ${[...w].map(u=>tn(n.schema,u).toLowerCase()).join(" or ")}`:`this is ${J(G(n.schema.tryDefinition(t[0].kind),t[0].kind))}`,nodeIds:t.map(u=>u.id)})}if(t.length===1){let e=t[0];for(let a of n.allMutations()){let h=a.subject,m=a.severs??[],r=a.connects??[];if(!h||m.length===0&&r.length===0)continue;let o=h.kinds==="*"?"*":h.kinds;if(o==="*"||o.includes(e.kind))continue;let k=E(a.input),g=k.find(y=>y.name!==h.arg&&(y.kinds.includes("*")||y.kinds.includes(e.kind)));if(!g)continue;let $=o,j=$.includes("*")?n.graph.allNodes().map(y=>y.id):$.flatMap(y=>n.graph.nodesOfKind(y).map(I=>I.id)),u=new Set(s(e.id,r.length>0?r:m,$)),p=r.length>0?j.filter(y=>!u.has(y)):j.filter(y=>u.has(y));if(p.length===0)continue;let S=[{name:h.arg,kinds:$,candidates:p,shape:x(a.input,h.arg)}];for(let y of k){if(y.name===g.name||y.name===h.arg)continue;let I=y.kinds.includes("*")?n.graph.allNodes().map(L=>L.id):y.kinds.flatMap(L=>n.graph.nodesOfKind(L).map(O=>O.id));S.push({name:y.name,kinds:y.kinds,candidates:I,shape:x(a.input,y.name),...y.optional?{optional:!0}:{}})}for(let y of q(a.input,g.name))y===h.arg||S.some(I=>I.name===y)||S.push({name:y,shape:x(a.input,y)});S.every(y=>y.optional===!0?!0:y.kinds!==void 0?(y.candidates?.length??0)>0:(y.candidates?.length??0)>0||y.shape!==void 0&&y.shape.type!=="unknown")&&c.push({id:`schema:tie:${a.name}:${e.id}`,label:a.fromTheOtherEnd??K(a),provider:"schema",mutation:a.name,args:{[g.name]:e.id},open:S,ties:!0,...a.destructive?{destructive:!0}:{},score:X-S.length+2,why:`${m.length>0?"this one is on":"this one could join"} ${S[0].candidates.length===1?"it":"one of these"}`,nodeIds:[e.id]})}}return{affordances:c}}}}function Sn(n,d){let t=n.shape;return t?Object.entries(t).filter(([f,v])=>f!==d&&v.safeParse(void 0).success).map(([f])=>f):[]}function wn(n,d,t){try{return n.preview({name:d,args:t}),!0}catch{return!1}}function q(n,d){let t=n.shape;return t?Object.entries(t).filter(([f,v])=>f!==d&&!v.safeParse(void 0).success).map(([f])=>f):[]}var An=70,$n=80,On=new Set(["id","kind"]);function mn(){return{name:"structure",derive({store:n,nodes:d}){let t=c=>T(n.schema.tryDefinition(c.kind),c);if(d.length<2)return{};let f=[],v=[],l=d.map(c=>c.id);for(let c of n.schema.edgeKinds){let w=In(d.map(e=>new Set([...n.graph.out(e.id,c).map(a=>a.id),...n.graph.in(e.id,c).map(a=>a.id)])));for(let e of w){let a=n.graph.getNode(e);a&&f.push({id:`shared:${c}:${e}`,text:`all ${d.length} share "${t(a)}" (${H(c).toLowerCase()})`,nodeIds:[...l,e]})}let s=new Map;for(let e of d)for(let a of[...n.graph.out(e.id,c),...n.graph.in(e.id,c)])s.set(a.id,(s.get(a.id)??0)+1);for(let[e,a]of s){if(a!==d.length-1||d.length<3||l.includes(e))continue;let h=n.graph.getNode(e);if(!h)continue;let m=d.find(r=>![...n.graph.out(r.id,c),...n.graph.in(r.id,c)].some(o=>o.id===e));if(m&&(f.push({id:`near-shared:${c}:${e}`,text:`all but "${t(m)}" share "${t(h)}" (${H(c).toLowerCase()})`,nodeIds:[...l,e]}),!(!n.schema.edgeAllowed(c,m.kind,h.kind)&&!n.schema.edgeAllowed(c,h.kind,m.kind))))for(let r of n.allMutations()){let o=r.subject;if(!o||o.kinds!=="*"&&!o.kinds.includes(m.kind)||(r.connects!==void 0||r.severs!==void 0)&&!(r.connects??[]).includes(c))continue;let g=Pn(r.input,h.kind);g&&v.push({id:`structure:join:${r.name}:${m.id}:${e}`,label:`${K(r)}: bring "${t(m)}" in line with the others`,provider:"structure",mutation:r.name,args:{[o.arg]:m.id,[g]:e},open:[],score:An,why:`every other selected node is connected to "${t(h)}"`,nodeIds:[m.id,e]})}}}let A=new Map;for(let c of d)A.set(c.kind,[...A.get(c.kind)??[],c]);for(let[c,w]of A){if(w.length<2)continue;let s=w,e=w.map(r=>r.id),a=A.size>1?`${c}:`:"",h=new Set;for(let r of s)for(let o of Object.keys(r))On.has(o)||h.add(o);let m=r=>n.schema.definitions.find(o=>o.kind===r);for(let r of[...h].sort()){let o=m(s[0].kind),k=sn(o,r).toLowerCase(),g=o?.display?.format?.[r],$=O=>{if(!g)return O;try{return String(g(JSON.parse(O)))}catch{return O}},j=s.map(O=>O[r]),u=new Map;if(j.forEach((O,R)=>{let D=JSON.stringify(O??null),M=u.get(D);M?M.push(s[R]):u.set(D,[s[R]])}),u.size===1){let O=[...u.keys()][0];if(O==="null")continue;f.push({id:`agree:${a}${r}`,text:`all ${s.length} share the ${k} ${$(O)}`,nodeIds:e});continue}if(s.length<3||u.size!==2)continue;let p=[...u.entries()].sort((O,R)=>R[1].length-O[1].length),[S,P]=p[0],[,y]=p[1];if(y.length!==1||S==="null")continue;let I=y[0],L=JSON.parse(S);f.push({id:`odd-one-out:${a}${r}`,text:`${P.length} share the ${k} ${$(S)}; "${t(I)}" does not`,nodeIds:e});for(let O of n.allMutations()){let R=O.subject;if(!R||R.kinds!=="*"&&!R.kinds.includes(I.kind))continue;let D=kn(O.input);if(!D||!(r in D))continue;let M={[R.arg]:I.id,[r]:L},C=!0;for(let[W,z]of Object.entries(D)){if(W in M||z.safeParse(void 0).success)continue;let B=I[W];if(B===void 0){C=!1;break}M[W]=B}!C||!O.input.safeParse(M).success||v.push({id:`structure:align:${O.name}:${r}:${I.id}`,label:`Align the ${k} of "${t(I)}" with the other ${P.length}`,provider:"structure",mutation:O.name,args:M,open:[],score:$n,why:`${P.length} of ${s.length} share the ${k} ${$(S)}`,nodeIds:e})}}}return{affordances:v,observations:f}}}}function In(n){if(n.length===0)return[];let[d,...t]=n;return[...d].filter(f=>t.every(v=>v.has(f))).sort()}function kn(n){return n.shape??null}function Pn(n,d){let t=kn(n);if(!t)return null;for(let[f]of Object.entries(t)){let v=on(t[f]);if(v&&(v.includes("*")||v.includes(d)))return f}return null}function jn(){return[gn(),mn(),pn(),fn()]}function Xn(n,d,t={}){let f=yn(),v=t.providers??jn(),l=d.map(i=>n.graph.getNode(i)).filter(i=>i!==void 0),A={store:n,selection:d,nodes:l,kindSelection:t.kindSelection??[],edgeSelection:t.edgeSelection??[],violations:n.violations(t.context),context:t.context??{},principal:t.principal??{kind:"human"}},c=[],w=[];for(let i of v){let b=i.derive(A);c.push(...b.affordances??[]),w.push(...b.observations??[])}let s=new Map(n.allMutations().map(i=>[i.name,i]));c.forEach((i,b)=>{let N=i.open.length>1?s.get(i.mutation):void 0;N&&(c[b]={...i,open:an(i.open,rn(n.schema,N))})});let e=new Set(n.allMutations().filter(i=>i.pinned).map(i=>i.name)),a=new Set(t.pins?.pinned??[]),h=new Set(t.pins?.unpinned??[]),m=i=>a.has(i.mutation)?"user":e.has(i.mutation)&&!h.has(i.mutation)?"declared":void 0,r=i=>{let b=m(i);return b?{...i,pinned:b}:i},o=new Map;for(let[i,b]of ln(n.log.all()))o.set(i,hn(b));let k=i=>i.pinned==="user"?0:i.pinned==="declared"?1:2,g=i=>i.score+(o.get(i.mutation)??0),$=new Map(n.allMutations().map(i=>[i.name,i])),j=new Map,u=i=>{let b=$.get(i.mutation);if(!b)return[];let N=j.get(i.mutation);N||(N=E(b.input).map(F=>F.name),j.set(i.mutation,N));let _=[];for(let F of i.batch??[i.args])for(let Y of N){let nn=F[Y]??i.args[Y];typeof nn=="string"&&_.push(nn)}return _},p=t.focus,S=4,P=i=>i.open.length>0?1:0,y=i=>{if(p===void 0)return S;let b=u(i);return b.length>0?b.includes(p)?I(i,0):S:i.nodeIds.includes(p)||i.subjectId===p?I(i,1):S},I=(i,b)=>i.provider==="invariant"?b:2+P(i),L=i=>i.setsAside?1:0,O=Nn(c).map(r),R=new Map(O.map((i,b)=>[i,b])),D=O.sort((i,b)=>{let N=Number(i.destructive??!1)-Number(b.destructive??!1);if(N!==0)return N;let _=L(i)-L(b);if(_!==0)return _;let F=y(i)-y(b);return F!==0?F:y(i)<2?R.get(i)-R.get(b):+(b.provider==="invariant")-+(i.provider==="invariant")||k(i)-k(b)||g(b)-g(i)||i.id.localeCompare(b.id)}),M=t.principal??{kind:"human"},C=[],W=[];for(let i of D){let b=n.permits({name:i.mutation,args:{...i.args,...i.batch?.[0]??{}}},M);if(b.ok)C.push(i);else{let N=Rn(n,i,M);if(N==="done")continue;N?C.push(N):W.push({...i,refusal:b.refusal})}}let z=C.map((i,b)=>({...i,rank:b})),B=W.map((i,b)=>({...i,rank:C.length+b}));return{affordances:t.limit===void 0?z:z.slice(0,t.limit),withheld:B,observations:xn(w),ms:yn()-f}}function Nn(n){let d=new Map;for(let t of n){let f=[t.mutation,JSON.stringify(t.args),JSON.stringify(t.batch??null)].join("|"),v=d.get(f);(!v||t.score>v.score)&&d.set(f,t)}return[...d.values()]}function xn(n){let d=new Map;for(let t of n)d.set(t.text,t);return[...d.values()]}function yn(){return typeof performance<"u"?performance.now():Date.now()}function Yn(n,d,t={},f={}){let v=(d.batch??[d.args]).map(A=>({name:d.mutation,args:{...d.args,...A,...t}})),l=n.allMutations().find(A=>A.name===d.mutation);return n.applyAll(v,{...l?.describe?{}:{intent:d.label},...f.author?{author:f.author}:{}})}function ne(n,d,t={},f={}){try{return n.preview({name:d.mutation,args:{...d.args,...t}})}catch(v){throw f.pressed&&dn(v,f.pressed.author?.id),v}}function Rn(n,d,t){let f=n.allMutations().find(s=>s.name===d.mutation)?.subject,v=f!==void 0&&d.args[f.arg]===void 0,l=v?d.open.find(s=>s.name===f.arg):d.open.find(s=>s.name!==f?.arg&&s.candidates);if(!l?.candidates)return;let A=s=>n.permits({name:d.mutation,args:{...d.args,...d.batch?.[0]??{},[l.name]:s}},t).ok,c=l.candidates.filter(A),w=t.id===void 0?void 0:n.graph.getNode(t.id);if(c.length===0){let s=v?f.kinds:"*";return w!==void 0&&(s==="*"||s.includes(w.kind))&&A(w.id)?"done":void 0}return c.length===1&&c[0]===t.id?{...d,args:{...d.args,[l.name]:t.id},open:d.open.filter(s=>s!==l)}:{...d,open:d.open.map(s=>s===l?{...s,candidates:c}:s)}}export{Xn as a,Yn as b,ne as c};
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk.FDWRH5P2.js";import"./chunk.44ZHHPPJ.js";import"./chunk.ZDUTEM3Z.js";import"./chunk.ZZM75ZTN.js";import"./chunk.ISN2QTVL.js";import"./chunk.ARHAD5IS.js";import"./chunk.R2TSTDS3.js";import"./chunk.QSDBF7VL.js";import"./chunk.2PK335JQ.js";import"./chunk.MHTA4HYB.js";import"./chunk.BU5PVRX7.js";import"./chunk.3KUYB5ZT.js";import"./chunk.IMKD6QQG.js";import"./chunk.HJCQ6I3S.js";import"./chunk.ZJFXM3LE.js";import"./chunk.PTQPS2FJ.js";import"./chunk.IR4OW67N.js";import"./chunk.6RZHKQP3.js";import"./chunk.N35SJWAM.js";import"./chunk.L7NJLZWV.js";import"./chunk.QO5RXOCS.js";import"./chunk.XSWR5LI4.js";import"./chunk.BIDL7GQD.js";import"./chunk.XTTESA7X.js";import"./chunk.J6KNEI5R.js";import"./chunk.2YMO7ZVX.js";import"./chunk.5M34BJIQ.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.UHI3X2YD.js";import"./chunk.INTJD5WG.js";import"./chunk.2QQ37RCZ.js";import"./chunk.MIE4TJRW.js";import"./chunk.CXJJB3MK.js";import"./chunk.OJGHDWI6.js";import"./chunk.74B6KQF4.js";import"./chunk.WVUJXDXZ.js";import"./chunk.S2DOVJRL.js";import"./chunk.64FCAUAJ.js";import"./chunk.DA4RSHLW.js";import"./chunk.FOSY7MZF.js";import"./chunk.NBVPWLRY.js";import"./chunk.S3EEY7T3.js";import"./chunk.SPCAMQJE.js";import"./chunk.TUCSUZNO.js";import"./chunk.ZMWAZACO.js";import"./chunk.CD6YWH6T.js";import"./chunk.MD36ZSM5.js";import"./chunk.L6FGKJ5H.js";import"./chunk.3CJLAJXP.js";import"./chunk.SDO3U72B.js";import"./chunk.J24YPQ5I.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};
@@ -1 +1 @@
1
- import{b as yt}from"./chunk.NIAM7OTV.js";import{a as mt}from"./chunk.PWAP2GJS.js";import{f as pt}from"./chunk.AHPYNDVA.js";import{a as C,f as J}from"./chunk.FNVGNISQ.js";import{F as X,Id as dt,J as k,L as tt,T as q,W as nt,Y as et,Z as rt,ac as ct,ea as ot,ga as V,la as F,oa as at,qb as ut,ra as st,ta as it,tb as ft}from"./chunk.Q4MI53KK.js";import{e as lt}from"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function z(t){let e=[],n=!0;for(let r of t){if(r.text.length===0)continue;let o=r.as==="close"||r.text===","||r.text===":"||r.text.startsWith("'")||n;e.push({part:r,space:!o}),n=r.as==="open"}return e}function D(t,e){return z(t).map(({part:n,space:r})=>`${r?" ":""}${e?n.said??n.text:n.text}`).join("")}function Pt(t){return D(t,!1)}function Lt(t){return D(t,!0)}function gt(t,e=!1){let n=e?t.said:t.text;return t.record!==void 0?`${t.record} \u2014 ${n}`:n}function G(t){let e=l=>z(l).map(({part:a,space:s})=>({...a,space:s})),n=e(t.parts),r=t.when&&t.when.length>0?e(t.when):void 0,o=l=>`${D(n,l)}${r?`, when ${D(r,l)}`:""}`;return{...t,parts:n,...r?{when:r}:{},text:o(!1),said:o(!0)}}function jt(t,e=!1){return t.line?gt(t.line,e):t.message}var ht=60,b=t=>({text:t,as:"name"}),f=(t,e)=>e===void 0?{text:t,as:"word"}:{text:t,as:"word",said:e},P=(t,e)=>e===void 0||e===t?{text:t,as:"value"}:{text:t,as:"value",said:e},v=(t,e)=>({text:t,as:"op",said:e}),R={text:"(",as:"open"},w={text:")",as:"close"},W={text:"\u2014",as:"value",said:"empty"},M={">=":["\u2265","at least"],"<=":["\u2264","at most"],"<":["<","less than"],">":[">","more than"],"==":["=","is"],"!=":["\u2260","is not"]},B={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},At={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},bt=t=>t.t==="binary"&&t.op in M;function T(t){return ot(t)}function vt(t){let{schema:e}=t,n=i=>i===null?void 0:e.tryDefinition(i),r=(i,d)=>{let y=n(i)?.edges;return y&&Object.hasOwn(y,d)?y[d]:void 0},o=(i,d)=>{let y=r(i,d)?.to;return Array.isArray(y)&&y.length===1?y[0]:null},l=(i,d)=>{let y=(e.edge(d)?.from??[]).filter(j=>{let $=r(j,d)?.to;return i===null||$==="*"||Array.isArray($)&&$.includes(i)});return y.length===1?y[0]:null},a=(i,d)=>r(i,d)?V(d).toLowerCase():T(st(n(i),d)),s=i=>T(at(e,i)),m=i=>T(pt(e).get(i)?.label??V(i)),g=i=>T(it(n(i),i)),S=(i,d)=>{let y=i===null?void 0:t.formatOf?.(i,d);if(y?.format)return y;let j=t.said?.get(d);return j?{...y,format:j}:y},u=i=>F(e.tryDefinition(i.kind),i),p=t.money?.locale,h=(i,d)=>{if(i==null)return W;if(i instanceof C){if(i.nodes.length===0)return W;let L=i.nodes.slice(0,3).map(u),Q=i.nodes.length-L.length;return P(Q>0?`${L.join(", ")} and ${Q} more`:L.length>1?`${L.slice(0,-1).join(", ")} and ${L[L.length-1]}`:L[0])}if(Array.isArray(i))return P(`{${i.map(L=>h(L,d).text).join(", ")}}`,i.map(L=>h(L,d).text).join(" or "));if(typeof i=="object")return P(u(i));if(typeof i=="boolean")return P(i?"yes":"no");let y=d?.format??(d?S(d.kind,d.key):void 0);if(typeof i=="number")return P(y&&y.format!=="date"?ct(i,{...t.money,...y}):rt(i,p));if(X.test(i)||y?.format==="date")return P(q(et(i,t.money?.timeZone)??i.slice(0,10),p));if(k.test(i))return P(nt(i,p,t.money?.timeZone));let j=d&&d.kind!==null?n(d.kind)?.display?.format?.[d.key]:void 0;if(j)return P(j(i));let $=i.length>ht?`${i.slice(0,ht-1).trimEnd()}\u2026`:i;return P(/^[a-z][a-z0-9]*([-_][a-z0-9]+)*$/.test($)?$.replace(/[-_]+/g," "):$)};return{definition:n,relation:r,farOf:o,nearOf:l,fieldName:a,plural:s,noun:g,factName:m,formatOf:S,valueWords:h,locale:p}}function E(t,e,n){if(t.t==="ident")return{kind:e,key:t.name};if(t.t==="member")return{kind:O(t.object,e,n),key:t.name};if(t.t==="call"&&(t.fn==="sum"||t.fn==="min"||t.fn==="max")&&t.args.length===2){let r=O(t.args[0],e,n),o=t.args[1];if(o.t==="ident")return{kind:r,key:o.name};if(o.t==="lit"&&typeof o.value=="string")return{kind:r,key:o.value}}if(t.t==="binary"&&(t.op==="+"||t.op==="-"))return E(t.left,e,n)??E(t.right,e,n);if(t.t==="call"&&t.fn==="if"&&t.args.length===3)return E(t.args[1],e,n)??E(t.args[2],e,n)}function O(t,e,n){switch(t.t){case"ident":return n.relation(e,t.name)?n.farOf(e,t.name):null;case"member":return n.farOf(O(t.object,e,n),t.name);case"where":return O(t.set,e,n);case"binary":return t.op==="|"||t.op==="&"||t.op==="-"?O(t.left,e,n):null;case"call":{let r=o=>{let l=t.args[o];return l?.t==="lit"&&typeof l.value=="string"?l.value:void 0};return t.fn==="all"?r(0)??null:t.fn==="out"?t.args.length===2?n.farOf(O(t.args[0],e,n),r(1)??""):n.farOf(e,r(0)??""):t.fn==="in"?t.args.length===2?n.nearOf(O(t.args[0],e,n),r(1)??""):n.nearOf(e,r(0)??""):(t.fn==="first"||t.fn==="sort")&&t.args[0]?O(t.args[0],e,n):null}default:return null}}function A(t){return t.t==="binary"?t.op==="||"?U(t)?4:1:t.op==="&&"?2:t.op in M||t.op==="in"?4:t.op==="+"||t.op==="-"?5:t.op==="*"||t.op==="/"||t.op==="%"?6:4.5:t.t==="unary"&&t.op==="!"?3:t.t==="where"?3.5:9}var K=t=>t.t==="lit",x=(t,e)=>t.t==="call"&&t.fn===e;function I(t,e){return t.t==="binary"&&t.op===e?[...I(t.left,e),...I(t.right,e)]:[t]}function U(t){if(t.t!=="binary"||t.op!=="||")return;let e=[];e.push(...I(t,"||"));let n,r=[];for(let o of e){if(o.t!=="binary"||o.op!=="=="||!K(o.right)||typeof o.right.value!="string"||n&&JSON.stringify(xt(n))!==JSON.stringify(xt(o.left)))return;n=o.left,r.push(o.right)}return n?{subject:n,values:r}:void 0}var xt=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function c(t,e,n,r){let o=(l,a,s=e)=>A(l)<a?[R,...c(l,s,n),w]:c(l,s,n);switch(t.t){case"lit":return[n.valueWords(t.value,r)];case"list":return[n.valueWords(t.items.map(l=>l.t==="lit"?l.value:null),r)];case"ident":return[b(n.fieldName(e,t.name))];case"member":{let l=x(t.object,"first")&&t.object.args[0]&&x(t.object.args[0],"all"),a=O(t.object,e,n);if(l&&a)return e!==null&&n.fieldName(e,t.name)===n.fieldName(a,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[b(`${n.noun(a)}'s ${n.fieldName(a,t.name)}`)]:[b(n.fieldName(a,t.name))];let s=c(t.object,e,n),m=s[s.length-1];return s.length===1&&m?.as==="name"?[b(`${m.text}'s ${n.fieldName(a,t.name)}`)]:[...s,f("'s"),b(n.fieldName(a,t.name))]}case"unary":return t.op==="-"?[v("\u2212","minus"),...o(t.operand,7)]:_(t.operand,e,n);case"where":{let l=O(t.set,e,n),a=c(t.filter,l,n),s=a.every(m=>m.as==="name"||m.as==="word"&&m.text==="not");return[...o(t.set,4),...s?[]:[f("with")],...A(t.filter)<=2?[R,...a,w]:a]}case"binary":return Rt(t,e,n);case"call":return St(t,e,n)}}function _(t,e,n){return bt(t)?Rt({...t,op:B[t.op]},e,n):x(t,"present")||x(t,"exists")?[...c(t.args[0],e,n),v("=","is"),W]:t.t==="ident"?[f("not"),b(n.fieldName(e,t.name))]:[f("not"),R,...c(t,e,n),w]}function Rt(t,e,n){let r=(a,s)=>A(a)<s?[R,...c(a,e,n),w]:c(a,e,n);if(t.op==="&&"||t.op==="||"){let a=U(t);if(a){let m=E(a.subject,e,n);return[...c(a.subject,e,n),v("\u2208","is one of"),n.valueWords(a.values.map(g=>g.value),m)]}let s=t.op==="&&"?2:1;return[...r(t.left,s),f(t.op==="&&"?"and":"or"),...r(t.right,s+.5)]}if(t.op in M){if(K(t.right)&&typeof t.right.value=="boolean"&&(t.op==="=="||t.op==="!="))return t.op==="=="===t.right.value?c(t.left,e,n):_(t.left,e,n);let[a,s]=M[t.op],m=E(t.left,e,n),g=E(t.right,e,n);return[...N(t.left,e,n,g),v(a,s),...N(t.right,e,n,m)]}if(t.op==="in")return[...r(t.left,5),v("\u2208","is one of"),...N(t.right,e,n,E(t.left,e,n))];let o=At[t.op];if(o){let a=A(t);return[...r(t.left,a),v(o[0],o[1]),...r(t.right,a+.5)]}let l={"|":"or","&":"and also","-":"except"};return[...r(t.left,5),f(l[t.op]??t.op),...r(t.right,5)]}function N(t,e,n,r){return t.t==="lit"||t.t==="list"?c(t,e,n,r):A(t)<5?[R,...c(t,e,n),w]:c(t,e,n)}function St(t,e,n){let r=a=>t.args[a],o=a=>{let s=t.args[a];return s?.t==="lit"&&typeof s.value=="string"?s.value:void 0},l=a=>{let s=r(a);return A(s)<9&&s.t!=="where"?[R,...c(s,e,n),w]:c(s,e,n)};switch(t.fn){case"out":{let a=o(t.args.length-1)??"",s=b(V(a).toLowerCase());return t.args.length===2?[s,f("of"),...l(0)]:[s]}case"in":{let a=o(t.args.length-1)??"",s=t.args.length===2?n.nearOf(O(r(0),e,n),a):n.nearOf(e,a),m=b(s?n.plural(s):V(a).toLowerCase());return t.args.length===2?[m,f("of"),...l(0)]:[m]}case"all":{let a=o(0),s=t.args[1]?.t==="lit"?t.args[1].value:void 0,m=s===!0?[f("archived")]:s==="all"?[f("archived or not")]:[];return s===!0?[...m,b(a?n.plural(a):"everything")]:[b(a?n.plural(a):"everything"),...m]}case"fact":{let a=o(0);return[b(a?n.factName(a):"fact")]}case"count":return[f("number of"),...l(0)];case"exists":return[...l(0),v("\u2260","is not"),W];case"present":return[...c(r(0),e,n),v("\u2260","is not"),W];case"some":case"every":{let a=O(r(0),e,n),s=r(1);return[...t.fn==="some"?[f("some")]:[],...l(0),f(t.fn==="some"?"with":"all with"),...A(s)<=2?[R,...c(s,a,n),w]:c(s,a,n)]}case"sum":case"min":case"max":{let a=O(r(0),e,n),s=r(1),m=s.t==="lit"&&typeof s.value=="string"?[b(n.fieldName(a,s.value))]:A(s)<9?[R,...c(s,a,n),w]:c(s,a,n);return[f(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...m,f("of"),...l(0)]}case"first":{let a=r(0);if(x(a,"all")){let s=a.args[0]?.value;if(typeof s=="string")return[b(`the ${n.noun(s)}`)]}return[f("first of"),...l(0)]}case"sort":return[...l(0),f("by"),...c(r(1),O(r(0),e,n),n)];case"len":return[f("length of"),...c(r(0),e,n)];case"lower":return c(r(0),e,n);case"round":return[...c(r(0),e,n),f(t.args.length===2&&K(r(1))?`rounded to ${String(r(1).value)} places`:"rounded")];case"contains":case"startsWith":return[...c(r(0),e,n),f(t.fn==="contains"?"contains":"starts with"),...N(r(1),e,n,E(r(0),e,n))];case"today":return[P("today")];case"now":return[P("now")];case"date":return K(r(0))&&typeof r(0).value=="string"?[P(q(String(r(0).value),n.locale))]:c(r(0),e,n);case"days":case"hours":{let a=t.fn,[s,m]=[r(0),r(1)];return x(m,"today")||x(m,"now")?[f(`${a} since`),...c(s,e,n)]:x(s,"today")||x(s,"now")?[f(`${a} until`),...c(m,e,n)]:[f(`${a} from`),...c(s,e,n),f("to"),...c(m,e,n)]}case"if":return[R,...c(r(1),e,n),f("if"),...c(r(0),e,n),f(","),f("else"),...c(r(2),e,n),w];case"either":return t.args.flatMap((a,s)=>s===0?c(a,e,n):[f(","),f("else"),...c(a,e,n)]);default:return[f(t.fn),R,...t.args.flatMap((a,s)=>s===0?c(a,e,n):[f(","),...c(a,e,n)]),w]}}function H(t){let e=n=>b(V(n).toLowerCase());return[f("through"),e(t.through.relation),...t.via?[f(","),f("then"),e(t.via.relation)]:[]]}function Z(t,e){let n=vt(e),r=t.over==="graph"?null:t.over,o=t.covers?[f("reaches every"),b(n.noun(t.covers.every)),...H(t.covers)]:c(t.require,r,n);return G({...r===null?{}:{kind:r},parts:o,...t.when?{when:c(t.when,r,n)}:{}})}function Y(t,e,n,r){let o=vt(e),l=t.over==="graph"?null:t.over,a=n.subject;if(t.covers)return G({...l===null?{}:{kind:l},parts:r?[f("does not reach"),o.valueWords(r),...H(t.covers)]:[f("does not reach every"),b(o.noun(t.covers.every)),...H(t.covers)],...a?{record:F(e.schema.tryDefinition(a.kind),a)}:{}});let s=u=>{try{return J(u,{...n,budget:2e3})}catch{return}},m=(u,p)=>{let h=N(u,l,o,p);if(u.t==="lit"||u.t==="list"||x(u,"today")||x(u,"now")||x(u,"date"))return h;let i=s(u);if(i===void 0)return h;let d=E(u,l,o),y=o.valueWords(i,d?{...d,format:o.formatOf(d.kind,d.key)??(p?o.formatOf(p.kind,p.key):void 0)}:p);return i instanceof C?[...h,f(":"),y]:[...h,y]},g=u=>{if(u.t==="binary"&&u.op==="&&"){let p=[];p.push(...I(u,"&&"));let h=p.filter(i=>s(i)!==!0);return(h.length>0?h:p).flatMap((i,d)=>[...d>0?[f("and")]:[],...A(i)<=2?[R,...g(i),w]:g(i)])}if(u.t==="binary"&&u.op==="||"){let p=U(u);if(p){let i=E(p.subject,l,o);return[...m(p.subject),v("\u2209","is not one of"),o.valueWords(p.values.map(d=>d.value),i)]}let h=[];return h.push(...I(u,"||")),h.flatMap((i,d)=>[...d>0?[f("and")]:[],...A(i)<=2?[R,...g(i),w]:g(i)])}if(u.t==="binary"&&u.op in M){if(K(u.right)&&typeof u.right.value=="boolean"&&(u.op==="=="||u.op==="!="))return u.op==="=="===u.right.value?_(u.left,l,o):c(u.left,l,o);let p=B[u.op],[h,i]=M[p],d=E(u.left,l,o),y=E(u.right,l,o);if(K(u.right)&&u.right.value===null)return[...p==="=="?N(u.left,l,o,y):m(u.left,y),v(h,i),W];let j=p==="=="&&(K(u.right)||K(u.left));return[...j?N(u.left,l,o,y):m(u.left,y),v(h,i),...j?N(u.right,l,o,d):m(u.right,d)]}if(u.t==="binary"&&u.op==="in")return[...m(u.left),v("\u2209","is not one of"),...N(u.right,l,o,E(u.left,l,o))];if(u.t==="unary"&&u.op==="!"){let p=u.operand;return bt(p)?g({...p,op:B[p.op]}):x(p,"present")||x(p,"exists")?[...m(p.args[0]),v("\u2260","is not"),W]:p.t==="ident"?c(p,l,o):[f("not"),R,..._(p,l,o),w]}if(x(u,"present")||x(u,"exists"))return[...c(u.args[0],l,o),v("=","is"),W];if(x(u,"some"))return[...c(u,l,o).slice(1),v("=","is"),W];if(x(u,"every")&&u.args.length===2){let p=s(u.args[0]);if(p instanceof C){let h=p.nodes.filter(i=>{try{return J(u.args[1],{...n,subject:i,budget:2e3})!==!0}catch{return!0}});return[...c(u,l,o),f(","),f("not"),o.valueWords(new C(h))]}}return u.t==="ident"?[f("not"),b(o.fieldName(l,u.name))]:[f("not"),R,...c(u,l,o),w]},S;try{S=g(t.require)}catch{S=[f("not"),R,...c(t.require,l,o),w]}return G({...l===null?{}:{kind:l},parts:S,...a?{record:F(e.schema.tryDefinition(a.kind),a)}:{}})}function wt(t){let e=new Map;for(let n of t??[])n.expr?.t==="ident"&&n.format&&(n.format==="money"||n.format==="percent"||n.format==="date")&&e.set(n.expr.name,n.format);return e}function Nt(t){return(e,n)=>{let r=t[e]?.fields?.[n],o=r?.format??(r?.type==="date"?"date":void 0);return o||r?.unit?{...o?{format:o}:{},...r?.unit?{unit:r.unit}:{}}:void 0}}function Et(t,e){return{schema:e,said:wt(t.says),...t.declared?{formatOf:Nt(t.declared)}:{},...t.money?{money:t.money}:{}}}function Xt(t,e){return t.shape?Z(t.shape,Et(t.shape,e)):void 0}var Ot=new WeakMap;function Wt(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let o=Vt(r),l=n.get(o.invariant)?.shape;if(!l||o.status&&o.status!=="violated")return o;let a=o.subjectId?t.graph.getNode(o.subjectId):void 0;if(l.over!=="graph"&&!a)return o;let s=l.kinds;s||(s=Ot.get(t.schema),s||Ot.set(t.schema,s=mt(t.schema)));try{let m=t.today?.()??l.today?.()??tt(),g=l.covers?o.nodeIds.find(p=>p!==o.subjectId):void 0,S=g?t.graph.getNode(g):void 0,u=Y(l,Et(l,t.schema),{graph:t.graph,subject:a??null,kinds:s,today:m},S);return{...o,line:u,...l.says||l.covers?{}:{message:`${o.message} \u2014 ${u.text}`}}}catch{return o}})}function $t(){ft((t,e,n,r)=>Wt({graph:t,schema:t.schema,allInvariants:()=>e,today:()=>r},n)),yt(Kt)}function Kt(t,e,n,r){let o=e.graph,l=ut.from(t.schema,o.snapshot(),{validate:!1});for(let g of n?[...r].reverse().map(lt):r)try{l.applyPrimitives([g],{restoring:!0})}catch{}let a=g=>t.violations(void 0,g),s=a(n?l:o),m=a(n?o:l);return{...dt(t.allInvariants(),s,m),violationsAfter:m}}function Vt(t){if(!t.line)return t;let{line:e,...n}=t,r=` \u2014 ${e.text}`;return n.message.endsWith(r)?{...n,message:n.message.slice(0,-r.length)}:n}$t();export{Y as brokenLineOf,$t as judgeWithLines,Kt as judgedForASeat,jt as problemWords,Xt as ruleLine,Z as ruleLineOf,gt as ruleLineWords,z as ruleSpacing,Lt as ruleSpoken,Pt as ruleText,Vt as unlined,Wt as withLines};
1
+ import{b as yt}from"./chunk.2QQ37RCZ.js";import{a as mt}from"./chunk.TUCSUZNO.js";import{f as pt}from"./chunk.ZMWAZACO.js";import{a as C,f as J}from"./chunk.CD6YWH6T.js";import{F as X,J as k,Kd as dt,L as tt,T as q,W as nt,Y as et,Z as rt,ac as ct,ea as ot,ga as V,la as F,oa as at,qb as ut,ra as st,ta as it,tb as ft}from"./chunk.J24YPQ5I.js";import{e as lt}from"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function z(t){let e=[],n=!0;for(let r of t){if(r.text.length===0)continue;let o=r.as==="close"||r.text===","||r.text===":"||r.text.startsWith("'")||n;e.push({part:r,space:!o}),n=r.as==="open"}return e}function D(t,e){return z(t).map(({part:n,space:r})=>`${r?" ":""}${e?n.said??n.text:n.text}`).join("")}function Pt(t){return D(t,!1)}function Lt(t){return D(t,!0)}function gt(t,e=!1){let n=e?t.said:t.text;return t.record!==void 0?`${t.record} \u2014 ${n}`:n}function G(t){let e=l=>z(l).map(({part:a,space:s})=>({...a,space:s})),n=e(t.parts),r=t.when&&t.when.length>0?e(t.when):void 0,o=l=>`${D(n,l)}${r?`, when ${D(r,l)}`:""}`;return{...t,parts:n,...r?{when:r}:{},text:o(!1),said:o(!0)}}function jt(t,e=!1){return t.line?gt(t.line,e):t.message}var ht=60,b=t=>({text:t,as:"name"}),f=(t,e)=>e===void 0?{text:t,as:"word"}:{text:t,as:"word",said:e},P=(t,e)=>e===void 0||e===t?{text:t,as:"value"}:{text:t,as:"value",said:e},v=(t,e)=>({text:t,as:"op",said:e}),R={text:"(",as:"open"},w={text:")",as:"close"},W={text:"\u2014",as:"value",said:"empty"},M={">=":["\u2265","at least"],"<=":["\u2264","at most"],"<":["<","less than"],">":[">","more than"],"==":["=","is"],"!=":["\u2260","is not"]},B={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},At={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},bt=t=>t.t==="binary"&&t.op in M;function T(t){return ot(t)}function vt(t){let{schema:e}=t,n=i=>i===null?void 0:e.tryDefinition(i),r=(i,d)=>{let y=n(i)?.edges;return y&&Object.hasOwn(y,d)?y[d]:void 0},o=(i,d)=>{let y=r(i,d)?.to;return Array.isArray(y)&&y.length===1?y[0]:null},l=(i,d)=>{let y=(e.edge(d)?.from??[]).filter(j=>{let $=r(j,d)?.to;return i===null||$==="*"||Array.isArray($)&&$.includes(i)});return y.length===1?y[0]:null},a=(i,d)=>r(i,d)?V(d).toLowerCase():T(st(n(i),d)),s=i=>T(at(e,i)),m=i=>T(pt(e).get(i)?.label??V(i)),g=i=>T(it(n(i),i)),S=(i,d)=>{let y=i===null?void 0:t.formatOf?.(i,d);if(y?.format)return y;let j=t.said?.get(d);return j?{...y,format:j}:y},u=i=>F(e.tryDefinition(i.kind),i),p=t.money?.locale,h=(i,d)=>{if(i==null)return W;if(i instanceof C){if(i.nodes.length===0)return W;let L=i.nodes.slice(0,3).map(u),Q=i.nodes.length-L.length;return P(Q>0?`${L.join(", ")} and ${Q} more`:L.length>1?`${L.slice(0,-1).join(", ")} and ${L[L.length-1]}`:L[0])}if(Array.isArray(i))return P(`{${i.map(L=>h(L,d).text).join(", ")}}`,i.map(L=>h(L,d).text).join(" or "));if(typeof i=="object")return P(u(i));if(typeof i=="boolean")return P(i?"yes":"no");let y=d?.format??(d?S(d.kind,d.key):void 0);if(typeof i=="number")return P(y&&y.format!=="date"?ct(i,{...t.money,...y}):rt(i,p));if(X.test(i)||y?.format==="date")return P(q(et(i,t.money?.timeZone)??i.slice(0,10),p));if(k.test(i))return P(nt(i,p,t.money?.timeZone));let j=d&&d.kind!==null?n(d.kind)?.display?.format?.[d.key]:void 0;if(j)return P(j(i));let $=i.length>ht?`${i.slice(0,ht-1).trimEnd()}\u2026`:i;return P(/^[a-z][a-z0-9]*([-_][a-z0-9]+)*$/.test($)?$.replace(/[-_]+/g," "):$)};return{definition:n,relation:r,farOf:o,nearOf:l,fieldName:a,plural:s,noun:g,factName:m,formatOf:S,valueWords:h,locale:p}}function E(t,e,n){if(t.t==="ident")return{kind:e,key:t.name};if(t.t==="member")return{kind:O(t.object,e,n),key:t.name};if(t.t==="call"&&(t.fn==="sum"||t.fn==="min"||t.fn==="max")&&t.args.length===2){let r=O(t.args[0],e,n),o=t.args[1];if(o.t==="ident")return{kind:r,key:o.name};if(o.t==="lit"&&typeof o.value=="string")return{kind:r,key:o.value}}if(t.t==="binary"&&(t.op==="+"||t.op==="-"))return E(t.left,e,n)??E(t.right,e,n);if(t.t==="call"&&t.fn==="if"&&t.args.length===3)return E(t.args[1],e,n)??E(t.args[2],e,n)}function O(t,e,n){switch(t.t){case"ident":return n.relation(e,t.name)?n.farOf(e,t.name):null;case"member":return n.farOf(O(t.object,e,n),t.name);case"where":return O(t.set,e,n);case"binary":return t.op==="|"||t.op==="&"||t.op==="-"?O(t.left,e,n):null;case"call":{let r=o=>{let l=t.args[o];return l?.t==="lit"&&typeof l.value=="string"?l.value:void 0};return t.fn==="all"?r(0)??null:t.fn==="out"?t.args.length===2?n.farOf(O(t.args[0],e,n),r(1)??""):n.farOf(e,r(0)??""):t.fn==="in"?t.args.length===2?n.nearOf(O(t.args[0],e,n),r(1)??""):n.nearOf(e,r(0)??""):(t.fn==="first"||t.fn==="sort")&&t.args[0]?O(t.args[0],e,n):null}default:return null}}function A(t){return t.t==="binary"?t.op==="||"?U(t)?4:1:t.op==="&&"?2:t.op in M||t.op==="in"?4:t.op==="+"||t.op==="-"?5:t.op==="*"||t.op==="/"||t.op==="%"?6:4.5:t.t==="unary"&&t.op==="!"?3:t.t==="where"?3.5:9}var K=t=>t.t==="lit",x=(t,e)=>t.t==="call"&&t.fn===e;function I(t,e){return t.t==="binary"&&t.op===e?[...I(t.left,e),...I(t.right,e)]:[t]}function U(t){if(t.t!=="binary"||t.op!=="||")return;let e=[];e.push(...I(t,"||"));let n,r=[];for(let o of e){if(o.t!=="binary"||o.op!=="=="||!K(o.right)||typeof o.right.value!="string"||n&&JSON.stringify(xt(n))!==JSON.stringify(xt(o.left)))return;n=o.left,r.push(o.right)}return n?{subject:n,values:r}:void 0}var xt=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function c(t,e,n,r){let o=(l,a,s=e)=>A(l)<a?[R,...c(l,s,n),w]:c(l,s,n);switch(t.t){case"lit":return[n.valueWords(t.value,r)];case"list":return[n.valueWords(t.items.map(l=>l.t==="lit"?l.value:null),r)];case"ident":return[b(n.fieldName(e,t.name))];case"member":{let l=x(t.object,"first")&&t.object.args[0]&&x(t.object.args[0],"all"),a=O(t.object,e,n);if(l&&a)return e!==null&&n.fieldName(e,t.name)===n.fieldName(a,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[b(`${n.noun(a)}'s ${n.fieldName(a,t.name)}`)]:[b(n.fieldName(a,t.name))];let s=c(t.object,e,n),m=s[s.length-1];return s.length===1&&m?.as==="name"?[b(`${m.text}'s ${n.fieldName(a,t.name)}`)]:[...s,f("'s"),b(n.fieldName(a,t.name))]}case"unary":return t.op==="-"?[v("\u2212","minus"),...o(t.operand,7)]:_(t.operand,e,n);case"where":{let l=O(t.set,e,n),a=c(t.filter,l,n),s=a.every(m=>m.as==="name"||m.as==="word"&&m.text==="not");return[...o(t.set,4),...s?[]:[f("with")],...A(t.filter)<=2?[R,...a,w]:a]}case"binary":return Rt(t,e,n);case"call":return St(t,e,n)}}function _(t,e,n){return bt(t)?Rt({...t,op:B[t.op]},e,n):x(t,"present")||x(t,"exists")?[...c(t.args[0],e,n),v("=","is"),W]:t.t==="ident"?[f("not"),b(n.fieldName(e,t.name))]:[f("not"),R,...c(t,e,n),w]}function Rt(t,e,n){let r=(a,s)=>A(a)<s?[R,...c(a,e,n),w]:c(a,e,n);if(t.op==="&&"||t.op==="||"){let a=U(t);if(a){let m=E(a.subject,e,n);return[...c(a.subject,e,n),v("\u2208","is one of"),n.valueWords(a.values.map(g=>g.value),m)]}let s=t.op==="&&"?2:1;return[...r(t.left,s),f(t.op==="&&"?"and":"or"),...r(t.right,s+.5)]}if(t.op in M){if(K(t.right)&&typeof t.right.value=="boolean"&&(t.op==="=="||t.op==="!="))return t.op==="=="===t.right.value?c(t.left,e,n):_(t.left,e,n);let[a,s]=M[t.op],m=E(t.left,e,n),g=E(t.right,e,n);return[...N(t.left,e,n,g),v(a,s),...N(t.right,e,n,m)]}if(t.op==="in")return[...r(t.left,5),v("\u2208","is one of"),...N(t.right,e,n,E(t.left,e,n))];let o=At[t.op];if(o){let a=A(t);return[...r(t.left,a),v(o[0],o[1]),...r(t.right,a+.5)]}let l={"|":"or","&":"and also","-":"except"};return[...r(t.left,5),f(l[t.op]??t.op),...r(t.right,5)]}function N(t,e,n,r){return t.t==="lit"||t.t==="list"?c(t,e,n,r):A(t)<5?[R,...c(t,e,n),w]:c(t,e,n)}function St(t,e,n){let r=a=>t.args[a],o=a=>{let s=t.args[a];return s?.t==="lit"&&typeof s.value=="string"?s.value:void 0},l=a=>{let s=r(a);return A(s)<9&&s.t!=="where"?[R,...c(s,e,n),w]:c(s,e,n)};switch(t.fn){case"out":{let a=o(t.args.length-1)??"",s=b(V(a).toLowerCase());return t.args.length===2?[s,f("of"),...l(0)]:[s]}case"in":{let a=o(t.args.length-1)??"",s=t.args.length===2?n.nearOf(O(r(0),e,n),a):n.nearOf(e,a),m=b(s?n.plural(s):V(a).toLowerCase());return t.args.length===2?[m,f("of"),...l(0)]:[m]}case"all":{let a=o(0),s=t.args[1]?.t==="lit"?t.args[1].value:void 0,m=s===!0?[f("archived")]:s==="all"?[f("archived or not")]:[];return s===!0?[...m,b(a?n.plural(a):"everything")]:[b(a?n.plural(a):"everything"),...m]}case"fact":{let a=o(0);return[b(a?n.factName(a):"fact")]}case"count":return[f("number of"),...l(0)];case"exists":return[...l(0),v("\u2260","is not"),W];case"present":return[...c(r(0),e,n),v("\u2260","is not"),W];case"some":case"every":{let a=O(r(0),e,n),s=r(1);return[...t.fn==="some"?[f("some")]:[],...l(0),f(t.fn==="some"?"with":"all with"),...A(s)<=2?[R,...c(s,a,n),w]:c(s,a,n)]}case"sum":case"min":case"max":{let a=O(r(0),e,n),s=r(1),m=s.t==="lit"&&typeof s.value=="string"?[b(n.fieldName(a,s.value))]:A(s)<9?[R,...c(s,a,n),w]:c(s,a,n);return[f(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...m,f("of"),...l(0)]}case"first":{let a=r(0);if(x(a,"all")){let s=a.args[0]?.value;if(typeof s=="string")return[b(`the ${n.noun(s)}`)]}return[f("first of"),...l(0)]}case"sort":return[...l(0),f("by"),...c(r(1),O(r(0),e,n),n)];case"len":return[f("length of"),...c(r(0),e,n)];case"lower":return c(r(0),e,n);case"round":return[...c(r(0),e,n),f(t.args.length===2&&K(r(1))?`rounded to ${String(r(1).value)} places`:"rounded")];case"contains":case"startsWith":return[...c(r(0),e,n),f(t.fn==="contains"?"contains":"starts with"),...N(r(1),e,n,E(r(0),e,n))];case"today":return[P("today")];case"now":return[P("now")];case"date":return K(r(0))&&typeof r(0).value=="string"?[P(q(String(r(0).value),n.locale))]:c(r(0),e,n);case"days":case"hours":{let a=t.fn,[s,m]=[r(0),r(1)];return x(m,"today")||x(m,"now")?[f(`${a} since`),...c(s,e,n)]:x(s,"today")||x(s,"now")?[f(`${a} until`),...c(m,e,n)]:[f(`${a} from`),...c(s,e,n),f("to"),...c(m,e,n)]}case"if":return[R,...c(r(1),e,n),f("if"),...c(r(0),e,n),f(","),f("else"),...c(r(2),e,n),w];case"either":return t.args.flatMap((a,s)=>s===0?c(a,e,n):[f(","),f("else"),...c(a,e,n)]);default:return[f(t.fn),R,...t.args.flatMap((a,s)=>s===0?c(a,e,n):[f(","),...c(a,e,n)]),w]}}function H(t){let e=n=>b(V(n).toLowerCase());return[f("through"),e(t.through.relation),...t.via?[f(","),f("then"),e(t.via.relation)]:[]]}function Z(t,e){let n=vt(e),r=t.over==="graph"?null:t.over,o=t.covers?[f("reaches every"),b(n.noun(t.covers.every)),...H(t.covers)]:c(t.require,r,n);return G({...r===null?{}:{kind:r},parts:o,...t.when?{when:c(t.when,r,n)}:{}})}function Y(t,e,n,r){let o=vt(e),l=t.over==="graph"?null:t.over,a=n.subject;if(t.covers)return G({...l===null?{}:{kind:l},parts:r?[f("does not reach"),o.valueWords(r),...H(t.covers)]:[f("does not reach every"),b(o.noun(t.covers.every)),...H(t.covers)],...a?{record:F(e.schema.tryDefinition(a.kind),a)}:{}});let s=u=>{try{return J(u,{...n,budget:2e3})}catch{return}},m=(u,p)=>{let h=N(u,l,o,p);if(u.t==="lit"||u.t==="list"||x(u,"today")||x(u,"now")||x(u,"date"))return h;let i=s(u);if(i===void 0)return h;let d=E(u,l,o),y=o.valueWords(i,d?{...d,format:o.formatOf(d.kind,d.key)??(p?o.formatOf(p.kind,p.key):void 0)}:p);return i instanceof C?[...h,f(":"),y]:[...h,y]},g=u=>{if(u.t==="binary"&&u.op==="&&"){let p=[];p.push(...I(u,"&&"));let h=p.filter(i=>s(i)!==!0);return(h.length>0?h:p).flatMap((i,d)=>[...d>0?[f("and")]:[],...A(i)<=2?[R,...g(i),w]:g(i)])}if(u.t==="binary"&&u.op==="||"){let p=U(u);if(p){let i=E(p.subject,l,o);return[...m(p.subject),v("\u2209","is not one of"),o.valueWords(p.values.map(d=>d.value),i)]}let h=[];return h.push(...I(u,"||")),h.flatMap((i,d)=>[...d>0?[f("and")]:[],...A(i)<=2?[R,...g(i),w]:g(i)])}if(u.t==="binary"&&u.op in M){if(K(u.right)&&typeof u.right.value=="boolean"&&(u.op==="=="||u.op==="!="))return u.op==="=="===u.right.value?_(u.left,l,o):c(u.left,l,o);let p=B[u.op],[h,i]=M[p],d=E(u.left,l,o),y=E(u.right,l,o);if(K(u.right)&&u.right.value===null)return[...p==="=="?N(u.left,l,o,y):m(u.left,y),v(h,i),W];let j=p==="=="&&(K(u.right)||K(u.left));return[...j?N(u.left,l,o,y):m(u.left,y),v(h,i),...j?N(u.right,l,o,d):m(u.right,d)]}if(u.t==="binary"&&u.op==="in")return[...m(u.left),v("\u2209","is not one of"),...N(u.right,l,o,E(u.left,l,o))];if(u.t==="unary"&&u.op==="!"){let p=u.operand;return bt(p)?g({...p,op:B[p.op]}):x(p,"present")||x(p,"exists")?[...m(p.args[0]),v("\u2260","is not"),W]:p.t==="ident"?c(p,l,o):[f("not"),R,..._(p,l,o),w]}if(x(u,"present")||x(u,"exists"))return[...c(u.args[0],l,o),v("=","is"),W];if(x(u,"some"))return[...c(u,l,o).slice(1),v("=","is"),W];if(x(u,"every")&&u.args.length===2){let p=s(u.args[0]);if(p instanceof C){let h=p.nodes.filter(i=>{try{return J(u.args[1],{...n,subject:i,budget:2e3})!==!0}catch{return!0}});return[...c(u,l,o),f(","),f("not"),o.valueWords(new C(h))]}}return u.t==="ident"?[f("not"),b(o.fieldName(l,u.name))]:[f("not"),R,...c(u,l,o),w]},S;try{S=g(t.require)}catch{S=[f("not"),R,...c(t.require,l,o),w]}return G({...l===null?{}:{kind:l},parts:S,...a?{record:F(e.schema.tryDefinition(a.kind),a)}:{}})}function wt(t){let e=new Map;for(let n of t??[])n.expr?.t==="ident"&&n.format&&(n.format==="money"||n.format==="percent"||n.format==="date")&&e.set(n.expr.name,n.format);return e}function Nt(t){return(e,n)=>{let r=t[e]?.fields?.[n],o=r?.format??(r?.type==="date"?"date":void 0);return o||r?.unit?{...o?{format:o}:{},...r?.unit?{unit:r.unit}:{}}:void 0}}function Et(t,e){return{schema:e,said:wt(t.says),...t.declared?{formatOf:Nt(t.declared)}:{},...t.money?{money:t.money}:{}}}function Xt(t,e){return t.shape?Z(t.shape,Et(t.shape,e)):void 0}var Ot=new WeakMap;function Wt(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let o=Vt(r),l=n.get(o.invariant)?.shape;if(!l||o.status&&o.status!=="violated")return o;let a=o.subjectId?t.graph.getNode(o.subjectId):void 0;if(l.over!=="graph"&&!a)return o;let s=l.kinds;s||(s=Ot.get(t.schema),s||Ot.set(t.schema,s=mt(t.schema)));try{let m=t.today?.()??l.today?.()??tt(),g=l.covers?o.nodeIds.find(p=>p!==o.subjectId):void 0,S=g?t.graph.getNode(g):void 0,u=Y(l,Et(l,t.schema),{graph:t.graph,subject:a??null,kinds:s,today:m},S);return{...o,line:u,...l.says||l.covers?{}:{message:`${o.message} \u2014 ${u.text}`}}}catch{return o}})}function $t(){ft((t,e,n,r)=>Wt({graph:t,schema:t.schema,allInvariants:()=>e,today:()=>r},n)),yt(Kt)}function Kt(t,e,n,r){let o=e.graph,l=ut.from(t.schema,o.snapshot(),{validate:!1});for(let g of n?[...r].reverse().map(lt):r)try{l.applyPrimitives([g],{restoring:!0})}catch{}let a=g=>t.violations(void 0,g),s=a(n?l:o),m=a(n?o:l);return{...dt(t.allInvariants(),s,m),violationsAfter:m}}function Vt(t){if(!t.line)return t;let{line:e,...n}=t,r=` \u2014 ${e.text}`;return n.message.endsWith(r)?{...n,message:n.message.slice(0,-r.length)}:n}$t();export{Y as brokenLineOf,$t as judgeWithLines,Kt as judgedForASeat,jt as problemWords,Xt as ruleLine,Z as ruleLineOf,gt as ruleLineWords,z as ruleSpacing,Lt as ruleSpoken,Pt as ruleText,Vt as unlined,Wt as withLines};
@@ -1,3 +1,3 @@
1
- import{b as te}from"./chunk.EJ4MSVX2.js";import"./chunk.REUMBCSV.js";import"./chunk.2KIWGQXC.js";import{c as ne}from"./chunk.D5LOTCBU.js";import{G as ge,T as ee}from"./chunk.CYTTZOYL.js";import"./chunk.SDO3U72B.js";import{la as X,na as Z,od as q}from"./chunk.Q4MI53KK.js";import"./chunk.FQLNBIQ5.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
1
+ import{b as te}from"./chunk.ZJFXM3LE.js";import"./chunk.DA4RSHLW.js";import"./chunk.FOSY7MZF.js";import{b as ne}from"./chunk.NBVPWLRY.js";import"./chunk.S3EEY7T3.js";import{G as ge,V as ee}from"./chunk.3CJLAJXP.js";import"./chunk.SDO3U72B.js";import{la as X,na as Z,qd as q}from"./chunk.J24YPQ5I.js";import"./chunk.FQLNBIQ5.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
2
2
  `),[y,K]=(0,M.useState)(null);(0,M.useLayoutEffect)(()=>{let n=x.current;if(!i.overview||R.length===0||!n||typeof document>"u"||$.t<1){K(null);return}let w=n.getBoundingClientRect(),B=e=>({x:e.left-w.left,y:e.top-w.top,width:e.width,height:e.height}),D=new Map,se=R.map(e=>`[data-graview-view="${CSS.escape(e)}"]`).join(","),k=null,H=()=>{if(k)return k;k={drawn:new Map,buildings:new Map};for(let e of n.querySelectorAll("[data-graview-pick], [data-graview-view], [data-graview-building]")){let r=e.getAttribute("data-graview-pick"),a=e.getAttribute("data-graview-view");for(let c of r!==null&&r===a?[r]:[r,a]){if(c===null)continue;let u=k.drawn.get(c);u?u.push(e):k.drawn.set(c,[e])}let L=e.getAttribute("data-graview-building");L!==null&&!k.buildings.has(L)&&k.buildings.set(L,e)}return k},P=e=>{if(D.has(e))return D.get(e);let r=null;for(let a of H().drawn.get(e)??[])if(!a.closest("[data-graview-offstage], [data-graview-screen]")&&!(!R.includes(e)&&a.closest(se))&&(r=h(a,n),r))break;if(!r){let a=H().buildings.get(e);a&&(r=B(a.getBoundingClientRect()))}return D.set(e,r),r},W=e=>{let r=n.querySelector(`[data-graview-plot="kind:${CSS.escape(e)}"] .graview-plot-tile`);return r?B(r.getBoundingClientRect()):null},de=re(R,t.graph.allEdges(),v,e=>P(e)!==null,t.schema),z=[];for(let e of n.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')){let r=h(e,n);r&&z.push(r)}let Q=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),O=[],V=new Set(R),I=new Set;for(let e of de){let r=v(e.self),a=P(e.self)??(r?W(r):null),L=e.lands==="record"?P(e.others[0]):W(e.kind);if(!a||!L)continue;for(let g of e.others)V.add(g);I.add(e.kind),r&&I.add(r);let c=Q(a),u=Q(L),A=Math.hypot(u.x-c.x,u.y-c.y);if(A<6)continue;let G=Math.min(40,A*.12)*(O.length%2===0?1:-1),le={x:(c.x+u.x)/2-(u.y-c.y)/A*G,y:(c.y+u.y)/2+(u.x-c.x)/A*G},J=l({p0:c,c:le,p1:u},z);if(J.length===0)continue;let ce=J.map(g=>`M ${g.p0.x.toFixed(1)} ${g.p0.y.toFixed(1)} Q ${g.c.x.toFixed(1)} ${g.c.y.toFixed(1)} ${g.p1.x.toFixed(1)} ${g.p1.y.toFixed(1)}`).join(" "),ue=g=>{let j=t.graph.getNode(g);return j?X(t.schema.tryDefinition(j.kind),j):g},U=e.lands==="record"?`${e.words}: ${ue(e.others[0])}`:`${e.words}: ${Z(t.schema,e.kind,e.others.length)}`,F=e.others[0],_=e.lands==="record"?b?.(e.edge,e.direction==="out"?e.self:F,e.direction==="out"?F:e.self):void 0;O.push({key:`${e.self}|${e.edge}|${e.direction}|${e.lands}|${F}`,link:e,d:ce,end:u,said:_!==void 0?`${U} \xB7 unsure`:U,..._!==void 0?{unsure:_}:{}})}let Y=[];for(let e of n.querySelectorAll(".graview-kind-face[data-graview-nameplate]")){let r=h(e,n);r&&Y.push(r)}let ae=ie(O.map(e=>({key:e.key,x:e.end.x,y:e.end.y-6,width:Math.min(260,14+e.said.length*6.6),height:20})),Y);K({lines:O,labels:ae,reached:[...V],districts:[...I]})},[oe,i.overview,$,o,E,S,m,x,t]);let N=(0,M.useMemo)(()=>{if(!y)return"";let n=y.reached.map(B=>`[data-graview-building="${CSS.escape(B)}"]`).join(","),w=y.districts.map(B=>`[data-graview-plot="kind:${CSS.escape(B)}"]`).join(",");return[".graview-ground[data-graview-altitude] .graview-building { opacity: 0.22; }",n?`.graview-ground[data-graview-altitude] .graview-building:is(${n}) { opacity: 1; }`:"",w?`.graview-ground[data-graview-altitude] .graview-plot:not(:is(${w})) .graview-plot-tile { opacity: 0.4; }`:""].join(`
3
3
  `)},[y]);return!y||y.lines.length===0?N?(0,s.jsx)("style",{children:N}):null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:N}),(0,s.jsx)("svg",{className:"graview-record-links","data-graview-world":"","data-graview-record-links":y.lines.length,"aria-hidden":"true",width:S,height:m,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:q.lines},children:y.lines.map(n=>(0,s.jsxs)("g",{className:"graview-record-link","data-graview-link":n.link.edge,"data-graview-lands":n.link.lands,"data-graview-direction":n.link.direction,"data-graview-provisional":n.unsure!==void 0||void 0,children:[(0,s.jsx)("path",{className:"graview-record-link-line",d:n.d,...n.unsure!==void 0?{strokeDasharray:f,strokeOpacity:p}:{}}),n.link.lands==="record"?(0,s.jsx)("circle",{className:"graview-record-link-end",cx:n.end.x,cy:n.end.y,r:3}):null]},n.key))}),(0,s.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:q.tieLabels},children:y.lines.map(n=>{let w=y.labels.get(n.key);return w?(0,s.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":n.link.edge,"data-graview-lands":n.link.lands,...n.unsure!==void 0?{title:n.unsure}:{},style:{position:"absolute",left:w.x,top:w.y,...n.unsure!==void 0?{pointerEvents:"auto"}:{}},children:n.said},n.key):null})})]})}export{xe as RecordLinks};
@@ -0,0 +1,2 @@
1
+ import{a as Ae}from"./chunk.BJUUSIQY.js";import{a as X}from"./chunk.64FCAUAJ.js";import{Cd as $e,Ib as be,ec as we,ga as B,la as he,oa as _,oc as Q,qc as Se,ra as ke,ta as W}from"./chunk.J24YPQ5I.js";import{j as H}from"./chunk.FQLNBIQ5.js";var M=e=>e.trim().toLowerCase(),U=e=>e.charAt(0).toUpperCase()+e.slice(1),le=e=>/^(?:[aeio]|u(?![sn]i|se|ser))/i.test(e),ee=e=>`${le(e)?"an":"a"} ${e}`,xe=e=>M(e).replace(/[^a-z0-9]+([a-z0-9])/g,(n,o)=>o.toUpperCase()).replace(/[^A-Za-z0-9]/g,""),se=e=>M(e).replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),ae=new Set(["person","people","someone","somebody","user","users","member","members"]);function de(e,n){let o=M(n);return Object.entries(e.kinds).find(([f,d])=>[f,d.noun,d.plural].some(c=>c!==void 0&&M(c)===o))?.[0]}function K(e,n){if(!e(n))return n;for(let o=2;;o++)if(!e(`${n}${o}`))return`${n}${o}`}function Fe(e,n){let o=e.acts??{},f=m=>m in o;if("link"in n){let m=de(e,n.link.on);if(!m)return{refused:`This app has no ${n.link.on} to give it to.`};let k=e.kinds[m],C=M(k.noun??m),v=M(n.link.called)||"linked to",u=de(e,n.link.to)??(ae.has(M(n.link.to))?(Object.entries(e.kinds).find(([,T])=>T.people)??Object.entries(e.kinds).find(([T,P])=>[T,P.noun,P.plural].some(t=>t!==void 0&&ae.has(M(t)))))?.[0]:void 0),A=[],j=[],$,F=u===void 0;if(!u){let T=M(n.link.to)||"person",P=ae.has(T),t=P?"person":T.replace(/s$/,""),a=P?"people":`${t}s`;u=K(b=>b in e.kinds,se(t)),A.push({op:"add-kind",kind:u,noun:t,plural:a,fields:{name:{type:"string",required:!0}},label:"{name}"}),$=K(f,`add-${u}`),j.push(`Add ${ee(U(a))} list.`)}let i=u in e.kinds?e.kinds[u]:A[0],p=M(i.noun??u),S=K(T=>T in(k.edges??{})||T in(k.fields??{}),xe(v)||"linkedTo");A.push({op:"add-relation",kind:m,relation:S,to:[u],cardinality:"one",description:U(v)});let R=K(f,`set-${se(v)}`);return A.push({op:"add-act",act:R,title:`Set \u201C${U(v)}\u201D`,on:m,connects:S,description:`Say who ${ee(C)} is ${v}.`}),j.push(`Give each ${C} ${le(v)?"an":"a"} \u201C${U(v)}\u201D field that points to ${ee(p)}.`),{edits:A,steps:j,on:m,relation:S,to:u,made:F,act:R,arg:"to",...$?{makes:$}:{},called:v}}let d=de(e,n.field.on);if(!d)return{refused:`This app has no ${n.field.on} to give it to.`};let c=e.kinds[d],g=M(c.noun??d),y=M(n.field.called)||"note",l=n.field.type??"string",s=K(m=>m in(c.fields??{})||m in(c.edges??{}),xe(y)||"note"),r=K(f,`set-${se(y)}`);return{edits:[{op:"add-field",kind:d,field:s,spec:{type:l}},{op:"add-act",act:r,title:`Set \u201C${U(y)}\u201D`,on:d,args:{value:{type:l,required:!0}},sets:{[s]:"$value"},description:`Say ${ee(g)}'s ${y}.`}],steps:[`Give each ${g} ${le(y)?"an":"a"} \u201C${U(y)}\u201D field.`],on:d,field:s,act:r,arg:"value",called:y}}var Re=["search-miss","unanswered","refused","tool-invalid"];var Le=new RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2066-\\u2069]","g");var G=e=>e.onBehalfOf?G(e.onBehalfOf):e.id!==void 0?`${e.kind}:${e.id}`:`${e.kind}:?`,ce=e=>e.toLowerCase().replace(/\s+/g," ").replace(/^[\s\p{P}]+|[\s\p{P}]+$/gu,"");var Ce=new Set("a an and are at be by can do does for from has have how i in is it me my of on or our the their there this to was we what when where which who why will with you your".split(" "));function J(e,n,o,f,d){let c=new Map;for(let g of e){let y=n(g);if(y===void 0)continue;let l=c.get(y)??{first:g,people:new Set,times:0,last:g};l.people.add(G(g.by)),l.times+=1,l.last=g,c.set(y,l)}return[...c.entries()].filter(([,g])=>g.people.size>=f).sort(([g,y],[l,s])=>s.people.size-y.people.size||s.times-y.times||g.localeCompare(l)).slice(0,d).map(([g,y])=>({...o(y.last,g),people:y.people.size,times:y.times}))}function je(e,n={}){let o=Math.max(1,n.minPeople??2),f=n.most??12,d=n.reader?G(n.reader):void 0,c=e.filter(s=>!$e(s.by)&&(d===void 0||G(s.by)!==d)),g=Object.fromEntries(Re.map(s=>{let r=c.filter(m=>m.type===s);return[s,{events:r.length,people:new Set(r.map(m=>G(m.by))).size}]})),y=[],l=new Map;for(let s of c){let r=s.type==="search-miss"?s.words:s.type==="unanswered"?s.question:void 0;if(r!==void 0)for(let m of new Set(ce(r).split(/[^\p{L}\p{N}]+/u))){if(m.length<3||Ce.has(m))continue;let k={...s,id:`${s.id}:${m}`};y.push(k),l.set(k,m)}}return{events:c.length,people:new Set(c.map(s=>G(s.by))).size,byType:g,searches:J(c,s=>s.type==="search-miss"&&ce(s.words)||void 0,(s,r)=>({words:r}),o,f),questions:J(c,s=>s.type==="unanswered"&&ce(s.question)||void 0,(s,r)=>({question:r}),o,f),words:J(y,s=>l.get(s),(s,r)=>({word:r}),o,f),refusals:J(c,s=>s.type==="refused"?`${s.act}|${s.code}`:void 0,s=>({act:s.act,code:s.code}),o,f),tools:J(c,s=>s.type==="tool-invalid"?`${s.tool}|${s.act??""}`:void 0,s=>{let r=s;return{tool:r.tool,...r.act?{act:r.act}:{},...r.then?{then:r.then}:{}}},1,f)}}var ve=e=>e.length>3&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e;function Ee(e){let n=new Set,o=f=>{for(let d of f.toLowerCase().split(/[^\p{L}\p{N}]+/u))d.length>0&&n.add(ve(d))};for(let f of e.kinds){let d=e.tryDefinition(f);o(f),o(W(d,f)),o(_(e,f));for(let c of[...d?.aliases??[],...Object.values(d?.fieldAliases??{}).flat()])o(c);for(let c of Object.keys(d?.fields?.shape??{}))o(c),o(B(c))}return n}function Oe(e,n,o={}){let f=je(e,{most:8,...o}),d=Ee(n),c=f.searches.filter(r=>!r.words.split(/[^\p{L}\p{N}]+/u).some(m=>m.length>0&&d.has(ve(m)))).map(r=>({words:r.words,people:r.people})),g=f.questions.map(r=>({question:r.question,people:r.people})),y=f.tools.map(r=>({tool:r.tool,...r.act?{act:r.act}:{},...r.then?{then:r.then}:{},times:r.times})),l=r=>`${r} ${r===1?"person":"people"}`;return{said:[...c.length>0?[`Searched for, found nothing, and nothing here is called it: ${c.map(r=>`\u201C${r.words}\u201D (${l(r.people)})`).join(", ")}.`]:[],...g.length>0?[`Asked and not answered: ${g.map(r=>`\u201C${r.question}\u201D (${l(r.people)})`).join(", ")}.`]:[],...y.length>0?[`Tool calls refused as invalid: ${y.map(r=>`${r.tool}${r.act?` (${r.act})`:""} ${r.times===1?"once":`${r.times} times`}${r.then?`, then worked as ${r.then}`:""}`).join("; ")}.`]:[]].join(`
2
+ `),unknownWords:c,questions:g,toolMistakes:y}}var Te=e=>/^(?:aggregate|kind):([^,]+)$/.exec(e)?.[1];function Ze(e,n){let o=e.about??[];if(e.field!==void 0&&e.on!==void 0&&n(e.on))return{on:"field",id:e.on,field:e.field};let f=o.filter(n);if(f.length>1)return{on:"selection",ids:f};if(e.on!==void 0&&n(e.on))return{on:"record",id:e.on};if(f.length===1)return{on:"record",id:f[0]};let d=[e.on,...o].map(c=>c===void 0?void 0:Te(c)).find(c=>c!==void 0);return e.place!==void 0?{on:"lens",place:e.place,...d?{kind:d}:{}}:d!==void 0?{on:"list",kind:d}:{on:"place",place:"home"}}var ne=e=>e.on==="record"||e.on==="field"?[e.id]:e.on==="selection"?e.ids:e.on==="act"&&e.id!==void 0?[e.id]:[],te=(e,n)=>e.tryDefinition(n)?.fields?.shape??{},Y=(e,n)=>e.tryDefinition(n)?.edges??{},ie=(e,n)=>new Set(e.tryDefinition(n)?.display?.hide??[]),N=(e,n)=>he(e.tryDefinition(n.kind),n),fe=(e,n,o)=>ke(e.tryDefinition(n),o)||B(o),pe=e=>typeof e=="boolean"?e?"yes":"no":String(e);function oe(e,n){let o=e.kindsKeptFrom(n);return new Set(e.schema.kinds.filter(f=>!o.has(f)))}function ye(e,n,o,f){if(!e.permits(n,o).ok)return!1;if(!f)return!0;try{return e.previewAll([n],{author:o}).ops.length>0}catch{return!1}}function Qe(e,n,o){let f=e,{principal:d}=o,c=o.each??8,g=H(f)?.store??f,y=g.seenBy(d),l=g.schema,s=oe(g,d),r=t=>{let a=y.graph.getNode(t);return a&&s.has(a.kind)?a:void 0},m=g.allMutations(),k=new Map(m.map(t=>[t.name,t])),C=[],v=new Set,u=t=>{v.has(t.id)||(v.add(t.id),C.push(t))},A=t=>t.slice(0,c),j=ne(n).filter(t=>r(t)!==void 0);if(ne(n).length>0&&j.length===0)return{target:n,candidates:[]};let $=j.length===1?r(j[0]):void 0,F=$?.kind??(n.on==="list"?n.kind:n.on==="lens"?n.kind??o.places?.find(t=>t.as===n.place)?.kind:void 0)??(n.on==="selection"?r(j[0])?.kind:void 0);if(F!==void 0&&!s.has(F))return{target:n,candidates:[]};let i=(t,a)=>`act:${t}${Object.keys(a).length>0?`:${Object.values(a).map(b=>String(b)).join(",")}`:""}`,p=(t,a,b,O,h)=>{t.destructive||Object.values(a).some(I=>typeof I=="string"&&g.graph.has(I)&&r(I)===void 0)||ye(g,{name:t.name,args:{...a}},d,O.length===0)&&u({type:"act",id:i(t.name,a),label:b,description:h??t.description??b,mutation:t.name,args:a,asks:O})};if(n.on!=="place"||o.acts)if(o.acts)for(let t of o.acts){let a=k.get(t.mutation);!a||t.destructive||n.on==="act"&&t.mutation!==n.act||p(a,t.args,t.label,(t.open??[]).filter(b=>!b.optional).map(b=>b.name),t.why)}else{let t=$?[$]:[];for(let a of m){if(n.on==="act"&&a.name!==n.act)continue;let b=a.input.shape??{},O=h=>Object.entries(b).filter(([I,w])=>I!==h&&w.safeParse?.(void 0).success===!1).map(([I])=>I);if(a.subject)for(let h of t)Q(l,a).includes(h.kind)&&p(a,{[a.subject.arg]:h.id},`${a.title??B(a.name)}: ${N(l,h)}`,O(a.subject.arg));else F!==void 0&&(a.creates??[]).includes(F)&&p(a,{},a.title??B(a.name),O(void 0))}}let S=C.filter(t=>t.type==="act");C.splice(0,C.length,...A(S));let R=(t,a)=>{let b=Se(l,m).get(t.kind),O=te(l,t.kind),h=ie(l,t.kind),I=[];for(let[w,D]of Object.entries(O)){if(a!==void 0?w!==a:h.has(w)||t[w]!==void 0)continue;let z=X(D),L=z?.type==="enum"&&!z.multiple?z.options??[]:z?.type==="boolean"?[!0,!1]:[];if(L.length===0)continue;let q=(b?.get(w)??[]).map(E=>k.get(E)).find(E=>E?.subject!==void 0&&ye(g,{name:E.name,args:{[E.subject.arg]:t.id,[w]:L.find(re=>re!==t[w])??L[0]}},d,!0));if(q?.subject)for(let E of L)t[w]!==E&&I.push({type:"fill",id:`fill:${t.id}:${w}:${pe(E)}`,label:`${fe(l,t.kind,w)}: ${pe(E)}`,description:`Set ${fe(l,t.kind,w).toLowerCase()} of ${N(l,t)} to ${pe(E)}`,record:t.id,field:w,value:E,call:{name:q.name,args:{[q.subject.arg]:t.id,[w]:E}}})}for(let[w,D]of Object.entries(Y(l,t.kind))){if(a!==void 0&&w!==a)continue;let z=D.to==="*"?[...s]:D.to.filter(x=>s.has(x)),L=new Set(y.graph.out(t.id,w).map(x=>x.id)),q=m.find(x=>(x.connects??[]).includes(w)&&x.subject!==void 0&&Q(l,x).includes(t.kind));if(!q?.subject)continue;let E=we(q.input).find(x=>x.name!==q.subject.arg);if(!E)continue;let re=z.flatMap(x=>E.kinds.length===0||E.kinds.includes(x)?y.graph.nodesOfKind(x):[]).filter(x=>x.id!==t.id&&!L.has(x.id)&&r(x.id)!==void 0);for(let x of A(re)){let me={name:q.name,args:{[q.subject.arg]:t.id,[E.name]:x.id}};ye(g,me,d,!0)&&I.push({type:"fill",id:`fill:${t.id}:${w}:${x.id}`,label:`${B(w)}: ${N(l,x)}`,description:`Link ${N(l,t)} to ${N(l,x)}${D.description?` as ${D.description}`:""}`,record:t.id,field:w,value:x.id,call:me})}}return I};if(n.on==="field"&&$)for(let t of R($,n.field))u(t);else if($&&n.on==="record")for(let t of A(R($)))u(t);let T=t=>{let a=_(l,t).toLowerCase(),b=[{type:"panel",id:`panel:${t}:list`,label:`A list of ${a}`,description:`Every ${W(l.tryDefinition(t),t).toLowerCase()} this viewer may see, as a list`,panel:{lens:"blocks",kind:t}}],O=ie(l,t);for(let[h,I]of Object.entries(te(l,t))){if(O.has(h))continue;let w=X(I),D=fe(l,t,h).toLowerCase();if(w?.type==="enum")b.push({type:"panel",id:`panel:${t}:group:${h}`,label:`${V(a)} by ${D}`,description:`A list of ${a} grouped by ${D}`,panel:{lens:"blocks",kind:t,group:h}}),b.push({type:"panel",id:`panel:${t}:columns:${h}`,label:`Columns of ${a} by ${D}`,description:`${V(a)} in a column for each ${D}`,panel:{lens:"columns",kind:t,column:h}});else if(w?.type==="number"||w?.type==="integer"||w?.type==="date"||w?.type==="datetime"){let z=w.type==="date"||w.type==="datetime";b.push({type:"panel",id:`panel:${t}:sort:${h}`,label:`${V(a)} by ${D}`,description:`A list of ${a}, the ${z?"latest":"highest"} ${D} first`,panel:{lens:"blocks",kind:t,sort:{by:h,direction:"desc"}}}),z&&b.push({type:"panel",id:`panel:${t}:calendar:${h}`,label:`A calendar of ${a}`,description:`${V(a)} on a calendar by ${D}`,panel:{lens:"calendar",kind:t,start:h}})}}return b},P=n.on==="place"?[...s]:F!==void 0?[F]:[];for(let t of P)for(let a of A(T(t)))u(a);for(let t of A((o.places??[]).filter(a=>a.kind===void 0?n.on==="place":s.has(a.kind)&&(n.on==="place"||a.kind===F))))n.on==="lens"&&t.as===n.place||u({type:"place",id:`place:${t.as}`,label:t.title,description:`Go to ${t.title}`,place:t.as});if($){let t=[];for(let[a,b]of Object.entries(Y(l,$.kind)))for(let O of y.graph.out($.id,a))r(O.id)&&t.push({type:"record",id:`record:${O.id}`,label:N(l,O),description:`${V(b.description??B(a))}: ${N(l,O)}`,record:O.id,relation:a});for(let a of l.kinds)for(let[b,O]of Object.entries(Y(l,a)))if(!(O.to!=="*"&&!O.to.includes($.kind)))for(let h of y.graph.in($.id,b))h.kind===a&&r(h.id)&&t.push({type:"record",id:`record:${h.id}`,label:N(l,h),description:`${V(O.inverse??B(b))}: ${N(l,h)}`,record:h.id,relation:b});for(let a of A(t))u(a)}else if(n.on==="list"||n.on==="lens")for(let t of A(F!==void 0?y.graph.nodesOfKind(F):[]))r(t.id)&&u({type:"record",id:`record:${t.id}`,label:N(l,t),description:`Open ${N(l,t)}`,record:t.id});else if(n.on==="selection")for(let t of j){let a=r(t);u({type:"record",id:`record:${t}`,label:N(l,a),description:`Open ${N(l,a)}`,record:t})}return{target:n,candidates:C}}var V=e=>e&&`${e[0].toUpperCase()}${e.slice(1)}`,Pe={columns:["board","kanban","column","lane","pipeline","stage","funnel"],board:["board","map","floor","layout","seat","slot"],calendar:["calendar","schedule","date","due","month","week","agenda","deadline","day"],timeline:["timeline","gantt","schedule","roadmap","span"],coverage:["coverage","matrix","grid","gap"],plan:["plan","floor","map","region","area"],blocks:["list","table","summary","overview","dashboard","card"]},De=new Set(["a","an","the","of","for","my","our","me","us","to","with","and","in","on","by","that","which","i","we","want","need","show","open","go","draw","make","new","view","views","panel","panels","page","lens","please","all","every","some","see","can","could","would","like","one","what","is","are","do","does","here","there","how","it","this","these","those"]),Z=e=>e.length>3&&e.endsWith("ies")?`${e.slice(0,-3)}y`:e.length>3&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e,ue=e=>e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,"").split(/[^a-z0-9]+/).filter(Boolean);function Xe(e,n,o){let f=e,d=H(f)?.store??f,c=d.schema,g=oe(d,o.principal),y=d.seenBy(o.principal),l=ne(n),s=new Set;for(let i of l){let p=y.graph.getNode(i)?.kind;p!==void 0&&g.has(p)&&s.add(p)}if(l.length>0&&s.size===0)return[];if(n.on==="list"&&s.add(n.kind),n.on==="lens"){let i=n.kind??o.places.find(p=>p.as===n.place)?.kind;i!==void 0&&s.add(i)}let r=new Map;for(let i of c.kinds){if(!g.has(i))continue;let p=c.tryDefinition(i);for(let S of[i,W(p,i),_(c,i)])for(let R of ue(S))r.set(Z(R),i)}let m=ue(o.said??"").filter(i=>!De.has(i)),k=new Set,C=[];for(let i of m){let p=r.get(Z(i));p!==void 0?k.add(p):C.push(Z(i))}let v=k.size>0?k:s;if((o.said??"").trim()!==""&&m.length===0)return[];if(v.size===0&&m.length===0)return[];let u=[];o.places.forEach((i,p)=>{if(i.hidden||n.on==="lens"&&i.as===n.place)return;let S=i.over??(i.kind!==void 0?[i.kind]:[]);if(S.length>0&&!S.some(P=>g.has(P)))return;let R=S.some(P=>v.has(P)),T=!R&&(i.reads??[]).some(P=>v.has(P));v.size>0&&!R&&!T||u.push({place:i,own:R,reads:T,at:p})});let A=i=>new Set(ue(i.title).map(Z)),j=new Set(C.filter(i=>u.some(({place:p})=>A(p).has(i)))),$=[];for(let{place:i,own:p,reads:S,at:R}of u){let T=A(i),P=new Set((Pe[i.lens??""]??[]).map(Z)),t=C.filter(h=>T.has(h)||P.has(h)&&!j.has(h)).length,a=C.length-t;if(C.length>0&&t===0)continue;let b=!S&&a===0?"full":"partial",O=(p?4:S?2:1)+t*2-a+(b==="full"?1:0);$.push({view:{place:i.as,title:i.title,...i.kind!==void 0?{kind:i.kind}:{},fit:b},score:O,at:R})}return $.filter((i,p)=>!$.slice(0,p).some(S=>S.view.place===i.view.place&&S.view.title===i.view.title)).sort((i,p)=>p.score-i.score||i.at-p.at).slice(0,o.most??3).map(i=>i.view)}var ge=new WeakMap;function Ne(e){let n=2166136261;for(let o=0;o<e.length;o++)n^=e.charCodeAt(o),n=Math.imul(n,16777619)>>>0;return n.toString(36)}function Ie(e,n){let o=e,f=H(o)?.store??o,d=f.schema,c=oe(f,n),y=f.allMutations().filter(u=>!u.destructive&&f.permits({name:u.name,args:{}},n).ok!==!1),l=`${[...c].join(",")}|${y.map(u=>u.name).join(",")}`,s=ge.get(d)?.get(l);if(s)return s;let r=[...c].map(u=>{let A=ie(d,u),j={};for(let[p,S]of Object.entries(te(d,u))){if(A.has(p))continue;let R=X(S);R&&(j[p]=R.type==="enum"?`enum:${(R.options??[]).join("|")}`:R.type)}let $={};for(let[p,S]of Object.entries(Y(d,u)))$[p]=S.to==="*"?[...c]:S.to.filter(R=>c.has(R));let F=d.tryDefinition(u),i=Object.entries(F?.fieldAliases??{}).filter(([p,S])=>p in j&&S.length>0);return{kind:u,noun:W(d.tryDefinition(u),u),plural:_(d,u),fields:j,relations:$,...F?.aliases&&F.aliases.length>0?{aliases:F.aliases}:{},...i.length>0?{fieldAliases:Object.fromEntries(i)}:{}}}),m=y.map(u=>({name:u.name,title:u.title??B(u.name),...u.subject?{on:Q(d,u).filter(A=>c.has(A))}:{}})),k={kinds:r,acts:m},C={version:Ne(JSON.stringify(k)),...k},v=ge.get(d)??new Map;return v.set(l,C),ge.set(d,v),C}var Me=e=>e.name??e.id??e.kind;function en(e,n,o){let f=e,{principal:d}=o,c=H(f)?.store??f,g=c.seenBy(d),y=c.schema,l=oe(c,d),s=i=>{let p=g.graph.getNode(i);return p&&l.has(p.kind)?p:void 0},r=i=>({id:i.id,kind:i.kind,label:N(y,i)}),m=ne(n),k=m.length===1?s(m[0]):void 0,C=k?Object.fromEntries(Object.keys(te(y,k.kind)).filter(i=>!ie(y,k.kind).has(i)&&k[i]!==void 0&&i!=="label").map(i=>[i,k[i]])):{},v={on:n.on,...k?{record:{...r(k),fields:C}}:{},...n.on==="field"&&k?{field:n.field}:{},...n.on==="list"&&l.has(n.kind)?{kind:n.kind}:{},...n.on==="lens"?{place:n.place,...n.kind&&l.has(n.kind)?{kind:n.kind}:{}}:{},...n.on==="place"?{place:n.place}:{},...n.on==="act"?{act:n.act}:{}},u=[...new Set([...n.on==="selection"?n.ids:[],...o.selection??[]])].flatMap(i=>{let p=s(i);return p?[r(p)]:[]}),A=[];if(k){for(let i of Object.keys(Y(y,k.kind)))for(let p of g.graph.out(k.id,i))s(p.id)&&A.push({...r(p),relation:i,direction:"out"});for(let i of y.kinds)for(let p of Object.keys(Y(y,i)))for(let S of g.graph.in(k.id,p))S.kind===i&&s(S.id)&&A.push({...r(S),relation:p,direction:"in"})}let j=g.batches().filter(i=>!i.ops.every(be)).slice(-(o.recent??6)).reverse().map(i=>({intent:i.intent,at:i.at,by:Me(i.author)})),$=(o.purpose?.jobs??[]).filter(i=>Ae(i,d.roles)&&l.has(i.kind)).map(i=>({name:i.name,ask:i.ask,kind:i.kind})),F=o.purpose&&(o.purpose.for!==void 0||$.length>0)?{...o.purpose.for!==void 0?{for:o.purpose.for}:{},jobs:$}:void 0;return{...o.place!==void 0?{place:o.place}:{},target:v,selection:u,neighbors:A.slice(0,24),recent:j,schema:Ie(c,d),...F?{purpose:F}:{},...o.friction?{friction:Oe(o.friction,y,{reader:d})}:{}}}export{Fe as a,Ze as b,ne as c,Qe as d,Xe as e,en as f};
@@ -0,0 +1,50 @@
1
+ import{a as Ft,b as Le,c as Tt,g as Nt,h as ne,i as Mt,j as Ot}from"./chunk.5YNLFOBJ.js";import{p as kt}from"./chunk.HNMSYQRA.js";import{g as St}from"./chunk.RFVOXX3P.js";import{a as vt}from"./chunk.IR4OW67N.js";import{d as wt}from"./chunk.FOSY7MZF.js";import{c as Rt}from"./chunk.NBVPWLRY.js";import{A as Ct,H as Lt,I as Dt,i as yt,j as gt,u as bt,v as Et,y as xt,z as Pt}from"./chunk.MD36ZSM5.js";import{c as Ar}from"./chunk.L6FGKJ5H.js";import{G as M,O as ht,Q as mt,V as ee,ea as pt}from"./chunk.3CJLAJXP.js";import{Vd as lt,Wd as st,Xd as ut,_c as nt,cd as ot,db as at,ga as Ce,le as ct,me as dt,ne as ft,pa as de,rd as it}from"./chunk.J24YPQ5I.js";import{b as D}from"./chunk.AJZBJBMO.js";function _r(e,t){return lt(e,t).slice(1)}function fe(e,t){return e.kinds.find(r=>_r(e,r)===t)}function Mn(e,t,r){return st(e,t,r)}function On(e,t){return ut(e,t)}var _=D(M(),1),g=D(M(),1),x=D(M(),1),Ve=D(M(),1),yr=D(M(),1),S=D(M(),1),nn=D(M(),1),on=D(M(),1),ln=D(M(),1),v=D(M(),1),Dr=D(M(),1);var Ae=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Bt=/^[\\/]{2}/;function $r(e,t){return t+e.replace(/\\/g,"/")}var At="popstate";function ge(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Wt(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((h,y)=>c(h,typeof h=="string"?null:h.state,y===0?"default":void 0,typeof h=="string"?void 0:h.mask));let o=s(r??n.length-1),i="POP",l=null;function s(h){return Math.min(Math.max(h,0),n.length-1)}function u(){return n[o]}function c(h,y=null,p,f){let R=ve(n?u().pathname:"/",h,y,p,f);return O(R.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),R}function d(h){return typeof h=="string"?h:W(h)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let y=typeof h=="string"?V(h):h;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(h,y){i="PUSH";let p=ge(h)?h:c(h,y);o+=1,n.splice(o,n.length,p),a&&l&&l({action:i,location:p,delta:1})},replace(h,y){i="REPLACE";let p=ge(h)?h:c(h,y);n[o]=p,a&&l&&l({action:i,location:p,delta:0})},go(h){i="POP";let y=s(o+h),p=n[y];o=y,l&&l({action:i,location:p,delta:h})},listen(h){return l=h,()=>{l=null}}}}function Yt(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return ve("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:W(n)}return Hr(t,r,null,e)}function L(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function O(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ir(){return Math.random().toString(36).substring(2,10)}function _t(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ve(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?V(t):t,state:r,key:t&&t.key||a||Ir(),mask:n}}function W({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function V(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function Hr(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let f=c(),R=f==null?null:f-u;u=f,s&&s({action:l,location:p.location,delta:R})}function m(f,R){l="PUSH";let w=ge(f)?f:ve(p.location,f,R);r&&r(w,f),u=c()+1;let b=_t(w,u),P=p.createHref(w.mask||w);try{i.pushState(b,"",P)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;n.location.assign(P)}o&&s&&s({action:l,location:p.location,delta:1})}function h(f,R){l="REPLACE";let w=ge(f)?f:ve(p.location,f,R);r&&r(w,f),u=c();let b=_t(w,u),P=p.createHref(w.mask||w);i.replaceState(b,"",P),o&&s&&s({action:l,location:p.location,delta:0})}function y(f){return Ur(n,f)}let p={get action(){return l},get location(){return e(n,i)},listen(f){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(At,d),s=f,()=>{n.removeEventListener(At,d),s=null}},createHref(f){return t(n,f)},createURL:y,encodeLocation(f){let R=y(f);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:m,replace:h,go(f){return i.go(f)}};return p}function Ur(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),L(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:W(t);return n=n.replace(/ $/,"%20"),!r&&Bt.test(n)&&(n=a+n),new URL(n,a)}var jr;jr=new WeakMap;function _e(e,t,r="/"){return zr(e,t,r,!1)}function zr(e,t,r,a,n){let o=typeof t=="string"?V(t):t,i=U(o.pathname||"/",r);if(i==null)return null;let l=n??Wr(e),s=null,u=ta(i);for(let c=0;s==null&&c<l.length;++c)s=ea(l[c],u,a);return s}function Br(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function Wr(e){let t=Vt(e);return Yr(t),t}function Vt(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(a)&&s)return;L(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length)}let d=H([a,c.relativePath]),m=r.concat(c);i.children&&i.children.length>0&&(L(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Vt(i.children,t,m,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:qr(d,i.index),routesMeta:m.map((h,y)=>{let[p,f]=Gt(h.relativePath,h.caseSensitive,y===m.length-1);return{...h,matcher:p,compiledParams:f}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of Jt(i.path))o(i,l,!0,s)}),t}function Jt(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=Jt(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function Yr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Zr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Vr=/^:[\w-]+$/,Jr=3,Kr=2,Gr=1,Xr=10,Qr=-2,$t=e=>e==="*";function qr(e,t){let r=e.split("/"),a=r.length;return r.some($t)&&(a+=Qr),t&&(a+=Kr),r.filter(n=>!$t(n)).reduce((n,o)=>n+(Vr.test(o)?Jr:o===""?Gr:Xr),a)}function Zr(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function ea(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",d={path:s.relativePath,caseSensitive:s.caseSensitive,end:u},m=s.matcher&&s.compiledParams?Kt(d,c,s.matcher,s.compiledParams):ie(d,c),h=s.route;if(!m&&u&&r&&!a[a.length-1].route.index&&(m=ie({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!m)return null;Object.assign(n,m.params),i.push({params:n,pathname:H([o,m.pathname]),pathnameBase:aa(H([o,m.pathnameBase])),route:h}),m.pathnameBase!=="/"&&(o=H([o,m.pathnameBase]))}return i}function ie(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Gt(e.path,e.caseSensitive,e.end);return Kt(e,t,r,a)}function Kt(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=te(o,1),l=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:d},m)=>{if(c==="*"){let y=l[m]||"";i=te(o.slice(0,o.length-y.length),1)}let h=l[m];return d&&!h?u[c]=void 0:u[c]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Gt(e,t=!1,r=!0){O(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,c)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let d=c.charAt(u+i.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function ta(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function U(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Xt(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?V(e):e,o;return r?(r=Qt(r),r.startsWith("/")||r.startsWith("\\")?o=It(r.substring(1),"/"):o=It(r,t)):o=t,{pathname:o,search:na(a),hash:oa(n)}}function It(e,t){let r=te(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function De(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ra(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function $e(e){let t=ra(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Se(e,t,r,a=!1){let n;typeof e=="string"?n=V(e):(n={...e},L(!n.pathname||!n.pathname.includes("?"),De("?","pathname","search",n)),L(!n.pathname||!n.pathname.includes("#"),De("#","pathname","hash",n)),L(!n.search||!n.search.includes("#"),De("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let d=t.length-1;if(!a&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),d-=1;n.pathname=m.join("/")}l=d>=0?t[d]:"/"}let s=Xt(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var Qt=e=>e.replace(/[\\/]{2,}/g,"/"),H=e=>Qt(e.join("/"));function te(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var aa=e=>te(e).replace(/^\/*/,"/"),na=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,oa=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var qt=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Zt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ia(e){let t=e.map(r=>r.route.path).filter(Boolean);return H(t)||"/"}var er=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function tr(e,t){let r=e;if(typeof r!="string"||!Ae.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(er)try{let o=new URL(window.location.href),i=Bt.test(r)?new URL($r(r,o.protocol)):new URL(r),l=U(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{O(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var _n=Symbol("Uninstrumented");var $n=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ht=new URL("http://localhost");function Ie(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),Ht)}catch{return Ht}}function ke(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function la(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function He(e,t,r,a){let n=null;try{n=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),i=n!=null&&!ke(n,r),l=!ke(o,r);if(a==="reject"){if(i||l)throw new Error("External navigation is not allowed")}else if(l&&(n==null||!la(e,n)||!ke(n,o)))throw new Error("External navigation is not allowed")}var rr=["POST","PUT","PATCH","DELETE"],In=new Set(rr),sa=["GET",...rr],Hn=new Set(sa);var Un=Symbol("ResetLoaderData"),ua,ca,da,fa;ua=new WeakMap;ca=new WeakMap;da=new WeakMap;fa=new WeakMap;var ha=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function ma(e){try{return ha.includes(new URL(e).protocol)}catch{return!1}}var G=_.createContext(null);G.displayName="DataRouter";var re=_.createContext(null);re.displayName="DataRouterState";var ar=_.createContext(!1);function pa(){return _.useContext(ar)}var Ue=_.createContext({isTransitioning:!1});Ue.displayName="ViewTransition";var nr=_.createContext(new Map);nr.displayName="Fetchers";var ya=_.createContext(null);ya.displayName="Await";var N=_.createContext(null);N.displayName="Navigation";var X=_.createContext(null);X.displayName="Location";var I=_.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName="Route";var je=_.createContext(null);je.displayName="RouteError";var Ne=!0,or="REACT_ROUTER_ERROR",ga="REDIRECT",va="ROUTE_ERROR_RESPONSE";function Ra(e){if(e.startsWith(`${or}:${ga}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function wa(e){if(e.startsWith(`${or}:${va}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new qt(t.status,t.statusText,t.data)}catch{}}function be(e,{relative:t}={}){L(Q(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=g.useContext(N),{hash:n,pathname:o,search:i}=ae(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:H([r,o])),a.createHref({pathname:l,search:i,hash:n})}function Q(){return g.useContext(X)!=null}function T(){return L(Q(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(X).location}function Sa(){return g.useContext(X).navigationType}var ir="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function lr(e){g.useContext(N).static||g.useLayoutEffect(e)}function q(){let{isDataRoute:e}=g.useContext(I);return e?Na():ba()}function ba(){L(Q(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(G),{basename:t,navigator:r}=g.useContext(N),{matches:a}=g.useContext(I),{pathname:n}=T(),o=JSON.stringify($e(a)),i=g.useRef(!1);return lr(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(O(i.current,ir),!i.current)return;if(typeof s=="number"){r.go(s);return}let c=Se(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:H([t,c.pathname])),He(typeof s=="string"?s:W(s),r.createHref(c),Ie(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var jn=g.createContext(null);function Ea(){let{matches:e}=g.useContext(I);return e[e.length-1]?.params??{}}function ae(e,{relative:t}={}){let{matches:r}=g.useContext(I),{pathname:a}=T(),n=JSON.stringify($e(r));return g.useMemo(()=>Se(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function sr(e,t){return ur(e,t)}function ur(e,t,r){L(Q(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=g.useContext(N),{matches:n}=g.useContext(I),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(Ne){let f=u&&u.path||"";hr(l,!u||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${f}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
+
3
+ Please change the parent <Route path="${f}"> to <Route path="${f==="/"?"*":`${f}/*`}">.`)}let c=T(),d;if(t){let f=typeof t=="string"?V(t):t;L(s==="/"||f.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${f.pathname}" was given in the \`location\` prop.`),d=f}else d=c;let m=d.pathname||"/",h=m;if(s!=="/"){let f=s.replace(/^\//,"").split("/");h="/"+m.replace(/^\//,"").split("/").slice(f.length).join("/")}let y=r&&r.state.matches.length?r.state.matches.map(f=>Object.assign(f,{route:r.manifest[f.route.id]||f.route})):_e(e,{pathname:h});Ne&&(O(u||y!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),O(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let p=Da(y&&y.map(f=>Object.assign({},f,{params:Object.assign({},i,f.params),pathname:H([s,a.encodeLocation?a.encodeLocation(f.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathname]),pathnameBase:f.pathnameBase==="/"?s:H([s,a.encodeLocation?a.encodeLocation(f.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathnameBase])})),n,r);return t&&p?g.createElement(X.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},p):p}function xa(){let e=fr(),t=Zt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return Ne&&(console.error("Error handled by React Router default ErrorBoundary:",e),i=g.createElement(g.Fragment,null,g.createElement("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:o},"ErrorBoundary")," or"," ",g.createElement("code",{style:o},"errorElement")," prop on your route."))),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),r?g.createElement("pre",{style:n},r):null,i)}var Pa=g.createElement(xa,null),cr=class extends g.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=wa(e.digest);r&&(e=r)}let t=e!==void 0?g.createElement(I.Provider,{value:this.props.routeContext},g.createElement(je.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?g.createElement(Ca,{error:e},t):t}};cr.contextType=ar;var Fe=new WeakMap;function Ca({children:e,error:t}){let{basename:r,navigator:a}=g.useContext(N);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=Ra(t.digest);if(n){let o=Fe.get(t);if(o)throw o;let i=tr(n.location,r),l=i.absoluteURL||i.to;if(He(n.location,l,Ie(a),"allow-explicit"),ma(l))throw new Error("Invalid redirect location");if(er&&!Fe.get(t))if(i.isExternal||n.reloadDocument)window.location.href=l;else{let s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:n.replace}));throw Fe.set(t,s),s}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function La({routeContext:e,match:t,children:r}){let a=g.useContext(G);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(I.Provider,{value:e},r)}function Da(e,t=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let n=e,o=a?.errors;if(o!=null){let c=n.findIndex(d=>d.route.id&&o?.[d.route.id]!==void 0);L(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,c+1))}let i=!1,l=-1;if(r&&a){i=a.renderFallback;for(let c=0;c<n.length;c++){let d=n[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=c),d.route.id){let{loaderData:m,errors:h}=a,y=d.route.loader&&!m.hasOwnProperty(d.route.id)&&(!h||h[d.route.id]===void 0);if(d.route.lazy||y){r.isStatic&&(i=!0),l>=0?n=n.slice(0,l+1):n=[n[0]];break}}}}let s=r?.onError,u=a&&s?(c,d)=>{s(c,{location:a.location,params:a.matches?.[0]?.params??{},pattern:ia(a.matches),errorInfo:d})}:void 0;return n.reduceRight((c,d,m)=>{let h,y=!1,p=null,f=null;a&&(h=o&&d.route.id?o[d.route.id]:void 0,p=d.route.errorElement||Pa,i&&(l<0&&m===0?(hr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,f=null):l===m&&(y=!0,f=d.route.hydrateFallbackElement||null)));let R=t.concat(n.slice(0,m+1)),w=()=>{let b;return h?b=p:y?b=f:d.route.Component?b=g.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=c,g.createElement(La,{match:d,routeContext:{outlet:c,matches:R,isDataRoute:a!=null},children:b})};return a&&(d.route.ErrorBoundary||d.route.errorElement||m===0)?g.createElement(cr,{location:a.location,revalidation:a.revalidation,component:p,error:h,children:w(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:u}):w()},null)}function ze(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ka(e){let t=g.useContext(G);return L(t,ze(e)),t}function Be(e){let t=g.useContext(re);return L(t,ze(e)),t}function Fa(e){let t=g.useContext(I);return L(t,ze(e)),t}function We(e){let t=Fa(e),r=t.matches[t.matches.length-1];return L(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Ta(){return We("useRouteId")}function dr(){let e=Be("useNavigation");return g.useMemo(()=>{let{matches:t,historyAction:r,...a}=e.navigation;return a},[e.navigation])}function Ye(){let{matches:e,loaderData:t}=Be("useMatches");return g.useMemo(()=>e.map(r=>Br(r,t)),[e,t])}function fr(){let e=g.useContext(je),t=Be("useRouteError"),r=We("useRouteError");return e!==void 0?e:t.errors?.[r]}function Na(){let{router:e}=ka("useNavigate"),t=We("useNavigate"),r=g.useRef(!1);return lr(()=>{r.current=!0}),g.useCallback(async(n,o={})=>{O(r.current,ir),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var Ut={};function hr(e,t,r){!t&&!Ut[e]&&(Ut[e]=!0,O(!1,r))}var Ma="useOptimistic",zn=x[Ma];var Bn=x.memo(Oa);function Oa({routes:e,manifest:t,future:r,state:a,isStatic:n,onError:o}){return ur(e,void 0,{manifest:t,state:a,isStatic:n,onError:o,future:r})}function Aa({basename:e,children:t,initialEntries:r,initialIndex:a,useTransitions:n}){let o=x.useRef();o.current==null&&(o.current=Wt({initialEntries:r,initialIndex:a,v5Compat:!0}));let i=o.current,[l,s]=x.useState({action:i.action,location:i.location}),u=x.useCallback(c=>{n===!1?s(c):x.startTransition(()=>s(c))},[n]);return x.useLayoutEffect(()=>i.listen(u),[i,u]),x.createElement(Ee,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,useTransitions:n})}function _a({to:e,replace:t,state:r,relative:a}){L(Q(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n,navigator:o}=x.useContext(N);O(!n,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=x.useContext(I),{pathname:l}=T(),s=q(),u=Se(e,$e(i),l,a==="path");He(typeof e=="string"?e:W(e),o.createHref(u),Ie(o),"reject");let c=JSON.stringify(u);return x.useEffect(()=>{s(JSON.parse(c),{replace:t,state:r,relative:a})},[s,c,a,t,r]),null}function mr(e){L(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Ee({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1,useTransitions:i}){L(!Q(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=x.useMemo(()=>({basename:l,navigator:n,static:o,useTransitions:i,future:{}}),[l,n,o,i]);typeof r=="string"&&(r=V(r));let{pathname:u="/",search:c="",hash:d="",state:m=null,key:h="default",mask:y}=r,p=x.useMemo(()=>{let f=U(u,l);return f==null?null:{location:{pathname:f,search:c,hash:d,state:m,key:h,mask:y},navigationType:a}},[l,u,c,d,m,h,a,y]);return O(p!=null,`<Router basename="${l}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),p==null?null:x.createElement(N.Provider,{value:s},x.createElement(X.Provider,{children:t,value:p}))}function $a({children:e,location:t}){return sr(Re(e),t)}function Re(e,t=[]){let r=[];return x.Children.forEach(e,(a,n)=>{if(!x.isValidElement(a))return;let o=[...t,n];if(a.type===x.Fragment){r.push.apply(r,Re(a.props.children,o));return}L(a.type===mr,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),L(!a.props.index||!a.props.children,"An index route cannot have child routes.");let i={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(i.children=Re(a.props.children,o)),r.push(i)}),r}var pe="get",ye="application/x-www-form-urlencoded";function xe(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Ia(e){return xe(e)&&e.tagName.toLowerCase()==="button"}function Ha(e){return xe(e)&&e.tagName.toLowerCase()==="form"}function Ua(e){return xe(e)&&e.tagName.toLowerCase()==="input"}function ja(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function za(e,t){return e.button===0&&(!t||t==="_self")&&!ja(e)}function we(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function Ba(e,t){let r=we(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var he=null;function Wa(){if(he===null)try{new FormData(document.createElement("form"),0),he=!1}catch{he=!0}return he}var Ya=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Te(e){return e!=null&&!Ya.has(e)?(O(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ye}"`),null):e}function Va(e,t){let r,a,n,o,i;if(Ha(e)){let l=e.getAttribute("action");a=l?U(l,t):null,r=e.getAttribute("method")||pe,n=Te(e.getAttribute("enctype"))||ye,o=new FormData(e)}else if(Ia(e)||Ua(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(a=s?U(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||pe,n=Te(e.getAttribute("formenctype"))||Te(l.getAttribute("enctype"))||ye,o=new FormData(l,e),!Wa()){let{name:u,type:c,value:d}=e;if(c==="image"){let m=u?`${u}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else u&&o.append(u,d)}}else{if(xe(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=pe,a=null,n=ye,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}var Wn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ja={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Ka=/[&><\u2028\u2029]/g;function jt(e){return e.replace(Ka,t=>Ja[t])}function Je(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var Ga=Symbol("SingleFetchRedirect");function pr(e,t,r,a){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${a}`:n.pathname=`${n.pathname}.${a}`:n.pathname==="/"?n.pathname=`_root.${a}`:t&&U(n.pathname,t)==="/"?n.pathname=`${te(t)}/_root.${a}`:n.pathname=`${te(n.pathname)}.${a}`,n}async function Xa(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&import.meta.hot)throw r;return window.location.reload(),new Promise(()=>{})}}function Qa(e){return e!=null&&typeof e.page=="string"}function qa(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Za(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await Xa(o,r);return i.links?i.links():[]}return[]}));return an(a.flat(1).filter(qa).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function zt(e,t,r,a,n,o){let i=(s,u)=>r[u]?s.route.id!==r[u].route.id:!0,l=(s,u)=>r[u].pathname!==s.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==s.params["*"];return o==="assets"?t.filter((s,u)=>i(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{let c=a.routes[s.route.id];if(!c||!c.hasLoader)return!1;if(i(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let d=s.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function en(e,t,{includeHydrateFallback:r}={}){return tn(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function tn(e){return[...new Set(e)]}function rn(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function an(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!Qa(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let l=JSON.stringify(rn(o));return r.has(l)||(r.add(l),n.push({key:l,link:o})),n},[])}function Ke(){let e=S.useContext(G);return Je(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function sn(){let e=S.useContext(re);return Je(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var le=S.createContext(void 0);le.displayName="FrameworkContext";function Pe(){let e=S.useContext(le);return Je(e,"You must render this element inside a <HydratedRouter> element"),e}function un(e,t){let r=S.useContext(le),[a,n]=S.useState(!1),[o,i]=S.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,m=S.useRef(null);S.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let p=R=>{R.forEach(w=>{i(w.isIntersecting)})},f=new IntersectionObserver(p,{threshold:.5});return m.current&&f.observe(m.current),()=>{f.disconnect()}}},[e]),S.useEffect(()=>{if(a){let p=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(p)}}},[a]);let h=()=>{n(!0)},y=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,m,{}]:[o,m,{onFocus:oe(l,h),onBlur:oe(s,y),onMouseEnter:oe(u,h),onMouseLeave:oe(c,y),onTouchStart:oe(d,h)}]:[!1,m,{}]}function oe(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function gr({page:e,...t}){let r=pa(),{nonce:a}=Pe(),{router:n}=Ke(),o=S.useMemo(()=>_e(n.routes,e,n.basename),[n.routes,e,n.basename]);return o?(t.nonce==null&&a&&(t={...t,nonce:a}),r?S.createElement(dn,{page:e,matches:o,...t}):S.createElement(fn,{page:e,matches:o,...t})):null}function cn(e){let{manifest:t,routeModules:r}=Pe(),[a,n]=S.useState([]);return S.useEffect(()=>{let o=!1;return Za(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function dn({page:e,matches:t,...r}){let a=T(),{future:n}=Pe(),{basename:o}=Ke(),i=S.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let l=pr(e,o,n.v8_trailingSlashAwareDataRequests,"rsc"),s=!1,u=[];for(let c of t)typeof c.route.shouldRevalidate=="function"?s=!0:u.push(c.route.id);return s&&u.length>0&&l.searchParams.set("_routes",u.join(",")),[l.pathname+l.search]},[o,n.v8_trailingSlashAwareDataRequests,e,a,t]);return S.createElement(S.Fragment,null,i.map(l=>S.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...r})))}function fn({page:e,matches:t,...r}){let a=T(),{future:n,manifest:o,routeModules:i}=Pe(),{basename:l}=Ke(),{loaderData:s,matches:u}=sn(),c=S.useMemo(()=>zt(e,t,u,o,a,"data"),[e,t,u,o,a]),d=S.useMemo(()=>zt(e,t,u,o,a,"assets"),[e,t,u,o,a]),m=S.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let p=new Set,f=!1;if(t.forEach(w=>{let b=o.routes[w.route.id];!b||!b.hasLoader||(!c.some(P=>P.route.id===w.route.id)&&w.route.id in s&&i[w.route.id]?.shouldRevalidate||b.hasClientLoader?f=!0:p.add(w.route.id))}),p.size===0)return[];let R=pr(e,l,n.v8_trailingSlashAwareDataRequests,"data");return f&&p.size>0&&R.searchParams.set("_routes",t.filter(w=>p.has(w.route.id)).map(w=>w.route.id).join(",")),[R.pathname+R.search]},[l,n.v8_trailingSlashAwareDataRequests,s,a,o,c,t,e,i]),h=S.useMemo(()=>en(d,o),[d,o]),y=cn(d);return S.createElement(S.Fragment,null,m.map(p=>S.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...r})),h.map(p=>S.createElement("link",{key:p,rel:"modulepreload",href:p,...r})),y.map(({key:p,link:f})=>S.createElement("link",{key:p,nonce:r.nonce,...f,crossOrigin:f.crossOrigin??r.crossOrigin})))}function hn(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var mn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{mn&&(window.__reactRouterVersion="7.18.3")}catch{}function pn({basename:e,children:t,useTransitions:r,window:a}){let n=v.useRef();n.current==null&&(n.current=Yt({window:a,v5Compat:!0}));let o=n.current,[i,l]=v.useState({action:o.action,location:o.location}),s=v.useCallback(u=>{r===!1?l(u):v.startTransition(()=>l(u))},[r]);return v.useLayoutEffect(()=>o.listen(s),[o,s]),v.createElement(Ee,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o,useTransitions:r})}function vr({basename:e,children:t,history:r,useTransitions:a}){let[n,o]=v.useState({action:r.action,location:r.location}),i=v.useCallback(l=>{a===!1?o(l):v.startTransition(()=>o(l))},[a]);return v.useLayoutEffect(()=>r.listen(i),[r,i]),v.createElement(Ee,{basename:e,children:t,location:n.location,navigationType:n.action,navigator:r,useTransitions:a})}vr.displayName="unstable_HistoryRouter";var se=v.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,mask:l,state:s,target:u,to:c,preventScrollReset:d,viewTransition:m,defaultShouldRevalidate:h,...y},p){let{basename:f,navigator:R,useTransitions:w}=v.useContext(N),b=typeof c=="string"&&Ae.test(c),P=tr(c,f);c=P.to;let E=be(c,{relative:n}),F=T(),k=null;if(l){let Y=Se(l,[],F.mask?F.mask.pathname:"/",!0);f!=="/"&&(Y.pathname=Y.pathname==="/"?f:H([f,Y.pathname])),k=R.createHref(Y)}let[$,K,B]=un(a,y),ue=Er(c,{replace:i,mask:l,state:s,target:u,preventScrollReset:d,relative:n,viewTransition:m,defaultShouldRevalidate:h,useTransitions:w});function Z(Y){t&&t(Y),Y.defaultPrevented||ue(Y)}let ce=!(P.isExternal||o),rt=v.createElement("a",{...y,...B,href:(ce?k:void 0)||P.absoluteURL||E,onClick:ce?Z:t,ref:hn(p,K),target:u,"data-discover":!b&&r==="render"?"true":void 0});return $&&!b?v.createElement(v.Fragment,null,rt,v.createElement(gr,{page:E})):rt});se.displayName="Link";var Rr=v.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:l,children:s,...u},c){let d=ae(i,{relative:u.relative}),m=T(),h=v.useContext(re),{navigator:y,basename:p}=v.useContext(N),f=h!=null&&Lr(d)&&l===!0,R=y.encodeLocation?y.encodeLocation(d).pathname:d.pathname,w=m.pathname,b=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;r||(w=w.toLowerCase(),b=b?b.toLowerCase():null,R=R.toLowerCase()),b&&p&&(b=U(b,p)||b);let P=R!=="/"&&R.endsWith("/")?R.length-1:R.length,E=w===R||!n&&w.startsWith(R)&&w.charAt(P)==="/",F=b!=null&&(b===R||!n&&b.startsWith(R)&&b.charAt(R.length)==="/"),k={isActive:E,isPending:F,isTransitioning:f},$=E?t:void 0,K;typeof a=="function"?K=a(k):K=[a,E?"active":null,F?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let B=typeof o=="function"?o(k):o;return v.createElement(se,{...u,"aria-current":$,className:K,ref:c,style:B,to:i,viewTransition:l},typeof s=="function"?s(k):s)});Rr.displayName="NavLink";var wr=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=pe,action:l,onSubmit:s,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:m,...h},y)=>{let{useTransitions:p}=v.useContext(N),f=xr(),R=Pr(l,{relative:u}),w=i.toLowerCase()==="get"?"get":"post",b=typeof l=="string"&&Ae.test(l);return v.createElement("form",{ref:y,method:w,action:R,onSubmit:a?s:E=>{if(s&&s(E),E.defaultPrevented)return;E.preventDefault();let F=E.nativeEvent.submitter,k=F?.getAttribute("formmethod")||i,$=()=>f(F||E.currentTarget,{fetcherKey:t,method:k,navigate:r,replace:n,state:o,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:m});p&&r!==!1?v.startTransition(()=>$()):$()},...h,"data-discover":!b&&e==="render"?"true":void 0})});wr.displayName="Form";function Sr({getKey:e,storageKey:t,...r}){let a=v.useContext(le),{basename:n}=v.useContext(N),o=T(),i=Ye();Cr({getKey:e,storageKey:t});let l=v.useMemo(()=>{if(!a||!e)return null;let u=Oe(o,i,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let s=((u,c)=>{if(!window.history.state||!window.history.state.key){let d=Math.random().toString(32).slice(2);window.history.replaceState({key:d},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(d){console.error(d),sessionStorage.removeItem(u)}}).toString();return r.nonce==null&&a?.nonce&&(r.nonce=a.nonce),v.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${jt(JSON.stringify(t||Me))}, ${jt(JSON.stringify(l))})`}})}Sr.displayName="ScrollRestoration";function br(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ge(e){let t=v.useContext(G);return L(t,br(e)),t}function yn(e){let t=v.useContext(re);return L(t,br(e)),t}function Er(e,{target:t,replace:r,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let c=q(),d=T(),m=ae(e,{relative:i});return v.useCallback(h=>{if(za(h,t)){h.preventDefault();let y=r!==void 0?r:W(d)===W(m),p=()=>c(e,{replace:y,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s});u?v.startTransition(()=>p()):p()}},[d,c,m,r,a,n,t,e,o,i,l,s,u])}function Xe(e){O(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(we(e)),r=v.useRef(!1),a=T(),n=v.useMemo(()=>Ba(a.search,r.current?null:t.current),[a.search]),o=q(),i=v.useCallback((l,s)=>{let u=we(typeof l=="function"?l(new URLSearchParams(n)):l);r.current=!0,o("?"+u,s)},[o,n]);return[n,i]}var gn=0,vn=()=>`__${String(++gn)}__`;function xr(){let{router:e}=Ge("useSubmit"),{basename:t}=v.useContext(N),r=Ta(),a=e.fetch,n=e.navigate;return v.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:c,body:d}=Va(o,t);if(i.navigate===!1){let m=i.fetcherKey||vn();await a(m,r,i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await n(i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[a,n,t,r])}function Pr(e,{relative:t}={}){let{basename:r}=v.useContext(N),a=v.useContext(I);L(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...ae(e||".",{relative:t})},i=T();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(c=>c==="")){l.delete("index"),s.filter(d=>d).forEach(d=>l.append("index",d));let c=l.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:H([r,o.pathname])),W(o)}var Me="react-router-scroll-positions",me={};function Oe(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:U(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function Cr({getKey:e,storageKey:t}={}){let{router:r}=Ge("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=yn("useScrollRestoration"),{basename:o}=v.useContext(N),i=T(),l=Ye(),s=dr();v.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Rn(v.useCallback(()=>{if(s.state==="idle"){let u=Oe(i,l,o,e);me[u]=window.scrollY}try{sessionStorage.setItem(t||Me,JSON.stringify(me))}catch(u){O(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(v.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||Me);u&&(me=JSON.parse(u))}catch{}},[t]),v.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(me,()=>window.scrollY,e?(c,d)=>Oe(c,d,o,e):void 0);return()=>u&&u()},[r,o,e]),v.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{O(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}n!==!0&&window.scrollTo(0,0)}},[i,a,n]))}function Rn(e,t){let{capture:r}=t||{};v.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function Lr(e,{relative:t}={}){let r=v.useContext(Ue);L(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Ge("useViewTransitionState"),n=ae(e,{relative:t});if(!r.isTransitioning)return!1;let o=U(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=U(r.nextLocation.pathname,a)||r.nextLocation.pathname;return ie(n.pathname,i)!=null||ie(n.pathname,o)!=null}var Qe=D(M(),1),kr=D(Ar(),1);var j=D(ee(),1);function Fr({context:e,own:t}){ne(e.store);let r=pt(),a=mt()?.live??e.store;ne(a);let n=St();if(!r||a.batches().length===0&&n===0)return null;let o=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Qe.Suspense,{fallback:null,children:(0,j.jsx)(kt,{})}),(0,j.jsx)(Qe.Suspense,{fallback:null,children:(0,j.jsx)(Ft,{})})]});return t?(0,kr.createPortal)(o,t):(0,j.jsx)("div",{className:"graview-bar-own",children:o})}var A=D(M(),1);var J=D(M(),1),wn=(0,J.createContext)(null);function ui(){let e=new Map,t=new Set,r=()=>{for(let a of t)a()};return{count:a=>e.get(a)??0,place(a){return e.set(a,(e.get(a)??0)+1),r(),()=>{e.set(a,(e.get(a)??1)-1),r()}},subscribe(a){return t.add(a),()=>t.delete(a)}}}function Tr(e){let t=(0,J.useContext)(wn);(0,J.useLayoutEffect)(()=>t?.place(e),[t,e])}function ci(e,t){return(0,J.useSyncExternalStore)(e.subscribe,()=>e.count(t)>0,()=>!1)}var Nr=D(M(),1),z=D(ee(),1),qe="var(--graview-text-small)",Ze="var(--graview-text-body)",gi="var(--graview-font-display, var(--graview-font-body, system-ui))",et={maxWidth:760,margin:"0 auto",padding:"40px var(--graview-page-gutter, 20px) max(96px, calc(var(--graview-foot-room, 0px) + env(safe-area-inset-bottom, 0px)))",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40},tt=1160,vi={...et,maxWidth:tt},Mr={margin:0,fontSize:"var(--graview-text-title)",lineHeight:1.2,letterSpacing:"-0.012em",overflowWrap:"anywhere",textWrap:"balance"},Ri={margin:0,fontSize:"var(--graview-text-heading)",lineHeight:1.3,textWrap:"balance"},wi={margin:0,fontSize:qe,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Si={margin:0,fontSize:Ze,color:"var(--graview-ink-muted)",maxWidth:"60ch"},Or={color:"var(--graview-ink-muted)",fontSize:qe},bi={borderTop:"1px solid var(--graview-edge)",paddingTop:24},Sn={color:"var(--graview-accent)",textDecorationColor:"color-mix(in srgb, currentColor 50%, transparent)",textDecorationThickness:1,textUnderlineOffset:"0.2em",display:"inline-flex",alignItems:"center",columnGap:"0.3em",minHeight:24},Ei={...Sn,textDecoration:"none"},xi={color:"inherit",textDecoration:"none",display:"inline-flex",alignItems:"center",minHeight:24},Pi=`.graview-list{container-type:inline-size}
4
+ .graview-rows{display:grid;grid-template-columns:minmax(0,1fr);column-gap:1.5rem;margin:0;padding:0;list-style:none;border-top:1px solid var(--graview-edge)}
5
+ .graview-row{grid-column:1/-1;display:grid;grid-template-columns:subgrid;align-items:baseline;align-content:center;position:relative;box-sizing:border-box;min-height:2.75rem;padding:.5rem 0;border-bottom:1px solid var(--graview-edge);overflow-wrap:anywhere}
6
+ .graview-row-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-height:24px;color:inherit;text-decoration:none;font-size:var(--graview-text-body);font-weight:500;line-height:1.3;text-wrap:pretty;hyphens:manual}
7
+ .graview-row-title::after{content:"";position:absolute;inset:0}
8
+ .graview-row-title:focus-visible{outline:0}
9
+ .graview-row-title:focus-visible::after{outline:2px solid var(--graview-accent);outline-offset:-2px;border-radius:var(--graview-radius-sm)}
10
+ .graview-row:hover .graview-row-title{text-decoration:underline 1px color-mix(in srgb,currentColor 50%,transparent);text-underline-offset:.2em}
11
+ .graview-row:active .graview-row-title{color:var(--graview-accent)}
12
+ .graview-row :is(a,button):not(.graview-row-title){position:relative}
13
+ .graview-row-glance,.graview-row>[data-testid=search-why]{font-size:var(--graview-text-small);line-height:1.5;color:var(--graview-ink-muted)}
14
+ .graview-row>[data-testid=search-why]{grid-column:1/-1}
15
+ .graview-row-glance{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
16
+ .graview-chip{display:inline-block;padding:0 .5em;border-radius:var(--graview-radius-sm);background:color-mix(in srgb,var(--graview-ink) 7%,transparent);color:var(--graview-ink);font-weight:500;line-height:1.6;white-space:nowrap}
17
+ .graview-group-head{display:flex;gap:.5em;align-items:baseline;margin:0;padding:.375rem 0;font-family:var(--graview-font-body);font-size:var(--graview-text-small);font-weight:var(--graview-weight-label);line-height:1.3;letter-spacing:.02em;scroll-margin-top:4rem}
18
+ .graview-group-head>span{color:var(--graview-ink-muted);font-weight:var(--graview-weight-body)}
19
+ .graview-group-toggle{display:inline-flex;gap:.5em;align-items:center;min-height:2.75rem;margin:-.375rem 0;padding:0 .5rem 0 0;border:0;background:none;color:inherit;font:inherit;letter-spacing:inherit;text-align:start;cursor:pointer;border-radius:var(--graview-radius-sm)}
20
+ .graview-group-toggle:focus-visible{outline:2px solid var(--graview-accent);outline-offset:2px}
21
+ .graview-group-toggle>span{color:var(--graview-ink-muted);font-weight:var(--graview-weight-body)}
22
+ @container (min-width:36rem){.graview-rows{grid-template-columns:minmax(0,1fr) fit-content(40%)}.graview-group-head:has(+.graview-rows){position:sticky;top:0;z-index:${it.raised};background:var(--graview-ground)}}`,Ci={font:"inherit",fontSize:qe,padding:"8px 14px",borderRadius:"var(--graview-radius-sm, 8px)",border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)",color:"var(--graview-ink)",cursor:"pointer"};function Li({kind:e,brand:t,size:r=10,schema:a}){return(0,z.jsx)(vt,{kind:e,...a?{schema:a}:{},...t?{brand:t}:{},size:Math.round(r*1.6)})}function Di(e,t){let a=[...new Set(t.targets.map(n=>n.kind))].map(n=>e.schema.tryDefinition(n)?.plural??Ce(n));return a.length>0?a.join(" and "):Ce(t.edgeKind)}function ki(e,t,r){return e.author.kind==="human"&&(e.author.id===void 0||t?.id===void 0||e.author.id===t.id)?"you":r?at(e.author,r):e.author.kind==="agent"?e.author.id??"an agent":e.author.id??e.author.kind}function Fi(e,t,r){return bn(e,t,r).map(a=>a.text).join(" \xB7 ")}function bn(e,t,r,a=()=>!1){return wt(e,t,{limit:3,said:[r],glance:!0}).map(n=>n.long?{text:Rt(n.stored,{markdown:n.markdown,most:100})}:a(n.key)?{text:n.alone,choice:n.key}:{text:n.alone})}function Ti({runs:e}){return(0,z.jsx)(z.Fragment,{children:e.map((t,r)=>{let a=r===0?"":t.choice===void 0&&e[r-1].choice===void 0?" \xB7 ":" ";return(0,z.jsx)(Nr.Fragment,{children:t.choice!==void 0?(0,z.jsxs)(z.Fragment,{children:[a,(0,z.jsx)("span",{className:"graview-chip","data-graview-field":t.choice,children:t.text})]}):`${a}${t.text}`},r)})})}var Ni=(e,t)=>de(e.schema,t),En=(e,t)=>{let r=e.kindsKeptFrom(t);return e.schema.kinds.filter(a=>!e.modules.disabledKinds.has(a)&&!r.has(a))},xn=e=>ft(En(e.store,e.principal),e.views?.arrangement?.()?.order),Mi=e=>{let t=new Set(e.views?.arrangement?.()?.hide??[]);return xn(e).filter(r=>!t.has(r))},Oi=e=>e.charAt(0).toUpperCase()+e.slice(1);var C=D(ee(),1);function Ji({context:e,children:t}){let{store:r,brand:a}=e;ne(r);let n=ht();return yt(e.embedded?void 0:ot(e.assetsAt??n,nt(a))),gt(e.embedded?void 0:a),(0,C.jsxs)("div",{style:{...e.embedded?{}:{minHeight:"100vh"},display:"flex",flexDirection:"column",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)",fontSize:Ze,lineHeight:1.5},children:[e.embedded?null:(0,C.jsx)(Cn,{context:e}),(0,C.jsx)("div",{style:{flex:1},children:t}),e.remembers?(0,C.jsx)("footer",{style:{borderTop:"1px solid var(--graview-edge)",padding:"14px 20px max(20px, calc(var(--graview-foot-room, 0px) + env(safe-area-inset-bottom, 0px)))",...Or},children:(0,C.jsx)("div",{style:{maxWidth:tt,margin:"0 auto",display:"flex",gap:14,flexWrap:"wrap",alignItems:"center",justifyContent:"flex-end"},children:(0,C.jsxs)("span",{"data-testid":"remembered",children:["Remembered in this browser \xB7 ",(0,C.jsx)(Nt,{})]})})}):null]})}var Pn=(0,A.createContext)(null);function Cn({context:e}){let{store:t,brand:r,sceneHref:a="/",invariantContext:n}=e,o=T(),i=q(),l=be("/").replace(/\/$/,""),s=(0,A.useContext)(Pn),u=s?.places===!1?[]:bt({store:t,principal:e.principal,views:e.views}),c=e.views?.arrangement?.(),d=`${o.pathname}${o.search}`,m=t.violations(n),h=m.length,y=Lt(m,"All rules hold"),p=o.pathname.split("/").filter(Boolean),f=p.length===2&&fe(t.schema,p[0])!==void 0&&t.graph.getNode(decodeURIComponent(p[1]))!==void 0;return(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(Pt,{brand:r,name:r?.name??"Graview",description:r?.subtitle,home:{href:`${l}/`,go:()=>i("/"),current:o.pathname==="/"},faces:{scene:{label:ct(c),current:!1,go:()=>window.location.assign(a)},pages:{label:dt(c),current:!0,go:()=>{}}},places:u,current:Et(u,d),reach:{href:R=>`${l}${R}`,go:R=>i(R.path)},...s?{onFind:s.onFind,find:s.find}:{findBox:(0,C.jsx)(Fn,{context:e})},skips:(0,C.jsx)(Tt,{to:[{label:"Skip to the content",testid:"content",go:()=>{let R=document.querySelector("[data-graview-skip-target]");Le(R?.querySelector('[data-graview-choose-box][tabindex="0"]')??R??document.querySelector("main"))}},...f?[{label:"Skip to what can be done",testid:"acts",go:()=>void Le(document.querySelector("main [data-affordance]:not([disabled]):not([tabindex='-1'])")??document.querySelector("main [data-affordance]:not([disabled])")??document.querySelector("main"))}]:[]]}),tools:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(se,{to:"/problems","data-testid":"standing-link","aria-label":y,title:y,style:{...xt,padding:h===0?0:"0 8px",textDecoration:"none",fontWeight:600,fontVariantNumeric:"tabular-nums",color:h===0?"var(--graview-ink-muted)":"var(--graview-warn)"},children:[(0,C.jsx)(Dt,{tone:h===0?"var(--graview-good)":"var(--graview-warn)"}),h>0?(0,C.jsx)("span",{"aria-hidden":"true",children:h}):null]}),s?null:(0,C.jsx)(Fr,{context:e}),e.views?(0,C.jsx)(Ct,{...e.signature?{signature:!0}:{}}):null]})})})}function Ki({context:e,style:t,bleedTop:r,children:a,...n}){let o=e.embedded||e.framed?"section":"main";return(0,C.jsxs)(o,{style:{...et,...t},"data-graview-page-main":"",...r?{"data-graview-bleed-top":""}:{},...n,children:[r?(0,C.jsx)("style",{children:Ln}):null,a]})}var Ln="@media (max-width:680px){[data-graview-bleed-top]:not(:has([data-graview-bleed]>[data-worker-view-fallback])){padding-top:0 !important}}";function Gi({when:e,children:t}){return e?(0,C.jsxs)("div",{"data-graview-bleed":"",style:{display:"grid",minWidth:0},children:[(0,C.jsx)("style",{children:Dn}),t]}):(0,C.jsx)(C.Fragment,{children:t})}var Dn="@media (max-width:680px){[data-graview-bleed]:not(:has(>[data-worker-view-fallback])){margin-inline:min(0px,calc(env(safe-area-inset-left,0px) - var(--graview-page-gutter,20px))) min(0px,calc(env(safe-area-inset-right,0px) - var(--graview-page-gutter,20px)))}}",kn={position:"absolute",width:1,height:1,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"};function Xi({context:e,unseen:t,children:r,...a}){let n=`h${e.titleLevel??(e.framed&&!e.barAbove?1:2)}`;return(0,C.jsx)(n,{style:t?kn:Mr,"data-graview-page-title":"",...a,children:r})}function Fn({context:e,narrowsLists:t=!0,className:r,size:a}){Tr("find");let n=T(),o=q(),[i,l]=Xe(),s=n.pathname.split("/").filter(Boolean),u=t&&s.length===1&&fe(e.store.schema,s[0])!==void 0,c=n.pathname==="/search",d=u||c?i.get("q")??"":"",m=u?`Narrow ${de(e.store.schema,fe(e.store.schema,s[0])).toLowerCase()}\u2026`:"",[h,y]=(0,A.useState)(!0);(0,A.useLayoutEffect)(()=>{let P=R.current;if(!P||!m||typeof ResizeObserver>"u")return;let E=()=>{let k=getComputedStyle(P),$=document.createElement("canvas").getContext("2d");$&&($.font=`${k.fontWeight} ${k.fontSize} ${k.fontFamily}`,y($.measureText(m).width<=P.clientWidth-parseFloat(k.paddingLeft)-parseFloat(k.paddingRight)))};E();let F=new ResizeObserver(E);return F.observe(P),()=>F.disconnect()},[m]);let[p,f]=(0,A.useState)(d),R=(0,A.useRef)(null);(0,A.useEffect)(()=>{let P=E=>{if(E.defaultPrevented||E.altKey)return;let F=!E.shiftKey&&(E.metaKey||E.ctrlKey)&&E.key.toLowerCase()==="k",k=document.activeElement,$=k instanceof HTMLInputElement||k instanceof HTMLTextAreaElement||k instanceof HTMLSelectElement||k instanceof HTMLElement&&k.isContentEditable,K=E.key==="/"&&!E.metaKey&&!E.ctrlKey&&!$;if(!F&&!K)return;let B=R.current,ue=B?.closest("[data-graview-embed]"),Z=E.target,ce=Z===document.body||Z===document.documentElement;!B||!(ce||!ue||Z instanceof Node&&ue.contains(Z))||(E.preventDefault(),B.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),requestAnimationFrame(()=>{B.focus(),B.select()}))};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[]);let w=(0,A.useRef)(new Set([d]));(0,A.useEffect)(()=>{w.current.has(d)||(w.current=new Set([d]),f(d))},[d]);let b=P=>{if(f(P),w.current.add(P),u){let F=new URLSearchParams(i);P.trim()?F.set("q",P):F.delete("q"),l(F,{replace:!0});return}let E=P.trim()?`/search?${new URLSearchParams({q:P}).toString()}`:"/search";o(E,{replace:c})};return(0,C.jsxs)("form",{role:"search","aria-label":u?"Narrow this list":"Find anything",className:Ot("graview-find",r),...Mt(a),onSubmit:P=>{P.preventDefault(),u&&p.trim()&&o(`/search?${new URLSearchParams({q:p}).toString()}`)},children:[(0,C.jsx)("input",{ref:R,type:"search","data-testid":"nav-find",value:p,onChange:P=>b(P.target.value),placeholder:u?h?m:"Narrow\u2026":"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K","aria-label":u?"Narrow this list":"Find anything",className:"graview-find-box"}),(0,C.jsx)("style",{children:Tn})]})}var Tn=`:where(.graview-find){display:flex;min-width:0;flex:1 1 auto}
23
+ :where(.graview-find[data-size=md]){--graview-control-height:36px}
24
+ :where(.graview-find-box){box-sizing:border-box;width:100%;min-width:0;height:var(--graview-control-height,30px);padding:0 var(--graview-bar-find-end,10px) 0 10px;font:inherit;font-size:.875rem;color:var(--graview-ink);background:var(--graview-ground);border:1px solid var(--graview-edge);border-radius:8px}`;export{_r as a,fe as b,Mn as c,On as d,qe as e,gi as f,vi as g,Ri as h,wi as i,Si as j,Or as k,bi as l,Sn as m,Ei as n,xi as o,Pi as p,Ci as q,Li as r,Di as s,ki as t,Fi as u,bn as v,Ti as w,Ni as x,En as y,xn as z,Mi as A,Oi as B,Fr as C,be as D,T as E,Sa as F,q as G,Ea as H,Aa as I,_a as J,mr as K,$a as L,pn as M,se as N,Xe as O,wn as P,ui as Q,ci as R,Ji as S,Pn as T,Ki as U,Gi as V,Xi as W,Fn as X};
25
+ /*! Bundled license information:
26
+
27
+ react-router/dist/development/chunk-BV7QT456.mjs:
28
+ (**
29
+ * react-router v7.18.3
30
+ *
31
+ * Copyright (c) Remix Software Inc.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE.md file in the root directory of this source tree.
35
+ *
36
+ * @license MIT
37
+ *)
38
+
39
+ react-router/dist/development/index.mjs:
40
+ (**
41
+ * react-router v7.18.3
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ *)
50
+ */
@@ -1,4 +1,4 @@
1
- import{G as I}from"./chunk.CYTTZOYL.js";import{$c as x,Rc as $,Sc as k,Tc as y,Uc as _,Vc as O,ld as S,nd as T,qd as E,rd as R}from"./chunk.Q4MI53KK.js";import{a as b}from"./chunk.AJZBJBMO.js";var N=b(l=>{"use strict";var V=I();function D(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var s={d:{f:d,r:function(){throw Error(D(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},j=Symbol.for("react.portal");function W(r,e,a){var t=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:j,key:t==null?null:""+t,children:r,containerInfo:e,implementation:a}}var u=V.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s;l.createPortal=function(r,e){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(D(299));return W(r,e,null,a)};l.flushSync=function(r){var e=u.T,a=s.p;try{if(u.T=null,s.p=2,r)return r()}finally{u.T=e,s.p=a,s.d.f()}};l.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,s.d.C(r,e))};l.prefetchDNS=function(r){typeof r=="string"&&s.d.D(r)};l.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var a=e.as,t=h(a,e.crossOrigin),n=typeof e.integrity=="string"?e.integrity:void 0,i=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?s.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:t,integrity:n,fetchPriority:i}):a==="script"&&s.d.X(r,{crossOrigin:t,integrity:n,fetchPriority:i,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};l.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=h(e.as,e.crossOrigin);s.d.M(r,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&s.d.M(r)};l.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,t=h(a,e.crossOrigin);s.d.L(r,a,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};l.preloadModule=function(r,e){if(typeof r=="string")if(e){var a=h(e.as,e.crossOrigin);s.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else s.d.m(r)};l.requestFormReset=function(r){s.d.r(r)};l.unstable_batchedUpdates=function(r,e){return r(e)};l.useFormState=function(r,e,a){return u.H.useFormState(r,e,a)};l.useFormStatus=function(){return u.H.useHostTransitionStatus()};l.version="19.2.8"});var Y=b((J,P)=>{"use strict";function L(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(L)}catch(r){console.error(r)}}L(),P.exports=N()});var B={name:"Graview",typography:{body:y.body,mono:y.mono},schemes:k},A={ground:"--graview-ground",groundDeep:"--graview-ground-deep",wash:"--graview-wash",panel:"--graview-panel",panelMuted:"--graview-panel-muted",panelWarning:"--graview-panel-warning",edge:"--graview-edge",edgeBright:"--graview-edge-bright",ink:"--graview-ink",inkMuted:"--graview-ink-muted",inkFaint:"--graview-ink-faint",accent:"--graview-accent",accentDim:"--graview-accent-dim",accentInk:"--graview-accent-ink",warn:"--graview-warn",good:"--graview-good",bad:"--graview-bad",glow:"--graview-glow",bar:"--graview-bar",float:"--graview-float",liftLow:"--graview-lift-low",liftHigh:"--graview-lift-high",tintAlpha:"--graview-tint-alpha",tintLightness:"--graview-tint-lightness",gridAlpha:"--graview-grid-alpha"};function H(r){return Object.keys(A).map(e=>` ${A[e]}: ${r[e]};`).join(`
1
+ import{G as I}from"./chunk.3CJLAJXP.js";import{Sc as $,Tc as k,Uc as y,Vc as _,Wc as O,ad as x,nd as S,pd as T,sd as E,td as R}from"./chunk.J24YPQ5I.js";import{a as b}from"./chunk.AJZBJBMO.js";var N=b(l=>{"use strict";var V=I();function D(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var s={d:{f:d,r:function(){throw Error(D(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},j=Symbol.for("react.portal");function W(r,e,a){var t=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:j,key:t==null?null:""+t,children:r,containerInfo:e,implementation:a}}var u=V.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s;l.createPortal=function(r,e){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(D(299));return W(r,e,null,a)};l.flushSync=function(r){var e=u.T,a=s.p;try{if(u.T=null,s.p=2,r)return r()}finally{u.T=e,s.p=a,s.d.f()}};l.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,s.d.C(r,e))};l.prefetchDNS=function(r){typeof r=="string"&&s.d.D(r)};l.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var a=e.as,t=h(a,e.crossOrigin),n=typeof e.integrity=="string"?e.integrity:void 0,i=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?s.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:t,integrity:n,fetchPriority:i}):a==="script"&&s.d.X(r,{crossOrigin:t,integrity:n,fetchPriority:i,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};l.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=h(e.as,e.crossOrigin);s.d.M(r,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&s.d.M(r)};l.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,t=h(a,e.crossOrigin);s.d.L(r,a,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};l.preloadModule=function(r,e){if(typeof r=="string")if(e){var a=h(e.as,e.crossOrigin);s.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else s.d.m(r)};l.requestFormReset=function(r){s.d.r(r)};l.unstable_batchedUpdates=function(r,e){return r(e)};l.useFormState=function(r,e,a){return u.H.useFormState(r,e,a)};l.useFormStatus=function(){return u.H.useHostTransitionStatus()};l.version="19.2.8"});var Y=b((J,P)=>{"use strict";function L(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(L)}catch(r){console.error(r)}}L(),P.exports=N()});var B={name:"Graview",typography:{body:y.body,mono:y.mono},schemes:k},A={ground:"--graview-ground",groundDeep:"--graview-ground-deep",wash:"--graview-wash",panel:"--graview-panel",panelMuted:"--graview-panel-muted",panelWarning:"--graview-panel-warning",edge:"--graview-edge",edgeBright:"--graview-edge-bright",ink:"--graview-ink",inkMuted:"--graview-ink-muted",inkFaint:"--graview-ink-faint",accent:"--graview-accent",accentDim:"--graview-accent-dim",accentInk:"--graview-accent-ink",warn:"--graview-warn",good:"--graview-good",bad:"--graview-bad",glow:"--graview-glow",bar:"--graview-bar",float:"--graview-float",liftLow:"--graview-lift-low",liftHigh:"--graview-lift-high",tintAlpha:"--graview-tint-alpha",tintLightness:"--graview-tint-lightness",gridAlpha:"--graview-grid-alpha"};function H(r){return Object.keys(A).map(e=>` ${A[e]}: ${r[e]};`).join(`
2
2
  `)}function C(r,e){let a=r===e?r:`${r} ${e}`;return` ${a} [data-graview-view] { transition: none; }
3
3
  ${a} [data-graview-touched] > * { animation: none; }
4
4
  ${a} [data-graview-view][data-graview-wrote] > *,
@@ -0,0 +1 @@
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,Ka as o,V as n}from"./chunk.3CJLAJXP.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.MIE4TJRW.js","./chunk.CXJJB3MK.js","./chunk.OJGHDWI6.js","./chunk.74B6KQF4.js","./chunk.WVUJXDXZ.js","./chunk.S2DOVJRL.js","./chunk.64FCAUAJ.js","./chunk.DA4RSHLW.js","./chunk.FOSY7MZF.js","./chunk.NBVPWLRY.js","./chunk.S3EEY7T3.js","./chunk.SPCAMQJE.js","./chunk.TUCSUZNO.js","./chunk.ZMWAZACO.js","./chunk.CD6YWH6T.js","./chunk.MD36ZSM5.js","./chunk.L6FGKJ5H.js","./chunk.3CJLAJXP.js","./chunk.SDO3U72B.js","./chunk.J24YPQ5I.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.E5WJSTOV.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.MIE4TJRW.js","./chunk.CXJJB3MK.js","./chunk.OJGHDWI6.js","./chunk.74B6KQF4.js","./chunk.DA4RSHLW.js","./chunk.FOSY7MZF.js","./chunk.NBVPWLRY.js","./chunk.S3EEY7T3.js","./chunk.MD36ZSM5.js","./chunk.L6FGKJ5H.js","./chunk.3CJLAJXP.js","./chunk.SDO3U72B.js","./chunk.J24YPQ5I.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.X2NGFOAF.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.CXJJB3MK.js","./chunk.OJGHDWI6.js","./chunk.74B6KQF4.js","./chunk.DA4RSHLW.js","./chunk.FOSY7MZF.js","./chunk.NBVPWLRY.js","./chunk.S3EEY7T3.js","./chunk.MD36ZSM5.js","./chunk.L6FGKJ5H.js","./chunk.3CJLAJXP.js","./chunk.SDO3U72B.js","./chunk.J24YPQ5I.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.J545NAMY.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.DA4RSHLW.js","./chunk.FOSY7MZF.js","./chunk.NBVPWLRY.js","./chunk.S3EEY7T3.js","./chunk.MD36ZSM5.js","./chunk.L6FGKJ5H.js","./chunk.3CJLAJXP.js","./chunk.SDO3U72B.js","./chunk.J24YPQ5I.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.4PCVQEVI.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 +1 @@
1
- import{a as I,c as x}from"./chunk.YXAKHXYB.js";import"./chunk.KZUMXT5J.js";import"./chunk.CGK2PY76.js";import{b,c as A,j as v,q as w,s as O,v as G}from"./chunk.CYTTZOYL.js";import"./chunk.SDO3U72B.js";import{Td as k,ie as E,pe as S,qe as W}from"./chunk.Q4MI53KK.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var F=(e,i)=>k(e,i).slice(1);function j(e,i){let l=e.split("/").filter(Boolean);return l.length===i.length&&l.every((s,h)=>s.startsWith(":")||s==="*"||s===i[h])}var $=["problems","search","map","places"];function R(e,i,l,s,h=[]){let{schema:r}=i,o=r.kinds,f=t=>{if(t.startsWith(w))return(t.slice(w.length).split("|")[0]??"").split("+").every(V=>o.includes(V));let y=O(t);return y!==null?o.includes(y):t.startsWith("edge:")||l.graph.getNode(t)!==void 0},[p="/",u]=e.path.split("?"),n=p.split("/").filter(Boolean),m=u?`?${u}`:"",d=n.length>0&&!$.includes(n[0])?o.find(t=>F(r,t)===n[0]):void 0,c=e.path;if(n[0]==="places"&&n.length===2)`/places/${n[1]}`!==E&&!s.some(t=>t.as===decodeURIComponent(n[1]))&&(c="/");else if(d){let t=n[1]===void 0?void 0:decodeURIComponent(n[1]);c=`/${F(r,d)}${t!==void 0&&l.graph.getNode(t)?.kind===d?`/${n[1]}`:""}${m}`}else n.length>0&&n.length<=2&&!$.includes(n[0])&&!h.some(t=>j(t.path,n))&&(c="/");let g=A(e.stop),P=g.within?.view,U=P!==void 0&&!s.some(t=>t.as===P),a=g;if(U){let{view:t,...y}=g.within??{};a={...a,within:y}}if(g.focusId&&!f(g.focusId)){let t=e.kind&&o.includes(e.kind)?G(e.kind):null;a={...v(a,t),zoom:!1}}return a={...a,relation:a.relation&&(o.includes(a.relation)||r.edgeKinds.includes(a.relation))?a.relation:null,expanded:a.expanded.filter(f),pins:Object.fromEntries(Object.entries(a.pins).filter(([t])=>f(t))),...a.selection?{selection:a.selection.filter(f)}:{}},{face:e.face,path:c,stop:b(a),...e.kind?{kind:e.kind}:{}}}function B(e,i,l){let s=e.at,h=e.pages?.routes()??[];if(e.routing!=="address"||typeof window>"u")return R(s,e.app,i,l,h);let{pathname:r,search:o,hash:f}=window.location,p=W(r,e.basePath),u=I({routing:"address",...e.basePath===void 0?{}:{basePath:e.basePath},face:s.face}),n=u==="pages",m={...s,face:u,...p===null?{}:n?{path:p+o}:{stop:x(e.basePath)??s.stop}},d=R(m,e.app,i,l,h),c=n?d.path===m.path?null:S(d.path,e.basePath===void 0?{}:{basePath:e.basePath}):d.stop===b(A(m.stop))?null:r+o+d.stop;return p!==null&&c!==null&&c!==r+o+f&&window.history.replaceState(window.history.state,"",c),d}export{R as settle,B as settleAt};
1
+ import{a as I,c as x}from"./chunk.DICM56FT.js";import"./chunk.MD36ZSM5.js";import"./chunk.L6FGKJ5H.js";import{b,c as A,j as v,q as w,s as O,v as G}from"./chunk.3CJLAJXP.js";import"./chunk.SDO3U72B.js";import{Vd as k,ke as E,re as S,se as W}from"./chunk.J24YPQ5I.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var F=(e,i)=>k(e,i).slice(1);function j(e,i){let l=e.split("/").filter(Boolean);return l.length===i.length&&l.every((s,h)=>s.startsWith(":")||s==="*"||s===i[h])}var $=["problems","search","map","places"];function R(e,i,l,s,h=[]){let{schema:r}=i,o=r.kinds,f=t=>{if(t.startsWith(w))return(t.slice(w.length).split("|")[0]??"").split("+").every(V=>o.includes(V));let y=O(t);return y!==null?o.includes(y):t.startsWith("edge:")||l.graph.getNode(t)!==void 0},[p="/",u]=e.path.split("?"),n=p.split("/").filter(Boolean),m=u?`?${u}`:"",d=n.length>0&&!$.includes(n[0])?o.find(t=>F(r,t)===n[0]):void 0,c=e.path;if(n[0]==="places"&&n.length===2)`/places/${n[1]}`!==E&&!s.some(t=>t.as===decodeURIComponent(n[1]))&&(c="/");else if(d){let t=n[1]===void 0?void 0:decodeURIComponent(n[1]);c=`/${F(r,d)}${t!==void 0&&l.graph.getNode(t)?.kind===d?`/${n[1]}`:""}${m}`}else n.length>0&&n.length<=2&&!$.includes(n[0])&&!h.some(t=>j(t.path,n))&&(c="/");let g=A(e.stop),P=g.within?.view,U=P!==void 0&&!s.some(t=>t.as===P),a=g;if(U){let{view:t,...y}=g.within??{};a={...a,within:y}}if(g.focusId&&!f(g.focusId)){let t=e.kind&&o.includes(e.kind)?G(e.kind):null;a={...v(a,t),zoom:!1}}return a={...a,relation:a.relation&&(o.includes(a.relation)||r.edgeKinds.includes(a.relation))?a.relation:null,expanded:a.expanded.filter(f),pins:Object.fromEntries(Object.entries(a.pins).filter(([t])=>f(t))),...a.selection?{selection:a.selection.filter(f)}:{}},{face:e.face,path:c,stop:b(a),...e.kind?{kind:e.kind}:{}}}function B(e,i,l){let s=e.at,h=e.pages?.routes()??[];if(e.routing!=="address"||typeof window>"u")return R(s,e.app,i,l,h);let{pathname:r,search:o,hash:f}=window.location,p=W(r,e.basePath),u=I({routing:"address",...e.basePath===void 0?{}:{basePath:e.basePath},face:s.face}),n=u==="pages",m={...s,face:u,...p===null?{}:n?{path:p+o}:{stop:x(e.basePath)??s.stop}},d=R(m,e.app,i,l,h),c=n?d.path===m.path?null:S(d.path,e.basePath===void 0?{}:{basePath:e.basePath}):d.stop===b(A(m.stop))?null:r+o+d.stop;return p!==null&&c!==null&&c!==r+o+f&&window.history.replaceState(window.history.state,"",c),d}export{R as settle,B as settleAt};
@@ -1 +1 @@
1
- import{Eb as a,la as l,ra as p}from"./chunk.Q4MI53KK.js";import{c}from"./chunk.FQLNBIQ5.js";function m(e){if(e.withheld===!0||e.undoes!==void 0||e.mutation?.name!==a)return;let{node:n,field:r}=e.mutation.args??{};return typeof n=="string"&&typeof r=="string"?{node:n,field:r}:void 0}function R(e,n){return e.kind!==n.kind?!1:e.id!==void 0||n.id!==void 0?e.id===n.id&&e.onBehalfOf===n.onBehalfOf:(e.name??"")===(n.name??"")}var f=e=>{let n=0;for(let r of e)n++;return n};function k(e){if(e.length===0)return;let n=m(e[0]);if(!n)return;let r=0,o=0;for(let i of e){let d=m(i);if(!d||d.node!==n.node||d.field!==n.field)return;for(let t of i.primitives)if(t.op==="splice-text"&&t.id===n.node&&t.field===n.field)r+=f(t.inserted),o+=f(t.removed);else if(t.op==="patch-node"&&t.id===n.node&&Object.prototype.hasOwnProperty.call(t.after,n.field)){let s=t.before[n.field],u=t.after[n.field];r+=typeof u=="string"?f(u):0,o+=typeof s=="string"&&!c(s)?f(s):0}}return{...n,inserted:r,removed:o}}var T=(e,n)=>({node:e.node,field:e.field,inserted:e.inserted+n.inserted,removed:e.removed+n.removed});function y(e){return`(${[...e.inserted>0||e.removed===0?[`+${e.inserted}`]:[],...e.removed>0?[`\u2212${e.removed}`]:[]].join(" ")})`}function w(e,n,r,o=!0){let i=r?.getNode(e.node),d=i?n.tryDefinition(i.kind):void 0,t=p(d,e.field);return`Wrote in ${i&&o?`${l(d,i)}'s ${t.toLowerCase()}`:t} ${y(e)}`}export{R as a,k as b,T as c,w as d};
1
+ import{Eb as a,la as l,ra as p}from"./chunk.J24YPQ5I.js";import{c}from"./chunk.FQLNBIQ5.js";function m(e){if(e.withheld===!0||e.undoes!==void 0||e.mutation?.name!==a)return;let{node:n,field:r}=e.mutation.args??{};return typeof n=="string"&&typeof r=="string"?{node:n,field:r}:void 0}function R(e,n){return e.kind!==n.kind?!1:e.id!==void 0||n.id!==void 0?e.id===n.id&&e.onBehalfOf===n.onBehalfOf:(e.name??"")===(n.name??"")}var f=e=>{let n=0;for(let r of e)n++;return n};function k(e){if(e.length===0)return;let n=m(e[0]);if(!n)return;let r=0,o=0;for(let i of e){let d=m(i);if(!d||d.node!==n.node||d.field!==n.field)return;for(let t of i.primitives)if(t.op==="splice-text"&&t.id===n.node&&t.field===n.field)r+=f(t.inserted),o+=f(t.removed);else if(t.op==="patch-node"&&t.id===n.node&&Object.prototype.hasOwnProperty.call(t.after,n.field)){let s=t.before[n.field],u=t.after[n.field];r+=typeof u=="string"?f(u):0,o+=typeof s=="string"&&!c(s)?f(s):0}}return{...n,inserted:r,removed:o}}var T=(e,n)=>({node:e.node,field:e.field,inserted:e.inserted+n.inserted,removed:e.removed+n.removed});function y(e){return`(${[...e.inserted>0||e.removed===0?[`+${e.inserted}`]:[],...e.removed>0?[`\u2212${e.removed}`]:[]].join(" ")})`}function w(e,n,r,o=!0){let i=r?.getNode(e.node),d=i?n.tryDefinition(i.kind):void 0,t=p(d,e.field);return`Wrote in ${i&&o?`${l(d,i)}'s ${t.toLowerCase()}`:t} ${y(e)}`}export{R as a,k as b,T as c,w as d};