graview 0.1.54 → 0.1.56

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 (197) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +6 -6
  3. package/dist/index.js.map +1 -1
  4. package/dist/preview/{chunk.XTT6ERI3.js → chunk.22MIRLL6.js} +1 -1
  5. package/dist/preview/chunk.2BLRCT3E.js +1 -0
  6. package/dist/preview/chunk.2DETYEJM.js +1 -0
  7. package/dist/preview/{chunk.AN5QCSVK.js → chunk.2E6EWVWR.js} +1 -1
  8. package/dist/preview/{chunk.RBYRT2I2.js → chunk.2HZGUVB2.js} +1 -1
  9. package/dist/preview/{chunk.ZBHFCSKO.js → chunk.2OX4YI46.js} +1 -1
  10. package/dist/preview/{chunk.E5JX5LWY.js → chunk.2YNZVNCA.js} +1 -1
  11. package/dist/preview/chunk.3V2WH6F7.js +1 -0
  12. package/dist/preview/chunk.3X3GLNWQ.js +1 -0
  13. package/dist/preview/chunk.45VIF2SX.js +5 -0
  14. package/dist/preview/{chunk.VGOWGOGD.js → chunk.4EUH6TLG.js} +2 -2
  15. package/dist/preview/chunk.4EY6WPSM.js +2 -0
  16. package/dist/preview/{chunk.Y2DFDMT6.js → chunk.4KMY24YC.js} +1 -1
  17. package/dist/preview/chunk.4YI6656P.js +1 -0
  18. package/dist/preview/{chunk.D2PJG5N7.js → chunk.5B4HNQGR.js} +1 -1
  19. package/dist/preview/chunk.5MS2TQFX.js +1 -0
  20. package/dist/preview/chunk.5MSWUTDB.js +1 -0
  21. package/dist/preview/{chunk.BOMYLOCX.js → chunk.64IKLRUS.js} +1 -1
  22. package/dist/preview/{chunk.VYKEIKY5.js → chunk.65Q5MKDW.js} +1 -1
  23. package/dist/preview/{chunk.3IEJQAK7.js → chunk.6HLKAUWF.js} +1 -1
  24. package/dist/preview/chunk.6Q6BW4QT.js +2 -0
  25. package/dist/preview/chunk.7ECBGIUK.js +1 -0
  26. package/dist/preview/{chunk.J2Z6WLCH.js → chunk.7NP2I2UP.js} +1 -1
  27. package/dist/preview/{chunk.5C43AM3X.js → chunk.7O6Z3BFR.js} +1 -1
  28. package/dist/preview/chunk.7RJGEU3Y.js +1 -0
  29. package/dist/preview/{chunk.TUNHUTQ5.js → chunk.7U2JO7ET.js} +1 -1
  30. package/dist/preview/chunk.7Z2PRPYE.js +1 -0
  31. package/dist/preview/{chunk.3JMZHCB4.js → chunk.7Z4USR3Y.js} +1 -1
  32. package/dist/preview/chunk.AGTFYPXY.js +1 -0
  33. package/dist/preview/{chunk.XZJ6XX5I.js → chunk.AIK3Z25Y.js} +1 -1
  34. package/dist/preview/{chunk.ZDDWXRPK.js → chunk.AKVBU5K5.js} +1 -1
  35. package/dist/preview/chunk.AKW6NR3X.js +1 -0
  36. package/dist/preview/{chunk.2DFWOLL2.js → chunk.AM2YRNOQ.js} +1 -1
  37. package/dist/preview/{chunk.2WSRJGW2.js → chunk.APXYWI3L.js} +1 -1
  38. package/dist/preview/{chunk.7SCENHVG.js → chunk.AQCU6TPV.js} +1 -1
  39. package/dist/preview/{chunk.B2X6DA2Q.js → chunk.AZUTYY2S.js} +1 -1
  40. package/dist/preview/chunk.BJUUSIQY.js +1 -0
  41. package/dist/preview/{chunk.FRZQSSGE.js → chunk.BNEOLRQG.js} +1 -1
  42. package/dist/preview/chunk.BT7RLFPO.js +1 -0
  43. package/dist/preview/{chunk.4GHXAWIE.js → chunk.C2VFDBSG.js} +1 -1
  44. package/dist/preview/{chunk.C3AHDHX7.js → chunk.CGM7OER2.js} +1 -1
  45. package/dist/preview/{chunk.4F5M5XZG.js → chunk.CKV2QCH5.js} +1 -1
  46. package/dist/preview/{chunk.4KTHJY5N.js → chunk.CU2NQ5WF.js} +1 -1
  47. package/dist/preview/{chunk.ARRLAAG6.js → chunk.D4LN33J2.js} +1 -1
  48. package/dist/preview/{chunk.W6NCLU5Y.js → chunk.D6BMAGPR.js} +1 -1
  49. package/dist/preview/{chunk.RCFAHV5N.js → chunk.D6KF72MZ.js} +1 -1
  50. package/dist/preview/{chunk.L7MFTL5S.js → chunk.DH7M57SE.js} +1 -1
  51. package/dist/preview/chunk.DPPT6WAJ.js +2 -0
  52. package/dist/preview/{chunk.45HTFSWD.js → chunk.DTSTUC2W.js} +1 -1
  53. package/dist/preview/{chunk.VTO6UWUP.js → chunk.DWMAFMYZ.js} +1 -1
  54. package/dist/preview/chunk.DZYLH5IM.js +1 -0
  55. package/dist/preview/{chunk.PZ4G5QA5.js → chunk.E33EJU3Q.js} +1 -1
  56. package/dist/preview/{chunk.33YC5RCB.js → chunk.E4EN4X5F.js} +1 -1
  57. package/dist/preview/{chunk.DF7IPT7V.js → chunk.E4HSSGF7.js} +1 -1
  58. package/dist/preview/{chunk.PZWJUQAO.js → chunk.E5XNQTEU.js} +1 -1
  59. package/dist/preview/{chunk.FWKNR7XF.js → chunk.EC5IWN74.js} +2 -2
  60. package/dist/preview/chunk.FBR4HJ2Q.js +1 -0
  61. package/dist/preview/{chunk.AKLVSZ5A.js → chunk.FCUDBMGC.js} +1 -1
  62. package/dist/preview/chunk.FOQENWF5.js +1 -0
  63. package/dist/preview/{chunk.SLBWPVIY.js → chunk.FQLNBIQ5.js} +1 -1
  64. package/dist/preview/{chunk.562IVJHX.js → chunk.G3ORIU7C.js} +1 -1
  65. package/dist/preview/chunk.GNQW4JOG.js +18 -0
  66. package/dist/preview/chunk.GUP7LC5O.js +21 -0
  67. package/dist/preview/{chunk.FWZF7X6A.js → chunk.HFVMGTNL.js} +2 -2
  68. package/dist/preview/chunk.HVN2DVP3.js +1 -0
  69. package/dist/preview/{chunk.4WH4N4V7.js → chunk.I2C5LPB5.js} +1 -1
  70. package/dist/preview/{chunk.BPWSQVEN.js → chunk.IF4FCQPG.js} +1 -1
  71. package/dist/preview/{chunk.U7GN6UPR.js → chunk.ILSK2E3R.js} +1 -1
  72. package/dist/preview/{chunk.2LMB5E6N.js → chunk.IRMO4FUC.js} +1 -1
  73. package/dist/preview/chunk.IT763BYH.js +1 -0
  74. package/dist/preview/chunk.IUQOSPQX.js +1 -0
  75. package/dist/preview/{chunk.Y36WSKL5.js → chunk.J3YBEZKE.js} +1 -1
  76. package/dist/preview/{chunk.4V64RBCK.js → chunk.JHFHIG4P.js} +1 -1
  77. package/dist/preview/chunk.JL4DGITZ.js +1 -0
  78. package/dist/preview/{chunk.463PGKOL.js → chunk.JQY2UKU6.js} +1 -1
  79. package/dist/preview/{chunk.IDYPQ45A.js → chunk.JZDKHWRL.js} +1 -1
  80. package/dist/preview/{chunk.6BBB7SJL.js → chunk.K2JE3PD7.js} +1 -1
  81. package/dist/preview/chunk.K4MO22RM.js +1 -0
  82. package/dist/preview/{chunk.NEJSKMJV.js → chunk.K5YLQAFW.js} +1 -1
  83. package/dist/preview/{chunk.IMHUKSPM.js → chunk.KBL4Y4UN.js} +1 -1
  84. package/dist/preview/chunk.KMEKMCKG.js +3 -0
  85. package/dist/preview/{chunk.3ZONBC6L.js → chunk.LKK7VQBA.js} +1 -1
  86. package/dist/preview/chunk.LLOZKUCA.js +1 -0
  87. package/dist/preview/{chunk.YXRKZMS5.js → chunk.LP3SHWJG.js} +1 -1
  88. package/dist/preview/chunk.LVOVPU64.js +1 -0
  89. package/dist/preview/chunk.MEJUAV3Y.js +1 -0
  90. package/dist/preview/{chunk.7JCUSYS5.js → chunk.MFDSWA2W.js} +1 -1
  91. package/dist/preview/{chunk.JTOAZ2IR.js → chunk.MJMVGW6Z.js} +1 -1
  92. package/dist/preview/{chunk.SDO3DD77.js → chunk.MLRPCZVS.js} +1 -1
  93. package/dist/preview/{chunk.OCV46AFN.js → chunk.MORMTKVR.js} +1 -1
  94. package/dist/preview/{chunk.FMP6NDRZ.js → chunk.N3Q5CPVA.js} +1 -1
  95. package/dist/preview/{chunk.VW6X53E7.js → chunk.N7EEPFYV.js} +1 -1
  96. package/dist/preview/{chunk.NGWHV4G6.js → chunk.NBLMANHT.js} +1 -1
  97. package/dist/preview/{chunk.5RH6FO3K.js → chunk.NFU4UM6F.js} +1 -1
  98. package/dist/preview/chunk.NPAWTPLQ.js +25 -0
  99. package/dist/preview/{chunk.B6PKKEY3.js → chunk.NQ4VGKEC.js} +1 -1
  100. package/dist/preview/{chunk.MNW2ZBQ6.js → chunk.NUE5VG4G.js} +1 -1
  101. package/dist/preview/{chunk.XBDFXFWM.js → chunk.O6LDZWLR.js} +1 -1
  102. package/dist/preview/chunk.OBUKZQCZ.js +1 -0
  103. package/dist/preview/{chunk.GKLDSHHH.js → chunk.ONGZ3YQF.js} +1 -1
  104. package/dist/preview/chunk.OYGPNO7A.js +1 -0
  105. package/dist/preview/chunk.PJCVFYFU.js +1 -0
  106. package/dist/preview/{chunk.IYYP6QUH.js → chunk.PMPDLE56.js} +1 -1
  107. package/dist/preview/{chunk.PR2TSHE7.js → chunk.PRV3KYT6.js} +2 -2
  108. package/dist/preview/chunk.Q7X2IVLH.js +1 -0
  109. package/dist/preview/chunk.QAIYYIZQ.js +1 -0
  110. package/dist/preview/chunk.QNNRSPIJ.js +2 -0
  111. package/dist/preview/{chunk.KI6M3EWZ.js → chunk.QSO5BP2H.js} +1 -1
  112. package/dist/preview/{chunk.WICMCZ27.js → chunk.QW3QLE53.js} +1 -1
  113. package/dist/preview/{chunk.WHGEDJB2.js → chunk.QYFZ7AZS.js} +2 -2
  114. package/dist/preview/{chunk.Q6RUTFU3.js → chunk.RDL6652E.js} +1 -1
  115. package/dist/preview/{chunk.MDWCX3YU.js → chunk.RR2IFETZ.js} +1 -1
  116. package/dist/preview/{chunk.R7RDUW37.js → chunk.RXYE2DAJ.js} +1 -1
  117. package/dist/preview/chunk.SDLUWRGI.js +1 -0
  118. package/dist/preview/chunk.SOTB6C5A.js +1 -0
  119. package/dist/preview/{chunk.3SOJJAMY.js → chunk.SRC37GNP.js} +1 -1
  120. package/dist/preview/{chunk.CB7IUKY7.js → chunk.SVAQGVS4.js} +1 -1
  121. package/dist/preview/chunk.T2RME6XF.js +1 -0
  122. package/dist/preview/{chunk.COWJTVZV.js → chunk.T6HG2XIP.js} +1 -1
  123. package/dist/preview/{chunk.6TILXTP6.js → chunk.TAIYNHSW.js} +1 -1
  124. package/dist/preview/chunk.TAJ2R44N.js +1 -0
  125. package/dist/preview/{chunk.BUDEUNBN.js → chunk.TQCRFZ53.js} +1 -1
  126. package/dist/preview/{chunk.ZYW7Q5EN.js → chunk.TXWCTHMI.js} +1 -1
  127. package/dist/preview/chunk.UE5YS3GN.js +1 -0
  128. package/dist/preview/{chunk.C6HBYRGJ.js → chunk.UQQAGT3R.js} +1 -1
  129. package/dist/preview/chunk.USB6B6L3.js +104 -0
  130. package/dist/preview/{chunk.KRVEAIKW.js → chunk.USQNSNIA.js} +1 -1
  131. package/dist/preview/{chunk.AZGXBTOQ.js → chunk.V3NPUAPB.js} +1 -1
  132. package/dist/preview/{chunk.NDI5OWIB.js → chunk.VDD3RHLB.js} +1 -1
  133. package/dist/preview/{chunk.ULSN3ASK.js → chunk.VEOS25PQ.js} +1 -1
  134. package/dist/preview/chunk.VIQ6EF2O.js +1 -0
  135. package/dist/preview/{chunk.OZ4EJ5M6.js → chunk.VLBY66PB.js} +2 -2
  136. package/dist/preview/chunk.VSM72NVF.js +1 -0
  137. package/dist/preview/{chunk.GVUJCOKD.js → chunk.VYW7DSUW.js} +2 -2
  138. package/dist/preview/{chunk.DTJ4FIHM.js → chunk.WMB2NNBD.js} +1 -1
  139. package/dist/preview/{chunk.KJGNLWU3.js → chunk.WPJVMVAL.js} +1 -1
  140. package/dist/preview/{chunk.CB5DGKR5.js → chunk.XGCOWCA2.js} +1 -1
  141. package/dist/preview/chunk.XJFAUOJS.js +1 -0
  142. package/dist/preview/{chunk.7TMWMW4W.js → chunk.XY5EVI22.js} +1 -1
  143. package/dist/preview/chunk.YEJ4LNUP.js +5 -0
  144. package/dist/preview/{chunk.FCZ7UFJI.js → chunk.YL5ZCRHQ.js} +1 -1
  145. package/dist/preview/{chunk.MAWP27FD.js → chunk.YLMOGGEP.js} +1 -1
  146. package/dist/preview/{chunk.WVWXNW74.js → chunk.ZFXHZZHW.js} +1 -1
  147. package/dist/preview/index.html +52 -51
  148. package/dist/preview/page.js +2 -2
  149. package/package.json +6 -6
  150. package/dist/preview/chunk.25P5SDNR.js +0 -1
  151. package/dist/preview/chunk.27O4LIDU.js +0 -1
  152. package/dist/preview/chunk.3G5DEGFA.js +0 -1
  153. package/dist/preview/chunk.3MZIWKNG.js +0 -5
  154. package/dist/preview/chunk.3V2WXZU3.js +0 -1
  155. package/dist/preview/chunk.4BX3KLAA.js +0 -1
  156. package/dist/preview/chunk.4TGQ6Z6E.js +0 -1
  157. package/dist/preview/chunk.57VTD3CU.js +0 -1
  158. package/dist/preview/chunk.5M62CMLA.js +0 -1
  159. package/dist/preview/chunk.5VF2RT4H.js +0 -1
  160. package/dist/preview/chunk.5XAIP3BS.js +0 -1
  161. package/dist/preview/chunk.5ZWE72VJ.js +0 -1
  162. package/dist/preview/chunk.6SPORDJC.js +0 -1
  163. package/dist/preview/chunk.7UD2JR6J.js +0 -1
  164. package/dist/preview/chunk.AG7CUSSV.js +0 -1
  165. package/dist/preview/chunk.C6HI3LRB.js +0 -1
  166. package/dist/preview/chunk.D6ACCKYJ.js +0 -1
  167. package/dist/preview/chunk.EC7I33WI.js +0 -1
  168. package/dist/preview/chunk.GHPCSNM6.js +0 -21
  169. package/dist/preview/chunk.HLDMTKUP.js +0 -1
  170. package/dist/preview/chunk.J3OX474P.js +0 -1
  171. package/dist/preview/chunk.JCFYZEMY.js +0 -1
  172. package/dist/preview/chunk.JLB4QP6Q.js +0 -1
  173. package/dist/preview/chunk.JXGDVJ4N.js +0 -1
  174. package/dist/preview/chunk.K2J26XMB.js +0 -104
  175. package/dist/preview/chunk.KLJDBYAZ.js +0 -1
  176. package/dist/preview/chunk.LNOWO3IY.js +0 -2
  177. package/dist/preview/chunk.LOUICR7K.js +0 -1
  178. package/dist/preview/chunk.LU3B3SZH.js +0 -1
  179. package/dist/preview/chunk.LVOL2LEC.js +0 -1
  180. package/dist/preview/chunk.LYFEGG6E.js +0 -1
  181. package/dist/preview/chunk.MPMROUZA.js +0 -1
  182. package/dist/preview/chunk.MVRNEC3Y.js +0 -2
  183. package/dist/preview/chunk.OLKFEHWB.js +0 -1
  184. package/dist/preview/chunk.PCNEM3WE.js +0 -1
  185. package/dist/preview/chunk.QB7RYJ67.js +0 -5
  186. package/dist/preview/chunk.RLO3RDYH.js +0 -2
  187. package/dist/preview/chunk.RYMSHMLM.js +0 -1
  188. package/dist/preview/chunk.SF4BYBH6.js +0 -25
  189. package/dist/preview/chunk.SG7YVKH4.js +0 -1
  190. package/dist/preview/chunk.T42H5RXN.js +0 -1
  191. package/dist/preview/chunk.TI4OSTQV.js +0 -1
  192. package/dist/preview/chunk.VFMC45E7.js +0 -1
  193. package/dist/preview/chunk.VWQ57LTT.js +0 -18
  194. package/dist/preview/chunk.Y36MLVMT.js +0 -1
  195. package/dist/preview/chunk.Z6O7RUSR.js +0 -1
  196. package/dist/preview/chunk.ZAGP3OKY.js +0 -1
  197. package/dist/preview/chunk.ZUBC3UFG.js +0 -2
