graview 0.1.56 → 0.1.58

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 (179) hide show
  1. package/dist/preview/chunk.27CW6SCT.js +3 -0
  2. package/dist/preview/{chunk.UQQAGT3R.js → chunk.2EDC63RI.js} +1 -1
  3. package/dist/preview/chunk.2VYNNWW5.js +18 -0
  4. package/dist/preview/chunk.32FMOHZK.js +1 -0
  5. package/dist/preview/{chunk.VLBY66PB.js → chunk.34TW32TB.js} +2 -2
  6. package/dist/preview/{chunk.AM2YRNOQ.js → chunk.3FCOFEGW.js} +1 -1
  7. package/dist/preview/{chunk.LKK7VQBA.js → chunk.3OYGXYQY.js} +1 -1
  8. package/dist/preview/{chunk.XJFAUOJS.js → chunk.3YZHZGTM.js} +1 -1
  9. package/dist/preview/{chunk.AIK3Z25Y.js → chunk.43OKZU73.js} +1 -1
  10. package/dist/preview/{chunk.QSO5BP2H.js → chunk.4444RPWW.js} +1 -1
  11. package/dist/preview/{chunk.4EY6WPSM.js → chunk.47JQPYXL.js} +2 -2
  12. package/dist/preview/{chunk.N3Q5CPVA.js → chunk.4AFFPYOK.js} +1 -1
  13. package/dist/preview/chunk.4GGPPCMM.js +1 -0
  14. package/dist/preview/{chunk.PRV3KYT6.js → chunk.4HSH2UIK.js} +2 -2
  15. package/dist/preview/{chunk.7Z4USR3Y.js → chunk.4KC35UNR.js} +1 -1
  16. package/dist/preview/{chunk.LP3SHWJG.js → chunk.4Y2JTY6Q.js} +1 -1
  17. package/dist/preview/{chunk.6HLKAUWF.js → chunk.5ICIMQE6.js} +1 -1
  18. package/dist/preview/{chunk.KY7QD22S.js → chunk.5IEFTFKQ.js} +1 -1
  19. package/dist/preview/{chunk.JHFHIG4P.js → chunk.64R3K2OE.js} +1 -1
  20. package/dist/preview/chunk.6K7EN2YI.js +1 -0
  21. package/dist/preview/{chunk.45VIF2SX.js → chunk.6VC6AGYV.js} +2 -2
  22. package/dist/preview/{chunk.PMPDLE56.js → chunk.6W7O5YLL.js} +1 -1
  23. package/dist/preview/chunk.7BBGRTXM.js +5 -0
  24. package/dist/preview/{chunk.CGM7OER2.js → chunk.7MSFDD7J.js} +1 -1
  25. package/dist/preview/chunk.7SQAKSJD.js +2 -0
  26. package/dist/preview/{chunk.VEOS25PQ.js → chunk.7V23SXGJ.js} +1 -1
  27. package/dist/preview/{chunk.C2VFDBSG.js → chunk.A6C4AGJJ.js} +1 -1
  28. package/dist/preview/chunk.ACYDJQRC.js +1 -0
  29. package/dist/preview/{chunk.NBLMANHT.js → chunk.ARWBIBSI.js} +1 -1
  30. package/dist/preview/{chunk.KBL4Y4UN.js → chunk.B2GVJD6H.js} +1 -1
  31. package/dist/preview/{chunk.2DETYEJM.js → chunk.B3WZHPM3.js} +1 -1
  32. package/dist/preview/{chunk.IT763BYH.js → chunk.BB33TI4S.js} +1 -1
  33. package/dist/preview/{chunk.3X3GLNWQ.js → chunk.BKVBX2YB.js} +1 -1
  34. package/dist/preview/{chunk.VYW7DSUW.js → chunk.BTVBZ6KE.js} +2 -2
  35. package/dist/preview/{chunk.JZDKHWRL.js → chunk.CCWPF5PK.js} +1 -1
  36. package/dist/preview/{chunk.QAIYYIZQ.js → chunk.D5KTGX7F.js} +1 -1
  37. package/dist/preview/{chunk.YLMOGGEP.js → chunk.DBZHRYBK.js} +1 -1
  38. package/dist/preview/{chunk.GUP7LC5O.js → chunk.DM767F2Q.js} +2 -2
  39. package/dist/preview/{chunk.65Q5MKDW.js → chunk.E34OQVSR.js} +1 -1
  40. package/dist/preview/{chunk.N7EEPFYV.js → chunk.E5MSFXL6.js} +1 -1
  41. package/dist/preview/{chunk.DTSTUC2W.js → chunk.EB4NVTJL.js} +1 -1
  42. package/dist/preview/{chunk.5MS2TQFX.js → chunk.ELAMMS2V.js} +1 -1
  43. package/dist/preview/chunk.ELERUERU.js +1 -0
  44. package/dist/preview/{chunk.XGCOWCA2.js → chunk.EPPXZZPK.js} +1 -1
  45. package/dist/preview/chunk.EQTSV7BK.js +2 -0
  46. package/dist/preview/{chunk.QNNRSPIJ.js → chunk.ETBFD76E.js} +1 -1
  47. package/dist/preview/{chunk.OBUKZQCZ.js → chunk.F7SF6EP2.js} +1 -1
  48. package/dist/preview/chunk.GCBZ3WE2.js +1 -0
  49. package/dist/preview/{chunk.ONGZ3YQF.js → chunk.GDOTG7YA.js} +1 -1
  50. package/dist/preview/{chunk.SVAQGVS4.js → chunk.GEB2DFBU.js} +1 -1
  51. package/dist/preview/chunk.GKSUTAIX.js +1 -0
  52. package/dist/preview/{chunk.VDD3RHLB.js → chunk.GP7F3PEF.js} +1 -1
  53. package/dist/preview/{chunk.AKW6NR3X.js → chunk.GQBJVCSM.js} +1 -1
  54. package/dist/preview/chunk.GUEHKCWN.js +1 -0
  55. package/dist/preview/{chunk.NQ4VGKEC.js → chunk.GZB6A6KF.js} +1 -1
  56. package/dist/preview/{chunk.2E6EWVWR.js → chunk.H3BFHI3G.js} +1 -1
  57. package/dist/preview/{chunk.7RJGEU3Y.js → chunk.HEWVPXRE.js} +1 -1
  58. package/dist/preview/{chunk.J3YBEZKE.js → chunk.HMFJT4KO.js} +1 -1
  59. package/dist/preview/{chunk.NFU4UM6F.js → chunk.HS3GHAUR.js} +1 -1
  60. package/dist/preview/{chunk.NPAWTPLQ.js → chunk.HT2BEOEV.js} +1 -1
  61. package/dist/preview/{chunk.7O6Z3BFR.js → chunk.HXRV3WVJ.js} +1 -1
  62. package/dist/preview/{chunk.MJMVGW6Z.js → chunk.HZB5F476.js} +1 -1
  63. package/dist/preview/{chunk.WPJVMVAL.js → chunk.I3WWCPQ2.js} +1 -1
  64. package/dist/preview/{chunk.IUQOSPQX.js → chunk.IDJPBWL2.js} +1 -1
  65. package/dist/preview/{chunk.4KMY24YC.js → chunk.ILRCNTGT.js} +1 -1
  66. package/dist/preview/{chunk.T6HG2XIP.js → chunk.INZQ6WZM.js} +1 -1
  67. package/dist/preview/{chunk.ILSK2E3R.js → chunk.IULQRCEE.js} +1 -1
  68. package/dist/preview/{chunk.IF4FCQPG.js → chunk.JB7TTJXQ.js} +1 -1
  69. package/dist/preview/{chunk.E4HSSGF7.js → chunk.JES77WXG.js} +1 -1
  70. package/dist/preview/{chunk.SRC37GNP.js → chunk.JGKA5QBX.js} +1 -1
  71. package/dist/preview/chunk.JOAN54PN.js +1 -0
  72. package/dist/preview/{chunk.2YNZVNCA.js → chunk.JUNMJYH5.js} +1 -1
  73. package/dist/preview/{chunk.MORMTKVR.js → chunk.KFQSYCY3.js} +1 -1
  74. package/dist/preview/{chunk.TXWCTHMI.js → chunk.KJ264E6K.js} +1 -1
  75. package/dist/preview/{chunk.NUE5VG4G.js → chunk.KJHPDL4N.js} +1 -1
  76. package/dist/preview/{chunk.SOTB6C5A.js → chunk.KKNDX4JT.js} +1 -1
  77. package/dist/preview/chunk.KNYLY7MH.js +1 -0
  78. package/dist/preview/{chunk.YL5ZCRHQ.js → chunk.KWJWAIQJ.js} +1 -1
  79. package/dist/preview/{chunk.V3NPUAPB.js → chunk.KXPRILAO.js} +1 -1
  80. package/dist/preview/chunk.L7V24JPO.js +1 -0
  81. package/dist/preview/chunk.LA4CPZ2N.js +1 -0
  82. package/dist/preview/{chunk.E33EJU3Q.js → chunk.LCPGZK7G.js} +1 -1
  83. package/dist/preview/chunk.LDAYDCUO.js +1 -0
  84. package/dist/preview/{chunk.64IKLRUS.js → chunk.LL2MLSPH.js} +1 -1
  85. package/dist/preview/{chunk.22MIRLL6.js → chunk.LMN4TSAP.js} +1 -1
  86. package/dist/preview/{chunk.IRMO4FUC.js → chunk.LO3U3P55.js} +1 -1
  87. package/dist/preview/{chunk.DH7M57SE.js → chunk.LRUNFSHP.js} +1 -1
  88. package/dist/preview/{chunk.MLRPCZVS.js → chunk.LY3YOWKV.js} +1 -1
  89. package/dist/preview/{chunk.DWMAFMYZ.js → chunk.M34CS7DI.js} +1 -1
  90. package/dist/preview/{chunk.I2C5LPB5.js → chunk.MQ5HBUBL.js} +1 -1
  91. package/dist/preview/chunk.MV3AJ7JH.js +1 -0
  92. package/dist/preview/chunk.MYNQWWCL.js +1 -0
  93. package/dist/preview/{chunk.E4EN4X5F.js → chunk.NFX24NUI.js} +1 -1
  94. package/dist/preview/{chunk.PJCVFYFU.js → chunk.NKC3JILT.js} +1 -1
  95. package/dist/preview/{chunk.MFDSWA2W.js → chunk.NOFWGDOT.js} +1 -1
  96. package/dist/preview/{chunk.QW3QLE53.js → chunk.O4CVKTPJ.js} +1 -1
  97. package/dist/preview/{chunk.TAIYNHSW.js → chunk.OASYYMG5.js} +1 -1
  98. package/dist/preview/{chunk.G3ORIU7C.js → chunk.OHQ3JH65.js} +1 -1
  99. package/dist/preview/{chunk.2OX4YI46.js → chunk.PBCNOFQH.js} +1 -1
  100. package/dist/preview/{chunk.V6X3U3JF.js → chunk.PHC2MI4C.js} +1 -1
  101. package/dist/preview/chunk.PM3SYXKB.js +1 -0
  102. package/dist/preview/{chunk.K2JE3PD7.js → chunk.POBMGM3X.js} +1 -1
  103. package/dist/preview/{chunk.LLOZKUCA.js → chunk.PZG3B7F4.js} +1 -1
  104. package/dist/preview/chunk.QB25SMP6.js +1 -0
  105. package/dist/preview/{chunk.FCUDBMGC.js → chunk.QGV7H7RQ.js} +1 -1
  106. package/dist/preview/chunk.QPXXY2DL.js +1133 -0
  107. package/dist/preview/chunk.QUJS63OJ.js +13 -0
  108. package/dist/preview/{chunk.Q7X2IVLH.js → chunk.R7LFO7KI.js} +1 -1
  109. package/dist/preview/{chunk.7NP2I2UP.js → chunk.RE7DELSR.js} +1 -1
  110. package/dist/preview/{chunk.XY5EVI22.js → chunk.RRKYJYZJ.js} +1 -1
  111. package/dist/preview/{chunk.APXYWI3L.js → chunk.S2H7B6RG.js} +1 -1
  112. package/dist/preview/chunk.S5MGE2U5.js +1 -0
  113. package/dist/preview/{chunk.D6KF72MZ.js → chunk.SDVPJYVF.js} +1 -1
  114. package/dist/preview/{chunk.FBR4HJ2Q.js → chunk.SPXRLO5K.js} +1 -1
  115. package/dist/preview/chunk.TBW7CU4G.js +1 -0
  116. package/dist/preview/{chunk.USB6B6L3.js → chunk.TF5I4VHX.js} +1 -1
  117. package/dist/preview/{chunk.4EUH6TLG.js → chunk.TJ647W6J.js} +2 -2
  118. package/dist/preview/{chunk.ZFXHZZHW.js → chunk.TJOXNEFU.js} +1 -1
  119. package/dist/preview/{chunk.WMB2NNBD.js → chunk.TUUVVO5U.js} +1 -1
  120. package/dist/preview/{chunk.AZUTYY2S.js → chunk.TWKXSLYY.js} +4 -4
  121. package/dist/preview/chunk.TXGNPW76.js +1 -0
  122. package/dist/preview/{chunk.VSM72NVF.js → chunk.U6O3MMQR.js} +1 -1
  123. package/dist/preview/{chunk.EC5IWN74.js → chunk.UAP5M3CD.js} +2 -2
  124. package/dist/preview/chunk.UDCDK7XJ.js +4 -0
  125. package/dist/preview/chunk.UKMVJV6Q.js +1 -0
  126. package/dist/preview/chunk.UUG3BYVN.js +1 -0
  127. package/dist/preview/{chunk.RDL6652E.js → chunk.VG7OWV2H.js} +1 -1
  128. package/dist/preview/{chunk.BNEOLRQG.js → chunk.VHSWBFXB.js} +1 -1
  129. package/dist/preview/{chunk.D4LN33J2.js → chunk.VUPLFUUS.js} +1 -1
  130. package/dist/preview/chunk.WJFQIE3Y.js +1 -0
  131. package/dist/preview/{chunk.AQCU6TPV.js → chunk.WNQFHMNR.js} +1 -1
  132. package/dist/preview/{chunk.CKV2QCH5.js → chunk.WNSC3RWD.js} +1 -1
  133. package/dist/preview/{chunk.CU2NQ5WF.js → chunk.WQOI6BLM.js} +1 -1
  134. package/dist/preview/{chunk.RXYE2DAJ.js → chunk.WXIEQZLY.js} +1 -1
  135. package/dist/preview/{chunk.2HZGUVB2.js → chunk.XN2RVXOI.js} +1 -1
  136. package/dist/preview/{chunk.USQNSNIA.js → chunk.XU34T2H4.js} +1 -1
  137. package/dist/preview/{chunk.HFVMGTNL.js → chunk.YD3TKV6P.js} +2 -2
  138. package/dist/preview/{chunk.K5YLQAFW.js → chunk.YHTE34RN.js} +1 -1
  139. package/dist/preview/chunk.YIA2EDVF.js +3 -0
  140. package/dist/preview/{chunk.JQY2UKU6.js → chunk.YP2F5UGY.js} +1 -1
  141. package/dist/preview/{chunk.D6BMAGPR.js → chunk.YS6GVLIP.js} +1 -1
  142. package/dist/preview/{chunk.O6LDZWLR.js → chunk.YZZONE4M.js} +1 -1
  143. package/dist/preview/{chunk.5B4HNQGR.js → chunk.ZN5HTWSI.js} +1 -1
  144. package/dist/preview/{chunk.AKVBU5K5.js → chunk.ZOHMWSHD.js} +1 -1
  145. package/dist/preview/index.html +50 -50
  146. package/dist/preview/page.js +2 -2
  147. package/package.json +6 -6
  148. package/dist/preview/chunk.2BLRCT3E.js +0 -1
  149. package/dist/preview/chunk.3V2WH6F7.js +0 -1
  150. package/dist/preview/chunk.4YI6656P.js +0 -1
  151. package/dist/preview/chunk.5MSWUTDB.js +0 -1
  152. package/dist/preview/chunk.6Q6BW4QT.js +0 -2
  153. package/dist/preview/chunk.7U2JO7ET.js +0 -3
  154. package/dist/preview/chunk.7Z2PRPYE.js +0 -1
  155. package/dist/preview/chunk.AGTFYPXY.js +0 -1
  156. package/dist/preview/chunk.BT7RLFPO.js +0 -1
  157. package/dist/preview/chunk.DPPT6WAJ.js +0 -2
  158. package/dist/preview/chunk.DVG47BK3.js +0 -1
  159. package/dist/preview/chunk.DZYLH5IM.js +0 -1
  160. package/dist/preview/chunk.E5XNQTEU.js +0 -1
  161. package/dist/preview/chunk.F5RN6YXG.js +0 -4
  162. package/dist/preview/chunk.FOQENWF5.js +0 -1
  163. package/dist/preview/chunk.GNQW4JOG.js +0 -18
  164. package/dist/preview/chunk.HVN2DVP3.js +0 -1
  165. package/dist/preview/chunk.JL4DGITZ.js +0 -1
  166. package/dist/preview/chunk.K4MO22RM.js +0 -1
  167. package/dist/preview/chunk.KMEKMCKG.js +0 -3
  168. package/dist/preview/chunk.LVOVPU64.js +0 -1
  169. package/dist/preview/chunk.MEJUAV3Y.js +0 -1
  170. package/dist/preview/chunk.OYGPNO7A.js +0 -1
  171. package/dist/preview/chunk.QYFZ7AZS.js +0 -1132
  172. package/dist/preview/chunk.RR2IFETZ.js +0 -1
  173. package/dist/preview/chunk.T2RME6XF.js +0 -1
  174. package/dist/preview/chunk.TAJ2R44N.js +0 -1
  175. package/dist/preview/chunk.TQCRFZ53.js +0 -1
  176. package/dist/preview/chunk.UE5YS3GN.js +0 -1
  177. package/dist/preview/chunk.VIQ6EF2O.js +0 -1
  178. package/dist/preview/chunk.XE72DFBV.js +0 -13
  179. package/dist/preview/chunk.YEJ4LNUP.js +0 -5
