graview 0.1.53 → 0.1.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/preview/chunk.25P5SDNR.js +1 -0
  2. package/dist/preview/chunk.27O4LIDU.js +1 -0
  3. package/dist/preview/{chunk.J6OT74RM.js → chunk.2DFWOLL2.js} +1 -1
  4. package/dist/preview/{chunk.H6EMDQP5.js → chunk.2LMB5E6N.js} +1 -1
  5. package/dist/preview/{chunk.E52UTLQ2.js → chunk.2WSRJGW2.js} +1 -1
  6. package/dist/preview/{chunk.3377DLPA.js → chunk.33YC5RCB.js} +1 -1
  7. package/dist/preview/chunk.3G5DEGFA.js +1 -0
  8. package/dist/preview/{chunk.MDIAWTNK.js → chunk.3IEJQAK7.js} +1 -1
  9. package/dist/preview/{chunk.W54NXXC5.js → chunk.3JMZHCB4.js} +1 -1
  10. package/dist/preview/chunk.3MZIWKNG.js +5 -0
  11. package/dist/preview/{chunk.KAKJYAHM.js → chunk.3SOJJAMY.js} +1 -1
  12. package/dist/preview/{chunk.VTCPA4V4.js → chunk.3V2WXZU3.js} +1 -1
  13. package/dist/preview/{chunk.RUTZEEBR.js → chunk.3ZONBC6L.js} +1 -1
  14. package/dist/preview/{chunk.CSA6SWTI.js → chunk.45HTFSWD.js} +1 -1
  15. package/dist/preview/{chunk.MKWVNW4Q.js → chunk.463PGKOL.js} +3 -3
  16. package/dist/preview/chunk.4BX3KLAA.js +1 -0
  17. package/dist/preview/{chunk.XBNASVTY.js → chunk.4F5M5XZG.js} +1 -1
  18. package/dist/preview/{chunk.UVMLX4US.js → chunk.4GHXAWIE.js} +1 -1
  19. package/dist/preview/{chunk.ULTYDYTS.js → chunk.4KTHJY5N.js} +2 -2
  20. package/dist/preview/{chunk.65F3DF5Q.js → chunk.4TGQ6Z6E.js} +1 -1
  21. package/dist/preview/{chunk.HDXDYS4C.js → chunk.4V64RBCK.js} +1 -1
  22. package/dist/preview/{chunk.P7FN3SFB.js → chunk.4WH4N4V7.js} +1 -1
  23. package/dist/preview/{chunk.BB5XKTVC.js → chunk.562IVJHX.js} +1 -1
  24. package/dist/preview/{chunk.OP3ZUI4W.js → chunk.57VTD3CU.js} +1 -1
  25. package/dist/preview/{chunk.LCG3VLCB.js → chunk.5C43AM3X.js} +1 -1
  26. package/dist/preview/chunk.5M62CMLA.js +1 -0
  27. package/dist/preview/{chunk.G226CUJQ.js → chunk.5RH6FO3K.js} +1 -1
  28. package/dist/preview/{chunk.KCM2VOC7.js → chunk.5VF2RT4H.js} +1 -1
  29. package/dist/preview/{chunk.5H3VCAPN.js → chunk.5XAIP3BS.js} +1 -1
  30. package/dist/preview/{chunk.MT45H2T5.js → chunk.5ZWE72VJ.js} +1 -1
  31. package/dist/preview/{chunk.S6TN3MLY.js → chunk.644FUGSX.js} +1 -1
  32. package/dist/preview/{chunk.I6W3IQ4W.js → chunk.6BBB7SJL.js} +1 -1
  33. package/dist/preview/chunk.6SPORDJC.js +1 -0
  34. package/dist/preview/{chunk.5XFRWXYQ.js → chunk.6TILXTP6.js} +1 -1
  35. package/dist/preview/{chunk.BPPDBPTL.js → chunk.7JCUSYS5.js} +1 -1
  36. package/dist/preview/{chunk.GZBODS7Z.js → chunk.7SCENHVG.js} +1 -1
  37. package/dist/preview/{chunk.NCTTPW7A.js → chunk.7TMWMW4W.js} +1 -1
  38. package/dist/preview/{chunk.FGJM4LJO.js → chunk.7UD2JR6J.js} +1 -1
  39. package/dist/preview/{chunk.IYVBJDR7.js → chunk.AG7CUSSV.js} +1 -1
  40. package/dist/preview/{chunk.PEA4D66Y.js → chunk.AKLVSZ5A.js} +1 -1
  41. package/dist/preview/{chunk.5K5D4IMM.js → chunk.AN5QCSVK.js} +1 -1
  42. package/dist/preview/{chunk.UQ4CASST.js → chunk.ARRLAAG6.js} +1 -1
  43. package/dist/preview/{chunk.Y4VOCJ7R.js → chunk.AZGXBTOQ.js} +1 -1
  44. package/dist/preview/{chunk.T56SOSIR.js → chunk.B2X6DA2Q.js} +1 -1
  45. package/dist/preview/{chunk.4SVAHPJA.js → chunk.B6PKKEY3.js} +1 -1
  46. package/dist/preview/{chunk.MSPRCR3Q.js → chunk.BOMYLOCX.js} +1 -1
  47. package/dist/preview/{chunk.QATG5HNV.js → chunk.BPWSQVEN.js} +1 -1
  48. package/dist/preview/{chunk.K7WME4P4.js → chunk.BUDEUNBN.js} +1 -1
  49. package/dist/preview/{chunk.CIUQWCU4.js → chunk.C3AHDHX7.js} +1 -1
  50. package/dist/preview/{chunk.TXEWSZGO.js → chunk.C6HBYRGJ.js} +1 -1
  51. package/dist/preview/{chunk.56UFDIX5.js → chunk.C6HI3LRB.js} +1 -1
  52. package/dist/preview/{chunk.ASCTAUFD.js → chunk.CB5DGKR5.js} +1 -1
  53. package/dist/preview/{chunk.VOHDRH3P.js → chunk.CB7IUKY7.js} +2 -2
  54. package/dist/preview/{chunk.JCJ7NTW4.js → chunk.COWJTVZV.js} +1 -1
  55. package/dist/preview/{chunk.CYP5KXIQ.js → chunk.D2PJG5N7.js} +1 -1
  56. package/dist/preview/chunk.D6ACCKYJ.js +1 -0
  57. package/dist/preview/{chunk.DQPEVPKQ.js → chunk.DF7IPT7V.js} +2 -2
  58. package/dist/preview/{chunk.VRJ4TULC.js → chunk.DTJ4FIHM.js} +1 -1
  59. package/dist/preview/chunk.DVG47BK3.js +1 -0
  60. package/dist/preview/{chunk.GANAZIRD.js → chunk.E5JX5LWY.js} +1 -1
  61. package/dist/preview/{chunk.EG2N5F6L.js → chunk.EC7I33WI.js} +1 -1
  62. package/dist/preview/{chunk.UYCPQ6IW.js → chunk.FCZ7UFJI.js} +1 -1
  63. package/dist/preview/{chunk.A2RQFAZ6.js → chunk.FMP6NDRZ.js} +1 -1
  64. package/dist/preview/{chunk.FJN4OGAS.js → chunk.FRZQSSGE.js} +2 -2
  65. package/dist/preview/{chunk.FBRARPGR.js → chunk.FWKNR7XF.js} +2 -2
  66. package/dist/preview/{chunk.G6DISMVT.js → chunk.FWZF7X6A.js} +2 -2
  67. package/dist/preview/{chunk.HBVURYWY.js → chunk.GHPCSNM6.js} +2 -2
  68. package/dist/preview/{chunk.CWPRQSED.js → chunk.GKLDSHHH.js} +1 -1
  69. package/dist/preview/{chunk.7NFCI4LH.js → chunk.GVUJCOKD.js} +2 -2
  70. package/dist/preview/chunk.HLDMTKUP.js +1 -0
  71. package/dist/preview/{chunk.OZYZBRWO.js → chunk.IDYPQ45A.js} +1 -1
  72. package/dist/preview/{chunk.LAOZEYYQ.js → chunk.IMHUKSPM.js} +2 -2
  73. package/dist/preview/{chunk.U4T4Y2MT.js → chunk.IYYP6QUH.js} +1 -1
  74. package/dist/preview/chunk.J2Z6WLCH.js +88 -0
  75. package/dist/preview/chunk.J3OX474P.js +1 -0
  76. package/dist/preview/chunk.JCFYZEMY.js +1 -0
  77. package/dist/preview/{chunk.7BXOQEUP.js → chunk.JLB4QP6Q.js} +1 -1
  78. package/dist/preview/{chunk.DUZS52WX.js → chunk.JTOAZ2IR.js} +1 -1
  79. package/dist/preview/chunk.JXGDVJ4N.js +1 -0
  80. package/dist/preview/{chunk.YI7WHBAD.js → chunk.K2J26XMB.js} +1 -1
  81. package/dist/preview/{chunk.OPKXCL5R.js → chunk.KI6M3EWZ.js} +1 -1
  82. package/dist/preview/{chunk.3FRVG6JW.js → chunk.KJGNLWU3.js} +2 -2
  83. package/dist/preview/chunk.KLJDBYAZ.js +1 -0
  84. package/dist/preview/{chunk.3FUFVVR4.js → chunk.KRVEAIKW.js} +1 -1
  85. package/dist/preview/{chunk.AQJD23AN.js → chunk.L7MFTL5S.js} +1 -1
  86. package/dist/preview/{chunk.VTRI2MT2.js → chunk.LNOWO3IY.js} +2 -2
  87. package/dist/preview/{chunk.NAEEPUWJ.js → chunk.LOUICR7K.js} +1 -1
  88. package/dist/preview/{chunk.WDEMPWS4.js → chunk.LU3B3SZH.js} +1 -1
  89. package/dist/preview/{chunk.6S3B4XC4.js → chunk.LVOL2LEC.js} +1 -1
  90. package/dist/preview/chunk.LYFEGG6E.js +1 -0
  91. package/dist/preview/{chunk.USAGE5C6.js → chunk.MAWP27FD.js} +1 -1
  92. package/dist/preview/chunk.MDWCX3YU.js +1 -0
  93. package/dist/preview/{chunk.HAIHXBVX.js → chunk.MNW2ZBQ6.js} +1 -1
  94. package/dist/preview/{chunk.GYO57LKD.js → chunk.MPMROUZA.js} +1 -1
  95. package/dist/preview/{chunk.CANTHIRO.js → chunk.MVRNEC3Y.js} +1 -1
  96. package/dist/preview/{chunk.JQTO52Q7.js → chunk.NDI5OWIB.js} +1 -1
  97. package/dist/preview/{chunk.ICYJ7QJG.js → chunk.NEJSKMJV.js} +1 -1
  98. package/dist/preview/{chunk.XFIZLWYA.js → chunk.NGWHV4G6.js} +1 -1
  99. package/dist/preview/{chunk.EZXGVTT2.js → chunk.OCV46AFN.js} +1 -1
  100. package/dist/preview/{chunk.ZYYM52N5.js → chunk.OLKFEHWB.js} +1 -1
  101. package/dist/preview/{chunk.TLQTDKOL.js → chunk.OZ4EJ5M6.js} +2 -2
  102. package/dist/preview/chunk.PCNEM3WE.js +1 -0
  103. package/dist/preview/{chunk.HIFLBWQJ.js → chunk.PR2TSHE7.js} +2 -2
  104. package/dist/preview/{chunk.2LQ37DC2.js → chunk.PZ4G5QA5.js} +1 -1
  105. package/dist/preview/{chunk.TTFYXKLI.js → chunk.PZWJUQAO.js} +1 -1
  106. package/dist/preview/{chunk.4DCPB67O.js → chunk.Q6RUTFU3.js} +1 -1
  107. package/dist/preview/{chunk.JRU5BT7K.js → chunk.QB7RYJ67.js} +2 -2
  108. package/dist/preview/{chunk.JKCLYLT4.js → chunk.R7RDUW37.js} +1 -1
  109. package/dist/preview/{chunk.RIS3OKAI.js → chunk.RBYRT2I2.js} +1 -1
  110. package/dist/preview/{chunk.Z4YSCHZT.js → chunk.RCFAHV5N.js} +1 -1
  111. package/dist/preview/{chunk.S2ATSY6P.js → chunk.RLO3RDYH.js} +1 -1
  112. package/dist/preview/chunk.RYMSHMLM.js +1 -0
  113. package/dist/preview/chunk.SDO3DD77.js +6 -0
  114. package/dist/preview/chunk.SF4BYBH6.js +25 -0
  115. package/dist/preview/chunk.SG7YVKH4.js +1 -0
  116. package/dist/preview/chunk.T42H5RXN.js +1 -0
  117. package/dist/preview/{chunk.72Q4R7N6.js → chunk.TUNHUTQ5.js} +1 -1
  118. package/dist/preview/{chunk.GPYZR6HE.js → chunk.U7GN6UPR.js} +1 -1
  119. package/dist/preview/{chunk.6CVW53WA.js → chunk.ULSN3ASK.js} +1 -1
  120. package/dist/preview/{chunk.BQHRZJ5Z.js → chunk.VFMC45E7.js} +1 -1
  121. package/dist/preview/{chunk.36XV4ZMC.js → chunk.VGOWGOGD.js} +2 -2
  122. package/dist/preview/{chunk.YA7ZMGOL.js → chunk.VTO6UWUP.js} +1 -1
  123. package/dist/preview/chunk.VW6X53E7.js +1 -0
  124. package/dist/preview/{chunk.HIDLE6BN.js → chunk.VWQ57LTT.js} +3 -3
  125. package/dist/preview/{chunk.6ESAZJBN.js → chunk.VYKEIKY5.js} +1 -1
  126. package/dist/preview/{chunk.XDEKL6TJ.js → chunk.W6NCLU5Y.js} +1 -1
  127. package/dist/preview/{chunk.GBIVIHGD.js → chunk.WHGEDJB2.js} +2 -2
  128. package/dist/preview/{chunk.FCAKLO5U.js → chunk.WICMCZ27.js} +1 -1
  129. package/dist/preview/{chunk.E647LWH5.js → chunk.WVWXNW74.js} +2 -2
  130. package/dist/preview/{chunk.5E4UGVAD.js → chunk.XBDFXFWM.js} +1 -1
  131. package/dist/preview/{chunk.KWMBRB6O.js → chunk.XTT6ERI3.js} +1 -1
  132. package/dist/preview/{chunk.R3DWF35R.js → chunk.XZJ6XX5I.js} +1 -1
  133. package/dist/preview/{chunk.OCWZJNZF.js → chunk.Y2DFDMT6.js} +1 -1
  134. package/dist/preview/{chunk.UXNZPPWR.js → chunk.Y36MLVMT.js} +1 -1
  135. package/dist/preview/{chunk.UQENE3VE.js → chunk.Y36WSKL5.js} +1 -1
  136. package/dist/preview/chunk.YXRKZMS5.js +1 -0
  137. package/dist/preview/{chunk.34Q7OKK3.js → chunk.Z6O7RUSR.js} +1 -1
  138. package/dist/preview/chunk.ZAGP3OKY.js +1 -0
  139. package/dist/preview/{chunk.N6A3DIOY.js → chunk.ZBHFCSKO.js} +1 -1
  140. package/dist/preview/{chunk.BG2SC77J.js → chunk.ZDDWXRPK.js} +1 -1
  141. package/dist/preview/{chunk.TRPPN2GD.js → chunk.ZUBC3UFG.js} +1 -1
  142. package/dist/preview/{chunk.LDLWYAHK.js → chunk.ZYW7Q5EN.js} +1 -1
  143. package/dist/preview/index.html +50 -51
  144. package/dist/preview/page.js +2 -2
  145. package/package.json +6 -6
  146. package/dist/preview/chunk.2IKVO743.js +0 -1
  147. package/dist/preview/chunk.3Y7BDRP3.js +0 -1
  148. package/dist/preview/chunk.4DFO43VM.js +0 -1
  149. package/dist/preview/chunk.4QVZXCV5.js +0 -1
  150. package/dist/preview/chunk.52Y37IAD.js +0 -1
  151. package/dist/preview/chunk.6W2DUW5S.js +0 -5
  152. package/dist/preview/chunk.7R6GXJS4.js +0 -6
  153. package/dist/preview/chunk.B3T4N2XM.js +0 -25
  154. package/dist/preview/chunk.D3A24PQ6.js +0 -1
  155. package/dist/preview/chunk.FXNUR5JI.js +0 -88
  156. package/dist/preview/chunk.GGHZEAAT.js +0 -1
  157. package/dist/preview/chunk.GZWC72HS.js +0 -1
  158. package/dist/preview/chunk.H2B3SEI7.js +0 -1
  159. package/dist/preview/chunk.HE545Z6I.js +0 -1
  160. package/dist/preview/chunk.I62MCBQM.js +0 -1
  161. package/dist/preview/chunk.I6SUHXJF.js +0 -1
  162. package/dist/preview/chunk.LEKML4S4.js +0 -1
  163. package/dist/preview/chunk.MXTDQXVW.js +0 -1
  164. package/dist/preview/chunk.OXLYDXQV.js +0 -1
  165. package/dist/preview/chunk.P2W727C7.js +0 -1
  166. package/dist/preview/chunk.PFXGWY3P.js +0 -1
  167. package/dist/preview/chunk.Q5JVKSEN.js +0 -1
  168. package/dist/preview/chunk.Q5WEOX3Q.js +0 -1
  169. package/dist/preview/chunk.SHNYYBNW.js +0 -1
  170. package/dist/preview/chunk.THL67D77.js +0 -1
  171. package/dist/preview/chunk.XXCT6DLX.js +0 -1
  172. package/dist/preview/chunk.ZJXUWOG3.js +0 -1
  173. package/dist/preview/chunk.ZQWKS6K5.js +0 -1