@@ -1,4 +1,4 @@
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{c as sr}from"./chunk.3JMZHCB4.js";import{G as R,Ga as O,Ma as hn,Na as vn,Oa as bn,Ra as U,T as S,Va as Q,a as Pe,ba as ce,ca as Y,e as Le,l as un,la as yn,m as fn,s as gn,ta as wn,v as re,z as mn}from"./chunk.SF4BYBH6.js";import{a as C}from"./chunk.SDO3U72B.js";import{Ac as Xe,Cc as en,Cd as on,Dc as nn,Dd as sn,Ed as ln,Fd as dn,Gd as cn,Hd as Se,Ld as pn,Ya as Ue,da as ze,ia as je,ja as Ye,mb as Qe,nd as de,od as ne,pd as rn,rc as Ze,rd as xe,td as tn,ud as an,vd as j,yc as z,zc as Je}from"./chunk.3MZIWKNG.js";import{b as v}from"./chunk.AJZBJBMO.js";var Ee=v(R(),1),kn=new WeakMap,pe=e=>{let n=kn.get(e);return n||kn.set(e,n={open:null,drawn:0,listeners:new Set}),n},lr=e=>{for(let n of[...e.listeners])n()},dr=0;function kt(e,n){let t=pe(e);t.open=n?{...n,at:++dr}:null,lr(t)}var xn=e=>n=>{let t=pe(e);return t.listeners.add(n),()=>void t.listeners.delete(n)};function Sn(e){let n=()=>e?pe(e).drawn>0:!1;return(0,Ee.useSyncExternalStore)(e?xn(e):cr,n,n)}var cr=()=>()=>{};function xt(e){let n=()=>pe(e).open;return(0,Ee.useSyncExternalStore)(xn(e),n,n)}var V=v(R(),1),Pn=v(sr(),1);function pr(e){let[n,t]=(0,V.useState)(null),[r,o]=(0,V.useState)(null);return(0,V.useLayoutEffect)(()=>{e.current!==r&&o(e.current)}),(0,V.useLayoutEffect)(()=>{if(!r||typeof ResizeObserver>"u")return;let a=()=>Math.round(r.getBoundingClientRect().width),i=a();t(i);let p=new ResizeObserver(()=>{let c=a();c!==i&&(i=c,(0,Pn.flushSync)(()=>t(c)))});return p.observe(r),()=>p.disconnect()},[r]),n}function ur(e=!0){let[n,t]=(0,V.useState)();return(0,V.useEffect)(()=>{if(!e)return t(void 0);let r=0,o=()=>t(innerHeight),a=()=>{o(),clearTimeout(r),r=window.setTimeout(o,300)},i=p=>{for(let[c,d]of[[window,"resize"],[window,"orientationchange"],[window.visualViewport,"resize"]])c?.[p](d,a)};return i("addEventListener"),o(),()=>{clearTimeout(r),i("removeEventListener")}},[e]),n}var ue={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap"};var L=v(R(),1);var T=v(S(),1),Ln=6e3;function fr(){let e=[],n=0,t=new Set,r=new Map,o,a=()=>{for(let d of[...t])d()},i=d=>{if(clearTimeout(r.get(d.id)),r.delete(d.id),d.kind!=="toast")return;let u=(d.actions?.length??0)+(d.action?1:0),l=d.timeout??(u>0?!1:Ln);l!==!1&&r.set(d.id,setTimeout(()=>o?.()?i(d):p(d.id),l))},p=d=>{clearTimeout(r.get(d)),r.delete(d),e.some(u=>u.id===d)&&(e=e.filter(u=>u.id!==d),a())},c=d=>{e=e.some(u=>u.id===d.id)?e.map(u=>u.id===d.id?d:u):[...e,d],i(d),a()};return{notify(d){let u=d.id??`notice-${++n}`;return c({...d,id:u,said:++n}),{id:u,dismiss:()=>p(u),update:l=>{let g=e.find(w=>w.id===u);g&&c({...g,...l,id:u,kind:g.kind,said:l.sentence!==void 0&&l.sentence!==g.sentence?++n:g.said})}}},dismiss:p,hold(d){o=d},list:()=>e,subscribe(d){return t.add(d),()=>t.delete(d)}}}function gr({notices:e}){let n=e.reduce((p,c)=>!p||c.said>p.said?c:p,void 0),[t,r]=(0,L.useState)(""),[o,a]=(0,L.useState)(""),i=(0,L.useRef)(0);return(0,L.useEffect)(()=>{if(!n||n.said===i.current)return;i.current=n.said;let p=n.tone==="bad";(p?a:r)("");let c=setTimeout(()=>(p?a:r)(n.sentence),50);return()=>clearTimeout(c)},[n]),(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{role:"status","aria-live":"polite","data-testid":"notices-said",style:ue,children:t}),(0,T.jsx)("div",{role:"alert","data-testid":"notices-alarm",style:ue,children:o})]})}var mr=(0,L.createContext)(null);function yr({board:e,anchor:n}){let t=(0,L.useSyncExternalStore)(e.subscribe,e.list,e.list);return(0,L.useEffect)(()=>vr(Ae.prefetch),[]),(0,T.jsxs)(T.Fragment,{children:[t.length>0?(0,T.jsx)(L.Suspense,{fallback:null,children:(0,T.jsx)(hr,{notices:t,anchor:n,board:e})}):null,(0,T.jsx)(gr,{notices:t})]})}var Ae=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.MB7LKKUD.js","./chunk.FWZF7X6A.js","./chunk.3JMZHCB4.js","./chunk.SF4BYBH6.js","./chunk.SDO3U72B.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.FCZ7UFJI.js")))),wr=()=>Ae.load().then(()=>{},()=>{}),hr=Ae.part((e,n)=>(0,T.jsx)(e.NoticeStacks,{...n}),{quiet:!0});function vr(e){let n=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},t=globalThis;if(t.requestIdleCallback){let o=t.requestIdleCallback(n,{timeout:5e3});return()=>t.cancelIdleCallback?.(o)}let r=setTimeout(n,2500);return()=>clearTimeout(r)}var M=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.XTT6ERI3.js","./chunk.5VF2RT4H.js","./chunk.5RH6FO3K.js","./chunk.ZDDWXRPK.js","./chunk.LOUICR7K.js","./chunk.L7MFTL5S.js","./chunk.XZJ6XX5I.js","./chunk.4F5M5XZG.js","./chunk.3G5DEGFA.js","./chunk.AZGXBTOQ.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.PZWJUQAO.js","./chunk.OJGHDWI6.js","./chunk.NEJSKMJV.js","./chunk.5ZWE72VJ.js","./chunk.RLO3RDYH.js","./chunk.TUNHUTQ5.js","./chunk.FWZF7X6A.js","./chunk.3JMZHCB4.js","./chunk.SF4BYBH6.js","./chunk.SDO3U72B.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.PR2TSHE7.js"))));var y=v(R(),1);var Tn=v(R(),1);var En=v(R(),1);function Te(e){return(0,En.useMemo)(()=>e===void 0||e===""?void 0:{__html:e},[e])}var $=v(S(),1);function He({brand:e,size:n=22}){let t=en(e),r=An(t?.light),o=r?An(t?.dark):void 0,a=Te(r!==void 0&&z(r)?r:void 0),i=Te(o!==void 0&&z(o)?o:void 0),p={display:"inline-flex",flex:"0 0 auto",height:n,color:"var(--graview-accent)"},c=nn(e);if(c)return(0,$.jsx)("span",{className:"graview-logo graview-emoji-mark","data-testid":"app-mark","aria-hidden":!0,style:{...p,alignItems:"center",fontSize:`${n*.86/16}rem`,lineHeight:1},children:c});if(!r)return null;let d=e?.logoAlt??e?.name??"",u=d!==""&&d!==e?.name,l=u?{role:"img","aria-label":d}:{"aria-hidden":!0};if(o){let w=(h,x,b)=>z(h)?(0,$.jsx)("span",{className:"graview-logo-face","data-graview-scheme-only":b,dangerouslySetInnerHTML:x}):(0,$.jsx)("img",{className:"graview-logo-face","data-graview-scheme-only":b,src:h,alt:""});return(0,$.jsxs)("span",{className:"graview-logo","data-testid":"app-mark",style:p,...l,children:[w(r,a,"light"),w(o,i,"dark")]})}let g=t?.darkFallback==="invert"?{"data-graview-logo-fallback":"invert"}:{};return z(r)?(0,$.jsx)("span",{className:"graview-logo","data-testid":"app-mark",style:p,...g,...l,dangerouslySetInnerHTML:a}):(0,$.jsx)("img",{className:"graview-logo","data-testid":"app-mark",src:r,alt:u?d:"",...g,style:{...p,width:"auto"}})}function An(e){if(!(!e||!Xe(e)))return z(e)&&Je(e)!==null?void 0:e}function br(e){(0,Tn.useEffect)(()=>{if(!e||typeof document>"u")return;let n=[...document.querySelectorAll('link[rel~="icon"]')],t=n.map(o=>o.getAttribute("href")),r;n.length===0&&(r=document.createElement("link"),r.rel="icon",r.setAttribute("data-graview-favicon",""),document.head.appendChild(r),n.push(r));for(let o of n)o.href=e;return()=>{r&&r.remove(),n.forEach((o,a)=>{o!==r&&t[a]!==null&&t[a]!==void 0&&o.setAttribute("href",t[a])})}},[e])}var s=v(S(),1),kr=M.part((e,n)=>(0,s.jsx)(e.TidyFoot,{...n}),{quiet:!0}),xr=M.part((e,n)=>(0,s.jsx)(e.Here,{...n}),{quiet:!0});function Sr(){let e=Y(),[n,t]=(0,y.useState)("");return(0,y.useEffect)(()=>e?.store.subscribe((r,o)=>{o.some(a=>a.author.id!==e.principal.id)&&M.load().then(a=>a.sayTheirChange(o,e,t),String)}),[e]),(0,s.jsx)("span",{role:"status",className:"graview-bar-said",children:n})}var Hn="home",Bn="/",q="scene:whole";function Pr(e){let{store:n,principal:t,views:r}=e,o=n.kindsKeptFrom(t),a=n.schema.kinds.filter(f=>!n.modules.disabledKinds.has(f)&&!o.has(f)),i=r?.arrangement?.(),p=r?.places()??[],c=dn(i,n.schema,p),d=ln(n.schema,i,[...n.modules.administered.values()].flatMap(f=>f.kinds??[])),u=(f,P)=>(!n.graph.size.nodes||n.graph.count(f)>0)&&(c?P?c.places.has(`${f}|${P}`):c.kinds.has(f):!d.has(f)),l=[{key:Hn,label:"Home",path:Bn,group:"home",primary:!0}],g=p.filter(f=>a.includes(f.kind)&&f.as!==cn),w=g.filter(f=>!f.hidden),h=new Set(ne(w).map(f=>j(f,p,n.schema).toLowerCase())),x=f=>tn(f.as,an(f,p)?xe(n.schema,f.kind).slice(1):void 0),b=new Set(i?.hide??[]),H=pn(a,i?.order,w);for(let{kind:f,view:P}of H){if(P){l.push({key:`place:${P.kind}:${P.as}`,label:j(P,p,n.schema),path:x(P),group:"lists",kind:f,primary:c?c.places.has(`${f}|${P.as}`):!0});continue}let W=je(n.schema,f),B=h.has(W.toLowerCase());l.push({key:`kind:${f}`,label:B?Ye(n.schema,f):W,path:xe(n.schema,f),group:"lists",kind:f,primary:B||b.has(f)?!1:u(f),...b.has(f)?{hidden:!0}:{}})}for(let f of ne(g)){if(H.some(B=>B.view&&de(B.view,f)))continue;let P=x(f),W=[f.kind,...f.over??[]].some(B=>a.includes(B)&&u(B,f.as));l.some(B=>B.path===P)||l.push({key:`place:${f.kind}:${f.as}`,label:j(f,p,n.schema),path:P,group:"pictures",kind:f.kind,primary:W,hidden:f.hidden})}return a.some(f=>Object.keys(n.schema.tryDefinition(f)?.edges??{}).length>0)&&l.push({key:"connections",label:"Connections",path:"/map",group:"pictures",primary:!1}),l}function Lr(e,n){let[t="/",r=""]=n.split("?"),o=e.find(i=>i.path===(r?`${t}?${r}`:t))??e.find(i=>i.path===t);if(o)return o.key;let a=`/${t.split("/").filter(Boolean)[0]??""}`;return e.find(i=>i.group==="lists"&&i.path===a)?.key??null}var Nn=(0,y.createContext)(null),Er=()=>(0,y.useContext)(Nn),Z=30,Mn=48,te=640,Me=4,Be=2;function Cn(e){let{widths:n,current:t,room:r,more:o,gap:a=Me,primary:i,most:p=sn}=e;if(n.length===0||!(r>0)||!(o>0)||n.some(l=>!(l>0)))return null;let c=(l,g)=>l.reduce((w,h)=>w+n[h],0)+a*Math.max(0,l.length-1)+(g?a+o:0),d=(l,g)=>t<0||!l.includes(t)||l.slice(0,g).includes(t)?l.slice(0,g):[...l.filter(w=>w!==t).slice(0,g-1),t].sort((w,h)=>w-h),u=d(n.map((l,g)=>g).filter(l=>i?.[l]!==!1||l===t),p);if(c(u,u.length<n.length)<=r)return u.length>=Be?u:null;for(let l=u.length-1;l>=Be;l--){let g=d(u,l);if(c(g,!0)<=r)return g}return null}var Ar=`
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{c as sr}from"./chunk.7Z4USR3Y.js";import{G as R,Ga as O,Ma as hn,Na as vn,Oa as bn,Ra as U,T as S,Va as Q,a as Pe,ba as ce,ca as Y,e as Le,l as un,la as yn,m as fn,s as gn,ta as wn,v as re,z as mn}from"./chunk.NPAWTPLQ.js";import{a as C}from"./chunk.SDO3U72B.js";import{Bc as z,Bd as tn,Cc as Je,Cd as an,Dc as Xe,Dd as j,Fc as en,Gc as nn,Kd as on,Ld as sn,Md as ln,Nd as dn,Od as cn,Pd as Se,Td as pn,_a as Ue,ga as ze,ka as je,la as Ye,pb as Qe,uc as Ze,vd as de,wd as ne,xd as rn,zd as xe}from"./chunk.YEJ4LNUP.js";import{b as v}from"./chunk.AJZBJBMO.js";var Ee=v(R(),1),kn=new WeakMap,pe=e=>{let n=kn.get(e);return n||kn.set(e,n={open:null,drawn:0,listeners:new Set}),n},lr=e=>{for(let n of[...e.listeners])n()},dr=0;function kt(e,n){let t=pe(e);t.open=n?{...n,at:++dr}:null,lr(t)}var xn=e=>n=>{let t=pe(e);return t.listeners.add(n),()=>void t.listeners.delete(n)};function Sn(e){let n=()=>e?pe(e).drawn>0:!1;return(0,Ee.useSyncExternalStore)(e?xn(e):cr,n,n)}var cr=()=>()=>{};function xt(e){let n=()=>pe(e).open;return(0,Ee.useSyncExternalStore)(xn(e),n,n)}var V=v(R(),1),Pn=v(sr(),1);function pr(e){let[n,t]=(0,V.useState)(null),[r,o]=(0,V.useState)(null);return(0,V.useLayoutEffect)(()=>{e.current!==r&&o(e.current)}),(0,V.useLayoutEffect)(()=>{if(!r||typeof ResizeObserver>"u")return;let a=()=>Math.round(r.getBoundingClientRect().width),i=a();t(i);let p=new ResizeObserver(()=>{let c=a();c!==i&&(i=c,(0,Pn.flushSync)(()=>t(c)))});return p.observe(r),()=>p.disconnect()},[r]),n}function ur(e=!0){let[n,t]=(0,V.useState)();return(0,V.useEffect)(()=>{if(!e)return t(void 0);let r=0,o=()=>t(innerHeight),a=()=>{o(),clearTimeout(r),r=window.setTimeout(o,300)},i=p=>{for(let[c,d]of[[window,"resize"],[window,"orientationchange"],[window.visualViewport,"resize"]])c?.[p](d,a)};return i("addEventListener"),o(),()=>{clearTimeout(r),i("removeEventListener")}},[e]),n}var ue={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap"};var L=v(R(),1);var T=v(S(),1),Ln=6e3;function fr(){let e=[],n=0,t=new Set,r=new Map,o,a=()=>{for(let d of[...t])d()},i=d=>{if(clearTimeout(r.get(d.id)),r.delete(d.id),d.kind!=="toast")return;let u=(d.actions?.length??0)+(d.action?1:0),l=d.timeout??(u>0?!1:Ln);l!==!1&&r.set(d.id,setTimeout(()=>o?.()?i(d):p(d.id),l))},p=d=>{clearTimeout(r.get(d)),r.delete(d),e.some(u=>u.id===d)&&(e=e.filter(u=>u.id!==d),a())},c=d=>{e=e.some(u=>u.id===d.id)?e.map(u=>u.id===d.id?d:u):[...e,d],i(d),a()};return{notify(d){let u=d.id??`notice-${++n}`;return c({...d,id:u,said:++n}),{id:u,dismiss:()=>p(u),update:l=>{let g=e.find(w=>w.id===u);g&&c({...g,...l,id:u,kind:g.kind,said:l.sentence!==void 0&&l.sentence!==g.sentence?++n:g.said})}}},dismiss:p,hold(d){o=d},list:()=>e,subscribe(d){return t.add(d),()=>t.delete(d)}}}function gr({notices:e}){let n=e.reduce((p,c)=>!p||c.said>p.said?c:p,void 0),[t,r]=(0,L.useState)(""),[o,a]=(0,L.useState)(""),i=(0,L.useRef)(0);return(0,L.useEffect)(()=>{if(!n||n.said===i.current)return;i.current=n.said;let p=n.tone==="bad";(p?a:r)("");let c=setTimeout(()=>(p?a:r)(n.sentence),50);return()=>clearTimeout(c)},[n]),(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{role:"status","aria-live":"polite","data-testid":"notices-said",style:ue,children:t}),(0,T.jsx)("div",{role:"alert","data-testid":"notices-alarm",style:ue,children:o})]})}var mr=(0,L.createContext)(null);function yr({board:e,anchor:n}){let t=(0,L.useSyncExternalStore)(e.subscribe,e.list,e.list);return(0,L.useEffect)(()=>vr(Ae.prefetch),[]),(0,T.jsxs)(T.Fragment,{children:[t.length>0?(0,T.jsx)(L.Suspense,{fallback:null,children:(0,T.jsx)(hr,{notices:t,anchor:n,board:e})}):null,(0,T.jsx)(gr,{notices:t})]})}var Ae=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.MB7LKKUD.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.YL5ZCRHQ.js")))),wr=()=>Ae.load().then(()=>{},()=>{}),hr=Ae.part((e,n)=>(0,T.jsx)(e.NoticeStacks,{...n}),{quiet:!0});function vr(e){let n=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},t=globalThis;if(t.requestIdleCallback){let o=t.requestIdleCallback(n,{timeout:5e3});return()=>t.cancelIdleCallback?.(o)}let r=setTimeout(n,2500);return()=>clearTimeout(r)}var M=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.Q7X2IVLH.js","./chunk.22MIRLL6.js","./chunk.NFU4UM6F.js","./chunk.AKVBU5K5.js","./chunk.LLOZKUCA.js","./chunk.DH7M57SE.js","./chunk.AIK3Z25Y.js","./chunk.CKV2QCH5.js","./chunk.TAJ2R44N.js","./chunk.V3NPUAPB.js","./chunk.GZHZLJBF.js","./chunk.E5XNQTEU.js","./chunk.OJGHDWI6.js","./chunk.K5YLQAFW.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.PRV3KYT6.js"))));var y=v(R(),1);var Tn=v(R(),1);var En=v(R(),1);function Te(e){return(0,En.useMemo)(()=>e===void 0||e===""?void 0:{__html:e},[e])}var $=v(S(),1);function He({brand:e,size:n=22}){let t=en(e),r=An(t?.light),o=r?An(t?.dark):void 0,a=Te(r!==void 0&&z(r)?r:void 0),i=Te(o!==void 0&&z(o)?o:void 0),p={display:"inline-flex",flex:"0 0 auto",height:n,color:"var(--graview-accent)"},c=nn(e);if(c)return(0,$.jsx)("span",{className:"graview-logo graview-emoji-mark","data-testid":"app-mark","aria-hidden":!0,style:{...p,alignItems:"center",fontSize:`${n*.86/16}rem`,lineHeight:1},children:c});if(!r)return null;let d=e?.logoAlt??e?.name??"",u=d!==""&&d!==e?.name,l=u?{role:"img","aria-label":d}:{"aria-hidden":!0};if(o){let w=(h,x,b)=>z(h)?(0,$.jsx)("span",{className:"graview-logo-face","data-graview-scheme-only":b,dangerouslySetInnerHTML:x}):(0,$.jsx)("img",{className:"graview-logo-face","data-graview-scheme-only":b,src:h,alt:""});return(0,$.jsxs)("span",{className:"graview-logo","data-testid":"app-mark",style:p,...l,children:[w(r,a,"light"),w(o,i,"dark")]})}let g=t?.darkFallback==="invert"?{"data-graview-logo-fallback":"invert"}:{};return z(r)?(0,$.jsx)("span",{className:"graview-logo","data-testid":"app-mark",style:p,...g,...l,dangerouslySetInnerHTML:a}):(0,$.jsx)("img",{className:"graview-logo","data-testid":"app-mark",src:r,alt:u?d:"",...g,style:{...p,width:"auto"}})}function An(e){if(!(!e||!Xe(e)))return z(e)&&Je(e)!==null?void 0:e}function br(e){(0,Tn.useEffect)(()=>{if(!e||typeof document>"u")return;let n=[...document.querySelectorAll('link[rel~="icon"]')],t=n.map(o=>o.getAttribute("href")),r;n.length===0&&(r=document.createElement("link"),r.rel="icon",r.setAttribute("data-graview-favicon",""),document.head.appendChild(r),n.push(r));for(let o of n)o.href=e;return()=>{r&&r.remove(),n.forEach((o,a)=>{o!==r&&t[a]!==null&&t[a]!==void 0&&o.setAttribute("href",t[a])})}},[e])}var s=v(S(),1),kr=M.part((e,n)=>(0,s.jsx)(e.TidyFoot,{...n}),{quiet:!0}),xr=M.part((e,n)=>(0,s.jsx)(e.Here,{...n}),{quiet:!0});function Sr(){let e=Y(),[n,t]=(0,y.useState)("");return(0,y.useEffect)(()=>e?.store.subscribe((r,o)=>{o.some(a=>a.author.id!==e.principal.id)&&M.load().then(a=>a.sayTheirChange(o,e,t),String)}),[e]),(0,s.jsx)("span",{role:"status",className:"graview-bar-said",children:n})}var Hn="home",Bn="/",q="scene:whole";function Pr(e){let{store:n,principal:t,views:r}=e,o=n.kindsKeptFrom(t),a=n.schema.kinds.filter(f=>!n.modules.disabledKinds.has(f)&&!o.has(f)),i=r?.arrangement?.(),p=r?.places()??[],c=dn(i,n.schema,p),d=ln(n.schema,i,[...n.modules.administered.values()].flatMap(f=>f.kinds??[])),u=(f,P)=>(!n.graph.size.nodes||n.graph.count(f)>0)&&(c?P?c.places.has(`${f}|${P}`):c.kinds.has(f):!d.has(f)),l=[{key:Hn,label:"Home",path:Bn,group:"home",primary:!0}],g=p.filter(f=>a.includes(f.kind)&&f.as!==cn),w=g.filter(f=>!f.hidden),h=new Set(ne(w).map(f=>j(f,p,n.schema).toLowerCase())),x=f=>tn(f.as,an(f,p)?xe(n.schema,f.kind).slice(1):void 0),b=new Set(i?.hide??[]),H=pn(a,i?.order,w);for(let{kind:f,view:P}of H){if(P){l.push({key:`place:${P.kind}:${P.as}`,label:j(P,p,n.schema),path:x(P),group:"lists",kind:f,primary:c?c.places.has(`${f}|${P.as}`):!0});continue}let W=je(n.schema,f),B=h.has(W.toLowerCase());l.push({key:`kind:${f}`,label:B?Ye(n.schema,f):W,path:xe(n.schema,f),group:"lists",kind:f,primary:B||b.has(f)?!1:u(f),...b.has(f)?{hidden:!0}:{}})}for(let f of ne(g)){if(H.some(B=>B.view&&de(B.view,f)))continue;let P=x(f),W=[f.kind,...f.over??[]].some(B=>a.includes(B)&&u(B,f.as));l.some(B=>B.path===P)||l.push({key:`place:${f.kind}:${f.as}`,label:j(f,p,n.schema),path:P,group:"pictures",kind:f.kind,primary:W,hidden:f.hidden})}return a.some(f=>Object.keys(n.schema.tryDefinition(f)?.edges??{}).length>0)&&l.push({key:"connections",label:"Connections",path:"/map",group:"pictures",primary:!1}),l}function Lr(e,n){let[t="/",r=""]=n.split("?"),o=e.find(i=>i.path===(r?`${t}?${r}`:t))??e.find(i=>i.path===t);if(o)return o.key;let a=`/${t.split("/").filter(Boolean)[0]??""}`;return e.find(i=>i.group==="lists"&&i.path===a)?.key??null}var Nn=(0,y.createContext)(null),Er=()=>(0,y.useContext)(Nn),Z=30,Mn=48,te=640,Me=4,Be=2;function Cn(e){let{widths:n,current:t,room:r,more:o,gap:a=Me,primary:i,most:p=sn}=e;if(n.length===0||!(r>0)||!(o>0)||n.some(l=>!(l>0)))return null;let c=(l,g)=>l.reduce((w,h)=>w+n[h],0)+a*Math.max(0,l.length-1)+(g?a+o:0),d=(l,g)=>t<0||!l.includes(t)||l.slice(0,g).includes(t)?l.slice(0,g):[...l.filter(w=>w!==t).slice(0,g-1),t].sort((w,h)=>w-h),u=d(n.map((l,g)=>g).filter(l=>i?.[l]!==!1||l===t),p);if(c(u,u.length<n.length)<=r)return u.length>=Be?u:null;for(let l=u.length-1;l>=Be;l--){let g=d(u,l);if(c(g,!0)<=r)return g}return null}var Ar=`
2
2
  .graview-bar{display:block;margin:0;padding:0;container:graview-bar/inline-size;flex:0 0 auto;position:relative;background:var(--graview-bar);border-bottom:1px solid var(--graview-edge);color:var(--graview-ink);font-family:var(--graview-font-body,system-ui)}
3
3
  .graview-bar-row{display:flex;flex-wrap:nowrap;align-items:center;gap:16px;height:${Mn-1}px;margin:0;padding:0 16px}
4
4
  .graview-bar-home,.graview-bar-face,.graview-bar-place,.graview-bar-item,.graview-bar-at{display:inline-flex;align-items:center;box-sizing:border-box;min-width:0;margin:0;border:0;background:none;box-shadow:none;font:inherit;letter-spacing:normal;text-transform:none;text-decoration:none;color:var(--graview-ink);cursor:pointer;text-align:left}
@@ -64,4 +64,4 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
64
64
  @container graview-bar (max-width: 300px){
65
65
  .graview-bar-row{gap:4px;padding:0 10px}
66
66
  }`,J={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,minWidth:Z,height:Z,padding:0,borderRadius:8,border:"1px solid transparent",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.875rem",cursor:"pointer",flex:"0 0 auto"};function Tr({brand:e,name:n,heading:t=1,home:r,faces:o,places:a,current:i,reach:p,tools:c,find:d=!0,description:u,findBox:l,onFind:g,switch:w="words",scenePlaces:h,skips:x,named:b=!0}){let H=(0,y.useRef)(null),De=Y()?.who.size,[f,P]=(0,y.useState)(null),[W,B]=(0,y.useState)(null),[A,Un]=(0,y.useState)(!1),[Qn,Ie]=(0,y.useState)(!1),[Zn,Jn]=(0,y.useState)(!0),[$e,Xn]=(0,y.useState)(null),oe=o?o.pages.current:!h,ee=oe?{places:a,current:i,reach:p}:h,he=ee&&{...ee,places:rn(ee.places),here:ee.places.find(m=>m.key===ee.current)?.label},k=he&&he.places.length>0?he:null,ve=k?k.places.findIndex(m=>m.key===k.current):-1,_e=!!o&&w==="words",Ke=k?k.places.map(m=>m.primary===!1?"0":"1").join(""):"",I=(0,y.useCallback)(()=>{let m=H.current;if(!m)return;let N=$r(m,ve,_e,Ke);N!==void 0&&Xn(N);let G=N?!0:Br(m);G!==null&&Jn(G)},[ve,_e,Ke]);(0,y.useLayoutEffect)(()=>{let m=H.current;if(!m)return;let N=()=>{let le=m.getBoundingClientRect().width;Un(le<te),m.style.setProperty("--graview-bar-width",`${Math.round(le)}px`),I()};N();let G=typeof document>"u"?void 0:document.fonts;if(G?.ready.then(I),G?.addEventListener?.("loadingdone",I),typeof ResizeObserver>"u")return()=>G?.removeEventListener?.("loadingdone",I);let ke=new ResizeObserver(N);ke.observe(m);for(let le of m.querySelectorAll(".graview-bar-tools > *"))ke.observe(le);return()=>{ke.disconnect(),G?.removeEventListener?.("loadingdone",I)}},[I]);let be=(0,y.useRef)(g);be.current=g,(0,y.useLayoutEffect)(()=>{be.current?.(d&&f?{slot:f,compact:A,own:W}:null)},[d,f,A,W]),(0,y.useLayoutEffect)(()=>()=>be.current?.(null),[]);let er=(0,y.useCallback)(()=>{Ie(!0),requestAnimationFrame(()=>f?.querySelector("input")?.focus())},[f]),We=(0,y.useRef)(null),ie=(0,y.useRef)(!1),Ge=(0,y.useCallback)(()=>{Ie(!1),ie.current&&(ie.current=!1,requestAnimationFrame(()=>We.current?.focus()))},[]),nr=t===!1?"span":`h${t}`,rr=r.href!==void 0?"a":"button",tr=m=>N=>{!m||!On(N)||(N.preventDefault(),m())},ar=!oe,qe=k&&!A&&$e!==null&&!(ve<0&&k.here)?$e.split(",").map(Number).filter(m=>m<k.places.length):null,se=k?(0,s.jsx)(Dr,{places:k.places,current:k.current,here:k.here,reach:k.reach,scene:ar,stands:qe}):null,or=k?k.places.map(m=>m.label).join(`
