graview 0.1.65 → 0.1.66

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 (261) hide show
  1. package/dist/index.js +4 -4
  2. package/dist/index.js.map +1 -1
  3. package/dist/preview/{chunk.6RZHKQP3.js → chunk.2KFZHUAC.js} +1 -1
  4. package/dist/preview/chunk.2MHNPBHC.js +1 -0
  5. package/dist/preview/{chunk.2PK335JQ.js → chunk.2VR7YEJ6.js} +1 -1
  6. package/dist/preview/chunk.32SHA3EY.js +1 -0
  7. package/dist/preview/chunk.3L4JMM3P.js +1 -0
  8. package/dist/preview/chunk.3PBTN7RO.js +1 -0
  9. package/dist/preview/chunk.45JP6VGJ.js +5 -0
  10. package/dist/preview/{chunk.INTJD5WG.js → chunk.4AC2QM7T.js} +1 -1
  11. package/dist/preview/chunk.4FCFNAA4.js +1 -0
  12. package/dist/preview/chunk.4FDVINRJ.js +1 -0
  13. package/dist/preview/chunk.4JULYKGD.js +1 -0
  14. package/dist/preview/chunk.4U4D7WOI.js +1 -0
  15. package/dist/preview/chunk.4WGYUYWU.js +2 -0
  16. package/dist/preview/chunk.5B5SRTUK.js +1 -0
  17. package/dist/preview/chunk.5BX66FBP.js +1 -0
  18. package/dist/preview/chunk.5CXIEYHY.js +2 -0
  19. package/dist/preview/chunk.5EMIWORS.js +1 -0
  20. package/dist/preview/{chunk.KIQXTQDU.js → chunk.5FNFRVTL.js} +1 -1
  21. package/dist/preview/chunk.5LJVOLKR.js +1 -0
  22. package/dist/preview/{chunk.GPCKOYSF.js → chunk.6EHHMWPP.js} +1 -1
  23. package/dist/preview/chunk.6EVMXBNB.js +1 -0
  24. package/dist/preview/chunk.6FQW6FNL.js +1 -0
  25. package/dist/preview/chunk.6HY6ZGEE.js +5 -0
  26. package/dist/preview/{chunk.DICM56FT.js → chunk.6LXIEM6B.js} +1 -1
  27. package/dist/preview/chunk.6MQ5NT7S.js +1 -0
  28. package/dist/preview/chunk.6P6NGZ6D.js +1 -0
  29. package/dist/preview/{chunk.F2TWV4TX.js → chunk.6TLXFMX2.js} +1 -1
  30. package/dist/preview/chunk.72XP2ARZ.js +1 -0
  31. package/dist/preview/{chunk.QSDBF7VL.js → chunk.72ZCLEQC.js} +1 -1
  32. package/dist/preview/{chunk.LY5CY7GE.js → chunk.7BIPZTJB.js} +1 -1
  33. package/dist/preview/chunk.7VADSNPZ.js +1 -0
  34. package/dist/preview/{chunk.IR4OW67N.js → chunk.7VP6Y6D2.js} +1 -1
  35. package/dist/preview/{chunk.C437FVD7.js → chunk.7ZKBYXUM.js} +1 -1
  36. package/dist/preview/chunk.AK7NGFEX.js +6 -0
  37. package/dist/preview/{chunk.FHHVW2WB.js → chunk.ANS2IEEV.js} +1 -1
  38. package/dist/preview/{chunk.LKK5YF2H.js → chunk.B6JRTW3A.js} +1 -1
  39. package/dist/preview/chunk.BCQWAFGD.js +1 -0
  40. package/dist/preview/{chunk.SOMRYDDH.js → chunk.BFAFCVL4.js} +1 -1
  41. package/dist/preview/chunk.BGAC3B7X.js +1 -0
  42. package/dist/preview/chunk.BMENTGDC.js +21 -0
  43. package/dist/preview/chunk.BOCVLC7X.js +1 -0
  44. package/dist/preview/{chunk.IMKD6QQG.js → chunk.BUVTUAB5.js} +1 -1
  45. package/dist/preview/chunk.BXBEGMPO.js +22 -0
  46. package/dist/preview/{chunk.ZYNC73DJ.js → chunk.BZ7QWHAE.js} +1 -1
  47. package/dist/preview/{chunk.AB4RZSYW.js → chunk.C2C3AXGI.js} +16 -16
  48. package/dist/preview/chunk.CBXS23YH.js +23 -0
  49. package/dist/preview/chunk.CEQQIW7Z.js +1 -0
  50. package/dist/preview/chunk.CEVGND3Y.js +6 -0
  51. package/dist/preview/{chunk.ZDUTEM3Z.js → chunk.CTASTRQN.js} +1 -1
  52. package/dist/preview/chunk.CU2WCYMK.js +1 -0
  53. package/dist/preview/{chunk.SPCAMQJE.js → chunk.CVPMSPCH.js} +1 -1
  54. package/dist/preview/chunk.DEHIR4EG.js +1 -0
  55. package/dist/preview/chunk.DPJNGFEZ.js +4 -0
  56. package/dist/preview/chunk.DQFHIJFN.js +1 -0
  57. package/dist/preview/chunk.DSYP43NN.js +1 -0
  58. package/dist/preview/chunk.DTCAUPLC.js +1 -0
  59. package/dist/preview/{chunk.7Q43N5JS.js → chunk.DZFM6GSY.js} +1 -1
  60. package/dist/preview/chunk.E3UL4MCD.js +35 -0
  61. package/dist/preview/chunk.E4VRRWFP.js +1 -0
  62. package/dist/preview/{chunk.6YDC6IDA.js → chunk.E7EWNWAN.js} +1 -1
  63. package/dist/preview/chunk.EG7OOJH5.js +1 -0
  64. package/dist/preview/{chunk.J6KNEI5R.js → chunk.EMFOMSMI.js} +1 -1
  65. package/dist/preview/{chunk.5THLLSS4.js → chunk.EQ4OODGO.js} +1 -1
  66. package/dist/preview/{chunk.P6TZGR3A.js → chunk.ES63XSIM.js} +1 -1
  67. package/dist/preview/chunk.EUAO4QNV.js +1 -0
  68. package/dist/preview/{chunk.O2W5JTWA.js → chunk.EXYCN4WI.js} +1 -1
  69. package/dist/preview/chunk.F4VB6Q2W.js +1 -0
  70. package/dist/preview/chunk.F7672TKJ.js +1 -0
  71. package/dist/preview/chunk.FA42HCPW.js +1 -0
  72. package/dist/preview/{chunk.L6FGKJ5H.js → chunk.FBILPNGH.js} +1 -1
  73. package/dist/preview/chunk.FBJAQPZ6.js +1 -0
  74. package/dist/preview/{chunk.FDWRH5P2.js → chunk.FDZE5LTJ.js} +2 -2
  75. package/dist/preview/{chunk.FOSY7MZF.js → chunk.FFOD5B4B.js} +1 -1
  76. package/dist/preview/{chunk.XSWR5LI4.js → chunk.FIFUMX5X.js} +1 -1
  77. package/dist/preview/{chunk.RFVOXX3P.js → chunk.FK722SHI.js} +1 -1
  78. package/dist/preview/chunk.FV72U33M.js +1 -0
  79. package/dist/preview/chunk.FXT5CN32.js +19 -0
  80. package/dist/preview/chunk.GAFMWOME.js +1 -0
  81. package/dist/preview/{chunk.PTQPS2FJ.js → chunk.GEFXU4VO.js} +1 -1
  82. package/dist/preview/chunk.GG47EIKO.js +1 -0
  83. package/dist/preview/{chunk.5M34BJIQ.js → chunk.GME63ZHI.js} +1 -1
  84. package/dist/preview/{chunk.IJ3YDBWI.js → chunk.GNEOSHQ6.js} +1 -1
  85. package/dist/preview/{chunk.N2FNHRI2.js → chunk.HOCD7KIR.js} +1 -1
  86. package/dist/preview/chunk.HSSIMVVM.js +1 -0
  87. package/dist/preview/{chunk.S2DOVJRL.js → chunk.I2737CPF.js} +1 -1
  88. package/dist/preview/chunk.I4Z7HVRT.js +1 -0
  89. package/dist/preview/{chunk.F5VEHAP2.js → chunk.IAEHUSQQ.js} +1 -1
  90. package/dist/preview/{chunk.7E4CSXBT.js → chunk.IGK7EZCX.js} +1 -1
  91. package/dist/preview/chunk.INHS3KTK.js +1 -0
  92. package/dist/preview/{chunk.LGRQDILY.js → chunk.IWYMKGZZ.js} +1 -1
  93. package/dist/preview/{chunk.3RFAUIGT.js → chunk.J2MM6BUW.js} +1 -1
  94. package/dist/preview/{chunk.7IGD2K4M.js → chunk.J7W2OFHY.js} +1 -1
  95. package/dist/preview/chunk.JMXXA4YG.js +1 -0
  96. package/dist/preview/chunk.JMYUQNXN.js +6 -0
  97. package/dist/preview/chunk.JO2X52D4.js +1 -0
  98. package/dist/preview/{chunk.2QQ37RCZ.js → chunk.JXNVNFV4.js} +1 -1
  99. package/dist/preview/chunk.K6DFXDPZ.js +1 -0
  100. package/dist/preview/{chunk.NSO6RUKW.js → chunk.KACSYPEV.js} +1 -1
  101. package/dist/preview/{chunk.ZMWAZACO.js → chunk.KBPJ7X7W.js} +1 -1
  102. package/dist/preview/chunk.KF27ME27.js +1 -0
  103. package/dist/preview/{chunk.35E75QJ7.js → chunk.KSIEO5W7.js} +1 -1
  104. package/dist/preview/chunk.L25DCT5S.js +1 -0
  105. package/dist/preview/{chunk.3KUYB5ZT.js → chunk.LETAQTLJ.js} +1 -1
  106. package/dist/preview/{chunk.44ZHHPPJ.js → chunk.LGRVEHXT.js} +2 -2
  107. package/dist/preview/chunk.LINSO5PN.js +1 -0
  108. package/dist/preview/{chunk.LVD3V77M.js → chunk.LLIURXFP.js} +1 -1
  109. package/dist/preview/{chunk.3IZEZPJB.js → chunk.LSN2IPAI.js} +1 -1
  110. package/dist/preview/chunk.M2JCFNHJ.js +1 -0
  111. package/dist/preview/{chunk.B3WVCSW5.js → chunk.M5FP4Y4Q.js} +1 -1
  112. package/dist/preview/{chunk.CPYBJNHP.js → chunk.M6ZN2KUO.js} +1 -1
  113. package/dist/preview/chunk.MODLZJD4.js +25 -0
  114. package/dist/preview/chunk.MWGZKZD6.js +1 -0
  115. package/dist/preview/{chunk.64FCAUAJ.js → chunk.NJRLJEJY.js} +1 -1
  116. package/dist/preview/chunk.NYLKG25K.js +4 -0
  117. package/dist/preview/{chunk.CD6YWH6T.js → chunk.OEIWIZCP.js} +1 -1
  118. package/dist/preview/{chunk.ZJFXM3LE.js → chunk.OJY7VJ7D.js} +1 -1
  119. package/dist/preview/chunk.OMT4QUZY.js +23 -0
  120. package/dist/preview/{chunk.R2TSTDS3.js → chunk.ONYBW45K.js} +1 -1
  121. package/dist/preview/chunk.OO2OP76C.js +1 -0
  122. package/dist/preview/{chunk.G3Q5IMM3.js → chunk.OOSIKCOS.js} +1 -1
  123. package/dist/preview/{chunk.7VQ3C7F4.js → chunk.OPTYYIGC.js} +1 -1
  124. package/dist/preview/{chunk.TUCSUZNO.js → chunk.OTV5XTBB.js} +1 -1
  125. package/dist/preview/{chunk.74B6KQF4.js → chunk.OWFS2YDQ.js} +1 -1
  126. package/dist/preview/{chunk.CXDGE5ZS.js → chunk.OWO3OV62.js} +1 -1
  127. package/dist/preview/{chunk.BUQKRXI6.js → chunk.PAGEGBUD.js} +1 -1
  128. package/dist/preview/{chunk.CGQ6KXVK.js → chunk.PDDIQ6PK.js} +1 -1
  129. package/dist/preview/{chunk.T3KNLP7C.js → chunk.PFQBCHQA.js} +1 -1
  130. package/dist/preview/{chunk.MH46V556.js → chunk.PPSYUOH7.js} +1 -1
  131. package/dist/preview/{chunk.HJS3LTSR.js → chunk.PSQYDCVM.js} +1 -1
  132. package/dist/preview/chunk.QDVGHI7R.js +1 -0
  133. package/dist/preview/chunk.QFHWG4LN.js +1 -0
  134. package/dist/preview/chunk.QGIM2WAY.js +1 -0
  135. package/dist/preview/chunk.QHMHUL6B.js +3 -0
  136. package/dist/preview/chunk.QOS5T46W.js +1 -0
  137. package/dist/preview/{chunk.KHAVEYT7.js → chunk.QPF4KSAW.js} +1 -1
  138. package/dist/preview/chunk.QQAZQDRW.js +1 -0
  139. package/dist/preview/chunk.QU52E5RG.js +3 -0
  140. package/dist/preview/{chunk.CS72MISN.js → chunk.QWNSHISU.js} +1 -1
  141. package/dist/preview/chunk.RSMCTI2N.js +1 -0
  142. package/dist/preview/chunk.RWIN3POV.js +1 -0
  143. package/dist/preview/chunk.SSF47GUY.js +1 -0
  144. package/dist/preview/chunk.T6DPWW2K.js +3 -0
  145. package/dist/preview/chunk.TA36WBHK.js +1 -0
  146. package/dist/preview/chunk.TGEL6EUA.js +1 -0
  147. package/dist/preview/chunk.TTGKX7LT.js +1 -0
  148. package/dist/preview/chunk.TXHYGFIZ.js +1 -0
  149. package/dist/preview/chunk.U3ED7W2U.js +1 -0
  150. package/dist/preview/chunk.U3HERHAI.js +88 -0
  151. package/dist/preview/chunk.U6QXLNHF.js +15 -0
  152. package/dist/preview/{chunk.FXG5AJF6.js → chunk.U6TEW6YD.js} +1 -1
  153. package/dist/preview/chunk.UJPX3BUV.js +1 -0
  154. package/dist/preview/chunk.V5I4GZEY.js +1 -0
  155. package/dist/preview/{chunk.XTTESA7X.js → chunk.V7W5AQKL.js} +1 -1
  156. package/dist/preview/{chunk.IFBGYFS4.js → chunk.VGHO3VCB.js} +1 -1
  157. package/dist/preview/{chunk.2TZSLREX.js → chunk.VKZIEZ5C.js} +2 -2
  158. package/dist/preview/chunk.VT2YGDK2.js +1 -0
  159. package/dist/preview/{chunk.ZTN7BS5O.js → chunk.W4YDPHCQ.js} +1 -1
  160. package/dist/preview/{chunk.NKYYDFIX.js → chunk.W53YNBSM.js} +1 -1
  161. package/dist/preview/chunk.WAB3L3ZI.js +1 -0
  162. package/dist/preview/chunk.WSDJPXJD.js +1 -0
  163. package/dist/preview/chunk.WSO7JOW5.js +1 -0
  164. package/dist/preview/{chunk.BU5PVRX7.js → chunk.WVLEGCRI.js} +1 -1
  165. package/dist/preview/chunk.XK65Y2KX.js +1 -0
  166. package/dist/preview/chunk.XMQG2PSM.js +50 -0
  167. package/dist/preview/{chunk.QO5RXOCS.js → chunk.XOE4KNP2.js} +2 -2
  168. package/dist/preview/chunk.YIPXZUTT.js +2 -0
  169. package/dist/preview/chunk.YNEHJWJV.js +2 -0
  170. package/dist/preview/{chunk.S3EEY7T3.js → chunk.YXEO3Y65.js} +1 -1
  171. package/dist/preview/chunk.Z274CL7J.js +1 -0
  172. package/dist/preview/{chunk.NBVPWLRY.js → chunk.Z7Y3R3YR.js} +1 -1
  173. package/dist/preview/{chunk.DJMSXXP4.js → chunk.ZBVYD4OX.js} +1 -1
  174. package/dist/preview/{chunk.4O3C2LJF.js → chunk.ZD7T234N.js} +1 -1
  175. package/dist/preview/{chunk.TY74U3EI.js → chunk.ZQR2SN65.js} +1 -1
  176. package/dist/preview/chunk.ZR2TP3BF.js +111 -0
  177. package/dist/preview/chunk.ZRBGYXAO.js +6 -0
  178. package/dist/preview/index.html +56 -54
  179. package/dist/preview/page.js +2 -2
  180. package/dist/preview/splash.js +17 -14
  181. package/package.json +6 -6
  182. package/dist/preview/chunk.2P34ML3O.js +0 -111
  183. package/dist/preview/chunk.2UW5CRHF.js +0 -1
  184. package/dist/preview/chunk.2YMO7ZVX.js +0 -1
  185. package/dist/preview/chunk.33ULA3CG.js +0 -1
  186. package/dist/preview/chunk.3CJLAJXP.js +0 -25
  187. package/dist/preview/chunk.3IJSB5ET.js +0 -1
  188. package/dist/preview/chunk.3KO35VN4.js +0 -1
  189. package/dist/preview/chunk.3L37FY3G.js +0 -4
  190. package/dist/preview/chunk.3WP66LB5.js +0 -1
  191. package/dist/preview/chunk.4GJ7F4SP.js +0 -35
  192. package/dist/preview/chunk.4IJTPV5X.js +0 -1
  193. package/dist/preview/chunk.4JFBLVXJ.js +0 -1
  194. package/dist/preview/chunk.4PCVQEVI.js +0 -1
  195. package/dist/preview/chunk.5FQSYMAE.js +0 -1
  196. package/dist/preview/chunk.5NCLZ4NZ.js +0 -1
  197. package/dist/preview/chunk.5YNLFOBJ.js +0 -5
  198. package/dist/preview/chunk.77XQEDT5.js +0 -1
  199. package/dist/preview/chunk.7HPQI5SY.js +0 -1
  200. package/dist/preview/chunk.A4VA3DU5.js +0 -1
  201. package/dist/preview/chunk.ABSY3UZF.js +0 -1
  202. package/dist/preview/chunk.ARHAD5IS.js +0 -1
  203. package/dist/preview/chunk.BOC2EOGB.js +0 -9
  204. package/dist/preview/chunk.BR6TINGU.js +0 -1
  205. package/dist/preview/chunk.CDEAAWPS.js +0 -1
  206. package/dist/preview/chunk.CXJJB3MK.js +0 -1
  207. package/dist/preview/chunk.CXLQPE4J.js +0 -1
  208. package/dist/preview/chunk.DA4RSHLW.js +0 -1
  209. package/dist/preview/chunk.DJPNVXBQ.js +0 -6
  210. package/dist/preview/chunk.DJVHKBEI.js +0 -1
  211. package/dist/preview/chunk.DVSTLVIH.js +0 -15
  212. package/dist/preview/chunk.E5WJSTOV.js +0 -1
  213. package/dist/preview/chunk.FEGSYSA7.js +0 -1
  214. package/dist/preview/chunk.HJUXC5GM.js +0 -1
  215. package/dist/preview/chunk.HNMSYQRA.js +0 -1
  216. package/dist/preview/chunk.HWLRKOI3.js +0 -1
  217. package/dist/preview/chunk.IHUMKFYH.js +0 -10
  218. package/dist/preview/chunk.IQ54QTA5.js +0 -1
  219. package/dist/preview/chunk.IQC3GOXO.js +0 -1
  220. package/dist/preview/chunk.ISN2QTVL.js +0 -2
  221. package/dist/preview/chunk.J24YPQ5I.js +0 -5
  222. package/dist/preview/chunk.J545NAMY.js +0 -1
  223. package/dist/preview/chunk.K2HDEL7I.js +0 -1
  224. package/dist/preview/chunk.K3JARAWU.js +0 -1
  225. package/dist/preview/chunk.KROR65KD.js +0 -2
  226. package/dist/preview/chunk.KV7GZBJ6.js +0 -50
  227. package/dist/preview/chunk.L7NJLZWV.js +0 -1
  228. package/dist/preview/chunk.LON75VHP.js +0 -1
  229. package/dist/preview/chunk.LQWVJQ5X.js +0 -18
  230. package/dist/preview/chunk.M5W2RHC6.js +0 -1
  231. package/dist/preview/chunk.M6BTLH24.js +0 -1
  232. package/dist/preview/chunk.MAGKI4PD.js +0 -1
  233. package/dist/preview/chunk.MD36ZSM5.js +0 -74
  234. package/dist/preview/chunk.MFZJVHWP.js +0 -1
  235. package/dist/preview/chunk.MHTA4HYB.js +0 -19
  236. package/dist/preview/chunk.N2YM247R.js +0 -1
  237. package/dist/preview/chunk.N35SJWAM.js +0 -1
  238. package/dist/preview/chunk.NJSK3UO2.js +0 -6
  239. package/dist/preview/chunk.OHMHPTEW.js +0 -1
  240. package/dist/preview/chunk.PV2I4UPH.js +0 -1
  241. package/dist/preview/chunk.QFQSSZN7.js +0 -1
  242. package/dist/preview/chunk.RSS6OHXG.js +0 -1
  243. package/dist/preview/chunk.SBCAYTMT.js +0 -1
  244. package/dist/preview/chunk.SMTGRCMG.js +0 -3
  245. package/dist/preview/chunk.TCZIZ2PU.js +0 -1
  246. package/dist/preview/chunk.U74PTRHJ.js +0 -1
  247. package/dist/preview/chunk.UAORKZLO.js +0 -1
  248. package/dist/preview/chunk.UDVTPI2W.js +0 -1
  249. package/dist/preview/chunk.UETLP5KC.js +0 -1
  250. package/dist/preview/chunk.UHI3X2YD.js +0 -1
  251. package/dist/preview/chunk.UL62ELNR.js +0 -1
  252. package/dist/preview/chunk.VRYSZYAD.js +0 -1
  253. package/dist/preview/chunk.VUZFLDOX.js +0 -1
  254. package/dist/preview/chunk.X2NGFOAF.js +0 -1
  255. package/dist/preview/chunk.XE762VL2.js +0 -2
  256. package/dist/preview/chunk.Y2RZ5B4U.js +0 -1
  257. package/dist/preview/chunk.YKMBXMZE.js +0 -1
  258. package/dist/preview/chunk.Z34KASY7.js +0 -1
  259. package/dist/preview/chunk.ZMGKWMID.js +0 -1
  260. package/dist/preview/chunk.ZT5YQSSP.js +0 -21
  261. package/dist/preview/chunk.ZZM75ZTN.js +0 -4