@@ -0,0 +1,88 @@
1
+ import{a as qe,c as Be}from"./chunk.2LMB5E6N.js";import{b as Ve}from"./chunk.KJGNLWU3.js";import{a as Ie,b as Ke,c as Fe,d as j}from"./chunk.GVUJCOKD.js";import"./chunk.3ZONBC6L.js";import{k as Me,l as Le}from"./chunk.FWKNR7XF.js";import"./chunk.MDWCX3YU.js";import"./chunk.CB5DGKR5.js";import"./chunk.GKLDSHHH.js";import{e as Ee}from"./chunk.OCV46AFN.js";import{m as Pe}from"./chunk.4KTHJY5N.js";import{a as Te,b as Oe}from"./chunk.PZ4G5QA5.js";import{h as $e}from"./chunk.Y36MLVMT.js";import{e as Re,f as De}from"./chunk.MPMROUZA.js";import"./chunk.HJCQ6I3S.js";import"./chunk.5C43AM3X.js";import{e as ne}from"./chunk.4WH4N4V7.js";import"./chunk.MVRNEC3Y.js";import{a as xe}from"./chunk.LOUICR7K.js";import"./chunk.L7MFTL5S.js";import"./chunk.XZJ6XX5I.js";import"./chunk.4F5M5XZG.js";import"./chunk.LVOL2LEC.js";import"./chunk.3G5DEGFA.js";import"./chunk.OZ4EJ5M6.js";import{a as Se,b as Ne,j as Ae}from"./chunk.SDO3DD77.js";import"./chunk.G4JJXA63.js";import"./chunk.BOMYLOCX.js";import"./chunk.45HTFSWD.js";import"./chunk.Q6RUTFU3.js";import"./chunk.AZGXBTOQ.js";import"./chunk.KRVEAIKW.js";import"./chunk.XOZU4OFA.js";import"./chunk.AG7CUSSV.js";import"./chunk.C6HBYRGJ.js";import"./chunk.WVUJXDXZ.js";import"./chunk.3V2WXZU3.js";import{a as ye}from"./chunk.7UD2JR6J.js";import"./chunk.BUDEUNBN.js";import"./chunk.3IEJQAK7.js";import"./chunk.AKLVSZ5A.js";import"./chunk.ZUBC3UFG.js";import"./chunk.GZHZLJBF.js";import{r as ke}from"./chunk.PZWJUQAO.js";import"./chunk.OJGHDWI6.js";import"./chunk.NEJSKMJV.js";import"./chunk.5ZWE72VJ.js";import{d as te,l as be}from"./chunk.RLO3RDYH.js";import{c as me}from"./chunk.TUNHUTQ5.js";import{o as J,z as Ce}from"./chunk.FWZF7X6A.js";import"./chunk.3JMZHCB4.js";import{G as tt,Na as ee,Oa as Y,T as we,W as ve,ba as V,da as X,j as ge,l as ue,m as fe,ma as he,r as U}from"./chunk.SF4BYBH6.js";import"./chunk.SDO3U72B.js";import{I as se,O as de,U as D,Wa as Z,da as G,ga as le,ia as pe,ka as ce}from"./chunk.3MZIWKNG.js";import"./chunk.SLBWPVIY.js";import{b as Q}from"./chunk.AJZBJBMO.js";var f=Q(tt(),1);var nt=300,it=14,z=50,at=3,ot=2;function _e(e,n,o){let p=e.tryDefinition(n)?.fields?.shape;return(p?.[o]===void 0?void 0:ye(p[o]))?.type}var rt=(e,n)=>Object.keys(e.tryDefinition(n)?.fields?.shape??{}),st=e=>e==="date"||e==="datetime",Ge=/^(due|dueOn|dueAt|dueDate|deadline|by)$/i,dt=/^(date|on|day|when|at|start|starts|startsOn|startsAt|begins|from|sown|scheduled|scheduledFor|planned|plannedFor)$/i,lt=/^(done|finished|complete|completed|closed)$/i;function ae(e,n){let o=e.tryDefinition(n),p=rt(e,n),a=p.filter(u=>st(_e(e,n,u)));if(a.length===0)return;let i=o?.fieldRoles??{},s=u=>i[u]!==void 0&&a.includes(i[u])?i[u]:void 0,c=s("start")??s("when")??a.find(u=>Ge.test(u))??a.find(u=>dt.test(u));if(!c)return;let S=s("end")??a.find(u=>u!==c&&/^(end|ends|until|to|finish|finished|harvested|through)$/i.test(u)),g=p.find(u=>lt.test(u)&&_e(e,n,u)==="boolean");return{field:c,due:Ge.test(c),...S?{end:S}:{},...g?{done:g}:{}}}function ie(e,n){return Math.round((Date.parse(`${n.slice(0,10)}T00:00:00Z`)-Date.parse(`${e.slice(0,10)}T00:00:00Z`))/864e5)}var q=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}/.test(e)?e.slice(0,10):void 0;function je(e,n,o,p){let a=ne(e,n);if(a&&o.length>0&&o.length<=nt)return{shape:"board",field:a.field};let i=ae(e,n);if(i&&!i.due){let s=r=>{let y=q(r[i.field]),h=q(Z(r,i.field,p));return y&&h?ie(y,h):0},c=o.map(r=>({from:q(Z(r,i.field,p)),to:i.end&&q(r[i.end])?L(q(r[i.end]),s(r)):void 0})).filter(r=>r.from!==void 0).map(r=>({from:r.from,to:r.to&&r.to>r.from?r.to:r.from})),S=`${p.slice(0,7)}-01`,g=L(`${L(S,31).slice(0,7)}-01`,-1),u=c.filter(r=>r.from<=g&&r.to>=S),w=c.map(r=>ie(r.from,r.to)).sort((r,y)=>r-y),l=w[Math.floor(w.length/2)]??0;if(u.length>0&&l<=it){let r=L(p,-((new Date(`${p}T00:00:00Z`).getUTCDay()+6)%7)),y=L(r,6),h=u.every(m=>m.from>=r&&m.to<=y);return{shape:"calendar",start:i.field,...i.end?{end:i.end}:{},...i.done?{done:i.done}:{},range:h?"week":"month"}}}return{shape:"table"}}function ze(e,n){let o=ae(e,n);return o?{by:o.field,direction:o.due?"asc":"desc"}:void 0}function He(e,n,o={}){switch(n.shape){case"board":return{lens:"columns",kind:e,column:n.field};case"calendar":return{lens:"calendar",kind:e,start:n.start,...n.end?{end:n.end}:{},...n.done?{done:n.done}:{},range:n.range};case"table":return{lens:"blocks",kind:e,as:"row",...o.group?.by?{group:o.group.by}:{},...o.sort?{sort:{by:o.sort.by,...o.sort.direction==="desc"?{direction:"desc"}:{}}}:{}}}}var pt=60;function We(e,n,o,p){let a=e.tryDefinition(n),i=o.slice(0,pt),s=new Map;i.forEach(w=>{let l=G(a,w);te(w,a,{glance:!0,said:[l]}).forEach((r,y)=>{if(r.long||r.files||r.app)return;let h=s.get(r.key);h?h.count++:s.set(r.key,{label:r.label,count:1,at:y})})});let c=Math.max(1,Math.ceil(i.length/3)),S=[...s.entries()].filter(([,w])=>w.count>=c).sort((w,l)=>w[1].at-l[1].at).slice(0,at).map(([w,l])=>({about:"field",key:w,label:l.label})),g=new Map;for(let w of i){let l=new Set;for(let[r,y]of[["out",p.outEdges(w.id)],["in",p.inEdges(w.id)]])for(let h of y){let m=p.getNode(r==="out"?h.to:h.from);if(!m||m.id===w.id)continue;let b=`${h.kind}|${r}`;if(l.has(b))continue;l.add(b);let A=g.get(b);A?A.count++:g.set(b,{edge:h.kind,direction:r,far:m.kind,count:1})}}let u=[...g.entries()].sort((w,l)=>l[1].count-w[1].count).slice(0,ot).map(([w,l])=>{let r=me(e,l.direction==="out"?n:l.far,l.edge,l.direction);return{about:"edge",key:w,label:r.charAt(0).toUpperCase()+r.slice(1),edge:l.edge,direction:l.direction}});return[...S,...u]}function Ze(e,n,o,p){if(o.about==="field"){let s=e.tryDefinition(n.kind);return{text:te(n,s,{excerpt:!0}).find(S=>S.key===o.key)?.value??""}}let i=(o.direction==="out"?p.outEdges(n.id):p.inEdges(n.id)).filter(s=>s.kind===o.edge).map(s=>p.getNode(o.direction==="out"?s.to:s.from)).filter(s=>s!==void 0).map(s=>G(e.tryDefinition(s.kind),s));return i.length===0?{text:""}:i.length===1?{text:i[0]}:{text:`${i[0]} +${i.length-1}`,title:i.join(", ")}}function Ue(e,n,o=()=>{}){let p=new Map;for(let a of e){let i=a.nodeIds.filter(c=>n.has(c));if(i.length===0&&!(a.subjectId!==void 0&&n.has(a.subjectId)))continue;let s=p.get(a.invariant)??{invariant:a.invariant,label:o(a.invariant)||a.label||a.message,violations:[],records:new Set};s.violations.push(a);for(let c of i)s.records.add(c);a.subjectId!==void 0&&n.has(a.subjectId)&&s.records.add(a.subjectId),p.set(a.invariant,s)}return[...p.values()].sort((a,i)=>i.violations.length-a.violations.length).map(a=>({invariant:a.invariant,label:a.label,violations:a.violations,records:[...a.records]}))}var Ye=6;function Je(e,n,o,p){let a=ae(e,n);if(!a)return;let i=ne(e,n),s=g=>{if(a.done!==void 0&&g[a.done]===!0)return!0;if(!i)return!1;let u=i.values.indexOf(String(g[i.field]));return u>=0&&i.tiers[u]==="done"},c=0,S=0;for(let g of o){let u=q(Z(g,a.field,p));if(!u||s(g))continue;let w=ie(p,u);a.due&&w<0?c++:w>=0&&w<=Ye&&S++}if(!(c===0&&S===0))return{field:a.field,due:a.due,overdue:c,soon:S}}function L(e,n){return new Date(Date.parse(`${e.slice(0,10)}T00:00:00Z`)+n*864e5).toISOString().slice(0,10)}function oe(e,n,o){return n==="overdue"?[{key:e.field,value:`before:${o}`}]:[{key:e.field,value:`after:${L(o,-1)}`},{key:e.field,value:`before:${L(o,Ye+1)}`}]}function Qe(e,n,o,p){let a=new Set,i=new Set;for(let s of e)if(!(s.at<=o))for(let c of s.primitives)c.op==="add-node"&&c.node?.kind===n?a.add(c.node.id):(c.op==="patch-node"||c.op==="splice-text")&&c.id!==void 0&&p(c.id)===n&&i.add(c.id);for(let s of a)i.delete(s);return{added:[...a].filter(s=>p(s)===n).length,changed:[...i].filter(s=>p(s)===n).length}}var t=Q(we(),1),Xe="as",ct=(e,n)=>`graview:kind-seen:${e}:${n}`;function gt(e){try{return localStorage.getItem(e)}catch{return null}}function ut(e,n){try{localStorage.setItem(e,n)}catch{}}var ft=(e,n)=>({...ge(fe(e,!1),n),relation:null});function Yt({kind:e,members:n,flagged:o=[],label:p,retired:a=0}){let{store:i,brand:s,principal:c,views:S,view:g}=V(),{go:u}=Y(),w=X(),l=i.schema,r=l.tryDefinition(e),y=p??pe(l,e),h=i.today()??se(),m=n,b=(0,f.useId)(),A=(0,f.useMemo)(()=>je(l,e,m,h),[l,e,m,h]),x=g.within?.[Xe]==="table"?{shape:"table"}:A,k=Te(g),C=x.shape==="table"&&!k.sort?ze(l,e):void 0,v=C?{...k,sort:C}:k,R=(0,f.useMemo)(()=>new Set(o),[o]),T=(0,f.useMemo)(()=>$e(m,v,{schema:l,graph:i.graph,flagged:R,today:h}),[m,v,l,i,R,h,w]),I=(0,f.useMemo)(()=>De(l,Re(l,e)),[l,e]),M=S.arrangement?.()?.lists?.[e]?.filters,K=$=>u(Oe(g,$)),B=(0,f.useMemo)(()=>({name:s?.name??"app",schema:l,...i.policy?{policy:i.policy}:{}}),[s,l,i]),H=JSON.stringify(He(e,x,v)),P=(0,f.useMemo)(()=>{let $=Ae(JSON.parse(H),{app:B,sight:Ne(B,c)});return Se($)?void 0:$},[H,B,c]),W=x.shape!=="table"&&P!==void 0;return(0,t.jsxs)("section",{"aria-labelledby":b,className:"graview-kind-stop","data-testid":"kind-stop","data-graview-kind-stop":e,"data-graview-shape":x.shape,children:[(0,t.jsx)("style",{children:St}),(0,t.jsx)(wt,{kind:e,plural:y,count:m.length,headingId:b,description:r?.description}),(0,t.jsx)(ht,{kind:e,plural:y,members:m,today:h,arrangement:v,onArrange:K}),(m.length>1||a>0)&&!W?(0,t.jsx)(Pe,{schema:l,graph:i.graph,kind:e,arrangement:v,onChange:K,offers:I,...M?{filters:M}:{},kept:{shown:T.nodes.length,of:m.length},testId:"kind-arrange",chips:{nodes:m,flagged:R,today:h},...a>0?{past:{count:a,widen:()=>u(Ee(g,!0))}}:{}}):null,m.length>0?(0,t.jsx)(yt,{derived:A,shape:x,draft:P}):null,(0,t.jsx)("div",{className:"graview-kind-stop-body","data-testid":"kind-stop-body",children:m.length===0?(0,t.jsx)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-empty",children:"Nothing here yet."}):W?(0,t.jsx)(kt,{draft:P,nodes:m}):T.nodes.length===0?(0,t.jsxs)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-none-kept",children:["None of the ",D(m.length)," ",y.toLowerCase()," ",v.query?`says \u201C${v.query}\u201D`:"is kept by these filters","."," ",(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link",onClick:()=>K({}),children:"Show them all"})]}):(0,t.jsx)(xt,{kind:e,nodes:T.nodes,groups:T.grouped?T.groups.map($=>({key:$.key,label:$.label,nodes:$.nodes})):void 0,flagged:R,plural:y,arrangement:v})})]})}function wt({kind:e,plural:n,count:o,headingId:p,description:a}){let{store:i,setSelection:s,setMenuAt:c}=V(),S=(0,f.useMemo)(()=>({about:[U(e)]}),[e]),{affordances:g}=Me(S),{apply:u,preview:w}=Le(),l=(0,f.useMemo)(()=>{let x=k=>i.allMutations().find(C=>C.name===k.mutation)?.creates?.includes(e)??!1;return g.find(k=>!k.destructive&&!k.setsAside&&x(k))},[g,i,e]),[r,y]=(0,f.useState)(!1),[h,m]=(0,f.useState)(null),b=(0,f.useRef)(null),A=(0,f.useRef)(null);(0,f.useEffect)(()=>{let x=A.current;!x||x.closest('[data-testid="kind-stop"]')?.contains(document.activeElement)||x.focus({preventScroll:!0})},[e]);let O=(x,k)=>{try{w(x,k),u(x,k),m(null),y(!1),requestAnimationFrame(()=>b.current?.focus())}catch(C){return m(be(i.schema,i.allMutations(),C)),[]}};return(0,t.jsxs)("header",{className:"graview-kind-stop-head",children:[(0,t.jsxs)("div",{className:"graview-kind-stop-title",children:[(0,t.jsx)("h2",{id:p,ref:A,tabIndex:-1,"data-testid":"kind-stop-title",children:n}),(0,t.jsxs)("p",{"data-testid":"kind-stop-count",children:[le(i.schema,e,o),a?` \xB7 ${a}`:""]})]}),(0,t.jsxs)("div",{className:"graview-kind-stop-acts",children:[l?(0,t.jsx)("button",{ref:b,type:"button",className:"graview-kind-stop-primary","data-testid":"kind-stop-primary","data-affordance":l.id,"aria-expanded":l.open.length>0?r:void 0,onClick:()=>{m(null),l.open.length===0?O(l):y(x=>!x)},children:l.label}):null,(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-quiet","data-testid":"kind-stop-acts","aria-haspopup":"menu","aria-label":`What can be done with the ${n.toLowerCase()}`,onClick:x=>{let k=x.currentTarget.getBoundingClientRect();s([U(e)]),c({x:Math.round(k.left),y:Math.round(k.bottom+4),on:U(e)})},children:"Acts\u2026"})]}),r&&l?(0,t.jsx)("div",{className:"graview-kind-stop-ask","data-testid":"kind-stop-ask","aria-label":l.label,role:"group",children:(0,t.jsx)(xe,{affordance:l,onApply:x=>O(l,x),onCancel:()=>{y(!1),b.current?.focus()}})}):null,h?(0,t.jsx)("p",{role:"alert",className:"graview-kind-stop-failed","data-testid":"kind-stop-failed",children:h}):null]})}var vt=J.part((e,n)=>(0,t.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"});function ht({kind:e,plural:n,members:o,today:p,arrangement:a,onArrange:i}){let{store:s,brand:c,setSelection:S}=V(),g=s.schema,u=ee(),w=(0,f.useMemo)(()=>new Set(o.map(v=>v.id)),[o]),l=(0,f.useMemo)(()=>Ue(u,w,v=>s.allInvariants().find(R=>R.name===v)?.label),[u,w,s]),r=(0,f.useMemo)(()=>Je(g,e,o,p),[g,e,o,p]),y=ct(Ce(c,g),e),[h]=(0,f.useState)(()=>gt(y));(0,f.useEffect)(()=>()=>ut(y,new Date().toISOString()),[y]);let m=X(),b=(0,f.useMemo)(()=>h?Qe(s.log.all(),e,h,v=>s.graph.getNode(v)?.kind):null,[h,s,e,m]),[A,O]=(0,f.useState)(null),x=v=>i({...a,filter:[...(a.filter??[]).filter(R=>!v?.some(T=>T.key===R.key)),...v??[]]}),k=l.reduce((v,R)=>v+R.violations.length,0),C=[];if(r&&(r.overdue>0||r.soon>0)){let v=r.field;C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-dates",children:[r.overdue>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact","data-tone":"warn",onClick:()=>x(oe(r,"overdue",p)),"aria-label":`${D(r.overdue)} overdue \u2014 show only these`,children:[D(r.overdue)," overdue"]}):null,r.soon>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact",onClick:()=>x(oe(r,"soon",p)),"aria-label":`${D(r.soon)} in the next 7 days \u2014 show only these`,children:[D(r.soon)," ",r.due?"due":""," in the next 7 days"]}):null,(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" by ",ce(g.tryDefinition(e),v).toLowerCase()]})]},"dates"))}if(l.length>0&&C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-problems","data-graview-problems":k,children:[(0,t.jsxs)("span",{className:"graview-kind-stop-warn",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0 "}),k===1?"1 problem":`${D(k)} problems`]}),(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" in ",n.toLowerCase(),":"]}),(0,t.jsx)("ul",{className:"graview-kind-stop-rules",children:l.map(v=>(0,t.jsx)(mt,{group:v,open:A===v.invariant,onToggle:()=>O(R=>R===v.invariant?null:v.invariant),onPick:R=>S([R])},v.invariant))}),(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-only-problems",onClick:()=>x([{key:"is",value:"flagged"}]),children:["Show only the ",n.toLowerCase()," with a problem"]})]},"problems")),b&&(b.added>0||b.changed>0)){let v=[b.added>0?`${D(b.added)} added`:"",b.changed>0?`${D(b.changed)} changed`:""].filter(Boolean);C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-since",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["Since you last looked (",de(h.slice(0,10)),"):"]})," ",v.join(", ")]},"since"))}return C.length===0?null:(0,t.jsx)("ul",{className:"graview-kind-stop-going-on","aria-label":`What is going on in the ${n.toLowerCase()}`,"data-testid":"kind-stop-going-on",children:C})}function mt({group:e,open:n,onToggle:o,onPick:p}){let a=(0,f.useId)();return(0,t.jsxs)("li",{"data-graview-rule":e.invariant,children:[(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-rule","aria-expanded":n,"aria-controls":a,onClick:o,onPointerEnter:J.prefetch,onFocus:J.prefetch,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"graview-kind-stop-chevron","data-open":n||void 0,children:"\u203A"}),e.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(e.violations.length)]})]}),n?(0,t.jsx)("ol",{id:a,className:"graview-kind-stop-problem-rows","data-testid":"kind-stop-problem-rows",children:(0,t.jsx)(f.Suspense,{fallback:null,children:(0,t.jsx)(vt,{violations:e.violations,pick:i=>{let s=i.subjectId??e.records[0]??i.nodeIds[0];s!==void 0&&p(s)}})})}):null]})}var bt={board:"Board",calendar:"Calendar",table:"Table"};function yt({derived:e,shape:n,draft:o}){let{view:p}=V(),{go:a}=Y(),{keep:i}=qe(Be()),[s,c]=(0,f.useState)(!1),S=e.shape==="table"?[]:[e.shape,"table"];return(0,t.jsxs)("div",{className:"graview-kind-stop-shape","data-testid":"kind-stop-shape",children:[S.length>0?(0,t.jsx)("span",{role:"group","aria-label":"Show as",className:"graview-kind-stop-switch",children:S.map(g=>(0,t.jsx)("button",{type:"button","aria-pressed":n.shape===g,"data-testid":`kind-stop-as-${g}`,onClick:()=>a(ue(p,Xe,g===e.shape?null:g)),children:bt[g]},g))}):null,(0,t.jsx)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-derived",children:o?`${o.said.replace(/\.$/,"")}, derived from the declaration`:"Derived from the declaration"}),o?(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-keep",disabled:s,title:`Keep \u201C${o.title}\u201D as a lens: a place of its own`,onClick:()=>{c(!0),i(o).finally(()=>c(!1))},children:"Keep as a lens"}):null]})}function kt({draft:e,nodes:n}){let o=Ve(e.drawn);return(0,t.jsx)("div",{className:"graview-kind-stop-lens","data-graview-draft":e.lens.name,children:(0,t.jsx)(ve,{mode:"scene",children:(0,t.jsx)(ke,{kind:e.kind,view:e.title,children:(0,t.jsx)(o,{nodes:n,label:e.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})})}function xt({kind:e,nodes:n,groups:o,flagged:p,plural:a,arrangement:i}){let{store:s,views:c,view:S,selection:g,setSelection:u,setMenuAt:w,principal:l}=V(),{go:r}=Y(),y=s.schema,h=s.graph,m=(0,f.useMemo)(()=>(o?o.flatMap(d=>d.nodes):n).map(d=>d.id),[n,o]),b=Ie(m),A=(0,f.useMemo)(()=>s.permittedMutations(l).some(d=>{let N=d.subject?.kinds;return N!==void 0&&(N==="*"||N.includes(e))}),[s,l,e]),O=(0,f.useRef)(null),x=d=>{b.choose(d),requestAnimationFrame(()=>{let N=b.list.current;((d[0]===void 0?null:N?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??N)?.focus({preventScroll:!0})})},k=b.chosen.length,C=c.lookup(e,{cardinality:"one",fidelity:"glyph"}),v=C!==void 0&&!he(C)?C:void 0,R=d=>g.includes(d),T=ee(),I=(0,f.useMemo)(()=>We(y,e,n,h),[y,e,n,h]),[M,K]=(0,f.useState)(z);(0,f.useEffect)(()=>K(z),[i.query,i.filter?.length,i.sort?.by,i.group?.by]);let B=y.tryDefinition(e),H=d=>T.filter(N=>N.nodeIds.includes(d)||N.subjectId===d).map(N=>N.message),P=i.sort?.by,W=`${a}${i.sort?`, in order of ${I.find(d=>d.key===P)?.label.toLowerCase()??P}`:""}`,$=M,et=d=>{let N=G(B,d),F=p.has(d.id)?H(d.id):[];return(0,t.jsxs)("tr",{"data-graview-pick":d.id,tabIndex:-1,"data-graview-record":d.id,"data-flagged":F.length>0||void 0,...A?{"data-graview-choose":d.id}:{},children:[A?(0,t.jsx)("td",{className:"graview-choose-at",children:(0,t.jsx)("input",{...b.boxProps(d.id,N),onPointerEnter:j,onFocus:j})}):null,(0,t.jsxs)("th",{scope:"row",className:"graview-kind-stop-name",children:[v?(0,t.jsx)("div",{"data-graview-pick":d.id,className:"graview-kind-stop-own-row",children:(0,t.jsx)(v,{node:d,cardinality:"one",fidelity:"glyph",mode:"scene",selected:R(d.id),...F.length>0?{flagged:[d.id]}:{}})}):(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-go",title:`Go to ${N}`,onClick:()=>r(ft(S,d.id)),children:N}),F.length>0?(0,t.jsxs)("span",{className:"graview-kind-stop-flag",title:F.join(" \xB7 "),children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0"}),(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:`Problem: ${F.join(". ")}`})]}):null]}),I.map(_=>{let E=Ze(y,d,_,h);return(0,t.jsx)("td",{"data-label":_.label,"data-short":E.text.length>0&&E.text.length<=14||void 0,"data-empty":E.text?void 0:"",...E.title?{title:E.title}:{},children:E.text?(0,t.jsx)("span",{children:E.text}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{"aria-hidden":"true",children:"\u2014"}),(0,t.jsx)("i",{className:"graview-kind-stop-hidden",children:"none"})]})},_.key)}),(0,t.jsx)("td",{className:"graview-kind-stop-row-acts",children:(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-acts","aria-haspopup":"menu","aria-label":`What can be done with ${N}`,onClick:_=>{let E=_.currentTarget.getBoundingClientRect();u([d.id]),w({x:Math.round(E.left),y:Math.round(E.bottom+4),on:d.id})},children:(0,t.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})})})]},d.id)},re=d=>{let N=d.slice(0,Math.max(0,$));return $-=N.length,N.map(et)};return(0,t.jsxs)("div",{className:"graview-kind-stop-table-at",...A?{...b.listProps,ref:d=>{O.current=d,b.list.current=d},tabIndex:-1,role:"group","aria-label":k>0?`${a}, ${k} chosen`:a,"data-graview-choosable":""}:{},children:[A?(0,t.jsx)("style",{children:Ke}):null,(0,t.jsxs)("table",{className:"graview-kind-stop-table","data-testid":"kind-stop-table",children:[(0,t.jsx)("caption",{className:"graview-kind-stop-hidden",children:W}),(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[A?(0,t.jsx)("td",{className:"graview-choose-at graview-choose-all",children:(0,t.jsx)("input",{type:"checkbox",className:"graview-choose-box","data-testid":"kind-stop-choose-all","aria-label":`Choose all ${D(n.length)} ${a.toLowerCase()}`,checked:k>0&&k===n.length,ref:d=>{d&&(d.indeterminate=k>0&&k<n.length)},onPointerEnter:j,onFocus:j,onChange:()=>k===n.length?b.clear():b.choose(m)})}):null,(0,t.jsx)("th",{scope:"col","aria-sort":P==="label"?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:"Name"}),I.map(d=>(0,t.jsx)("th",{scope:"col","aria-sort":d.about==="field"&&d.key===P?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:d.label},d.key)),(0,t.jsx)("th",{scope:"col",children:(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:"Acts"})})]})}),o?o.map(d=>$<=0?null:(0,t.jsxs)("tbody",{"data-graview-group":d.key,children:[(0,t.jsx)("tr",{className:"graview-kind-stop-group",children:(0,t.jsxs)("th",{scope:"rowgroup",colSpan:I.length+(A?3:2),children:[d.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(d.nodes.length)]})]})}),re(d.nodes)]},d.key||"-")):(0,t.jsx)("tbody",{children:re(n)})]}),A?(0,t.jsx)(Fe,{store:s,chosen:b.chosen,principal:l,anchor:()=>O.current?.closest('[data-testid="kind-stop"]')??null,of:m.length,onChooseAll:()=>b.choose(m),onClear:b.clear,onActed:x}):null,n.length>M?(0,t.jsxs)("p",{className:"graview-kind-stop-more",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-shown",children:[D(M)," of ",D(n.length)," shown"]})," ",(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-more",onClick:()=>K(d=>d+z),children:["Show ",D(Math.min(z,n.length-M))," more"]})]}):null]})}var St=`
2
+ .graview-kind-stop{container-type:inline-size;box-sizing:border-box;height:100%;min-height:0;display:flex;flex-direction:column;gap:10px;padding:16px 18px 12px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-panel);color:var(--graview-ink);box-shadow:var(--graview-lift-low);overflow:auto;overscroll-behavior:contain}
3
+ [data-graview-map-panel] .graview-kind-stop{height:auto;padding:4px 6px 12px;border:0;box-shadow:none;background:none;overflow:visible}
4
+ .graview-kind-stop :focus-visible{outline:2px solid var(--graview-accent);outline-offset:2px}
5
+ .graview-kind-stop button{font:inherit;cursor:pointer}
6
+ .graview-kind-stop :is(.graview-kind-stop-link,.graview-kind-stop-rule,.graview-kind-stop-name button,.graview-kind-stop-row-acts button,.graview-kind-stop-fact,.graview-kind-stop-switch button){box-shadow:none}
7
+ .graview-kind-stop-head{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px 16px}
8
+ .graview-kind-stop-title{flex:1 1 16rem;min-width:0}
9
+ .graview-kind-stop-title h2{margin:0;outline-offset:2px;font-size:var(--graview-text-heading);line-height:1.3;overflow-wrap:anywhere}
10
+ .graview-kind-stop-title p{margin:2px 0 0;font-size:.875rem;color:var(--graview-ink-muted);overflow-wrap:anywhere}
11
+ .graview-kind-stop-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
12
+ .graview-kind-stop-primary,.graview-kind-stop-quiet{min-height:32px;padding:0 14px;border-radius:8px;font-size:.875rem}
13
+ .graview-kind-stop-primary{border:1px solid var(--graview-accent);background:var(--graview-accent);color:var(--graview-accent-ink);font-weight:600}
14
+ .graview-kind-stop-quiet{border:1px solid var(--graview-edge);background:transparent;color:var(--graview-ink)}
15
+ .graview-kind-stop-ask{flex:1 1 100%;min-width:0;padding:10px 12px;border:1px solid var(--graview-edge);border-radius:10px}
16
+ .graview-kind-stop-failed{flex:1 1 100%;margin:0;font-size:var(--graview-text-small);color:var(--graview-warn)}
17
+ .graview-kind-stop-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
18
+ .graview-kind-stop-going-on{list-style:none;margin:0;padding:0;display:grid;gap:6px;font-size:.875rem}
19
+ .graview-kind-stop-going-on>li{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0}
20
+ .graview-kind-stop-fact{min-height:28px;padding:0 10px;border:1px solid var(--graview-edge);border-radius:999px;background:transparent;color:var(--graview-ink)}
21
+ .graview-kind-stop-fact[data-tone=warn],.graview-kind-stop-warn{color:var(--graview-warn);font-weight:600}
22
+ .graview-kind-stop-quiet-text{color:var(--graview-ink-muted)}
23
+ .graview-kind-stop-rules{list-style:none;margin:0;padding:0;flex:1 1 100%;display:grid;gap:2px}
24
+ .graview-kind-stop-rule{display:inline-flex;align-items:center;gap:6px;min-height:28px;max-width:100%;padding:0 6px;border:1px solid transparent;border-radius:7px;background:none;color:var(--graview-ink);text-align:left;overflow-wrap:anywhere}
25
+ .graview-kind-stop-rule:hover{border-color:var(--graview-edge)}
26
+ .graview-kind-stop-chevron{display:inline-block;width:.8em}
27
+ .graview-kind-stop-chevron[data-open]{transform:rotate(90deg)}
28
+ .graview-kind-stop-problem-rows{list-style:none;margin:2px 0 6px 18px;padding:0;max-width:44rem}
29
+ .graview-kind-stop-link{min-height:28px;padding:0 4px;border:0;background:none;color:var(--graview-accent);text-decoration:underline;text-underline-offset:2px}
30
+ .graview-kind-stop-link:disabled{opacity:.6;cursor:default}
31
+ .graview-kind-stop-shape{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;font-size:var(--graview-text-small)}
32
+ .graview-kind-stop-switch{display:inline-flex;border:1px solid var(--graview-edge);border-radius:8px;overflow:hidden}
33
+ .graview-kind-stop-switch button{min-height:28px;padding:0 12px;border:0;background:transparent;color:var(--graview-ink-muted)}
34
+ .graview-kind-stop-switch button+button{border-left:1px solid var(--graview-edge)}
35
+ .graview-kind-stop-switch button[aria-pressed=true]{background:color-mix(in srgb,var(--graview-accent) 16%,transparent);color:var(--graview-ink);font-weight:600}
36
+ .graview-kind-stop-body{flex:1 0 auto;min-width:0}
37
+ .graview-kind-stop-empty{margin:24px 0;color:var(--graview-ink-muted)}
38
+ .graview-kind-stop-lens{min-width:0}
39
+
40
+ .graview-kind-stop-table-at{min-width:0}
41
+ .graview-kind-stop-table{width:100%;border-collapse:collapse;font-size:.875rem}
42
+ .graview-kind-stop-table th,.graview-kind-stop-table td{padding:7px 8px;text-align:left;vertical-align:top;border-top:1px solid var(--graview-edge);overflow-wrap:break-word}
43
+ .graview-kind-stop-table td{color:var(--graview-ink)}
44
+ .graview-kind-stop-table td>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
45
+ .graview-kind-stop-table td[data-short]{white-space:nowrap;font-variant-numeric:tabular-nums}
46
+ .graview-kind-stop-table thead th{border-top:0;font-size:var(--graview-text-small);font-weight:600;letter-spacing:.04em;color:var(--graview-ink-muted)}
47
+ .graview-kind-stop-name{font-weight:500;min-width:8rem;max-width:22rem}
48
+ .graview-kind-stop-name button{display:inline-block;min-width:24px;min-height:24px;padding:0;border:0;background:none;color:var(--graview-ink);font-weight:500;text-align:left;text-decoration:underline;text-decoration-color:var(--graview-edge);text-underline-offset:3px}
49
+ .graview-kind-stop-name button:hover{text-decoration-color:currentColor}
50
+ .graview-kind-stop-own-row{display:inline-block;max-width:100%;cursor:pointer}
51
+ .graview-kind-stop-flag{margin-left:6px;color:var(--graview-warn)}
52
+ .graview-kind-stop-group th{padding-top:12px;font-weight:600;color:var(--graview-ink)}
53
+ .graview-kind-stop-row-acts{width:1%;white-space:nowrap;text-align:right}
54
+ .graview-kind-stop-row-acts button{min-width:32px;min-height:28px;border:1px solid var(--graview-edge-bright,var(--graview-edge));border-radius:7px;background:none;color:var(--graview-ink);font-size:1.125rem;font-weight:700;line-height:1}
55
+ .graview-kind-stop-row-acts button:hover{background:color-mix(in srgb,var(--graview-ink) 8%,transparent)}
56
+ .graview-kind-stop-table td[data-empty] b{font-weight:400;color:var(--graview-ink-faint)}
57
+ .graview-kind-stop-table tr[data-graview-pick]{cursor:default}
58
+ .graview-kind-stop-more{margin:10px 0 0;font-size:.875rem}
59
+ .graview-kind-stop-table-at[data-graview-choosable]{outline:none}
60
+ [data-graview-choosable]:hover .graview-choose-all .graview-choose-box{opacity:1}
61
+ .graview-kind-stop-table .graview-choose-at{width:1%;padding-right:0;vertical-align:middle}
62
+ @container (max-width: 559px){
63
+ .graview-kind-stop{padding:12px}
64
+ .graview-kind-stop-acts{flex:1 1 100%}
65
+ .graview-kind-stop-primary{flex:1 1 auto}
66
+ .graview-kind-stop-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
67
+ .graview-kind-stop-table,.graview-kind-stop-table tbody,.graview-kind-stop-table tr{display:block}
68
+ .graview-kind-stop-table tr{position:relative;padding:8px 40px 8px 0;border-top:1px solid var(--graview-edge)}
69
+ .graview-kind-stop-table th,.graview-kind-stop-table td{display:block;padding:1px 0;border:0}
70
+ .graview-kind-stop-table td>span{display:inline}
71
+ .graview-kind-stop-table td[data-short]{white-space:normal}
72
+ .graview-kind-stop-table td[data-label]::before{content:attr(data-label) " \xB7 ";color:var(--graview-ink-muted)}
73
+ .graview-kind-stop-row-acts{position:absolute;top:6px;right:0;width:auto}
74
+ .graview-kind-stop-table [data-graview-choose]{padding-left:34px}
75
+ .graview-kind-stop-table td.graview-choose-at{position:absolute;left:0;top:8px;width:auto;padding:0}
76
+ .graview-kind-stop-table thead .graview-choose-at{position:static}
77
+ }
78
+ @media (pointer: coarse){
79
+ .graview-kind-stop-table-at:not([data-graview-choosing]) .graview-choose-at{display:none}
80
+ .graview-kind-stop-table-at:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
81
+ }
82
+ @media (pointer: coarse){
83
+ .graview-kind-stop-primary,.graview-kind-stop-quiet,.graview-kind-stop-fact,.graview-kind-stop-rule,.graview-kind-stop-link,.graview-kind-stop-switch button,.graview-kind-stop-row-acts button{min-height:44px}
84
+ .graview-kind-stop-row-acts button{min-width:44px}
85
+ .graview-kind-stop-name button{min-height:44px}
86
+ }
87
+ @media (prefers-reduced-motion: reduce){.graview-kind-stop *{transition:none!important;animation:none!important}}
88
+ `;export{Yt as KindStop};
@@ -0,0 +1 @@
1
+ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{q as He}from"./chunk.MPMROUZA.js";import{d as Je,e as Ee,f as ze,g as je}from"./chunk.ZDDWXRPK.js";import{a as Ie}from"./chunk.Q6RUTFU3.js";import{e as X}from"./chunk.AG7CUSSV.js";import{a as j}from"./chunk.C6HBYRGJ.js";import{f as De,g as Y,i as Pe}from"./chunk.RLO3RDYH.js";import{a as Se}from"./chunk.TUNHUTQ5.js";import{$a as ke,Ba as K,Bb as ve,Da as he,Eb as Ae,Fa as ye,Fb as Oe,Ga as Z,Ib as Re,K as pe,Lb as Te,Na as ge,Oa as be,Ob as C,Ra as we,Wb as _e,Ya as W,a as fe,ea as G,ed as $e,kc as xe,lc as Me,mc as Ne,ya as me}from"./chunk.3MZIWKNG.js";var E=(t,e,n)=>{(t[e]===void 0||n>t[e])&&(t[e]=n)},z=(t,e,n)=>{(t[e]===void 0||n<t[e])&&(t[e]=n)},Q=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},Le=(t,e)=>{t.mime=t.mime?t.mime.filter(n=>e.includes(n)):[...e]},qe=(t,e)=>{t.multipleOf??=[],t.multipleOf.includes(e)||t.multipleOf.push(e)},Fe=(t,e)=>(t.patterns??=new Set).add(e),sn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function I(t){let e={},{def:n,bag:r}=t._zod,i=t._zod.traits.has("$ZodCheck")?[t,...n.checks??[]]:n.checks??[];for(let o of i){let a=o._zod.def;switch(a.check){case"greater_than":E(e,a.inclusive?"minimum":"exclusiveMinimum",a.value);break;case"less_than":z(e,a.inclusive?"maximum":"exclusiveMaximum",a.value);break;case"multiple_of":qe(e,a.value);break;case"number_format":{Q(e,a.format);let d=sn[a.format];d&&(E(e,"minimum",d[0]),z(e,"maximum",d[1]));break}case"bigint_format":Q(e,a.format);break;case"min_length":case"min_size":E(e,"minimum",a.minimum);break;case"max_length":case"max_size":z(e,"maximum",a.maximum);break;case"length_equals":E(e,"minimum",a.length),z(e,"maximum",a.length);break;case"size_equals":E(e,"minimum",a.size),z(e,"maximum",a.size);break;case"string_format":Q(e,a.format),a.pattern&&Fe(e,a.pattern),(a.format==="base64"||a.format==="base64url")&&(e.contentEncoding=a.format),(a.local||a.precision===-1)&&(e.laxFormat=!0);break;case"mime_type":Le(e,a.mime);break}}r.minimum!==void 0&&E(e,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&E(e,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&z(e,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&z(e,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&qe(e,r.multipleOf),r.format!==void 0&&(e.format??=r.format,r.format.includes("int")&&(e.isInt=!0)),r.mime&&Le(e,r.mime);for(let o of r.patterns??[])Fe(e,o);return e}var dn={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""};function L(t){let e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?L(e.out):e.type==="catch"?L(e.innerType):t._zod.optin}var cn=new Set(["promise","optional","nonoptional","nullable","readonly","default","prefault","catch"]);function _(t,e=new Set){if(e.has(t))return!1;e.add(t);let n=t._zod.def,r=n.type;return r==="transform"?!0:r==="array"?_(n.element,e):r==="set"?_(n.valueType,e):r==="lazy"?_(n.getter(),e):cn.has(r)?_(n.innerType,e):r==="intersection"?_(n.left,e)||_(n.right,e):r==="record"||r==="map"?_(n.keyType,e)||_(n.valueType,e):r==="pipe"?t._zod.traits.has("$ZodCodec")||_(n.in,e)||_(n.out,e):r==="object"?Object.values(n.shape).some(i=>_(i,e)):r==="union"?n.options.some(i=>_(i,e)):r==="tuple"?n.items.some(i=>_(i,e))||(n.rest?_(n.rest,e):!1):!1}function ln(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n])=>e.indexOf(+n)===-1).map(([,n])=>n)}function Be(t){let e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;let n=[];for(let r of e){if(!r||typeof r!="object")return;Be(r);let i=Object.keys(r);if(i.length!==1||i[0]!=="type")return;for(let o of[r.type].flat()){if(typeof o!="string")return;n.includes(o)||n.push(o)}}delete t.anyOf,t.type=n.length===1?n[0]:n}var Ue=new Set(["type","properties","required","additionalProperties"]),We=t=>{let e=t.additionalProperties;return e&&typeof e=="object"&&Object.keys(e).length?e:null},Ce=(t,e)=>JSON.stringify(t)===JSON.stringify(e);function ee(t){for(let i of t){if(typeof i!="object"||i.type!=="object")return null;for(let o in i)if(!Ue.has(o))return null}let e={},n=new Set;for(let i of t){for(let o in i.properties){if(Object.prototype.hasOwnProperty.call(e,o))continue;let a=[];for(let d of t){let s=d.properties?.[o]??We(d);s&&!a.some(y=>Ce(y,s))&&a.push(s)}e[o]=a.length===1?a[0]:ee(a)??{allOf:a}}for(let o of i.required??[])n.add(o)}let r={type:"object",properties:e};if(n.size&&(r.required=[...n]),t.every(i=>i.additionalProperties===!1))r.additionalProperties=!1;else{let i=[];for(let o of t){let a=We(o);a&&!i.some(d=>Ce(d,a))&&i.push(a)}i.length===1?r.additionalProperties=i[0]:i.length>1&&(r.additionalProperties={allOf:i})}return r}function un(t){let e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(let i of Ue)if(i in t)return;let n=e.filter(i=>Array.isArray(i.oneOf)||Array.isArray(i.anyOf)),r;if(!n.length)r=ee(e);else{let i=n[0],o=Array.isArray(i.oneOf)?"oneOf":"anyOf";if(Object.keys(i).length!==1)return;let a=e.filter(s=>s!==i),d=i[o].map(s=>ee([...a,s]));if(d.some(s=>!s))return;r={[o]:d}}r&&(delete t.allOf,Object.assign(t,r))}function Ve(t){let e=t;for(let S of["anyOf","oneOf"]){let T=e[S];if(!Array.isArray(T))continue;let O=T.map(Ve);O.some((v,h)=>v!==T[h])&&(e={...e,[S]:O})}let n=[e.type].flat(),r=!n.includes("string")&&n.some(S=>S==="number"||S==="integer"),i=e.enum??(e.const!==void 0?[e.const]:void 0);if(!r&&!i?.some(S=>typeof S=="number"))return e;let{minimum:o,maximum:a,exclusiveMinimum:d,exclusiveMaximum:s,multipleOf:y,format:p,id:b,...f}=e;return f.enum?f.enum=f.enum.map(S=>typeof S=="number"?String(S):S):typeof f.const=="number"&&(f.const=String(f.const)),r&&(f.type="string",i||(f.pattern=n.includes("number")?"^-?\\d+(?:\\.\\d+)?$":"^-?\\d+$")),f}var B=class{constructor(e,n){this.override=e;this.refs=n}done=new Map;path=[];cyclic=new Map;write(e,n=!1){let r=this.refs.get(e);if(r!==void 0&&!n)return{$ref:r};if(this.path.includes(e))return this.cyclic.has(e)||this.cyclic.set(e,""),{};let i=this.done.get(e);if(i)return i;this.path.push(e);try{let o=this.written(e);return this.done.set(e,o),o}finally{this.path.pop()}}written(e){let n={},r,i=e._zod.toJSONSchema?.();i?Object.assign(n,i):r=this.process(e,n);let o=fe.get(e);if(o)for(let d of Object.keys(o))n[d]=o[d];_(e)&&(delete n.examples,delete n.default),"_prefault"in n&&(n.default??=n._prefault,delete n._prefault);let a=n;if(r){let d=this.write(r);a={...n};for(let s of Object.keys(d))s in n||(a[s]=d[s])}return this.override({zodSchema:e,jsonSchema:a}),Be(a),e._zod.def.type==="intersection"&&un(a),a}process(e,n){let r=e._zod.def;switch(r.type){case"string":{n.type="string";let{minimum:i,maximum:o,format:a,patterns:d,contentEncoding:s,laxFormat:y}=I(e);if(typeof i=="number"&&(n.minLength=i),typeof o=="number"&&(n.maxLength=o),a&&(n.format=dn[a]??a,(n.format===""||a==="time"||y)&&delete n.format),s&&(n.contentEncoding=s),d&&d.size>0){let p=[...d];p.length===1?n.pattern=p[0].source:n.allOf=p.map(b=>({pattern:b.source}))}return}case"number":{let{minimum:i,maximum:o,multipleOf:a,exclusiveMinimum:d,exclusiveMaximum:s,isInt:y}=I(e);if(n.type=y?"integer":"number",typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY)?n.exclusiveMinimum=d:typeof i=="number"&&(n.minimum=i),typeof s=="number"&&s<=(o??Number.POSITIVE_INFINITY)?n.exclusiveMaximum=s:typeof o=="number"&&(n.maximum=o),a){let[p,...b]=new Set(a.filter(f=>Number.isFinite(f)&&f!==0).map(Math.abs));p!==void 0&&(n.multipleOf=p),b.length&&(n.allOf=[...n.allOf??[],...b.map(f=>({multipleOf:f}))])}return}case"boolean":case"success":n.type="boolean";return;case"null":n.type="null";return;case"never":n.not={};return;case"enum":{let i=ln(r.entries);i.length===0?n.not={}:(i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i);return}case"literal":{let i=r.values.filter(o=>o!==void 0).map(o=>typeof o=="bigint"?Number(o):o);if(r.values.length===0)n.not={};else if(i.length===1)n.type=i[0]===null?"null":typeof i[0],n.const=i[0];else if(i.length>1){for(let o of["number","string","boolean"])i.every(a=>typeof a===o)&&(n.type=o);i.every(o=>o===null)&&(n.type="null"),n.enum=i}return}case"template_literal":n.type="string",n.pattern=e._zod.pattern.source;return;case"file":{n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:i,maximum:o,mime:a}=I(e);i!==void 0&&(n.minLength=i),o!==void 0&&(n.maxLength=o),a&&(a.length===0?n.not={}:a.length===1?n.contentMediaType=a[0]:n.anyOf=a.map(d=>({contentMediaType:d})));return}case"array":{let{minimum:i,maximum:o}=I(e);typeof i=="number"&&(n.minItems=i),typeof o=="number"&&(n.maxItems=o),n.type="array",n.items=this.write(r.element);return}case"object":{let i=r.shape;n.type="object";let o={};n.properties=o;for(let d in i)Object.defineProperty(o,d,{value:this.write(i[d]),writable:!0,enumerable:!0,configurable:!0});let a=Object.keys(i).filter(d=>L(i[d])===void 0);a.length>0&&(n.required=a),r.catchall?._zod.def.type==="never"?n.additionalProperties=!1:r.catchall&&(n.additionalProperties=this.write(r.catchall));return}case"union":n[r.inclusive===!1?"oneOf":"anyOf"]=r.options.map(i=>this.write(i));return;case"intersection":{let i=d=>"allOf"in d&&Object.keys(d).length===1,o=this.write(r.left),a=this.write(r.right);n.allOf=[...i(o)?o.allOf:[o],...i(a)?a.allOf:[a]];return}case"tuple":{let i=r.items;n.type="array",n.prefixItems=i.map(s=>this.write(s)),r.rest?n.items=this.write(r.rest):n.items=!1;let o=i.length;for(;o>0&&L(i[o-1])!==void 0;)o-=1;o>0&&(n.minItems=o),r.rest||(n.maxItems=i.length);let{minimum:a,maximum:d}=I(e);typeof a=="number"&&(n.minItems=a),typeof d=="number"&&(n.maxItems=d);return}case"record":{let i=r.keyType;n.type="object";let o=I(i).patterns;if(r.mode==="loose"&&o&&o.size>0){let d=this.write(r.valueType),s={};for(let y of o)s[y.source]=d;n.patternProperties=s}else n.propertyNames=Ve(this.write(i)),n.additionalProperties=this.write(r.valueType);let a=i._zod.values;if(a&&!r.partial&&L(r.valueType)===void 0){let d=[...a].filter(s=>typeof s=="string"||typeof s=="number");d.length>0&&(n.required=d.map(String))}return}case"nullable":n.anyOf=[this.write(r.innerType),{type:"null"}];return;case"default":case"prefault":{let i=r.defaultValue,o,a=!1,d=JSON.stringify(i,(s,y)=>typeof y=="bigint"?(a=!0,null):y);return!a&&d!==void 0&&(o=JSON.parse(d)),a||(n[r.type==="default"?"default":"_prefault"]=o),r.innerType}case"catch":{try{n.default=r.catchValue(void 0)}catch{}return r.innerType}case"readonly":return n.readOnly=!0,r.innerType;case"pipe":return r.in._zod.traits.has("$ZodTransform")?r.out:r.in;case"lazy":return e._zod.innerType;case"optional":case"nonoptional":case"promise":return r.innerType;default:return}}};function Ge(t,e=()=>{}){let n=t,r=new B(e,new Map),i=r.write(n,!0);if(r.cyclic.size>0){let o=new Map,a=0,d=[];for(let y of r.cyclic.keys())if(y===n)o.set(y,"#");else{let p=`__schema${a++}`;o.set(y,`#/$defs/${p}`),d.push([y,p])}r=new B(e,o),i=r.write(n,!0);let s={};for(let[y,p]of d)s[p]=r.write(y,!0);d.length>0&&(i={...i,$defs:s})}return JSON.parse(JSON.stringify({$schema:"https://json-schema.org/draft/2020-12/schema",...i}))}function Ke(t){return Ge(t,mn)}var fn={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string"},pn={phone:"A phone number as it is written, like +1 555 123 4567 or 020 7946 0958 ext. 12.",place:"An address or a place's name, as a person would search a map for it.",duration:"A length of time in whole minutes: 90 is 1 h 30 min."};function mn(t){me(t.zodSchema)&&(t.jsonSchema["x-graview-app-link"]=!0);let e=ye(t.zodSchema);if(e&&(t.jsonSchema.type==="string"||t.jsonSchema.type==="array")){t.jsonSchema["x-graview-linked"]={address:e.address,kinds:[...e.kinds],cardinality:e.cardinality};let s=e.kinds.join(" or "),y=`${e.cardinality==="many"?"Records":"A record"}: a ${s} in the app ${e.address}, as "${e.kinds[0]}:<id>" \u2014 an id found there with find_linked. Linking never changes that app.`,p=t.jsonSchema.description;typeof p=="string"&&p.includes(y)||(t.jsonSchema.description=`${typeof p=="string"&&p?`${p.replace(/\.?$/,".")} `:""}${y}`)}if(we(t.zodSchema)&&(t.jsonSchema["x-graview-repeat"]=!0,!t.jsonSchema.type&&!t.jsonSchema.anyOf&&!t.jsonSchema.oneOf&&Object.assign(t.jsonSchema,hn())),Se(t.zodSchema)){t.jsonSchema.contentMediaType="text/markdown";let s=t.jsonSchema.description;typeof s=="string"&&s.endsWith("Written in Markdown.")||(t.jsonSchema.description=`${typeof s=="string"&&s?`${s.replace(/\.?$/,".")} `:""}Written in Markdown.`)}let n=Te(t.zodSchema);if(n){let s=t.jsonSchema;s["x-graview-type"]=n,n==="duration"&&(s["x-graview-unit"]="minutes"),s.description??=pn[n]}let r=Re(t.zodSchema,!1);if(r){let s=De(r);t.jsonSchema["x-graview-format"]=s.format??"unit",s.currency&&(t.jsonSchema["x-graview-currency"]=s.currency),s.unit&&s.format!=="money"&&(t.jsonSchema["x-graview-unit"]=s.unit);let y=t.jsonSchema.description;t.jsonSchema.description=typeof y=="string"&&y.length>0?`${y} ${Y(s)}`:Y(s)}let i=t.zodSchema._zod?.def;if(!i||i.type!=="string"||typeof i.format!="string"||i.format==="regex")return;let o=t.jsonSchema,a=(i.checks??[]).map(s=>s._zod?.def).filter(s=>s?.format==="regex"&&s.pattern instanceof RegExp).map(s=>s.pattern.source);delete o.pattern;let d=o.allOf;Array.isArray(d)&&d.every(s=>typeof s=="object"&&s!==null&&Object.keys(s).length===1&&"pattern"in s)&&delete o.allOf,o.format=fn[i.format]??i.format,a.length===1?o.pattern=a[0]:a.length>1&&(o.allOf=a.map(s=>({pattern:s})))}function ne(t,e){let n=C(t.input),r=Ke(t.input);if(e&&r.properties){let o=a=>e.includes(a)?e.indexOf(a):e.length;r.properties=Object.fromEntries(Object.entries(r.properties).sort(([a],[d])=>o(a)-o(d)))}let i=r.properties??{};if(Ae(t)){let o=t.creates.join(" | ");i.id={type:"string",minLength:1,description:`Optional: the id for the ${o} this makes. Refused if the graph already has it; left out, one is minted from the label.`},r.properties=i}Oe(t)&&(r.additionalProperties=!1);for(let o of n){let a=i[o.name];if(!a)continue;let d=o.kinds.includes("*")?"any node kind":o.kinds.join(" | ");a.description=[a.description,`Id of a node (${d}).`].filter(Boolean).join(" ")}return{name:t.name,...t.title===void 0?{}:{title:t.title},description:t.description??t.title??t.name,inputSchema:r,nodeRefs:n}}function hn(){let t={type:"string",pattern:"^\\d{4}-\\d{2}-\\d{2}$"},e=(n,r)=>({type:"integer",minimum:n,maximum:r});return{type:"object",description:'How the date beside it repeats; the date is the first occurrence. "on" is weekdays for "week", days of the month (-1 the last) for "month".',properties:{every:{type:"string",enum:[...be]},interval:e(1,99),on:{type:"array",minItems:1,maxItems:31,items:{anyOf:[{type:"string",enum:[...ge]},e(-1,31)]}},until:t,count:e(1,1e3),except:{type:"array",maxItems:500,items:t},continues:{type:"string",maxLength:200}},required:["every"],additionalProperties:!1}}function Ze(t){let e=new Set;for(let n=t;n;n=n.onBehalfOf)n.id!==void 0&&e.add(`${n.kind}:${n.id}`);return e}function U(t,e){let n=Ze(e),r=p=>{if(p.kind==="rule")return!1;let b=Ze(p);if(b.size===0)return!1;for(let f of b)if(n.has(f))return!1;return!0},i,o=()=>{if(i)return i;i=new Map;for(let p of t.log.live()){if(p.undoes!==void 0)continue;let b=r(p.author)?p.author:void 0;for(let f of p.primitives){f.op==="remove-node"&&i.delete(f.node.id);let S=f.op==="add-node"?f.node.id:f.op==="patch-node"||f.op==="splice-text"?f.id:void 0;if(S===void 0)continue;let T=f.op==="add-node"?Object.keys(f.node):f.op==="splice-text"?[f.field]:Object.keys(f.after),O=i.get(S);(f.op==="add-node"||!O)&&i.set(S,O=new Map);for(let v of T)v==="id"||v==="kind"||(b?O.set(v,b):O.delete(v))}}return i},a=t.schema,d=new Map,s=(p,b)=>{let f=`${p}\0${b}`,S=d.get(f);if(S===void 0){let T=a.tryDefinition(p)?.fields?.shape;S=T!==void 0&&b in T&&Pe(T[b]).type==="text",d.set(f,S)}return S},y=p=>t.graph.getNode(p)?.kind;return{prose:s,say:p=>W(p,{graph:t.graph,schema:a}),fieldBy(p,b){let f=y(p);if(!(f===void 0||!s(f,b)))return o().get(p)?.get(b)},recordBy(p){let b=y(p),f=o().get(p);if(b===void 0||!f)return;let S;for(let[T,O]of f)s(b,T)&&(S=O);return S}}}var te=(t,e,n)=>({untrusted:!0,authoredBy:n.say(e),text:t}),yn="the host's ranker";function Ye(t,e){return{...t,hits:t.hits.map(n=>{if(n.about!=="node")return n;n.why.by==="meaning"&&n.why.matched!==void 0&&(n={...n,why:{...n.why,matched:{untrusted:!0,authoredBy:yn,text:n.why.matched}}});let r=e.recordBy(n.id);if(!r)return n;let i=e.prose(n.kind,n.why.field)?e.fieldBy(n.id,n.why.field):r;return{...n,label:te(n.label,r,e),...n.apart!==void 0?{apart:te(n.apart,r,e)}:{},why:i?{...n.why,fragment:te(n.why.fragment,i,e)}:n.why}})}}var ie=(t,e,n)=>({title:t,readOnlyHint:e,destructiveHint:!1,idempotentHint:n,openWorldHint:!1}),gn={name:"subscribe",title:"Notify me when something happens",description:`Subscribe the person you act for to be told when something happens in this app \u2014 their host delivers it (an email, a push). on is one of: "act" (an act runs; give act, its declared name, and/or record), "created" (a record of kind is added), "changed" (a record of kind, or the one record, changes), "reaches" (a record of kind, or the one record, comes to satisfy condition, an expression in the app's rule language such as done == true or amount > 100). They are told only of changes someone else made, unless alsoMine is true, and only of records they may see. Returns the subscription and its sentence. Changes nothing in the app.`,inputSchema:{type:"object",properties:{on:{type:"string",enum:["act","created","changed","reaches"],description:"What to be told of."},act:{type:"string",description:"An act's declared name, for on: act."},kind:{type:"string",description:"A kind, for created, changed and reaches."},record:{type:"string",description:"One record, by id or name: for act, changed and reaches."},condition:{type:"string",description:"For reaches: what the record should come to satisfy, in the rule language (done == true)."},alsoMine:{type:"boolean",description:"Also when the person themselves made the change; false when unsaid."}},required:["on"],additionalProperties:!1},mutating:!1,annotations:ie("Notify me when something happens",!1,!1)},bn={name:"unsubscribe",title:"Stop notifying me",description:"Take away one of the person's subscriptions, by the id list_subscriptions or subscribe answered. Changes nothing in the app.",inputSchema:{type:"object",properties:{id:{type:"string",description:"The subscription's id."}},required:["id"],additionalProperties:!1},mutating:!1,annotations:ie("Stop notifying me",!1,!0)},wn={name:"list_subscriptions",title:"What I am notified of",description:`List what the person you act for is told of in this app: each subscription's id and its sentence ("When someone else adds a task").`,inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:ie("What I am notified of",!0,!0)},re=[gn,bn,wn];var F=t=>{let e;return()=>e??=t().catch(n=>{throw e=void 0,n})},Sn=F(()=>(__graviewPreload(import.meta.url,["./chunk.MVRNEC3Y.js","./chunk.45HTFSWD.js","./chunk.AG7CUSSV.js","./chunk.3V2WXZU3.js","./chunk.7UD2JR6J.js","./chunk.BUDEUNBN.js","./chunk.3IEJQAK7.js","./chunk.AKLVSZ5A.js","./chunk.ZUBC3UFG.js","./chunk.RLO3RDYH.js","./chunk.TUNHUTQ5.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.4BX3KLAA.js"))),kn=()=>(__graviewPreload(import.meta.url,["./chunk.C6HBYRGJ.js","./chunk.3IEJQAK7.js","./chunk.AKLVSZ5A.js","./chunk.ZUBC3UFG.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.4TGQ6Z6E.js")).catch(()=>{}),vn=async()=>{(await kn())?.judgeWithLines()},q=F(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.3V2WXZU3.js","./chunk.7UD2JR6J.js","./chunk.BUDEUNBN.js","./chunk.3IEJQAK7.js","./chunk.AKLVSZ5A.js","./chunk.ZUBC3UFG.js","./chunk.TUNHUTQ5.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.COWJTVZV.js"))),An=F(()=>(__graviewPreload(import.meta.url,["./chunk.SDO3DD77.js","./chunk.G4JJXA63.js","./chunk.BOMYLOCX.js","./chunk.45HTFSWD.js","./chunk.KRVEAIKW.js","./chunk.XOZU4OFA.js","./chunk.AG7CUSSV.js","./chunk.C6HBYRGJ.js","./chunk.WVUJXDXZ.js","./chunk.3V2WXZU3.js","./chunk.7UD2JR6J.js","./chunk.BUDEUNBN.js","./chunk.3IEJQAK7.js","./chunk.AKLVSZ5A.js","./chunk.ZUBC3UFG.js","./chunk.5ZWE72VJ.js","./chunk.RLO3RDYH.js","./chunk.TUNHUTQ5.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.5M62CMLA.js"))),On=F(()=>(__graviewPreload(import.meta.url,["./chunk.7SCENHVG.js","./chunk.MVRNEC3Y.js","./chunk.45HTFSWD.js","./chunk.Q6RUTFU3.js","./chunk.AZGXBTOQ.js","./chunk.AG7CUSSV.js","./chunk.3V2WXZU3.js","./chunk.7UD2JR6J.js","./chunk.BUDEUNBN.js","./chunk.3IEJQAK7.js","./chunk.AKLVSZ5A.js","./chunk.ZUBC3UFG.js","./chunk.5ZWE72VJ.js","./chunk.RLO3RDYH.js","./chunk.TUNHUTQ5.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.PCNEM3WE.js"))),Rn=F(()=>(__graviewPreload(import.meta.url,["./chunk.RBYRT2I2.js","./chunk.JTOAZ2IR.js","./chunk.3IEJQAK7.js","./chunk.AKLVSZ5A.js","./chunk.ZUBC3UFG.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.W6NCLU5Y.js"))),Tn=t=>t.definitions.some(e=>Z(e).size>0),Xe=t=>({value:K(t),label:t.label,...t.describe?{describe:t.describe}:{},...t.card?{card:t.card}:{},fields:t.fields,...t.app?{app:t.app}:{}});async function _n(t,e,n,r){let i=String(n.relation??""),[o,a]=i.includes(".")?i.split(".",2):[void 0,i],d=t.schema.definitions.flatMap(v=>[...Z(v)].map(([h,u])=>({kind:v.kind,name:h,relation:u}))),s=d.filter(v=>v.name===a&&(o===void 0||v.kind===o));if(s.length!==1){let v=d.map(h=>`${h.kind}.${h.name}`).join(", ")||"none";return{ok:!1,error:`${s.length===0?`No relation to another app is called "${i}"`:`"${i}" names a relation of several kinds`}. The relations to other apps are: ${v}.`}}let{kind:y,name:p,relation:b}=s[0];if(!r)return{ok:!1,error:`This seat cannot read ${b.address}: its host reads no other app's records. Nothing was changed.`};let f={kind:e.kind,...e.id===void 0?{}:{id:e.id},...e.roles?{roles:e.roles}:{}},S=typeof n.of=="string"?n.of:void 0;if(S!==void 0){let v=t.graph.getNode(S);if(!v||v.kind!==y)return{ok:!1,error:`No ${y} "${S}".`};let h=he(v[p],b),u=await Promise.all(h.map(w=>Promise.resolve().then(()=>r.resolve(w,f)).catch(()=>null)));return{ok:!0,data:{relation:`${y}.${p}`,app:b.address,records:u.map((w,k)=>w===null?{value:K(h[k]),missing:!0}:"denied"in w?{denied:!0,said:"linked record (no access)"}:Xe(w))},reads:[S]}}let T=typeof n.limit=="number"&&n.limit>0?Math.min(n.limit,20):20,O=await Promise.resolve().then(()=>r.find({address:b.address,kinds:b.kinds,query:String(n.query??""),limit:T},f)).catch(()=>[]);return Array.isArray(O)?{ok:!0,data:{relation:`${y}.${p}`,app:b.address,records:O.map(Xe),link:`edit-${y} with ${p} set to a record's value`}}:{ok:!0,data:{relation:`${y}.${p}`,app:b.address,denied:!0,said:"linked record (no access)"}}}var M=t=>({title:t,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}),Qe={description:'Which records: false (the default) the live ones, true only the archived ones, "all" both. An archived record is set aside, not gone: unarchive-<kind> brings it back.',anyOf:[{type:"boolean"},{type:"string",enum:["all"]}]},oe={type:"number",description:"Where the page starts; 0 when unsaid."},se=[{name:"search_graph",title:"Find by name",description:"Find things by name: records whose name or readable fields carry the words, and the kinds, places and rules the words name \u2014 each with why it matched. Reach for this before get_graph when you know what something is called. Words match the start of words, case and accents aside; key:value tokens narrow as a list's filter does (done:false, is:any for past records, kind:<kind>). Pass subject (a node id) to get the acts you may run on it as hits too. When few records match exactly, records with a near word follow \u2014 a typo, another form of the word, a meaning \u2014 each with near: true and why.matched, the record's own word that answered.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Words, with optional key:value conditions."},limit:{type:"number",description:"Most hits to return; at most 20."},subject:{type:"string",description:"A node id whose acts to include."},archived:Qe},required:["query"],additionalProperties:!1},mutating:!1,annotations:M("Find by name")},{name:"get_graph",title:"Read the graph",description:"Read the graph, 25 nodes a page: their fields, the edges out of them, and how many more. Start here when you need the shape of the domain rather than one thing in it.",inputSchema:{type:"object",properties:{offset:oe,archived:Qe},additionalProperties:!1},mutating:!1,annotations:M("Read the graph")},{name:"get_node",title:"Read one node",description:"Read one node: its fields, its links (id, kind and label, 20 each way a page), the violations that implicate it, and its computed values: read-only fields worked out from what you can see, which no act sets. Use this to check a thing before you change it.",inputSchema:{type:"object",properties:{id:{type:"string",description:"A node's id, or its name."},offset:oe},required:["id"],additionalProperties:!1},mutating:!1,annotations:M("Read one node")},{name:"get_violations",title:"List the problems",description:"List the invariant violations the graph currently has, 20 a page, with the repairs that would resolve each one. Read this before proposing work: a rule that is already broken is more urgent than anything you could add.",inputSchema:{type:"object",properties:{offset:oe,context:{type:"object",description:"Evaluation context, e.g. { weekStart }."}},additionalProperties:!1},mutating:!1,annotations:M("List the problems")},{name:"get_affordances",title:"Ask what can be done",description:"Ask what can legally be done with a selection, ranked. Prefer these over composing a mutation by hand: they are derived from the schema, the invariants and the shape of the graph, so they cannot name an action that does not exist.",inputSchema:{type:"object",properties:{selection:{type:"array",items:{type:"string"},description:"Node ids."},context:{type:"object"}},required:["selection"],additionalProperties:!1},mutating:!1,annotations:M("Ask what can be done")},{name:"describe_place",title:"Say what a place shows",description:`Say what one place of the app shows you, as a person in your seat would see it: its headings, its figures as drawn, its lists with each record's title and what its card or row says, the headings a list is grouped under, what an empty list says, the forms it offers (each field in the order asked, its label, whether it must be answered, what it takes and its choices), and any block that could not be worked out. Pass a place's slug ("home", a lens's address like "the-offers", a kind's like "offers"), a record's id, or a visitor form's "forms/<name>", and width 390 for a phone. Use it after a change to check what somebody now sees, instead of guessing.`,inputSchema:{type:"object",properties:{place:{type:"string",description:`"home", a place's slug, a record's id, or "forms/<name>" for a visitor form.`},width:{type:"number",description:"The screen's width in CSS pixels; 390 is a phone, 1440 when unsaid."}},required:["place"],additionalProperties:!1},mutating:!1,annotations:M("Say what a place shows")},{name:"preview_mutation",title:"Try an act without applying it",description:"Try a mutation without applying it: get back the diff it would produce and any invariant it would break. Do this when you are unsure, rather than applying and undoing.",inputSchema:{type:"object",properties:{mutation:{type:"string"},args:{type:"object"}},required:["mutation","args"],additionalProperties:!1},mutating:!1,annotations:M("Try an act without applying it")},{name:"undo_batch",title:"Undo a batch",description:"Undo one batch of operations. Fails, naming the blocking operation, when a later operation read what it wrote.",inputSchema:{type:"object",properties:{batch:{type:"string"},include:{type:"array",items:{type:"string"}}},required:["batch"],additionalProperties:!1},mutating:!0,annotations:{title:"Undo a batch",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},{name:"list_suggestions",title:"List what is suggested",description:"List the suggestions waiting for a person: changes the app's own actor proposed and did not make, each with its id, what it would do, who suggested it, what it was based on and how sure (0 to 1). Nothing changes until one is accepted (accept_suggestion) or declined (decline_suggestion); a declined one is never suggested again.",inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:M("List what is suggested")},{name:"accept_suggestion",title:"Accept a suggestion",description:"Make a waiting suggestion's change, as this seat, carrying what it was based on. Returns the batch (undo_batch takes it back).",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Accept a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}},{name:"decline_suggestion",title:"Decline a suggestion",description:"Decline a waiting suggestion: nothing changes, the decline is kept in the log, and the same change is never suggested or made by the app's own actor again.",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Decline a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}],nn={name:"act_on_several",title:"Do one act to several records",description:`Run one act on several records at once, as one change with one undo. act is the act (its tool name or its declared name), records the records it runs on (ids or names; each goes in the act's subject), args what every call shares ("Set stage to Declined" is args { stage: "declined" }). Each record is judged on its own: one this seat may not change is named with why, and the rest still apply. Returns the batch (undo_batch takes it all back), the records changed, those already so, and those refused.`,inputSchema:{type:"object",properties:{act:{type:"string",description:"The act to run on each record."},records:{type:"array",items:{type:"string"},minItems:1,maxItems:200,description:"Ids or names of the records."},args:{type:"object",description:"Arguments every call shares, besides the record."}},required:["act","records"],additionalProperties:!1},mutating:!0,annotations:{title:"Do one act to several records",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},ue={name:"suggest_changes",title:"Suggest changes",description:"Keep calls ({ act, args }) as one suggestion a person accepts or declines, with its basis and confidence (0 to 1). Changes nothing; a declined change is refused.",inputSchema:{type:"object",properties:{calls:{type:"array",items:{type:"object"}},basis:{type:"string"},confidence:{type:"number"}},required:["calls","basis"]},mutating:!0,annotations:{title:"Suggest changes",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},de={type:"object",description:"A lens, as draft_view returns one.",properties:{title:{type:"string"},lens:{type:"string"},on:{type:"string"},bindings:{type:"object"},options:{type:"object"}},required:["title","lens","on"]},ce={name:"draft_view",title:"Draw a view",description:'Draw a view of the data from words ("a board of tasks by status", "who covers what") as a lens the app could keep; or check a lens you wrote (lens); or change the one on screen (current, with ask: "only this month"). Returns the lens and its add-lens edit, or one sentence saying why not. Writes nothing.',inputSchema:{type:"object",properties:{ask:{type:"string",description:"What to see, in words."},lens:de,current:de},additionalProperties:!1},mutating:!1,annotations:M("Draw a view")},tn={name:"keep_lens",title:"Keep a view as a lens",description:"Keep a lens draft_view drew as one of the app's places: checked again, then written as the add-lens edit. Returns the remove-lens edit that takes it back.",inputSchema:{...de,additionalProperties:!1},mutating:!0,annotations:{title:"Keep a view as a lens",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},rn={name:"find_linked",title:"Find a record in another app",description:`A relation may go to a kind in another app (describe_app lists them under "Linked from other apps"). With relation and words, list the records there this seat may link \u2014 each with the value to link it by ("house:h1"), its name and its describe line. With of (a record id here), read the records that record links, as this seat may see them there. Linking one is the record's edit (edit-<kind>) with the relation set to the value. Another app this seat may not open answers denied, and nothing of it. Writes nothing; never changes the other app.`,inputSchema:{type:"object",properties:{relation:{type:"string",description:"The relation, by name (forHouse) or as <kind>.<relation> (scenario.forHouse)."},query:{type:"string",description:"Words to find by, in the other app's names; empty for the first few."},of:{type:"string",description:"A record here whose linked records to read, instead of finding."},limit:{type:"number",description:"Most records to return; at most 20."}},required:["relation"],additionalProperties:!1},mutating:!1,annotations:M("Find a record in another app")};function xn(t,e){return t===void 0?[]:t==="keep"&&!e?[ce,tn]:[ce]}var Mn="An argument that names a record takes its id or its name.",on=[...se.map(t=>t.name),nn.name,ue.name,ce.name,tn.name,rn.name,...re.map(t=>t.name)],an=64;function N(t){let{line:e,...n}=t;return n}function en(t){return{...t,...t.introduces?{introduces:t.introduces.map(N)}:{},...t.resolves?{resolves:t.resolves.map(N)}:{},...t.violationsAfter?{violationsAfter:t.violationsAfter.map(N)}:{}}}function Nn(t){let e=t.normalize("NFKD").replace(/\p{M}/gu,"").replace(/[^A-Za-z0-9_-]/g,"_");return e.length===0&&(e="act"),/^[A-Za-z_]/.test(e)||(e=`act_${e}`),e.slice(0,an)}function $n(t){let e=new Set(on),n=new Map;for(let r of t){let i=Nn(r),o=i;for(let a=2;e.has(o);a+=1)o=`${i.slice(0,an-`_${a}`.length)}_${a}`;e.add(o),n.set(r,o)}return n}function Dn(t,e){if(e.size===0)return t;let n=Object.fromEntries(Object.entries(t.properties??{}).filter(([i])=>!e.has(i))),r=(t.required??[]).filter(i=>!e.has(i));return{...t,properties:n,...t.required?{required:r}:{}}}function Pn(t,e,n,r){let i=ne(t,_e(r,t)),o=G(t),a=i.nodeRefs.length>0?`${i.description}${/[.!?]$/.test(i.description)?"":"."} ${Mn}`:i.description;return{name:e,title:o,description:a,inputSchema:Dn(i.inputSchema,n),mutating:!0,annotations:{title:o,readOnlyHint:!1,destructiveHint:t.destructive===!0||(t.severs?.length??0)>0,idempotentHint:t.idempotent===!0,openWorldHint:!1},act:t.name}}function le(t){if(t===null||typeof t!="object")return JSON.stringify(t)??"null";if(Array.isArray(t))return`[${t.map(le).join(",")}]`;let e=t;return`{${Object.keys(e).filter(n=>e[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${le(e[n])}`).join(",")}}`}function Jn(t){return`sha256:${$e(le(t))}`}function En(t,e,n,r,i,o=!1,a=!1,d=!1,s){let y=$n(t.map(f=>f.name)),p=[...xn(r,n),...o?[rn]:[],...a?re:[]];return{definitions:n?[...se.filter(f=>!f.mutating),...p]:[...se,nn,...d?[ue]:[],...p,...t.filter(f=>e.has(f.name)).map(f=>Pn(f,y.get(f.name),i(f),s))],names:y}}function At(t,e={}){let n=e.author??{kind:"agent"},r=t.allMutations(),i=new Set(t.permittedMutations(n).map(h=>h.name)),{definitions:o,names:a}=En(r,i,e.readOnly===!0,e.drafts?e.drafts.keep?"keep":"draw":void 0,h=>X(t.schema,t.policy,n,h),Tn(t.schema),e.subscriptions!==void 0,Ne(n),t.schema),d=Jn(o),s={app:e.app?.brand?.locale,appTimeZone:e.app?.brand?.timeZone},y=h=>pe(s,h),p=h=>{if(!on.includes(h)){for(let[u,w]of a)if(w===h)return u;return a.has(h)?h:xe(h,a.keys())}},b=h=>{let u=Me(h,a.keys());return u?` Did you mean "${u}"?`:""},f=h=>{let u=o.find(k=>k.name===h)??o.find(k=>k.act===h);if(u)return u;let w=p(h);return w===void 0?void 0:o.find(k=>k.act===w)},S=(h,u)=>{let w=r.find(c=>c.name===h);if(!w)return{args:u,resolved:[]};let k={...u},l=[];for(let c of C(w.input)){let m=k[c.name];if(typeof m!="string"||m.trim()==="")continue;let g=t.resolveRef(c,m,n);if(!g.ok){let A=g.reason==="none"?` Nothing was changed. Use search_graph to look it up, then pass its id as ${c.name}.`:" Nothing was changed.";return{ok:!1,error:`${g.message}${A}`,argument:c.name,candidates:g.candidates}}g.by!=="id"&&(k[c.name]=g.id,l.push({argument:c.name,given:m,id:g.id,label:g.label}))}return{args:k,resolved:l}},T=async(h,u)=>{try{await vn();let w=f(h);if(!w&&h===ue.name)return{ok:!1,error:"Only the app's own actor (automated: true) suggests changes.",reason:"forbidden"};if(!w){let l=p(h);if(l){let c=t.permits({name:l,args:u},n);if(!c.ok)return{ok:!1,error:c.refusal.message,reason:"forbidden"}}return{ok:!1,error:`Unknown tool "${h}".${b(h)} Available: ${o.map(c=>c.name).join(", ")}`}}if(w.mutating&&e.readOnly)return{ok:!1,error:`"${h}" changes the graph, and this seat is read-only.`,reason:"forbidden"};if(w.act!==void 0){let l=S(w.act,u);if("ok"in l)return l;let c=w.act,m=y(()=>j(t,n,t.apply({name:c,args:l.args},{...e.author?{author:e.author}:{},...V(e.via)})));return{ok:!0,data:{batch:m.batch,intent:m.intent,introduces:m.introduces.map(N),resolves:m.resolves.map(N),...l.resolved.length>0?{resolved:l.resolved}:{}},diff:m.diff}}let k=t.seenBy(n);switch(w.name){case"search_graph":{let l=typeof e.places=="function"?e.places():e.places,c=typeof u.subject=="string"?u.subject:void 0,m=He(k,String(u.query??""),{principal:n,rank:e.near,archived:ke(u.archived),limit:typeof u.limit=="number"&&u.limit>0?Math.min(u.limit,20):20,...l?{places:l}:{},...c?{subject:c,from:[c]}:{}}),g=m.later?await m.later:m;return{ok:!0,data:(await q()).searchRead(g,Ye(g,U(k,n))),reads:g.hits.flatMap(A=>A.about==="node"?[A.id]:[])}}case"get_graph":return{ok:!0,...(await q()).graphRead(k,U(k,n),u)};case"get_node":{let l=String(u.id??""),c=l,m;if(!k.graph.getNode(l)){let A=l.trim()===""?void 0:t.resolveRef({name:"id",kinds:["*"]},l,n);if(A?.ok)c=A.id,m={argument:"id",given:l,id:c,label:A.label};else return A?.reason==="ambiguous"?{ok:!1,error:A.message,argument:"id",candidates:A.candidates}:{ok:!1,error:`No node "${l}".`}}let g=(await q()).nodeRead(k,U(k,n),c,u);return{ok:!0,data:m?{...g.data,resolved:[m]}:g.data,reads:g.reads}}case"describe_place":{let l=e.app??{name:"",schema:t.schema},c=typeof u.width=="number"&&Number.isFinite(u.width)&&u.width>0?u.width:1440,{describePlace:m}=await Sn(),g=m(t,n,String(u.place??""),{app:l,width:c});if(!g.ok)return{ok:!1,error:`${g.error} The places are: ${g.places.join(", ")}.`};let A=new Set,$=H=>{for(let P of H)for(let x of P.groups??[])for(let D of x.items)A.add(D.id),$(D.parts)};return $(g.description.parts),{ok:!0,data:g.description,reads:[...A]}}case"find_linked":return _n(k,n,u,e.linked);case"draft_view":case"keep_lens":{let l=e.app??{name:"",schema:t.schema};return(await An()).runDraftTool(w.name,u,{app:l,principal:n,...e.drafts?{drafts:e.drafts}:{}})}case"get_violations":{let l=k.violations(u.context);return{ok:!0,...(await q()).violationsRead(l,u)}}case"get_affordances":{let l=u.selection??[];return{ok:!0,data:Ie(k,l,{...typeof e.derive=="function"?e.derive():e.derive,...e.author?{principal:e.author}:{},...u.context?{context:u.context}:{}}),reads:l.filter(m=>k.graph.has(m))}}case"preview_mutation":{let l=String(u.mutation),c=p(l)??l,m=S(c,u.args??{});if("ok"in m)return m;let g=t.missingFor({name:c,args:m.args},n);if(g)return{ok:!1,error:g.message,reason:"missing"};let A=j(t,n,t.preview({name:c,args:m.args},void 0,{author:n})),$=en(A);return{ok:!0,data:m.resolved.length>0?{...$,resolved:m.resolved}:$}}case"act_on_several":{let l=String(u.act??""),c=p(l)??l,m=r.find(R=>R.name===c);if(!m||!i.has(c)){let R=m?t.permits({name:c,args:{}},n):void 0;return R&&!R.ok?{ok:!1,error:R.refusal.message,reason:"forbidden"}:{ok:!1,error:`There is no act "${l}" this seat may run.${b(l)} Nothing was changed.`,reason:"invalid"}}let g=m.subject;if(!g)return{ok:!1,error:`"${G(m)}" does not act on a record, so it cannot be run on several. Nothing was changed.`,reason:"invalid"};let A=Array.isArray(u.records)?u.records.filter(R=>typeof R=="string"&&R.trim()!==""):[];if(A.length===0)return{ok:!1,error:"Name at least one record. Nothing was changed.",reason:"invalid"};let $=[],H=[];for(let R of A.slice(0,200)){let J=t.resolveRef({name:g.arg,kinds:g.kinds},R,n);if(!J.ok)return{ok:!1,error:`${J.message} Nothing was changed.`,argument:"records",candidates:J.candidates};$.push(J.id),J.by!=="id"&&H.push({argument:"records",given:R,id:J.id,label:J.label})}let P=S(c,{...u.args??{}});if("ok"in P)return P;let x=(await On()).actOnSeveral(t,{mutation:c,subject:g.arg,args:P.args},$,{author:n,...V(e.via)}),D=x.result?j(t,n,x.result):void 0;return{ok:!0,data:{...x.batch?{batch:x.batch,intent:x.intent}:{},applied:x.applied,unchanged:x.unchanged,refused:x.refused.map(R=>({record:R.id,label:R.label,error:R.message,reason:R.reason})),...x.allOrNothing?{keptNone:!0}:{},...D?{introduces:D.introduces.map(N),resolves:D.resolves.map(N)}:{},...H.length>0||P.resolved.length>0?{resolved:[...H,...P.resolved]}:{}},...D?{diff:D.diff}:{}}}case"subscribe":case"unsubscribe":case"list_subscriptions":{let l=await(await Rn()).runSubscriptionTool(w.name,u,{store:t,principal:e.subscriber??n,app:e.app?.name??"app",subscriptions:e.subscriptions});return l.ok?{ok:!0,data:l.data}:{ok:!1,error:l.error}}case"list_suggestions":{let l=Ee(t,n).map(c=>{let m=W(c.author,{graph:k.graph,schema:t.schema});return{id:c.id,intent:c.intent,by:m,at:c.at,about:c.about,...c.lineage?{basis:{untrusted:!0,authoredBy:m,text:c.lineage.basis},...c.lineage.confidence!==void 0?{confidence:c.lineage.confidence}:{}}:{}}});return{ok:!0,data:{suggestions:l},reads:[...new Set(l.flatMap(c=>c.about))]}}case"suggest_changes":{let l=u.calls.map(m=>({name:p(m.act)??m.act,args:m.args}));return{ok:!0,data:{suggestion:Je(t,l,{author:n,lineage:{basis:u.basis,confidence:u.confidence},...V(e.via)})?.id??null}}}case"accept_suggestion":case"decline_suggestion":{let l=String(u.suggestion??""),c={author:n,...V(e.via)},m=w.name==="accept_suggestion"?ze(t,l,c):je(t,l,c),g=j(t,n,m);return{ok:!0,data:{batch:g.batch,intent:g.intent,introduces:g.introduces.map(N),resolves:g.resolves.map(N)},diff:g.diff}}case"undo_batch":{let l=String(u.batch),c=u.include??[],m=k.canUndo([l,...c]);if(!m.ok)return{ok:!1,error:m.message};let g=j(t,n,t.undo([l,...c],{...e.author?{author:e.author}:{}}));return{ok:!0,data:en(g),diff:g.diff}}default:return{ok:!1,error:`Unknown tool "${h}".`}}}catch(w){let{reason:k,wouldNeed:l}=ve(w);return{ok:!1,error:w instanceof Error?w.message:String(w),reason:k,...l?{wouldNeed:l}:{}}}},O=new Set,v=h=>{for(let u of O)u(h)};return{definitions:o,hash:d,...e.author?{author:e.author}:{},onDiff(h){return t.subscribe(h)},onCall(h){return O.add(h),()=>O.delete(h)},async call(h,u){let w=f(h)?.mutating??!1,k={name:h,args:u,mutating:w,at:new Date().toISOString()};v({...k,phase:"running"});let l=m=>(v(m.ok?{...k,phase:"ok",...!w&&m.reads?{reads:m.reads}:{}}:{...k,phase:"failed",error:m.error}),m),c=await T(h,u);return l(c.ok&&!w?{...c,data:(await q()).withinReadChars(h,c.data)}:c)}}}function V(t){let e=typeof t=="function"?t():t;return e?{via:e}:{}}export{le as a,At as b};
@@ -0,0 +1 @@
1
+ import{b as dn,c as cn,d as re,e as ln,f as oe,h as ze,i as Ae,n as fn,r as ie}from"./chunk.ZUBC3UFG.js";import{Ab as U,B as ue,C as te,Ca as Ue,Db as nn,Ea as We,F as ke,Fc as an,Gc as Oe,H as Ve,Hb as tn,Hc as sn,I as Ie,Ia as we,Ic as Re,Ja as ve,Mb as rn,Pa as Je,Sa as Ye,b as Ge,ba as qe,bb as Qe,c as Pe,d as Me,db as Xe,e as K,fa as Be,g as ce,h as F,i as Le,ib as xe,j as Fe,jb as en,k as le,l as Ne,la as _e,m as Ce,o as Ze,p as fe,q as he,uc as on,v as Ke,wa as be,x as ne,z as pe,za as He}from"./chunk.3MZIWKNG.js";function pn(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let a=e,n=v=>typeof a[v]=="string"?a[v]:void 0,t=n("light")??n("src");if(t===void 0)return;let[o,l,m]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...o!==void 0?{dark:o}:{},...l!==void 0?{alt:l}:{},...m!==void 0?{darkFallback:m}:{}}}function Fn(e,a){let n=e.brand??{},t=n.ground,o=n.accent?Re(n.accent,t):void 0;t&&sn(o?.ok?o.schemes:Oe(t),n.accent)&&(a.push(Ae("brand","brand.ground","words would not read on that page background, so the app keeps Graview's","pick a lighter ground for the light scheme, a darker one for the dark")),t=void 0,o=n.accent?Re(n.accent):void 0),o&&!o.ok&&a.push(Ae("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${o.why}`,"pick a color further from orange-red, or a darker one"));let l=pn(n.logo),m=n.name??e.name,v=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,j])=>typeof j=="string"&&!/url\(|@import|[;{}<>\\]/i.test(j)).map(([j,D])=>[j,an(D)])):void 0;return{name:m,schemes:o?.ok?o.schemes:t?Oe(t):on,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...l?{logo:l.dark||l.darkFallback==="invert"?{light:l.light,...l.dark?{dark:l.dark}:{darkFallback:"invert"}}:l.light,logoAlt:l.alt??m}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...n.subtitle===!1?{subtitleDrawn:!1}:{},...v?{typography:v}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function un(e){let{currency:a,locale:n,timeZone:t}=e.brand??{};return{...a?{currency:a}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var xn=Symbol.for("@graview/core:typed-field"),mn=(e,a)=>(/^(phone|place|duration)$/.test(a)&&(te(e)[xn]=a),e),gn=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function yn(e){let a=F().check(K(300),pe(t=>Ue(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?a:fe(a).check(K(200));return We(e.description?n.check(ue(e.description)):n,e)}var Rn=new WeakMap;function hn(e,a){Rn.set(e,a)}var zn=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function kn(e,a=zn){if(!V(e))return{document:e,respelled:[]};let n=[],t=e;for(let o of a)t=Se(t,o.where.split("."),o,"",n);return{document:t,respelled:n}}function Se(e,a,n,t,o){if(a.length===0){if(!V(e)||!Object.hasOwn(e,n.was))return e;o.push(`${t}${n.was}`);let{[n.was]:G,...N}=e;return Object.hasOwn(e,n.now)?N:{...N,[n.now]:G}}if(!V(e))return e;let[l,...m]=a,v=l.endsWith("[]"),j=v?l.slice(0,-2):l,D=e[j],B=D;if(!v)B=Se(D,m,n,`${t}${j}.`,o);else if(Array.isArray(D)){let G=D.map((N,W)=>Se(N,m,n,`${t}${j}.${W}.`,o));B=G.some((N,W)=>N!==D[W])?G:D}return B===D?e:{...e,[j]:B}}var bn="graview-compiled@1";function An(e,a){return e.find(([n,t])=>n!==q&&"ref"in t&&(t.ref==="*"||t.ref.includes(a)))?.[0]}var q="id",me=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function wn(e){let a=Object.entries(e.fields),n=t=>["name","title","label"].find(o=>t.some(([l])=>l===o))??t[0]?.[0];return n(a.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(a.filter(([,t])=>t.type==="string"))}function vn(e,a,n){let t;switch(e.type){case"string":case"place":t=F().check(K(500));break;case"phone":t=F().check(K(40),ce(gn,"a phone number"));break;case"text":t=F().check(K(2e4)),e.format&&(te(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let l=e.min??(e.type==="duration"?0:void 0),m=[...e.type==="number"?[]:[Ne()],...l===void 0?[]:[Pe(l)],...e.max===void 0?[]:[Ge(e.max)],...e.step===void 0?[]:[Me(e.step)]];t=m.length>0?le().check(...m):le();break}case"boolean":t=Ce();break;case"date":t=F().check(ce(ke,"a date like 2026-10-02"));break;case"datetime":t=F().check(pe(Ve,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Ke(e.options);break;case"list":t=fe(e.of==="number"?le():e.of==="date"?F().check(ce(ke)):e.of==="image"||e.of==="video"||e.of==="file"?be(e.of):F().check(K(500))).check(K(200));break;case"image":case"video":case"file":t=be(e.type);break;case"app-link":t=He();break;case"url":t=Fe();break;case"email":t=Le();break}let o=e.type==="number"||e.type==="integer";return mn(t,o&&e.format==="duration"?"duration":e.type),e.collaborative!==void 0&&(e.type==="text"||e.type==="string")&&(te(t)[Symbol.for("@graview/core:collaborative")]=e.collaborative?1:0),e.description&&(t=t.check(ue(e.description))),o&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&tn(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),a?ne(t):t}var ae=e=>{throw new U(`there is no record "${e}"`,"invalid")},Sn=(e,a)=>"field"in e?vn(e.field,e.optional,a):"ref"in e?rn(e.ref):ne(Ze()),En=new WeakMap;var Ee=(e,a)=>V(a)&&Object.keys(e??{}).length===Object.keys(a).length&&Object.keys(e??{}).every(n=>Object.hasOwn(a,n));function dt(e,a={}){let n=V(e)?e.format:void 0;if(n!==bn)return{ok:!1,findings:[ze("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${bn}`,"compile the document instead")]};let t=e,o=kn(t.document).document,l=o===t.document?t:{...t,document:o},m=V(o)&&typeof o.name=="string"&&V(o.kinds)&&Ee(o.kinds,l.kinds)&&Ee(o.acts,l.acts)&&Ee(o.rules,l.rules)&&Array.isArray(l.edges)&&Array.isArray(l.findings),v={ok:!1,findings:[ze("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!m)return v;try{return jn(l,a)}catch{return v}}function jn(e,a={}){let{document:n}=e,t=n.brand?.timeZone,o=a.today??(()=>Ie(t)),l=new Map(e.edges.map(([h,r])=>[h,r])),m=new Map;for(let[h,r]of Object.entries(n.kinds)){let z=e.kinds[h]?.computed,R=ve(r.edges);m.set(h,{fields:new Set([...Object.keys(r.fields),...R.keys()]),edges:new Map(Object.entries(we(r.edges)).map(([T,P])=>[T,P.cardinality??"many"])),...z?{computed:new Map(z)}:{},...R.size>0?{linked:R}:{}})}e.facts&&m.set(cn,{computed:new Map(e.facts)});let v=un(n),j=new Map,D=Object.entries(n.kinds).map(([h,r])=>{let z={};for(let[i,g]of Object.entries(r.fields))z[i]=vn(g,!g.required,v),g.repeats&&(z[Je(i)]=ne(Ye()));for(let[i,g]of ve(r.edges))z[i]=ne(yn(g));let{label:R,describe:T,durations:P}=e.kinds[h]??{},M=Object.entries(r.computed??{}).map(([i,g])=>[i,typeof g=="string"?{expr:g}:g]),J=Object.hasOwn(r.fields,"label")&&!r.fields.label.label&&!/\{\s*label\b/.test(r.label??`{${wn(r)??""}}`),_=Object.fromEntries([...J?[["label","Label"]]:[],...Object.entries(r.fields).filter(([,i])=>i.label).map(([i,g])=>[i,g.label]),...M.filter(([,i])=>i.label).map(([i,g])=>[i,g.label])]),A=Object.keys(_).length>0,f=Object.fromEntries(Object.entries(r.fields).filter(([,i])=>i.default!==void 0).map(([i,g])=>[i,g.default]));j.set(h,f);let $=Object.fromEntries(Object.entries(we(r.edges)).map(([i,{renamedFrom:g,...I}])=>[i,I])),S=i=>r[i]?{[i]:r[i]}:{};return qe(h,{fields:he(z),edges:$,...S("plural"),...S("noun"),...S("description"),...R?{label:i=>ie(R,{node:i,kinds:m,today:o(),money:v})||i.id}:{},...T?{describe:i=>ie(T,{node:i,kinds:m,today:o(),money:v})}:{},...S("lifecycle"),...S("figure"),...S("fieldRoles"),...S("people"),archives:r.archives,...r.tidying?{tidying:r.tidying}:{},...M.length>0?{computed:Object.fromEntries(M.map(([i,g])=>[i,P?.includes(i)?{...g,as:"duration"}:r.computed[i]]))}:{},...A||r.glance||r.page?{display:{...A?{labels:_}:{},...r.glance?{glance:[...r.glance]}:{},...r.page?{page:r.page}:{}}}:{},...Object.keys(f).length>0?{defaults:f}:{}})}),B=Qe(D,n.computed);function G(h){return B.tryDefinition(h.kind)?.label?.(h)??h.id}let N=h=>({id:"",kind:h,...j.get(h)}),W=[];for(let[h,r]of Object.entries(n.acts??{})){let z=e.acts[h],{title:R,effects:T,guard:P,refusal:M,destructive:J,idempotent:_,creates:A,connects:f,severs:$,writes:S,writesOther:i,sets:g}=z,I=new Map(z.args),se={};for(let[d,x]of I)se[d]=Sn(x,v);let b=[r.on??[]].flat(),C=new Map(z.exprs),L=T.find(d=>"create"in d),Y=(d,x,p,w=null)=>{if(V(d)&&"expr"in d)return oe(C.get(d.expr),{graph:p,subject:w,kinds:m,bindings:x,today:o()});let k=me(d);return k===void 0?typeof d=="string"&&d.startsWith("$$")?d.slice(1):d:k==="now"?new Date().toISOString():k==="today"?o():x[k]},Te=(d,x)=>{if(!L)return"";let p=n.kinds[L.create].fields,w=N(L.create),k=[];for(let[O,ee]of Object.entries(L.set??{})){try{w[O]=Y(ee,d,x)??w[O]}catch{}let Q=me(ee);Q&&d[Q]!==void 0&&k.push(O)}let Z=G(w).trim(),H=k.filter(O=>w[O]!==!1&&p[O].type!=="text"&&!(/[^]{41}/.test(w[O])||/ .*[.!?]$/.test(w[O])&&!/[ .][A-Z]\w{0,3}\.$/.test(w[O]))&&G({...w,[O]:void 0}).trim()===Z).map(O=>w[O]===!0?p[O].label??Be(O):fn(w[O],p[O].format,o(),[],v));return Z&&H.length>0?`${Z} (${H.join(", ")})`:Z};W.push(nn(h,{input:he(se),title:R,...r.description?{description:r.description}:{},...r.fromTheOtherEnd?{fromTheOtherEnd:r.fromTheOtherEnd}:{},...I.has(q)?{subject:{kinds:b.length>0?b:"*",arg:q}}:{},...J?{destructive:!0}:{},..._?{idempotent:!0}:{},...A.length>0?{creates:A}:{},...f.length>0?{connects:f}:{},...$.length>0?{severs:$}:{},writes:S,...Object.keys(i).length>0?{writesOther:i}:{},...Object.keys(g).length>0?{sets:g}:{},describe:(d,x)=>{let p=typeof d[q]=="string"?x.getNode(d[q]):void 0,w=p?G(p):Te(d,x);return w?`${R}: ${w}`:R},apply(d,x){let p=d.graph,w=typeof x[q]=="string"?x[q]:void 0,k=w?p.getNode(w):void 0;if(w&&!k&&ae(w),k&&b.length>0&&!b.includes(k.kind))throw new U(`"${R}" acts on ${b.join(" or ")}, not on ${_e(k.kind)}`,"invalid");let Z={};for(let[s,c]of Object.entries(x))c!==void 0&&(Z[s]=c);if(P&&k){let s;try{s=oe(P,{graph:p,subject:k,kinds:m,bindings:Z,today:o()})}catch(c){throw c instanceof re?new U(`"${R}" could not be judged: ${c.sentence}`):c}if(s!==!0)throw new U(M?ie(M,{node:k,kinds:m,graph:p,bindings:Z,today:o(),money:v}):`"${R}" is not allowed for ${G(k)} right now`)}let H=new Map,O=s=>p.has(s)||[...H.values()].includes(s),ee=new Set,Q=s=>{let c=Xe(s);ee.has(c)||(ee.add(c),d.removeEdge(s))},X=(s,c)=>{let u=me(s);if(u==="subject")return w;if(u==="me"){let y=d.me;if(y&&n.kinds[p.getNode(y)?.kind]?.people)return y;throw new U(`"${R}" is done as you, and you have no record here`)}if(H.has(u))return H.get(u);try{return Y(s,Z,p,c??k??null)}catch(y){throw y instanceof re?new U(`"${R}" could not work out a value: ${y.sentence}`):y}};for(let s of T)if("create"in s){let c=n.kinds[s.create],u=N(s.create);for(let[ye,de]of Object.entries(s.set??{})){let $e=X(de,void 0);$e!==void 0&&(u[ye]=$e)}let y=wn(c),E=d.freshId(String((y&&u[y])??s.create),s.create);d.addNode({...u,id:E}),s.as&&H.set(s.as,E)}else if("connect"in s||"sever"in s){let c="connect"in s?s.connect:s.sever,u=String(X(s.from,void 0)??""),y=String(X(s.to,void 0)??"");if(O(u)||ae(u),O(y)||ae(y),"connect"in s){if(l.get(c)?.cardinality==="one")for(let E of p.out(u,c))E.id!==y&&Q({kind:c,from:u,to:E.id});p.out(u,c).some(E=>E.id===y)||d.addEdge({kind:c,from:u,to:y})}else Q({kind:c,from:u,to:y})}else if("set"in s){let c=String(X(s.target??"$subject",void 0)??""),u=p.getNode(c);!u&&!O(c)&&ae(c);let y={};for(let[E,ye]of Object.entries(s.set)){let de=X(ye,u);de!==void 0&&(y[E]=de)}Object.keys(y).length>0&&d.patchNode(c,y)}else if("remove"in s){let c=String(X(s.remove,void 0)??"");p.has(c)||ae(c),d.removeNode(c)}else if("replace"in s&&k){let c=x.to;for(let u of s.replace){let y=l.get(u)?.from.includes(k.kind)??!0;for(let E of y?p.out(k.id,u):p.in(k.id,u))u===s.keep&&E.id===c||Q(y?{kind:u,from:k.id,to:E.id}:{kind:u,from:E.id,to:k.id})}}}}))}let je=[];for(let[h,r]of Object.entries(n.rules??{})){let{title:z,require:R,when:T,says:P}=e.rules[h],M=r.repairs??[],J=(A,f,$=o(),S)=>{let i=[],g={graph:A,subject:f,kinds:m,today:$,...S?{linked:S}:{},onUnread:b=>i.push(b)},I;try{if(T&&oe(T,g)!==!0)return[];if(I=oe(R,g)===!0,!I&&i.length>0)throw new re(`it reads ${dn(i[0])}`,0)}catch(b){throw b instanceof ln?new en(b.sentence):b instanceof re?new Error(b.sentence):b}if(I)return[];let se=M.flatMap(b=>{let C=n.acts?.[b.act],L={},Y=f&&C?.on&&C.fromTheOtherEnd&&![C.on].flat().includes(f.kind)?An(e.acts[b.act].args,f.kind):void 0;Y?L[Y]=f.id:f&&(C?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(b.act))&&(L[q]=f.id);for(let[x,p]of Object.entries(b.args??{}))L[x]=me(p)==="subject"?f?.id:p;let d=(C?e.acts[b.act].args:[]).filter(([x,p])=>p.required&&L[x]===void 0).map(([x])=>x);return[{mutation:b.act,label:b.label??(Y?C.fromTheOtherEnd:C?.title)??b.act.replace(/-/g," "),args:L,...d.length>0?{missing:d}:{}}]});return[{invariant:h,...f?{subjectId:f.id}:{},label:z,message:P?ie(P,{node:f,kinds:m,graph:A,today:$,money:v}):f?`${G(f)}: ${z}`:z,nodeIds:f?[f.id]:[],repairs:se}]},_={label:z,shape:{over:r.over,require:R,when:T,says:P,declared:n.kinds,money:v,kinds:m,today:o},judgment:{require:r.require,...r.when?{when:r.when}:{},...r.says?{says:r.says}:{}},...r.description?{description:r.description}:{},...M.length>0?{repairs:M.map(A=>A.act)}:{}};je.push(r.over==="graph"?xe(h,{scope:"graph",..._,evaluate:({graph:A,today:f,context:$})=>J(A,null,f,$?.linked)}):xe(h,{scope:{kind:r.over},..._,evaluate:({graph:A,subject:f,today:$,context:S})=>J(A,f,$,S?.linked)}))}let De=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ge={name:n.name,schema:B,mutations:W,invariants:je,...De?{policy:De}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...n.forms?{forms:n.forms}:{},...n.publishing?{publishing:n.publishing}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return hn(ge,n),En.set(ge,e),{ok:!0,app:ge,document:n,findings:e.findings,sights:n.policy?.sees,kinds:m}}export{kn as a,Fn as b,bn as c,q as d,me as e,wn as f,dt as g,jn as h};
@@ -1 +1 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{e as k,g as M,h as I,i as B,l as P}from"./chunk.MT45H2T5.js";import"./chunk.S2ATSY6P.js";import"./chunk.72Q4R7N6.js";import"./chunk.G6DISMVT.js";import"./chunk.W54NXXC5.js";import{G as te,Ga as q,T as W}from"./chunk.B3T4N2XM.js";import{a as L}from"./chunk.SDO3U72B.js";import"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import{b as h}from"./chunk.AJZBJBMO.js";var r=h(te(),1);var A=h(W(),1),U=q(L(()=>(__graviewPreload(import.meta.url,["./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.YA7ZMGOL.js")))),v={Part:U.part((n,t)=>(0,A.jsx)(n.WhenMonth,{...t}),{quiet:!0}),prefetch:()=>U.prefetch()};var o=h(W(),1),z="try \u201Ctomorrow 3pm\u201D, \u201CFri 10:30\u201D or \u201C17 Oct\u201D";function K(n,t,d,p=!1){let S=Date.UTC(+n.day.slice(0,4),+n.day.slice(5,7)-1,+n.day.slice(8,10),0,t?n.minutes??0:0),g={weekday:p?"long":"short",year:"numeric",month:p?"long":"short",day:"numeric",...t?{hour:"numeric",minute:"2-digit"}:{},timeZone:"UTC"},m;try{m=new Intl.DateTimeFormat(d??"en-US",g)}catch{m=new Intl.DateTimeFormat("en-US",g)}return m.format(S).replace(/ /g," ")}function ce({value:n,time:t,instant:d=!1,label:p,name:S,required:g,autoFocus:m,autoSelect:H,locale:s,onChange:j,onLeave:_,onCancel:V,inputRef:w,boxStyle:Z}){let x=(0,r.useId)(),u=(0,r.useRef)(null),D=(0,r.useRef)(null),b=e=>{let a=M(e);return a?K(a,t,s):e??""},[T,C]=(0,r.useState)(()=>b(n)),[F,y]=(0,r.useState)(!1),[G,E]=(0,r.useState)(n),[J,Q]=(0,r.useState)(n);n!==J&&(Q(n),n!==G&&(E(n),C(b(n)))),(0,r.useEffect)(()=>{H&&(u.current?.focus(),u.current?.select())},[H]);let i=t&&d?B(s):void 0,N=T===b(n),l=M(n),c=N?l:P(T,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}}),X=N?n:c?I(c,{time:t,instant:d}):void 0,$=T.trim()==="",f=!$&&c===void 0;(0,r.useEffect)(()=>{u.current?.setCustomValidity(f?`Not a date this reads \u2014 ${z}`:"")},[f]);let O=e=>{E(e),j(e)},Y=e=>{C(e);let a=e.trim()===""?void 0:P(e,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}});O(a?I(a,{time:t,instant:d}):void 0)},ee=e=>{let a=t?{day:e,minutes:c?.minutes??l?.minutes??540}:{day:e},R=I(a,{time:t,instant:d});C(b(R)),O(R),y(!1),requestAnimationFrame(()=>{u.current?.focus(),u.current?.select()})},ne=$?`Type a date, or pick one \u2014 ${z}`:f?`Not a date this reads \u2014 ${z}`:c?`${K(c,t,s,!0)}${i?` ${i.short}`:""}`:"";return(0,o.jsxs)("span",{"data-graview-when":t?d?"instant":"moment":"day",style:{display:"inline-flex",flex:"1 1 14rem",flexWrap:"wrap",alignItems:"center",gap:"4px 6px",maxWidth:"100%",minWidth:0},onBlur:e=>{let a=e.relatedTarget;a&&e.currentTarget.contains(a)||!a&&typeof document<"u"&&!document.hasFocus()||(y(!1),_?.(X))},children:[(0,o.jsx)("input",{ref:e=>{u.current=e,typeof w=="function"?w(e):w&&(w.current=e)},type:"text",name:S,required:g,autoFocus:m,"aria-label":p,"aria-describedby":`${x}-said`,"aria-invalid":f||void 0,autoComplete:"off",spellCheck:!1,enterKeyHint:"done",placeholder:t?"tomorrow 3pm":"17 Oct",value:T,"data-graview-part":"control",onChange:e=>Y(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),V?.()):e.key==="ArrowDown"&&e.altKey&&(e.preventDefault(),y(!0))},style:{flex:"1 1 12ch",minWidth:"10ch",maxWidth:"100%",boxSizing:"border-box",font:"inherit",...Z}}),(0,o.jsx)("button",{ref:D,type:"button","aria-label":`Pick a date for ${p}`,"aria-expanded":F,"aria-controls":`${x}-month`,"data-graview-part":"when-pick",onClick:()=>y(e=>!e),onPointerEnter:()=>v.prefetch(),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:32,minHeight:32,padding:0,borderRadius:6},children:(0,o.jsxs)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[(0,o.jsx)("rect",{x:"2",y:"3",width:"12",height:"11",rx:"1.5"}),(0,o.jsx)("path",{d:"M2 6.5h12M5.5 1.5v3M10.5 1.5v3"})]})}),(0,o.jsxs)("span",{id:`${x}-said`,"aria-live":"polite","data-graview-part":"when-said",...i?{"data-graview-zone":i.zone,title:`Times are in ${i.zone.replace(/_/g," ")} (${i.short})`}:{},style:{flexBasis:"100%",fontSize:"0.75rem",color:f?"var(--graview-bad)":"var(--graview-ink-faint)"},children:[ne,i&&!f&&!$?(0,o.jsx)("span",{"data-graview-part":"when-zone",children:` \xB7 ${(i.zone.split("/").at(-1)??i.zone).replace(/_/g," ")} time`}):null]}),F?(0,o.jsx)(r.Suspense,{fallback:null,children:(0,o.jsx)(v.Part,{id:`${x}-month`,label:p,selected:c?.day??l?.day,today:k().day,locale:s,onPick:ee,onClose:()=>{y(!1),D.current?.focus()}})}):null]})}export{ce as WhenInput,K as wallAsRead};
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{e as k,g as M,h as I,i as B,l as P}from"./chunk.5ZWE72VJ.js";import"./chunk.RLO3RDYH.js";import"./chunk.TUNHUTQ5.js";import"./chunk.FWZF7X6A.js";import"./chunk.3JMZHCB4.js";import{G as te,Ga as q,T as W}from"./chunk.SF4BYBH6.js";import{a as L}from"./chunk.SDO3U72B.js";import"./chunk.3MZIWKNG.js";import"./chunk.SLBWPVIY.js";import{b as h}from"./chunk.AJZBJBMO.js";var r=h(te(),1);var A=h(W(),1),U=q(L(()=>(__graviewPreload(import.meta.url,["./chunk.FWZF7X6A.js","./chunk.3JMZHCB4.js","./chunk.SF4BYBH6.js","./chunk.SDO3U72B.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.VTO6UWUP.js")))),v={Part:U.part((n,t)=>(0,A.jsx)(n.WhenMonth,{...t}),{quiet:!0}),prefetch:()=>U.prefetch()};var o=h(W(),1),z="try \u201Ctomorrow 3pm\u201D, \u201CFri 10:30\u201D or \u201C17 Oct\u201D";function K(n,t,d,p=!1){let S=Date.UTC(+n.day.slice(0,4),+n.day.slice(5,7)-1,+n.day.slice(8,10),0,t?n.minutes??0:0),g={weekday:p?"long":"short",year:"numeric",month:p?"long":"short",day:"numeric",...t?{hour:"numeric",minute:"2-digit"}:{},timeZone:"UTC"},m;try{m=new Intl.DateTimeFormat(d??"en-US",g)}catch{m=new Intl.DateTimeFormat("en-US",g)}return m.format(S).replace(/ /g," ")}function le({value:n,time:t,instant:d=!1,label:p,name:S,required:g,autoFocus:m,autoSelect:H,locale:s,onChange:j,onLeave:_,onCancel:V,inputRef:w,boxStyle:Z}){let x=(0,r.useId)(),u=(0,r.useRef)(null),D=(0,r.useRef)(null),b=e=>{let a=M(e);return a?K(a,t,s):e??""},[T,C]=(0,r.useState)(()=>b(n)),[F,y]=(0,r.useState)(!1),[G,E]=(0,r.useState)(n),[J,Q]=(0,r.useState)(n);n!==J&&(Q(n),n!==G&&(E(n),C(b(n)))),(0,r.useEffect)(()=>{H&&(u.current?.focus(),u.current?.select())},[H]);let i=t&&d?B(s):void 0,N=T===b(n),l=M(n),c=N?l:P(T,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}}),X=N?n:c?I(c,{time:t,instant:d}):void 0,$=T.trim()==="",f=!$&&c===void 0;(0,r.useEffect)(()=>{u.current?.setCustomValidity(f?`Not a date this reads \u2014 ${z}`:"")},[f]);let O=e=>{E(e),j(e)},Y=e=>{C(e);let a=e.trim()===""?void 0:P(e,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}});O(a?I(a,{time:t,instant:d}):void 0)},ee=e=>{let a=t?{day:e,minutes:c?.minutes??l?.minutes??540}:{day:e},R=I(a,{time:t,instant:d});C(b(R)),O(R),y(!1),requestAnimationFrame(()=>{u.current?.focus(),u.current?.select()})},ne=$?`Type a date, or pick one \u2014 ${z}`:f?`Not a date this reads \u2014 ${z}`:c?`${K(c,t,s,!0)}${i?` ${i.short}`:""}`:"";return(0,o.jsxs)("span",{"data-graview-when":t?d?"instant":"moment":"day",style:{display:"inline-flex",flex:"1 1 14rem",flexWrap:"wrap",alignItems:"center",gap:"4px 6px",maxWidth:"100%",minWidth:0},onBlur:e=>{let a=e.relatedTarget;a&&e.currentTarget.contains(a)||!a&&typeof document<"u"&&!document.hasFocus()||(y(!1),_?.(X))},children:[(0,o.jsx)("input",{ref:e=>{u.current=e,typeof w=="function"?w(e):w&&(w.current=e)},type:"text",name:S,required:g,autoFocus:m,"aria-label":p,"aria-describedby":`${x}-said`,"aria-invalid":f||void 0,autoComplete:"off",spellCheck:!1,enterKeyHint:"done",placeholder:t?"tomorrow 3pm":"17 Oct",value:T,"data-graview-part":"control",onChange:e=>Y(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),V?.()):e.key==="ArrowDown"&&e.altKey&&(e.preventDefault(),y(!0))},style:{flex:"1 1 12ch",minWidth:"10ch",maxWidth:"100%",boxSizing:"border-box",font:"inherit",...Z}}),(0,o.jsx)("button",{ref:D,type:"button","aria-label":`Pick a date for ${p}`,"aria-expanded":F,"aria-controls":`${x}-month`,"data-graview-part":"when-pick",onClick:()=>y(e=>!e),onPointerEnter:()=>v.prefetch(),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:32,minHeight:32,padding:0,borderRadius:6},children:(0,o.jsxs)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[(0,o.jsx)("rect",{x:"2",y:"3",width:"12",height:"11",rx:"1.5"}),(0,o.jsx)("path",{d:"M2 6.5h12M5.5 1.5v3M10.5 1.5v3"})]})}),(0,o.jsxs)("span",{id:`${x}-said`,"aria-live":"polite","data-graview-part":"when-said",...i?{"data-graview-zone":i.zone,title:`Times are in ${i.zone.replace(/_/g," ")} (${i.short})`}:{},style:{flexBasis:"100%",fontSize:"0.75rem",color:f?"var(--graview-bad)":"var(--graview-ink-faint)"},children:[ne,i&&!f&&!$?(0,o.jsx)("span",{"data-graview-part":"when-zone",children:` \xB7 ${(i.zone.split("/").at(-1)??i.zone).replace(/_/g," ")} time`}):null]}),F?(0,o.jsx)(r.Suspense,{fallback:null,children:(0,o.jsx)(v.Part,{id:`${x}-month`,label:p,selected:c?.day??l?.day,today:k().day,locale:s,onPick:ee,onClose:()=>{y(!1),D.current?.focus()}})}):null]})}export{le as WhenInput,K as wallAsRead};
@@ -1 +1 @@
1
- import{da as l,ka as p,ob as a}from"./chunk.6W2DUW5S.js";import{c}from"./chunk.SLBWPVIY.js";function m(e){if(e.withheld===!0||e.undoes!==void 0||e.mutation?.name!==a)return;let{node:n,field:r}=e.mutation.args??{};return typeof n=="string"&&typeof r=="string"?{node:n,field:r}:void 0}function R(e,n){return e.kind!==n.kind?!1:e.id!==void 0||n.id!==void 0?e.id===n.id&&e.onBehalfOf===n.onBehalfOf:(e.name??"")===(n.name??"")}var f=e=>{let n=0;for(let r of e)n++;return n};function k(e){if(e.length===0)return;let n=m(e[0]);if(!n)return;let r=0,o=0;for(let i of e){let d=m(i);if(!d||d.node!==n.node||d.field!==n.field)return;for(let t of i.primitives)if(t.op==="splice-text"&&t.id===n.node&&t.field===n.field)r+=f(t.inserted),o+=f(t.removed);else if(t.op==="patch-node"&&t.id===n.node&&Object.prototype.hasOwnProperty.call(t.after,n.field)){let s=t.before[n.field],u=t.after[n.field];r+=typeof u=="string"?f(u):0,o+=typeof s=="string"&&!c(s)?f(s):0}}return{...n,inserted:r,removed:o}}var T=(e,n)=>({node:e.node,field:e.field,inserted:e.inserted+n.inserted,removed:e.removed+n.removed});function y(e){return`(${[...e.inserted>0||e.removed===0?[`+${e.inserted}`]:[],...e.removed>0?[`\u2212${e.removed}`]:[]].join(" ")})`}function w(e,n,r,o=!0){let i=r?.getNode(e.node),d=i?n.tryDefinition(i.kind):void 0,t=p(d,e.field);return`Wrote in ${i&&o?`${l(d,i)}'s ${t.toLowerCase()}`:t} ${y(e)}`}export{R as a,k as b,T as c,w as d};
1
+ import{da as l,ka as p,ob as a}from"./chunk.3MZIWKNG.js";import{c}from"./chunk.SLBWPVIY.js";function m(e){if(e.withheld===!0||e.undoes!==void 0||e.mutation?.name!==a)return;let{node:n,field:r}=e.mutation.args??{};return typeof n=="string"&&typeof r=="string"?{node:n,field:r}:void 0}function R(e,n){return e.kind!==n.kind?!1:e.id!==void 0||n.id!==void 0?e.id===n.id&&e.onBehalfOf===n.onBehalfOf:(e.name??"")===(n.name??"")}var f=e=>{let n=0;for(let r of e)n++;return n};function k(e){if(e.length===0)return;let n=m(e[0]);if(!n)return;let r=0,o=0;for(let i of e){let d=m(i);if(!d||d.node!==n.node||d.field!==n.field)return;for(let t of i.primitives)if(t.op==="splice-text"&&t.id===n.node&&t.field===n.field)r+=f(t.inserted),o+=f(t.removed);else if(t.op==="patch-node"&&t.id===n.node&&Object.prototype.hasOwnProperty.call(t.after,n.field)){let s=t.before[n.field],u=t.after[n.field];r+=typeof u=="string"?f(u):0,o+=typeof s=="string"&&!c(s)?f(s):0}}return{...n,inserted:r,removed:o}}var T=(e,n)=>({node:e.node,field:e.field,inserted:e.inserted+n.inserted,removed:e.removed+n.removed});function y(e){return`(${[...e.inserted>0||e.removed===0?[`+${e.inserted}`]:[],...e.removed>0?[`\u2212${e.removed}`]:[]].join(" ")})`}function w(e,n,r,o=!0){let i=r?.getNode(e.node),d=i?n.tryDefinition(i.kind):void 0,t=p(d,e.field);return`Wrote in ${i&&o?`${l(d,i)}'s ${t.toLowerCase()}`:t} ${y(e)}`}export{R as a,k as b,T as c,w as d};
@@ -0,0 +1 @@
1
+ import{i as n}from"./chunk.MDWCX3YU.js";import"./chunk.CB5DGKR5.js";import"./chunk.GKLDSHHH.js";import"./chunk.OCV46AFN.js";import"./chunk.PZ4G5QA5.js";import"./chunk.Y36MLVMT.js";import"./chunk.MPMROUZA.js";import"./chunk.XZJ6XX5I.js";import"./chunk.4F5M5XZG.js";import"./chunk.LVOL2LEC.js";import"./chunk.3G5DEGFA.js";import"./chunk.OZ4EJ5M6.js";import"./chunk.WVUJXDXZ.js";import{e as p}from"./chunk.3V2WXZU3.js";import"./chunk.7UD2JR6J.js";import"./chunk.BUDEUNBN.js";import"./chunk.3IEJQAK7.js";import"./chunk.AKLVSZ5A.js";import"./chunk.ZUBC3UFG.js";import"./chunk.GZHZLJBF.js";import"./chunk.PZWJUQAO.js";import"./chunk.OJGHDWI6.js";import"./chunk.NEJSKMJV.js";import"./chunk.5ZWE72VJ.js";import"./chunk.RLO3RDYH.js";import"./chunk.TUNHUTQ5.js";import"./chunk.FWZF7X6A.js";import"./chunk.3JMZHCB4.js";import{T as m}from"./chunk.SF4BYBH6.js";import"./chunk.SDO3U72B.js";import"./chunk.3MZIWKNG.js";import"./chunk.SLBWPVIY.js";import{b as t}from"./chunk.AJZBJBMO.js";var i=t(m(),1),a=new WeakMap;function l(o){let e=a.get(o);if(!e){let r=p(o);e=c=>c.mode==="fullscreen"?(0,i.jsx)(n,{blocks:r,slot:"home",heading:2,firstHeading:1}):(0,i.jsx)(n,{blocks:r,slot:"home",heading:3,firstHeading:2}),a.set(o,e)}return e}export{l as homeView};
@@ -1,4 +1,4 @@
1
- import{a as N,c as W,d as I,f as O}from"./chunk.52Y37IAD.js";import{a as Z,b as ee}from"./chunk.XOZU4OFA.js";import{b as U,c as X,d as ae}from"./chunk.IYVBJDR7.js";import{b as Y,c as _,d as L,j as J,k as Q}from"./chunk.MT45H2T5.js";import{b as $,k as B,l as V}from"./chunk.S2ATSY6P.js";import{G as oe,T as K}from"./chunk.B3T4N2XM.js";import{da as j,fa as F,ma as G}from"./chunk.6W2DUW5S.js";import{b as T}from"./chunk.AJZBJBMO.js";var c=T(oe(),1),a=T(K(),1),le=`
1
+ import{a as N,c as W,d as I,f as O}from"./chunk.3G5DEGFA.js";import{a as Z,b as ee}from"./chunk.XOZU4OFA.js";import{b as U,c as X,d as ae}from"./chunk.AG7CUSSV.js";import{b as Y,c as _,d as L,j as J,k as Q}from"./chunk.5ZWE72VJ.js";import{b as $,k as B,l as V}from"./chunk.RLO3RDYH.js";import{G as oe,T as K}from"./chunk.SF4BYBH6.js";import{da as j,fa as F,ma as G}from"./chunk.3MZIWKNG.js";import{b as T}from"./chunk.AJZBJBMO.js";var c=T(oe(),1),a=T(K(),1),le=`
2
2
  form:where([data-graview-part="form"]) {
3
3
  /* A grid item of the section above it and a grid container for the
4
4
  fields below: both halves are allowed to be narrower than what is in
@@ -1 +1 @@
1
- import{b as a,c as b,d as c,e as d,f as e,g as f,h as g}from"./chunk.QATG5HNV.js";import"./chunk.PXQVXBNG.js";import"./chunk.B3WVCSW5.js";import"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";export{g as createLinks,f as judgeDestination,e as listsOf,c as nowhere,a as placesSaid,b as quoted,d as whereOfWords};
1
+ import{b as a,c as b,d as c,e as d,f as e,g as f,h as g}from"./chunk.BPWSQVEN.js";import"./chunk.PXQVXBNG.js";import"./chunk.B3WVCSW5.js";import"./chunk.3MZIWKNG.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";export{g as createLinks,f as judgeDestination,e as listsOf,c as nowhere,a as placesSaid,b as quoted,d as whereOfWords};