graview 0.1.58 → 0.1.59

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 (173) hide show
  1. package/dist/preview/{chunk.27CW6SCT.js → chunk.2FOIJ5ID.js} +1 -1
  2. package/dist/preview/{chunk.JB7TTJXQ.js → chunk.2FP4KEEG.js} +1 -1
  3. package/dist/preview/{chunk.PBCNOFQH.js → chunk.2MFXP3FB.js} +1 -1
  4. package/dist/preview/{chunk.XU34T2H4.js → chunk.2NJDT47T.js} +1 -1
  5. package/dist/preview/{chunk.EPPXZZPK.js → chunk.2QESVWUW.js} +1 -1
  6. package/dist/preview/{chunk.IDJPBWL2.js → chunk.2XTCDFWU.js} +1 -1
  7. package/dist/preview/{chunk.WXIEQZLY.js → chunk.3UTRR5YM.js} +1 -1
  8. package/dist/preview/{chunk.INZQ6WZM.js → chunk.3XIIJHQ6.js} +1 -1
  9. package/dist/preview/chunk.3XLOFZRM.js +1 -0
  10. package/dist/preview/{chunk.POBMGM3X.js → chunk.4OMOP77U.js} +1 -1
  11. package/dist/preview/{chunk.WNQFHMNR.js → chunk.4QWTSI7V.js} +1 -1
  12. package/dist/preview/{chunk.4HSH2UIK.js → chunk.4T5QIZKB.js} +2 -2
  13. package/dist/preview/chunk.6BLNFVB4.js +1 -0
  14. package/dist/preview/{chunk.ACYDJQRC.js → chunk.6E36I2GC.js} +1 -1
  15. package/dist/preview/{chunk.YD3TKV6P.js → chunk.6IUEGPCZ.js} +2 -2
  16. package/dist/preview/{chunk.M34CS7DI.js → chunk.6N7LNTB6.js} +1 -1
  17. package/dist/preview/chunk.6O3YPUW3.js +1 -0
  18. package/dist/preview/{chunk.GEB2DFBU.js → chunk.6VNKGTLF.js} +1 -1
  19. package/dist/preview/{chunk.JGKA5QBX.js → chunk.7AMBLGVB.js} +1 -1
  20. package/dist/preview/{chunk.NFX24NUI.js → chunk.7JOG6XFC.js} +1 -1
  21. package/dist/preview/chunk.7XSDXX5Z.js +1 -0
  22. package/dist/preview/{chunk.HZB5F476.js → chunk.ATSKKTUO.js} +1 -1
  23. package/dist/preview/{chunk.HXRV3WVJ.js → chunk.ATVPAYS6.js} +1 -1
  24. package/dist/preview/{chunk.KKNDX4JT.js → chunk.AXXYJCSW.js} +1 -1
  25. package/dist/preview/{chunk.O4CVKTPJ.js → chunk.B5HLA45D.js} +1 -1
  26. package/dist/preview/{chunk.LRUNFSHP.js → chunk.BDBLGGFJ.js} +1 -1
  27. package/dist/preview/{chunk.A6C4AGJJ.js → chunk.BFN6B4C4.js} +1 -1
  28. package/dist/preview/{chunk.TJ647W6J.js → chunk.BPC4XQFZ.js} +2 -2
  29. package/dist/preview/{chunk.7V23SXGJ.js → chunk.CIB65YO6.js} +1 -1
  30. package/dist/preview/chunk.CJUIJ6TL.js +1 -0
  31. package/dist/preview/{chunk.KJHPDL4N.js → chunk.CLR6KAA3.js} +1 -1
  32. package/dist/preview/{chunk.4KC35UNR.js → chunk.CUJX3IVA.js} +4 -2
  33. package/dist/preview/{chunk.ILRCNTGT.js → chunk.CYUMQPMH.js} +1 -1
  34. package/dist/preview/{chunk.7SQAKSJD.js → chunk.CZH27V2R.js} +1 -1
  35. package/dist/preview/chunk.D3AISGQH.js +1 -0
  36. package/dist/preview/{chunk.KJ264E6K.js → chunk.DGM3Y2FB.js} +1 -1
  37. package/dist/preview/{chunk.HMFJT4KO.js → chunk.DO45KXLM.js} +1 -1
  38. package/dist/preview/{chunk.IULQRCEE.js → chunk.DWHPZBPZ.js} +1 -1
  39. package/dist/preview/{chunk.NKC3JILT.js → chunk.E22DDEQI.js} +1 -1
  40. package/dist/preview/chunk.E2REVMAG.js +6 -0
  41. package/dist/preview/{chunk.E34OQVSR.js → chunk.E4SYOBGB.js} +1 -1
  42. package/dist/preview/{chunk.TJOXNEFU.js → chunk.EGJUFZD5.js} +1 -1
  43. package/dist/preview/chunk.EZ3CRUBU.js +21 -0
  44. package/dist/preview/{chunk.LMN4TSAP.js → chunk.F6P3WSMW.js} +1 -1
  45. package/dist/preview/{chunk.4Y2JTY6Q.js → chunk.FJTVY6AE.js} +1 -1
  46. package/dist/preview/chunk.G2TCFWYX.js +1 -0
  47. package/dist/preview/{chunk.TWKXSLYY.js → chunk.G7HIAUEA.js} +1 -1
  48. package/dist/preview/{chunk.64R3K2OE.js → chunk.GDUM2UOM.js} +1 -1
  49. package/dist/preview/chunk.GQHFLOTZ.js +5 -0
  50. package/dist/preview/{chunk.DBZHRYBK.js → chunk.GR2B7SKI.js} +1 -1
  51. package/dist/preview/{chunk.GCBZ3WE2.js → chunk.HF5SNUTK.js} +1 -1
  52. package/dist/preview/{chunk.VUPLFUUS.js → chunk.HJOVOA52.js} +1 -1
  53. package/dist/preview/{chunk.QGV7H7RQ.js → chunk.HKINU7VO.js} +1 -1
  54. package/dist/preview/{chunk.GZB6A6KF.js → chunk.HVUUJQRE.js} +1 -1
  55. package/dist/preview/{chunk.34TW32TB.js → chunk.IIESMHXY.js} +2 -2
  56. package/dist/preview/{chunk.GQBJVCSM.js → chunk.IPPZEGBX.js} +1 -1
  57. package/dist/preview/{chunk.WNSC3RWD.js → chunk.IZ2ZTNEV.js} +1 -1
  58. package/dist/preview/{chunk.OHQ3JH65.js → chunk.J4HTSXUA.js} +1 -1
  59. package/dist/preview/{chunk.B3WZHPM3.js → chunk.JPNBQFJ3.js} +1 -1
  60. package/dist/preview/{chunk.ELAMMS2V.js → chunk.KE6ZRUMP.js} +1 -1
  61. package/dist/preview/{chunk.ELERUERU.js → chunk.KHZA5F7A.js} +1 -1
  62. package/dist/preview/{chunk.TF5I4VHX.js → chunk.KKQXGN5U.js} +1 -1
  63. package/dist/preview/{chunk.U6O3MMQR.js → chunk.KOGUYWHG.js} +1 -1
  64. package/dist/preview/{chunk.YHTE34RN.js → chunk.KSVJHSRH.js} +1 -1
  65. package/dist/preview/{chunk.JES77WXG.js → chunk.L3K25NCS.js} +1 -1
  66. package/dist/preview/chunk.LDLTQNJ2.js +1 -0
  67. package/dist/preview/{chunk.LL2MLSPH.js → chunk.LDYOQCY7.js} +1 -1
  68. package/dist/preview/{chunk.F7SF6EP2.js → chunk.LHJWII6C.js} +1 -1
  69. package/dist/preview/{chunk.E5MSFXL6.js → chunk.LKE2FBXL.js} +1 -1
  70. package/dist/preview/{chunk.RRKYJYZJ.js → chunk.M3JIIF32.js} +1 -1
  71. package/dist/preview/{chunk.BB33TI4S.js → chunk.MHILFBK6.js} +1 -1
  72. package/dist/preview/chunk.MMWLLWFS.js +1 -0
  73. package/dist/preview/{chunk.2VYNNWW5.js → chunk.MOAUE3N2.js} +3 -3
  74. package/dist/preview/{chunk.LCPGZK7G.js → chunk.MRYN42EQ.js} +1 -1
  75. package/dist/preview/{chunk.JUNMJYH5.js → chunk.MZJ3KTEU.js} +1 -1
  76. package/dist/preview/{chunk.GKSUTAIX.js → chunk.N4LOI3YA.js} +1 -1
  77. package/dist/preview/{chunk.LY3YOWKV.js → chunk.NIFQDN6R.js} +1 -1
  78. package/dist/preview/chunk.NOLGJFA4.js +2 -0
  79. package/dist/preview/{chunk.3YZHZGTM.js → chunk.NSGQXCH6.js} +1 -1
  80. package/dist/preview/{chunk.HEWVPXRE.js → chunk.OLW44AP5.js} +1 -1
  81. package/dist/preview/{chunk.PZG3B7F4.js → chunk.OVSZXILB.js} +1 -1
  82. package/dist/preview/{chunk.ZOHMWSHD.js → chunk.P3CUCDHO.js} +1 -1
  83. package/dist/preview/{chunk.UAP5M3CD.js → chunk.P52UTBNO.js} +2 -2
  84. package/dist/preview/{chunk.XN2RVXOI.js → chunk.P6CHNBRR.js} +1 -1
  85. package/dist/preview/chunk.PCVPH5KM.js +1 -0
  86. package/dist/preview/{chunk.ETBFD76E.js → chunk.PS5SEND3.js} +1 -1
  87. package/dist/preview/chunk.Q355UPFG.js +1 -0
  88. package/dist/preview/{chunk.QPXXY2DL.js → chunk.Q3Y5EV5A.js} +3 -3
  89. package/dist/preview/{chunk.LDAYDCUO.js → chunk.Q6LLURRM.js} +1 -1
  90. package/dist/preview/{chunk.YS6GVLIP.js → chunk.QC4YXFF7.js} +1 -1
  91. package/dist/preview/chunk.QDZAITMN.js +1 -0
  92. package/dist/preview/chunk.QHU3KUZZ.js +1 -0
  93. package/dist/preview/{chunk.SDLUWRGI.js → chunk.QL555VQ2.js} +1 -1
  94. package/dist/preview/{chunk.CCWPF5PK.js → chunk.QLTHHWBA.js} +1 -1
  95. package/dist/preview/{chunk.4AFFPYOK.js → chunk.QT6UV7HN.js} +1 -1
  96. package/dist/preview/{chunk.4444RPWW.js → chunk.QXMQUIQZ.js} +1 -1
  97. package/dist/preview/{chunk.KWJWAIQJ.js → chunk.R4YDAJRL.js} +1 -1
  98. package/dist/preview/{chunk.5ICIMQE6.js → chunk.RKZ4J3H2.js} +1 -1
  99. package/dist/preview/{chunk.RE7DELSR.js → chunk.ROHSF4WM.js} +1 -1
  100. package/dist/preview/{chunk.S2H7B6RG.js → chunk.S6VON4LU.js} +1 -1
  101. package/dist/preview/{chunk.GDOTG7YA.js → chunk.S7ZLGODY.js} +1 -1
  102. package/dist/preview/{chunk.ZN5HTWSI.js → chunk.SU6WKQ73.js} +1 -1
  103. package/dist/preview/{chunk.EQTSV7BK.js → chunk.SZG6HJWH.js} +1 -1
  104. package/dist/preview/{chunk.SPXRLO5K.js → chunk.T227XQIO.js} +1 -1
  105. package/dist/preview/{chunk.D5KTGX7F.js → chunk.TCPTVTFU.js} +1 -1
  106. package/dist/preview/chunk.U37WZMUO.js +1 -0
  107. package/dist/preview/chunk.U5JFW2YM.js +1 -0
  108. package/dist/preview/{chunk.GP7F3PEF.js → chunk.U5PX2ECA.js} +1 -1
  109. package/dist/preview/{chunk.VHSWBFXB.js → chunk.U7G56KXT.js} +1 -1
  110. package/dist/preview/{chunk.H3BFHI3G.js → chunk.UFTAGUTU.js} +1 -1
  111. package/dist/preview/{chunk.LO3U3P55.js → chunk.UHUBQ4EX.js} +1 -1
  112. package/dist/preview/{chunk.KXPRILAO.js → chunk.UITZ74YJ.js} +1 -1
  113. package/dist/preview/{chunk.KFQSYCY3.js → chunk.UM5H2VVR.js} +1 -1
  114. package/dist/preview/chunk.V5MOMBZG.js +1 -0
  115. package/dist/preview/{chunk.B2GVJD6H.js → chunk.V6EEDYYW.js} +1 -1
  116. package/dist/preview/{chunk.TBW7CU4G.js → chunk.VDGMFX5C.js} +1 -1
  117. package/dist/preview/{chunk.EB4NVTJL.js → chunk.VFRURRNI.js} +1 -1
  118. package/dist/preview/{chunk.6W7O5YLL.js → chunk.VGHZQEHS.js} +1 -1
  119. package/dist/preview/{chunk.MQ5HBUBL.js → chunk.VNBEAF62.js} +1 -1
  120. package/dist/preview/chunk.VNJKGSGZ.js +25 -0
  121. package/dist/preview/{chunk.TUUVVO5U.js → chunk.VS25R6R2.js} +1 -1
  122. package/dist/preview/chunk.VUSJ7HPC.js +1 -0
  123. package/dist/preview/chunk.VXRECLX6.js +1 -0
  124. package/dist/preview/{chunk.7MSFDD7J.js → chunk.W2VOD6SD.js} +1 -1
  125. package/dist/preview/{chunk.WJFQIE3Y.js → chunk.W66VMALY.js} +1 -1
  126. package/dist/preview/{chunk.WQOI6BLM.js → chunk.WEGPDJTB.js} +1 -1
  127. package/dist/preview/{chunk.3OYGXYQY.js → chunk.WGTBQHHE.js} +1 -1
  128. package/dist/preview/chunk.WGVIJDV5.js +1 -0
  129. package/dist/preview/{chunk.SDVPJYVF.js → chunk.WTUB7W2D.js} +1 -1
  130. package/dist/preview/{chunk.VG7OWV2H.js → chunk.X2G4ZRB2.js} +1 -1
  131. package/dist/preview/chunk.X3MMJ3QC.js +5 -0
  132. package/dist/preview/chunk.X5YRNNHU.js +1 -0
  133. package/dist/preview/{chunk.BTVBZ6KE.js → chunk.XOTES3PI.js} +2 -2
  134. package/dist/preview/{chunk.YIA2EDVF.js → chunk.YGZCESXY.js} +1 -1
  135. package/dist/preview/chunk.YMC2T2HN.js +1 -0
  136. package/dist/preview/{chunk.HS3GHAUR.js → chunk.YMRVKG6W.js} +1 -1
  137. package/dist/preview/chunk.YN6BXZHO.js +1 -0
  138. package/dist/preview/{chunk.YP2F5UGY.js → chunk.Z4CJJ4QP.js} +1 -1
  139. package/dist/preview/{chunk.2EDC63RI.js → chunk.ZFH4SCCF.js} +1 -1
  140. package/dist/preview/{chunk.NOFWGDOT.js → chunk.ZLMI2NHC.js} +1 -1
  141. package/dist/preview/{chunk.YZZONE4M.js → chunk.ZT3NEAFI.js} +1 -1
  142. package/dist/preview/{chunk.I3WWCPQ2.js → chunk.ZUKYMU6C.js} +1 -1
  143. package/dist/preview/index.html +51 -51
  144. package/dist/preview/page.js +2 -2
  145. package/package.json +6 -6
  146. package/dist/preview/chunk.32FMOHZK.js +0 -1
  147. package/dist/preview/chunk.3FCOFEGW.js +0 -1
  148. package/dist/preview/chunk.43OKZU73.js +0 -1
  149. package/dist/preview/chunk.47JQPYXL.js +0 -2
  150. package/dist/preview/chunk.4GGPPCMM.js +0 -1
  151. package/dist/preview/chunk.6K7EN2YI.js +0 -1
  152. package/dist/preview/chunk.6VC6AGYV.js +0 -5
  153. package/dist/preview/chunk.7BBGRTXM.js +0 -5
  154. package/dist/preview/chunk.7ECBGIUK.js +0 -1
  155. package/dist/preview/chunk.ARWBIBSI.js +0 -6
  156. package/dist/preview/chunk.BKVBX2YB.js +0 -1
  157. package/dist/preview/chunk.DM767F2Q.js +0 -21
  158. package/dist/preview/chunk.GUEHKCWN.js +0 -1
  159. package/dist/preview/chunk.HT2BEOEV.js +0 -25
  160. package/dist/preview/chunk.JOAN54PN.js +0 -1
  161. package/dist/preview/chunk.L7V24JPO.js +0 -1
  162. package/dist/preview/chunk.LA4CPZ2N.js +0 -1
  163. package/dist/preview/chunk.MV3AJ7JH.js +0 -1
  164. package/dist/preview/chunk.MYNQWWCL.js +0 -1
  165. package/dist/preview/chunk.OASYYMG5.js +0 -1
  166. package/dist/preview/chunk.PM3SYXKB.js +0 -1
  167. package/dist/preview/chunk.QB25SMP6.js +0 -1
  168. package/dist/preview/chunk.R7LFO7KI.js +0 -1
  169. package/dist/preview/chunk.S5MGE2U5.js +0 -1
  170. package/dist/preview/chunk.TXGNPW76.js +0 -1
  171. package/dist/preview/chunk.UGFDSE37.js +0 -1
  172. package/dist/preview/chunk.UKMVJV6Q.js +0 -1
  173. package/dist/preview/chunk.UUG3BYVN.js +0 -1
