graview 0.1.55 → 0.1.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/{chunk.YGZGMRDC.js → chunk.22MIRLL6.js} +1 -1
- package/dist/preview/chunk.2BLRCT3E.js +1 -0
- package/dist/preview/chunk.2DETYEJM.js +1 -0
- package/dist/preview/{chunk.5EOSEVZB.js → chunk.2E6EWVWR.js} +1 -1
- package/dist/preview/{chunk.JRRVLGEK.js → chunk.2HZGUVB2.js} +1 -1
- package/dist/preview/{chunk.G5XTASMO.js → chunk.2OX4YI46.js} +1 -1
- package/dist/preview/{chunk.4OMSQFIY.js → chunk.2YNZVNCA.js} +1 -1
- package/dist/preview/chunk.3V2WH6F7.js +1 -0
- package/dist/preview/chunk.3X3GLNWQ.js +1 -0
- package/dist/preview/{chunk.FTW3K3G6.js → chunk.45VIF2SX.js} +2 -2
- package/dist/preview/{chunk.QWICAV2C.js → chunk.4EUH6TLG.js} +2 -2
- package/dist/preview/{chunk.35O5H5L7.js → chunk.4EY6WPSM.js} +2 -2
- package/dist/preview/{chunk.7Y6NK5CT.js → chunk.4KMY24YC.js} +1 -1
- package/dist/preview/chunk.4YI6656P.js +1 -0
- package/dist/preview/{chunk.XSMXSNDR.js → chunk.5B4HNQGR.js} +1 -1
- package/dist/preview/{chunk.P4ZZSFOQ.js → chunk.5MS2TQFX.js} +1 -1
- package/dist/preview/chunk.5MSWUTDB.js +1 -0
- package/dist/preview/{chunk.ATXSLBE3.js → chunk.64IKLRUS.js} +1 -1
- package/dist/preview/{chunk.6NQQUIBX.js → chunk.65Q5MKDW.js} +1 -1
- package/dist/preview/{chunk.KVQZ5FR6.js → chunk.6HLKAUWF.js} +1 -1
- package/dist/preview/chunk.6Q6BW4QT.js +2 -0
- package/dist/preview/{chunk.XTP5DGPJ.js → chunk.7NP2I2UP.js} +1 -1
- package/dist/preview/{chunk.FUZWXKTN.js → chunk.7O6Z3BFR.js} +1 -1
- package/dist/preview/chunk.7RJGEU3Y.js +1 -0
- package/dist/preview/{chunk.T66UK7PQ.js → chunk.7U2JO7ET.js} +1 -1
- package/dist/preview/chunk.7Z2PRPYE.js +1 -0
- package/dist/preview/{chunk.DBCVZGCC.js → chunk.7Z4USR3Y.js} +1 -1
- package/dist/preview/chunk.AGTFYPXY.js +1 -0
- package/dist/preview/{chunk.QIAH7HHO.js → chunk.AIK3Z25Y.js} +1 -1
- package/dist/preview/{chunk.XUHY4XO2.js → chunk.AKVBU5K5.js} +1 -1
- package/dist/preview/chunk.AKW6NR3X.js +1 -0
- package/dist/preview/{chunk.ZPXAKRKG.js → chunk.AM2YRNOQ.js} +1 -1
- package/dist/preview/{chunk.YRFN4VDD.js → chunk.APXYWI3L.js} +1 -1
- package/dist/preview/{chunk.HXR7EEXR.js → chunk.AQCU6TPV.js} +1 -1
- package/dist/preview/{chunk.YYWANGIC.js → chunk.AZUTYY2S.js} +1 -1
- package/dist/preview/{chunk.PIHCXN5U.js → chunk.BNEOLRQG.js} +1 -1
- package/dist/preview/chunk.BT7RLFPO.js +1 -0
- package/dist/preview/{chunk.DB3HOKZD.js → chunk.C2VFDBSG.js} +1 -1
- package/dist/preview/{chunk.62LPYPP3.js → chunk.CGM7OER2.js} +1 -1
- package/dist/preview/{chunk.DNJM6WQO.js → chunk.CKV2QCH5.js} +1 -1
- package/dist/preview/{chunk.NDLQXQV2.js → chunk.CU2NQ5WF.js} +1 -1
- package/dist/preview/{chunk.SUGOENC4.js → chunk.D4LN33J2.js} +1 -1
- package/dist/preview/{chunk.OT6EWYK2.js → chunk.D6BMAGPR.js} +1 -1
- package/dist/preview/{chunk.27ZSRO3O.js → chunk.D6KF72MZ.js} +1 -1
- package/dist/preview/{chunk.2SWQI4HF.js → chunk.DH7M57SE.js} +1 -1
- package/dist/preview/chunk.DPPT6WAJ.js +2 -0
- package/dist/preview/{chunk.6UAUME5U.js → chunk.DTSTUC2W.js} +1 -1
- package/dist/preview/{chunk.AFK5HHLL.js → chunk.DWMAFMYZ.js} +1 -1
- package/dist/preview/chunk.DZYLH5IM.js +1 -0
- package/dist/preview/{chunk.WUFCRE7O.js → chunk.E33EJU3Q.js} +1 -1
- package/dist/preview/{chunk.TAQB64FZ.js → chunk.E4EN4X5F.js} +1 -1
- package/dist/preview/{chunk.TUBAFVV4.js → chunk.E4HSSGF7.js} +1 -1
- package/dist/preview/{chunk.OL2N5NUV.js → chunk.E5XNQTEU.js} +1 -1
- package/dist/preview/{chunk.PIQ52FCI.js → chunk.EC5IWN74.js} +2 -2
- package/dist/preview/chunk.FBR4HJ2Q.js +1 -0
- package/dist/preview/{chunk.2HANQ737.js → chunk.FCUDBMGC.js} +1 -1
- package/dist/preview/chunk.FOQENWF5.js +1 -0
- package/dist/preview/{chunk.FUS2FJS3.js → chunk.G3ORIU7C.js} +1 -1
- package/dist/preview/chunk.GNQW4JOG.js +18 -0
- package/dist/preview/chunk.GUP7LC5O.js +21 -0
- package/dist/preview/{chunk.LMXNHBGH.js → chunk.HFVMGTNL.js} +2 -2
- package/dist/preview/chunk.HVN2DVP3.js +1 -0
- package/dist/preview/{chunk.YOBRVKJT.js → chunk.I2C5LPB5.js} +1 -1
- package/dist/preview/{chunk.LQCH2NFE.js → chunk.IF4FCQPG.js} +1 -1
- package/dist/preview/{chunk.K5WPS4RR.js → chunk.ILSK2E3R.js} +1 -1
- package/dist/preview/{chunk.RPVJ5IXD.js → chunk.IRMO4FUC.js} +1 -1
- package/dist/preview/chunk.IT763BYH.js +1 -0
- package/dist/preview/{chunk.QBMIET7P.js → chunk.IUQOSPQX.js} +1 -1
- package/dist/preview/{chunk.SIABGHF2.js → chunk.J3YBEZKE.js} +1 -1
- package/dist/preview/{chunk.4BFJWNVM.js → chunk.JHFHIG4P.js} +1 -1
- package/dist/preview/chunk.JL4DGITZ.js +1 -0
- package/dist/preview/{chunk.EJXUOL2C.js → chunk.JQY2UKU6.js} +1 -1
- package/dist/preview/{chunk.IXHLP2CL.js → chunk.JZDKHWRL.js} +1 -1
- package/dist/preview/{chunk.AFEEXRN3.js → chunk.K2JE3PD7.js} +1 -1
- package/dist/preview/chunk.K4MO22RM.js +1 -0
- package/dist/preview/{chunk.5DPFAVCZ.js → chunk.K5YLQAFW.js} +1 -1
- package/dist/preview/{chunk.CM2ETM2A.js → chunk.KBL4Y4UN.js} +1 -1
- package/dist/preview/chunk.KMEKMCKG.js +3 -0
- package/dist/preview/{chunk.ZOW7AC7U.js → chunk.LKK7VQBA.js} +1 -1
- package/dist/preview/chunk.LLOZKUCA.js +1 -0
- package/dist/preview/{chunk.QJ42D5GM.js → chunk.LP3SHWJG.js} +1 -1
- package/dist/preview/chunk.LVOVPU64.js +1 -0
- package/dist/preview/chunk.MEJUAV3Y.js +1 -0
- package/dist/preview/{chunk.PCKX2FHR.js → chunk.MFDSWA2W.js} +1 -1
- package/dist/preview/{chunk.U5AX4DD5.js → chunk.MJMVGW6Z.js} +1 -1
- package/dist/preview/{chunk.7WEQHJ3N.js → chunk.MLRPCZVS.js} +1 -1
- package/dist/preview/{chunk.Y3BEKXYB.js → chunk.MORMTKVR.js} +1 -1
- package/dist/preview/{chunk.O752PM42.js → chunk.N3Q5CPVA.js} +1 -1
- package/dist/preview/{chunk.AVVNQKA7.js → chunk.N7EEPFYV.js} +1 -1
- package/dist/preview/{chunk.PM64C5PX.js → chunk.NBLMANHT.js} +1 -1
- package/dist/preview/{chunk.6ZJE5M2A.js → chunk.NFU4UM6F.js} +1 -1
- package/dist/preview/{chunk.WSMYFEGU.js → chunk.NPAWTPLQ.js} +1 -1
- package/dist/preview/{chunk.4TLWZVVG.js → chunk.NQ4VGKEC.js} +1 -1
- package/dist/preview/{chunk.TT6GKRBE.js → chunk.NUE5VG4G.js} +1 -1
- package/dist/preview/{chunk.MFCBAQS3.js → chunk.O6LDZWLR.js} +1 -1
- package/dist/preview/chunk.OBUKZQCZ.js +1 -0
- package/dist/preview/{chunk.RZQKCLTW.js → chunk.ONGZ3YQF.js} +1 -1
- package/dist/preview/chunk.OYGPNO7A.js +1 -0
- package/dist/preview/chunk.PJCVFYFU.js +1 -0
- package/dist/preview/{chunk.5MCXTY2P.js → chunk.PMPDLE56.js} +1 -1
- package/dist/preview/{chunk.HXHFWZ2U.js → chunk.PRV3KYT6.js} +2 -2
- package/dist/preview/chunk.Q7X2IVLH.js +1 -0
- package/dist/preview/chunk.QAIYYIZQ.js +1 -0
- package/dist/preview/{chunk.PSLCI3GO.js → chunk.QNNRSPIJ.js} +1 -1
- package/dist/preview/{chunk.5L4J2XAI.js → chunk.QSO5BP2H.js} +1 -1
- package/dist/preview/{chunk.LYVRXRIH.js → chunk.QW3QLE53.js} +1 -1
- package/dist/preview/{chunk.USJ4J3GL.js → chunk.QYFZ7AZS.js} +2 -2
- package/dist/preview/{chunk.BRCKXL7B.js → chunk.RDL6652E.js} +1 -1
- package/dist/preview/{chunk.INBHY3SA.js → chunk.RR2IFETZ.js} +1 -1
- package/dist/preview/{chunk.NXM73RZA.js → chunk.RXYE2DAJ.js} +1 -1
- package/dist/preview/chunk.SOTB6C5A.js +1 -0
- package/dist/preview/{chunk.KHJ2MCMS.js → chunk.SRC37GNP.js} +1 -1
- package/dist/preview/{chunk.PHLMQO7V.js → chunk.SVAQGVS4.js} +1 -1
- package/dist/preview/chunk.T2RME6XF.js +1 -0
- package/dist/preview/{chunk.ZAHVKXYQ.js → chunk.T6HG2XIP.js} +1 -1
- package/dist/preview/{chunk.354A4QCG.js → chunk.TAIYNHSW.js} +1 -1
- package/dist/preview/chunk.TAJ2R44N.js +1 -0
- package/dist/preview/{chunk.5MSNKSTE.js → chunk.TQCRFZ53.js} +1 -1
- package/dist/preview/{chunk.RNYLNBIB.js → chunk.TXWCTHMI.js} +1 -1
- package/dist/preview/chunk.UE5YS3GN.js +1 -0
- package/dist/preview/{chunk.MFOSEOF4.js → chunk.UQQAGT3R.js} +1 -1
- package/dist/preview/chunk.USB6B6L3.js +104 -0
- package/dist/preview/{chunk.EKP3HQAX.js → chunk.USQNSNIA.js} +1 -1
- package/dist/preview/{chunk.CPNE6HPQ.js → chunk.V3NPUAPB.js} +1 -1
- package/dist/preview/{chunk.ZXOD5GM3.js → chunk.VDD3RHLB.js} +1 -1
- package/dist/preview/{chunk.O7RMVGAB.js → chunk.VEOS25PQ.js} +1 -1
- package/dist/preview/chunk.VIQ6EF2O.js +1 -0
- package/dist/preview/{chunk.UE5GAP67.js → chunk.VLBY66PB.js} +2 -2
- package/dist/preview/{chunk.OS5EALHY.js → chunk.VSM72NVF.js} +1 -1
- package/dist/preview/{chunk.WVKXELAF.js → chunk.VYW7DSUW.js} +2 -2
- package/dist/preview/{chunk.2KH2LWZL.js → chunk.WMB2NNBD.js} +1 -1
- package/dist/preview/{chunk.5SANELJT.js → chunk.WPJVMVAL.js} +1 -1
- package/dist/preview/{chunk.TDV7JGIQ.js → chunk.XGCOWCA2.js} +1 -1
- package/dist/preview/chunk.XJFAUOJS.js +1 -0
- package/dist/preview/{chunk.EGSE6NNE.js → chunk.XY5EVI22.js} +1 -1
- package/dist/preview/chunk.YEJ4LNUP.js +5 -0
- package/dist/preview/{chunk.6JYNNPAI.js → chunk.YL5ZCRHQ.js} +1 -1
- package/dist/preview/{chunk.DH4AC7TC.js → chunk.YLMOGGEP.js} +1 -1
- package/dist/preview/{chunk.V5PAFSWP.js → chunk.ZFXHZZHW.js} +1 -1
- package/dist/preview/index.html +50 -50
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2ORJGMRT.js +0 -104
- package/dist/preview/chunk.3IZOXNJH.js +0 -1
- package/dist/preview/chunk.5D6SIBOK.js +0 -1
- package/dist/preview/chunk.5EZDXWOE.js +0 -1
- package/dist/preview/chunk.5XUVCM7X.js +0 -1
- package/dist/preview/chunk.6NGSR2ZQ.js +0 -1
- package/dist/preview/chunk.7KERB5CH.js +0 -1
- package/dist/preview/chunk.AVNOLMCV.js +0 -1
- package/dist/preview/chunk.AZ6Q3WT2.js +0 -1
- package/dist/preview/chunk.DKJK2MMV.js +0 -2
- package/dist/preview/chunk.DU75P3Y7.js +0 -1
- package/dist/preview/chunk.DXJFAAOI.js +0 -1
- package/dist/preview/chunk.FVOFTM5J.js +0 -1
- package/dist/preview/chunk.G2XDQPE4.js +0 -1
- package/dist/preview/chunk.H536YUAZ.js +0 -3
- package/dist/preview/chunk.HNJFBI7J.js +0 -1
- package/dist/preview/chunk.HUABTCQE.js +0 -1
- package/dist/preview/chunk.KIMIPHAI.js +0 -1
- package/dist/preview/chunk.KXNWZ33P.js +0 -1
- package/dist/preview/chunk.LEPKPNPA.js +0 -1
- package/dist/preview/chunk.LLXEWLIP.js +0 -1
- package/dist/preview/chunk.LWLI5PI4.js +0 -1
- package/dist/preview/chunk.MIQMPOWF.js +0 -2
- package/dist/preview/chunk.MNSKBGRM.js +0 -1
- package/dist/preview/chunk.MSM6E6JK.js +0 -1
- package/dist/preview/chunk.NS6KWKF5.js +0 -1
- package/dist/preview/chunk.OIMYSR2J.js +0 -1
- package/dist/preview/chunk.QQ3YWKWU.js +0 -1
- package/dist/preview/chunk.R3ZS4QO6.js +0 -18
- package/dist/preview/chunk.SG67ID6C.js +0 -1
- package/dist/preview/chunk.SYX7AEHU.js +0 -1
- package/dist/preview/chunk.TEE23CVQ.js +0 -1
- package/dist/preview/chunk.TZTRGNAA.js +0 -1
- package/dist/preview/chunk.UADL2LHO.js +0 -1
- package/dist/preview/chunk.URDCHVH3.js +0 -21
- package/dist/preview/chunk.WR63RQGU.js +0 -5
- package/dist/preview/chunk.XEHLSKHP.js +0 -1
- package/dist/preview/chunk.YG2WZO53.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as le,b as I,d as ue,g as ye,h as me,i as pe}from"./chunk.T66UK7PQ.js";import{$ as q,C as T,Cb as fe,Da as re,F as Z,Fa as ie,G as O,H as B,I as V,Ib as v,Kb as ce,Lb as C,Na as W,O as x,R as X,Ra as se,S as Y,Ta as de,Va as ae,W as j,Y as H,da as M,fa as L,ka as _,ma as J,sa as Q,ta as ee,ua as ne,va as te,ya as oe}from"./chunk.WR63RQGU.js";var $e=t=>`${t}${t%100>=11&&t%100<=13?"th":["th","st","nd","rd"][t%10]??"th"}`,Re={day:"day",week:"week",month:"month",year:"year"},F=t=>t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`;function xe(t,e,n){let o=e.interval??1,i=Re[e.every],s=t.slice(0,10),l=o===1?`Every ${i}`:o===2?`Every other ${i}`:`Every ${o} ${i}s`,d;if(e.every==="week"){let y=(e.on?.length?e.on:[W[new Date(`${s}T00:00:00Z`).getUTCDay()]]).map(r=>H(W.indexOf(r),"long",n));d=o===1?`Every ${F(y)}`:o===2?`Every other ${F(y)}`:`${l} on ${F(y)}`}else if(e.every==="month"){let y=(e.on?.length?e.on:[+s.slice(8,10)]).map(r=>r===-1?"the last day":`the ${$e(Number(r))}`);d=`${l} on ${F(y)}`}else e.every==="year"?d=`${l} on ${j(s,n)}`:d=l;return O.test(t)&&(d+=` at ${Y(t,n)}`),e.until&&(d+=`, until ${x(e.until,n)}`),e.count&&(d+=`, ${e.count===1?"once":`${e.count} times`}`),d}function ge(t,e,n={}){if(!de(e)||typeof t!="string")return;let o=n.today??V(),i=ae(t,e,o),s=xe(t,e,n.locale),l=i.slice(0,4)===o.slice(0,4)?j(i.slice(0,10),n.locale):x(i.slice(0,10),n.locale);return i.slice(0,10)<o?`${s}, last ${l}`:`${s}, next ${l}`}function on(t,e){let n=new Map,o=new Map;for(let i of t){let s=M(e(i.kind),i).trim().toLowerCase();o.set(s,[...o.get(s)??[],i])}for(let i of o.values()){if(i.length<2)continue;let s=new Map;for(let l of i)s.set(l.kind,[...s.get(l.kind)??[],l]);for(let[l,d]of s){if(d.length===1){n.set(d[0].id,J(e(l),l));continue}let y=d.map(f=>new Map(Se(f,e(f.kind)).map(m=>[m.key,m.alone]))),r=[...new Set(y.flatMap(f=>[...f.keys()]))],u=f=>y.every(m=>!/\d/.test(m.get(f)??"")),h=[...r.filter(u),...r.filter(f=>!u(f))],b=(f,m)=>m.map(p=>y[f].get(p)??"").filter(Boolean).join(" \xB7 "),S=f=>new Set(d.map((m,p)=>b(p,f))).size===d.length&&d.every((m,p)=>b(p,f)!==""),c=h.find(f=>S([f])),a=c?void 0:h.flatMap((f,m)=>h.slice(m+1).map(p=>[f,p])).find(f=>S(f));d.forEach((f,m)=>{if(c||a)return void n.set(f.id,b(m,c?[c]:a));let p=h.find($=>{let w=y[m].get($);return w!==void 0&&w!==""&&y.every((R,k)=>k===m||R.get($)!==w)});n.set(f.id,p?y[m].get(p):`${m+1} of ${d.length}`)})}}return n}function rn(t,e){return t?.describe?t.describe(e):`${e.kind} ${M(t,e)}`}var _e=new Set(["id","kind","label"]);function ve(t,e){if(e.length===0)return!1;let n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(^|[\\s\xB7,(/])${n}($|[\\s\xB7,)/])`).test(t)}function Se(t,e,n={}){let o=e?.display,i=new Set([..._e,...o?.hide??[]]);typeof t.label=="string"&&e?.label&&!M(e,t).includes(t.label)&&i.delete("label");let s=(n.said??[]).filter(c=>!!c),l=s.filter(c=>c.endsWith("\u2026")).map(c=>c.replace(/…$/,"").trim()).filter(c=>c.length>12),d=[],y=e?.fields?.shape,r=e?.fieldRoles,u=n.glance?o?.glance??[r?.who,r?.when].filter(c=>!!c):he(o?.page),h=n.glance&&o?.glance!==void 0,S=[...new Set(h?u:[...u,...Ne(e),...Object.keys(t)])].filter(c=>Object.hasOwn(t,c)).map(c=>[c,t[c]]);for(let[c,a]of S){if(i.has(c)||a===void 0||a===null)continue;let f=o?.format?.[c],m=f?[]:ne(a);if(m[0]&&n.glance)continue;let p=e?.fields?.shape?.[c],$=!f&&typeof a=="string"&&oe(p)?a:void 0,w=!f&&typeof a=="string"&&le(p);if($&&n.glance)continue;let R=f?void 0:ie(p),k=R?{relation:R,refs:re(a,R)}:void 0;if(k&&(n.glance||k.refs.length===0)||!m[0]&&typeof a=="object"&&(!Array.isArray(a)||a.some(g=>typeof g=="object"&&g!==null))&&f===void 0)continue;let U=typeof a=="string"&&!f?ge(a,t[`${c}Repeat`],{locale:n.locale}):void 0,N=m[0]?m.map(g=>`${g.caption?`${g.name} \u2014 ${g.caption}`:g.name}${Q(g)?` (${ee(g)})`:""}`).join(", "):Array.isArray(a)?a.join(", "):typeof a=="boolean"?a?"Yes":"No":String(a),E=f?void 0:ye(e,c),G=pe(E,a),K=!f&&!E&&typeof a=="number"?v(e?.fields?.shape?.[c]):void 0,z=k?k.refs.length>1?`${k.refs.length} linked records`:"linked record":f?f(a):K?ce(a,K):me(E,a,n.locale)??(Array.isArray(a)||typeof a=="boolean"?N:typeof a=="string"&&U!==void 0?U:typeof a=="string"&&Z.test(a)?x(a,n.locale):typeof a=="string"&&O.test(a)?X(a,n.locale,n.timeZone):typeof a=="string"&&Fe(e,c)?I(e,c,a):N),P=typeof a=="string"&&Te(e,c,z),A=(n.glance||n.excerpt)&&!f&&(P||w)?ue(z,{markdown:w}):z;if(s.includes(A)||l.some(g=>A.startsWith(g))||n.glance&&(typeof a=="string"||typeof a=="number")&&s.some(g=>ve(g,A)))continue;let D=_(e,c),Ae=typeof a=="number"?`${D} ${A}`:typeof a=="boolean"&&!f?`${D}: ${A.toLowerCase()}`:A;if(d.push({key:c,label:D,value:A,stored:N,alone:Ae,long:P,...w?{markdown:!0}:{},...m[0]?{files:m}:{},...$?{app:$}:{},...k?{linked:k}:{},...G?{href:G}:{},...se(y?.[`${c}Repeat`])?{repeats:!0}:{}}),n.limit!==void 0&&d.length>=n.limit)break}return Oe(d,e)}function Oe(t,e){let n=new Map;for(let o of t){let i=Me(e,o.key);i&&n.set(o.key,new Set(i.map(s=>I(e,o.key,s).toLowerCase())))}return n.size<2?t:t.map(o=>{let i=n.get(o.key);return i!==void 0&&[...n].some(([l,d])=>l!==o.key&&[...i].some(y=>d.has(y)))?{...o,alone:`${o.label}: ${o.value.toLowerCase()}`}:o})}function Me(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"&&n._zod.def.entries?Object.values(n._zod.def.entries).map(String):void 0}function Fe(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"}function Ne(t){let e=t?.fields?.shape;return[...Object.keys(e??{}),...Object.keys(t?.computed??{})]}function he(t){return[...t?.fields??[],...(t?.groups??[]).flatMap(e=>e.fields)]}var Ee=500,ze=160;function De(t){let e=t;for(let n=0;n<6&&e?._zod?.def?.innerType!==void 0;n++)e=e._zod.def.innerType;return e?._zod?.def?.type==="string"?e._zod.def:void 0}function Te(t,e,n){return De(t?.fields?.shape?.[e])?.checks?.some(i=>i._zod?.def?.check==="max_length"&&(i._zod.def.maximum??0)>Ee)?!0:typeof n=="string"&&(n.includes(`
|
|
2
|
-
`)||n.length>ze)}function sn(t,e){let n=t?.display?.page,o=n?.groups??[],i=new Map(e.map(r=>[r.key,r])),s=new Set(he(n)),l=r=>r.flatMap(u=>i.has(u)?[i.get(u)]:[]),d=e.filter(r=>!s.has(r.key));return[{fields:[...l(n?.fields??[]),...o.length>0?[]:d]},...o.map(r=>({title:r.title,fields:l(r.fields)})),...o.length>0?[{title:"Details",fields:d}]:[]].filter(r=>r.fields.length>0)}function je(t,e,n){let o=[...e?.creates??[],...e?.subject&&e.subject.kinds!=="*"?e.subject.kinds:[]];for(let i of o){let s=t.tryDefinition(i),l=s?.fields?.shape??{};if(!s||!(n in l))continue;let d=s.display?.format?.[n];return{label:s.display?.labels?.[n]??_(s,n),option:r=>d?d(r):L(r)}}return{label:_(void 0,n),option:i=>L(i)}}function cn(t,e,n){if(n instanceof fe){let o=e.find(s=>s.name===n.mutation);return`Not yet: ${n.issues.map(s=>{let l=s.path.length>0?je(t,o,String(s.path[0])).label:void 0;return l?`${l} \u2014 ${q(s.message)}`:s.message}).join("; ")}.`}return n instanceof Error?n.message:String(n)}var Le=t=>/^[A-Z]{3}$/.test(t??"");function ke(t){let{format:e,unit:n,currency:o,locale:i}=t,s=Le(n),l=e==="money"||!e&&s,d=l?s?n:o:void 0;return{...l?{format:"money"}:e?{format:e}:{},...n&&!(l&&s)?{unit:n}:{},...d?{currency:d}:{},...i?{locale:i}:{}}}function yn(t){switch(t.format){case"money":return t.currency?`An amount of money in ${t.currency}: a plain number, 1250.5 for 1,250.50 ${t.currency}.`:"An amount of money, in no named currency: a plain number.";case"percent":return"A fraction said as a percent: 0.15 is 15%.";default:return t.unit?`A number of ${t.unit}.`:"A number."}}function be(t){let e=T(t)?.innerType;return e===void 0?t:be(e)}var We={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ce=t=>(t?._zod?.def?.checks??[]).map(e=>e._zod?.def).filter(e=>e!==void 0);function we(t){let e=be(t),n=T(e),o=n?.type,i=Ce(e);if(o==="enum")return{type:"choice",options:Object.keys(n?.entries??{})};let s=te(e);if(s)return s==="image"?{type:"file",image:!0}:s==="video"?{type:"file",video:!0}:{type:"file"};if(o==="boolean")return{type:"boolean"};if(o==="array"){let l=we(n?.element);return l.type==="unknown"?{type:"unknown"}:{type:"several",of:l}}if(o==="number"){let l,d,y;for(let r of i){r.check==="multiple_of"&&typeof r.value=="number"?y=r.value:r.check==="number_format"&&(r.format==="safeint"||r.format==="int32"||r.format==="uint32")&&(y??=1);let u=r.check==="number_format"&&r.format?We[r.format]:void 0,h=u?u[0]:r.check==="greater_than"&&r.inclusive&&typeof r.value=="number"?r.value:void 0,b=u?u[1]:r.check==="less_than"&&r.inclusive&&typeof r.value=="number"?r.value:void 0;h!==void 0&&(l=l===void 0?h:Math.max(l,h)),b!==void 0&&(d=d===void 0?b:Math.min(d,b))}return{type:"number",...l===void 0?{}:{min:l},...d===void 0?{}:{max:d},...y===void 0?{}:{step:y},...C(e)==="duration"?{duration:!0}:{},...v(t)?{amount:ke(v(t))}:{}}}if(o==="string"){if(i.some(u=>u.fn===B||u.format==="datetime")||n?.format==="datetime")return{type:"date",time:!0,instant:!0};let d=[n?.pattern,...i.map(u=>u.pattern)].filter(u=>u instanceof RegExp).map(u=>u.source);if(d.some(u=>u.includes("\\d{4}")))return d.some(u=>u.includes("\\d{2}:\\d{2}"))?{type:"date",time:!0}:{type:"date"};let y=i.some(u=>u.check==="max_length"&&typeof u.maximum=="number"&&u.maximum>500),r=C(e);return y?{type:"text",long:!0}:r==="phone"||r==="place"?{type:"text",holds:r}:{type:"text"}}return{type:"unknown"}}function An(t,e){let n=t?.shape;return!n||!(e in n)?{type:"unknown"}:we(n[e])}export{xe as a,on as b,rn as c,Se as d,sn as e,ke as f,yn as g,be as h,we as i,An as j,je as k,cn as l};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{e as k,g as M,h as I,i as B,l as P}from"./chunk.5EZDXWOE.js";import"./chunk.MIQMPOWF.js";import"./chunk.T66UK7PQ.js";import"./chunk.LMXNHBGH.js";import"./chunk.DBCVZGCC.js";import{G as te,Ga as q,T as W}from"./chunk.WSMYFEGU.js";import{a as L}from"./chunk.SDO3U72B.js";import"./chunk.WR63RQGU.js";import"./chunk.FQLNBIQ5.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.LMXNHBGH.js","./chunk.DBCVZGCC.js","./chunk.WSMYFEGU.js","./chunk.SDO3U72B.js","./chunk.WR63RQGU.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.AFK5HHLL.js")))),v={Part:U.part((n,t)=>(0,A.jsx)(n.WhenMonth,{...t}),{quiet:!0}),prefetch:()=>U.prefetch()};var o=h(W(),1),z="try \u201Ctomorrow 3pm\u201D, \u201CFri 10:30\u201D or \u201C17 Oct\u201D";function K(n,t,d,p=!1){let S=Date.UTC(+n.day.slice(0,4),+n.day.slice(5,7)-1,+n.day.slice(8,10),0,t?n.minutes??0:0),g={weekday:p?"long":"short",year:"numeric",month:p?"long":"short",day:"numeric",...t?{hour:"numeric",minute:"2-digit"}:{},timeZone:"UTC"},m;try{m=new Intl.DateTimeFormat(d??"en-US",g)}catch{m=new Intl.DateTimeFormat("en-US",g)}return m.format(S).replace(/ /g," ")}function le({value:n,time:t,instant:d=!1,label:p,name:S,required:g,autoFocus:m,autoSelect:H,locale:s,onChange:j,onLeave:_,onCancel:V,inputRef:w,boxStyle:Z}){let x=(0,r.useId)(),u=(0,r.useRef)(null),D=(0,r.useRef)(null),b=e=>{let a=M(e);return a?K(a,t,s):e??""},[T,C]=(0,r.useState)(()=>b(n)),[F,y]=(0,r.useState)(!1),[G,E]=(0,r.useState)(n),[J,Q]=(0,r.useState)(n);n!==J&&(Q(n),n!==G&&(E(n),C(b(n)))),(0,r.useEffect)(()=>{H&&(u.current?.focus(),u.current?.select())},[H]);let i=t&&d?B(s):void 0,N=T===b(n),l=M(n),c=N?l:P(T,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}}),X=N?n:c?I(c,{time:t,instant:d}):void 0,$=T.trim()==="",f=!$&&c===void 0;(0,r.useEffect)(()=>{u.current?.setCustomValidity(f?`Not a date this reads \u2014 ${z}`:"")},[f]);let O=e=>{E(e),j(e)},Y=e=>{C(e);let a=e.trim()===""?void 0:P(e,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}});O(a?I(a,{time:t,instant:d}):void 0)},ee=e=>{let a=t?{day:e,minutes:c?.minutes??l?.minutes??540}:{day:e},R=I(a,{time:t,instant:d});C(b(R)),O(R),y(!1),requestAnimationFrame(()=>{u.current?.focus(),u.current?.select()})},ne=$?`Type a date, or pick one \u2014 ${z}`:f?`Not a date this reads \u2014 ${z}`:c?`${K(c,t,s,!0)}${i?` ${i.short}`:""}`:"";return(0,o.jsxs)("span",{"data-graview-when":t?d?"instant":"moment":"day",style:{display:"inline-flex",flex:"1 1 14rem",flexWrap:"wrap",alignItems:"center",gap:"4px 6px",maxWidth:"100%",minWidth:0},onBlur:e=>{let a=e.relatedTarget;a&&e.currentTarget.contains(a)||!a&&typeof document<"u"&&!document.hasFocus()||(y(!1),_?.(X))},children:[(0,o.jsx)("input",{ref:e=>{u.current=e,typeof w=="function"?w(e):w&&(w.current=e)},type:"text",name:S,required:g,autoFocus:m,"aria-label":p,"aria-describedby":`${x}-said`,"aria-invalid":f||void 0,autoComplete:"off",spellCheck:!1,enterKeyHint:"done",placeholder:t?"tomorrow 3pm":"17 Oct",value:T,"data-graview-part":"control",onChange:e=>Y(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),V?.()):e.key==="ArrowDown"&&e.altKey&&(e.preventDefault(),y(!0))},style:{flex:"1 1 12ch",minWidth:"10ch",maxWidth:"100%",boxSizing:"border-box",font:"inherit",...Z}}),(0,o.jsx)("button",{ref:D,type:"button","aria-label":`Pick a date for ${p}`,"aria-expanded":F,"aria-controls":`${x}-month`,"data-graview-part":"when-pick",onClick:()=>y(e=>!e),onPointerEnter:()=>v.prefetch(),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:32,minHeight:32,padding:0,borderRadius:6},children:(0,o.jsxs)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[(0,o.jsx)("rect",{x:"2",y:"3",width:"12",height:"11",rx:"1.5"}),(0,o.jsx)("path",{d:"M2 6.5h12M5.5 1.5v3M10.5 1.5v3"})]})}),(0,o.jsxs)("span",{id:`${x}-said`,"aria-live":"polite","data-graview-part":"when-said",...i?{"data-graview-zone":i.zone,title:`Times are in ${i.zone.replace(/_/g," ")} (${i.short})`}:{},style:{flexBasis:"100%",fontSize:"0.75rem",color:f?"var(--graview-bad)":"var(--graview-ink-faint)"},children:[ne,i&&!f&&!$?(0,o.jsx)("span",{"data-graview-part":"when-zone",children:` \xB7 ${(i.zone.split("/").at(-1)??i.zone).replace(/_/g," ")} time`}):null]}),F?(0,o.jsx)(r.Suspense,{fallback:null,children:(0,o.jsx)(v.Part,{id:`${x}-month`,label:p,selected:c?.day??l?.day,today:k().day,locale:s,onPick:ee,onClose:()=>{y(!1),D.current?.focus()}})}):null]})}export{le as WhenInput,K as wallAsRead};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as Ce,d as $e,i as ae}from"./chunk.MIQMPOWF.js";import{e as Te}from"./chunk.T66UK7PQ.js";import{I as ke,Sd as je,Tc as oe,Wa as Se,Xc as ve,Yc as Oe,Za as G,_ as M,aa as xe,ca as _,da as z,ea as Ae,fa as W,ha as we,ia as Ne,nc as ie,sd as Re,vd as De,xd as We,yd as Me}from"./chunk.WR63RQGU.js";function se(n,e){return n.display?.labels?.[e]??W(e)}function de(n){let e=ae(n);switch(e.type){case"text":case"date":case"number":case"boolean":case"choice":return e.type;default:return}}function Je(n,e){let t=new Map,i=n.tryDefinition(e);for(let[r,a]of Object.entries(i?.edges??{}))t.set(r,{key:r,label:a.description?M(a.description):W(r),about:"edge",far:a.to==="*"?[...n.kinds]:[...a.to]});for(let r of n.definitions)if(r.kind!==e)for(let[a,s]of Object.entries(r.edges??{}))t.has(a)||s.to!=="*"&&!s.to.includes(e)||t.set(a,{key:a,label:s.inverse?M(s.inverse):W(a),about:"edge",far:[r.kind]});return[...t.values()]}var Ze=["current","past","any","flagged","clear"];function Fe(n,e){let t=n?.lifecycle;if(!t||t.retired==="date")return!1;let i=t.retired.map(String);return e.some(r=>r.key===t.field&&i.includes(r.value))}function Be(n,e){let t=n.tryDefinition(e);if(!t)return{kind:e,sorts:[],filters:[],groups:[]};let i=new Set(t.display?.hide??[]),r=t.fields.shape??{},a=[{key:"label",label:"Name",about:"label",type:"text"}],s=[],f=[];for(let[y,x]of Object.entries(r)){if(y==="id"||y==="kind"||y==="label"||i.has(y))continue;let p=de(x);if(!p)continue;let O=se(t,y),w=p==="choice"?Le(x):p==="boolean"?["true","false"]:void 0,N={key:y,label:O,about:"field",type:p,...w?{options:w}:{}};a.push(N),s.push(N),(p==="boolean"||p==="choice")&&f.push(N),p==="date"&&f.push({...N,buckets:["day","week","month","year","decade"]})}for(let y of Je(n,e))a.push(y),s.push(y),f.push(y);let l={key:"is",label:t.lifecycle?"Standing and currency":"Standing",about:"is",type:"choice",options:t.lifecycle?[...Ze]:["flagged","clear"]};s.push(l);let u=t.fieldRoles?.order,g=u&&(u in r||u==="label")?{by:u,direction:"asc"}:void 0;return{kind:e,sorts:a,filters:s,groups:f,...g?{natural:g}:{}}}function vn(n,e){let t=[];for(let r of e.filters){let a=r.about==="edge"&&r.far?.length===1?n.tryDefinition(r.far[0]):void 0;if(!(!a||a.kind===e.kind))for(let[s,f]of Object.entries(a.fields.shape??{}))de(f)!=="choice"||a.display?.hide?.includes(s)||t.push({key:`${r.key}.${s}`,label:`${r.label} \xB7 ${se(a,s)}`,about:"via",type:"choice",options:Le(f),far:[a.kind]})}if(t.length===0)return e;let i=e.filters.filter(r=>r.about!=="is");return{...e,filters:[...i,...t,...e.filters.filter(r=>r.about==="is")]}}function On(n,e){let t=n.tryDefinition(e.kind),i=Object.entries(t?.computed??{});if(!t||i.length===0)return e;let r=i.filter(([a])=>!e.sorts.some(s=>s.key===a)).map(([a,s])=>({key:a,label:(typeof s=="object"?s.label:void 0)??se(t,a),about:"field",type:"number"}));return{...e,sorts:[...e.sorts,...r]}}function Le(n){let e=ae(n);return e.type==="choice"?e.options:[]}var Ie=n=>n,Pe=n=>n;function en(n,e,t){let i=new Map;for(let r of[...n.out(e,t),...n.in(e,t)])i.set(r.id,r);return[...i.values()]}function le(n,e,t){let i=n.schema.tryDefinition(e.kind);if(t.key==="is")switch(t.value){case"current":return _(i,Pe(e),n.today);case"past":return!_(i,Pe(e),n.today);case"any":return!0;case"flagged":return n.flagged?.has(e.id)??!1;case"clear":return!(n.flagged?.has(e.id)??!1);default:return!0}let r=i?.fields.shape??{};if(t.key in r){let l=Se(Ie(e),t.key,n.today??ke()),u=de(r[t.key]);if(u==="date"){let[g,y]=t.value.split(":");if(typeof l!="string"||!y)return!1;let x=l.slice(0,10);return g==="before"?x<y:g==="after"?x>y:x===y}if(u==="boolean")return String(l)===t.value;if(u==="number"){let g=t.value.lastIndexOf(":"),y=g>0?t.value.slice(0,g):"",x=Number(t.value.slice(g+1));if(y==="at-most"||y==="at-least")return typeof l!="number"||!Number.isFinite(x)?!1:y==="at-most"?l<=x:l>=x}return String(l)===t.value}let[a,s]=t.key.split("."),f=en(n.graph,e.id,a);return s?f.some(l=>String(Ie(l)[s])===t.value):t.value==="*"?f.length>0:t.value==="none"?f.length===0:f.some(l=>l.id===t.value)}var nn=5;function ze(n){return n.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function ce(n){return ze(n).replace(/ /g,"")}var U=new Map,tn=5e4;function $(n){let e=U.get(n);if(e===void 0){U.size>=tn&&U.clear();let t=ze(n);e={tokens:t.split(" ").filter(Boolean),whole:t.replace(/ /g,"")},U.set(n,e)}return e}var T=n=>[...$(n).tokens];function j(n,e){if(e.length===0)return;let{whole:t,tokens:i}=$(n),r=e.join("");if(t.length===0)return;if(t===r)return"exact";if(e.every(s=>i.some(f=>f.startsWith(s))))return t.startsWith(r)?"prefix":e.every(s=>i.includes(s))?"word":"part"}function q(n,e,t=48){let i=n.replace(/\s+/g," ").trim();if(i.length<=t)return i;let r=e[0],a=i.normalize("NFD").replace(/\p{M}/gu,"").toLowerCase(),s=r?a.search(new RegExp(`(^|[^\\p{L}\\p{N}])${rn(r)}`,"u")):-1,f=s<0?0:s+(a[s]&&/[\p{L}\p{N}]/u.test(a[s])?0:1),l=Math.max(0,f-Math.floor(t/3));if(l>0){let g=i.lastIndexOf(" ",l);l=g<0?0:g+1}let u=Math.min(i.length,l+t);if(u<i.length){let g=i.indexOf(" ",u);u=g<0||g-u>16?u:g}return`${l>0?"\u2026":""}${i.slice(l,u).trim()}${u<i.length?"\u2026":""}`}var rn=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),on=/^([\p{L}][\p{L}\p{N}_-]*):(\S+)$/u;function an(n){let e=[],t=[];for(let i of n.trim().split(/\s+/).filter(Boolean)){let r=on.exec(i);r?t.push({key:r[1],value:r[2]}):e.push(i)}return{words:e.join(" "),conditions:t}}var Ee=new WeakMap;function Q(n,e){let t=Ee.get(e);if(t&&t.definition===n)return t.texts;let i=sn(n,e);return Ee.set(e,{definition:n,texts:i}),i}function sn(n,e){let t=z(n,e),i=[{field:"label",reading:"Name",text:t}];for(let r of $e(e,n,{limit:Number.POSITIVE_INFINITY}))r.key==="label"||r.value===t||typeof e[r.key]!="boolean"&&i.push({field:r.key,reading:r.label,text:r.markdown?Te(r.value):r.value});return i}var I={exact:0,prefix:1,word:2,part:3,field:4,near:5},Ge=new Set(["a","an","the","of","and","or","for","to","in","on","at","by","with","my","our","is"]);function Ke(n){let e=n;e.length>4&&e.endsWith("ies")?e=`${e.slice(0,-3)}y`:e.length>4&&/(ss|x|ch|sh|z)es$/.test(e)?e=e.slice(0,-2):e.length>3&&e.endsWith("s")&&!/(ss|us|is)$/.test(e)&&(e=e.slice(0,-1));for(let t of["ing","ed"])if(e.length>t.length+2&&e.endsWith(t)){e=e.slice(0,-t.length),/([b-df-hj-km-np-rtv-z])\1$/.test(e)&&(e=e.slice(0,-1));break}return e.length>3&&e.endsWith("e")?e.slice(0,-1):e}function He(n,e,t){if(Math.abs(n.length-e.length)>t)return t+1;let i=[],r=Array.from({length:e.length+1},(a,s)=>s);for(let a=1;a<=n.length;a++){let s=[a],f=a;for(let l=1;l<=e.length;l++){let u=Math.min(r[l]+1,s[l-1]+1,r[l-1]+(n[a-1]===e[l-1]?0:1));a>1&&l>1&&n[a-1]===e[l-2]&&n[a-2]===e[l-1]&&(u=Math.min(u,i[l-2]+1)),s[l]=u,u<f&&(f=u)}if(f>t)return t+1;i=r,r=s}return r[e.length]}var V=new Map;function dn(n,e){let t=V.get(n);t||(V.size>=64&&V.clear(),V.set(n,t=new Map));let i=t.get(e);return i===void 0&&(i=ln(n,e)??null,t.set(e,i)),i??void 0}function ln(n,e){if(/\d/.test(n))return;let t=Ke(n);if(t.length>=3&&(Ke(e)===t||t.length>=4&&e.startsWith(t)))return"stem";let i=n.length<4?0:n.length<=7?1:2;if(i!==0){if(He(n,e,i)<=i)return"spelling";if(n.length>=5){for(let r=n.length-i;r<=n.length+i;r++)if(r<e.length&&He(n,e.slice(0,r),i)<=i)return"spelling"}}}function cn(n,e){let t=e.length>1?e.filter(r=>!Ge.has(r)):e;if(t.length===0)return;let i;for(let r of t){let a;for(let s of n){for(let f of $(s.text).tokens){if(f.startsWith(r)){a={text:s,matched:f};break}let l=a?void 0:dn(r,f);l&&(a={text:s,matched:f,by:l})}if(a&&!a.by)break}if(!a)return;a.by&&!i&&(i={text:a.text,asked:r,matched:a.matched,by:a.by})}if(i)return{field:i.text.field,reading:i.text.reading,fragment:q(i.text.text,[i.matched]),strength:"near",asked:i.asked,matched:i.matched,by:i.by}}var fn=80;function gn(n,e,t){let i=T(e).filter(s=>!Ge.has(s)).join(" ")||e,r=t===void 0?[]:T(t),a=r.length>0&&n.find(s=>r.every(f=>$(s.text).tokens.some(l=>l.startsWith(f))))||n[0];return{field:a.field,reading:a.reading,fragment:q(a.text,r),strength:"near",asked:i,matched:(t??a.text).slice(0,fn),by:"meaning"}}function _e(n,e,t,i){let r=T(t);if(r.length===0)return;if(i){let p=Q(n,e),O=i.includes("label")||i.some(v=>typeof e[v]=="string"&&e[v]===p[0].text),w=p.filter((v,D)=>D===0?O:i.includes(v.field)),N=v=>D=>$(D.text).tokens.some(P=>P.startsWith(v));if(!r.every(v=>w.some(N(v))))return;let S=w.find(N(r[0]));return{field:S.field,reading:S.reading,fragment:q(S.text,r),strength:S.field==="label"?j(S.text,r)??"field":"field"}}let a=Q(n,e),[s,...f]=a,l=j(s.text,r);if(l)return{field:"label",reading:s.reading,fragment:q(s.text,r),strength:l};let u=p=>O=>$(O.text).tokens.some(w=>w.startsWith(p));if(!r.every(p=>a.some(u(p))))return;let g=T(s.text),y=r.find(p=>!g.some(O=>O.startsWith(p)))??r[0],x=f.find(u(y));return{field:x.field,reading:x.reading,fragment:q(x.text,[y]),strength:"field"}}var un=512,yn=64;function hn(n){let e=new Map;if(n.length===0)return e;let t=n.slice(-un),i=n[n.length-1].seq;for(let r of t){let a=Math.pow(.5,(i-r.seq)/yn);for(let s of r.writes)e.set(s,(e.get(s)??0)+a)}return e}var ge=(n,e)=>we({tryDefinition:()=>n},e),fe=(n,e)=>De({tryDefinition:()=>n},e);function pn(n,e,t){let i=n.tryDefinition(e),r=[{field:"plural",text:ge(i,e)},{field:"kind",text:W(e)},...i?.noun?[{field:"noun",text:i.noun}]:[],...(i?.aliases??[]).map(s=>({field:"alias",text:s}))],a;for(let s of r){let f=j(s.text,t);f&&(!a||I[f]<I[a.strength])&&(a={strength:f,...s})}return a}var mn,bn=(n,e)=>(mn??=new Intl.Collator(void 0,{sensitivity:"base",numeric:!0})).compare(n,e),qe=(n,e)=>(n.nearly??0)-(e.nearly??0)||(n.archived??0)-(e.archived??0)||n.tier-e.tier||n.inKind-e.inKind||n.near-e.near||n.past-e.past||n.touched-e.touched||n.flagged-e.flagged||bn(n.name,e.name)||(n.id<e.id?-1:n.id>e.id?1:0);function Ln(n,e,t={}){let i=n.schema,r=an(e),a=T(r.words),s=t.principal??{kind:"human"},f=n.kindsKeptFrom(s),l=n.modules.disabledKinds,u=r.conditions.filter(o=>o.key==="kind").map(o=>o.value),g=r.conditions.filter(o=>o.key==="is").map(o=>o.value),y=g.includes("any")||g.includes("past"),x=g.includes("past")&&!g.includes("any")&&!g.includes("current"),p=g.includes("archived")?!0:t.archived??"all",O=(o,d)=>{let c=ce(d),h=i.tryDefinition(o);return ce(o)===c||ce(ge(h,o))===c},w=i.kinds.filter(o=>!f.has(o)&&!l.has(o)&&(t.kinds===void 0||t.kinds.includes(o))&&(u.length===0||u.some(d=>O(o,d)))),S=r.conditions.filter(o=>o.key!=="kind").map(o=>({...o,admittedBy:w.filter(d=>Be(i,d).filters.some(c=>c.key===o.key))})),v=S.filter(o=>o.key!=="is"),D=g.filter(o=>o==="flagged"||o==="clear"||o==="past"||o==="archived"),P={kinds:w,past:y},Qe={hits:[],words:r.words,conditions:S,searched:P,byKind:{},total:0,matched:[]};if(a.length===0&&v.length===0&&D.length===0)return Qe;let X=t.today,F=t.flagged??new Set(n.violations().flatMap(o=>o.nodeIds)),Ue=t.touched??hn(n.log.all()),Y=new Set;for(let o of t.from??[]){Y.add(o);for(let d of n.graph.neighbors(o))Y.add(d.id)}let ue=ve(n,s)?Oe(n,s):void 0,J=oe.keptFrom?.(n,s)&&n.seenBy(s).graph,Z=o=>je(o,t.basePath===void 0?{}:{basePath:t.basePath}),ye={schema:i,graph:n.graph,flagged:F,...X?{today:X}:{}},R=[],B={},L=[],E=[],K=(o,d,c,h,m,b)=>{let A=z(c,o);B[d]=(B[d]??0)+1,R.push({hit:{about:"node",id:o.id,kind:d,label:A,why:m,current:h,flagged:F.has(o.id),address:Z(`${fe(c,d)}/${encodeURIComponent(o.id)}`),...b===void 0?{}:{near:!0},...G(o)?{archived:!0}:{}},...b===void 0?{}:{nearly:2-b},tier:I[m.strength],inKind:d===t.inKind?0:1,near:Y.has(o.id)?0:1,past:h?0:1,archived:G(o)?1:0,touched:-(Ue.get(o.id)??0),flagged:F.has(o.id)?0:1,name:A,id:o.id})};for(let o of w){let d=i.tryDefinition(o),c=S.filter(m=>m.key!=="is"&&m.admittedBy.includes(o));if(a.length===0&&c.length===0&&D.length===0)continue;let h=Fe(d,c);for(let m of n.graph.nodesOfKind(o,{archived:p})){if(ue&&!ue(m.id))continue;let b=J?J.getNode(m.id):m;if(!b)continue;let A=_(d,b,X);if(!y&&!h&&!A){if(a.length>0&&g.length===0&&c.every(k=>le(ye,b,k))){let k=_e(d,b,r.words);k&&E.push({node:b,kind:o,definition:d,why:k})}continue}if(x&&A||!c.every(k=>le(ye,b,k))||g.includes("flagged")&&!F.has(b.id)||g.includes("clear")&&F.has(b.id))continue;let C=a.length>0?_e(d,b,r.words):c[0]?{field:c[0].key,reading:W(c[0].key),fragment:`${c[0].key}:${c[0].value}`,strength:"field"}:{field:"is",reading:"Is",fragment:`is:${D[0]}`,strength:"field"};C?K(b,o,d,A,C):a.length>0&&L.push({node:b,kind:o,definition:d,current:A})}}let ee=o=>o.strength!=="field",ne=!1;if(E.length>0&&R.length===0){ne=!0;for(let o of E)K(o.node,o.kind,o.definition,!1,o.why)}else if(E.some(o=>ee(o.why))&&!R.some(o=>ee(o.hit.why))){ne=!0;for(let o of E)ee(o.why)&&K(o.node,o.kind,o.definition,!1,o.why)}let he=t.near!==!1&&a.length>0&&R.length<nn&&L.length>0,te=new Set;if(he)for(let o of L){let d=cn(Q(o.definition,o.node),a);d&&(te.add(o.node.id),K(o.node,o.kind,o.definition,o.current,d,d.by==="stem"?.9:.8))}let Ve=o=>o==="exact"||o==="prefix"?-1:I[o],re=(o,d,c,h)=>({hit:o,tier:Ve(d),inKind:1,near:1,past:0,touched:0,flagged:1,name:c,id:h});if(a.length>0){for(let d of w){let c=pn(i,d,a);if(!c)continue;let h=Ne(i,d),m={field:c.field,reading:c.field==="plural"?"Plural":"Kind",fragment:c.text,strength:c.strength};R.push(re({about:"kind",kind:d,label:h,why:m,count:B[d]??0,address:Z(fe(i.tryDefinition(d),d))},c.strength,h,`kind:${d}`))}let o=t.places??[];for(let d of Re(o.filter(c=>w.includes(c.kind)))){if(d.across&&f.has(d.across))continue;let c=j(d.title,a);if(!c)continue;let h={field:"title",reading:"Title",fragment:d.title,strength:c},m=Me(d,o)?fe(i.tryDefinition(d.kind),d.kind).slice(1):void 0,b=Z(We(d.as,m));R.push(re({about:"place",kind:d.kind,title:d.title,as:d.as,why:h,address:b},c,d.title,`place:${d.kind}:${d.as}`))}for(let d of n.allInvariants()){let c=d.scope==="graph"?void 0:d.scope.kind;if(c&&!w.includes(c))continue;let h=d.label??W(d.name),m=j(h,a),b=m?void 0:j(W(d.name),a),A=m??b;if(!A)continue;let C={field:m?"label":"name",reading:m?"Rule":"Name",fragment:m?h:d.name,strength:A};R.push(re({about:"rule",name:d.name,label:h,...c?{kind:c}:{},why:C},A,h,`rule:${d.name}`))}}let pe=()=>{R.sort(qe);let o=t.limit??50,d=R.slice(0,o).map(k=>k.hit),c=d.flatMap(k=>k.about==="node"?[(J||n.graph).getNode(k.id)]:[]).filter(Boolean),h=Ce(c,k=>i.tryDefinition(k)),m=d.map(k=>k.about==="node"&&h.has(k.id)?{...k,apart:h.get(k.id)}:k),b=Object.values(B).reduce((k,Ye)=>k+Ye,0),A=R.flatMap(k=>k.hit.about==="node"?[k.hit.id]:[]),C=t.subject&&w.includes(String(n.graph.getNode(t.subject)?.kind))?kn(n,t.subject,r.words,{principal:s}):[];return{hits:[...m,...C],words:r.words,conditions:S,searched:ne?{...P,past:!0}:P,byKind:{...B},total:b,matched:A}},H=pe(),me=t.rank;if(!he||!me)return H;let be=L.filter(o=>!te.has(o.node.id)).map(({node:o,kind:d,definition:c})=>({id:o.id,kind:d,label:z(c,o),texts:Q(c,o)}));if(be.length===0)return H;let Xe=(async()=>{let o;try{o=await me(r.words,be)}catch{return H}let d=new Map(L.filter(h=>!te.has(h.node.id)).map(h=>[h.node.id,h])),c=!1;for(let{id:h,score:m,matched:b}of Array.isArray(o)?o:[]){let A=d.get(h);!A||!(m>0)||(d.delete(h),c=!0,K(A.node,A.kind,A.definition,A.current,gn(Q(A.definition,A.node),r.words,typeof b=="string"?b:void 0),Math.min(1,m)))}return c?pe():H})();return{...H,later:Xe}}function kn(n,e,t,i={}){let r=i.principal??{kind:"human"},a=(oe.keptFrom?.(n,r)?n.seenBy(r):n).graph.getNode(e);if(!a)return[];if(n.kindsKeptFrom(r).has(a.kind))return[];let s=T(t),f=z(n.schema.tryDefinition(a.kind),a),l=[];for(let g of n.allMutations()){let y=g.subject;if(!y||y.kinds!=="*"&&!y.kinds.includes(a.kind))continue;let x=g.derived?.act;if((x==="archive"||x==="merge")&&G(a)||x==="unarchive"&&!G(a)||x==="leave-alone"&&ie(a)||x==="allow-tidying"&&!ie(a)||!n.permits({name:g.name,args:{[y.arg]:a.id}},r).ok)continue;let p=Ae(g),O=T(p),w=s.filter(v=>O.some(D=>D.startsWith(v))),N=w.length>0?j(p,w):void 0,S=N?{field:"title",reading:"Act",fragment:p,strength:N}:{field:"subject",reading:"On",fragment:f,strength:"field"};l.push({hit:{about:"act",name:g.name,title:p,subject:a.id,why:S,destructive:g.destructive===!0},tier:N?I[N]:I.field+1,inKind:0,near:0,past:g.destructive?1:0,touched:0,flagged:g.pinned?0:1,name:p,id:`act:${g.name}`})}l.sort(qe);let u=l.map(g=>g.hit);return i.limit===void 0?u:u.slice(0,i.limit)}function En(n,e){let t=e.kinds.map((a,s)=>{let f=ge(n.tryDefinition(a),a);return s===0?f:f.toLowerCase()}),i=xe(t)||"Nothing";return e.kinds.some(a=>n.tryDefinition(a)?.lifecycle)?e.past?`${M(i)}, past ones included.`:`${M(i)}, current ones; add is:any for past ones.`:`${M(i)}.`}export{se as a,de as b,Je as c,Fe as d,Be as e,vn as f,On as g,Le as h,Ie as i,Pe as j,en as k,le as l,ce as m,an as n,_e as o,hn as p,Ln as q,kn as r,En as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{G as l,N as p,U as k,W as y,c}from"./chunk.YYWANGIC.js";import"./chunk.FTW3K3G6.js";import"./chunk.UGFDSE37.js";import{b as m}from"./chunk.QBMIET7P.js";import"./chunk.WVKXELAF.js";import"./chunk.ZOW7AC7U.js";import"./chunk.INBHY3SA.js";import"./chunk.TDV7JGIQ.js";import"./chunk.RZQKCLTW.js";import"./chunk.Y3BEKXYB.js";import"./chunk.NDLQXQV2.js";import"./chunk.WUFCRE7O.js";import"./chunk.XEHLSKHP.js";import"./chunk.MSM6E6JK.js";import"./chunk.YGZGMRDC.js";import"./chunk.6ZJE5M2A.js";import"./chunk.2SWQI4HF.js";import"./chunk.QIAH7HHO.js";import"./chunk.DNJM6WQO.js";import"./chunk.LEPKPNPA.js";import"./chunk.5D6SIBOK.js";import"./chunk.UE5GAP67.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.HUABTCQE.js";import"./chunk.DXJFAAOI.js";import"./chunk.5MSNKSTE.js";import"./chunk.KVQZ5FR6.js";import"./chunk.2HANQ737.js";import"./chunk.H536YUAZ.js";import"./chunk.GZHZLJBF.js";import"./chunk.OL2N5NUV.js";import"./chunk.OJGHDWI6.js";import"./chunk.5DPFAVCZ.js";import"./chunk.5EZDXWOE.js";import"./chunk.MIQMPOWF.js";import"./chunk.T66UK7PQ.js";import"./chunk.LMXNHBGH.js";import"./chunk.DBCVZGCC.js";import{G as S,H as s,I as d,T as f,ca as g}from"./chunk.WSMYFEGU.js";import"./chunk.SDO3U72B.js";import"./chunk.WR63RQGU.js";import"./chunk.FQLNBIQ5.js";import{b as n}from"./chunk.AJZBJBMO.js";var u=n(S(),1);var t=n(f(),1);function D({context:a}){let r=l(),h=g(),[w]=(0,u.useState)(()=>s(null)),o=d(h?.seatTalk??w),P=()=>{(window.history.state?.idx??0)>0?r(-1):r("/")};return(0,t.jsxs)(k,{context:a,"data-testid":"draft-page",children:[(0,t.jsx)(y,{context:a,...o.draft?{"data-testid":"draft-title"}:{},children:o.draft?o.draft.title:"Nothing drawn"}),o.draft?(0,t.jsx)(m,{page:!0,go:e=>r(e.address),onPick:e=>{let i=a.store.graph.getNode(e);i&&r(c(a.store.schema,i.kind,e))},onDiscard:P}):(0,t.jsxs)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:["Ask for a way of seeing \u2014 \u201Ca board of tasks by status\u201D \u2014 and it is drawn here."," ",(0,t.jsx)(p,{to:"/",style:{color:"var(--graview-accent)"},children:"Home \u2192"})]})]})}export{D as DraftPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as mt}from"./chunk.MFOSEOF4.js";import{a as pt}from"./chunk.KVQZ5FR6.js";import{f as dt}from"./chunk.2HANQ737.js";import{a as F,f as q}from"./chunk.H536YUAZ.js";import{$ as rt,F as Q,G as X,I as k,Kb as ft,O as G,R as tt,T as nt,U as et,da as _,fa as M,ha as ot,hb as lt,ka as at,kb as ut,kd as ct,ma as st}from"./chunk.WR63RQGU.js";import{e as it}from"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function J(t){let e=[],n=!0;for(let r of t){if(r.text.length===0)continue;let s=r.as==="close"||r.text===","||r.text===":"||r.text.startsWith("'")||n;e.push({part:r,space:!s}),n=r.as==="open"}return e}function D(t,e){return J(t).map(({part:n,space:r})=>`${r?" ":""}${e?n.said??n.text:n.text}`).join("")}function Et(t){return D(t,!1)}function Pt(t){return D(t,!0)}function yt(t,e=!1){let n=e?t.said:t.text;return t.record!==void 0?`${t.record} \u2014 ${n}`:n}function z(t){let e=u=>J(u).map(({part:o,space:a})=>({...o,space:a})),n=e(t.parts),r=t.when&&t.when.length>0?e(t.when):void 0,s=u=>`${D(n,u)}${r?`, when ${D(r,u)}`:""}`;return{...t,parts:n,...r?{when:r}:{},text:s(!1),said:s(!0)}}function Lt(t,e=!1){return t.line?yt(t.line,e):t.message}var gt=60,O=t=>({text:t,as:"name"}),c=(t,e)=>e===void 0?{text:t,as:"word"}:{text:t,as:"word",said:e},L=(t,e)=>e===void 0||e===t?{text:t,as:"value"}:{text:t,as:"value",said:e},R=(t,e)=>({text:t,as:"op",said:e}),v={text:"(",as:"open"},w={text:")",as:"close"},N={text:"\u2014",as:"value",said:"empty"},V={">=":["\u2265","at least"],"<=":["\u2264","at most"],"<":["<","less than"],">":[">","more than"],"==":["=","is"],"!=":["\u2260","is not"]},B={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},At={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},xt=t=>t.t==="binary"&&t.op in V;function I(t){return rt(t)}function bt(t){let{schema:e}=t,n=l=>l===null?void 0:e.tryDefinition(l),r=(l,m)=>{let g=n(l)?.edges;return g&&Object.hasOwn(g,m)?g[m]:void 0},s=(l,m)=>{let g=r(l,m)?.to;return Array.isArray(g)&&g.length===1?g[0]:null},u=(l,m)=>{let g=(e.edge(m)?.from??[]).filter(W=>{let K=r(W,m)?.to;return l===null||K==="*"||Array.isArray(K)&&K.includes(l)});return g.length===1?g[0]:null},o=(l,m)=>r(l,m)?M(m).toLowerCase():I(at(n(l),m)),a=l=>I(ot(e,l)),d=l=>I(dt(e).get(l)?.label??M(l)),b=l=>I(st(n(l),l)),i=(l,m)=>{let g=l===null?void 0:t.formatOf?.(l,m);if(g?.format)return g;let W=t.said?.get(m);return W?{...g,format:W}:g},p=l=>_(e.tryDefinition(l.kind),l),h=t.money?.locale,y=(l,m)=>{if(l==null)return N;if(l instanceof F){if(l.nodes.length===0)return N;let A=l.nodes.slice(0,3).map(p),Y=l.nodes.length-A.length;return L(Y>0?`${A.join(", ")} and ${Y} more`:A.length>1?`${A.slice(0,-1).join(", ")} and ${A[A.length-1]}`:A[0])}if(Array.isArray(l))return L(`{${l.map(A=>y(A,m).text).join(", ")}}`,l.map(A=>y(A,m).text).join(" or "));if(typeof l=="object")return L(p(l));if(typeof l=="boolean")return L(l?"yes":"no");let g=m?.format??(m?i(m.kind,m.key):void 0);if(typeof l=="number")return L(g&&g.format!=="date"?ft(l,{...t.money,...g}):et(l,h));if(Q.test(l)||g?.format==="date")return L(G(nt(l,t.money?.timeZone)??l.slice(0,10),h));if(X.test(l))return L(tt(l,h,t.money?.timeZone));let W=m&&m.kind!==null?n(m.kind)?.display?.format?.[m.key]:void 0;if(W)return L(W(l));let K=l.length>gt?`${l.slice(0,gt-1).trimEnd()}\u2026`:l;return L(/^[a-z][a-z0-9]*([-_][a-z0-9]+)*$/.test(K)?K.replace(/[-_]+/g," "):K)};return{definition:n,relation:r,farOf:s,nearOf:u,fieldName:o,plural:a,noun:b,factName:d,formatOf:i,valueWords:y,locale:h}}function P(t,e,n){if(t.t==="ident")return{kind:e,key:t.name};if(t.t==="member")return{kind:E(t.object,e,n),key:t.name};if(t.t==="call"&&(t.fn==="sum"||t.fn==="min"||t.fn==="max")&&t.args.length===2){let r=E(t.args[0],e,n),s=t.args[1];if(s.t==="ident")return{kind:r,key:s.name};if(s.t==="lit"&&typeof s.value=="string")return{kind:r,key:s.value}}if(t.t==="binary"&&(t.op==="+"||t.op==="-"))return P(t.left,e,n)??P(t.right,e,n);if(t.t==="call"&&t.fn==="if"&&t.args.length===3)return P(t.args[1],e,n)??P(t.args[2],e,n)}function E(t,e,n){switch(t.t){case"ident":return n.relation(e,t.name)?n.farOf(e,t.name):null;case"member":return n.farOf(E(t.object,e,n),t.name);case"where":return E(t.set,e,n);case"binary":return t.op==="|"||t.op==="&"||t.op==="-"?E(t.left,e,n):null;case"call":{let r=s=>{let u=t.args[s];return u?.t==="lit"&&typeof u.value=="string"?u.value:void 0};return t.fn==="all"?r(0)??null:t.fn==="out"?t.args.length===2?n.farOf(E(t.args[0],e,n),r(1)??""):n.farOf(e,r(0)??""):t.fn==="in"?t.args.length===2?n.nearOf(E(t.args[0],e,n),r(1)??""):n.nearOf(e,r(0)??""):(t.fn==="first"||t.fn==="sort")&&t.args[0]?E(t.args[0],e,n):null}default:return null}}function j(t){return t.t==="binary"?t.op==="||"?H(t)?4:1:t.op==="&&"?2:t.op in V||t.op==="in"?4:t.op==="+"||t.op==="-"?5:t.op==="*"||t.op==="/"||t.op==="%"?6:4.5:t.t==="unary"&&t.op==="!"?3:t.t==="where"?3.5:9}var $=t=>t.t==="lit",x=(t,e)=>t.t==="call"&&t.fn===e;function C(t,e){return t.t==="binary"&&t.op===e?[...C(t.left,e),...C(t.right,e)]:[t]}function H(t){if(t.t!=="binary"||t.op!=="||")return;let e=[];e.push(...C(t,"||"));let n,r=[];for(let s of e){if(s.t!=="binary"||s.op!=="=="||!$(s.right)||typeof s.right.value!="string"||n&&JSON.stringify(ht(n))!==JSON.stringify(ht(s.left)))return;n=s.left,r.push(s.right)}return n?{subject:n,values:r}:void 0}var ht=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function f(t,e,n,r){let s=(u,o,a=e)=>j(u)<o?[v,...f(u,a,n),w]:f(u,a,n);switch(t.t){case"lit":return[n.valueWords(t.value,r)];case"list":return[n.valueWords(t.items.map(u=>u.t==="lit"?u.value:null),r)];case"ident":return[O(n.fieldName(e,t.name))];case"member":{let u=x(t.object,"first")&&t.object.args[0]&&x(t.object.args[0],"all"),o=E(t.object,e,n);if(u&&o)return e!==null&&n.fieldName(e,t.name)===n.fieldName(o,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[O(`${n.noun(o)}'s ${n.fieldName(o,t.name)}`)]:[O(n.fieldName(o,t.name))];let a=f(t.object,e,n),d=a[a.length-1];return a.length===1&&d?.as==="name"?[O(`${d.text}'s ${n.fieldName(o,t.name)}`)]:[...a,c("'s"),O(n.fieldName(o,t.name))]}case"unary":return t.op==="-"?[R("\u2212","minus"),...s(t.operand,7)]:T(t.operand,e,n);case"where":{let u=E(t.set,e,n),o=f(t.filter,u,n),a=o.every(d=>d.as==="name"||d.as==="word"&&d.text==="not");return[...s(t.set,4),...a?[]:[c("with")],...j(t.filter)<=2?[v,...o,w]:o]}case"binary":return Rt(t,e,n);case"call":return jt(t,e,n)}}function T(t,e,n){return xt(t)?Rt({...t,op:B[t.op]},e,n):x(t,"present")||x(t,"exists")?[...f(t.args[0],e,n),R("=","is"),N]:t.t==="ident"?[c("not"),O(n.fieldName(e,t.name))]:[c("not"),v,...f(t,e,n),w]}function Rt(t,e,n){let r=(o,a)=>j(o)<a?[v,...f(o,e,n),w]:f(o,e,n);if(t.op==="&&"||t.op==="||"){let o=H(t);if(o){let d=P(o.subject,e,n);return[...f(o.subject,e,n),R("\u2208","is one of"),n.valueWords(o.values.map(b=>b.value),d)]}let a=t.op==="&&"?2:1;return[...r(t.left,a),c(t.op==="&&"?"and":"or"),...r(t.right,a+.5)]}if(t.op in V){if($(t.right)&&typeof t.right.value=="boolean"&&(t.op==="=="||t.op==="!="))return t.op==="=="===t.right.value?f(t.left,e,n):T(t.left,e,n);let[o,a]=V[t.op],d=P(t.left,e,n),b=P(t.right,e,n);return[...S(t.left,e,n,b),R(o,a),...S(t.right,e,n,d)]}if(t.op==="in")return[...r(t.left,5),R("\u2208","is one of"),...S(t.right,e,n,P(t.left,e,n))];let s=At[t.op];if(s){let o=j(t);return[...r(t.left,o),R(s[0],s[1]),...r(t.right,o+.5)]}let u={"|":"or","&":"and also","-":"except"};return[...r(t.left,5),c(u[t.op]??t.op),...r(t.right,5)]}function S(t,e,n,r){return t.t==="lit"||t.t==="list"?f(t,e,n,r):j(t)<5?[v,...f(t,e,n),w]:f(t,e,n)}function jt(t,e,n){let r=o=>t.args[o],s=o=>{let a=t.args[o];return a?.t==="lit"&&typeof a.value=="string"?a.value:void 0},u=o=>{let a=r(o);return j(a)<9&&a.t!=="where"?[v,...f(a,e,n),w]:f(a,e,n)};switch(t.fn){case"out":{let o=s(t.args.length-1)??"",a=O(M(o).toLowerCase());return t.args.length===2?[a,c("of"),...u(0)]:[a]}case"in":{let o=s(t.args.length-1)??"",a=t.args.length===2?n.nearOf(E(r(0),e,n),o):n.nearOf(e,o),d=O(a?n.plural(a):M(o).toLowerCase());return t.args.length===2?[d,c("of"),...u(0)]:[d]}case"all":{let o=s(0),a=t.args[1]?.t==="lit"?t.args[1].value:void 0,d=a===!0?[c("archived")]:a==="all"?[c("archived or not")]:[];return a===!0?[...d,O(o?n.plural(o):"everything")]:[O(o?n.plural(o):"everything"),...d]}case"fact":{let o=s(0);return[O(o?n.factName(o):"fact")]}case"count":return[c("number of"),...u(0)];case"exists":return[...u(0),R("\u2260","is not"),N];case"present":return[...f(r(0),e,n),R("\u2260","is not"),N];case"some":case"every":{let o=E(r(0),e,n),a=r(1);return[...t.fn==="some"?[c("some")]:[],...u(0),c(t.fn==="some"?"with":"all with"),...j(a)<=2?[v,...f(a,o,n),w]:f(a,o,n)]}case"sum":case"min":case"max":{let o=E(r(0),e,n),a=r(1),d=a.t==="lit"&&typeof a.value=="string"?[O(n.fieldName(o,a.value))]:j(a)<9?[v,...f(a,o,n),w]:f(a,o,n);return[c(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...d,c("of"),...u(0)]}case"first":{let o=r(0);if(x(o,"all")){let a=o.args[0]?.value;if(typeof a=="string")return[O(`the ${n.noun(a)}`)]}return[c("first of"),...u(0)]}case"sort":return[...u(0),c("by"),...f(r(1),E(r(0),e,n),n)];case"len":return[c("length of"),...f(r(0),e,n)];case"lower":return f(r(0),e,n);case"contains":case"startsWith":return[...f(r(0),e,n),c(t.fn==="contains"?"contains":"starts with"),...S(r(1),e,n,P(r(0),e,n))];case"today":return[L("today")];case"now":return[L("now")];case"date":return $(r(0))&&typeof r(0).value=="string"?[L(G(String(r(0).value),n.locale))]:f(r(0),e,n);case"days":case"hours":{let o=t.fn,[a,d]=[r(0),r(1)];return x(d,"today")||x(d,"now")?[c(`${o} since`),...f(a,e,n)]:x(a,"today")||x(a,"now")?[c(`${o} until`),...f(d,e,n)]:[c(`${o} from`),...f(a,e,n),c("to"),...f(d,e,n)]}case"if":return[v,...f(r(1),e,n),c("if"),...f(r(0),e,n),c(","),c("else"),...f(r(2),e,n),w];case"either":return t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),c("else"),...f(o,e,n)]);default:return[c(t.fn),v,...t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),...f(o,e,n)]),w]}}function U(t,e){let n=bt(e),r=t.over==="graph"?null:t.over;return z({...r===null?{}:{kind:r},parts:f(t.require,r,n),...t.when?{when:f(t.when,r,n)}:{}})}function Z(t,e,n){let r=bt(e),s=t.over==="graph"?null:t.over,u=n.subject,o=i=>{try{return q(i,{...n,budget:2e3})}catch{return}},a=(i,p)=>{let h=S(i,s,r,p);if(i.t==="lit"||i.t==="list"||x(i,"today")||x(i,"now")||x(i,"date"))return h;let y=o(i);if(y===void 0)return h;let l=P(i,s,r),m=r.valueWords(y,l?{...l,format:r.formatOf(l.kind,l.key)??(p?r.formatOf(p.kind,p.key):void 0)}:p);return y instanceof F?[...h,c(":"),m]:[...h,m]},d=i=>{if(i.t==="binary"&&i.op==="&&"){let p=[];p.push(...C(i,"&&"));let h=p.filter(y=>o(y)!==!0);return(h.length>0?h:p).flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op==="||"){let p=H(i);if(p){let y=P(p.subject,s,r);return[...a(p.subject),R("\u2209","is not one of"),r.valueWords(p.values.map(l=>l.value),y)]}let h=[];return h.push(...C(i,"||")),h.flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op in V){if($(i.right)&&typeof i.right.value=="boolean"&&(i.op==="=="||i.op==="!="))return i.op==="=="===i.right.value?T(i.left,s,r):f(i.left,s,r);let p=B[i.op],[h,y]=V[p],l=P(i.left,s,r),m=P(i.right,s,r);if($(i.right)&&i.right.value===null)return[...p==="=="?S(i.left,s,r,m):a(i.left,m),R(h,y),N];let g=p==="=="&&($(i.right)||$(i.left));return[...g?S(i.left,s,r,m):a(i.left,m),R(h,y),...g?S(i.right,s,r,l):a(i.right,l)]}if(i.t==="binary"&&i.op==="in")return[...a(i.left),R("\u2209","is not one of"),...S(i.right,s,r,P(i.left,s,r))];if(i.t==="unary"&&i.op==="!"){let p=i.operand;return xt(p)?d({...p,op:B[p.op]}):x(p,"present")||x(p,"exists")?[...a(p.args[0]),R("\u2260","is not"),N]:p.t==="ident"?f(p,s,r):[c("not"),v,...T(p,s,r),w]}if(x(i,"present")||x(i,"exists"))return[...f(i.args[0],s,r),R("=","is"),N];if(x(i,"some"))return[...f(i,s,r).slice(1),R("=","is"),N];if(x(i,"every")&&i.args.length===2){let p=o(i.args[0]);if(p instanceof F){let h=p.nodes.filter(y=>{try{return q(i.args[1],{...n,subject:y,budget:2e3})!==!0}catch{return!0}});return[...f(i,s,r),c(","),c("not"),r.valueWords(new F(h))]}}return i.t==="ident"?[c("not"),O(r.fieldName(s,i.name))]:[c("not"),v,...f(i,s,r),w]},b;try{b=d(t.require)}catch{b=[c("not"),v,...f(t.require,s,r),w]}return z({...s===null?{}:{kind:s},parts:b,...u?{record:_(e.schema.tryDefinition(u.kind),u)}:{}})}function vt(t){let e=new Map;for(let n of t??[])n.expr?.t==="ident"&&n.format&&(n.format==="money"||n.format==="percent"||n.format==="date")&&e.set(n.expr.name,n.format);return e}function St(t){return(e,n)=>{let r=t[e]?.fields?.[n],s=r?.format??(r?.type==="date"?"date":void 0);return s||r?.unit?{...s?{format:s}:{},...r?.unit?{unit:r.unit}:{}}:void 0}}function Ot(t,e){return{schema:e,said:vt(t.says),...t.declared?{formatOf:St(t.declared)}:{},...t.money?{money:t.money}:{}}}function Qt(t,e){return t.shape?U(t.shape,Ot(t.shape,e)):void 0}var wt=new WeakMap;function Nt(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let s=$t(r),u=n.get(s.invariant)?.shape;if(!u||s.status&&s.status!=="violated")return s;let o=s.subjectId?t.graph.getNode(s.subjectId):void 0;if(u.over!=="graph"&&!o)return s;let a=u.kinds;a||(a=wt.get(t.schema),a||wt.set(t.schema,a=pt(t.schema)));try{let d=t.today?.()??u.today?.()??k(),b=Z(u,Ot(u,t.schema),{graph:t.graph,subject:o??null,kinds:a,today:d});return{...s,line:b,...u.says?{}:{message:`${s.message} \u2014 ${b.text}`}}}catch{return s}})}function Wt(){ut((t,e,n,r)=>Nt({graph:t,schema:t.schema,allInvariants:()=>e,today:()=>r},n)),mt(Kt)}function Kt(t,e,n,r){let s=e.graph,u=lt.from(t.schema,s.snapshot(),{validate:!1});for(let b of n?[...r].reverse().map(it):r)try{u.applyPrimitives([b],{restoring:!0})}catch{}let o=b=>t.violations(void 0,b),a=o(n?u:s),d=o(n?s:u);return{...ct(t.allInvariants(),a,d),violationsAfter:d}}function $t(t){if(!t.line)return t;let{line:e,...n}=t,r=` \u2014 ${e.text}`;return n.message.endsWith(r)?{...n,message:n.message.slice(0,-r.length)}:n}Wt();export{Z as brokenLineOf,Wt as judgeWithLines,Kt as judgedForASeat,Lt as problemWords,Qt as ruleLine,U as ruleLineOf,yt as ruleLineWords,J as ruleSpacing,Pt as ruleSpoken,Et as ruleText,$t as unlined,Nt as withLines};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,i as E}from"./chunk.MIQMPOWF.js";import{a as M,f as z}from"./chunk.T66UK7PQ.js";import{C as y,Fa as O,Nb as N,Qa as P,Ra as D,Tc as K,Uc as k,Wb as T,Xb as Z,Yb as q,Zb as v,ab as L,fa as S,qb as V,rb as I,sb as g,va as R,ya as j}from"./chunk.WR63RQGU.js";var J=n=>n.safeParse?.(void 0).success??!1,C=n=>h(n).shape,A=n=>{let r=h(n);if(y(r)?.type!=="literal")return;let o=y(r)?.values;return o&&o.length===1&&typeof o[0]=="string"?o[0]:void 0};function F(n,r){let o=J(r),e=h(r),t=y(e)?.type,c=N(r);if(c)return{control:"node",name:n,optional:o,kinds:c};let p=O(r);if(p)return{control:"linked",name:n,optional:o,relation:p};if(D(r)){let d=P(n);return{control:"repeat",name:n,optional:o,...d?{of:d}:{}}}if(t==="boolean")return{control:"boolean",name:n,optional:o};let f=R(e);if(f)return{control:"file",name:n,optional:o,...f==="image"?{image:!0}:f==="video"?{video:!0}:{}};if(t==="object"){let d=e.shape??{};return{control:"group",name:n,optional:o,fields:Object.entries(d).map(([a,l])=>F(a,l))}}if(t==="union"){let d=y(e)?.options??[],a=d.map(s=>C(s));if(a.every(s=>s!==void 0)){let s=Object.keys(a[0]??{}).find(u=>a.every(m=>A(m?.[u])!==void 0));if(s)return{control:"variant",name:n,optional:o,tag:s,options:d.map((u,m)=>({value:A(a[m]?.[s])??"",fields:Object.entries(a[m]??{}).filter(([w])=>w!==s).map(([w,B])=>F(w,B))}))}}let l=d.map(s=>A(s));return l.every(s=>s!==void 0)?{control:"choice",name:n,optional:o,options:l}:{control:"opaque",name:n,optional:o}}if(t==="array"){let d=y(e)?.element;return d!==void 0?{control:"list",name:n,optional:o,item:F(n,d)}:{control:"opaque",name:n,optional:o}}let i=E(r);return i.type==="text"?{control:"text",name:n,optional:o,...i.long?{long:!0}:{},...j(e)?{app:!0}:{},...M(e)?{markdown:!0}:{},...i.holds?{holds:i.holds}:{}}:i.type==="number"&&i.duration?{control:"text",name:n,optional:o,holds:"duration"}:i.type==="date"?{control:"date",name:n,optional:o,...i.time?{time:!0}:{},...i.instant?{instant:!0}:{}}:i.type==="number"?{control:"number",name:n,optional:o,...i.min===void 0?{}:{min:i.min},...i.max===void 0?{}:{max:i.max},...i.step===void 0?{}:{step:i.step},...i.amount?{amount:i.amount}:{}}:i.type==="choice"?{control:"choice",name:n,optional:o,options:i.options}:{control:"opaque",name:n,optional:o}}function H(n){let r=n.shape;return r?Object.entries(r).map(([o,e])=>F(o,e)):[]}function W(n,r){let o={...r};for(let e of n){let t=r[e.name];t===void 0&&!e.optional&&(e.control==="list"||e.control==="boolean")&&(o[e.name]=e.control==="list"?[]:!1),e.control==="text"&&e.holds&&typeof t=="string"&&(o[e.name]=t.trim()===""?void 0:e.holds==="duration"?z(t)??t:t.trim()),e.control==="group"&&t!==void 0&&typeof t=="object"&&t!==null&&(o[e.name]=W(e.fields,t))}return o}function G(n,r){return Z(H(r.input),T(n,r))}var x="visitor";function gn(n,r,o,e){let t=K.keptFrom?.(n,r),c=new Set;if(!t)return c;let p=Object.keys(o.input.shape??{});for(let a of o.creates??[]){let l=t({id:"\0new",kind:a});for(let s of p)l?.(s)&&c.add(s)}let f=e===void 0?void 0:n.graph.getNode(e),i=f&&n.schema.tryDefinition(f.kind),d=f&&t(f);if(i&&d)for(let a of v(o,i))d(a)&&p.includes(a)&&c.add(a);return c}function _(n,r,o,e){let t=new Set,c=r?.sees??[];if(I(o)||!c.some(k))return t;let p=V(o),f=(l,s)=>{let u=c.filter(m=>m.kinds.includes(l)&&g(m,p));return u.some(k)?L.has(s)||u.some(m=>!k(m)||(m.fields===void 0||m.fields.includes(s))&&!m.hide?.includes(s)):!0},i=Object.keys(e.input.shape??{}),d=new Map,a=(l,s)=>d.set(l,d.get(l)===!0||s);for(let l of e.creates??[]){let s=Object.keys(n.tryDefinition(l)?.fields.shape??{});for(let u of i)s.includes(u)&&a(u,f(l,u))}for(let l of q(n,e)){let s=n.tryDefinition(l);if(s)for(let u of v(e,s))i.includes(u)&&a(u,f(l,u))}for(let[l,s]of d)s||t.add(l);return t}var $=(n,r)=>r.title??S(n);function Q(n,r,o){let e=n?.sees;return!e||e.length===0?!0:e.some(t=>t.kinds.includes(o)&&g(t,r)&&!t.own&&!t.via)}function b(n){switch(n.control){case"node":return[n];case"group":return n.fields.flatMap(b);case"variant":return n.options.flatMap(r=>r.fields.flatMap(b));case"list":return b(n.item);default:return[]}}function U(n,r,o,e){return e.has(o.name)?!1:b(o).every(t=>t.kinds.some(c=>c!=="*"&&Q(n,r,c)))}var X=n=>({kind:"human",id:"form:",roles:[n]});function vn(n,r,o=n.mutations??[]){let e=n.forms?.[r];if(!e)return;let t=o.find(a=>a.name===e.act);if(!t)return;let c=e.role??x,p=X(c),f=_(n.schema,n.policy,p,t),i=G(n.schema,t),d=e.fields?e.fields.flatMap(a=>i.find(l=>l.name===a)??[]):i.filter(a=>U(n.policy,p,a,f));return{name:r,title:$(r,e),...e.intro?{intro:e.intro}:{},...e.say?{say:e.say}:{},submit:e.submit??t.title??S(t.name),role:c,act:t,fields:d}}function An(n,r,o){let e=n.forms?.[r];if(!e)throw new Error(`There is no form called "${r}"${n.forms?`: the forms are ${Object.keys(n.forms).join(", ")}`:": the app declares none"}.`);return{kind:"visitor",id:o,name:`a visitor via the ${$(r,e)} form`,roles:[e.role??x]}}function xn(n){return{said:"Received \u2014 thank you.",...n.say?{next:n.say}:{}}}export{H as a,W as b,G as c,gn as d,_ as e,vn as f,An as g,xn as h};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Le}from"./chunk.2ORJGMRT.js";import{A as en,B as Te,C as vo,D as et,E as ye,F as Jn,G as qe,H as _e,I as ko,J as Yn,K as Ee,L as xo,M as Po,N as F,O as ft,P as Pt,Q as Ao,R as At,S as tn,T as Co,U as le,V as yt,W as de,X as Qn,a as V,b as ke,c as Y,d as Xt,e as Un,f as _n,g as gt,h as ee,i as Se,j as ie,k as A,l as se,m as U,n as We,o as be,p as mt,q as fe,r as ge,s as wo,t as vt,u as So,v as kt,w as xt,x as z,y as Ge,z as bo}from"./chunk.YYWANGIC.js";import{b as Vn,c as yo,d as ho,e as Ke,f as zn,h as ne}from"./chunk.FTW3K3G6.js";import{a as go,d as mo,e as fo}from"./chunk.UGFDSE37.js";import{a as io,c as so,f as lo,g as co,i as po,j as uo}from"./chunk.QBMIET7P.js";import{a as Qt,b as Zt}from"./chunk.PXQVXBNG.js";import{a as Yr,b as Qr,c as Zr,d as jn}from"./chunk.WVKXELAF.js";import{b as Jr}from"./chunk.ZOW7AC7U.js";import{a as Xr,b as eo,d as Jt,e as to,f as no,g as ao,j as Yt}from"./chunk.INBHY3SA.js";import{m as zr}from"./chunk.NDLQXQV2.js";import{a as $r,b as Hr,c as Fr,e as Vr,f as qn,h as Ut}from"./chunk.XEHLSKHP.js";import{d as Ir,e as Dr,f as Wr,g as Gr,n as jt,o as qr,q as jr,s as Vt}from"./chunk.MSM6E6JK.js";import{a as Gt,b as cr,c as pr,d as Bt,e as ur}from"./chunk.YGZGMRDC.js";import{b as wr,c as Er,e as Nr,f as Gn}from"./chunk.6ZJE5M2A.js";import{a as Wn,b as Tr}from"./chunk.2SWQI4HF.js";import{a as _t,b as zt,c as Ur,e as _r}from"./chunk.LEPKPNPA.js";import{a as ut,b as Rr,e as Lr}from"./chunk.5D6SIBOK.js";import{a as Mr}from"./chunk.BJUUSIQY.js";import{a as Bn}from"./chunk.BRCKXL7B.js";import{a as In,b as yr,c as hr}from"./chunk.CPNE6HPQ.js";import{a as Or}from"./chunk.QQ3YWKWU.js";import{c as br,d as vr,e as kr,f as xr,j as Pr,l as Xe,m as Ar}from"./chunk.HUABTCQE.js";import{a as Sr}from"./chunk.DXJFAAOI.js";import{b as _a,c as za}from"./chunk.2HANQ737.js";import{a as $n,d as Hn,f as Ua}from"./chunk.H536YUAZ.js";import{r as Dn,s as Cr}from"./chunk.OL2N5NUV.js";import{b as gr,c as mr,d as Kt,e as fr,l as qt}from"./chunk.MIQMPOWF.js";import{H as ro,K as oo,c as lr,d as dr,r as Br,s as Kr,z as Kn}from"./chunk.LMXNHBGH.js";import{c as Ai}from"./chunk.DBCVZGCC.js";import{Ba as Wt,G as ve,L as Qa,N as Za,Qa as sr,R as Xa,T as j,U as Fn,Y as er,Z as tr,ba as nr,ca as ce,fa as ar,ga as rr,ia as or,ma as ct,oa as ir,qa as pt,r as Ya,v as De}from"./chunk.WSMYFEGU.js";import{a as Ja}from"./chunk.SDO3U72B.js";import{$a as Ha,Bd as Dt,J as La,Jc as Nn,Kc as Ga,Kd as On,Ld as ja,Qc as Ba,Qd as Va,U as bt,Za as $a,ca as lt,da as oe,ed as Ka,fa as Qe,ga as dt,ha as Ta,hc as Ia,ia as Ue,ka as Ea,la as Na,lb as En,ma as Ze,mb as Fa,oc as Da,qc as Wa,sd as Mn,wb as Ft,xa as Ma,ya as Oa,yd as It,zd as qa}from"./chunk.WR63RQGU.js";import{b as H}from"./chunk.AJZBJBMO.js";function nn(e,t,n={}){let a=e.graph.getNode(t);if(!a)return;let r=e.schema.tryDefinition(a.kind),o=s=>oe(e.schema.tryDefinition(s.kind),s),i=new Map;for(let s of e.graph.allEdges()){let l=s.from===t?"out":s.to===t?"in":null;if(!l)continue;let c=l==="out"?s.to:s.from,u=e.graph.getNode(c);if(!u)continue;let p=(l==="out"?r:e.schema.tryDefinition(u.kind))?.edges?.[s.kind],w=l==="in"?p?.inverse??p?.description:p?.description,R=`${s.kind}|${l}|${w??""}`;(i.get(R)??(()=>{let x={edgeKind:s.kind,direction:l,...w?{description:w}:{},targets:[]};return i.set(R,x),x})()).targets.push({id:u.id,kind:u.kind,label:o(u)})}return{id:t,kind:a.kind,label:o(a),fields:Kt(Xe(e.schema,e.graph,a),r),violations:En(e.violations(n.context),[t]),actions:Bn(e,[t],{focus:t,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...i.values()].map(s=>{let l=gr(s.targets.flatMap(c=>{let u=e.graph.getNode(c.id);return u?[u]:[]}),c=>e.schema.tryDefinition(c));return{...s,targets:[...s.targets].map(c=>l.has(c.id)?{...c,apart:l.get(c.id)}:c).sort((c,u)=>c.label.localeCompare(u.label))}})}}function tt(e,t,n={}){return{kind:t,members:e.graph.nodesOfKind(t),actions:Bn(e,[],{kindSelection:[t],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function Ro(e,t){let n=(o,i)=>`${o}|${JSON.stringify(i)}`,a=new Map;for(let o of[...e.affordances,...e.withheld]){if(o.provider!=="invariant")continue;let i=n(o.mutation,o.args);a.has(i)||a.set(i,o.rank??Number.MAX_SAFE_INTEGER)}let r=Number.MAX_SAFE_INTEGER;return[...t].map((o,i)=>({repair:o,declared:i})).sort((o,i)=>(a.get(n(o.repair.mutation,o.repair.args??{}))??r)-(a.get(n(i.repair.mutation,i.repair.args??{}))??r)||o.declared-i.declared).map(o=>o.repair)}function nt(e){let t=e.schema.kinds.map(r=>({kind:r,plural:Ue(e.schema,r),count:e.graph.nodesOfKind(r).length})),n=new Map;for(let r of e.graph.allEdges()){let o=e.graph.getNode(r.from),i=e.graph.getNode(r.to);if(!o||!i)continue;let s=`${r.kind}|${o.kind}|${i.kind}`;n.set(s,(n.get(s)??0)+1)}let a=[];for(let{kind:r}of t){let o=e.schema.tryDefinition(r)?.edges??{};for(let[i,s]of Object.entries(o)){let l=s.to==="*"||s.to===void 0?(()=>{let c=[...n.keys()].filter(u=>u.startsWith(`${i}|${r}|`)).map(u=>u.split("|")[2]);return c.length>0?c:["*"]})():s.to;for(let c of l)a.push({edgeKind:i,from:r,to:c,...s.description?{description:s.description}:{},...s.inverse?{inverse:s.inverse}:{},count:n.get(`${i}|${r}|${c}`)??0})}}return{kinds:t,relations:a}}var je=H(ve(),1);var Ct=H(ve(),1);var Ne=H(j(),1),Ri={problems:"Problems",search:"Search",map:"Connections",places:"Pictures","~draft":"A view drawn"},Li=e=>{try{return decodeURIComponent(e)}catch{return e}};function Ti(e,t,n={}){let{store:a}=e,r=a.schema,o=(n.base??"").replace(/\/$/,""),[i="/",s=""]=t.split("#")[0].split("?"),l=(O,D,g)=>({label:O,href:`${o}${D}`,path:D,...g?{current:g}:{}}),c=O=>{let D=n.registry?.sectionOf(O);return D?[D.path===void 0?{label:D.label}:l(D.label,D.path)]:[]},u=O=>n.registry?.sectionOf(O)?.label,k=O=>{let D=u(O);return D===void 0?{}:{section:D}},[p,w,...R]=i.split("/").filter(Boolean).map(Li);if(p===void 0)return{as:"home",label:"Home",trail:[l("Home","/",!0)]};if(p==="places"&&w!==void 0&&R.length===0){let O=new URLSearchParams(s).get("of"),D=new Set(Ge(a,e.principal)),g=e.views?.places()??[],N=g.find(T=>D.has(T.kind)&&T.as===w&&(!O||V(r,T.kind)===O));if(N){let T=Xt(N.as,It(N,g)?V(r,N.kind):void 0);return{as:"place",kind:N.kind,label:N.title,...k(N.kind),trail:[...c(N.kind),l(N.title,T,!0)]}}}let f=R.length===0?ke(r,p):void 0;if(f!==void 0){let O=l(Ue(r,f),`/${V(r,f)}`);if(w===void 0)return{as:"list",kind:f,label:O.label,...k(f),trail:[...c(f),{...O,current:!0}]};let D=a.graph.getNode(w),g=D&&D.kind===f?oe(r.tryDefinition(f),D):"Nothing lives here";return{as:"record",kind:f,id:w,label:g,...k(f),trail:[...c(f),O,l(g,Y(r,f,w),!0)]}}let x=Ri[p]??Ei((R.at(-1)??w??p).replace(/[-_]+/g," "));return{as:"page",label:x,trail:[l(x,i,!0)]}}var Ei=e=>e.charAt(0).toUpperCase()+e.slice(1),Zn=(0,Ct.createContext)(null);function Ni(e){let t=ye(),n=et("/");return ne(e.context.store),Ti(e.context,`${t.pathname}${t.search}`,{registry:e.registry,base:n})}var Mi={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},Lo={display:"flex",alignItems:"center",gap:6,minWidth:0},To={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,lineHeight:"24px"};function ht({context:e,style:t}){let n=(0,Ct.useContext)(Zn),a=(0,Ct.useContext)(Pt);return At(a??$i,"trail")||n?.registry?.without().has("trail")?null:(0,Ne.jsx)(Oi,{root:n??{context:e,registry:void 0},context:e,...t?{style:t}:{}})}function Oi({root:e,context:t,style:n}){let a=Ni(e);return a.trail.length<2?null:(0,Ne.jsx)(Hi,{here:a,mark:a.as==="record"?{kind:a.kind,context:t}:void 0,...n?{style:n}:{},"data-testid":"page-trail"})}var $i={count:()=>0,place:()=>()=>{},subscribe:()=>()=>{}};function Hi({here:e,mark:t,style:n,...a}){let r=e.as==="record"?e.trail.length-2:-1;return(0,Ne.jsx)("nav",{"aria-label":"You are here","data-graview-trail":"",style:{minWidth:0,...n},...a,children:(0,Ne.jsx)("ol",{style:{...Se,listStyle:"none",padding:0,display:"flex",alignItems:"center",gap:6,minWidth:0,overflow:"hidden"},children:e.trail.map((o,i)=>(0,Ne.jsxs)("li",{style:o.current?Mi:{...Lo,flexShrink:i===e.trail.length-2?0:1,maxWidth:"100%"},...o.current?{"aria-current":"page"}:{},children:[i>0&&!o.current?(0,Ne.jsx)("span",{"aria-hidden":"true",children:"\u203A"}):null,o.current?o.label:o.path!==void 0?(0,Ne.jsxs)(F,{to:o.path,style:{...be,...Lo},...i===r?{"data-testid":"trail-list"}:{},children:[i===r&&t?(0,Ne.jsx)(ge,{kind:t.kind,brand:t.context.brand,schema:t.context.store.schema,size:8}):null,(0,Ne.jsx)("span",{style:To,children:o.label})]}):(0,Ne.jsx)("span",{style:To,children:o.label})]},`${i}:${o.label}`))})})}var C=H(j(),1);function He(e){let t=e.views;if(!t)return[];let n=new Set(Ge(e.store,e.principal));return t.places().filter(a=>n.has(a.kind))}function an(e,t){if(!t.over)return[t.kind];let n=new Set(Ge(e.store,e.principal));return t.over.filter(a=>a===t.kind||n.has(a))}var at=e=>`place:${e.kind}:${e.as}`;function he(e,t){return Xt(t.as,It(t,e.views?.places()??[])?V(e.store.schema,t.kind):void 0)}function Rt(e,t){let n=e.schema.tryDefinition(t);return e.graph.nodesOfKind(t).filter(a=>lt(n,a))}function Xn(e,t,n){let a=(o,i)=>dt(e.schema,i,o),r=(typeof t=="string"?[t]:t).map(o=>a(Rt(e,o).length,o)).join(" and ");return n?`${r} across ${a(Rt(e,n).length,n)}`:r}function ea({context:e,place:t,chosen:n,filter:a}){let{store:r,views:o,invariantContext:i}=e,l=o?.resolve(t.kind,{cardinality:"many",fidelity:"full"},t.as)?.view,c=[...new Set(r.violations(i).flatMap(p=>p.nodeIds))],u=an(e,t).flatMap(p=>Rt(r,p));if(!l)return null;let k=Fi(r,u,a,c);return(0,C.jsx)(Dn,{kind:t.kind,view:t.title,children:(0,C.jsx)(yt,{when:pt(l),children:(0,C.jsx)(l,{nodes:k,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...c.length>0?{flagged:c}:{}})})})}function Fi(e,t,n,a){let r=n?Dt({filter:n}).filter??[]:[];return r.length===0?t:Ut(t,{filter:r},{schema:e.schema,graph:e.graph,flagged:new Set(a)}).nodes}function Ii({store:e,views:t,as:n,invariantContext:a}){ne(e);let r={store:e,views:t,...a?{invariantContext:a}:{}},o=t.places().find(i=>i.as===n);return o?(0,C.jsx)(ea,{context:r,place:o}):null}function Di({context:e,kind:t}){let{store:n,views:a,invariantContext:r}=e,o=Rt(n,t),i=n.schema.tryDefinition(t),s=z(n,t),c=a?.resolve(t,{cardinality:"many",fidelity:"full"})?.view,u=[...new Set(n.violations(r).flatMap(R=>R.nodeIds))];if(c&&!ct(c))return(0,C.jsx)(Dn,{kind:t,children:(0,C.jsx)(c,{nodes:o,label:s,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...u.length>0?{flagged:u}:{}})});let k=a?.resolve(t,{cardinality:"one",fidelity:"summary"})?.view,p=8,w=o.slice(0,p);return(0,C.jsxs)("div",{"data-testid":"kind-sheet",style:k?{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridAutoRows:"max-content",alignContent:"center",gap:12,padding:24}:{display:"flex",flexWrap:"wrap",alignContent:"center",justifyContent:"center",gap:10,padding:24},children:[w.map(R=>k?(0,C.jsx)(k,{node:R,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...u.includes(R.id)?{flagged:[R.id]}:{}},R.id):(0,C.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:oe(i,R)},R.id)),o.length>p?(0,C.jsxs)("span",{style:{...A,alignSelf:"center",padding:"0 6px"},children:["+",o.length-p," more ",s.toLowerCase()]}):null]})}function ta(e){let{store:t}=e,n=bo(e),a=He(e),r=e.views?.arrangement?.()?.order??[],o=l=>{let c=l.name===void 0?-1:r.indexOf(`view:${l.name}`);return c>=0?c-r.length:n.indexOf(l.kind)},i=Mn([...a].sort((l,c)=>o(l)-o(c))).filter(l=>!l.hidden),s=new Set(i.flatMap(l=>l.over??[l.kind]));return[...i.map(l=>({key:at(l),kind:l.kind,title:qa(l,a,t.schema),to:he(e,l),place:l})),...en(e).filter(l=>!s.has(l)).map(l=>({key:`kind:${l}`,kind:l,title:z(t,l),to:`/${V(t.schema,l)}`}))]}var Eo=.72,Wi=540,No=16/10;function Gi(e){let t=(0,je.useRef)(null),[n,a]=(0,je.useState)(e);return(0,je.useLayoutEffect)(()=>{let r=t.current;if(!r||typeof ResizeObserver>"u")return;let o=()=>{let s=r.getBoundingClientRect().width;s>0&&a(l=>Math.abs(l-s)<.5?l:s)};o();let i=new ResizeObserver(o);return i.observe(r),()=>i.disconnect()},[]),{ref:t,width:n}}function Bi(e){for(let t=e.parentElement;t;t=t.parentElement)if(/(auto|scroll)/.test(getComputedStyle(t).overflowY))return t;return null}function Ki(e){let[t,n]=(0,je.useState)(()=>typeof IntersectionObserver>"u");return(0,je.useLayoutEffect)(()=>{let a=e.current;if(t||!a)return;let r=new IntersectionObserver(o=>{o.some(i=>i.isIntersecting)&&(r.disconnect(),n(!0))},{root:Bi(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[t,e]),t}function na({context:e,entry:t,small:n=!1}){let{store:a,brand:r,principal:o}=e,{ref:i,width:s}=Gi(Wi),l=Ki(i),c=s/Eo,u=Rt(a,t.kind),k=a.schema.tryDefinition(t.kind),p=u.length===0?tt(a,t.kind,{...o?{principal:o}:{},...e.invariantContext?{context:e.invariantContext}:{}}).actions.affordances[0]:void 0,w=t.place!==void 0;return(0,C.jsxs)(F,{to:t.to,"data-testid":w?"place-card":"kind-card",className:"graview-gallery-card",style:{...be,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,C.jsxs)("span",{ref:i,"data-testid":w?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${No}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,C.jsx)("span",{style:{position:"absolute",left:0,top:0,width:c,height:c/No,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${Eo})`,transformOrigin:"0 0"},children:l?(0,C.jsx)(Jt.Provider,{value:null,children:t.place?(0,C.jsx)(ea,{context:e,place:t.place}):(0,C.jsx)(Di,{context:e,kind:t.kind})}):null}),u.length===0?(0,C.jsx)("span",{"data-testid":"picture-empty",style:{position:"absolute",inset:0,display:"grid",placeContent:"center",justifyItems:"center",gap:2,padding:20,textAlign:"center"},children:(0,C.jsxs)("span",{style:{display:"grid",gap:2,padding:"10px 16px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:[(0,C.jsxs)("span",{style:{fontFamily:_n,fontWeight:"var(--graview-weight-display)"},children:["No ",z(a,t.kind).toLowerCase()," yet"]}),p?(0,C.jsxs)("span",{style:A,children:["Begin with \u201C",p.label,"\u201D"]}):null]})}):null]}),(0,C.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,C.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[w?null:(0,C.jsx)(ge,{kind:t.kind,brand:r,schema:a.schema,size:8}),(0,C.jsx)("span",{style:{fontFamily:_n,fontSize:n?"var(--graview-text-body)":"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:t.title})]}),(0,C.jsxs)("span",{style:A,children:[t.place?Xn(a,an(e,t.place),t.place.across):Xn(a,t.kind),!w&&k?.description?` \xB7 ${k.description}`:null]})]})]})}var Mo={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},qi={display:"grid",gap:"20px 16px",gridTemplateColumns:"repeat(auto-fill, minmax(clamp(140px, 22%, 260px), 1fr))"},ji=`
|
|
2
|
-
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
3
|
-
.graview-gallery-card:hover > span:first-child,
|
|
4
|
-
.graview-gallery-card:focus-visible > span:first-child { border-color: var(--graview-edge-bright); box-shadow: 0 1px 0 var(--graview-edge), 0 10px 30px -18px var(--graview-ink); }
|
|
5
|
-
`;function rn({context:e,small:t=!1}){ne(e.store);let n=ta(e);return n.length===0?null:(0,C.jsxs)("section",{style:t?qi:Mo,"data-testid":"gallery",...t?{"data-small":""}:{},children:[(0,C.jsx)("style",{children:ji}),n.map(a=>(0,C.jsx)(na,{context:e,entry:a,small:t},a.key))]})}function aa({context:e}){let{store:t}=e;ne(t);let n=Mn(He(e)).filter(r=>!r.hidden),a=ta(e);return(0,C.jsxs)(le,{context:e,style:gt,children:[(0,C.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,C.jsx)("p",{style:Se,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,C.jsx)(de,{context:e,children:"Pictures"}),(0,C.jsx)("p",{style:ie,children:n.length===0?"Nothing here has a picture of its own yet, so each kind is drawn as the scene draws it. Title a group view and it appears here by name.":"The ways this installation looks at what it holds \u2014 each one the same picture the scene shows, here as a page."})]}),a.length>0?(0,C.jsx)("div",{style:Mo,"data-testid":"places",children:a.map(r=>(0,C.jsx)(na,{context:e,entry:r},r.key))}):null]})}var Vi={lede:!0},Ui={lede:!1},_i={...ie,textWrap:"pretty"};function zi(e,t){if(t===void 0)return;let[n]=xr(kr([t]),Ar(e.store,null,null,e.brand?{money:e.brand}:{}));return n?.t==="headline"&&!n.problem&&n.text.trim()!==""?n.text:void 0}function ra({context:e}){let{store:t,principal:n}=e;ne(t);let a=_e(),r=qe(),[o]=ft(),i=decodeURIComponent(a.as??""),[s,l]=(0,je.useState)(null),c=o.get("of"),u=o.get("filter"),p=He(e).find(T=>T.as===i&&(!c||V(t.schema,T.kind)===c));if(!p)return(0,C.jsxs)(le,{context:e,children:[(0,C.jsx)(de,{context:e,children:"No picture is called that."}),(0,C.jsx)("p",{style:ie,children:(0,C.jsx)(F,{to:"/places",style:We,children:(0,C.jsx)(Ke,{children:"The pictures there are"})})})]});let w=z(t,p.kind),R=e.views?.resolve(p.kind,{cardinality:"many",fidelity:"full"},p.as)?.view,f=R?.flows===!0,x=R?.ownHeading===!0,O=R?.creates!==!1,D=zi(e,R?.lede),g=tt(t,p.kind,{...n?{principal:n}:{},...e.invariantContext?{context:e.invariantContext}:{}}),N=O?g.actions.affordances.map(T=>({affordance:T,mutation:t.allMutations().find(E=>E.name===T.mutation)})).filter(T=>T.mutation!==void 0):[];return(0,C.jsxs)(le,{context:e,style:{...gt,gap:"var(--graview-space-6, 32px)"},children:[(0,C.jsxs)("header",{style:{display:"grid",gap:"var(--graview-space-2, 8px)"},children:[(0,C.jsx)(ht,{context:e}),(0,C.jsx)(de,{context:e,unseen:x,children:p.title}),x?null:(0,C.jsx)("p",{style:_i,"data-testid":"place-lede",...D!==void 0?{"data-graview-lede":"headline"}:{},children:D??`${Xn(t,an(e,p),p.across)}.`}),u&&!f?(0,C.jsxs)("p",{style:{...A,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${u.split(",").map(T=>T.replace(":"," is ")).join(" and ")}. `,(0,C.jsx)(F,{to:`?${(()=>{let T=new URLSearchParams(o);return T.delete("filter"),T.toString()})()}`,style:{...U,...A},children:"Show all"})]}):null,(0,C.jsx)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:an(e,p).map((T,E)=>(0,C.jsx)(F,{to:`/${V(t.schema,T)}`,style:{...We,...A},...E===0?{"data-testid":"place-as-list"}:{},children:(0,C.jsxs)(Ke,{children:["All ",(T===p.kind?w:z(t,T)).toLowerCase()," as a list"]})},T))})]}),(0,C.jsx)("div",{"data-testid":"place-lens","data-flows":f?"":void 0,...f?{}:{role:"group","aria-label":p.title,tabIndex:0},style:f?{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"}:{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},onClick:T=>{let E=T.target?.closest("[data-graview-pick]"),re=E?.getAttribute("data-graview-pick"),te=E?.getAttribute("data-graview-joins");if(te)try{let Ae=JSON.parse(te);if(Array.isArray(Ae)&&Ae.every(Fe=>typeof Fe=="string")){T.preventDefault(),l({at:at(p),ids:Ae});return}}catch{}if(!re)return;let Q=t.graph.getNode(re);Q&&(T.preventDefault(),r(Y(t.schema,Q.kind,re)))},children:(0,C.jsx)(ao.Provider,{value:D!==void 0?Vi:Ui,children:(0,C.jsx)(ea,{context:e,place:p,filter:u,...s?.at===at(p)?{chosen:s.ids}:{}})})}),N.length>0?(0,C.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:N.map(({affordance:T,mutation:E})=>(0,C.jsxs)("section",{style:{...se,display:"grid",gap:14},children:[(0,C.jsx)("h2",{style:ee,children:E.title??E.name}),E.description?(0,C.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:E.description}):null,(0,C.jsx)(Le,{store:t,mutation:E,prefilled:T.args,open:T.open,label:T.label,...n?{principal:n}:{}})]},T.id))}):null]})}function Ji(e,t=document){let n=Qt(e);if(!n)return null;let a=[t,...[...t.querySelectorAll("[data-worker-view]")].flatMap(r=>r.shadowRoot?[r.shadowRoot]:[])];for(let r of a)for(let o of r.querySelectorAll("[id], [data-section]")){let i=o.getAttribute("data-section")??o.id;if(i===e||Qt(i)===n)return o}for(let r of a)for(let o of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(Qt(o.textContent??"")===n)return o;return null}function Oo(e,t={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=t.frames??120,a=0,r=()=>{let o=Ji(e,t.root??document);if(o){o.hasAttribute("tabindex")||o.setAttribute("tabindex","-1"),o.scrollIntoView?.({block:"start"}),o.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(r))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(r)}),()=>cancelAnimationFrame(a)}var q=H(ve(),1);var on=H(ve(),1);var rt=H(j(),1);function $o({context:e}){return ce()?(0,rt.jsxs)(rt.Fragment,{children:[(0,rt.jsx)(Yi,{context:e}),(0,rt.jsx)(so,{face:"pages",on:e.quickAsk??!0})]}):null}function Yi({context:e}){let{store:t}=e,n=ce(),{pathname:a}=ye(),r=(0,on.useRef)(n?.setSelection);return r.current=n?.setSelection,(0,on.useEffect)(()=>{let o=r.current;if(!o)return;let[,i,s]=a.split("/"),l=(()=>{if(i==="places"){let u=e.views?.places().find(k=>k.as===decodeURIComponent(s??""));return u?[De(u.kind)]:[]}let c=i?ke(t.schema,i):void 0;return c&&s?[decodeURIComponent(s)]:c?[Ya(c)]:[]})();o(c=>c.length===l.length&&c.every((u,k)=>u===l[k])?c:l)},[a]),null}var xe=H(ve(),1);var Fo=H(Ai(),1);var me=H(j(),1);var Qi=Wt(Ja(()=>(__graviewPreload(import.meta.url,["./chunk.FTW3K3G6.js","./chunk.UGFDSE37.js","./chunk.QBMIET7P.js","./chunk.WVKXELAF.js","./chunk.ZOW7AC7U.js","./chunk.INBHY3SA.js","./chunk.TDV7JGIQ.js","./chunk.RZQKCLTW.js","./chunk.Y3BEKXYB.js","./chunk.NDLQXQV2.js","./chunk.WUFCRE7O.js","./chunk.XEHLSKHP.js","./chunk.MSM6E6JK.js","./chunk.YGZGMRDC.js","./chunk.6ZJE5M2A.js","./chunk.2SWQI4HF.js","./chunk.QIAH7HHO.js","./chunk.DNJM6WQO.js","./chunk.LEPKPNPA.js","./chunk.5D6SIBOK.js","./chunk.UE5GAP67.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.HUABTCQE.js","./chunk.DXJFAAOI.js","./chunk.5MSNKSTE.js","./chunk.KVQZ5FR6.js","./chunk.2HANQ737.js","./chunk.H536YUAZ.js","./chunk.GZHZLJBF.js","./chunk.OL2N5NUV.js","./chunk.OJGHDWI6.js","./chunk.5DPFAVCZ.js","./chunk.5EZDXWOE.js","./chunk.MIQMPOWF.js","./chunk.T66UK7PQ.js","./chunk.LMXNHBGH.js","./chunk.DBCVZGCC.js","./chunk.WSMYFEGU.js","./chunk.SDO3U72B.js","./chunk.WR63RQGU.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.2KH2LWZL.js")).then(e=>({default:e.TakeBack}))));function Zi({context:e,docked:t,at:n,...a}){let{store:r}=e,o=ne(r),[i]=(0,xe.useState)(()=>r.batches().length),s=(0,xe.useRef)(!1);return s.current||=o>0||!t&&i>0,s.current?(0,me.jsx)(xe.Suspense,{fallback:null,children:(0,me.jsx)(Qi,{context:e,docked:t,at:n,since:i,...a})}):null}function Xi(e,t,n){let{store:a,principal:r,embedded:o}=e;(0,xe.useEffect)(()=>{if(!n)return;let i=s=>{if(!fo(s))return;let l=s.target,c=l instanceof Node&&t.current?.contains(l),u=l===document.body||l===document.documentElement||l===document;if(!(!c&&!(u&&!o))&&go(a,r)){s.preventDefault();try{mo(a,r)}catch{}}};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[a,r,o,t,n])}function Io({context:e,registry:t,root:n,children:a}){let r=(0,xe.useMemo)(Ao,[]),o=t?.without()??new Set;return Xi(e,n,!o.has("undo")),(0,me.jsxs)(Pt.Provider,{value:r,children:[(0,me.jsx)(es,{context:e,placed:r,without:o}),a]})}function es({context:e,placed:t,without:n}){let[a,r]=(0,xe.useState)(!1);(0,xe.useLayoutEffect)(()=>r(!0),[]);let o=At(t,"find"),i=At(t,"undo"),s=ye(),l=Kr();if(!a)return null;let c=s.pathname.split("/").filter(Boolean),k=(c.length===1?ke(e.store.schema,c[0]):void 0)!==void 0;return(0,me.jsxs)(me.Fragment,{children:[!o&&!n.has("find")&&l?(0,Fo.createPortal)((0,me.jsx)(Ho,{context:e,narrowsLists:k}),l.slot):null,!o&&!n.has("find")&&!l?(0,me.jsx)("div",{"data-testid":"face-find-bar",style:{display:"flex",alignItems:"center",padding:"8px 16px",borderBottom:"1px solid var(--graview-edge)",background:"var(--graview-bar)",minWidth:0},children:(0,me.jsx)(Ho,{context:e,narrowsLists:k})}):null,!i&&!n.has("undo")?(0,me.jsx)(Zi,{context:e,docked:!0,at:s.pathname+s.search}):null,l?.own&&!n.has("undo")?(0,me.jsx)(vo,{context:e,own:l.own}):null]})}function Ho({context:e,narrowsLists:t}){return(0,me.jsx)(Pt.Provider,{value:null,children:(0,me.jsx)(Qn,{context:e,narrowsLists:t})})}var ae=H(ve(),1);var Pe=H(j(),1),ts=500,ns=10;function sn(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function as(e){let t=typeof getSelection=="function"?getSelection():null;return t!==null&&!t.isCollapsed&&t.containsNode(e,!0)}function Do(e){let t=e.closest('a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])');if(t)return t;let n=document.activeElement;return n instanceof HTMLElement&&n!==document.body?n:null}function Wo({context:e,root:t,children:n}){return ce()===null?(0,Pe.jsx)(Pe.Fragment,{children:n}):(0,Pe.jsx)(rs,{context:e,root:t,children:n})}function rs({context:e,root:t,children:n}){let{setMenuAt:a}=nr(),{store:r}=e,o=r.schema,i=qe(),{pathname:s,search:l}=ye(),c=et("/").replace(/\/$/,""),u=(0,ae.useCallback)((b,S)=>e.views?.places().find(L=>L.as===b&&(S===null||L.kind===S)),[e.views]),k=(0,ae.useCallback)((b,S)=>{let[L="",I,Z]=b.split("/").filter(Boolean).map(m=>{try{return decodeURIComponent(m)}catch{return m}});if(Z!==void 0)return null;if(L==="places"&&I!==void 0){let m=u(I,new URLSearchParams(S).get("of"));return m?{face:"pages",place:m.as,about:[De(m.kind)],title:m.title}:null}let X=ke(o,L);return X?I===void 0?{face:"pages",about:[De(X)],title:Ue(o,X)}:r.graph.getNode(I)?{face:"pages",on:I,about:[I]}:null:null},[o,r,u]),p=(0,ae.useCallback)(b=>{let S=b.href;try{let L=new URL(S,location.href);if(L.origin===location.origin&&(c===""||L.pathname===c||L.pathname.startsWith(`${c}/`))){let I=k(L.pathname.slice(c.length),L.search);if(I)return{...I,href:S}}}catch{}return{face:"pages",about:[],href:S}},[c,k]),w=(0,ae.useCallback)(()=>k(s,l)??{face:"pages",about:[]},[k,s,l]),R=(0,ae.useCallback)(b=>{let S=w(),L=b.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(L&&S.on!==void 0&&b.closest("[data-graview-pick], a[href]")===null)return{...S,field:L};let I=b.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(I)return{...S,act:I};let Z=b.closest("a[href]"),X=b.closest("[data-graview-listed]"),m=[b.closest("[data-graview-pick]")?.getAttribute("data-graview-pick"),X&&(!Z||X.contains(Z)&&Z.classList.contains("graview-spec-item-link"))?X.getAttribute("data-graview-listed"):null].map(J=>J?r.graph.getNode(J):void 0).find(Boolean);if(m)return{face:"pages",on:m.id,about:[m.id],href:`${c}${Y(o,m.kind,m.id)}`};if(Z)return p(Z);let M=b.closest("[data-graview-record]")?.getAttribute("data-graview-record");return M&&r.graph.getNode(M)?{face:"pages",on:M,about:[M]}:S},[w,p,r,o,c]),f=(0,ae.useCallback)(b=>{let S=t.current;if(S===null||!S.contains(b)||sn(b)||b.closest("[data-graview-popover]"))return null;let L=R(b);return{face:"pages",on:L.on,about:L.about??[],field:L.field,place:L.place,href:L.href,act:L.act,element:Do(b)}},[R,t]),x=(0,ae.useCallback)((b,S,L)=>{let I=R(b);a({...I,x:Math.round(S),y:Math.round(L),returnTo:Do(b)})},[R,a]),O=(0,ae.useCallback)(b=>{let S=b.getBoundingClientRect();x(b,S.left+Math.min(16,S.width/2),Math.min(S.bottom,S.top+36))},[x]),D=(0,ae.useRef)(0),g=(0,ae.useRef)(null),N=(0,ae.useRef)(!1),T=()=>{g.current&&clearTimeout(g.current.timer),g.current=null};(0,ae.useEffect)(()=>T,[]),(0,ae.useEffect)(()=>{let b=S=>{if(S.defaultPrevented||!(S.key==="ContextMenu"||S.key==="F10"&&S.shiftKey))return;let L=t.current,I=S.target instanceof Element?S.target:null,Z=I===null||I===document.body||I===document.documentElement,X=L!==null&&I!==null&&L.contains(I);if(!X&&!(Z&&document.querySelector("[data-graview-face='pages']")===L)||sn(I)||I?.closest("[data-graview-popover]"))return;S.preventDefault(),D.current=Date.now();let m=X&&I instanceof HTMLElement?I:L?.querySelector("[data-graview-page-title], main h1, main")??null;m&&O(m)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[t,O]),(0,ae.useEffect)(()=>{let b=t.current;if(!b)return;let S=L=>{let I=L.detail;I&&a({...I,face:"pages"})};return b.addEventListener(Fn,S),()=>b.removeEventListener(Fn,S)},[t,a]);let E=(0,ae.useMemo)(()=>b=>{if(b.face!=="pages")return null;let S=[],L=b.on===void 0?void 0:r.graph.getNode(b.on),I=b.place===void 0?void 0:e.views?.places().find(pe=>pe.as===b.place),Z=L?void 0:b.about.length===1&&b.about[0].startsWith("aggregate:")&&!I?os(b.about[0]):void 0,X=L?Y(o,L.kind,L.id):I?he(e,I):Z?`/${V(o,Z)}`:void 0,m=X!==void 0&&s===X.split("?")[0];X!==void 0&&!m&&S.push({id:"open",label:"Open",run:()=>i(X)});let M=X!==void 0?`${c}${X}`:b.href;M!==void 0&&S.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(M,"_blank","noopener")});let J=L?`#focus=${encodeURIComponent(L.id)}`:I?`#focus=${encodeURIComponent(De(I.kind))}&view=${encodeURIComponent(I.as)}`:Z?`#focus=${encodeURIComponent(De(Z))}`:void 0;if(J!==void 0&&(e.overview||!e.embedded)){let pe=e.overview;S.push({id:"in-the-scene",label:"Show in the scene",run:()=>pe?pe(J):location.assign(`${e.sceneHref??"/"}${J}`)})}return L===void 0&&b.href===void 0&&S.push({id:"find",label:"Find\u2026",run:()=>{let pe=t.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');pe&&pe.offsetParent!==null?pe.focus():i("/search")}}),S.length>0?{id:"pages",items:S}:null},[r,o,e,s,c,i,t]),re=(0,ae.useMemo)(()=>b=>{if(b.face!=="pages"||b.field===void 0||b.on===void 0)return null;let S=r.graph.getNode(b.on),L=b.element?.closest("[data-graview-field]")??t.current?.querySelector(`[data-graview-field="${CSS.escape(b.field)}"]`);return!S||!(L instanceof HTMLElement)||!L.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${Ea(o.tryDefinition(S.kind),b.field)}\u201D`,run:()=>L.click()}]}},[r,o,t]),te=co(),Q=Er(),Ae=Jr(),Fe=(0,ae.useCallback)((b,S)=>{s===he(e,b).split("?")[0]&&i(S?he(e,S):"/")},[s,e,i]),Ce=uo(Fe),Re=(0,ae.useMemo)(()=>[re,Ae,E,...Ce?[Ce]:[],...Q?[Q]:[],...te?[te]:[]],[re,Ae,E,Ce,Q,te]);return(0,Pe.jsxs)(Cr,{sections:Re,children:[(0,Pe.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:b=>{let S=b.target;b.shiftKey||sn(S)||as(S)||(b.preventDefault(),!S.closest("[data-graview-popover]")&&(Date.now()-D.current<700||(b.clientX===0&&b.clientY===0&&S instanceof HTMLElement?O(S):x(S,b.clientX,b.clientY))))},onPointerDown:b=>{if(N.current=!1,b.pointerType==="mouse"||!b.isPrimary)return;let S=b.target;if(sn(S)||S.closest("[data-graview-choose], [data-graview-popover]"))return;T();let{clientX:L,clientY:I}=b;g.current={x:L,y:I,timer:setTimeout(()=>{g.current=null,N.current=!0,D.current=Date.now(),x(S,L,I)},ts)}},onPointerMove:b=>{let S=g.current;S&&Math.hypot(b.clientX-S.x,b.clientY-S.y)>ns&&T()},onPointerUp:T,onPointerCancel:T,onClickCapture:b=>{N.current&&(N.current=!1,b.preventDefault(),b.stopPropagation())},children:n}),(0,Pe.jsx)(is,{openAt:O,readyAt:f}),(0,Pe.jsx)(po,{placement:"page"}),(0,Pe.jsx)(Nr,{})]})}function os(e){let t=e.slice(10).split("+");return t.length===1&&t[0]?t[0]:void 0}function is({openAt:e,readyAt:t}){return(0,Pe.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:n=>{if(n.target!==n.currentTarget)return;let a=n.currentTarget.closest("[data-graview-face]"),r=a?.querySelector("[data-graview-page-title]")??a?.querySelector("main h1, main")??null;r&&(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,Pe.jsx)(io,{placement:"menu",openActs:e,aimAt:t})})}var K=H(j(),1);function Go(e,t){return t==="*"?{label:"anything",path:null}:{label:z(e,t),path:`/${V(e.schema,t)}`}}function ss({context:e,relation:t}){let{store:n}=e,a=Go(n,t.from),r=Go(n,t.to),o=i=>i.path?(0,K.jsx)(F,{to:i.path,style:{...be,fontWeight:550},children:i.label}):(0,K.jsx)("span",{children:i.label});return(0,K.jsxs)("li",{"data-testid":"relation","data-relation":t.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,K.jsx)(lo,{edgeKind:t.edgeKind,...e.brand?.kit?{kit:e.brand.kit}:{}}),(0,K.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,K.jsxs)("span",{children:[o(a)," ",(0,K.jsxs)("span",{style:A,"data-graview-speaks-ids":"",children:[Qe(t.edgeKind)," \u2192"]})," ",o(r)]}),t.description||t.inverse?(0,K.jsxs)("span",{style:A,children:[t.description?Te(t.description):null,t.description&&t.inverse?" \xB7 ":null,t.inverse?`from the other end, ${t.inverse}`:null]}):null]}),r.path?(0,K.jsx)(F,{to:`${r.path}?with=${encodeURIComponent(t.edgeKind)}`,style:{...U,...A,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${r.label.toLowerCase()} that have this`,children:t.count}):(0,K.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:t.count})]})}function Bo({context:e,heading:t=!0}){let{store:n}=e,a=new Set(Ge(n,e.principal)),r=nt(n).relations.filter(o=>a.has(o.from)&&(o.to==="*"||a.has(o.to)));return r.length===0?null:(0,K.jsxs)("section",{style:{...se,display:"grid",gap:12},"data-testid":"kind-map",children:[t?(0,K.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,K.jsx)("h2",{style:ee,children:(0,K.jsx)(F,{to:"/map",style:be,children:"Connections"})}),(0,K.jsx)("span",{style:A,children:r.length===1?"1 relation":`${r.length} relations`})]}):null,(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:r.map(o=>(0,K.jsx)(ss,{context:e,relation:o},`${o.edgeKind}|${o.from}|${o.to}`))})]})}function oa({context:e}){let{store:t}=e;ne(t);let n=new Set(Ge(t,e.principal)),a=nt(t),r=a.relations.filter(o=>n.has(o.from));return(0,K.jsxs)(le,{context:e,children:[(0,K.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,K.jsx)("p",{style:Se,children:r.length===0?"No relations":`${r.length} ${r.length===1?"relation":"relations"}`}),(0,K.jsx)(de,{context:e,children:"Connections"}),(0,K.jsx)("p",{style:ie,children:r.length===0?"Nothing here is declared to relate to anything else yet.":"The kinds this installation holds, and the relations declared between them \u2014 each in the declaration's own words, with how many of it there are."})]}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(o=>n.has(o.kind)).map(o=>(0,K.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,K.jsx)(ge,{kind:o.kind,brand:e.brand,schema:t.schema,size:7}),(0,K.jsx)(F,{to:`/${V(t.schema,o.kind)}`,style:U,children:o.plural}),(0,K.jsx)("span",{style:A,children:o.count})]},o.kind))}),(0,K.jsx)(Bo,{context:e,heading:!1})]})}function Ko({context:e}){let n=[...ce()?.robots.values()??[]].filter(r=>r.mode==="asking"&&r.say);if(n.length===0)return null;let{store:a}=e;return(0,K.jsxs)("section",{style:{...se,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,K.jsx)("h2",{style:ee,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(r=>{let o=r.at?a.graph.getNode(r.at):void 0;return(0,K.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,K.jsx)("span",{children:r.say}),o?(0,K.jsxs)(F,{to:Y(a.schema,o.kind,o.id),style:{...U,...A},children:[oe(a.schema.tryDefinition(o.kind),o)," \u2192"]}):null]},r.participant)})})]})}function jo(e){let t=new Set(e.schema.kinds);return(Array.isArray(e.purpose?.jobs)?e.purpose.jobs:[]).flatMap(a=>{if(typeof a!="object"||a===null||typeof a.name!="string"||typeof a.ask!="string"||!t.has(a.kind))return[];let r=Nn(a.sort);return[{name:a.name,ask:a.ask,kind:a.kind,plural:Ta(e.schema,a.kind),...a.where!==void 0?{where:a.where}:{},...r?{sort:r}:{},...a.act!==void 0?{act:a.act}:{},...a.roles&&a.roles.length>0?{roles:[...a.roles]}:{}}]})}function Vo(e,t){return e.filter(n=>Mr(n,t.roles))}var ln=new Map;function qo(e){if(!ln.has(e))try{ln.set(e,za(e))}catch(t){if(!(t instanceof _a))throw t;ln.set(e,null)}return ln.get(e)}var ls=e=>e instanceof $n?e.nodes.length>0:Array.isArray(e)?e.length>0:!!e,ds=(e,t)=>t instanceof $n?t.nodes.length:t!==null&&typeof t=="object"&&!Array.isArray(t)?oe(e.tryDefinition(t.kind),t):t;function Uo(e,t,n){let a=e;if(a.kindsKeptFrom(n).has(t.kind)||!a.schema.tryDefinition(t.kind))return{count:0,ids:[]};let r=a.seenBy(n),o=r.graph,i=r.schema,s=Pr(i),l=r.today?.(),c=(x,O)=>Ua(x,{graph:o,subject:O,kinds:s,...l?{today:l}:{}}),u=t.where===void 0?void 0:qo(t.where);if(u===null)return{count:0,ids:[]};let k=o.nodesOfKind(t.kind).filter(x=>{if(!u)return!0;try{return ls(c(u,x))}catch(O){if(!(O instanceof Hn))throw O;return!1}}),p=Nn(t.sort),w=p&&p.by!=="label"?qo(p.by):void 0,f=(p?Ga(k,p,x=>{if(p.by==="label")return oe(i.tryDefinition(x.kind),x);if(w)try{return ds(i,c(w,x))}catch(O){if(!(O instanceof Hn))throw O;return}}):k).map(x=>x.id);return{count:f.length,ids:f}}var dn=H(ve(),1);var _=H(j(),1),cs=5,ps=3,zo={kind:"human"};function Jo(e){if(!e.app)return[];let t=e.principal??zo;return Vo(jo(e.app),t).map(n=>({job:n,...Uo(e.store,n,t)}))}function Yo({context:e,answered:t}){let n=t.filter(i=>i.count>0),a=t.filter(i=>i.count===0),[r,...o]=n;return(0,_.jsxs)("div",{style:{display:"grid",gap:40,maxWidth:"46rem",outline:"none"},"data-testid":"jobs",tabIndex:-1,children:[(0,_.jsx)("style",{children:mt}),r?(0,_.jsx)(_o,{context:e,answered:r,leads:!0}):null,o.map(i=>(0,_.jsx)(_o,{context:e,answered:i},i.job.name)),a.length>0?(0,_.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"jobs-quiet",children:a.map(({job:i})=>(0,_.jsxs)("li",{"data-testid":"job-quiet","data-job":i.name,style:{overflowWrap:"anywhere"},children:[i.ask," ",(0,_.jsxs)("span",{style:A,children:["No ",z(e.store,i.kind).toLowerCase()," right now."]})]},i.name))}):null]})}function _o({context:e,answered:t,leads:n=!1}){let{store:a}=e,{job:r,count:o,ids:i}=t,s=i.slice(0,n?cs:ps),l=z(a,r.kind),c=n?(0,_.jsx)(de,{context:e,"data-testid":"job-ask",children:r.ask}):(0,_.jsx)("h2",{style:ee,"data-testid":"job-ask",children:r.ask});return(0,_.jsxs)("section",{className:"graview-list",style:{display:"grid",gap:n?12:8,minWidth:0},"data-testid":"job","data-job":r.name,...n?{"data-leads":""}:{},children:[(0,_.jsxs)("header",{style:{display:"grid",gap:4},children:[c,(0,_.jsx)("p",{style:{...n?ie:A,margin:0},"data-testid":"job-count",children:dt(a.schema,r.kind,o)})]}),(0,_.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",borderBottom:"1px solid var(--graview-edge)"},"data-testid":"job-rows",children:s.map(u=>(0,_.jsx)(us,{context:e,job:r,id:u},u))}),(0,_.jsxs)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",gap:"0 12px",alignItems:"baseline"},children:[o>s.length?(0,_.jsxs)("span",{"data-testid":"job-more",children:[o-s.length," more"]}):null,(0,_.jsx)(F,{to:`/${V(a.schema,r.kind)}`,style:We,"data-testid":"job-all",children:(0,_.jsxs)(Ke,{children:["All ",l.toLowerCase()]})})]})]})}function us({context:e,job:t,id:n}){let{store:a,principal:r,invariantContext:o}=e,[i,s]=(0,dn.useState)(!1),l=(0,dn.useRef)(null),c=a.seenBy(r??zo).graph.getNode(n);if(!c)return null;let u=a.schema.tryDefinition(c.kind),k=oe(u,c),p=kt(c,u,k),w=t.act?nn(a,n,{...r?{principal:r}:{},...o?{context:o}:{}})?.actions.affordances.find(x=>x.mutation===t.act&&x.provider!=="invariant"):void 0,R=w?a.allMutations().find(x=>x.name===w.mutation):void 0,f=`job-${t.name}-${n}`;return(0,_.jsxs)("li",{ref:l,"data-testid":"job-row","data-graview-record":n,style:{position:"relative",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"center",gap:"8px 12px",minHeight:"2.75rem",padding:"8px 0",borderTop:"1px solid var(--graview-edge)"},children:[(0,_.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,_.jsx)(F,{to:Y(a.schema,c.kind,n),className:"graview-row-title",...k.length>60?{title:k}:{},children:k}),p.length>0?(0,_.jsx)("span",{className:"graview-row-glance",children:(0,_.jsx)(xt,{runs:p})}):null]}),w&&R?(0,_.jsx)("button",{type:"button","data-testid":"job-act","data-graview-act":w.mutation,"aria-expanded":i,"aria-controls":f,"aria-label":`${w.label}: ${k}`,onClick:()=>s(!i),style:{...fe,position:"relative",...i?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:w.label}):null,i&&w&&R?(0,_.jsx)("div",{id:f,style:{gridColumn:"1 / -1",position:"relative",display:"grid",gap:10,padding:"4px 0 8px"},children:(0,_.jsx)(Le,{store:a,mutation:R,prefilled:w.args,open:w.open,label:w.label,autoFocus:!0,onDone:()=>{let x=l.current?.closest('[data-testid="jobs"]');s(!1),requestAnimationFrame(()=>{((l.current?.isConnected?l.current.querySelector('[data-testid="job-act"]'):null)??x?.querySelector('[data-testid="job-act"]')??x)?.focus()})},...r?{principal:r}:{}})}):null]})}var W=H(j(),1);function ia({context:e}){let{principal:t}=e,{store:n,brand:a,invariantContext:r}=e;ne(n);let o=n.violations(r),i=`${o.length===1?"A rule is broken":"Rules are broken"} \u2014 see what, and what would fix it`,s=[...n.log.all()].slice(-5).reverse(),c=en(e).map(g=>({kind:g,members:n.graph.nodesOfKind(g).filter(N=>lt(n.schema.tryDefinition(g),N))})),u=c.filter(g=>g.members.length>0),k=c.map(g=>({entry:g,creator:n.allMutations().find(N=>(N.creates??[]).includes(g.kind)&&n.permits({name:N.name,args:{}},e.principal).ok)})).find(g=>g.creator!==void 0),p=u.length===0?"Nothing here yet.":`${u.map(g=>dt(n.schema,g.kind,g.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,w=e.views?.homeView?.(),R=n.schema.kinds.some(g=>n.graph.nodesOfKind(g).length>0);if(w&&R){let g=a?.subtitle&&a.subtitleDrawn!==!1?(0,W.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,N=w[Symbol.for("graview.home-blocks")]===!0;return(0,W.jsx)(le,{context:e,style:gt,children:(0,W.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[N?null:g,o.length>0?(0,W.jsx)(F,{to:"/problems",style:{...U,color:"var(--graview-warn)"},children:i}):null,(0,W.jsx)(no.Provider,{value:N?g:null,children:(0,W.jsx)(yt,{when:pt(w),children:(0,W.jsx)(w,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})})]})})}let f=new Set(Ge(n,e.principal)),x=nt(n).relations.filter(g=>f.has(g.from)&&(g.to==="*"||f.has(g.to))),O=Jo(e),D=O.some(g=>g.count>0);return(0,W.jsxs)(le,{context:e,style:gt,children:[(0,W.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle&&a.subtitleDrawn!==!1?(0,W.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,D?null:(0,W.jsx)(de,{context:e,"data-testid":"standing",children:p}),D&&o.length===0?null:(0,W.jsxs)("p",{style:{...ie,display:"grid",gap:4},"data-testid":"standing-card",children:[u.length===0&&k?(0,W.jsxs)("span",{children:["Begin with \u201C",k.creator?.title??k.creator?.name,"\u201D, under"," ",(0,W.jsx)(F,{to:`/${V(n.schema,k.entry.kind)}`,style:U,children:z(n,k.entry.kind)}),"."]}):null,o.length===0?(0,W.jsx)("span",{children:"All rules hold."}):(0,W.jsx)(F,{to:"/problems",style:{...U,color:"var(--graview-warn)"},children:i})]})]}),O.length>0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Yo,{context:e,answered:O}),(0,W.jsxs)("section",{style:{display:"grid",gap:20},"data-testid":"after-the-jobs",children:[D?(0,W.jsxs)("p",{style:{...A,margin:0},"data-testid":"standing",children:[p,o.length===0?" All rules hold.":""]}):null,(0,W.jsx)(rn,{context:e,small:!0})]})]}):(0,W.jsx)(rn,{context:e}),(0,W.jsxs)("section",{style:{...se,display:"grid",gap:14},"data-testid":"kinds",children:[(0,W.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,W.jsx)("h2",{style:ee,children:"What is here"}),x.length>0?(0,W.jsx)(F,{to:"/map",style:{...We,...A,marginLeft:"auto"},"data-testid":"map-link",children:(0,W.jsxs)(Ke,{children:["Connections \xB7 ",x.length===1?"1 relation":`${x.length} relations`]})}):null]}),(0,W.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:c.map(({kind:g,members:N})=>(0,W.jsx)("li",{style:{maxWidth:"100%"},children:(0,W.jsxs)(F,{to:`/${V(n.schema,g)}`,style:{...be,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,W.jsx)(ge,{kind:g,brand:a,schema:n.schema,size:7}),(0,W.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:z(n,g)}),(0,W.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:N.length===0?"none yet":bt(N.length)})]})},g))})]}),s.length>0?(0,W.jsxs)("section",{style:{...se,display:"grid",gap:10},children:[(0,W.jsx)("h2",{style:ee,children:"Recently"}),(0,W.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:s.map(g=>(0,W.jsxs)("li",{style:A,children:[(0,W.jsx)("span",{style:{color:"var(--graview-ink)"},children:g.intent})," \u2014 ",vt(g,t,{graph:n.graph,schema:n.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},g.id))})]}):null]})}var Qo=H(ve(),1);function Zo(e,t){(0,Qo.useEffect)(()=>{let n=globalThis[Symbol.for("graview.shown-lists")]??=new Map;return n.set(e,()=>t),()=>void n.delete(e)})}var sa=e=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(t=>t.saveShownList(e.read()));function Xo(e,t,n){let a={off:e,about:t,read:n,menu:(r,o,i)=>[...e?[]:[{id:"export-csv",label:"Export CSV",run:()=>void sa(a)}],...r&&o?[{id:e?"export-on":"export-off",label:e?"Turn on export":"Turn off export",run:()=>void (__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(s=>s.switchExport(a,o,e,i))}]:[]]};return a}function la(e){let{schema:t,graph:n,kind:a,nodes:r,arrangement:o,offers:i,declaredGroup:s}=e,l=t.tryDefinition(a),c=jt(o.query??""),u=[...o.filter??[],...c.conditions],k=u.some(E=>E.key==="is"&&(E.value==="past"||E.value==="any"))||Ir(l,u),p=k||!l?.lifecycle?o:{...o,filter:[...o.filter??[],{key:"is",value:"current"}]},w=new Map,R=Ut(r,p,{schema:t,graph:n,...e.flagged?{flagged:e.flagged}:{},...e.today!==void 0?{today:e.today}:{},read:(E,re)=>{let te=w.get(E.id);return te||w.set(E.id,te=Xe(t,n,E)),te[re]}}),f=R.grouped&&!!o.group?.by,x=s&&o.group?.by===s.by&&!o.group.bucket?i.groups.find(E=>E.key===s.by):void 0,O=s&&x&&(x.type==="choice"||x.type==="boolean")?Fr(R.groups,s,{type:x.type,...x.options?{options:x.options}:{}}):R.groups.map(E=>({...E,closed:!1})),D=!!o.query||(o.filter??[]).some(E=>E.key===s?.by),g=E=>x?.type==="boolean"?E==="1"?"true":"false":E,N=e.opened??new Set,T=O.map(E=>{let re=g(E.key);return{...E,value:re,shut:E.closed&&!D&&!N.has(re)}});return{arrangement:p,showingPast:k,arranged:R,grouped:f,groups:T,nodes:f?T.flatMap(E=>E.shut?[]:E.nodes):R.nodes}}var Me=H(ve(),1);var ot=H(j(),1);function cn({context:e,withheld:t,style:n,testId:a}){let r=ce(),o=Wa(t,e.signIn??r?.signIn);return o?(0,ot.jsx)("p",{style:{...n,margin:0},children:(0,ot.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>o.run(),style:fe,children:o.label})}):t.length===0?null:(0,ot.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:t.map(i=>(0,ot.jsxs)("li",{style:A,children:[(0,ot.jsx)("s",{children:i.label})," \u2014 ",i.refusal.message]},i.id))})}var ei=H(ve(),1);var $=H(j(),1);function da({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;ne(t);let[o]=ft(),i=o.get("q")??"",s=typeof r?.today=="string"?r.today:void 0,l=jr(t,i,{...a?{principal:a}:{},places:He(e),flagged:new Set(t.violations(r).flatMap(f=>f.nodeIds)),...s?{today:s}:{},limit:200}),c=l.hits.filter(f=>f.about==="node"),u=l.hits.filter(f=>f.about==="kind"||f.about==="place"||f.about==="rule"),k=[...new Set(c.map(f=>f.kind))],p=i.trim(),w=p.length>=2&&l.hits.length===0,R=l.searched.kinds.length===1?l.searched.kinds[0]:void 0;return(0,ei.useEffect)(()=>{if(!w)return;let f=setTimeout(()=>Ka(t,{type:"search-miss",words:p,...R?{kind:R}:{}},a),gs);return()=>clearTimeout(f)},[t,p,w,R,a]),(0,$.jsxs)(le,{context:e,children:[(0,$.jsx)("style",{children:mt}),(0,$.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,$.jsx)("p",{style:Se,children:"Search"}),(0,$.jsx)(de,{context:e,"data-testid":"search-heading",children:p.length===0?"Find anything by its name":l.hits.length===0?(0,$.jsxs)($.Fragment,{children:["Nothing here is called \u201C",p,"\u201D."]}):(0,$.jsxs)($.Fragment,{children:[ms(t,l.byKind)," for \u201C",p,"\u201D"]})}),p.length>0?(0,$.jsxs)("p",{style:{...A,margin:0},"data-testid":"search-searched",children:[Vt(t.schema,l.searched),l.conditions.filter(f=>f.key!=="is"&&f.admittedBy.length<l.searched.kinds.length).map(f=>(0,$.jsxs)("span",{children:[" ",f.key,":",f.value," narrows"," ",f.admittedBy.length===0?"nothing here":f.admittedBy.map(x=>z(t,x).toLowerCase()).join(" and "),"."]},`${f.key}:${f.value}`))]}):(0,$.jsxs)("p",{style:ie,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,$.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,$.jsx)("code",{children:"is:any"})," includes what is past."]})]}),u.length>0?(0,$.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:u.map(f=>(0,$.jsx)("li",{"data-testid":"search-hit","data-about":f.about,children:f.about==="kind"?(0,$.jsxs)(F,{to:`/${V(t.schema,f.kind)}`,style:U,children:[f.label,f.count>0?(0,$.jsxs)("span",{style:A,children:[" \xB7 ",f.count," match"]}):null]}):f.about==="place"?(0,$.jsxs)(F,{to:he(e,f),style:U,children:["Go to ",f.title]}):f.about==="rule"?(0,$.jsxs)(F,{to:"/problems",style:U,children:["The rule \u201C",f.label,"\u201D"]}):null},`${f.about}:${f.about==="rule"?f.name:f.about==="place"?f.as:f.kind}`))}):null,k.map(f=>(0,$.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":f,children:[(0,$.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,$.jsx)(ge,{kind:f,brand:n,schema:t.schema,size:8}),(0,$.jsx)(F,{to:`/${V(t.schema,f)}?${new URLSearchParams({q:p}).toString()}`,style:U,"data-testid":"search-kind-link",children:z(t,f)}),(0,$.jsx)("span",{children:l.byKind[f]})]}),(0,$.jsx)("ul",{className:"graview-rows",children:c.filter(x=>x.kind===f).map(x=>(0,$.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,$.jsxs)(F,{to:Y(t.schema,f,x.id),className:"graview-row-title",...x.label.length>60?{title:x.label}:{},children:[x.flagged?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,x.label]}),x.apart||!x.current?(0,$.jsx)("span",{className:"graview-row-glance",children:[x.apart,x.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,$.jsx)(pn,{why:x.why})]},x.id))})]},f)),p.length>0?(0,$.jsx)(fs,{asked:p}):null,p.length>0&&l.hits.length===0?(0,$.jsx)(ni,{store:t,kinds:l.searched.kinds,words:l.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}var gs=1500;function pn({why:e}){return e.strength==="near"?(0,$.jsxs)("span",{style:A,"data-testid":"search-why","data-near":"",children:["Near \u201C",e.asked,"\u201D",e.field==="label"?"":` \u2014 ${e.reading}: ${e.fragment}`]}):e.field==="label"?null:(0,$.jsxs)("span",{style:A,"data-testid":"search-why",children:[e.reading,": ",e.fragment]})}function ms(e,t){let n=Object.entries(t).map(([a,r])=>`${r} ${r===1?Ze(e.schema.tryDefinition(a),a):z(e,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Te(n[0]):Te(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function ti(e,t,n={}){let a=[];for(let r of t){let o=tt(e,r,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let i of un(e,r,o.actions.affordances))a.some(s=>s.mutation.name===i.mutation.name)||a.push(i)}return a}function un(e,t,n){let a=e.schema.tryDefinition(t)?.fieldRoles?.label,r=[];for(let o of n){let i=e.allMutations().find(c=>c.name===o.mutation);if(!i||!i.creates?.includes(t)||r.some(c=>c.mutation.name===i.name))continue;let s=Or(i.input).map(c=>c.name),l=s.includes("label")?"label":a&&s.includes(a)?a:void 0;!l||o.args[l]!==void 0||r.push({kind:t,affordance:o,mutation:i,arg:l})}return r}function ni({store:e,kinds:t,words:n,principal:a,invariantContext:r}){let o=ti(e,t,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return o.length===0||n.trim().length===0?null:(0,$.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:o.map(({kind:i,affordance:s,mutation:l,arg:c})=>(0,$.jsxs)("section",{style:{...se,display:"grid",gap:14},children:[(0,$.jsxs)("h2",{style:ee,children:[Te(Na(Ze(e.schema.tryDefinition(i),i)))," called \u201C",n,"\u201D"]}),(0,$.jsx)(Le,{store:e,mutation:l,prefilled:s.args,open:s.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${s.id}|${n}`))})}function fs({asked:e}){let t=ce();return t?(0,$.jsx)(ys,{asked:e,desk:t.aiDesk}):null}function ys({asked:e,desk:t}){return dr(t)?(0,$.jsx)("p",{style:{margin:0},children:(0,$.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>lr(t,{pointed:{about:[]},asked:e,returnTo:a.currentTarget}),style:{...U,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",e,"\u2019"]})}):null}var y=H(j(),1),ri=8,oi=40;function hs(e,t){let n=t?.fields?.shape??{},a=Object.keys(n).find(r=>Oa(n[r])&&Ma(e[r]));return a===void 0?void 0:e[a]}function ca({context:e}){let t=_e(),n=ke(e.store.schema,t.slug??"");return n?(0,y.jsx)(ii,{context:e,kind:n}):(0,y.jsx)(le,{context:e,children:(0,y.jsx)(de,{context:e,children:"No such kind of thing here."})})}function ii({context:e,kind:t,opening:n,row:a,layout:r="list",description:o,bare:i}){let{store:s,brand:l,invariantContext:c}=e;ne(s);let[u,k]=ft(),p=`list-${(0,Me.useId)().replace(/:/g,"")}`,w=s.schema.tryDefinition(t),R=Ha(u.get("archived")),f=s.graph.nodesOfKind(t,{archived:R}),x=nt(s).relations.filter(d=>d.from===t||d.to===t),O=new Set(s.violations(c).flatMap(d=>d.nodeIds)),D=Gr(s.schema,Wr(s.schema,Dr(s.schema,t))),g=x.map(d=>d.edgeKind),N=xs(u,D,g),T=["sort","filter","group","q","by","with","past","archived",...g].some(d=>u.has(d)),E=f.length>=oi,re=w?.fieldRoles?.when,te=e.views?.arrangement?.()?.lists?.[t],Q=Hr(te),Ae=$r(te?.group),Fe=ks(E,re),Ce=n??(Q?{...Fe,...Q}:Fe),Re=T?N.arrangement:qn(Ce,D).arrangement,b=Q?.sort,S=Re.sort&&b?.then&&Re.sort.by===b.by&&Re.sort.direction===b.direction?{...Re,sort:b}:Re,L=jt(S.query??""),I=new Set((u.get("open")??"").split(",").filter(Boolean)),Z=la({schema:s.schema,graph:s.graph,kind:t,nodes:f,arrangement:S,offers:D,declaredGroup:Ae,flagged:O,...typeof c?.today=="string"?{today:c.today}:{},opened:I}),{showingPast:X,arranged:m}=Z,M=Z.groups,J=ce(),pe=Xo(te?.export===!1,{kind:t},()=>({title:z(s,t),schema:s.schema,graph:s.graph,kind:t,groups:Z.groups,grouped:Z.grouped,onExport:e.onExport??J?.onExport,words:{labelOf:oe,readableFields:Kt,withComputed:Xe}}));Zo(`list:${t}`,pe);let gi=d=>d.shut,mi=d=>{let h=new URLSearchParams(u),G=new Set(I);G.has(d)?G.delete(d):G.add(d),G.size>0?h.set("open",[...G].join(",")):h.delete("open"),k(h,{replace:!0})},Oe=m.nodes,Je=w?.lifecycle&&!X?f.filter(d=>lt(w,d)):f,ma=f.length-Je.length,fa=S.group?.by??null,fi=d=>{let h=new URLSearchParams(u);for(let ue of["sort","filter","group","q","by","with","past","archived",...x.map($t=>$t.edgeKind)])h.delete(ue);let G=Vr(d);for(let ue of["sort","filter","group","q","archived"])G[ue]&&h.set(ue,G[ue]);![...h.keys()].some(ue=>["sort","filter","group","q"].includes(ue))&&(n||Q||E||re)&&h.set("sort",""),k(h)},{principal:it}=e,yn=tt(s,t,{...it?{principal:it}:{},...e.invariantContext?{context:e.invariantContext}:{}}),Be=yn.actions.affordances.map(d=>({affordance:d,mutation:s.allMutations().find(h=>h.name===d.mutation)})).filter(d=>d.mutation!==void 0),yi=yn.actions.withheld,hn=()=>new Set(Oe.length===0?Be.map(({mutation:d})=>d.name):[]),[wn,ya]=(0,Me.useState)(()=>({kind:t,open:hn()}));wn.kind!==t&&ya({kind:t,open:hn()});let ha=d=>(wn.kind===t?wn.open:hn()).has(d),wa=(d,h)=>ya(G=>{let ue=new Set(G.open);return h?ue.add(d):ue.delete(d),{kind:G.kind,open:ue}}),Sa=`begin-${(0,Me.useId)().replace(/:/g,"")}`,ba=L.words&&Oe.length===0?Object.fromEntries(un(s,t,yn.actions.affordances).map(d=>[d.mutation.name,d.arg])):{},Ye=z(s,t),Tt=e.views?.lookup(t,{cardinality:"one",fidelity:"glyph"}),Sn=Tt!==void 0&&!ct(Tt)?Tt:void 0,bn=(S.group?.bucket??"day")==="day"?S.group?.by:void 0,vn=(S.filter??[]).map(d=>d.key),hi=vn.filter(d=>vn.indexOf(d)===vn.lastIndexOf(d)&&/choice|boolean/.test(D.filters.find(h=>h.key===d)?.type??"")),kn=d=>{let h={...w?.computed?Xe(s.schema,s.graph,d):d};bn&&!String(h[bn]).includes("T")&&delete h[bn];for(let G of hi)delete h[G];return h},va=d=>Sr(w?.fields?.shape?.[d])?.type==="enum",Et=d=>{let h=oe(w,d);if(a)return(0,y.jsxs)("li",{"data-testid":"record-row","data-graview-record":d.id,style:{minWidth:0},...Ln(d.id),children:[Rn(d,h),a(d,{label:h,href:Y(s.schema,t,d.id),flagged:O.has(d.id),glance:So(kn(d),w,h)})]},d.id);if(Sn){let Tn=Yt(Tt,d,s.graph),xi=Object.fromEntries(Object.entries(kn(d)).filter(([Pi])=>!Tn?.fields.has(Pi))),Ra=Tn?kt(xi,w,Tn.title??h,va):[];return(0,y.jsxs)("li",{"data-testid":"record-row","data-graview-record":d.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...Ln(d.id),children:[Rn(d,h),(0,y.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,y.jsx)(Sn,{node:d,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...O.has(d.id)?{flagged:[d.id]}:{}})}),Ra.length>0?(0,y.jsx)("span",{style:{...A,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:(0,y.jsx)(xt,{runs:Ra})}):null,(0,y.jsx)(Cs,{to:Y(s.schema,t,d.id),label:O.has(d.id)?`${h} \u2014 implicated in a problem`:h})]},d.id)}let G=kt(kn(d),w,h,va),ue=G.length>0,$t=L.words?qr(w,d,L.words):void 0,Aa=E?void 0:vr(d,w),Ht=hs(d,w),Ca=(0,y.jsxs)(F,{to:Y(s.schema,t,d.id),className:"graview-row-title",...h.length>60?{title:h}:{},children:[O.has(d.id)?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,h]});return(0,y.jsxs)("li",{className:"graview-row","data-graview-record":d.id,...Ln(d.id),children:[Rn(d,h),Aa?(0,y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,y.jsx)(ut,{as:"thumb",file:Aa}),Ca]}):Ca,ue||Ht?(0,y.jsxs)("span",{className:"graview-row-glance",children:[(0,y.jsx)(xt,{runs:G}),ue&&Ht?" \xB7 ":null,Ht?(0,y.jsx)(_t,{address:Ht}):null]}):null,$t?(0,y.jsx)(pn,{why:$t}):null]},d.id)},xn=He(e).filter(d=>d.kind===t&&!d.hidden),ka=te?.filters,wi=(S.filter??[]).some(d=>d.key!=="is"||d.value!=="any"),Si=!!(S.sort||S.group||S.query||wi),bi=Je.length>=ri||T&&Si,Ie=S.sort?D.sorts.find(d=>d.key===S.sort.by):void 0,Pn=Ie?.type==="date"||Ie!==void 0&&Ie.key===re,xa=E&&!m.grouped&&Ie&&(Ie.about==="label"||Ie.type==="text"||Pn)?d=>{let h=Ie.about==="label"?oe(w,d):d[Ie.key];if(typeof h!="string"||h.length===0)return Pn?"No date":"#";if(Pn)return h.slice(0,4);let G=h.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(G)?G:"#"}:void 0,Nt=xa?Oe.reduce((d,h)=>{let G=xa(h);return d.at(-1)?.key===G?d.at(-1).nodes.push(h):d.push({key:G,nodes:[h]}),d},[]):void 0,Pa=Z.nodes,An=(0,Me.useMemo)(()=>Pa.map(d=>d.id),[Pa.map(d=>d.id).join(`
|
|
6
|
-
`)]),$e=Yr(An),Cn=(0,Me.useId)(),wt=(it?s.permittedMutations(it):s.permittedMutations()).some(d=>{let h=d.subject?.kinds;return h!==void 0&&(h==="*"||h.includes(t))}),Rn=(d,h)=>wt?(0,y.jsx)("span",{className:"graview-choose-at",children:(0,y.jsx)("input",{...$e.boxProps(d.id,h),onPointerEnter:jn,onFocus:jn})}):null,Ln=d=>wt?{"data-graview-choose":d}:{},vi=(0,Me.useCallback)(d=>{$e.choose(d),requestAnimationFrame(()=>{let h=$e.list.current;((d[0]===void 0?null:h?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??h)?.focus({preventScroll:!0})})},[$e]),st=r==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||Sn?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&r==="list"?6:0}:void 0,Mt=st?void 0:"graview-rows",St=d=>`list-at-${d.replace(/[^\p{L}\p{N}]/gu,"_")}`,Ot=x.map(d=>{let h=d.from===t?d.to:d.from,G=d.from===t?d.description:d.inverse??d.description;return{relation:d,far:h,words:G}}),ki=new Set(Ot.map(d=>(d.words??"").toLowerCase()).filter((d,h,G)=>d&&G.indexOf(d)!==h));return(0,y.jsxs)(i?vs:le,{context:e,children:[(0,y.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,y.jsxs)("header",{style:{display:"grid",gap:4},children:[i?null:(0,y.jsx)(ht,{context:e}),(0,y.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,y.jsx)(ge,{kind:t,brand:l,schema:s.schema,size:8}),(0,y.jsx)(de,{context:e,children:Ye}),Be.length>0?(0,y.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:Be.map(({affordance:d,mutation:h})=>(0,y.jsx)(Ps,{name:h.name,title:h.title??h.name,panel:`${Sa}-${h.name}`,open:ha(h.name),onOpen:G=>wa(h.name,G)},d.id))}):null,!pe.off&&Je.length>0?(0,y.jsxs)("button",{type:"button","data-testid":"list-export","aria-label":"Export CSV",title:"Export CSV",onClick:()=>void sa(pe),style:{...be,minHeight:28,margin:"-4px 0",...Be.length>0?{}:{marginLeft:"auto"},padding:"0 2px",border:0,background:"none",font:"inherit",color:"var(--graview-ink-muted)",cursor:"pointer"},children:[(0,y.jsx)("span",{"aria-hidden":"true",style:{marginRight:4},children:"\u2193"}),"CSV"]}):null]}),Oe.length>0?(0,y.jsx)(yo,{place:"here",to:[{label:`Skip to the ${Oe.length===1?Ze(w,t):`${Oe.length} ${Ye.toLowerCase()}`}`,testid:"records",go:()=>{let d=document.querySelector(`[data-graview-skip-target="${CSS.escape(Cn)}"]`);Vn(d?.querySelector('[data-graview-choose-box][tabindex="0"]')??d)}},...Je.length>0?[{label:"Skip to arranging them",testid:"arranging",go:()=>{let d=document.querySelector(`[data-graview-skip-target="${CSS.escape(Cn)}"]`)?.parentElement?.querySelector('[role="group"][aria-label="Arrange"]');Vn(d?.querySelector('button[data-testid$="-add"], button[data-testid$="-all"]')??d)}}]:[]]}):null,o??w?.description?(0,y.jsx)("p",{style:ie,children:o??w?.description}):null,Ot.length>0||xn.length>0?(0,y.jsxs)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[Ot.length>0?(0,y.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",Ot.map(({relation:d,far:h,words:G},ue)=>(0,y.jsxs)("span",{"data-relation":d.edgeKind,children:[ue>0?(0,y.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,h==="*"?Te(G??Qe(d.edgeKind)):(0,y.jsx)(F,{to:`/${V(s.schema,h)}`,style:U,title:z(s,h),children:G&&ki.has(G.toLowerCase())?`${Te(G)}: ${z(s,h).toLowerCase()}`:Te(G??z(s,h))})]},`${d.edgeKind}|${d.from}|${d.to}`))]}):null,xn.length>0?(0,y.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",xn.map((d,h)=>(0,y.jsxs)("span",{children:[h>0?(0,y.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,y.jsx)(F,{to:he(e,d),style:U,children:d.title})]},at(d)))]}):null]}):null]}),Be.length>0?(0,y.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:Be.map(({affordance:d,mutation:h})=>{let G=!!(ba[h.name]&&Oe.length===0);return(0,y.jsx)(As,{name:h.name,id:`${Sa}-${h.name}`,description:h.description,open:ha(h.name),onClose:()=>wa(h.name,!1),children:(0,y.jsx)(Le,{store:s,mutation:h,prefilled:d.args,open:d.open,...G?{initial:{[ba[h.name]]:L.words}}:{},...e.principal?{principal:e.principal}:{}},G?`${h.name}|${L.words}`:h.name)},d.id)})}):null,N.dropped.length>0?(0,y.jsxs)("p",{style:{...A,margin:0},"data-testid":"list-dropped",children:["This link asked for ",N.dropped.join(", "),", which ",Ye.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,Je.length>0?(0,y.jsx)(zr,{schema:s.schema,graph:s.graph,kind:t,arrangement:S,onChange:fi,kept:{shown:Oe.length,of:Je.length},noun:{one:Ze(w,t),many:Ye.toLowerCase()},...bi?{}:{allow:!1},...ka?{filters:ka}:{},offers:D,chips:{nodes:Je,flagged:O,...typeof c?.today=="string"?{today:c.today}:{}},query:e.framed===!0&&e.barAbove!==!0}):null,(0,y.jsx)("style",{children:mt}),wt?(0,y.jsx)("style",{children:Qr+bs}):null,(0,y.jsx)("div",{className:"graview-list","data-graview-skip-target":Cn,...wt?{...$e.listProps,ref:$e.list,tabIndex:-1,"data-graview-choosable":"","aria-label":$e.chosen.length>0?`${Ye}, ${$e.chosen.length} chosen`:Ye,role:"group"}:{},children:Oe.length===0&&L.words?(0,y.jsxs)("p",{style:ie,"data-testid":"none-yet",children:["Nothing here is called \u201C",L.words,"\u201D."," ",(0,y.jsx)("span",{style:A,"data-testid":"list-searched",children:Vt(s.schema,{kinds:[t],past:X})})," ",(0,y.jsx)(F,{to:"?",style:U,children:"Show every one"})]}):Oe.length===0?(0,y.jsxs)("p",{style:ie,"data-testid":"none-yet",children:[S.filter?.length||S.query?"None of them.":"None yet",!S.filter?.length&&!S.query&&Be.length>0?` \u2014 the first one starts above, with \u201C${Be[0]?.mutation.title??Be[0]?.mutation.name}\u201D.`:!S.filter?.length&&!S.query?".":"",S.filter?.length||S.query?(0,y.jsxs)(y.Fragment,{children:[" ",(0,y.jsx)(F,{to:"?",style:U,children:"Show every one"})]}):null]}):m.grouped&&fa?(0,y.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":fa,children:M.map(d=>{if(!d.closed)return(0,y.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,y.jsxs)("h2",{className:"graview-group-head",children:[d.label," ",(0,y.jsx)("span",{children:d.nodes.length})]}),(0,y.jsx)("ul",{style:st,className:Mt,"data-graview-rows":"",children:d.nodes.map(Et)})]},d.key||"-");let h=gi(d),G=`${p}-${St(d.key||"none")}`;return(0,y.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":h?"shut":"open",children:[(0,y.jsx)("h2",{className:"graview-group-head",children:(0,y.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!h,"aria-controls":G,"data-testid":"list-group-toggle",onClick:()=>mi(d.value),children:[(0,y.jsx)("span",{"aria-hidden":"true",children:h?"\u25B8":"\u25BE"}),d.label," ",(0,y.jsxs)("span",{children:["\xB7 ",d.nodes.length]}),(0,y.jsxs)("span",{style:ws,children:[" ",d.nodes.length===1?Ze(w,t):Ye.toLowerCase()]})]})}),(0,y.jsx)("ul",{id:G,style:h?{...st,display:"none"}:st,className:Mt,"data-graview-rows":"",hidden:h,children:h?null:d.nodes.map(Et)})]},d.key||"-")})}):Nt&&Nt.length>1?(0,y.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":Ie?.type==="date"?"year":"letter",children:[(0,y.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...A,display:"flex",flexWrap:"wrap",gap:Ie?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:Nt.map(d=>(0,y.jsx)("a",{href:`#${St(d.key)}`,onClick:h=>{h.preventDefault(),document.getElementById(St(d.key))?.scrollIntoView({block:"start"})},style:{...be,minWidth:24,justifyContent:"center"},children:d.key},d.key))}),Nt.map(d=>(0,y.jsxs)("section",{"data-testid":"list-section","aria-labelledby":St(d.key),style:{display:"grid",gap:0},children:[(0,y.jsx)("h2",{id:St(d.key),className:"graview-group-head",children:d.key}),(0,y.jsx)("ul",{style:st,className:Mt,"data-graview-rows":"",children:d.nodes.map(Et)})]},d.key))]}):(0,y.jsx)("ul",{style:st,className:Mt,"data-testid":"records","data-graview-rows":"",children:Oe.map(Et)})}),wt?(0,y.jsx)(Zr,{store:s,chosen:$e.chosen,...it?{principal:it}:{},...c?{context:c}:{},anchor:Ss,of:An.length,onChooseAll:()=>$e.choose(An),onClear:$e.clear,onActed:vi}):null,ma>0?(0,y.jsxs)(F,{to:ai(u,"filter","is:any"),style:{...U,...A,justifySelf:"start"},"data-testid":"past-link",children:["+",ma," past"]}):null,R===!1&&s.graph.count(t,{archived:!0})>0?(0,y.jsxs)(F,{to:ai(u,"archived","true"),style:{...U,...A,justifySelf:"start"},"data-testid":"archived-link",children:["+",s.graph.count(t,{archived:!0})," archived"]}):null]}),(0,y.jsx)(cn,{context:e,withheld:yi,style:se,testId:"withheld"})]})}var ws={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Ss=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,bs=`
|
|
7
|
-
.graview-list[data-graview-choosable]{outline:none}
|
|
8
|
-
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
9
|
-
.graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${Ba.raised};display:flex;align-items:center}
|
|
10
|
-
@media (min-width: 900px) and (pointer: fine){
|
|
11
|
-
.graview-list [data-graview-choose]{padding-left:0}
|
|
12
|
-
.graview-choose-at{left:-34px}
|
|
13
|
-
}
|
|
14
|
-
@media (pointer: coarse){
|
|
15
|
-
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
16
|
-
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
17
|
-
}
|
|
18
|
-
`;function vs({children:e}){return(0,y.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:e})}var ks=(e,t)=>t?{sort:{by:t,direction:"desc"}}:e?{sort:{by:"label",direction:"asc"}}:{};function xs(e,t,n){let a=Dt({...e.get("sort")?{sort:e.get("sort")}:{},...e.get("filter")?{filter:e.get("filter")}:{},...e.get("group")?{group:e.get("group")}:{},...e.get("q")?{q:e.get("q")}:{},...e.get("archived")?{archived:e.get("archived")}:{}}),r=[...a.filter??[]],o=e.get("by"),i=a.group??(o?{by:o}:void 0);for(let l of n){let c=e.get(l);c&&r.push({key:l,value:c})}let s=e.get("with");return s&&r.push({key:s,value:"*"}),e.get("past")==="1"&&!r.some(l=>l.key==="is")&&r.push({key:"is",value:"any"}),qn({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...r.length>0?{filter:r}:{},...i?{group:i}:{},...a.archived!==void 0?{archived:a.archived}:{}},t)}function ai(e,t,n){let a=new URLSearchParams(e);return a.set(t,n),a.delete("past"),`?${a.toString()}`}function Ps({name:e,title:t,panel:n,open:a,onOpen:r}){return(0,y.jsxs)("button",{type:"button","data-testid":`act-open-${e}`,"data-graview-act":e,"aria-expanded":a,"aria-controls":n,onClick:()=>{r(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...be,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,y.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),t]})}function As({name:e,id:t,description:n,open:a,onClose:r,children:o}){return(0,y.jsxs)("div",{"data-testid":`act-${e}`,id:t,hidden:!a,onKeyDown:i=>{i.key==="Escape"&&(i.preventDefault(),r(),document.querySelector(`[aria-controls="${t}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,y.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:n}):null,o]})}function Cs({to:e,label:t}){let n=(0,Me.useRef)(null);return Xr(n),(0,y.jsx)(F,{ref:n,to:e,"aria-label":t,style:{position:"absolute",inset:0,borderRadius:6}})}var Ve=H(ve(),1);var Lt=H(ve(),1);var B=H(j(),1);function pa({context:e}){let{store:t,brand:n,invariantContext:a,principal:r}=e;ne(t);let o=t.violations(a),i=t.allInvariants(),s=Gt(t,o),l=cr(t.schema,i);return(0,B.jsxs)(le,{context:e,children:[(0,B.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,B.jsx)(de,{context:e,children:o.length===0?"All rules hold":"What is broken"}),(0,B.jsx)("p",{style:ie,"data-testid":"problems-count",children:o.length===0?"Every declared rule is satisfied by what is here.":Fa(o)})]}),(0,B.jsx)(Ko,{context:e}),s.map((c,u)=>{let k=c.nodeIds[0],p=k?t.graph.getNode(k):void 0;return(0,B.jsxs)("section",{style:{display:"grid",gap:10,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:[c.line?null:(0,B.jsx)(gn,{violation:c,schema:t.schema,...n?{brand:n}:{}}),p?(0,B.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,B.jsx)(ge,{kind:p.kind,brand:n,schema:t.schema,size:7}),(0,B.jsx)(F,{to:Y(t.schema,p.kind,p.id),style:U,children:oe(t.schema.tryDefinition(p.kind),p)})]}):null,c.line?(0,B.jsx)(gn,{violation:c,schema:t.schema,...n?{brand:n}:{}}):null,(0,B.jsx)(mn,{store:t,repairs:c.repairs,...r?{principal:r}:{}})]},u)}),i.length>0?(0,B.jsxs)("section",{style:{...se,display:"grid",gap:12},"data-testid":"rules",children:[(0,B.jsx)("h2",{style:ee,children:"The rules"}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:i.map(c=>{let u=o.filter(w=>w.invariant===c.name).length,k=l.get(c.name),p=c.label??c.name;return(0,B.jsxs)("li",{"data-graview-rule":c.name,style:{display:"grid",gap:2},children:[(0,B.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[k?(0,B.jsx)(Bt,{line:k,schema:t.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,B.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:p}),(0,B.jsx)("span",{style:{...A,color:u>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:u===0?"holds":`broken in ${u} ${u===1?"place":"places"}`})]}),k&&p.trim().length>0?(0,B.jsx)("span",{style:A,children:p}):null]},c.name)})})]}):null]})}function gn({violation:e,schema:t,brand:n}){if(!e.line)return(0,B.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:e.message});let a=ur(e),r=pr(e);return r?(0,B.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,B.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:r}),a?(0,B.jsx)("span",{style:A,children:a}):null,(0,B.jsxs)("details",{"data-testid":"problem-judged",style:A,children:[(0,B.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,B.jsx)(Bt,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none"})]})]}):(0,B.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,B.jsx)(Bt,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,B.jsx)("span",{style:A,children:a}):null]})}function mn({store:e,repairs:t,principal:n}){let[a,r]=(0,Lt.useState)(null),[o,i]=(0,Lt.useState)(null),s=(0,Lt.useRef)([]);if(t.length===0)return null;let l=a===null?null:t[a],c=l&&(l.missing??[]).length>0?e.allMutations().find(u=>u.name===l.mutation):void 0;return(0,B.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,B.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:t.map((u,k)=>{let p=(u.missing??[]).length>0,w=e.permits({name:u.mutation,args:{...u.args}},n);return w.ok?(0,B.jsx)("button",{ref:R=>{s.current[k]=R},type:"button","data-graview-repair":u.mutation,"data-graview-asks":p||void 0,"aria-expanded":p?a===k:void 0,onClick:()=>{if(i(null),p){r(a===k?null:k);return}r(null);try{e.apply({name:u.mutation,args:{...u.args}},n?{author:n}:{})}catch(R){i(qt(e.schema,e.allMutations(),R))}},style:fe,children:p?`${u.label} \u2026`:u.label},k):(0,B.jsxs)("p",{"data-testid":"withheld","data-withheld":w.refusal.wouldNeed.join(",")||"nobody",style:{...A,margin:0},children:[(0,B.jsx)("s",{children:u.label})," \u2014 ",w.refusal.message]},k)})}),c&&l?(0,B.jsx)(Le,{store:e,mutation:c,prefilled:{...l.args},only:l.missing??[],label:l.label,autoFocus:!0,onDone:()=>{let u=a;r(null),requestAnimationFrame(()=>{let k=u===null?null:s.current[u];if(k?.isConnected){k.focus();return}let p=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");p&&(p.hasAttribute("tabindex")||(p.tabIndex=-1),p.focus())})},...n?{principal:n}:{}}):null,l&&!c&&(l.missing??[]).length>0?(0,B.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Un},children:["\u201C",l.label,"\u201D names ",l.mutation,", which this app does not declare."]}):null,o?(0,B.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Un},children:o}):null]})}var ua=H(ve(),1);var ze=H(j(),1);function si({store:e,link:t,principal:n}){let[a,r]=(0,ua.useState)(!1),[o,i]=(0,ua.useState)(null),s=yr(t);return(0,ze.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,ze.jsx)("button",{type:"button","data-graview-provisional":"",title:s,"aria-label":`Unsure link: ${s}`,"aria-expanded":a,onClick:()=>r(!a),style:{border:"1px dashed var(--graview-ink-muted)",borderRadius:999,background:"transparent",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.75rem",lineHeight:1,padding:"2px 6px",cursor:"pointer"},children:"unsure"}),a?(0,ze.jsxs)("span",{style:{...A,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,ze.jsx)("span",{children:s}),(0,ze.jsx)("button",{type:"button",style:{...fe,padding:"4px 10px"},onClick:()=>{try{e.apply({name:Ia,args:{kind:t.edge.kind,from:t.edge.from,to:t.edge.to}},n?{author:n}:{}),r(!1)}catch(l){i(qt(e.schema,e.allMutations(),l))}},children:"Keep this link"}),o?(0,ze.jsx)("span",{role:"alert",children:o}):null]}):null]})}var we=H(j(),1);function li({nodeId:e,node:t,field:n,inPlace:a,labelStyle:r=Se}){return n.files?(0,we.jsx)(ut,{as:"field",read:!a,nodeId:e,field:n.key,label:n.label,files:n.files,labelStyle:r,style:{gap:4}}):n.long?(0,we.jsx)(_r,{nodeId:e,field:n.key,label:n.label,value:n.value,markdown:n.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:r,valueStyle:{lineHeight:1.6}}):(0,we.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,we.jsx)("dt",{style:r,children:n.label}),(0,we.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:n.linked?(0,we.jsx)(Rr,{relation:n.linked.relation,refs:n.linked.refs,...a?{nodeId:e,field:n.key}:{}}):n.app?(0,we.jsx)(_t,{address:n.app,as:"record",...a?{nodeId:e,field:n.key}:{}}):n.href?(0,we.jsx)(Ur,{href:n.href,field:n.key,value:n.value,stored:n.stored,...a?{nodeId:e}:{}}):a?(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(zt,{nodeId:e,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,we.jsx)(Lr,{nodeId:e,field:n.key,start:t?.[n.key],value:t?.[`${n.key}Repeat`],label:`${n.label} repeats`}):null]}):n.value})]})}var v=H(j(),1),Rs=[];function ga({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;ne(t);let o=ce()!==null,i=_e(),s=decodeURIComponent(i.id??""),l=nn(t,s,{...a?{principal:a}:{},...r?{context:r}:{}}),c=Gt(t,l?.violations??Rs),[u,k]=(0,Ve.useState)(null),[p,w]=(0,Ve.useState)(!1),[R,f]=(0,Ve.useState)(null),x=(0,Ve.useRef)(null),O=(0,Ve.useRef)(null),D=Tr({flow:"both",letters:!0}),g=m=>{(x.current?.parentElement?.querySelector(`[data-affordance="${m.replace(/["\\]/g,"\\$&")}"]`)??x.current)?.focus()};if(!l)return(0,v.jsx)(le,{context:e,children:(0,v.jsx)(de,{context:e,children:"Nothing lives at this address."})});let N=t.graph.getNode(s),T=t.schema.tryDefinition(l.kind),E=T?.describe&&N?mr(T,N):null,re=[...t.log.all()].filter(m=>!Ft(m)&&(m.writes.includes(s)||m.reads.includes(s))).slice(-8).reverse(),te=t.log.all().find(m=>!Ft(m)&&m.undoes===void 0&&m.primitives.some(M=>M.op==="add-node"&&M.node.id===s)),Q=l.actions.affordances.filter(m=>m.provider!=="invariant"),Ae=Q.filter(m=>m.destructive||m.setsAside),Fe=p||Ae.length<2?Q:Q.filter(m=>!Ae.includes(m)),Ce=e.views?.lookup(l.kind,{cardinality:"one",fidelity:"full"}),Re=Ce!==void 0&&!ct(Ce)?Ce:void 0,b=Re&&N?Yt(Ce,N,t.graph):void 0,S=b?l.fields.filter(m=>!b.fields.has(m.key)):l.fields,L=b?l.links.flatMap(m=>{let M=m.targets.filter(J=>!b.records.has(J.id));return M.length>0?[{...m,targets:M}]:[]}):l.links,I=Re!==void 0&&ir(Ce),Z=o&&br(T).length>0,X=He(e).filter(m=>!m.hidden&&(m.kind===l.kind||m.across===l.kind));return(0,v.jsxs)(le,{context:e,children:[(0,v.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,v.jsx)(ht,{context:e}),(0,v.jsx)(de,{context:e,children:o&&N?.label===l.label?(0,v.jsx)(zt,{nodeId:s,field:"label",value:l.label,said:l.label}):l.label}),E&&E!==l.label?(0,v.jsx)("p",{style:ie,children:E}):null,te?.lineage?(0,v.jsxs)("p",{style:{...A,margin:0},"data-testid":"record-lineage",children:["Made by ",vt(te,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}}),", ",In(te.lineage)]}):null,(0,v.jsx)(zn,{context:e,stop:`#focus=${encodeURIComponent(s)}`,style:{...We,...A},"data-testid":"spatial-link"}),o&&N?(0,v.jsx)(Gn,{choices:[{on:"changed",record:s},{on:"act",record:s},{on:"reaches",kind:l.kind,condition:"",record:s}],label:"Notify me when this changes",testId:"record-notify",style:{...fe,...A,justifySelf:"start"}}):null,X.length>0?(0,v.jsx)(Ls,{context:e,places:X}):null]}),N&&$a(N)?(0,v.jsx)(Ns,{context:e,id:s,kind:l.kind}):null,N&&Da(t,s)?(0,v.jsx)(Es,{context:e,id:s,kind:l.kind}):null,Re&&N?(0,v.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,v.jsx)(eo,{children:(0,v.jsx)(yt,{when:pt(Ce),children:(0,v.jsx)(Re,{node:N,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...l.violations.length>0?{flagged:[s]}:{}})})})}):null,l.violations.length>0?(0,v.jsx)("section",{"data-testid":"record-violations",style:{display:"grid",gap:12,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:c.map((m,M)=>(0,v.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,v.jsx)(gn,{violation:m,schema:t.schema,...n?{brand:n}:{}}),(0,v.jsx)(mn,{store:t,repairs:Ro(l.actions,m.repairs),...a?{principal:a}:{}})]},M))}):null,!I&&(S.length>0||Z)?(0,v.jsxs)("section",{style:{...se,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,v.jsx)("h2",{style:ee,children:"The facts"}),fr(T,S).map((m,M)=>{let J=(0,v.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:m.fields.map(pe=>(0,v.jsx)(li,{nodeId:s,node:N,field:pe,inPlace:o},pe.key))});return m.title?(0,v.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,v.jsx)("h3",{"data-graview-field-group":m.title,style:{...ee,fontSize:"inherit"},children:m.title}),J]},M):(0,v.jsx)("div",{children:J},M)}),Z?(0,v.jsx)(ut,{as:"unfilled",nodeId:s,skip:[...b?.fields??[]],labelStyle:Se,style:{gap:4}}):null]}):null,(I?[]:L).map(m=>(0,v.jsxs)("section",{style:{...se,display:"grid",gap:10},children:[(0,v.jsx)("p",{style:Se,children:wo(t,m)}),m.description?(0,v.jsx)("h2",{style:ee,children:Te(m.description)}):(0,v.jsxs)("h2",{style:ee,"aria-label":Qe(m.edgeKind),children:[m.direction==="in"?"\u2190 ":"\u2192 ",Qe(m.edgeKind)]}),(0,v.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:m.targets.map(M=>{let J=hr(t,m.direction==="in"?{kind:m.edgeKind,from:M.id,to:s}:{kind:m.edgeKind,from:s,to:M.id});return(0,v.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,v.jsx)(ge,{kind:M.kind,brand:n,schema:t.schema,size:7}),(0,v.jsxs)(F,{to:Y(t.schema,M.kind,M.id),style:U,children:[M.label,M.apart?(0,v.jsxs)("span",{style:A,children:[" \xB7 ",M.apart]}):null]}),J?.provisional?(0,v.jsx)(si,{store:t,link:J,...a?{principal:a}:{}}):null]},M.id)})}),(m.direction==="out"&&t.schema.edge(m.edgeKind)?.cardinality==="one"?[]:[...new Set(m.targets.map(M=>M.kind))]).map(M=>(0,v.jsx)(F,{to:`/${V(t.schema,M)}?${encodeURIComponent(m.edgeKind)}=${encodeURIComponent(s)}`,style:{...We,...A},"data-testid":"related-all",children:(0,v.jsxs)(Ke,{children:["Sort and filter ",m.description??`these ${z(t,M).toLowerCase()}`,m.targets.some(J=>J.kind!==M)?` (${z(t,M).toLowerCase()})`:""]})},M))]},`${m.edgeKind}|${m.direction}|${m.description??""}`)),!I&&(Q.length>0||l.actions.withheld.length>0)?(0,v.jsxs)("section",{style:{...se,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,v.jsx)("h2",{style:ee,ref:x,tabIndex:-1,children:"What can be done"}),(0,v.jsxs)("div",{role:"toolbar","aria-label":"What can be done",...D,style:{display:"flex",flexWrap:"wrap",gap:8},children:[Fe.map(m=>{let M=u===m.id;return(0,v.jsx)("button",{type:"button","data-affordance":m.id,"data-rank":m.rank,"data-graview-act":m.mutation,[Wn]:"",autoFocus:p&&m===Ae[0],"aria-expanded":M,onClick:()=>k(M?null:m.id),style:{...fe,...M?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:m.label},m.id)}),Fe.length<Q.length?(0,v.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>w(!0),style:{...fe,...A},"data-testid":"record-actions-more",[Wn]:"",children:["Show ",Q.length-Fe.length," more"]}):null]}),Q.map(m=>{if(u!==m.id)return null;let M=t.allMutations().find(J=>J.name===m.mutation);return M?(0,v.jsxs)("div",{ref:O,onKeyDown:J=>{if(J.key!=="Escape"||J.defaultPrevented)return;J.preventDefault(),k(null);let pe=m.id;requestAnimationFrame(()=>g(pe))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,v.jsx)("h3",{style:ee,children:m.label}),M.description?(0,v.jsx)("p",{style:{...A,margin:0},children:M.description}):null,(0,v.jsx)(Le,{store:t,mutation:M,prefilled:m.args,open:m.open,label:m.label,autoFocus:!0,onDone:()=>{k(null),f(m.mutation);let J=m.id;requestAnimationFrame(()=>g(J))},...a?{principal:a}:{}})]},m.id):null}),o&&R!==null&&u===null?(0,v.jsx)(Gn,{choices:[{on:"act",act:R,record:s},{on:"act",act:R}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...fe,...A,justifySelf:"start"}}):null,(0,v.jsx)(cn,{context:e,withheld:l.actions.withheld})]}):null,o?(0,v.jsx)(ho,{id:s,style:se,headingStyle:ee}):null,re.length>0?(0,v.jsxs)("section",{style:{...se,display:"grid",gap:10},"data-testid":"record-history",children:[(0,v.jsx)("h2",{style:ee,children:"What has happened"}),(0,v.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:re.map(m=>(0,v.jsxs)("li",{style:A,children:[(0,v.jsx)("span",{style:{color:"var(--graview-ink)"},children:m.intent}),m.lineage?(0,v.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",In(m.lineage)]}):null," \u2014 ",vt(m,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},m.id))})]}):null]})}function Ls({context:e,places:t}){let[n,a]=(0,Ve.useState)(!1),r=(0,Ve.useRef)(null),o=n||t.length<=fn+1?0:t.length-fn;return(0,v.jsxs)("p",{ref:r,style:{...A,margin:0},"data-testid":"seen-in",...n?{"data-open":""}:{},children:["Seen in:"," ",t.map((i,s)=>(0,v.jsxs)("span",{...o>0&&s>=fn?{"data-graview-later":""}:{},children:[s>0?(0,v.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,v.jsx)(F,{to:he(e,i),style:U,children:i.title})]},at(i))),o>0?(0,v.jsxs)(v.Fragment,{children:[" ",(0,v.jsxs)("button",{type:"button","data-graview-seen-more":"","aria-expanded":"false",style:{...U,...A,font:"inherit",background:"none",border:0,padding:0,cursor:"pointer"},onClick:()=>{a(!0),requestAnimationFrame(()=>r.current?.querySelectorAll("a")[fn]?.focus())},children:[o," more"]}),(0,v.jsx)("style",{children:Ts})]}):null]})}var fn=3,Ts="[data-graview-seen-more]{display:none!important}@media (max-width:680px){[data-graview-seen-more]{display:inline!important}[data-testid=seen-in] [data-graview-later]{display:none}}";function Es({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`allow-tidying-${n}`,args:{id:t}},i=a.allMutations().some(s=>s.name===o.name)&&a.permits(o,r).ok;return(0,v.jsxs)("section",{"data-testid":"record-left-alone",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,v.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,v.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),i?(0,v.jsx)("button",{type:"button",style:fe,"data-testid":"allow-tidying",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Allow tidying again"}):null]})}function Ns({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`unarchive-${n}`,args:{id:t}},i=a.allMutations().some(c=>c.name===o.name)&&a.permits(o,r).ok,s=[...a.log.all()].reverse().find(c=>!Ft(c)&&c.mergedInto!==void 0&&c.writes.includes(t)),l=s?.mergedInto!==void 0?a.graph.getNode(s.mergedInto):void 0;return(0,v.jsxs)("section",{"data-testid":"record-archived",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,v.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,v.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",l?(0,v.jsxs)(v.Fragment,{children:[" ","Merged into ",(0,v.jsx)(F,{to:Y(a.schema,l.kind,l.id),style:U,children:oe(a.schema.tryDefinition(l.kind),l)}),"."]}):null]}),i?(0,v.jsx)("button",{type:"button",style:fe,"data-testid":"bring-it-back",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Bring it back"}):null]})}var P=H(j(),1),Ms=Wt(()=>(__graviewPreload(import.meta.url,["./chunk.YYWANGIC.js","./chunk.FTW3K3G6.js","./chunk.UGFDSE37.js","./chunk.QBMIET7P.js","./chunk.WVKXELAF.js","./chunk.ZOW7AC7U.js","./chunk.INBHY3SA.js","./chunk.TDV7JGIQ.js","./chunk.RZQKCLTW.js","./chunk.Y3BEKXYB.js","./chunk.NDLQXQV2.js","./chunk.WUFCRE7O.js","./chunk.XEHLSKHP.js","./chunk.MSM6E6JK.js","./chunk.YGZGMRDC.js","./chunk.6ZJE5M2A.js","./chunk.2SWQI4HF.js","./chunk.QIAH7HHO.js","./chunk.DNJM6WQO.js","./chunk.LEPKPNPA.js","./chunk.5D6SIBOK.js","./chunk.UE5GAP67.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.HUABTCQE.js","./chunk.DXJFAAOI.js","./chunk.5MSNKSTE.js","./chunk.KVQZ5FR6.js","./chunk.2HANQ737.js","./chunk.H536YUAZ.js","./chunk.GZHZLJBF.js","./chunk.OL2N5NUV.js","./chunk.OJGHDWI6.js","./chunk.5DPFAVCZ.js","./chunk.5EZDXWOE.js","./chunk.MIQMPOWF.js","./chunk.T66UK7PQ.js","./chunk.LMXNHBGH.js","./chunk.DBCVZGCC.js","./chunk.WSMYFEGU.js","./chunk.SDO3U72B.js","./chunk.WR63RQGU.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.NS6KWKF5.js")).then(e=>({default:e.DraftPage}))),Os={kind:"human"};function $s({list:e,store:t}){let n=new Set(e.members.map(i=>i.kind)),a=e.total-e.members.length,r=n.size===1?[...n][0]:void 0;if(!r)return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let o=Ue(t.schema,r).toLowerCase();return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,P.jsx)(F,{to:`/${V(t.schema,r)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:e.total===t.graph.nodesOfKind(r).length?`See all ${bt(e.total)} ${o}`:`${bt(a)} more \xB7 all ${o}`})})}function Hs({context:e,children:t}){let n=qe(),a=e.store.schema,r=et("/").replace(/\/$/,""),o=(0,q.useMemo)(()=>({href:i=>`${r}${Y(a,i.kind,i.id)}`,go:i=>n(Y(a,i.kind,i.id)),more:i=>(0,P.jsx)($s,{list:i,store:e.store})}),[r,a,n,e.store]);return(0,P.jsx)(Jt.Provider,{value:o,children:(0,P.jsx)(to.Provider,{value:(e.titleLevel??(e.framed&&!e.barAbove?1:2))-1,children:t})})}var ci=(0,q.createContext)(void 0);function Fs({steering:e}){let t=ye(),n=qe(),a=`${t.pathname}${t.search}`;return(0,q.useLayoutEffect)(()=>e.at(a),[a,e]),(0,q.useLayoutEffect)(()=>{let r=i=>{i!==a&&n(i)};e.go.current=r;let o=e.pending?.current;return o!==void 0&&(e.pending.current=void 0,r(o)),()=>{e.go.current===r&&(e.go.current=void 0)}},[a,n,e]),null}function Is({context:e,to:t}){let{pathname:n}=ye(),a=ce(),r=(t??a)?.sayWhere,o=Ds(e,n);return(0,q.useEffect)(()=>(r?.(o),()=>r?.(null)),[r,o]),null}function Ds(e,t){let[n="",a,r]=t.split("/").filter(Boolean).map(i=>{try{return decodeURIComponent(i)}catch{return i}});if(r!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===On)return"#overview=1";let i=e.views?.places().find(s=>s.as===a);return i?`#focus=${encodeURIComponent(De(i.kind))}&view=${encodeURIComponent(i.as)}`:"#"}let o=ke(e.store.schema,n);return o?`#focus=${encodeURIComponent(a??De(o))}`:"#"}function Ws({onNavigate:e,path:t}){let n=ye(),a=Jn(),r=qe(),o=n.hash&&!n.hash.includes("=")?n.hash:"",i=`${n.pathname}${n.search}${o}`,s=(0,q.useRef)(e);s.current=e;let l=(0,q.useRef)(null);(0,q.useEffect)(()=>{let u=l.current;l.current=i,u!==null&&(i===u&&a!=="PUSH"||s.current?.(i,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let c=(0,q.useRef)(t);return(0,q.useEffect)(()=>{t===void 0||t===c.current||(c.current=t,t!==i&&r(t))},[t]),null}function di({context:e,registry:t,page:n}){let a=_e(),r=ke(e.store.schema,a.slug??""),o=n==="list"?ca:ga,s=(r?t?.lookup(r,n):void 0)??o;return(0,P.jsx)(s,{context:e})}function Gs({context:e,registry:t,children:n}){let a=(0,q.useRef)(null);return sr(a),(0,P.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,P.jsx)(Io,{context:e,registry:t,root:a,children:(0,P.jsx)(Wo,{context:e,root:a,children:n})})})}function Bs(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function Ks(){let{pathname:e}=ye(),t=Jn(),n=(0,q.useRef)(null);(0,q.useLayoutEffect)(()=>{if(t!=="POP"){for(let o=n.current?.parentElement;o;o=o.parentElement){let{overflowY:i}=getComputedStyle(o);if((i==="auto"||i==="scroll")&&o.scrollHeight>o.clientHeight){o.scrollTop=0;return}}window.scrollTo(0,0)}},[e]);let a=(0,q.useRef)(e),r=(0,q.useRef)(!1);return(0,q.useEffect)(()=>{if(!r.current&&e===a.current)return;r.current=!0;let o=document.activeElement;if(Bs(o))return;let i=n.current?.closest("main")??document.querySelector("main"),l=n.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??i?.querySelector("h1, h2")??null??i??null;l&&(l.hasAttribute("tabindex")||l.setAttribute("tabindex","-1"),l.focus({preventScroll:!0}))},[e]),(0,P.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function pi({context:e,children:t}){let n=qe(),a=et("/").replace(/\/$/,""),r=(0,q.useContext)(ci),o=(0,q.useMemo)(()=>{let i=(l,c)=>{if("record"in l){let u=e.store.graph.getNode(l.record);return u?Zt(Y(e.store.schema,u.kind,l.record),{section:c?.section}):void 0}if("place"in l){let u=e.views?.places().find(k=>k.as===l.place);return u?Zt(he(e,u),c):void 0}return e.store.schema.tryDefinition(l.list)?Zt(`/${V(e.store.schema,l.list)}`,c):void 0},s=l=>{l!==void 0&&n(l)};return{record:(l,c)=>s(i({record:l},c)),place:(l,c)=>s(i({place:l},c)),list:(l,c)=>s(i({list:l},c)),draft:()=>n("/~draft"),href:(l,c)=>{let u=r===!1?void 0:i(l,c);if(u!==void 0)return r?r(u):`${a}${u}`}}},[e,n,a,r]);return(0,P.jsx)(or.Provider,{value:o,children:t})}function qs(){let{pathname:e,search:t,hash:n}=ye();return(0,q.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return Oo(a)},[e,t,n]),null}function js({context:e,Home:t}){let n=ye(),a=e.views,r=n.key==="default"&&!(a&&ar(a));(0,q.useEffect)(()=>{a&&rr(a)},[a]);let o=r?Va(e.views?.arrangement?.()?.first,e.store.schema,e.views?.places()??[]):void 0,i=o?.to==="place"?he(e,o.place):o?.to==="kind"?`/${V(e.store.schema,o.kind)}`:void 0;return i?(0,P.jsx)(Yn,{to:i,replace:!0}):(0,P.jsx)(t,{context:e})}function ui({context:e,registry:t}){let n=t?.lookupSurface("shell"),a=n!==void 0,r=a&&(t?.without().has("bar")??!1),o=a&&!r&&!e.embedded?{...e,barAbove:!0}:e,i=f=>n===void 0?(0,P.jsx)(tn,{context:e,children:f}):r?(0,P.jsx)(n,{context:e,children:f}):(0,P.jsx)(tn,{context:e,children:(0,P.jsx)(n,{context:o,children:f})}),s=t?.lookupSurface("home")??ia,l=t?.lookupSurface("problems")??pa,c=a?{...o,framed:!0}:e,[u,k]=(0,q.useState)(null),p=(0,q.useMemo)(()=>({context:c,registry:t}),[c,t]),w=(0,q.useMemo)(()=>({onFind:k,find:!(t?.without().has("find")??!1),places:!(t?.without().has("places")??!1)}),[t]),R=(0,P.jsx)(Zn.Provider,{value:p,children:(0,P.jsx)(pi,{context:e,children:(0,P.jsx)(Gs,{context:e,registry:t,children:i((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(wr,{face:"pages"}),(0,P.jsxs)(Hs,{context:c,children:[(0,P.jsx)(Ks,{}),(0,P.jsx)(qs,{}),(0,P.jsxs)(xo,{children:[(t?.routes()??[]).map(({path:f,component:x})=>(0,P.jsx)(Ee,{path:f,element:(0,P.jsx)(x,{context:c})},f)),(0,P.jsx)(Ee,{path:"/",element:(0,P.jsx)(js,{context:c,Home:s})}),(0,P.jsx)(Ee,{path:"/problems",element:(0,P.jsx)(l,{context:c})}),(0,P.jsx)(Ee,{path:"/~draft",element:(0,P.jsx)(q.Suspense,{fallback:null,children:(0,P.jsx)(Ms,{context:c})})}),(0,P.jsx)(Ee,{path:"/search",element:(0,P.jsx)(da,{context:c})}),(0,P.jsx)(Ee,{path:"/map",element:(0,P.jsx)(oa,{context:c})}),(0,P.jsx)(Ee,{path:"/places",element:(0,P.jsx)(aa,{context:c})}),He(c).some(f=>f.as===On)?null:(0,P.jsx)(Ee,{path:ja,element:(0,P.jsx)(Yn,{to:"/",replace:!0})}),(0,P.jsx)(Ee,{path:"/places/:as",element:(0,P.jsx)(ra,{context:c})}),(0,P.jsx)(Ee,{path:"/:slug",element:(0,P.jsx)(di,{context:c,registry:t,page:"list"})}),(0,P.jsx)(Ee,{path:"/:slug/:id",element:(0,P.jsx)(di,{context:c,registry:t,page:"record"})})]})]})]}))})})});return e.embedded||!a||r?R:(0,P.jsx)(Co.Provider,{value:w,children:(0,P.jsx)(Br.Provider,{value:u,children:R})})}var Vs=()=>typeof document>"u"?null:document.body;function Us({context:e,registry:t,basename:n,initialPath:a,onNavigate:r,path:o,steering:i,firstLook:s,hrefOf:l,typing:c}){let[u,k]=(0,q.useState)(void 0),p=u!==void 0&&u.from===e.principal?{...e,principal:u.seat}:e;(0,q.useState)(()=>p.views?ro(p.views,p.store.schema,Kn(p.brand,p.store.schema)):void 0);let w=ce(),R=c??p.typing;La({reader:p.locale??w?.locale,app:p.brand?.locale??p.app?.brand?.locale,readerTimeZone:p.timeZone??w?.timeZone,appTimeZone:p.brand?.timeZone??p.app?.brand?.timeZone});let f=p.principal??Os,x=Xa(p.store,f,p.history),D=(x.past&&x.live===p.store?x.past.store:p.store).seenBy(f),g=D===p.store?p:{...p,store:D};er(p.store,p.principal);let N=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ws,{onNavigate:r,path:o}),i?(0,P.jsx)(Fs,{steering:i}):null,g.presence||w?(0,P.jsx)(Is,{context:g,to:w}):null,(0,P.jsx)(ui,{context:g,...t?{registry:t}:{}}),s?(0,P.jsx)(oo,{firstLook:s,root:Vs,app:Kn(p.brand,p.store.schema)}):null]}),T=g.views?(0,P.jsxs)(tr,{store:g.store,views:g.views,...g.principal?{principal:g.principal}:{},...g.brand?{brand:g.brand}:{},...g.locale?{locale:g.locale}:{},...g.timeZone?{timeZone:g.timeZone}:{},...g.settings?{settings:g.settings}:{},...g.presence&&!w?{presence:g.presence}:{},...R?{typing:R}:{},...g.people?{people:g.people}:{},...g.seats?{seats:g.seats}:{},onSeat:Q=>w?w.takeSeat(Q):k({from:e.principal,seat:Q}),...g.onKeepLens?{onKeepLens:g.onKeepLens}:{},...g.onExport?{onExport:g.onExport}:{},...g.ai?{ai:g.ai}:{},...g.subscriptions?{subscriptions:g.subscriptions}:{},dismissals:g.dismissals,whileAway:g.whileAway,...g.signIn?{signIn:g.signIn}:{},resolveApp:g.resolveApp??w?.resolveApp,linkedRecords:g.linkedRecords??w?.linkedRecords,...g.app?{app:g.app}:{},...g.menuSections?{menuSections:g.menuSections}:{},children:[N,(0,P.jsx)(pi,{context:g,children:(0,P.jsx)($o,{context:g})})]}):N,E=(0,P.jsx)(Za.Provider,{value:x,children:T}),re=g.files?(0,P.jsx)(Qa.Provider,{value:g.files,children:E}):E,te=l===void 0?re:(0,P.jsx)(ci.Provider,{value:l,children:re});if(a!==void 0){let Q=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,P.jsx)(ko,{initialEntries:[Q],...n===void 0?{}:{basename:n},children:te})}return(0,P.jsx)(Po,{...n===void 0?{}:{basename:n},children:te})}export{Ii as a,Us as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as dn,c as cn,d as oe,e as ln,f as ie,h as Ae,i as ze,n as fn,r as ae}from"./chunk.H536YUAZ.js";import{Ab as U,B as ue,C as re,Ca as Ue,Db as nn,Ea as We,F as ke,Fc as an,Gc as Oe,H as Ve,Hb as tn,Hc as sn,I as Ie,Ia as we,Ic as Re,Ja as ve,Mb as rn,Pa as Je,Sa as Ye,b as Ge,ba as qe,bb as Qe,c as Me,d as Pe,db as Xe,e as V,fa as Be,g as ce,h as F,i as Le,ib as xe,j as Fe,jb as en,k as le,l as Ne,la as _e,m as Ce,o as Ze,p as fe,q as he,uc as on,v as Ke,wa as be,x as te,z as pe,za as He}from"./chunk.WR63RQGU.js";function pn(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let a=e,n=v=>typeof a[v]=="string"?a[v]:void 0,t=n("light")??n("src");if(t===void 0)return;let[o,l,g]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...o!==void 0?{dark:o}:{},...l!==void 0?{alt:l}:{},...g!==void 0?{darkFallback:g}:{}}}function Fn(e,a){let n=e.brand??{},t=n.ground,o=n.accent?Re(n.accent,t):void 0;t&&sn(o?.ok?o.schemes:Oe(t),n.accent)&&(a.push(ze("brand","brand.ground","words would not read on that page background, so the app keeps Graview's","pick a lighter ground for the light scheme, a darker one for the dark")),t=void 0,o=n.accent?Re(n.accent):void 0),o&&!o.ok&&a.push(ze("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${o.why}`,"pick a color further from orange-red, or a darker one"));let l=pn(n.logo),g=n.name??e.name,v=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,E])=>typeof E=="string"&&!/url\(|@import|[;{}<>\\]/i.test(E)).map(([E,D])=>[E,an(D)])):void 0;return{name:g,schemes:o?.ok?o.schemes:t?Oe(t):on,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...l?{logo:l.dark||l.darkFallback==="invert"?{light:l.light,...l.dark?{dark:l.dark}:{darkFallback:"invert"}}:l.light,logoAlt:l.alt??g}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...n.subtitle===!1?{subtitleDrawn:!1}:{},...v?{typography:v}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function un(e){let{currency:a,locale:n,timeZone:t}=e.brand??{};return{...a?{currency:a}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var xn=Symbol.for("@graview/core:typed-field"),mn=(e,a)=>(/^(phone|place|duration)$/.test(a)&&(re(e)[xn]=a),e),gn=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function yn(e){let a=F().check(V(300),pe(t=>Ue(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?a:fe(a).check(V(200));return We(e.description?n.check(ue(e.description)):n,e)}var Rn=new WeakMap;function hn(e,a){Rn.set(e,a)}var An=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],I=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function kn(e,a=An){if(!I(e))return{document:e,respelled:[]};let n=[],t=e;for(let o of a)t=Se(t,o.where.split("."),o,"",n);return{document:t,respelled:n}}function Se(e,a,n,t,o){if(a.length===0){if(!I(e)||!Object.hasOwn(e,n.was))return e;o.push(`${t}${n.was}`);let{[n.was]:G,...N}=e;return Object.hasOwn(e,n.now)?N:{...N,[n.now]:G}}if(!I(e))return e;let[l,...g]=a,v=l.endsWith("[]"),E=v?l.slice(0,-2):l,D=e[E],B=D;if(!v)B=Se(D,g,n,`${t}${E}.`,o);else if(Array.isArray(D)){let G=D.map((N,W)=>Se(N,g,n,`${t}${E}.${W}.`,o));B=G.some((N,W)=>N!==D[W])?G:D}return B===D?e:{...e,[E]:B}}var bn="graview-compiled@1";function zn(e,a){return e.find(([n,t])=>n!==q&&"ref"in t&&(t.ref==="*"||t.ref.includes(a)))?.[0]}var q="id",me=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function wn(e){let a=Object.entries(e.fields),n=t=>["name","title","label"].find(o=>t.some(([l])=>l===o))??t[0]?.[0];return n(a.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(a.filter(([,t])=>t.type==="string"))}function vn(e,a,n){let t;switch(e.type){case"string":case"place":t=F().check(V(500));break;case"phone":t=F().check(V(40),ce(gn,"a phone number"));break;case"text":t=F().check(V(2e4)),e.format&&(re(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let l=e.min??(e.type==="duration"?0:void 0),g=[...e.type==="number"?[]:[Ne()],...l===void 0?[]:[Me(l)],...e.max===void 0?[]:[Ge(e.max)],...e.step===void 0?[]:[Pe(e.step)]];t=g.length>0?le().check(...g):le();break}case"boolean":t=Ce();break;case"date":t=F().check(ce(ke,"a date like 2026-10-02"));break;case"datetime":t=F().check(pe(Ve,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Ke(e.options);break;case"list":t=fe(e.of==="number"?le():e.of==="date"?F().check(ce(ke)):e.of==="image"||e.of==="video"||e.of==="file"?be(e.of):F().check(V(500))).check(V(200));break;case"image":case"video":case"file":t=be(e.type);break;case"app-link":t=He();break;case"url":t=Fe();break;case"email":t=Le();break}let o=e.type==="number"||e.type==="integer";return mn(t,o&&e.format==="duration"?"duration":e.type),e.collaborative!==void 0&&(e.type==="text"||e.type==="string")&&(re(t)[Symbol.for("@graview/core:collaborative")]=e.collaborative?1:0),e.description&&(t=t.check(ue(e.description))),o&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&tn(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),a?te(t):t}var se=e=>{throw new U(`there is no record "${e}"`,"invalid")},Sn=(e,a)=>"field"in e?vn(e.field,e.optional,a):"ref"in e?rn(e.ref):te(Ze()),jn=new WeakMap;var je=(e,a)=>I(a)&&Object.keys(e??{}).length===Object.keys(a).length&&Object.keys(e??{}).every(n=>Object.hasOwn(a,n));function dt(e,a={}){let n=I(e)?e.format:void 0;if(n!==bn)return{ok:!1,findings:[Ae("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${bn}`,"compile the document instead")]};let t=e,o=kn(t.document).document,l=o===t.document?t:{...t,document:o},g=I(o)&&typeof o.name=="string"&&I(o.kinds)&&je(o.kinds,l.kinds)&&je(o.acts,l.acts)&&je(o.rules,l.rules)&&Array.isArray(l.edges)&&Array.isArray(l.findings),v={ok:!1,findings:[Ae("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!g)return v;try{return En(l,a)}catch{return v}}function En(e,a={}){let{document:n}=e,t=n.brand?.timeZone,o=a.today??(()=>Ie(t)),l=new Map(e.edges.map(([h,r])=>[h,r])),g=new Map;for(let[h,r]of Object.entries(n.kinds)){let A=e.kinds[h]?.computed,R=ve(r.edges);g.set(h,{fields:new Set([...Object.keys(r.fields),...R.keys()]),edges:new Map(Object.entries(we(r.edges)).map(([T,M])=>[T,M.cardinality??"many"])),...A?{computed:new Map(A)}:{},...R.size>0?{linked:R}:{}})}e.facts&&g.set(cn,{computed:new Map(e.facts)});let v=un(n),E=new Map,D=Object.entries(n.kinds).map(([h,r])=>{let A={};for(let[i,f]of Object.entries(r.fields))A[i]=vn(f,!f.required,v),f.repeats&&(A[Je(i)]=te(Ye()));for(let[i,f]of ve(r.edges))A[i]=te(yn(f));let{label:R,describe:T,durations:M}=e.kinds[h]??{},P=Object.entries(r.computed??{}).map(([i,f])=>[i,typeof f=="string"?{expr:f}:f]),J=Object.hasOwn(r.fields,"label")&&!r.fields.label.label&&!/\{\s*label\b/.test(r.label??`{${wn(r)??""}}`),_=Object.fromEntries([...J?[["label","Label"]]:[],...Object.entries(r.fields).filter(([,i])=>i.label).map(([i,f])=>[i,f.label]),...P.filter(([,i])=>i.label).map(([i,f])=>[i,f.label])]),S=Object.keys(_).length>0,p=Object.fromEntries(Object.entries(r.fields).filter(([,i])=>i.default!==void 0).map(([i,f])=>[i,f.default]));E.set(h,p);let $=Object.fromEntries(Object.entries(we(r.edges)).map(([i,{renamedFrom:f,...Y}])=>[i,Y])),C=Object.entries(r.fields).flatMap(([i,f])=>f.aliases?[[i,f.aliases]]:[]),z=i=>r[i]?{[i]:r[i]}:{};return qe(h,{fields:he(A),edges:$,...z("plural"),...z("noun"),...z("aliases"),...C.length>0?{fieldAliases:Object.fromEntries(C)}:{},...z("description"),...R?{label:i=>ae(R,{node:i,kinds:g,today:o(),money:v})||i.id}:{},...T?{describe:i=>ae(T,{node:i,kinds:g,today:o(),money:v})}:{},...z("lifecycle"),...z("figure"),...z("fieldRoles"),...z("people"),archives:r.archives,...r.tidying?{tidying:r.tidying}:{},...P.length>0?{computed:Object.fromEntries(P.map(([i,f])=>[i,M?.includes(i)?{...f,as:"duration"}:r.computed[i]]))}:{},...S||r.glance||r.page?{display:{...S?{labels:_}:{},...r.glance?{glance:[...r.glance]}:{},...r.page?{page:r.page}:{}}}:{},...Object.keys(p).length>0?{defaults:p}:{}})}),B=Qe(D,n.computed);function G(h){return B.tryDefinition(h.kind)?.label?.(h)??h.id}let N=h=>({id:"",kind:h,...E.get(h)}),W=[];for(let[h,r]of Object.entries(n.acts??{})){let A=e.acts[h],{title:R,effects:T,guard:M,refusal:P,destructive:J,idempotent:_,creates:S,connects:p,severs:$,writes:C,writesOther:z,sets:i}=A,f=new Map(A.args),Y={};for(let[d,x]of f)Y[d]=Sn(x,v);let b=[r.on??[]].flat(),Z=new Map(A.exprs),L=T.find(d=>"create"in d),Q=(d,x,u,w=null)=>{if(I(d)&&"expr"in d)return ie(Z.get(d.expr),{graph:u,subject:w,kinds:g,bindings:x,today:o()});let k=me(d);return k===void 0?typeof d=="string"&&d.startsWith("$$")?d.slice(1):d:k==="now"?new Date().toISOString():k==="today"?o():x[k]},Te=(d,x)=>{if(!L)return"";let u=n.kinds[L.create].fields,w=N(L.create),k=[];for(let[O,ne]of Object.entries(L.set??{})){try{w[O]=Q(ne,d,x)??w[O]}catch{}let X=me(ne);X&&d[X]!==void 0&&k.push(O)}let K=G(w).trim(),H=k.filter(O=>w[O]!==!1&&u[O].type!=="text"&&!(/[^]{41}/.test(w[O])||/ .*[.!?]$/.test(w[O])&&!/[ .][A-Z]\w{0,3}\.$/.test(w[O]))&&G({...w,[O]:void 0}).trim()===K).map(O=>w[O]===!0?u[O].label??Be(O):fn(w[O],u[O].format,o(),[],v));return K&&H.length>0?`${K} (${H.join(", ")})`:K};W.push(nn(h,{input:he(Y),title:R,...r.description?{description:r.description}:{},...r.fromTheOtherEnd?{fromTheOtherEnd:r.fromTheOtherEnd}:{},...f.has(q)?{subject:{kinds:b.length>0?b:"*",arg:q}}:{},...J?{destructive:!0}:{},..._?{idempotent:!0}:{},...S.length>0?{creates:S}:{},...p.length>0?{connects:p}:{},...$.length>0?{severs:$}:{},writes:C,...Object.keys(z).length>0?{writesOther:z}:{},...Object.keys(i).length>0?{sets:i}:{},describe:(d,x)=>{let u=typeof d[q]=="string"?x.getNode(d[q]):void 0,w=u?G(u):Te(d,x);return w?`${R}: ${w}`:R},apply(d,x){let u=d.graph,w=typeof x[q]=="string"?x[q]:void 0,k=w?u.getNode(w):void 0;if(w&&!k&&se(w),k&&b.length>0&&!b.includes(k.kind))throw new U(`"${R}" acts on ${b.join(" or ")}, not on ${_e(k.kind)}`,"invalid");let K={};for(let[s,c]of Object.entries(x))c!==void 0&&(K[s]=c);if(M&&k){let s;try{s=ie(M,{graph:u,subject:k,kinds:g,bindings:K,today:o()})}catch(c){throw c instanceof oe?new U(`"${R}" could not be judged: ${c.sentence}`):c}if(s!==!0)throw new U(P?ae(P,{node:k,kinds:g,graph:u,bindings:K,today:o(),money:v}):`"${R}" is not allowed for ${G(k)} right now`)}let H=new Map,O=s=>u.has(s)||[...H.values()].includes(s),ne=new Set,X=s=>{let c=Xe(s);ne.has(c)||(ne.add(c),d.removeEdge(s))},ee=(s,c)=>{let m=me(s);if(m==="subject")return w;if(m==="me"){let y=d.me;if(y&&n.kinds[u.getNode(y)?.kind]?.people)return y;throw new U(`"${R}" is done as you, and you have no record here`)}if(H.has(m))return H.get(m);try{return Q(s,K,u,c??k??null)}catch(y){throw y instanceof oe?new U(`"${R}" could not work out a value: ${y.sentence}`):y}};for(let s of T)if("create"in s){let c=n.kinds[s.create],m=N(s.create);for(let[ye,de]of Object.entries(s.set??{})){let $e=ee(de,void 0);$e!==void 0&&(m[ye]=$e)}let y=wn(c),j=d.freshId(String((y&&m[y])??s.create),s.create);d.addNode({...m,id:j}),s.as&&H.set(s.as,j)}else if("connect"in s||"sever"in s){let c="connect"in s?s.connect:s.sever,m=String(ee(s.from,void 0)??""),y=String(ee(s.to,void 0)??"");if(O(m)||se(m),O(y)||se(y),"connect"in s){if(l.get(c)?.cardinality==="one")for(let j of u.out(m,c))j.id!==y&&X({kind:c,from:m,to:j.id});u.out(m,c).some(j=>j.id===y)||d.addEdge({kind:c,from:m,to:y})}else X({kind:c,from:m,to:y})}else if("set"in s){let c=String(ee(s.target??"$subject",void 0)??""),m=u.getNode(c);!m&&!O(c)&&se(c);let y={};for(let[j,ye]of Object.entries(s.set)){let de=ee(ye,m);de!==void 0&&(y[j]=de)}Object.keys(y).length>0&&d.patchNode(c,y)}else if("remove"in s){let c=String(ee(s.remove,void 0)??"");u.has(c)||se(c),d.removeNode(c)}else if("replace"in s&&k){let c=x.to;for(let m of s.replace){let y=l.get(m)?.from.includes(k.kind)??!0;for(let j of y?u.out(k.id,m):u.in(k.id,m))m===s.keep&&j.id===c||X(y?{kind:m,from:k.id,to:j.id}:{kind:m,from:j.id,to:k.id})}}}}))}let Ee=[];for(let[h,r]of Object.entries(n.rules??{})){let{title:A,require:R,when:T,says:M}=e.rules[h],P=r.repairs??[],J=(S,p,$=o(),C)=>{let z=[],i={graph:S,subject:p,kinds:g,today:$,...C?{linked:C}:{},onUnread:b=>z.push(b)},f;try{if(T&&ie(T,i)!==!0)return[];if(f=ie(R,i)===!0,!f&&z.length>0)throw new oe(`it reads ${dn(z[0])}`,0)}catch(b){throw b instanceof ln?new en(b.sentence):b instanceof oe?new Error(b.sentence):b}if(f)return[];let Y=P.flatMap(b=>{let Z=n.acts?.[b.act],L={},Q=p&&Z?.on&&Z.fromTheOtherEnd&&![Z.on].flat().includes(p.kind)?zn(e.acts[b.act].args,p.kind):void 0;Q?L[Q]=p.id:p&&(Z?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(b.act))&&(L[q]=p.id);for(let[x,u]of Object.entries(b.args??{}))L[x]=me(u)==="subject"?p?.id:u;let d=(Z?e.acts[b.act].args:[]).filter(([x,u])=>u.required&&L[x]===void 0).map(([x])=>x);return[{mutation:b.act,label:b.label??(Q?Z.fromTheOtherEnd:Z?.title)??b.act.replace(/-/g," "),args:L,...d.length>0?{missing:d}:{}}]});return[{invariant:h,...p?{subjectId:p.id}:{},label:A,message:M?ae(M,{node:p,kinds:g,graph:S,today:$,money:v}):p?`${G(p)}: ${A}`:A,nodeIds:p?[p.id]:[],repairs:Y}]},_={label:A,shape:{over:r.over,require:R,when:T,says:M,declared:n.kinds,money:v,kinds:g,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(S=>S.act)}:{}};Ee.push(r.over==="graph"?xe(h,{scope:"graph",..._,evaluate:({graph:S,today:p,context:$})=>J(S,null,p,$?.linked)}):xe(h,{scope:{kind:r.over},..._,evaluate:({graph:S,subject:p,today:$,context:C})=>J(S,p,$,C?.linked)}))}let De=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ge={name:n.name,schema:B,mutations:W,invariants:Ee,...De?{policy:De}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...n.forms?{forms:n.forms}:{},...n.publishing?{publishing:n.publishing}:{},...n.purpose?{purpose:n.purpose}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return hn(ge,n),jn.set(ge,e),{ok:!0,app:ge,document:n,findings:e.findings,sights:n.policy?.sees,kinds:g}}export{kn as a,Fn as b,bn as c,q as d,me as e,wn as f,dt as g,En as h};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk.HXR7EEXR.js";import"./chunk.DKJK2MMV.js";import"./chunk.6UAUME5U.js";import"./chunk.BRCKXL7B.js";import"./chunk.CPNE6HPQ.js";import"./chunk.QQ3YWKWU.js";import"./chunk.HUABTCQE.js";import"./chunk.DXJFAAOI.js";import"./chunk.5MSNKSTE.js";import"./chunk.KVQZ5FR6.js";import"./chunk.2HANQ737.js";import"./chunk.H536YUAZ.js";import"./chunk.5EZDXWOE.js";import"./chunk.MIQMPOWF.js";import"./chunk.T66UK7PQ.js";import"./chunk.WR63RQGU.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk.R3ZS4QO6.js";import"./chunk.2ORJGMRT.js";import"./chunk.YYWANGIC.js";import"./chunk.FTW3K3G6.js";import"./chunk.UGFDSE37.js";import{l as s}from"./chunk.QBMIET7P.js";import"./chunk.PXQVXBNG.js";import"./chunk.WVKXELAF.js";import"./chunk.ZOW7AC7U.js";import"./chunk.INBHY3SA.js";import"./chunk.TDV7JGIQ.js";import"./chunk.RZQKCLTW.js";import"./chunk.Y3BEKXYB.js";import"./chunk.NDLQXQV2.js";import"./chunk.WUFCRE7O.js";import"./chunk.XEHLSKHP.js";import"./chunk.MSM6E6JK.js";import"./chunk.YGZGMRDC.js";import"./chunk.6ZJE5M2A.js";import"./chunk.2SWQI4HF.js";import"./chunk.QIAH7HHO.js";import"./chunk.DNJM6WQO.js";import"./chunk.LEPKPNPA.js";import"./chunk.5D6SIBOK.js";import"./chunk.UE5GAP67.js";import"./chunk.BJUUSIQY.js";import"./chunk.BRCKXL7B.js";import"./chunk.CPNE6HPQ.js";import"./chunk.XOZU4OFA.js";import"./chunk.QQ3YWKWU.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.HUABTCQE.js";import"./chunk.DXJFAAOI.js";import"./chunk.5MSNKSTE.js";import"./chunk.KVQZ5FR6.js";import"./chunk.2HANQ737.js";import"./chunk.H536YUAZ.js";import"./chunk.GZHZLJBF.js";import"./chunk.OL2N5NUV.js";import"./chunk.OJGHDWI6.js";import"./chunk.5DPFAVCZ.js";import"./chunk.5EZDXWOE.js";import"./chunk.MIQMPOWF.js";import"./chunk.T66UK7PQ.js";import"./chunk.LMXNHBGH.js";import"./chunk.DBCVZGCC.js";import{G as y,T as i}from"./chunk.WSMYFEGU.js";import"./chunk.SDO3U72B.js";import"./chunk.WR63RQGU.js";import"./chunk.FQLNBIQ5.js";import{b as r}from"./chunk.AJZBJBMO.js";var c=r(y(),1),e=r(i(),1);function v({store:d,views:t,as:a,scope:o}){let l=(0,c.useMemo)(()=>s({scope:`.${o}`}),[o]);return(0,e.jsxs)("div",{"data-testid":"embed-picture","data-embed-content":"",tabIndex:0,"aria-label":t.places().find(m=>m.as===a)?.title??"The picture",style:{flex:"1 1 auto",minHeight:0,display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,e.jsx)("style",{children:l}),(0,e.jsx)(n,{store:d,views:t,as:a})]})}export{v as PictureFace};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as n}from"./chunk.INBHY3SA.js";import"./chunk.TDV7JGIQ.js";import"./chunk.RZQKCLTW.js";import"./chunk.Y3BEKXYB.js";import"./chunk.WUFCRE7O.js";import"./chunk.XEHLSKHP.js";import"./chunk.MSM6E6JK.js";import"./chunk.QIAH7HHO.js";import"./chunk.DNJM6WQO.js";import"./chunk.LEPKPNPA.js";import"./chunk.5D6SIBOK.js";import"./chunk.UE5GAP67.js";import"./chunk.WVUJXDXZ.js";import{e as p}from"./chunk.HUABTCQE.js";import"./chunk.DXJFAAOI.js";import"./chunk.5MSNKSTE.js";import"./chunk.KVQZ5FR6.js";import"./chunk.2HANQ737.js";import"./chunk.H536YUAZ.js";import"./chunk.GZHZLJBF.js";import"./chunk.OL2N5NUV.js";import"./chunk.OJGHDWI6.js";import"./chunk.5DPFAVCZ.js";import"./chunk.5EZDXWOE.js";import"./chunk.MIQMPOWF.js";import"./chunk.T66UK7PQ.js";import"./chunk.LMXNHBGH.js";import"./chunk.DBCVZGCC.js";import{T as m}from"./chunk.WSMYFEGU.js";import"./chunk.SDO3U72B.js";import"./chunk.WR63RQGU.js";import"./chunk.FQLNBIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var i=t(m(),1),a=new WeakMap;function l(o){let e=a.get(o);if(!e){let r=p(o);e=c=>c.mode==="fullscreen"?(0,i.jsx)(n,{blocks:r,slot:"home",heading:2,firstHeading:1}):(0,i.jsx)(n,{blocks:r,slot:"home",heading:3,firstHeading:2}),a.set(o,e)}return e}export{l as homeView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk.LWLI5PI4.js";import"./chunk.6ZJE5M2A.js";import"./chunk.XUHY4XO2.js";import"./chunk.DU75P3Y7.js";import"./chunk.2SWQI4HF.js";import"./chunk.DNJM6WQO.js";import"./chunk.5D6SIBOK.js";import"./chunk.CPNE6HPQ.js";import{b as n}from"./chunk.6NQQUIBX.js";import"./chunk.IXHLP2CL.js";import"./chunk.GZHZLJBF.js";import"./chunk.OL2N5NUV.js";import"./chunk.OJGHDWI6.js";import"./chunk.5DPFAVCZ.js";import"./chunk.5EZDXWOE.js";import"./chunk.MIQMPOWF.js";import"./chunk.T66UK7PQ.js";import"./chunk.LMXNHBGH.js";import"./chunk.DBCVZGCC.js";import{T as i}from"./chunk.WSMYFEGU.js";import"./chunk.SDO3U72B.js";import"./chunk.WR63RQGU.js";import"./chunk.FQLNBIQ5.js";import{b as o}from"./chunk.AJZBJBMO.js";var e=o(i(),1);function m({entries:d,style:l,headingStyle:p,className:r}){return(0,e.jsxs)("section",{...r?{className:r}:{},"data-testid":"record-ai","aria-label":"What AI did here",style:{display:"grid",gap:10,...l},children:[(0,e.jsx)("h2",{style:p??{margin:0,fontSize:"1rem"},children:"What AI did here"}),(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8,fontSize:"0.875rem"},children:d.slice(0,8).map(t=>(0,e.jsx)(n,{entry:t,undo:s=>(0,e.jsx)(a,{batch:s})},t.id))})]})}export{m as RecordInteractions};
|