graview 0.1.42 → 0.1.43
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.
- package/dist/preview/chunk.22E4GKYU.js +1 -0
- package/dist/preview/chunk.25VAWLKJ.js +1 -0
- package/dist/preview/chunk.26SI4K3P.js +35 -0
- package/dist/preview/chunk.27QYTMXP.js +1 -0
- package/dist/preview/chunk.2AZTW66C.js +1 -0
- package/dist/preview/chunk.2JMJTREH.js +1 -0
- package/dist/preview/chunk.3B47UX2J.js +2 -0
- package/dist/preview/{chunk.37NF3YXZ.js → chunk.3GQL4K3Q.js} +1 -1
- package/dist/preview/chunk.3HLNRVFY.js +1 -0
- package/dist/preview/chunk.4C65DXZB.js +1 -0
- package/dist/preview/{chunk.HQMGTPDC.js → chunk.4HAGPMY6.js} +3 -3
- package/dist/preview/{chunk.LQGXUMUX.js → chunk.4IDXQVSW.js} +1 -1
- package/dist/preview/{chunk.SUQU4AXG.js → chunk.4P3LS2OE.js} +1 -1
- package/dist/preview/{chunk.6HUS5UHZ.js → chunk.4YLBGGWT.js} +1 -1
- package/dist/preview/chunk.4ZHUGSJL.js +1 -0
- package/dist/preview/{chunk.2ZGICECC.js → chunk.4ZSHTUNK.js} +1 -1
- package/dist/preview/chunk.5BJW4IPW.js +1 -0
- package/dist/preview/{chunk.L6HKDIZB.js → chunk.5J2HETUO.js} +1 -1
- package/dist/preview/{chunk.U3MQUIJL.js → chunk.5TBK44MK.js} +1 -1
- package/dist/preview/chunk.63DI7XNE.js +21 -0
- package/dist/preview/{chunk.X2M7IOQA.js → chunk.64MP7636.js} +1 -1
- package/dist/preview/chunk.6AYTF53S.js +1 -0
- package/dist/preview/chunk.6BU3GCHK.js +1 -0
- package/dist/preview/{chunk.P6J6VFF5.js → chunk.6IEDQHKI.js} +1 -1
- package/dist/preview/chunk.6K4JBLOP.js +1 -0
- package/dist/preview/{chunk.KSXB4LDF.js → chunk.6PF5LWRK.js} +1 -1
- package/dist/preview/{chunk.27P37343.js → chunk.6ROYIMQ2.js} +1 -1
- package/dist/preview/{chunk.QHP7AJUV.js → chunk.6XEATXZC.js} +1 -1
- package/dist/preview/chunk.7IXLH7PR.js +1 -0
- package/dist/preview/chunk.7L6LYXCV.js +25 -0
- package/dist/preview/chunk.7MQ7UWVW.js +5 -0
- package/dist/preview/{chunk.7EB6SDUQ.js → chunk.7MXQRSNR.js} +1 -1
- package/dist/preview/{chunk.5NDYYTT4.js → chunk.7ROWZZN5.js} +1 -1
- package/dist/preview/chunk.7TU2PDYW.js +1 -0
- package/dist/preview/{chunk.57R4ZUMM.js → chunk.7XCBIID7.js} +1 -1
- package/dist/preview/{chunk.5FHH5NR6.js → chunk.A3WOUDOG.js} +1 -1
- package/dist/preview/{chunk.VO6DBVZR.js → chunk.AXJJUCWT.js} +1 -1
- package/dist/preview/chunk.B2KDYES6.js +1 -0
- package/dist/preview/{chunk.V3K32XD7.js → chunk.BT6FUNQI.js} +1 -1
- package/dist/preview/chunk.BYVE2NQY.js +1 -0
- package/dist/preview/chunk.BYVLGDVJ.js +1 -0
- package/dist/preview/{chunk.ROHM3ETN.js → chunk.C3DX4LWD.js} +1 -1
- package/dist/preview/chunk.C3X3R7LP.js +9 -0
- package/dist/preview/{chunk.I7QCXRP7.js → chunk.C5NOO4CC.js} +1 -1
- package/dist/preview/{chunk.EC2T2UVH.js → chunk.CO2ZPX3D.js} +2 -2
- package/dist/preview/{chunk.ARTJL3X2.js → chunk.CTSPNTDX.js} +1 -1
- package/dist/preview/{chunk.K63BUJBF.js → chunk.CW6IPHRR.js} +2 -2
- package/dist/preview/chunk.CXJXVBGF.js +1 -0
- package/dist/preview/{chunk.B6DKKNVR.js → chunk.DJ3BD7AZ.js} +1 -1
- package/dist/preview/{chunk.PACJFDDU.js → chunk.DQR45N7V.js} +1 -1
- package/dist/preview/{chunk.PCTVLNOS.js → chunk.DYW4D74X.js} +1 -1
- package/dist/preview/chunk.DZN26GKS.js +1 -0
- package/dist/preview/chunk.E2AJ7U5Z.js +1 -0
- package/dist/preview/chunk.E5PHLNXR.js +1 -0
- package/dist/preview/{chunk.HG2IO5NS.js → chunk.EBTYR5CZ.js} +1 -1
- package/dist/preview/chunk.EPPAFWP7.js +5 -0
- package/dist/preview/{chunk.NS3Z7QNP.js → chunk.F6CPM7SL.js} +1 -1
- package/dist/preview/chunk.FCPH4YZN.js +1 -0
- package/dist/preview/{chunk.PH5ITX3N.js → chunk.FKLEIR4Y.js} +1 -1
- package/dist/preview/chunk.FLMNHV6A.js +19 -0
- package/dist/preview/chunk.FTF67QE2.js +1 -0
- package/dist/preview/chunk.GNPYSMHA.js +1 -0
- package/dist/preview/chunk.GSZYT6GF.js +1 -0
- package/dist/preview/{chunk.X5WIS4BC.js → chunk.GZA5ZNLJ.js} +1 -1
- package/dist/preview/chunk.HMABYAZR.js +1 -0
- package/dist/preview/chunk.I4HUBO22.js +1 -0
- package/dist/preview/chunk.IJ2AF3AW.js +1 -0
- package/dist/preview/{chunk.HOTOH7ZB.js → chunk.IJU322EP.js} +1 -1
- package/dist/preview/chunk.IWUSCCZN.js +1 -0
- package/dist/preview/{chunk.B7DCQJXV.js → chunk.JNCSGUO3.js} +1 -1
- package/dist/preview/{chunk.LZH65VSN.js → chunk.K6SPN4D6.js} +1 -1
- package/dist/preview/chunk.KBMVUIWR.js +6 -0
- package/dist/preview/{chunk.HAY22FPJ.js → chunk.KG5R4GTK.js} +1 -1
- package/dist/preview/chunk.KR3J27IA.js +88 -0
- package/dist/preview/chunk.KWQ67UK2.js +1 -0
- package/dist/preview/chunk.LBIDNJ6G.js +1 -0
- package/dist/preview/{chunk.ILPD5CZG.js → chunk.LDU25CCL.js} +1 -1
- package/dist/preview/{chunk.CAZX6OPN.js → chunk.MBOOUJOE.js} +1 -1
- package/dist/preview/{chunk.J7ZMNAWB.js → chunk.MI2HL3LQ.js} +1 -1
- package/dist/preview/chunk.MXU3VQSQ.js +1 -0
- package/dist/preview/{chunk.KZDLDXLB.js → chunk.N3FONYEP.js} +2 -2
- package/dist/preview/chunk.NH6D6TWY.js +1 -0
- package/dist/preview/chunk.NQTCOBOQ.js +1 -0
- package/dist/preview/chunk.O4X5WJIC.js +1 -0
- package/dist/preview/chunk.OH2N3SX7.js +1 -0
- package/dist/preview/chunk.OIJP6PQV.js +1 -0
- package/dist/preview/{chunk.CSWX7YGI.js → chunk.ONSG3OIL.js} +1 -1
- package/dist/preview/chunk.ORKXXLWD.js +1 -0
- package/dist/preview/chunk.OUN2H3TR.js +1 -0
- package/dist/preview/{chunk.AQTCN7KQ.js → chunk.OWL5GZ6U.js} +1 -1
- package/dist/preview/chunk.PEXPTDX7.js +1 -0
- package/dist/preview/chunk.PWYMZWAN.js +1 -0
- package/dist/preview/{chunk.V5VQCANB.js → chunk.Q5XICUDZ.js} +1 -1
- package/dist/preview/chunk.QJUFVEAU.js +1 -0
- package/dist/preview/{chunk.WVN62OMH.js → chunk.QWY54AVN.js} +1 -1
- package/dist/preview/{chunk.Y2QDZLSY.js → chunk.QXTLZSBL.js} +1 -1
- package/dist/preview/{chunk.XDPIS7RS.js → chunk.R2B2ZAWI.js} +1 -1
- package/dist/preview/{chunk.VTUMPH4Z.js → chunk.R7F6UJVG.js} +1 -1
- package/dist/preview/chunk.RDXDEFOC.js +1 -0
- package/dist/preview/{chunk.WUQOSVQU.js → chunk.RPDTWQKA.js} +3 -3
- package/dist/preview/{chunk.4YBP552Z.js → chunk.RQBX7M7Q.js} +2 -2
- package/dist/preview/{chunk.LFJH6X6O.js → chunk.RSYFIL2Z.js} +1 -1
- package/dist/preview/{chunk.WZEA2UK6.js → chunk.RY4E4JRI.js} +1 -1
- package/dist/preview/{chunk.VEP4EJ2N.js → chunk.S2MP53RO.js} +1 -1
- package/dist/preview/{chunk.IWLVZGW5.js → chunk.S6BZXNMV.js} +1 -1
- package/dist/preview/{chunk.WERBD5ZR.js → chunk.SGRKCQ2X.js} +1 -1
- package/dist/preview/chunk.SKB4XSDG.js +1 -0
- package/dist/preview/chunk.T4M4MLOS.js +1 -0
- package/dist/preview/{chunk.BZ4VZ6WQ.js → chunk.T4Q6OLZU.js} +1 -1
- package/dist/preview/{chunk.QHLD4TZW.js → chunk.T4QT5SZY.js} +1 -1
- package/dist/preview/{chunk.VKJAGZNU.js → chunk.TMBFLZNH.js} +1 -1
- package/dist/preview/chunk.TX65ZO27.js +1 -0
- package/dist/preview/chunk.U3ETEQDO.js +1 -0
- package/dist/preview/chunk.VCOIFBUE.js +1 -0
- package/dist/preview/{chunk.4QEDYRES.js → chunk.VP35BUUZ.js} +5 -5
- package/dist/preview/{chunk.VMBIFUYX.js → chunk.WH2RYGXR.js} +1 -1
- package/dist/preview/{chunk.P7ISPJAQ.js → chunk.WWR7Y2KE.js} +1 -1
- package/dist/preview/chunk.X5WB4GJ4.js +1 -0
- package/dist/preview/chunk.XAXZCOZK.js +1 -0
- package/dist/preview/chunk.XBV4WO7D.js +1 -0
- package/dist/preview/chunk.XFQUVMRI.js +1 -0
- package/dist/preview/{chunk.QXMTGLHR.js → chunk.XGRMQUFB.js} +1 -1
- package/dist/preview/{chunk.O7VHAKSA.js → chunk.XVWJD2DG.js} +1 -1
- package/dist/preview/{chunk.LWAZ6ZO6.js → chunk.YKN2VWWQ.js} +2 -2
- package/dist/preview/{chunk.ZRIDKFTV.js → chunk.YPEZZLOY.js} +1 -1
- package/dist/preview/chunk.YQDIVHCH.js +1 -0
- package/dist/preview/{chunk.ZQCGDTQ3.js → chunk.Z56L6V6Z.js} +1 -1
- package/dist/preview/{chunk.KMGGP6XT.js → chunk.ZE4U4JBF.js} +2 -2
- package/dist/preview/chunk.ZE6LJVVN.js +1 -0
- package/dist/preview/{chunk.U6YOAS4X.js → chunk.ZEC64CK6.js} +1 -1
- package/dist/preview/chunk.ZHRW2UF4.js +1 -0
- package/dist/preview/{chunk.XNW7PUAF.js → chunk.ZRICIE6T.js} +1 -1
- package/dist/preview/chunk.ZUJZVK2X.js +1 -0
- package/dist/preview/index.html +46 -45
- package/dist/preview/page.js +6 -6
- package/package.json +6 -6
- package/dist/preview/chunk.22QEYFWI.js +0 -1
- package/dist/preview/chunk.35FR36BQ.js +0 -1
- package/dist/preview/chunk.36LP3I7Z.js +0 -21
- package/dist/preview/chunk.3K2KBIRG.js +0 -1
- package/dist/preview/chunk.3SKUJWFC.js +0 -1
- package/dist/preview/chunk.3WABA2WQ.js +0 -1
- package/dist/preview/chunk.4NBB44YU.js +0 -1
- package/dist/preview/chunk.4YRCKOX2.js +0 -1
- package/dist/preview/chunk.6MLAJKYM.js +0 -1
- package/dist/preview/chunk.6NF32PAT.js +0 -1
- package/dist/preview/chunk.6WB24MS3.js +0 -1
- package/dist/preview/chunk.7HZVCW3Q.js +0 -1
- package/dist/preview/chunk.7MJM3OVC.js +0 -1
- package/dist/preview/chunk.7OSL64QH.js +0 -1
- package/dist/preview/chunk.7XDNCCLG.js +0 -6
- package/dist/preview/chunk.7Z2GTKA4.js +0 -1
- package/dist/preview/chunk.AOC2KUFE.js +0 -1
- package/dist/preview/chunk.AWSUMY3D.js +0 -1
- package/dist/preview/chunk.B65HPL4I.js +0 -1
- package/dist/preview/chunk.BJET6KOG.js +0 -1
- package/dist/preview/chunk.D3ELYLME.js +0 -1
- package/dist/preview/chunk.DNMBZONP.js +0 -1
- package/dist/preview/chunk.DXAUXGNN.js +0 -1
- package/dist/preview/chunk.EHMCRUYR.js +0 -1
- package/dist/preview/chunk.EQIQPY4O.js +0 -1
- package/dist/preview/chunk.ETWOZQWL.js +0 -1
- package/dist/preview/chunk.EVHXF7LZ.js +0 -19
- package/dist/preview/chunk.FFRWSODT.js +0 -1
- package/dist/preview/chunk.G4AY6NGN.js +0 -1
- package/dist/preview/chunk.GN2SZEFH.js +0 -1
- package/dist/preview/chunk.GXWOEOUY.js +0 -1
- package/dist/preview/chunk.IGA7OD3L.js +0 -1
- package/dist/preview/chunk.IXS5XBG6.js +0 -1
- package/dist/preview/chunk.JCTT2LAK.js +0 -1
- package/dist/preview/chunk.JE4QQEJE.js +0 -25
- package/dist/preview/chunk.JEBB3WM7.js +0 -1
- package/dist/preview/chunk.JPD2I4Z7.js +0 -1
- package/dist/preview/chunk.LKGDN25E.js +0 -1
- package/dist/preview/chunk.LMUFLZYT.js +0 -1
- package/dist/preview/chunk.MUBZIU6F.js +0 -1
- package/dist/preview/chunk.MZ6I2Q4E.js +0 -1
- package/dist/preview/chunk.NTJNBKWC.js +0 -1
- package/dist/preview/chunk.OMCXJGDI.js +0 -1
- package/dist/preview/chunk.OTHGZPUC.js +0 -1
- package/dist/preview/chunk.P6FGIYWP.js +0 -35
- package/dist/preview/chunk.PYFQGBU3.js +0 -1
- package/dist/preview/chunk.RFCTUGMU.js +0 -1
- package/dist/preview/chunk.RR4RZH4S.js +0 -1
- package/dist/preview/chunk.S5K4FLLG.js +0 -1
- package/dist/preview/chunk.SZKVNPEF.js +0 -1
- package/dist/preview/chunk.T3F6BKIO.js +0 -1
- package/dist/preview/chunk.UG727PEE.js +0 -5
- package/dist/preview/chunk.VXZFW52D.js +0 -1
- package/dist/preview/chunk.VYPR2MZO.js +0 -1
- package/dist/preview/chunk.W77OH637.js +0 -1
- package/dist/preview/chunk.WODEO2JF.js +0 -9
- package/dist/preview/chunk.XPML6T3P.js +0 -1
- package/dist/preview/chunk.YJM23BJL.js +0 -88
- package/dist/preview/chunk.YLGSXLXF.js +0 -1
- package/dist/preview/chunk.YLI6I6XP.js +0 -1
- package/dist/preview/chunk.YRYEWVNP.js +0 -1
- package/dist/preview/chunk.Z2TYCMBT.js +0 -5
- package/dist/preview/chunk.ZAFIZXGX.js +0 -1
- package/dist/preview/chunk.ZBYLAC3B.js +0 -2
- package/dist/preview/chunk.ZOS5APMD.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Se,b as $e,c as ze,d as $a,e as za,h as Ee,i as Ce,k as Ae,l as Te,m as Ea}from"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Se,b as $e,c as ze,d as $a,e as za,h as Ee,i as Ce,k as Ae,l as Te,m as Ea}from"./chunk.O4X5WJIC.js";import{c as ke}from"./chunk.QXTLZSBL.js";import{g as ya,h as ka}from"./chunk.RPDTWQKA.js";import"./chunk.S2MP53RO.js";import{b as ma,c as fa,d as ye,e as ha}from"./chunk.7MXQRSNR.js";import{a as ba}from"./chunk.HJCQ6I3S.js";import{b as xa}from"./chunk.A3WOUDOG.js";import"./chunk.WH2RYGXR.js";import{b as la}from"./chunk.7IXLH7PR.js";import{b as fe,d as xe,e as be}from"./chunk.X5WB4GJ4.js";import"./chunk.XGRMQUFB.js";import{b as he}from"./chunk.6IEDQHKI.js";import"./chunk.5J2HETUO.js";import"./chunk.5TBK44MK.js";import"./chunk.VCOIFBUE.js";import"./chunk.BT6FUNQI.js";import{p as va,q as wa,r as ua}from"./chunk.MBOOUJOE.js";import"./chunk.64MP7636.js";import"./chunk.RY4E4JRI.js";import"./chunk.Q5XICUDZ.js";import"./chunk.UT6642FC.js";import{f as Sa}from"./chunk.AXJJUCWT.js";import"./chunk.TI4OSTQV.js";import"./chunk.FKLEIR4Y.js";import"./chunk.GZHZLJBF.js";import{c as oa,d as da,e as Z,o as sa}from"./chunk.EBTYR5CZ.js";import"./chunk.OJGHDWI6.js";import"./chunk.OWL5GZ6U.js";import"./chunk.RSYFIL2Z.js";import"./chunk.R7F6UJVG.js";import"./chunk.DYW4D74X.js";import{H as ca,b as Ye,e as ta,f as ia,j as Wa,m as na,o as pa,v as ga}from"./chunk.VP35BUUZ.js";import{Aa as K,Da as aa,G as O,Ha as ra,R as f,X as Xe,Z as Je,_ as S,aa as le,ha as Ze,i as ue,j as ne,m as j,n as oe,o as me,r as de,ua as pe,x as je,y as se,z as Qe,za as ea}from"./chunk.7L6LYXCV.js";import{a as V}from"./chunk.SDO3U72B.js";import{$b as Ve,U as _e,fa as Ue,ha as ie,uc as H,wc as P}from"./chunk.7MQ7UWVW.js";import"./chunk.2AZTW66C.js";import{b as p}from"./chunk.AJZBJBMO.js";function qa(e){return`
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
.graview-altitude-control {
|
|
@@ -1123,5 +1123,5 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
|
|
|
1123
1123
|
}
|
|
1124
1124
|
[data-graview-connector][data-graview-activity] {
|
|
1125
1125
|
animation: graview-relation 1200ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
1126
|
-
}`}function Me(e="dark",n={}){let s=qa(e);return n.scope===void 0?s:Ye(s,n.scope)}var B=p(O(),1);var W=p(f(),1),Fa=pe(V(()=>(__graviewPreload(import.meta.url,["./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.6HUS5UHZ.js")))).part(e=>(0,W.jsx)(e.MapKey,{}),{quiet:!0});function Ie(){let{store:e}=S(),{view:n}=K(),s=le(),o=(0,B.useMemo)(()=>e.graph.allEdges().length>0,[e,s]),[r,v]=(0,B.useState)(!1),g=(0,B.useId)(),c=(0,B.useRef)(null),M=(0,B.useRef)(null);return(0,B.useEffect)(()=>{if(!r)return;let z=x=>{let I=x.target;I&&(M.current?.contains(I)||c.current?.contains(I))||v(!1)};return document.addEventListener("pointerdown",z,!0),()=>document.removeEventListener("pointerdown",z,!0)},[r]),o?(0,W.jsxs)("div",{style:{display:"contents"},onKeyDown:z=>{z.key!=="Escape"||!r||(z.preventDefault(),z.stopPropagation(),v(!1),c.current?.focus({preventScroll:!0}))},children:[(0,W.jsx)("button",{ref:c,type:"button","data-testid":"lines-key","aria-expanded":r,"aria-controls":g,title:"What the lines mean",onClick:()=>v(z=>!z),style:{position:"absolute",top:60,right:"calc(14px + var(--graview-dock, 0px))",zIndex:P("overview"),height:30,padding:"0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.8125rem",color:r?"var(--graview-accent)":"var(--graview-ink-muted)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Key"}),r?(0,W.jsxs)("div",{ref:M,id:g,"data-testid":"lines-key-pane","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:P("rail"),width:za,maxHeight:"calc(100cqh - 120px)",overflowY:"auto",boxSizing:"border-box",padding:"8px 8px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[n.overview?(0,W.jsx)(Fa,{}):null,(0,W.jsx)($a,{inside:!0,widthOf:ba})]}):null]}):null}var ce=p(O(),1),ge=p(f(),1);function Ca(e){return e.lens!==null?{what:"lens",kind:e.lens}:e.records.length===1&&e.districts.length===0?{what:"record",id:e.records[0]}:e.districts.length===1&&e.records.length===0?{what:"district",kind:e.districts[0]}:null}var Ga=pe(V(()=>(__graviewPreload(import.meta.url,["./chunk.WUQOSVQU.js","./chunk.B6DKKNVR.js","./chunk.7EB6SDUQ.js","./chunk.HJCQ6I3S.js","./chunk.5FHH5NR6.js","./chunk.VMBIFUYX.js","./chunk.U3MQUIJL.js","./chunk.DNMBZONP.js","./chunk.OTHGZPUC.js","./chunk.4YBP552Z.js","./chunk.V3K32XD7.js","./chunk.CAZX6OPN.js","./chunk.X2M7IOQA.js","./chunk.WZEA2UK6.js","./chunk.V5VQCANB.js","./chunk.UT6642FC.js","./chunk.PH5ITX3N.js","./chunk.WVUJXDXZ.js","./chunk.WVN62OMH.js","./chunk.BZ4VZ6WQ.js","./chunk.XDPIS7RS.js","./chunk.57R4ZUMM.js","./chunk.J7ZMNAWB.js","./chunk.VKJAGZNU.js","./chunk.GZHZLJBF.js","./chunk.HG2IO5NS.js","./chunk.OJGHDWI6.js","./chunk.AQTCN7KQ.js","./chunk.LFJH6X6O.js","./chunk.VTUMPH4Z.js","./chunk.PCTVLNOS.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.CSWX7YGI.js")))),_a=Ga.part((e,n)=>(0,ge.jsx)(e.MapPanelFor,{showing:n.showing}),{what:"This panel",quiet:!0});function Re(){let{store:e,view:n,selection:s,hiddenKinds:o,seatTalk:r}=S();le();let v=(0,ce.useSyncExternalStore)(r.subscribe,()=>r.get().draft!==null,()=>!1);if(!n.overview||v)return null;let g=Ca(xa(s,{...n,beside:!0},c=>e.graph.getNode(c)?.kind));return!g||g.what!=="record"&&(o.has(g.kind)||!e.schema.kinds.includes(g.kind))?null:(0,ge.jsx)(ce.Suspense,{fallback:null,children:(0,ge.jsx)(_a,{showing:g})})}var Ua=p(O(),1);var D=p(f(),1);function Le(){let{view:e,go:n}=K(),{store:s,views:o,hiddenKinds:r}=S(),v=e.overview??!1,g=o.places().map($=>$.kind).filter($=>!r.has($)),c=ca(e,s.schema.kinds,g),M=()=>{n(ne(j(e,!1),c))},z=(()=>{if(!c)return null;let $=je(c)[0],y=e.within?.view,C=(y?o.places().find(R=>R.as===y):void 0)??($?o.places().filter(R=>R.kind===$).at(-1):void 0);return C?C.title:$?ie(s.schema,$):s.graph.getNode(c)?.label??null})(),x=v?"Close the map":"Up",I=v&&z?`Close the map, down to ${z}`:x;return(0,D.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":v,"aria-label":I,title:v?I:"Up \u2014 the whole thing, from above",onClick:()=>v?M():n(j(e,!0)),style:{position:"absolute",top:14,right:"calc(14px + var(--graview-dock, 0px))",zIndex:P("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":v?1:0,...v?{color:"var(--graview-accent)"}:{}},children:[(0,D.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,D.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,D.jsx)("span",{className:"graview-altitude-label",children:x})]})}var Ne=p(f(),1);function He(){let{administered:e}=S(),{view:n,go:s}=K(),o=e.filter(r=>r.canShow);return o.length===0?null:(0,Ne.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:o.map(r=>(0,Ne.jsx)("button",{type:"button","aria-pressed":r.shown,"data-testid":`show-${r.name}`,title:r.shown?`Hide the ${r.name}'s own districts again`:r.description??`Show the ${r.name}'s own districts beside the domain`,onClick:()=>s(ma(n,r.name,!r.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:r.shown?"var(--graview-accent)":"var(--graview-edge)",color:r.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:r.shown?"var(--graview-panel)":"transparent"},children:r.shown?`Hide the ${r.name}`:`Show the ${r.name}`},r.name))})}var h=p(O(),1);var l=p(f(),1);Xe({search:wa,touchWeights:va});var Va=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Ia({compact:e=!1}){let{store:n,view:s,setView:o,principal:r,setMenuAt:v,brand:g,aiDesk:c,selection:M}=S(),z=ia(c),x=Je(),I=ea(),$=sa().marks.flag,y=(0,h.useRef)(null),C=(0,h.useId)(),[R,m]=(0,h.useState)(!1),[F,ee]=(0,h.useState)(null),[X,ae]=(0,h.useState)(null),A=s.q??"";(0,h.useEffect)(()=>{let a=t=>{if(t.defaultPrevented)return;let i=t.key.toLowerCase()==="k"&&(t.metaKey||t.ctrlKey)&&!t.altKey&&!t.shiftKey,w=t.key==="/"&&!t.metaKey&&!t.ctrlKey&&!t.altKey;if(!i&&!w)return;let d=y.current;if(!d)return;let _=d.closest("[data-graview-embed]"),L=t.target,J=L===document.body||L===document.documentElement||L===window;if(_&&!(i&&J||L instanceof Node&&_.contains(L)))return;let U=document.activeElement,Ka=U instanceof HTMLInputElement||U instanceof HTMLTextAreaElement||U instanceof HTMLSelectElement||U instanceof HTMLElement&&U.isContentEditable;w&&Ka||(t.preventDefault(),d.getClientRects().length===0&&d.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),d.focus({preventScroll:!0}),d.select(),m(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let We=(0,h.useMemo)(()=>X&&A.trim()?ua(n,X,x?.words??A,{principal:r,limit:4}):[],[n,A,x,X,r]),ve=(0,h.useMemo)(()=>{let a=new Map;for(let[t,i]of(x?.hits??[]).entries()){if(i.about==="act")continue;let w=Va(i),d=a.get(w)??[];if(d.push({id:`${C}-${t}`,hit:i}),a.set(w,d),i.about==="node"&&i.id===X)for(let[_,L]of We.entries())d.push({id:`${C}-${t}-act-${_}`,hit:L})}return[...a.entries()]},[x,We,X,C]),N=z&&A.trim()?{id:`${C}-ask`,ask:A.trim()}:null,k=(0,h.useMemo)(()=>[...ve.flatMap(([,a])=>a),...N?[N]:[]],[ve,N?.ask]),T=k.find(a=>a.id===F)??k[0],qe=(x?.hits??[]).filter(a=>a.about==="node").length;(0,h.useEffect)(()=>{ee(null),ae(null)},[A]);let re=(0,h.useRef)(null);(0,h.useEffect)(()=>{let a=re.current;if(!a)return;re.current=null;let t=0,i=()=>{let w=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),d=document.activeElement;if(!(!d||d===document.body||d===document.documentElement||d===y.current||d===w))return;let L=w?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if(L)return L.focus({preventScroll:!0});w&&w.tabIndex>=0&&d!==w&&t>30&&w.focus({preventScroll:!0}),++t<240&&requestAnimationFrame(i)};requestAnimationFrame(i)},[s]);let G=a=>{if(a){if(ee(a.id),"ask"in a){ae(null);return}a.hit.about==="node"?ae(a.hit.id):a.hit.about!=="act"&&ae(null)}},Fe=a=>{let t=document.getElementById(C),i=t?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,w=t?.clientHeight??0;return Math.min(a,i>0&&w>0?Math.max(1,Math.floor(w/i)-1):Xa)};(0,h.useEffect)(()=>{F&&document.getElementById(F)?.scrollIntoView?.({block:"nearest"})},[F]);let we=a=>{if(!a)return;if("ask"in a){ta(c,{pointed:{...M[0]!==void 0?{on:M[0]}:{},about:M},asked:a.ask}),o(i=>ye(i)),m(!1);return}let t=a.hit;switch(t.about){case"node":o(i=>oe(ne(j(i,!1),t.id),[t.id]));break;case"kind":o(i=>se(j(i,!1),de(t.kind),{ownPicture:!0})),re.current=t.kind;break;case"place":o(i=>Qe(i,t.kind,t.as)),re.current=t.kind;break;case"rule":{let i=I.filter(w=>w.invariant===t.name).flatMap(w=>w.nodeIds);o(w=>oe(w,[...new Set(i)]));break}case"act":{o(w=>oe(w,[t.subject]));let i=y.current?.getBoundingClientRect();v({x:i?.left??0,y:(i?.bottom??0)+6,on:t.subject});break}}m(!1),y.current?.blur()},Da=x?Ya(x.byKind,x.hits,n.schema):"",te=R&&A.trim().length>0,Oa=(0,h.useCallback)(()=>{let a=y.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Za};let t=y.current?.getBoundingClientRect();return t?{x:t.right,y:t.bottom}:null},[]),Ge=ra("find",{open:te,onOpenChange:a=>{a||m(!1)},...e?{at:Oa}:{}});return(0,l.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,l.jsx)("input",{ref:a=>{y.current=a,Ge.trigger.ref(a)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":te,"aria-controls":C,"aria-autocomplete":"list",...te&&T?{"aria-activedescendant":T.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:A,onChange:a=>{let t=a.target.value;m(!0),o(i=>fa(i,t.length>0?t:null))},onFocus:()=>m(!0),onBlur:()=>m(!1),onKeyDown:a=>{let t=F!==null&&T?k.indexOf(T):-1,i=d=>d!==void 0&&!("ask"in d)&&d.hit.about==="act",w=t>=0&&T!==void 0&&!("ask"in T)&&T.hit.about==="node";if(a.key==="ArrowDown"){a.preventDefault(),m(!0);let d=t+1;if(w)for(;d<k.length-1&&i(k[d]);)d+=1;G(k[Math.min(k.length-1,d)])}else if(a.key==="ArrowUp")a.preventDefault(),G(k[Math.max(0,t-1)]);else if((a.key==="PageDown"||a.key==="PageUp")&&k.length>0){a.preventDefault(),m(!0);let d=k.flatMap((J,U)=>i(J)?[]:[U]),_=Math.max(0,d.findIndex(J=>J>=Math.max(t,0))),L=a.key==="PageDown"?Fe(k.length):-Fe(k.length);G(k[d[Math.min(d.length-1,Math.max(0,(t<0?-1:_)+L))]])}else if(a.key==="ArrowRight"&&w&&i(k[t+1]))a.preventDefault(),G(k[t+1]);else if(a.key==="ArrowLeft"&&i(T)){a.preventDefault();let d=t-1;for(;d>0&&i(k[d]);)d-=1;G(k[d])}else a.key==="Enter"?(a.preventDefault(),we(T)):a.key==="Escape"&&(a.preventDefault(),A?o(d=>ye(d)):y.current?.blur())},style:{width:"100%",boxSizing:"border-box",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-panel)",border:`1px solid ${A?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,l.jsx)("span",{role:"status","aria-live":"polite",style:na,"data-testid":"find-count",children:A.trim()?Da:""}),(0,l.jsxs)("div",{...Ge.pane,id:C,role:"listbox","aria-label":A?`What \u201C${A}\u201D finds`:"What the words find","data-testid":"find-strip",hidden:!te,onMouseDown:a=>a.preventDefault(),style:e?{...Ta,...er}:Ta,children:[k.every(a=>"ask"in a)?(0,l.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",x?.words||A,"\u201D."]}):ve.map(([a,t])=>(0,l.jsxs)("div",{role:"group","aria-label":Aa(a,n.schema),children:[(0,l.jsxs)("div",{role:"presentation",style:ar,children:[a!=="rule:"?(0,l.jsx)(Qa,{kind:a,accents:g?.accents}):null,Aa(a,n.schema)]}),t.map(i=>(0,l.jsx)("div",{id:i.id,role:"option","aria-selected":i===T,"data-testid":"find-hit","data-about":i.hit.about,...i.hit.about==="node"&&i.hit.near?{"data-near":""}:{},onMouseEnter:()=>G(i),onClick:()=>we(i),style:{...Ma,...i.hit.about==="act"?{paddingLeft:30}:{},background:i===T?"var(--graview-panel-muted)":"transparent"},children:(0,l.jsx)(ja,{hit:i.hit,flag:$})},i.id))]},a)),N?(0,l.jsx)("div",{id:N.id,role:"option","aria-selected":N===T||T?.id===N.id,"data-testid":"find-ask",onMouseEnter:()=>G(N),onClick:()=>we(N),style:{...Ma,borderTop:"1px solid var(--graview-edge)",marginTop:4,background:T?.id===N.id?"var(--graview-panel-muted)":"transparent"},children:(0,l.jsxs)("span",{children:["Ask: ",(0,l.jsxs)("span",{style:{fontWeight:600},children:["\u2018",N.ask,"\u2019"]})]})}):null,qe>Ja?(0,l.jsxs)("p",{role:"presentation",style:{margin:0,padding:"6px 12px 2px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},"data-testid":"find-more-words",children:[_e(qe)," found: another word of the name narrows them."]}):null,x&&x.searched.past===!1&&x.searched.kinds.some(a=>n.schema.tryDefinition(a)?.lifecycle)?(0,l.jsx)("p",{role:"presentation",style:{margin:0,padding:"6px 12px 8px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"Current ones; add is:any for the past."}):null]})]})}function ja({hit:e,flag:n}){switch(e.about){case"node":return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("span",{style:{fontWeight:600,overflowWrap:"anywhere"},children:[e.flagged?(0,l.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[n," "]}):null,e.label,e.apart?(0,l.jsxs)("span",{style:Q,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,l.jsx)("span",{style:Q,children:" \xB7 past"})]}),e.near?(0,l.jsxs)("span",{style:Q,"data-testid":"find-near",children:["Near \u201C",e.why.asked,"\u201D",e.why.field!=="label"?` \u2014 ${e.why.reading.toLowerCase()}: ${e.why.fragment}`:""]}):e.why.field!=="label"?(0,l.jsxs)("span",{style:Q,children:[e.why.reading.toLowerCase(),": ",e.why.fragment]}):null]});case"kind":return(0,l.jsxs)("span",{children:[e.label,(0,l.jsxs)("span",{style:Q,children:[" \xB7 ",e.count," match"]})]});case"place":return(0,l.jsxs)("span",{children:["Go to ",e.title]});case"rule":return(0,l.jsxs)("span",{children:["The rule \u201C",e.label,"\u201D"]});case"act":return(0,l.jsxs)("span",{style:e.destructive?{color:"var(--graview-warn)"}:void 0,children:[e.title,(0,l.jsxs)("span",{style:Q,children:[" \xB7 ",e.why.field==="title"?"act":`on ${e.why.fragment}`]})]})}}function Qa({kind:e,accents:n}){let s=Math.round(Ve(e,n));return(0,l.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${s} 55% 52%)`}})}function Aa(e,n){return e==="rule:"?"Rules":e==="act:"?"Acts":n.tryDefinition(e)?.plural??`${e}s`}function Ya(e,n,s){let o=Object.entries(e).map(([g,c])=>Ue(s,g,c)),r=n.filter(g=>g.about==="kind"||g.about==="place"||g.about==="rule").length;r>0&&o.push(`${r} ${r===1?"place or rule":"places and rules"}`);let v=n.filter(g=>g.about==="node"&&g.near).length;return o.length===0?"Nothing found":`${o.join(", ")} found${v>0?`, ${v} of them near`:""}`}var Xa=10,Ja=12,Ta={...aa,width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(60vh, 28rem)",overflowY:"auto",boxSizing:"border-box",background:"var(--graview-panel)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:"4px 0"},Za=6,er={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},ar={display:"flex",alignItems:"center",gap:6,padding:"8px 12px 2px",fontSize:"0.6875rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Ma={display:"grid",gap:1,minHeight:32,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)"},Q={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400};var Y=p(O(),1);var Be=p(Wa(),1);var La=p(f(),1);function Ra(){let{following:e,follow:n}=S();return e?(0,La.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>n(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",e.name]}):null}var Na=p(O(),1);var b=p(f(),1);function Ha({home:e,homeLabel:n,children:s,onPicture:o=!1}){let{view:r,focus:v,show:g,go:c}=K(),{store:M}=S(),{movedByHand:z}=S(),x=z&&(r.pan!==void 0||Object.keys(r.pins).length>0),I=r.focusId&&r.focusId!==e?M.graph.getNode(r.focusId):void 0,$=m=>ie(M.schema,m),y={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},C=n!==void 0&&I!==void 0,R=[];if(I&&!o&&R.push({key:"focused",node:(0,b.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>c(me({...r,focusId:e},!1)),title:he(M,I.id),style:{...y,maxWidth:"min(14rem, 15vw)"},children:[(0,b.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:he(M,I.id)}),(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),r.past&&R.push({key:"past",node:(0,b.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>c(ha(r,!1)),title:"Back to now \u2014 retired things leave the picture again",style:y,children:["the past",(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),r.zoom&&R.push({key:"zoomed",node:(0,b.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>c(me(r,!1)),title:"Zoom back out",style:y,children:["zoomed in",(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),x&&R.push({key:"moved",node:(0,b.jsx)("button",{type:"button","data-testid":"moved",onClick:()=>c(ue(r)),title:"Put the camera and everything you dragged back where the layout wanted them",style:y,children:"Reset view"})}),r.relation){let m=r.relation;R.push({key:"raised",node:(0,b.jsxs)("span",{style:{display:"inline-flex",alignItems:"center"},children:[(0,b.jsxs)("button",{type:"button","data-testid":"raised-into",onClick:()=>c(se(r,de(m),{ownPicture:!0})),title:`Go into the ${$(m).toLowerCase()}`,"aria-label":`Go into the ${$(m).toLowerCase()}`,style:{...y,color:"var(--graview-ink)"},children:[$(m),(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\u2198"})]}),(0,b.jsx)("button",{type:"button","data-testid":"raised",onClick:()=>g(null),title:`Stop showing ${$(m).toLowerCase()}`,"aria-label":`Stop showing ${$(m).toLowerCase()}`,style:{...y,minWidth:26,justifyContent:"center"},children:(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})})]})})}return o&&!C&&R.length===0&&s===void 0?null:(0,b.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...o?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[C?(0,b.jsx)("button",{type:"button",onClick:()=>v(e),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:n}):null,R.map(({key:m,node:F},ee)=>(0,b.jsxs)(Na.Fragment,{children:[C||ee>0?(0,b.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,F]},m)),s]})}var E=p(f(),1);function Pe(){let[e,n]=(0,Y.useState)([]),s=(0,Y.useCallback)(o=>{n(r=>{let v=o.phase!=="running"&&r[0]?.name===o.name&&r[0]?.at===o.at;return[o,...v?r.slice(1):r].slice(0,12)})},[]);return[e,s]}function De({find:e,calls:n,seat:s,remembers:o=!1}){return e?(0,E.jsxs)(E.Fragment,{children:[(0,Be.createPortal)((0,E.jsx)(Ia,{compact:e.compact}),e.slot),e.own?(0,Be.createPortal)((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Y.Suspense,{fallback:null,children:(0,E.jsx)(Ea,{})}),(0,E.jsx)(la,{calls:n,remembers:o,...s!==void 0?{seat:s}:{}})]}),e.own):null]}):null}function Oe({home:e=null}){return(0,E.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px - var(--graview-dock, 0px))",zIndex:P("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,E.jsx)(Ha,{home:e,onPicture:!0}),(0,E.jsx)("span",{style:{pointerEvents:"auto"},children:(0,E.jsx)(Ra,{})})]})}var q=p(O(),1);var Ba=p(f(),1),rr=V(()=>(__graviewPreload(import.meta.url,["./chunk.UGFDSE37.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.GXWOEOUY.js")));function Ke(){let{store:e,principal:n}=S(),s=(0,q.useContext)(pa),o=(0,q.useRef)(null),r=(0,q.useRef)(!1);return(0,q.useEffect)(()=>()=>void(r.current=!0),[]),(0,q.useEffect)(()=>{let v=e.batches().length,g=rr().then(c=>c.sceneWay(e,n,s,v,o.current),()=>{});return()=>void g.then(c=>c?.(r.current))},[e,n,s]),(0,Ba.jsx)("span",{ref:o,hidden:!0})}var Pa=p(O(),1);var u=p(f(),1);function Ht({address:e=!1,auto:n,quickAsk:s=!0,scheme:o,scope:r}){let v=(0,Pa.useMemo)(()=>`${Te({scope:`.${r}`})}
|
|
1126
|
+
}`}function Me(e="dark",n={}){let s=qa(e);return n.scope===void 0?s:Ye(s,n.scope)}var B=p(O(),1);var W=p(f(),1),Fa=pe(V(()=>(__graviewPreload(import.meta.url,["./chunk.VP35BUUZ.js","./chunk.7L6LYXCV.js","./chunk.SDO3U72B.js","./chunk.7MQ7UWVW.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.4YLBGGWT.js")))).part(e=>(0,W.jsx)(e.MapKey,{}),{quiet:!0});function Ie(){let{store:e}=S(),{view:n}=K(),s=le(),o=(0,B.useMemo)(()=>e.graph.allEdges().length>0,[e,s]),[r,v]=(0,B.useState)(!1),g=(0,B.useId)(),c=(0,B.useRef)(null),M=(0,B.useRef)(null);return(0,B.useEffect)(()=>{if(!r)return;let z=x=>{let I=x.target;I&&(M.current?.contains(I)||c.current?.contains(I))||v(!1)};return document.addEventListener("pointerdown",z,!0),()=>document.removeEventListener("pointerdown",z,!0)},[r]),o?(0,W.jsxs)("div",{style:{display:"contents"},onKeyDown:z=>{z.key!=="Escape"||!r||(z.preventDefault(),z.stopPropagation(),v(!1),c.current?.focus({preventScroll:!0}))},children:[(0,W.jsx)("button",{ref:c,type:"button","data-testid":"lines-key","aria-expanded":r,"aria-controls":g,title:"What the lines mean",onClick:()=>v(z=>!z),style:{position:"absolute",top:60,right:"calc(14px + var(--graview-dock, 0px))",zIndex:P("overview"),height:30,padding:"0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.8125rem",color:r?"var(--graview-accent)":"var(--graview-ink-muted)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Key"}),r?(0,W.jsxs)("div",{ref:M,id:g,"data-testid":"lines-key-pane","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:P("rail"),width:za,maxHeight:"calc(100cqh - 120px)",overflowY:"auto",boxSizing:"border-box",padding:"8px 8px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[n.overview?(0,W.jsx)(Fa,{}):null,(0,W.jsx)($a,{inside:!0,widthOf:ba})]}):null]}):null}var ce=p(O(),1),ge=p(f(),1);function Ca(e){return e.lens!==null?{what:"lens",kind:e.lens}:e.records.length===1&&e.districts.length===0?{what:"record",id:e.records[0]}:e.districts.length===1&&e.records.length===0?{what:"district",kind:e.districts[0]}:null}var Ga=pe(V(()=>(__graviewPreload(import.meta.url,["./chunk.RPDTWQKA.js","./chunk.DJ3BD7AZ.js","./chunk.7MXQRSNR.js","./chunk.HJCQ6I3S.js","./chunk.A3WOUDOG.js","./chunk.WH2RYGXR.js","./chunk.5TBK44MK.js","./chunk.27QYTMXP.js","./chunk.VCOIFBUE.js","./chunk.RQBX7M7Q.js","./chunk.BT6FUNQI.js","./chunk.MBOOUJOE.js","./chunk.64MP7636.js","./chunk.RY4E4JRI.js","./chunk.Q5XICUDZ.js","./chunk.UT6642FC.js","./chunk.FKLEIR4Y.js","./chunk.WVUJXDXZ.js","./chunk.QWY54AVN.js","./chunk.T4Q6OLZU.js","./chunk.R2B2ZAWI.js","./chunk.7XCBIID7.js","./chunk.MI2HL3LQ.js","./chunk.TMBFLZNH.js","./chunk.GZHZLJBF.js","./chunk.EBTYR5CZ.js","./chunk.OJGHDWI6.js","./chunk.OWL5GZ6U.js","./chunk.RSYFIL2Z.js","./chunk.R7F6UJVG.js","./chunk.DYW4D74X.js","./chunk.VP35BUUZ.js","./chunk.7L6LYXCV.js","./chunk.SDO3U72B.js","./chunk.7MQ7UWVW.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.ONSG3OIL.js")))),_a=Ga.part((e,n)=>(0,ge.jsx)(e.MapPanelFor,{showing:n.showing}),{what:"This panel",quiet:!0});function Re(){let{store:e,view:n,selection:s,hiddenKinds:o,seatTalk:r}=S();le();let v=(0,ce.useSyncExternalStore)(r.subscribe,()=>r.get().draft!==null,()=>!1);if(!n.overview||v)return null;let g=Ca(xa(s,{...n,beside:!0},c=>e.graph.getNode(c)?.kind));return!g||g.what!=="record"&&(o.has(g.kind)||!e.schema.kinds.includes(g.kind))?null:(0,ge.jsx)(ce.Suspense,{fallback:null,children:(0,ge.jsx)(_a,{showing:g})})}var Ua=p(O(),1);var D=p(f(),1);function Le(){let{view:e,go:n}=K(),{store:s,views:o,hiddenKinds:r}=S(),v=e.overview??!1,g=o.places().map($=>$.kind).filter($=>!r.has($)),c=ca(e,s.schema.kinds,g),M=()=>{n(ne(j(e,!1),c))},z=(()=>{if(!c)return null;let $=je(c)[0],y=e.within?.view,C=(y?o.places().find(R=>R.as===y):void 0)??($?o.places().filter(R=>R.kind===$).at(-1):void 0);return C?C.title:$?ie(s.schema,$):s.graph.getNode(c)?.label??null})(),x=v?"Close the map":"Up",I=v&&z?`Close the map, down to ${z}`:x;return(0,D.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":v,"aria-label":I,title:v?I:"Up \u2014 the whole thing, from above",onClick:()=>v?M():n(j(e,!0)),style:{position:"absolute",top:14,right:"calc(14px + var(--graview-dock, 0px))",zIndex:P("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":v?1:0,...v?{color:"var(--graview-accent)"}:{}},children:[(0,D.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,D.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,D.jsx)("span",{className:"graview-altitude-label",children:x})]})}var Ne=p(f(),1);function He(){let{administered:e}=S(),{view:n,go:s}=K(),o=e.filter(r=>r.canShow);return o.length===0?null:(0,Ne.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:o.map(r=>(0,Ne.jsx)("button",{type:"button","aria-pressed":r.shown,"data-testid":`show-${r.name}`,title:r.shown?`Hide the ${r.name}'s own districts again`:r.description??`Show the ${r.name}'s own districts beside the domain`,onClick:()=>s(ma(n,r.name,!r.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:r.shown?"var(--graview-accent)":"var(--graview-edge)",color:r.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:r.shown?"var(--graview-panel)":"transparent"},children:r.shown?`Hide the ${r.name}`:`Show the ${r.name}`},r.name))})}var h=p(O(),1);var l=p(f(),1);Xe({search:wa,touchWeights:va});var Va=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Ia({compact:e=!1}){let{store:n,view:s,setView:o,principal:r,setMenuAt:v,brand:g,aiDesk:c,selection:M}=S(),z=ia(c),x=Je(),I=ea(),$=sa().marks.flag,y=(0,h.useRef)(null),C=(0,h.useId)(),[R,m]=(0,h.useState)(!1),[F,ee]=(0,h.useState)(null),[X,ae]=(0,h.useState)(null),A=s.q??"";(0,h.useEffect)(()=>{let a=t=>{if(t.defaultPrevented)return;let i=t.key.toLowerCase()==="k"&&(t.metaKey||t.ctrlKey)&&!t.altKey&&!t.shiftKey,w=t.key==="/"&&!t.metaKey&&!t.ctrlKey&&!t.altKey;if(!i&&!w)return;let d=y.current;if(!d)return;let _=d.closest("[data-graview-embed]"),L=t.target,J=L===document.body||L===document.documentElement||L===window;if(_&&!(i&&J||L instanceof Node&&_.contains(L)))return;let U=document.activeElement,Ka=U instanceof HTMLInputElement||U instanceof HTMLTextAreaElement||U instanceof HTMLSelectElement||U instanceof HTMLElement&&U.isContentEditable;w&&Ka||(t.preventDefault(),d.getClientRects().length===0&&d.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),d.focus({preventScroll:!0}),d.select(),m(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let We=(0,h.useMemo)(()=>X&&A.trim()?ua(n,X,x?.words??A,{principal:r,limit:4}):[],[n,A,x,X,r]),ve=(0,h.useMemo)(()=>{let a=new Map;for(let[t,i]of(x?.hits??[]).entries()){if(i.about==="act")continue;let w=Va(i),d=a.get(w)??[];if(d.push({id:`${C}-${t}`,hit:i}),a.set(w,d),i.about==="node"&&i.id===X)for(let[_,L]of We.entries())d.push({id:`${C}-${t}-act-${_}`,hit:L})}return[...a.entries()]},[x,We,X,C]),N=z&&A.trim()?{id:`${C}-ask`,ask:A.trim()}:null,k=(0,h.useMemo)(()=>[...ve.flatMap(([,a])=>a),...N?[N]:[]],[ve,N?.ask]),T=k.find(a=>a.id===F)??k[0],qe=(x?.hits??[]).filter(a=>a.about==="node").length;(0,h.useEffect)(()=>{ee(null),ae(null)},[A]);let re=(0,h.useRef)(null);(0,h.useEffect)(()=>{let a=re.current;if(!a)return;re.current=null;let t=0,i=()=>{let w=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),d=document.activeElement;if(!(!d||d===document.body||d===document.documentElement||d===y.current||d===w))return;let L=w?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if(L)return L.focus({preventScroll:!0});w&&w.tabIndex>=0&&d!==w&&t>30&&w.focus({preventScroll:!0}),++t<240&&requestAnimationFrame(i)};requestAnimationFrame(i)},[s]);let G=a=>{if(a){if(ee(a.id),"ask"in a){ae(null);return}a.hit.about==="node"?ae(a.hit.id):a.hit.about!=="act"&&ae(null)}},Fe=a=>{let t=document.getElementById(C),i=t?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,w=t?.clientHeight??0;return Math.min(a,i>0&&w>0?Math.max(1,Math.floor(w/i)-1):Xa)};(0,h.useEffect)(()=>{F&&document.getElementById(F)?.scrollIntoView?.({block:"nearest"})},[F]);let we=a=>{if(!a)return;if("ask"in a){ta(c,{pointed:{...M[0]!==void 0?{on:M[0]}:{},about:M},asked:a.ask}),o(i=>ye(i)),m(!1);return}let t=a.hit;switch(t.about){case"node":o(i=>oe(ne(j(i,!1),t.id),[t.id]));break;case"kind":o(i=>se(j(i,!1),de(t.kind),{ownPicture:!0})),re.current=t.kind;break;case"place":o(i=>Qe(i,t.kind,t.as)),re.current=t.kind;break;case"rule":{let i=I.filter(w=>w.invariant===t.name).flatMap(w=>w.nodeIds);o(w=>oe(w,[...new Set(i)]));break}case"act":{o(w=>oe(w,[t.subject]));let i=y.current?.getBoundingClientRect();v({x:i?.left??0,y:(i?.bottom??0)+6,on:t.subject});break}}m(!1),y.current?.blur()},Da=x?Ya(x.byKind,x.hits,n.schema):"",te=R&&A.trim().length>0,Oa=(0,h.useCallback)(()=>{let a=y.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Za};let t=y.current?.getBoundingClientRect();return t?{x:t.right,y:t.bottom}:null},[]),Ge=ra("find",{open:te,onOpenChange:a=>{a||m(!1)},...e?{at:Oa}:{}});return(0,l.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,l.jsx)("input",{ref:a=>{y.current=a,Ge.trigger.ref(a)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":te,"aria-controls":C,"aria-autocomplete":"list",...te&&T?{"aria-activedescendant":T.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:A,onChange:a=>{let t=a.target.value;m(!0),o(i=>fa(i,t.length>0?t:null))},onFocus:()=>m(!0),onBlur:()=>m(!1),onKeyDown:a=>{let t=F!==null&&T?k.indexOf(T):-1,i=d=>d!==void 0&&!("ask"in d)&&d.hit.about==="act",w=t>=0&&T!==void 0&&!("ask"in T)&&T.hit.about==="node";if(a.key==="ArrowDown"){a.preventDefault(),m(!0);let d=t+1;if(w)for(;d<k.length-1&&i(k[d]);)d+=1;G(k[Math.min(k.length-1,d)])}else if(a.key==="ArrowUp")a.preventDefault(),G(k[Math.max(0,t-1)]);else if((a.key==="PageDown"||a.key==="PageUp")&&k.length>0){a.preventDefault(),m(!0);let d=k.flatMap((J,U)=>i(J)?[]:[U]),_=Math.max(0,d.findIndex(J=>J>=Math.max(t,0))),L=a.key==="PageDown"?Fe(k.length):-Fe(k.length);G(k[d[Math.min(d.length-1,Math.max(0,(t<0?-1:_)+L))]])}else if(a.key==="ArrowRight"&&w&&i(k[t+1]))a.preventDefault(),G(k[t+1]);else if(a.key==="ArrowLeft"&&i(T)){a.preventDefault();let d=t-1;for(;d>0&&i(k[d]);)d-=1;G(k[d])}else a.key==="Enter"?(a.preventDefault(),we(T)):a.key==="Escape"&&(a.preventDefault(),A?o(d=>ye(d)):y.current?.blur())},style:{width:"100%",boxSizing:"border-box",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-panel)",border:`1px solid ${A?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,l.jsx)("span",{role:"status","aria-live":"polite",style:na,"data-testid":"find-count",children:A.trim()?Da:""}),(0,l.jsxs)("div",{...Ge.pane,id:C,role:"listbox","aria-label":A?`What \u201C${A}\u201D finds`:"What the words find","data-testid":"find-strip",hidden:!te,onMouseDown:a=>a.preventDefault(),style:e?{...Ta,...er}:Ta,children:[k.every(a=>"ask"in a)?(0,l.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",x?.words||A,"\u201D."]}):ve.map(([a,t])=>(0,l.jsxs)("div",{role:"group","aria-label":Aa(a,n.schema),children:[(0,l.jsxs)("div",{role:"presentation",style:ar,children:[a!=="rule:"?(0,l.jsx)(Qa,{kind:a,accents:g?.accents}):null,Aa(a,n.schema)]}),t.map(i=>(0,l.jsx)("div",{id:i.id,role:"option","aria-selected":i===T,"data-testid":"find-hit","data-about":i.hit.about,...i.hit.about==="node"&&i.hit.near?{"data-near":""}:{},onMouseEnter:()=>G(i),onClick:()=>we(i),style:{...Ma,...i.hit.about==="act"?{paddingLeft:30}:{},background:i===T?"var(--graview-panel-muted)":"transparent"},children:(0,l.jsx)(ja,{hit:i.hit,flag:$})},i.id))]},a)),N?(0,l.jsx)("div",{id:N.id,role:"option","aria-selected":N===T||T?.id===N.id,"data-testid":"find-ask",onMouseEnter:()=>G(N),onClick:()=>we(N),style:{...Ma,borderTop:"1px solid var(--graview-edge)",marginTop:4,background:T?.id===N.id?"var(--graview-panel-muted)":"transparent"},children:(0,l.jsxs)("span",{children:["Ask: ",(0,l.jsxs)("span",{style:{fontWeight:600},children:["\u2018",N.ask,"\u2019"]})]})}):null,qe>Ja?(0,l.jsxs)("p",{role:"presentation",style:{margin:0,padding:"6px 12px 2px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},"data-testid":"find-more-words",children:[_e(qe)," found: another word of the name narrows them."]}):null,x&&x.searched.past===!1&&x.searched.kinds.some(a=>n.schema.tryDefinition(a)?.lifecycle)?(0,l.jsx)("p",{role:"presentation",style:{margin:0,padding:"6px 12px 8px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"Current ones; add is:any for the past."}):null]})]})}function ja({hit:e,flag:n}){switch(e.about){case"node":return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("span",{style:{fontWeight:600,overflowWrap:"anywhere"},children:[e.flagged?(0,l.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[n," "]}):null,e.label,e.apart?(0,l.jsxs)("span",{style:Q,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,l.jsx)("span",{style:Q,children:" \xB7 past"})]}),e.near?(0,l.jsxs)("span",{style:Q,"data-testid":"find-near",children:["Near \u201C",e.why.asked,"\u201D",e.why.field!=="label"?` \u2014 ${e.why.reading.toLowerCase()}: ${e.why.fragment}`:""]}):e.why.field!=="label"?(0,l.jsxs)("span",{style:Q,children:[e.why.reading.toLowerCase(),": ",e.why.fragment]}):null]});case"kind":return(0,l.jsxs)("span",{children:[e.label,(0,l.jsxs)("span",{style:Q,children:[" \xB7 ",e.count," match"]})]});case"place":return(0,l.jsxs)("span",{children:["Go to ",e.title]});case"rule":return(0,l.jsxs)("span",{children:["The rule \u201C",e.label,"\u201D"]});case"act":return(0,l.jsxs)("span",{style:e.destructive?{color:"var(--graview-warn)"}:void 0,children:[e.title,(0,l.jsxs)("span",{style:Q,children:[" \xB7 ",e.why.field==="title"?"act":`on ${e.why.fragment}`]})]})}}function Qa({kind:e,accents:n}){let s=Math.round(Ve(e,n));return(0,l.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${s} 55% 52%)`}})}function Aa(e,n){return e==="rule:"?"Rules":e==="act:"?"Acts":n.tryDefinition(e)?.plural??`${e}s`}function Ya(e,n,s){let o=Object.entries(e).map(([g,c])=>Ue(s,g,c)),r=n.filter(g=>g.about==="kind"||g.about==="place"||g.about==="rule").length;r>0&&o.push(`${r} ${r===1?"place or rule":"places and rules"}`);let v=n.filter(g=>g.about==="node"&&g.near).length;return o.length===0?"Nothing found":`${o.join(", ")} found${v>0?`, ${v} of them near`:""}`}var Xa=10,Ja=12,Ta={...aa,width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(60vh, 28rem)",overflowY:"auto",boxSizing:"border-box",background:"var(--graview-panel)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:"4px 0"},Za=6,er={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},ar={display:"flex",alignItems:"center",gap:6,padding:"8px 12px 2px",fontSize:"0.6875rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Ma={display:"grid",gap:1,minHeight:32,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)"},Q={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400};var Y=p(O(),1);var Be=p(Wa(),1);var La=p(f(),1);function Ra(){let{following:e,follow:n}=S();return e?(0,La.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>n(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",e.name]}):null}var Na=p(O(),1);var b=p(f(),1);function Ha({home:e,homeLabel:n,children:s,onPicture:o=!1}){let{view:r,focus:v,show:g,go:c}=K(),{store:M}=S(),{movedByHand:z}=S(),x=z&&(r.pan!==void 0||Object.keys(r.pins).length>0),I=r.focusId&&r.focusId!==e?M.graph.getNode(r.focusId):void 0,$=m=>ie(M.schema,m),y={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},C=n!==void 0&&I!==void 0,R=[];if(I&&!o&&R.push({key:"focused",node:(0,b.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>c(me({...r,focusId:e},!1)),title:he(M,I.id),style:{...y,maxWidth:"min(14rem, 15vw)"},children:[(0,b.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:he(M,I.id)}),(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),r.past&&R.push({key:"past",node:(0,b.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>c(ha(r,!1)),title:"Back to now \u2014 retired things leave the picture again",style:y,children:["the past",(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),r.zoom&&R.push({key:"zoomed",node:(0,b.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>c(me(r,!1)),title:"Zoom back out",style:y,children:["zoomed in",(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),x&&R.push({key:"moved",node:(0,b.jsx)("button",{type:"button","data-testid":"moved",onClick:()=>c(ue(r)),title:"Put the camera and everything you dragged back where the layout wanted them",style:y,children:"Reset view"})}),r.relation){let m=r.relation;R.push({key:"raised",node:(0,b.jsxs)("span",{style:{display:"inline-flex",alignItems:"center"},children:[(0,b.jsxs)("button",{type:"button","data-testid":"raised-into",onClick:()=>c(se(r,de(m),{ownPicture:!0})),title:`Go into the ${$(m).toLowerCase()}`,"aria-label":`Go into the ${$(m).toLowerCase()}`,style:{...y,color:"var(--graview-ink)"},children:[$(m),(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\u2198"})]}),(0,b.jsx)("button",{type:"button","data-testid":"raised",onClick:()=>g(null),title:`Stop showing ${$(m).toLowerCase()}`,"aria-label":`Stop showing ${$(m).toLowerCase()}`,style:{...y,minWidth:26,justifyContent:"center"},children:(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})})]})})}return o&&!C&&R.length===0&&s===void 0?null:(0,b.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...o?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[C?(0,b.jsx)("button",{type:"button",onClick:()=>v(e),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:n}):null,R.map(({key:m,node:F},ee)=>(0,b.jsxs)(Na.Fragment,{children:[C||ee>0?(0,b.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,F]},m)),s]})}var E=p(f(),1);function Pe(){let[e,n]=(0,Y.useState)([]),s=(0,Y.useCallback)(o=>{n(r=>{let v=o.phase!=="running"&&r[0]?.name===o.name&&r[0]?.at===o.at;return[o,...v?r.slice(1):r].slice(0,12)})},[]);return[e,s]}function De({find:e,calls:n,seat:s,remembers:o=!1}){return e?(0,E.jsxs)(E.Fragment,{children:[(0,Be.createPortal)((0,E.jsx)(Ia,{compact:e.compact}),e.slot),e.own?(0,Be.createPortal)((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Y.Suspense,{fallback:null,children:(0,E.jsx)(Ea,{})}),(0,E.jsx)(la,{calls:n,remembers:o,...s!==void 0?{seat:s}:{}})]}),e.own):null]}):null}function Oe({home:e=null}){return(0,E.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px - var(--graview-dock, 0px))",zIndex:P("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,E.jsx)(Ha,{home:e,onPicture:!0}),(0,E.jsx)("span",{style:{pointerEvents:"auto"},children:(0,E.jsx)(Ra,{})})]})}var q=p(O(),1);var Ba=p(f(),1),rr=V(()=>(__graviewPreload(import.meta.url,["./chunk.UGFDSE37.js","./chunk.VP35BUUZ.js","./chunk.7L6LYXCV.js","./chunk.SDO3U72B.js","./chunk.7MQ7UWVW.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.LBIDNJ6G.js")));function Ke(){let{store:e,principal:n}=S(),s=(0,q.useContext)(pa),o=(0,q.useRef)(null),r=(0,q.useRef)(!1);return(0,q.useEffect)(()=>()=>void(r.current=!0),[]),(0,q.useEffect)(()=>{let v=e.batches().length,g=rr().then(c=>c.sceneWay(e,n,s,v,o.current),()=>{});return()=>void g.then(c=>c?.(r.current))},[e,n,s]),(0,Ba.jsx)("span",{ref:o,hidden:!0})}var Pa=p(O(),1);var u=p(f(),1);function Ht({address:e=!1,auto:n,quickAsk:s=!0,scheme:o,scope:r}){let v=(0,Pa.useMemo)(()=>`${Te({scope:`.${r}`})}
|
|
1127
1127
|
${Me(o,{scope:`.${r}`})}`,[o,r]),g=ga(),[c]=Pe();return(0,u.jsx)(Ze.Provider,{value:!0,children:(0,u.jsxs)("div",{"data-embed-content":"",style:{position:"relative",flex:n?`0 0 ${Sa}px`:"1 1 auto",minHeight:0,containerType:"size"},children:[(0,u.jsx)("style",{children:v}),e?(0,u.jsx)(ka,{}):null,(0,u.jsx)(ya,{}),(0,u.jsx)(Oe,{}),(0,u.jsx)(Le,{}),(0,u.jsx)(Ie,{}),(0,u.jsx)($e,{}),(0,u.jsx)(ze,{face:"scene",on:s}),(0,u.jsx)(Re,{}),(0,u.jsx)(xe,{children:(0,u.jsx)(ke,{children:(0,u.jsx)(Ee,{children:(0,u.jsx)(Ae,{children:(0,u.jsx)(Se,{placement:"menu"})})})})}),(0,u.jsx)(be,{}),(0,u.jsx)(Ce,{}),(0,u.jsx)(De,{find:g,calls:c}),(0,u.jsx)(Ke,{}),(0,u.jsx)(fe,{face:"scene"})]})})}function Bt(){return(0,u.jsx)(He,{})}export{Ht as SceneFace,Bt as SceneKeeping};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as a,l as b,m as c,n as d,o as e,p as f,q as g,r as h,s as i}from"./chunk.YKN2VWWQ.js";import"./chunk.Q5XICUDZ.js";import"./chunk.UT6642FC.js";import"./chunk.SGRKCQ2X.js";import"./chunk.KG5R4GTK.js";import"./chunk.ZEC64CK6.js";import"./chunk.TI4OSTQV.js";import"./chunk.T4Q6OLZU.js";import"./chunk.RSYFIL2Z.js";import"./chunk.R7F6UJVG.js";import"./chunk.DYW4D74X.js";import"./chunk.VP35BUUZ.js";import"./chunk.7L6LYXCV.js";import"./chunk.SDO3U72B.js";import"./chunk.7MQ7UWVW.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{i as GhostTray,h as InlineAiMenu,g as askAgain,c as askInline,a as askOf,b as drawPanel,d as heldSuggestion,e as suggestOnce,f as takeOffer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Aa as k,R as w,j as c,l as h,m as b,r as f,ya as y}from"./chunk.
|
|
1
|
+
import{Aa as k,R as w,j as c,l as h,m as b,r as f,ya as y}from"./chunk.7L6LYXCV.js";import{U as i}from"./chunk.7MQ7UWVW.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=null,a=new Set,v=e=>{s={kind:e,n:(s?.n??0)+1};for(let t of a)t()},A=()=>s,C=e=>(a.add(e),()=>a.delete(e)),V=()=>{s=null};var d=g(w(),1);function T(e,t){if(e.length===0||t.length===0)return[];let o=new Set(t.map(n=>n.id));return e.filter(n=>n.nodeIds.some(l=>o.has(l)))}var x=(e,t)=>`${i(e)} ${e===1?"problem":"problems"} in ${t}`;function q({kind:e,plural:t,problems:o,flag:n,listed:l=!1}){let{view:p,go:P}=k(),{set:$}=y();if(o.length===0)return null;let u=x(o.length,t),m=o.length===1?"it":"them";return(0,d.jsx)("button",{type:"button",className:"graview-district-problems","data-testid":`district-problems-${e}`,"data-graview-problems":o.length,"aria-expanded":l,"aria-label":u,title:`${u} \u2014 ${o[0].message}${o.length>1?` (and ${i(o.length-1)} more)`:""}. Press to see ${m} and how to fix ${m}.`,onClick:r=>{r.stopPropagation(),p.overview||P(h(c(b(p,!0),null),"view",null)),$([f(e)]),v(e)},onDoubleClick:r=>r.stopPropagation(),onPointerDown:r=>r.stopPropagation(),children:(0,d.jsx)("span",{"aria-hidden":"true",children:`${n} ${i(o.length)}`})})}export{A as a,C as b,V as c,T as d,x as e,q as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m}from"./chunk.
|
|
1
|
+
import{c as m}from"./chunk.MI2HL3LQ.js";import{ca as c,da as u,ea as f,ga as p,ka as h,la as l}from"./chunk.7MQ7UWVW.js";function A(t,e){let n=t.schema.kinds,r="kind"in e?e.kind:void 0;if(r!==void 0&&!n.includes(r))return`There is no kind "${r}" in this app. Its kinds are: ${n.join(", ")}.`;if(e.on==="act"&&e.act!==void 0&&t.allMutations&&!t.allMutations().some(i=>i.name===e.act))return`There is no act "${e.act}" in this app.`;let o="record"in e?e.record:void 0;if(o!==void 0&&t.graph&&!t.graph.getNode(o))return`No record "${o}" is here to be told about.`;if(o!==void 0&&r!==void 0&&t.graph&&t.graph.getNode(o)?.kind!==r)return`\u201C${o}\u201D is not ${h(r)}.`;if(e.on==="changed"&&e.kind===void 0&&e.record===void 0)return"Say which kind, or which record, to be told about.";if(e.on==="reaches"){if(e.condition.trim()==="")return"Say what it should reach: a condition like done == true.";try{m(e.condition)}catch(i){return`The condition does not read: ${i instanceof Error?i.message:String(i)}.`}}}function a(t,e){let n=t.graph?.getNode(e);return n?c(t.schema.tryDefinition(n.kind),n):e}function g(t,e){let n=t.allMutations?.().find(r=>r.name===e);return n?u(n):f(e)}function M(t,e){let{when:n}=e,r=e.alsoMine?"anyone":"someone else",o=d=>l(t.schema.tryDefinition(d),d),i=d=>{let s=o(d);return`${/^[aeiou]/i.test(s)?"an":"a"} ${s}`};switch(n.on){case"act":{let d=n.act!==void 0?`\u201C${g(t,n.act)}\u201D`:"an act";return`When ${r} runs ${d}${n.record!==void 0?` on \u201C${a(t,n.record)}\u201D`:""}`}case"created":return`When ${r} adds ${i(n.kind)}`;case"changed":return n.record!==void 0?`When ${r} changes \u201C${a(t,n.record)}\u201D`:`When ${r} changes any of the ${p(t.schema,n.kind)}`;case"reaches":return`When ${n.record!==void 0?`\u201C${a(t,n.record)}\u201D`:i(n.kind)} reaches ${n.condition}${e.alsoMine?"":" (by someone else)"}`}}export{A as a,M as b};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{C as y,Fb as $,Jb as x,L as h,U as g,ea as m}from"./chunk.
|
|
1
|
+
import{C as y,Fb as $,Jb as x,L as h,U as g,ea as m}from"./chunk.7MQ7UWVW.js";function B(n,e,t){let o=n?.display?.format?.[e];return o?o(t):typeof t=="string"?m(t):String(t)}function G(n,e,t,o){let s=n.tryDefinition(e)?.edges,i=s&&Object.hasOwn(s,t)?s[t]:void 0;return(o==="out"?i?.description:i?.inverse)??m(t).toLowerCase()}var O=Symbol.for("@graview/core:markdown");function S(n){let e=y(n);return!!e&&(e[O]===1||S(e.innerType))}var w=/^ {0,3}#{1,6}(?:[ \t]+|$)/,b=/^[ \t]*(?:[-*+•]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?/,k=/^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,R=/^ {0,3}(?:`{3,}|~{3,})/,F=/^ {0,3}(?:>[ \t]?)+/,A=/^\|?\s*:?-{2,}:?\s*(?:\|\s*:?-{2,}:?\s*)*\|?$/,_={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'",nbsp:" "};function E(n){return n.replace(/!?\[([^\]\n]{0,500})\]\([^)\n]{0,500}\)/g,"$1").replace(/<((?:https?:|mailto:)[^>\s]*)>/gi,"$1").replace(/<\/?[A-Za-z][^<>\n]*>/g,"").replace(/`+([^`\n]*)`+/g,"$1").replace(/(\*\*|__|~~)(?=\S)([^\n]{0,500}?\S)\1/g,"$2").replace(/(^|[^\w*])\*(?=\S)([^*\n]{0,500}?\S)\*(?![\w*])/g,"$1$2").replace(/(^|\W)_(?=\S)([^_\n]{0,500}?\S)_(?!\w)/g,"$1$2").replace(/\\([\\`*_{}[\]()#+\-.!>|~])/g,"$1").replace(/&(amp|lt|gt|quot|#39|nbsp);/g,(e,t)=>_[t]??"")}function N(n,e,t){let o=n.replace(/\r\n?/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),s=[],i=[],c=0,d=!1,u=()=>{let r=i.join(" ").replace(/\s+/g," ").trim();r&&(s.push(r),c+=r.length),i=[]},a=0;for(;a<o.length&&c<=t;){let r=o[a++];if(e&&R.test(r)){d=!d,d||u();continue}if(!d&&(r.trim().length===0||e&&(k.test(r)||A.test(r.trim())))){u();continue}let f=!d&&e&&w.test(r),l=!d&&b.test(r);if((f||l)&&u(),e&&!d?(r=r.replace(F,""),f&&(r=r.replace(w,"").replace(/[ \t]+#+[ \t]*$/,"")),l&&(r=r.replace(b,"")),r.includes("|")&&(r=r.replace(/^[ \t]*\||\|[ \t]*$/g,"").split("|").map(p=>p.trim()).filter(Boolean).join(" \xB7 ")),r=E(Number.isFinite(t)?r.slice(0,t*2+200):r)):l&&(r=r.replace(b,"")),i.push(r),f&&u(),i.reduce((p,T)=>p+T.length,0)>t)break}return u(),{blocks:s,more:o.slice(a).some(r=>r.trim().length>0&&!(e&&(R.test(r)||k.test(r))))}}function M(n,e){return`${(n.slice(0,e+1).replace(/\s+\S*$/,"")||n.slice(0,e)).replace(/[\s,;:.—-]+$/,"")}\u2026`}function Z(n,e={}){let t=e.most??160,{blocks:o,more:s}=N(n,e.markdown===!0,t),i=o[0]??"";if(i.length<=t)return(s||o.length>1)&&i.length>0&&!/[.!?…:]$/.test(i)?`${i}\u2026`:i;let c=x(i);return c&&c.length<=t?c:M(i,t)}var J=n=>N(n,!0,Number.POSITIVE_INFINITY).blocks.join(" ");var j={d:1440,h:60,m:1};function ne(n){if(typeof n=="number")return Number.isFinite(n)&&n>=0?Math.round(n):void 0;if(typeof n!="string")return;let e=n.trim().toLowerCase();if(/^\d+$/.test(e))return Number(e);let t=/^(\d+):([0-5]\d)(?::([0-5]\d))?$/.exec(e);if(t)return Number(t[1])*60+Number(t[2])+Math.round(Number(t[3]??0)/60);let o=0,s=!1,i=e.replace(/(\d*[.,]?\d+) *(days?|d|hours?|hrs?|hr|h|minutes?|mins?|min|m)(?![a-z])/g,(c,d,u)=>(s=!0,o+=Number(d.replace(",","."))*j[u[0]]," "));return s&&/^[\s,+]*(?:and[\s,+]*)*$/.test(i)?Math.round(o):void 0}function I(n,e){if(!Number.isFinite(n))return String(n);let t=Math.round(Math.abs(n)),o=Math.floor(t/60),s=t%60,i=[o?`${g(o,e)} h`:"",s||!o?`${g(s,e)} min`:""].filter(Boolean).join(" ");return n<0?`\u2212${i}`:i}var D=/^(\+?1[ .-]?)?\(?([2-9]\d\d)\)?[ .-]?(\d{3})[ .-]?(\d{4})(?: *(?:ext\.?|x|#) *(\d+))?$/i;function W(n,e){let t=n.trim(),o=/[-_](US|CA)\b/i.test(h(e))?D.exec(t):null;if(!o)return t;let[,s,i,c,d,u]=o;return`${s?.startsWith("+")?"+1 ":""}(${i}) ${c}-${d}${u?` ext. ${u}`:""}`}function P(n){let[,e="",t]=/^(.*?)(?: *(?:ext\.?|x|#) *(\d+))?$/i.exec(n.trim())??[],o=e.replace(/\D/g,"");return o.length<3?void 0:`tel:${e.startsWith("+")?"+":""}${o}${t?`;ext=${t}`:""}`}var L=()=>/Mac|iPhone|iPad|iPod/.test(globalThis.navigator?.userAgent??"");function q(n,e=L()){let t=encodeURIComponent(n.trim());return e?`https://maps.apple.com/?q=${t}`:`https://www.google.com/maps/search/?api=1&query=${t}`}var C=n=>n?.fields?.shape??{},U=(n,e)=>{let t=C(n);return Object.hasOwn(t,e)?$(t[e]):void 0},H=(n,e)=>{let t=n.computed,o=t&&Object.hasOwn(t,e)?t[e]:void 0;return typeof o=="object"?o.as:void 0};function te(n,e){return U(n,e)??(n&&H(n,e)==="duration"?"duration":void 0)}function re(n,e,t){return n==="duration"?typeof e=="number"?I(e,t):void 0:n==="phone"?typeof e=="string"?W(e,t):void 0:n==="place"&&typeof e=="string"?e.trim():void 0}function oe(n,e){if(!(typeof e!="string"||!e.trim()))return n==="phone"?P(e):n==="place"?q(e):void 0}export{S as a,B as b,G as c,Z as d,J as e,ne as f,te as g,re as h,oe as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as C,e as L,n as H,o as R,p as k}from"./chunk.YKN2VWWQ.js";import"./chunk.Q5XICUDZ.js";import"./chunk.UT6642FC.js";import"./chunk.SGRKCQ2X.js";import"./chunk.KG5R4GTK.js";import{a as S}from"./chunk.ZEC64CK6.js";import"./chunk.TI4OSTQV.js";import"./chunk.T4Q6OLZU.js";import"./chunk.RSYFIL2Z.js";import"./chunk.R7F6UJVG.js";import"./chunk.DYW4D74X.js";import"./chunk.VP35BUUZ.js";import{Ea as E,G as T,R as b}from"./chunk.7L6LYXCV.js";import"./chunk.SDO3U72B.js";import{wc as x}from"./chunk.7MQ7UWVW.js";import"./chunk.2AZTW66C.js";import{b as g}from"./chunk.AJZBJBMO.js";var t=g(T(),1);var c=g(b(),1);function N(n){if(!n||n.interaction.outcome==="failed")return null;let s=n.offers[0],o=s?n.interaction.offered.find(i=>i.id===s.id)?.confidence:void 0;return s&&o!==void 0&&o>=.6?{offer:s,confidence:o}:null}function j({rest:n,hold:s,leave:o}){let i=S(),u=(0,t.useMemo)(()=>C(n.target,e=>i.store.graph.has(e)),[n.target,i.store]),l=u.on==="record"&&L(i.ai)!==void 0,m=l?H(i,u):void 0,p=JSON.stringify(u),[y,I]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!l||m!==void 0)return;let e=!0;return R(i,u).then(r=>{e&&I({key:p,result:r})}),()=>{e=!1}},[p,l]);let w=m??(y?.key===p?y.result:void 0),f=l?N(w):null,v=f?.offer.id??null,h=(0,t.useRef)(null);if((0,t.useEffect)(()=>{if(v===null)return;let e=r=>{r.target instanceof Node&&h.current?.contains(r.target)||o(!0)};return document.addEventListener("pointerdown",e,{capture:!0,passive:!0}),document.addEventListener("contextmenu",e,{capture:!0,passive:!0}),addEventListener("scroll",e,{capture:!0,passive:!0}),addEventListener("resize",e,{passive:!0}),()=>{document.removeEventListener("pointerdown",e,{capture:!0}),document.removeEventListener("contextmenu",e,{capture:!0}),removeEventListener("scroll",e,{capture:!0}),removeEventListener("resize",e)}},[v,o]),(0,t.useLayoutEffect)(()=>{let e=h.current;if(!e)return;if(typeof e.showPopover=="function"&&!E(e))try{e.showPopover()}catch{}let r=n.element.getBoundingClientRect(),d=e.getBoundingClientRect(),O=r.top-d.height-4>=4?r.top-d.height-4:Math.min(innerHeight-d.height-4,r.top+4),A=Math.max(4,Math.min(innerWidth-d.width-4,r.right-d.width));e.style.top=`${Math.round(O)}px`,e.style.left=`${Math.round(A)}px`},[v,n.element]),!f)return null;let{offer:a,confidence:P}=f,M=a.type==="panel"?"a panel":a.type==="place"?"go there":a.type==="record"?"open it":"suggested";return(0,c.jsxs)("button",{ref:h,type:"button",popover:"manual","data-testid":"hover-chip","data-ai-offer":a.id,"data-ai-offer-type":a.type,"data-graview-overlay":"","data-graview-popover":"","aria-label":`Suggested by AI: ${a.label}`,title:`Suggested by AI, ${Math.round(P*100)}% sure`,onPointerEnter:s,onPointerLeave:()=>o(),onClick:()=>{n.element.closest("[tabindex], a[href], button")?.focus({preventScroll:!0}),o(!0),k(i,w,a)},style:$,children:[(0,c.jsxs)("span",{"aria-hidden":"true",style:{color:"var(--graview-accent)"},children:["\u2726"," "]}),a.label,(0,c.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",M]})]})}var $={position:"fixed",inset:"auto",top:0,left:0,margin:0,zIndex:x("toast"),boxSizing:"border-box",width:"max-content",maxWidth:"min(320px, calc(100vw - 8px))",height:"auto",minHeight:24,padding:"2px 10px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",borderRadius:999,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",font:"inherit",fontSize:"0.75rem",cursor:"pointer"};export{j as HoverChip};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v}from"./chunk.TI4OSTQV.js";import{f as P}from"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";function G(e,n){let r;for(let o of[...e??[]].sort((a,s)=>a.seq-s.seq)){if(o.seq>n)break;o.declaration&&(r=o.declaration)}return r}var q=new WeakMap;function T(e,n){let r=G(e?.declarations,n),o=e?.declarationAt,a=[...e?.declarations??[]].filter(i=>i.seq<=n).sort((i,d)=>i.seq-d.seq).at(-1);if(!o||!a||a.declaration)return{declaration:r};let s=q.get(o);s||q.set(o,s=new Map);let t=s.get(a.seq);if(!t){let i={settled:!0,declaration:void 0,waiting:Promise.resolve()};try{let d=o(a.seq);d instanceof Promise?(i.settled=!1,i.waiting=d.then(f=>void Object.assign(i,{settled:!0,declaration:f}),()=>void(i.settled=!0))):i.declaration=d}catch{}s.set(a.seq,t=i)}return t.settled?{declaration:t.declaration??r}:{waiting:t.waiting}}var E=e=>e,D=new WeakMap,x=new WeakMap;function H(e,n){let r=typeof n=="string"?Date.parse(n):n.getTime();if(Number.isNaN(r))throw new RangeError(`\u201C${String(n)}\u201D is not a time`);let a=e.log.all().findIndex(s=>Date.parse(s.at)>r);return a===-1?e.log.length:e.log.horizon+a}function j(e,n,r={}){let o=v(e);if(o)return j(o.store,n,r).seenBy(o.principal);let a=e.log,s=a.horizon,t=typeof n=="number"?n:H(e,n);if(!Number.isInteger(t)||t<s||t>a.length)throw new RangeError(`No moment at seq ${t}: this store holds seqs ${s} to ${a.length}${s>0?"; what is before its horizon is in the archive":""}`);let i=a.all(),d=r.declaration,f=d?.schema??e.schema,l=a.epochs().filter(c=>c.seq<=t),p=l.at(-1),u=p?.seq??s,A=c=>c>s?i[c-1-s]?.id:void 0,m=(D.get(e)??[]).filter(c=>c.seq<=a.length&&A(c.seq)===c.id);D.set(e,m);let w=[...m].reverse().find(c=>c.seq>=u&&c.seq<=t),g=w?.seq??u,V=w?.base??p?.base??U(e),S=z(e,f,V),M=e.pastEvery,O=(c,y)=>{m.some(b=>b.seq===c)||(m.push({seq:c,id:y,base:S.snapshot()}),m.sort((b,B)=>b.seq-B.seq))};for(let c=g;c<t;c++){let y=i[c-s];try{K(S,y)}catch{}(c+1)%M===0&&c+1<t&&O(c+1,y.id)}t-g>=M&&O(t,A(t));let W=i[t-1-s]?.at??p?.at;return I(e,d,{graph:S,log:i.slice(0,t-s),epochs:l,...s>0&&!l.some(c=>c.horizon)?{horizon:s}:{},seq:t,at:W,from:g})}var h=(e,n)=>n===void 0?{}:{[e]:n};function I(e,n,r){let o=E(e),a=e.constructor;return new a({schema:n?.schema??e.schema,invariants:n?.invariants??o.invariants,invariantOptions:o.invariantOptions,...h("policy",n?n.policy:e.policy),...h("modules",n?.modules??o.declaredModules),...h("enabledModules",o.startingModules),...h("timeZone",e.timeZone),intelligence:e.intelligence,principal:o.by,log:[...r.log],epochs:[...r.epochs],...h("horizon",r.horizon),snapshot:r.graph.snapshot(),validate:!1,now:o.now,past:{seq:r.seq,...h("at",r.at),foldedFrom:r.from,folded:r.seq-r.from}})}function z(e,n,r){let o=e.graph.constructor;try{return o.from(n,r,{validate:E(e).validate})}catch{return o.from(n,r,{validate:!1})}}var $=256,N=new WeakMap;function C(e){let n=N.get(e);return n||N.set(e,n={ops:new Map,epochs:new Map,chunks:new Map,marks:new Map}),n}function k(e,n){let r=-1,o;for(let[i,d]of e.epochs)i<=n&&i>r&&([r,o]=[i,d.base]);for(let[i,d]of e.marks)i<=n&&i>r&&([r,o]=[i,d]);let a=-1;for(let i=n-1;i>=Math.max(r,0);i--)if(!e.ops.has(i)){a=i;break}if(a<0&&o)return{from:r,base:o};let s=a<0?0:a-a%$,t=e.chunks.get(s);return!t||t.settled&&!t.refused&&a>=t.to?{ask:s}:t.settled?t.refused?{refused:t.refused}:a<0?{from:0,base:{nodes:[],edges:[]}}:{refused:`The archive is missing a change this moment needs (seq ${a})`}:{waiting:t.waiting}}function F(e,n,r,o){let a=Math.min(r+$,o),s={to:a,settled:!1,waiting:Promise.resolve()};s.waiting=Promise.resolve().then(()=>n(r,a)).then(t=>{let i=Array.isArray(t)?{ops:t}:t;if(!Array.isArray(i?.ops))throw new Error("its answer held no ops");for(let d of i.ops)Number.isInteger(d?.seq)&&d.seq<o&&!e.ops.has(d.seq)&&e.ops.set(d.seq,d);for(let d of i.epochs??[])Number.isInteger(d?.seq)&&d.seq<o&&d.base&&e.epochs.set(d.seq,d)}).then(()=>void(s.settled=!0),t=>void Object.assign(s,{settled:!0,refused:`Could not read the older changes from the archive: ${t instanceof Error?t.message:String(t)}`})),e.chunks.set(r,s)}function J(e,n,r){let o=r?.archived,a=e.log.horizon;if(!o||n>=a)return;let s=C(o),t=k(s,n);return"ask"in t&&(F(s,o,t.ask,a),t=k(s,n)),"base"in t||"ask"in t?void 0:{seq:n,...t}}function R(e,n,r,o){let a=v(e);if(a)return R(a.store,n,r,o).seenBy(a.principal);if(!Number.isInteger(n)||n<0)throw new RangeError(`No moment at seq ${n}`);let s=C(r),t=k(s,n);if(!("base"in t))throw new RangeError("refused"in t?t.refused:`The changes before seq ${n} are still being read from the archive`);let i=z(e,o?.schema??e.schema,t.base),d=[],f=e.pastEvery;for(let p=t.from;p<n;p++){let u=s.ops.get(p);d.push(u);try{K(i,u)}catch{}(p+1)%f===0&&p+1<n&&!s.marks.has(p+1)&&s.marks.set(p+1,i.snapshot())}n-t.from>=f&&s.marks.set(n,i.snapshot());let l=s.epochs.get(t.from);return I(e,o,{graph:i,log:d,epochs:l?[l]:[],...t.from>0?{horizon:t.from}:{},seq:n,at:d.at(-1)?.at??l?.at,from:t.from})}function U(e){let n=e.log.all(),r=e.log.horizon,o=n[0]?.id,a=x.get(e);if(a&&a.firstId===o)return a.base;let s=e.log.epochs().find(d=>d.seq>r),t=e.graph.constructor.from(e.schema,s?.base??e.graph.snapshot(),{validate:!1});for(let d=(s?.seq??e.log.length)-1;d>=r;d--)try{t.applyPrimitives(P(n[d-r]),{restoring:!0})}catch{}let i=t.snapshot();return x.set(e,{firstId:o,base:i}),i}function L(e,n,r={}){let o=typeof n=="number"?n:H(e,n),a=T(r,o),s="declaration"in a?a.declaration:G(r.declarations,o);return r.archived&&o<e.log.horizon?R(e,o,r.archived,s):j(e,o,{declaration:s})}function K(e,n){if(n.undoes!==void 0){e.applyPrimitives(n.primitives,{restoring:!0});return}try{e.applyPrimitives(n.primitives)}catch{e.applyPrimitives(n.primitives,{restoring:!0})}}export{J as askArchived,T as askDeclaration,G as declarationAt,L as pastAt,j as pastOf,H as seqAt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as n}from"./chunk.4ZHUGSJL.js";import"./chunk.DJ3BD7AZ.js";import"./chunk.S2MP53RO.js";import"./chunk.7MXQRSNR.js";import"./chunk.6XEATXZC.js";import"./chunk.5TBK44MK.js";import"./chunk.27QYTMXP.js";import"./chunk.VCOIFBUE.js";import"./chunk.RQBX7M7Q.js";import"./chunk.CTSPNTDX.js";import"./chunk.BT6FUNQI.js";import"./chunk.MBOOUJOE.js";import"./chunk.WVUJXDXZ.js";import{e as p}from"./chunk.QWY54AVN.js";import"./chunk.T4Q6OLZU.js";import"./chunk.R2B2ZAWI.js";import"./chunk.7XCBIID7.js";import"./chunk.MI2HL3LQ.js";import"./chunk.TMBFLZNH.js";import"./chunk.GZHZLJBF.js";import"./chunk.EBTYR5CZ.js";import"./chunk.OJGHDWI6.js";import"./chunk.OWL5GZ6U.js";import"./chunk.RSYFIL2Z.js";import"./chunk.R7F6UJVG.js";import"./chunk.DYW4D74X.js";import"./chunk.VP35BUUZ.js";import{R as m}from"./chunk.7L6LYXCV.js";import"./chunk.SDO3U72B.js";import"./chunk.7MQ7UWVW.js";import"./chunk.2AZTW66C.js";import{b as t}from"./chunk.AJZBJBMO.js";var i=t(m(),1),a=new WeakMap;function s(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{s as homeView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as O}from"./chunk.OJGHDWI6.js";import{e as C}from"./chunk.
|
|
1
|
+
import{l as O}from"./chunk.OJGHDWI6.js";import{e as C}from"./chunk.RSYFIL2Z.js";import{$ as I,G as x,R as M,_ as w,aa as W,c as V,x as B,xa as G}from"./chunk.7L6LYXCV.js";import{C as D,Ib as F,Ob as N,rc as _,sc as L,yc as j}from"./chunk.7MQ7UWVW.js";import{b as m}from"./chunk.AJZBJBMO.js";function H(t,e){let n=t.graph.getNode(e);if(!n)return[];let i=n.kind,a=t.schema.tryDefinition(i);if(!a)return[];let c=t.seenFor,u=c?j.keptFrom?.(t,c)?.(n):void 0,o=new Map;for(let r of t.allMutations()){let s=r.subject;if(!s||!(s.kinds==="*"||s.kinds.includes(i)))continue;let l=r.input.shape??{};for(let d of N(r,a)){if(u?.(d))continue;let b=d in l,k=[];for(let h of Object.keys(l)){if(h===s.arg||h===d||X(l[h]))continue;let v=F(r.input).find(S=>S.name===h);k.push({name:h,...v?{kinds:v.kinds}:{},...v?{candidates:v.kinds.includes("*")?t.graph.allNodes().map(S=>S.id):v.kinds.flatMap(S=>t.graph.nodesOfKind(S).map(J=>J.id))}:{},shape:C(r.input,h)})}let Q={field:d,mutation:r.name,title:r.title??r.name,shape:b?C(r.input,d):{type:"unknown"},takesValue:b,alternatives:[],open:k,call:h=>({name:r.name,args:b?{[s.arg]:e,[d]:h}:{[s.arg]:e}})};o.set(d,[...o.get(d)??[],Q])}}return[...o.values()].map(r=>{let s=[...r.filter(d=>d.takesValue),...r.filter(d=>!d.takesValue)],[f,...l]=s;return{...f,alternatives:l}})}function X(t){let e=D(t)?.type;return e==="optional"||e==="default"||e==="nullable"}var R=m(x(),1);function be(t){let{store:e,principal:n}=w(),i=W(),a=(0,R.useMemo)(()=>t===null?[]:H(e,t),[e,t,i]),c=(0,R.useCallback)((u,o,r={})=>{let s=u.call(o);e.apply({name:s.name,args:{...s.args,...r}},{author:n})},[e,n]);return{fields:a,commit:c}}var K=m(x(),1);function Qe(){let{brand:t}=w(),e=t?.kit;return(0,K.useMemo)(()=>_(e),[e])}function Je(t,e){let n=L(t,e),i={...n.color!==void 0?{color:n.color}:{},...n.pattern!==void 0?{pattern:n.pattern}:{},...n.width!==void 0?{width:n.width}:{},...n.cap!==void 0?{cap:n.cap}:{},...n.opacity!==void 0?{opacity:n.opacity}:{}};return{connector:n,style:O(e,{[e]:i})}}var $=m(x(),1);var g=m(M(),1);function Z(t){let e=t?.hint;return typeof e=="string"&&e.length>0?e:void 0}function ee(t){if(t instanceof Error&&t.message)return t.message;let e=String(t);return e==="[object Object]"?"The view threw without a message.":e}var U=class extends $.Component{static contextType=G;state={};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){console.error(`[graview] the ${this.props.view??"view"} of ${this.props.kind} threw while rendering`,e,n.componentStack),this.context?.(e,{module:"@graview/react"})}render(){let{error:e}=this.state;if(!e)return this.props.children;let n=Z(e);return(0,g.jsxs)("div",{role:"alert","data-graview-view-error":this.props.kind,style:{display:"flex",flexDirection:"column",gap:"0.375rem",padding:"var(--graview-pad, 12px)",height:"100%",overflow:"auto",boxSizing:"border-box",borderRadius:"var(--graview-radius-sm, 6px)",background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)",font:"var(--graview-font-body, 13px/1.45 system-ui)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,g.jsx)("strong",{style:{color:"var(--graview-warn, #b4462a)"},children:this.props.view?`${this.props.view} could not draw`:"This view could not draw"}),(0,g.jsx)("span",{style:{color:"var(--graview-ink-muted, #555)"},children:this.props.kind}),(0,g.jsx)("span",{children:ee(e)}),n?(0,g.jsx)("span",{style:{color:"var(--graview-ink-muted, #555)"},children:n}):null]})}};var y=m(x(),1);var q=m(M(),1),A=(0,y.createContext)([]);function nt({sections:t,children:e}){let n=(0,y.useContext)(A),i=(0,y.useMemo)(()=>[...n,...t.filter(a=>!n.includes(a))],[n,t]);return(0,q.jsx)(A.Provider,{value:i,children:e})}function z(){let t=(0,y.useContext)(A),e=I()?.menuSections;return(0,y.useMemo)(()=>e?[...t,...e.filter(n=>!t.includes(n))]:t,[t,e])}function rt(){let t=z();return(0,y.useCallback)(e=>{for(let n of t)try{n(e)?.prepare?.()}catch{}},[t])}function ot(t){let e=z();if(t===null||e.length===0)return{start:[],end:[]};let n=e.flatMap(i=>{try{let a=i(t);return a&&((a.items?.length??0)>0||a.render)?[a]:[]}catch{return[]}});return{start:n.filter(i=>i.at==="start"),end:n.filter(i=>i.at!=="start")}}var te=m(x(),1);function st(){return w().activity}var P=(t,e)=>t.length*e*.58;var ne=156,re=2,E=ne-18,oe=7.1,ie=16;function ae(t,e){let n=0,i=E;for(let a of t.split(" ")){let c=e(a),u=i+e(" ")+c;if(u<=E)i=u;else{let o=Math.ceil(c/E)||1;n+=o,i=c-(o-1)*E}}return n}var se=16.25,Y=27,ce=(t,e)=>{let n=Math.ceil(t.length*oe/E);return e?Math.max(Y,Math.ceil(Math.max(n,ae(t,e))*se)+6):Math.max(Y,n*ie+6)};function ut(t,e,n){return t.length===0?0:10+t.reduce((i,a)=>i+ce(a,n),0)+(t.length-1)*re}var de=27,ue=8,lt=4,le=64,pt=t=>Math.max(1,Math.min(ue,t)),ft=t=>t*de+le;var p=m(x(),1);function gt(t,{units:e,target:n=0,legibleAt:i=260}){let[a,c]=(0,p.useState)(e);(0,p.useEffect)(()=>{let o=t.current;if(o===null||typeof ResizeObserver>"u")return;let r=new ResizeObserver(([s])=>{let f=s?.contentRect.width??0;f>0&&c(f)});return r.observe(o),()=>r.disconnect()},[t]);let u=a/e;return{scale:u,width:a,touchable:u*n>=24,legible:a>=i}}function xt(t="--graview-font-body",e="sans-serif"){let n=(0,p.useRef)(void 0),i=(0,p.useMemo)(()=>{if(typeof getComputedStyle!="function"||typeof document>"u")return e;let a=getComputedStyle(document.documentElement).getPropertyValue(t).trim();return a.length>0?a:e},[t,e]);return(0,p.useMemo)(()=>{n.current===void 0&&(n.current=typeof document>"u"?null:document.createElement("canvas").getContext("2d")??null);let a=n.current;return a===null?P:(c,u)=>{a.font=`${u}px ${i}`;let o=a.measureText(c).width;return o>0?o:P(c,u)}},[i])}var wt=(0,p.createContext)(void 0);var T=3;function pe(t){let e=V(t),n=e.focusId;if(!n)return null;if(e.within?.view){let[a]=B(n);if(a)return{at:`screen:${a}`,audience:!0}}return{at:n,audience:!1}}var fe=102,me=32;function St(t,e,n){let i=[],a=new Map,c=new Map,u=0;for(let o of t){let r=pe(o.stop),s=r?e(r.at):null;if(!r||!s){o.name&&i.push({kind:"edge",presence:o,point:{x:n-8,y:fe+u++*me}});continue}if(!o.name){let k=c.get(r.at);c.set(r.at,{n:(k?.n??0)+1,box:s});continue}let f=a.get(r.at)??[];if(f.push(o),a.set(r.at,f),f.length>T)continue;let l=s,d=f.length-1,b=r.audience?{x:l.x+l.width*.5+(d-1)*26,y:l.y+Math.min(l.height,24)}:{x:l.x+l.width*.5-26-d*26,y:l.y+l.height-4};i.push({kind:"person",presence:o,point:b,at:r.at,index:d,of:f.length,audience:r.audience})}for(let[o,r]of a){if(r.length<=T)continue;let s=e(o);s&&i.push({kind:"count",at:o,point:{x:s.x+s.width*.5+2*26+18,y:s.y+s.height-4},n:r.length-T})}for(let[o,{n:r,box:s}]of c)i.push({kind:"count",at:o,point:{x:s.x+s.width*.5+40,y:s.y+s.height-4},n:r});for(let o of t)if(o.name){if(o.robot?.at&&o.robot.mode!=="docked"){let r=e(o.robot.at);r&&i.push({kind:"robot",presence:o,point:{x:r.x+r.width/2+22,y:r.y+r.height-4},mode:o.robot.mode})}if(o.over){let r=e(o.over);r&&i.push({kind:"over",presence:o,box:r})}}return i}export{st as a,P as b,ne as c,re as d,Y as e,ut as f,de as g,lt as h,le as i,pt as j,ft as k,gt as l,xt as m,be as n,Qe as o,Je as p,St as q,U as r,nt as s,rt as t,ot as u};
|
|
@@ -0,0 +1,5 @@
|
|
|
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{r as C}from"./chunk.VP35BUUZ.js";import{G as A,J as P,R as s,_ as R,ua as L}from"./chunk.7L6LYXCV.js";import{a as b}from"./chunk.SDO3U72B.js";import{md as w,wc as v}from"./chunk.7MQ7UWVW.js";import{b as i}from"./chunk.AJZBJBMO.js";var B=i(s(),1),I=C.part(e=>(0,B.jsx)(e.ActivityRail,{calls:[]}),{quiet:!0});var g=i(s(),1),T=e=>e.tabIndex>=0&&!e.disabled&&e.getClientRects().length>0;function H(e){if(!e)return!1;if(T(e))return e.focus({preventScroll:!1}),!0;let r=[...e.querySelectorAll("a[href], button, input, select, textarea, [tabindex]")].find(T);return r?(r.focus(),!0):(e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1"),e.focus(),!0)}var F=`.graview-skips{display:contents}
|
|
2
|
+
.graview-skip{position:absolute;width:0;height:0;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
|
|
3
|
+
.graview-skip:focus{width:auto;height:auto;overflow:visible;clip-path:none;padding:6px 12px;border-radius:8px;border:1px solid var(--graview-accent);background:var(--graview-float,var(--graview-panel));color:var(--graview-ink);font:inherit;font-size:.875rem;font-weight:600;box-shadow:var(--graview-lift-high);outline:2px solid var(--graview-accent);outline-offset:1px}
|
|
4
|
+
.graview-skips[data-place=bar] .graview-skip:focus{position:fixed;left:8px;top:6px;z-index:${v("toast")}}
|
|
5
|
+
.graview-skips[data-place=here] .graview-skip:focus{position:static;justify-self:start}`;function O({to:e,place:r="bar"}){return e.length===0?null:(0,g.jsxs)("span",{className:"graview-skips","data-place":r,children:[(0,g.jsx)("style",{children:F}),e.map(o=>(0,g.jsx)("button",{type:"button",className:"graview-skip","data-graview-skip":o.testid,"data-testid":`skip-${o.testid}`,...o.opens?{"data-graview-skip-opens":""}:{},onClick:o.go,children:o.label},o.testid))]})}var l=i(A(),1),S=i(s(),1),D=L(b(()=>(__graviewPreload(import.meta.url,["./chunk.7IXLH7PR.js","./chunk.X5WB4GJ4.js","./chunk.XGRMQUFB.js","./chunk.6IEDQHKI.js","./chunk.5J2HETUO.js","./chunk.5TBK44MK.js","./chunk.VCOIFBUE.js","./chunk.UT6642FC.js","./chunk.JNCSGUO3.js","./chunk.ZEC64CK6.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.EBTYR5CZ.js","./chunk.OJGHDWI6.js","./chunk.OWL5GZ6U.js","./chunk.RSYFIL2Z.js","./chunk.R7F6UJVG.js","./chunk.DYW4D74X.js","./chunk.VP35BUUZ.js","./chunk.7L6LYXCV.js","./chunk.SDO3U72B.js","./chunk.7MQ7UWVW.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.ORKXXLWD.js")))),E=D.part((e,r)=>{let o=e.RecordInteractions;return(0,S.jsx)(o,{...r})},{quiet:!0});function M(e,r,o){let t=e.target;return(t.on==="record"||t.on==="field"?t.id===r:t.on==="selection"?t.ids.includes(r):t.on==="act"?t.id===r:!1)||e.offered.some(n=>n.id===`record:${r}`||n.id.startsWith(`fill:${r}:`))||(e.batches??[]).some(n=>o(n).includes(r))}function j({id:e,style:r,headingStyle:o,className:t}){let{ai:c,aiDesk:n,store:f}=R(),{entries:y}=P(n),p=c.off===!0;(0,l.useEffect)(()=>{p||n.load()},[n,p]);let x=f.log.length,u=(0,l.useMemo)(()=>{let h=m=>f.log.all().flatMap(k=>k.batch===m?k.writes:[]);return y.filter(m=>M(m,e,h))},[y,e,f,x]);return p||u.length===0?null:(0,S.jsx)(l.Suspense,{fallback:null,children:(0,S.jsx)(E,{entries:u,...r?{style:r}:{},...o?{headingStyle:o}:{},...t?{className:t}:{}})})}var d=i(A(),1),a=i(s(),1);function So({context:e,stop:r,title:o,label:t,style:c,className:n,children:f,...y}){let p=w(e.views?.arrangement?.()),x=f??(0,a.jsxs)(a.Fragment,{children:["In ",p==="Scene"?"the scene":p.replace(/^The /,"the ")," ",(0,a.jsx)("span",{"aria-hidden":"true",children:"\u2197"})]}),u=t?{"aria-label":t}:{};if(e.overview){let h=e.overview;return(0,a.jsx)("a",{href:r,...y,...u,...o?{title:o}:{},style:c,...n?{className:n}:{},onClick:m=>{m.preventDefault(),h(r)},children:x})}return e.embedded?null:(0,a.jsx)("a",{href:`${e.sceneHref??"/"}${r}`,...y,...u,...o?{title:o}:{},style:c,...n?{className:n}:{},children:x})}function ho(){return(0,a.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:e=>{e.preventDefault();let r=new URL(window.location.href);r.searchParams.set("fresh","1"),window.location.assign(r.toString())},style:{color:"inherit",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24},children:"Start fresh"})}function ko(e){let r=(0,d.useRef)(0),o=(0,d.useCallback)(t=>e.subscribe(()=>{r.current+=1,t()}),[e]);return(0,d.useSyncExternalStore)(o,()=>r.current,()=>0)}function wo(e){return e===void 0?{}:e==="sm"||e==="md"?{"data-size":e}:{style:{"--graview-control-height":typeof e=="number"?`${e}px`:e}}}var bo=(e,r)=>r?`${e} ${r}`:e;export{I as a,H as b,O as c,j as d,So as e,ho as f,ko as g,wo as h,bo as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as he,b as xe,c as be,d as ie,e as I}from"./chunk.TKUNRFDE.js";import{c as A,e as re}from"./chunk.
|
|
1
|
+
import{a as he,b as xe,c as be,d as ie,e as I}from"./chunk.TKUNRFDE.js";import{c as A,e as re}from"./chunk.WH2RYGXR.js";import{a as te}from"./chunk.OWL5GZ6U.js";import{G as U,R as Z,_ as ee,aa as ne}from"./chunk.7L6LYXCV.js";import"./chunk.SDO3U72B.js";import{U as j,ca as J,uc as Q}from"./chunk.7MQ7UWVW.js";import"./chunk.2AZTW66C.js";import{b as C}from"./chunk.AJZBJBMO.js";var w=C(U(),1);var P=C(U(),1),ke=(e,n)=>`graview:last-visit:${n??"anyone"}:${e.join(",")}`;function Pe(e,n,r){let t=new Set;for(let i of e)if(!(i.author.id!==void 0&&i.author.id===r)&&Date.parse(i.at)>n)for(let o of i.writes)t.add(o);return t}function oe(e,n,r){let t=ke(n,r?.id),[i]=(0,P.useState)(()=>{try{let o=globalThis.localStorage?.getItem(t);return o?Number(o):null}catch{return null}});return(0,P.useEffect)(()=>{let o=()=>{if(document.visibilityState==="hidden")try{globalThis.localStorage?.setItem(t,String(Date.now()))}catch{}};return document.addEventListener("visibilitychange",o),window.addEventListener("pagehide",o),()=>{document.removeEventListener("visibilitychange",o),window.removeEventListener("pagehide",o)}},[t]),(0,P.useMemo)(()=>i===null?new Set:Pe(e,i,r?.id),[e,i,r?.id])}function ae(e,n,r){let t=new Set;if(r===void 0)return t;t.add(r);for(let i of[...e.out(r),...e.in(r)])t.add(i.id);for(let i of n)if(i.author.id===r)for(let o of i.primitives)o.op==="add-node"&&t.add(o.node.id);return t}var g=C(Z(),1);function Se(e,n,r={x:0,y:0}){let t=(i,o)=>{let c=A(i,o,n.cell,n.tilt);return{x:n.originX+r.x+c.x,y:n.originY+r.y+c.y}};return[t(e.col,e.row),t(e.col+e.side,e.row),t(e.col+e.side,e.row+e.side),t(e.col,e.row+e.side)]}var B=e=>e.map(n=>`${n.x.toFixed(1)},${n.y.toFixed(1)}`).join(" ");function Ie({frame:e,width:n,height:r,pan:t,pinned:i,close:o,today:c,swallowed:y,chosen:p=[],onFocus:f}){let{selection:u,store:d,scheme:S,principal:x}=ee(),b=ne(),a=(0,w.useMemo)(()=>d.log.all(),[d,b]),m=oe(a,d.schema.kinds,x),$=(0,w.useMemo)(()=>ae(d.graph,a,x?.id),[d,a,x?.id]),se=te(),E=e.city,D=e.nodes.filter(l=>l.plot!==void 0&&Math.round(l.plane)===2),R=E?.cell??0,F=E?.tilt??.5,K=(0,w.useRef)(f);K.current=f;let le=(0,w.useCallback)(l=>!K.current||y?.current?!1:(K.current(l),!0),[y]),X=(0,w.useRef)(new Map),M=new Map;for(let l of D){let O=l.aggregate?.memberIds??[],v=re(d.schema,l.kind),z=s=>v?d.graph.getNode(s)?.[v.field]:void 0,L=O.filter(s=>p.includes(s)),G=`${R}|${F}|${l.plot.col},${l.plot.row},${l.plot.side}|${L.join(",")}|${O.map(s=>`${s}=${String(z(s))}`).join(",")}`,T=X.current.get(l.id);if(T&&T.key===G){M.set(l.id,T);continue}let V={cell:R,originX:0,originY:0,tilt:F},q={x:0,y:0},we=d.schema.tryDefinition(l.kind),ye=s=>{let h=d.graph.getNode(s);return h?J(we,h):s},k=v?v.values.map(()=>[]):[[]],N=v?[...v.tiers]:["waiting"];for(let s of L.length>0?[...L,...O.filter(h=>!L.includes(h))]:O){let h=v?v.values.indexOf(z(s)):0;h>=0?k[h].push(s):(k.length===N.length&&(k.push([]),N.push("waiting")),k[k.length-1].push(s))}let{blocks:pe,rests:ve}=I(l.plot,k,N.map(s=>ie[s])),me=Se(l.plot,V,q),H=v?Le(d.schema,l.kind):void 0;M.set(l.id,{key:G,tile:B(me),rests:ve.map(s=>({count:s.count,rows:s.rows,at:A(s.col,s.row,R,F)})),buildings:pe.map(s=>{let W=(H?d.graph.getNode(s.id):void 0)?.[H];return{id:s.id,tier:N[s.lane],overdue:typeof W=="string"&&N[s.lane]!=="done"&&W.slice(0,10)<(c??new Date().toISOString().slice(0,10)),name:ye(s.id),width:s.footprint*R,...Ce(s,V,q)}})})}if(X.current=M,!E)return null;let de={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible"},ge=u.join(`
|
|
2
2
|
`),ce=se.join(`
|
|
3
3
|
`),ue=m?[...m].join(`
|
|
4
4
|
`):"",fe=$?[...$].join(`
|
|
@@ -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{l as k,n as M,o as I,p as B,s as P}from"./chunk.RSYFIL2Z.js";import"./chunk.R7F6UJVG.js";import"./chunk.DYW4D74X.js";import"./chunk.VP35BUUZ.js";import{G as te,R as W,ua as q}from"./chunk.7L6LYXCV.js";import{a as L}from"./chunk.SDO3U72B.js";import"./chunk.7MQ7UWVW.js";import"./chunk.2AZTW66C.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.VP35BUUZ.js","./chunk.7L6LYXCV.js","./chunk.SDO3U72B.js","./chunk.7MQ7UWVW.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZE6LJVVN.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 +1 @@
|
|
|
1
|
-
import{Ac as E,Bc as G,Cc as F,Ec as J,Fc as W,kb as k,ob as O,pb as P,rb as h,sb as j}from"./chunk.
|
|
1
|
+
import{Ac as E,Bc as G,Cc as F,Ec as J,Fc as W,kb as k,ob as O,pb as P,rb as h,sb as j}from"./chunk.7MQ7UWVW.js";var I=(o,a)=>{let t=o.kindOf(a);return t===void 0?void 0:o.kept?.({id:a,kind:t})};function w(o,a){return o.flatMap(t=>{if(t.op!=="patch-node")return[t];let i=I(a,t.id);if(!i||!Object.keys(t.after).some(i))return[t];let c=r=>Object.fromEntries(Object.entries(r).filter(([f])=>!i(f))),s=c(t.after);return Object.keys(s).length===0?[]:[{op:"patch-node",id:t.id,before:c(t.before),after:s}]})}function _(o,a,t){if(!F(o,a))return t;let i=J(o,a),c=r=>o.graph.getNode(r)!==void 0||E(o.log).kindOf(r)!==void 0,s={...t};if(t.diff){let r=t.diff,f=G(o.log),l=o.log.length??o.log.all().length,u=t.ops?.[0]?.seq??l,x=k(a).id,y=(e,n)=>d=>f.writerAt(e,d,n),m=(e,n)=>i.shows(e.id)?i.servedWith(e,n):void 0,b=(e,n)=>e.flatMap(d=>m(d,n(d.id))??[]),S=e=>i.shows(e.from)&&i.shows(e.to)&&!h(e,i.sees),v=(e,n)=>t.ops?y(e,l):d=>n===void 0||n.includes(d)?x:f.writerAt(e,d,l),M=r.changedNodes.flatMap(e=>{let n=m(e.before,y(e.before.id,u)),d=m(e.after,v(e.after.id,e.fields));return n&&d?[{before:n,after:d,fields:e.fields.filter(p=>p in n||p in d)}]:[]}),D=new Set(r.changedNodes.map(e=>e.after.id)),g=new Map;for(let e of t.ops?.flatMap(n=>n.primitives)??t.primitives??[])e.op!=="patch-node"||D.has(e.id)||g.set(e.id,[...g.get(e.id)??[],...Object.keys(e.after)]);let B=[...g].flatMap(([e,n])=>{let d=o.graph.getNode(e);if(!d)return[];let p=m(d,y(e,u)),N=m(d,v(e,n));return p&&N&&JSON.stringify(p)!==JSON.stringify(N)?[{before:p,after:N,fields:n}]:[]});s.diff={addedNodes:b(r.addedNodes,e=>v(e)),removedNodes:b(r.removedNodes,e=>y(e,u)),changedNodes:[...M,...B],addedEdges:r.addedEdges.filter(S),removedEdges:r.removedEdges.filter(S),touched:[...r.touched.filter(i.shows),...[...g.keys()].filter(e=>i.shows(e)&&!r.touched.includes(e))]}}if(t.ops&&(s.ops=j(t.ops,i)),t.primitives){let r=s.ops;s.primitives=r?r.flatMap(f=>f.primitives):i.timeline?O(t.primitives,i.timeline,{served:(f,l)=>i.servedWith(f,l),edgeClean:f=>!h(f,i.sees),sees:i.sees},k(a).id):j([{id:"",seq:0,batch:"",author:{kind:"system"},intent:"",mutation:null,primitives:t.primitives,reads:[],writes:[],at:""}],i)[0].primitives}return i.kept&&s.primitives&&(s.primitives=w(s.primitives,i)),t.reads&&(s.reads=t.reads.filter(r=>i.shows(r)&&c(r))),t.writes&&(s.writes=t.writes.filter(i.shows)),t.intent!==void 0&&h(t.intent,i.sees)&&(s.intent=P),t.violationsAfter&&Object.assign(s,A?A(o,W(o,a),!!t.ops,s.primitives??[]):{introduces:[],resolves:[],violationsAfter:[]}),s}var A,z=o=>void(A=o);export{_ as a,z as b};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{d as C,e as re}from"./chunk.BT6FUNQI.js";import{e as ee}from"./chunk.MBOOUJOE.js";import{b as S}from"./chunk.DYW4D74X.js";import{m as X}from"./chunk.VP35BUUZ.js";import{Da as J,G as se,Ha as Q,R as Z,ua as V}from"./chunk.7L6LYXCV.js";import{a as K}from"./chunk.SDO3U72B.js";import{O as Y,U as M,ca as U}from"./chunk.7MQ7UWVW.js";import{b as D}from"./chunk.AJZBJBMO.js";var h=D(se(),1);var n=D(Z(),1),Re=9,le=40,ge=2;function de(e){let r=new Map;for(let i of e.allNodes())r.set(i.kind,(r.get(i.kind)??0)+1);return r}var ue=(e,r)=>(e.far??[]).reduce((i,a)=>i+(r.get(a)??0),0);function ce(e,r,i){if(i)return i.flatMap(s=>e.filters.filter(u=>u.key===s));let a=de(r),o=new Set(e.filters.filter(s=>s.about==="edge"&&ue(s,a)>le).map(s=>s.key));return e.filters.filter(s=>s.about==="edge"?!o.has(s.key):s.about==="via"?o.has(s.key.split(".")[0]):!0)}function pe(e,r){let i=e.filter(a=>a.about==="field"&&a.type==="choice"&&(a.options?.length??0)>0);return r?i:i.slice(0,ge)}var fe=520;function ye(e,r,i,a){let o=i.filters.find(s=>s.key===a.key);if(!o)return`${a.key}: ${a.value}`;if(o.about==="is")return a.value.charAt(0).toUpperCase()+a.value.slice(1);if(o.about==="via")return`${o.label}: ${S(e.tryDefinition(o.far?.[0]??""),o.key.split(".")[1],a.value)}`;if(o.about==="edge"){if(a.value==="*")return`${o.label}: anything`;if(a.value==="none")return`${o.label}: nothing`;let s=r.getNode(a.value);return`${o.label}: ${s?U(e.tryDefinition(s.kind),s):a.value}`}if(o.type==="date"){let[s,u]=a.value.split(":");return`${o.label} ${s} ${u?Y(u):""}`.trim()}if(o.type==="boolean")return`${o.label}: ${a.value==="true"?"yes":"no"}`;if(o.type==="number"){let s=a.value.lastIndexOf(":"),u=a.value.slice(0,Math.max(0,s));if(u==="at-most"||u==="at-least")return`${o.label}: ${u==="at-most"?"at most":"at least"} ${S(e.tryDefinition(i.kind),o.key,Number(a.value.slice(s+1)))}`}return o.type==="text"?`${o.label}: ${a.value}`:`${o.label}: ${S(e.tryDefinition(i.kind),o.key,a.value)}`}var P=e=>/^[A-Z][a-z]/.test(e)?e.charAt(0).toLowerCase()+e.slice(1):e;function me(e){return e?.type==="date"?{asc:"Earliest first",desc:"Latest first"}:e?.type==="number"?{asc:"Lowest first",desc:"Highest first"}:e?.type==="boolean"?{asc:"No first",desc:"Yes first"}:e?.type==="choice"?{asc:"In their order",desc:"In reverse order"}:{asc:"A to Z",desc:"Z to A"}}var x=V(K(()=>(__graviewPreload(import.meta.url,["./chunk.FLMNHV6A.js","./chunk.CTSPNTDX.js","./chunk.BT6FUNQI.js","./chunk.MBOOUJOE.js","./chunk.RSYFIL2Z.js","./chunk.R7F6UJVG.js","./chunk.DYW4D74X.js","./chunk.VP35BUUZ.js","./chunk.7L6LYXCV.js","./chunk.SDO3U72B.js","./chunk.7MQ7UWVW.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.26SI4K3P.js")))),N=x.part((e,r)=>(0,n.jsx)(e.ArrangeLists,{...r}),{what:"This list",quiet:!0}),he=x.part((e,r)=>(0,n.jsx)(e.ArrangeChips,{...r}),{what:"This list",quiet:!0}),Te=()=>x.load(),q=new Map;function Ie(e){let{schema:r,graph:i,kind:a,arrangement:o,onChange:s}=e,u=e.offers??ee(r,a),g=e.testId??"arrange",y=C(e.allow,"sort")&&u.sorts.length>1,m=C(e.allow,"group")&&u.groups.length>0,F=C(e.allow,"filter")?ce(u,i,e.filters):[],L=e.chips?pe(F,e.filters):[],H=F.filter(t=>!L.includes(t)),G=H.length>0,_=e.query!==!1&&e.allow!==!1,w=we(e.noun,e.kept),v=e.past&&e.past.count>0?e.past:null;if(!y&&!m&&!G&&!_&&!w&&!v)return null;let z=t=>JSON.stringify(re(t)),O=`${g}|${a}`,p={current:q.get(O)??{words:new Set,latest:null,at:0}};q.set(O,p.current),p.current.latest&&Date.now()-p.current.at>1500&&!p.current.words.has(z(o))&&(p.current={words:new Set,latest:null,at:0},q.set(O,p.current));let d=p.current.latest??o,b=t=>{let l={...p.current.latest??o,...t};for(let c of Object.keys(l))l[c]===void 0&&delete l[c];p.current.latest=l,p.current.at=Date.now(),p.current.words.add(z(l)),s(l)},f=d.filter??[],R=t=>{let l=f.filter((c,I)=>I!==t);b({filter:l.length>0?l:void 0})},A=t=>f.some(l=>l.key===t.key&&l.value===t.value),te=t=>A(t)?R(f.findIndex(l=>l.key===t.key&&l.value===t.value)):b({filter:[...f,t]}),T=d.sort?u.sorts.find(t=>t.key===d.sort.by):void 0,j=d.group?u.groups.find(t=>t.key===d.group.by):void 0,ne=me(T),k={schema:r,graph:i,offers:{...u,filters:H},arrangement:d,set:b,toggle:te,has:A,testId:g},ae=(t,l)=>A({key:t,value:l})?R(f.findIndex(c=>c.key===t&&c.value===l)):b({filter:[...f.filter(c=>c.key!==t),{key:t,value:l}]}),oe=d.sort?(0,n.jsxs)(n.Fragment,{children:["Sorted by ",P(T?.label??d.sort.by),(0,n.jsx)("span",{"aria-hidden":"true",children:d.sort.direction==="desc"?" \u2193":" \u2191"})]}):"Sort",ie=d.group?.bucket&&j?.buckets?`, a ${d.group.bucket} each`:"",B=d.group?`Grouped by ${P(j?.label??d.group.by)}${ie}`:"Group";return(0,n.jsxs)("div",{"data-testid":`${g}-bar`,role:"group","aria-label":"Arrange",className:"graview-arrange",style:e.style,onPointerEnter:x.prefetch,onFocus:x.prefetch,children:[(0,n.jsx)("style",{children:xe}),(0,n.jsxs)("div",{className:"graview-arrange-line",children:[w?(0,n.jsxs)("span",{className:"graview-arrange-count","data-testid":`${g}-count`,children:[w.kept?(0,n.jsx)("span",{"data-testid":`${g}-kept`,children:w.kept}):null,w.words]}):null,v?(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":`${g}-past`,title:`${M(v.count)} more behind the horizon \u2014 press to widen the view to the past`,onClick:t=>{let l=t.currentTarget.closest("[data-graview-view]"),c=t.currentTarget;v.widen();let I=0,W=()=>{if(document.activeElement!==c&&document.activeElement!==document.body&&c.isConnected)return;let $=l?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if($&&$!==c&&$.isConnected)return $.focus({preventScroll:!0});++I<120&&requestAnimationFrame(W)};requestAnimationFrame(W)},children:["+",M(v.count)," past"]}):null,f.map((t,l)=>{let c=ye(r,i,u,t);return(0,n.jsxs)("span",{className:"graview-arrange-token","data-testid":`${g}-condition`,children:[c,(0,n.jsx)("button",{type:"button","aria-label":`Remove: ${c}`,title:"Remove",onClick:()=>R(l),children:"\xD7"})]},`${t.key}:${t.value}`)}),y?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-sort`,value:d.sort?.by??"",set:d.sort!==void 0,label:"Sort",name:d.sort?`Sorted by ${P(T?.label??d.sort.by)}, ${ne[d.sort.direction].toLowerCase()}`:"Sort",list:t=>(0,n.jsx)(N,{which:"sort",done:t,...k}),children:oe})}):null,m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-group`,value:d.group?.by??"",set:d.group!==void 0,label:"Group",name:B,list:t=>(0,n.jsx)(N,{which:"group",done:t,...k}),children:B})}):null,G?(0,n.jsx)("span",{className:"graview-arrange-part",children:(0,n.jsx)(E,{testId:`${g}-add`,value:"",set:!1,label:"Filter",name:f.length>0?`Filter \u2014 ${f.length} on`:"Filter",list:t=>(0,n.jsx)(N,{which:"filter",done:t,...k}),children:"Filter"})}):null,y||m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-all",children:(0,n.jsx)(E,{testId:`${g}-all`,value:"",set:!1,label:"Arrange",name:"Arrange: sort and group",list:t=>(0,n.jsx)(N,{which:"all",done:t,parts:{sort:y,group:m,filter:!1},...k}),children:"Arrange"})}):null,_?(0,n.jsxs)("label",{className:"graview-arrange-words-at",children:[(0,n.jsx)("span",{style:X,children:"Find"}),(0,n.jsx)("input",{type:"search",className:"graview-arrange-words","data-testid":`${g}-query`,value:d.query??"",placeholder:"Find\u2026",onChange:t=>b({query:t.target.value.length>0?t.target.value:void 0})})]}):null,L.length>0&&e.chips?(0,n.jsx)(h.Suspense,{fallback:null,children:(0,n.jsx)(he,{offers:L,chips:e.chips,schema:r,graph:i,kind:a,arrangement:d,has:A,choose:ae,testId:g})}):null]})]})}function we(e,r){if(!r)return null;let i=r.shown!==r.of;if(!e)return i?{words:"",kept:`${r.shown} of ${r.of}`}:null;let a=r.of===1?e.one:e.many;return i?{words:` ${a}`,kept:`${r.shown} of ${r.of}`}:{words:`${r.of} ${a}`}}function E({testId:e,value:r,set:i,label:a,name:o,list:s,children:u}){let g=Q("arrange",{align:"start"}),y=(0,h.useRef)(null);return(0,h.useEffect)(()=>{g.open&&y.current?.querySelector('[aria-pressed="true"]')?.focus({preventScroll:!0})},[g.open]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":e,"data-set":i?"":void 0,value:r,"aria-label":o,...g.trigger,onClick:g.toggle,children:[u,(0,n.jsx)(be,{})]}),g.open?(0,n.jsx)("div",{...g.pane,ref:m=>{g.pane.ref(m),y.current=m},role:"group","aria-label":a,"data-testid":"arrange-list","data-arrange":e,className:"graview-arrange-list",style:J,onKeyDown:ve,children:s(()=>g.setOpen(!1))}):null]})}function ve(e){if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;let r=[...e.currentTarget.querySelectorAll("button:not([disabled]), input")];if(r.length===0)return;let i=r.indexOf(document.activeElement);if(document.activeElement instanceof HTMLInputElement&&document.activeElement.type==="date"&&(e.key==="ArrowUp"||e.key==="ArrowDown"))return;e.preventDefault();let a=e.key==="Home"?0:e.key==="End"?r.length-1:e.key==="ArrowDown"?(i+1)%r.length:(i-1+r.length)%r.length;r[a].focus()}function be(){return(0,n.jsx)("svg",{width:"9",height:"9",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto",opacity:.7},children:(0,n.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var xe=`
|
|
2
|
+
.graview-arrange{container-type:inline-size;box-sizing:border-box;width:100%;min-width:0;max-width:100%}
|
|
3
|
+
.graview-arrange-line{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;min-width:0;font-size:.875rem;line-height:1.35;color:var(--graview-ink-muted)}
|
|
4
|
+
.graview-arrange-count{margin-right:2px;color:var(--graview-ink-muted)}
|
|
5
|
+
.graview-arrange-part{display:inline-flex;align-items:center;min-width:0}
|
|
6
|
+
.graview-arrange-count~.graview-arrange-part::before{content:"\xB7" / "";margin-right:6px;color:var(--graview-ink-muted)}
|
|
7
|
+
.graview-arrange-open{display:inline-flex;align-items:center;gap:5px;min-height:28px;min-width:0;max-width:100%;margin:0;padding:0 6px;border:1px solid transparent;border-radius:7px;background:none;box-shadow:none;font:inherit;letter-spacing:normal;text-transform:none;text-align:left;color:var(--graview-ink-muted);cursor:pointer}
|
|
8
|
+
.graview-arrange-open[data-set]{color:var(--graview-ink)}
|
|
9
|
+
.graview-arrange-open:hover,.graview-arrange-open[aria-expanded=true]{border-color:var(--graview-edge);color:var(--graview-ink)}
|
|
10
|
+
.graview-arrange :focus-visible,.graview-arrange-list :focus-visible{outline:2px solid var(--graview-accent);outline-offset:1px}
|
|
11
|
+
.graview-arrange-all{display:none}
|
|
12
|
+
@container (max-width: ${fe-1}px){.graview-arrange-one{display:none}.graview-arrange-all{display:inline-flex}}
|
|
13
|
+
.graview-arrange-token{display:inline-flex;align-items:center;gap:0;min-width:0;min-height:26px;box-sizing:border-box;padding:0 2px 0 10px;border:1px solid var(--graview-edge);border-radius:999px;background:var(--graview-panel);color:var(--graview-ink);overflow-wrap:anywhere}
|
|
14
|
+
.graview-arrange-token button{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;margin:0;padding:0;border:0;border-radius:6px;background:none;font:inherit;line-height:1;color:var(--graview-ink-muted);cursor:pointer}
|
|
15
|
+
.graview-arrange-token button:hover{color:var(--graview-ink);background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
|
|
16
|
+
.graview-arrange-words-at{display:inline-flex;min-width:0;max-width:100%}
|
|
17
|
+
.graview-arrange-words{box-sizing:border-box;width:min(100%,12rem);min-height:28px;margin:0;padding:0 8px;border:1px solid transparent;border-radius:7px;background:transparent;font:inherit;color:var(--graview-ink)}
|
|
18
|
+
.graview-arrange-words:hover,.graview-arrange-words:focus{border-color:var(--graview-edge)}
|
|
19
|
+
`;function De(e){let r=[];return e.query&&r.push(`\u201C${e.query}\u201D`),e.filter?.length&&r.push(`${e.filter.length} condition${e.filter.length===1?"":"s"}`),e.group&&r.push(`by ${e.group.by}`),e.sort&&r.push(`sorted by ${e.sort.by}`),r.length>0?r.join(" \xB7 "):null}export{Re as a,le as b,ge as c,de as d,ue as e,ce as f,pe as g,fe as h,ye as i,P as j,me as k,Te as l,Ie as m,De as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as O,b}from"./chunk.DQR45N7V.js";import"./chunk.7XCBIID7.js";import"./chunk.MI2HL3LQ.js";import"./chunk.TMBFLZNH.js";import"./chunk.VP35BUUZ.js";import{G as z,R as M,_ as S}from"./chunk.7L6LYXCV.js";import"./chunk.SDO3U72B.js";import{Gc as A}from"./chunk.7MQ7UWVW.js";import"./chunk.2AZTW66C.js";import{b as v}from"./chunk.AJZBJBMO.js";var o=v(z(),1);var t=v(M(),1);function G(i){for(let d of i)for(let[r,s]of Object.entries(d))if(s===!1)return`${r} == true`;return""}var w={margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function j({ask:i,close:d}){let{store:r,principal:s,subscriptions:h,app:f}=S(),c=(0,o.useRef)(null),p=(0,o.useId)(),[n,u]=(0,o.useState)(0),[l,y]=(0,o.useState)(!0),[m,P]=(0,o.useState)(()=>{let e=i.choices.find(g=>g.on==="reaches");if(!e)return"";let a=e.record!==void 0?r.graph.getNode(e.record):void 0;return G(a?[a]:r.graph.nodesOfKind(e.kind).slice(0,5))}),[C,x]=(0,o.useState)(null),[W,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=c.current;e&&!e.open&&e.showModal()},[]);let T=()=>{let e=i.returnTo;d(),requestAnimationFrame(()=>{e?.isConnected?e.focus():document.querySelector("[data-graview-page-title], main h1, [data-testid='activity-button']")?.focus()})},N=e=>e.on==="reaches"?{...e,condition:m}:e,E=e=>b(r,{when:N(e),alsoMine:!l}),L=async()=>{let e=N(i.choices[n]),a=O(r,e);if(a){x(a);return}k(!0);try{await h.add({who:A(s),app:f?.name??"app",when:e,...l?{}:{alsoMine:!0}}),T()}catch(g){k(!1),x(g instanceof Error?g.message:String(g))}};return(0,t.jsx)("dialog",{ref:c,"aria-labelledby":p,"data-testid":"notify-sheet",onClose:T,onClick:e=>{e.target===e.currentTarget&&e.currentTarget.close()},style:{width:"min(92vw, 420px)",padding:0,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)"},children:(0,t.jsxs)("form",{method:"dialog",onSubmit:e=>{e.preventDefault(),L()},style:{display:"grid",gap:12,padding:18},children:[(0,t.jsx)("h2",{id:p,style:{margin:0,fontSize:"1.0625rem"},children:"Notify me"}),(0,t.jsxs)("fieldset",{style:{margin:0,padding:0,border:0,display:"grid",gap:6},children:[(0,t.jsx)("legend",{style:{...w,marginBottom:6},children:"Tell me"}),i.choices.map((e,a)=>(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"baseline",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"radio",name:`${p}-when`,checked:n===a,onChange:()=>u(a),"data-notify-choice":e.on}),(0,t.jsx)("span",{children:e.on==="reaches"?`When ${e.record!==void 0?"it":"one"} reaches a condition`:E(e)})]},a))]}),i.choices[n]?.on==="reaches"?(0,t.jsxs)("label",{style:{display:"grid",gap:4},children:[(0,t.jsx)("span",{style:w,children:"The condition, in the app's own words (done == true, amount > 100)"}),(0,t.jsx)("input",{value:m,onChange:e=>P(e.target.value),"data-testid":"notify-condition",autoComplete:"off",spellCheck:!1})]}):null,(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:e=>y(e.target.checked),"data-testid":"notify-others-only"}),"Only when someone else does it"]}),(0,t.jsxs)("p",{style:w,"data-testid":"notify-said",children:[E(i.choices[n]),"."]}),C?(0,t.jsx)("p",{role:"alert",style:{margin:0,color:"var(--graview-danger, var(--graview-ink))"},children:C}):null,(0,t.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>c.current?.close(),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",autoFocus:!0,disabled:W,"data-testid":"notify-keep",style:{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"},children:"Notify me"})]})]})})}function B({style:i}){let{store:d,principal:r,subscriptions:s,app:h}=S(),f=(r.onBehalfOf??r).id,[c,p]=(0,o.useState)([]);return(0,o.useEffect)(()=>{if(f===void 0)return;let n=!0,u=()=>void Promise.resolve(s.list(f)).then(y=>n&&p(y.filter(m=>m.app===(h?.name??"app"))),()=>n&&p([]));u();let l=s.onChange?.(u);return()=>{n=!1,l?.()}},[s,f,h]),c.length===0?null:(0,t.jsxs)("section",{"aria-label":"What you are told of","data-testid":"notified",style:{display:"grid",gap:6,...i},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"You are told"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:c.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"baseline",justifyContent:"space-between"},"data-subscription":n.id,children:[(0,t.jsx)("span",{style:{fontSize:"0.8125rem"},children:b(d,n)}),(0,t.jsx)("button",{type:"button","data-testid":"notify-stop","aria-label":`Stop: ${b(d,n)}`,onClick:u=>{let l=u.currentTarget.closest("li"),y=(l?.nextElementSibling??l?.previousElementSibling)?.querySelector("button");Promise.resolve(s.remove(n.id)).then(()=>(y??document.querySelector("[data-testid='activity-button']"))?.focus())},style:{padding:"1px 8px",fontSize:"0.8125rem"},children:"Stop"})]},n.id))})]})}export{B as NotifiedList,j as NotifySheet};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as c}from"./chunk.4HAGPMY6.js";import"./chunk.C3DX4LWD.js";import"./chunk.EPPAFWP7.js";import"./chunk.UGFDSE37.js";import{l as m}from"./chunk.O4X5WJIC.js";import"./chunk.CO2ZPX3D.js";import"./chunk.QXTLZSBL.js";import"./chunk.4ZHUGSJL.js";import"./chunk.DJ3BD7AZ.js";import"./chunk.S2MP53RO.js";import"./chunk.7MXQRSNR.js";import"./chunk.PXQVXBNG.js";import"./chunk.BYVE2NQY.js";import"./chunk.X5WB4GJ4.js";import"./chunk.5J2HETUO.js";import"./chunk.6XEATXZC.js";import"./chunk.5TBK44MK.js";import"./chunk.27QYTMXP.js";import"./chunk.VCOIFBUE.js";import"./chunk.RQBX7M7Q.js";import"./chunk.FLMNHV6A.js";import"./chunk.CTSPNTDX.js";import"./chunk.BT6FUNQI.js";import"./chunk.MBOOUJOE.js";import"./chunk.Q5XICUDZ.js";import"./chunk.UT6642FC.js";import"./chunk.KG5R4GTK.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.QWY54AVN.js";import"./chunk.T4Q6OLZU.js";import"./chunk.R2B2ZAWI.js";import"./chunk.7XCBIID7.js";import"./chunk.MI2HL3LQ.js";import"./chunk.TMBFLZNH.js";import"./chunk.GZHZLJBF.js";import"./chunk.EBTYR5CZ.js";import"./chunk.OJGHDWI6.js";import"./chunk.OWL5GZ6U.js";import"./chunk.RSYFIL2Z.js";import"./chunk.R7F6UJVG.js";import"./chunk.DYW4D74X.js";import"./chunk.VP35BUUZ.js";import{G as S,R as g}from"./chunk.7L6LYXCV.js";import"./chunk.SDO3U72B.js";import{qd as n}from"./chunk.7MQ7UWVW.js";import"./chunk.2AZTW66C.js";import{b as t}from"./chunk.AJZBJBMO.js";var y=t(S(),1),a=t(g(),1);function E({store:h,auto:f,brand:i,views:u,presence:o,steering:r,overview:s,scope:d,titleLevel:v=2,quickAsk:l,props:e}){let b=(0,y.useMemo)(()=>m({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:f?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:b}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(c,{context:{store:h,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...s?{overview:s}:{},titleLevel:v,views:u,settings:e.app.settings??[],...o?{presence:o}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.timeZone?{timeZone:e.timeZone}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},...e.signIn?{signIn:e.signIn}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...r?{steering:r}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{E as PagesContent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as ce}from"./chunk.MBOOUJOE.js";import{a as Z,b as C,c as ee,d as te,g as oe,j as re,k as P,l as se,p as le,s as de}from"./chunk.YKN2VWWQ.js";import{a as ie,b as ne,c as ae}from"./chunk.Q5XICUDZ.js";import"./chunk.UT6642FC.js";import"./chunk.SGRKCQ2X.js";import"./chunk.KG5R4GTK.js";import{a as X}from"./chunk.ZEC64CK6.js";import"./chunk.TI4OSTQV.js";import"./chunk.T4Q6OLZU.js";import"./chunk.RSYFIL2Z.js";import"./chunk.R7F6UJVG.js";import"./chunk.DYW4D74X.js";import{e as _,m as J}from"./chunk.VP35BUUZ.js";import{G as me,J as U,R as V,_ as j}from"./chunk.7L6LYXCV.js";import"./chunk.SDO3U72B.js";import{ga as B,wc as Y}from"./chunk.7MQ7UWVW.js";import"./chunk.2AZTW66C.js";import{b as O}from"./chunk.AJZBJBMO.js";var a=O(me(),1);var d=O(V(),1),ke=new Set(["show","go","to","open","the","a","an","me"]),ge=s=>s.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,""),W=(s,p)=>{let r=ge(s);return p.every(t=>r.includes(t))},pe=s=>s&&`${s[0].toLowerCase()}${s.slice(1)}`,I={act:4,show:3,place:3,record:4},we=360,h=12;function Oe({face:s,opening:p,close:r}){let t=X(),{setMenuAt:v}=j(),n=(0,a.useMemo)(()=>p.target??Z(p.pointed??{about:[]},e=>t.store.graph.has(e)),[p,t.store]),f=(0,a.useMemo)(()=>oe(t.store,n,t.places),[t.store,n,t.places]),[u,y]=(0,a.useState)(""),[b,m]=(0,a.useState)(-1),[l,$]=(0,a.useState)(null),[A,L]=(0,a.useState)(null),E=(0,a.useRef)(null),z=(0,a.useRef)(null),T=(0,a.useId)(),R=(0,a.useRef)(!0),{ghost:G}=U(t.desk);(0,a.useEffect)(()=>()=>{R.current=!1;let e=t.desk.get().ghost;e?.onCard&&t.desk.setGhost({...e,onCard:!1})},[t.desk]);let M=(0,a.useMemo)(()=>{let e=P(t,n);return ee(t.store,n,{principal:t.principal,places:t.places,...e.acts?{acts:e.acts}:{}})},[t,n]),K=(0,a.useMemo)(()=>{let e=C(n);if(e.length===0)return[];let i=new Set(M.candidates.flatMap(c=>c.type==="act"?[c.mutation]:[]));return ie(t.store,e,{principal:t.principal,...e.length===1?{focus:e[0]}:{}}).affordances.filter(c=>!c.destructive&&i.has(c.mutation))},[t.store,t.principal,n,M]),q=(0,a.useCallback)(()=>{let e=p.returnTo,i=ue(E.current,n,s);r(),requestAnimationFrame(()=>{if(e?.isConnected&&!e.closest("[inert]"))return e.focus({preventScroll:!0});let c=(i&&i.tabIndex>=0?i:null)??document.querySelector("[data-graview-page-title]")??document.querySelector("main");c&&c.tabIndex<0&&!c.hasAttribute("tabindex")&&c.setAttribute("tabindex","-1"),c?.focus({preventScroll:!0})})},[p.returnTo,n,s,r]),F=(0,a.useCallback)(e=>{if(e.open.length>0){let i=E.current?.getBoundingClientRect();r(),v({x:i?.left??0,y:i?.top??0,on:e.args.id??C(n)[0],about:C(n)});return}try{ae(t.store,e,{},{pressed:t.principal?{author:t.principal}:{}}),ne(t.store,e,{},{author:t.principal}),q()}catch(i){L(i instanceof Error?i.message:String(i))}},[t.store,t.principal,r,q,v,n]),H=(0,a.useCallback)(async e=>{let i=e.trim();if(!i)return;let c=l?.result?.answer?{said:l.said,answer:l.result.answer}:void 0;y(""),m(-1),L(null),$({said:i,result:null});let S=await re(t.ai,{...P(t,n,i),said:i,...c?{follows:c}:{}});t.desk.record(S.interaction),S.ghost&&S.ghost.proposals.length>0&&t.desk.setGhost({ghost:S.ghost,onCard:!0}),R.current&&$({said:i,result:S})},[l,t,n]),N=(0,a.useRef)(p.asked);(0,a.useEffect)(()=>{let e=N.current;N.current=void 0,e&&H(e)},[]);let k=(0,a.useMemo)(()=>{let e=u.trim();if(!e&&l)return[];let i=ge(e).split(/\s+/).filter(o=>o&&!ke.has(o)),c=/^show\b/i.test(e),S=/^(go|open)\b/i.test(e),x=[];if(!c&&!S)for(let o of K.filter(g=>W(g.label,i)).slice(0,I.act))x.push({id:`act:${o.id}`,kind:"act",label:o.label,hint:o.open.length>0?"asks more":"do it",take:()=>F(o)});let Q=e&&!/\?\s*$/.test(e)?te(t.store,n,{principal:t.principal,places:t.places,said:e}):[];for(let o of Q)x.push({id:`place:${o.place}`,kind:"place",label:o.fit==="full"?`Open ${o.title}`:`Open and adjust ${o.title}`,hint:o.fit==="full"?"a view you have":"adjust it",take:()=>{r(),t.goTo.place(o.place),o.fit==="partial"&&_(t.desk,{target:{on:"lens",place:o.place,...o.kind?{kind:o.kind}:{}},asked:e})}});if(!S){let o=M.candidates.filter(g=>g.type==="panel");for(let g of o.filter(D=>W(`show ${D.label}`,i)).slice(0,I.show))x.push({id:g.id,kind:"show",label:`Show ${pe(g.label)}`,hint:"a panel",take:()=>{r(),se(t,{title:g.label,recipe:{...g.panel,title:g.label}})}})}if(!c){for(let o of t.places.filter(g=>W(g.title,i)&&!Q.some(D=>D.place===g.as)).slice(0,I.place))x.push({id:`place:${o.as}`,kind:"place",label:`Go to ${o.title}`,take:()=>(r(),t.goTo.place(o.as))});if(i.length>0){let o=ce(t.store,e.replace(/^(go to|open)\s+/i,""),{principal:t.principal,from:C(n),limit:I.record}).hits;for(let g of o)g.about==="node"&&x.push({id:`record:${g.id}`,kind:"record",label:g.label,hint:B(t.store.schema,g.kind),take:()=>(r(),t.goTo.record(g.id))})}}return e&&x.push({id:"ask",kind:"ask",label:e,take:()=>void H(e)}),x},[u,K,M,t,n,F,H,r,l]);(0,a.useEffect)(()=>m(u.trim()?0:-1),[u]),(0,a.useLayoutEffect)(()=>{let e=E.current;if(!e)return;if(typeof e.showPopover=="function")try{e.showPopover()}catch{}z.current?.focus({preventScroll:!0});let i=0,c=()=>{be(e,ue(e,n,s)),i=requestAnimationFrame(c)};return c(),()=>cancelAnimationFrame(i)},[n,s]),(0,a.useEffect)(()=>{if(l)return;let e=i=>{i.target instanceof Node&&E.current?.contains(i.target)||r()};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[l,r]);let fe=e=>{if(e.key==="ArrowDown"&&k.length>0)e.preventDefault(),m(i=>Math.min(k.length-1,i+1));else if(e.key==="ArrowUp"&&k.length>0)e.preventDefault(),m(i=>Math.max(0,i-1));else if(e.key==="Enter"){e.preventDefault();let i=k[b];i?i.take():u.trim()&&H(u)}},w=l?.result??null,he=k[b];return(0,d.jsxs)("section",{ref:E,popover:"manual",role:"region","aria-label":l?`Answer about ${f}`:`Ask about ${f}`,"data-testid":"quick-ask","data-quick-ask":l?"answer":"bar","data-quick-ask-face":s,"data-graview-offstage":"","data-graview-overlay":"",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),q())},onMouseDown:e=>e.stopPropagation(),style:ve,children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[(0,d.jsxs)("p",{"data-testid":"quick-ask-about",style:{margin:0,flex:"1 1 auto",minWidth:0,fontSize:"0.75rem",color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},children:["About ",f]}),(0,d.jsx)("button",{type:"button","data-testid":"quick-ask-close","aria-label":"Close",title:"Close",onClick:q,style:ye,children:(0,d.jsx)("span",{"aria-hidden":"true",children:"\u2715"})})]}),l?(0,d.jsxs)("div",{"data-testid":"quick-answer",style:{display:"grid",gap:8},children:[(0,d.jsxs)("p",{"data-testid":"quick-answer-asked",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",fontStyle:"italic",overflowWrap:"anywhere"},children:["\u201C",l.said,"\u201D"]}),(0,d.jsx)("p",{"data-testid":"quick-answer-text","aria-live":"polite",style:{margin:0,fontSize:"0.9375rem",lineHeight:1.45,color:w?.interaction.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)",overflowWrap:"anywhere"},children:w===null?"Thinking\u2026":w.interaction.outcome==="failed"?w.interaction.failed??"The AI could not answer that here.":w.answer??""}),w&&w.offers.length>0?(0,d.jsx)("ul",{"aria-label":"What acts on it",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:6},children:w.offers.map(e=>(0,d.jsx)("li",{children:(0,d.jsx)("button",{type:"button","data-testid":"quick-answer-offer","data-ai-offer":e.id,"data-ai-offer-type":e.type,onClick:()=>{le(t,w,e,r).then(i=>{i&&R.current&&L(i)})},style:xe,children:e.type==="panel"?`Show ${pe(e.label)}`:e.type==="place"?`Go to ${e.label}`:e.label})},e.id))}):null,G?.onCard&&G.ghost.interaction===w?.interaction.id?(0,d.jsx)(de,{placement:"card"}):null]}):null,(0,d.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,d.jsx)("input",{ref:z,type:"text",role:"combobox","data-testid":"quick-ask-input","aria-label":l?`Ask a follow-up about ${f}`:`Ask about ${f}, or go somewhere`,"aria-expanded":k.length>0,"aria-controls":T,"aria-autocomplete":"list",...he?{"aria-activedescendant":`${T}-${b}`}:{},autoComplete:"off",enterKeyHint:"go",placeholder:l?"Ask a follow-up\u2026":"Ask, or go to\u2026",value:u,readOnly:l!==null&&w===null,"aria-busy":l!==null&&w===null,onChange:e=>y(e.target.value),onKeyDown:fe,style:Ae}),(0,d.jsx)("div",{id:T,role:"listbox","aria-label":u.trim()?`What \u201C${u.trim()}\u201D finds here`:"What can be done here",hidden:k.length===0,style:{display:k.length===0?"none":"grid",gap:1,maxHeight:280,overflowY:"auto"},children:k.map((e,i)=>(0,d.jsx)("div",{id:`${T}-${i}`,role:"option","aria-selected":i===b,"data-testid":"quick-ask-option","data-quick-ask-kind":e.kind,"data-quick-ask-row":e.id,onMouseEnter:()=>m(i),onMouseDown:c=>c.preventDefault(),onClick:e.take,style:{...Se,background:i===b?"var(--graview-panel-muted)":"transparent",...e.kind==="ask"?{borderTop:"1px solid var(--graview-edge)",marginTop:2}:{}},children:e.kind==="ask"?(0,d.jsxs)("span",{children:["Ask: ",(0,d.jsxs)("span",{style:{fontWeight:600},children:["\u2018",e.label,"\u2019"]})]}):(0,d.jsxs)("span",{children:[e.label,e.hint?(0,d.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.hint]}):null]})},e.id))})]}),A?(0,d.jsx)("p",{role:"alert","data-testid":"quick-ask-refused",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-warn)"},children:A}):null,(0,d.jsx)("span",{style:J,"aria-live":"polite",children:k.length>0&&u.trim()?`${k.length} ${k.length===1?"way":"ways"} to go on`:""})]})}function ue(s,p,r){let t=s?.closest("[data-graview-embed]")??document,v=p.on==="list"?[`aggregate:${p.kind}`,`kind:${p.kind}`]:p.on==="lens"&&p.kind?[`aggregate:${p.kind}`]:C(p);for(let n of v)for(let f of t.querySelectorAll(`[data-graview-view="${CSS.escape(n)}"], [data-graview-pick="${CSS.escape(n)}"]`)){if(s?.contains(f))continue;let u=f.getBoundingClientRect();if(u.width>0&&u.height>0)return f}return r==="pages"?t.querySelector("main [data-graview-page-title]")??t.querySelector("main h1"):null}function be(s,p){let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},t=Math.min(we,r.width-2*h),v=s.getBoundingClientRect().height,n=p?.getBoundingClientRect(),f,u,y,b=A=>Math.max(h,Math.min(A,r.height-v-h));if(n&&n.width>0&&n.bottom>0&&n.top<r.height)if(n.right+h+t<=r.width-h)f=n.right+h,u=b(n.top),y="right";else if(n.left-h-t>=h)f=n.left-h-t,u=b(n.top),y="left";else{f=Math.max(h,Math.min(n.left,r.width-t-h));let A=n.bottom+h;u=A+v<=r.height-h?A:b(n.top-h-v),y=A+v<=r.height-h?"below":"above"}else f=(r.width-t)/2,u=b(72),y="top";let m=s.style,l={left:`${Math.round(f)}px`,top:`${Math.round(u)}px`,width:`${Math.round(t)}px`};m.left!==l.left&&(m.left=l.left),m.top!==l.top&&(m.top=l.top),m.width!==l.width&&(m.width=l.width);let $=p?.getAttribute("data-graview-view")??p?.getAttribute("data-graview-pick")??(p?"page":"");s.getAttribute("data-quick-ask-beside")!==$&&s.setAttribute("data-quick-ask-beside",$),s.getAttribute("data-quick-ask-side")!==y&&s.setAttribute("data-quick-ask-side",y)}var ve={position:"fixed",inset:"auto",margin:0,zIndex:Y("popover"),boxSizing:"border-box",display:"grid",gap:10,padding:12,borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",maxHeight:"calc(100dvh - 24px)",overflowY:"auto",fontSize:"0.875rem"},ye={display:"inline-grid",placeItems:"center",width:28,height:28,padding:0,font:"inherit",fontSize:"0.875rem",lineHeight:1,color:"var(--graview-ink-muted)",background:"transparent",border:"1px solid transparent",borderRadius:6,boxShadow:"none",cursor:"pointer"},Ae={boxSizing:"border-box",width:"100%",height:36,padding:"0 10px",font:"inherit",fontSize:"max(1rem,16px)",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:8},Se={display:"flex",alignItems:"center",minHeight:30,padding:"4px 8px",borderRadius:6,cursor:"pointer",overflowWrap:"anywhere"},xe={display:"inline-flex",alignItems:"center",minHeight:30,padding:"2px 10px",font:"inherit",fontSize:"0.8125rem",borderRadius:8};export{Oe as QuickAskCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as on,c as an,d as te,e as sn,f as re,h as Re,i as dn,n as cn,q as oe}from"./chunk.VKJAGZNU.js";import{$a as We,B as pe,Ba as Be,Bb as Xe,C as me,Da as _e,F as ke,Gb as en,H as Ce,Ha as be,I as Ze,Ia as ve,Oa as He,Ra as Ue,aa as Ke,ab as Je,b as Te,c as De,cc as nn,d as $e,e as K,ea as Ve,eb as xe,fb as Ye,g as de,h as M,i as Pe,j as Ge,k as ce,ka as Ie,l as Me,m as Le,nc as tn,o as Fe,oc as rn,p as le,q as he,ub as U,v as Ne,va as we,x as ne,xb as Qe,ya as qe,z as fe}from"./chunk.UG727PEE.js";function ln(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let s=e,n=w=>typeof s[w]=="string"?s[w]:void 0,t=n("light")??n("src");if(t===void 0)return;let[o,u,m]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...o!==void 0?{dark:o}:{},...u!==void 0?{alt:u}:{},...m!==void 0?{darkFallback:m}:{}}}function Gn(e,s){let n=e.brand??{},t=n.accent?rn(n.accent):void 0;t&&!t.ok&&s.push(dn("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${t.why}`,"pick a color further from orange-red, or a darker one"));let o=ln(n.logo),u=n.name??e.name,m=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,w])=>typeof w=="string"&&!/url\(|@import|[;{}<>\\]/i.test(w)).map(([w,L])=>[w,tn(L)])):void 0;return{name:u,schemes:t?.ok?t.schemes:nn,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...o?{logo:o.dark||o.darkFallback==="invert"?{light:o.light,...o.dark?{dark:o.dark}:{darkFallback:"invert"}}:o.light,logoAlt:o.alt??u}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...m?{typography:m}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function fn(e){let{currency:s,locale:n,timeZone:t}=e.brand??{};return{...s?{currency:s}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var bn=Symbol.for("@graview/core:typed-field"),pn=(e,s)=>(/^(phone|place|duration)$/.test(s)&&(me(e)[bn]=s),e),mn=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function un(e){let s=M().check(K(300),fe(t=>Be(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?s:le(s).check(K(200));return _e(e.description?n.check(pe(e.description)):n,e)}var xn=new WeakMap;function gn(e,s){xn.set(e,s)}var Rn=[{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 yn(e,s=Rn){if(!V(e))return{document:e,respelled:[]};let n=[],t=e;for(let o of s)t=Oe(t,o.where.split("."),o,"",n);return{document:t,respelled:n}}function Oe(e,s,n,t,o){if(s.length===0){if(!V(e)||!Object.hasOwn(e,n.was))return e;o.push(`${t}${n.was}`);let{[n.was]:D,...N}=e;return Object.hasOwn(e,n.now)?N:{...N,[n.now]:D}}if(!V(e))return e;let[u,...m]=s,w=u.endsWith("[]"),L=w?u.slice(0,-2):u,F=e[L],B=F;if(!w)B=Oe(F,m,n,`${t}${L}.`,o);else if(Array.isArray(F)){let D=F.map((N,W)=>Oe(N,m,n,`${t}${L}.${W}.`,o));B=D.some((N,W)=>N!==F[W])?D:F}return B===F?e:{...e,[L]:B}}var hn="graview-compiled@1";function On(e,s){return e.find(([n,t])=>n!==q&&"ref"in t&&(t.ref==="*"||t.ref.includes(s)))?.[0]}var q="id",ue=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function kn(e){let s=Object.entries(e.fields),n=t=>["name","title","label"].find(o=>t.some(([u])=>u===o))??t[0]?.[0];return n(s.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(s.filter(([,t])=>t.type==="string"))}function wn(e,s,n){let t;switch(e.type){case"string":case"place":t=M().check(K(500));break;case"phone":t=M().check(K(40),de(mn,"a phone number"));break;case"text":t=M().check(K(2e4)),e.format&&(me(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let u=e.min??(e.type==="duration"?0:void 0),m=[...e.type==="number"?[]:[Me()],...u===void 0?[]:[De(u)],...e.max===void 0?[]:[Te(e.max)],...e.step===void 0?[]:[$e(e.step)]];t=m.length>0?ce().check(...m):ce();break}case"boolean":t=Le();break;case"date":t=M().check(de(ke,"a date like 2026-10-02"));break;case"datetime":t=M().check(fe(Ce,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Ne(e.options);break;case"list":t=le(e.of==="number"?ce():e.of==="date"?M().check(de(ke)):e.of==="image"||e.of==="video"||e.of==="file"?we(e.of):M().check(K(500))).check(K(200));break;case"image":case"video":case"file":t=we(e.type);break;case"app-link":t=qe();break;case"url":t=Ge();break;case"email":t=Pe();break}let o=e.type==="number"||e.type==="integer";return pn(t,o&&e.format==="duration"?"duration":e.type),e.description&&(t=t.check(pe(e.description))),o&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&Xe(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),s?ne(t):t}var ie=e=>{throw new U(`there is no record "${e}"`,"invalid")},zn=(e,s)=>"field"in e?wn(e.field,e.optional,s):"ref"in e?en(e.ref):ne(Fe()),An=new WeakMap;var ze=(e,s)=>V(s)&&Object.keys(e??{}).length===Object.keys(s).length&&Object.keys(e??{}).every(n=>Object.hasOwn(s,n));function it(e,s={}){let n=V(e)?e.format:void 0;if(n!==hn)return{ok:!1,findings:[Re("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${hn}`,"compile the document instead")]};let t=e,o=yn(t.document).document,u=o===t.document?t:{...t,document:o},m=V(o)&&typeof o.name=="string"&&V(o.kinds)&&ze(o.kinds,u.kinds)&&ze(o.acts,u.acts)&&ze(o.rules,u.rules)&&Array.isArray(u.edges)&&Array.isArray(u.findings),w={ok:!1,findings:[Re("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!m)return w;try{return Sn(u,s)}catch{return w}}function Sn(e,s={}){let{document:n}=e,t=n.brand?.timeZone,o=s.today??(()=>Ze(t)),u=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,O=ve(r.edges);m.set(h,{fields:new Set([...Object.keys(r.fields),...O.keys()]),edges:new Map(Object.entries(be(r.edges)).map(([j,$])=>[j,$.cardinality??"many"])),...z?{computed:new Map(z)}:{},...O.size>0?{linked:O}:{}})}e.facts&&m.set(an,{computed:new Map(e.facts)});let w=fn(n),L=new Map,F=Object.entries(n.kinds).map(([h,r])=>{let z={};for(let[i,g]of Object.entries(r.fields))z[i]=wn(g,!g.required,w),g.repeats&&(z[He(i)]=ne(Ue()));for(let[i,g]of ve(r.edges))z[i]=ne(un(g));let{label:O,describe:j,durations:$}=e.kinds[h]??{},P=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??`{${kn(r)??""}}`),_=Object.fromEntries([...J?[["label","Label"]]:[],...Object.entries(r.fields).filter(([,i])=>i.label).map(([i,g])=>[i,g.label]),...P.filter(([,i])=>i.label).map(([i,g])=>[i,g.label])]),A=Object.keys(_).length>0,l=Object.fromEntries(Object.entries(r.fields).filter(([,i])=>i.default!==void 0).map(([i,g])=>[i,g.default]));L.set(h,l);let T=Object.fromEntries(Object.entries(be(r.edges)).map(([i,{renamedFrom:g,...I}])=>[i,I])),S=i=>r[i]?{[i]:r[i]}:{};return Ke(h,{fields:he(z),edges:T,...S("plural"),...S("noun"),...S("description"),...O?{label:i=>oe(O,{node:i,kinds:m,today:o(),money:w})||i.id}:{},...j?{describe:i=>oe(j,{node:i,kinds:m,today:o(),money:w})}:{},...S("lifecycle"),...S("figure"),...S("fieldRoles"),...S("people"),archives:r.archives,...r.tidying?{tidying:r.tidying}:{},...P.length>0?{computed:Object.fromEntries(P.map(([i,g])=>[i,$?.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(l).length>0?{defaults:l}:{}})}),B=We(F,n.computed);function D(h){return B.tryDefinition(h.kind)?.label?.(h)??h.id}let N=h=>({id:"",kind:h,...L.get(h)}),W=[];for(let[h,r]of Object.entries(n.acts??{})){let z=e.acts[h],{title:O,effects:j,guard:$,refusal:P,destructive:J,idempotent:_,creates:A,connects:l,severs:T,writes:S,writesOther:i,sets:g}=z,I=new Map(z.args),ae={};for(let[d,x]of I)ae[d]=zn(x,w);let b=[r.on??[]].flat(),C=new Map(z.exprs),G=j.find(d=>"create"in d),Y=(d,x,f,v=null)=>{if(V(d)&&"expr"in d)return re(C.get(d.expr),{graph:f,subject:v,kinds:m,bindings:x,today:o()});let k=ue(d);return k===void 0?typeof d=="string"&&d.startsWith("$$")?d.slice(1):d:k==="now"?new Date().toISOString():k==="today"?o():x[k]},Ee=(d,x)=>{if(!G)return"";let f=n.kinds[G.create].fields,v=N(G.create),k=[];for(let[R,ee]of Object.entries(G.set??{})){try{v[R]=Y(ee,d,x)??v[R]}catch{}let Q=ue(ee);Q&&d[Q]!==void 0&&k.push(R)}let Z=D(v).trim(),H=k.filter(R=>v[R]!==!1&&f[R].type!=="text"&&!(/[^]{41}/.test(v[R])||/ .*[.!?]$/.test(v[R])&&!/[ .][A-Z]\w{0,3}\.$/.test(v[R]))&&D({...v,[R]:void 0}).trim()===Z).map(R=>v[R]===!0?f[R].label??Ve(R):cn(v[R],f[R].format,o(),[],w));return Z&&H.length>0?`${Z} (${H.join(", ")})`:Z};W.push(Qe(h,{input:he(ae),title:O,...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}:{},...l.length>0?{connects:l}:{},...T.length>0?{severs:T}:{},writes:S,...Object.keys(i).length>0?{writesOther:i}:{},...Object.keys(g).length>0?{sets:g}:{},describe:(d,x)=>{let f=typeof d[q]=="string"?x.getNode(d[q]):void 0,v=f?D(f):Ee(d,x);return v?`${O}: ${v}`:O},apply(d,x){let f=d.graph,v=typeof x[q]=="string"?x[q]:void 0,k=v?f.getNode(v):void 0;if(v&&!k&&ie(v),k&&b.length>0&&!b.includes(k.kind))throw new U(`"${O}" acts on ${b.join(" or ")}, not on ${Ie(k.kind)}`,"invalid");let Z={};for(let[a,c]of Object.entries(x))c!==void 0&&(Z[a]=c);if($&&k){let a;try{a=re($,{graph:f,subject:k,kinds:m,bindings:Z,today:o()})}catch(c){throw c instanceof te?new U(`"${O}" could not be judged: ${c.sentence}`):c}if(a!==!0)throw new U(P?oe(P,{node:k,kinds:m,graph:f,bindings:Z,today:o(),money:w}):`"${O}" is not allowed for ${D(k)} right now`)}let H=new Map,R=a=>f.has(a)||[...H.values()].includes(a),ee=new Set,Q=a=>{let c=Je(a);ee.has(c)||(ee.add(c),d.removeEdge(a))},X=(a,c)=>{let p=ue(a);if(p==="subject")return v;if(p==="me"){let y=d.me;if(y&&n.kinds[f.getNode(y)?.kind]?.people)return y;throw new U(`"${O}" is done as you, and you have no record here`)}if(H.has(p))return H.get(p);try{return Y(a,Z,f,c??k??null)}catch(y){throw y instanceof te?new U(`"${O}" could not work out a value: ${y.sentence}`):y}};for(let a of j)if("create"in a){let c=n.kinds[a.create],p=N(a.create);for(let[ye,se]of Object.entries(a.set??{})){let je=X(se,void 0);je!==void 0&&(p[ye]=je)}let y=kn(c),E=d.freshId(String((y&&p[y])??a.create),a.create);d.addNode({...p,id:E}),a.as&&H.set(a.as,E)}else if("connect"in a||"sever"in a){let c="connect"in a?a.connect:a.sever,p=String(X(a.from,void 0)??""),y=String(X(a.to,void 0)??"");if(R(p)||ie(p),R(y)||ie(y),"connect"in a){if(u.get(c)?.cardinality==="one")for(let E of f.out(p,c))E.id!==y&&Q({kind:c,from:p,to:E.id});f.out(p,c).some(E=>E.id===y)||d.addEdge({kind:c,from:p,to:y})}else Q({kind:c,from:p,to:y})}else if("set"in a){let c=String(X(a.target??"$subject",void 0)??""),p=f.getNode(c);!p&&!R(c)&&ie(c);let y={};for(let[E,ye]of Object.entries(a.set)){let se=X(ye,p);se!==void 0&&(y[E]=se)}Object.keys(y).length>0&&d.patchNode(c,y)}else if("remove"in a){let c=String(X(a.remove,void 0)??"");f.has(c)||ie(c),d.removeNode(c)}else if("replace"in a&&k){let c=x.to;for(let p of a.replace){let y=u.get(p)?.from.includes(k.kind)??!0;for(let E of y?f.out(k.id,p):f.in(k.id,p))p===a.keep&&E.id===c||Q(y?{kind:p,from:k.id,to:E.id}:{kind:p,from:E.id,to:k.id})}}}}))}let Ae=[];for(let[h,r]of Object.entries(n.rules??{})){let{title:z,require:O,when:j,says:$}=e.rules[h],P=r.repairs??[],J=(A,l,T=o(),S)=>{let i=[],g={graph:A,subject:l,kinds:m,today:T,...S?{linked:S}:{},onUnread:b=>i.push(b)},I;try{if(j&&re(j,g)!==!0)return[];if(I=re(O,g)===!0,!I&&i.length>0)throw new te(`it reads ${on(i[0])}`,0)}catch(b){throw b instanceof sn?new Ye(b.sentence):b instanceof te?new Error(b.sentence):b}if(I)return[];let ae=P.flatMap(b=>{let C=n.acts?.[b.act],G={},Y=l&&C?.on&&C.fromTheOtherEnd&&![C.on].flat().includes(l.kind)?On(e.acts[b.act].args,l.kind):void 0;Y?G[Y]=l.id:l&&(C?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(b.act))&&(G[q]=l.id);for(let[x,f]of Object.entries(b.args??{}))G[x]=ue(f)==="subject"?l?.id:f;let d=(C?e.acts[b.act].args:[]).filter(([x,f])=>f.required&&G[x]===void 0).map(([x])=>x);return[{mutation:b.act,label:b.label??(Y?C.fromTheOtherEnd:C?.title)??b.act.replace(/-/g," "),args:G,...d.length>0?{missing:d}:{}}]});return[{invariant:h,...l?{subjectId:l.id}:{},label:z,message:$?oe($,{node:l,kinds:m,graph:A,today:T,money:w}):l?`${D(l)}: ${z}`:z,nodeIds:l?[l.id]:[],repairs:ae}]},_={label:z,shape:{over:r.over,require:O,when:j,says:$,declared:n.kinds,money:w,kinds:m,today:o},judgment:{require:r.require,...r.when?{when:r.when}:{},...r.says?{says:r.says}:{}},...r.description?{description:r.description}:{},...P.length>0?{repairs:P.map(A=>A.act)}:{}};Ae.push(r.over==="graph"?xe(h,{scope:"graph",..._,evaluate:({graph:A,today:l,context:T})=>J(A,null,l,T?.linked)}):xe(h,{scope:{kind:r.over},..._,evaluate:({graph:A,subject:l,today:T,context:S})=>J(A,l,T,S?.linked)}))}let Se=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ge={name:n.name,schema:B,mutations:W,invariants:Ae,...Se?{policy:Se}:{},...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}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return gn(ge,n),An.set(ge,e),{ok:!0,app:ge,document:n,findings:e.findings,sights:n.policy?.sees,kinds:m}}export{yn as a,Gn as b,hn as c,q as d,ue as e,kn as f,it as g,Sn as h};
|
|
1
|
+
import{b as on,c as an,d as te,e as sn,f as re,h as Re,i as dn,n as cn,q as oe}from"./chunk.TMBFLZNH.js";import{$a as We,B as pe,Ba as Be,Bb as Xe,C as me,Da as _e,F as ke,Gb as en,H as Ce,Ha as be,I as Ze,Ia as ve,Oa as He,Ra as Ue,aa as Ke,ab as Je,b as Te,c as De,cc as nn,d as $e,db as xe,e as K,ea as Ve,eb as Ye,g as de,h as M,i as Pe,j as Ge,k as ce,ka as Ie,l as Me,m as Le,nc as tn,o as Fe,oc as rn,p as le,q as he,ub as U,v as Ne,va as we,x as ne,xb as Qe,ya as qe,z as fe}from"./chunk.7MQ7UWVW.js";function ln(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let s=e,n=w=>typeof s[w]=="string"?s[w]:void 0,t=n("light")??n("src");if(t===void 0)return;let[o,u,m]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...o!==void 0?{dark:o}:{},...u!==void 0?{alt:u}:{},...m!==void 0?{darkFallback:m}:{}}}function Gn(e,s){let n=e.brand??{},t=n.accent?rn(n.accent):void 0;t&&!t.ok&&s.push(dn("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${t.why}`,"pick a color further from orange-red, or a darker one"));let o=ln(n.logo),u=n.name??e.name,m=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,w])=>typeof w=="string"&&!/url\(|@import|[;{}<>\\]/i.test(w)).map(([w,L])=>[w,tn(L)])):void 0;return{name:u,schemes:t?.ok?t.schemes:nn,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...o?{logo:o.dark||o.darkFallback==="invert"?{light:o.light,...o.dark?{dark:o.dark}:{darkFallback:"invert"}}:o.light,logoAlt:o.alt??u}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...m?{typography:m}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function fn(e){let{currency:s,locale:n,timeZone:t}=e.brand??{};return{...s?{currency:s}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var bn=Symbol.for("@graview/core:typed-field"),pn=(e,s)=>(/^(phone|place|duration)$/.test(s)&&(me(e)[bn]=s),e),mn=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function un(e){let s=M().check(K(300),fe(t=>Be(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?s:le(s).check(K(200));return _e(e.description?n.check(pe(e.description)):n,e)}var xn=new WeakMap;function gn(e,s){xn.set(e,s)}var Rn=[{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 yn(e,s=Rn){if(!V(e))return{document:e,respelled:[]};let n=[],t=e;for(let o of s)t=Oe(t,o.where.split("."),o,"",n);return{document:t,respelled:n}}function Oe(e,s,n,t,o){if(s.length===0){if(!V(e)||!Object.hasOwn(e,n.was))return e;o.push(`${t}${n.was}`);let{[n.was]:D,...N}=e;return Object.hasOwn(e,n.now)?N:{...N,[n.now]:D}}if(!V(e))return e;let[u,...m]=s,w=u.endsWith("[]"),L=w?u.slice(0,-2):u,F=e[L],B=F;if(!w)B=Oe(F,m,n,`${t}${L}.`,o);else if(Array.isArray(F)){let D=F.map((N,W)=>Oe(N,m,n,`${t}${L}.${W}.`,o));B=D.some((N,W)=>N!==F[W])?D:F}return B===F?e:{...e,[L]:B}}var hn="graview-compiled@1";function On(e,s){return e.find(([n,t])=>n!==q&&"ref"in t&&(t.ref==="*"||t.ref.includes(s)))?.[0]}var q="id",ue=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function kn(e){let s=Object.entries(e.fields),n=t=>["name","title","label"].find(o=>t.some(([u])=>u===o))??t[0]?.[0];return n(s.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(s.filter(([,t])=>t.type==="string"))}function wn(e,s,n){let t;switch(e.type){case"string":case"place":t=M().check(K(500));break;case"phone":t=M().check(K(40),de(mn,"a phone number"));break;case"text":t=M().check(K(2e4)),e.format&&(me(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let u=e.min??(e.type==="duration"?0:void 0),m=[...e.type==="number"?[]:[Me()],...u===void 0?[]:[De(u)],...e.max===void 0?[]:[Te(e.max)],...e.step===void 0?[]:[$e(e.step)]];t=m.length>0?ce().check(...m):ce();break}case"boolean":t=Le();break;case"date":t=M().check(de(ke,"a date like 2026-10-02"));break;case"datetime":t=M().check(fe(Ce,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Ne(e.options);break;case"list":t=le(e.of==="number"?ce():e.of==="date"?M().check(de(ke)):e.of==="image"||e.of==="video"||e.of==="file"?we(e.of):M().check(K(500))).check(K(200));break;case"image":case"video":case"file":t=we(e.type);break;case"app-link":t=qe();break;case"url":t=Ge();break;case"email":t=Pe();break}let o=e.type==="number"||e.type==="integer";return pn(t,o&&e.format==="duration"?"duration":e.type),e.description&&(t=t.check(pe(e.description))),o&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&Xe(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),s?ne(t):t}var ie=e=>{throw new U(`there is no record "${e}"`,"invalid")},zn=(e,s)=>"field"in e?wn(e.field,e.optional,s):"ref"in e?en(e.ref):ne(Fe()),An=new WeakMap;var ze=(e,s)=>V(s)&&Object.keys(e??{}).length===Object.keys(s).length&&Object.keys(e??{}).every(n=>Object.hasOwn(s,n));function it(e,s={}){let n=V(e)?e.format:void 0;if(n!==hn)return{ok:!1,findings:[Re("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${hn}`,"compile the document instead")]};let t=e,o=yn(t.document).document,u=o===t.document?t:{...t,document:o},m=V(o)&&typeof o.name=="string"&&V(o.kinds)&&ze(o.kinds,u.kinds)&&ze(o.acts,u.acts)&&ze(o.rules,u.rules)&&Array.isArray(u.edges)&&Array.isArray(u.findings),w={ok:!1,findings:[Re("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!m)return w;try{return Sn(u,s)}catch{return w}}function Sn(e,s={}){let{document:n}=e,t=n.brand?.timeZone,o=s.today??(()=>Ze(t)),u=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,O=ve(r.edges);m.set(h,{fields:new Set([...Object.keys(r.fields),...O.keys()]),edges:new Map(Object.entries(be(r.edges)).map(([j,$])=>[j,$.cardinality??"many"])),...z?{computed:new Map(z)}:{},...O.size>0?{linked:O}:{}})}e.facts&&m.set(an,{computed:new Map(e.facts)});let w=fn(n),L=new Map,F=Object.entries(n.kinds).map(([h,r])=>{let z={};for(let[i,g]of Object.entries(r.fields))z[i]=wn(g,!g.required,w),g.repeats&&(z[He(i)]=ne(Ue()));for(let[i,g]of ve(r.edges))z[i]=ne(un(g));let{label:O,describe:j,durations:$}=e.kinds[h]??{},P=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??`{${kn(r)??""}}`),_=Object.fromEntries([...J?[["label","Label"]]:[],...Object.entries(r.fields).filter(([,i])=>i.label).map(([i,g])=>[i,g.label]),...P.filter(([,i])=>i.label).map(([i,g])=>[i,g.label])]),A=Object.keys(_).length>0,l=Object.fromEntries(Object.entries(r.fields).filter(([,i])=>i.default!==void 0).map(([i,g])=>[i,g.default]));L.set(h,l);let T=Object.fromEntries(Object.entries(be(r.edges)).map(([i,{renamedFrom:g,...I}])=>[i,I])),S=i=>r[i]?{[i]:r[i]}:{};return Ke(h,{fields:he(z),edges:T,...S("plural"),...S("noun"),...S("description"),...O?{label:i=>oe(O,{node:i,kinds:m,today:o(),money:w})||i.id}:{},...j?{describe:i=>oe(j,{node:i,kinds:m,today:o(),money:w})}:{},...S("lifecycle"),...S("figure"),...S("fieldRoles"),...S("people"),archives:r.archives,...r.tidying?{tidying:r.tidying}:{},...P.length>0?{computed:Object.fromEntries(P.map(([i,g])=>[i,$?.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(l).length>0?{defaults:l}:{}})}),B=We(F,n.computed);function D(h){return B.tryDefinition(h.kind)?.label?.(h)??h.id}let N=h=>({id:"",kind:h,...L.get(h)}),W=[];for(let[h,r]of Object.entries(n.acts??{})){let z=e.acts[h],{title:O,effects:j,guard:$,refusal:P,destructive:J,idempotent:_,creates:A,connects:l,severs:T,writes:S,writesOther:i,sets:g}=z,I=new Map(z.args),ae={};for(let[d,x]of I)ae[d]=zn(x,w);let b=[r.on??[]].flat(),C=new Map(z.exprs),G=j.find(d=>"create"in d),Y=(d,x,f,v=null)=>{if(V(d)&&"expr"in d)return re(C.get(d.expr),{graph:f,subject:v,kinds:m,bindings:x,today:o()});let k=ue(d);return k===void 0?typeof d=="string"&&d.startsWith("$$")?d.slice(1):d:k==="now"?new Date().toISOString():k==="today"?o():x[k]},Ee=(d,x)=>{if(!G)return"";let f=n.kinds[G.create].fields,v=N(G.create),k=[];for(let[R,ee]of Object.entries(G.set??{})){try{v[R]=Y(ee,d,x)??v[R]}catch{}let Q=ue(ee);Q&&d[Q]!==void 0&&k.push(R)}let Z=D(v).trim(),H=k.filter(R=>v[R]!==!1&&f[R].type!=="text"&&!(/[^]{41}/.test(v[R])||/ .*[.!?]$/.test(v[R])&&!/[ .][A-Z]\w{0,3}\.$/.test(v[R]))&&D({...v,[R]:void 0}).trim()===Z).map(R=>v[R]===!0?f[R].label??Ve(R):cn(v[R],f[R].format,o(),[],w));return Z&&H.length>0?`${Z} (${H.join(", ")})`:Z};W.push(Qe(h,{input:he(ae),title:O,...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}:{},...l.length>0?{connects:l}:{},...T.length>0?{severs:T}:{},writes:S,...Object.keys(i).length>0?{writesOther:i}:{},...Object.keys(g).length>0?{sets:g}:{},describe:(d,x)=>{let f=typeof d[q]=="string"?x.getNode(d[q]):void 0,v=f?D(f):Ee(d,x);return v?`${O}: ${v}`:O},apply(d,x){let f=d.graph,v=typeof x[q]=="string"?x[q]:void 0,k=v?f.getNode(v):void 0;if(v&&!k&&ie(v),k&&b.length>0&&!b.includes(k.kind))throw new U(`"${O}" acts on ${b.join(" or ")}, not on ${Ie(k.kind)}`,"invalid");let Z={};for(let[a,c]of Object.entries(x))c!==void 0&&(Z[a]=c);if($&&k){let a;try{a=re($,{graph:f,subject:k,kinds:m,bindings:Z,today:o()})}catch(c){throw c instanceof te?new U(`"${O}" could not be judged: ${c.sentence}`):c}if(a!==!0)throw new U(P?oe(P,{node:k,kinds:m,graph:f,bindings:Z,today:o(),money:w}):`"${O}" is not allowed for ${D(k)} right now`)}let H=new Map,R=a=>f.has(a)||[...H.values()].includes(a),ee=new Set,Q=a=>{let c=Je(a);ee.has(c)||(ee.add(c),d.removeEdge(a))},X=(a,c)=>{let p=ue(a);if(p==="subject")return v;if(p==="me"){let y=d.me;if(y&&n.kinds[f.getNode(y)?.kind]?.people)return y;throw new U(`"${O}" is done as you, and you have no record here`)}if(H.has(p))return H.get(p);try{return Y(a,Z,f,c??k??null)}catch(y){throw y instanceof te?new U(`"${O}" could not work out a value: ${y.sentence}`):y}};for(let a of j)if("create"in a){let c=n.kinds[a.create],p=N(a.create);for(let[ye,se]of Object.entries(a.set??{})){let je=X(se,void 0);je!==void 0&&(p[ye]=je)}let y=kn(c),E=d.freshId(String((y&&p[y])??a.create),a.create);d.addNode({...p,id:E}),a.as&&H.set(a.as,E)}else if("connect"in a||"sever"in a){let c="connect"in a?a.connect:a.sever,p=String(X(a.from,void 0)??""),y=String(X(a.to,void 0)??"");if(R(p)||ie(p),R(y)||ie(y),"connect"in a){if(u.get(c)?.cardinality==="one")for(let E of f.out(p,c))E.id!==y&&Q({kind:c,from:p,to:E.id});f.out(p,c).some(E=>E.id===y)||d.addEdge({kind:c,from:p,to:y})}else Q({kind:c,from:p,to:y})}else if("set"in a){let c=String(X(a.target??"$subject",void 0)??""),p=f.getNode(c);!p&&!R(c)&&ie(c);let y={};for(let[E,ye]of Object.entries(a.set)){let se=X(ye,p);se!==void 0&&(y[E]=se)}Object.keys(y).length>0&&d.patchNode(c,y)}else if("remove"in a){let c=String(X(a.remove,void 0)??"");f.has(c)||ie(c),d.removeNode(c)}else if("replace"in a&&k){let c=x.to;for(let p of a.replace){let y=u.get(p)?.from.includes(k.kind)??!0;for(let E of y?f.out(k.id,p):f.in(k.id,p))p===a.keep&&E.id===c||Q(y?{kind:p,from:k.id,to:E.id}:{kind:p,from:E.id,to:k.id})}}}}))}let Ae=[];for(let[h,r]of Object.entries(n.rules??{})){let{title:z,require:O,when:j,says:$}=e.rules[h],P=r.repairs??[],J=(A,l,T=o(),S)=>{let i=[],g={graph:A,subject:l,kinds:m,today:T,...S?{linked:S}:{},onUnread:b=>i.push(b)},I;try{if(j&&re(j,g)!==!0)return[];if(I=re(O,g)===!0,!I&&i.length>0)throw new te(`it reads ${on(i[0])}`,0)}catch(b){throw b instanceof sn?new Ye(b.sentence):b instanceof te?new Error(b.sentence):b}if(I)return[];let ae=P.flatMap(b=>{let C=n.acts?.[b.act],G={},Y=l&&C?.on&&C.fromTheOtherEnd&&![C.on].flat().includes(l.kind)?On(e.acts[b.act].args,l.kind):void 0;Y?G[Y]=l.id:l&&(C?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(b.act))&&(G[q]=l.id);for(let[x,f]of Object.entries(b.args??{}))G[x]=ue(f)==="subject"?l?.id:f;let d=(C?e.acts[b.act].args:[]).filter(([x,f])=>f.required&&G[x]===void 0).map(([x])=>x);return[{mutation:b.act,label:b.label??(Y?C.fromTheOtherEnd:C?.title)??b.act.replace(/-/g," "),args:G,...d.length>0?{missing:d}:{}}]});return[{invariant:h,...l?{subjectId:l.id}:{},label:z,message:$?oe($,{node:l,kinds:m,graph:A,today:T,money:w}):l?`${D(l)}: ${z}`:z,nodeIds:l?[l.id]:[],repairs:ae}]},_={label:z,shape:{over:r.over,require:O,when:j,says:$,declared:n.kinds,money:w,kinds:m,today:o},judgment:{require:r.require,...r.when?{when:r.when}:{},...r.says?{says:r.says}:{}},...r.description?{description:r.description}:{},...P.length>0?{repairs:P.map(A=>A.act)}:{}};Ae.push(r.over==="graph"?xe(h,{scope:"graph",..._,evaluate:({graph:A,today:l,context:T})=>J(A,null,l,T?.linked)}):xe(h,{scope:{kind:r.over},..._,evaluate:({graph:A,subject:l,today:T,context:S})=>J(A,l,T,S?.linked)}))}let Se=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ge={name:n.name,schema:B,mutations:W,invariants:Ae,...Se?{policy:Se}:{},...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}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return gn(ge,n),An.set(ge,e),{ok:!0,app:ge,document:n,findings:e.findings,sights:n.policy?.sees,kinds:m}}export{yn as a,Gn as b,hn as c,q as d,ue as e,kn as f,it as g,Sn as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v,b as m,c as h}from"./chunk.MB7LKKUD.js";import"./chunk.VP35BUUZ.js";import{Ea as p,G as N,Ga as b,R as u}from"./chunk.7L6LYXCV.js";import"./chunk.SDO3U72B.js";import{wc as f}from"./chunk.7MQ7UWVW.js";import"./chunk.2AZTW66C.js";import{b as c}from"./chunk.AJZBJBMO.js";var l=c(N(),1);var o=c(u(),1);function z({notices:r,anchor:n,board:a}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(w,{notices:r.filter(i=>i.kind==="banner"),at:"top",anchor:n,board:a}),(0,o.jsx)(w,{notices:r.filter(i=>i.kind==="toast"),at:"foot",anchor:n,board:a})]})}var y={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"};function w({notices:r,at:n,anchor:a,board:i}){let s=(0,l.useRef)(null),t=r.length>0;return(0,l.useLayoutEffect)(()=>{let e=s.current;if(!t||!e)return;if(typeof e.showPopover=="function"&&!p(e))try{e.showPopover()}catch{}let d=()=>(n==="top"?h:m)(e,a());d(),n==="foot"&&i.hold?.(()=>e.matches(":hover, :focus-within"));let S=b(e);addEventListener("resize",d),addEventListener("scroll",d,!0),n==="foot"&&addEventListener(v,d);let g=typeof ResizeObserver=="function"?new ResizeObserver(d):null;return g?.observe(e),()=>{if(S(),g?.disconnect(),removeEventListener("resize",d),removeEventListener("scroll",d,!0),removeEventListener(v,d),e.isConnected&&p(e))try{e.hidePopover()}catch{}}},[t,n,a,i]),t?(0,o.jsx)("div",{ref:s,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:f("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:r.map(e=>(0,o.jsx)(T,{notice:e,board:i},e.id))}):null}function T({notice:r,board:n}){let a=r.tone??"info",i=[...r.action?[r.action]:[],...r.actions??[]],s=()=>n.dismiss(r.id);return(0,o.jsxs)("div",{"data-testid":"notice","data-kind":r.kind,"data-tone":a,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:r.kind==="banner"?"8px 10px 8px 14px":"10px 12px 10px 14px",borderRadius:"var(--graview-radius, 12px)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:`3px solid ${y[a]}`,background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,o.jsx)("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:999,flex:"0 0 auto",background:y[a]}}),(0,o.jsx)("span",{style:{flex:"1 1 16rem",minWidth:0},children:r.sentence}),i.length>0?(0,o.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:i.map((t,e)=>t.href!==void 0?(0,o.jsx)("a",{href:t.href,...t.target?{target:t.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{t.onSelect?.(),s()},style:{...x,...e===0?k:{}},children:t.label},t.label):(0,o.jsx)("button",{type:"button","data-testid":"notice-action",onClick:()=>{s(),t.onSelect?.()},style:{...x,...e===0?k:{}},children:t.label},t.label))}):null,(0,o.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${r.sentence}`,title:"Dismiss",onClick:s,style:E,children:"\xD7"})]})}var x={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},k={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},E={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{z as NoticeStacks};
|