@@ -1 +1 @@
1
- import{a as v,b as y,c as m}from"./chunk.MB7LKKUD.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{G as N,Sa as c,T as u,Ua as b}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import{Vc as f}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as p}from"./chunk.AJZBJBMO.js";var l=p(N(),1);var t=p(u(),1);function z({notices:o,anchor:n,board:a}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w,{notices:o.filter(i=>i.kind==="banner"),at:"top",anchor:n,board:a}),(0,t.jsx)(w,{notices:o.filter(i=>i.kind==="toast"),at:"foot",anchor:n,board:a})]})}var h={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"};function w({notices:o,at:n,anchor:a,board:i}){let d=(0,l.useRef)(null),e=o.length>0;return(0,l.useLayoutEffect)(()=>{let r=d.current;if(!e||!r)return;if(typeof r.showPopover=="function"&&!c(r))try{r.showPopover()}catch{}let s=()=>(n==="top"?m:y)(r,a());s(),n==="foot"&&i.hold?.(()=>r.matches(":hover, :focus-within"));let S=b(r);addEventListener("resize",s),addEventListener("scroll",s,!0),n==="foot"&&addEventListener(v,s);let g=typeof ResizeObserver=="function"?new ResizeObserver(s):null;return g?.observe(r),()=>{if(S(),g?.disconnect(),removeEventListener("resize",s),removeEventListener("scroll",s,!0),removeEventListener(v,s),r.isConnected&&c(r))try{r.hidePopover()}catch{}}},[e,n,a,i]),e?(0,t.jsx)("div",{ref:d,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:f("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:o.map(r=>(0,t.jsx)(C,{notice:r,board:i},r.id))}):null}var T=o=>o.split(/\s+/).filter(Boolean).map(n=>n.replace(/^Meta\+/,"\u2318").replace(/^Control\+/,"Ctrl+").replace(/^Alt\+/,"Alt+")).join(" or ");function C({notice:o,board:n}){let a=o.tone??"info",i=[...o.action?[o.action]:[],...o.actions??[]],d=()=>n.dismiss(o.id);return(0,t.jsxs)("div",{"data-testid":"notice","data-kind":o.kind,"data-tone":a,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:o.kind==="banner"?"8px 10px 8px 14px":"10px 12px 10px 14px",borderRadius:"var(--graview-radius, 12px)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:`3px solid ${h[a]}`,background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:999,flex:"0 0 auto",background:h[a]}}),(0,t.jsx)("span",{style:{flex:"1 1 16rem",minWidth:0},children:o.sentence}),i.length>0?(0,t.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:i.map((e,r)=>e.href!==void 0?(0,t.jsx)("a",{href:e.href,...e.target?{target:e.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{e.onSelect?.(),d()},style:{...x,...r===0?k:{}},children:e.label},e.label):(0,t.jsx)("button",{type:"button","data-testid":"notice-action",...e.keys?{"aria-keyshortcuts":e.keys,title:`${e.label} \u2014 ${T(e.keys)}`}:{},onClick:()=>{d(),e.onSelect?.()},style:{...x,...r===0?k:{}},children:e.label},e.label))}):null,(0,t.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${o.sentence}`,title:"Dismiss",onClick:d,style:E,children:"\xD7"})]})}var x={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},k={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},E={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{z as NoticeStacks};
1
+ import{a as v,b as y,c as m}from"./chunk.MB7LKKUD.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{G as N,Sa as c,T as u,Ua as b}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import{Wc as f}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as p}from"./chunk.AJZBJBMO.js";var l=p(N(),1);var t=p(u(),1);function z({notices:o,anchor:n,board:a}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w,{notices:o.filter(i=>i.kind==="banner"),at:"top",anchor:n,board:a}),(0,t.jsx)(w,{notices:o.filter(i=>i.kind==="toast"),at:"foot",anchor:n,board:a})]})}var h={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"};function w({notices:o,at:n,anchor:a,board:i}){let d=(0,l.useRef)(null),e=o.length>0;return(0,l.useLayoutEffect)(()=>{let r=d.current;if(!e||!r)return;if(typeof r.showPopover=="function"&&!c(r))try{r.showPopover()}catch{}let s=()=>(n==="top"?m:y)(r,a());s(),n==="foot"&&i.hold?.(()=>r.matches(":hover, :focus-within"));let S=b(r);addEventListener("resize",s),addEventListener("scroll",s,!0),n==="foot"&&addEventListener(v,s);let g=typeof ResizeObserver=="function"?new ResizeObserver(s):null;return g?.observe(r),()=>{if(S(),g?.disconnect(),removeEventListener("resize",s),removeEventListener("scroll",s,!0),removeEventListener(v,s),r.isConnected&&c(r))try{r.hidePopover()}catch{}}},[e,n,a,i]),e?(0,t.jsx)("div",{ref:d,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:f("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:o.map(r=>(0,t.jsx)(C,{notice:r,board:i},r.id))}):null}var T=o=>o.split(/\s+/).filter(Boolean).map(n=>n.replace(/^Meta\+/,"\u2318").replace(/^Control\+/,"Ctrl+").replace(/^Alt\+/,"Alt+")).join(" or ");function C({notice:o,board:n}){let a=o.tone??"info",i=[...o.action?[o.action]:[],...o.actions??[]],d=()=>n.dismiss(o.id);return(0,t.jsxs)("div",{"data-testid":"notice","data-kind":o.kind,"data-tone":a,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:o.kind==="banner"?"8px 10px 8px 14px":"10px 12px 10px 14px",borderRadius:"var(--graview-radius, 12px)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:`3px solid ${h[a]}`,background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:999,flex:"0 0 auto",background:h[a]}}),(0,t.jsx)("span",{style:{flex:"1 1 16rem",minWidth:0},children:o.sentence}),i.length>0?(0,t.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:i.map((e,r)=>e.href!==void 0?(0,t.jsx)("a",{href:e.href,...e.target?{target:e.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{e.onSelect?.(),d()},style:{...x,...r===0?k:{}},children:e.label},e.label):(0,t.jsx)("button",{type:"button","data-testid":"notice-action",...e.keys?{"aria-keyshortcuts":e.keys,title:`${e.label} \u2014 ${T(e.keys)}`}:{},onClick:()=>{d(),e.onSelect?.()},style:{...x,...r===0?k:{}},children:e.label},e.label))}):null,(0,t.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${o.sentence}`,title:"Dismiss",onClick:d,style:E,children:"\xD7"})]})}var x={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},k={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},E={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{z as NoticeStacks};
@@ -1 +1 @@
1
- import{g as a}from"./chunk.QGV7H7RQ.js";import{c as p}from"./chunk.YIA2EDVF.js";import{Ia as d}from"./chunk.7BBGRTXM.js";function k(n){let r=new Map;for(let i of n.kinds){let e=n.tryDefinition(i),o=a(e),s=d(e);r.set(i,{fields:new Set(Object.keys(e?.fields?.shape??{})),edges:new Map(Object.entries(e?.edges??{}).map(([l,h])=>[l,h.cardinality??"many"])),...o?{computed:o}:{},...s.size>0?{linked:s}:{}})}let t=a(n);return t&&r.set(p,{computed:t}),r}export{k as a};
1
+ import{g as a}from"./chunk.HKINU7VO.js";import{c as p}from"./chunk.YGZCESXY.js";import{Ia as d}from"./chunk.X3MMJ3QC.js";function k(n){let r=new Map;for(let i of n.kinds){let e=n.tryDefinition(i),o=a(e),s=d(e);r.set(i,{fields:new Set(Object.keys(e?.fields?.shape??{})),edges:new Map(Object.entries(e?.edges??{}).map(([l,h])=>[l,h.cardinality??"many"])),...o?{computed:o}:{},...s.size>0?{linked:s}:{}})}let t=a(n);return t&&r.set(p,{computed:t}),r}export{k as a};
@@ -1,4 +1,4 @@
1
- import{a as qe,c as Be}from"./chunk.LO3U3P55.js";import{b as Ve}from"./chunk.I3WWCPQ2.js";import{a as Ie,b as Ke,c as Fe,d as j}from"./chunk.BTVBZ6KE.js";import"./chunk.3OYGXYQY.js";import{k as Me,l as Le}from"./chunk.UAP5M3CD.js";import"./chunk.GCBZ3WE2.js";import"./chunk.GDOTG7YA.js";import"./chunk.EPPXZZPK.js";import{e as Ee}from"./chunk.KFQSYCY3.js";import{m as Pe}from"./chunk.WQOI6BLM.js";import{a as Te,b as Oe}from"./chunk.LCPGZK7G.js";import{h as $e}from"./chunk.NKC3JILT.js";import{e as Se,f as Ne}from"./chunk.HEWVPXRE.js";import"./chunk.HJCQ6I3S.js";import"./chunk.HXRV3WVJ.js";import{e as ne}from"./chunk.MQ5HBUBL.js";import"./chunk.7SQAKSJD.js";import{a as xe}from"./chunk.PZG3B7F4.js";import"./chunk.LRUNFSHP.js";import"./chunk.43OKZU73.js";import"./chunk.WNSC3RWD.js";import"./chunk.ACYDJQRC.js";import"./chunk.S5MGE2U5.js";import"./chunk.34TW32TB.js";import{a as Ae,b as Ce,j as Re}from"./chunk.LY3YOWKV.js";import"./chunk.G4JJXA63.js";import"./chunk.LL2MLSPH.js";import"./chunk.EB4NVTJL.js";import"./chunk.VG7OWV2H.js";import"./chunk.KXPRILAO.js";import"./chunk.XU34T2H4.js";import"./chunk.XOZU4OFA.js";import"./chunk.BB33TI4S.js";import"./chunk.2EDC63RI.js";import"./chunk.WVUJXDXZ.js";import"./chunk.LDAYDCUO.js";import{a as ye}from"./chunk.KKNDX4JT.js";import"./chunk.GKSUTAIX.js";import"./chunk.5ICIMQE6.js";import"./chunk.QGV7H7RQ.js";import"./chunk.YIA2EDVF.js";import"./chunk.GZHZLJBF.js";import{r as ke}from"./chunk.ELERUERU.js";import"./chunk.OJGHDWI6.js";import"./chunk.YHTE34RN.js";import"./chunk.3YZHZGTM.js";import{d as te,l as be}from"./chunk.EQTSV7BK.js";import{c as me}from"./chunk.27CW6SCT.js";import{o as J,z as De}from"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{G as tt,Na as ee,Oa as Y,T as we,W as ve,ba as V,da as X,j as ge,l as ue,m as fe,ma as he,r as U}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import{K as se,Q as de,W as D,Ya as Z,ga as G,ia as le,ka as pe,ma as ce}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as Q}from"./chunk.AJZBJBMO.js";var f=Q(tt(),1);var nt=300,it=14,z=50,at=3,ot=2;function _e(e,n,o){let p=e.tryDefinition(n)?.fields?.shape;return(p?.[o]===void 0?void 0:ye(p[o]))?.type}var rt=(e,n)=>Object.keys(e.tryDefinition(n)?.fields?.shape??{}),st=e=>e==="date"||e==="datetime",Ge=/^(due|dueOn|dueAt|dueDate|deadline|by)$/i,dt=/^(date|on|day|when|at|start|starts|startsOn|startsAt|begins|from|sown|scheduled|scheduledFor|planned|plannedFor)$/i,lt=/^(done|finished|complete|completed|closed)$/i;function ae(e,n){let o=e.tryDefinition(n),p=rt(e,n),a=p.filter(u=>st(_e(e,n,u)));if(a.length===0)return;let i=o?.fieldRoles??{},s=u=>i[u]!==void 0&&a.includes(i[u])?i[u]:void 0,c=s("start")??s("when")??a.find(u=>Ge.test(u))??a.find(u=>dt.test(u));if(!c)return;let S=s("end")??a.find(u=>u!==c&&/^(end|ends|until|to|finish|finished|harvested|through)$/i.test(u)),g=p.find(u=>lt.test(u)&&_e(e,n,u)==="boolean");return{field:c,due:Ge.test(c),...S?{end:S}:{},...g?{done:g}:{}}}function ie(e,n){return Math.round((Date.parse(`${n.slice(0,10)}T00:00:00Z`)-Date.parse(`${e.slice(0,10)}T00:00:00Z`))/864e5)}var q=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}/.test(e)?e.slice(0,10):void 0;function je(e,n,o,p){let a=ne(e,n);if(a&&o.length>0&&o.length<=nt)return{shape:"board",field:a.field};let i=ae(e,n);if(i&&!i.due){let s=r=>{let y=q(r[i.field]),h=q(Z(r,i.field,p));return y&&h?ie(y,h):0},c=o.map(r=>({from:q(Z(r,i.field,p)),to:i.end&&q(r[i.end])?L(q(r[i.end]),s(r)):void 0})).filter(r=>r.from!==void 0).map(r=>({from:r.from,to:r.to&&r.to>r.from?r.to:r.from})),S=`${p.slice(0,7)}-01`,g=L(`${L(S,31).slice(0,7)}-01`,-1),u=c.filter(r=>r.from<=g&&r.to>=S),w=c.map(r=>ie(r.from,r.to)).sort((r,y)=>r-y),l=w[Math.floor(w.length/2)]??0;if(u.length>0&&l<=it){let r=L(p,-((new Date(`${p}T00:00:00Z`).getUTCDay()+6)%7)),y=L(r,6),h=u.every(m=>m.from>=r&&m.to<=y);return{shape:"calendar",start:i.field,...i.end?{end:i.end}:{},...i.done?{done:i.done}:{},range:h?"week":"month"}}}return{shape:"table"}}function ze(e,n){let o=ae(e,n);return o?{by:o.field,direction:o.due?"asc":"desc"}:void 0}function He(e,n,o={}){switch(n.shape){case"board":return{lens:"columns",kind:e,column:n.field};case"calendar":return{lens:"calendar",kind:e,start:n.start,...n.end?{end:n.end}:{},...n.done?{done:n.done}:{},range:n.range};case"table":return{lens:"blocks",kind:e,as:"row",...o.group?.by?{group:o.group.by}:{},...o.sort?{sort:{by:o.sort.by,...o.sort.direction==="desc"?{direction:"desc"}:{}}}:{}}}}var pt=60;function We(e,n,o,p){let a=e.tryDefinition(n),i=o.slice(0,pt),s=new Map;i.forEach(w=>{let l=G(a,w);te(w,a,{glance:!0,said:[l]}).forEach((r,y)=>{if(r.long||r.files||r.app)return;let h=s.get(r.key);h?h.count++:s.set(r.key,{label:r.label,count:1,at:y})})});let c=Math.max(1,Math.ceil(i.length/3)),S=[...s.entries()].filter(([,w])=>w.count>=c).sort((w,l)=>w[1].at-l[1].at).slice(0,at).map(([w,l])=>({about:"field",key:w,label:l.label})),g=new Map;for(let w of i){let l=new Set;for(let[r,y]of[["out",p.outEdges(w.id)],["in",p.inEdges(w.id)]])for(let h of y){let m=p.getNode(r==="out"?h.to:h.from);if(!m||m.id===w.id)continue;let b=`${h.kind}|${r}`;if(l.has(b))continue;l.add(b);let A=g.get(b);A?A.count++:g.set(b,{edge:h.kind,direction:r,far:m.kind,count:1})}}let u=[...g.entries()].sort((w,l)=>l[1].count-w[1].count).slice(0,ot).map(([w,l])=>{let r=me(e,l.direction==="out"?n:l.far,l.edge,l.direction);return{about:"edge",key:w,label:r.charAt(0).toUpperCase()+r.slice(1),edge:l.edge,direction:l.direction}});return[...S,...u]}function Ze(e,n,o,p){if(o.about==="field"){let s=e.tryDefinition(n.kind);return{text:te(n,s,{excerpt:!0}).find(S=>S.key===o.key)?.value??""}}let i=(o.direction==="out"?p.outEdges(n.id):p.inEdges(n.id)).filter(s=>s.kind===o.edge).map(s=>p.getNode(o.direction==="out"?s.to:s.from)).filter(s=>s!==void 0).map(s=>G(e.tryDefinition(s.kind),s));return i.length===0?{text:""}:i.length===1?{text:i[0]}:{text:`${i[0]} +${i.length-1}`,title:i.join(", ")}}function Ue(e,n,o=()=>{}){let p=new Map;for(let a of e){let i=a.nodeIds.filter(c=>n.has(c));if(i.length===0&&!(a.subjectId!==void 0&&n.has(a.subjectId)))continue;let s=p.get(a.invariant)??{invariant:a.invariant,label:o(a.invariant)||a.label||a.message,violations:[],records:new Set};s.violations.push(a);for(let c of i)s.records.add(c);a.subjectId!==void 0&&n.has(a.subjectId)&&s.records.add(a.subjectId),p.set(a.invariant,s)}return[...p.values()].sort((a,i)=>i.violations.length-a.violations.length).map(a=>({invariant:a.invariant,label:a.label,violations:a.violations,records:[...a.records]}))}var Ye=6;function Je(e,n,o,p){let a=ae(e,n);if(!a)return;let i=ne(e,n),s=g=>{if(a.done!==void 0&&g[a.done]===!0)return!0;if(!i)return!1;let u=i.values.indexOf(String(g[i.field]));return u>=0&&i.tiers[u]==="done"},c=0,S=0;for(let g of o){let u=q(Z(g,a.field,p));if(!u||s(g))continue;let w=ie(p,u);a.due&&w<0?c++:w>=0&&w<=Ye&&S++}if(!(c===0&&S===0))return{field:a.field,due:a.due,overdue:c,soon:S}}function L(e,n){return new Date(Date.parse(`${e.slice(0,10)}T00:00:00Z`)+n*864e5).toISOString().slice(0,10)}function oe(e,n,o){return n==="overdue"?[{key:e.field,value:`before:${o}`}]:[{key:e.field,value:`after:${L(o,-1)}`},{key:e.field,value:`before:${L(o,Ye+1)}`}]}function Qe(e,n,o,p){let a=new Set,i=new Set;for(let s of e)if(!(s.at<=o))for(let c of s.primitives)c.op==="add-node"&&c.node?.kind===n?a.add(c.node.id):(c.op==="patch-node"||c.op==="splice-text")&&c.id!==void 0&&p(c.id)===n&&i.add(c.id);for(let s of a)i.delete(s);return{added:[...a].filter(s=>p(s)===n).length,changed:[...i].filter(s=>p(s)===n).length}}var t=Q(we(),1),Xe="as",ct=(e,n)=>`graview:kind-seen:${e}:${n}`;function gt(e){try{return localStorage.getItem(e)}catch{return null}}function ut(e,n){try{localStorage.setItem(e,n)}catch{}}var ft=(e,n)=>({...ge(fe(e,!1),n),relation:null});function Yt({kind:e,members:n,flagged:o=[],label:p,retired:a=0}){let{store:i,brand:s,principal:c,views:S,view:g}=V(),{go:u}=Y(),w=X(),l=i.schema,r=l.tryDefinition(e),y=p??pe(l,e),h=i.today()??se(),m=n,b=(0,f.useId)(),A=(0,f.useMemo)(()=>je(l,e,m,h),[l,e,m,h]),x=g.within?.[Xe]==="table"?{shape:"table"}:A,k=Te(g),C=x.shape==="table"&&!k.sort?ze(l,e):void 0,v=C?{...k,sort:C}:k,R=(0,f.useMemo)(()=>new Set(o),[o]),T=(0,f.useMemo)(()=>$e(m,v,{schema:l,graph:i.graph,flagged:R,today:h}),[m,v,l,i,R,h,w]),I=(0,f.useMemo)(()=>Ne(l,Se(l,e)),[l,e]),M=S.arrangement?.()?.lists?.[e]?.filters,K=$=>u(Oe(g,$)),B=(0,f.useMemo)(()=>({name:s?.name??"app",schema:l,...i.policy?{policy:i.policy}:{}}),[s,l,i]),H=JSON.stringify(He(e,x,v)),P=(0,f.useMemo)(()=>{let $=Re(JSON.parse(H),{app:B,sight:Ce(B,c)});return Ae($)?void 0:$},[H,B,c]),W=x.shape!=="table"&&P!==void 0;return(0,t.jsxs)("section",{"aria-labelledby":b,className:"graview-kind-stop","data-testid":"kind-stop","data-graview-kind-stop":e,"data-graview-shape":x.shape,children:[(0,t.jsx)("style",{children:St}),(0,t.jsx)(wt,{kind:e,plural:y,count:m.length,headingId:b,description:r?.description}),(0,t.jsx)(ht,{kind:e,plural:y,members:m,today:h,arrangement:v,onArrange:K}),(m.length>1||a>0)&&!W?(0,t.jsx)(Pe,{schema:l,graph:i.graph,kind:e,arrangement:v,onChange:K,offers:I,...M?{filters:M}:{},kept:{shown:T.nodes.length,of:m.length},testId:"kind-arrange",chips:{nodes:m,flagged:R,today:h},...a>0?{past:{count:a,widen:()=>u(Ee(g,!0))}}:{}}):null,m.length>0?(0,t.jsx)(yt,{derived:A,shape:x,draft:P}):null,(0,t.jsx)("div",{className:"graview-kind-stop-body","data-testid":"kind-stop-body",children:m.length===0?(0,t.jsx)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-empty",children:"Nothing here yet."}):W?(0,t.jsx)(kt,{draft:P,nodes:m}):T.nodes.length===0?(0,t.jsxs)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-none-kept",children:["None of the ",D(m.length)," ",y.toLowerCase()," ",v.query?`says \u201C${v.query}\u201D`:"is kept by these filters","."," ",(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link",onClick:()=>K({}),children:"Show them all"})]}):(0,t.jsx)(xt,{kind:e,nodes:T.nodes,groups:T.grouped?T.groups.map($=>({key:$.key,label:$.label,nodes:$.nodes})):void 0,flagged:R,plural:y,arrangement:v})})]})}function wt({kind:e,plural:n,count:o,headingId:p,description:a}){let{store:i,setSelection:s,setMenuAt:c}=V(),S=(0,f.useMemo)(()=>({about:[U(e)]}),[e]),{affordances:g}=Me(S),{apply:u,preview:w}=Le(),l=(0,f.useMemo)(()=>{let x=k=>i.allMutations().find(C=>C.name===k.mutation)?.creates?.includes(e)??!1;return g.find(k=>!k.destructive&&!k.setsAside&&x(k))},[g,i,e]),[r,y]=(0,f.useState)(!1),[h,m]=(0,f.useState)(null),b=(0,f.useRef)(null),A=(0,f.useRef)(null);(0,f.useEffect)(()=>{let x=A.current;!x||x.closest('[data-testid="kind-stop"]')?.contains(document.activeElement)||x.focus({preventScroll:!0})},[e]);let O=(x,k)=>{try{w(x,k),u(x,k),m(null),y(!1),requestAnimationFrame(()=>b.current?.focus())}catch(C){return m(be(i.schema,i.allMutations(),C)),[]}};return(0,t.jsxs)("header",{className:"graview-kind-stop-head",children:[(0,t.jsxs)("div",{className:"graview-kind-stop-title",children:[(0,t.jsx)("h2",{id:p,ref:A,tabIndex:-1,"data-testid":"kind-stop-title",children:n}),(0,t.jsxs)("p",{"data-testid":"kind-stop-count",children:[le(i.schema,e,o),a?` \xB7 ${a}`:""]})]}),(0,t.jsxs)("div",{className:"graview-kind-stop-acts",children:[l?(0,t.jsx)("button",{ref:b,type:"button",className:"graview-kind-stop-primary","data-testid":"kind-stop-primary","data-affordance":l.id,"aria-expanded":l.open.length>0?r:void 0,onClick:()=>{m(null),l.open.length===0?O(l):y(x=>!x)},children:l.label}):null,(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-quiet","data-testid":"kind-stop-acts","aria-haspopup":"menu","aria-label":`What can be done with the ${n.toLowerCase()}`,onClick:x=>{let k=x.currentTarget.getBoundingClientRect();s([U(e)]),c({x:Math.round(k.left),y:Math.round(k.bottom+4),on:U(e)})},children:"Acts\u2026"})]}),r&&l?(0,t.jsx)("div",{className:"graview-kind-stop-ask","data-testid":"kind-stop-ask","aria-label":l.label,role:"group",children:(0,t.jsx)(xe,{affordance:l,onApply:x=>O(l,x),onCancel:()=>{y(!1),b.current?.focus()}})}):null,h?(0,t.jsx)("p",{role:"alert",className:"graview-kind-stop-failed","data-testid":"kind-stop-failed",children:h}):null]})}var vt=J.part((e,n)=>(0,t.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"});function ht({kind:e,plural:n,members:o,today:p,arrangement:a,onArrange:i}){let{store:s,brand:c,setSelection:S}=V(),g=s.schema,u=ee(),w=(0,f.useMemo)(()=>new Set(o.map(v=>v.id)),[o]),l=(0,f.useMemo)(()=>Ue(u,w,v=>s.allInvariants().find(R=>R.name===v)?.label),[u,w,s]),r=(0,f.useMemo)(()=>Je(g,e,o,p),[g,e,o,p]),y=ct(De(c,g),e),[h]=(0,f.useState)(()=>gt(y));(0,f.useEffect)(()=>()=>ut(y,new Date().toISOString()),[y]);let m=X(),b=(0,f.useMemo)(()=>h?Qe(s.log.all(),e,h,v=>s.graph.getNode(v)?.kind):null,[h,s,e,m]),[A,O]=(0,f.useState)(null),x=v=>i({...a,filter:[...(a.filter??[]).filter(R=>!v?.some(T=>T.key===R.key)),...v??[]]}),k=l.reduce((v,R)=>v+R.violations.length,0),C=[];if(r&&(r.overdue>0||r.soon>0)){let v=r.field;C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-dates",children:[r.overdue>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact","data-tone":"warn",onClick:()=>x(oe(r,"overdue",p)),"aria-label":`${D(r.overdue)} overdue \u2014 show only these`,children:[D(r.overdue)," overdue"]}):null,r.soon>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact",onClick:()=>x(oe(r,"soon",p)),"aria-label":`${D(r.soon)} in the next 7 days \u2014 show only these`,children:[D(r.soon)," ",r.due?"due":""," in the next 7 days"]}):null,(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" by ",ce(g.tryDefinition(e),v).toLowerCase()]})]},"dates"))}if(l.length>0&&C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-problems","data-graview-problems":k,children:[(0,t.jsxs)("span",{className:"graview-kind-stop-warn",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0 "}),k===1?"1 problem":`${D(k)} problems`]}),(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" in ",n.toLowerCase(),":"]}),(0,t.jsx)("ul",{className:"graview-kind-stop-rules",children:l.map(v=>(0,t.jsx)(mt,{group:v,open:A===v.invariant,onToggle:()=>O(R=>R===v.invariant?null:v.invariant),onPick:R=>S([R])},v.invariant))}),(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-only-problems",onClick:()=>x([{key:"is",value:"flagged"}]),children:["Show only the ",n.toLowerCase()," with a problem"]})]},"problems")),b&&(b.added>0||b.changed>0)){let v=[b.added>0?`${D(b.added)} added`:"",b.changed>0?`${D(b.changed)} changed`:""].filter(Boolean);C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-since",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["Since you last looked (",de(h.slice(0,10)),"):"]})," ",v.join(", ")]},"since"))}return C.length===0?null:(0,t.jsx)("ul",{className:"graview-kind-stop-going-on","aria-label":`What is going on in the ${n.toLowerCase()}`,"data-testid":"kind-stop-going-on",children:C})}function mt({group:e,open:n,onToggle:o,onPick:p}){let a=(0,f.useId)();return(0,t.jsxs)("li",{"data-graview-rule":e.invariant,children:[(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-rule","aria-expanded":n,"aria-controls":a,onClick:o,onPointerEnter:J.prefetch,onFocus:J.prefetch,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"graview-kind-stop-chevron","data-open":n||void 0,children:"\u203A"}),e.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(e.violations.length)]})]}),n?(0,t.jsx)("ol",{id:a,className:"graview-kind-stop-problem-rows","data-testid":"kind-stop-problem-rows",children:(0,t.jsx)(f.Suspense,{fallback:null,children:(0,t.jsx)(vt,{violations:e.violations,pick:i=>{let s=i.subjectId??e.records[0]??i.nodeIds[0];s!==void 0&&p(s)}})})}):null]})}var bt={board:"Board",calendar:"Calendar",table:"Table"};function yt({derived:e,shape:n,draft:o}){let{view:p}=V(),{go:a}=Y(),{keep:i}=qe(Be()),[s,c]=(0,f.useState)(!1),S=e.shape==="table"?[]:[e.shape,"table"];return(0,t.jsxs)("div",{className:"graview-kind-stop-shape","data-testid":"kind-stop-shape",children:[S.length>0?(0,t.jsx)("span",{role:"group","aria-label":"Show as",className:"graview-kind-stop-switch",children:S.map(g=>(0,t.jsx)("button",{type:"button","aria-pressed":n.shape===g,"data-testid":`kind-stop-as-${g}`,onClick:()=>a(ue(p,Xe,g===e.shape?null:g)),children:bt[g]},g))}):null,(0,t.jsx)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-derived",children:o?`${o.said.replace(/\.$/,"")}, derived from the declaration`:"Derived from the declaration"}),o?(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-keep",disabled:s,title:`Keep \u201C${o.title}\u201D as a lens: a place of its own`,onClick:()=>{c(!0),i(o).finally(()=>c(!1))},children:"Keep as a lens"}):null]})}function kt({draft:e,nodes:n}){let o=Ve(e.drawn);return(0,t.jsx)("div",{className:"graview-kind-stop-lens","data-graview-draft":e.lens.name,children:(0,t.jsx)(ve,{mode:"scene",children:(0,t.jsx)(ke,{kind:e.kind,view:e.title,children:(0,t.jsx)(o,{nodes:n,label:e.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})})}function xt({kind:e,nodes:n,groups:o,flagged:p,plural:a,arrangement:i}){let{store:s,views:c,view:S,selection:g,setSelection:u,setMenuAt:w,principal:l}=V(),{go:r}=Y(),y=s.schema,h=s.graph,m=(0,f.useMemo)(()=>(o?o.flatMap(d=>d.nodes):n).map(d=>d.id),[n,o]),b=Ie(m),A=(0,f.useMemo)(()=>s.permittedMutations(l).some(d=>{let N=d.subject?.kinds;return N!==void 0&&(N==="*"||N.includes(e))}),[s,l,e]),O=(0,f.useRef)(null),x=d=>{b.choose(d),requestAnimationFrame(()=>{let N=b.list.current;((d[0]===void 0?null:N?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??N)?.focus({preventScroll:!0})})},k=b.chosen.length,C=c.lookup(e,{cardinality:"one",fidelity:"glyph"}),v=C!==void 0&&!he(C)?C:void 0,R=d=>g.includes(d),T=ee(),I=(0,f.useMemo)(()=>We(y,e,n,h),[y,e,n,h]),[M,K]=(0,f.useState)(z);(0,f.useEffect)(()=>K(z),[i.query,i.filter?.length,i.sort?.by,i.group?.by]);let B=y.tryDefinition(e),H=d=>T.filter(N=>N.nodeIds.includes(d)||N.subjectId===d).map(N=>N.message),P=i.sort?.by,W=`${a}${i.sort?`, in order of ${I.find(d=>d.key===P)?.label.toLowerCase()??P}`:""}`,$=M,et=d=>{let N=G(B,d),F=p.has(d.id)?H(d.id):[];return(0,t.jsxs)("tr",{"data-graview-pick":d.id,tabIndex:-1,"data-graview-record":d.id,"data-flagged":F.length>0||void 0,...A?{"data-graview-choose":d.id}:{},children:[A?(0,t.jsx)("td",{className:"graview-choose-at",children:(0,t.jsx)("input",{...b.boxProps(d.id,N),onPointerEnter:j,onFocus:j})}):null,(0,t.jsxs)("th",{scope:"row",className:"graview-kind-stop-name",children:[v?(0,t.jsx)("div",{"data-graview-pick":d.id,className:"graview-kind-stop-own-row",children:(0,t.jsx)(v,{node:d,cardinality:"one",fidelity:"glyph",mode:"scene",selected:R(d.id),...F.length>0?{flagged:[d.id]}:{}})}):(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-go",title:`Go to ${N}`,onClick:()=>r(ft(S,d.id)),children:N}),F.length>0?(0,t.jsxs)("span",{className:"graview-kind-stop-flag",title:F.join(" \xB7 "),children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0"}),(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:`Problem: ${F.join(". ")}`})]}):null]}),I.map(_=>{let E=Ze(y,d,_,h);return(0,t.jsx)("td",{"data-label":_.label,"data-short":E.text.length>0&&E.text.length<=14||void 0,"data-empty":E.text?void 0:"",...E.title?{title:E.title}:{},children:E.text?(0,t.jsx)("span",{children:E.text}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{"aria-hidden":"true",children:"\u2014"}),(0,t.jsx)("i",{className:"graview-kind-stop-hidden",children:"none"})]})},_.key)}),(0,t.jsx)("td",{className:"graview-kind-stop-row-acts",children:(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-acts","aria-haspopup":"menu","aria-label":`What can be done with ${N}`,onClick:_=>{let E=_.currentTarget.getBoundingClientRect();u([d.id]),w({x:Math.round(E.left),y:Math.round(E.bottom+4),on:d.id})},children:(0,t.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})})})]},d.id)},re=d=>{let N=d.slice(0,Math.max(0,$));return $-=N.length,N.map(et)};return(0,t.jsxs)("div",{className:"graview-kind-stop-table-at",...A?{...b.listProps,ref:d=>{O.current=d,b.list.current=d},tabIndex:-1,role:"group","aria-label":k>0?`${a}, ${k} chosen`:a,"data-graview-choosable":""}:{},children:[A?(0,t.jsx)("style",{children:Ke}):null,(0,t.jsxs)("table",{className:"graview-kind-stop-table","data-testid":"kind-stop-table",children:[(0,t.jsx)("caption",{className:"graview-kind-stop-hidden",children:W}),(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[A?(0,t.jsx)("td",{className:"graview-choose-at graview-choose-all",children:(0,t.jsx)("input",{type:"checkbox",className:"graview-choose-box","data-testid":"kind-stop-choose-all","aria-label":`Choose all ${D(n.length)} ${a.toLowerCase()}`,checked:k>0&&k===n.length,ref:d=>{d&&(d.indeterminate=k>0&&k<n.length)},onPointerEnter:j,onFocus:j,onChange:()=>k===n.length?b.clear():b.choose(m)})}):null,(0,t.jsx)("th",{scope:"col","aria-sort":P==="label"?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:"Name"}),I.map(d=>(0,t.jsx)("th",{scope:"col","aria-sort":d.about==="field"&&d.key===P?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:d.label},d.key)),(0,t.jsx)("th",{scope:"col",children:(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:"Acts"})})]})}),o?o.map(d=>$<=0?null:(0,t.jsxs)("tbody",{"data-graview-group":d.key,children:[(0,t.jsx)("tr",{className:"graview-kind-stop-group",children:(0,t.jsxs)("th",{scope:"rowgroup",colSpan:I.length+(A?3:2),children:[d.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(d.nodes.length)]})]})}),re(d.nodes)]},d.key||"-")):(0,t.jsx)("tbody",{children:re(n)})]}),A?(0,t.jsx)(Fe,{store:s,chosen:b.chosen,principal:l,anchor:()=>O.current?.closest('[data-testid="kind-stop"]')??null,of:m.length,onChooseAll:()=>b.choose(m),onClear:b.clear,onActed:x}):null,n.length>M?(0,t.jsxs)("p",{className:"graview-kind-stop-more",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-shown",children:[D(M)," of ",D(n.length)," shown"]})," ",(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-more",onClick:()=>K(d=>d+z),children:["Show ",D(Math.min(z,n.length-M))," more"]})]}):null]})}var St=`
1
+ import{a as qe,c as Be}from"./chunk.UHUBQ4EX.js";import{b as Ve}from"./chunk.ZUKYMU6C.js";import{a as Ie,b as Ke,c as Fe,d as j}from"./chunk.XOTES3PI.js";import"./chunk.WGTBQHHE.js";import{k as Me,l as Le}from"./chunk.P52UTBNO.js";import"./chunk.HF5SNUTK.js";import"./chunk.S7ZLGODY.js";import"./chunk.2QESVWUW.js";import{e as Ee}from"./chunk.UM5H2VVR.js";import{m as Pe}from"./chunk.WEGPDJTB.js";import{a as Te,b as Oe}from"./chunk.MRYN42EQ.js";import{h as $e}from"./chunk.E22DDEQI.js";import{e as Se,f as Ne}from"./chunk.OLW44AP5.js";import"./chunk.HJCQ6I3S.js";import"./chunk.ATVPAYS6.js";import{e as ne}from"./chunk.VNBEAF62.js";import"./chunk.CZH27V2R.js";import{a as xe}from"./chunk.OVSZXILB.js";import"./chunk.BDBLGGFJ.js";import"./chunk.D3AISGQH.js";import"./chunk.IZ2ZTNEV.js";import"./chunk.6E36I2GC.js";import"./chunk.CJUIJ6TL.js";import"./chunk.IIESMHXY.js";import{a as Ae,b as Ce,j as Re}from"./chunk.NIFQDN6R.js";import"./chunk.G4JJXA63.js";import"./chunk.LDYOQCY7.js";import"./chunk.VFRURRNI.js";import"./chunk.X2G4ZRB2.js";import"./chunk.UITZ74YJ.js";import"./chunk.2NJDT47T.js";import"./chunk.XOZU4OFA.js";import"./chunk.MHILFBK6.js";import"./chunk.ZFH4SCCF.js";import"./chunk.WVUJXDXZ.js";import"./chunk.Q6LLURRM.js";import{a as ye}from"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.GZHZLJBF.js";import{r as ke}from"./chunk.KHZA5F7A.js";import"./chunk.OJGHDWI6.js";import"./chunk.KSVJHSRH.js";import"./chunk.NSGQXCH6.js";import{d as te,l as be}from"./chunk.SZG6HJWH.js";import{c as me}from"./chunk.2FOIJ5ID.js";import{o as J,z as De}from"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{G as tt,Na as ee,Oa as Y,T as we,W as ve,ba as V,da as X,j as ge,l as ue,m as fe,ma as he,r as U}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import{K as se,Q as de,W as D,Ya as Z,ga as G,ia as le,ka as pe,ma as ce}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as Q}from"./chunk.AJZBJBMO.js";var f=Q(tt(),1);var nt=300,it=14,z=50,at=3,ot=2;function _e(e,n,o){let p=e.tryDefinition(n)?.fields?.shape;return(p?.[o]===void 0?void 0:ye(p[o]))?.type}var rt=(e,n)=>Object.keys(e.tryDefinition(n)?.fields?.shape??{}),st=e=>e==="date"||e==="datetime",Ge=/^(due|dueOn|dueAt|dueDate|deadline|by)$/i,dt=/^(date|on|day|when|at|start|starts|startsOn|startsAt|begins|from|sown|scheduled|scheduledFor|planned|plannedFor)$/i,lt=/^(done|finished|complete|completed|closed)$/i;function ae(e,n){let o=e.tryDefinition(n),p=rt(e,n),a=p.filter(u=>st(_e(e,n,u)));if(a.length===0)return;let i=o?.fieldRoles??{},s=u=>i[u]!==void 0&&a.includes(i[u])?i[u]:void 0,c=s("start")??s("when")??a.find(u=>Ge.test(u))??a.find(u=>dt.test(u));if(!c)return;let S=s("end")??a.find(u=>u!==c&&/^(end|ends|until|to|finish|finished|harvested|through)$/i.test(u)),g=p.find(u=>lt.test(u)&&_e(e,n,u)==="boolean");return{field:c,due:Ge.test(c),...S?{end:S}:{},...g?{done:g}:{}}}function ie(e,n){return Math.round((Date.parse(`${n.slice(0,10)}T00:00:00Z`)-Date.parse(`${e.slice(0,10)}T00:00:00Z`))/864e5)}var q=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}/.test(e)?e.slice(0,10):void 0;function je(e,n,o,p){let a=ne(e,n);if(a&&o.length>0&&o.length<=nt)return{shape:"board",field:a.field};let i=ae(e,n);if(i&&!i.due){let s=r=>{let y=q(r[i.field]),h=q(Z(r,i.field,p));return y&&h?ie(y,h):0},c=o.map(r=>({from:q(Z(r,i.field,p)),to:i.end&&q(r[i.end])?L(q(r[i.end]),s(r)):void 0})).filter(r=>r.from!==void 0).map(r=>({from:r.from,to:r.to&&r.to>r.from?r.to:r.from})),S=`${p.slice(0,7)}-01`,g=L(`${L(S,31).slice(0,7)}-01`,-1),u=c.filter(r=>r.from<=g&&r.to>=S),w=c.map(r=>ie(r.from,r.to)).sort((r,y)=>r-y),l=w[Math.floor(w.length/2)]??0;if(u.length>0&&l<=it){let r=L(p,-((new Date(`${p}T00:00:00Z`).getUTCDay()+6)%7)),y=L(r,6),h=u.every(m=>m.from>=r&&m.to<=y);return{shape:"calendar",start:i.field,...i.end?{end:i.end}:{},...i.done?{done:i.done}:{},range:h?"week":"month"}}}return{shape:"table"}}function ze(e,n){let o=ae(e,n);return o?{by:o.field,direction:o.due?"asc":"desc"}:void 0}function He(e,n,o={}){switch(n.shape){case"board":return{lens:"columns",kind:e,column:n.field};case"calendar":return{lens:"calendar",kind:e,start:n.start,...n.end?{end:n.end}:{},...n.done?{done:n.done}:{},range:n.range};case"table":return{lens:"blocks",kind:e,as:"row",...o.group?.by?{group:o.group.by}:{},...o.sort?{sort:{by:o.sort.by,...o.sort.direction==="desc"?{direction:"desc"}:{}}}:{}}}}var pt=60;function We(e,n,o,p){let a=e.tryDefinition(n),i=o.slice(0,pt),s=new Map;i.forEach(w=>{let l=G(a,w);te(w,a,{glance:!0,said:[l]}).forEach((r,y)=>{if(r.long||r.files||r.app)return;let h=s.get(r.key);h?h.count++:s.set(r.key,{label:r.label,count:1,at:y})})});let c=Math.max(1,Math.ceil(i.length/3)),S=[...s.entries()].filter(([,w])=>w.count>=c).sort((w,l)=>w[1].at-l[1].at).slice(0,at).map(([w,l])=>({about:"field",key:w,label:l.label})),g=new Map;for(let w of i){let l=new Set;for(let[r,y]of[["out",p.outEdges(w.id)],["in",p.inEdges(w.id)]])for(let h of y){let m=p.getNode(r==="out"?h.to:h.from);if(!m||m.id===w.id)continue;let b=`${h.kind}|${r}`;if(l.has(b))continue;l.add(b);let A=g.get(b);A?A.count++:g.set(b,{edge:h.kind,direction:r,far:m.kind,count:1})}}let u=[...g.entries()].sort((w,l)=>l[1].count-w[1].count).slice(0,ot).map(([w,l])=>{let r=me(e,l.direction==="out"?n:l.far,l.edge,l.direction);return{about:"edge",key:w,label:r.charAt(0).toUpperCase()+r.slice(1),edge:l.edge,direction:l.direction}});return[...S,...u]}function Ze(e,n,o,p){if(o.about==="field"){let s=e.tryDefinition(n.kind);return{text:te(n,s,{excerpt:!0}).find(S=>S.key===o.key)?.value??""}}let i=(o.direction==="out"?p.outEdges(n.id):p.inEdges(n.id)).filter(s=>s.kind===o.edge).map(s=>p.getNode(o.direction==="out"?s.to:s.from)).filter(s=>s!==void 0).map(s=>G(e.tryDefinition(s.kind),s));return i.length===0?{text:""}:i.length===1?{text:i[0]}:{text:`${i[0]} +${i.length-1}`,title:i.join(", ")}}function Ue(e,n,o=()=>{}){let p=new Map;for(let a of e){let i=a.nodeIds.filter(c=>n.has(c));if(i.length===0&&!(a.subjectId!==void 0&&n.has(a.subjectId)))continue;let s=p.get(a.invariant)??{invariant:a.invariant,label:o(a.invariant)||a.label||a.message,violations:[],records:new Set};s.violations.push(a);for(let c of i)s.records.add(c);a.subjectId!==void 0&&n.has(a.subjectId)&&s.records.add(a.subjectId),p.set(a.invariant,s)}return[...p.values()].sort((a,i)=>i.violations.length-a.violations.length).map(a=>({invariant:a.invariant,label:a.label,violations:a.violations,records:[...a.records]}))}var Ye=6;function Je(e,n,o,p){let a=ae(e,n);if(!a)return;let i=ne(e,n),s=g=>{if(a.done!==void 0&&g[a.done]===!0)return!0;if(!i)return!1;let u=i.values.indexOf(String(g[i.field]));return u>=0&&i.tiers[u]==="done"},c=0,S=0;for(let g of o){let u=q(Z(g,a.field,p));if(!u||s(g))continue;let w=ie(p,u);a.due&&w<0?c++:w>=0&&w<=Ye&&S++}if(!(c===0&&S===0))return{field:a.field,due:a.due,overdue:c,soon:S}}function L(e,n){return new Date(Date.parse(`${e.slice(0,10)}T00:00:00Z`)+n*864e5).toISOString().slice(0,10)}function oe(e,n,o){return n==="overdue"?[{key:e.field,value:`before:${o}`}]:[{key:e.field,value:`after:${L(o,-1)}`},{key:e.field,value:`before:${L(o,Ye+1)}`}]}function Qe(e,n,o,p){let a=new Set,i=new Set;for(let s of e)if(!(s.at<=o))for(let c of s.primitives)c.op==="add-node"&&c.node?.kind===n?a.add(c.node.id):(c.op==="patch-node"||c.op==="splice-text")&&c.id!==void 0&&p(c.id)===n&&i.add(c.id);for(let s of a)i.delete(s);return{added:[...a].filter(s=>p(s)===n).length,changed:[...i].filter(s=>p(s)===n).length}}var t=Q(we(),1),Xe="as",ct=(e,n)=>`graview:kind-seen:${e}:${n}`;function gt(e){try{return localStorage.getItem(e)}catch{return null}}function ut(e,n){try{localStorage.setItem(e,n)}catch{}}var ft=(e,n)=>({...ge(fe(e,!1),n),relation:null});function Yt({kind:e,members:n,flagged:o=[],label:p,retired:a=0}){let{store:i,brand:s,principal:c,views:S,view:g}=V(),{go:u}=Y(),w=X(),l=i.schema,r=l.tryDefinition(e),y=p??pe(l,e),h=i.today()??se(),m=n,b=(0,f.useId)(),A=(0,f.useMemo)(()=>je(l,e,m,h),[l,e,m,h]),x=g.within?.[Xe]==="table"?{shape:"table"}:A,k=Te(g),C=x.shape==="table"&&!k.sort?ze(l,e):void 0,v=C?{...k,sort:C}:k,R=(0,f.useMemo)(()=>new Set(o),[o]),T=(0,f.useMemo)(()=>$e(m,v,{schema:l,graph:i.graph,flagged:R,today:h}),[m,v,l,i,R,h,w]),I=(0,f.useMemo)(()=>Ne(l,Se(l,e)),[l,e]),M=S.arrangement?.()?.lists?.[e]?.filters,K=$=>u(Oe(g,$)),B=(0,f.useMemo)(()=>({name:s?.name??"app",schema:l,...i.policy?{policy:i.policy}:{}}),[s,l,i]),H=JSON.stringify(He(e,x,v)),P=(0,f.useMemo)(()=>{let $=Re(JSON.parse(H),{app:B,sight:Ce(B,c)});return Ae($)?void 0:$},[H,B,c]),W=x.shape!=="table"&&P!==void 0;return(0,t.jsxs)("section",{"aria-labelledby":b,className:"graview-kind-stop","data-testid":"kind-stop","data-graview-kind-stop":e,"data-graview-shape":x.shape,children:[(0,t.jsx)("style",{children:St}),(0,t.jsx)(wt,{kind:e,plural:y,count:m.length,headingId:b,description:r?.description}),(0,t.jsx)(ht,{kind:e,plural:y,members:m,today:h,arrangement:v,onArrange:K}),(m.length>1||a>0)&&!W?(0,t.jsx)(Pe,{schema:l,graph:i.graph,kind:e,arrangement:v,onChange:K,offers:I,...M?{filters:M}:{},kept:{shown:T.nodes.length,of:m.length},testId:"kind-arrange",chips:{nodes:m,flagged:R,today:h},...a>0?{past:{count:a,widen:()=>u(Ee(g,!0))}}:{}}):null,m.length>0?(0,t.jsx)(yt,{derived:A,shape:x,draft:P}):null,(0,t.jsx)("div",{className:"graview-kind-stop-body","data-testid":"kind-stop-body",children:m.length===0?(0,t.jsx)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-empty",children:"Nothing here yet."}):W?(0,t.jsx)(kt,{draft:P,nodes:m}):T.nodes.length===0?(0,t.jsxs)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-none-kept",children:["None of the ",D(m.length)," ",y.toLowerCase()," ",v.query?`says \u201C${v.query}\u201D`:"is kept by these filters","."," ",(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link",onClick:()=>K({}),children:"Show them all"})]}):(0,t.jsx)(xt,{kind:e,nodes:T.nodes,groups:T.grouped?T.groups.map($=>({key:$.key,label:$.label,nodes:$.nodes})):void 0,flagged:R,plural:y,arrangement:v})})]})}function wt({kind:e,plural:n,count:o,headingId:p,description:a}){let{store:i,setSelection:s,setMenuAt:c}=V(),S=(0,f.useMemo)(()=>({about:[U(e)]}),[e]),{affordances:g}=Me(S),{apply:u,preview:w}=Le(),l=(0,f.useMemo)(()=>{let x=k=>i.allMutations().find(C=>C.name===k.mutation)?.creates?.includes(e)??!1;return g.find(k=>!k.destructive&&!k.setsAside&&x(k))},[g,i,e]),[r,y]=(0,f.useState)(!1),[h,m]=(0,f.useState)(null),b=(0,f.useRef)(null),A=(0,f.useRef)(null);(0,f.useEffect)(()=>{let x=A.current;!x||x.closest('[data-testid="kind-stop"]')?.contains(document.activeElement)||x.focus({preventScroll:!0})},[e]);let O=(x,k)=>{try{w(x,k),u(x,k),m(null),y(!1),requestAnimationFrame(()=>b.current?.focus())}catch(C){return m(be(i.schema,i.allMutations(),C)),[]}};return(0,t.jsxs)("header",{className:"graview-kind-stop-head",children:[(0,t.jsxs)("div",{className:"graview-kind-stop-title",children:[(0,t.jsx)("h2",{id:p,ref:A,tabIndex:-1,"data-testid":"kind-stop-title",children:n}),(0,t.jsxs)("p",{"data-testid":"kind-stop-count",children:[le(i.schema,e,o),a?` \xB7 ${a}`:""]})]}),(0,t.jsxs)("div",{className:"graview-kind-stop-acts",children:[l?(0,t.jsx)("button",{ref:b,type:"button",className:"graview-kind-stop-primary","data-testid":"kind-stop-primary","data-affordance":l.id,"aria-expanded":l.open.length>0?r:void 0,onClick:()=>{m(null),l.open.length===0?O(l):y(x=>!x)},children:l.label}):null,(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-quiet","data-testid":"kind-stop-acts","aria-haspopup":"menu","aria-label":`What can be done with the ${n.toLowerCase()}`,onClick:x=>{let k=x.currentTarget.getBoundingClientRect();s([U(e)]),c({x:Math.round(k.left),y:Math.round(k.bottom+4),on:U(e)})},children:"Acts\u2026"})]}),r&&l?(0,t.jsx)("div",{className:"graview-kind-stop-ask","data-testid":"kind-stop-ask","aria-label":l.label,role:"group",children:(0,t.jsx)(xe,{affordance:l,onApply:x=>O(l,x),onCancel:()=>{y(!1),b.current?.focus()}})}):null,h?(0,t.jsx)("p",{role:"alert",className:"graview-kind-stop-failed","data-testid":"kind-stop-failed",children:h}):null]})}var vt=J.part((e,n)=>(0,t.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"});function ht({kind:e,plural:n,members:o,today:p,arrangement:a,onArrange:i}){let{store:s,brand:c,setSelection:S}=V(),g=s.schema,u=ee(),w=(0,f.useMemo)(()=>new Set(o.map(v=>v.id)),[o]),l=(0,f.useMemo)(()=>Ue(u,w,v=>s.allInvariants().find(R=>R.name===v)?.label),[u,w,s]),r=(0,f.useMemo)(()=>Je(g,e,o,p),[g,e,o,p]),y=ct(De(c,g),e),[h]=(0,f.useState)(()=>gt(y));(0,f.useEffect)(()=>()=>ut(y,new Date().toISOString()),[y]);let m=X(),b=(0,f.useMemo)(()=>h?Qe(s.log.all(),e,h,v=>s.graph.getNode(v)?.kind):null,[h,s,e,m]),[A,O]=(0,f.useState)(null),x=v=>i({...a,filter:[...(a.filter??[]).filter(R=>!v?.some(T=>T.key===R.key)),...v??[]]}),k=l.reduce((v,R)=>v+R.violations.length,0),C=[];if(r&&(r.overdue>0||r.soon>0)){let v=r.field;C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-dates",children:[r.overdue>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact","data-tone":"warn",onClick:()=>x(oe(r,"overdue",p)),"aria-label":`${D(r.overdue)} overdue \u2014 show only these`,children:[D(r.overdue)," overdue"]}):null,r.soon>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact",onClick:()=>x(oe(r,"soon",p)),"aria-label":`${D(r.soon)} in the next 7 days \u2014 show only these`,children:[D(r.soon)," ",r.due?"due":""," in the next 7 days"]}):null,(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" by ",ce(g.tryDefinition(e),v).toLowerCase()]})]},"dates"))}if(l.length>0&&C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-problems","data-graview-problems":k,children:[(0,t.jsxs)("span",{className:"graview-kind-stop-warn",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0 "}),k===1?"1 problem":`${D(k)} problems`]}),(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" in ",n.toLowerCase(),":"]}),(0,t.jsx)("ul",{className:"graview-kind-stop-rules",children:l.map(v=>(0,t.jsx)(mt,{group:v,open:A===v.invariant,onToggle:()=>O(R=>R===v.invariant?null:v.invariant),onPick:R=>S([R])},v.invariant))}),(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-only-problems",onClick:()=>x([{key:"is",value:"flagged"}]),children:["Show only the ",n.toLowerCase()," with a problem"]})]},"problems")),b&&(b.added>0||b.changed>0)){let v=[b.added>0?`${D(b.added)} added`:"",b.changed>0?`${D(b.changed)} changed`:""].filter(Boolean);C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-since",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["Since you last looked (",de(h.slice(0,10)),"):"]})," ",v.join(", ")]},"since"))}return C.length===0?null:(0,t.jsx)("ul",{className:"graview-kind-stop-going-on","aria-label":`What is going on in the ${n.toLowerCase()}`,"data-testid":"kind-stop-going-on",children:C})}function mt({group:e,open:n,onToggle:o,onPick:p}){let a=(0,f.useId)();return(0,t.jsxs)("li",{"data-graview-rule":e.invariant,children:[(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-rule","aria-expanded":n,"aria-controls":a,onClick:o,onPointerEnter:J.prefetch,onFocus:J.prefetch,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"graview-kind-stop-chevron","data-open":n||void 0,children:"\u203A"}),e.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(e.violations.length)]})]}),n?(0,t.jsx)("ol",{id:a,className:"graview-kind-stop-problem-rows","data-testid":"kind-stop-problem-rows",children:(0,t.jsx)(f.Suspense,{fallback:null,children:(0,t.jsx)(vt,{violations:e.violations,pick:i=>{let s=i.subjectId??e.records[0]??i.nodeIds[0];s!==void 0&&p(s)}})})}):null]})}var bt={board:"Board",calendar:"Calendar",table:"Table"};function yt({derived:e,shape:n,draft:o}){let{view:p}=V(),{go:a}=Y(),{keep:i}=qe(Be()),[s,c]=(0,f.useState)(!1),S=e.shape==="table"?[]:[e.shape,"table"];return(0,t.jsxs)("div",{className:"graview-kind-stop-shape","data-testid":"kind-stop-shape",children:[S.length>0?(0,t.jsx)("span",{role:"group","aria-label":"Show as",className:"graview-kind-stop-switch",children:S.map(g=>(0,t.jsx)("button",{type:"button","aria-pressed":n.shape===g,"data-testid":`kind-stop-as-${g}`,onClick:()=>a(ue(p,Xe,g===e.shape?null:g)),children:bt[g]},g))}):null,(0,t.jsx)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-derived",children:o?`${o.said.replace(/\.$/,"")}, derived from the declaration`:"Derived from the declaration"}),o?(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-keep",disabled:s,title:`Keep \u201C${o.title}\u201D as a lens: a place of its own`,onClick:()=>{c(!0),i(o).finally(()=>c(!1))},children:"Keep as a lens"}):null]})}function kt({draft:e,nodes:n}){let o=Ve(e.drawn);return(0,t.jsx)("div",{className:"graview-kind-stop-lens","data-graview-draft":e.lens.name,children:(0,t.jsx)(ve,{mode:"scene",children:(0,t.jsx)(ke,{kind:e.kind,view:e.title,children:(0,t.jsx)(o,{nodes:n,label:e.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})})}function xt({kind:e,nodes:n,groups:o,flagged:p,plural:a,arrangement:i}){let{store:s,views:c,view:S,selection:g,setSelection:u,setMenuAt:w,principal:l}=V(),{go:r}=Y(),y=s.schema,h=s.graph,m=(0,f.useMemo)(()=>(o?o.flatMap(d=>d.nodes):n).map(d=>d.id),[n,o]),b=Ie(m),A=(0,f.useMemo)(()=>s.permittedMutations(l).some(d=>{let N=d.subject?.kinds;return N!==void 0&&(N==="*"||N.includes(e))}),[s,l,e]),O=(0,f.useRef)(null),x=d=>{b.choose(d),requestAnimationFrame(()=>{let N=b.list.current;((d[0]===void 0?null:N?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??N)?.focus({preventScroll:!0})})},k=b.chosen.length,C=c.lookup(e,{cardinality:"one",fidelity:"glyph"}),v=C!==void 0&&!he(C)?C:void 0,R=d=>g.includes(d),T=ee(),I=(0,f.useMemo)(()=>We(y,e,n,h),[y,e,n,h]),[M,K]=(0,f.useState)(z);(0,f.useEffect)(()=>K(z),[i.query,i.filter?.length,i.sort?.by,i.group?.by]);let B=y.tryDefinition(e),H=d=>T.filter(N=>N.nodeIds.includes(d)||N.subjectId===d).map(N=>N.message),P=i.sort?.by,W=`${a}${i.sort?`, in order of ${I.find(d=>d.key===P)?.label.toLowerCase()??P}`:""}`,$=M,et=d=>{let N=G(B,d),F=p.has(d.id)?H(d.id):[];return(0,t.jsxs)("tr",{"data-graview-pick":d.id,tabIndex:-1,"data-graview-record":d.id,"data-flagged":F.length>0||void 0,...A?{"data-graview-choose":d.id}:{},children:[A?(0,t.jsx)("td",{className:"graview-choose-at",children:(0,t.jsx)("input",{...b.boxProps(d.id,N),onPointerEnter:j,onFocus:j})}):null,(0,t.jsxs)("th",{scope:"row",className:"graview-kind-stop-name",children:[v?(0,t.jsx)("div",{"data-graview-pick":d.id,className:"graview-kind-stop-own-row",children:(0,t.jsx)(v,{node:d,cardinality:"one",fidelity:"glyph",mode:"scene",selected:R(d.id),...F.length>0?{flagged:[d.id]}:{}})}):(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-go",title:`Go to ${N}`,onClick:()=>r(ft(S,d.id)),children:N}),F.length>0?(0,t.jsxs)("span",{className:"graview-kind-stop-flag",title:F.join(" \xB7 "),children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0"}),(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:`Problem: ${F.join(". ")}`})]}):null]}),I.map(_=>{let E=Ze(y,d,_,h);return(0,t.jsx)("td",{"data-label":_.label,"data-short":E.text.length>0&&E.text.length<=14||void 0,"data-empty":E.text?void 0:"",...E.title?{title:E.title}:{},children:E.text?(0,t.jsx)("span",{children:E.text}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{"aria-hidden":"true",children:"\u2014"}),(0,t.jsx)("i",{className:"graview-kind-stop-hidden",children:"none"})]})},_.key)}),(0,t.jsx)("td",{className:"graview-kind-stop-row-acts",children:(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-acts","aria-haspopup":"menu","aria-label":`What can be done with ${N}`,onClick:_=>{let E=_.currentTarget.getBoundingClientRect();u([d.id]),w({x:Math.round(E.left),y:Math.round(E.bottom+4),on:d.id})},children:(0,t.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})})})]},d.id)},re=d=>{let N=d.slice(0,Math.max(0,$));return $-=N.length,N.map(et)};return(0,t.jsxs)("div",{className:"graview-kind-stop-table-at",...A?{...b.listProps,ref:d=>{O.current=d,b.list.current=d},tabIndex:-1,role:"group","aria-label":k>0?`${a}, ${k} chosen`:a,"data-graview-choosable":""}:{},children:[A?(0,t.jsx)("style",{children:Ke}):null,(0,t.jsxs)("table",{className:"graview-kind-stop-table","data-testid":"kind-stop-table",children:[(0,t.jsx)("caption",{className:"graview-kind-stop-hidden",children:W}),(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[A?(0,t.jsx)("td",{className:"graview-choose-at graview-choose-all",children:(0,t.jsx)("input",{type:"checkbox",className:"graview-choose-box","data-testid":"kind-stop-choose-all","aria-label":`Choose all ${D(n.length)} ${a.toLowerCase()}`,checked:k>0&&k===n.length,ref:d=>{d&&(d.indeterminate=k>0&&k<n.length)},onPointerEnter:j,onFocus:j,onChange:()=>k===n.length?b.clear():b.choose(m)})}):null,(0,t.jsx)("th",{scope:"col","aria-sort":P==="label"?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:"Name"}),I.map(d=>(0,t.jsx)("th",{scope:"col","aria-sort":d.about==="field"&&d.key===P?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:d.label},d.key)),(0,t.jsx)("th",{scope:"col",children:(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:"Acts"})})]})}),o?o.map(d=>$<=0?null:(0,t.jsxs)("tbody",{"data-graview-group":d.key,children:[(0,t.jsx)("tr",{className:"graview-kind-stop-group",children:(0,t.jsxs)("th",{scope:"rowgroup",colSpan:I.length+(A?3:2),children:[d.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(d.nodes.length)]})]})}),re(d.nodes)]},d.key||"-")):(0,t.jsx)("tbody",{children:re(n)})]}),A?(0,t.jsx)(Fe,{store:s,chosen:b.chosen,principal:l,anchor:()=>O.current?.closest('[data-testid="kind-stop"]')??null,of:m.length,onChooseAll:()=>b.choose(m),onClear:b.clear,onActed:x}):null,n.length>M?(0,t.jsxs)("p",{className:"graview-kind-stop-more",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-shown",children:[D(M)," of ",D(n.length)," shown"]})," ",(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-more",onClick:()=>K(d=>d+z),children:["Show ",D(Math.min(z,n.length-M))," more"]})]}):null]})}var St=`
2
2
  .graview-kind-stop{container-type:inline-size;box-sizing:border-box;height:100%;min-height:0;display:flex;flex-direction:column;gap:10px;padding:16px 18px 12px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-panel);color:var(--graview-ink);box-shadow:var(--graview-lift-low);overflow:auto;overscroll-behavior:contain}
3
3
  [data-graview-map-panel] .graview-kind-stop{height:auto;padding:4px 6px 12px;border:0;box-shadow:none;background:none;overflow:visible}
4
4
  .graview-kind-stop :focus-visible{outline:2px solid var(--graview-accent);outline-offset:2px}
@@ -1 +1 @@
1
- import{a as ee,b as H,c as ne}from"./chunk.RRKYJYZJ.js";import{B as J,F as Q,H as X,K as Y,g as K,i as G,m as q,p as z,q as W,u as j,v as Z,x as _,z as U}from"./chunk.YD3TKV6P.js";import{a as O}from"./chunk.4KC35UNR.js";import{G as ae,Ha as D,Qa as $,T as M,ba as T,da as N,ua as I}from"./chunk.HT2BEOEV.js";import{Ec as C}from"./chunk.7BBGRTXM.js";import{b as k}from"./chunk.AJZBJBMO.js";var o=k(ae(),1);var y=k(M(),1),fe=e=>typeof e=="object"?e:{};function he({rootRef:e,firstLook:r,app:n}){let t=(0,o.useCallback)(()=>e.current,[e]);return r?(0,y.jsx)(Y,{firstLook:r,root:t,app:n}):null}function ge(e,r,n){let{app:t}=e,a=(0,o.useMemo)(()=>{let i=Q(r(t.schema,t.viewSpecs),t),d=n?ie(i,n):i,s=e.views?e.views(t.schema,d):i,c=s===d?i:I(i,s);return X(c,t.schema,U(e.brand??t.brand,t.schema)),n?n.register(c):c},[e.views,t.schema,t.viewSpecs,t.lenses,t.pages,t.home,n]);return D(a,e.keptViews)}function ie(e,r){let n={...e,register(t,a,i,d){return d?.name!==r.name&&e.register(t,a,i,d),n},...e.home?{home:(t,a)=>(r.home||e.home(t,a),n)}:{}};return n}var F=e=>e?e.getBoundingClientRect().height:0;function be(e,r,n){let t=(0,o.useRef)(n);t.current=n;let a=n!==void 0;(0,o.useLayoutEffect)(()=>{let i=e.current;if(!i||!a)return;let d=()=>{let m=[...i.children],h=m.find(b=>b.hasAttribute("data-graview-app-bar")),p=m.find(b=>b.hasAttribute("data-embed-content")),g=p?.querySelector("[data-embed-measure]")??null,l=m.find(b=>b.hasAttribute("data-graview-place-line"));return{strip:h,line:l,content:p,measure:g}},s=-1,c=()=>{let{strip:m,line:h,content:p,measure:g}=d(),l=Math.ceil(F(m)+F(h)+F(g||p));l!==s&&(s=l,t.current?.(l))};if(c(),typeof ResizeObserver>"u")return;let u=new ResizeObserver(c),E=()=>{u.disconnect();let{strip:m,line:h,content:p,measure:g}=d();for(let l of[i,m,h,p,g])l&&u.observe(l)};E();let w=new MutationObserver(()=>{E(),c()});return w.observe(i,{childList:!0}),()=>{u.disconnect(),w.disconnect()}},[e,r,a])}var we=480,se=0;function Se(e){let{app:r,seed:n,scheme:t="auto",brand:a=r.brand,fonts:i=!0,height:d="100%",label:s}=e,c=(0,o.useRef)(null);$(c);let u=d==="viewport"?"100dvh":d,E=G(typeof u=="string"&&/vh\b/.test(u)),w=(0,o.useMemo)(()=>`graview-embed-${++se}`,[]),m=(0,o.useMemo)(()=>e.store??e.remote?.store??H(r,n),[e.store,e.remote,r,n]),h=e.presence??e.remote?.presence,p=e.hostContext?.theme,g=ne(t==="auto"&&p===void 0,a?.scheme),l=t==="auto"?p??g:t,b=(0,o.useMemo)(()=>O(l,a,{scope:`.${w}`}),[l,a,w]);K(e.favicon?C(a):void 0),(0,o.useEffect)(()=>{if(!i||typeof document>"u")return;let v=ee(a);if(!v||document.querySelector(`link[href="${v}"]`))return;let f=document.createElement("link");f.rel="stylesheet",f.href=v,document.head.appendChild(f)},[a,i]);let A=(0,o.useRef)(void 0);(0,o.useLayoutEffect)(()=>{let v=c.current,f=A.current;if(A.current=s,!v||!s)return;let oe=S=>{let R=S.getAttribute("aria-label")??"",x=f&&f!==s?R.startsWith(`${f} \xB7 `)?R.slice(f.length+3):R===f?"":R:R;x===s&&(S.getAttribute("role")==="region"||S.tagName==="SECTION"&&!S.hasAttribute("role"))&&S.setAttribute("role","group");let V=x.startsWith(`${s} \xB7 `)||x===s?x:x?`${s} \xB7 ${x}`:s;V!==R&&S.setAttribute("aria-label",V)},B=()=>v.querySelectorAll("aside, nav, main, header, footer, section[aria-label]:not([role]), [role=region], [role=complementary], [role=navigation], [role=search]").forEach(S=>{S.hasAttribute("data-graview-named-by-lens")||oe(S)});B();let P=new MutationObserver(B);return P.observe(v,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["aria-label"]}),()=>P.disconnect()},[s]);let re=E?`${u}`.replace(/([\d.]+)[sdl]?vh\b/g,(v,f)=>`${+f*E/100}px`):u;return{rootRef:c,scope:w,css:b,scheme:l,store:m,presence:h,brand:a,auto:d==="auto",height:re}}function ve({rootRef:e,board:r}){let n=(0,o.useCallback)(()=>e.current?.querySelector("[data-embed-content]")??e.current,[e]);return(0,y.jsx)(q,{board:r,anchor:n})}function Ee(e,r,n){return{brand:n,locale:e.locale,timeZone:e.timeZone,principal:e.principal,seats:e.seats,presence:r,typing:e.remote?.typing,people:e.people,memory:e.memory,presenceTtlMs:e.presenceTtlMs,onKeepLens:e.onKeepLens,ai:e.ai,files:e.files,resolveApp:e.resolveApp,history:e.history,linkedRecords:e.linkedRecords,subscriptions:e.subscriptions,dismissals:e.dismissals,whileAway:e.whileAway,keptViews:e.keptViews,onExport:e.onExport,signIn:e.signIn,menuSections:e.menuSections,app:e.app}}function Re({name:e,heading:r,faces:n,at:t,without:a,home:i,reach:d,standing:s,hostActions:c,keeping:u,onFind:E,switch:w,named:m=!0}){let{brand:h,store:p,principal:g,views:l}=T();N();let b=a?.has("places")?[]:z({store:p,principal:g,views:l}),A=_();return(0,y.jsx)(j,{brand:h,name:e,named:m,description:h?.subtitle,heading:r,faces:n,home:i,places:b,current:t===null?null:W(b,t),reach:d,onFind:E,...w?{switch:w}:{},...n||t===null?{scenePlaces:A}:{},tools:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(J,{clean:s}),(0,y.jsx)(Z,{...c?{hostActions:c}:{},...u?{keeping:u}:{}})]})})}var xe=e=>e===!1?2:Math.min(e+1,6);function Ae(e){let[r,n]=(0,o.useState)(e),t=(0,o.useRef)(void 0),a=(0,o.useRef)(void 0),i=(0,o.useMemo)(()=>({go:t,at:n,pending:a}),[]),d=(0,o.useCallback)(s=>{if(t.current){t.current(s);return}a.current=s,n(s)},[]);return{at:r,setAt:n,steering:i,steer:d}}function de(e){let r=typeof e=="object"&&e!==null?e.name:void 0;return{name:typeof r=="string"&&r.length>0?r:typeof e=="object"?"Error":typeof e}}var L=()=>typeof performance<"u"?performance.now():Date.now();function Fe(e,r){let n=(0,o.useRef)({onError:e,face:r});return n.current={onError:e,face:r},(0,o.useCallback)((t,a)=>n.current.onError?.(de(t),{module:a.module,face:n.current.face}),[])}function ke(e,r){let n=(0,o.useRef)(null);n.current===null&&(n.current=L());let t=(0,o.useRef)({onReady:e,face:r});t.current={onReady:e,face:r};let a=(0,o.useRef)(!1);return(0,o.useCallback)(i=>{a.current||(a.current=!0,t.current.onReady?.({ms:Math.max(0,L()-(n.current??L())),face:i}))},[])}var te=class extends o.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(r,n){console.error(`[graview] ${this.props.module} threw while rendering`,r,n.componentStack),this.props.report(r,{module:this.props.module})}render(){return this.state.failed?(0,y.jsxs)("div",{role:"alert","data-graview-face-error":this.props.module,...this.props.content?{"data-embed-content":""}:{},style:this.props.content?{flex:"1 1 auto",display:"grid",alignContent:"center",justifyItems:"center",gap:8,padding:24,background:"var(--graview-ground)",color:"var(--graview-ink)",fontSize:"0.9375rem"}:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:[(0,y.jsx)("span",{children:this.props.content?"This part of the app could not draw.":"Could not draw."}),(0,y.jsx)("button",{type:"button",onClick:()=>this.setState({failed:!1}),style:{padding:"3px 11px",fontSize:"0.8125rem"},children:"Try again"})]}):this.props.children}};export{fe as a,he as b,ge as c,be as d,we as e,Se as f,ve as g,Ee as h,Re as i,xe as j,Ae as k,Fe as l,ke as m,te as n};
1
+ import{a as ee,b as H,c as ne}from"./chunk.M3JIIF32.js";import{B as J,F as Q,H as X,K as Y,g as K,i as G,m as q,p as z,q as W,u as j,v as Z,x as _,z as U}from"./chunk.6IUEGPCZ.js";import{a as O}from"./chunk.CUJX3IVA.js";import{G as ae,Ha as D,Qa as $,T as M,ba as T,da as N,ua as I}from"./chunk.VNJKGSGZ.js";import{Ec as C}from"./chunk.X3MMJ3QC.js";import{b as k}from"./chunk.AJZBJBMO.js";var o=k(ae(),1);var y=k(M(),1),fe=e=>typeof e=="object"?e:{};function he({rootRef:e,firstLook:r,app:n}){let t=(0,o.useCallback)(()=>e.current,[e]);return r?(0,y.jsx)(Y,{firstLook:r,root:t,app:n}):null}function ge(e,r,n){let{app:t}=e,a=(0,o.useMemo)(()=>{let i=Q(r(t.schema,t.viewSpecs),t),d=n?ie(i,n):i,s=e.views?e.views(t.schema,d):i,c=s===d?i:I(i,s);return X(c,t.schema,U(e.brand??t.brand,t.schema)),n?n.register(c):c},[e.views,t.schema,t.viewSpecs,t.lenses,t.pages,t.home,n]);return D(a,e.keptViews)}function ie(e,r){let n={...e,register(t,a,i,d){return d?.name!==r.name&&e.register(t,a,i,d),n},...e.home?{home:(t,a)=>(r.home||e.home(t,a),n)}:{}};return n}var F=e=>e?e.getBoundingClientRect().height:0;function be(e,r,n){let t=(0,o.useRef)(n);t.current=n;let a=n!==void 0;(0,o.useLayoutEffect)(()=>{let i=e.current;if(!i||!a)return;let d=()=>{let m=[...i.children],h=m.find(b=>b.hasAttribute("data-graview-app-bar")),p=m.find(b=>b.hasAttribute("data-embed-content")),g=p?.querySelector("[data-embed-measure]")??null,l=m.find(b=>b.hasAttribute("data-graview-place-line"));return{strip:h,line:l,content:p,measure:g}},s=-1,c=()=>{let{strip:m,line:h,content:p,measure:g}=d(),l=Math.ceil(F(m)+F(h)+F(g||p));l!==s&&(s=l,t.current?.(l))};if(c(),typeof ResizeObserver>"u")return;let u=new ResizeObserver(c),E=()=>{u.disconnect();let{strip:m,line:h,content:p,measure:g}=d();for(let l of[i,m,h,p,g])l&&u.observe(l)};E();let w=new MutationObserver(()=>{E(),c()});return w.observe(i,{childList:!0}),()=>{u.disconnect(),w.disconnect()}},[e,r,a])}var we=480,se=0;function Se(e){let{app:r,seed:n,scheme:t="auto",brand:a=r.brand,fonts:i=!0,height:d="100%",label:s}=e,c=(0,o.useRef)(null);$(c);let u=d==="viewport"?"100dvh":d,E=G(typeof u=="string"&&/vh\b/.test(u)),w=(0,o.useMemo)(()=>`graview-embed-${++se}`,[]),m=(0,o.useMemo)(()=>e.store??e.remote?.store??H(r,n),[e.store,e.remote,r,n]),h=e.presence??e.remote?.presence,p=e.hostContext?.theme,g=ne(t==="auto"&&p===void 0,a?.scheme),l=t==="auto"?p??g:t,b=(0,o.useMemo)(()=>O(l,a,{scope:`.${w}`}),[l,a,w]);K(e.favicon?C(a):void 0),(0,o.useEffect)(()=>{if(!i||typeof document>"u")return;let v=ee(a);if(!v||document.querySelector(`link[href="${v}"]`))return;let f=document.createElement("link");f.rel="stylesheet",f.href=v,document.head.appendChild(f)},[a,i]);let A=(0,o.useRef)(void 0);(0,o.useLayoutEffect)(()=>{let v=c.current,f=A.current;if(A.current=s,!v||!s)return;let oe=S=>{let R=S.getAttribute("aria-label")??"",x=f&&f!==s?R.startsWith(`${f} \xB7 `)?R.slice(f.length+3):R===f?"":R:R;x===s&&(S.getAttribute("role")==="region"||S.tagName==="SECTION"&&!S.hasAttribute("role"))&&S.setAttribute("role","group");let V=x.startsWith(`${s} \xB7 `)||x===s?x:x?`${s} \xB7 ${x}`:s;V!==R&&S.setAttribute("aria-label",V)},B=()=>v.querySelectorAll("aside, nav, main, header, footer, section[aria-label]:not([role]), [role=region], [role=complementary], [role=navigation], [role=search]").forEach(S=>{S.hasAttribute("data-graview-named-by-lens")||oe(S)});B();let P=new MutationObserver(B);return P.observe(v,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["aria-label"]}),()=>P.disconnect()},[s]);let re=E?`${u}`.replace(/([\d.]+)[sdl]?vh\b/g,(v,f)=>`${+f*E/100}px`):u;return{rootRef:c,scope:w,css:b,scheme:l,store:m,presence:h,brand:a,auto:d==="auto",height:re}}function ve({rootRef:e,board:r}){let n=(0,o.useCallback)(()=>e.current?.querySelector("[data-embed-content]")??e.current,[e]);return(0,y.jsx)(q,{board:r,anchor:n})}function Ee(e,r,n){return{brand:n,locale:e.locale,timeZone:e.timeZone,principal:e.principal,seats:e.seats,presence:r,typing:e.remote?.typing,people:e.people,memory:e.memory,presenceTtlMs:e.presenceTtlMs,onKeepLens:e.onKeepLens,ai:e.ai,files:e.files,resolveApp:e.resolveApp,history:e.history,linkedRecords:e.linkedRecords,subscriptions:e.subscriptions,dismissals:e.dismissals,whileAway:e.whileAway,keptViews:e.keptViews,onExport:e.onExport,signIn:e.signIn,menuSections:e.menuSections,app:e.app}}function Re({name:e,heading:r,faces:n,at:t,without:a,home:i,reach:d,standing:s,hostActions:c,keeping:u,onFind:E,switch:w,named:m=!0}){let{brand:h,store:p,principal:g,views:l}=T();N();let b=a?.has("places")?[]:z({store:p,principal:g,views:l}),A=_();return(0,y.jsx)(j,{brand:h,name:e,named:m,description:h?.subtitle,heading:r,faces:n,home:i,places:b,current:t===null?null:W(b,t),reach:d,onFind:E,...w?{switch:w}:{},...n||t===null?{scenePlaces:A}:{},tools:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(J,{clean:s}),(0,y.jsx)(Z,{...c?{hostActions:c}:{},...u?{keeping:u}:{}})]})})}var xe=e=>e===!1?2:Math.min(e+1,6);function Ae(e){let[r,n]=(0,o.useState)(e),t=(0,o.useRef)(void 0),a=(0,o.useRef)(void 0),i=(0,o.useMemo)(()=>({go:t,at:n,pending:a}),[]),d=(0,o.useCallback)(s=>{if(t.current){t.current(s);return}a.current=s,n(s)},[]);return{at:r,setAt:n,steering:i,steer:d}}function de(e){let r=typeof e=="object"&&e!==null?e.name:void 0;return{name:typeof r=="string"&&r.length>0?r:typeof e=="object"?"Error":typeof e}}var L=()=>typeof performance<"u"?performance.now():Date.now();function Fe(e,r){let n=(0,o.useRef)({onError:e,face:r});return n.current={onError:e,face:r},(0,o.useCallback)((t,a)=>n.current.onError?.(de(t),{module:a.module,face:n.current.face}),[])}function ke(e,r){let n=(0,o.useRef)(null);n.current===null&&(n.current=L());let t=(0,o.useRef)({onReady:e,face:r});t.current={onReady:e,face:r};let a=(0,o.useRef)(!1);return(0,o.useCallback)(i=>{a.current||(a.current=!0,t.current.onReady?.({ms:Math.max(0,L()-(n.current??L())),face:i}))},[])}var te=class extends o.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(r,n){console.error(`[graview] ${this.props.module} threw while rendering`,r,n.componentStack),this.props.report(r,{module:this.props.module})}render(){return this.state.failed?(0,y.jsxs)("div",{role:"alert","data-graview-face-error":this.props.module,...this.props.content?{"data-embed-content":""}:{},style:this.props.content?{flex:"1 1 auto",display:"grid",alignContent:"center",justifyItems:"center",gap:8,padding:24,background:"var(--graview-ground)",color:"var(--graview-ink)",fontSize:"0.9375rem"}:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:[(0,y.jsx)("span",{children:this.props.content?"This part of the app could not draw.":"Could not draw."}),(0,y.jsx)("button",{type:"button",onClick:()=>this.setState({failed:!1}),style:{padding:"3px 11px",fontSize:"0.8125rem"},children:"Try again"})]}):this.props.children}};export{fe as a,he as b,ge as c,be as d,we as e,Se as f,ve as g,Ee as h,Re as i,xe as j,Ae as k,Fe as l,ke as m,te as n};
@@ -1,4 +1,4 @@
1
- import{Uc as e}from"./chunk.7BBGRTXM.js";var i=`
1
+ import{Vc as e}from"./chunk.X3MMJ3QC.js";var i=`
2
2
  .graview-spec{display:flex;flex-direction:column;gap:6px;min-width:0;color:var(--graview-ink)}