67
- `):"";(0,y.useLayoutEffect)(I,[I,n,e,or,k?.current,oe,A,w,d]);let ir=w==="icons"||!Zn||A?"icons":"words";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("header",{ref:H,className:"graview-bar","data-testid":"app-bar","data-graview-app-bar":"",...Qn&&A?{"data-finding":""}:{},children:[(0,s.jsx)("style",{children:Ar}),x,(0,s.jsxs)("div",{className:"graview-bar-row",children:[b?(0,s.jsx)("div",{className:"graview-bar-app",children:(0,s.jsx)(nr,{className:"graview-bar-name",children:(0,s.jsxs)(rr,{...r.href!==void 0?{href:r.href,onClick:tr(r.go)}:{type:"button",onClick:r.go},"data-testid":"app-home",...r.current?{"aria-current":"page"}:{},title:u?`${n} \u2014 ${u}`:`${n} \u2014 home`,className:"graview-bar-home",children:[(0,s.jsx)(He,{brand:e,size:20}),(0,s.jsx)("span",{className:"graview-bar-app-name","data-testid":"app-name",children:n})]})})}):null,o?(0,s.jsx)(Hr,{faces:o,form:w,drawn:ir}):null,(0,s.jsx)("div",{className:"graview-bar-mid",...qe?{"data-places":"standing"}:!A&&se?{"data-place":""}:{},children:A?null:se}),!A&&k&&k.places.length>1?(0,s.jsxs)("span",{className:"graview-bar-ruler","aria-hidden":"true","data-graview-bar-ruler":"",children:[k.places.map(m=>(0,s.jsx)("span",{className:"graview-bar-at",children:m.label},m.key)),(0,s.jsxs)("span",{className:"graview-bar-at",children:[Ne,(0,s.jsx)(Vn,{})]})]}):null,b?(0,s.jsx)("span",{className:"graview-bar-ruler","aria-hidden":"true",children:(0,s.jsx)("span",{className:"graview-bar-name",children:n})}):null,(0,s.jsxs)("div",{className:"graview-bar-tools",children:[d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"graview-bar-find-open",ref:We,"data-testid":"app-find-open","aria-label":"Find",title:"Find",onClick:er,style:{...J,display:void 0},children:(0,s.jsx)(Rr,{})}),(0,s.jsxs)("div",{className:"graview-bar-find","data-testid":"app-find",onBlur:m=>{let N=m.relatedTarget;N instanceof Node&&m.currentTarget.contains(N)||m.currentTarget.querySelector("input")?.value||Ge()},onKeyDownCapture:m=>{m.key==="Escape"&&A&&(ie.current=!0)},onKeyDown:m=>{m.key!=="Escape"||!A||(!m.defaultPrevented||!m.currentTarget.querySelector("input")?.value?Ge():ie.current=!1)},children:[(0,s.jsx)("div",{ref:P,className:"graview-bar-find-slot",children:l}),(0,s.jsx)(Mr,{})]})]}):null,(0,s.jsx)("div",{ref:B,className:"graview-bar-own","data-graview-bar-own":""}),De?(0,s.jsx)(y.Suspense,{fallback:null,children:(0,s.jsx)(xr,{scene:!oe,compact:A})}):null,(0,s.jsx)(Sr,{}),c]})]})]}),A&&se?(0,s.jsx)("div",{className:"graview-bar-line","data-graview-place-line":"","data-testid":"app-place-line",children:se}):null]})}function Hr({faces:e,form:n,drawn:t}){let r=o=>{let a=e[o];return(0,s.jsxs)("button",{type:"button",className:"graview-bar-face","data-testid":`app-face-${o}`,"aria-pressed":a.current,title:a.label,...a.reach&&!a.current?{onPointerEnter:a.reach,onPointerDown:a.reach,onFocus:a.reach}:{},onClick:()=>{a.current||a.go()},children:[o==="scene"?(0,s.jsx)(Fn,{}):(0,s.jsx)(Cr,{}),(0,s.jsx)("span",{children:a.label})]})};return(0,s.jsxs)("div",{className:"graview-bar-faces",role:"group","aria-label":`${e.scene.label} or ${e.pages.label}`,"data-testid":"app-faces","data-switch":n,"data-switch-drawn":t,children:[r("scene"),r("pages")]})}function Br(e){let n=e.querySelector(".graview-bar-faces"),t=e.querySelector(".graview-bar-mid"),r=e.querySelector(".graview-bar-find");if(!n||!t||r?.matches(":focus-within")||e.getBoundingClientRect().width<te)return null;let a=In(n),i=t.querySelector(".graview-bar-place-words"),p=i?parseFloat(getComputedStyle(i).fontSize)||14:0,c=i?Math.min(i.scrollWidth+34,14*p):0,d=Rn(e);if(d===null)return!1;let u=t.getBoundingClientRect().width-c-d;if(r&&r.getBoundingClientRect().width>0){let l=parseFloat(getComputedStyle(r).flexBasis);isFinite(l)&&(u-=Math.max(0,l-r.getBoundingClientRect().width))}return n.getAttribute("data-switch-drawn")==="icons"?u>=a+2:u>=-1}function Rn(e){let n=e.querySelector(".graview-bar-app"),t=e.querySelector(".graview-bar-ruler>.graview-bar-name");if(!n||!t)return 0;let r=i=>i?.getBoundingClientRect().width??0,o=r(n.firstElementChild)-r(e.querySelector(".graview-bar-app-name"))+r(t)+2,a=parseFloat(getComputedStyle(n).maxWidth)/100*(n.parentElement.clientWidth-2*n.offsetLeft)||1/0;return o>a+.5?null:Math.max(0,o-r(n))}var On=e=>e.button===0&&!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey);function Nr(){let e=globalThis.navigator?.platform??"";return/Mac|iPhone|iPad|iPod/.test(e)?"\u2318K":"Ctrl K"}function Mr(){let e=Sn(Y()?.aiDesk);return(0,s.jsx)("span",{className:"graview-bar-find-keys","data-testid":"app-find-keys","aria-hidden":"true",children:e?"/":Nr()})}function ae({size:e,box:n=e,children:t}){return(0,s.jsx)("svg",{width:e,height:e,viewBox:`0 0 ${n} ${n}`,"aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto"},children:t})}function Fn(){return(0,s.jsxs)(ae,{size:14,children:[(0,s.jsx)("path",{d:"M7 1.5 L12.5 4.5 L7 7.5 L1.5 4.5 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M1.5 7.5 L7 10.5 L12.5 7.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round",strokeLinecap:"round"})]})}function Cr(){return(0,s.jsxs)(ae,{size:14,children:[(0,s.jsx)("rect",{x:"2.25",y:"1.75",width:"9.5",height:"10.5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),(0,s.jsx)("path",{d:"M4.5 5 H9.5 M4.5 7.25 H9.5 M4.5 9.5 H7.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Vn(){return(0,s.jsx)(ae,{size:10,children:(0,s.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Rr(){return(0,s.jsxs)(ae,{size:16,children:[(0,s.jsx)("circle",{cx:"7",cy:"7",r:"4.75",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,s.jsx)("path",{d:"M10.5 10.5 L14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Or({place:e}){if(e.key===q)return(0,s.jsx)(Fn,{});if(e.group==="home")return(0,s.jsx)(ae,{size:13,box:14,children:(0,s.jsx)("path",{d:"M2 6.5 L7 2 L12 6.5 V12 H2 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})});let n=e.kind?`hsl(${Math.round(Ze(e.kind))} 55% 52%`:"rgb(128 128 128";return(0,s.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:12,height:8,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",background:e.group==="lists"?`${n})`:`linear-gradient(${n}), ${n})) center / 6px 4px no-repeat, ${n} / 0.35)`}})}var Fr=[{group:"home"},{group:"lists",heading:"Lists"},{group:"pictures",heading:"Pictures"}],Ne="More";function Dn({place:e,current:n,reach:t,standing:r,done:o}){let a=e.key===n,i=t.href?.(e.path);return(0,s.jsxs)(i!==void 0?"a":"button",{className:r?"graview-bar-at":"graview-bar-item","data-testid":`app-place-${e.key}`,"data-place-path":e.path,...a?{"aria-current":"page"}:{},...i!==void 0?{href:i}:{type:"button"},onClick:c=>{o(),t.go&&(i!==void 0&&!On(c)||(c.preventDefault(),t.go(e)))},children:[r?null:(0,s.jsx)("span",{className:"graview-bar-mark",children:(0,s.jsx)(Or,{place:e})}),r&&a?(0,s.jsx)("span",{"data-testid":"app-place-current",children:e.label}):(0,s.jsx)("span",{children:e.label})]})}function Vr({places:e,current:n,reach:t,id:r,done:o}){return(0,s.jsx)(s.Fragment,{children:Fr.map(({group:a,heading:i})=>{let p=e.filter(d=>d.group===a);if(p.length===0)return null;let c=`${r}-${a}`;return(0,s.jsxs)("div",{role:"group",...i?{"aria-labelledby":c}:{"aria-label":p[0].label},"data-place-group":a,children:[i?(0,s.jsx)("p",{id:c,children:i}):null,(0,s.jsx)("ul",{children:p.map(d=>(0,s.jsx)("li",{children:(0,s.jsx)(Dn,{place:d,current:n,reach:t,standing:!1,done:o})},d.key))})]},a)})})}function Dr({places:e,current:n,here:t,reach:r,scene:o,stands:a}){let i=Q("places"),p=(0,y.useRef)(a);i.open||(p.current=a);let c=p.current,u=e.find(b=>b.key===n)?.label??t??"Places",l=c?e.filter((b,H)=>!c.includes(H)):e,g=Ir(e,n,o),w=Y(),h=w?.keptViews?.current(),x=!!(h&&(h.removed.length>0||w.views.places().some(b=>b.hidden)||h.may.lenses&&(w.views.arrangement?.()?.hide?.length??0)>0));return(0,s.jsxs)("nav",{className:c?"graview-bar-places":"graview-bar-place-at","aria-label":o?"What the scene shows":"The app\u2019s places",...c?{"data-testid":"app-places-standing"}:{},...g,children:[c?.map(b=>(0,s.jsx)(Dn,{place:e[b],current:n,reach:r,standing:!0,done:()=>{}},e[b].key)),l.length>0||x?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",className:c?"graview-bar-at":"graview-bar-place","data-testid":"app-places-open",...i.trigger,onClick:i.toggle,"aria-label":c?`${Ne} \u2014 ${l.length} more ${o?"pictures":"places"}`:`${u} \u2014 ${o?"everything the scene shows":"every place"}`,title:c?l.map(b=>b.label).join(", "):u,children:[c?Ne:(0,s.jsx)("span",{className:"graview-bar-place-words","data-testid":"app-place-current",children:u}),(0,s.jsx)(Vn,{})]}),(0,s.jsxs)("div",{...i.pane,"data-testid":"app-places",hidden:!i.open,className:"graview-bar-list",style:U,children:[(0,s.jsx)(Vr,{places:l,current:n,reach:r,id:i.pane.id,done:()=>i.setOpen(!1)}),x&&i.open?(0,s.jsx)(y.Suspense,{fallback:null,children:(0,s.jsx)(kr,{id:i.pane.id,scene:o,reach:r,done:()=>i.setOpen(!1)})}):null]})]}):null]})}function Ir(e,n,t){let r=Y()?.setMenuAt,o=a=>{let i=a.target.closest?.("[data-place-path],[data-testid=app-places-open]");if(!i||!r)return;let p={at:0};a.type==="pointerdown"?document.addEventListener("pointerup",()=>p.at||=Date.now(),{once:!0}):a.preventDefault();let c=a.nativeEvent;M.load().then(d=>d.placeGesture(c,i,e,n,t,r,p),String)};return{onContextMenu:a=>a.shiftKey||o(a),onKeyDown:a=>(a.key==="ContextMenu"||a.key==="F10"&&a.shiftKey)&&o(a),onPointerDown:a=>a.pointerType!=="mouse"&&a.isPrimary&&o(a)}}function $r(e,n,t,r){let o=e.querySelector("[data-graview-bar-ruler]"),a=e.querySelector(".graview-bar-mid");if(!o||!a)return null;let i=e.querySelector(".graview-bar-find");if(i?.matches(":focus-within"))return;if(e.getBoundingClientRect().width<te)return null;let p=Rn(e);if(p===null)return null;let c=[...o.children].map(H=>H.getBoundingClientRect().width),d=c.pop()??0,u=e.querySelector(".graview-bar-faces"),l=u&&t?In(u):0,g=u?.getAttribute("data-switch-drawn")==="words"?l:0,w=a.getBoundingClientRect().left+p,h=i?.getBoundingClientRect(),x=h&&h.width>0?h.right-w-(parseFloat(getComputedStyle(i).minWidth)||0)-16:a.getBoundingClientRect().width-p,b=[...r].map(H=>H!=="0");return Cn({widths:c,current:n,room:Math.floor(x+g-l),more:d,primary:b})?.join(",")??null}function In(e){return[...e.querySelectorAll(".graview-bar-face span")].reduce((n,t)=>n+t.scrollWidth+10,0)}var _r=e=>`graview:lenses:${e}`,Kr=(e,n)=>e?.name??n.kinds.join(",");function Ce(e){try{let n=JSON.parse(localStorage.getItem(_r(e))??"[]");return Array.isArray(n)?n.filter(t=>typeof t?.title=="string"&&typeof t.lens=="string"):[]}catch{return[]}}var _=v(R(),1);var E=v(S(),1);function Wr({scheme:e,onScheme:n,profileHref:t,keeping:r,hostActions:o=Gr,signature:a=!1}){let{store:i,principal:p,seats:c,people:d}=ce(),u=Q("profile"),l=u.open,[g,w]=(0,_.useState)(!1);(0,_.useEffect)(()=>jr(fe),[]),l&&!g&&w(!0),(0,_.useEffect)(()=>{l&&fe()},[l]);let h=p.id===void 0?void 0:i.graph.getNode(p.id),x=h===void 0?p.id===void 0?"Nobody in particular":Ue(p,{graph:i.graph,schema:i.schema,seats:c,people:d}):ze(i.schema.tryDefinition(h.kind),h);return(0,E.jsxs)("div",{style:{position:"relative"},children:[(0,E.jsx)("button",{type:"button","data-testid":"profile-button",...u.trigger,onClick:u.toggle,onPointerEnter:fe,onFocus:fe,"aria-label":`${x} \u2014 you, your seat and your settings`,title:`${x} \u2014 you, your seat and your settings`,style:{...J,borderRadius:999},children:(0,E.jsx)("span",{"aria-hidden":"true","data-testid":"profile-mark",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:Z-4,height:Z-4,borderRadius:999,fontSize:"0.8125rem",fontWeight:600,background:"var(--graview-panel-muted)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)"},children:Yr(x)})}),(0,E.jsxs)("section",{...u.pane,"aria-label":"Profile","data-testid":"profile","data-graview-offstage":"",hidden:!l,style:{...U,width:280,maxWidth:"calc(100vw - 32px)",maxHeight:"min(62cqh, 520px)",overflowY:"auto",overflowX:"hidden",display:l?"grid":"none",gap:12,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[g?(0,E.jsx)(_.Suspense,{fallback:null,children:(0,E.jsx)(qr,{part:"top",name:x,me:h,profileHref:t,hostActions:o,close:()=>u.setOpen(!1)})}):null,(0,E.jsxs)("div",{className:"graview-profile-keeping","data-testid":"profile-keeping",style:Qr,children:[(0,E.jsx)("span",{style:Ur,children:"Keeping this app"}),r]}),g?(0,E.jsx)(_.Suspense,{fallback:null,children:(0,E.jsx)(zr,{part:"rest",name:x,me:h,scheme:e,onScheme:n,hostActions:o,signature:a,close:()=>u.setOpen(!1)})}):null]})]})}var Gr=[],fe=()=>M.prefetch(),qr=M.part((e,n)=>(0,E.jsx)(e.ProfilePane,{...n}),{what:"The rest of your menu"}),zr=M.part((e,n)=>(0,E.jsx)(e.ProfilePane,{...n}),{quiet:!0});function jr(e){let n=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},t=globalThis;if(t.requestIdleCallback){let o=t.requestIdleCallback(n,{timeout:5e3});return()=>t.cancelIdleCallback?.(o)}let r=setTimeout(n,2500);return()=>clearTimeout(r)}function Yr(e){return(e.trim()[0]??"?").toUpperCase()}var Ur={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},Qr={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};function Zr(e){return!(e==="hidden"||e===!1)}var Re=v(R(),1);var $n="The whole thing",ge=e=>`scene:${e.kind}:${e.as}`;function _n(e){let{view:n}=e,t=e.places.filter(l=>!e.hidden.has(l.kind)),r=ne(t),o=(l,g)=>{if(l===q)return un(fn(g,!0),"view",null);let w=r.find(h=>ge(h)===l);return w?mn(g,w.over?.find(h=>g.focusId===re(h))??w.kind,w.as):null},a=n.within?.view,i=l=>n.focusId===re(l.kind)&&(a===void 0?t.filter(g=>g.kind===l.kind).at(-1)===l:a===l.as),p=t.find(l=>i(l)&&(a!==void 0||!n.overview)),c=p?r.find(l=>de(l,p)):void 0,d=r.filter(l=>!l.hidden||l===c);return{places:[{key:q,label:$n,path:`${Se}${Le(o(q,Pe))}`,group:"home"},...d.map(l=>({key:ge(l),label:j(l,t,e.schema),path:`${Se}${Le(o(ge(l),Pe))}`,group:"pictures",kind:l.kind,hidden:l.hidden}))],current:c?ge(c):q,to:o}}function Jr(){let{store:e,views:n,hiddenKinds:t}=ce(),{view:r,go:o}=bn(),a=n.places(),i=(0,Re.useMemo)(()=>_n({places:a,hidden:t,view:r,schema:e.schema}),[a,t,r,e.schema]),p=(0,Re.useMemo)(()=>({go:c=>{let d=i.to(c.key,r);d&&o(d)}}),[i,r,o]);return{places:i.places,current:i.current,reach:p}}var X=v(R(),1);var F=v(S(),1),Xr=M.part((e,n)=>(0,F.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"}),Oe=()=>M.prefetch();function et({clean:e="All rules hold"}){let n=vn(),{set:t}=hn(),r=n.length,[o,a]=(0,X.useState)(!1),i=Q("problems",{open:o&&r>0,onOpenChange:a}),p=i.open,c=Wn(n,e);return(0,X.useEffect)(()=>{if(r===0)return;let d=setTimeout(Oe,1500);return()=>clearTimeout(d)},[r>0]),(0,F.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[(0,F.jsxs)("button",{type:"button","data-testid":"standing",...i.trigger,"aria-disabled":r===0?!0:void 0,"aria-label":c,onClick:r===0?void 0:i.toggle,onPointerEnter:r===0?void 0:Oe,onFocus:r===0?void 0:Oe,title:c,style:{...J,padding:r===0?0:"0 8px",cursor:r===0?"default":"pointer",color:r===0?"var(--graview-ink-muted)":Kn(n),fontVariantNumeric:"tabular-nums",fontWeight:600},children:[(0,F.jsx)(Gn,{tone:r===0?"var(--graview-good)":Kn(n)}),r>0?(0,F.jsx)("span",{"aria-hidden":"true",children:r}):null]}),p?(0,F.jsx)("ol",{...i.pane,"data-testid":"problems",style:{...U,width:300,maxHeight:"min(48cqh, 420px)",overflow:"auto",margin:0,padding:4,listStyle:"none",display:"grid",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:(0,F.jsx)(X.Suspense,{fallback:null,children:(0,F.jsx)(Xr,{violations:n,pick:d=>{t(d.nodeIds),i.setOpen(!1)}})})}):null]})}function Wn(e,n){return e.length===0?n:`${Qe(e)} \u2014 open what is broken, and what would fix it`}var Kn=e=>e.some(n=>n.status==="could-not-judge"||n.status==="over-budget")?"var(--graview-bad)":"var(--graview-warn)";function Gn({tone:e}){return(0,F.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:999,flex:"0 0 auto",background:e}})}function nt(e,n,t=[]){if(e.focusId)return e.focusId;let o=(e.selection??[]).map(gn).find(a=>a!==null)??t.find(a=>n.includes(a))??n[0]??null;return o===null?null:re(o)}var ye=v(S(),1),me=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.MDWCX3YU.js","./chunk.CB5DGKR5.js","./chunk.GKLDSHHH.js","./chunk.OCV46AFN.js","./chunk.PZ4G5QA5.js","./chunk.Y36MLVMT.js","./chunk.MPMROUZA.js","./chunk.XZJ6XX5I.js","./chunk.4F5M5XZG.js","./chunk.LVOL2LEC.js","./chunk.3G5DEGFA.js","./chunk.OZ4EJ5M6.js","./chunk.WVUJXDXZ.js","./chunk.3V2WXZU3.js","./chunk.7UD2JR6J.js","./chunk.BUDEUNBN.js","./chunk.3IEJQAK7.js","./chunk.AKLVSZ5A.js","./chunk.ZUBC3UFG.js","./chunk.GZHZLJBF.js","./chunk.PZWJUQAO.js","./chunk.OJGHDWI6.js","./chunk.NEJSKMJV.js","./chunk.5ZWE72VJ.js","./chunk.RLO3RDYH.js","./chunk.TUNHUTQ5.js","./chunk.FWZF7X6A.js","./chunk.3JMZHCB4.js","./chunk.SF4BYBH6.js","./chunk.SDO3U72B.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.LYFEGG6E.js"))));function rt(){return me.load().then(()=>{})}var tt=[{cardinality:"one",fidelity:"full",slot:"page"},{cardinality:"one",fidelity:"summary",slot:"card"},{cardinality:"one",fidelity:"glyph",slot:"row"},{cardinality:"many",fidelity:"full"},{cardinality:"many",fidelity:"summary"},{cardinality:"many",fidelity:"glyph"}];function at({schema:e,specs:n,kind:t,view:r}){let o=me.current.frameworkViews(e,n).lookup(t,{cardinality:r.cardinality,fidelity:r.fidelity});return o?(0,ye.jsx)(o,{...r}):null}var ot=me.part((e,n)=>(0,ye.jsx)(at,{...n}),{what:"This view"});function qn(e,n,t){for(let r of n.kinds){let o=t?.[r];for(let a of tt){let i=c=>(0,ye.jsx)(ot,{schema:n,specs:t,kind:r,view:c}),p=a.slot!==void 0&&o?.[a.slot]!==void 0;p&&(i.says=(c,d)=>me.current?.frameworkViews(n,t).lookup(r,{cardinality:a.cardinality,fidelity:a.fidelity})?.says?.(c,d)),e.register(r,{cardinality:a.cardinality,fidelity:a.fidelity},p?i:yn(i))}}return e}function it(e,n){return qn(wn(e),e,n)}var Fe=v(R(),1);var D=v(S(),1),zn=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.KJGNLWU3.js","./chunk.GVUJCOKD.js","./chunk.3ZONBC6L.js","./chunk.FWKNR7XF.js","./chunk.MDWCX3YU.js","./chunk.CB5DGKR5.js","./chunk.GKLDSHHH.js","./chunk.OCV46AFN.js","./chunk.4KTHJY5N.js","./chunk.PZ4G5QA5.js","./chunk.Y36MLVMT.js","./chunk.MPMROUZA.js","./chunk.HJCQ6I3S.js","./chunk.5C43AM3X.js","./chunk.4WH4N4V7.js","./chunk.MVRNEC3Y.js","./chunk.XZJ6XX5I.js","./chunk.4F5M5XZG.js","./chunk.LVOL2LEC.js","./chunk.3G5DEGFA.js","./chunk.OZ4EJ5M6.js","./chunk.BOMYLOCX.js","./chunk.45HTFSWD.js","./chunk.Q6RUTFU3.js","./chunk.AZGXBTOQ.js","./chunk.AG7CUSSV.js","./chunk.C6HBYRGJ.js","./chunk.WVUJXDXZ.js","./chunk.3V2WXZU3.js","./chunk.7UD2JR6J.js","./chunk.BUDEUNBN.js","./chunk.3IEJQAK7.js","./chunk.AKLVSZ5A.js","./chunk.ZUBC3UFG.js","./chunk.GZHZLJBF.js","./chunk.PZWJUQAO.js","./chunk.OJGHDWI6.js","./chunk.NEJSKMJV.js","./chunk.5ZWE72VJ.js","./chunk.RLO3RDYH.js","./chunk.TUNHUTQ5.js","./chunk.FWZF7X6A.js","./chunk.3JMZHCB4.js","./chunk.SF4BYBH6.js","./chunk.SDO3U72B.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.SG7YVKH4.js"))));function st({lens:e,view:n}){let t=zn.current.declaredLensView(e);return(0,D.jsx)(t,{...n})}var lt=zn.part((e,n)=>(0,D.jsx)(st,{...n}),{what:"This picture"});function dt(e){let n=r=>(0,D.jsx)(Fe.Suspense,{fallback:null,children:(0,D.jsx)(lt,{lens:e,view:r})});e.lens==="blocks"&&(n.flows=!0);let t=e.lens==="blocks"?e.options.blocks?.[0]:void 0;return typeof t?.headline=="string"&&(n.lede=t),e.create===!1&&(n.creates=!1),n}var jn=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.MDWCX3YU.js","./chunk.CB5DGKR5.js","./chunk.GKLDSHHH.js","./chunk.OCV46AFN.js","./chunk.PZ4G5QA5.js","./chunk.Y36MLVMT.js","./chunk.MPMROUZA.js","./chunk.XZJ6XX5I.js","./chunk.4F5M5XZG.js","./chunk.LVOL2LEC.js","./chunk.3G5DEGFA.js","./chunk.OZ4EJ5M6.js","./chunk.WVUJXDXZ.js","./chunk.3V2WXZU3.js","./chunk.7UD2JR6J.js","./chunk.BUDEUNBN.js","./chunk.3IEJQAK7.js","./chunk.AKLVSZ5A.js","./chunk.ZUBC3UFG.js","./chunk.GZHZLJBF.js","./chunk.PZWJUQAO.js","./chunk.OJGHDWI6.js","./chunk.NEJSKMJV.js","./chunk.5ZWE72VJ.js","./chunk.RLO3RDYH.js","./chunk.TUNHUTQ5.js","./chunk.FWZF7X6A.js","./chunk.3JMZHCB4.js","./chunk.SF4BYBH6.js","./chunk.SDO3U72B.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.JXGDVJ4N.js"))));function ct({blocks:e,view:n}){let t=jn.current.homeView(e);return(0,D.jsx)(t,{...n})}var pt=jn.part((e,n)=>(0,D.jsx)(ct,{...n}),{what:"The home"});function ut(e){let n=t=>(0,D.jsx)(Fe.Suspense,{fallback:null,children:(0,D.jsx)(pt,{blocks:e,view:t})});return Object.defineProperty(n,Symbol.for("graview.home-blocks"),{value:!0}),n}function ft(e,n){return n.home&&n.home.length>0&&e.home?.(ut(n.home)),Yn(e,n),e.arrange?.(n.pages),e}function Yn(e,n,t){for(let r of on(n).drawn){if(t&&e.places().some(i=>i.title===r.title))continue;let o=dt(r),a={title:r.title,lens:r.lens,...r.across?{across:r.across}:{},...t?{beside:t}:{},...r.hidden?{hidden:!0}:{},over:r.kinds,...t?{}:{declared:!0}};for(let i of r.kinds)e.register(i,{cardinality:"many",fidelity:"full"},o,a),e.register(i,{cardinality:"many",fidelity:"summary"},o,a)}}function gt(e,n,t){t.length>0&&Yn(e,{schema:n,lenses:t.map(({lens:r,...o})=>({...o,name:r}))},!0)}function mt(e,n,t){gt(e,n,Ce(t))}var K=v(R(),1),we=v(S(),1);var Ve=e=>`graview:first-look:${e}`;function yt(e,n){if(e.seen!==void 0)try{return typeof e.seen=="function"?e.seen():e.seen}catch{return!0}try{return window.localStorage.getItem(Ve(n))!==null}catch{return!1}}function wt(e,n){if(e.seen===void 0)try{window.localStorage.setItem(Ve(n),"seen")}catch{}}var ht=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.SF4BYBH6.js","./chunk.SDO3U72B.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.4GHXAWIE.js")))),vt=ht.part((e,n)=>{let t=e.FirstLookHints;return(0,we.jsx)(t,{...n})},{quiet:!0});function bt({firstLook:e,root:n,app:t}){let r=(0,K.useRef)(null);r.current=e===!0?{}:e||null;let[o,a]=(0,K.useState)(()=>r.current!==null&&typeof window<"u"&&!yt(r.current,t)),i=(0,K.useCallback)(p=>{if(a(!1),p===null)return;let c=r.current??{};wt(c,t),c.onDone?.(p)},[t]);return!o||r.current===null?null:(0,we.jsx)(K.Suspense,{fallback:null,children:(0,we.jsx)(vt,{root:n,steps:r.current.steps??[],onEnd:i})})}export{pe as a,lr as b,kt as c,Sn as d,xt as e,Te as f,br as g,pr as h,ur as i,ue as j,fr as k,mr as l,yr as m,wr as n,M as o,Pr as p,Lr as q,Nn as r,Er as s,J as t,Tr as u,Wr as v,Zr as w,Jr as x,_r as y,Kr as z,Ce as A,et as B,Wn as C,Gn as D,nt as E,ft as F,gt as G,mt as H,rt as I,it as J,bt as K};
67
+ `):"";(0,y.useLayoutEffect)(I,[I,n,e,or,k?.current,oe,A,w,d]);let ir=w==="icons"||!Zn||A?"icons":"words";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("header",{ref:H,className:"graview-bar","data-testid":"app-bar","data-graview-app-bar":"",...Qn&&A?{"data-finding":""}:{},children:[(0,s.jsx)("style",{children:Ar}),x,(0,s.jsxs)("div",{className:"graview-bar-row",children:[b?(0,s.jsx)("div",{className:"graview-bar-app",children:(0,s.jsx)(nr,{className:"graview-bar-name",children:(0,s.jsxs)(rr,{...r.href!==void 0?{href:r.href,onClick:tr(r.go)}:{type:"button",onClick:r.go},"data-testid":"app-home",...r.current?{"aria-current":"page"}:{},title:u?`${n} \u2014 ${u}`:`${n} \u2014 home`,className:"graview-bar-home",children:[(0,s.jsx)(He,{brand:e,size:20}),(0,s.jsx)("span",{className:"graview-bar-app-name","data-testid":"app-name",children:n})]})})}):null,o?(0,s.jsx)(Hr,{faces:o,form:w,drawn:ir}):null,(0,s.jsx)("div",{className:"graview-bar-mid",...qe?{"data-places":"standing"}:!A&&se?{"data-place":""}:{},children:A?null:se}),!A&&k&&k.places.length>1?(0,s.jsxs)("span",{className:"graview-bar-ruler","aria-hidden":"true","data-graview-bar-ruler":"",children:[k.places.map(m=>(0,s.jsx)("span",{className:"graview-bar-at",children:m.label},m.key)),(0,s.jsxs)("span",{className:"graview-bar-at",children:[Ne,(0,s.jsx)(Vn,{})]})]}):null,b?(0,s.jsx)("span",{className:"graview-bar-ruler","aria-hidden":"true",children:(0,s.jsx)("span",{className:"graview-bar-name",children:n})}):null,(0,s.jsxs)("div",{className:"graview-bar-tools",children:[d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"graview-bar-find-open",ref:We,"data-testid":"app-find-open","aria-label":"Find",title:"Find",onClick:er,style:{...J,display:void 0},children:(0,s.jsx)(Rr,{})}),(0,s.jsxs)("div",{className:"graview-bar-find","data-testid":"app-find",onBlur:m=>{let N=m.relatedTarget;N instanceof Node&&m.currentTarget.contains(N)||m.currentTarget.querySelector("input")?.value||Ge()},onKeyDownCapture:m=>{m.key==="Escape"&&A&&(ie.current=!0)},onKeyDown:m=>{m.key!=="Escape"||!A||(!m.defaultPrevented||!m.currentTarget.querySelector("input")?.value?Ge():ie.current=!1)},children:[(0,s.jsx)("div",{ref:P,className:"graview-bar-find-slot",children:l}),(0,s.jsx)(Mr,{})]})]}):null,(0,s.jsx)("div",{ref:B,className:"graview-bar-own","data-graview-bar-own":""}),De?(0,s.jsx)(y.Suspense,{fallback:null,children:(0,s.jsx)(xr,{scene:!oe,compact:A})}):null,(0,s.jsx)(Sr,{}),c]})]})]}),A&&se?(0,s.jsx)("div",{className:"graview-bar-line","data-graview-place-line":"","data-testid":"app-place-line",children:se}):null]})}function Hr({faces:e,form:n,drawn:t}){let r=o=>{let a=e[o];return(0,s.jsxs)("button",{type:"button",className:"graview-bar-face","data-testid":`app-face-${o}`,"aria-pressed":a.current,title:a.label,...a.reach&&!a.current?{onPointerEnter:a.reach,onPointerDown:a.reach,onFocus:a.reach}:{},onClick:()=>{a.current||a.go()},children:[o==="scene"?(0,s.jsx)(Fn,{}):(0,s.jsx)(Cr,{}),(0,s.jsx)("span",{children:a.label})]})};return(0,s.jsxs)("div",{className:"graview-bar-faces",role:"group","aria-label":`${e.scene.label} or ${e.pages.label}`,"data-testid":"app-faces","data-switch":n,"data-switch-drawn":t,children:[r("scene"),r("pages")]})}function Br(e){let n=e.querySelector(".graview-bar-faces"),t=e.querySelector(".graview-bar-mid"),r=e.querySelector(".graview-bar-find");if(!n||!t||r?.matches(":focus-within")||e.getBoundingClientRect().width<te)return null;let a=In(n),i=t.querySelector(".graview-bar-place-words"),p=i?parseFloat(getComputedStyle(i).fontSize)||14:0,c=i?Math.min(i.scrollWidth+34,14*p):0,d=Rn(e);if(d===null)return!1;let u=t.getBoundingClientRect().width-c-d;if(r&&r.getBoundingClientRect().width>0){let l=parseFloat(getComputedStyle(r).flexBasis);isFinite(l)&&(u-=Math.max(0,l-r.getBoundingClientRect().width))}return n.getAttribute("data-switch-drawn")==="icons"?u>=a+2:u>=-1}function Rn(e){let n=e.querySelector(".graview-bar-app"),t=e.querySelector(".graview-bar-ruler>.graview-bar-name");if(!n||!t)return 0;let r=i=>i?.getBoundingClientRect().width??0,o=r(n.firstElementChild)-r(e.querySelector(".graview-bar-app-name"))+r(t)+2,a=parseFloat(getComputedStyle(n).maxWidth)/100*(n.parentElement.clientWidth-2*n.offsetLeft)||1/0;return o>a+.5?null:Math.max(0,o-r(n))}var On=e=>e.button===0&&!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey);function Nr(){let e=globalThis.navigator?.platform??"";return/Mac|iPhone|iPad|iPod/.test(e)?"\u2318K":"Ctrl K"}function Mr(){let e=Sn(Y()?.aiDesk);return(0,s.jsx)("span",{className:"graview-bar-find-keys","data-testid":"app-find-keys","aria-hidden":"true",children:e?"/":Nr()})}function ae({size:e,box:n=e,children:t}){return(0,s.jsx)("svg",{width:e,height:e,viewBox:`0 0 ${n} ${n}`,"aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto"},children:t})}function Fn(){return(0,s.jsxs)(ae,{size:14,children:[(0,s.jsx)("path",{d:"M7 1.5 L12.5 4.5 L7 7.5 L1.5 4.5 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M1.5 7.5 L7 10.5 L12.5 7.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round",strokeLinecap:"round"})]})}function Cr(){return(0,s.jsxs)(ae,{size:14,children:[(0,s.jsx)("rect",{x:"2.25",y:"1.75",width:"9.5",height:"10.5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),(0,s.jsx)("path",{d:"M4.5 5 H9.5 M4.5 7.25 H9.5 M4.5 9.5 H7.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Vn(){return(0,s.jsx)(ae,{size:10,children:(0,s.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Rr(){return(0,s.jsxs)(ae,{size:16,children:[(0,s.jsx)("circle",{cx:"7",cy:"7",r:"4.75",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,s.jsx)("path",{d:"M10.5 10.5 L14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Or({place:e}){if(e.key===q)return(0,s.jsx)(Fn,{});if(e.group==="home")return(0,s.jsx)(ae,{size:13,box:14,children:(0,s.jsx)("path",{d:"M2 6.5 L7 2 L12 6.5 V12 H2 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})});let n=e.kind?`hsl(${Math.round(Ze(e.kind))} 55% 52%`:"rgb(128 128 128";return(0,s.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:12,height:8,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",background:e.group==="lists"?`${n})`:`linear-gradient(${n}), ${n})) center / 6px 4px no-repeat, ${n} / 0.35)`}})}var Fr=[{group:"home"},{group:"lists",heading:"Lists"},{group:"pictures",heading:"Pictures"}],Ne="More";function Dn({place:e,current:n,reach:t,standing:r,done:o}){let a=e.key===n,i=t.href?.(e.path);return(0,s.jsxs)(i!==void 0?"a":"button",{className:r?"graview-bar-at":"graview-bar-item","data-testid":`app-place-${e.key}`,"data-place-path":e.path,...a?{"aria-current":"page"}:{},...i!==void 0?{href:i}:{type:"button"},onClick:c=>{o(),t.go&&(i!==void 0&&!On(c)||(c.preventDefault(),t.go(e)))},children:[r?null:(0,s.jsx)("span",{className:"graview-bar-mark",children:(0,s.jsx)(Or,{place:e})}),r&&a?(0,s.jsx)("span",{"data-testid":"app-place-current",children:e.label}):(0,s.jsx)("span",{children:e.label})]})}function Vr({places:e,current:n,reach:t,id:r,done:o}){return(0,s.jsx)(s.Fragment,{children:Fr.map(({group:a,heading:i})=>{let p=e.filter(d=>d.group===a);if(p.length===0)return null;let c=`${r}-${a}`;return(0,s.jsxs)("div",{role:"group",...i?{"aria-labelledby":c}:{"aria-label":p[0].label},"data-place-group":a,children:[i?(0,s.jsx)("p",{id:c,children:i}):null,(0,s.jsx)("ul",{children:p.map(d=>(0,s.jsx)("li",{children:(0,s.jsx)(Dn,{place:d,current:n,reach:t,standing:!1,done:o})},d.key))})]},a)})})}function Dr({places:e,current:n,here:t,reach:r,scene:o,stands:a}){let i=Q("places"),p=(0,y.useRef)(a);i.open||(p.current=a);let c=p.current,u=e.find(b=>b.key===n)?.label??t??"Places",l=c?e.filter((b,H)=>!c.includes(H)):e,g=Ir(e,n,o),w=Y(),h=w?.keptViews?.current(),x=!!(h&&(h.removed.length>0||w.views.places().some(b=>b.hidden)||h.may.lenses&&(w.views.arrangement?.()?.hide?.length??0)>0));return(0,s.jsxs)("nav",{className:c?"graview-bar-places":"graview-bar-place-at","aria-label":o?"What the scene shows":"The app\u2019s places",...c?{"data-testid":"app-places-standing"}:{},...g,children:[c?.map(b=>(0,s.jsx)(Dn,{place:e[b],current:n,reach:r,standing:!0,done:()=>{}},e[b].key)),l.length>0||x?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",className:c?"graview-bar-at":"graview-bar-place","data-testid":"app-places-open",...i.trigger,onClick:i.toggle,"aria-label":c?`${Ne} \u2014 ${l.length} more ${o?"pictures":"places"}`:`${u} \u2014 ${o?"everything the scene shows":"every place"}`,title:c?l.map(b=>b.label).join(", "):u,children:[c?Ne:(0,s.jsx)("span",{className:"graview-bar-place-words","data-testid":"app-place-current",children:u}),(0,s.jsx)(Vn,{})]}),(0,s.jsxs)("div",{...i.pane,"data-testid":"app-places",hidden:!i.open,className:"graview-bar-list",style:U,children:[(0,s.jsx)(Vr,{places:l,current:n,reach:r,id:i.pane.id,done:()=>i.setOpen(!1)}),x&&i.open?(0,s.jsx)(y.Suspense,{fallback:null,children:(0,s.jsx)(kr,{id:i.pane.id,scene:o,reach:r,done:()=>i.setOpen(!1)})}):null]})]}):null]})}function Ir(e,n,t){let r=Y()?.setMenuAt,o=a=>{let i=a.target.closest?.("[data-place-path],[data-testid=app-places-open]");if(!i||!r)return;let p={at:0};a.type==="pointerdown"?document.addEventListener("pointerup",()=>p.at||=Date.now(),{once:!0}):a.preventDefault();let c=a.nativeEvent;M.load().then(d=>d.placeGesture(c,i,e,n,t,r,p),String)};return{onContextMenu:a=>a.shiftKey||o(a),onKeyDown:a=>(a.key==="ContextMenu"||a.key==="F10"&&a.shiftKey)&&o(a),onPointerDown:a=>a.pointerType!=="mouse"&&a.isPrimary&&o(a)}}function $r(e,n,t,r){let o=e.querySelector("[data-graview-bar-ruler]"),a=e.querySelector(".graview-bar-mid");if(!o||!a)return null;let i=e.querySelector(".graview-bar-find");if(i?.matches(":focus-within"))return;if(e.getBoundingClientRect().width<te)return null;let p=Rn(e);if(p===null)return null;let c=[...o.children].map(H=>H.getBoundingClientRect().width),d=c.pop()??0,u=e.querySelector(".graview-bar-faces"),l=u&&t?In(u):0,g=u?.getAttribute("data-switch-drawn")==="words"?l:0,w=a.getBoundingClientRect().left+p,h=i?.getBoundingClientRect(),x=h&&h.width>0?h.right-w-(parseFloat(getComputedStyle(i).minWidth)||0)-16:a.getBoundingClientRect().width-p,b=[...r].map(H=>H!=="0");return Cn({widths:c,current:n,room:Math.floor(x+g-l),more:d,primary:b})?.join(",")??null}function In(e){return[...e.querySelectorAll(".graview-bar-face span")].reduce((n,t)=>n+t.scrollWidth+10,0)}var _r=e=>`graview:lenses:${e}`,Kr=(e,n)=>e?.name??n.kinds.join(",");function Ce(e){try{let n=JSON.parse(localStorage.getItem(_r(e))??"[]");return Array.isArray(n)?n.filter(t=>typeof t?.title=="string"&&typeof t.lens=="string"):[]}catch{return[]}}var _=v(R(),1);var E=v(S(),1);function Wr({scheme:e,onScheme:n,profileHref:t,keeping:r,hostActions:o=Gr,signature:a=!1}){let{store:i,principal:p,seats:c,people:d}=ce(),u=Q("profile"),l=u.open,[g,w]=(0,_.useState)(!1);(0,_.useEffect)(()=>jr(fe),[]),l&&!g&&w(!0),(0,_.useEffect)(()=>{l&&fe()},[l]);let h=p.id===void 0?void 0:i.graph.getNode(p.id),x=h===void 0?p.id===void 0?"Nobody in particular":Ue(p,{graph:i.graph,schema:i.schema,seats:c,people:d}):ze(i.schema.tryDefinition(h.kind),h);return(0,E.jsxs)("div",{style:{position:"relative"},children:[(0,E.jsx)("button",{type:"button","data-testid":"profile-button",...u.trigger,onClick:u.toggle,onPointerEnter:fe,onFocus:fe,"aria-label":`${x} \u2014 you, your seat and your settings`,title:`${x} \u2014 you, your seat and your settings`,style:{...J,borderRadius:999},children:(0,E.jsx)("span",{"aria-hidden":"true","data-testid":"profile-mark",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:Z-4,height:Z-4,borderRadius:999,fontSize:"0.8125rem",fontWeight:600,background:"var(--graview-panel-muted)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)"},children:Yr(x)})}),(0,E.jsxs)("section",{...u.pane,"aria-label":"Profile","data-testid":"profile","data-graview-offstage":"",hidden:!l,style:{...U,width:280,maxWidth:"calc(100vw - 32px)",maxHeight:"min(62cqh, 520px)",overflowY:"auto",overflowX:"hidden",display:l?"grid":"none",gap:12,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[g?(0,E.jsx)(_.Suspense,{fallback:null,children:(0,E.jsx)(qr,{part:"top",name:x,me:h,profileHref:t,hostActions:o,close:()=>u.setOpen(!1)})}):null,(0,E.jsxs)("div",{className:"graview-profile-keeping","data-testid":"profile-keeping",style:Qr,children:[(0,E.jsx)("span",{style:Ur,children:"Keeping this app"}),r]}),g?(0,E.jsx)(_.Suspense,{fallback:null,children:(0,E.jsx)(zr,{part:"rest",name:x,me:h,scheme:e,onScheme:n,hostActions:o,signature:a,close:()=>u.setOpen(!1)})}):null]})]})}var Gr=[],fe=()=>M.prefetch(),qr=M.part((e,n)=>(0,E.jsx)(e.ProfilePane,{...n}),{what:"The rest of your menu"}),zr=M.part((e,n)=>(0,E.jsx)(e.ProfilePane,{...n}),{quiet:!0});function jr(e){let n=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},t=globalThis;if(t.requestIdleCallback){let o=t.requestIdleCallback(n,{timeout:5e3});return()=>t.cancelIdleCallback?.(o)}let r=setTimeout(n,2500);return()=>clearTimeout(r)}function Yr(e){return(e.trim()[0]??"?").toUpperCase()}var Ur={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},Qr={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};function Zr(e){return!(e==="hidden"||e===!1)}var Re=v(R(),1);var $n="The whole thing",ge=e=>`scene:${e.kind}:${e.as}`;function _n(e){let{view:n}=e,t=e.places.filter(l=>!e.hidden.has(l.kind)),r=ne(t),o=(l,g)=>{if(l===q)return un(fn(g,!0),"view",null);let w=r.find(h=>ge(h)===l);return w?mn(g,w.over?.find(h=>g.focusId===re(h))??w.kind,w.as):null},a=n.within?.view,i=l=>n.focusId===re(l.kind)&&(a===void 0?t.filter(g=>g.kind===l.kind).at(-1)===l:a===l.as),p=t.find(l=>i(l)&&(a!==void 0||!n.overview)),c=p?r.find(l=>de(l,p)):void 0,d=r.filter(l=>!l.hidden||l===c);return{places:[{key:q,label:$n,path:`${Se}${Le(o(q,Pe))}`,group:"home"},...d.map(l=>({key:ge(l),label:j(l,t,e.schema),path:`${Se}${Le(o(ge(l),Pe))}`,group:"pictures",kind:l.kind,hidden:l.hidden}))],current:c?ge(c):q,to:o}}function Jr(){let{store:e,views:n,hiddenKinds:t}=ce(),{view:r,go:o}=bn(),a=n.places(),i=(0,Re.useMemo)(()=>_n({places:a,hidden:t,view:r,schema:e.schema}),[a,t,r,e.schema]),p=(0,Re.useMemo)(()=>({go:c=>{let d=i.to(c.key,r);d&&o(d)}}),[i,r,o]);return{places:i.places,current:i.current,reach:p}}var X=v(R(),1);var F=v(S(),1),Xr=M.part((e,n)=>(0,F.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"}),Oe=()=>M.prefetch();function et({clean:e="All rules hold"}){let n=vn(),{set:t}=hn(),r=n.length,[o,a]=(0,X.useState)(!1),i=Q("problems",{open:o&&r>0,onOpenChange:a}),p=i.open,c=Wn(n,e);return(0,X.useEffect)(()=>{if(r===0)return;let d=setTimeout(Oe,1500);return()=>clearTimeout(d)},[r>0]),(0,F.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[(0,F.jsxs)("button",{type:"button","data-testid":"standing",...i.trigger,"aria-disabled":r===0?!0:void 0,"aria-label":c,onClick:r===0?void 0:i.toggle,onPointerEnter:r===0?void 0:Oe,onFocus:r===0?void 0:Oe,title:c,style:{...J,padding:r===0?0:"0 8px",cursor:r===0?"default":"pointer",color:r===0?"var(--graview-ink-muted)":Kn(n),fontVariantNumeric:"tabular-nums",fontWeight:600},children:[(0,F.jsx)(Gn,{tone:r===0?"var(--graview-good)":Kn(n)}),r>0?(0,F.jsx)("span",{"aria-hidden":"true",children:r}):null]}),p?(0,F.jsx)("ol",{...i.pane,"data-testid":"problems",style:{...U,width:300,maxHeight:"min(48cqh, 420px)",overflow:"auto",margin:0,padding:4,listStyle:"none",display:"grid",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:(0,F.jsx)(X.Suspense,{fallback:null,children:(0,F.jsx)(Xr,{violations:n,pick:d=>{t(d.nodeIds),i.setOpen(!1)}})})}):null]})}function Wn(e,n){return e.length===0?n:`${Qe(e)} \u2014 open what is broken, and what would fix it`}var Kn=e=>e.some(n=>n.status==="could-not-judge"||n.status==="over-budget")?"var(--graview-bad)":"var(--graview-warn)";function Gn({tone:e}){return(0,F.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:999,flex:"0 0 auto",background:e}})}function nt(e,n,t=[]){if(e.focusId)return e.focusId;let o=(e.selection??[]).map(gn).find(a=>a!==null)??t.find(a=>n.includes(a))??n[0]??null;return o===null?null:re(o)}var ye=v(S(),1),me=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.RR2IFETZ.js","./chunk.ONGZ3YQF.js","./chunk.XGCOWCA2.js","./chunk.MORMTKVR.js","./chunk.E33EJU3Q.js","./chunk.PJCVFYFU.js","./chunk.7RJGEU3Y.js","./chunk.AIK3Z25Y.js","./chunk.CKV2QCH5.js","./chunk.BT7RLFPO.js","./chunk.TAJ2R44N.js","./chunk.VLBY66PB.js","./chunk.WVUJXDXZ.js","./chunk.T2RME6XF.js","./chunk.SOTB6C5A.js","./chunk.TQCRFZ53.js","./chunk.6HLKAUWF.js","./chunk.FCUDBMGC.js","./chunk.KMEKMCKG.js","./chunk.GZHZLJBF.js","./chunk.E5XNQTEU.js","./chunk.OJGHDWI6.js","./chunk.K5YLQAFW.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HVN2DVP3.js"))));function rt(){return me.load().then(()=>{})}var tt=[{cardinality:"one",fidelity:"full",slot:"page"},{cardinality:"one",fidelity:"summary",slot:"card"},{cardinality:"one",fidelity:"glyph",slot:"row"},{cardinality:"many",fidelity:"full"},{cardinality:"many",fidelity:"summary"},{cardinality:"many",fidelity:"glyph"}];function at({schema:e,specs:n,kind:t,view:r}){let o=me.current.frameworkViews(e,n).lookup(t,{cardinality:r.cardinality,fidelity:r.fidelity});return o?(0,ye.jsx)(o,{...r}):null}var ot=me.part((e,n)=>(0,ye.jsx)(at,{...n}),{what:"This view"});function qn(e,n,t){for(let r of n.kinds){let o=t?.[r];for(let a of tt){let i=c=>(0,ye.jsx)(ot,{schema:n,specs:t,kind:r,view:c}),p=a.slot!==void 0&&o?.[a.slot]!==void 0;p&&(i.says=(c,d)=>me.current?.frameworkViews(n,t).lookup(r,{cardinality:a.cardinality,fidelity:a.fidelity})?.says?.(c,d)),e.register(r,{cardinality:a.cardinality,fidelity:a.fidelity},p?i:yn(i))}}return e}function it(e,n){return qn(wn(e),e,n)}var Fe=v(R(),1);var D=v(S(),1),zn=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.WPJVMVAL.js","./chunk.VYW7DSUW.js","./chunk.LKK7VQBA.js","./chunk.EC5IWN74.js","./chunk.RR2IFETZ.js","./chunk.ONGZ3YQF.js","./chunk.XGCOWCA2.js","./chunk.MORMTKVR.js","./chunk.CU2NQ5WF.js","./chunk.E33EJU3Q.js","./chunk.PJCVFYFU.js","./chunk.7RJGEU3Y.js","./chunk.HJCQ6I3S.js","./chunk.7O6Z3BFR.js","./chunk.I2C5LPB5.js","./chunk.6Q6BW4QT.js","./chunk.AIK3Z25Y.js","./chunk.CKV2QCH5.js","./chunk.BT7RLFPO.js","./chunk.TAJ2R44N.js","./chunk.VLBY66PB.js","./chunk.64IKLRUS.js","./chunk.DTSTUC2W.js","./chunk.RDL6652E.js","./chunk.V3NPUAPB.js","./chunk.IT763BYH.js","./chunk.UQQAGT3R.js","./chunk.WVUJXDXZ.js","./chunk.T2RME6XF.js","./chunk.SOTB6C5A.js","./chunk.TQCRFZ53.js","./chunk.6HLKAUWF.js","./chunk.FCUDBMGC.js","./chunk.KMEKMCKG.js","./chunk.GZHZLJBF.js","./chunk.E5XNQTEU.js","./chunk.OJGHDWI6.js","./chunk.K5YLQAFW.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.3V2WH6F7.js"))));function st({lens:e,view:n}){let t=zn.current.declaredLensView(e);return(0,D.jsx)(t,{...n})}var lt=zn.part((e,n)=>(0,D.jsx)(st,{...n}),{what:"This picture"});function dt(e){let n=r=>(0,D.jsx)(Fe.Suspense,{fallback:null,children:(0,D.jsx)(lt,{lens:e,view:r})});e.lens==="blocks"&&(n.flows=!0);let t=e.lens==="blocks"?e.options.blocks?.[0]:void 0;return typeof t?.headline=="string"&&(n.lede=t),e.create===!1&&(n.creates=!1),n}var jn=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.RR2IFETZ.js","./chunk.ONGZ3YQF.js","./chunk.XGCOWCA2.js","./chunk.MORMTKVR.js","./chunk.E33EJU3Q.js","./chunk.PJCVFYFU.js","./chunk.7RJGEU3Y.js","./chunk.AIK3Z25Y.js","./chunk.CKV2QCH5.js","./chunk.BT7RLFPO.js","./chunk.TAJ2R44N.js","./chunk.VLBY66PB.js","./chunk.WVUJXDXZ.js","./chunk.T2RME6XF.js","./chunk.SOTB6C5A.js","./chunk.TQCRFZ53.js","./chunk.6HLKAUWF.js","./chunk.FCUDBMGC.js","./chunk.KMEKMCKG.js","./chunk.GZHZLJBF.js","./chunk.E5XNQTEU.js","./chunk.OJGHDWI6.js","./chunk.K5YLQAFW.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.JL4DGITZ.js"))));function ct({blocks:e,view:n}){let t=jn.current.homeView(e);return(0,D.jsx)(t,{...n})}var pt=jn.part((e,n)=>(0,D.jsx)(ct,{...n}),{what:"The home"});function ut(e){let n=t=>(0,D.jsx)(Fe.Suspense,{fallback:null,children:(0,D.jsx)(pt,{blocks:e,view:t})});return Object.defineProperty(n,Symbol.for("graview.home-blocks"),{value:!0}),n}function ft(e,n){return n.home&&n.home.length>0&&e.home?.(ut(n.home)),Yn(e,n),e.arrange?.(n.pages),e}function Yn(e,n,t){for(let r of on(n).drawn){if(t&&e.places().some(i=>i.title===r.title))continue;let o=dt(r),a={title:r.title,lens:r.lens,...r.across?{across:r.across}:{},...t?{beside:t}:{},...r.hidden?{hidden:!0}:{},over:r.kinds,...t?{}:{declared:!0}};for(let i of r.kinds)e.register(i,{cardinality:"many",fidelity:"full"},o,a),e.register(i,{cardinality:"many",fidelity:"summary"},o,a)}}function gt(e,n,t){t.length>0&&Yn(e,{schema:n,lenses:t.map(({lens:r,...o})=>({...o,name:r}))},!0)}function mt(e,n,t){gt(e,n,Ce(t))}var K=v(R(),1),we=v(S(),1);var Ve=e=>`graview:first-look:${e}`;function yt(e,n){if(e.seen!==void 0)try{return typeof e.seen=="function"?e.seen():e.seen}catch{return!0}try{return window.localStorage.getItem(Ve(n))!==null}catch{return!1}}function wt(e,n){if(e.seen===void 0)try{window.localStorage.setItem(Ve(n),"seen")}catch{}}var ht=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.C2VFDBSG.js")))),vt=ht.part((e,n)=>{let t=e.FirstLookHints;return(0,we.jsx)(t,{...n})},{quiet:!0});function bt({firstLook:e,root:n,app:t}){let r=(0,K.useRef)(null);r.current=e===!0?{}:e||null;let[o,a]=(0,K.useState)(()=>r.current!==null&&typeof window<"u"&&!yt(r.current,t)),i=(0,K.useCallback)(p=>{if(a(!1),p===null)return;let c=r.current??{};wt(c,t),c.onDone?.(p)},[t]);return!o||r.current===null?null:(0,we.jsx)(K.Suspense,{fallback:null,children:(0,we.jsx)(vt,{root:n,steps:r.current.steps??[],onEnd:i})})}export{pe as a,lr as b,kt as c,Sn as d,xt as e,Te as f,br as g,pr as h,ur as i,ue as j,fr as k,mr as l,yr as m,wr as n,M as o,Pr as p,Lr as q,Nn as r,Er as s,J as t,Tr as u,Wr as v,Zr as w,Jr as x,_r as y,Kr as z,Ce as A,et as B,Wn as C,Gn as D,nt as E,ft as F,gt as G,mt as H,rt as I,it as J,bt as K};
@@ -0,0 +1 @@
1
+ import{k as a,l as o}from"./chunk.RR2IFETZ.js";import"./chunk.ONGZ3YQF.js";import"./chunk.XGCOWCA2.js";import"./chunk.MORMTKVR.js";import"./chunk.E33EJU3Q.js";import"./chunk.PJCVFYFU.js";import"./chunk.7RJGEU3Y.js";import"./chunk.AIK3Z25Y.js";import"./chunk.CKV2QCH5.js";import"./chunk.BT7RLFPO.js";import"./chunk.TAJ2R44N.js";import"./chunk.VLBY66PB.js";import"./chunk.WVUJXDXZ.js";import"./chunk.T2RME6XF.js";import"./chunk.SOTB6C5A.js";import"./chunk.TQCRFZ53.js";import"./chunk.6HLKAUWF.js";import"./chunk.FCUDBMGC.js";import"./chunk.KMEKMCKG.js";import"./chunk.GZHZLJBF.js";import"./chunk.E5XNQTEU.js";import"./chunk.OJGHDWI6.js";import"./chunk.K5YLQAFW.js";import"./chunk.XJFAUOJS.js";import"./chunk.DPPT6WAJ.js";import"./chunk.7U2JO7ET.js";import"./chunk.HFVMGTNL.js";import"./chunk.7Z4USR3Y.js";import{ta as n}from"./chunk.NPAWTPLQ.js";import"./chunk.SDO3U72B.js";import"./chunk.YEJ4LNUP.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function p(e,i){let t=w.get(e);t||w.set(e,t=new Map);let r=t.get(i);return r||t.set(i,r=a(o(e,n(e)),e,i)),r}export{p as frameworkViews};
@@ -1 +1 @@
1
- import{C as O}from"./chunk.3MZIWKNG.js";var k=3,A=k+1,P=A+1,z=(o,r)=>o<r?-1:o>r?1:0;function L(o){return(o??0)>4?k:2}function N(o,r,a){let n=[];for(let d of Object.values(o.tryDefinition(r)?.edges??{}))if(d.to!=="*")for(let i of d.to)i!==r&&a.includes(i)&&!n.includes(i)&&n.push(i);return n}function W(o,r={}){let a=[...o.kinds],n=[...(r.order??[]).filter(e=>a.includes(e)),...a.filter(e=>!(r.order??[]).includes(e)).sort(z)].filter((e,t,s)=>s.indexOf(e)===t),d=e=>n.indexOf(e),i=new Map,g=[],h=(e,t,s)=>{i.set(e,{col:t,row:s,side:L(r.counts?.[e])}),g.push({col:t,row:s})};for(let e of n){let t=o.tryDefinition(e)?.plot??r.plots?.[e];t&&h(e,t.col,t.row)}let l=new Map(n.map(e=>[e,N(o,e,a)])),b=new Set(n.filter(e=>l.get(e).length>0||n.some(t=>l.get(t).includes(e)))),v=new Map,C=new Set,D=e=>{let t=v.get(e);if(t!==void 0)return t;if(C.has(e))return-1;C.add(e);let s=0;for(let c of l.get(e))s=Math.max(s,D(c)+1);return C.delete(e),v.set(e,s),s};for(let e of n)b.has(e)&&D(e);let f=[];for(let e of n)b.has(e)&&(f[v.get(e)]??=[]).push(e);let I=new Map,T=Math.max(1,Math.ceil(Math.sqrt(f.length))),H=Math.max(1,...f.map(e=>e?.length??0)),w=Math.max(P,Math.round(r.pitch??P)),R=(e,t)=>r.upright?{col:e%T*w,row:(Math.floor(e/T)*(H+1)+t)*w}:{col:t*w,row:e===0?0:-e*w},$=e=>!g.some(t=>V(t,e)),S=(e,t,s)=>{let c=s;for(;!$(R(t,c))&&c<s+64;)c++;return i.has(e)||h(e,R(t,c).col,R(t,c).row),c},x=0;f.forEach((e=[],t)=>{let s=u=>{let m=l.get(u).map(p=>I.get(p)).filter(p=>p!==void 0);return m.length>0?m.reduce((p,q)=>p+q,0)/m.length:1/0},c=[...e].sort((u,m)=>s(u)-s(m)||d(u)-d(m)),y=0;for(let u of c)i.has(u)||(y=S(u,t,y),I.set(u,y),x=Math.max(x,y+1),y++)});let j=n.filter(e=>!b.has(e)&&!i.has(e)),M=Math.max(r.upright?x:f.length,Math.ceil(Math.sqrt(j.length*2)),1),E=b.size>0?1:0;return j.forEach((e,t)=>{r.upright?S(e,f.length+E+Math.floor(t/M),t%M):S(e,t%M,x+E+Math.floor(t/M))}),i}function V(o,r){return Math.abs(o.col-r.col)<A&&Math.abs(o.row-r.row)<A}function X(o,r,a,n=.5){return{x:(o-r)*a/2,y:(o+r)*a*n/2}}var G=1,B=/^(done|completed?|closed|finished|shipped|sent|won|lost|passed|declined|dropped|answered|resolved|fixed|archived|cancell?ed|retired|released|published|delivered|paid|merged|rejected|written[-_ ]?up|out)$/i,F=/^(doing|in[-_ ]?progress|active|building|started|working|in[-_ ]?review|review(ing)?|fixing|ongoing|underway|testing|drafting|writing|running)$/i;function _(o,r,a){let n=O(o.tryDefinition(r)?.fields.shape?.[a]);for(;n&&n.innerType!==void 0&&n.type!=="enum";)n=O(n.innerType);if(n?.type!=="enum")return;let d=(n.entries?Object.values(n.entries):n.values??[]).filter(i=>typeof i=="string");return d.length>0?d:void 0}function J(o,r){let a=o.tryDefinition(r);if(!a)return;let n=a.lifecycle,d=Object.keys(a.fields.shape??{}),i=[n?.field,...d.filter(l=>/^(status|stage|state|phase)$/i.test(l))].find(l=>l!==void 0&&_(o,r,l)!==void 0);if(!i)return;let g=_(o,r,i),h=n?.field===i&&Array.isArray(n.retired)?n.retired:[];return{field:i,values:g,tiers:g.map(l=>h.includes(l)||B.test(l)?"done":F.test(l)?"active":"waiting")}}export{P as a,W as b,X as c,G as d,J as e};
1
+ import{C as O}from"./chunk.YEJ4LNUP.js";var k=3,A=k+1,P=A+1,z=(o,r)=>o<r?-1:o>r?1:0;function L(o){return(o??0)>4?k:2}function N(o,r,a){let n=[];for(let d of Object.values(o.tryDefinition(r)?.edges??{}))if(d.to!=="*")for(let i of d.to)i!==r&&a.includes(i)&&!n.includes(i)&&n.push(i);return n}function W(o,r={}){let a=[...o.kinds],n=[...(r.order??[]).filter(e=>a.includes(e)),...a.filter(e=>!(r.order??[]).includes(e)).sort(z)].filter((e,t,s)=>s.indexOf(e)===t),d=e=>n.indexOf(e),i=new Map,g=[],h=(e,t,s)=>{i.set(e,{col:t,row:s,side:L(r.counts?.[e])}),g.push({col:t,row:s})};for(let e of n){let t=o.tryDefinition(e)?.plot??r.plots?.[e];t&&h(e,t.col,t.row)}let l=new Map(n.map(e=>[e,N(o,e,a)])),b=new Set(n.filter(e=>l.get(e).length>0||n.some(t=>l.get(t).includes(e)))),v=new Map,C=new Set,D=e=>{let t=v.get(e);if(t!==void 0)return t;if(C.has(e))return-1;C.add(e);let s=0;for(let c of l.get(e))s=Math.max(s,D(c)+1);return C.delete(e),v.set(e,s),s};for(let e of n)b.has(e)&&D(e);let f=[];for(let e of n)b.has(e)&&(f[v.get(e)]??=[]).push(e);let I=new Map,T=Math.max(1,Math.ceil(Math.sqrt(f.length))),H=Math.max(1,...f.map(e=>e?.length??0)),w=Math.max(P,Math.round(r.pitch??P)),R=(e,t)=>r.upright?{col:e%T*w,row:(Math.floor(e/T)*(H+1)+t)*w}:{col:t*w,row:e===0?0:-e*w},$=e=>!g.some(t=>V(t,e)),S=(e,t,s)=>{let c=s;for(;!$(R(t,c))&&c<s+64;)c++;return i.has(e)||h(e,R(t,c).col,R(t,c).row),c},x=0;f.forEach((e=[],t)=>{let s=u=>{let m=l.get(u).map(p=>I.get(p)).filter(p=>p!==void 0);return m.length>0?m.reduce((p,q)=>p+q,0)/m.length:1/0},c=[...e].sort((u,m)=>s(u)-s(m)||d(u)-d(m)),y=0;for(let u of c)i.has(u)||(y=S(u,t,y),I.set(u,y),x=Math.max(x,y+1),y++)});let j=n.filter(e=>!b.has(e)&&!i.has(e)),M=Math.max(r.upright?x:f.length,Math.ceil(Math.sqrt(j.length*2)),1),E=b.size>0?1:0;return j.forEach((e,t)=>{r.upright?S(e,f.length+E+Math.floor(t/M),t%M):S(e,t%M,x+E+Math.floor(t/M))}),i}function V(o,r){return Math.abs(o.col-r.col)<A&&Math.abs(o.row-r.row)<A}function X(o,r,a,n=.5){return{x:(o-r)*a/2,y:(o+r)*a*n/2}}var G=1,B=/^(done|completed?|closed|finished|shipped|sent|won|lost|passed|declined|dropped|answered|resolved|fixed|archived|cancell?ed|retired|released|published|delivered|paid|merged|rejected|written[-_ ]?up|out)$/i,F=/^(doing|in[-_ ]?progress|active|building|started|working|in[-_ ]?review|review(ing)?|fixing|ongoing|underway|testing|drafting|writing|running)$/i;function _(o,r,a){let n=O(o.tryDefinition(r)?.fields.shape?.[a]);for(;n&&n.innerType!==void 0&&n.type!=="enum";)n=O(n.innerType);if(n?.type!=="enum")return;let d=(n.entries?Object.values(n.entries):n.values??[]).filter(i=>typeof i=="string");return d.length>0?d:void 0}function J(o,r){let a=o.tryDefinition(r);if(!a)return;let n=a.lifecycle,d=Object.keys(a.fields.shape??{}),i=[n?.field,...d.filter(l=>/^(status|stage|state|phase)$/i.test(l))].find(l=>l!==void 0&&_(o,r,l)!==void 0);if(!i)return;let g=_(o,r,i),h=n?.field===i&&Array.isArray(n.retired)?n.retired:[];return{field:i,values:g,tiers:g.map(l=>h.includes(l)||B.test(l)?"done":F.test(l)?"active":"waiting")}}export{P as a,W as b,X as c,G as d,J as e};
@@ -1 +1 @@
1
- import{a as D}from"./chunk.PXQVXBNG.js";import{a as L,f as P,g as N,h as R,i as T}from"./chunk.B3WVCSW5.js";import{rd as E}from"./chunk.3MZIWKNG.js";var z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),W=e=>e?._zod?.def;function I(e){let n=W(e);for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)n=W(n.innerType);return n}function K(e){if(e?.type==="boolean")return["true","false"];if(e?.type==="enum")return(e.entries?Object.values(e.entries):e.values??[]).filter(n=>typeof n=="string")}var m=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]/g," ").replace(/^./,n=>n.toUpperCase());function J(e,n,i){let a=e.tryDefinition(n);if(!a)return[];let c=new Set(a.display?.hide??[]),o=[];for(let[s,l]of Object.entries(a.fields.shape??{})){if(s==="id"||s==="kind"||s==="label"||c.has(s))continue;let r=I(l);if(r?.type==="array"||r?.type==="object"||r?.type==="record")continue;let u=K(r);o.push({key:s,label:m(s),...u?{options:u}:{}})}let g=new Map;for(let[s,l]of Object.entries(a.edges??{}))g.set(s,l.to==="*"?[]:[...l.to]);for(let s of e.definitions)if(s.kind!==n)for(let[l,r]of Object.entries(s.edges??{}))!g.has(l)&&(r.to==="*"||r.to.includes(n))&&g.set(l,[s.kind]);let y=[];for(let[s,l]of g){o.push({key:s,label:m(s)});let r=i&&l.length===1&&l[0]!==n?e.tryDefinition(l[0]):void 0;for(let[u,f]of Object.entries(r?.fields.shape??{})){let p=I(f);p?.type==="enum"&&!r?.display?.hide?.includes(u)&&y.push({key:`${s}.${u}`,label:`${m(s)} \xB7 ${m(u)}`,options:K(p)})}}return o.push(...y),o.push({key:"is",label:"Is",options:a.lifecycle?["current","past","any","flagged","clear"]:["flagged","clear"]}),o}var G=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`;function q(e,n,i,a={}){if(i==null)return{ok:!0};if(!z(i))return{ok:!1,says:'A filter is an object of a field and the value it keeps, like { where: { stage: "building" } }.'};let c=Object.entries(i);if(c.length===0)return{ok:!0};let o=[];for(let l of n)for(let r of J(e,l,a.through===!0))o.some(u=>u.key===r.key)||o.push(r);let g=n[0]?e.tryDefinition(n[0]):void 0,y=g?g.plural??`${m(g.kind)}s`:"These",s=[];for(let[l,r]of c){let u=o.find(p=>p.key===l);if(!u)return{ok:!1,says:`${y.replace(/^./,p=>p.toUpperCase())} have no field "${l}" to filter by${o.length>0?`; they filter by ${G(o.map(p=>p.key))}`:""}.`};if(typeof r!="string"&&typeof r!="number"&&typeof r!="boolean")return{ok:!1,says:`The filter on "${l}" is ${Array.isArray(r)?"a list":r===null?"null":`a ${typeof r}`}; it keeps one value: a word, a number, or true or false.`};let f=String(r);if(f.trim().length===0)return{ok:!1,says:`The filter on "${l}" keeps nothing; give it a value, or leave "${l}" out.`};if(f.includes(","))return{ok:!1,says:`The filter on "${l}" holds a comma, which an address reads as a second filter; keep one value.`};if(u.options&&u.options.length>0&&!u.options.includes(f))return{ok:!1,says:`${u.label} has no choice "${f}"; its choices are ${G(u.options.map(p=>`"${p}"`))}.`};s.push(`${l}:${f}`)}return{ok:!0,filter:s.join(",")}}var C=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");function F(e,n){let i=e.find(o=>o.as===n);if(i)return i;let a=n.trim().toLowerCase(),c=C(n);return e.find(o=>o.title!==void 0&&o.title.trim().toLowerCase()===a)??(c?e.find(o=>o.as===c||o.title!==void 0&&C(o.title)===c):void 0)}function Q(e){let n=[];for(let i of e){if(typeof i!="object"||i===null)continue;let{as:a,slug:c,title:o,kind:g}=i,y=typeof a=="string"&&a.length>0?a:typeof c=="string"&&c.length>0?c:void 0;!y||n.some(s=>s.as===y)||n.push({as:y,title:typeof o=="string"?o:y,kind:typeof g=="string"?g:""})}return n}var M=e=>` Its places: ${e.map(n=>typeof n=="string"?`"${n}"`:n.title&&n.title!==n.as?`"${n.as}" (${n.title})`:`"${n.as}"`).join(", ")||"none"}.`;var b=e=>`"${e.length>80?`${e.slice(0,79)}\u2026`:e}"`,O=(e,n)=>`${"place"in e?`The place ${b(e.place)}`:`${b(e.record)} is no record this viewer may see and`} is no place of this app: it goes nowhere.${M(n)}`;function S(e){let n={};for(let i of e.split(",")){let a=i.indexOf(":");a>0&&(n[i.slice(0,a).trim()]=i.slice(a+1).trim())}return n}function oe(e,n=new Set){return e.kinds.filter(i=>!n.has(i)).map(i=>({slug:E(e,i).slice(1),kind:i}))}function V(e,n){let i=[...new Set(n.places.map(f=>f.as))],a=n.lists.map(f=>f.slug).filter(f=>!i.includes(f)),c;if(e.section!==void 0&&e.section!==null){if(typeof e.section!="string"||D(e.section).length===0||e.section.length>120)return{ok:!1,says:`The section ${typeof e.section=="string"?b(e.section):"asked for"} names nothing on a page: a section is a heading's words or an element's id, like "shipping-soon". It goes nowhere.`};c=e.section}let o=c!==void 0?{section:c}:{};if("record"in e&&n.sees(e.record))return e.where!==void 0&&e.where!==null?{ok:!1,says:`${b(e.record)} is one record, and a filter narrows a list or a place: it goes nowhere. Go to { place, where } for a list narrowed.`}:{ok:!0,arrival:{record:e.record,...o}};let g="place"in e?e.place:e.record,y=F(n.places,g),s=y?void 0:n.lists.find(f=>f.slug===g||f.kind===g);if(!y&&!s)return{ok:!1,says:`${O(e,n.places.filter((f,p,$)=>$.findIndex(t=>t.as===f.as)===p))}${_(a)}`};let l=y?[y.kind]:[s.kind],r;if(e.where!==void 0&&e.where!==null){if(!n.schema)return{ok:!1,says:`The place ${b(g)} cannot be narrowed here: it goes nowhere.`};let f=q(n.schema,l,e.where,{through:s!==void 0});if(!f.ok)return{ok:!1,says:`The filter on ${b(g)} goes nowhere: ${f.says}`};r=f.filter}let u=r?{filter:r}:{};return{ok:!0,arrival:y?{place:y.as,...u,...o}:{list:s.kind,...u,...o}}}var _=e=>e.length===0?"":` Its lists: ${e.slice(0,8).map(n=>`"${n}"`).join(", ")}${e.length>8?` and ${e.length-8} more`:""}.`,U="http://www.w3.org/1999/xhtml",H="http://www.w3.org/2000/svg",Z=e=>{let n=e;return n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||e.type==="click"&&typeof n.button=="number"&&n.button!==0};function se(e){let n=new WeakSet,i=new WeakSet,a=new WeakMap,c=new WeakMap,o=t=>V(t,{sees:e.sees,places:e.places(),lists:e.lists?.()??[],...e.schema?{schema:e.schema}:{}}),g=t=>{let d=o(t);return d.ok?e.onNavigate?.(d.arrival):e.onLost?.(d.says),d.ok},y=t=>{let d=t.getAttribute("data-record"),h=t.getAttribute("data-place"),k=t.getAttribute("data-filter"),w=t.getAttribute("data-section"),v={...k?{where:S(k)}:{},...w?{section:w}:{}};if(d)return{record:d,...v};if(h)return{place:h,...v}},s=t=>{if(!e.hrefOf)return;let d=y(t),h=d?o(d):void 0;return h?.ok?e.hrefOf(h.arrival):void 0},l=t=>t.hasAttribute("tabindex")?!1:(t.setAttribute("tabindex","0"),n.add(t),!0),r=t=>{n.delete(t)&&t.removeAttribute("tabindex")},u=t=>{i.delete(t)&&t.getAttribute("role")==="link"&&t.removeAttribute("role")},f=t=>{let d=a.get(t);d&&(a.delete(t),t.getAttribute("href")===d.href&&t.removeAttribute("href"),d.target!==null&&!t.hasAttribute("target")&&t.setAttribute("target",d.target))},p=t=>{let d=c.get(t);d&&(c.delete(t),r(d))},$={link(t){if(!N(t,[...t.querySelectorAll("input, select, textarea")].some(L))){if(!t.hasAttribute("data-graview-link"))return;t.removeAttribute("data-graview-link"),u(t),r(t),f(t),p(t);return}t.hasAttribute("data-graview-link")||t.setAttribute("data-graview-link","");let h=t.localName==="a"&&(t.namespaceURI===U||t.namespaceURI===H),k=t.getAttribute("href"),w=a.get(t),v=k!==null&&w?.href!==k,A=h&&!v?s(t):void 0;if(A!==void 0){k!==A&&t.setAttribute("href",A),a.set(t,{href:A,target:w?w.target:t.getAttribute("target")}),t.removeAttribute("target"),u(t),r(t);return}if(v?a.delete(t):f(t),R(t,t.querySelectorAll("a"))){u(t),r(t),p(t);return}if(!t.hasAttribute("role")&&(h||P(t))&&(t.setAttribute("role","link"),i.add(t)),t.localName==="tr"&&t.namespaceURI===U){r(t);let x=[...t.children].find(j=>j.localName==="td"||j.localName==="th");c.get(t)!==x&&p(t),x&&!c.has(t)&&l(x)&&c.set(t,x);return}t.localName!=="button"&&l(t)},refresh(t){for(let d of t.querySelectorAll("[data-record], [data-place], [data-graview-link]"))$.link(d)},pressed(t,d,h){if(t.type!=="click"&&!(t.type==="keydown"&&t.key==="Enter"))return!1;let k=T(d,h,w=>w.hasAttribute("data-graview-link"));return k?(t.stopPropagation(),a.has(k)&&Z(t)||(t.preventDefault(),$.follow(k)),!0):!1},follow(t){let d=y(t);d&&g(d)},go:g};return $}export{Q as a,M as b,b as c,O as d,S as e,oe as f,V as g,se as h};
1
+ import{a as D}from"./chunk.PXQVXBNG.js";import{a as L,f as P,g as N,h as R,i as T}from"./chunk.B3WVCSW5.js";import{zd as E}from"./chunk.YEJ4LNUP.js";var z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),W=e=>e?._zod?.def;function I(e){let n=W(e);for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)n=W(n.innerType);return n}function K(e){if(e?.type==="boolean")return["true","false"];if(e?.type==="enum")return(e.entries?Object.values(e.entries):e.values??[]).filter(n=>typeof n=="string")}var m=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]/g," ").replace(/^./,n=>n.toUpperCase());function J(e,n,i){let a=e.tryDefinition(n);if(!a)return[];let c=new Set(a.display?.hide??[]),o=[];for(let[s,l]of Object.entries(a.fields.shape??{})){if(s==="id"||s==="kind"||s==="label"||c.has(s))continue;let r=I(l);if(r?.type==="array"||r?.type==="object"||r?.type==="record")continue;let u=K(r);o.push({key:s,label:m(s),...u?{options:u}:{}})}let g=new Map;for(let[s,l]of Object.entries(a.edges??{}))g.set(s,l.to==="*"?[]:[...l.to]);for(let s of e.definitions)if(s.kind!==n)for(let[l,r]of Object.entries(s.edges??{}))!g.has(l)&&(r.to==="*"||r.to.includes(n))&&g.set(l,[s.kind]);let y=[];for(let[s,l]of g){o.push({key:s,label:m(s)});let r=i&&l.length===1&&l[0]!==n?e.tryDefinition(l[0]):void 0;for(let[u,f]of Object.entries(r?.fields.shape??{})){let p=I(f);p?.type==="enum"&&!r?.display?.hide?.includes(u)&&y.push({key:`${s}.${u}`,label:`${m(s)} \xB7 ${m(u)}`,options:K(p)})}}return o.push(...y),o.push({key:"is",label:"Is",options:a.lifecycle?["current","past","any","flagged","clear"]:["flagged","clear"]}),o}var G=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`;function q(e,n,i,a={}){if(i==null)return{ok:!0};if(!z(i))return{ok:!1,says:'A filter is an object of a field and the value it keeps, like { where: { stage: "building" } }.'};let c=Object.entries(i);if(c.length===0)return{ok:!0};let o=[];for(let l of n)for(let r of J(e,l,a.through===!0))o.some(u=>u.key===r.key)||o.push(r);let g=n[0]?e.tryDefinition(n[0]):void 0,y=g?g.plural??`${m(g.kind)}s`:"These",s=[];for(let[l,r]of c){let u=o.find(p=>p.key===l);if(!u)return{ok:!1,says:`${y.replace(/^./,p=>p.toUpperCase())} have no field "${l}" to filter by${o.length>0?`; they filter by ${G(o.map(p=>p.key))}`:""}.`};if(typeof r!="string"&&typeof r!="number"&&typeof r!="boolean")return{ok:!1,says:`The filter on "${l}" is ${Array.isArray(r)?"a list":r===null?"null":`a ${typeof r}`}; it keeps one value: a word, a number, or true or false.`};let f=String(r);if(f.trim().length===0)return{ok:!1,says:`The filter on "${l}" keeps nothing; give it a value, or leave "${l}" out.`};if(f.includes(","))return{ok:!1,says:`The filter on "${l}" holds a comma, which an address reads as a second filter; keep one value.`};if(u.options&&u.options.length>0&&!u.options.includes(f))return{ok:!1,says:`${u.label} has no choice "${f}"; its choices are ${G(u.options.map(p=>`"${p}"`))}.`};s.push(`${l}:${f}`)}return{ok:!0,filter:s.join(",")}}var C=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");function F(e,n){let i=e.find(o=>o.as===n);if(i)return i;let a=n.trim().toLowerCase(),c=C(n);return e.find(o=>o.title!==void 0&&o.title.trim().toLowerCase()===a)??(c?e.find(o=>o.as===c||o.title!==void 0&&C(o.title)===c):void 0)}function Q(e){let n=[];for(let i of e){if(typeof i!="object"||i===null)continue;let{as:a,slug:c,title:o,kind:g}=i,y=typeof a=="string"&&a.length>0?a:typeof c=="string"&&c.length>0?c:void 0;!y||n.some(s=>s.as===y)||n.push({as:y,title:typeof o=="string"?o:y,kind:typeof g=="string"?g:""})}return n}var M=e=>` Its places: ${e.map(n=>typeof n=="string"?`"${n}"`:n.title&&n.title!==n.as?`"${n.as}" (${n.title})`:`"${n.as}"`).join(", ")||"none"}.`;var b=e=>`"${e.length>80?`${e.slice(0,79)}\u2026`:e}"`,O=(e,n)=>`${"place"in e?`The place ${b(e.place)}`:`${b(e.record)} is no record this viewer may see and`} is no place of this app: it goes nowhere.${M(n)}`;function S(e){let n={};for(let i of e.split(",")){let a=i.indexOf(":");a>0&&(n[i.slice(0,a).trim()]=i.slice(a+1).trim())}return n}function oe(e,n=new Set){return e.kinds.filter(i=>!n.has(i)).map(i=>({slug:E(e,i).slice(1),kind:i}))}function V(e,n){let i=[...new Set(n.places.map(f=>f.as))],a=n.lists.map(f=>f.slug).filter(f=>!i.includes(f)),c;if(e.section!==void 0&&e.section!==null){if(typeof e.section!="string"||D(e.section).length===0||e.section.length>120)return{ok:!1,says:`The section ${typeof e.section=="string"?b(e.section):"asked for"} names nothing on a page: a section is a heading's words or an element's id, like "shipping-soon". It goes nowhere.`};c=e.section}let o=c!==void 0?{section:c}:{};if("record"in e&&n.sees(e.record))return e.where!==void 0&&e.where!==null?{ok:!1,says:`${b(e.record)} is one record, and a filter narrows a list or a place: it goes nowhere. Go to { place, where } for a list narrowed.`}:{ok:!0,arrival:{record:e.record,...o}};let g="place"in e?e.place:e.record,y=F(n.places,g),s=y?void 0:n.lists.find(f=>f.slug===g||f.kind===g);if(!y&&!s)return{ok:!1,says:`${O(e,n.places.filter((f,p,$)=>$.findIndex(t=>t.as===f.as)===p))}${_(a)}`};let l=y?[y.kind]:[s.kind],r;if(e.where!==void 0&&e.where!==null){if(!n.schema)return{ok:!1,says:`The place ${b(g)} cannot be narrowed here: it goes nowhere.`};let f=q(n.schema,l,e.where,{through:s!==void 0});if(!f.ok)return{ok:!1,says:`The filter on ${b(g)} goes nowhere: ${f.says}`};r=f.filter}let u=r?{filter:r}:{};return{ok:!0,arrival:y?{place:y.as,...u,...o}:{list:s.kind,...u,...o}}}var _=e=>e.length===0?"":` Its lists: ${e.slice(0,8).map(n=>`"${n}"`).join(", ")}${e.length>8?` and ${e.length-8} more`:""}.`,U="http://www.w3.org/1999/xhtml",H="http://www.w3.org/2000/svg",Z=e=>{let n=e;return n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||e.type==="click"&&typeof n.button=="number"&&n.button!==0};function se(e){let n=new WeakSet,i=new WeakSet,a=new WeakMap,c=new WeakMap,o=t=>V(t,{sees:e.sees,places:e.places(),lists:e.lists?.()??[],...e.schema?{schema:e.schema}:{}}),g=t=>{let d=o(t);return d.ok?e.onNavigate?.(d.arrival):e.onLost?.(d.says),d.ok},y=t=>{let d=t.getAttribute("data-record"),h=t.getAttribute("data-place"),k=t.getAttribute("data-filter"),w=t.getAttribute("data-section"),v={...k?{where:S(k)}:{},...w?{section:w}:{}};if(d)return{record:d,...v};if(h)return{place:h,...v}},s=t=>{if(!e.hrefOf)return;let d=y(t),h=d?o(d):void 0;return h?.ok?e.hrefOf(h.arrival):void 0},l=t=>t.hasAttribute("tabindex")?!1:(t.setAttribute("tabindex","0"),n.add(t),!0),r=t=>{n.delete(t)&&t.removeAttribute("tabindex")},u=t=>{i.delete(t)&&t.getAttribute("role")==="link"&&t.removeAttribute("role")},f=t=>{let d=a.get(t);d&&(a.delete(t),t.getAttribute("href")===d.href&&t.removeAttribute("href"),d.target!==null&&!t.hasAttribute("target")&&t.setAttribute("target",d.target))},p=t=>{let d=c.get(t);d&&(c.delete(t),r(d))},$={link(t){if(!N(t,[...t.querySelectorAll("input, select, textarea")].some(L))){if(!t.hasAttribute("data-graview-link"))return;t.removeAttribute("data-graview-link"),u(t),r(t),f(t),p(t);return}t.hasAttribute("data-graview-link")||t.setAttribute("data-graview-link","");let h=t.localName==="a"&&(t.namespaceURI===U||t.namespaceURI===H),k=t.getAttribute("href"),w=a.get(t),v=k!==null&&w?.href!==k,A=h&&!v?s(t):void 0;if(A!==void 0){k!==A&&t.setAttribute("href",A),a.set(t,{href:A,target:w?w.target:t.getAttribute("target")}),t.removeAttribute("target"),u(t),r(t);return}if(v?a.delete(t):f(t),R(t,t.querySelectorAll("a"))){u(t),r(t),p(t);return}if(!t.hasAttribute("role")&&(h||P(t))&&(t.setAttribute("role","link"),i.add(t)),t.localName==="tr"&&t.namespaceURI===U){r(t);let x=[...t.children].find(j=>j.localName==="td"||j.localName==="th");c.get(t)!==x&&p(t),x&&!c.has(t)&&l(x)&&c.set(t,x);return}t.localName!=="button"&&l(t)},refresh(t){for(let d of t.querySelectorAll("[data-record], [data-place], [data-graview-link]"))$.link(d)},pressed(t,d,h){if(t.type!=="click"&&!(t.type==="keydown"&&t.key==="Enter"))return!1;let k=T(d,h,w=>w.hasAttribute("data-graview-link"));return k?(t.stopPropagation(),a.has(k)&&Z(t)||(t.preventDefault(),$.follow(k)),!0):!1},follow(t){let d=y(t);d&&g(d)},go:g};return $}export{Q as a,M as b,b as c,O as d,S as e,oe as f,V as g,se as h};
@@ -1 +1 @@
1
- import{a as O,b}from"./chunk.RBYRT2I2.js";import"./chunk.JTOAZ2IR.js";import"./chunk.3IEJQAK7.js";import"./chunk.AKLVSZ5A.js";import"./chunk.ZUBC3UFG.js";import"./chunk.FWZF7X6A.js";import"./chunk.3JMZHCB4.js";import{G as z,T as M,ba as S}from"./chunk.SF4BYBH6.js";import"./chunk.SDO3U72B.js";import{$c as A}from"./chunk.3MZIWKNG.js";import"./chunk.SLBWPVIY.js";import{b as v}from"./chunk.AJZBJBMO.js";var o=v(z(),1);var t=v(M(),1);function G(i){for(let d of i)for(let[r,s]of Object.entries(d))if(s===!1)return`${r} == true`;return""}var w={margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function $({ask:i,close:d}){let{store:r,principal:s,subscriptions:h,app:f}=S(),c=(0,o.useRef)(null),p=(0,o.useId)(),[n,u]=(0,o.useState)(0),[l,y]=(0,o.useState)(!0),[m,P]=(0,o.useState)(()=>{let e=i.choices.find(g=>g.on==="reaches");if(!e)return"";let a=e.record!==void 0?r.graph.getNode(e.record):void 0;return G(a?[a]:r.graph.nodesOfKind(e.kind).slice(0,5))}),[C,x]=(0,o.useState)(null),[W,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=c.current;e&&!e.open&&e.showModal()},[]);let T=()=>{let e=i.returnTo;d(),requestAnimationFrame(()=>{e?.isConnected?e.focus():document.querySelector("[data-graview-page-title], main h1, [data-testid='activity-button']")?.focus()})},N=e=>e.on==="reaches"?{...e,condition:m}:e,E=e=>b(r,{when:N(e),alsoMine:!l}),L=async()=>{let e=N(i.choices[n]),a=O(r,e);if(a){x(a);return}k(!0);try{await h.add({who:A(s),app:f?.name??"app",when:e,...l?{}:{alsoMine:!0}}),T()}catch(g){k(!1),x(g instanceof Error?g.message:String(g))}};return(0,t.jsx)("dialog",{ref:c,"aria-labelledby":p,"data-testid":"notify-sheet",onClose:T,onClick:e=>{e.target===e.currentTarget&&e.currentTarget.close()},style:{width:"min(92vw, 420px)",padding:0,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)"},children:(0,t.jsxs)("form",{method:"dialog",onSubmit:e=>{e.preventDefault(),L()},style:{display:"grid",gap:12,padding:18},children:[(0,t.jsx)("h2",{id:p,style:{margin:0,fontSize:"1.0625rem"},children:"Notify me"}),(0,t.jsxs)("fieldset",{style:{margin:0,padding:0,border:0,display:"grid",gap:6},children:[(0,t.jsx)("legend",{style:{...w,marginBottom:6},children:"Tell me"}),i.choices.map((e,a)=>(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"baseline",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"radio",name:`${p}-when`,checked:n===a,onChange:()=>u(a),"data-notify-choice":e.on}),(0,t.jsx)("span",{children:e.on==="reaches"?`When ${e.record!==void 0?"it":"one"} reaches a condition`:E(e)})]},a))]}),i.choices[n]?.on==="reaches"?(0,t.jsxs)("label",{style:{display:"grid",gap:4},children:[(0,t.jsx)("span",{style:w,children:"The condition, in the app's own words (done == true, amount > 100)"}),(0,t.jsx)("input",{value:m,onChange:e=>P(e.target.value),"data-testid":"notify-condition",autoComplete:"off",spellCheck:!1})]}):null,(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:e=>y(e.target.checked),"data-testid":"notify-others-only"}),"Only when someone else does it"]}),(0,t.jsxs)("p",{style:w,"data-testid":"notify-said",children:[E(i.choices[n]),"."]}),C?(0,t.jsx)("p",{role:"alert",style:{margin:0,color:"var(--graview-danger, var(--graview-ink))"},children:C}):null,(0,t.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>c.current?.close(),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",autoFocus:!0,disabled:W,"data-testid":"notify-keep",style:{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"},children:"Notify me"})]})]})})}function j({style:i}){let{store:d,principal:r,subscriptions:s,app:h}=S(),f=(r.onBehalfOf??r).id,[c,p]=(0,o.useState)([]);return(0,o.useEffect)(()=>{if(f===void 0)return;let n=!0,u=()=>void Promise.resolve(s.list(f)).then(y=>n&&p(y.filter(m=>m.app===(h?.name??"app"))),()=>n&&p([]));u();let l=s.onChange?.(u);return()=>{n=!1,l?.()}},[s,f,h]),c.length===0?null:(0,t.jsxs)("section",{"aria-label":"What you are told of","data-testid":"notified",style:{display:"grid",gap:6,...i},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"You are told"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:c.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"baseline",justifyContent:"space-between"},"data-subscription":n.id,children:[(0,t.jsx)("span",{style:{fontSize:"0.8125rem"},children:b(d,n)}),(0,t.jsx)("button",{type:"button","data-testid":"notify-stop","aria-label":`Stop: ${b(d,n)}`,onClick:u=>{let l=u.currentTarget.closest("li"),y=(l?.nextElementSibling??l?.previousElementSibling)?.querySelector("button");Promise.resolve(s.remove(n.id)).then(()=>(y??document.querySelector("[data-testid='activity-button']"))?.focus())},style:{padding:"1px 8px",fontSize:"0.8125rem"},children:"Stop"})]},n.id))})]})}export{j as NotifiedList,$ as NotifySheet};
1
+ import{a as O,b}from"./chunk.2HZGUVB2.js";import"./chunk.MJMVGW6Z.js";import"./chunk.6HLKAUWF.js";import"./chunk.FCUDBMGC.js";import"./chunk.KMEKMCKG.js";import"./chunk.HFVMGTNL.js";import"./chunk.7Z4USR3Y.js";import{G as z,T as M,ba as S}from"./chunk.NPAWTPLQ.js";import"./chunk.SDO3U72B.js";import{ed as A}from"./chunk.YEJ4LNUP.js";import"./chunk.FQLNBIQ5.js";import{b as v}from"./chunk.AJZBJBMO.js";var o=v(z(),1);var t=v(M(),1);function G(i){for(let d of i)for(let[r,s]of Object.entries(d))if(s===!1)return`${r} == true`;return""}var w={margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function $({ask:i,close:d}){let{store:r,principal:s,subscriptions:h,app:f}=S(),c=(0,o.useRef)(null),p=(0,o.useId)(),[n,u]=(0,o.useState)(0),[l,y]=(0,o.useState)(!0),[m,P]=(0,o.useState)(()=>{let e=i.choices.find(g=>g.on==="reaches");if(!e)return"";let a=e.record!==void 0?r.graph.getNode(e.record):void 0;return G(a?[a]:r.graph.nodesOfKind(e.kind).slice(0,5))}),[C,x]=(0,o.useState)(null),[W,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=c.current;e&&!e.open&&e.showModal()},[]);let T=()=>{let e=i.returnTo;d(),requestAnimationFrame(()=>{e?.isConnected?e.focus():document.querySelector("[data-graview-page-title], main h1, [data-testid='activity-button']")?.focus()})},N=e=>e.on==="reaches"?{...e,condition:m}:e,E=e=>b(r,{when:N(e),alsoMine:!l}),L=async()=>{let e=N(i.choices[n]),a=O(r,e);if(a){x(a);return}k(!0);try{await h.add({who:A(s),app:f?.name??"app",when:e,...l?{}:{alsoMine:!0}}),T()}catch(g){k(!1),x(g instanceof Error?g.message:String(g))}};return(0,t.jsx)("dialog",{ref:c,"aria-labelledby":p,"data-testid":"notify-sheet",onClose:T,onClick:e=>{e.target===e.currentTarget&&e.currentTarget.close()},style:{width:"min(92vw, 420px)",padding:0,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)"},children:(0,t.jsxs)("form",{method:"dialog",onSubmit:e=>{e.preventDefault(),L()},style:{display:"grid",gap:12,padding:18},children:[(0,t.jsx)("h2",{id:p,style:{margin:0,fontSize:"1.0625rem"},children:"Notify me"}),(0,t.jsxs)("fieldset",{style:{margin:0,padding:0,border:0,display:"grid",gap:6},children:[(0,t.jsx)("legend",{style:{...w,marginBottom:6},children:"Tell me"}),i.choices.map((e,a)=>(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"baseline",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"radio",name:`${p}-when`,checked:n===a,onChange:()=>u(a),"data-notify-choice":e.on}),(0,t.jsx)("span",{children:e.on==="reaches"?`When ${e.record!==void 0?"it":"one"} reaches a condition`:E(e)})]},a))]}),i.choices[n]?.on==="reaches"?(0,t.jsxs)("label",{style:{display:"grid",gap:4},children:[(0,t.jsx)("span",{style:w,children:"The condition, in the app's own words (done == true, amount > 100)"}),(0,t.jsx)("input",{value:m,onChange:e=>P(e.target.value),"data-testid":"notify-condition",autoComplete:"off",spellCheck:!1})]}):null,(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:e=>y(e.target.checked),"data-testid":"notify-others-only"}),"Only when someone else does it"]}),(0,t.jsxs)("p",{style:w,"data-testid":"notify-said",children:[E(i.choices[n]),"."]}),C?(0,t.jsx)("p",{role:"alert",style:{margin:0,color:"var(--graview-danger, var(--graview-ink))"},children:C}):null,(0,t.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>c.current?.close(),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",autoFocus:!0,disabled:W,"data-testid":"notify-keep",style:{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"},children:"Notify me"})]})]})})}function j({style:i}){let{store:d,principal:r,subscriptions:s,app:h}=S(),f=(r.onBehalfOf??r).id,[c,p]=(0,o.useState)([]);return(0,o.useEffect)(()=>{if(f===void 0)return;let n=!0,u=()=>void Promise.resolve(s.list(f)).then(y=>n&&p(y.filter(m=>m.app===(h?.name??"app"))),()=>n&&p([]));u();let l=s.onChange?.(u);return()=>{n=!1,l?.()}},[s,f,h]),c.length===0?null:(0,t.jsxs)("section",{"aria-label":"What you are told of","data-testid":"notified",style:{display:"grid",gap:6,...i},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"You are told"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:c.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"baseline",justifyContent:"space-between"},"data-subscription":n.id,children:[(0,t.jsx)("span",{style:{fontSize:"0.8125rem"},children:b(d,n)}),(0,t.jsx)("button",{type:"button","data-testid":"notify-stop","aria-label":`Stop: ${b(d,n)}`,onClick:u=>{let l=u.currentTarget.closest("li"),y=(l?.nextElementSibling??l?.previousElementSibling)?.querySelector("button");Promise.resolve(s.remove(n.id)).then(()=>(y??document.querySelector("[data-testid='activity-button']"))?.focus())},style:{padding:"1px 8px",fontSize:"0.8125rem"},children:"Stop"})]},n.id))})]})}export{j as NotifiedList,$ as NotifySheet};
@@ -1 +1 @@
1
- import{A as S,G,l as O,y as v,z as C}from"./chunk.FWZF7X6A.js";import{G as I,ba as m,c as V,j as y,l as p,m as g,n as u,o as D,v as B,z as E}from"./chunk.SF4BYBH6.js";import{ia as M,qd as P,rd as k,td as R,ud as T}from"./chunk.3MZIWKNG.js";import{b as A}from"./chunk.AJZBJBMO.js";var W=A(I(),1);function j(e,t){try{t.length===0?localStorage.removeItem(v(e)):localStorage.setItem(v(e),JSON.stringify(t))}catch{}}function F(e,t){j(e,[...S(e).filter(n=>n.title!==t.title),t])}function H(e,t){j(e,S(e).filter(n=>n.title!==t))}function J(e,t){for(let n of e.places().filter(o=>o.title===t))e.forget?.(n.kind,n.as)}var U=e=>e===!0?{written:!0}:typeof e=="object"&&e!==null?{written:e.kept===!0,...e.said?{said:e.said}:{}}:{written:!1},N=e=>({title:e.title,lens:e.lens,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}});function Z(e,t){let n=o=>t.some(r=>r.title===o||r.as===P(o));if(!n(e))return e;for(let o=2;;o++)if(!n(`${e} ${o}`))return`${e} ${o}`}function ie(e){let{store:t,views:n,brand:o,seatTalk:r,onKeepLens:d}=m(),h=(0,W.useContext)(O),L=C(o,t.schema),b=async f=>{let{edit:i}=f;if(f.written&&d)try{await d({op:"remove-lens",title:i.title,on:i.on})}catch{}H(L,i.title),J(n,i.title),h?.dismiss(`kept:${i.title}`),r.setTurns(l=>[...l.map(s=>s.kept&&s.kept.edit.title===i.title&&!s.kept.taken?{...s,kept:{...s.kept,taken:!0}}:s),{role:"seat",text:`Took \u201C${i.title}\u201D back out of the places.`}]);let a=M(t.schema,i.on);e({to:"kind",kind:i.on,title:a,address:k(t.schema,i.on),said:`Went to ${a}.`})};return{keep:async f=>{let i=Z(f.edit.title,n.places()),a={...f.edit,title:i},l=!1,s;if(d)try{({written:l,said:s}=U(await d(a)))}catch{l=!1}l||F(L,N(a)),G(n,t.schema,[N(a)]);let K=n.places(),c=K.find(w=>w.title===i),x=s??(l?`Kept \u201C${i}\u201D as a lens: it is in the places now.`:d?`Kept \u201C${i}\u201D as your own lens. Ask the owner to keep it for everyone.`:`Kept \u201C${i}\u201D as your own lens.`),$={edit:a,written:l};r.setDraft(null),r.setTurns(w=>[...w,{role:"seat",text:x,kept:$}]),h?.notify({kind:"toast",id:`kept:${i}`,sentence:x,timeout:1e4,action:{label:"Take back",onSelect:()=>void b($)}}),c&&e({to:"picture",kind:c.kind,as:c.as,title:i,address:R(c.as,T(c,K)?k(t.schema,c.kind).slice(1):void 0),said:`Went to ${i}.`})},takeBack:b}}var q=A(I(),1);function _(e,t){switch(t.to){case"place":return{view:V("#")};case"picture":return{view:u(E(p(e,"filter",null),t.kind,t.as),[])};case"kind":{let n=D(g({...y(e,B(t.kind)),relation:null},!1),!0);return{view:u(p(p(n,"view",null),"filter",t.filter??null),[])}}case"record":return{view:u(y(g(p(p(e,"view",null),"filter",null),!1),t.id),[t.id])};case"problems":return{pane:"problems"}}}function z(e){let t=typeof document>"u"?null:document.querySelector('[data-testid="standing"]');t&&t.getAttribute("aria-expanded")==="true"!==e&&t.click()}function ae(){let{setView:e,seatTalk:t}=m();return(0,q.useCallback)(n=>{t.get().draft&&t.setDraft(null),z(n.to==="problems"),n.to!=="problems"&&e(o=>{let r=_(o,n);return"view"in r?r.view:o})},[e,t])}export{ie as a,z as b,ae as c};
1
+ import{A as S,G,l as O,y as v,z as C}from"./chunk.HFVMGTNL.js";import{G as I,ba as m,c as V,j as y,l as p,m as g,n as u,o as D,v as B,z as E}from"./chunk.NPAWTPLQ.js";import{Bd as R,Cd as T,ka as M,yd as P,zd as k}from"./chunk.YEJ4LNUP.js";import{b as A}from"./chunk.AJZBJBMO.js";var W=A(I(),1);function j(e,t){try{t.length===0?localStorage.removeItem(v(e)):localStorage.setItem(v(e),JSON.stringify(t))}catch{}}function F(e,t){j(e,[...S(e).filter(n=>n.title!==t.title),t])}function H(e,t){j(e,S(e).filter(n=>n.title!==t))}function J(e,t){for(let n of e.places().filter(o=>o.title===t))e.forget?.(n.kind,n.as)}var U=e=>e===!0?{written:!0}:typeof e=="object"&&e!==null?{written:e.kept===!0,...e.said?{said:e.said}:{}}:{written:!1},N=e=>({title:e.title,lens:e.lens,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}});function Z(e,t){let n=o=>t.some(r=>r.title===o||r.as===P(o));if(!n(e))return e;for(let o=2;;o++)if(!n(`${e} ${o}`))return`${e} ${o}`}function ie(e){let{store:t,views:n,brand:o,seatTalk:r,onKeepLens:d}=m(),h=(0,W.useContext)(O),L=C(o,t.schema),b=async f=>{let{edit:i}=f;if(f.written&&d)try{await d({op:"remove-lens",title:i.title,on:i.on})}catch{}H(L,i.title),J(n,i.title),h?.dismiss(`kept:${i.title}`),r.setTurns(l=>[...l.map(s=>s.kept&&s.kept.edit.title===i.title&&!s.kept.taken?{...s,kept:{...s.kept,taken:!0}}:s),{role:"seat",text:`Took \u201C${i.title}\u201D back out of the places.`}]);let a=M(t.schema,i.on);e({to:"kind",kind:i.on,title:a,address:k(t.schema,i.on),said:`Went to ${a}.`})};return{keep:async f=>{let i=Z(f.edit.title,n.places()),a={...f.edit,title:i},l=!1,s;if(d)try{({written:l,said:s}=U(await d(a)))}catch{l=!1}l||F(L,N(a)),G(n,t.schema,[N(a)]);let K=n.places(),c=K.find(w=>w.title===i),x=s??(l?`Kept \u201C${i}\u201D as a lens: it is in the places now.`:d?`Kept \u201C${i}\u201D as your own lens. Ask the owner to keep it for everyone.`:`Kept \u201C${i}\u201D as your own lens.`),$={edit:a,written:l};r.setDraft(null),r.setTurns(w=>[...w,{role:"seat",text:x,kept:$}]),h?.notify({kind:"toast",id:`kept:${i}`,sentence:x,timeout:1e4,action:{label:"Take back",onSelect:()=>void b($)}}),c&&e({to:"picture",kind:c.kind,as:c.as,title:i,address:R(c.as,T(c,K)?k(t.schema,c.kind).slice(1):void 0),said:`Went to ${i}.`})},takeBack:b}}var q=A(I(),1);function _(e,t){switch(t.to){case"place":return{view:V("#")};case"picture":return{view:u(E(p(e,"filter",null),t.kind,t.as),[])};case"kind":{let n=D(g({...y(e,B(t.kind)),relation:null},!1),!0);return{view:u(p(p(n,"view",null),"filter",t.filter??null),[])}}case"record":return{view:u(y(g(p(p(e,"view",null),"filter",null),!1),t.id),[t.id])};case"problems":return{pane:"problems"}}}function z(e){let t=typeof document>"u"?null:document.querySelector('[data-testid="standing"]');t&&t.getAttribute("aria-expanded")==="true"!==e&&t.click()}function ae(){let{setView:e,seatTalk:t}=m();return(0,q.useCallback)(n=>{t.get().draft&&t.setDraft(null),z(n.to==="problems"),n.to!=="problems"&&e(o=>{let r=_(o,n);return"view"in r?r.view:o})},[e,t])}export{ie as a,z as b,ae as c};
@@ -0,0 +1 @@
1
+ import{h,i as E}from"./chunk.DPPT6WAJ.js";import{a as M,f as z}from"./chunk.7U2JO7ET.js";import{$b as q,Aa as j,C as y,Ha as O,Qb as N,Sa as P,Ta as D,Xc as K,Yc as k,Zb as T,_b as Z,ac as v,da as S,db as L,tb as V,ub as I,vb as g,xa as R}from"./chunk.YEJ4LNUP.js";var J=n=>n.safeParse?.(void 0).success??!1,C=n=>h(n).shape,A=n=>{let r=h(n);if(y(r)?.type!=="literal")return;let o=y(r)?.values;return o&&o.length===1&&typeof o[0]=="string"?o[0]:void 0};function F(n,r){let o=J(r),e=h(r),t=y(e)?.type,c=N(r);if(c)return{control:"node",name:n,optional:o,kinds:c};let m=O(r);if(m)return{control:"linked",name:n,optional:o,relation:m};if(D(r)){let d=P(n);return{control:"repeat",name:n,optional:o,...d?{of:d}:{}}}if(t==="boolean")return{control:"boolean",name:n,optional:o};let f=R(e);if(f)return{control:"file",name:n,optional:o,...f==="image"?{image:!0}:f==="video"?{video:!0}:{}};if(t==="object"){let d=e.shape??{};return{control:"group",name:n,optional:o,fields:Object.entries(d).map(([a,l])=>F(a,l))}}if(t==="union"){let d=y(e)?.options??[],a=d.map(s=>C(s));if(a.every(s=>s!==void 0)){let s=Object.keys(a[0]??{}).find(u=>a.every(p=>A(p?.[u])!==void 0));if(s)return{control:"variant",name:n,optional:o,tag:s,options:d.map((u,p)=>({value:A(a[p]?.[s])??"",fields:Object.entries(a[p]??{}).filter(([w])=>w!==s).map(([w,B])=>F(w,B))}))}}let l=d.map(s=>A(s));return l.every(s=>s!==void 0)?{control:"choice",name:n,optional:o,options:l}:{control:"opaque",name:n,optional:o}}if(t==="array"){let d=y(e)?.element;return d!==void 0?{control:"list",name:n,optional:o,item:F(n,d)}:{control:"opaque",name:n,optional:o}}let i=E(r);return i.type==="text"?{control:"text",name:n,optional:o,...i.long?{long:!0}:{},...j(e)?{app:!0}:{},...M(e)?{markdown:!0}:{},...i.holds?{holds:i.holds}:{}}:i.type==="number"&&i.duration?{control:"text",name:n,optional:o,holds:"duration"}:i.type==="date"?{control:"date",name:n,optional:o,...i.time?{time:!0}:{},...i.instant?{instant:!0}:{},...i.partial?{partial:!0}:{}}:i.type==="number"?{control:"number",name:n,optional:o,...i.min===void 0?{}:{min:i.min},...i.max===void 0?{}:{max:i.max},...i.step===void 0?{}:{step:i.step},...i.amount?{amount:i.amount}:{}}:i.type==="choice"?{control:"choice",name:n,optional:o,options:i.options}:{control:"opaque",name:n,optional:o}}function H(n){let r=n.shape;return r?Object.entries(r).map(([o,e])=>F(o,e)):[]}function W(n,r){let o={...r};for(let e of n){let t=r[e.name];t===void 0&&!e.optional&&(e.control==="list"||e.control==="boolean")&&(o[e.name]=e.control==="list"?[]:!1),e.control==="text"&&e.holds&&typeof t=="string"&&(o[e.name]=t.trim()===""?void 0:e.holds==="duration"?z(t)??t:t.trim()),e.control==="group"&&t!==void 0&&typeof t=="object"&&t!==null&&(o[e.name]=W(e.fields,t))}return o}function G(n,r){return Z(H(r.input),T(n,r))}var x="visitor";function gn(n,r,o,e){let t=K.keptFrom?.(n,r),c=new Set;if(!t)return c;let m=Object.keys(o.input.shape??{});for(let a of o.creates??[]){let l=t({id:"\0new",kind:a});for(let s of m)l?.(s)&&c.add(s)}let f=e===void 0?void 0:n.graph.getNode(e),i=f&&n.schema.tryDefinition(f.kind),d=f&&t(f);if(i&&d)for(let a of v(o,i))d(a)&&m.includes(a)&&c.add(a);return c}function _(n,r,o,e){let t=new Set,c=r?.sees??[];if(I(o)||!c.some(k))return t;let m=V(o),f=(l,s)=>{let u=c.filter(p=>p.kinds.includes(l)&&g(p,m));return u.some(k)?L.has(s)||u.some(p=>!k(p)||(p.fields===void 0||p.fields.includes(s))&&!p.hide?.includes(s)):!0},i=Object.keys(e.input.shape??{}),d=new Map,a=(l,s)=>d.set(l,d.get(l)===!0||s);for(let l of e.creates??[]){let s=Object.keys(n.tryDefinition(l)?.fields.shape??{});for(let u of i)s.includes(u)&&a(u,f(l,u))}for(let l of q(n,e)){let s=n.tryDefinition(l);if(s)for(let u of v(e,s))i.includes(u)&&a(u,f(l,u))}for(let[l,s]of d)s||t.add(l);return t}var $=(n,r)=>r.title??S(n);function Q(n,r,o){let e=n?.sees;return!e||e.length===0?!0:e.some(t=>t.kinds.includes(o)&&g(t,r)&&!t.own&&!t.via)}function b(n){switch(n.control){case"node":return[n];case"group":return n.fields.flatMap(b);case"variant":return n.options.flatMap(r=>r.fields.flatMap(b));case"list":return b(n.item);default:return[]}}function U(n,r,o,e){return e.has(o.name)?!1:b(o).every(t=>t.kinds.some(c=>c!=="*"&&Q(n,r,c)))}var X=n=>({kind:"human",id:"form:",roles:[n]});function vn(n,r,o=n.mutations??[]){let e=n.forms?.[r];if(!e)return;let t=o.find(a=>a.name===e.act);if(!t)return;let c=e.role??x,m=X(c),f=_(n.schema,n.policy,m,t),i=G(n.schema,t),d=e.fields?e.fields.flatMap(a=>i.find(l=>l.name===a)??[]):i.filter(a=>U(n.policy,m,a,f));return{name:r,title:$(r,e),...e.intro?{intro:e.intro}:{},...e.say?{say:e.say}:{},submit:e.submit??t.title??S(t.name),role:c,act:t,fields:d}}function An(n,r,o){let e=n.forms?.[r];if(!e)throw new Error(`There is no form called "${r}"${n.forms?`: the forms are ${Object.keys(n.forms).join(", ")}`:": the app declares none"}.`);return{kind:"visitor",id:o,name:`a visitor via the ${$(r,e)} form`,roles:[e.role??x]}}function xn(n){return{said:"Received \u2014 thank you.",...n.say?{next:n.say}:{}}}export{H as a,W as b,G as c,gn as d,_ as e,vn as f,An as g,xn as h};
@@ -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{a as te}from"./chunk.ONGZ3YQF.js";import{o as Se,p as ee,s as $,t as be}from"./chunk.E5XNQTEU.js";import{m as J,n as ye,o as we,p as X,q as Z}from"./chunk.OJGHDWI6.js";import{c as ke}from"./chunk.7U2JO7ET.js";import{a as he,b as U,c as j,e as ve,l as Me}from"./chunk.HFVMGTNL.js";import{b as de}from"./chunk.7Z4USR3Y.js";import{D as z,Ea as fe,F as Y,Fa as ge,G as O,Ga as T,J as pe,Ma as _,O as me,Oa as F,T as M,ba as A,ca as q,da as B,m as le,v as ce,z as ue}from"./chunk.NPAWTPLQ.js";import{a as E}from"./chunk.SDO3U72B.js";import{Qc as ie,Vc as ae,ka as H,td as se}from"./chunk.YEJ4LNUP.js";import{b as y}from"./chunk.AJZBJBMO.js";var P=y(O(),1),x=y(M(),1),ne=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.2YNZVNCA.js")))),xe=ne.part(t=>(0,x.jsx)(t.HoverChipDoor,{}),{quiet:!0}),De="A",Q=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.3X3GLNWQ.js","./chunk.644FUGSX.js","./chunk.AQCU6TPV.js","./chunk.EC5IWN74.js","./chunk.MORMTKVR.js","./chunk.PJCVFYFU.js","./chunk.7RJGEU3Y.js","./chunk.HJCQ6I3S.js","./chunk.7O6Z3BFR.js","./chunk.I2C5LPB5.js","./chunk.6Q6BW4QT.js","./chunk.AKVBU5K5.js","./chunk.LLOZKUCA.js","./chunk.DH7M57SE.js","./chunk.CKV2QCH5.js","./chunk.TAJ2R44N.js","./chunk.64IKLRUS.js","./chunk.DTSTUC2W.js","./chunk.RDL6652E.js","./chunk.V3NPUAPB.js","./chunk.USQNSNIA.js","./chunk.XOZU4OFA.js","./chunk.IT763BYH.js","./chunk.7ECBGIUK.js","./chunk.UQQAGT3R.js","./chunk.T2RME6XF.js","./chunk.SOTB6C5A.js","./chunk.TQCRFZ53.js","./chunk.6HLKAUWF.js","./chunk.FCUDBMGC.js","./chunk.KMEKMCKG.js","./chunk.E5XNQTEU.js","./chunk.OJGHDWI6.js","./chunk.K5YLQAFW.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.QNNRSPIJ.js"))));var Ce=Q.part((t,e)=>(0,x.jsx)(t.InspectorPane,{...e}),{what:"This card's acts"});function Le(t){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&t()},n=globalThis;if(n.requestIdleCallback){let c=n.requestIdleCallback(e,{timeout:5e3});return()=>n.cancelIdleCallback?.(c)}let i=setTimeout(e,2500);return()=>clearTimeout(i)}var Oe=150,Ne="[data-graview-pick], [data-graview-view], [data-graview-record], [data-graview-act], [data-graview-field], a[href]";function Re(t){if(t.closest("[data-graview-face='pages'], [data-graview-popover]"))return null;let e=t.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??t.closest("[data-graview-view]")?.getAttribute("data-graview-view");return e?{face:"scene",on:e,about:[e]}:null}function We(t){let{store:e,principal:n,providers:i,ai:c}=A(),p=be(),h=Y(c),r=(0,P.useRef)({aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h});r.current={aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h},(0,P.useEffect)(()=>{if(typeof document>"u")return;let u=null,w=null,k=null,l=g=>{let m=r.current,b=m.chipsOn?m.aimAt(g):null;b&&(k=g,ne.load().then(G=>{k===g&&G.restOn(b,g)},()=>{}))},f=()=>{u&&clearTimeout(u.timer),u=null},s=g=>{let m=r.current,b=m.aimAt(g);if(!b)return;let G=JSON.stringify([b.face,b.on,b.about,b.field,b.place,b.act,m.store.log.length]);G!==w&&(w=G,m.prepareSections(b),Q.load().then(Pe=>Pe.prepareActs(m.store,b,{principal:m.principal,providers:m.providers}),()=>{}))},o=g=>g.target instanceof Element?g.target.closest(Ne):null,d=g=>{if(g.pointerType==="touch")return;let m=o(g);m!==null&&m===u?.element||(f(),m!==null&&(u={element:m,timer:setTimeout(()=>{u=null,s(m),l(m)},Oe)}))},v=g=>{let m=g.relatedTarget;k!==null&&!(m instanceof Node&&k.contains(m))&&(k=null,ne.current?.leaveRest()),u!==null&&(m instanceof Node&&u.element.contains(m)||f())},S=g=>{if(g.pointerType==="mouse")return;let m=o(g);m&&s(m)},I=g=>{if(!fe())return;let m=o(g);m&&s(m)};return document.addEventListener("pointerover",d,{passive:!0}),document.addEventListener("pointerout",v,{passive:!0}),document.addEventListener("pointerdown",S,{capture:!0,passive:!0}),document.addEventListener("focusin",I),()=>{f(),document.removeEventListener("pointerover",d),document.removeEventListener("pointerout",v),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("focusin",I)}},[])}function it({placement:t="float",openActs:e,aimAt:n}={}){let{menuAt:i,setMenuAt:c,registerActsDoor:p,ai:h}=A(),{selection:r}=_();We(n??Re),(0,P.useEffect)(()=>{if(Q.current)return;let f=()=>{v(),Q.prefetch()},s=()=>{},o=ge(()=>void(s=Le(f))),d=["pointerdown","keydown"];for(let S of d)document.addEventListener(S,f,{capture:!0,passive:!0});function v(){o(),s();for(let S of d)document.removeEventListener(S,f,{capture:!0})}return v},[]),(0,P.useEffect)(()=>{if(t==="menu")return p({key:De,open:e??(f=>{let s=f.getBoundingClientRect(),o=f.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??f.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;c({x:Math.round(s.left+Math.min(16,s.width/2)),y:Math.round(Math.min(s.bottom,s.top+36)),...o?{on:o}:{}})})}),()=>p(null)},[t,p,c,e]);let u=i!==null||r.length>0&&e===void 0,[w,k]=(0,P.useState)(u);(0,P.useEffect)(()=>{u&&k(!0)},[u]);let l=Y(h)?(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(xe,{})}):null;return!w&&!u?l:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(Ce,{placement:t,chosen:e===void 0})}),l]})}var K=y(O(),1),V=y(M(),1),Ge=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.3X3GLNWQ.js","./chunk.25VJPUDH.js","./chunk.644FUGSX.js","./chunk.AQCU6TPV.js","./chunk.IRMO4FUC.js","./chunk.WPJVMVAL.js","./chunk.VYW7DSUW.js","./chunk.LKK7VQBA.js","./chunk.EC5IWN74.js","./chunk.RR2IFETZ.js","./chunk.ONGZ3YQF.js","./chunk.XGCOWCA2.js","./chunk.MORMTKVR.js","./chunk.CU2NQ5WF.js","./chunk.E33EJU3Q.js","./chunk.PJCVFYFU.js","./chunk.7RJGEU3Y.js","./chunk.HJCQ6I3S.js","./chunk.7O6Z3BFR.js","./chunk.I2C5LPB5.js","./chunk.6Q6BW4QT.js","./chunk.AKVBU5K5.js","./chunk.LLOZKUCA.js","./chunk.DH7M57SE.js","./chunk.AIK3Z25Y.js","./chunk.CKV2QCH5.js","./chunk.BT7RLFPO.js","./chunk.TAJ2R44N.js","./chunk.VLBY66PB.js","./chunk.64IKLRUS.js","./chunk.DTSTUC2W.js","./chunk.RDL6652E.js","./chunk.V3NPUAPB.js","./chunk.USQNSNIA.js","./chunk.XOZU4OFA.js","./chunk.IT763BYH.js","./chunk.7ECBGIUK.js","./chunk.UQQAGT3R.js","./chunk.WVUJXDXZ.js","./chunk.T2RME6XF.js","./chunk.SOTB6C5A.js","./chunk.TQCRFZ53.js","./chunk.6HLKAUWF.js","./chunk.FCUDBMGC.js","./chunk.KMEKMCKG.js","./chunk.GZHZLJBF.js","./chunk.E5XNQTEU.js","./chunk.OJGHDWI6.js","./chunk.K5YLQAFW.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.5MS2TQFX.js")))),He=Ge.part((t,e)=>{let n=t.DraftFrame;return(0,V.jsx)(n,{...e})},{what:"The view"});function ct(t){let{seatTalk:e}=A();return(0,K.useSyncExternalStore)(e.subscribe,()=>e.get().draft!==null,()=>!1)?(0,V.jsx)(K.Suspense,{fallback:null,children:(0,V.jsx)(He,{...t})}):null}var C=y(O(),1),D=y(M(),1),Ae=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.7RJGEU3Y.js","./chunk.4EY6WPSM.js","./chunk.BJUUSIQY.js","./chunk.RDL6652E.js","./chunk.V3NPUAPB.js","./chunk.USQNSNIA.js","./chunk.XOZU4OFA.js","./chunk.IT763BYH.js","./chunk.JZDKHWRL.js","./chunk.SOTB6C5A.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.NQ4VGKEC.js")))),ze=Ae.part((t,e)=>{let n=t.QuickAskCard;return(0,D.jsx)(n,{...e})},{what:"The quick ask"});function gt({face:t,on:e=!0}){let{ai:n,aiDesk:i,selection:c,view:p}=A(),h=me()?.open??!1,r=e&&z(n)&&!h,u=ve(i),w=(0,C.useRef)(null),k=(0,C.useRef)({selection:c,place:p.within?.view});return k.current={selection:c,place:p.within?.view},(0,C.useEffect)(()=>{if(!r)return;let l=he(i);return l.drawn+=1,U(l),()=>{l.drawn=Math.max(0,l.drawn-1),l.drawn===0&&(l.open=null),U(l)}},[r,i]),(0,C.useEffect)(()=>{if(!r)return;let l=f=>{if(f.defaultPrevented||f.key.toLowerCase()!=="k"||!(f.metaKey||f.ctrlKey)||f.altKey||f.shiftKey)return;let s=w.current?.closest("[data-graview-embed]"),o=f.target,d=!(o instanceof Node)||o===document.body||o===document.documentElement;if(s&&!(d||o instanceof Node&&s.contains(o)))return;f.preventDefault(),Ae.prefetch();let v=document.activeElement,{selection:S,place:I}=k.current;j(i,{pointed:{...S[0]!==void 0?{on:S[0]}:{},about:S,...I?{place:I}:{}},returnTo:v instanceof HTMLElement&&v!==document.body?v:null})};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[r,i]),r?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("span",{ref:w,hidden:!0,"data-graview-quick-ask":t}),u?(0,D.jsx)(C.Suspense,{fallback:null,children:(0,D.jsx)(ze,{face:t,opening:u,close:()=>j(i,null)},u.at)}):null]}):null}var R=y(O(),1),L=y(M(),1),oe=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.4EY6WPSM.js","./chunk.BJUUSIQY.js","./chunk.RDL6652E.js","./chunk.V3NPUAPB.js","./chunk.USQNSNIA.js","./chunk.XOZU4OFA.js","./chunk.IT763BYH.js","./chunk.JZDKHWRL.js","./chunk.SOTB6C5A.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.VIQ6EF2O.js")))),qe=oe.part((t,e)=>{let n=t.InlineAiMenu;return(0,L.jsx)(n,{...e})},{what:"The AI's suggestions"}),Be=oe.part((t,e)=>{let n=t.GhostTray;return(0,L.jsx)(n,{...e})},{quiet:!0});function _e(){let{ai:t}=A(),e=z(t);return(0,R.useMemo)(()=>e?n=>({id:"inline-ai",heading:"AI",render:i=>(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(qe,{target:n,close:i})}),prepare:()=>oe.prefetch()}):null,[e])}var Fe=[];function St({children:t}){let e=_e(),n=(0,R.useMemo)(()=>e?[e]:Fe,[e]);return(0,L.jsx)($,{sections:n,children:t})}function bt(t){let{ai:e,aiDesk:n}=A(),{ghost:i}=pe(n);return i===null||i.onCard||e.off?null:(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(Be,{...t})})}var N=y(O(),1);var Te=y(M(),1),Qe=t=>globalThis[Symbol.for("graview.shown-lists")]?.get(t),Ee=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.BNEOLRQG.js"))));function Ve(t){let e=t.about[0];if(t.about.length!==1||!e?.startsWith("aggregate:"))return;let n=e.slice(10).split("+");return n.length===1?n[0]:void 0}function Ke(t,e){return t.filter(n=>n.as!==e.as&&!n.hidden&&(n.kind===e.kind||n.over?.includes(e.kind)===!0)).at(-1)}function Ye(t){let e=q(),n=e?.keptViews,i=e?.views,c=(0,N.useContext)(Me);return(0,N.useMemo)(()=>i?p=>{let h=n?.current(),r=Ve(p),u=s=>s.length>0?{id:"tidy-view",items:s,prepare:()=>Ee.prefetch()}:null,w=(s,...o)=>Ee.load().then(d=>d[s](...o),()=>!1),k=(s,o)=>Qe(s)?.().menu(o,n,c)??[];if(p.place===void 0){if(p.face!=="pages"||r===void 0||p.on!==void 0)return null;let s=h?.may.lenses===!0&&n?.lens!==void 0,o=H(e.store.schema,r),d=i.arrangement?.()?.hide?.includes(r)===!0;return u([...s?[{id:d?"show-list":"hide-list",label:d?"Show":"Hide",hint:d?"Back in the places, for everyone":"Off the places, for everyone; still at its address",run:()=>void w("setListHidden",r,o,n,!d,c)}]:[],...k(`list:${r}`,s)])}let l=i.places().find(s=>s.as===p.place&&(r===void 0||s.kind===r||s.over?.includes(r)===!0));if(!l)return null;let f=n&&h?se(l,h,n):null;return u([...f?[l.hidden?{id:"show-view",label:"Show",hint:"Back in the places, for everyone",run:()=>void w("setHidden",l,f,n,!1,c)}:{id:"hide-view",label:"Hide",hint:"Off the places and the scene, for everyone",run:()=>void w("setHidden",l,f,n,!0,c)},{id:"delete-view",label:"Delete",hint:`Kept ${30} days under Recently deleted`,run:()=>{let s=Ke(i.places(),l);w("remove",l,f,n,c).then(o=>o&&t?.(l,s))}}]:[],...k(`place:${l.as}`,f==="lens")])}:null,[n,i,c,t])}var Ue=[];function Dt({children:t}){let{view:e,go:n}=F(),i=(0,N.useCallback)((h,r)=>{let u=e.within?.view;e.focusId===ce(h.kind)&&(u===void 0||u===h.as)&&n(r?ue(e,r.kind,r.as):le(e,!0))},[e,n]),c=Ye(i),p=(0,N.useMemo)(()=>c?[c]:Ue,[c]);return(0,Te.jsx)($,{sections:p,children:t})}function Nt(t={}){return t.scope===void 0?te:de(te,t.scope)}var W=y(O(),1),a=y(M(),1);function Bt({inside:t=!1,widthOf:e}={}){let{store:n,view:i,emphasis:c,setEmphasis:p}=A(),h=Se(),{selection:r,set:u}=_(),{show:w}=F(),k=B(),l=(0,W.useMemo)(()=>{let o=new Map;for(let d of n.graph.allEdges()){let v=o.get(d.kind)??{count:0,ends:new Set};v.count+=1;for(let S of[d.from,d.to]){let I=n.graph.getNode(S);I&&v.ends.add(`kind:${I.kind}`)}o.set(d.kind,v)}return[...o.entries()].sort(([d],[v])=>d.localeCompare(v)).map(([d,v])=>({kind:d,count:v.count,ends:[...v.ends]}))},[n,k]),f=Math.max(0,...l.map(o=>o.count));if((0,W.useEffect)(()=>()=>p(null),[p]),!i.overview&&!t||l.length===0)return null;let s=new Set;for(let o of r){if(o.startsWith("kind:")){s.add(o);continue}let d=n.graph.getNode(o);d&&s.add(`kind:${d.kind}`)}return(0,a.jsxs)("section",{"aria-label":"What the lines mean",role:t?"group":void 0,"data-testid":"relation-key",style:t?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:ae("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:je,animation:"graview-settle 380ms 280ms ease backwards"},children:[t?null:(0,a.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:l.length===1?"1 relation":`${l.length} relations`}),e?(0,a.jsx)(Xe,{aloft:i.overview===!0}):null,l.map(({kind:o,count:d,ends:v})=>{let{connector:S,style:I}=ee(h,o),g=Je(n.schema,o),m=c!==null?c===o:s.size===0||v.some(b=>s.has(b));return(0,a.jsxs)("button",{type:"button",title:n.schema.edge(o)?.description===void 0?`${d} of these`:g.words,onMouseEnter:()=>p(o),onMouseLeave:()=>p(null),onFocus:()=>p(o),onBlur:()=>p(null),onClick:()=>{u(v),w(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:m?1:.4},children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:S.visible?1:.35},children:i.overview&&e?(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:e(d,f)}):(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:X(I),strokeWidth:Z(I,!0),strokeDasharray:J[I.pattern],strokeLinecap:"round"})}),(0,a.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":o,children:[(0,a.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:g.words}),(0,a.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:g.ends})]}),S.visible?null:(0,a.jsx)("span",{"data-graview-quiet":o,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,a.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:d})]},o)})]})}var je="min(280px, calc(100% - 28px))";function Je(t,e,n){let i=t.edge(e)?.from??[],c=new Map;for(let r of n!==void 0&&i.includes(n)?[n]:i.length>0?i:[""]){let u=ke(t,r,e,"out");c.set(u,[...c.get(u)??[],r])}let p=r=>r==="*"?"anything":H(t,r),h=[...c].map(([r,u])=>{let w=u.flatMap(l=>t.tryDefinition(l)?.edges[e]?.to??[]),k=u[0]&&w.length>0?`${u.map(p).join(", ")} \u2192 ${(w.includes("*")?["*"]:[...new Set(w)]).map(p).join(", ")}`:"";return[r.charAt(0).toUpperCase()+r.slice(1),k]});return{words:h.map(([r])=>r).join(" \xB7 "),ends:h.flatMap(([,r])=>r?[r]:[]).join(" \xB7 ")}}function _t({edgeKind:t,kit:e,width:n=30}){let i=q(),c=(0,W.useMemo)(()=>ie(e??i?.brand?.kit),[e,i?.brand?.kit]),{connector:p,style:h}=ee(c,t);return(0,a.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":t,style:{display:"inline-block",verticalAlign:"middle",opacity:p.visible?1:.35},children:(0,a.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:X(h),strokeWidth:Z(h,!0),strokeDasharray:J[h.pattern],strokeLinecap:"round"})})}function Xe({aloft:t}){let e={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,a.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{style:e,"data-graview-manner":"ribbon",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,a.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"record",children:[(0,a.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,a.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"district",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,a.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,a.jsxs)("div",{style:e,"data-graview-manner":"unsure",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:we,strokeWidth:1.8,strokeDasharray:ye,strokeLinecap:"round"})}),(0,a.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}var Ie=y(O(),1),re=y(M(),1),Ze=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.25VJPUDH.js","./chunk.AKVBU5K5.js","./chunk.LLOZKUCA.js","./chunk.DH7M57SE.js","./chunk.CKV2QCH5.js","./chunk.TAJ2R44N.js","./chunk.V3NPUAPB.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.OBUKZQCZ.js")))),et=Ze.part(t=>(0,re.jsx)(t.SuggestedTray,{}),{quiet:!0});function Vt(){let{store:t,whileAway:e}=A(),n=B();return(0,Ie.useMemo)(()=>t.log.all().some(c=>c.suggests!==void 0&&!c.withheld),[t,n])||e?.tidied?(0,re.jsx)(et,{}):null}export{it as a,ct as b,gt as c,Bt as d,je as e,_t as f,_e as g,St as h,bt as i,Ye as j,Dt as k,Nt as l,Vt as m};
@@ -1 +1 @@
1
- import{a as I,c as x}from"./chunk.7JCUSYS5.js";import"./chunk.FWZF7X6A.js";import"./chunk.3JMZHCB4.js";import{b,c as A,j as v,q as w,s as O,v as G}from"./chunk.SF4BYBH6.js";import"./chunk.SDO3U72B.js";import{Hd as E,Od as S,Pd as W,rd as k}from"./chunk.3MZIWKNG.js";import"./chunk.SLBWPVIY.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.MFDSWA2W.js";import"./chunk.HFVMGTNL.js";import"./chunk.7Z4USR3Y.js";import{b,c as A,j as v,q as w,s as O,v as G}from"./chunk.NPAWTPLQ.js";import"./chunk.SDO3U72B.js";import{Pd as E,Wd as S,Xd as W,zd as k}from"./chunk.YEJ4LNUP.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{a as ot}from"./chunk.644FUGSX.js";import"./chunk.Y36MLVMT.js";import{e as V,l as ue,m as G,q as st}from"./chunk.MPMROUZA.js";import{a as ee}from"./chunk.G4JJXA63.js";import"./chunk.BOMYLOCX.js";import{b as nt}from"./chunk.45HTFSWD.js";import{d as tt}from"./chunk.KRVEAIKW.js";import"./chunk.XOZU4OFA.js";import"./chunk.AG7CUSSV.js";import"./chunk.C6HBYRGJ.js";import"./chunk.5ZWE72VJ.js";import{d as et}from"./chunk.RLO3RDYH.js";import{c as Ze}from"./chunk.TUNHUTQ5.js";import{I as ze,V as Je,da as Ye,ha as qe,la as Ae,lb as Ve,ma as F,mb as Qe,rd as Ne,sd as Xe}from"./chunk.3MZIWKNG.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";var At="Nothing by that name here.",$=o=>o.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[’']/g,"'").replace(/[^\p{L}\p{N}' ]+/gu," ").replace(/\s+/g," ").trim(),Nt=/^(?:(?:can you |could you |please )?(?:go|take me|bring me|head|jump|navigate|switch|get me)(?: back)? to|(?:please )?(?:open|show(?: me)?|bring up|let me see|view)) (.+)$/,St=/^(?:(?:can you |could you |please )?tell me (?:about|of)|what(?: is|'s| are) (?:in |on )?|describe|explain|who(?: is|'s)) (.+)$/,Ot=/^(?:what(?: is|'s| am i looking at| do i see)(?: (?:here|this|on (?:this|the) (?:page|screen)|in view|this place|this page))?|where am i|describe (?:this|here|this place|this page)|tell me about (?:this|here|this place|this page))$/,rt=new Set(["here","this","this place","this page","on this page","on the page","on this screen","in view"]),Ct=/^(?:date|day|when|on|at|the date|the day)$/,jt=/^(?:what(?: is|'s) (?:wrong|broken|the (?:problem|matter|trouble))|what needs (?:fixing|attention|doing)|any (?:problems|issues|trouble)|(?:show(?: me)? |go to |open )?(?:the )?(?:problems|issues|trouble|standing|what's wrong)|is (?:anything|something) (?:wrong|broken)|are there (?:any )?(?:problems|issues))(?: (?:with|about|on|in) (.+))?$/,z=o=>o.replace(/^(?:the|a|an|my|our) /,""),te=new Set(["the","a","an","my","our","all","any","of","that","which","who","are","is","be","what","whats","what's","with","me","show","list","every","there","do","i","have","we","due","for","please","were","was","by","from","in","on"]),ft=864e5,he=o=>Date.UTC(Number(o.slice(0,4)),Number(o.slice(5,7))-1,Number(o.slice(8,10))),xe=o=>new Date(o).toISOString().slice(0,10),C=(o,i)=>xe(he(o)+i*ft),xt=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Mt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wt="(monday|tuesday|tues|wednesday|thursday|thurs|friday|saturday|sunday)",it="(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sept|sep|oct|nov|dec)",at="(\\d{1,2})(?:st|nd|rd|th)?",Dt=o=>xt.findIndex(i=>i.startsWith(o.slice(0,3))),dt=o=>Mt.findIndex(i=>o.startsWith(i.toLowerCase()));function Rt(o,i){return Je(o,{year:o.slice(0,4)!==i.slice(0,4)})}function Se(o,i,y){if(o<0||i<1||i>31)return;let f=Number(y.slice(0,4)),c=k=>{let j=Date.UTC(k,o,i);return new Date(j).getUTCMonth()===o?xe(j):void 0},p=c(f);if(p)return he(p)<he(y)-183*ft?c(f+1):p}function Oe(o,i,y){let f=new Date(he(i)).getUTCDay(),c=u=>{let S=(f-y+7)%7,w=C(i,-S+u*7);return{from:w,to:C(w,6)}},p=()=>{let u=`${i.slice(0,8)}01`,S=new Date(Date.UTC(Number(i.slice(0,4)),Number(i.slice(5,7)),1));return{from:u,to:C(xe(S.getTime()),-1)}},k=u=>u?{from:u,to:u,day:Rt(u,i)}:void 0,j=(u,S)=>{let w=Dt(S);return k(u==="this"||u==="next"?C(c(u==="next"?1:0).from,(w-y+7)%7):u==="last"?C(i,-((f-w+6)%7+1)):C(i,(w-f+7)%7))},J=u=>{let S=C(i,f===0?-1:6-f);return{from:C(S,u*7),to:C(S,u*7+1)}},B="\\b(?:(?:due |for |on |by )(?:the )?)?",P=[[/\b(?:overdue|past due|late)\b/,()=>({overdue:!0,to:C(i,-1)})],[/\b(?:due |for |on )?today\b/,()=>({from:i,to:i})],[/\b(?:due |for |on )?tomorrow\b/,()=>k(C(i,1))],[/\b(?:due |for |on )?yesterday\b/,()=>k(C(i,-1))],[/\b(?:due |for |on )?this week\b/,()=>c(0)],[/\b(?:due |for |on )?next week\b/,()=>c(1)],[/\b(?:due |for |on )?(?:last|previous) week\b/,()=>c(-1)],[/\b(?:due |for |on )?next weekend\b/,()=>J(1)],[/\b(?:due |for |on )?(?:this |the )?weekend\b/,()=>J(0)],[/\b(?:due |for |on )?this month\b/,()=>p()],[new RegExp(`${B}(\\d{4}) (\\d{2}) (\\d{2})\\b`),u=>k(Se(Number(u[2])-1,Number(u[3]),`${u[1]}-01-01`))],[new RegExp(`${B}${at} (?:of )?${it}\\b`),u=>k(Se(dt(u[2]),Number(u[1]),i))],[new RegExp(`${B}${it} (?:the )?${at}\\b`),u=>k(Se(dt(u[1]),Number(u[2]),i))],[new RegExp(`${B}(?:(this|next|last|coming) )?${Wt}\\b`),u=>j(u[1],u[2])]];for(let[u,S]of P){let w=o.match(u);if(!w)continue;let N=S(w);if(N)return{ask:{words:w[0],...N},rest:o.replace(w[0]," ").replace(/\s+/g," ").trim()}}}function ht(o,i,y={}){let f=y.principal??{kind:"human"},c=o.seenBy(f),p=c.schema,k=y.today??o.today?.()??ze(),j=y.weekStartsOn??1,J=o.kindsKeptFrom(f),B=o.modules.disabledKinds,P=p.kinds.filter(e=>!J.has(e)&&!B.has(e)),u=new Set(P),S=(y.places??[]).filter(e=>e.kind===null||u.has(e.kind)),w=c.graph,N=$(i).replace(/[?.!]+$/,"").trim();if(N.length===0)return{unresolved:!0};let M=e=>p.tryDefinition(e),H=e=>Ye(M(e.kind),e),I=e=>qe(p,e),se=e=>S.find(t=>t.kind===e&&t.address===Ne(p,e))?.address??Ne(p,e),ge=e=>Xe(p,e.kind,e.id),Me=e=>({to:"record",id:e.id,kind:e.kind,label:H(e),address:ge(e),said:`Went to ${H(e)}.`}),We=e=>{let t=`Went to ${e.title}.`;return e.kind===null?{to:"place",slug:e.slug,title:e.title,address:e.address,...e.slug==="overview"?{face:"scene"}:{},said:t}:e.lens||e.address.startsWith("/places/")?{to:"picture",kind:e.kind,as:e.slug,title:e.title,address:e.address,said:t}:{to:"kind",kind:e.kind,title:e.title,address:e.address,said:t}},De=()=>({unresolved:!0,say:At}),oe=e=>{let t=M(e.kind),s=et(e,t,{limit:3,excerpt:!0}).map(r=>r.alone.startsWith(r.label)?r.alone:`${r.label.toLowerCase()} ${r.alone}`).join(", "),n=c.violations().filter(r=>r.nodeIds.includes(e.id));return[`${H(e)} \u2014 ${Ae(F(t,e.kind))}${s?` (${s})`:""}.`,n.length>0?`Trouble: ${n.map(r=>r.message).join("; ")}.`:""].filter(Boolean).join(" ")},re=e=>{let t=new Set([G(e),G(z(e))]);for(let n of[" page"," view"," lens"," place"," picture"," list"])e.endsWith(n)&&(t.add(G(e.slice(0,-n.length))),t.add(G(z(e.slice(0,-n.length)))));t.delete("");let s=n=>t.has(G(n.title))||t.has(G(z($(n.title))))||t.has(G(n.slug));return S.find(n=>n.kind!==null&&n.address.startsWith("/places/")&&s(n))??S.find(s)},pe=e=>{let t=st(o,e,{principal:f,today:k,limit:6,near:!1,...y.selection?{from:y.selection}:{}}),s=t.hits.filter(r=>r.about==="node"&&u.has(r.kind)&&w.getNode(r.id)!==void 0),n=s.filter(r=>r.why.field==="label"&&r.why.strength==="exact");return n.length===1?{one:w.getNode(n[0].id),picks:s}:n.length>1?{picks:n}:s.length===1&&t.total===1?{one:w.getNode(s[0].id),picks:s}:{picks:s}},Re=e=>{let t=e.map(s=>`${s.label} (${F(M(s.kind),s.kind)})`);return`${e.length===1?"One thing matches":`${e.length} things match`}: ${t.join("; ")}.`},Ee=(e,t)=>{if(rt.has(e))return Le();let s=t?pe(z(e)||e):void 0,n=s?.one&&$(H(s.one))===$(z(e)||e)?void 0:re(e);if(n){let l=We(n);return{about:"place",say:t?`${l.said} ${me(n)}`:l.said,moves:[l],subject:n.slug}}let r=pe(z(e)||e);if(r.one){let l=Me(r.one);return{about:t?"describe":"record",say:t?`${l.said} ${oe(r.one)}`:l.said,moves:[l],subject:r.one.id}}if(r.picks.length>0)return{about:"picks",say:Re(r.picks),moves:[],picks:r.picks};let h=ae(e);if(h)return h;let d=Pe(e);if(d){if(d.rest.split(" ").every(l=>l===""||te.has(l))){let l=I(d.kind),v={to:"kind",kind:d.kind,title:l,address:se(d.kind),said:`Went to the ${l.toLowerCase()}.`};return{about:"kind",say:v.said,moves:[v]}}return{unresolved:!0}}return De()},me=e=>{if(e.kind===null){let h=P.map(l=>({kind:l,count:w.nodesOfKind(l).length})).filter(l=>l.count>0).map(l=>`${l.count} ${(l.count===1?F(M(l.kind),l.kind):I(l.kind)).toLowerCase()}`),d=c.violations().length;return[h.length>0?`It holds ${fe(h)}.`:"It holds nothing yet.",d>0?`${d===1?"One problem":`${d} problems`} to see to.`:""].filter(Boolean).join(" ")}let t=w.nodesOfKind(e.kind).length,s=I(e.kind).toLowerCase(),n=new Set(c.violations().flatMap(h=>h.nodeIds)),r=w.nodesOfKind(e.kind).filter(h=>n.has(h.id)).length;return[e.lens?`It draws the ${s} as ${Ae(e.lens)}${t>0?` \u2014 ${t} of them`:""}.`:`${t===0?"No":t} ${t===1?F(M(e.kind),e.kind):s} ${t===1?"is":"are"} here.`,r>0?`${r} ${r===1?"has":"have"} a problem.`:""].filter(Boolean).join(" ")},Le=()=>{let e=(y.selection??[]).map(s=>w.getNode(s)).find(s=>s!==void 0);if(e)return{about:"here",say:oe(e),moves:[],subject:e.id};let t=S.find(s=>s.slug===y.place)??S.find(s=>s.slug==="home");return t?{about:"here",say:`${t.title}. ${me(t)}`,moves:[],subject:t.slug}:{about:"here",say:me({slug:"home",title:"Home",kind:null,cardinality:"many",address:"/",stop:"#"}),moves:[]}},Pe=e=>{let t=P.flatMap(s=>[I(s),F(M(s),s),s].map(n=>({kind:s,name:$(n)}))).filter(s=>s.name.length>0).sort((s,n)=>n.name.length-s.name.length);for(let{kind:s,name:n}of t)if(!(` ${e} `.indexOf(` ${n} `)<0))return{kind:s,rest:` ${e} `.replace(` ${n} `," ").replace(/\s+/g," ").trim()}},ie=(e,t)=>{let s=V(p,e).filters.filter(d=>d.about==="field"&&d.type==="date");if(s.length===0)return;let n=s.find(d=>t.some(l=>$(d.key)===l||$(d.label)===l));if(n)return n;let r=M(e)?.fieldRoles??{};for(let d of["due","deadline","date","when","start","end"]){let l=r[d],v=l?s.find(x=>x.key===l):void 0;if(v)return v}return s.find(d=>["due","deadline","date","when","on","at"].includes(d.key.toLowerCase()))??(s.length===1?s[0]:void 0)},He=e=>{let t=M(e),s=V(p,e).filters;if(t?.lifecycle)return{conditions:[{key:"is",value:"current"}],holds:d=>ue(be,d,{key:"is",value:"current"})};let r=s.find(d=>d.about==="field"&&d.type==="boolean"&&ne.has($(d.key)));if(r)return{conditions:[{key:r.key,value:"false"}],holds:d=>d[r.key]!==!0};let h=s.find(d=>d.about==="field"&&d.type==="choice"&&(d.options??[]).some(l=>ne.has($(l))));if(h){let d=new Set((h.options??[]).filter(v=>ne.has($(v)))),l=(h.options??[]).filter(v=>!d.has(v));return l.length===1?{conditions:[{key:h.key,value:l[0]}],holds:v=>v[h.key]===l[0]}:"unsayable"}return{conditions:[],holds:()=>!0}},Ie=(e,t)=>{let s=e.words.startsWith("due")||$(t.key)==="due",n=Ct.test($(t.label));if(e.day)return s?`due ${e.day}`:n?`on ${e.day}`:`${t.label.toLowerCase()} on ${e.day}`;let r=e.words.replace(/^(?:due|for|on|by) (?:the )?/,"");return s?`due ${r}`:n?r:`${t.label.toLowerCase()} ${r}`},ye=new Set(c.violations().flatMap(e=>e.nodeIds)),be={schema:p,graph:c.graph,flagged:ye,today:k},ae=e=>{let t=Oe(e,k,j),s=Pe(t?.rest??e),n=s?.kind,r=(s?.rest??t?.rest??e).split(" ").filter(Boolean);if(!n&&t){let g=e.split(" "),m=P.filter(L=>ie(L,g)!==void 0),E=m.filter(L=>{let b=ie(L,g);return g.some(O=>$(b.key)===O||$(b.label)===O)}),U=m.length===1?m:E;if(U.length!==1)return;n=U[0]}if(!n)return;let h=V(p,n).filters,d=[],l=[],v=[],x=[],q=!1,de=[];for(let g=0;g<r.length;g++){let m=r[g],E=g>0&&(r[g-1]==="not"||r[g-1]==="un"),U=h.find(b=>b.about==="field"&&b.type==="choice"&&(b.options??[]).some(O=>$(O)===m));if(U&&!E){let b=(U.options??[]).find(O=>$(O)===m);d.push({key:U.key,value:b}),l.push(b);continue}let L=h.find(b=>b.about==="field"&&b.type==="boolean"&&[$(b.key),$(b.label)].some(O=>O===m||O===m.replace(/^un/,"")));if(L){let b=!E&&!(m.startsWith("un")&&!$(L.key).startsWith("un"));d.push({key:L.key,value:String(b)}),l.push(b?m:`not ${m.replace(/^un/,"")}`);continue}if(Pt.has(m)&&!E){let b=He(n);b==="unsayable"?(q=!0,x.push(O=>!ut(p,O))):(d.push(...b.conditions),x.push(b.holds)),l.push(m);continue}m==="not"||m==="un"||t&&h.some(b=>b.type==="date"&&($(b.key)===m||$(b.label)===m))||de.push(m)}if(r=de,r.some(g=>!te.has(g))||!t&&d.length===0&&x.length===0)return;let T=I(n).toLowerCase(),Q=I(n);if(t){let g=ie(n,e.split(" "));if(!g){let m={to:"kind",kind:n,title:Q,address:se(n),said:`Went to the ${T}.`};return{about:"kind",say:`${ee(Q)} carry no date, so I can't tell which are ${/^(?:due|for|on|overdue|past due|late)\b/.test(t.ask.words)?t.ask.words:`due ${t.ask.words}`}. ${m.said}`,moves:[m]}}if(t.ask.from&&d.push({key:g.key,value:`after:${C(t.ask.from,-1)}`}),t.ask.to&&d.push({key:g.key,value:`before:${C(t.ask.to,1)}`}),t.ask.overdue){let m=He(n);m==="unsayable"?(q=!0,x.push(E=>!ut(p,E))):(d.push(...m.conditions),x.push(m.holds))}t.ask.overdue?l.push("overdue"):v.push(Ie(t.ask,g))}let R=w.nodesOfKind(n).filter(g=>d.every(m=>ue(be,g,m))&&x.every(m=>m(g))),K=[...l,...v].join(" and "),Y=[...l,T,...v].join(" "),W=R.slice(0,6).map(g=>({about:"node",id:g.id,kind:n,label:H(g),why:{field:d[0]?.key??"label",reading:d[0]?.key??"Name",fragment:K,strength:"field"},current:!0,flagged:ye.has(g.id),address:ge(g)})),X=R.length===0?`No ${T} are ${K}.`:`${R.length===1?`One ${F(M(n),n)} is`:`${R.length} ${T} are`} ${K}: ${fe(R.slice(0,6).map(H))}${R.length>6?`, and ${R.length-6} more`:""}.`;if(q)return{about:"kind",say:X,moves:[],picks:W,offer:{draft:Y,label:"Show as a view"}};let Z=d.map(g=>`${g.key}:${g.value}`).join(","),we=`${se(n)}?${new URLSearchParams({filter:Z}).toString()}`,_={to:"kind",kind:n,title:ee(Y),filter:Z,address:we,said:`Went to the ${Y}.`};return{about:"kind",say:`${_.said} ${X}`,moves:[_],picks:W}},Te=e=>M(e)?.figure==="person"?!0:[e,F(M(e),e),I(e)].some(s=>$(s).split(" ").some(n=>Et.has(n))),pt=e=>{let t=[],s=n=>M(n)?.edges??{};for(let[n,r]of Object.entries(s(e)))for(let h of r.to??[])u.has(h)&&t.push({key:n,direction:"out",far:h,words:ct(`${r.description??""} ${n}`)});for(let n of P)for(let[r,h]of Object.entries(s(n)))(h.to??[]).includes(e)&&t.push({key:r,direction:"in",far:n,words:ct(`${h.inverse??""} ${r}`)});return t},mt=e=>{let t=e.match(/^(who|which|what)\b/)?.[1];if(!t)return;let s=Oe(e,k,j);if(!s||s.ask.overdue)return;let n=s.rest.split(" ").filter(Boolean),r=P.flatMap(a=>[I(a),F(M(a),a),a].map(A=>({kind:a,name:$(A)}))).filter(a=>a.name.length>0).sort((a,A)=>A.name.length-a.name.length),h=` ${n.join(" ")} `,d=[];for(let{kind:a,name:A}of r)h.includes(` ${A} `)&&(h=h.replace(` ${A} `," "),d.includes(a)||d.push(a));let l=h.match(/\b(?:is|are|was|were)\b|'s\b/)?.[0],v=h.replace(/'s\b/g," ").split(" ").filter(a=>a.length>0&&!te.has(a)&&!Ce.has(a)),x=t==="who"?d.find(Te):d[0];if(!x&&t!=="who")return;let q=d.find(a=>a!==x),de=v.flatMap(a=>[je(a),...lt.has(je(a))?[...lt]:[]]),T=P.filter(a=>q?a===q:a!==x).flatMap(a=>{let A=ie(a,e.split(" "))??V(p,a).filters.find(D=>D.about==="field"&&D.type==="date");return A?pt(a).filter(D=>(x?D.far===x:Te(D.far))&&D.far!==a).map(D=>({kind:a,field:A,relation:D,said:v.length===0||de.some(ve=>D.words.some(vt=>Lt(vt,ve)))})):[]}).filter(a=>a.said);if(T.length===0)return;let Q=T.filter(a=>n.some(A=>$(a.field.key)===A||$(a.field.label)===A)),R=T.length===1?T[0]:Q.length===1?Q[0]:void 0;if(!R)return;let{kind:K,field:Y,relation:W}=R,X=[...s.ask.from?[{key:Y.key,value:`after:${C(s.ask.from,-1)}`}]:[],...s.ask.to?[{key:Y.key,value:`before:${C(s.ask.to,1)}`}]:[]],Z=w.nodesOfKind(K).filter(a=>X.every(A=>ue(be,a,A))),we=a=>(W.direction==="out"?c.graph.out(a.id,W.key):c.graph.in(a.id,W.key)).filter(A=>A.kind===W.far&&u.has(W.far)),_=[],g=[];for(let a of Z){let A=we(a);A.length===0&&g.push(a);for(let D of A)_.some(ve=>ve.id===D.id)||_.push(D)}let m=Ie(s.ask,Y),E=s.ask.day?`On ${s.ask.day}`:ee(s.ask.words.replace(/^(?:due|for|on|by) (?:the )?/,"")),U=I(K).toLowerCase(),L=X.map(a=>`${a.key}:${a.value}`).join(","),b=`${U} ${m}`,O={to:"kind",kind:K,title:ee(b),filter:L,address:`${se(K)}?${new URLSearchParams({filter:L}).toString()}`,said:`Went to the ${b}.`};if(Z.length===0)return{about:"related",say:`No ${b}. ${O.said}`,moves:[O]};let le=v.join(" "),yt=l==="was"||l==="were",Ge=a=>yt?a===1?"was":"were":a===1?"is":"are",ce=_.map(H),bt=ce.length>8?[...ce.slice(0,8),`${ce.length-8} more`]:ce,kt=_.length===0?`${E}: nobody ${Ge(1)}${le?` ${le}`:""}.`:`${E}: ${fe(bt)}${le?` ${Ge(_.length)} ${le}`:""}.`,$t=t==="who"&&g.length>0?`${fe(g.slice(0,4).map(H))}${g.length>4?` and ${g.length-4} more`:""} ${g.length===1?"has":"have"} nobody.`:"",wt=_.slice(0,8).map(a=>({about:"node",id:a.id,kind:a.kind,label:H(a),why:{field:W.key,reading:Ze(p,W.direction==="out"?K:W.far,W.key,W.direction==="out"?"out":"in"),fragment:m,strength:"field"},current:!0,flagged:ye.has(a.id),address:ge(a)}));return{about:"related",say:[kt,$t,O.said].filter(Boolean).join(" "),moves:[O],picks:wt}},Ke=N.match(jt);if(Ke){let e=Ke[1];if(e&&!rt.has(e)&&!/^(?:it|this|that)$/.test(e)){let n=re(e),r=n?void 0:pe(z(e)||e);if(r?.one){let h=Me(r.one);return{about:"describe",say:`${h.said} ${oe(r.one)}`,moves:[h],subject:r.one.id}}if(!n)return r&&r.picks.length>0?{about:"picks",say:Re(r.picks),moves:[],picks:r.picks}:De()}if(e&&/^(?:it|this|that)$|^(?:here|this place|this page)$/.test(e)){let n=(y.selection??[]).map(r=>w.getNode(r)).find(r=>r!==void 0);if(n)return{about:"describe",say:oe(n),moves:[],subject:n.id}}let t=c.violations();if(t.length===0)return{about:"problems",say:"Nothing is wrong \u2014 every rule holds.",moves:[]};let s={to:"problems",address:"/problems",said:"Went to the problems."};return{about:"problems",say:`${s.said} ${Qe(t)}: ${t.slice(0,4).map(n=>n.message).join("; ")}${t.length>4?"\u2026":"."}`,moves:[s]}}if(Ot.test(N))return Le();let _e=mt(N);if(_e)return _e;let ke=Oe(N,k,j);if(ke&&!re(z(ke.ask.words))&&ke.rest.replace(/'s\b/g,"").split(" ").every(e=>e===""||te.has(e)||Ce.has(e))){let e=ae(N);if(e)return e}if(/^open /.test(N)){let e=ae(N);if(e)return e}let Fe=N.match(Nt)??N.match(/^(?:go|take me|head|get me)(?: back)? (home)$/);if(Fe)return Ee(Fe[1].trim(),!1);let Be=N.match(St);if(Be){let e=Ee(Be[1].trim(),!0);return"unresolved"in e&&e.unresolved&&!/^tell me|^describe/.test(N)?{unresolved:!0}:e}let $e=re(N);if($e){let e=We($e);return{about:"place",say:e.said,moves:[e],subject:$e.slug}}let Ue=ae(N);return Ue||{unresolved:!0}}var Ce=new Set(["who","whom","whose","which","what","whats","what's","who's"]),Et=new Set(["person","people","user","users","member","members","volunteer","volunteers","gardener","gardeners","player","players","staff","worker","workers","employee","employees","owner","owners","assignee","assignees","helper","helpers","student","students","teacher","teachers","customer","customers","client","clients","contact","contacts","author","authors"]),lt=new Set(["work","cover","staff","assign","do","run","schedul","roster","book","duty","serv","help"]);function je(o){let i=o.toLowerCase().replace(/'s$/,"");for(let y of["ing","ed","es","s"])if(i.length>y.length+2&&i.endsWith(y)){let f=i.slice(0,-y.length);return f.length>3&&f[f.length-1]===f[f.length-2]?f.slice(0,-1):f}return i}function ct(o){return o.toLowerCase().split(/[^a-z']+/).filter(i=>i.length>1&&!te.has(i)&&!Ce.has(i)&&!["it","they","them","their","its","this","here","to","at"].includes(i)).map(je)}var Lt=(o,i)=>o===i||o.length>=4&&i.length>=4&&(o.startsWith(i)||i.startsWith(o)),ne=new Set(["done","finished","complete","completed","closed","resolved","agreed","canceled","archived","shipped","delivered"]),Pt=new Set(["open","unfinished","outstanding","pending","remaining","undone","incomplete"]);function ut(o,i){return V(o,i.kind).filters.some(f=>f.about==="field"&&(f.type==="boolean"&&ne.has(f.key.toLowerCase())&&i[f.key]===!0||f.type==="choice"&&typeof i[f.key]=="string"&&ne.has(String(i[f.key]).toLowerCase())))}function fe(o){return o.length<=1?o[0]??"":`${o.slice(0,-1).join(", ")} and ${o[o.length-1]}`}function zt(o,i,y={}){let f=y.scene!==void 0?{...y.pages,scene:y.scene}:y.pages;return[...nt(o,i,f?{pages:f}:{})].map(({first:c,hidden:p,lens:k,...j})=>j)}function gt(o,i){return{...o.principal?{principal:o.principal}:{},...o.places?{places:o.places}:{},...o.selection?{selection:o.selection}:{},...o.place?{place:o.place}:{},...i??o.today?{today:i??o.today}:{},...o.weekStartsOn!==void 0?{weekStartsOn:o.weekStartsOn}:{}}}function Jt(o,i,y,f){let c=ht(o,i,gt(y,f));if(c.unresolved)return c.say?{reply:{say:c.say,proposals:[],grounded:!0}}:{};if(c.about==="picks")return{};let p=c.moves.length>0?{moves:c.moves}:{},k=c.subject?o.graph.getNode(c.subject):void 0;if(c.about==="problems")return{...p,problems:!0};if(k&&(c.about==="describe"||c.about==="here"))return{...p,told:k.id};let j=k?tt(o,ot(Ve(o.violations(),[k.id])).slice(0,3)):[];return{reply:{say:c.say,proposals:j,grounded:!0,...p,...c.picks&&c.picks.length>0?{picks:c.picks}:{},...c.offer?{offer:c.offer}:{}}}}function Yt(o,i,y={}){let f=gt(y),c=[];for(let p of i){let k=typeof p=="string"?p:typeof p=="object"&&p!==null&&typeof p.to=="string"?p.to:void 0;if(!k||k.trim().length===0)continue;let j=ht(o,/^(?:go|take me|open|show)\b/i.test(k.trim())?k:`go to ${k}`,f);if("moves"in j)for(let J of j.moves)c.some(B=>B.address===J.address)||c.push(J)}return c}export{At as NOTHING_BY_THAT_NAME,gt as askContextOf,Jt as goingFrom,Yt as movesFromNames,zt as placesFromViews,ht as resolveAsk};
1
+ import{a as ot}from"./chunk.644FUGSX.js";import"./chunk.PJCVFYFU.js";import{e as V,l as ue,m as G,q as st}from"./chunk.7RJGEU3Y.js";import{a as ee}from"./chunk.G4JJXA63.js";import"./chunk.64IKLRUS.js";import{b as nt}from"./chunk.DTSTUC2W.js";import{d as tt}from"./chunk.USQNSNIA.js";import"./chunk.XOZU4OFA.js";import"./chunk.IT763BYH.js";import"./chunk.UQQAGT3R.js";import"./chunk.XJFAUOJS.js";import{d as et}from"./chunk.DPPT6WAJ.js";import{c as Ze}from"./chunk.7U2JO7ET.js";import{Ad as Xe,K as ze,X as Je,ga as Ye,ja as qe,na as Ae,oa as F,ob as Ve,pb as Qe,zd as Ne}from"./chunk.YEJ4LNUP.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var At="Nothing by that name here.",$=o=>o.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[’']/g,"'").replace(/[^\p{L}\p{N}' ]+/gu," ").replace(/\s+/g," ").trim(),Nt=/^(?:(?:can you |could you |please )?(?:go|take me|bring me|head|jump|navigate|switch|get me)(?: back)? to|(?:please )?(?:open|show(?: me)?|bring up|let me see|view)) (.+)$/,St=/^(?:(?:can you |could you |please )?tell me (?:about|of)|what(?: is|'s| are) (?:in |on )?|describe|explain|who(?: is|'s)) (.+)$/,Ot=/^(?:what(?: is|'s| am i looking at| do i see)(?: (?:here|this|on (?:this|the) (?:page|screen)|in view|this place|this page))?|where am i|describe (?:this|here|this place|this page)|tell me about (?:this|here|this place|this page))$/,rt=new Set(["here","this","this place","this page","on this page","on the page","on this screen","in view"]),Ct=/^(?:date|day|when|on|at|the date|the day)$/,jt=/^(?:what(?: is|'s) (?:wrong|broken|the (?:problem|matter|trouble))|what needs (?:fixing|attention|doing)|any (?:problems|issues|trouble)|(?:show(?: me)? |go to |open )?(?:the )?(?:problems|issues|trouble|standing|what's wrong)|is (?:anything|something) (?:wrong|broken)|are there (?:any )?(?:problems|issues))(?: (?:with|about|on|in) (.+))?$/,z=o=>o.replace(/^(?:the|a|an|my|our) /,""),te=new Set(["the","a","an","my","our","all","any","of","that","which","who","are","is","be","what","whats","what's","with","me","show","list","every","there","do","i","have","we","due","for","please","were","was","by","from","in","on"]),ft=864e5,he=o=>Date.UTC(Number(o.slice(0,4)),Number(o.slice(5,7))-1,Number(o.slice(8,10))),xe=o=>new Date(o).toISOString().slice(0,10),C=(o,i)=>xe(he(o)+i*ft),xt=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Mt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wt="(monday|tuesday|tues|wednesday|thursday|thurs|friday|saturday|sunday)",it="(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sept|sep|oct|nov|dec)",at="(\\d{1,2})(?:st|nd|rd|th)?",Dt=o=>xt.findIndex(i=>i.startsWith(o.slice(0,3))),dt=o=>Mt.findIndex(i=>o.startsWith(i.toLowerCase()));function Rt(o,i){return Je(o,{year:o.slice(0,4)!==i.slice(0,4)})}function Se(o,i,y){if(o<0||i<1||i>31)return;let f=Number(y.slice(0,4)),c=k=>{let j=Date.UTC(k,o,i);return new Date(j).getUTCMonth()===o?xe(j):void 0},p=c(f);if(p)return he(p)<he(y)-183*ft?c(f+1):p}function Oe(o,i,y){let f=new Date(he(i)).getUTCDay(),c=u=>{let S=(f-y+7)%7,w=C(i,-S+u*7);return{from:w,to:C(w,6)}},p=()=>{let u=`${i.slice(0,8)}01`,S=new Date(Date.UTC(Number(i.slice(0,4)),Number(i.slice(5,7)),1));return{from:u,to:C(xe(S.getTime()),-1)}},k=u=>u?{from:u,to:u,day:Rt(u,i)}:void 0,j=(u,S)=>{let w=Dt(S);return k(u==="this"||u==="next"?C(c(u==="next"?1:0).from,(w-y+7)%7):u==="last"?C(i,-((f-w+6)%7+1)):C(i,(w-f+7)%7))},J=u=>{let S=C(i,f===0?-1:6-f);return{from:C(S,u*7),to:C(S,u*7+1)}},B="\\b(?:(?:due |for |on |by )(?:the )?)?",P=[[/\b(?:overdue|past due|late)\b/,()=>({overdue:!0,to:C(i,-1)})],[/\b(?:due |for |on )?today\b/,()=>({from:i,to:i})],[/\b(?:due |for |on )?tomorrow\b/,()=>k(C(i,1))],[/\b(?:due |for |on )?yesterday\b/,()=>k(C(i,-1))],[/\b(?:due |for |on )?this week\b/,()=>c(0)],[/\b(?:due |for |on )?next week\b/,()=>c(1)],[/\b(?:due |for |on )?(?:last|previous) week\b/,()=>c(-1)],[/\b(?:due |for |on )?next weekend\b/,()=>J(1)],[/\b(?:due |for |on )?(?:this |the )?weekend\b/,()=>J(0)],[/\b(?:due |for |on )?this month\b/,()=>p()],[new RegExp(`${B}(\\d{4}) (\\d{2}) (\\d{2})\\b`),u=>k(Se(Number(u[2])-1,Number(u[3]),`${u[1]}-01-01`))],[new RegExp(`${B}${at} (?:of )?${it}\\b`),u=>k(Se(dt(u[2]),Number(u[1]),i))],[new RegExp(`${B}${it} (?:the )?${at}\\b`),u=>k(Se(dt(u[1]),Number(u[2]),i))],[new RegExp(`${B}(?:(this|next|last|coming) )?${Wt}\\b`),u=>j(u[1],u[2])]];for(let[u,S]of P){let w=o.match(u);if(!w)continue;let N=S(w);if(N)return{ask:{words:w[0],...N},rest:o.replace(w[0]," ").replace(/\s+/g," ").trim()}}}function ht(o,i,y={}){let f=y.principal??{kind:"human"},c=o.seenBy(f),p=c.schema,k=y.today??o.today?.()??ze(),j=y.weekStartsOn??1,J=o.kindsKeptFrom(f),B=o.modules.disabledKinds,P=p.kinds.filter(e=>!J.has(e)&&!B.has(e)),u=new Set(P),S=(y.places??[]).filter(e=>e.kind===null||u.has(e.kind)),w=c.graph,N=$(i).replace(/[?.!]+$/,"").trim();if(N.length===0)return{unresolved:!0};let M=e=>p.tryDefinition(e),H=e=>Ye(M(e.kind),e),I=e=>qe(p,e),se=e=>S.find(t=>t.kind===e&&t.address===Ne(p,e))?.address??Ne(p,e),ge=e=>Xe(p,e.kind,e.id),Me=e=>({to:"record",id:e.id,kind:e.kind,label:H(e),address:ge(e),said:`Went to ${H(e)}.`}),We=e=>{let t=`Went to ${e.title}.`;return e.kind===null?{to:"place",slug:e.slug,title:e.title,address:e.address,...e.slug==="overview"?{face:"scene"}:{},said:t}:e.lens||e.address.startsWith("/places/")?{to:"picture",kind:e.kind,as:e.slug,title:e.title,address:e.address,said:t}:{to:"kind",kind:e.kind,title:e.title,address:e.address,said:t}},De=()=>({unresolved:!0,say:At}),oe=e=>{let t=M(e.kind),s=et(e,t,{limit:3,excerpt:!0}).map(r=>r.alone.startsWith(r.label)?r.alone:`${r.label.toLowerCase()} ${r.alone}`).join(", "),n=c.violations().filter(r=>r.nodeIds.includes(e.id));return[`${H(e)} \u2014 ${Ae(F(t,e.kind))}${s?` (${s})`:""}.`,n.length>0?`Trouble: ${n.map(r=>r.message).join("; ")}.`:""].filter(Boolean).join(" ")},re=e=>{let t=new Set([G(e),G(z(e))]);for(let n of[" page"," view"," lens"," place"," picture"," list"])e.endsWith(n)&&(t.add(G(e.slice(0,-n.length))),t.add(G(z(e.slice(0,-n.length)))));t.delete("");let s=n=>t.has(G(n.title))||t.has(G(z($(n.title))))||t.has(G(n.slug));return S.find(n=>n.kind!==null&&n.address.startsWith("/places/")&&s(n))??S.find(s)},pe=e=>{let t=st(o,e,{principal:f,today:k,limit:6,near:!1,...y.selection?{from:y.selection}:{}}),s=t.hits.filter(r=>r.about==="node"&&u.has(r.kind)&&w.getNode(r.id)!==void 0),n=s.filter(r=>r.why.field==="label"&&r.why.strength==="exact");return n.length===1?{one:w.getNode(n[0].id),picks:s}:n.length>1?{picks:n}:s.length===1&&t.total===1?{one:w.getNode(s[0].id),picks:s}:{picks:s}},Re=e=>{let t=e.map(s=>`${s.label} (${F(M(s.kind),s.kind)})`);return`${e.length===1?"One thing matches":`${e.length} things match`}: ${t.join("; ")}.`},Ee=(e,t)=>{if(rt.has(e))return Le();let s=t?pe(z(e)||e):void 0,n=s?.one&&$(H(s.one))===$(z(e)||e)?void 0:re(e);if(n){let l=We(n);return{about:"place",say:t?`${l.said} ${me(n)}`:l.said,moves:[l],subject:n.slug}}let r=pe(z(e)||e);if(r.one){let l=Me(r.one);return{about:t?"describe":"record",say:t?`${l.said} ${oe(r.one)}`:l.said,moves:[l],subject:r.one.id}}if(r.picks.length>0)return{about:"picks",say:Re(r.picks),moves:[],picks:r.picks};let h=ae(e);if(h)return h;let d=Pe(e);if(d){if(d.rest.split(" ").every(l=>l===""||te.has(l))){let l=I(d.kind),v={to:"kind",kind:d.kind,title:l,address:se(d.kind),said:`Went to the ${l.toLowerCase()}.`};return{about:"kind",say:v.said,moves:[v]}}return{unresolved:!0}}return De()},me=e=>{if(e.kind===null){let h=P.map(l=>({kind:l,count:w.nodesOfKind(l).length})).filter(l=>l.count>0).map(l=>`${l.count} ${(l.count===1?F(M(l.kind),l.kind):I(l.kind)).toLowerCase()}`),d=c.violations().length;return[h.length>0?`It holds ${fe(h)}.`:"It holds nothing yet.",d>0?`${d===1?"One problem":`${d} problems`} to see to.`:""].filter(Boolean).join(" ")}let t=w.nodesOfKind(e.kind).length,s=I(e.kind).toLowerCase(),n=new Set(c.violations().flatMap(h=>h.nodeIds)),r=w.nodesOfKind(e.kind).filter(h=>n.has(h.id)).length;return[e.lens?`It draws the ${s} as ${Ae(e.lens)}${t>0?` \u2014 ${t} of them`:""}.`:`${t===0?"No":t} ${t===1?F(M(e.kind),e.kind):s} ${t===1?"is":"are"} here.`,r>0?`${r} ${r===1?"has":"have"} a problem.`:""].filter(Boolean).join(" ")},Le=()=>{let e=(y.selection??[]).map(s=>w.getNode(s)).find(s=>s!==void 0);if(e)return{about:"here",say:oe(e),moves:[],subject:e.id};let t=S.find(s=>s.slug===y.place)??S.find(s=>s.slug==="home");return t?{about:"here",say:`${t.title}. ${me(t)}`,moves:[],subject:t.slug}:{about:"here",say:me({slug:"home",title:"Home",kind:null,cardinality:"many",address:"/",stop:"#"}),moves:[]}},Pe=e=>{let t=P.flatMap(s=>[I(s),F(M(s),s),s].map(n=>({kind:s,name:$(n)}))).filter(s=>s.name.length>0).sort((s,n)=>n.name.length-s.name.length);for(let{kind:s,name:n}of t)if(!(` ${e} `.indexOf(` ${n} `)<0))return{kind:s,rest:` ${e} `.replace(` ${n} `," ").replace(/\s+/g," ").trim()}},ie=(e,t)=>{let s=V(p,e).filters.filter(d=>d.about==="field"&&d.type==="date");if(s.length===0)return;let n=s.find(d=>t.some(l=>$(d.key)===l||$(d.label)===l));if(n)return n;let r=M(e)?.fieldRoles??{};for(let d of["due","deadline","date","when","start","end"]){let l=r[d],v=l?s.find(x=>x.key===l):void 0;if(v)return v}return s.find(d=>["due","deadline","date","when","on","at"].includes(d.key.toLowerCase()))??(s.length===1?s[0]:void 0)},He=e=>{let t=M(e),s=V(p,e).filters;if(t?.lifecycle)return{conditions:[{key:"is",value:"current"}],holds:d=>ue(be,d,{key:"is",value:"current"})};let r=s.find(d=>d.about==="field"&&d.type==="boolean"&&ne.has($(d.key)));if(r)return{conditions:[{key:r.key,value:"false"}],holds:d=>d[r.key]!==!0};let h=s.find(d=>d.about==="field"&&d.type==="choice"&&(d.options??[]).some(l=>ne.has($(l))));if(h){let d=new Set((h.options??[]).filter(v=>ne.has($(v)))),l=(h.options??[]).filter(v=>!d.has(v));return l.length===1?{conditions:[{key:h.key,value:l[0]}],holds:v=>v[h.key]===l[0]}:"unsayable"}return{conditions:[],holds:()=>!0}},Ie=(e,t)=>{let s=e.words.startsWith("due")||$(t.key)==="due",n=Ct.test($(t.label));if(e.day)return s?`due ${e.day}`:n?`on ${e.day}`:`${t.label.toLowerCase()} on ${e.day}`;let r=e.words.replace(/^(?:due|for|on|by) (?:the )?/,"");return s?`due ${r}`:n?r:`${t.label.toLowerCase()} ${r}`},ye=new Set(c.violations().flatMap(e=>e.nodeIds)),be={schema:p,graph:c.graph,flagged:ye,today:k},ae=e=>{let t=Oe(e,k,j),s=Pe(t?.rest??e),n=s?.kind,r=(s?.rest??t?.rest??e).split(" ").filter(Boolean);if(!n&&t){let g=e.split(" "),m=P.filter(L=>ie(L,g)!==void 0),E=m.filter(L=>{let b=ie(L,g);return g.some(O=>$(b.key)===O||$(b.label)===O)}),U=m.length===1?m:E;if(U.length!==1)return;n=U[0]}if(!n)return;let h=V(p,n).filters,d=[],l=[],v=[],x=[],q=!1,de=[];for(let g=0;g<r.length;g++){let m=r[g],E=g>0&&(r[g-1]==="not"||r[g-1]==="un"),U=h.find(b=>b.about==="field"&&b.type==="choice"&&(b.options??[]).some(O=>$(O)===m));if(U&&!E){let b=(U.options??[]).find(O=>$(O)===m);d.push({key:U.key,value:b}),l.push(b);continue}let L=h.find(b=>b.about==="field"&&b.type==="boolean"&&[$(b.key),$(b.label)].some(O=>O===m||O===m.replace(/^un/,"")));if(L){let b=!E&&!(m.startsWith("un")&&!$(L.key).startsWith("un"));d.push({key:L.key,value:String(b)}),l.push(b?m:`not ${m.replace(/^un/,"")}`);continue}if(Pt.has(m)&&!E){let b=He(n);b==="unsayable"?(q=!0,x.push(O=>!ut(p,O))):(d.push(...b.conditions),x.push(b.holds)),l.push(m);continue}m==="not"||m==="un"||t&&h.some(b=>b.type==="date"&&($(b.key)===m||$(b.label)===m))||de.push(m)}if(r=de,r.some(g=>!te.has(g))||!t&&d.length===0&&x.length===0)return;let T=I(n).toLowerCase(),Q=I(n);if(t){let g=ie(n,e.split(" "));if(!g){let m={to:"kind",kind:n,title:Q,address:se(n),said:`Went to the ${T}.`};return{about:"kind",say:`${ee(Q)} carry no date, so I can't tell which are ${/^(?:due|for|on|overdue|past due|late)\b/.test(t.ask.words)?t.ask.words:`due ${t.ask.words}`}. ${m.said}`,moves:[m]}}if(t.ask.from&&d.push({key:g.key,value:`after:${C(t.ask.from,-1)}`}),t.ask.to&&d.push({key:g.key,value:`before:${C(t.ask.to,1)}`}),t.ask.overdue){let m=He(n);m==="unsayable"?(q=!0,x.push(E=>!ut(p,E))):(d.push(...m.conditions),x.push(m.holds))}t.ask.overdue?l.push("overdue"):v.push(Ie(t.ask,g))}let R=w.nodesOfKind(n).filter(g=>d.every(m=>ue(be,g,m))&&x.every(m=>m(g))),K=[...l,...v].join(" and "),Y=[...l,T,...v].join(" "),W=R.slice(0,6).map(g=>({about:"node",id:g.id,kind:n,label:H(g),why:{field:d[0]?.key??"label",reading:d[0]?.key??"Name",fragment:K,strength:"field"},current:!0,flagged:ye.has(g.id),address:ge(g)})),X=R.length===0?`No ${T} are ${K}.`:`${R.length===1?`One ${F(M(n),n)} is`:`${R.length} ${T} are`} ${K}: ${fe(R.slice(0,6).map(H))}${R.length>6?`, and ${R.length-6} more`:""}.`;if(q)return{about:"kind",say:X,moves:[],picks:W,offer:{draft:Y,label:"Show as a view"}};let Z=d.map(g=>`${g.key}:${g.value}`).join(","),we=`${se(n)}?${new URLSearchParams({filter:Z}).toString()}`,_={to:"kind",kind:n,title:ee(Y),filter:Z,address:we,said:`Went to the ${Y}.`};return{about:"kind",say:`${_.said} ${X}`,moves:[_],picks:W}},Te=e=>M(e)?.figure==="person"?!0:[e,F(M(e),e),I(e)].some(s=>$(s).split(" ").some(n=>Et.has(n))),pt=e=>{let t=[],s=n=>M(n)?.edges??{};for(let[n,r]of Object.entries(s(e)))for(let h of r.to??[])u.has(h)&&t.push({key:n,direction:"out",far:h,words:ct(`${r.description??""} ${n}`)});for(let n of P)for(let[r,h]of Object.entries(s(n)))(h.to??[]).includes(e)&&t.push({key:r,direction:"in",far:n,words:ct(`${h.inverse??""} ${r}`)});return t},mt=e=>{let t=e.match(/^(who|which|what)\b/)?.[1];if(!t)return;let s=Oe(e,k,j);if(!s||s.ask.overdue)return;let n=s.rest.split(" ").filter(Boolean),r=P.flatMap(a=>[I(a),F(M(a),a),a].map(A=>({kind:a,name:$(A)}))).filter(a=>a.name.length>0).sort((a,A)=>A.name.length-a.name.length),h=` ${n.join(" ")} `,d=[];for(let{kind:a,name:A}of r)h.includes(` ${A} `)&&(h=h.replace(` ${A} `," "),d.includes(a)||d.push(a));let l=h.match(/\b(?:is|are|was|were)\b|'s\b/)?.[0],v=h.replace(/'s\b/g," ").split(" ").filter(a=>a.length>0&&!te.has(a)&&!Ce.has(a)),x=t==="who"?d.find(Te):d[0];if(!x&&t!=="who")return;let q=d.find(a=>a!==x),de=v.flatMap(a=>[je(a),...lt.has(je(a))?[...lt]:[]]),T=P.filter(a=>q?a===q:a!==x).flatMap(a=>{let A=ie(a,e.split(" "))??V(p,a).filters.find(D=>D.about==="field"&&D.type==="date");return A?pt(a).filter(D=>(x?D.far===x:Te(D.far))&&D.far!==a).map(D=>({kind:a,field:A,relation:D,said:v.length===0||de.some(ve=>D.words.some(vt=>Lt(vt,ve)))})):[]}).filter(a=>a.said);if(T.length===0)return;let Q=T.filter(a=>n.some(A=>$(a.field.key)===A||$(a.field.label)===A)),R=T.length===1?T[0]:Q.length===1?Q[0]:void 0;if(!R)return;let{kind:K,field:Y,relation:W}=R,X=[...s.ask.from?[{key:Y.key,value:`after:${C(s.ask.from,-1)}`}]:[],...s.ask.to?[{key:Y.key,value:`before:${C(s.ask.to,1)}`}]:[]],Z=w.nodesOfKind(K).filter(a=>X.every(A=>ue(be,a,A))),we=a=>(W.direction==="out"?c.graph.out(a.id,W.key):c.graph.in(a.id,W.key)).filter(A=>A.kind===W.far&&u.has(W.far)),_=[],g=[];for(let a of Z){let A=we(a);A.length===0&&g.push(a);for(let D of A)_.some(ve=>ve.id===D.id)||_.push(D)}let m=Ie(s.ask,Y),E=s.ask.day?`On ${s.ask.day}`:ee(s.ask.words.replace(/^(?:due|for|on|by) (?:the )?/,"")),U=I(K).toLowerCase(),L=X.map(a=>`${a.key}:${a.value}`).join(","),b=`${U} ${m}`,O={to:"kind",kind:K,title:ee(b),filter:L,address:`${se(K)}?${new URLSearchParams({filter:L}).toString()}`,said:`Went to the ${b}.`};if(Z.length===0)return{about:"related",say:`No ${b}. ${O.said}`,moves:[O]};let le=v.join(" "),yt=l==="was"||l==="were",Ge=a=>yt?a===1?"was":"were":a===1?"is":"are",ce=_.map(H),bt=ce.length>8?[...ce.slice(0,8),`${ce.length-8} more`]:ce,kt=_.length===0?`${E}: nobody ${Ge(1)}${le?` ${le}`:""}.`:`${E}: ${fe(bt)}${le?` ${Ge(_.length)} ${le}`:""}.`,$t=t==="who"&&g.length>0?`${fe(g.slice(0,4).map(H))}${g.length>4?` and ${g.length-4} more`:""} ${g.length===1?"has":"have"} nobody.`:"",wt=_.slice(0,8).map(a=>({about:"node",id:a.id,kind:a.kind,label:H(a),why:{field:W.key,reading:Ze(p,W.direction==="out"?K:W.far,W.key,W.direction==="out"?"out":"in"),fragment:m,strength:"field"},current:!0,flagged:ye.has(a.id),address:ge(a)}));return{about:"related",say:[kt,$t,O.said].filter(Boolean).join(" "),moves:[O],picks:wt}},Ke=N.match(jt);if(Ke){let e=Ke[1];if(e&&!rt.has(e)&&!/^(?:it|this|that)$/.test(e)){let n=re(e),r=n?void 0:pe(z(e)||e);if(r?.one){let h=Me(r.one);return{about:"describe",say:`${h.said} ${oe(r.one)}`,moves:[h],subject:r.one.id}}if(!n)return r&&r.picks.length>0?{about:"picks",say:Re(r.picks),moves:[],picks:r.picks}:De()}if(e&&/^(?:it|this|that)$|^(?:here|this place|this page)$/.test(e)){let n=(y.selection??[]).map(r=>w.getNode(r)).find(r=>r!==void 0);if(n)return{about:"describe",say:oe(n),moves:[],subject:n.id}}let t=c.violations();if(t.length===0)return{about:"problems",say:"Nothing is wrong \u2014 every rule holds.",moves:[]};let s={to:"problems",address:"/problems",said:"Went to the problems."};return{about:"problems",say:`${s.said} ${Qe(t)}: ${t.slice(0,4).map(n=>n.message).join("; ")}${t.length>4?"\u2026":"."}`,moves:[s]}}if(Ot.test(N))return Le();let _e=mt(N);if(_e)return _e;let ke=Oe(N,k,j);if(ke&&!re(z(ke.ask.words))&&ke.rest.replace(/'s\b/g,"").split(" ").every(e=>e===""||te.has(e)||Ce.has(e))){let e=ae(N);if(e)return e}if(/^open /.test(N)){let e=ae(N);if(e)return e}let Fe=N.match(Nt)??N.match(/^(?:go|take me|head|get me)(?: back)? (home)$/);if(Fe)return Ee(Fe[1].trim(),!1);let Be=N.match(St);if(Be){let e=Ee(Be[1].trim(),!0);return"unresolved"in e&&e.unresolved&&!/^tell me|^describe/.test(N)?{unresolved:!0}:e}let $e=re(N);if($e){let e=We($e);return{about:"place",say:e.said,moves:[e],subject:$e.slug}}let Ue=ae(N);return Ue||{unresolved:!0}}var Ce=new Set(["who","whom","whose","which","what","whats","what's","who's"]),Et=new Set(["person","people","user","users","member","members","volunteer","volunteers","gardener","gardeners","player","players","staff","worker","workers","employee","employees","owner","owners","assignee","assignees","helper","helpers","student","students","teacher","teachers","customer","customers","client","clients","contact","contacts","author","authors"]),lt=new Set(["work","cover","staff","assign","do","run","schedul","roster","book","duty","serv","help"]);function je(o){let i=o.toLowerCase().replace(/'s$/,"");for(let y of["ing","ed","es","s"])if(i.length>y.length+2&&i.endsWith(y)){let f=i.slice(0,-y.length);return f.length>3&&f[f.length-1]===f[f.length-2]?f.slice(0,-1):f}return i}function ct(o){return o.toLowerCase().split(/[^a-z']+/).filter(i=>i.length>1&&!te.has(i)&&!Ce.has(i)&&!["it","they","them","their","its","this","here","to","at"].includes(i)).map(je)}var Lt=(o,i)=>o===i||o.length>=4&&i.length>=4&&(o.startsWith(i)||i.startsWith(o)),ne=new Set(["done","finished","complete","completed","closed","resolved","agreed","canceled","archived","shipped","delivered"]),Pt=new Set(["open","unfinished","outstanding","pending","remaining","undone","incomplete"]);function ut(o,i){return V(o,i.kind).filters.some(f=>f.about==="field"&&(f.type==="boolean"&&ne.has(f.key.toLowerCase())&&i[f.key]===!0||f.type==="choice"&&typeof i[f.key]=="string"&&ne.has(String(i[f.key]).toLowerCase())))}function fe(o){return o.length<=1?o[0]??"":`${o.slice(0,-1).join(", ")} and ${o[o.length-1]}`}function zt(o,i,y={}){let f=y.scene!==void 0?{...y.pages,scene:y.scene}:y.pages;return[...nt(o,i,f?{pages:f}:{})].map(({first:c,hidden:p,lens:k,...j})=>j)}function gt(o,i){return{...o.principal?{principal:o.principal}:{},...o.places?{places:o.places}:{},...o.selection?{selection:o.selection}:{},...o.place?{place:o.place}:{},...i??o.today?{today:i??o.today}:{},...o.weekStartsOn!==void 0?{weekStartsOn:o.weekStartsOn}:{}}}function Jt(o,i,y,f){let c=ht(o,i,gt(y,f));if(c.unresolved)return c.say?{reply:{say:c.say,proposals:[],grounded:!0}}:{};if(c.about==="picks")return{};let p=c.moves.length>0?{moves:c.moves}:{},k=c.subject?o.graph.getNode(c.subject):void 0;if(c.about==="problems")return{...p,problems:!0};if(k&&(c.about==="describe"||c.about==="here"))return{...p,told:k.id};let j=k?tt(o,ot(Ve(o.violations(),[k.id])).slice(0,3)):[];return{reply:{say:c.say,proposals:j,grounded:!0,...p,...c.picks&&c.picks.length>0?{picks:c.picks}:{},...c.offer?{offer:c.offer}:{}}}}function Yt(o,i,y={}){let f=gt(y),c=[];for(let p of i){let k=typeof p=="string"?p:typeof p=="object"&&p!==null&&typeof p.to=="string"?p.to:void 0;if(!k||k.trim().length===0)continue;let j=ht(o,/^(?:go|take me|open|show)\b/i.test(k.trim())?k:`go to ${k}`,f);if("moves"in j)for(let J of j.moves)c.some(B=>B.address===J.address)||c.push(J)}return c}export{At as NOTHING_BY_THAT_NAME,gt as askContextOf,Jt as goingFrom,Yt as movesFromNames,zt as placesFromViews,ht as resolveAsk};
@@ -0,0 +1 @@
1
+ import{i as n}from"./chunk.RR2IFETZ.js";import"./chunk.ONGZ3YQF.js";import"./chunk.XGCOWCA2.js";import"./chunk.MORMTKVR.js";import"./chunk.E33EJU3Q.js";import"./chunk.PJCVFYFU.js";import"./chunk.7RJGEU3Y.js";import"./chunk.AIK3Z25Y.js";import"./chunk.CKV2QCH5.js";import"./chunk.BT7RLFPO.js";import"./chunk.TAJ2R44N.js";import"./chunk.VLBY66PB.js";import"./chunk.WVUJXDXZ.js";import{e as p}from"./chunk.T2RME6XF.js";import"./chunk.SOTB6C5A.js";import"./chunk.TQCRFZ53.js";import"./chunk.6HLKAUWF.js";import"./chunk.FCUDBMGC.js";import"./chunk.KMEKMCKG.js";import"./chunk.GZHZLJBF.js";import"./chunk.E5XNQTEU.js";import"./chunk.OJGHDWI6.js";import"./chunk.K5YLQAFW.js";import"./chunk.XJFAUOJS.js";import"./chunk.DPPT6WAJ.js";import"./chunk.7U2JO7ET.js";import"./chunk.HFVMGTNL.js";import"./chunk.7Z4USR3Y.js";import{T as m}from"./chunk.NPAWTPLQ.js";import"./chunk.SDO3U72B.js";import"./chunk.YEJ4LNUP.js";import"./chunk.FQLNBIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var i=t(m(),1),a=new WeakMap;function l(o){let e=a.get(o);if(!e){let r=p(o);e=c=>c.mode==="fullscreen"?(0,i.jsx)(n,{blocks:r,slot:"home",heading:2,firstHeading:1}):(0,i.jsx)(n,{blocks:r,slot:"home",heading:3,firstHeading:2}),a.set(o,e)}return e}export{l as homeView};