@@ -1 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{d as be,f as ke}from"./chunk.XGCOWCA2.js";import{e as ht}from"./chunk.MORMTKVR.js";import{a as ft,b as wt}from"./chunk.E33EJU3Q.js";import{h as mt}from"./chunk.PJCVFYFU.js";import{a as ie,b as nt}from"./chunk.AIK3Z25Y.js";import{b as we,c as J,d as Y,e as rt,f as ot}from"./chunk.CKV2QCH5.js";import{a as vt,d as St,f as bt}from"./chunk.BT7RLFPO.js";import{a as Se,b as pt}from"./chunk.TAJ2R44N.js";import{a as Ce,b as yt}from"./chunk.VLBY66PB.js";import{d as st,e as re,f as j,g as lt,h as ye,i as dt,l as ct,n as oe}from"./chunk.T2RME6XF.js";import{j as gt,o as ve}from"./chunk.E5XNQTEU.js";import{c as ut}from"./chunk.K5YLQAFW.js";import{c as it,d as Pe}from"./chunk.DPPT6WAJ.js";import{c as at}from"./chunk.7U2JO7ET.js";import{G as U,Ga as fe,Ia as tt,Ma as Ne,Na as X,Oa as Re,T as I,W as Ze,aa as Qe,ba as V,da as pe,j as je,ka as et,l as qe,la as _,m as Ue,ma as me,r as ae,ta as he,v as Xe,y as Je,z as Ye}from"./chunk.NPAWTPLQ.js";import{a as ue}from"./chunk.SDO3U72B.js";import{W as ee,da as te,ga as $,oa as H,ob as _e,uc as ne}from"./chunk.YEJ4LNUP.js";import{b as L}from"./chunk.AJZBJBMO.js";var f=L(U(),1);var kt=L(U(),1);function xt(e){(0,kt.useLayoutEffect)(()=>{let n=e.current,t=n?.parentElement;if(!n||!t)return;let a=n.style.bottom,o=()=>{let d=t.querySelector(Ft);if(!d){n.style.bottom=a;return}let u=t.getBoundingClientRect(),m=d.getBoundingClientRect(),g=u.height>0?t.offsetHeight/u.height:1;n.style.bottom=`${Math.max(0,Math.round((u.bottom-m.top)*g))}px`};if(o(),typeof ResizeObserver>"u")return;let s=new ResizeObserver(o);return s.observe(t),()=>s.disconnect()},[e])}var Ft=".graview-spec-listing";var $e=L(U(),1);var P=L(U(),1);var Nt=L(U(),1);var B=L(I(),1);function Rt({id:e,max:n=8,empty:t,hide:a}){let{store:o}=V();pe();let s=_t(o,e,X()),[d,u]=(0,Nt.useState)(()=>new Set),m=a?s.flatMap(g=>{let w=g.ids.filter(r=>!a.has(r));return w.length>0?[{...g,ids:w}]:[]}):s;return m.length===0?t&&s.length===0?(0,B.jsx)("p",{style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-faint)"},children:t}):null:(0,B.jsx)("div",{"data-graview-primitive":"connections",style:{display:"flex",flexDirection:"column",gap:12},children:m.map(g=>{let w=d.has(g.key),r=g.ids.length>n,c=w?g.ids:g.ids.slice(0,n),y=g.ids.length-Math.min(n,g.ids.length),k=`graview-more-${e}-${g.key}`.replace(/[^A-Za-z0-9_-]/g,"-");return(0,B.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,B.jsx)("h2",{...g.said?{"aria-label":g.said}:{},style:{margin:0,fontSize:"0.75rem",fontWeight:600,letterSpacing:"0.09em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:g.label}),(0,B.jsxs)("div",{id:k,style:{display:"flex",flexWrap:"wrap",gap:6},children:[c.map(h=>{let S=o.graph.getNode(h);return S?(0,B.jsx)(Y,{pickId:h,hue:ne(S.kind),title:`Go to the ${H(o.schema.tryDefinition(S.kind),S.kind)}`,label:$(o.schema.tryDefinition(S.kind),S)},h):null}),r?(0,B.jsx)("button",{type:"button","data-graview-more":g.key,"aria-expanded":w,"aria-controls":k,...w?{}:{"aria-label":`${y} more: ${g.said??g.label}`},onClick:h=>{h.stopPropagation(),u(S=>{let b=new Set(S);return b.has(g.key)?b.delete(g.key):b.add(g.key),b})},style:Kt,children:w?"Show fewer":`+${y} more`}):null]})]},g.key)})})}var Kt={display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,border:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",color:"var(--graview-accent)",font:"inherit",fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",cursor:"pointer"};function _t(e,n,t=[]){let a=e.graph.getNode(n);if(!a)return[];let o=new Map,s=[];for(let d of t)if(d.subjectId===n)for(let u of d.nodeIds)u!==n&&!s.includes(u)&&e.graph.has(u)&&s.push(u);s.length>0&&o.set("judges",{key:"judges",label:"what it finds wrong",ids:s});for(let d of e.graph.allEdges()){let u=d.from===n?d.to:d.to===n?d.from:null;if(u===null||u===n)continue;let m=e.graph.getNode(u);if(!m)continue;let g=d.from===n?"out":"in",w=g==="out"?a.kind:m.kind,r=jt(e.schema,w,d.kind,g),c=`${d.kind}:${g}:${r.label}`,y=o.get(c)??{key:c,...r,ids:[]};y.ids.includes(u)||y.ids.push(u),o.set(c,y)}for(let d of o.values())d.ids.sort();return[...o.values()].sort((d,u)=>d.key<u.key?-1:d.key>u.key?1:0)}function jt(e,n,t,a){let o=at(e,n,t,a),s=te(t).toLowerCase();return o.trim().toLowerCase()!==s?{label:o}:a==="out"?{label:`\u2192 ${s}`,said:s}:{label:`\u2190 ${s}`,said:`${s}, pointing here`}}var Pt=L(U(),1),se=(0,Pt.createContext)(null);var l=L(I(),1),qt=fe(ue(()=>(__graviewPreload(import.meta.url,["./chunk.CU2NQ5WF.js","./chunk.E33EJU3Q.js","./chunk.PJCVFYFU.js","./chunk.7RJGEU3Y.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.VSM72NVF.js")))).part((e,n)=>(0,l.jsx)(e.ArrangeBar,{...n}),{what:"Arranging this list"}),Ut=fe(ue(()=>(__graviewPreload(import.meta.url,["./chunk.IRMO4FUC.js","./chunk.WPJVMVAL.js","./chunk.VYW7DSUW.js","./chunk.LKK7VQBA.js","./chunk.EC5IWN74.js","./chunk.RR2IFETZ.js","./chunk.ONGZ3YQF.js","./chunk.XGCOWCA2.js","./chunk.MORMTKVR.js","./chunk.CU2NQ5WF.js","./chunk.E33EJU3Q.js","./chunk.PJCVFYFU.js","./chunk.7RJGEU3Y.js","./chunk.HJCQ6I3S.js","./chunk.7O6Z3BFR.js","./chunk.I2C5LPB5.js","./chunk.6Q6BW4QT.js","./chunk.LLOZKUCA.js","./chunk.DH7M57SE.js","./chunk.AIK3Z25Y.js","./chunk.CKV2QCH5.js","./chunk.BT7RLFPO.js","./chunk.TAJ2R44N.js","./chunk.VLBY66PB.js","./chunk.MLRPCZVS.js","./chunk.G4JJXA63.js","./chunk.64IKLRUS.js","./chunk.DTSTUC2W.js","./chunk.RDL6652E.js","./chunk.V3NPUAPB.js","./chunk.USQNSNIA.js","./chunk.XOZU4OFA.js","./chunk.IT763BYH.js","./chunk.UQQAGT3R.js","./chunk.WVUJXDXZ.js","./chunk.T2RME6XF.js","./chunk.SOTB6C5A.js","./chunk.TQCRFZ53.js","./chunk.6HLKAUWF.js","./chunk.FCUDBMGC.js","./chunk.KMEKMCKG.js","./chunk.GZHZLJBF.js","./chunk.E5XNQTEU.js","./chunk.OJGHDWI6.js","./chunk.K5YLQAFW.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.7NP2I2UP.js")))).part((e,n)=>(0,l.jsx)(e.KindStop,{...n}),{what:"This list"});function Ae(e){let{brand:n}=V();return ne(e,n?.accents)}function Xt(e,n){if(!n.endsWith("\u2026")&&!n.endsWith("..."))return;let t=n.replace(/[…]|\.\.\.$/g,"").trim();if(!(t.length<12)){for(let a of Object.values(e))if(typeof a=="string"&&a.length>t.length&&a.startsWith(t))return a}}function Jt(e,n){let a=Math.max(0,...e.slice(0,n*2).map(s=>s.length))*7.5+28<=212/2?2:1,o=n*a;return{columns:a,shown:Math.min(e.length,o)}}var Yt=8,Ct=500,Zt=12;function $t(e){return{x:e.clientX,y:e.clientY,pointerType:e.pointerType??""}}function Qt(e,n,t){let a=performance.now()+Ct,o=["pointerdown","pointerup","mousedown","mouseup","dblclick"],s=r=>{if(performance.now()>a||!(r instanceof MouseEvent))return!1;let c=$t(r);return n.pointerType&&c.pointerType&&n.pointerType!==c.pointerType?!1:Math.hypot(c.x-n.x,c.y-n.y)<=Zt},d=r=>{if(!s(r))return g();r.stopPropagation()},u=r=>{if(!s(r))return g();r.stopPropagation(),r.preventDefault(),e.removeEventListener("click",u,!0),setTimeout(g,50),t()},m=!1,g=()=>{if(!m){m=!0,clearTimeout(w),e.removeEventListener("click",u,!0);for(let r of o)e.removeEventListener(r,d,!0)}};for(let r of o)e.addEventListener(r,d,!0);e.addEventListener("click",u,!0);let w=setTimeout(g,Ct)}function en({View:e,members:n,mode:t,flagged:a}){let{isSelected:o}=Ne(),s=n.slice(0,Yt);return(0,l.jsxs)("div",{"data-graview-rows":"",style:{display:"grid",gap:4,minWidth:0},children:[s.map(d=>(0,l.jsx)("div",{"data-graview-pick":d.id,style:{minWidth:0,cursor:"pointer"},children:(0,l.jsx)(e,{node:d,cardinality:"one",fidelity:"glyph",mode:t,selected:o(d.id),...a?.includes(d.id)?{flagged:[d.id]}:{}})},d.id)),n.length>s.length?(0,l.jsx)(Y,{label:`+${n.length-s.length} more`}):null]})}var tn=11/15,nn=fe(ue(()=>(__graviewPreload(import.meta.url,["./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.NUE5VG4G.js")))).part((e,n)=>(0,l.jsx)(e.StatesBar,{...n}),{quiet:!0});function an({text:e,accent:n}){let t=(0,P.useRef)(null),a=(0,P.useRef)(null),[o,s]=(0,P.useState)(1),[d,u]=(0,P.useState)(!1),m=o<1?`${o}em`:void 0;return(0,P.useLayoutEffect)(()=>{let g=t.current,w=a.current;if(!g||!w)return;let r=()=>{let y=g.clientWidth,k=w.offsetWidth;if(y<=0||k<=0)return;let h=parseFloat(getComputedStyle(w).fontSize)/parseFloat(getComputedStyle(g).fontSize)||1,S=k/h,b=Math.max(tn,Math.min(1,Math.floor(y/S*100)/100));s(N=>Math.abs(N-b)<.01?N:b),u(S*b>y+.5)};if(r(),typeof ResizeObserver>"u")return;let c=new ResizeObserver(r);return c.observe(g),()=>c.disconnect()},[e]),(0,l.jsx)("span",{ref:t,"data-graview-district-name":"",...o<1?{"data-graview-fitted":""}:{},...d?{title:e}:{},style:{display:"block",minWidth:0,fontSize:"0.9375rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(0,l.jsx)("span",{ref:a,style:{fontSize:m},children:e})})}function At(e,n){return!!e?.display?.page?.groups?.length||Pe(n,e).some(t=>t.long)}function Vt(e,n=he(e)){for(let t of e.kinds){let a=e.tryDefinition(t),o=a?.plural??`${String(t)}s`,s=r=>{let c=r.node,y=X(),k=(0,P.useContext)(se);if(!c)return null;let h=k?.nodeId===c.id?k:null,S=$(a,c),b=r.mode==="fullscreen"?Xt(c,S)??S:S,N=_e(y,[c.id]);return(0,l.jsxs)(J,{title:(0,l.jsx)(bt,{nodeId:c.id,children:h?.title??b}),...h?{}:{subtitle:a?.describe?it(a,c):a?.description??String(t)},selected:r.selected,...r.flagged?.includes(c.id)?{tone:"warning"}:{},fit:!0,children:[h?(0,l.jsx)(se.Provider,{value:null,children:h.body}):null,(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"22px 34px",alignItems:"flex-start"},children:[(0,l.jsx)("div",{style:{flex:At(a,c)?"1 1 100%":"1 1 0",minWidth:"min(200px, 100%)"},children:(0,l.jsx)(St,{id:c.id,shown:[b,S,a?.description,h?.title],...h?{hide:[...h.fields]}:{}})}),(0,l.jsx)("div",{style:{flex:At(a,c)?"1 1 100%":"1.4 1 0",minWidth:"min(220px, 100%)"},children:(0,l.jsx)(Rt,{id:c.id,empty:`Nothing is connected to this ${H(a,String(t))} yet.`,...h?{hide:h.records}:{}})})]}),N.length>0?(0,l.jsx)("p",{"data-graview-broken":"",style:{margin:"14px 0 0",paddingTop:12,borderTop:"1px solid var(--graview-edge)",fontSize:"0.875rem",color:"var(--graview-warn)"},children:N.map(v=>v.message).join(" \xB7 ")}):null]})},d=r=>{let c=r.node;if(!c)return null;let{store:y}=V(),k=a?.computed?ct(y.schema,y.graph,c):c,h=Pe(k,a,{limit:3,said:[$(a,c)],glance:!0}),S=Ae(t),b=h.filter(x=>!x.long&&!x.markdown),N=h.find(x=>x.long||x.markdown),v=st(c,a);return(0,l.jsxs)(J,{title:$(a,c),selected:r.selected,tone:r.flagged?.includes(c.id)?"warning":"muted",fit:!0,children:[v?(0,l.jsx)(Se,{as:"thumb",file:v,size:64,style:{marginBottom:6}}):null,(0,l.jsx)(rt,{items:b.map(x=>({id:x.key,label:x.alone,hue:S})),max:3}),N?(0,l.jsx)("p",{"data-graview-excerpt":N.key,title:N.value,style:{margin:b.length>0?"6px 0 0":0,fontSize:"0.8125rem",lineHeight:1.35,color:"var(--graview-ink-muted)",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:N.value}):null]})},u=r=>{let c=r.node,y=Ae(t),k=ve().marks.flag;if(!c)return null;let h=r.flagged?.includes(c.id)??!1;return(0,l.jsx)(Y,{label:h?`${$(a,c)} ${k}`:$(a,c),hue:y,selected:r.selected,title:h?`${te(H(a,String(t)))} \u2014 implicated in a problem`:te(H(a,String(t)))})},m=r=>r.fidelity==="full"?(0,l.jsx)(P.Suspense,{fallback:(0,l.jsx)(g,{...r}),children:(0,l.jsx)(Ut,{kind:String(t),members:r.nodes??[],...r.flagged?{flagged:r.flagged}:{},...r.label?{label:r.label}:{},...r.retired?{retired:r.retired}:{}})}):(0,l.jsx)(g,{...r}),g=r=>{let{brand:c,store:y,views:k}=V(),{view:h,go:S}=Re(),b=r.nodes??[],N=k.lookup(String(t),{cardinality:"one",fidelity:"glyph"}),v=N!==void 0&&!me(N)?N:void 0,x=ft(h),C=mt(b,x,{schema:e,graph:y.graph,flagged:new Set(r.flagged??[])}),M=R=>({id:R.id,label:$(e.tryDefinition(R.kind),R),hue:ne(R.kind,c?.accents)}),W=r.fidelity==="full"&&b.length>1?(0,l.jsx)(P.Suspense,{fallback:null,children:(0,l.jsx)(qt,{schema:e,graph:y.graph,kind:String(t),arrangement:x,onChange:R=>S(wt(h,R)),kept:{shown:C.nodes.length,of:b.length},style:{marginBottom:8}})}):null,le=R=>R.some(A=>r.flagged?.includes(A.id)),de=X(),Z=ve().marks.flag,z=(R,A,ce)=>v?(0,l.jsx)(J,{title:R,meta:(0,l.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,l.jsx)(ke,{kind:String(t),plural:o,problems:be(de,A),flag:Z}),(0,l.jsx)("span",{title:`${ee(A.length)} ${A.length===1?H(a,String(t)):o.toLowerCase()}`,children:ee(A.length)})]}),tone:le(A)?"warning":"muted",children:(0,l.jsx)(en,{View:v,members:A,mode:r.mode,...r.flagged?{flagged:r.flagged}:{}})},ce):(0,l.jsx)(ot,{label:R,count:A.length,flagged:le(A),items:A.map(M),problems:(0,l.jsx)(ke,{kind:String(t),plural:o,problems:be(de,A),flag:Z})},ce);return C.grouped?(0,l.jsxs)("div",{style:{display:"grid",gap:8},"data-graview-grouped":x.group?.by,children:[W,C.groups.map(R=>z(`${r.label??o} \xB7 ${R.label}`,R.nodes,R.key||"-"))]}):(0,l.jsxs)("div",{style:{display:"grid",gap:4},children:[W,z(r.label??o,C.nodes)]})},w=r=>{let c=r.nodes??[],y=Jt(c.map(p=>$(a,p)),r.openedRows??gt(c.length)),k=Ae(t),{brand:h}=V(),S=nt(String(t),e,h),b=ve().marks.flag,{selection:N,set:v,clear:x}=Ne(),{toggle:C,view:M,go:W}=Re(),{views:le,hiddenKinds:de}=V(),Z=(0,P.useContext)(et),z=M.overview&&!de.has(String(t))?le.places().filter(p=>p.kind===String(t)):[],R=r.focused?M.within?.view??z[0]?.as:void 0,A=c.filter(p=>r.flagged?.includes(p.id)).length,ce=A>0,Ht=X(),It=be(Ht,c),F=(M.overview??!1)&&r.nestedUnder===void 0,G=r.focused||r.raised,Ie=r.rank==="secondary"&&!G,E=r.nestedUnder!==void 0,We=new Set(N),K=Z?N.length===1&&N[0]===ae(String(t)):r.opened??!1,Wt=ut(),O=G||F?0:c.filter(p=>Wt.includes(p.id)&&!We.has(p.id)).length,xe=O>0&&!ce,ge=Qe(),q=ge&&!E?ge.byKind[String(t)]??0:0,ze=(0,P.useRef)(null),Fe=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{let p=Fe.current,T=ze.current;if(!p||!T||!F)return;let D=()=>T.style.setProperty("--graview-plate-h",`${p.offsetHeight}px`);if(D(),typeof ResizeObserver>"u")return;let Q=new ResizeObserver(D);return Q.observe(p,{box:"border-box"}),()=>Q.disconnect()},[F]);let zt=E?8:Math.min(46,10+Math.round(Math.sqrt(c.length)*8)),Ke=E?(0,l.jsx)("span",{style:{fontSize:"0.75rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:G?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r.label??o}):(0,l.jsx)(an,{text:r.label??o,accent:!!G});return(0,l.jsxs)("div",{ref:ze,className:"graview-kind-card","data-graview-rank":r.rank,"data-graview-landmark":S||void 0,"data-graview-nested":E||void 0,"data-graview-tied":O||void 0,"data-graview-hits":ge&&!E?q:void 0,"data-graview-emphasis":ge&&!E?q>0?"lit":"dimmed":void 0,...a?.description||E?{title:E?[r.label??o,a?.description].filter(Boolean).join(" \u2014 "):a.description}:{},style:{position:"relative",height:"100%","--graview-hue":Math.round(k)},children:[S?(0,l.jsx)("span",{className:"graview-kind-block graview-kind-landmark","data-graview-opened":r.opened||void 0,"aria-hidden":"true",style:{"--graview-rise":zt},children:(0,l.jsx)(ie,{kind:String(t),schema:e,...h?{brand:h}:{},size:96})}):null,(0,l.jsxs)("div",{ref:Fe,className:"graview-kind-face","data-graview-opened":r.opened||void 0,"data-graview-nameplate":F?r.nameplate??"full":void 0,style:{display:"flex",flexDirection:"column",gap:E?1:3,padding:E?"5px 7px":"7px 10px",borderRadius:"var(--graview-radius-sm, 9px)",justifyContent:"center",position:"relative",height:"100%",overflow:"hidden",boxSizing:"border-box",border:G?"1px solid var(--graview-accent)":O>0?"1px solid var(--graview-accent-dim)":`1px solid hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / 0.34)`,backgroundColor:"var(--graview-panel)",backgroundImage:`linear-gradient(hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:Ie?.28:.5})), hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:Ie?.28:.5})))`,boxShadow:G?"0 0 0 1px var(--graview-accent-dim)":void 0},children:[!E&&!F&&c.length>0?(0,l.jsx)("div",{"data-graview-tally":c.length,"data-graview-broken":A||void 0,"aria-hidden":"true",style:{position:"absolute",left:0,right:0,top:0,display:"flex",height:3,background:`hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / 0.4)`},children:A>0?(0,l.jsx)("span",{style:{width:`${Math.max(6,Math.round(A/c.length*100))}%`,background:"var(--graview-warn)"}}):null}):null,S?(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:E?4:6},children:[(0,l.jsx)(ie,{kind:String(t),schema:e,...h?{brand:h}:{},size:E?14:18}),Ke]}):Ke,(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"0.875rem"},children:[(0,l.jsx)("span",{title:c.length>0?`${ee(c.length)} ${c.length===1?H(a,String(t)):o.toLowerCase()}`:void 0,style:{fontVariantNumeric:"tabular-nums",color:xe?"var(--graview-accent)":"var(--graview-ink-faint)"},children:c.length===0?"none yet":xe?O===c.length?`${O} tied`:`${O} of ${c.length} tied`:ee(c.length)}),(0,l.jsx)(ke,{kind:String(t),plural:o,problems:It,flag:b,listed:K}),(r.retired??0)>0?(0,l.jsxs)("button",{type:"button",className:"graview-kind-past","data-graview-retired":r.retired,title:`${r.retired} retired ${o.toLowerCase()} \u2014 press to widen the view to the past`,onClick:p=>{p.stopPropagation(),W(ht(M,!0))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:["+",r.retired," past"]}):null,q>0?(0,l.jsxs)("button",{type:"button",className:"graview-kind-hits","data-testid":`hits-${String(t)}`,title:`${q} ${q===1?"match":"matches"} for \u201C${M.q??""}\u201D \u2014 press to go in, narrowed`,onClick:p=>{p.stopPropagation(),W(Je(M,ae(String(t)),{ownPicture:!0,...M.q?{carry:M.q}:{}}))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[q," match"]}):null,O>0&&!xe?(0,l.jsxs)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-accent)"},children:[O," tied"]}):null,r.hasOwnView&&!F?(0,l.jsx)("span",{title:`${o} has a view of its own`,"aria-label":"has its own view",style:{fontSize:"0.6875rem",color:"var(--graview-accent)"},children:"\u25C6"}):null,!E&&c.length>0&&!r.focused?(0,l.jsxs)("button",{type:"button",className:"graview-kind-open","data-testid":`open-${String(t)}`,"aria-expanded":K,"aria-label":K?`Close up the ${o}`:`See the ${o} in here`,title:K?"Close it up":`See the ${o} in here`,onClick:p=>{p.stopPropagation(),Z?K?x():v([ae(String(t))]):C(ae(String(t)))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[(0,l.jsx)("span",{className:"graview-kind-open-word",children:K?"close":"open"})," ",(0,l.jsx)("span",{"aria-hidden":"true",children:K?"\u25B4":"\u25BE"})]}):null]}),F&&r.states?(0,l.jsx)(P.Suspense,{fallback:null,children:(0,l.jsx)(nn,{states:r.states,definition:a})}):null,r.opened?(0,l.jsxs)("div",{className:"graview-kind-members","data-graview-buildings":r.plot?.side??1,style:{display:"grid",gridTemplateColumns:`repeat(${y.columns}, minmax(0, 1fr))`,gap:3},children:[c.slice(0,y.shown).map(p=>{let T=r.flagged?.includes(p.id)??!1,D=$(a,p);return(0,l.jsx)(Y,{pickId:p.id,label:T?`${D} ${b}`:D,title:T?`${D} \u2014 implicated in a problem`:void 0,hue:k,selected:We.has(p.id)},p.id)}),c.length>y.shown?(0,l.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",padding:"2px 4px",gridColumn:"1 / -1"},children:["+",c.length-y.shown," more \u2014 double-click to go in"]}):null]}):null]}),!E&&z.length>0?(0,l.jsx)("div",{className:"graview-drive-in","data-testid":`drive-in-${String(t)}`,"data-graview-showing":R,onPointerDown:p=>p.stopPropagation(),onDoubleClick:p=>p.stopPropagation(),children:(0,l.jsx)("div",{className:"graview-drive-in-marquee",role:"group","aria-label":`${o}: pictures`,"data-graview-thumbs":z.length===1?"one":"two",children:z.map(p=>{let T=R===p.as;return(0,l.jsxs)("div",{className:"graview-drive-in-thumb","data-graview-pressed":T||void 0,children:[(0,l.jsx)("span",{className:"graview-drive-in-thumb-title","aria-hidden":"true",children:p.title}),(0,l.jsx)("button",{type:"button",className:"graview-drive-in-thumb-press","data-testid":`showing-${p.as}`,"aria-label":`${o}: ${p.title}`,"aria-pressed":T,title:T?`${p.title} is showing \u2014 press again to open it`:`Show ${p.title} on the billboard \u2014 double-click to open it`,onClick:D=>{D.stopPropagation();let Q=()=>W(Ye(M,String(t),p.as));if(D.detail>=2||T&&r.focused){Q();return}W(qe(je(Ue(M,!0),Xe(String(t))),"view",p.as)),D.detail===1&&Qt(D.currentTarget.ownerDocument,$t(D.nativeEvent),Q)}})]},p.as)})})}):null]})};m.generic=!0,w.generic=!0,n.register(t,{cardinality:"one",fidelity:"full"},_(s)).register(t,{cardinality:"one",fidelity:"summary"},_(d)).register(t,{cardinality:"one",fidelity:"glyph"},_(u)).register(t,{cardinality:"many",fidelity:"full"},_(m)).register(t,{cardinality:"many",fidelity:"summary"},_(m)).register(t,{cardinality:"many",fidelity:"glyph"},_(w))}return n}var Ee=L(I(),1),Et=new WeakMap;function rn(e){let n=Et.get(e);return n||Et.set(e,n=Vt(e,he(e))),n}var Ve=tt;function Lt(){return(0,$e.useContext)(Ve)}function qn({children:e}){return(0,Ee.jsx)(Ve.Provider,{value:!0,children:e})}function Mt(e){let n=(0,$e.useContext)(Ve),{store:t}=V();if(n)return null;let a=e.kind??e.node?.kind??e.nodes?.[0]?.kind;if(!a)return null;let o=rn(t.schema).lookup(a,{cardinality:e.cardinality,fidelity:e.fidelity});return o?(0,Ee.jsx)(o,{...e}):null}var i=L(I(),1),on=90,Tt=(0,f.createContext)(null),Le=(e,n)=>e.trim().toLowerCase().replace(/[_-]+/g," ")===n.trim().toLowerCase().replace(/[_-]+/g," "),sn=(0,f.createContext)(null),Ge=(0,f.createContext)(null);function Dt({block:e}){let n=(0,f.useContext)(Ge),t=n?.slots?.[e.key],a=(0,i.jsx)(ln,{block:e});return t?(0,i.jsx)(f.Suspense,{fallback:a,children:(0,i.jsx)(t,{block:e,node:n.node,drawn:a})}):a}function ln({block:e}){let n=(0,f.useContext)(Tt),t=(0,f.useContext)(cn),a=(0,f.useContext)(Te),o=(0,f.useContext)(we);if(n&&e.t==="badge"&&n.values.some(s=>Le(s,e.text))||n&&e.t==="field"&&n.field!==void 0&&e.field===n.field||e.t==="badge"&&/^0(?:\s+\p{L}+)?$/u.test(e.text.trim()))return null;switch(e.t){case"title":return(0,i.jsx)("strong",{className:"graview-spec-title",...o!==null&&Le(o,e.text)?{"aria-hidden":!0}:{},children:e.text});case"text":return e.markdown||Ce(e.text)?(0,i.jsx)("div",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},children:(0,i.jsx)(yt,{text:e.text,markdown:e.markdown})}):e.runs?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-meta",...e.tone?{"data-graview-tone":e.tone}:{},children:e.runs.map((s,d)=>(0,i.jsxs)(f.Fragment,{children:[d>0?" ":null,s.field!==void 0?(0,i.jsx)("span",{className:"graview-spec-chip","data-graview-field":s.field,children:s.text}):(0,i.jsx)("span",{className:"graview-spec-meta-words",children:d>0&&e.runs[d-1].field===void 0?`\xB7 ${s.text}`:s.text})]},d))}):(0,i.jsx)("p",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},children:e.text});case"badge":return(0,i.jsx)("span",{className:"graview-spec-badge","data-graview-tone":e.tone,children:e.text});case"field":return(0,i.jsxs)("span",{className:"graview-spec-field","data-graview-field":e.field,children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",...Ce(e.text)?{style:{whiteSpace:"pre-line"}}:{},children:e.linked?(0,i.jsx)(pt,{relation:e.linked.relation,refs:e.linked.refs,as:"chip"}):e.app?(0,i.jsx)(vt,{address:e.app}):e.href?(0,i.jsx)("a",{className:"graview-spec-link",href:e.href,...e.href.startsWith("tel:")?{}:{rel:"noopener noreferrer",target:"_blank"},children:e.text}):e.text})]});case"image":return(0,i.jsx)(Se,{as:"block",field:e.field,files:e.files,label:e.label,view:e.as});case"progress":return e.value===void 0||e.max===void 0?(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]}):(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-track",role:"progressbar","aria-label":e.label,"aria-valuemin":0,"aria-valuemax":e.max,"aria-valuenow":Math.max(0,Math.min(e.value,e.max)),"aria-valuetext":e.text,children:(0,i.jsx)("span",{className:"graview-spec-fill",style:{width:`${Math.round(Math.max(0,Math.min(e.value,e.max))/e.max*100)}%`}})}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]});case"group":return(0,i.jsx)("span",{className:"graview-spec-group","data-direction":e.direction,children:(0,i.jsx)(Me,{blocks:e.blocks})});case"when":return e.shown?(0,i.jsx)(Me,{blocks:e.blocks}):null;case"divider":return(0,i.jsx)("hr",{className:"graview-spec-divider"});case"figure":return(0,i.jsx)(dn,{});case"headline":{let s=`h${Math.min(6,e.level+t)}`,d=(0,i.jsx)(s,{className:"graview-spec-headline","data-level":e.level,"data-long":e.text.length>on?"":void 0,children:e.text});return a!==null&&e.level===1?(0,i.jsxs)(i.Fragment,{children:[d,a]}):d}case"number":return(0,i.jsxs)("span",{className:"graview-spec-number",...e.emphasis?{"data-emphasis":e.emphasis}:{},children:[(0,i.jsx)("span",{className:"graview-spec-number-value",children:e.text}),e.label?(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}):null]});case"list":return(0,i.jsx)(pn,{list:e})}}function dn(){let e=(0,f.useContext)(Ge)?.figure;return e?(0,i.jsx)("span",{className:"graview-spec-figure","aria-hidden":"true",children:e()}):null}function Me({blocks:e}){let n=[];for(let t=0;t<e.length;t++){let a=t;for(;e[a]?.t==="badge"&&e[a+1]?.t==="badge";)a++;if(a===t){n.push((0,i.jsx)(Dt,{block:e[t]},t));continue}n.push((0,i.jsx)("span",{className:"graview-spec-badges",children:e.slice(t,a+1).map((o,s)=>(0,i.jsx)(Dt,{block:o},s))},t)),t=a}return n}function Oe({blocks:e,ctx:n,view:t}){let a=(0,f.useContext)(sn)?.[t];return(0,i.jsx)(Ge.Provider,{value:{figure:n.figure,slots:a,node:n.node},children:(0,i.jsx)(Me,{blocks:e})})}function Bt({blocks:e,ctx:n,view:t}){return(0,i.jsx)(Oe,{blocks:j(e,n),ctx:n,view:t})}var De=3,Gt=(0,f.createContext)(0),Ot=(0,f.createContext)(null),cn=(0,f.createContext)(0),Te=(0,f.createContext)(null),gn=(0,f.createContext)(null);function un({node:e,as:n,depth:t,said:a=null}){let{store:o,views:s}=V(),d=$(o.schema.tryDefinition(e.kind),e),u=s.lookup(e.kind,{cardinality:"one",fidelity:n==="card"?"summary":"glyph"});return n==="row"&&t<=De&&(!u||me(u))?(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(Be,{node:e,label:d}),(0,i.jsx)("div",{className:"graview-spec graview-spec-row","data-graview-spec":"row","data-graview-kind":e.kind,"aria-hidden":"true",children:(0,i.jsx)("strong",{className:"graview-spec-title",children:d})})]}):(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(Be,{node:e,label:d}),t<=De&&u?(0,i.jsx)(Ze,{mode:"scene",children:(0,i.jsx)(Gt.Provider,{value:t,children:(0,i.jsx)(Tt.Provider,{value:a,children:(0,i.jsx)(we.Provider,{value:d,children:(0,i.jsx)(u,{node:e,cardinality:"one",fidelity:n==="card"?"summary":"glyph",mode:"scene",selected:!1})})})})}):(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:d})]})}function Be({node:e,label:n,describedBy:t}){let a=(0,f.useContext)(Ot),o=(0,f.useRef)(null);return xt(o),a?(0,i.jsx)("a",{ref:o,className:"graview-spec-item-link",href:a.href(e),"aria-label":n,...t?{"aria-describedby":t}:{},onClick:s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.button!==0||(s.preventDefault(),s.stopPropagation(),a.go(e))}}):(0,i.jsx)("button",{ref:o,type:"button",className:"graview-spec-item-link","data-graview-pick":e.id,"aria-label":n,...t?{"aria-describedby":t}:{}})}function pn({list:e}){let n=(0,f.useContext)(Gt)+1,{store:t}=V(),a=(0,f.useContext)(Ot),[o,s]=(0,f.useState)(e.members.length);if(e.failed)return(0,i.jsx)("p",{className:"graview-spec-text",children:"\u2014"});if(e.members.length===0)return e.empty?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-empty",children:e.empty}):null;let d=(v,x=null)=>n>De?(0,i.jsx)("ul",{className:"graview-spec-list","data-as":"names",children:v.map(C=>(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":C.id,"data-as":"name",children:[(0,i.jsx)(Be,{node:C,label:$(t.schema.tryDefinition(C.kind),C)}),(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:$(t.schema.tryDefinition(C.kind),C)})]},C.id))}):(0,i.jsx)("ul",{className:"graview-spec-list","data-as":e.as,children:v.map(C=>(0,i.jsx)(un,{node:C,as:e.as,depth:n,said:x},C.id))}),u=e.rest??[],m=Math.min(o,e.members.length+u.length),g=m>e.members.length?[...e.members,...u].slice(0,m):e.members,w=e.members.length+u.length-m,r=Math.max(1,e.members.length),c=w>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,i.jsx)("button",{type:"button",className:"graview-spec-show-more","data-graview-show-more":w,onClick:()=>s(m+r),children:`Show ${Math.min(r,w)} more`})}):null,y=e.total??e.members.length+e.more,k=e.more-u.length,h=c??(a?.more&&y>g.length?a.more({members:g,total:y}):k>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${k} more`}):null);if(!e.groups)return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[d(g),h]});let S=`h${e.headingLevel}`,b=m,N=m>e.members.length&&e.everyGroup?e.everyGroup.flatMap(v=>{if(b<=0)return[];let x=v.members.slice(0,b);return b-=x.length,[{...v,members:x}]}):e.groups;return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[N.map(v=>(0,i.jsxs)("section",{className:"graview-spec-list-group","data-graview-group":v.value??"",children:[v.heading?(0,i.jsxs)(S,{className:"graview-spec-list-heading",children:[v.heading," ",(0,i.jsx)("span",{className:"graview-spec-list-count",children:(e.everyGroup?.find(x=>x.value===v.value)??v).members.length})]}):null,d(v.members,v.value!==null?{values:[v.value,...v.heading?[v.heading]:[]]}:null)]},v.value??"")),h]})}function da({blocks:e,heading:n=2,firstHeading:t,slot:a,view:o=a}){let{store:s,brand:d}=V();pe();let u=oe(s,null,null,{heading:n,firstHeading:t,money:d}),m=(0,f.useContext)(Te),w=(0,f.useContext)(gn)?.lede===!0&&a==="place"&&e[0]?.t==="headline"?e.slice(1):e,r=w.some(c=>c.t==="headline");return(0,i.jsxs)("div",{className:`graview-spec graview-spec-${a}`,"data-graview-spec":a,children:[m!==null&&!r?m:null,(0,i.jsx)(Te.Provider,{value:r?m:null,children:(0,i.jsx)(Bt,{blocks:w,ctx:u,view:o})})]})}function He(e,n="card"){let{store:t,brand:a}=V(),o=t.schema;return{...oe(t,null,e,{slot:n,money:a}),figure:()=>(0,i.jsx)(ie,{kind:e.kind,schema:o,...a?{brand:a}:{},size:22})}}function mn({blocks:e,node:n,selected:t,flagged:a}){let o=He(n),[s,...d]=e,u=s?.t==="title";return(0,i.jsx)(J,{...u?{title:j([s],o)[0].text}:{},selected:t,tone:a?"warning":"muted",fit:!0,children:(0,i.jsx)("div",{className:"graview-spec graview-spec-card","data-graview-spec":"card","data-graview-kind":n.kind,children:(0,i.jsx)(Bt,{blocks:u?d:e,ctx:o,view:`${n.kind}.card`})})})}function hn({blocks:e,props:n}){let t=n.node,a=He(t,"page"),o=Lt(),s=j(e,a),d=ye(e,s),u=d.title!==void 0&&(!o||d.title===$(a.schema?.tryDefinition(t.kind),t)),m=(0,i.jsx)("div",{className:"graview-spec graview-spec-page","data-graview-spec":"page","data-graview-kind":t.kind,children:(0,i.jsx)(Oe,{blocks:u?s.slice(1):s,ctx:a,view:`${t.kind}.page`})});return o?m:(0,i.jsx)(se.Provider,{value:{nodeId:t.id,...d.title!==void 0?{title:d.title}:{},body:m,fields:d.fields,records:d.records},children:(0,i.jsx)(Mt,{...n})})}function ca(e,n,t){return typeof e=="function"?e.says?.(n,t):void 0}function fn({blocks:e,node:n,selected:t}){let{store:a}=V(),o=$(a.schema.tryDefinition(n.kind),n),s=He(n,"row"),d=j(e,s),u=(0,f.useContext)(we);return(0,i.jsx)("div",{title:o,style:{minWidth:0,maxWidth:"100%"},children:(0,i.jsxs)("div",{className:"graview-spec graview-spec-row","data-graview-spec":"row","data-graview-kind":n.kind,...e.some(dt)?{"data-graview-tall":""}:{},...t?{"data-selected":""}:{},children:[lt(d,o)?null:(0,i.jsx)("strong",{className:"graview-spec-title","data-graview-row-name":"",...u!==null&&Le(u,o)?{"aria-hidden":!0}:{},children:o}),(0,i.jsx)(Oe,{blocks:d,ctx:s,view:`${n.kind}.row`})]})})}function ga(e,n,t){if(!t)return e;let a=new Set(n.kinds);for(let[o,s]of Object.entries(t)){if(!a.has(o)||!s)continue;let d=o;if(s.card){let u=re(s.card),m=g=>g.node?(0,i.jsx)(mn,{blocks:u,node:g.node,selected:g.selected,flagged:g.flagged?.includes(g.node.id)??!1}):null;e.register(d,{cardinality:"one",fidelity:"summary"},m)}if(s.row){let u=re(s.row),m=g=>g.node?(0,i.jsx)(fn,{blocks:u,node:g.node,selected:g.selected}):null;m.says=(g,w)=>ye(u,j(u,oe({graph:w,schema:n},null,g,{slot:"row"}))),e.register(d,{cardinality:"one",fidelity:"glyph"},m)}if(s.page){let u=re(s.page),m=g=>g.node?(0,i.jsx)(hn,{blocks:u,props:g}):null;m.says=(g,w)=>ye(u,j(u,oe({graph:w,schema:n},null,g))),e.register(d,{cardinality:"one",fidelity:"full"},m)}}return e}export{xt as a,qn as b,Tt as c,Ot as d,cn as e,Te as f,gn as g,Be as h,da as i,ca as j,ga as k,Vt as l};
@@ -1 +0,0 @@
1
- import{a as _}from"./chunk.SOTB6C5A.js";import{a as ie,b as de,c as se,d as le,e as V,f as L,g as ue}from"./chunk.TQCRFZ53.js";import{a as ye}from"./chunk.6HLKAUWF.js";import{c as T,e as ae,f as fe}from"./chunk.FCUDBMGC.js";import{a as j,b as ee,c as ne,d as re,f as E,m as te,n as b,o as oe,p as B,q as P}from"./chunk.KMEKMCKG.js";import{b as x,d as pe,e as me,g as ce,h as ge,i as he}from"./chunk.7U2JO7ET.js";import{C as v,Fa as Y,K as H,Lb as q,Mb as Q,Nb as C,T as K,W as F,aa as J,ga as X,ma as N,oa as Z,ta as G,ua as A,va as z,wa as O,xa as M}from"./chunk.YEJ4LNUP.js";var be=e=>e.caption?.trim()||e.name,I=e=>A(e)?`${be(e)}, ${z(e)}`:be(e);function rn(e){let n=Math.max(0,Math.round(e)),t=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),o=Math.floor(n%3600/60);return r>0?`${r}:${t(o)}:${t(n%60)}`:`${o}:${t(n%60)}`}function Pe(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(t=>{let r=v(n[t]);for(;r?.innerType;)r=v(r.innerType);return M(n[t])!==void 0||r?.type==="array"&&M(r.element)!==void 0})}function tn(e,n){for(let t of Pe(n)){let r=O(e[t]).find(o=>G(o)||A(o));if(r)return r}}var k=e=>{try{return e()}catch{return null}},je=e=>typeof e=="string"&&ie.includes(e);function ve(e){if(e!==void 0)return je(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:k(()=>T(e.expr))}:"neutral"}var Fe=4;function Ne(e){let n=typeof e.list=="string"?k(()=>T(e.list)):null,t=e.sort,r=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.by=="string"?t.by:void 0,o=t&&typeof t=="object"?t.direction:void 0,a=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let y=k(()=>T(r));a=y?{t:"call",fn:"sort",args:[n,y,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,V):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,f=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(f).filter(y=>typeof y[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function we(e,n=1,t=""){if(!Array.isArray(e)||n>Fe)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let a=o,d=p=>typeof p=="string"?k(()=>ae(p)):null,l=p=>typeof p=="string"?k(()=>T(p)):null,i=ve(a.tone),s=typeof a.label=="string"?a.label:void 0,f=p=>Object.hasOwn(a,p),y=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=f("list")?"list":f("headline")?"headline":typeof a.figure=="string"?"number":Me.find(f);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,R=typeof c=="string"&&c?c:`${t}${u}.${m}`;return[{...(()=>{switch(u){case"list":return Ne(a);case"number":{let p=se.includes(a.as)?a.as:void 0,W=le.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:d(s)}:{},...W?{emphasis:W}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=de.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:we(a.group,n+1,`${R}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:we(a.show,n+1,`${R}.`)};default:return{t:u}}})(),key:R}]})}var Me=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Ce=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:E(e,{graph:n.graph??te,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Ce})}}catch(t){return{ok:!1,problem:t instanceof Error?t.message:String(t)}}}var Ve=(e,n,t)=>!e.format&&e.expr?.t==="ident"&&typeof t=="string"&&n.fields[e.expr.name]?.format==="markdown";function S(e,n,t){if(!e)return{text:g,problem:"a template that does not parse"};let r,o;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(Ve(d,n,l.value))return n.glance?pe(l.value,{markdown:!0}):t&&e.length===1?(o=!0,l.value):me(l.value);let i=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?xe(n,d.expr.name):void 0;return oe(d,i?C(l.value,i):b(l.value,d.format,n.today,d.formatArgs,n.money,P(n.schema)))}).join(""),...r?{problem:r}:{},...o?{markdown:o}:{}}}var Le=" \xB7 ";function _e(e,n){if(!e||!n.node)return;let t=[[]];for(let d of e){if(d.text===void 0){t[t.length-1].push(d);continue}d.text.split(Le).forEach((i,s)=>{s>0&&t.push([]),i!==""&&t[t.length-1].push({text:i})})}if(t.length<2)return;let r=d=>{let[l]=d;if(!(d.length!==1||!l||l.format||l.expr?.t!=="ident"))return n.fields[l.expr.name]?.type==="enum"?l.expr.name:void 0},o=0,a=t.flatMap(d=>{let l=r(d);if(l){let s=Object.hasOwn(n.node,l)?n.node[l]:void 0;return s==null||s===""?[]:(o++,[{text:x(n.definition,l,s),field:l}])}let i=S(d,n).text.trim();return i===""||i===g?[]:[{text:i}]});return o>0?a:void 0}function Se(e,n){if(e===void 0)return;if(typeof e=="string")return e;let t=w(e.expr,n);return t.ok&&je(t.value)?t.value:"neutral"}function Ie(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var Te=(e,n)=>{let t=e.fields[n]?.type;return t==="phone"||t==="place"||t==="duration"?t:ce(e.definition,n)},xe=(e,n)=>q(e.definition?.fields?.shape?.[n]);function De(e,n,t,r,o){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,t.today,[],o?{...t.money,currency:o}:t.money);let a=t.fields[e];if(t.definition?.display?.format?.[e])return x(t.definition,e,n);let d=ge(Te(t,e),n,t.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",t.today,[],t.money);if(a?.type==="datetime"&&typeof n=="string")return K(n,t.money?.locale,t.money?.timeZone);if(a?.type==="enum"&&typeof n=="string")return x(t.definition,e,n);let l=typeof n=="number"?xe(t,e):void 0;if(l)return C(n,l);if(typeof n=="number")return F(n,t.money?.locale,{});let i=O(n);return i[0]?i.map(I).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function $e(e,n,t,r,o){return typeof e!="number"?String(e):n==="money"?Q(e,t?{...o,currency:t}:o):n==="percent"?b(e,n,r,[],o):F(e,o?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function Re(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function Ue(e,n,t){switch(e.t){case"title":{let r=S(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=S(e.parts,n,!0),o=Se(e.tone,n),a=n.glance&&!r.problem?_e(e.parts,n):void 0;return h({t:"text",text:r.text,...o?{tone:o}:{},...r.markdown?{markdown:r.markdown}:{},...a?{runs:a}:{}},r.problem)}case"badge":{let r=S(e.parts,n);return h({t:"badge",text:r.text,tone:Se(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??N(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(o){let y=Y(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,o);return{t:"field",field:e.field,label:r,text:y.length>0?"linked record":g,...y.length>0?{linked:{relation:o,refs:y}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let y=w({t:"ident",name:e.field,at:0},n);y.ok?d=y.value!==null&&typeof y.value=="object"?b(y.value,void 0,n.today,[],n.money,P(n.schema)):y.value:l=y.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?Ie(d):he(Te(n,e.field),d),s=k(()=>De(e.field,d,n,e.as,e.currency))??g,f=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...f?{app:f}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(a=>G(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??N(n.definition,e.field),as:e.as,files:o,text:o.map(I).join(", ")||g}}case"progress":{let r=w(e.value,n),o=w(e.max,n),a=e.label?S(e.label,n):{text:"Progress"},d=e.label?B(e.label,a.text):a.text,l=r.ok?o.ok?a.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?h({t:"progress",label:d,value:r.value,max:o.value,text:`${b(r.value,void 0,n.today)} of ${b(o.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:ke(e.blocks,Re(n))};case"when":{let r=w(e.when,n),o=r.ok&&r.value===!0;return h({t:"when",shown:o,blocks:o?ke(e.show,Re(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=S(e.parts,n),o=Math.min(6,Math.max(1,(t?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:o,text:e.parts?B(e.parts,r.text):r.text},r.problem)}case"number":{let r=w(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?g:$e(r.value,e.as,e.currency,n.today,n.money),a=e.label?S(e.label,n):void 0;return h({t:"number",text:o,...a&&e.label?{label:B(e.label,a.text)}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return He(e,n)}}function ke(e,n){let t=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...Ue(r,n,o===t),key:r.key}))}function Ae(e,n){let t=n.trim().toLowerCase();return e.some(r=>{switch(r.t){case"title":case"headline":return r.text.trim()!=="";case"text":case"badge":return t!==""&&r.text.toLowerCase().includes(t);case"group":return Ae(r.blocks,n);case"when":return r.shown&&Ae(r.blocks,n);default:return!1}})}var We=new Set(["every","some","sum","min","max","sort"]);function On(e,n){let t=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":t.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,f)=>{f===1&&We.has(i.fn)||o(s)});return;default:return}},a=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((f,y)=>{let u=s[y];if(u)switch(f.t){case"field":case"image":t.add(f.field);return;case"title":case"text":case"badge":case"headline":a(f.parts);return;case"number":o(f.value),a(f.label);return;case"progress":o(f.value),o(f.max);return;case"group":u.t==="group"&&d(f.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(f.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:t,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function He(e,n){let t=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:t,more:0,problem:r.problem};let o=r.value,a=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(a=Ke(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??V),i=l.slice(0,L),s=l.slice(L),f=(e.limit===void 0?d:l.length)-i.length,y=c=>e.group&&n.schema&&c.length>0?Je(c,e.group,n.schema,n.graph):void 0,u=y(i),m=s.length>0?y(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:t,...i.length===0&&e.empty?{empty:e.empty}:{},more:f,total:d}}function D(e,n,t){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,t)?_(r[t]):void 0;return o?.type==="enum"?o.options??[]:[]}var $=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function Ke(e,n,t){let r=o=>{let a=D(t,o.kind,n).indexOf(String($(o,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((o,a)=>({node:o,i:a,rank:r(o)})).sort((o,a)=>o.rank-a.rank||o.i-a.i).map(o=>o.node)}function Je(e,n,t,r){let o=e.some(i=>D(t,i.kind,n.by).length>0)?void 0:ue(n.by);if(o&&r)return Xe(e,o,n.headings,t,r);let a=[];for(let i of e)for(let s of D(t,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(y=>$(y,n.by)===i);if(s.length===0)continue;let f=t.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??J(x(f,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String($(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function Xe(e,n,t,r,o){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=P(r),s;for(let u of e){let m=a(u)==="out"?o.out(u.id,n.edge):o.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let R=d.get(c.id)??{node:c,members:[]};R.members.push(u),d.set(c.id,R)}}let f=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:t[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let y=s&&s!=="*"?Z(r.tryDefinition(s),s):void 0;return l.length>0&&f.push({value:null,...y?{heading:`No ${y}`}:{},members:l}),f}function Oe(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(Oe):e.t==="when"?e.show.some(Oe):!1}function Ge(e,n){let t=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,a]of Object.entries(t)){let d=_(a);d&&(r[o]=d)}return r}var Ee=new WeakMap;function U(e){let n=Ee.get(e);return n||Ee.set(e,n=ye(e)),n}function Ze(e,n,t,r={}){let o=U(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:X(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(t?t.kind:ne)?.computed??[])try{let f=[],y=E(s,{graph:n,subject:t,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>f.push(u)});f.length>0&&(y===null||y instanceof j&&y.nodes.length===0)?d[i]=ee(f[0]):a[i]=l(y)}catch(f){if(!(f instanceof re))throw f;d[i]=f.sentence}return{values:a,refused:d}}function Bn(e,n,t){let{values:r}=Ze(e,n,t);if(Object.keys(r).length===0)return t;let o=a=>Array.isArray(a)?a.map(o):a!==null&&typeof a=="object"?a.label:a;return{...t,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,o(d)]))}}function Pn(e,n){return[...fe(e.tryDefinition(n)).keys()]}var ze=500,Ye=2e4,Be=new WeakMap;function qe(e,n){let t=Be.get(e);t||Be.set(e,t=new Map);let r=t.get(n);return r||t.set(n,r=Ge(e,n)),r}function Cn(e,n,t,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,a=n&&t?o.graph.getNode(t.id)??null:t,d=o.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:f}=r;return{node:a,graph:o.graph,schema:d,kinds:U(d),fields:a?qe(d,a.kind):{},definition:l||void 0,today:r.today??o.today?.()??H(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:f,budget:r.budget??(i?Ye:ze),...i?{}:{glance:!0}}}export{be as a,rn as b,Pe as c,tn as d,we as e,ke as f,Ae as g,On as h,Oe as i,U as j,Ze as k,Bn as l,Pn as m,Cn as n};
@@ -1 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{G as k,Ga as o,T as n}from"./chunk.NPAWTPLQ.js";import{a as t}from"./chunk.SDO3U72B.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.T2RME6XF.js","./chunk.SOTB6C5A.js","./chunk.TQCRFZ53.js","./chunk.6HLKAUWF.js","./chunk.FCUDBMGC.js","./chunk.KMEKMCKG.js","./chunk.GZHZLJBF.js","./chunk.E5XNQTEU.js","./chunk.OJGHDWI6.js","./chunk.K5YLQAFW.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.O6LDZWLR.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.E5XNQTEU.js","./chunk.OJGHDWI6.js","./chunk.K5YLQAFW.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.2E6EWVWR.js")))),I=d.part((e,r)=>e.drawLinkedRecord(r),{quiet:!0}),w=d.part((e,r)=>e.drawLinkedPicker(r),{what:"Picking a linked record"});var s=p(n(),1),m=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.E5XNQTEU.js","./chunk.OJGHDWI6.js","./chunk.K5YLQAFW.js","./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.D4LN33J2.js")))),E=m.part((e,r)=>(0,s.jsx)(e.RepeatPicker,{...r}),{quiet:!0}),W=m.part((e,r)=>(0,s.jsx)(e.RepeatEditor,{...r}),{quiet:!0});var a=p(k(),1),i=p(n(),1),c=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.XJFAUOJS.js","./chunk.DPPT6WAJ.js","./chunk.7U2JO7ET.js","./chunk.HFVMGTNL.js","./chunk.7Z4USR3Y.js","./chunk.NPAWTPLQ.js","./chunk.SDO3U72B.js","./chunk.YEJ4LNUP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.2DETYEJM.js")))),l=c.part((e,r)=>(0,i.jsx)(e.WhenInput,{...r}),{quiet:!0});function M(e){return(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)("span",{"data-graview-when-arriving":"",style:{display:"inline-block",minHeight:24}}),children:(0,i.jsx)(l,{...e})})}var N=()=>c.load().then(()=>{},()=>{});export{y as a,I as b,w as c,E as d,W as e,M as f,N as g};
@@ -1 +0,0 @@
1
- import{a as O,b,c as w,d as R,e as V}from"./chunk.FCUDBMGC.js";import{h as l,i as S}from"./chunk.KMEKMCKG.js";import{Ka as $,La as F}from"./chunk.YEJ4LNUP.js";var E=["card","row","page"],j=["good","warn","bad","neutral","accent"],H=["money","percent","date","time","datetime","relative","count"],_=4,T=40,I=120,L=["number","money","percent"],B=["large"],U=["card","row"],M=1e3,fe=100;function C(e){let n=/^\s*(out|in)\(\s*['"]([A-Za-z][A-Za-z0-9_-]*)['"]\s*\)\s*$/.exec(e);return n?{edge:n[2],way:n[1]}:/^[A-Za-z][A-Za-z0-9_-]*$/.test(e)?{edge:e}:void 0}var v={title:[],headline:[],list:["sort","limit","group","empty","as"],text:["tone"],badge:["tone"],field:["as","currency","label"],image:["as","label"],progress:["label"],group:["direction"],when:["show"],divider:[],figure:["as","currency","label","emphasis"]},Z=Object.keys(v),G=`{"title": "{name}"}, {"headline": "{count(all('offer'))} offers"}, {"figure": expr, "as"?: "number"|"money"|"percent", "currency"?, "label"?, "emphasis"?: "large"}, {"list": expr, "sort"?, "limit"?, "group"?, "empty"?, "as"?: "card"|"row"}, {"text": "\u2026", "tone"?}, {"badge": "{status}", "tone"?}, {"field": "quote", "as"?, "currency"?, "label"?}, {"image": "photos", "as"?: "thumb"|"gallery"}, {"progress": {"value": expr, "max": expr}, "label"?}, {"group": [blocks], "direction"?: "row"|"column"}, {"when": expr, "show": [blocks]}, {"divider": true}, {"figure": true}`,X=e=>/^(image|video|file)$/.test(e?.of??e?.type??"");function ue(e){return Object.fromEntries(Object.entries(e.views??{}).filter(([,n])=>!Array.isArray(n)))}function ce(e){let n=e.views?.home;return Array.isArray(n)?n:void 0}var Y={field:()=>!1,relation:()=>!1,figure:!1},z=e=>e.kind??"the home",m=(e,n)=>e!==void 0&&Object.hasOwn(e,n),g=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function N(e,n,t){let o=O(e);for(let a of o.unknownFunctions)t.findings.push(l("unknown-function",n,`"${a}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let a of o.names){if(t.kind===null){t.findings.push(l("view-name",n,`"${a}" names nothing here: these blocks are about no one record`,"reach records with all('<kind>'), like count(all('offer')) or first(all('party') where role == 'client').name"));continue}a==="id"||t.spec.field(a)||t.spec.relation(a)||t.findings.push(l("view-name",n,`${t.kind} has no field or relation called "${a}"`))}for(let a of o.edges)t.edges.has(a)||t.findings.push(l("view-edge",n,`"${a}" is not a relation any kind declares`));for(let a of o.sweeps)t.kinds.has(a)||t.findings.push(l("view-kind",n,`"${a}" is not a kind this document declares`))}function k(e,n,t){if(typeof e!="string"||e.length===0||e.length>2e3){t.findings.push(l("view-expression",n,`an expression is a line of the rule language, like "status == 'booked'"`));return}try{N(w(e),n,t)}catch(o){if(!(o instanceof b))throw o;t.findings.push(l("expression",n,`${o.sentence} (at character ${o.at+1})`))}}function A(e,n,t,o){let a=o==="text";if(typeof e!="string"||e.length===0||e.length>300){t.findings.push(l("view-template",n,'a template is words with {field} in braces, like "{name}" or "{quote|money}", at most 300 characters'));return}let d;try{d=V(e)}catch(r){if(r instanceof R||r instanceof b){t.findings.push(l("template",n,r.sentence));return}throw r}for(let r of d)if(r.expr){if(N(r.expr,n,t),a&&!r.format&&r.expr.t==="ident"&&(t.slot==="card"||t.slot==="row")&&t.spec.prose?.(r.expr.name)){let i=r.expr.name;t.findings.push(S("view-whole-text",n,`${t.kind} ${t.slot} shows ${i} whole; it will be clamped. Use {${i}|excerpt} or move it to the page.`,`write {${i}|excerpt}, or {${i}|excerpt: 80} for fewer characters`))}if(o==="headline"&&!r.format&&r.expr.t==="ident"&&t.spec.prose?.(r.expr.name)){let i=r.expr.name;t.findings.push(S("view-headline-long",n,`${z(t)}${t.slot?` ${t.slot}`:""} heads it with ${i}, a long text, drawn at a headline's size; a headline is a few words.`,`say it in a text block, {"text": "{${i}}"}, or head it with {${i}|excerpt: 60}`))}}}function q(e,n,t){if(typeof e=="string"){j.includes(e)||t.findings.push(l("view-tone",n,`"${e}" is not a tone`,`use one of ${j.join(", ")}, or {"expr": "if(status == 'booked', 'good', 'neutral')"}`));return}if(g(e)&&Object.keys(e).length===1&&"expr"in e){k(e.expr,`${n}.expr`,t);return}t.findings.push(l("view-tone",n,'a tone is a word or {"expr": \u2026}',`one of ${j.join(", ")}`))}function x(e,n,t,o){if(!Array.isArray(e)){o.findings.push(l("view-shape",n,"a view is a list of blocks"));return}if(t>_){o.findings.push(l("view-depth",n,`blocks nest at most ${_} deep`,"flatten a group or a condition"));return}e.forEach((a,d)=>J(a,`${n}.${d}`,t,o))}function J(e,n,t,o){if(t===1&&o.count++,o.all++,!g(e)){o.findings.push(l("view-block",n,"a block is an object naming what it shows",`one of ${G}`));return}let a=Object.keys(e),d=a.filter(s=>Z.includes(s)&&!(s==="group"&&a.includes("list")));if(d.length===0){o.findings.push(l("view-block",n,`${a.length>0?a.map(s=>`"${s}"`).join(", "):"an empty object"} is not a block Graview knows`,`one of ${G}`));return}if(d.length>1){o.findings.push(l("view-block",n,`a block is one thing, and this says ${d.map(s=>`"${s}"`).join(" and ")}`,"split it into two blocks"));return}let r=d[0];for(let s of a)s!==r&&s!="key"&&!v[r].includes(s)&&o.findings.push(l("unknown-key",`${n}.${s}`,`"${s}" is not part of a ${r} block`,v[r].length>0?`a ${r} block may also say ${v[r].map(f=>`"${f}"`).join(", ")}`:`a ${r} block says nothing else`));let i=e[r];switch(r){case"title":case"headline":case"text":case"badge":A(i,`${n}.${r}`,o,r==="text"||r==="headline"?r:void 0),"tone"in e&&q(e.tone,`${n}.tone`,o);return;case"image":case"field":{let s=r==="image";if(typeof i!="string"||!(s?o.spec.files?.(i):o.spec.field(i))){let u=typeof i=="string"&&o.spec.relation(i);o.findings.push(l(`view-${r}`,`${n}.${r}`,`${o.kind} has no ${s?"image, video or file ":""}field ${typeof i=="string"?`"${i}"`:"by that name"}`,u?`"${i}" is a relation; show it with {"text": "{${i}.name}"}`:void 0))}let f=s?["thumb","gallery"]:H;"as"in e&&!f.includes(e.as)&&o.findings.push(l("view-format",`${n}.as`,`"${String(e.as)}" is not a way to show ${s?"pictures":"a field"}`,`use one of ${f.join(", ")}`)),s||W(e,n,o,"field"),"label"in e&&ie(e.label,`${n}.label`,o);return}case"progress":{!g(i)||Object.keys(i).some(s=>s!=="value"&&s!=="max")||!("value"in i)||!("max"in i)?o.findings.push(l("view-progress",`${n}.progress`,'progress is {"value": expression, "max": expression}')):(k(i.value,`${n}.progress.value`,o),k(i.max,`${n}.progress.max`,o)),"label"in e&&A(e.label,`${n}.label`,o);return}case"group":"direction"in e&&e.direction!=="row"&&e.direction!=="column"&&o.findings.push(l("view-direction",`${n}.direction`,`a group runs "row" or "column", not "${String(e.direction)}"`)),x(i,`${n}.group`,t+1,o);return;case"when":k(i,`${n}.when`,o),"show"in e?x(e.show,`${n}.show`,t+1,o):o.findings.push(l("view-when",n,'a condition says what it shows: {"when": expr, "show": [blocks]}'));return;case"figure":if(typeof i=="string")return Q(e,n,o);for(let s of["as","currency","label","emphasis"])s in e&&o.findings.push(l("unknown-key",`${n}.${s}`,`"${s}" belongs to a figure that works a number out; {"figure": true} is the kind's picture`,`write {"figure": "count(all('offer'))", "as": "number"}`));i!==!0?o.findings.push(l("view-block",`${n}.figure`,`a figure is a number worked out, {"figure": "sum(all('offer'), net)", "as": "money"}, or the kind's picture, {"figure": true}`)):o.spec.figure||o.findings.push(l("view-figure",`${n}.figure`,`${z(o)} has no figure to show`,o.kind===null?`work a number out: {"figure": "count(all('offer'))"}`:'give the kind a "figure", or leave this block out'));return;case"list":return ne(e,n,o);case"divider":i!==!0&&o.findings.push(l("view-block",`${n}.${r}`,`write {"${r}": true}`));return}}function Q(e,n,t){k(e.figure,`${n}.figure`,t),"as"in e&&!L.includes(e.as)&&t.findings.push(l("view-format",`${n}.as`,`"${String(e.as)}" is not a way to say a figure`,`use one of ${L.join(", ")}`)),W(e,n,t,"figure"),"label"in e&&A(e.label,`${n}.label`,t),"emphasis"in e&&!B.includes(e.emphasis)&&t.findings.push(l("view-emphasis",`${n}.emphasis`,`"${String(e.emphasis)}" is not how loudly a figure is said`,`use ${B.map(o=>`"${o}"`).join(", ")}, or leave it out for the figure's own size`))}function W(e,n,t,o){"currency"in e&&(typeof e.currency!="string"||!/^[A-Z]{3}$/.test(e.currency)?t.findings.push(l("view-currency",`${n}.currency`,'a currency is its three-letter code, like "USD" or "EUR"')):e.as!=="money"&&t.findings.push(l("view-currency",`${n}.currency`,`a currency belongs on a ${o} shown as money`,'add "as": "money"')))}function ee(e,n){let t=[...n.kinds],o=(d,r)=>{let i=new Set;for(let s of d){let f=n.vocabulary.namesOf(s)?.targets?.(r);if(f==="*")return t;for(let u of f??[])i.add(u)}return i.size>0?[...i]:void 0},a=d=>{switch(d.t){case"ident":return n.kind!==null&&n.spec.relation(d.name)?o([n.kind],d.name):void 0;case"member":{let r=a(d.object);return r?o(r,d.name):void 0}case"where":return a(d.set);case"call":{let r=d.args[0],i=r?.t==="lit"&&typeof r.value=="string"?r.value:void 0;if(d.fn==="all")return i!==void 0&&n.kinds.has(i)?[i]:void 0;let s=d.args.length===2&&d.args[1]?.t==="lit"&&typeof d.args[1].value=="string"?d.args[1].value:void 0;if(d.fn==="out"&&s!==void 0){let f=a(r);return f?o(f,s):void 0}if(d.fn==="out")return i!==void 0&&n.kind!==null?o([n.kind],i):void 0;if(d.fn==="in"){let f=s??i,u=s!==void 0?a(r):n.kind!==null?[n.kind]:void 0,c=f!==void 0?n.vocabulary.sources(f).filter(p=>{let y=n.vocabulary.namesOf(p)?.targets?.(f);return!u||y==="*"||u.some(h=>y?.includes(h))}):[];return c.length>0?c:void 0}if((d.fn==="sort"||d.fn==="first")&&r)return a(r);if(d.fn==="either"){let f=d.args.map(a);return f.every(u=>u!==void 0)?[...new Set(f.flatMap(u=>u??[]))]:void 0}return}default:return}};return a(e)}function K(e,n,t,o){let a;try{a=w(e)}catch(r){if(!(r instanceof b))throw r;o.findings.push(l("expression",n,`${r.sentence} (at character ${r.at+1})`));return}let d=O(a);for(let r of d.unknownFunctions)o.findings.push(l("unknown-function",n,`"${r}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let r of d.edges)o.edges.has(r)||o.findings.push(l("view-edge",n,`"${r}" is not a relation any kind declares`));if(t)for(let r of d.names)r==="id"||t.some(i=>o.vocabulary.namesOf(i)?.field(r)||o.vocabulary.namesOf(i)?.relation(r))||o.findings.push(l("view-name",n,`${t.join(" and ")} ${t.length===1?"has":"have"} no field or relation called "${r}"`))}function ne(e,n,t){let o=e.list;k(o,`${n}.list`,t);let a;if(typeof o=="string")try{a=ee(w(o),t)}catch{a=void 0}let d=i=>{if(!a)return[...t.kinds].map(f=>t.vocabulary.namesOf(f)?.choices?.(i)).find(f=>f!==void 0);let s=a.map(f=>t.vocabulary.namesOf(f)?.choices?.(i));return s.every(f=>f!==void 0)?[...new Set(s.flatMap(f=>f??[]))]:void 0},r=a?a.join(" and "):"any kind";if("sort"in e){let i=e.sort;if(typeof i=="string")K(i,`${n}.sort`,a,t);else if(g(i)&&typeof i.by=="string"&&Object.keys(i).every(s=>s==="by"||s==="direction")){let s=i.direction;s!==void 0&&s!=="asc"&&s!=="desc"&&s!=="choices"?t.findings.push(l("list-sort",`${n}.sort.direction`,`a list is sorted "asc", "desc" or "choices", not "${String(s)}"`,'"choices" puts a choice field in the order its choices are declared')):s==="choices"?d(i.by)===void 0&&t.findings.push(l("list-sort",`${n}.sort.by`,`"${i.by}" is not a choice field of ${r}, so it has no declared order`,'sort by a choice field, or say "asc" or "desc"')):K(i.by,`${n}.sort.by`,a,t)}else t.findings.push(l("list-sort",`${n}.sort`,'a sort is a key, like "net", or {"by": key, "direction": "asc" | "desc" | "choices"}'))}if("limit"in e){let i=e.limit;(typeof i!="number"||!Number.isInteger(i)||i<1||i>M)&&t.findings.push(l("list-limit",`${n}.limit`,`a limit is a whole number from 1 to ${M}`))}if("group"in e){let i=e.group,s=typeof i=="string"?i:g(i)&&typeof i.by=="string"?i.by:void 0;if(!(typeof i=="string"||g(i)&&Object.keys(i).every(u=>u==="by"||u==="headings"))||s===void 0)t.findings.push(l("list-group",`${n}.group`,'a group is a choice field, like "type", or {"by": "type", "headings": {"pain": "What hurts"}} \u2014 or a relation, like "inGenre", a heading per linked record'));else{let u=d(s),c=u===void 0?C(s):void 0,p=c!==void 0&&(c.way!==void 0?t.edges.has(c.edge):a?a.every(y=>t.vocabulary.namesOf(y)?.relation(c.edge)):t.edges.has(c.edge));if(u===void 0&&!p&&t.findings.push(l("list-group",`${n}.group`,`"${s}" is not a choice field or a relation of ${r}, so it has nothing to group by`,'group by a field whose type is enum, or by a relation of the kind listed, like "inGenre"')),g(i)&&"headings"in i){let y=i.headings;if(!g(y)||Object.values(y).some(h=>typeof h!="string"||h.length===0||h.length>80))t.findings.push(l("list-group",`${n}.group.headings`,'headings are words per choice, like {"pain": "What hurts"}, at most 80 characters each'));else if(u)for(let h of Object.keys(y))u.includes(h)||t.findings.push(l("list-group",`${n}.group.headings.${h}`,`"${h}" is not one of ${s}'s choices`,`use ${u.join(", ")}`))}}}"empty"in e&&(typeof e.empty!="string"||e.empty.length===0||e.empty.length>200)&&t.findings.push(l("list-empty",`${n}.empty`,"what an empty list says is a sentence, at most 200 characters")),"as"in e&&!U.includes(e.as)&&t.findings.push(l("list-as",`${n}.as`,`a list draws each record as its "card" or its "row", not "${String(e.as)}"`))}function ie(e,n,t){(typeof e!="string"||e.length===0||e.length>60)&&t.findings.push(l("view-label",n,"a label is a few words, at most 60 characters"))}function D(e,n,t,o,a,d,r){let i={kind:null,spec:Y,kinds:o,edges:a,vocabulary:t,findings:d,count:0,all:0};Array.isArray(e)&&e.length===0&&d.push(l("view-shape",n,`${r} has no blocks`,'give it one: {"headline": "\u2026"}')),x(e,n,1,i),P(i,n,r,"show less")}function P(e,n,t,o){e.count>T?e.findings.push(l("view-size",n,`${t} has ${e.count} blocks at its top; a view has at most ${T} there, a group or a condition counting as one`,`${o}, or gather some into a group`)):e.all>I&&e.findings.push(l("view-size",n,`${t} has ${e.all} blocks counting the ones inside its groups and conditions; a view has at most ${I} in all`,o))}function te(e,n,t,o,a){Array.isArray(e)&&e.forEach((d,r)=>{if(!g(d)||d.name!=="blocks"||!g(d.options)||!("blocks"in d.options))return;let i=[];D(d.options.blocks,`lenses.${r}.options.blocks`,n,t,o,i,`the lens "${String(d.title??r)}"`);for(let s of i)a.push({...s,severity:"warning"})})}function oe(e,n,t,o,a,d,r){let i=[];if(e===void 0)return i;if(!g(e))return i.push(l("view-shape",n,'views are an object of kinds, each with a "card", a "row" or a "page"')),i;for(let[s,f]of Object.entries(e)){if(s==="home"&&Array.isArray(f)){D(f,`${n}.home`,r,o,a,i,"the home");continue}let u=t(s);if(!u){i.push(l("view-kind",`${n}.${s}`,`"${s}" is not a kind this ${d} declares`));continue}if(!g(f)){i.push(l("view-shape",`${n}.${s}`,`a kind's views are {"card": [blocks], "row": [blocks], "page": [blocks]}`));continue}for(let c of Object.keys(f))E.includes(c)||i.push(l("view-slot",`${n}.${s}.${c}`,`"${c}" is not a place a view is drawn`,`use ${E.map(p=>`"${p}"`).join(", ")}`));for(let c of E){let p=f[c];if(p===void 0)continue;let y={kind:s,spec:u,kinds:o,edges:a,vocabulary:r,findings:i,count:0,all:0,slot:c};x(p,`${n}.${s}.${c}`,1,y),P(y,`${n}.${s}.${c}`,`this ${c}`,"show less, or move detail to the page")}}return i}function ge(e){let n=new Set(Object.keys(e.kinds)),t=new Set(Object.values(e.kinds).flatMap(r=>Object.keys($(r.edges)))),o=r=>{let i=m(e.kinds,r)?e.kinds[r]:void 0;return i?{field:s=>m(i.fields,s)||m(i.computed,s)||F(i.edges).has(s),relation:s=>m($(i.edges),s),figure:i.figure!==void 0,files:s=>m(i.fields,s)&&X(i.fields[s]),choices:s=>m(i.fields,s)&&i.fields[s].type==="enum"?i.fields[s].options:void 0,targets:s=>m($(i.edges),s)?i.edges[s].to:void 0,prose:s=>m(i.fields,s)&&i.fields[s].type==="text"}:void 0},a={namesOf:o,sources:r=>Object.keys(e.kinds).filter(i=>m(e.kinds[i].edges,r))},d=oe(e.views,"views",o,n,t,"document",a);return te(e.lenses,a,n,t,d),d}export{j as a,H as b,L as c,B as d,M as e,fe as f,C as g,ue as h,ce as i,ge as j};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk.MLRPCZVS.js";import"./chunk.G4JJXA63.js";import"./chunk.64IKLRUS.js";import"./chunk.DTSTUC2W.js";import"./chunk.USQNSNIA.js";import"./chunk.XOZU4OFA.js";import"./chunk.IT763BYH.js";import"./chunk.UQQAGT3R.js";import"./chunk.WVUJXDXZ.js";import"./chunk.T2RME6XF.js";import"./chunk.SOTB6C5A.js";import"./chunk.TQCRFZ53.js";import"./chunk.6HLKAUWF.js";import"./chunk.FCUDBMGC.js";import"./chunk.KMEKMCKG.js";import"./chunk.XJFAUOJS.js";import"./chunk.DPPT6WAJ.js";import"./chunk.7U2JO7ET.js";import"./chunk.YEJ4LNUP.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{i as draftAnswer,h as draftFromLens,b as draftSight,l as draftView,a as isDraftFailure,c as judgeLens,d as lensEditOf,f as lensFromSpec,j as recipeDraft,g as recipeOfLens,m as refineDraft,o as runDraftTool,e as takeBackEditOf,k as templateDraft,n as withReaderLenses};
@@ -1 +0,0 @@
1
- import{k as a,l as b,m as c,n as d,o as e,p as f,q as g,r as h,s as i}from"./chunk.4EY6WPSM.js";import"./chunk.BJUUSIQY.js";import"./chunk.RDL6652E.js";import"./chunk.V3NPUAPB.js";import"./chunk.USQNSNIA.js";import"./chunk.XOZU4OFA.js";import"./chunk.IT763BYH.js";import"./chunk.JZDKHWRL.js";import"./chunk.SOTB6C5A.js";import"./chunk.XJFAUOJS.js";import"./chunk.DPPT6WAJ.js";import"./chunk.7U2JO7ET.js";import"./chunk.HFVMGTNL.js";import"./chunk.7Z4USR3Y.js";import"./chunk.NPAWTPLQ.js";import"./chunk.SDO3U72B.js";import"./chunk.YEJ4LNUP.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{i as GhostTray,h as InlineAiMenu,g as askAgain,c as askInline,a as askOf,b as drawPanel,d as heldSuggestion,e as suggestOnce,f as takeOffer};
@@ -1,13 +0,0 @@
1
- import{a as _,b as C,c as I,d as j,e as P,f as F,g as T,i as M}from"./chunk.F5RN6YXG.js";import"./chunk.AJZBJBMO.js";var J=0,q=1,Q=2,Z=3,H=1,ee=2,B=3,te=1,ne=3,re=8,G="~",N=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),U=new Set(["input","select","textarea","option"]),oe=new Set(["value","checked","selected"]),V=["aria-label","aria-labelledby","title"],ie=r=>V.some(t=>(r.getAttribute(t)??"").trim()!=="");function W(r,t){let u=r.ownerDocument??r,p=t.maxNodes??5e3,g=[],m=new Map,w=new WeakMap,k={dom:r,name:"div",namespace:"html",children:[],id:G};m.set(G,k);let x=0,D=!1,O=new WeakMap,R=new Map,n=e=>{g.push(e),g.length>200&&g.shift(),t.onRefused?.(e)},a=()=>({dom:u.createComment(""),children:[],refused:!0}),f=(e,l)=>{if(e.namespace==="html"&&e.name&&U.has(e.name))return e.dom;if(l?.namespace==="html"&&l.name==="textarea")return l.dom},E=(e,l)=>{let d=e.dom,s=O.get(d)??d.getAttribute("role");if(s===null||!s.split(/\s+/).some(i=>_.includes(i.toLowerCase())))return void O.delete(d);if(ie(d)){O.delete(d),d.getAttribute("role")!==s&&d.setAttribute("role",s);return}O.set(d,s),d.removeAttribute("role"),l&&n({reason:"value",element:e.name,name:"role"})},b=(e,l,d,s=!0)=>{let i=e.dom;if(d!=null&&typeof d!="string")return n({reason:"value",element:e.name,name:l});let o=M(e.namespace,e.name,l,d??null,t);if("refused"in o){let S=M(e.namespace,e.name,l,null,t);return"refused"in S||i.removeAttribute(S.name),!("refused"in S)&&S.name==="role"&&O.delete(i),n(o.refused)}for(let S of o.dropped??[])n(S);let v=e.namespace==="html"&&oe.has(o.name)&&U.has(e.name),c=i,y=v?o.name==="value"?c.value:o.name==="checked"?c.checked:c.selected:void 0;o.name==="role"&&O.delete(i),o.value===null?i.removeAttribute(o.name):i.setAttribute(o.name,o.value),s&&(o.name==="role"||V.includes(o.name))&&E(e,o.name==="role"),t.onAttribute?.(i,o.name),v&&(o.name==="value"&&"value"in c?(c.value=o.value??"",y!==c.value&&t.onFieldSet?.(i)):o.name==="checked"&&"checked"in c?(c.checked=o.value!==null,y!==c.checked&&t.onFieldSet?.(i)):o.name==="selected"&&"selected"in c&&(c.selected=o.value!==null,y!==c.selected&&t.onFieldSet?.(i.parentElement?.closest("select")??i)))},h=e=>{if(!e.refused){x-=1,e.id!==void 0&&m.delete(e.id);for(let l of e.children)h(l)}},A=(e,l)=>{if(!N(e)||typeof e.id!="string"||m.has(e.id))return n({reason:"record"}),a();if(x>=p)return n({reason:"budget"}),D||(D=!0,t.onOverBudget?.()),a();let d=e.id;if(e.type===re)return a();if(e.type===ne){if(T(l.namespace,l.name))return n({reason:"child",element:l.name}),a();let c=u.createTextNode(String(e.data??"").slice(0,C)),y={dom:c,children:[],text:!0,id:d,parent:l};return m.set(d,y),w.set(c,d),x+=1,y}if(e.type!==te)return n({reason:"record"}),a();let s=String(e.element);if(T(l.namespace,l.name))return n({reason:"child",element:s}),a();let i=F(s,l.namespace);if("refused"in i)return n(i.refused),a();let o=u.createElementNS(i.namespace==="svg"?j:I,i.name);i.as&&o.setAttribute("data-graview-as",i.as),i.namespace==="html"&&i.name==="img"&&o.setAttribute("referrerpolicy","no-referrer"),i.namespace==="html"&&i.name==="a"&&(o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"),o.setAttribute("referrerpolicy","no-referrer"));let v={dom:o,name:i.name,namespace:i.namespace,children:[],id:d,parent:l};if(m.set(d,v),w.set(o,d),x+=1,N(e.attributes)){for(let[c,y]of Object.entries(e.attributes))b(v,c,y,!1);E(v,!0)}if(t.decorate?.(o,i.name,i.namespace),N(e.properties))for(let c of Object.keys(e.properties))n({reason:"attribute",element:i.name,name:c});if(N(e.eventListeners))for(let c of Object.keys(e.eventListeners))e.eventListeners[c]!=null&&n({reason:"attribute",element:i.name,name:`on${c}`});if(Array.isArray(e.children))for(let c of e.children){let y=A(c,v);v.children.push(y),o.appendChild(y.dom)}return v},L=e=>{if(!Array.isArray(e))return n({reason:"record"});let[l,d]=e,s=typeof d=="string"?m.get(d):void 0;if(!s)return n({reason:"record"});switch(l){case J:{if(s.text)return n({reason:"record"});let i=Number(e[3]),o=Number.isInteger(i)&&i>=0&&i<=s.children.length?i:s.children.length,v=e[2],c=N(v)&&typeof v.id=="string"?R.get(v.id):void 0,y;c&&c.parent?.namespace===s.namespace&&!T(s.namespace,s.name)?(R.delete(v.id),c.parent=s,y=c):y=A(v,s),s.dom.insertBefore(y.dom,s.children[o]?.dom??null),s.children.splice(o,0,y),s.namespace==="html"&&s.name==="textarea"&&t.onFieldSet?.(s.dom);return}case q:{let i=Number(e[2]),o=s.children[i];if(!o)return n({reason:"record"});s.children.splice(i,1),o.dom.parentNode?.removeChild(o.dom),o.id!==void 0&&!o.refused?R.set(o.id,o):h(o);return}case Q:{if(!s.text)return n({reason:"record"});s.dom.data=String(e[2]??"").slice(0,C);let i=f(s,s.parent);i&&t.onFieldSet?.(i);return}case Z:{if(s===k||s.text)return n({reason:"record"});let i=String(e[2]),o=e[4]??H;return o===ee?b(s,i,e[3]):n(o===H||o===B?{reason:"attribute",element:s.name,name:o===B?`on${i}`:i}:{reason:"record"})}default:return n({reason:"record"})}};return{apply(e,l){if(!Array.isArray(e))return n({reason:"record"}),!0;try{for(let d=0;d<e.length;d+=1){if(l&&d%32===0&&l())return!1;L(e[d])}return!0}finally{for(let d of R.values())h(d);R.clear()}},get refused(){return g},get size(){return x},idOf:e=>w.get(e),elementOf(e){let l=m.get(e);return l&&!l.text&&l!==k?l.dom:void 0},dispose(){for(let e of k.children)h(e);for(k.children.length=0;r.firstChild;)r.removeChild(r.firstChild)}}}var $=["https:","mailto:","tel:"];function K(r){if(!(typeof r!="string"||r.length>2e3||/[\s<>"]/.test(r.trim())||r.trim()!==r))try{let t=new URL(r);return!$.includes(t.protocol)||t.protocol==="https:"&&(t.hostname===""||t.username!==""||t.password!=="")?void 0:t.href}catch{return}}function ae(r){let t=new Set,u=p=>{if(typeof p!="string"||!/^(https|mailto|tel):/i.test(p))return;let g=K(p);g&&t.add(g)};for(let p of[...r?.node?[r.node]:[],...r?.nodes??[]])for(let[g,m]of Object.entries(p))g==="id"||g==="kind"||(Array.isArray(m)?m.forEach(u):u(m));return t}function z(r){return(r??[]).flatMap(t=>{try{let u=new URL(t);return u.protocol==="https:"&&u.hostname!==""&&u.username===""&&u.password===""?[u.origin]:[]}catch{return[]}})}function se(r,t){let u=K(r);if(u&&(t.handed.has(u)||u.startsWith("https:")&&z(t.origins).includes(new URL(u).origin)))return u}function de(r,t){let u=r.length>120?`${r.slice(0,119)}\u2026`:r,p="";try{p=new URL(r).protocol}catch{p=""}if(!$.includes(p))return`The link "${u}" was not drawn: a view links only to an https:, mailto: or tel: address.`;let g=z(t);return`The link "${u}" was not drawn: it is no address this view was handed. A view links out only to an address a record it was shown holds (a url field), as the record holds it${g.length>0?`, or an https: address on ${g.join(", ")}`:""}; a record or a place of this app is <a data-record> or <a data-place>.`}var le=`
2
- :host { display: block; position: relative; contain: layout paint style; isolation: isolate; overflow: clip; min-width: 0; }
3
- :host(:focus-within) { overflow-clip-margin: var(--graview-ring-reach, 4px); }
4
- [data-graview-view-root] { display: flow-root; color: var(--graview-ink, CanvasText); font-family: var(--graview-font-body, system-ui, sans-serif); line-height: 1.45; }
5
- :where([data-graview-view-root]) :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; text-align: inherit; appearance: none; cursor: pointer; }
6
- :where([data-graview-view-root]) :where(a[data-graview-link]) { color: inherit; text-decoration: none; }
7
- [data-graview-view-root] :is([data-graview-link], [data-graview-press]) { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: rgb(128 128 128 / 0.16); }
8
- [data-graview-view-root] :focus-visible { outline: max(2px, var(--graview-focus-width, 2px)) solid var(--graview-focus-color, var(--graview-accent, Highlight)) !important; outline-offset: var(--graview-focus-offset, 2px) !important; }
9
- [data-graview-view-root] [data-graview-ring-inside]:focus-visible { outline-offset: calc(-1 * max(2px, var(--graview-focus-width, 2px))) !important; }
10
- [data-graview-view-root] .graview-sr { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
11
- [data-graview-view-root] a[href]:not([data-graview-link])::after { content: " \u2197" !important; content: " \u2197" / " (opens in a new tab)" !important; }
12
- @layer graview-motion { @media (prefers-reduced-motion: reduce) { [data-graview-view-root] *, [data-graview-view-root] ::before, [data-graview-view-root] ::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-timeline: auto !important; transition-duration: 1ms !important; scroll-behavior: auto !important; } } }
13
- `,X=4,ce=16;function ue(r){let t=r.ownerDocument.defaultView?.getComputedStyle(r);if(!t)return X;let u=Number.parseFloat(t.outlineWidth)||0,p=Math.max(0,Number.parseFloat(t.outlineOffset)||0);return Math.min(ce,Math.max(X,Math.ceil(u+p)))}var fe=new Set(["Enter"," ","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]),Y=["click","input","change","keydown"];function we(r,t){let u=r.ownerDocument,p=u.createElement("style");p.setAttribute("data-graview-region",""),p.textContent=le;let g=u.createElement("style");g.setAttribute("data-graview-view-style","");let m=u.createElement("div");m.setAttribute("data-graview-view-root",""),r.append(p,g,m);let w=W(m,{origin:t.origin,...t.asset?{asset:t.asset}:{},...t.imageOrigins?{imageOrigins:t.imageOrigins}:{},...t.picture?{picture:t.picture}:{},...t.link?{link:t.link}:{},...t.onRefused?{onRefused:t.onRefused}:{},...t.maxNodes!==void 0?{maxNodes:t.maxNodes}:{},...t.onOverBudget?{onOverBudget:t.onOverBudget}:{},decorate:(n,a,f)=>{f==="html"&&a==="button"&&n.setAttribute("type","button"),f==="html"&&(a==="input"||a==="textarea"||a==="select")&&n.setAttribute("autocomplete","off"),t.decorate?.(n,a,f)},...t.onFieldSet?{onFieldSet:t.onFieldSet}:{},...t.onAttribute?{onAttribute:t.onAttribute}:{}}),k=[],x="",D=n=>{for(let a=n.composedPath()[0];a&&a!==m&&a!==r;a=a.parentNode)if(a.nodeType===1&&w.idOf(a)!==void 0)return a},O=n=>{let a=D(n);if(!a||n.type==="keydown"&&!fe.has(n.key))return;let f=t.before?.(n,a,m);if(f===!1)return;let E=a,b=a.namespaceURI==="http://www.w3.org/1999/xhtml"&&["input","select","textarea"].includes(a.localName);t.send({type:"dom-event",target:w.idOf(a),event:n.type,...b?{value:String(E.value??"")}:{},...b&&(E.type==="checkbox"||E.type==="radio")?{checked:E.checked}:{},...n.type==="keydown"?{key:n.key}:{},...f??{}});let h=n.type==="keydown"?n.key:void 0;(h==="Enter"||h===" ")&&a.hasAttribute("data-graview-press")&&n.composedPath()[0]===a&&(n.preventDefault(),t.send({type:"dom-event",target:w.idOf(a),event:"click"}))};for(let n of Y)r.addEventListener(n,O);r.addEventListener("toggle",O,!0);let R=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("overflow-clip-margin","4px");return r.addEventListener("focusin",n=>{let a=n.composedPath()[0],f=r.host;if(!a||a.nodeType!==1||!m.contains(a))return;let E=ue(a);if(R){f.style.setProperty("--graview-ring-reach",`${E}px`);return}let b=f.getBoundingClientRect(),h=a.getBoundingClientRect(),A=E*(f.offsetWidth>0?b.width/f.offsetWidth:1),L=h.left-b.left<A||b.right-h.right<A||h.top-b.top<A||b.bottom-h.bottom<A;a.toggleAttribute("data-graview-ring-inside",L)}),{apply(n,a){let f=r.activeElement,E=f?w.idOf(f):void 0,b=w.apply(n,a);if(E!==void 0&&r.activeElement!==f){let h=w.elementOf(E);h?.isConnected&&typeof h.focus=="function"&&h.focus({preventScroll:!0})}return b},style(n){let a=P(n);k.length=0;for(let f of a.refused)k.push({reason:"css",name:"stylesheet",css:f}),k.length>200&&k.shift();x=a.css,g.textContent=x},renderer:w,get refused(){return[...w.refused,...k]},get css(){return x},dispose(){for(let n of Y)r.removeEventListener(n,O);r.removeEventListener("toggle",O,!0),w.dispose(),r.replaceChildren()}}}export{le as REGION_CSS,we as createOpenDrawing,ae as handedLinks,se as judgeLink,de as linkRefusedWords,ue as ringReach};