3
3
 
4
4
  .graview-spec-row{flex-direction:row;flex-wrap:wrap;align-items:center;gap:4px 10px;box-sizing:border-box;max-width:100%;padding:5px 10px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius-sm,8px);background:var(--graview-panel);font-size:.875rem}
@@ -1,4 +1,4 @@
1
- import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{T}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as A}from"./chunk.AJZBJBMO.js";var F=/^ {0,3}(`{3,}|~{3,})[ \t]*([^`\s]*)/,D=/^ {0,3}(#{1,6})(?:[ \t]+|$)/,R=/^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,v=/^ {0,3}>[ \t]?/,_=/^([ \t]*)([-*+]|(\d{1,9})[.)])(?:[ \t]+|$)/,K=/^\|?\s*:?-+:?\s*(?:\|\s*:?-+:?\s*)+\|?$|^\|\s*:?-+:?\s*\|$/,w=/^[ \t]*$/;function O(t){let n=F.exec(t);if(!(!n||n[1][0]==="`"&&t.indexOf("`",n[0].length)>=0))return{mark:n[1],lang:n[2]}}function U(t,n){let r=t.trim().slice(n).trim(),e=r.length;for(;e>0&&r[e-1]==="#";)e--;return(e===0||r[e-1]===" "||r[e-1]===" ")&&(r=r.slice(0,e).trim()),r}var $=t=>O(t)!==void 0||D.test(t)||R.test(t)||v.test(t)||_.test(t),b=t=>[...t].reduce((n,r)=>r===" "?n+4-n%4:n+1,0);function E(t){let n=t.trim().replace(/^\|/,"").replace(/(?<!\\)\|$/,""),r=[],e="",l=!1;for(let c=0;c<n.length;c++){let h=n[c];h==="\\"&&n[c+1]==="|"?(e+="|",c++):h==="`"?(l=!l,e+=h):h==="|"&&!l?(r.push(e.trim()),e=""):e+=h}return r.push(e.trim()),r}function W(t){return B(t.replace(/\r\n?/g,`
1
+ import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{T}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as A}from"./chunk.AJZBJBMO.js";var F=/^ {0,3}(`{3,}|~{3,})[ \t]*([^`\s]*)/,D=/^ {0,3}(#{1,6})(?:[ \t]+|$)/,R=/^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,v=/^ {0,3}>[ \t]?/,_=/^([ \t]*)([-*+]|(\d{1,9})[.)])(?:[ \t]+|$)/,K=/^\|?\s*:?-+:?\s*(?:\|\s*:?-+:?\s*)+\|?$|^\|\s*:?-+:?\s*\|$/,w=/^[ \t]*$/;function O(t){let n=F.exec(t);if(!(!n||n[1][0]==="`"&&t.indexOf("`",n[0].length)>=0))return{mark:n[1],lang:n[2]}}function U(t,n){let r=t.trim().slice(n).trim(),e=r.length;for(;e>0&&r[e-1]==="#";)e--;return(e===0||r[e-1]===" "||r[e-1]===" ")&&(r=r.slice(0,e).trim()),r}var $=t=>O(t)!==void 0||D.test(t)||R.test(t)||v.test(t)||_.test(t),b=t=>[...t].reduce((n,r)=>r===" "?n+4-n%4:n+1,0);function E(t){let n=t.trim().replace(/^\|/,"").replace(/(?<!\\)\|$/,""),r=[],e="",l=!1;for(let c=0;c<n.length;c++){let h=n[c];h==="\\"&&n[c+1]==="|"?(e+="|",c++):h==="`"?(l=!l,e+=h):h==="|"&&!l?(r.push(e.trim()),e=""):e+=h}return r.push(e.trim()),r}function W(t){return B(t.replace(/\r\n?/g,`
2
2
  `).replace(/\0/g,"\uFFFD").split(`
3
3
  `),0)}function B(t,n){let r=[],e=0;for(;e<t.length;){let l=t[e];if(w.test(l)){e++;continue}let c=O(l);if(c){let o=new RegExp(`^ {0,3}${c.mark[0]==="`"?"`":"~"}{${c.mark.length},}[ \\t]*$`),a=[];for(e++;e<t.length&&!o.test(t[e]);)a.push(t[e++]);e++,r.push({t:"code",text:a.join(`
4
4
  `),...c.lang?{lang:c.lang}:{}});continue}let h=D.exec(l);if(h){r.push({t:"heading",level:h[1].length,children:k(U(l,h[1].length),0)}),e++;continue}if(R.test(l)){r.push({t:"rule"}),e++;continue}if(v.test(l)){let o=[];for(;e<t.length&&(v.test(t[e])||o.length>0&&!w.test(t[e])&&!$(t[e])&&!w.test(o[o.length-1]));)o.push(t[e++].replace(v,""));r.push(n<8?{t:"quote",blocks:B(o,n+1)}:{t:"p",children:k(o.join(`
@@ -1,2 +1,2 @@
1
- import{a as le,b as U,d as ce,g as ye,h as pe,i as me,j as ge,k as he}from"./chunk.27CW6SCT.js";import{Aa as oe,C as j,Fa as re,Fb as fe,H as _,Ha as ie,I as E,J as Z,K as B,Lb as O,Nb as ue,Ob as I,Pa as C,Q as x,T as H,Ta as se,U as X,Va as de,Xa as ae,Y as L,_ as Y,ba as q,da as W,ga as M,ma as v,oa as J,ua as Q,va as ee,wa as ne,xa as te}from"./chunk.7BBGRTXM.js";var _e=t=>`${t}${t%100>=11&&t%100<=13?"th":["th","st","nd","rd"][t%10]??"th"}`,xe={day:"day",week:"week",month:"month",year:"year"},F=t=>t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`;function ve(t,e,n){let o=e.interval??1,i=xe[e.every],s=t.slice(0,10),l=o===1?`Every ${i}`:o===2?`Every other ${i}`:`Every ${o} ${i}s`,d;if(e.every==="week"){let y=(e.on?.length?e.on:[C[new Date(`${s}T00:00:00Z`).getUTCDay()]]).map(r=>Y(C.indexOf(r),"long",n));d=o===1?`Every ${F(y)}`:o===2?`Every other ${F(y)}`:`${l} on ${F(y)}`}else if(e.every==="month"){let y=(e.on?.length?e.on:[+s.slice(8,10)]).map(r=>r===-1?"the last day":`the ${_e(Number(r))}`);d=`${l} on ${F(y)}`}else e.every==="year"?d=`${l} on ${L(s,n)}`:d=l;return E.test(t)&&(d+=` at ${X(t,n)}`),e.until&&(d+=`, until ${x(e.until,n)}`),e.count&&(d+=`, ${e.count===1?"once":`${e.count} times`}`),d}function ke(t,e,n={}){if(!de(e)||typeof t!="string")return;let o=n.today??B(),i=ae(t,e,o),s=ve(t,e,n.locale),l=i.slice(0,4)===o.slice(0,4)?L(i.slice(0,10),n.locale):x(i.slice(0,10),n.locale);return i.slice(0,10)<o?`${s}, last ${l}`:`${s}, next ${l}`}function dn(t,e){let n=new Map,o=new Map;for(let i of t){let s=M(e(i.kind),i).trim().toLowerCase();o.set(s,[...o.get(s)??[],i])}for(let i of o.values()){if(i.length<2)continue;let s=new Map;for(let l of i)s.set(l.kind,[...s.get(l.kind)??[],l]);for(let[l,d]of s){if(d.length===1){n.set(d[0].id,J(e(l),l));continue}let y=d.map(u=>new Map(Ee(u,e(u.kind)).map(p=>[p.key,p.alone]))),r=[...new Set(y.flatMap(u=>[...u.keys()]))],c=u=>y.every(p=>!/\d/.test(p.get(u)??"")),h=[...r.filter(c),...r.filter(u=>!c(u))],b=(u,p)=>p.map(m=>y[u].get(m)??"").filter(Boolean).join(" \xB7 "),S=u=>new Set(d.map((p,m)=>b(m,u))).size===d.length&&d.every((p,m)=>b(m,u)!==""),f=h.find(u=>S([u])),a=f?void 0:h.flatMap((u,p)=>h.slice(p+1).map(m=>[u,m])).find(u=>S(u));d.forEach((u,p)=>{if(f||a)return void n.set(u.id,b(p,f?[f]:a));let m=h.find($=>{let w=y[p].get($);return w!==void 0&&w!==""&&y.every((R,k)=>k===p||R.get($)!==w)});n.set(u.id,m?y[p].get(m):`${p+1} of ${d.length}`)})}}return n}function an(t,e){return t?.describe?t.describe(e):`${e.kind} ${M(t,e)}`}var Oe=new Set(["id","kind","label"]);function Se(t,e){if(e.length===0)return!1;let n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(^|[\\s\xB7,(/])${n}($|[\\s\xB7,)/])`).test(t)}function Ee(t,e,n={}){let o=e?.display,i=new Set([...Oe,...o?.hide??[]]);typeof t.label=="string"&&e?.label&&!M(e,t).includes(t.label)&&i.delete("label");let s=(n.said??[]).filter(f=>!!f),l=s.filter(f=>f.endsWith("\u2026")).map(f=>f.replace(/…$/,"").trim()).filter(f=>f.length>12),d=[],y=e?.fields?.shape,r=e?.fieldRoles,c=n.glance?o?.glance??[r?.who,r?.when].filter(f=>!!f):be(o?.page),h=n.glance&&o?.glance!==void 0,S=[...new Set(h?c:[...c,...De(e),...Object.keys(t)])].filter(f=>Object.hasOwn(t,f)).map(f=>[f,t[f]]);for(let[f,a]of S){if(i.has(f)||a===void 0||a===null||pe(e,f))continue;let u=o?.format?.[f],p=u?[]:ne(a);if(p[0]&&n.glance)continue;let m=e?.fields?.shape?.[f],$=!u&&typeof a=="string"&&oe(m)?a:void 0,w=!u&&typeof a=="string"&&le(m);if($&&n.glance)continue;let R=u?void 0:ie(m),k=R?{relation:R,refs:re(a,R)}:void 0;if(k&&(n.glance||k.refs.length===0)||!p[0]&&typeof a=="object"&&(!Array.isArray(a)||a.some(g=>typeof g=="object"&&g!==null))&&u===void 0)continue;let V=typeof a=="string"&&!u?ke(a,t[`${f}Repeat`],{locale:n.locale}):void 0,N=p[0]?p.map(g=>`${g.caption?`${g.name} \u2014 ${g.caption}`:g.name}${Q(g)?` (${ee(g)})`:""}`).join(", "):Array.isArray(a)?a.join(", "):typeof a=="boolean"?a?"Yes":"No":String(a),z=u?void 0:me(e,f),G=he(z,a),K=!u&&!z&&typeof a=="number"?O(e?.fields?.shape?.[f])??ye(e,f):void 0,D=k?k.refs.length>1?`${k.refs.length} linked records`:"linked record":u?u(a):K?ue(a,K):ge(z,a,n.locale)??(Array.isArray(a)||typeof a=="boolean"?N:typeof a=="string"&&V!==void 0?V:typeof a=="string"&&_.test(a)&&(a.length===10||Ne(e,f))?x(a,n.locale):typeof a=="string"&&E.test(a)?H(a,n.locale,n.timeZone):typeof a=="string"&&ze(e,f)?U(e,f,a):N),P=typeof a=="string"&&We(e,f,D),A=(n.glance||n.excerpt)&&!u&&(P||w)?ce(D,{markdown:w}):D;if(s.includes(A)||l.some(g=>A.startsWith(g))||n.glance&&(typeof a=="string"||typeof a=="number")&&s.some(g=>Se(g,A)))continue;let T=v(e,f),Re=typeof a=="number"?`${T} ${A}`:typeof a=="boolean"&&!u?`${T}: ${A.toLowerCase()}`:A;if(d.push({key:f,label:T,value:A,stored:N,alone:Re,long:P,...w?{markdown:!0}:{},...p[0]?{files:p}:{},...$?{app:$}:{},...k?{linked:k}:{},...G?{href:G}:{},...se(y?.[`${f}Repeat`])?{repeats:!0}:{}}),n.limit!==void 0&&d.length>=n.limit)break}return Me(d,e)}function Me(t,e){let n=new Map;for(let o of t){let i=Fe(e,o.key);i&&n.set(o.key,new Set(i.map(s=>U(e,o.key,s).toLowerCase())))}return n.size<2?t:t.map(o=>{let i=n.get(o.key);return i!==void 0&&[...n].some(([l,d])=>l!==o.key&&[...i].some(y=>d.has(y)))?{...o,alone:`${o.label}: ${o.value.toLowerCase()}`}:o})}function Fe(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"&&n._zod.def.entries?Object.values(n._zod.def.entries).map(String):void 0}function Ne(t,e){let n=t?.fields?.shape?.[e]?._zod?.def;for(let o=0;o<6&&n?.innerType!==void 0;o++)n=n.innerType._zod?.def;return n?.type==="string"&&(n.checks??[]).some(o=>o._zod?.def?.pattern?.source===_.source)}function ze(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"}function De(t){let e=t?.fields?.shape;return[...Object.keys(e??{}),...Object.keys(t?.computed??{})]}function be(t){return[...t?.fields??[],...(t?.groups??[]).flatMap(e=>e.fields)]}var Te=500,je=160;function Le(t){let e=t;for(let n=0;n<6&&e?._zod?.def?.innerType!==void 0;n++)e=e._zod.def.innerType;return e?._zod?.def?.type==="string"?e._zod.def:void 0}function We(t,e,n){return Le(t?.fields?.shape?.[e])?.checks?.some(i=>i._zod?.def?.check==="max_length"&&(i._zod.def.maximum??0)>Te)?!0:typeof n=="string"&&(n.includes(`
1
+ import{a as le,b as U,d as ce,g as ye,h as pe,i as me,j as ge,k as he}from"./chunk.2FOIJ5ID.js";import{Aa as oe,C as j,Fa as re,Fb as fe,H as _,Ha as ie,I as E,J as Z,K as B,Lb as O,Nb as ue,Ob as I,Pa as C,Q as x,T as H,Ta as se,U as X,Va as de,Xa as ae,Y as L,_ as Y,ba as q,da as W,ga as M,ma as v,oa as J,ua as Q,va as ee,wa as ne,xa as te}from"./chunk.X3MMJ3QC.js";var _e=t=>`${t}${t%100>=11&&t%100<=13?"th":["th","st","nd","rd"][t%10]??"th"}`,xe={day:"day",week:"week",month:"month",year:"year"},F=t=>t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`;function ve(t,e,n){let o=e.interval??1,i=xe[e.every],s=t.slice(0,10),l=o===1?`Every ${i}`:o===2?`Every other ${i}`:`Every ${o} ${i}s`,d;if(e.every==="week"){let y=(e.on?.length?e.on:[C[new Date(`${s}T00:00:00Z`).getUTCDay()]]).map(r=>Y(C.indexOf(r),"long",n));d=o===1?`Every ${F(y)}`:o===2?`Every other ${F(y)}`:`${l} on ${F(y)}`}else if(e.every==="month"){let y=(e.on?.length?e.on:[+s.slice(8,10)]).map(r=>r===-1?"the last day":`the ${_e(Number(r))}`);d=`${l} on ${F(y)}`}else e.every==="year"?d=`${l} on ${L(s,n)}`:d=l;return E.test(t)&&(d+=` at ${X(t,n)}`),e.until&&(d+=`, until ${x(e.until,n)}`),e.count&&(d+=`, ${e.count===1?"once":`${e.count} times`}`),d}function ke(t,e,n={}){if(!de(e)||typeof t!="string")return;let o=n.today??B(),i=ae(t,e,o),s=ve(t,e,n.locale),l=i.slice(0,4)===o.slice(0,4)?L(i.slice(0,10),n.locale):x(i.slice(0,10),n.locale);return i.slice(0,10)<o?`${s}, last ${l}`:`${s}, next ${l}`}function dn(t,e){let n=new Map,o=new Map;for(let i of t){let s=M(e(i.kind),i).trim().toLowerCase();o.set(s,[...o.get(s)??[],i])}for(let i of o.values()){if(i.length<2)continue;let s=new Map;for(let l of i)s.set(l.kind,[...s.get(l.kind)??[],l]);for(let[l,d]of s){if(d.length===1){n.set(d[0].id,J(e(l),l));continue}let y=d.map(u=>new Map(Ee(u,e(u.kind)).map(p=>[p.key,p.alone]))),r=[...new Set(y.flatMap(u=>[...u.keys()]))],c=u=>y.every(p=>!/\d/.test(p.get(u)??"")),h=[...r.filter(c),...r.filter(u=>!c(u))],b=(u,p)=>p.map(m=>y[u].get(m)??"").filter(Boolean).join(" \xB7 "),S=u=>new Set(d.map((p,m)=>b(m,u))).size===d.length&&d.every((p,m)=>b(m,u)!==""),f=h.find(u=>S([u])),a=f?void 0:h.flatMap((u,p)=>h.slice(p+1).map(m=>[u,m])).find(u=>S(u));d.forEach((u,p)=>{if(f||a)return void n.set(u.id,b(p,f?[f]:a));let m=h.find($=>{let w=y[p].get($);return w!==void 0&&w!==""&&y.every((R,k)=>k===p||R.get($)!==w)});n.set(u.id,m?y[p].get(m):`${p+1} of ${d.length}`)})}}return n}function an(t,e){return t?.describe?t.describe(e):`${e.kind} ${M(t,e)}`}var Oe=new Set(["id","kind","label"]);function Se(t,e){if(e.length===0)return!1;let n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(^|[\\s\xB7,(/])${n}($|[\\s\xB7,)/])`).test(t)}function Ee(t,e,n={}){let o=e?.display,i=new Set([...Oe,...o?.hide??[]]);typeof t.label=="string"&&e?.label&&!M(e,t).includes(t.label)&&i.delete("label");let s=(n.said??[]).filter(f=>!!f),l=s.filter(f=>f.endsWith("\u2026")).map(f=>f.replace(/…$/,"").trim()).filter(f=>f.length>12),d=[],y=e?.fields?.shape,r=e?.fieldRoles,c=n.glance?o?.glance??[r?.who,r?.when].filter(f=>!!f):be(o?.page),h=n.glance&&o?.glance!==void 0,S=[...new Set(h?c:[...c,...De(e),...Object.keys(t)])].filter(f=>Object.hasOwn(t,f)).map(f=>[f,t[f]]);for(let[f,a]of S){if(i.has(f)||a===void 0||a===null||pe(e,f))continue;let u=o?.format?.[f],p=u?[]:ne(a);if(p[0]&&n.glance)continue;let m=e?.fields?.shape?.[f],$=!u&&typeof a=="string"&&oe(m)?a:void 0,w=!u&&typeof a=="string"&&le(m);if($&&n.glance)continue;let R=u?void 0:ie(m),k=R?{relation:R,refs:re(a,R)}:void 0;if(k&&(n.glance||k.refs.length===0)||!p[0]&&typeof a=="object"&&(!Array.isArray(a)||a.some(g=>typeof g=="object"&&g!==null))&&u===void 0)continue;let V=typeof a=="string"&&!u?ke(a,t[`${f}Repeat`],{locale:n.locale}):void 0,N=p[0]?p.map(g=>`${g.caption?`${g.name} \u2014 ${g.caption}`:g.name}${Q(g)?` (${ee(g)})`:""}`).join(", "):Array.isArray(a)?a.join(", "):typeof a=="boolean"?a?"Yes":"No":String(a),z=u?void 0:me(e,f),G=he(z,a),K=!u&&!z&&typeof a=="number"?O(e?.fields?.shape?.[f])??ye(e,f):void 0,D=k?k.refs.length>1?`${k.refs.length} linked records`:"linked record":u?u(a):K?ue(a,K):ge(z,a,n.locale)??(Array.isArray(a)||typeof a=="boolean"?N:typeof a=="string"&&V!==void 0?V:typeof a=="string"&&_.test(a)&&(a.length===10||Ne(e,f))?x(a,n.locale):typeof a=="string"&&E.test(a)?H(a,n.locale,n.timeZone):typeof a=="string"&&ze(e,f)?U(e,f,a):N),P=typeof a=="string"&&We(e,f,D),A=(n.glance||n.excerpt)&&!u&&(P||w)?ce(D,{markdown:w}):D;if(s.includes(A)||l.some(g=>A.startsWith(g))||n.glance&&(typeof a=="string"||typeof a=="number")&&s.some(g=>Se(g,A)))continue;let T=v(e,f),Re=typeof a=="number"?`${T} ${A}`:typeof a=="boolean"&&!u?`${T}: ${A.toLowerCase()}`:A;if(d.push({key:f,label:T,value:A,stored:N,alone:Re,long:P,...w?{markdown:!0}:{},...p[0]?{files:p}:{},...$?{app:$}:{},...k?{linked:k}:{},...G?{href:G}:{},...se(y?.[`${f}Repeat`])?{repeats:!0}:{}}),n.limit!==void 0&&d.length>=n.limit)break}return Me(d,e)}function Me(t,e){let n=new Map;for(let o of t){let i=Fe(e,o.key);i&&n.set(o.key,new Set(i.map(s=>U(e,o.key,s).toLowerCase())))}return n.size<2?t:t.map(o=>{let i=n.get(o.key);return i!==void 0&&[...n].some(([l,d])=>l!==o.key&&[...i].some(y=>d.has(y)))?{...o,alone:`${o.label}: ${o.value.toLowerCase()}`}:o})}function Fe(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"&&n._zod.def.entries?Object.values(n._zod.def.entries).map(String):void 0}function Ne(t,e){let n=t?.fields?.shape?.[e]?._zod?.def;for(let o=0;o<6&&n?.innerType!==void 0;o++)n=n.innerType._zod?.def;return n?.type==="string"&&(n.checks??[]).some(o=>o._zod?.def?.pattern?.source===_.source)}function ze(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"}function De(t){let e=t?.fields?.shape;return[...Object.keys(e??{}),...Object.keys(t?.computed??{})]}function be(t){return[...t?.fields??[],...(t?.groups??[]).flatMap(e=>e.fields)]}var Te=500,je=160;function Le(t){let e=t;for(let n=0;n<6&&e?._zod?.def?.innerType!==void 0;n++)e=e._zod.def.innerType;return e?._zod?.def?.type==="string"?e._zod.def:void 0}function We(t,e,n){return Le(t?.fields?.shape?.[e])?.checks?.some(i=>i._zod?.def?.check==="max_length"&&(i._zod.def.maximum??0)>Te)?!0:typeof n=="string"&&(n.includes(`
2
2
  `)||n.length>je)}function ln(t,e){let n=t?.display?.page,o=n?.groups??[],i=new Map(e.map(r=>[r.key,r])),s=new Set(be(n)),l=r=>r.flatMap(c=>i.has(c)?[i.get(c)]:[]),d=e.filter(r=>!s.has(r.key));return[{fields:[...l(n?.fields??[]),...o.length>0?[]:d]},...o.map(r=>({title:r.title,fields:l(r.fields)})),...o.length>0?[{title:"Details",fields:d}]:[]].filter(r=>r.fields.length>0)}function Ce(t,e,n){let o=[...e?.creates??[],...e?.subject&&e.subject.kinds!=="*"?e.subject.kinds:[]];for(let i of o){let s=t.tryDefinition(i),l=s?.fields?.shape??{};if(!s||!(n in l))continue;let d=s.display?.format?.[n];return{label:s.display?.labels?.[n]??v(s,n),option:r=>d?d(r):W(r)}}return{label:v(void 0,n),option:i=>W(i)}}function pn(t,e,n){if(n instanceof fe){let o=e.find(s=>s.name===n.mutation);return`Not yet: ${n.issues.map(s=>{let l=s.path.length>0?Ce(t,o,String(s.path[0])).label:void 0;return l?`${l} \u2014 ${q(s.message)}`:s.message}).join("; ")}.`}return n instanceof Error?n.message:String(n)}var Ie=t=>/^[A-Z]{3}$/.test(t??"");function we(t){let{format:e,unit:n,currency:o,locale:i}=t,s=Ie(n),l=e==="money"||!e&&s,d=l?s?n:o:void 0;return{...l?{format:"money"}:e?{format:e}:{},...n&&!(l&&s)?{unit:n}:{},...d?{currency:d}:{},...i?{locale:i}:{}}}function gn(t){switch(t.format){case"money":return t.currency?`An amount of money in ${t.currency}: a plain number, 1250.5 for 1,250.50 ${t.currency}.`:"An amount of money, in no named currency: a plain number.";case"percent":return"A fraction said as a percent: 0.15 is 15%.";default:return t.unit?`A number of ${t.unit}.`:"A number."}}function Ae(t){let e=j(t)?.innerType;return e===void 0?t:Ae(e)}var Ue={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ve=t=>(t?._zod?.def?.checks??[]).map(e=>e._zod?.def).filter(e=>e!==void 0);function $e(t){let e=Ae(t),n=j(e),o=n?.type,i=Ve(e);if(o==="enum")return{type:"choice",options:Object.keys(n?.entries??{})};let s=te(e);if(s)return s==="image"?{type:"file",image:!0}:s==="video"?{type:"file",video:!0}:{type:"file"};if(o==="boolean")return{type:"boolean"};if(o==="array"){let l=$e(n?.element);return l.type==="unknown"?{type:"unknown"}:{type:"several",of:l}}if(o==="number"){let l,d,y;for(let r of i){r.check==="multiple_of"&&typeof r.value=="number"?y=r.value:r.check==="number_format"&&(r.format==="safeint"||r.format==="int32"||r.format==="uint32")&&(y??=1);let c=r.check==="number_format"&&r.format?Ue[r.format]:void 0,h=c?c[0]:r.check==="greater_than"&&r.inclusive&&typeof r.value=="number"?r.value:void 0,b=c?c[1]:r.check==="less_than"&&r.inclusive&&typeof r.value=="number"?r.value:void 0;h!==void 0&&(l=l===void 0?h:Math.max(l,h)),b!==void 0&&(d=d===void 0?b:Math.min(d,b))}return{type:"number",...l===void 0?{}:{min:l},...d===void 0?{}:{max:d},...y===void 0?{}:{step:y},...I(e)==="duration"?{duration:!0}:{},...O(t)?{amount:we(O(t))}:{}}}if(o==="string"){if(i.some(c=>c.fn===Z||c.format==="datetime")||n?.format==="datetime")return{type:"date",time:!0,instant:!0};let d=[n?.pattern,...i.map(c=>c.pattern)].filter(c=>c instanceof RegExp).map(c=>c.source);if(d.some(c=>c.includes("\\d{4}")))return d.some(c=>c.includes("\\d{2}:\\d{2}"))?{type:"date",time:!0}:d.includes(_.source)?{type:"date",partial:!0}:{type:"date"};let y=i.some(c=>c.check==="max_length"&&typeof c.maximum=="number"&&c.maximum>500),r=I(e);return y?{type:"text",long:!0}:r==="phone"||r==="place"?{type:"text",holds:r}:{type:"text"}}return{type:"unknown"}}function _n(t,e){let n=t?.shape;return!n||!(e in n)?{type:"unknown"}:$e(n[e])}export{ve as a,dn as b,an as c,Ee as d,ln as e,we as f,gn as g,Ae as h,$e as i,_n as j,Ce as k,pn as l};
@@ -1 +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{Cb as L,N as H,P as N,Pc as j}from"./chunk.7BBGRTXM.js";var D=()=>(__graviewPreload(import.meta.url,["./chunk.JB7TTJXQ.js","./chunk.PXQVXBNG.js","./chunk.B3WVCSW5.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.4444RPWW.js"));function W(n,l,c){let i=new Map;for(let u of c?.kinds??[])for(let o of n.nodesOfKind(u))l.has(o.id)||i.set(o.id,o);let t=new Set([...l,...i.keys()]),p=new Set(c?.edges??[]),k=new Set;if(p.size>0&&l.size>0){for(let u of l)for(let o of n.outEdges(u))p.has(o.kind)&&i.has(o.to)&&k.add(o.to);for(let u of i.keys())n.outEdges(u).some(o=>p.has(o.kind)&&l.has(o.to))&&k.add(u)}let S=new Map([...[...i].filter(([u])=>k.has(u)),...[...i].filter(([u])=>!k.has(u))]),h=[];if(p.size>0)for(let u of t)for(let o of n.outEdges(u))p.has(o.kind)&&t.has(o.to)&&h.push({kind:o.kind,from:o.from,to:o.to});return{nodes:[...S.values()],edges:h}}function E(n,l,c){let i=[];return()=>{let t=c();for(;i.length>0&&i[0]<=t-l;)i.shift();return i.length>=n?!1:(i.push(t),!0)}}function C(n={},l=Date.now){return{act:E(n.acts??30,n.actWindowMs??6e4,l),message:E(n.messages??120,n.messageWindowMs??1e3,l)}}var A=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function K(n,l){let c=l.flatMap(t=>A(t)&&typeof t.kind=="string"?[t.kind]:[]),i=j(n,c);return Object.keys(i).length>0?{choices:i}:{}}function J(n,l){let c=structuredClone(l),i=n.schema.tryDefinition(c.kind),t=c.label;return{...c,label:i?.label?i.label(c):typeof t=="string"&&t.length>0?t:c.id}}function I(n){let l=n.limiter??C(n.limits,n.now),c=n.limits?.maxHeight??4e3,i=`view:${n.view}`,t={applied:0,refused:0,dropped:0},p=()=>n.store.seenBy(n.principal),k=e=>J(n.store,e),S=()=>{if(n.props)return n.props();let e=p(),d=e.graph,r=n.input?.()??{},y=r.node?d.getNode(r.node.id):void 0,a=r.nodes?.flatMap(s=>{let m=d.getNode(s.id);return m?[m]:[]}),g=new Set([...y?[y.id]:[],...(a??[]).map(s=>s.id)]),f=[];for(let s of g)for(let m of d.outEdges(s))g.has(m.to)&&f.push({kind:m.kind,from:m.from,to:m.to});let G=W(d,g,n.reads),b=new Set(f.map(s=>`${s.kind} ${s.from} ${s.to}`));for(let s of G.edges)b.has(`${s.kind} ${s.from} ${s.to}`)||f.push(s);let v=G.nodes.length>0?[...a??[],...G.nodes]:a,M=s=>s?.filter(m=>d.has(m)),$=e.permittedMutations(n.principal).map(s=>({name:s.name,title:s.title??s.name,...s.description!==void 0?{description:s.description}:{},...s.subject?{subject:{kinds:s.subject.kinds,arg:s.subject.arg}}:{}}));return{view:n.view,...y?{node:k(y)}:{},...v?{nodes:v.map(k)}:{},edges:f,...r.label!==void 0?{label:r.label}:{},...r.fidelity!==void 0?{fidelity:r.fidelity}:{},...r.cardinality!==void 0?{cardinality:r.cardinality}:{},...r.mode!==void 0?{mode:r.mode}:{},...r.selected!==void 0?{selected:r.selected}:{},...r.implicated?{implicated:M(r.implicated)}:{},...r.flagged?{flagged:M(r.flagged)}:{},acts:$,...n.theme?{theme:n.theme()}:{},locale:H(),timeZone:N(),...K(n.store.schema,[...y?[y]:[],...v??[]]),...n.placesShown?{places:n.placesShown().map(({as:s,title:m,kind:F})=>({as:s,title:m,kind:F}))}:{}}},h=!1,u=0,o=new Set,x=()=>{if(h)return;u+=1,o.add(u),o.size>100&&o.delete(o.values().next().value);let e=S();n.send({type:"props",props:n.hand?n.hand(e):e,push:u})},R=!1,O=n.store.subscribe(()=>{R||(R=!0,queueMicrotask(()=>{R=!1,x()}))}),w=(e,d)=>(t.refused+=1,{ok:!1,reason:e,message:d}),z=(e,d,r)=>P([{name:e,args:d}],r),P=(e,d,r)=>{if(!l.act())return w("rate-limited","Too many acts asked for at once; this one was not applied.");let y=[];for(let{name:a,args:g}of e){if(d){let f=d(a,g);if(!f.ok)return w(f.reason,f.message);a=f.name,g=f.args}if(!n.store.allMutations().some(f=>f.name===a))return w("unknown-act","There is no act by that name here.");y.push({name:a,args:g})}try{let a=n.store.applyAll(y,{author:n.principal,via:i,...r?{intent:r}:{}});return t.applied+=1,{ok:!0,intent:a.intent}}catch(a){return a instanceof L?w("refused",a.refusal.message):w("failed","The act could not be applied.")}},T=(e,d,r)=>{let y=Array.isArray(r);if(typeof d!="string"||(y?r.length===0||r.length>100||!r.every(A):!A(r)))return t.refused+=1,n.send({type:"answer",id:e,ok:!1,reason:"malformed",message:"An act is asked for by name, with its arguments as an object, or a list of 1 to 100 of them for several as one change."});let a=P((y?r:[r]).map(g=>({name:d,args:g})),n.judgeAct);n.send(a.ok?{type:"answer",id:e,ok:!0,intent:a.intent}:{type:"answer",id:e,ok:!1,reason:a.reason,message:a.message})};return{receive(e){if(h)return;if(!(A(e)&&e.nonce===n.nonce&&e.type==="pushed"&&typeof e.push=="number"&&o.delete(e.push))&&!l.message()){t.dropped+=1,n.onFlood?.();return}if(!A(e)||e.nonce!==n.nonce){t.dropped+=1;return}if(e.type==="act"&&(typeof e.id=="string"||typeof e.id=="number"))return T(e.id,e.name,e.args);if(e.type==="navigate"&&n.onArrive&&(typeof e.place=="string"||typeof e.to=="string")){let r={...e.where!==void 0?{where:e.where}:{},...e.section!==void 0?{section:e.section}:{}},y=typeof e.place=="string"?{place:e.place,...r}:{record:e.to,...r},a=n.onArrive;D().then(({judgeDestination:g,listsOf:f})=>{if(h)return;let G=new Set([...n.store.kindsKeptFrom(n.principal),...n.store.modules.disabledKinds]),b=g(y,{sees:v=>p().graph.has(v),places:n.placesShown?.()??[],lists:f(n.store.schema,G),schema:n.store.schema});b.ok?a(b.arrival):(t.dropped+=1,n.onLost?.(b.says))});return}if(e.type==="navigate"&&typeof e.place=="string"){n.places?.().includes(e.place)?n.onNavigatePlace?.(e.place):t.dropped+=1;return}if(e.type==="navigate"&&typeof e.to=="string"){p().graph.has(e.to)?n.onNavigate?.(e.to):t.dropped+=1;return}if(e.type==="render"&&Array.isArray(e.records)&&n.onRender){n.onRender(e.records);return}if(e.type==="style"&&Array.isArray(e.sheets)&&e.sheets.every(r=>typeof r=="string")&&n.onStyle){n.onStyle(e.sheets);return}if(e.type==="hears"&&Array.isArray(e.events)&&n.onHears){n.onHears(e.events.filter(r=>typeof r=="string").slice(0,20));return}if(e.type==="clicks"&&Array.isArray(e.selectors)){n.onClicks?.(e.selectors.filter(r=>typeof r=="string"&&r.length<=500).slice(0,200));return}if(e.type==="gestures"&&Array.isArray(e.bound)&&n.onGestures){n.onGestures(e.bound.slice(0,32));return}if(e.type==="pushed"&&typeof e.push=="number"&&typeof e.ms=="number"&&n.onPushed){n.onPushed(e.push,e.ms);return}if(e.type==="size"&&typeof e.height=="number"&&Number.isFinite(e.height)){n.onSize?.(Math.max(0,Math.min(c,Math.round(e.height))));return}t.dropped+=1},push:x,pressed(e){return h?{ok:!1,reason:"refused",message:"The view has gone."}:e.ok?z(e.name,e.args):(t.refused+=1,e)},change(e,d){return h?{ok:!1,reason:"refused",message:"The view has gone."}:P(e,void 0,d)},get stats(){return t},dispose(){h=!0,O()}}}export{W as a,C as b,K as c,J as d,I as e};
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{Cb as L,N as H,P as N,Qc as j}from"./chunk.X3MMJ3QC.js";var D=()=>(__graviewPreload(import.meta.url,["./chunk.2FP4KEEG.js","./chunk.PXQVXBNG.js","./chunk.B3WVCSW5.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.QXMQUIQZ.js"));function W(n,l,c){let i=new Map;for(let u of c?.kinds??[])for(let o of n.nodesOfKind(u))l.has(o.id)||i.set(o.id,o);let t=new Set([...l,...i.keys()]),p=new Set(c?.edges??[]),k=new Set;if(p.size>0&&l.size>0){for(let u of l)for(let o of n.outEdges(u))p.has(o.kind)&&i.has(o.to)&&k.add(o.to);for(let u of i.keys())n.outEdges(u).some(o=>p.has(o.kind)&&l.has(o.to))&&k.add(u)}let S=new Map([...[...i].filter(([u])=>k.has(u)),...[...i].filter(([u])=>!k.has(u))]),h=[];if(p.size>0)for(let u of t)for(let o of n.outEdges(u))p.has(o.kind)&&t.has(o.to)&&h.push({kind:o.kind,from:o.from,to:o.to});return{nodes:[...S.values()],edges:h}}function E(n,l,c){let i=[];return()=>{let t=c();for(;i.length>0&&i[0]<=t-l;)i.shift();return i.length>=n?!1:(i.push(t),!0)}}function C(n={},l=Date.now){return{act:E(n.acts??30,n.actWindowMs??6e4,l),message:E(n.messages??120,n.messageWindowMs??1e3,l)}}var A=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function K(n,l){let c=l.flatMap(t=>A(t)&&typeof t.kind=="string"?[t.kind]:[]),i=j(n,c);return Object.keys(i).length>0?{choices:i}:{}}function J(n,l){let c=structuredClone(l),i=n.schema.tryDefinition(c.kind),t=c.label;return{...c,label:i?.label?i.label(c):typeof t=="string"&&t.length>0?t:c.id}}function I(n){let l=n.limiter??C(n.limits,n.now),c=n.limits?.maxHeight??4e3,i=`view:${n.view}`,t={applied:0,refused:0,dropped:0},p=()=>n.store.seenBy(n.principal),k=e=>J(n.store,e),S=()=>{if(n.props)return n.props();let e=p(),d=e.graph,r=n.input?.()??{},y=r.node?d.getNode(r.node.id):void 0,a=r.nodes?.flatMap(s=>{let m=d.getNode(s.id);return m?[m]:[]}),g=new Set([...y?[y.id]:[],...(a??[]).map(s=>s.id)]),f=[];for(let s of g)for(let m of d.outEdges(s))g.has(m.to)&&f.push({kind:m.kind,from:m.from,to:m.to});let G=W(d,g,n.reads),b=new Set(f.map(s=>`${s.kind} ${s.from} ${s.to}`));for(let s of G.edges)b.has(`${s.kind} ${s.from} ${s.to}`)||f.push(s);let v=G.nodes.length>0?[...a??[],...G.nodes]:a,M=s=>s?.filter(m=>d.has(m)),$=e.permittedMutations(n.principal).map(s=>({name:s.name,title:s.title??s.name,...s.description!==void 0?{description:s.description}:{},...s.subject?{subject:{kinds:s.subject.kinds,arg:s.subject.arg}}:{}}));return{view:n.view,...y?{node:k(y)}:{},...v?{nodes:v.map(k)}:{},edges:f,...r.label!==void 0?{label:r.label}:{},...r.fidelity!==void 0?{fidelity:r.fidelity}:{},...r.cardinality!==void 0?{cardinality:r.cardinality}:{},...r.mode!==void 0?{mode:r.mode}:{},...r.selected!==void 0?{selected:r.selected}:{},...r.implicated?{implicated:M(r.implicated)}:{},...r.flagged?{flagged:M(r.flagged)}:{},acts:$,...n.theme?{theme:n.theme()}:{},locale:H(),timeZone:N(),...K(n.store.schema,[...y?[y]:[],...v??[]]),...n.placesShown?{places:n.placesShown().map(({as:s,title:m,kind:F})=>({as:s,title:m,kind:F}))}:{}}},h=!1,u=0,o=new Set,x=()=>{if(h)return;u+=1,o.add(u),o.size>100&&o.delete(o.values().next().value);let e=S();n.send({type:"props",props:n.hand?n.hand(e):e,push:u})},R=!1,O=n.store.subscribe(()=>{R||(R=!0,queueMicrotask(()=>{R=!1,x()}))}),w=(e,d)=>(t.refused+=1,{ok:!1,reason:e,message:d}),z=(e,d,r)=>P([{name:e,args:d}],r),P=(e,d,r)=>{if(!l.act())return w("rate-limited","Too many acts asked for at once; this one was not applied.");let y=[];for(let{name:a,args:g}of e){if(d){let f=d(a,g);if(!f.ok)return w(f.reason,f.message);a=f.name,g=f.args}if(!n.store.allMutations().some(f=>f.name===a))return w("unknown-act","There is no act by that name here.");y.push({name:a,args:g})}try{let a=n.store.applyAll(y,{author:n.principal,via:i,...r?{intent:r}:{}});return t.applied+=1,{ok:!0,intent:a.intent}}catch(a){return a instanceof L?w("refused",a.refusal.message):w("failed","The act could not be applied.")}},T=(e,d,r)=>{let y=Array.isArray(r);if(typeof d!="string"||(y?r.length===0||r.length>100||!r.every(A):!A(r)))return t.refused+=1,n.send({type:"answer",id:e,ok:!1,reason:"malformed",message:"An act is asked for by name, with its arguments as an object, or a list of 1 to 100 of them for several as one change."});let a=P((y?r:[r]).map(g=>({name:d,args:g})),n.judgeAct);n.send(a.ok?{type:"answer",id:e,ok:!0,intent:a.intent}:{type:"answer",id:e,ok:!1,reason:a.reason,message:a.message})};return{receive(e){if(h)return;if(!(A(e)&&e.nonce===n.nonce&&e.type==="pushed"&&typeof e.push=="number"&&o.delete(e.push))&&!l.message()){t.dropped+=1,n.onFlood?.();return}if(!A(e)||e.nonce!==n.nonce){t.dropped+=1;return}if(e.type==="act"&&(typeof e.id=="string"||typeof e.id=="number"))return T(e.id,e.name,e.args);if(e.type==="navigate"&&n.onArrive&&(typeof e.place=="string"||typeof e.to=="string")){let r={...e.where!==void 0?{where:e.where}:{},...e.section!==void 0?{section:e.section}:{}},y=typeof e.place=="string"?{place:e.place,...r}:{record:e.to,...r},a=n.onArrive;D().then(({judgeDestination:g,listsOf:f})=>{if(h)return;let G=new Set([...n.store.kindsKeptFrom(n.principal),...n.store.modules.disabledKinds]),b=g(y,{sees:v=>p().graph.has(v),places:n.placesShown?.()??[],lists:f(n.store.schema,G),schema:n.store.schema});b.ok?a(b.arrival):(t.dropped+=1,n.onLost?.(b.says))});return}if(e.type==="navigate"&&typeof e.place=="string"){n.places?.().includes(e.place)?n.onNavigatePlace?.(e.place):t.dropped+=1;return}if(e.type==="navigate"&&typeof e.to=="string"){p().graph.has(e.to)?n.onNavigate?.(e.to):t.dropped+=1;return}if(e.type==="render"&&Array.isArray(e.records)&&n.onRender){n.onRender(e.records);return}if(e.type==="style"&&Array.isArray(e.sheets)&&e.sheets.every(r=>typeof r=="string")&&n.onStyle){n.onStyle(e.sheets);return}if(e.type==="hears"&&Array.isArray(e.events)&&n.onHears){n.onHears(e.events.filter(r=>typeof r=="string").slice(0,20));return}if(e.type==="clicks"&&Array.isArray(e.selectors)){n.onClicks?.(e.selectors.filter(r=>typeof r=="string"&&r.length<=500).slice(0,200));return}if(e.type==="gestures"&&Array.isArray(e.bound)&&n.onGestures){n.onGestures(e.bound.slice(0,32));return}if(e.type==="pushed"&&typeof e.push=="number"&&typeof e.ms=="number"&&n.onPushed){n.onPushed(e.push,e.ms);return}if(e.type==="size"&&typeof e.height=="number"&&Number.isFinite(e.height)){n.onSize?.(Math.max(0,Math.min(c,Math.round(e.height))));return}t.dropped+=1},push:x,pressed(e){return h?{ok:!1,reason:"refused",message:"The view has gone."}:e.ok?z(e.name,e.args):(t.refused+=1,e)},change(e,d){return h?{ok:!1,reason:"refused",message:"The view has gone."}:P(e,void 0,d)},get stats(){return t},dispose(){h=!0,O()}}}export{W as a,C as b,K as c,J as d,I as e};
@@ -1 +1 @@
1
- import{b as mt}from"./chunk.2EDC63RI.js";import{a as pt}from"./chunk.5ICIMQE6.js";import{f as dt}from"./chunk.QGV7H7RQ.js";import{a as F,f as q}from"./chunk.YIA2EDVF.js";import{F as Q,I as X,K as k,Nb as ft,Q as G,T as tt,V as nt,W as et,ba as rt,da as M,ga as _,ja as ot,kb as lt,ma as at,nb as ut,oa as st,od as ct}from"./chunk.7BBGRTXM.js";import{e as it}from"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function J(t){let e=[],n=!0;for(let r of t){if(r.text.length===0)continue;let s=r.as==="close"||r.text===","||r.text===":"||r.text.startsWith("'")||n;e.push({part:r,space:!s}),n=r.as==="open"}return e}function D(t,e){return J(t).map(({part:n,space:r})=>`${r?" ":""}${e?n.said??n.text:n.text}`).join("")}function Et(t){return D(t,!1)}function Pt(t){return D(t,!0)}function yt(t,e=!1){let n=e?t.said:t.text;return t.record!==void 0?`${t.record} \u2014 ${n}`:n}function z(t){let e=u=>J(u).map(({part:o,space:a})=>({...o,space:a})),n=e(t.parts),r=t.when&&t.when.length>0?e(t.when):void 0,s=u=>`${D(n,u)}${r?`, when ${D(r,u)}`:""}`;return{...t,parts:n,...r?{when:r}:{},text:s(!1),said:s(!0)}}function Lt(t,e=!1){return t.line?yt(t.line,e):t.message}var gt=60,O=t=>({text:t,as:"name"}),c=(t,e)=>e===void 0?{text:t,as:"word"}:{text:t,as:"word",said:e},L=(t,e)=>e===void 0||e===t?{text:t,as:"value"}:{text:t,as:"value",said:e},R=(t,e)=>({text:t,as:"op",said:e}),v={text:"(",as:"open"},w={text:")",as:"close"},N={text:"\u2014",as:"value",said:"empty"},V={">=":["\u2265","at least"],"<=":["\u2264","at most"],"<":["<","less than"],">":[">","more than"],"==":["=","is"],"!=":["\u2260","is not"]},B={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},At={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},xt=t=>t.t==="binary"&&t.op in V;function I(t){return rt(t)}function bt(t){let{schema:e}=t,n=l=>l===null?void 0:e.tryDefinition(l),r=(l,m)=>{let g=n(l)?.edges;return g&&Object.hasOwn(g,m)?g[m]:void 0},s=(l,m)=>{let g=r(l,m)?.to;return Array.isArray(g)&&g.length===1?g[0]:null},u=(l,m)=>{let g=(e.edge(m)?.from??[]).filter(W=>{let K=r(W,m)?.to;return l===null||K==="*"||Array.isArray(K)&&K.includes(l)});return g.length===1?g[0]:null},o=(l,m)=>r(l,m)?M(m).toLowerCase():I(at(n(l),m)),a=l=>I(ot(e,l)),d=l=>I(dt(e).get(l)?.label??M(l)),b=l=>I(st(n(l),l)),i=(l,m)=>{let g=l===null?void 0:t.formatOf?.(l,m);if(g?.format)return g;let W=t.said?.get(m);return W?{...g,format:W}:g},p=l=>_(e.tryDefinition(l.kind),l),h=t.money?.locale,y=(l,m)=>{if(l==null)return N;if(l instanceof F){if(l.nodes.length===0)return N;let A=l.nodes.slice(0,3).map(p),Y=l.nodes.length-A.length;return L(Y>0?`${A.join(", ")} and ${Y} more`:A.length>1?`${A.slice(0,-1).join(", ")} and ${A[A.length-1]}`:A[0])}if(Array.isArray(l))return L(`{${l.map(A=>y(A,m).text).join(", ")}}`,l.map(A=>y(A,m).text).join(" or "));if(typeof l=="object")return L(p(l));if(typeof l=="boolean")return L(l?"yes":"no");let g=m?.format??(m?i(m.kind,m.key):void 0);if(typeof l=="number")return L(g&&g.format!=="date"?ft(l,{...t.money,...g}):et(l,h));if(Q.test(l)||g?.format==="date")return L(G(nt(l,t.money?.timeZone)??l.slice(0,10),h));if(X.test(l))return L(tt(l,h,t.money?.timeZone));let W=m&&m.kind!==null?n(m.kind)?.display?.format?.[m.key]:void 0;if(W)return L(W(l));let K=l.length>gt?`${l.slice(0,gt-1).trimEnd()}\u2026`:l;return L(/^[a-z][a-z0-9]*([-_][a-z0-9]+)*$/.test(K)?K.replace(/[-_]+/g," "):K)};return{definition:n,relation:r,farOf:s,nearOf:u,fieldName:o,plural:a,noun:b,factName:d,formatOf:i,valueWords:y,locale:h}}function P(t,e,n){if(t.t==="ident")return{kind:e,key:t.name};if(t.t==="member")return{kind:E(t.object,e,n),key:t.name};if(t.t==="call"&&(t.fn==="sum"||t.fn==="min"||t.fn==="max")&&t.args.length===2){let r=E(t.args[0],e,n),s=t.args[1];if(s.t==="ident")return{kind:r,key:s.name};if(s.t==="lit"&&typeof s.value=="string")return{kind:r,key:s.value}}if(t.t==="binary"&&(t.op==="+"||t.op==="-"))return P(t.left,e,n)??P(t.right,e,n);if(t.t==="call"&&t.fn==="if"&&t.args.length===3)return P(t.args[1],e,n)??P(t.args[2],e,n)}function E(t,e,n){switch(t.t){case"ident":return n.relation(e,t.name)?n.farOf(e,t.name):null;case"member":return n.farOf(E(t.object,e,n),t.name);case"where":return E(t.set,e,n);case"binary":return t.op==="|"||t.op==="&"||t.op==="-"?E(t.left,e,n):null;case"call":{let r=s=>{let u=t.args[s];return u?.t==="lit"&&typeof u.value=="string"?u.value:void 0};return t.fn==="all"?r(0)??null:t.fn==="out"?t.args.length===2?n.farOf(E(t.args[0],e,n),r(1)??""):n.farOf(e,r(0)??""):t.fn==="in"?t.args.length===2?n.nearOf(E(t.args[0],e,n),r(1)??""):n.nearOf(e,r(0)??""):(t.fn==="first"||t.fn==="sort")&&t.args[0]?E(t.args[0],e,n):null}default:return null}}function j(t){return t.t==="binary"?t.op==="||"?H(t)?4:1:t.op==="&&"?2:t.op in V||t.op==="in"?4:t.op==="+"||t.op==="-"?5:t.op==="*"||t.op==="/"||t.op==="%"?6:4.5:t.t==="unary"&&t.op==="!"?3:t.t==="where"?3.5:9}var $=t=>t.t==="lit",x=(t,e)=>t.t==="call"&&t.fn===e;function C(t,e){return t.t==="binary"&&t.op===e?[...C(t.left,e),...C(t.right,e)]:[t]}function H(t){if(t.t!=="binary"||t.op!=="||")return;let e=[];e.push(...C(t,"||"));let n,r=[];for(let s of e){if(s.t!=="binary"||s.op!=="=="||!$(s.right)||typeof s.right.value!="string"||n&&JSON.stringify(ht(n))!==JSON.stringify(ht(s.left)))return;n=s.left,r.push(s.right)}return n?{subject:n,values:r}:void 0}var ht=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function f(t,e,n,r){let s=(u,o,a=e)=>j(u)<o?[v,...f(u,a,n),w]:f(u,a,n);switch(t.t){case"lit":return[n.valueWords(t.value,r)];case"list":return[n.valueWords(t.items.map(u=>u.t==="lit"?u.value:null),r)];case"ident":return[O(n.fieldName(e,t.name))];case"member":{let u=x(t.object,"first")&&t.object.args[0]&&x(t.object.args[0],"all"),o=E(t.object,e,n);if(u&&o)return e!==null&&n.fieldName(e,t.name)===n.fieldName(o,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[O(`${n.noun(o)}'s ${n.fieldName(o,t.name)}`)]:[O(n.fieldName(o,t.name))];let a=f(t.object,e,n),d=a[a.length-1];return a.length===1&&d?.as==="name"?[O(`${d.text}'s ${n.fieldName(o,t.name)}`)]:[...a,c("'s"),O(n.fieldName(o,t.name))]}case"unary":return t.op==="-"?[R("\u2212","minus"),...s(t.operand,7)]:T(t.operand,e,n);case"where":{let u=E(t.set,e,n),o=f(t.filter,u,n),a=o.every(d=>d.as==="name"||d.as==="word"&&d.text==="not");return[...s(t.set,4),...a?[]:[c("with")],...j(t.filter)<=2?[v,...o,w]:o]}case"binary":return Rt(t,e,n);case"call":return jt(t,e,n)}}function T(t,e,n){return xt(t)?Rt({...t,op:B[t.op]},e,n):x(t,"present")||x(t,"exists")?[...f(t.args[0],e,n),R("=","is"),N]:t.t==="ident"?[c("not"),O(n.fieldName(e,t.name))]:[c("not"),v,...f(t,e,n),w]}function Rt(t,e,n){let r=(o,a)=>j(o)<a?[v,...f(o,e,n),w]:f(o,e,n);if(t.op==="&&"||t.op==="||"){let o=H(t);if(o){let d=P(o.subject,e,n);return[...f(o.subject,e,n),R("\u2208","is one of"),n.valueWords(o.values.map(b=>b.value),d)]}let a=t.op==="&&"?2:1;return[...r(t.left,a),c(t.op==="&&"?"and":"or"),...r(t.right,a+.5)]}if(t.op in V){if($(t.right)&&typeof t.right.value=="boolean"&&(t.op==="=="||t.op==="!="))return t.op==="=="===t.right.value?f(t.left,e,n):T(t.left,e,n);let[o,a]=V[t.op],d=P(t.left,e,n),b=P(t.right,e,n);return[...S(t.left,e,n,b),R(o,a),...S(t.right,e,n,d)]}if(t.op==="in")return[...r(t.left,5),R("\u2208","is one of"),...S(t.right,e,n,P(t.left,e,n))];let s=At[t.op];if(s){let o=j(t);return[...r(t.left,o),R(s[0],s[1]),...r(t.right,o+.5)]}let u={"|":"or","&":"and also","-":"except"};return[...r(t.left,5),c(u[t.op]??t.op),...r(t.right,5)]}function S(t,e,n,r){return t.t==="lit"||t.t==="list"?f(t,e,n,r):j(t)<5?[v,...f(t,e,n),w]:f(t,e,n)}function jt(t,e,n){let r=o=>t.args[o],s=o=>{let a=t.args[o];return a?.t==="lit"&&typeof a.value=="string"?a.value:void 0},u=o=>{let a=r(o);return j(a)<9&&a.t!=="where"?[v,...f(a,e,n),w]:f(a,e,n)};switch(t.fn){case"out":{let o=s(t.args.length-1)??"",a=O(M(o).toLowerCase());return t.args.length===2?[a,c("of"),...u(0)]:[a]}case"in":{let o=s(t.args.length-1)??"",a=t.args.length===2?n.nearOf(E(r(0),e,n),o):n.nearOf(e,o),d=O(a?n.plural(a):M(o).toLowerCase());return t.args.length===2?[d,c("of"),...u(0)]:[d]}case"all":{let o=s(0),a=t.args[1]?.t==="lit"?t.args[1].value:void 0,d=a===!0?[c("archived")]:a==="all"?[c("archived or not")]:[];return a===!0?[...d,O(o?n.plural(o):"everything")]:[O(o?n.plural(o):"everything"),...d]}case"fact":{let o=s(0);return[O(o?n.factName(o):"fact")]}case"count":return[c("number of"),...u(0)];case"exists":return[...u(0),R("\u2260","is not"),N];case"present":return[...f(r(0),e,n),R("\u2260","is not"),N];case"some":case"every":{let o=E(r(0),e,n),a=r(1);return[...t.fn==="some"?[c("some")]:[],...u(0),c(t.fn==="some"?"with":"all with"),...j(a)<=2?[v,...f(a,o,n),w]:f(a,o,n)]}case"sum":case"min":case"max":{let o=E(r(0),e,n),a=r(1),d=a.t==="lit"&&typeof a.value=="string"?[O(n.fieldName(o,a.value))]:j(a)<9?[v,...f(a,o,n),w]:f(a,o,n);return[c(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...d,c("of"),...u(0)]}case"first":{let o=r(0);if(x(o,"all")){let a=o.args[0]?.value;if(typeof a=="string")return[O(`the ${n.noun(a)}`)]}return[c("first of"),...u(0)]}case"sort":return[...u(0),c("by"),...f(r(1),E(r(0),e,n),n)];case"len":return[c("length of"),...f(r(0),e,n)];case"lower":return f(r(0),e,n);case"round":return[...f(r(0),e,n),c(t.args.length===2&&$(r(1))?`rounded to ${String(r(1).value)} places`:"rounded")];case"contains":case"startsWith":return[...f(r(0),e,n),c(t.fn==="contains"?"contains":"starts with"),...S(r(1),e,n,P(r(0),e,n))];case"today":return[L("today")];case"now":return[L("now")];case"date":return $(r(0))&&typeof r(0).value=="string"?[L(G(String(r(0).value),n.locale))]:f(r(0),e,n);case"days":case"hours":{let o=t.fn,[a,d]=[r(0),r(1)];return x(d,"today")||x(d,"now")?[c(`${o} since`),...f(a,e,n)]:x(a,"today")||x(a,"now")?[c(`${o} until`),...f(d,e,n)]:[c(`${o} from`),...f(a,e,n),c("to"),...f(d,e,n)]}case"if":return[v,...f(r(1),e,n),c("if"),...f(r(0),e,n),c(","),c("else"),...f(r(2),e,n),w];case"either":return t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),c("else"),...f(o,e,n)]);default:return[c(t.fn),v,...t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),...f(o,e,n)]),w]}}function U(t,e){let n=bt(e),r=t.over==="graph"?null:t.over;return z({...r===null?{}:{kind:r},parts:f(t.require,r,n),...t.when?{when:f(t.when,r,n)}:{}})}function Z(t,e,n){let r=bt(e),s=t.over==="graph"?null:t.over,u=n.subject,o=i=>{try{return q(i,{...n,budget:2e3})}catch{return}},a=(i,p)=>{let h=S(i,s,r,p);if(i.t==="lit"||i.t==="list"||x(i,"today")||x(i,"now")||x(i,"date"))return h;let y=o(i);if(y===void 0)return h;let l=P(i,s,r),m=r.valueWords(y,l?{...l,format:r.formatOf(l.kind,l.key)??(p?r.formatOf(p.kind,p.key):void 0)}:p);return y instanceof F?[...h,c(":"),m]:[...h,m]},d=i=>{if(i.t==="binary"&&i.op==="&&"){let p=[];p.push(...C(i,"&&"));let h=p.filter(y=>o(y)!==!0);return(h.length>0?h:p).flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op==="||"){let p=H(i);if(p){let y=P(p.subject,s,r);return[...a(p.subject),R("\u2209","is not one of"),r.valueWords(p.values.map(l=>l.value),y)]}let h=[];return h.push(...C(i,"||")),h.flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op in V){if($(i.right)&&typeof i.right.value=="boolean"&&(i.op==="=="||i.op==="!="))return i.op==="=="===i.right.value?T(i.left,s,r):f(i.left,s,r);let p=B[i.op],[h,y]=V[p],l=P(i.left,s,r),m=P(i.right,s,r);if($(i.right)&&i.right.value===null)return[...p==="=="?S(i.left,s,r,m):a(i.left,m),R(h,y),N];let g=p==="=="&&($(i.right)||$(i.left));return[...g?S(i.left,s,r,m):a(i.left,m),R(h,y),...g?S(i.right,s,r,l):a(i.right,l)]}if(i.t==="binary"&&i.op==="in")return[...a(i.left),R("\u2209","is not one of"),...S(i.right,s,r,P(i.left,s,r))];if(i.t==="unary"&&i.op==="!"){let p=i.operand;return xt(p)?d({...p,op:B[p.op]}):x(p,"present")||x(p,"exists")?[...a(p.args[0]),R("\u2260","is not"),N]:p.t==="ident"?f(p,s,r):[c("not"),v,...T(p,s,r),w]}if(x(i,"present")||x(i,"exists"))return[...f(i.args[0],s,r),R("=","is"),N];if(x(i,"some"))return[...f(i,s,r).slice(1),R("=","is"),N];if(x(i,"every")&&i.args.length===2){let p=o(i.args[0]);if(p instanceof F){let h=p.nodes.filter(y=>{try{return q(i.args[1],{...n,subject:y,budget:2e3})!==!0}catch{return!0}});return[...f(i,s,r),c(","),c("not"),r.valueWords(new F(h))]}}return i.t==="ident"?[c("not"),O(r.fieldName(s,i.name))]:[c("not"),v,...f(i,s,r),w]},b;try{b=d(t.require)}catch{b=[c("not"),v,...f(t.require,s,r),w]}return z({...s===null?{}:{kind:s},parts:b,...u?{record:_(e.schema.tryDefinition(u.kind),u)}:{}})}function vt(t){let e=new Map;for(let n of t??[])n.expr?.t==="ident"&&n.format&&(n.format==="money"||n.format==="percent"||n.format==="date")&&e.set(n.expr.name,n.format);return e}function St(t){return(e,n)=>{let r=t[e]?.fields?.[n],s=r?.format??(r?.type==="date"?"date":void 0);return s||r?.unit?{...s?{format:s}:{},...r?.unit?{unit:r.unit}:{}}:void 0}}function Ot(t,e){return{schema:e,said:vt(t.says),...t.declared?{formatOf:St(t.declared)}:{},...t.money?{money:t.money}:{}}}function Qt(t,e){return t.shape?U(t.shape,Ot(t.shape,e)):void 0}var wt=new WeakMap;function Nt(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let s=Kt(r),u=n.get(s.invariant)?.shape;if(!u||s.status&&s.status!=="violated")return s;let o=s.subjectId?t.graph.getNode(s.subjectId):void 0;if(u.over!=="graph"&&!o)return s;let a=u.kinds;a||(a=wt.get(t.schema),a||wt.set(t.schema,a=pt(t.schema)));try{let d=t.today?.()??u.today?.()??k(),b=Z(u,Ot(u,t.schema),{graph:t.graph,subject:o??null,kinds:a,today:d});return{...s,line:b,...u.says?{}:{message:`${s.message} \u2014 ${b.text}`}}}catch{return s}})}function Wt(){ut((t,e,n,r)=>Nt({graph:t,schema:t.schema,allInvariants:()=>e,today:()=>r},n)),mt($t)}function $t(t,e,n,r){let s=e.graph,u=lt.from(t.schema,s.snapshot(),{validate:!1});for(let b of n?[...r].reverse().map(it):r)try{u.applyPrimitives([b],{restoring:!0})}catch{}let o=b=>t.violations(void 0,b),a=o(n?u:s),d=o(n?s:u);return{...ct(t.allInvariants(),a,d),violationsAfter:d}}function Kt(t){if(!t.line)return t;let{line:e,...n}=t,r=` \u2014 ${e.text}`;return n.message.endsWith(r)?{...n,message:n.message.slice(0,-r.length)}:n}Wt();export{Z as brokenLineOf,Wt as judgeWithLines,$t as judgedForASeat,Lt as problemWords,Qt as ruleLine,U as ruleLineOf,yt as ruleLineWords,J as ruleSpacing,Pt as ruleSpoken,Et as ruleText,Kt as unlined,Nt as withLines};
1
+ import{b as mt}from"./chunk.ZFH4SCCF.js";import{a as pt}from"./chunk.RKZ4J3H2.js";import{f as dt}from"./chunk.HKINU7VO.js";import{a as F,f as q}from"./chunk.YGZCESXY.js";import{F as Q,I as X,K as k,Nb as ft,Q as G,T as tt,V as nt,W as et,ba as rt,da as M,ga as _,ja as ot,kb as lt,ma as at,nb as ut,oa as st,qd as ct}from"./chunk.X3MMJ3QC.js";import{e as it}from"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function J(t){let e=[],n=!0;for(let r of t){if(r.text.length===0)continue;let s=r.as==="close"||r.text===","||r.text===":"||r.text.startsWith("'")||n;e.push({part:r,space:!s}),n=r.as==="open"}return e}function D(t,e){return J(t).map(({part:n,space:r})=>`${r?" ":""}${e?n.said??n.text:n.text}`).join("")}function Et(t){return D(t,!1)}function Pt(t){return D(t,!0)}function yt(t,e=!1){let n=e?t.said:t.text;return t.record!==void 0?`${t.record} \u2014 ${n}`:n}function z(t){let e=u=>J(u).map(({part:o,space:a})=>({...o,space:a})),n=e(t.parts),r=t.when&&t.when.length>0?e(t.when):void 0,s=u=>`${D(n,u)}${r?`, when ${D(r,u)}`:""}`;return{...t,parts:n,...r?{when:r}:{},text:s(!1),said:s(!0)}}function Lt(t,e=!1){return t.line?yt(t.line,e):t.message}var gt=60,O=t=>({text:t,as:"name"}),c=(t,e)=>e===void 0?{text:t,as:"word"}:{text:t,as:"word",said:e},L=(t,e)=>e===void 0||e===t?{text:t,as:"value"}:{text:t,as:"value",said:e},R=(t,e)=>({text:t,as:"op",said:e}),v={text:"(",as:"open"},w={text:")",as:"close"},N={text:"\u2014",as:"value",said:"empty"},V={">=":["\u2265","at least"],"<=":["\u2264","at most"],"<":["<","less than"],">":[">","more than"],"==":["=","is"],"!=":["\u2260","is not"]},B={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},At={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},xt=t=>t.t==="binary"&&t.op in V;function I(t){return rt(t)}function bt(t){let{schema:e}=t,n=l=>l===null?void 0:e.tryDefinition(l),r=(l,m)=>{let g=n(l)?.edges;return g&&Object.hasOwn(g,m)?g[m]:void 0},s=(l,m)=>{let g=r(l,m)?.to;return Array.isArray(g)&&g.length===1?g[0]:null},u=(l,m)=>{let g=(e.edge(m)?.from??[]).filter(W=>{let K=r(W,m)?.to;return l===null||K==="*"||Array.isArray(K)&&K.includes(l)});return g.length===1?g[0]:null},o=(l,m)=>r(l,m)?M(m).toLowerCase():I(at(n(l),m)),a=l=>I(ot(e,l)),d=l=>I(dt(e).get(l)?.label??M(l)),b=l=>I(st(n(l),l)),i=(l,m)=>{let g=l===null?void 0:t.formatOf?.(l,m);if(g?.format)return g;let W=t.said?.get(m);return W?{...g,format:W}:g},p=l=>_(e.tryDefinition(l.kind),l),h=t.money?.locale,y=(l,m)=>{if(l==null)return N;if(l instanceof F){if(l.nodes.length===0)return N;let A=l.nodes.slice(0,3).map(p),Y=l.nodes.length-A.length;return L(Y>0?`${A.join(", ")} and ${Y} more`:A.length>1?`${A.slice(0,-1).join(", ")} and ${A[A.length-1]}`:A[0])}if(Array.isArray(l))return L(`{${l.map(A=>y(A,m).text).join(", ")}}`,l.map(A=>y(A,m).text).join(" or "));if(typeof l=="object")return L(p(l));if(typeof l=="boolean")return L(l?"yes":"no");let g=m?.format??(m?i(m.kind,m.key):void 0);if(typeof l=="number")return L(g&&g.format!=="date"?ft(l,{...t.money,...g}):et(l,h));if(Q.test(l)||g?.format==="date")return L(G(nt(l,t.money?.timeZone)??l.slice(0,10),h));if(X.test(l))return L(tt(l,h,t.money?.timeZone));let W=m&&m.kind!==null?n(m.kind)?.display?.format?.[m.key]:void 0;if(W)return L(W(l));let K=l.length>gt?`${l.slice(0,gt-1).trimEnd()}\u2026`:l;return L(/^[a-z][a-z0-9]*([-_][a-z0-9]+)*$/.test(K)?K.replace(/[-_]+/g," "):K)};return{definition:n,relation:r,farOf:s,nearOf:u,fieldName:o,plural:a,noun:b,factName:d,formatOf:i,valueWords:y,locale:h}}function P(t,e,n){if(t.t==="ident")return{kind:e,key:t.name};if(t.t==="member")return{kind:E(t.object,e,n),key:t.name};if(t.t==="call"&&(t.fn==="sum"||t.fn==="min"||t.fn==="max")&&t.args.length===2){let r=E(t.args[0],e,n),s=t.args[1];if(s.t==="ident")return{kind:r,key:s.name};if(s.t==="lit"&&typeof s.value=="string")return{kind:r,key:s.value}}if(t.t==="binary"&&(t.op==="+"||t.op==="-"))return P(t.left,e,n)??P(t.right,e,n);if(t.t==="call"&&t.fn==="if"&&t.args.length===3)return P(t.args[1],e,n)??P(t.args[2],e,n)}function E(t,e,n){switch(t.t){case"ident":return n.relation(e,t.name)?n.farOf(e,t.name):null;case"member":return n.farOf(E(t.object,e,n),t.name);case"where":return E(t.set,e,n);case"binary":return t.op==="|"||t.op==="&"||t.op==="-"?E(t.left,e,n):null;case"call":{let r=s=>{let u=t.args[s];return u?.t==="lit"&&typeof u.value=="string"?u.value:void 0};return t.fn==="all"?r(0)??null:t.fn==="out"?t.args.length===2?n.farOf(E(t.args[0],e,n),r(1)??""):n.farOf(e,r(0)??""):t.fn==="in"?t.args.length===2?n.nearOf(E(t.args[0],e,n),r(1)??""):n.nearOf(e,r(0)??""):(t.fn==="first"||t.fn==="sort")&&t.args[0]?E(t.args[0],e,n):null}default:return null}}function j(t){return t.t==="binary"?t.op==="||"?H(t)?4:1:t.op==="&&"?2:t.op in V||t.op==="in"?4:t.op==="+"||t.op==="-"?5:t.op==="*"||t.op==="/"||t.op==="%"?6:4.5:t.t==="unary"&&t.op==="!"?3:t.t==="where"?3.5:9}var $=t=>t.t==="lit",x=(t,e)=>t.t==="call"&&t.fn===e;function C(t,e){return t.t==="binary"&&t.op===e?[...C(t.left,e),...C(t.right,e)]:[t]}function H(t){if(t.t!=="binary"||t.op!=="||")return;let e=[];e.push(...C(t,"||"));let n,r=[];for(let s of e){if(s.t!=="binary"||s.op!=="=="||!$(s.right)||typeof s.right.value!="string"||n&&JSON.stringify(ht(n))!==JSON.stringify(ht(s.left)))return;n=s.left,r.push(s.right)}return n?{subject:n,values:r}:void 0}var ht=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function f(t,e,n,r){let s=(u,o,a=e)=>j(u)<o?[v,...f(u,a,n),w]:f(u,a,n);switch(t.t){case"lit":return[n.valueWords(t.value,r)];case"list":return[n.valueWords(t.items.map(u=>u.t==="lit"?u.value:null),r)];case"ident":return[O(n.fieldName(e,t.name))];case"member":{let u=x(t.object,"first")&&t.object.args[0]&&x(t.object.args[0],"all"),o=E(t.object,e,n);if(u&&o)return e!==null&&n.fieldName(e,t.name)===n.fieldName(o,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[O(`${n.noun(o)}'s ${n.fieldName(o,t.name)}`)]:[O(n.fieldName(o,t.name))];let a=f(t.object,e,n),d=a[a.length-1];return a.length===1&&d?.as==="name"?[O(`${d.text}'s ${n.fieldName(o,t.name)}`)]:[...a,c("'s"),O(n.fieldName(o,t.name))]}case"unary":return t.op==="-"?[R("\u2212","minus"),...s(t.operand,7)]:T(t.operand,e,n);case"where":{let u=E(t.set,e,n),o=f(t.filter,u,n),a=o.every(d=>d.as==="name"||d.as==="word"&&d.text==="not");return[...s(t.set,4),...a?[]:[c("with")],...j(t.filter)<=2?[v,...o,w]:o]}case"binary":return Rt(t,e,n);case"call":return jt(t,e,n)}}function T(t,e,n){return xt(t)?Rt({...t,op:B[t.op]},e,n):x(t,"present")||x(t,"exists")?[...f(t.args[0],e,n),R("=","is"),N]:t.t==="ident"?[c("not"),O(n.fieldName(e,t.name))]:[c("not"),v,...f(t,e,n),w]}function Rt(t,e,n){let r=(o,a)=>j(o)<a?[v,...f(o,e,n),w]:f(o,e,n);if(t.op==="&&"||t.op==="||"){let o=H(t);if(o){let d=P(o.subject,e,n);return[...f(o.subject,e,n),R("\u2208","is one of"),n.valueWords(o.values.map(b=>b.value),d)]}let a=t.op==="&&"?2:1;return[...r(t.left,a),c(t.op==="&&"?"and":"or"),...r(t.right,a+.5)]}if(t.op in V){if($(t.right)&&typeof t.right.value=="boolean"&&(t.op==="=="||t.op==="!="))return t.op==="=="===t.right.value?f(t.left,e,n):T(t.left,e,n);let[o,a]=V[t.op],d=P(t.left,e,n),b=P(t.right,e,n);return[...S(t.left,e,n,b),R(o,a),...S(t.right,e,n,d)]}if(t.op==="in")return[...r(t.left,5),R("\u2208","is one of"),...S(t.right,e,n,P(t.left,e,n))];let s=At[t.op];if(s){let o=j(t);return[...r(t.left,o),R(s[0],s[1]),...r(t.right,o+.5)]}let u={"|":"or","&":"and also","-":"except"};return[...r(t.left,5),c(u[t.op]??t.op),...r(t.right,5)]}function S(t,e,n,r){return t.t==="lit"||t.t==="list"?f(t,e,n,r):j(t)<5?[v,...f(t,e,n),w]:f(t,e,n)}function jt(t,e,n){let r=o=>t.args[o],s=o=>{let a=t.args[o];return a?.t==="lit"&&typeof a.value=="string"?a.value:void 0},u=o=>{let a=r(o);return j(a)<9&&a.t!=="where"?[v,...f(a,e,n),w]:f(a,e,n)};switch(t.fn){case"out":{let o=s(t.args.length-1)??"",a=O(M(o).toLowerCase());return t.args.length===2?[a,c("of"),...u(0)]:[a]}case"in":{let o=s(t.args.length-1)??"",a=t.args.length===2?n.nearOf(E(r(0),e,n),o):n.nearOf(e,o),d=O(a?n.plural(a):M(o).toLowerCase());return t.args.length===2?[d,c("of"),...u(0)]:[d]}case"all":{let o=s(0),a=t.args[1]?.t==="lit"?t.args[1].value:void 0,d=a===!0?[c("archived")]:a==="all"?[c("archived or not")]:[];return a===!0?[...d,O(o?n.plural(o):"everything")]:[O(o?n.plural(o):"everything"),...d]}case"fact":{let o=s(0);return[O(o?n.factName(o):"fact")]}case"count":return[c("number of"),...u(0)];case"exists":return[...u(0),R("\u2260","is not"),N];case"present":return[...f(r(0),e,n),R("\u2260","is not"),N];case"some":case"every":{let o=E(r(0),e,n),a=r(1);return[...t.fn==="some"?[c("some")]:[],...u(0),c(t.fn==="some"?"with":"all with"),...j(a)<=2?[v,...f(a,o,n),w]:f(a,o,n)]}case"sum":case"min":case"max":{let o=E(r(0),e,n),a=r(1),d=a.t==="lit"&&typeof a.value=="string"?[O(n.fieldName(o,a.value))]:j(a)<9?[v,...f(a,o,n),w]:f(a,o,n);return[c(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...d,c("of"),...u(0)]}case"first":{let o=r(0);if(x(o,"all")){let a=o.args[0]?.value;if(typeof a=="string")return[O(`the ${n.noun(a)}`)]}return[c("first of"),...u(0)]}case"sort":return[...u(0),c("by"),...f(r(1),E(r(0),e,n),n)];case"len":return[c("length of"),...f(r(0),e,n)];case"lower":return f(r(0),e,n);case"round":return[...f(r(0),e,n),c(t.args.length===2&&$(r(1))?`rounded to ${String(r(1).value)} places`:"rounded")];case"contains":case"startsWith":return[...f(r(0),e,n),c(t.fn==="contains"?"contains":"starts with"),...S(r(1),e,n,P(r(0),e,n))];case"today":return[L("today")];case"now":return[L("now")];case"date":return $(r(0))&&typeof r(0).value=="string"?[L(G(String(r(0).value),n.locale))]:f(r(0),e,n);case"days":case"hours":{let o=t.fn,[a,d]=[r(0),r(1)];return x(d,"today")||x(d,"now")?[c(`${o} since`),...f(a,e,n)]:x(a,"today")||x(a,"now")?[c(`${o} until`),...f(d,e,n)]:[c(`${o} from`),...f(a,e,n),c("to"),...f(d,e,n)]}case"if":return[v,...f(r(1),e,n),c("if"),...f(r(0),e,n),c(","),c("else"),...f(r(2),e,n),w];case"either":return t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),c("else"),...f(o,e,n)]);default:return[c(t.fn),v,...t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),...f(o,e,n)]),w]}}function U(t,e){let n=bt(e),r=t.over==="graph"?null:t.over;return z({...r===null?{}:{kind:r},parts:f(t.require,r,n),...t.when?{when:f(t.when,r,n)}:{}})}function Z(t,e,n){let r=bt(e),s=t.over==="graph"?null:t.over,u=n.subject,o=i=>{try{return q(i,{...n,budget:2e3})}catch{return}},a=(i,p)=>{let h=S(i,s,r,p);if(i.t==="lit"||i.t==="list"||x(i,"today")||x(i,"now")||x(i,"date"))return h;let y=o(i);if(y===void 0)return h;let l=P(i,s,r),m=r.valueWords(y,l?{...l,format:r.formatOf(l.kind,l.key)??(p?r.formatOf(p.kind,p.key):void 0)}:p);return y instanceof F?[...h,c(":"),m]:[...h,m]},d=i=>{if(i.t==="binary"&&i.op==="&&"){let p=[];p.push(...C(i,"&&"));let h=p.filter(y=>o(y)!==!0);return(h.length>0?h:p).flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op==="||"){let p=H(i);if(p){let y=P(p.subject,s,r);return[...a(p.subject),R("\u2209","is not one of"),r.valueWords(p.values.map(l=>l.value),y)]}let h=[];return h.push(...C(i,"||")),h.flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op in V){if($(i.right)&&typeof i.right.value=="boolean"&&(i.op==="=="||i.op==="!="))return i.op==="=="===i.right.value?T(i.left,s,r):f(i.left,s,r);let p=B[i.op],[h,y]=V[p],l=P(i.left,s,r),m=P(i.right,s,r);if($(i.right)&&i.right.value===null)return[...p==="=="?S(i.left,s,r,m):a(i.left,m),R(h,y),N];let g=p==="=="&&($(i.right)||$(i.left));return[...g?S(i.left,s,r,m):a(i.left,m),R(h,y),...g?S(i.right,s,r,l):a(i.right,l)]}if(i.t==="binary"&&i.op==="in")return[...a(i.left),R("\u2209","is not one of"),...S(i.right,s,r,P(i.left,s,r))];if(i.t==="unary"&&i.op==="!"){let p=i.operand;return xt(p)?d({...p,op:B[p.op]}):x(p,"present")||x(p,"exists")?[...a(p.args[0]),R("\u2260","is not"),N]:p.t==="ident"?f(p,s,r):[c("not"),v,...T(p,s,r),w]}if(x(i,"present")||x(i,"exists"))return[...f(i.args[0],s,r),R("=","is"),N];if(x(i,"some"))return[...f(i,s,r).slice(1),R("=","is"),N];if(x(i,"every")&&i.args.length===2){let p=o(i.args[0]);if(p instanceof F){let h=p.nodes.filter(y=>{try{return q(i.args[1],{...n,subject:y,budget:2e3})!==!0}catch{return!0}});return[...f(i,s,r),c(","),c("not"),r.valueWords(new F(h))]}}return i.t==="ident"?[c("not"),O(r.fieldName(s,i.name))]:[c("not"),v,...f(i,s,r),w]},b;try{b=d(t.require)}catch{b=[c("not"),v,...f(t.require,s,r),w]}return z({...s===null?{}:{kind:s},parts:b,...u?{record:_(e.schema.tryDefinition(u.kind),u)}:{}})}function vt(t){let e=new Map;for(let n of t??[])n.expr?.t==="ident"&&n.format&&(n.format==="money"||n.format==="percent"||n.format==="date")&&e.set(n.expr.name,n.format);return e}function St(t){return(e,n)=>{let r=t[e]?.fields?.[n],s=r?.format??(r?.type==="date"?"date":void 0);return s||r?.unit?{...s?{format:s}:{},...r?.unit?{unit:r.unit}:{}}:void 0}}function Ot(t,e){return{schema:e,said:vt(t.says),...t.declared?{formatOf:St(t.declared)}:{},...t.money?{money:t.money}:{}}}function Qt(t,e){return t.shape?U(t.shape,Ot(t.shape,e)):void 0}var wt=new WeakMap;function Nt(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let s=Kt(r),u=n.get(s.invariant)?.shape;if(!u||s.status&&s.status!=="violated")return s;let o=s.subjectId?t.graph.getNode(s.subjectId):void 0;if(u.over!=="graph"&&!o)return s;let a=u.kinds;a||(a=wt.get(t.schema),a||wt.set(t.schema,a=pt(t.schema)));try{let d=t.today?.()??u.today?.()??k(),b=Z(u,Ot(u,t.schema),{graph:t.graph,subject:o??null,kinds:a,today:d});return{...s,line:b,...u.says?{}:{message:`${s.message} \u2014 ${b.text}`}}}catch{return s}})}function Wt(){ut((t,e,n,r)=>Nt({graph:t,schema:t.schema,allInvariants:()=>e,today:()=>r},n)),mt($t)}function $t(t,e,n,r){let s=e.graph,u=lt.from(t.schema,s.snapshot(),{validate:!1});for(let b of n?[...r].reverse().map(it):r)try{u.applyPrimitives([b],{restoring:!0})}catch{}let o=b=>t.violations(void 0,b),a=o(n?u:s),d=o(n?s:u);return{...ct(t.allInvariants(),a,d),violationsAfter:d}}function Kt(t){if(!t.line)return t;let{line:e,...n}=t,r=` \u2014 ${e.text}`;return n.message.endsWith(r)?{...n,message:n.message.slice(0,-r.length)}:n}Wt();export{Z as brokenLineOf,Wt as judgeWithLines,$t as judgedForASeat,Lt as problemWords,Qt as ruleLine,U as ruleLineOf,yt as ruleLineWords,J as ruleSpacing,Pt as ruleSpoken,Et as ruleText,Kt as unlined,Nt as withLines};
@@ -0,0 +1 @@
1
+ import{k as a,l as o}from"./chunk.HF5SNUTK.js";import"./chunk.S7ZLGODY.js";import"./chunk.2QESVWUW.js";import"./chunk.UM5H2VVR.js";import"./chunk.MRYN42EQ.js";import"./chunk.E22DDEQI.js";import"./chunk.OLW44AP5.js";import"./chunk.D3AISGQH.js";import"./chunk.IZ2ZTNEV.js";import"./chunk.6E36I2GC.js";import"./chunk.CJUIJ6TL.js";import"./chunk.IIESMHXY.js";import"./chunk.WVUJXDXZ.js";import"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.GZHZLJBF.js";import"./chunk.KHZA5F7A.js";import"./chunk.OJGHDWI6.js";import"./chunk.KSVJHSRH.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{ta as n}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import"./chunk.X3MMJ3QC.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};
@@ -0,0 +1 @@
1
+ import"./chunk.WVUJXDXZ.js";import{k as m,m as i}from"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.2FOIJ5ID.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function a(t){let r=new Map;return(s,o)=>{let e=o.kind,n=r.get(e);return n===void 0&&r.set(e,n=i(t,e).length),n===0?{}:m(t,s,o).values}}export{a as computedOn};
@@ -1 +1 @@
1
- import{a as r,b as m,d as k,e as y}from"./chunk.UGFDSE37.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var i="way-back",b='[data-testid="notices-toasts"]';function g(t){let o=document.activeElement;o!==null&&o!==document.body&&!o.closest(b)||(t??document).querySelector('[data-graview-app-bar] [data-testid="app-home"]')?.focus({preventScroll:!0})}function E(t,o,a,d,h){if(t.past)return a?.dismiss(i),()=>{};let c=h?.closest("[data-graview-embed]"),s,f=e=>{if(e!==void 0&&r(t,o)?.batch!==e)return!1;try{let n=k(t,o);return n&&a?.notify({kind:"toast",id:i,sentence:`Took back \u201C${n.intent}\u201D`}),n!==void 0}catch(n){return a?.notify({kind:"toast",id:i,tone:"warn",sentence:n instanceof Error?n.message:String(n)}),!0}},u=()=>{let e=m(t,o,d);if(d=t.batches().length,e){let n=s=e.batch;a?.notify({kind:"toast",id:i,sentence:e.intent,timeout:1e4,action:{label:"Take back",keys:"Meta+Z Control+Z",onSelect:()=>(g(c),f(n))}})}else s&&r(t,o)?.batch!==s&&(s=void 0,a?.dismiss(i))},l=e=>{y(e)&&(!c||c.contains(e.target))&&f()&&e.preventDefault()};u();let p=t.subscribe(u);return document.addEventListener("keydown",l),(e=!1)=>{p(),document.removeEventListener("keydown",l),e&&s&&a?.dismiss(i)}}export{E as sceneWay};
1
+ import{a as r,b as m,d as k,e as y}from"./chunk.Q355UPFG.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var i="way-back",b='[data-testid="notices-toasts"]';function g(t){let o=document.activeElement;o!==null&&o!==document.body&&!o.closest(b)||(t??document).querySelector('[data-graview-app-bar] [data-testid="app-home"]')?.focus({preventScroll:!0})}function E(t,o,a,d,h){if(t.past)return a?.dismiss(i),()=>{};let c=h?.closest("[data-graview-embed]"),s,f=e=>{if(e!==void 0&&r(t,o)?.batch!==e)return!1;try{let n=k(t,o);return n&&a?.notify({kind:"toast",id:i,sentence:`Took back \u201C${n.intent}\u201D`}),n!==void 0}catch(n){return a?.notify({kind:"toast",id:i,tone:"warn",sentence:n instanceof Error?n.message:String(n)}),!0}},u=()=>{let e=m(t,o,d);if(d=t.batches().length,e){let n=s=e.batch;a?.notify({kind:"toast",id:i,sentence:e.intent,timeout:1e4,action:{label:"Take back",keys:"Meta+Z Control+Z",onSelect:()=>(g(c),f(n))}})}else s&&r(t,o)?.batch!==s&&(s=void 0,a?.dismiss(i))},l=e=>{y(e)&&(!c||c.contains(e.target))&&f()&&e.preventDefault()};u();let p=t.subscribe(u);return document.addEventListener("keydown",l),(e=!1)=>{p(),document.removeEventListener("keydown",l),e&&s&&a?.dismiss(i)}}export{E as sceneWay};
@@ -1,4 +1,4 @@
1
- import{l as K}from"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{G as R,T as x,ba as N,ca as $}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import{Bd as k,ka as w,rd as g,sd as b,td as f,zd as h}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as v}from"./chunk.AJZBJBMO.js";var u=v(R(),1);var o=v(x(),1),E=()=>()=>{};function C(e){let n=(0,u.useMemo)(()=>e?.onChange?i=>e.onChange(i):E,[e]),t=()=>e?.current()??b;return(0,u.useSyncExternalStore)(n,t,t)}var D=(e,n)=>e.lens?n.may.lenses:n.may.views;async function p(e,n,t){try{return await n(),!0}catch(i){return e?.notify({kind:"toast",tone:"bad",sentence:i instanceof Error&&i.message?i.message:t}),!1}}function H(e,n,t,i,r){let s=e.name;return p(r,()=>n==="view"&&s!==void 0?i?t.hide(s):t.show(s):t.lens?.({op:"set-lens-hidden",title:e.title,on:e.kind,hidden:i}),i?`\u201C${e.title}\u201D could not be hidden.`:`\u201C${e.title}\u201D could not be shown.`)}function L(e,n,t,i,r){return p(r,()=>t.lens?.({op:"set-lens-hidden",title:e,hidden:i}),i?`\u201C${n}\u201D could not be hidden.`:`\u201C${n}\u201D could not be shown.`)}function V(e,n,t){return p(t,()=>n.restore(e.name),`\u201C${e.title}\u201D could not be restored.`)}async function A(e,n,t,i){let r=n==="view"&&e.name!==void 0?e.name:g(e.title),s=await p(i,()=>n==="view"&&e.name!==void 0?t.remove(e.name,{title:e.title,kind:e.kind}):t.lens?.({op:"remove-lens",title:e.title,on:e.kind}),`\u201C${e.title}\u201D could not be deleted.`);return s&&i?.notify({kind:"toast",id:`deleted-view-${r}`,sentence:`Deleted \u201C${e.title}\u201D. It is under Recently deleted in the places for ${30} days.`,action:{label:"Restore",onSelect:()=>void V({name:r,title:e.title},t,i)}}),s}function G(){let e=$(),n=e?.keptViews,t=C(n),i=e?.views;return(0,u.useMemo)(()=>{if(!n||!i)return null;let r=d=>f(d,t,n),s=new Set,m=i.places().filter(d=>{if(!d.hidden||r(d)===null)return!1;let c=`${d.name??""}|${d.title}`;return s.has(c)?!1:(s.add(c),!0)}),l=e?.store.schema,y=t.may.lenses&&n.lens&&l?(i.arrangement?.()?.hide??[]).filter(d=>l.tryDefinition(d)!==void 0).map(d=>({kind:d,title:w(l,d),path:h(l,d)})):[];return{keeper:n,hidden:m,lists:y,removed:t.removed.filter(d=>D(d,t)),how:r}},[n,t,i,e?.store.schema])}function T(e,n){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(n??"en-US",{month:"short",day:"numeric"})}var I=`.graview-bar-list li.graview-bar-tidied{display:flex;align-items:flex-start;gap:8px;padding:0 0 0 2px}
1
+ import{l as K}from"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{G as R,T as x,ba as N,ca as $}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import{Bd as h,Dd as k,ka as w,td as g,ud as b,vd as f}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as v}from"./chunk.AJZBJBMO.js";var u=v(R(),1);var o=v(x(),1),E=()=>()=>{};function C(e){let n=(0,u.useMemo)(()=>e?.onChange?i=>e.onChange(i):E,[e]),t=()=>e?.current()??b;return(0,u.useSyncExternalStore)(n,t,t)}var D=(e,n)=>e.lens?n.may.lenses:n.may.views;async function p(e,n,t){try{return await n(),!0}catch(i){return e?.notify({kind:"toast",tone:"bad",sentence:i instanceof Error&&i.message?i.message:t}),!1}}function H(e,n,t,i,r){let s=e.name;return p(r,()=>n==="view"&&s!==void 0?i?t.hide(s):t.show(s):t.lens?.({op:"set-lens-hidden",title:e.title,on:e.kind,hidden:i}),i?`\u201C${e.title}\u201D could not be hidden.`:`\u201C${e.title}\u201D could not be shown.`)}function L(e,n,t,i,r){return p(r,()=>t.lens?.({op:"set-lens-hidden",title:e,hidden:i}),i?`\u201C${n}\u201D could not be hidden.`:`\u201C${n}\u201D could not be shown.`)}function V(e,n,t){return p(t,()=>n.restore(e.name),`\u201C${e.title}\u201D could not be restored.`)}async function A(e,n,t,i){let r=n==="view"&&e.name!==void 0?e.name:g(e.title),s=await p(i,()=>n==="view"&&e.name!==void 0?t.remove(e.name,{title:e.title,kind:e.kind}):t.lens?.({op:"remove-lens",title:e.title,on:e.kind}),`\u201C${e.title}\u201D could not be deleted.`);return s&&i?.notify({kind:"toast",id:`deleted-view-${r}`,sentence:`Deleted \u201C${e.title}\u201D. It is under Recently deleted in the places for ${30} days.`,action:{label:"Restore",onSelect:()=>void V({name:r,title:e.title},t,i)}}),s}function G(){let e=$(),n=e?.keptViews,t=C(n),i=e?.views;return(0,u.useMemo)(()=>{if(!n||!i)return null;let r=d=>f(d,t,n),s=new Set,m=i.places().filter(d=>{if(!d.hidden||r(d)===null)return!1;let c=`${d.name??""}|${d.title}`;return s.has(c)?!1:(s.add(c),!0)}),l=e?.store.schema,y=t.may.lenses&&n.lens&&l?(i.arrangement?.()?.hide??[]).filter(d=>l.tryDefinition(d)!==void 0).map(d=>({kind:d,title:w(l,d),path:h(l,d)})):[];return{keeper:n,hidden:m,lists:y,removed:t.removed.filter(d=>D(d,t)),how:r}},[n,t,i,e?.store.schema])}function T(e,n){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(n??"en-US",{month:"short",day:"numeric"})}var I=`.graview-bar-list li.graview-bar-tidied{display:flex;align-items:flex-start;gap:8px;padding:0 0 0 2px}
2
2
  .graview-bar-tidied>.graview-bar-item,.graview-bar-gone{flex:1 1 auto;min-width:0}
3
3
  .graview-bar-gone{display:grid;gap:1px;padding:7px 8px;font-size:.875rem;line-height:1.3;overflow-wrap:anywhere;color:var(--graview-ink-muted)}
4
4
  .graview-bar-gone small{font-size:.75rem}
@@ -1 +1 @@
1
- import"./chunk.GZHZLJBF.js";import{n as P}from"./chunk.ELERUERU.js";import"./chunk.OJGHDWI6.js";import"./chunk.YHTE34RN.js";import"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import"./chunk.27CW6SCT.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{G as A,T as S,ca as b}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import{Da as w,Uc as x,qa as L}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as R}from"./chunk.AJZBJBMO.js";var u=R(A(),1);var n=R(S(),1),C={kind:"human"},p={color:"var(--graview-ink-muted)"};function I(e){if(e){if(/^https?:\/\//i.test(e))try{return new URL(e).href}catch{return}return L(e)?e:void 0}}function z(e){let o=b(),t=o?.linkedReads,[i,a]=(0,u.useState)(()=>t?t.answered(e)??"asking":null);return(0,u.useEffect)(()=>{if(!t){a(o?.linkedRecords?"asking":null);return}let d=t.answered(e);if(a(d===void 0?"asking":d),d!==void 0)return;let s=!0;return t.ask(e).then(l=>s&&a(l)),()=>{s=!1}},[t,o?.linkedRecords,e.address,e.kind,e.id]),i}function V({reference:e,as:o}){let t=b(),i=z(e),a={position:"relative",zIndex:x.raised,overflowWrap:"anywhere",minWidth:0,maxWidth:"100%"};if(i==="asking")return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"asking","aria-busy":"true",style:{...p,...a},children:"Linked record"});if(i&&"denied"in i)return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"denied",style:{...p,fontStyle:"italic",...a},children:"linked record (no access)"});if(!i)return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"missing",style:{...p,fontStyle:"italic",...a},children:"linked record (not found)"});let d=I(i.href),s=t?.linkedRecords,l=t?.principal??C,g=s?.open?c=>{c.metaKey||c.ctrlKey||(c.preventDefault(),s.open(e,l))}:void 0,k=(0,n.jsx)("a",{"data-graview-linked-title":"",...d?{href:d}:{role:"link",tabIndex:0},...g?{onClick:g,onKeyDown:c=>!d&&(c.key==="Enter"||c.key===" ")?g(c):void 0}:{},style:{fontWeight:600,color:"inherit",textUnderlineOffset:3,cursor:d||g?"pointer":"default"},children:i.label});return o==="chip"?(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"found",title:i.describe,style:{display:"inline-flex",alignItems:"center",minHeight:24,...a},children:k}):(0,n.jsx)(D,{record:i,title:k,base:a})}function D({record:e,title:o,base:t}){return(0,n.jsxs)("span",{"data-graview-linked":"","data-graview-linked-state":"found",style:{display:"grid",gap:2,padding:"8px 10px",border:"1px solid var(--graview-line)",borderRadius:"var(--graview-radius-sm, 6px)",background:"var(--graview-surface)",...t},children:[(0,n.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"2px 8px"},children:[o,e.app?(0,n.jsxs)("span",{"data-graview-linked-app":"",style:{...p,fontSize:"0.75rem"},children:["in ",e.app]}):null]}),e.describe?(0,n.jsx)("span",{"data-graview-linked-describe":"",style:{...p,fontSize:"0.8125rem"},children:e.describe}):null,e.card&&e.card.length>0?(0,n.jsx)("span",{"data-graview-linked-card":"",style:{display:"flex",flexWrap:"wrap",gap:"2px 12px",fontSize:"0.8125rem"},children:e.card.map(i=>(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{style:p,children:i.label})," ",i.text]},i.label))}):null]})}function H({relation:e,refs:o,as:t="record",nodeId:i,field:a,style:d}){let s=(0,n.jsx)("span",{"data-graview-linked-list":"",style:{display:"grid",gap:6,minWidth:0,...d},children:o.map(l=>(0,n.jsx)(V,{reference:l,as:t},w(l)))});return i&&a?(0,n.jsx)(K,{nodeId:i,field:a,relation:e,refs:o,drawn:s}):s}function K({nodeId:e,field:o,relation:t,refs:i,drawn:a}){let{fields:d,commit:s}=P(e),l=d.find(f=>f.field===o),[g,k]=(0,u.useState)(!1);if(!l)return a;let c=t.cardinality==="one"?i[0]?w(i[0]):void 0:i.map(w);return(0,n.jsxs)("span",{style:{display:"grid",gap:6,minWidth:0},children:[a,g?(0,n.jsx)(N,{relation:t,value:c,label:"Link another record",onChange:f=>{s(l,f),k(!1)},onCancel:()=>k(!1)}):(0,n.jsx)("button",{type:"button","data-graview-linked-change":"",onClick:()=>k(!0),style:{justifySelf:"start",font:"inherit",fontSize:"0.8125rem",background:"none",border:0,padding:"4px 0",color:"var(--graview-accent)",cursor:"pointer",minHeight:24},children:"Change"})]})}function N({relation:e,value:o,onChange:t,onCancel:i,label:a}){let d=b(),s=d?.linkedRecords,l=d?.principal??C,g=(0,u.useId)(),[k,c]=(0,u.useState)(""),[f,m]=(0,u.useState)("asking");(0,u.useEffect)(()=>{if(!s)return;let r=!0;m("asking");let y=setTimeout(()=>{Promise.resolve().then(()=>s.find({address:e.address,kinds:e.kinds,query:k,limit:20},l)).then(h=>r&&m(Array.isArray(h)?h:"denied"),()=>r&&m([]))},150);return()=>{r=!1,clearTimeout(y)}},[s,e.address,e.kinds.join(","),k,l.kind,l.id]);let v=new Set([o].flat().filter(r=>typeof r=="string")),W=r=>{let y=w(r);if(e.cardinality==="one")return t(y);t(v.has(y)?[...v].filter(h=>h!==y):[...v,y])};return s?(0,n.jsxs)("span",{"data-graview-linked-picker":"",style:{display:"grid",gap:6,minWidth:0},children:[(0,n.jsx)("label",{htmlFor:g,style:{...p,fontSize:"0.8125rem"},children:a}),(0,n.jsx)("input",{id:g,type:"search",value:k,placeholder:`Find one in ${e.address}`,onChange:r=>c(r.target.value),style:{font:"inherit",minHeight:32,padding:"4px 8px",border:"1px solid var(--graview-line)",borderRadius:6,background:"var(--graview-surface)",color:"inherit",minWidth:0}}),f==="asking"?(0,n.jsx)("span",{"aria-busy":"true",style:p,children:"Looking\u2026"}):f==="denied"?(0,n.jsx)("span",{"data-graview-linked-state":"denied",style:{...p,fontStyle:"italic"},children:"linked record (no access)"}):f.length===0?(0,n.jsx)("span",{style:p,children:"Nothing there matches."}):(0,n.jsx)("ul",{role:"list",style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:4},children:f.map(r=>{let y=v.has(w(r));return(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button","data-graview-linked-candidate":w(r),"aria-pressed":y,onClick:()=>W(r),style:{display:"grid",gap:2,width:"100%",textAlign:"start",font:"inherit",padding:"6px 8px",minHeight:32,border:"1px solid var(--graview-line)",borderRadius:6,background:y?"var(--graview-accent-soft, var(--graview-surface))":"var(--graview-surface)",color:"inherit",cursor:"pointer"},children:[(0,n.jsx)("span",{style:{fontWeight:600},children:r.label}),r.describe?(0,n.jsx)("span",{style:{...p,fontSize:"0.8125rem"},children:r.describe}):null]})},w(r))})}),i?(0,n.jsx)("button",{type:"button",onClick:i,style:{justifySelf:"start",font:"inherit",fontSize:"0.8125rem",background:"none",border:0,padding:"4px 0",color:"var(--graview-ink-muted)",cursor:"pointer",minHeight:24},children:"Keep it as it is"}):null]}):(0,n.jsxs)("span",{"data-graview-linked-picker":"","data-graview-linked-state":"no-host",style:p,children:["This page cannot read ",e.address,", so nothing there can be linked here."]})}var T=e=>(0,n.jsx)(H,{...e}),U=e=>(0,n.jsx)(N,{...e});export{N as LinkedPicker,H as LinkedRecordView,U as drawLinkedPicker,T as drawLinkedRecord};
1
+ import"./chunk.GZHZLJBF.js";import{n as P}from"./chunk.KHZA5F7A.js";import"./chunk.OJGHDWI6.js";import"./chunk.KSVJHSRH.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{G as A,T as S,ca as b}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import{Da as w,Vc as x,qa as L}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as R}from"./chunk.AJZBJBMO.js";var u=R(A(),1);var n=R(S(),1),C={kind:"human"},p={color:"var(--graview-ink-muted)"};function I(e){if(e){if(/^https?:\/\//i.test(e))try{return new URL(e).href}catch{return}return L(e)?e:void 0}}function z(e){let o=b(),t=o?.linkedReads,[i,a]=(0,u.useState)(()=>t?t.answered(e)??"asking":null);return(0,u.useEffect)(()=>{if(!t){a(o?.linkedRecords?"asking":null);return}let d=t.answered(e);if(a(d===void 0?"asking":d),d!==void 0)return;let s=!0;return t.ask(e).then(l=>s&&a(l)),()=>{s=!1}},[t,o?.linkedRecords,e.address,e.kind,e.id]),i}function V({reference:e,as:o}){let t=b(),i=z(e),a={position:"relative",zIndex:x.raised,overflowWrap:"anywhere",minWidth:0,maxWidth:"100%"};if(i==="asking")return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"asking","aria-busy":"true",style:{...p,...a},children:"Linked record"});if(i&&"denied"in i)return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"denied",style:{...p,fontStyle:"italic",...a},children:"linked record (no access)"});if(!i)return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"missing",style:{...p,fontStyle:"italic",...a},children:"linked record (not found)"});let d=I(i.href),s=t?.linkedRecords,l=t?.principal??C,g=s?.open?c=>{c.metaKey||c.ctrlKey||(c.preventDefault(),s.open(e,l))}:void 0,k=(0,n.jsx)("a",{"data-graview-linked-title":"",...d?{href:d}:{role:"link",tabIndex:0},...g?{onClick:g,onKeyDown:c=>!d&&(c.key==="Enter"||c.key===" ")?g(c):void 0}:{},style:{fontWeight:600,color:"inherit",textUnderlineOffset:3,cursor:d||g?"pointer":"default"},children:i.label});return o==="chip"?(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"found",title:i.describe,style:{display:"inline-flex",alignItems:"center",minHeight:24,...a},children:k}):(0,n.jsx)(D,{record:i,title:k,base:a})}function D({record:e,title:o,base:t}){return(0,n.jsxs)("span",{"data-graview-linked":"","data-graview-linked-state":"found",style:{display:"grid",gap:2,padding:"8px 10px",border:"1px solid var(--graview-line)",borderRadius:"var(--graview-radius-sm, 6px)",background:"var(--graview-surface)",...t},children:[(0,n.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"2px 8px"},children:[o,e.app?(0,n.jsxs)("span",{"data-graview-linked-app":"",style:{...p,fontSize:"0.75rem"},children:["in ",e.app]}):null]}),e.describe?(0,n.jsx)("span",{"data-graview-linked-describe":"",style:{...p,fontSize:"0.8125rem"},children:e.describe}):null,e.card&&e.card.length>0?(0,n.jsx)("span",{"data-graview-linked-card":"",style:{display:"flex",flexWrap:"wrap",gap:"2px 12px",fontSize:"0.8125rem"},children:e.card.map(i=>(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{style:p,children:i.label})," ",i.text]},i.label))}):null]})}function H({relation:e,refs:o,as:t="record",nodeId:i,field:a,style:d}){let s=(0,n.jsx)("span",{"data-graview-linked-list":"",style:{display:"grid",gap:6,minWidth:0,...d},children:o.map(l=>(0,n.jsx)(V,{reference:l,as:t},w(l)))});return i&&a?(0,n.jsx)(K,{nodeId:i,field:a,relation:e,refs:o,drawn:s}):s}function K({nodeId:e,field:o,relation:t,refs:i,drawn:a}){let{fields:d,commit:s}=P(e),l=d.find(f=>f.field===o),[g,k]=(0,u.useState)(!1);if(!l)return a;let c=t.cardinality==="one"?i[0]?w(i[0]):void 0:i.map(w);return(0,n.jsxs)("span",{style:{display:"grid",gap:6,minWidth:0},children:[a,g?(0,n.jsx)(N,{relation:t,value:c,label:"Link another record",onChange:f=>{s(l,f),k(!1)},onCancel:()=>k(!1)}):(0,n.jsx)("button",{type:"button","data-graview-linked-change":"",onClick:()=>k(!0),style:{justifySelf:"start",font:"inherit",fontSize:"0.8125rem",background:"none",border:0,padding:"4px 0",color:"var(--graview-accent)",cursor:"pointer",minHeight:24},children:"Change"})]})}function N({relation:e,value:o,onChange:t,onCancel:i,label:a}){let d=b(),s=d?.linkedRecords,l=d?.principal??C,g=(0,u.useId)(),[k,c]=(0,u.useState)(""),[f,m]=(0,u.useState)("asking");(0,u.useEffect)(()=>{if(!s)return;let r=!0;m("asking");let y=setTimeout(()=>{Promise.resolve().then(()=>s.find({address:e.address,kinds:e.kinds,query:k,limit:20},l)).then(h=>r&&m(Array.isArray(h)?h:"denied"),()=>r&&m([]))},150);return()=>{r=!1,clearTimeout(y)}},[s,e.address,e.kinds.join(","),k,l.kind,l.id]);let v=new Set([o].flat().filter(r=>typeof r=="string")),W=r=>{let y=w(r);if(e.cardinality==="one")return t(y);t(v.has(y)?[...v].filter(h=>h!==y):[...v,y])};return s?(0,n.jsxs)("span",{"data-graview-linked-picker":"",style:{display:"grid",gap:6,minWidth:0},children:[(0,n.jsx)("label",{htmlFor:g,style:{...p,fontSize:"0.8125rem"},children:a}),(0,n.jsx)("input",{id:g,type:"search",value:k,placeholder:`Find one in ${e.address}`,onChange:r=>c(r.target.value),style:{font:"inherit",minHeight:32,padding:"4px 8px",border:"1px solid var(--graview-line)",borderRadius:6,background:"var(--graview-surface)",color:"inherit",minWidth:0}}),f==="asking"?(0,n.jsx)("span",{"aria-busy":"true",style:p,children:"Looking\u2026"}):f==="denied"?(0,n.jsx)("span",{"data-graview-linked-state":"denied",style:{...p,fontStyle:"italic"},children:"linked record (no access)"}):f.length===0?(0,n.jsx)("span",{style:p,children:"Nothing there matches."}):(0,n.jsx)("ul",{role:"list",style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:4},children:f.map(r=>{let y=v.has(w(r));return(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button","data-graview-linked-candidate":w(r),"aria-pressed":y,onClick:()=>W(r),style:{display:"grid",gap:2,width:"100%",textAlign:"start",font:"inherit",padding:"6px 8px",minHeight:32,border:"1px solid var(--graview-line)",borderRadius:6,background:y?"var(--graview-accent-soft, var(--graview-surface))":"var(--graview-surface)",color:"inherit",cursor:"pointer"},children:[(0,n.jsx)("span",{style:{fontWeight:600},children:r.label}),r.describe?(0,n.jsx)("span",{style:{...p,fontSize:"0.8125rem"},children:r.describe}):null]})},w(r))})}),i?(0,n.jsx)("button",{type:"button",onClick:i,style:{justifySelf:"start",font:"inherit",fontSize:"0.8125rem",background:"none",border:0,padding:"4px 0",color:"var(--graview-ink-muted)",cursor:"pointer",minHeight:24},children:"Keep it as it is"}):null]}):(0,n.jsxs)("span",{"data-graview-linked-picker":"","data-graview-linked-state":"no-host",style:p,children:["This page cannot read ",e.address,", so nothing there can be linked here."]})}var T=e=>(0,n.jsx)(H,{...e}),U=e=>(0,n.jsx)(N,{...e});export{N as LinkedPicker,H as LinkedRecordView,U as drawLinkedPicker,T as drawLinkedRecord};
@@ -1 +1 @@
1
- import{A as S,G,l as O,y as v,z as C}from"./chunk.YD3TKV6P.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.HT2BEOEV.js";import{Bd as R,Cd as T,ka as M,yd as P,zd as k}from"./chunk.7BBGRTXM.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.6IUEGPCZ.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.VNJKGSGZ.js";import{Ad as P,Bd as k,Dd as R,Ed as T,ka as M}from"./chunk.X3MMJ3QC.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 +1 @@
1
- import{Za as g}from"./chunk.7BBGRTXM.js";function y(e){return[`based on \u201C${e.basis}\u201D`,...e.confidence!==void 0?[`${Math.round(e.confidence*100)}% sure`]:[],...e.model?[e.model]:[]].join(" \xB7 ")}var u=e=>`Not yet kept by a person. ${e.by.name??e.by.id??"Something"} made it${e.lineage?`, ${y(e.lineage)}`:""}.`,p=e=>`${e.kind}\0${e.from}\0${e.to}`;function k(e,o){let r=new Map;for(let n of e){if(n.undoes!==void 0||o.has(n.id)||n.withheld)continue;let l=g(n.author),s=l==="human"||l==="visitor",c=new Map;for(let t of n.primitives){if(t.op!=="add-edge"&&t.op!=="remove-edge")continue;let i=p(t.edge),a=r.get(i)??c.get(i);if(r.delete(i),t.op==="remove-edge")a&&c.set(i,a);else if(a&&(s||!n.lineage))r.set(i,s?{...a,provisional:!1,keptBy:n.id}:a);else{let d=n.lineage;r.set(i,{edge:t.edge,made:n.id,by:n.author,...d?{lineage:d}:{},provisional:!s&&(d?.confidence??1)<1})}}}return r}var f=new WeakMap;function v({log:e}){let o=e.all(),r=`${e.horizon}:${o.length}:${o.at(-1)?.id}`,n=f.get(e);return n?.at!==r&&f.set(e,n={at:r,links:k(o,e.undoneIds())}),n.links}var L=(e,o)=>v(e).get(p(o));var m=e=>[...v(e).values()].filter(o=>o.provisional);export{y as a,u as b,L as c,m as d};
1
+ import{Za as g}from"./chunk.X3MMJ3QC.js";function y(e){return[`based on \u201C${e.basis}\u201D`,...e.confidence!==void 0?[`${Math.round(e.confidence*100)}% sure`]:[],...e.model?[e.model]:[]].join(" \xB7 ")}var u=e=>`Not yet kept by a person. ${e.by.name??e.by.id??"Something"} made it${e.lineage?`, ${y(e.lineage)}`:""}.`,p=e=>`${e.kind}\0${e.from}\0${e.to}`;function k(e,o){let r=new Map;for(let n of e){if(n.undoes!==void 0||o.has(n.id)||n.withheld)continue;let l=g(n.author),s=l==="human"||l==="visitor",c=new Map;for(let t of n.primitives){if(t.op!=="add-edge"&&t.op!=="remove-edge")continue;let i=p(t.edge),a=r.get(i)??c.get(i);if(r.delete(i),t.op==="remove-edge")a&&c.set(i,a);else if(a&&(s||!n.lineage))r.set(i,s?{...a,provisional:!1,keptBy:n.id}:a);else{let d=n.lineage;r.set(i,{edge:t.edge,made:n.id,by:n.author,...d?{lineage:d}:{},provisional:!s&&(d?.confidence??1)<1})}}}return r}var f=new WeakMap;function v({log:e}){let o=e.all(),r=`${e.horizon}:${o.length}:${o.at(-1)?.id}`,n=f.get(e);return n?.at!==r&&f.set(e,n={at:r,links:k(o,e.undoneIds())}),n.links}var L=(e,o)=>v(e).get(p(o));var m=e=>[...v(e).values()].filter(o=>o.provisional);export{y as a,u as b,L as c,m as d};
@@ -1 +1 @@
1
- import{g as o,l as u}from"./chunk.HT2BEOEV.js";function c(t,n,i){let e=r=>encodeURIComponent(r);return`${o}${e(t)}:${e(n)}:${e(i)}`}function S(t,n,i){let e=new Set(t.shown??[]);if(i?e.add(n):e.delete(n),e.size===0){let{shown:r,...w}=t;return w}return{...t,shown:[...e].sort()}}function l(t,n){if(n===null||n.trim().length===0){let{q:i,...e}=t;return e}return{...t,q:n}}function p(t){let n=t.q!==void 0&&t.within?.q===t.q;return l(n?u(t,"q",null):t,null)}function h(t,n){if(!n){let{past:i,...e}=t;return e}return{...t,past:!0}}function f(t,n){if(n===null||n.x===0&&n.y===0){let{pan:i,...e}=t;return e}return{...t,pan:n}}function d(t,n,i){let e={...t.pins};return i===null?delete e[n]:e[n]=i,{...t,pins:e}}export{c as a,S as b,l as c,p as d,h as e,f,d as g};
1
+ import{g as o,l as u}from"./chunk.VNJKGSGZ.js";function c(t,n,i){let e=r=>encodeURIComponent(r);return`${o}${e(t)}:${e(n)}:${e(i)}`}function S(t,n,i){let e=new Set(t.shown??[]);if(i?e.add(n):e.delete(n),e.size===0){let{shown:r,...w}=t;return w}return{...t,shown:[...e].sort()}}function l(t,n){if(n===null||n.trim().length===0){let{q:i,...e}=t;return e}return{...t,q:n}}function p(t){let n=t.q!==void 0&&t.within?.q===t.q;return l(n?u(t,"q",null):t,null)}function h(t,n){if(!n){let{past:i,...e}=t;return e}return{...t,past:!0}}function f(t,n){if(n===null||n.x===0&&n.y===0){let{pan:i,...e}=t;return e}return{...t,pan:n}}function d(t,n,i){let e={...t.pins};return i===null?delete e[n]:e[n]=i,{...t,pins:e}}export{c as a,S as b,l as c,p as d,h as e,f,d as g};
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk.4QWTSI7V.js";import"./chunk.CZH27V2R.js";import"./chunk.VFRURRNI.js";import"./chunk.X2G4ZRB2.js";import"./chunk.UITZ74YJ.js";import"./chunk.MHILFBK6.js";import"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};
@@ -1,4 +1,4 @@
1
- import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{T as o,ba as n}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var a=t(o(),1),d=[["waiting","Waiting"],["active","Under way: darker and taller"],["done","Done: flat and pale"],["flagged","A problem, or past its due date"],["recent","Changed since you were last here"],["own","Yours"]],g=i=>{let e=r=>`color-mix(in oklab,var(--graview-ink) ${r}%,var(--graview-panel))`;return`.graview-map-key{display:grid;gap:4px;padding:2px 4px 8px;margin-bottom:6px;border-bottom:1px solid var(--graview-edge);font-size:.8125rem;color:var(--graview-ink-muted)}
1
+ import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{T as o,ba as n}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var a=t(o(),1),d=[["waiting","Waiting"],["active","Under way: darker and taller"],["done","Done: flat and pale"],["flagged","A problem, or past its due date"],["recent","Changed since you were last here"],["own","Yours"]],g=i=>{let e=r=>`color-mix(in oklab,var(--graview-ink) ${r}%,var(--graview-panel))`;return`.graview-map-key{display:grid;gap:4px;padding:2px 4px 8px;margin-bottom:6px;border-bottom:1px solid var(--graview-edge);font-size:.8125rem;color:var(--graview-ink-muted)}
2
2
  .graview-map-key>div{display:flex;align-items:center;gap:8px}
3
3
  .graview-map-key>div:first-child{color:var(--graview-ink)}
4
4
  .graview-map-key i{flex:none;width:14px;height:10px;border-radius:2px;background:${e(i?34:42)}}