@@ -1 +0,0 @@
1
- import{a as B,b as ve}from"./chunk.NKYYDFIX.js";import{a as ye,c as he,d as be,f as we}from"./chunk.L7NJLZWV.js";import{b as S,c as fe,d as me,j as ce,k as ge}from"./chunk.DA4RSHLW.js";import{b as pe,k as q}from"./chunk.FOSY7MZF.js";import{b as de,e as ue}from"./chunk.NBVPWLRY.js";import{G as Re,V as se,ea as le,h as ae,u as ie}from"./chunk.3CJLAJXP.js";import{Ma as te,Xa as re,Ya as oe,ga as Z,la as ee,ta as ne}from"./chunk.J24YPQ5I.js";import{b as W}from"./chunk.AJZBJBMO.js";var l=W(Re(),1);var i=W(se(),1);function qe({affordance:n,onApply:a,onCancel:u,store:w}){let y=le(),s=w??y?.store,[x,_]=(0,l.useState)({}),[p,D]=(0,l.useState)(""),[I,F]=(0,l.useState)(G),[J,V]=(0,l.useState)(void 0),U=(0,l.useId)(),L=(0,l.useRef)(null),A=n.open.filter(e=>!(e.name in x)),o=A[0],v=s.allMutations().find(e=>e.name===n.mutation),P=(0,l.useMemo)(()=>De(v,s,n.args??{}),[v,s,n.args]),d=o?P[o.name]:void 0,E=ge(n.open.filter(e=>e.shape?.type==="date").map(e=>e.name)),Se=(()=>{if(!E||o?.name!==E.end||o.shape?.type!=="date")return;let e=x[E.start];if(typeof e!="string")return;let r=P[E.start];return ce(typeof r=="string"?r:void 0,e,typeof d=="string"?d:void 0,{time:o.shape.time===!0,instant:o.shape.instant===!0})})();(0,l.useEffect)(()=>{D(Se??ke(d,o?.shape)),F(Array.isArray(d)?d:G),V(d)},[o?.name]),(0,l.useEffect)(()=>{L.current?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[o?.name]),(0,l.useLayoutEffect)(()=>{let e=L.current,r=typeof document>"u"?null:document.activeElement,f=r instanceof HTMLElement&&r.getAttribute("data-affordance")===n.id;if(!e||r&&r!==document.body&&!e.contains(r)&&!f)return;let b=e.querySelector('[data-testid="ask-filter"], form input, [role=group] button:not([disabled])');b&&b!==r&&b.focus()},[o?.name]);let Y=ve({flow:"both",letters:!0});if(!o)return null;let h=e=>{let r=d!==void 0&&JSON.stringify(e)===JSON.stringify(d)?void 0:e,f={...x,[o.name]:r};if(n.open.filter(R=>!(R.name in f)).length===0){let R=a(Object.fromEntries(Object.entries(f).filter(([,M])=>M!==void 0)));R&&R.length>0&&_(Object.fromEntries(Object.entries(f).filter(([M])=>!R.includes(M))))}else _(f)},O=o.optional?(0,i.jsx)("button",{type:"button",onClick:()=>h(void 0),style:{fontSize:"0.8125rem"},children:"Skip"}):null,t=o.shape??{type:"unknown"},c=t.type==="number"?t.amount:void 0,g=Ee(o,t),m=q(s.schema,v,o.name),Q=te((v?.input?.shape??{})[o.name]),xe=oe((v?.input?.shape??{})[o.name]),N=re(o.name),Ae=typeof d=="boolean"?d?"yes":"no":d,[T,Oe]=(0,l.useState)(""),X=(0,l.useMemo)(()=>{let e=g.map(r=>s.graph.getNode(r)).filter(r=>r!==void 0);return pe(e,r=>s.schema.tryDefinition(r))},[g,s]),j=e=>{let r=Ce(s,t,e),f=t.type==="choice"||t.type==="several"&&t.of.type==="choice"?m.option(e):r,b=X.get(e);return b?`${f} \xB7 ${b}`:f},$=(0,l.useMemo)(()=>{let e=T.trim().toLowerCase();return e===""?g:g.filter(r=>j(r).toLowerCase().includes(e))},[g,T,s,t,X]),k=t.type==="several",H=t.type==="file"?t:t.type==="several"&&t.of.type==="file"?t.of:void 0,K=k&&g.length===0,C=o.kinds&&o.kinds.length>0&&!o.kinds.includes("*")?o.kinds.map(e=>Z(ne(s.schema.tryDefinition(e),e))).join(" or "):m.label,Ne=n.open.length>1?`${C} \xB7 ${n.open.length-A.length+1} of ${n.open.length}`:C;return(0,i.jsxs)("div",{ref:L,"data-graview-asking":n.id,style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:4,padding:"5px 0 2px"},children:[n.open.length>1||g.length>0?(0,i.jsx)("span",{id:U,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:Ne}):null,g.length>z?(0,i.jsx)("input",{type:"search",value:T,onChange:e=>Oe(e.target.value),placeholder:`Filter ${g.length}\u2026`,"aria-label":`Filter ${C}`,"data-testid":"ask-filter",onKeyDown:e=>{if(e.key!=="ArrowDown"||e.metaKey||e.ctrlKey||e.altKey)return;let r=Y.ref.current?.querySelector(`[${B}][tabindex="0"]`);r&&(e.preventDefault(),r.focus())},style:{font:"inherit",fontSize:"0.8125rem",minWidth:0,padding:"3px 7px"}}):null,xe?(0,i.jsxs)("form",{style:{display:"grid",gap:4},onSubmit:e=>{e.preventDefault(),h(J??(d===void 0?void 0:null))},children:[(0,i.jsx)(be,{value:J,onChange:V,start:N?x[N]??P[N]:void 0,label:`${N?q(s.schema,v,N).label:m.label} repeats`,name:o.name}),(0,i.jsxs)("span",{style:{display:"flex",gap:4},children:[(0,i.jsx)("button",{type:"submit",style:{fontSize:"0.8125rem"},children:A.length>1?"Next":"Apply"}),O]})]}):Q?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(he,{relation:Q,value:d,onChange:h,label:m.label}),O]}):H?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(ye,{as:"control",value:d,onChange:h,several:k,image:H.image===!0,video:H.video===!0,label:m.label}),O]}):g.length>0?(0,i.jsxs)("div",{...Y,role:"group","aria-labelledby":U,style:{display:"flex",flexWrap:"wrap",gap:4},children:[$.slice(0,z).map(e=>{let r=k?I.includes(e):e===Ae;return(0,i.jsx)("button",{type:"button",[B]:"","aria-label":`${C}: ${j(e)}`,...k?{"aria-pressed":r}:r?{"aria-current":!0}:{},style:{padding:"3px 9px",fontSize:"0.8125rem",...r?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},onClick:()=>k?F(f=>f.includes(e)?f.filter(b=>b!==e):[...f,e]):h(t.type==="boolean"?e==="yes":e),children:j(e)},e)}),$.length>z?(0,i.jsxs)("span",{"data-testid":"ask-more",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:[$.length-z," more \u2014 type to narrow"]}):null,$.length===0?(0,i.jsxs)("span",{"data-testid":"ask-none",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["None of the ",g.length," match that."]}):null,k?(0,i.jsx)("button",{type:"button",disabled:I.length===0,style:{fontSize:"0.8125rem"},onClick:()=>{let e=I;F(G),h(e)},children:A.length>1?"Next":"Apply"}):null,O]}):(0,i.jsxs)("form",{style:{display:"flex",flexWrap:"wrap",gap:4},onSubmit:e=>{if(e.preventDefault(),d!==void 0&&p===ke(d,t)){h(void 0);return}if(K){h(p.split(/[,\n]/).map(r=>r.trim()).filter(Boolean));return}if(p.trim().length!==0){if(c){let r=me(p,c);r!==void 0&&h(r);return}h(t.type==="number"?t.duration?ue(p)??p:Number(p):p)}},children:[t.type==="text"&&t.long?(0,i.jsx)("textarea",{autoFocus:!0,name:o.name,"aria-label":m.label,placeholder:m.label,value:p,rows:4,onChange:e=>D(e.target.value),onKeyDown:e=>{e.key==="Escape"?u():e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},style:{flex:"1 1 100%",minWidth:0,font:"inherit",fontSize:"0.875rem",lineHeight:1.45,padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",resize:"vertical",fieldSizing:"content",minHeight:"5.5em",maxHeight:"40vh"}}):t.type==="date"?(0,i.jsx)(we,{autoFocus:!0,name:o.name,label:m.label,value:p===""?void 0:p,time:t.time===!0,instant:t.instant===!0,partial:t.partial===!0,onChange:e=>D(e??""),onCancel:u,boxStyle:{fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):(0,i.jsx)("input",{autoFocus:!0,type:t.type==="number"&&!t.duration&&!c?"number":t.type==="text"&&t.holds==="phone"?"tel":"text",...c?{inputMode:"decimal","data-graview-amount":c.format??"unit"}:{},name:o.name,"aria-label":m.label,placeholder:K?`${m.label}, separated by commas`:c?`${m.label}, ${S(c).hint} \u2014 ${S(c).prefix??""}${S(c).placeholder}${S(c).suffix?` ${S(c).suffix}`:""}`:m.label,value:p,...t.type==="number"&&t.min!==void 0?{min:t.min}:{},...t.type==="number"&&t.max!==void 0?{max:t.max}:{},...t.type==="number"&&t.step!==void 0?{step:t.step}:{},onChange:e=>D(e.target.value),onKeyDown:e=>{e.key==="Escape"&&u()},style:{flex:1,minWidth:0,font:"inherit",fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}),(0,i.jsx)("button",{type:"submit",disabled:!K&&p.trim().length===0,style:{fontSize:"0.8125rem"},children:A.length>1?"Next":"Apply"}),O]})]})}var G=[];function De(n,a,u){let w=n?.derived?.act==="edit"&&n.subject?u[n.subject.arg]:void 0,y=typeof w=="string"?a.graph.getNode(w):void 0;return y?Object.fromEntries((n.writes??[]).filter(s=>y[s]!==void 0&&y[s]!==null).map(s=>[s,y[s]])):{}}function ke(n,a){return typeof n=="number"?a?.type==="number"&&a.amount?fe(n,a.amount):String(n):Array.isArray(n)?n.every(u=>typeof u=="string")?n.join(", "):"":typeof n!="string"?"":n}var z=10;function Ee(n,a){return n.candidates&&n.candidates.length>0?n.candidates:a.type==="choice"?a.options:a.type==="several"&&a.of.type==="choice"?a.of.options:a.type==="boolean"?$e:[]}var $e=["yes","no"];function Ce(n,a,u){return a.type==="boolean"||a.type==="choice"||a.type==="several"&&a.of.type==="choice"?u:ze(n,u)}function ze(n,a){let u=ae(a);if(u){let s=de(n.schema,n.graph.getNode(u.from)?.kind??"",u.kind,"out");return s.charAt(0).toUpperCase()+s.slice(1)}let w=ie(a);if(w.length>0)return w.map(s=>n.schema.tryDefinition(s)?.plural??`${s}s`).join(" + ");let y=n.graph.getNode(a);return y?ee(n.schema.tryDefinition(y.kind),y):a}export{qe as a,ze as b};
@@ -1,2 +0,0 @@
1
- import{a as Ie}from"./chunk.XTTESA7X.js";import{c as Oe,d as Be,f as Ge}from"./chunk.5M34BJIQ.js";import{e as Ce,f as Re,k as Fe,l as re,n as Me}from"./chunk.S2DOVJRL.js";import{d as z,e as Pe,k as ne}from"./chunk.FOSY7MZF.js";import{a as Ae,d as je}from"./chunk.NBVPWLRY.js";import{f as De}from"./chunk.ZMWAZACO.js";import{$c as be,C as Q,Fd as ve,L as de,Wd as ke,Xb as ge,Xc as ye,Zc as we,ea as ue,ee as xe,ga as U,ha as me,ka as H,kd as Z,la as T,ld as $e,ma as pe,na as ee,ne as Se,oa as fe,oc as te,pc as he,ra as _,ta as q}from"./chunk.J24YPQ5I.js";function Xe(t,e,n){let o=t.tryDefinition(e)?.fields.shape,r=Q(o?.[n]),a=!1,s=!1;for(;r&&(r.type==="optional"||r.type==="default"||r.type==="nullable"||r.type==="prefault");)(r.type==="optional"||r.type==="nullable")&&(a=!0),(r.type==="default"||r.type==="prefault")&&(s=!0),r=Q(r.innerType);if(r?.type!=="enum")return;let p=(r.entries?Object.values(r.entries):r.values??[]).filter(m=>typeof m=="string");return p.length>0?{values:p,empty:a&&!s}:void 0}function L(t,e,n){let o=Xe(t,e,n);if(!o)return[];let r=t.tryDefinition(e),a=o.values.map(s=>({value:s,label:Ae(r,n,s)}));return o.empty&&a.push({value:null,label:`No ${_(r,n).toLowerCase()}`}),a}function X(t,e,n){let o=t[e];return typeof o=="string"&&n.some(r=>r.value===o)?o:null}function se(t,e,n,o,r=L(t.schema,n.kind,o)){return Ve(t,e,n,o,r).flatMap(a=>a.move?[a.move]:[])}function Ve(t,e,n,o,r=L(t.schema,n.kind,o)){let a=Ne(t.schema,t.allMutations(),n.kind,o,r),s=X(n,o,r),p=q(t.schema.tryDefinition(n.kind),n.kind),m=[];for(let{value:A,label:C,by:R,acts:F}of a){if(A===s)continue;let x,I,V;for(let c of F){let w=R==="step"?{[c.subject.arg]:n.id}:{[c.subject.arg]:n.id,[o]:A},S={name:c.name,args:w};if(!c.input.safeParse(w).success){V??=`${c.title??c.name} asks for more than the ${p} itself.`;continue}let k=t.permits(S,e);if(!k.ok){I??=k.refusal?.message??`You may not ${c.title??c.name}.`;continue}try{ge(t.graph,c,w)}catch(f){I??=f instanceof Error?f.message:String(f);continue}x={to:A,call:S,title:c.title??c.name};break}m.push(x?{to:A,label:C,move:x}:{to:A,label:C,why:I??V??`Nothing in this app moves a ${p} to ${C}.`})}return m}function Ne(t,e,n,o,r=L(t,n,o)){let a=Ke(t,e,n,o),s=We(t,e,n,o);return r.flatMap(p=>{if(p.value===null)return[];let m=a.filter(A=>A.sets?.[o]===p.value);return[{value:p.value,label:p.label,by:m.length>0?"step":s.length>0?"value":"none",acts:m.length>0?m:s}]})}function Ke(t,e,n,o){return e.filter(r=>r.subject!==void 0&&r.derived===void 0&&typeof r.sets?.[o]=="string"&&te(t,r).includes(n))}function We(t,e,n,o){let r=t.tryDefinition(n);return r?e.filter(a=>{if(!a.subject||!te(t,a).includes(n)||!he(a,r).includes(o))return!1;let s=a.input.shape;return s!==void 0&&o in s}).sort((a,s)=>+(a.derived!==void 0)-+(s.derived!==void 0)):[]}var oe=(t,e)=>e&&t[e]!==void 0?String(t[e]):"";function Ye(t,e,n){let o=c=>t.tryDefinition(c)?e.nodesOfKind(c).filter(w=>H(t.tryDefinition(c),w)):[],r=o(n.rows),a=o(n.columns),s=new Set(r.map(c=>c.id)),p=new Set(a.map(c=>c.id)),m=e.allEdges(),A=[],C=n.link;if(typeof C=="string"){let c=f=>t.tryDefinition(f)?.edges?.[C]?.to,w=(c(n.columns)??[]).some(f=>f===n.rows||f==="*"),S=(c(n.rows)??[]).some(f=>f===n.columns||f==="*"),k=w||!S;for(let f of m){if(f.kind!==C)continue;let j=k?f.to:f.from,i=k?f.from:f.to;s.has(j)&&p.has(i)&&A.push({rowId:j,columnId:i,via:[]})}}else{let c=new Map(C.path.map(S=>[S,new Map]));for(let S of m){let k=c.get(S.kind);if(!k)continue;let f=k.get(S.from);f?f.push(S.to):k.set(S.from,[S.to]);let j=k.get(S.to);j?j.push(S.from):k.set(S.to,[S.from])}let w=new Set;for(let S of a){let k=[{id:S.id,via:[]}];for(let f of C.path){let j=[],i=new Set;for(let v of k)for(let b of c.get(f).get(v.id)??[])i.has(`${v.id}|${b}`)||(i.add(`${v.id}|${b}`),j.push({id:b,via:[...v.via,v.id]}));k=j}for(let f of k){let j=`${f.id}|${S.id}`;!s.has(f.id)||w.has(j)||(w.add(j),A.push({rowId:f.id,columnId:S.id,via:f.via.slice(1)}))}}}let R=n.groupOrder??[],F=c=>R.indexOf(c)===-1?R.length:R.indexOf(c),x=(c,w)=>w==="label"?T(t.tryDefinition(c.kind),c):c[w],I=Z(r,n.sort,x).map(c=>{let w=c;return{node:c,label:T(t.tryDefinition(c.kind),c),group:oe(w,n.rowGroup),ref:oe(w,n.rowRef)}}).sort((c,w)=>F(c.group)-F(w.group)||(n.sort!==void 0?0:c.ref<w.ref?-1:c.ref>w.ref?1:0)),V=Z(a,n.columnSort,x).map(c=>({node:c,label:T(t.tryDefinition(c.kind),c),group:oe(c,n.columnGroup)})).sort((c,w)=>c.group<w.group?-1:c.group>w.group?1:n.columnSort!==void 0?0:c.node.id<w.node.id?-1:c.node.id>w.node.id?1:0);return{rows:I,columns:V,cells:A}}function Te(t,e,n){let{rows:o,columns:r,cells:a}=Ye(t,e,n),s=(i,v)=>ee(t,i,v),p=i=>ee(t,i,1).replace(/^1 /,""),m=i=>({id:i.id,kind:i.kind,title:T(t.tryDefinition(i.kind),i),parts:[]}),A=i=>{let v=e.getNode(i);if(!v)return null;let b=t.tryDefinition(v.kind),P=T(b,v),N=z(v,b,{limit:3,said:[P],glance:!0}).map(K=>K.alone.startsWith(K.label)?`${K.label.toLowerCase()}${K.alone.slice(K.label.length)}`:K.alone);return[P,...N].join(", ")},C=typeof n.link=="string"?[]:n.link.path.slice(0,-1).flatMap((i,v,b)=>{let P=ve(t,n.columns,b.slice(0,v+1));return P.ok?[...P.reached]:[]}),R=$e(t,n,{rows:o.length,columns:r.length,cells:a.length});if(R)return[{t:"text",text:`${s(n.rows,o.length)} against ${s(n.columns,r.length)}.`},{t:"text",text:R}];let F=[{t:"text",text:`${s(n.rows,o.length)} against ${s(n.columns,r.length)}${C.length>0?`, through ${[...new Set(C)].map(i=>s(i,2).replace(/^2 /,"")).join(" and ")}`:""}${r.length>0?`: ${r.map(i=>i.label).join(", ")}`:""}.`}],x=new Map(r.map(i=>[i.node.id,i.label])),I=new Map(r.map((i,v)=>[i.node.id,v])),V=new Map,c=new Map;for(let i of a){let v=V.get(i.rowId);v?v.push(i):V.set(i.rowId,[i]);let b=c.get(i.columnId);b?b.add(i.rowId):c.set(i.columnId,new Set([i.rowId]))}for(let i of o){let b=[...V.get(i.node.id)??[]].sort((P,N)=>I.get(P.columnId)-I.get(N.columnId)).map(P=>{let N=P.via.map(A).filter(K=>K!==null);return`${x.get(P.columnId)}${N.length>0?` (${N.join("; ")})`:""}`});F.push({t:"field",label:i.label,text:b.length>0?b.join(", "):"none"})}F.push({t:"list",as:"name",columns:1,groups:r.map(i=>{let v=c.get(i.node.id)??new Set,b=o.filter(P=>v.has(P.node.id)).map(P=>m(P.node));return{heading:`${i.label} (${b.length})`,items:b}})});let w=new Set(a.map(i=>i.rowId)),S=new Set(a.map(i=>i.columnId)),k=o.filter(i=>!w.has(i.node.id)),f=r.filter(i=>!S.has(i.node.id)),j=n.rows===n.columns;return k.length>0&&F.push({t:"text",text:`${j?`${k.length} with none across`:`${s(n.rows,k.length)} with no ${p(n.columns)}`}: ${k.map(i=>i.label).join(", ")}.`}),f.length>0&&F.push({t:"text",text:`${j?`${f.length} with none down`:`${s(n.columns,f.length)} on no ${p(n.rows)}`}: ${f.map(i=>i.label).join(", ")}.`}),F}function ie(t,e,n,o={}){let{app:r,blocks:a=n?r?.viewSpecs?.[n.kind]?.[o.slot??"page"]:r?.home}=o;if(!a?.length)return[];let s=o.firstHeading??(n||o.blocks?void 0:1),p=Me(t,e,n,{...o,money:o.money??r?.brand,firstHeading:s});return n&&!p.node?[]:Re(typeof a[0]?.t=="string"?a:Ce(a),p)}function Y(t,e,n){let o=!(e.optional||e.control==="boolean"),r=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(s=>U(q(t.tryDefinition(s),s))).join(" or "):n(e.name).label,a={name:e.name,label:r,required:o};switch(e.control){case"text":return{...a,input:e.holds==="duration"?"length of time":e.holds??(e.markdown?"Markdown text":e.long?"long text":e.app?"app address":"text")};case"date":return{...a,input:e.time||e.instant?"date and time":"date"};case"number":return{...a,input:e.amount?"amount":"number",...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max}};case"choice":return{...a,input:"choice",choices:(e.options??[]).map(s=>n(e.name).option(s))};case"boolean":return{...a,input:"yes or no"};case"node":return{...a,input:"record",kinds:e.kinds};case"linked":return{...a,input:"record in another app"};case"file":return{...a,input:e.image?"picture":e.video?"video":"file"};case"repeat":return{...a,input:"how it repeats"};case"list":return{...a,input:`list of ${Y(t,e.item,n).input}`};case"group":return{...a,input:"group",fields:e.fields.map(s=>Y(t,s,n))};case"variant":return{...a,input:"one of",choices:e.options.map(s=>me(s.value))};default:return{...a,input:"answer"}}}function He(t,e,n){let o=Be(t,e,n),r=t.schema,a=Oe(r,n).filter(p=>p.name!==n.subject?.arg&&!o.has(p.name)),s=pe(n);return{act:n.name,title:s,submit:s,fields:a.map(p=>Y(r,p,m=>ne(r,n,m)))}}function Le(t,e){return{act:e.act.name,title:e.title,submit:e.submit,visitor:e.name,fields:e.fields.map(n=>Y(t,n,o=>ne(t,e.act,o)))}}function Ee(t,e,n){return t.permittedMutations(e).filter(o=>!o.derived&&!o.subject&&(o.creates??[]).includes(n))}function Ze(t,e=""){let n=[`${e}Form "${t.title}" (${t.visitor?`the visitor form ${t.visitor}, running `:""}act ${t.act}), button "${t.submit}":`],o=(r,a)=>{for(let s of r){let p=s.choices?`${s.input}: ${s.choices.join(", ")}`:s.kinds?`${s.input} (${s.kinds.join(" or ")})`:s.input,m=s.min!==void 0||s.max!==void 0?`, ${s.min??"\u2026"} to ${s.max??"\u2026"}`:"";n.push(`${a}- ${s.label}${s.required?" *":""} (${s.name}) \u2014 ${p}${m}`),s.fields&&o(s.fields,`${a} `)}};return o(t.fields,`${e} `),t.fields.length===0&&n.push(`${e} (asks nothing)`),n}function Ue(t,e){let n=t.viewSpecs??{};return e.filter(o=>o.cardinality==="one"&&o.replaces==="page"&&(n[o.attach]?.page?.length??0)>0).map(o=>{let r=E(t.schema,o.attach,1);return{at:`views.${o.attach}.page`,says:`The view "${o.name}" replaces ${Je(r)}'s page, so its page slot is never drawn: leave out replaces to draw the slot under the view, or draw what the slot says in the view.`}})}var Je=t=>`${/^[aeiou]/i.test(t)?"an":"a"} ${t}`,Qe=240,ze=10,et=1160,tt=40,_e=640,nt=3,rt=t=>Math.max(1,Math.floor((Math.min(t,et)-tt+ze)/(Qe+ze)));function st(t,e,n,o){let{app:r}=o,a=o.width??1440,s=o.today??t.today()??de(r.brand?.timeZone),p=t.seenBy(e),m=p.schema,A=p.graph,C=Ie(r,o.views?{views:o.views}:{}),R=typeof n=="string"?n.trim():n.slug,F=typeof n=="string"?C.find(l=>l.slug===R||l.title===R||l.address===R):C.find(l=>l.slug===n.slug&&l.kind===n.kind)??n,x=!F&&typeof n=="string"?A.getNode(R):void 0,I=!F&&!x?/^\/?forms\/(.+)$/.exec(R)?.[1]:void 0,V=I!==void 0?Ge(r,I):void 0;if(V)return{ok:!0,description:ot(m,V,a)};if(!F&&!x)return{ok:!1,error:`"${R}" is not a place this app has, nor a record this seat can see.`,places:[...C.map(l=>l.slug),...Object.keys(r.forms??{}).map(l=>`forms/${l}`)]};let c=[],w=r.viewSpecs??{},S=rt(a),k=(l,h)=>ie(p,null,l,{app:r,today:s,...h}),f=(l,h,M)=>{let d=m.tryDefinition(l.kind),g=T(d,l);if(h==="name")return{id:l.id,kind:l.kind,title:g,parts:[]};if(w[l.kind]?.[h]){let G=k(l,{slot:h}),[B,...O]=G,y=B?.t==="title"||h==="row"&&B?.t==="headline";return{id:l.id,kind:l.kind,title:y?B.text:g,parts:j(y?O:G,M,`views.${l.kind}.${h}`,` (${l.id})`,y?1:0)}}if(h==="row")return{id:l.id,kind:l.kind,title:g,parts:[]};let u=d?.computed?re(m,A,l):l,W=z(u,d,{limit:3,said:[g],glance:!0,locale:r.brand?.locale,timeZone:r.brand?.timeZone});return{id:l.id,kind:l.kind,title:g,parts:W.map(G=>({t:"text",text:G.alone}))}};function j(l,h,M,d="",g=0){let $=[];return l.forEach((u,W)=>{let G=`${M}.${W+g}`;switch("problem"in u&&u.problem&&c.push({at:`${G}${d}`,says:u.problem}),u.t){case"title":$.push({t:"heading",level:3,text:u.text});return;case"text":$.push({t:"text",text:u.markdown?je(u.text):u.runs?lt(u.runs):u.text,...u.tone?{tone:u.tone}:{}});return;case"badge":$.push({t:"badge",text:u.text});return;case"field":case"image":$.push({t:"field",label:u.label,text:u.text});return;case"progress":$.push({t:"progress",label:u.label,text:u.text});return;case"group":$.push(...j(u.blocks,h,`${G}.group`,d));return;case"when":$.push(...j(u.blocks,h,`${G}.show`,d));return;case"divider":case"figure":return;case"headline":$.push({t:"heading",level:u.level,text:u.text});return;case"number":$.push({t:"figure",text:u.text,...u.label?{label:u.label}:{}});return;case"list":{if(u.failed){$.push({t:"text",text:"\u2014"});return}if(u.members.length===0){u.empty&&$.push({t:"list",as:u.as,columns:1,groups:[],empty:u.empty});return}let B=h+1,O=B>nt?"name":u.as,y=(u.groups??[{value:null,members:u.members}]).map(D=>({..."heading"in D&&D.heading?{heading:D.heading,count:(u.everyGroup?.find(J=>J.value===D.value)??D).members.length}:{},items:D.members.map(J=>f(J,O,B))}));$.push({t:"list",as:O,columns:O==="card"?S:1,groups:y,...u.more>0?{more:u.more}:{}});return}}}),$}let i=[],v,b,P,N=[];if(x){b="record";let l=m.tryDefinition(x.kind),h=T(l,x);P={slug:x.id,title:h,kind:x.kind,address:ke(m,x.kind,x.id)};let M=w[x.kind]?.page,d=o.views?.find(g=>g.attach===x.kind&&g.cardinality==="one");if(d&&i.push({t:"view",name:d.name,...d.title?{title:d.title}:{},...d.replaces==="page"?{replaces:!0}:{},...d.parts?{parts:d.parts}:{}}),d?.replaces==="page")b=`view:${d.name}`,c.push(...Ue(r,[d]));else{M&&i.push(...j(k(x,{slot:"page"}),1,`views.${x.kind}.page`));let g=l?.computed?re(m,A,x):x;for(let $ of Pe(l,z(g,l,{said:[h],locale:r.brand?.locale,timeZone:r.brand?.timeZone}))){$.title&&i.push({t:"heading",level:2,text:$.title});for(let u of $.fields)i.push({t:"field",label:u.label,text:u.value,...u.long?{long:!0}:{},...u.markdown?{markdown:!0}:{}})}}}else{let l=F;P={slug:l.slug,title:l.title,kind:l.kind,address:l.address};let h=l.lens?xe(r).drawn.find(d=>d.as===l.slug&&(l.kind===null||d.kinds.includes(l.kind))):void 0,M=l.kind!==null&&l.view===void 0&&!h?o.views?.find(d=>d.attach===l.kind&&d.cardinality==="many"&&d.replaces==="page"&&!d.hidden):void 0;if(l.kind!==null&&h?.create!==!1&&l.view===void 0&&!M&&(N=Ee(t,e,l.kind).map(d=>He(t,e,d))),l.view!==void 0&&!h){let d=o.views?.find(g=>g.name===l.view);b=`view:${l.view}`,i.push({t:"view",name:l.view,title:d?.title??l.title,...typeof d?.flows=="boolean"?{flows:d.flows}:{},...d?.parts?{parts:d.parts}:{}})}else if(l.kind===null){let d=r.brand,g=d?.name??r.name,$=be(d)?.light,u=$&&we($)?$:void 0;if(v={name:g,...d?.subtitle&&d.subtitleDrawn!==!1?{subtitle:d.subtitle}:{},...u?{logo:{alt:d?.logoAlt??g,...ye(u)?{drawn:"inline SVG"}:{drawn:"image",src:u}}}:{}},r.home)b="blocks",i=j(k(null,{}),0,"views.home");else{b="derived";let W=t.kindsKeptFrom(e),G=new Set([...r.pages?.hide??[],...W,...t.modules.disabledKinds]),B=Se(m.kinds,r.pages?.order).filter(O=>!G.has(O));i.push({t:"heading",level:1,text:r.name??"Home"});for(let O of B){let y=A.nodesOfKind(O).filter(D=>H(m.tryDefinition(O),D)).length;y>0&&i.push({t:"text",text:`${y} ${E(m,O,y)}`})}}}else if(h?.lens==="blocks")b="lens:blocks",i=j(k(null,{blocks:h.options.blocks??[]}),0,`lenses.${h.index}.options.blocks`);else if(h?.lens==="columns"){b="lens:columns";let d=h.options.bindings??{};for(let g of Object.keys(d)){let $=d[g]?.column;if(!$)continue;let u=L(m,g,$),W=Z(A.nodesOfKind(g).filter(y=>H(m.tryDefinition(g),y)),h.options.sort,(y,D)=>D==="label"?T(m.tryDefinition(y.kind),y):y[D]);Object.keys(d).length>1&&i.push({t:"heading",level:2,text:E(m,g,2).replace(/^./,y=>y.toUpperCase())}),i.push({t:"text",text:`${W.length} ${E(m,g,W.length)} in columns by ${_(m.tryDefinition(g),$).toLowerCase()}.`});let G=u.map(y=>({column:y,items:W.filter(D=>X(D,$,u)===y.value).map(D=>f(D,"card",1))})).filter(({column:y,items:D})=>y.value!==null||D.length>0).map(({column:y,items:D})=>({heading:`${y.label} (${D.length})`,items:D}));i.push({t:"list",as:"card",columns:1,groups:G});let B=new Map;for(let y of W)for(let D of se(t,e,y,$,u))B.set(D.to,(B.get(D.to)??new Set).add(`"${D.title}"`));let O=u.filter(y=>y.value!==null&&B.has(y.value)).map(y=>`to ${y.label} by ${[...B.get(y.value)].join(" or ")}`);i.push({t:"text",text:O.length>0?`Moves: ${O.join("; ")}.`:"Moves: none for this seat."})}}else if(h?.lens==="coverage")b="lens:coverage",i=Te(m,A,h.options);else if(h){b=`lens:${h.lens}`;let d=h.kinds.flatMap(g=>A.nodesOfKind(g).filter($=>H(m.tryDefinition(g),$)));i.push({t:"text",text:`A ${h.lens} of ${d.length} ${h.kinds.map(g=>E(m,g,d.length)).join(" and ")}.`}),i.push({t:"list",as:"name",columns:1,groups:[{items:d.map(g=>f(g,"name",1))}]})}else if(M)b=`view:${M.name}`,i.push({t:"heading",level:1,text:l.title}),i.push({t:"view",name:M.name,...M.title?{title:M.title}:{},replaces:!0,...M.parts?{parts:M.parts}:{}});else{b="derived";let d=A.nodesOfKind(l.kind).filter(g=>H(m.tryDefinition(l.kind),g));i.push({t:"heading",level:1,text:l.title}),d.length===0?i.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${E(m,l.kind,0)} yet.`}):i.push({t:"list",as:"row",columns:1,groups:[{items:d.map(g=>f(g,"row",1))}]})}}let K=e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,qe=a<_e?"phone":"wide",le=P.kind===null?it(m,A):[],ce={...v?{masthead:v}:{},...le.length>0?{facts:le}:{},place:P,seat:K,width:a,variant:qe,drawnBy:b,parts:i,...N.length>0?{forms:N}:{},problems:c};return{ok:!0,description:{...ce,text:ae(ce)}}}function ot(t,e,n){let o=[{t:"heading",level:1,text:e.title},...e.intro?[{t:"text",text:e.intro}]:[]],r={place:{slug:`forms/${e.name}`,title:e.title,kind:null,address:`/forms/${e.name}`},seat:`a visitor (${e.role})`,width:n,variant:n<_e?"phone":"wide",drawnBy:"form",parts:o,forms:[Le(t,e)],problems:[]};return{...r,text:ae(r)}}function it(t,e){let n=Fe(t,e,null),o=r=>Array.isArray(r)?r.map(o).join(", "):r===null?"nothing":typeof r=="boolean"?r?"yes":"no":typeof r=="object"?r.label:String(r);return[...De(t)].map(([r,a])=>{let s=a.label??U(r);return Object.hasOwn(n.values,r)?{name:r,label:s,value:o(n.values[r])}:{name:r,label:s,refused:n.refused[r]??"it could not be worked out"}})}function E(t,e,n){let o=t.tryDefinition(e);if(n===1)return o?.noun??e;let r=fe(t,e);return ue(r)}function ae(t){let e=[`${t.place.title} (${t.place.address}) \u2014 as ${t.seat}, ${t.width} wide (${t.variant}).`],n=t.masthead;n&&e.push(`Masthead: ${n.logo?`the logo ("${n.logo.alt}", ${n.logo.drawn==="image"?n.logo.src:"inline SVG"}), `:""}${n.name}${n.subtitle?` \u2014 ${n.subtitle}`:""}`);let o=(r,a)=>{for(let s of r)switch(s.t){case"heading":e.push(`${a}${"#".repeat(s.level)} ${s.text}`);break;case"text":e.push(`${a}${s.text}`);break;case"badge":e.push(`${a}[${s.text}]`);break;case"field":case"progress":e.push(`${a}${s.label}: ${s.text}`);break;case"figure":e.push(`${a}${s.text}${s.label?` \u2014 ${s.label}`:""}`);break;case"list":if(s.groups.length===0){s.empty&&e.push(`${a}(${s.empty})`);break}for(let p of s.groups){p.heading&&e.push(`${a}${p.heading}${p.count!==void 0?` (${p.count})`:""}:`);for(let m of p.items)e.push(`${a}${p.heading?" ":""}- ${m.title}`),o(m.parts,`${a}${p.heading?" ":" "}`)}s.as==="card"&&s.columns>1&&e.push(`${a}(cards, ${s.columns} across)`),s.more&&e.push(`${a}and ${s.more} more`);break;case"view":e.push(`${a}[the view "${s.title??s.name}"${s.replaces?", in place of the page":""}${s.flows===!0?", flowing with the page":s.flows===!1?", in a frame of its own":""}]`),s.parts&&o(s.parts,`${a} `);break}};o(t.parts,"");for(let r of t.forms??[])e.push(...Ze(r));if(t.facts){e.push("Facts of the whole graph (what fact('<name>') reads):");for(let r of t.facts)e.push(`- ${r.label} (${r.name}): ${r.value??`not worked out \u2014 ${r.refused}`}`)}if(t.videos&&t.videos.length>0){e.push("Videos:");for(let r of t.videos)e.push(`- ${at(r)}`)}if(t.problems.length>0){e.push("Problems:");for(let r of t.problems)e.push(`- ${r.at}: ${r.says}`)}return e.join(`
2
- `)}function at(t){let e=t.autoplay?"plays as a background, muted and looping, with no controls":"plays with the browser's controls";return`${t.text} (${t.field} of ${t.record}): ${t.source}${t.duration!==void 0?`, ${Math.round(t.duration)} s`:""}, ${t.poster?"with a poster":"no poster"}; ${e}${t.cover?", filling its box":""}; ${t.playable?"playable":`not playable: ${t.why??"it is not a video a browser plays"}`}.`}function lt(t){return t.map((e,n)=>(n===0?"":e.field===void 0&&t[n-1].field===void 0?" \xB7 ":" ")+e.text).join("")}export{L as a,X as b,se as c,Ve as d,Ne as e,Ke as f,We as g,ie as h,Ue as i,st as j,ae as k};