graview 0.1.64 → 0.1.66
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/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/preview/chunk.2KFZHUAC.js +1 -0
- package/dist/preview/chunk.2MHNPBHC.js +1 -0
- package/dist/preview/{chunk.77JI5T4F.js → chunk.2VR7YEJ6.js} +1 -1
- package/dist/preview/chunk.32SHA3EY.js +1 -0
- package/dist/preview/chunk.3L4JMM3P.js +1 -0
- package/dist/preview/chunk.3PBTN7RO.js +1 -0
- package/dist/preview/chunk.45JP6VGJ.js +5 -0
- package/dist/preview/{chunk.DUP2CGVH.js → chunk.4AC2QM7T.js} +1 -1
- package/dist/preview/chunk.4FCFNAA4.js +1 -0
- package/dist/preview/chunk.4FDVINRJ.js +1 -0
- package/dist/preview/chunk.4JULYKGD.js +1 -0
- package/dist/preview/chunk.4U4D7WOI.js +1 -0
- package/dist/preview/chunk.4WGYUYWU.js +2 -0
- package/dist/preview/chunk.5B5SRTUK.js +1 -0
- package/dist/preview/chunk.5BX66FBP.js +1 -0
- package/dist/preview/chunk.5CXIEYHY.js +2 -0
- package/dist/preview/chunk.5EMIWORS.js +1 -0
- package/dist/preview/{chunk.D2XLECMP.js → chunk.5FNFRVTL.js} +1 -1
- package/dist/preview/chunk.5LJVOLKR.js +1 -0
- package/dist/preview/{chunk.APUQIELA.js → chunk.6EHHMWPP.js} +1 -1
- package/dist/preview/chunk.6EVMXBNB.js +1 -0
- package/dist/preview/chunk.6FQW6FNL.js +1 -0
- package/dist/preview/chunk.6HY6ZGEE.js +5 -0
- package/dist/preview/{chunk.K5YFUMRS.js → chunk.6LXIEM6B.js} +1 -1
- package/dist/preview/chunk.6MQ5NT7S.js +1 -0
- package/dist/preview/chunk.6P6NGZ6D.js +1 -0
- package/dist/preview/{chunk.XIVELWAM.js → chunk.6TLXFMX2.js} +1 -1
- package/dist/preview/chunk.72XP2ARZ.js +1 -0
- package/dist/preview/{chunk.2V7QTIAV.js → chunk.72ZCLEQC.js} +1 -1
- package/dist/preview/{chunk.ITBG37WJ.js → chunk.7BIPZTJB.js} +1 -1
- package/dist/preview/chunk.7VADSNPZ.js +1 -0
- package/dist/preview/{chunk.2VYGDY5Z.js → chunk.7VP6Y6D2.js} +1 -1
- package/dist/preview/{chunk.S7SHWDPR.js → chunk.7ZKBYXUM.js} +1 -1
- package/dist/preview/chunk.AK7NGFEX.js +6 -0
- package/dist/preview/{chunk.2VIS2NAT.js → chunk.ANS2IEEV.js} +1 -1
- package/dist/preview/{chunk.UDYFGYJP.js → chunk.B6JRTW3A.js} +1 -1
- package/dist/preview/chunk.BCQWAFGD.js +1 -0
- package/dist/preview/{chunk.7SRSE5IS.js → chunk.BFAFCVL4.js} +1 -1
- package/dist/preview/chunk.BGAC3B7X.js +1 -0
- package/dist/preview/chunk.BMENTGDC.js +21 -0
- package/dist/preview/chunk.BOCVLC7X.js +1 -0
- package/dist/preview/{chunk.7VAHHEDX.js → chunk.BUVTUAB5.js} +1 -1
- package/dist/preview/chunk.BXBEGMPO.js +22 -0
- package/dist/preview/{chunk.4XCYZRZ3.js → chunk.BZ7QWHAE.js} +1 -1
- package/dist/preview/chunk.C2C3AXGI.js +1141 -0
- package/dist/preview/chunk.CBXS23YH.js +23 -0
- package/dist/preview/chunk.CEQQIW7Z.js +1 -0
- package/dist/preview/chunk.CEVGND3Y.js +6 -0
- package/dist/preview/{chunk.WHX47OJM.js → chunk.CTASTRQN.js} +1 -1
- package/dist/preview/chunk.CU2WCYMK.js +1 -0
- package/dist/preview/{chunk.7CLKGKSF.js → chunk.CVPMSPCH.js} +1 -1
- package/dist/preview/chunk.DEHIR4EG.js +1 -0
- package/dist/preview/chunk.DPJNGFEZ.js +4 -0
- package/dist/preview/chunk.DQFHIJFN.js +1 -0
- package/dist/preview/chunk.DSYP43NN.js +1 -0
- package/dist/preview/chunk.DTCAUPLC.js +1 -0
- package/dist/preview/{chunk.4U45EY5M.js → chunk.DZFM6GSY.js} +1 -1
- package/dist/preview/chunk.E3UL4MCD.js +35 -0
- package/dist/preview/chunk.E4VRRWFP.js +1 -0
- package/dist/preview/chunk.E7EWNWAN.js +1 -0
- package/dist/preview/chunk.EG7OOJH5.js +1 -0
- package/dist/preview/{chunk.TQ2G4AM4.js → chunk.EMFOMSMI.js} +1 -1
- package/dist/preview/{chunk.5B7NG6WH.js → chunk.EQ4OODGO.js} +1 -1
- package/dist/preview/{chunk.CJHYGRWV.js → chunk.ES63XSIM.js} +1 -1
- package/dist/preview/chunk.EUAO4QNV.js +1 -0
- package/dist/preview/{chunk.47N2G7A5.js → chunk.EXYCN4WI.js} +1 -1
- package/dist/preview/chunk.F4VB6Q2W.js +1 -0
- package/dist/preview/chunk.F7672TKJ.js +1 -0
- package/dist/preview/chunk.FA42HCPW.js +1 -0
- package/dist/preview/{chunk.DLWFULWE.js → chunk.FBILPNGH.js} +1 -1
- package/dist/preview/chunk.FBJAQPZ6.js +1 -0
- package/dist/preview/{chunk.2DH42I7L.js → chunk.FDZE5LTJ.js} +2 -2
- package/dist/preview/chunk.FFOD5B4B.js +2 -0
- package/dist/preview/{chunk.TA2JTUNX.js → chunk.FIFUMX5X.js} +1 -1
- package/dist/preview/{chunk.T4TRJDBF.js → chunk.FK722SHI.js} +1 -1
- package/dist/preview/chunk.FV72U33M.js +1 -0
- package/dist/preview/chunk.FXT5CN32.js +19 -0
- package/dist/preview/chunk.GAFMWOME.js +1 -0
- package/dist/preview/{chunk.OXFDB5BB.js → chunk.GEFXU4VO.js} +1 -1
- package/dist/preview/chunk.GG47EIKO.js +1 -0
- package/dist/preview/chunk.GME63ZHI.js +1 -0
- package/dist/preview/{chunk.PVDDSBRG.js → chunk.GNEOSHQ6.js} +1 -1
- package/dist/preview/chunk.HOCD7KIR.js +1 -0
- package/dist/preview/chunk.HSSIMVVM.js +1 -0
- package/dist/preview/{chunk.ZA5TDCBC.js → chunk.I2737CPF.js} +1 -1
- package/dist/preview/chunk.I4Z7HVRT.js +1 -0
- package/dist/preview/chunk.IAEHUSQQ.js +1 -0
- package/dist/preview/chunk.IGK7EZCX.js +1 -0
- package/dist/preview/chunk.INHS3KTK.js +1 -0
- package/dist/preview/{chunk.JHUCKEJS.js → chunk.IWYMKGZZ.js} +1 -1
- package/dist/preview/chunk.J2MM6BUW.js +1 -0
- package/dist/preview/{chunk.JOM6MFVE.js → chunk.J7W2OFHY.js} +1 -1
- package/dist/preview/chunk.JMXXA4YG.js +1 -0
- package/dist/preview/chunk.JMYUQNXN.js +6 -0
- package/dist/preview/chunk.JO2X52D4.js +1 -0
- package/dist/preview/{chunk.YEXFVDRA.js → chunk.JXNVNFV4.js} +1 -1
- package/dist/preview/chunk.K6DFXDPZ.js +1 -0
- package/dist/preview/{chunk.WPQP54FM.js → chunk.KACSYPEV.js} +1 -1
- package/dist/preview/{chunk.R5MLRKAO.js → chunk.KBPJ7X7W.js} +1 -1
- package/dist/preview/chunk.KF27ME27.js +1 -0
- package/dist/preview/{chunk.WX23K7ZU.js → chunk.KSIEO5W7.js} +1 -1
- package/dist/preview/chunk.L25DCT5S.js +1 -0
- package/dist/preview/{chunk.UDU545CL.js → chunk.LETAQTLJ.js} +1 -1
- package/dist/preview/{chunk.VZAF3452.js → chunk.LGRVEHXT.js} +2 -2
- package/dist/preview/chunk.LINSO5PN.js +1 -0
- package/dist/preview/{chunk.XJWKIXPV.js → chunk.LLIURXFP.js} +1 -1
- package/dist/preview/{chunk.BVIJXL4J.js → chunk.LSN2IPAI.js} +1 -1
- package/dist/preview/chunk.M2JCFNHJ.js +1 -0
- package/dist/preview/{chunk.B3WVCSW5.js → chunk.M5FP4Y4Q.js} +1 -1
- package/dist/preview/{chunk.YSBTE3PX.js → chunk.M6ZN2KUO.js} +1 -1
- package/dist/preview/chunk.MODLZJD4.js +25 -0
- package/dist/preview/chunk.MWGZKZD6.js +1 -0
- package/dist/preview/{chunk.2JEN2RCB.js → chunk.NJRLJEJY.js} +1 -1
- package/dist/preview/chunk.NYLKG25K.js +4 -0
- package/dist/preview/{chunk.YMXWS4XN.js → chunk.OEIWIZCP.js} +1 -1
- package/dist/preview/{chunk.DQAMVVE6.js → chunk.OJY7VJ7D.js} +1 -1
- package/dist/preview/chunk.OMT4QUZY.js +23 -0
- package/dist/preview/{chunk.Z26T5E76.js → chunk.ONYBW45K.js} +1 -1
- package/dist/preview/chunk.OO2OP76C.js +1 -0
- package/dist/preview/{chunk.UJNLT3L6.js → chunk.OOSIKCOS.js} +1 -1
- package/dist/preview/{chunk.B6JR7EQO.js → chunk.OPTYYIGC.js} +1 -1
- package/dist/preview/{chunk.TMHVYI5R.js → chunk.OTV5XTBB.js} +1 -1
- package/dist/preview/{chunk.F6BNFLQM.js → chunk.OWFS2YDQ.js} +1 -1
- package/dist/preview/{chunk.CXDGE5ZS.js → chunk.OWO3OV62.js} +1 -1
- package/dist/preview/{chunk.4VRX7FCO.js → chunk.PAGEGBUD.js} +1 -1
- package/dist/preview/{chunk.NGRL3QOI.js → chunk.PDDIQ6PK.js} +1 -1
- package/dist/preview/{chunk.OW3M4OBN.js → chunk.PFQBCHQA.js} +1 -1
- package/dist/preview/{chunk.LDMBJC3B.js → chunk.PPSYUOH7.js} +1 -1
- package/dist/preview/{chunk.GH5UBSQI.js → chunk.PSQYDCVM.js} +1 -1
- package/dist/preview/chunk.QDVGHI7R.js +1 -0
- package/dist/preview/chunk.QFHWG4LN.js +1 -0
- package/dist/preview/chunk.QGIM2WAY.js +1 -0
- package/dist/preview/chunk.QHMHUL6B.js +3 -0
- package/dist/preview/chunk.QOS5T46W.js +1 -0
- package/dist/preview/{chunk.E4TXLT25.js → chunk.QPF4KSAW.js} +1 -1
- package/dist/preview/chunk.QQAZQDRW.js +1 -0
- package/dist/preview/chunk.QU52E5RG.js +3 -0
- package/dist/preview/{chunk.REXU6ARY.js → chunk.QWNSHISU.js} +2 -2
- package/dist/preview/chunk.RSMCTI2N.js +1 -0
- package/dist/preview/chunk.RWIN3POV.js +1 -0
- package/dist/preview/chunk.SSF47GUY.js +1 -0
- package/dist/preview/chunk.T6DPWW2K.js +3 -0
- package/dist/preview/chunk.TA36WBHK.js +1 -0
- package/dist/preview/chunk.TBY5IR7C.js +1 -0
- package/dist/preview/chunk.TGEL6EUA.js +1 -0
- package/dist/preview/chunk.TTGKX7LT.js +1 -0
- package/dist/preview/chunk.TXHYGFIZ.js +1 -0
- package/dist/preview/chunk.U3ED7W2U.js +1 -0
- package/dist/preview/chunk.U3HERHAI.js +88 -0
- package/dist/preview/chunk.U6QXLNHF.js +15 -0
- package/dist/preview/{chunk.P4TAX3HE.js → chunk.U6TEW6YD.js} +1 -1
- package/dist/preview/chunk.UJPX3BUV.js +1 -0
- package/dist/preview/chunk.V5I4GZEY.js +1 -0
- package/dist/preview/{chunk.HZPRMHSL.js → chunk.V7W5AQKL.js} +1 -1
- package/dist/preview/{chunk.77MLXWZV.js → chunk.VGHO3VCB.js} +1 -1
- package/dist/preview/{chunk.YIZPW7IK.js → chunk.VKZIEZ5C.js} +2 -2
- package/dist/preview/chunk.VT2YGDK2.js +1 -0
- package/dist/preview/{chunk.XCLW4GP7.js → chunk.W4YDPHCQ.js} +1 -1
- package/dist/preview/{chunk.2TCOLAL2.js → chunk.W53YNBSM.js} +1 -1
- package/dist/preview/chunk.WAB3L3ZI.js +1 -0
- package/dist/preview/chunk.WSDJPXJD.js +1 -0
- package/dist/preview/chunk.WSO7JOW5.js +1 -0
- package/dist/preview/{chunk.4DZOAB4D.js → chunk.WVLEGCRI.js} +1 -1
- package/dist/preview/chunk.XK65Y2KX.js +1 -0
- package/dist/preview/chunk.XMQG2PSM.js +50 -0
- package/dist/preview/{chunk.WFCE7NLK.js → chunk.XOE4KNP2.js} +2 -2
- package/dist/preview/chunk.Y7QDQ3WF.js +1 -0
- package/dist/preview/chunk.YIPXZUTT.js +2 -0
- package/dist/preview/chunk.YNEHJWJV.js +2 -0
- package/dist/preview/chunk.YXEO3Y65.js +1 -0
- package/dist/preview/chunk.Z274CL7J.js +1 -0
- package/dist/preview/chunk.Z7Y3R3YR.js +3 -0
- package/dist/preview/{chunk.JS2UZYGB.js → chunk.ZBVYD4OX.js} +1 -1
- package/dist/preview/{chunk.P6FNJR6E.js → chunk.ZD7T234N.js} +1 -1
- package/dist/preview/{chunk.2G5WLG3Z.js → chunk.ZQR2SN65.js} +1 -1
- package/dist/preview/chunk.ZR2TP3BF.js +111 -0
- package/dist/preview/chunk.ZRBGYXAO.js +6 -0
- package/dist/preview/index.html +57 -55
- package/dist/preview/page.js +2 -2
- package/dist/preview/splash.js +17 -14
- package/package.json +6 -6
- package/dist/preview/chunk.2D7K2IJQ.js +0 -4
- package/dist/preview/chunk.2E62YCMZ.js +0 -1
- package/dist/preview/chunk.2HV5FF6O.js +0 -1
- package/dist/preview/chunk.2JDAUKSN.js +0 -1133
- package/dist/preview/chunk.37I45R6V.js +0 -35
- package/dist/preview/chunk.3FKKH2XU.js +0 -74
- package/dist/preview/chunk.3J7XLJP2.js +0 -1
- package/dist/preview/chunk.3L37FY3G.js +0 -4
- package/dist/preview/chunk.3OEODIHB.js +0 -1
- package/dist/preview/chunk.3RD4JHVG.js +0 -88
- package/dist/preview/chunk.3RUV4HE4.js +0 -1
- package/dist/preview/chunk.3SAESG6X.js +0 -1
- package/dist/preview/chunk.4HTB6TX2.js +0 -1
- package/dist/preview/chunk.4Q5PCMGZ.js +0 -18
- package/dist/preview/chunk.52MBXPEK.js +0 -1
- package/dist/preview/chunk.5AD2QHWH.js +0 -3
- package/dist/preview/chunk.5HJ2GTKZ.js +0 -1
- package/dist/preview/chunk.5IEZF433.js +0 -2
- package/dist/preview/chunk.5PPCK7QT.js +0 -1
- package/dist/preview/chunk.6NRWLCIZ.js +0 -5
- package/dist/preview/chunk.75JQCTR6.js +0 -1
- package/dist/preview/chunk.7AOEZJRM.js +0 -1
- package/dist/preview/chunk.7ZG77OI3.js +0 -1
- package/dist/preview/chunk.7ZHH7WBN.js +0 -1
- package/dist/preview/chunk.AJEK3I5X.js +0 -6
- package/dist/preview/chunk.APRWUIE3.js +0 -1
- package/dist/preview/chunk.ATHLE33D.js +0 -1
- package/dist/preview/chunk.B2YTHEX5.js +0 -1
- package/dist/preview/chunk.BN42H3C6.js +0 -1
- package/dist/preview/chunk.CC7P435K.js +0 -9
- package/dist/preview/chunk.CM65MCHA.js +0 -1
- package/dist/preview/chunk.DJIF7IAQ.js +0 -2
- package/dist/preview/chunk.DMENNIHT.js +0 -1
- package/dist/preview/chunk.DN7UCBOA.js +0 -1
- package/dist/preview/chunk.DVSTLVIH.js +0 -15
- package/dist/preview/chunk.DYRULRFX.js +0 -1
- package/dist/preview/chunk.FN34P4IS.js +0 -1
- package/dist/preview/chunk.FUPYIOXZ.js +0 -1
- package/dist/preview/chunk.FXRYMT3U.js +0 -1
- package/dist/preview/chunk.G5BVZLCM.js +0 -1
- package/dist/preview/chunk.G7YLK4PX.js +0 -1
- package/dist/preview/chunk.GF62K25C.js +0 -1
- package/dist/preview/chunk.GFQPO3NC.js +0 -1
- package/dist/preview/chunk.GHHKRFPD.js +0 -1
- package/dist/preview/chunk.GP5DAA4P.js +0 -3
- package/dist/preview/chunk.HPG6CNKM.js +0 -1
- package/dist/preview/chunk.HSJEOM3W.js +0 -1
- package/dist/preview/chunk.IQGSEAQ2.js +0 -5
- package/dist/preview/chunk.K2HDEL7I.js +0 -1
- package/dist/preview/chunk.K2PXP5H6.js +0 -1
- package/dist/preview/chunk.K54ISAXN.js +0 -1
- package/dist/preview/chunk.KHXRJLLU.js +0 -50
- package/dist/preview/chunk.KMIFSPGQ.js +0 -1
- package/dist/preview/chunk.L4V5VLSM.js +0 -1
- package/dist/preview/chunk.LTOQ22ZJ.js +0 -1
- package/dist/preview/chunk.M5VHUIDB.js +0 -1
- package/dist/preview/chunk.N643PVQA.js +0 -1
- package/dist/preview/chunk.NJSK3UO2.js +0 -6
- package/dist/preview/chunk.NRPBTV6O.js +0 -21
- package/dist/preview/chunk.O7HHNQK4.js +0 -2
- package/dist/preview/chunk.PR74PGLC.js +0 -1
- package/dist/preview/chunk.QROPDEJF.js +0 -1
- package/dist/preview/chunk.QRT6BZR6.js +0 -1
- package/dist/preview/chunk.RDA35HZB.js +0 -2
- package/dist/preview/chunk.S6QZBWCJ.js +0 -1
- package/dist/preview/chunk.SADHOSRC.js +0 -19
- package/dist/preview/chunk.SJHUC4TL.js +0 -1
- package/dist/preview/chunk.SL5FXE3R.js +0 -1
- package/dist/preview/chunk.T4JP6BGP.js +0 -1
- package/dist/preview/chunk.TOLW64EO.js +0 -1
- package/dist/preview/chunk.TP3PZRHE.js +0 -1
- package/dist/preview/chunk.TUR2DA2M.js +0 -1
- package/dist/preview/chunk.TYIBLD2D.js +0 -1
- package/dist/preview/chunk.UD2GGG7L.js +0 -1
- package/dist/preview/chunk.UN2IAA5R.js +0 -1
- package/dist/preview/chunk.VLX7YWVH.js +0 -25
- package/dist/preview/chunk.VT4YBFZL.js +0 -1
- package/dist/preview/chunk.WMARJ5E3.js +0 -1
- package/dist/preview/chunk.X36BYTEG.js +0 -1
- package/dist/preview/chunk.XEG7ZDRG.js +0 -1
- package/dist/preview/chunk.XQ5RTPEF.js +0 -1
- package/dist/preview/chunk.YLOGIJOH.js +0 -1
- package/dist/preview/chunk.Z4XGEV34.js +0 -1
- package/dist/preview/chunk.ZNDVJGTY.js +0 -1
- package/dist/preview/chunk.ZQGLPP7A.js +0 -1
- /package/dist/preview/{chunk.GZHZLJBF.js → chunk.MIE4TJRW.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as b,d as y}from"./chunk.NYLKG25K.js";var e={},h={empty:!0},N={id:"text",class:"text",title:"text",lang:"text",dir:{oneOf:["ltr","rtl","auto"]},hidden:"text",tabindex:{oneOf:["-1","0"]},role:"text",style:"style",translate:{oneOf:["yes","no"]},spellcheck:{oneOf:["true","false"]},draggable:{oneOf:["true","false"]},inert:"boolean"},p={div:e,section:e,article:e,aside:e,header:e,footer:e,nav:e,hgroup:e,search:e,address:e,figure:e,figcaption:e,blockquote:e,p:e,pre:e,hr:h,br:h,wbr:h,h1:e,h2:e,h3:e,h4:e,h5:e,h6:e,span:e,strong:e,em:e,b:e,i:e,u:e,s:e,small:e,mark:e,abbr:e,cite:e,q:e,code:e,kbd:e,samp:e,var:e,sub:e,sup:e,dfn:e,bdi:e,bdo:e,ruby:e,rt:e,rp:e,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:{attributes:{href:"link"}},ul:e,menu:e,dl:e,dt:e,dd:e,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:e,caption:e,thead:e,tbody:e,tfoot:e,tr:e,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:e,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:e,output:e,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":{empty:!0,attributes:{autoplay:"boolean",cover:"boolean"}}},L=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask","filter","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],U={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(L.map(r=>[r,"css"]))},d={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},g={viewBox:"geometry",preserveAspectRatio:"geometry"},w={oneOf:["userSpaceOnUse","objectBoundingBox"]},E={oneOf:["R","G","B","A"]},l={...d,in:"text",result:"text"},A={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},f={svg:{attributes:{...d,...g}},g:e,defs:e,symbol:{attributes:{...d,...g,refX:"geometry",refY:"geometry"}},use:{attributes:{...d,href:"fragment"}},title:e,desc:e,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...d,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...A}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...A}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...d,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...d,...g,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...g,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}},a:e,filter:{attributes:{...d,filterUnits:w,primitiveUnits:w}},feBlend:{attributes:{...l,in2:"text",mode:"text"}},feColorMatrix:{attributes:{...l,type:{oneOf:["matrix","saturate","hueRotate","luminanceToAlpha"]},values:"geometry"}},feComponentTransfer:{attributes:l},...Object.fromEntries(["feFuncR","feFuncG","feFuncB","feFuncA"].map(r=>[r,{attributes:{type:{oneOf:["identity","table","discrete","linear","gamma"]},tableValues:"geometry",slope:"number",intercept:"number",amplitude:"number",exponent:"number",offset:"number"}}])),feComposite:{attributes:{...l,in2:"text",operator:{oneOf:["over","in","out","atop","xor","lighter","arithmetic"]},k1:"number",k2:"number",k3:"number",k4:"number"}},feDisplacementMap:{attributes:{...l,in2:"text",scale:"number",xChannelSelector:E,yChannelSelector:E}},feDropShadow:{attributes:{...l,dx:"number",dy:"number",stdDeviation:"geometry"}},feFlood:{attributes:l},feGaussianBlur:{attributes:{...l,stdDeviation:"geometry",edgeMode:{oneOf:["duplicate","wrap","none"]}}},feMerge:{attributes:l},feMergeNode:{attributes:{in:"text"}},feMorphology:{attributes:{...l,operator:{oneOf:["erode","dilate"]},radius:"geometry"}},feOffset:{attributes:{...l,dx:"number",dy:"number"}},feTurbulence:{attributes:{...d,result:"text",type:{oneOf:["fractalNoise","turbulence"]},baseFrequency:"geometry",numOctaves:"number",seed:"number",stitchTiles:{oneOf:["stitch","noStitch"]}}}};var v=["alert","alertdialog","dialog","banner","main","navigation","contentinfo","complementary","search","form","application","status","log","marquee","timer"],re=["region"],x={nav:"div",header:"div",footer:"div",aside:"div",search:"div",output:"span"},R={section:["aria-label","title"]},ne=["aria-labelledby","aria-describedby"];function C(r){return/^aria-[a-z]+$/.test(r)}function j(r){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(r)}var O=4e3,_=1e5,m=512e3,oe=1e4,se="http://www.w3.org/1999/xhtml",ae="http://www.w3.org/2000/svg",B=new Map(Object.keys(f).map(r=>[r.toLowerCase(),r]));function S(r){return B.get(r.toLowerCase())}function T(r,o,t){let s=t.toLowerCase(),i=r==="html"?[p[o]?.attributes,N]:[f[o]?.attributes,U],n=r==="svg"&&s==="xlink:href"?"href":s;for(let a of i)if(a){for(let[u,c]of Object.entries(a))if(u.toLowerCase()===n)return{name:u,kind:c}}if(C(s)||j(s))return{name:s,kind:"text"}}function de(r,o){if(o==="svg"){let s=S(r);return s?{namespace:"svg",name:s}:{refused:{reason:"element",element:r}}}let t=r.toLowerCase();return t==="svg"?{namespace:"svg",name:"svg"}:Object.prototype.hasOwnProperty.call(p,t)?Object.prototype.hasOwnProperty.call(x,t)?{namespace:"html",name:x[t],as:t}:{namespace:"html",name:t}:{refused:{reason:"element",element:r}}}function me(r,o){return(r==="html"?p[o]:f[o])?.empty===!0}var z=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/,G=/^[0-9A-Za-z\s.,+\-%()]*$/,P=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,I=/^data:image\/(png|gif|jpeg|webp|avif|bmp|svg\+xml)(;[A-Za-z0-9=._+-]+)*,/i,$=/^\/graview\/assets\/[0-9a-f]{64}\.(png|gif|jpe?g|webp|avif|svg|ico)$/,k=/\/graview\/assets\/[0-9a-f]{64}\.(png|gif|jpe?g|webp|avif|svg|ico)$/,D=/^\/(?!\/)(?!(?:.*\/)?\.\.?(?:\/|$))(?!.*%(?:2e|2f|5c))[^\\\s?#"'<>]*$/i;function V(r,o){if($.test(r))return r;let t=r;if(/^https?:\/\//i.test(r))try{let s=new URL(r);if(o==="null"||s.origin!==o||s.username!==""||s.password!==""||s.search!==""||s.hash!=="")return;t=r.slice(s.origin.length)}catch{return}if(D.test(t))return k.exec(t)?.[0]}function ce(r,o={},t){let s=r.length>120?`${r.slice(0,119)}\u2026`:r,i=M(o.origins),n=k.exec(r.split(/[?#]/)[0])?.[0],a=t!==void 0&&t>m?` It is a data: image of ${t.toLocaleString("en-US")} characters, more than the ${m.toLocaleString("en-US")} a view's own data: image may be. A picture on a record is drawn at any size by the src the host hands the view (pictures in its manifest), used as it was handed.`:n?o.assets?` It is the app's own image only by its path, or under the app's base on this page's origin: write it as its path, ${n}.`:" This host has not said where the app's own images live (asset, on the view's definition), so a view here cannot draw one by its path.":/^https:\/\//i.test(r)?i.length>0?` Its origin is not one the host lists for images (${i.join(", ")}).`:" The host lists no origin a view's images may come from (images.origins, on the view's definition).":"",u=["a data: image",...o.assets?["the app's own image by the path add_image answered (/graview/assets/<sha256>.<ext>)"]:[],"a picture on a record (pictures in its manifest)",...i.length>0?[`an https: image from ${i.join(", ")}`]:[]];return`The image "${s}" was not drawn.${a} A view here shows ${u.slice(0,-1).join(", ")} or ${u[u.length-1]}.`}function M(r){return(r??[]).flatMap(o=>{try{let t=new URL(o);return t.protocol==="https:"&&t.hostname!==""&&t.username===""&&t.password===""?[t.origin]:[]}catch{return[]}})}function F(r,o){if(!(!o||o.length===0||!/^https:\/\//i.test(r)))try{let t=new URL(r);return t.protocol!=="https:"||t.username!==""||t.password!==""?void 0:M(o).includes(t.origin)?t.href:void 0}catch{return}}function ge(r,o,t,s,i){let n=T(r,o,t);if(!n)return{refused:{reason:"attribute",element:o,name:t}};if(r==="html"&&R[o]?.includes(n.name))return{refused:{reason:"attribute",element:o,name:t}};if(s===null)return{name:n.name,value:null};let a=H(n.name,n.kind,s,i);return"refused"in a?{refused:{...a.refused,element:o,...n.kind==="image"&&a.refused.reason==="url"?{address:s.slice(0,200),...s.length>m?{length:s.length}:{}}:{},...n.kind==="link"?{address:s.slice(0,200)}:{}}}:n.name==="role"&&a.value.split(/\s+/).some(u=>v.includes(u.toLowerCase()))?{refused:{reason:"value",element:o,name:t}}:n.name==="aria-live"&&!["polite","off"].includes(a.value.toLowerCase())?{refused:{reason:"value",element:o,name:t}}:{name:n.name,value:a.value,...a.dropped?{dropped:a.dropped.map(u=>({reason:u.reason==="url"?"url":"css",element:o,name:n.name,css:u}))}:{}}}function H(r,o,t,s){let i=(n,a)=>({refused:{reason:n,name:r,...a?{css:a}:{}}});if(o==="geometry")return t.length>_||!G.test(t)||/url/i.test(t)?i("value"):{value:t};if(o==="image"){let n=s.picture?.(t);if(n!==void 0)return{value:n};if(t.length>m)return i("url");if(I.test(t))return{value:t};if(t.startsWith(`blob:${s.origin}/`)&&/^blob:[^\s"'<>]+$/.test(t))return{value:t};let a=s.asset?V(t,s.origin):void 0;if(a!==void 0){let c=s.asset(a);if(c)return{value:c}}let u=F(t,s.imageOrigins);return u?{value:u}:i("url")}if(o==="link"){let n=s.link?.(t);return n===void 0?i("url"):{value:n}}if(t.length>O)return i("value");if(typeof o=="object"){let n=o.oneOf.find(a=>a.toLowerCase()===t.toLowerCase());return n===void 0?i("value"):{value:n}}switch(o){case"text":return{value:t};case"number":return z.test(t.trim())&&Number.isFinite(Number(t))?{value:t.trim()}:i("value");case"boolean":return{value:""};case"fragment":return P.test(t)?{value:t}:i("url");case"style":{let n=b(t,O);return n.refused.length>0&&n.css===""?i(n.refused[0].reason==="url"?"url":"css",n.refused[0]):{value:n.css,...n.refused.length>0?{dropped:n.refused}:{}}}case"css":{let n=y(r,t);return"refused"in n?i(n.refused.reason==="url"?"url":"css",n.refused):{value:n.value}}}}export{re as a,ne as b,oe as c,se as d,ae as e,de as f,me as g,ce as h,ge as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,i as E}from"./chunk.FFOD5B4B.js";import{e as z}from"./chunk.Z7Y3R3YR.js";import{a as M}from"./chunk.YXEO3Y65.js";import{Ab as g,C as y,Da as R,Ga as j,Na as O,Qb as N,Rb as k,Ya as P,Za as D,ec as T,ga as S,jb as L,nc as Z,oc as q,pc as K,qc as v,yb as V,zb as I}from"./chunk.6HY6ZGEE.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=T(r);if(c)return{control:"node",name:n,optional:o,kinds:c};let m=O(r);if(m)return{control:"linked",name:n,optional:o,relation:m};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(p=>A(p?.[u])!==void 0));if(s)return{control:"variant",name:n,optional:o,tag:s,options:d.map((u,p)=>({value:A(a[p]?.[s])??"",fields:Object.entries(a[p]??{}).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,a=d===void 0?void 0:F(n,d);return a?.control==="choice"?{...a,optional:o,multiple:!0}:a!==void 0?{control:"list",name:n,optional:o,item:a}:{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.partial?{partial:!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 q(H(r.input),Z(n,r))}var x="visitor";function gn(n,r,o,e){let t=N.keptFrom?.(n,r),c=new Set;if(!t)return c;let m=Object.keys(o.input.shape??{});for(let a of o.creates??[]){let l=t({id:"\0new",kind:a});for(let s of m)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)&&m.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 m=V(o),f=(l,s)=>{let u=c.filter(p=>p.kinds.includes(l)&&g(p,m));return u.some(k)?L.has(s)||u.some(p=>!k(p)||(p.fields===void 0||p.fields.includes(s))&&!p.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 K(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,m=X(c),f=_(n.schema,n.policy,m,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,m,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 +1 @@
|
|
|
1
|
-
import{a as r,b as m,d as k,e as y}from"./chunk.Q355UPFG.js";import"./chunk.
|
|
1
|
+
import{a as r,b as m,d as k,e as y}from"./chunk.Q355UPFG.js";import"./chunk.U3HERHAI.js";import"./chunk.FBILPNGH.js";import"./chunk.MODLZJD4.js";import"./chunk.SDO3U72B.js";import"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var i="way-back",b='[data-testid="notices-toasts"]';function g(t){let o=document.activeElement;o!==null&&o!==document.body&&!o.closest(b)||(t??document).querySelector('[data-graview-app-bar] [data-testid="app-home"]')?.focus({preventScroll:!0})}function E(t,o,a,d,h){if(t.past)return a?.dismiss(i),()=>{};let c=h?.closest("[data-graview-embed]"),s,f=e=>{if(e!==void 0&&r(t,o)?.batch!==e)return!1;try{let n=k(t,o);return n&&a?.notify({kind:"toast",id:i,sentence:`Took back \u201C${n.intent}\u201D`}),n!==void 0}catch(n){return a?.notify({kind:"toast",id:i,tone:"warn",sentence:n instanceof Error?n.message:String(n)}),!0}},u=()=>{let e=m(t,o,d);if(d=t.batches().length,e){let n=s=e.batch;a?.notify({kind:"toast",id:i,sentence:e.intent,timeout:1e4,action:{label:"Take back",keys:"Meta+Z Control+Z",onSelect:()=>(g(c),f(n))}})}else s&&r(t,o)?.batch!==s&&(s=void 0,a?.dismiss(i))},l=e=>{y(e)&&(!c||c.contains(e.target))&&f()&&e.preventDefault()};u();let p=t.subscribe(u);return document.addEventListener("keydown",l),(e=!1)=>{p(),document.removeEventListener("keydown",l),e&&s&&a?.dismiss(i)}}export{E as sceneWay};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as v,F as C,G as S,M as G,q as O}from"./chunk.U3HERHAI.js";import{G as I,c as V,ea as m,j as y,l as p,m as g,n as u,o as D,v as B,z as E}from"./chunk.MODLZJD4.js";import{$d as R,Yd as P,Zd as k,ae as T,pa as M}from"./chunk.6HY6ZGEE.js";import{b as A}from"./chunk.AJZBJBMO.js";var W=A(I(),1);function j(e,t){try{t.length===0?localStorage.removeItem(v(e)):localStorage.setItem(v(e),JSON.stringify(t))}catch{}}function F(e,t){j(e,[...S(e).filter(n=>n.title!==t.title),t])}function H(e,t){j(e,S(e).filter(n=>n.title!==t))}function J(e,t){for(let n of e.places().filter(o=>o.title===t))e.forget?.(n.kind,n.as)}var U=e=>e===!0?{written:!0}:typeof e=="object"&&e!==null?{written:e.kept===!0,...e.said?{said:e.said}:{}}:{written:!1},N=e=>({title:e.title,lens:e.lens,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}});function Z(e,t){let n=o=>t.some(r=>r.title===o||r.as===P(o));if(!n(e))return e;for(let o=2;;o++)if(!n(`${e} ${o}`))return`${e} ${o}`}function ie(e){let{store:t,views:n,brand:o,seatTalk:r,onKeepLens:d}=m(),h=(0,W.useContext)(O),L=C(o,t.schema),b=async f=>{let{edit:i}=f;if(f.written&&d)try{await d({op:"remove-lens",title:i.title,on:i.on})}catch{}H(L,i.title),J(n,i.title),h?.dismiss(`kept:${i.title}`),r.setTurns(l=>[...l.map(s=>s.kept&&s.kept.edit.title===i.title&&!s.kept.taken?{...s,kept:{...s.kept,taken:!0}}:s),{role:"seat",text:`Took \u201C${i.title}\u201D back out of the places.`}]);let a=M(t.schema,i.on);e({to:"kind",kind:i.on,title:a,address:k(t.schema,i.on),said:`Went to ${a}.`})};return{keep:async f=>{let i=Z(f.edit.title,n.places()),a={...f.edit,title:i},l=!1,s;if(d)try{({written:l,said:s}=U(await d(a)))}catch{l=!1}l||F(L,N(a)),G(n,t.schema,[N(a)]);let K=n.places(),c=K.find(w=>w.title===i),x=s??(l?`Kept \u201C${i}\u201D as a lens: it is in the places now.`:d?`Kept \u201C${i}\u201D as your own lens. Ask the owner to keep it for everyone.`:`Kept \u201C${i}\u201D as your own lens.`),$={edit:a,written:l};r.setDraft(null),r.setTurns(w=>[...w,{role:"seat",text:x,kept:$}]),h?.notify({kind:"toast",id:`kept:${i}`,sentence:x,timeout:1e4,action:{label:"Take back",onSelect:()=>void b($)}}),c&&e({to:"picture",kind:c.kind,as:c.as,title:i,address:R(c.as,T(c,K)?k(t.schema,c.kind).slice(1):void 0),said:`Went to ${i}.`})},takeBack:b}}var q=A(I(),1);function _(e,t){switch(t.to){case"place":return{view:V("#")};case"picture":return{view:u(E(p(e,"filter",null),t.kind,t.as),[])};case"kind":{let n=D(g({...y(e,B(t.kind)),relation:null},!1),!0);return{view:u(p(p(n,"view",null),"filter",t.filter??null),[])}}case"record":return{view:u(y(g(p(p(e,"view",null),"filter",null),!1),t.id),[t.id])};case"problems":return{pane:"problems"}}}function z(e){let t=typeof document>"u"?null:document.querySelector('[data-testid="standing"]');t&&t.getAttribute("aria-expanded")==="true"!==e&&t.click()}function ae(){let{setView:e,seatTalk:t}=m();return(0,q.useCallback)(n=>{t.get().draft&&t.setDraft(null),z(n.to==="problems"),n.to!=="problems"&&e(o=>{let r=_(o,n);return"view"in r?r.view:o})},[e,t])}export{ie as a,z as b,ae as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h}from"./chunk.DQFHIJFN.js";import"./chunk.BFAFCVL4.js";import"./chunk.M5FP4Y4Q.js";import"./chunk.V7W5AQKL.js";import"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{h as createLinks,g as judgeDestination,e as listsOf,c as nowhere,f as placeVocabulary,a as placesSaid,b as quoted,d as whereOfWords};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _}from"./chunk.2JEN2RCB.js";import{a as se,b as le,c as ue,d as fe,e as L,f as I,g as ye}from"./chunk.7CLKGKSF.js";import{a as me}from"./chunk.TMHVYI5R.js";import{c as T,e as de,f as pe}from"./chunk.R5MLRKAO.js";import{a as j,b as re,c as te,d as oe,f as G,m as ae,n as b,o as V,p as B,q as v,r as ie}from"./chunk.YMXWS4XN.js";import{b as x,d as ce,e as ge,g as he,i as be,j as we,k as Se}from"./chunk.5AD2QHWH.js";import{$b as ne,Aa as q,Ba as O,C as P,Ca as M,Ka as Q,L as K,W as z,Z as F,_b as ee,ac as C,da as J,ha as X,la as Z,ra as N,ta as Y,ya as E,za as A}from"./chunk.IQGSEAQ2.js";var Re=e=>e.caption?.trim()||e.name,D=e=>A(e)?`${Re(e)}, ${q(e)}`:Re(e);function dn(e){let n=Math.max(0,Math.round(e)),t=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),o=Math.floor(n%3600/60);return r>0?`${r}:${t(o)}:${t(n%60)}`:`${o}:${t(n%60)}`}function Ne(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(t=>{let r=P(n[t]);for(;r?.innerType;)r=P(r.innerType);return M(n[t])!==void 0||r?.type==="array"&&M(r.element)!==void 0})}function sn(e,n){for(let t of Ne(n)){let r=O(e[t]).find(o=>E(o)||A(o));if(r)return r}}var k=e=>{try{return e()}catch{return null}},Ee=e=>typeof e=="string"&&se.includes(e);function Me(e){if(e!==void 0)return Ee(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:k(()=>T(e.expr))}:"neutral"}var Ce=4;function Ve(e){let n=typeof e.list=="string"?k(()=>T(e.list)):null,t=e.sort,r=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.by=="string"?t.by:void 0,o=t&&typeof t=="object"?t.direction:void 0,a=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let y=k(()=>T(r));a=y?{t:"call",fn:"sort",args:[n,y,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,L):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,f=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(f).filter(y=>typeof y[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function ke(e,n=1,t=""){if(!Array.isArray(e)||n>Ce)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let a=o,d=p=>typeof p=="string"?k(()=>de(p)):null,l=p=>typeof p=="string"?k(()=>T(p)):null,i=Me(a.tone),s=typeof a.label=="string"?a.label:void 0,f=p=>Object.hasOwn(a,p),y=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=f("list")?"list":f("headline")?"headline":typeof a.figure=="string"?"number":Le.find(f);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,R=typeof c=="string"&&c?c:`${t}${u}.${m}`;return[{...(()=>{switch(u){case"list":return Ve(a);case"number":{let p=ue.includes(a.as)?a.as:void 0,H=fe.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:d(s)}:{},...H?{emphasis:H}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":{let p=a.lines;return{t:u,parts:d(a[u]),...i?{tone:i}:{},...typeof p=="number"&&Number.isInteger(p)&&p>=0?{lines:p}:{}}}case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=le.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:ke(a.group,n+1,`${R}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:ke(a.show,n+1,`${R}.`)};default:return{t:u}}})(),key:R}]})}var Le=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Ie=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:G(e,{graph:n.graph??ae,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Ie})}}catch(t){return{ok:!1,problem:t instanceof Error?t.message:String(t)}}}function _e(e,n){let t=e.definition?.display?.format?.[n],r=e.fields[n]?.options??[];return t?Object.fromEntries(r.flatMap(o=>{let a=t(o);return a!==X(o)?[[o,a]]:[]})):{}}var De=(e,n,t)=>!e.format&&e.expr?.t==="ident"&&typeof t=="string"&&n.fields[e.expr.name]?.format==="markdown";function S(e,n,t){if(!e)return{text:g,problem:"a template that does not parse"};let r,o;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(De(d,n,l.value))return n.glance?ce(l.value,{markdown:!0}):t&&e.length===1?(o=!0,l.value):ge(l.value);let i=!d.format&&d.expr?.t==="ident"&&n.fields[d.expr.name]?.type==="enum"?d.expr.name:void 0;if(i&&(typeof l.value=="string"||Array.isArray(l.value)))return V(d,ie(l.value,_e(n,i),e.length===1));let s=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?Be(n,d.expr.name):void 0;return V(d,s?C(l.value,s):b(l.value,d.format,n.today,d.formatArgs,n.money,v(n.schema)))}).join(""),...r?{problem:r}:{},...o?{markdown:o}:{}}}var $e=" \xB7 ";function Ue(e,n){if(!e||!n.node)return;let t=[[]];for(let d of e){if(d.text===void 0){t[t.length-1].push(d);continue}d.text.split($e).forEach((i,s)=>{s>0&&t.push([]),i!==""&&t[t.length-1].push({text:i})})}if(t.length<2)return;let r=d=>{let[l]=d;if(!(d.length!==1||!l||l.format||l.expr?.t!=="ident"))return n.fields[l.expr.name]?.type==="enum"?l.expr.name:void 0},o=0,a=t.flatMap(d=>{let l=r(d);if(l){let s=Object.hasOwn(n.node,l)?n.node[l]:void 0;return s==null||s===""?[]:(o++,[{text:x(n.definition,l,s),field:l}])}let i=S(d,n).text.trim();return i===""||i===g?[]:[{text:i}]});return o>0?a:void 0}function Ae(e,n){if(e===void 0)return;if(typeof e=="string")return e;let t=w(e.expr,n);return t.ok&&Ee(t.value)?t.value:"neutral"}function We(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var Ge=(e,n)=>{let t=e.fields[n]?.type;return t==="phone"||t==="place"||t==="duration"?t:be(e.definition,n)},Be=(e,n)=>ee(e.definition?.fields?.shape?.[n])??he(e.definition,n);function He(e,n,t,r,o){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,t.today,[],o?{...t.money,currency:o}:t.money);let a=t.fields[e];if(t.definition?.display?.format?.[e])return x(t.definition,e,n);let d=we(Ge(t,e),n,t.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",t.today,[],t.money);if(a?.type==="datetime"&&typeof n=="string")return z(n,t.money?.locale,t.money?.timeZone);if(a?.type==="enum"&&(typeof n=="string"||Array.isArray(n)))return x(t.definition,e,n);let l=typeof n=="number"?Be(t,e):void 0;if(l)return C(n,l);if(typeof n=="number")return F(n,t.money?.locale,{});let i=O(n);return i[0]?i.map(D).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function Ke(e,n,t,r,o){return typeof e!="number"?String(e):n==="money"?ne(e,t?{...o,currency:t}:o):n==="percent"?b(e,n,r,[],o):F(e,o?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function Oe(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function ze(e,n,t){switch(e.t){case"title":{let r=S(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=S(e.parts,n,!0),o=Ae(e.tone,n),a=n.glance&&!r.problem?Ue(e.parts,n):void 0;return h({t:"text",text:r.text,...o?{tone:o}:{},...e.lines!==void 0?{lines:e.lines}:{},...r.markdown?{markdown:r.markdown}:{},...a?{runs:a}:{}},r.problem)}case"badge":{let r=S(e.parts,n);return h({t:"badge",text:r.text,tone:Ae(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??N(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(o){let y=Q(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,o);return{t:"field",field:e.field,label:r,text:y.length>0?"linked record":g,...y.length>0?{linked:{relation:o,refs:y}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let y=w({t:"ident",name:e.field,at:0},n);y.ok?d=y.value!==null&&typeof y.value=="object"?b(y.value,void 0,n.today,[],n.money,v(n.schema)):y.value:l=y.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?We(d):Se(Ge(n,e.field),d),s=k(()=>He(e.field,d,n,e.as,e.currency))??g,f=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...f?{app:f}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(a=>E(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??N(n.definition,e.field),as:e.as,files:o,text:o.map(D).join(", ")||g}}case"progress":{let r=w(e.value,n),o=w(e.max,n),a=e.label?S(e.label,n):{text:"Progress"},d=e.label?B(e.label,a.text):a.text,l=r.ok?o.ok?a.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?h({t:"progress",label:d,value:r.value,max:o.value,text:`${b(r.value,void 0,n.today)} of ${b(o.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:je(e.blocks,Oe(n))};case"when":{let r=w(e.when,n),o=r.ok&&r.value===!0;return h({t:"when",shown:o,blocks:o?je(e.show,Oe(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=S(e.parts,n),o=Math.min(6,Math.max(1,(t?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:o,text:e.parts?B(e.parts,r.text):r.text},r.problem)}case"number":{let r=w(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?g:Ke(r.value,e.as,e.currency,n.today,n.money),a=e.label?S(e.label,n):void 0;return h({t:"number",text:o,...a&&e.label?{label:B(e.label,a.text)}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return Xe(e,n)}}function je(e,n){let t=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...ze(r,n,o===t),key:r.key}))}function Te(e,n){let t=n.trim().toLowerCase();return e.some(r=>{switch(r.t){case"title":case"headline":return r.text.trim()!=="";case"text":case"badge":return t!==""&&r.text.toLowerCase().includes(t);case"group":return Te(r.blocks,n);case"when":return r.shown&&Te(r.blocks,n);default:return!1}})}var Je=new Set(["every","some","sum","min","max","sort"]);function Gn(e,n){let t=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":t.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,f)=>{f===1&&Je.has(i.fn)||o(s)});return;default:return}},a=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((f,y)=>{let u=s[y];if(u)switch(f.t){case"field":case"image":t.add(f.field);return;case"title":case"text":case"badge":case"headline":a(f.parts);return;case"number":o(f.value),a(f.label);return;case"progress":o(f.value),o(f.max);return;case"group":u.t==="group"&&d(f.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(f.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:t,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function Xe(e,n){let t=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:t,more:0,problem:r.problem};let o=r.value,a=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(a=Ze(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??L),i=l.slice(0,I),s=l.slice(I),f=(e.limit===void 0?d:l.length)-i.length,y=c=>e.group&&n.schema&&c.length>0?Ye(c,e.group,n.schema,n.graph):void 0,u=y(i),m=s.length>0?y(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:t,...i.length===0&&e.empty?{empty:e.empty}:{},more:f,total:d}}function $(e,n,t){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,t)?_(r[t]):void 0;return o?.type==="enum"?o.options??[]:[]}var U=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function Ze(e,n,t){let r=o=>{let a=$(t,o.kind,n).indexOf(String(U(o,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((o,a)=>({node:o,i:a,rank:r(o)})).sort((o,a)=>o.rank-a.rank||o.i-a.i).map(o=>o.node)}function Ye(e,n,t,r){let o=e.some(i=>$(t,i.kind,n.by).length>0)?void 0:ye(n.by);if(o&&r)return qe(e,o,n.headings,t,r);let a=[];for(let i of e)for(let s of $(t,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(y=>U(y,n.by)===i);if(s.length===0)continue;let f=t.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??J(x(f,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String(U(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function qe(e,n,t,r,o){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=v(r),s;for(let u of e){let m=a(u)==="out"?o.out(u.id,n.edge):o.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let R=d.get(c.id)??{node:c,members:[]};R.members.push(u),d.set(c.id,R)}}let f=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:t[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let y=s&&s!=="*"?Y(r.tryDefinition(s),s):void 0;return l.length>0&&f.push({value:null,...y?{heading:`No ${y}`}:{},members:l}),f}function xe(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(xe):e.t==="when"?e.show.some(xe):!1}function ve(e,n){let t=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,a]of Object.entries(t)){let d=_(a);d&&(r[o]=d)}return r}var Pe=new WeakMap;function W(e){let n=Pe.get(e);return n||Pe.set(e,n=me(e)),n}function Qe(e,n,t,r={}){let o=W(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:Z(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(t?t.kind:te)?.computed??[])try{let f=[],y=G(s,{graph:n,subject:t,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>f.push(u)});f.length>0&&(y===null||y instanceof j&&y.nodes.length===0)?d[i]=re(f[0]):a[i]=l(y)}catch(f){if(!(f instanceof oe))throw f;d[i]=f.sentence}return{values:a,refused:d}}function Mn(e,n,t){let{values:r}=Qe(e,n,t);if(Object.keys(r).length===0)return t;let o=a=>Array.isArray(a)?a.map(o):a!==null&&typeof a=="object"?a.label:a;return{...t,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,o(d)]))}}function Cn(e,n){return[...pe(e.tryDefinition(n)).keys()]}var en=500,nn=2e4,Fe=new WeakMap;function rn(e,n){let t=Fe.get(e);t||Fe.set(e,t=new Map);let r=t.get(n);return r||t.set(n,r=ve(e,n)),r}function Dn(e,n,t,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,a=n&&t?o.graph.getNode(t.id)??null:t,d=o.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:f}=r;return{node:a,graph:o.graph,schema:d,kinds:W(d),fields:a?rn(d,a.kind):{},definition:l||void 0,today:r.today??o.today?.()??K(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:f,budget:r.budget??(i?nn:en),...i?{}:{glance:!0}}}export{Re as a,dn as b,Ne as c,sn as d,ke as e,je as f,Te as g,Gn as h,xe as i,W as j,Qe as k,Mn as l,Cn as m,Dn as n};
|
|
1
|
+
import{a as _}from"./chunk.NJRLJEJY.js";import{a as se,b as le,c as ue,d as fe,e as L,f as I,g as ye}from"./chunk.CVPMSPCH.js";import{a as me}from"./chunk.OTV5XTBB.js";import{c as T,e as de,f as pe}from"./chunk.KBPJ7X7W.js";import{a as j,b as re,c as te,d as oe,f as G,m as ae,n as b,o as V,p as B,q as v,r as ie}from"./chunk.OEIWIZCP.js";import{a as x,c as ce,d as ge,f as he,h as be,i as we,j as Se}from"./chunk.Z7Y3R3YR.js";import{$b as ee,Aa as A,Ba as q,C as P,Ca as O,Da as M,L as K,La as Q,W as z,Z as F,ac as ne,bc as C,da as J,ha as X,la as Z,ra as N,ua as Y,za as E}from"./chunk.6HY6ZGEE.js";var Re=e=>e.caption?.trim()||e.name,D=e=>A(e)?`${Re(e)}, ${q(e)}`:Re(e);function dn(e){let n=Math.max(0,Math.round(e)),t=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),o=Math.floor(n%3600/60);return r>0?`${r}:${t(o)}:${t(n%60)}`:`${o}:${t(n%60)}`}function Ne(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(t=>{let r=P(n[t]);for(;r?.innerType;)r=P(r.innerType);return M(n[t])!==void 0||r?.type==="array"&&M(r.element)!==void 0})}function sn(e,n){for(let t of Ne(n)){let r=O(e[t]).find(o=>E(o)||A(o));if(r)return r}}var k=e=>{try{return e()}catch{return null}},Ee=e=>typeof e=="string"&&se.includes(e);function Me(e){if(e!==void 0)return Ee(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:k(()=>T(e.expr))}:"neutral"}var Ce=4;function Ve(e){let n=typeof e.list=="string"?k(()=>T(e.list)):null,t=e.sort,r=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.by=="string"?t.by:void 0,o=t&&typeof t=="object"?t.direction:void 0,a=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let y=k(()=>T(r));a=y?{t:"call",fn:"sort",args:[n,y,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,L):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,f=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(f).filter(y=>typeof y[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function ke(e,n=1,t=""){if(!Array.isArray(e)||n>Ce)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let a=o,d=p=>typeof p=="string"?k(()=>de(p)):null,l=p=>typeof p=="string"?k(()=>T(p)):null,i=Me(a.tone),s=typeof a.label=="string"?a.label:void 0,f=p=>Object.hasOwn(a,p),y=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=f("list")?"list":f("headline")?"headline":typeof a.figure=="string"?"number":Le.find(f);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,R=typeof c=="string"&&c?c:`${t}${u}.${m}`;return[{...(()=>{switch(u){case"list":return Ve(a);case"number":{let p=ue.includes(a.as)?a.as:void 0,H=fe.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:d(s)}:{},...H?{emphasis:H}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":{let p=a.lines;return{t:u,parts:d(a[u]),...i?{tone:i}:{},...typeof p=="number"&&Number.isInteger(p)&&p>=0?{lines:p}:{}}}case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=le.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:ke(a.group,n+1,`${R}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:ke(a.show,n+1,`${R}.`)};default:return{t:u}}})(),key:R}]})}var Le=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Ie=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:G(e,{graph:n.graph??ae,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Ie})}}catch(t){return{ok:!1,problem:t instanceof Error?t.message:String(t)}}}function _e(e,n){let t=e.definition?.display?.format?.[n],r=e.fields[n]?.options??[];return t?Object.fromEntries(r.flatMap(o=>{let a=t(o);return a!==X(o)?[[o,a]]:[]})):{}}var De=(e,n,t)=>!e.format&&e.expr?.t==="ident"&&typeof t=="string"&&n.fields[e.expr.name]?.format==="markdown";function S(e,n,t){if(!e)return{text:g,problem:"a template that does not parse"};let r,o;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(De(d,n,l.value))return n.glance?ce(l.value,{markdown:!0}):t&&e.length===1?(o=!0,l.value):ge(l.value);let i=!d.format&&d.expr?.t==="ident"&&n.fields[d.expr.name]?.type==="enum"?d.expr.name:void 0;if(i&&(typeof l.value=="string"||Array.isArray(l.value)))return V(d,ie(l.value,_e(n,i),e.length===1));let s=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?Be(n,d.expr.name):void 0;return V(d,s?C(l.value,s):b(l.value,d.format,n.today,d.formatArgs,n.money,v(n.schema)))}).join(""),...r?{problem:r}:{},...o?{markdown:o}:{}}}var $e=" \xB7 ";function Ue(e,n){if(!e||!n.node)return;let t=[[]];for(let d of e){if(d.text===void 0){t[t.length-1].push(d);continue}d.text.split($e).forEach((i,s)=>{s>0&&t.push([]),i!==""&&t[t.length-1].push({text:i})})}if(t.length<2)return;let r=d=>{let[l]=d;if(!(d.length!==1||!l||l.format||l.expr?.t!=="ident"))return n.fields[l.expr.name]?.type==="enum"?l.expr.name:void 0},o=0,a=t.flatMap(d=>{let l=r(d);if(l){let s=Object.hasOwn(n.node,l)?n.node[l]:void 0;return s==null||s===""?[]:(o++,[{text:x(n.definition,l,s),field:l}])}let i=S(d,n).text.trim();return i===""||i===g?[]:[{text:i}]});return o>0?a:void 0}function Ae(e,n){if(e===void 0)return;if(typeof e=="string")return e;let t=w(e.expr,n);return t.ok&&Ee(t.value)?t.value:"neutral"}function We(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var Ge=(e,n)=>{let t=e.fields[n]?.type;return t==="phone"||t==="place"||t==="duration"?t:be(e.definition,n)},Be=(e,n)=>ee(e.definition?.fields?.shape?.[n])??he(e.definition,n);function He(e,n,t,r,o){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,t.today,[],o?{...t.money,currency:o}:t.money);let a=t.fields[e];if(t.definition?.display?.format?.[e])return x(t.definition,e,n);let d=we(Ge(t,e),n,t.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",t.today,[],t.money);if(a?.type==="datetime"&&typeof n=="string")return z(n,t.money?.locale,t.money?.timeZone);if(a?.type==="enum"&&(typeof n=="string"||Array.isArray(n)))return x(t.definition,e,n);let l=typeof n=="number"?Be(t,e):void 0;if(l)return C(n,l);if(typeof n=="number")return F(n,t.money?.locale,{});let i=O(n);return i[0]?i.map(D).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function Ke(e,n,t,r,o){return typeof e!="number"?String(e):n==="money"?ne(e,t?{...o,currency:t}:o):n==="percent"?b(e,n,r,[],o):F(e,o?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function Oe(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function ze(e,n,t){switch(e.t){case"title":{let r=S(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=S(e.parts,n,!0),o=Ae(e.tone,n),a=n.glance&&!r.problem?Ue(e.parts,n):void 0;return h({t:"text",text:r.text,...o?{tone:o}:{},...e.lines!==void 0?{lines:e.lines}:{},...r.markdown?{markdown:r.markdown}:{},...a?{runs:a}:{}},r.problem)}case"badge":{let r=S(e.parts,n);return h({t:"badge",text:r.text,tone:Ae(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??N(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(o){let y=Q(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,o);return{t:"field",field:e.field,label:r,text:y.length>0?"linked record":g,...y.length>0?{linked:{relation:o,refs:y}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let y=w({t:"ident",name:e.field,at:0},n);y.ok?d=y.value!==null&&typeof y.value=="object"?b(y.value,void 0,n.today,[],n.money,v(n.schema)):y.value:l=y.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?We(d):Se(Ge(n,e.field),d),s=k(()=>He(e.field,d,n,e.as,e.currency))??g,f=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...f?{app:f}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(a=>E(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??N(n.definition,e.field),as:e.as,files:o,text:o.map(D).join(", ")||g}}case"progress":{let r=w(e.value,n),o=w(e.max,n),a=e.label?S(e.label,n):{text:"Progress"},d=e.label?B(e.label,a.text):a.text,l=r.ok?o.ok?a.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?h({t:"progress",label:d,value:r.value,max:o.value,text:`${b(r.value,void 0,n.today)} of ${b(o.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:je(e.blocks,Oe(n))};case"when":{let r=w(e.when,n),o=r.ok&&r.value===!0;return h({t:"when",shown:o,blocks:o?je(e.show,Oe(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=S(e.parts,n),o=Math.min(6,Math.max(1,(t?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:o,text:e.parts?B(e.parts,r.text):r.text},r.problem)}case"number":{let r=w(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?g:Ke(r.value,e.as,e.currency,n.today,n.money),a=e.label?S(e.label,n):void 0;return h({t:"number",text:o,...a&&e.label?{label:B(e.label,a.text)}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return Xe(e,n)}}function je(e,n){let t=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...ze(r,n,o===t),key:r.key}))}function Te(e,n){let t=n.trim().toLowerCase();return e.some(r=>{switch(r.t){case"title":case"headline":return r.text.trim()!=="";case"text":case"badge":return t!==""&&r.text.toLowerCase().includes(t);case"group":return Te(r.blocks,n);case"when":return r.shown&&Te(r.blocks,n);default:return!1}})}var Je=new Set(["every","some","sum","min","max","sort"]);function Gn(e,n){let t=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":t.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,f)=>{f===1&&Je.has(i.fn)||o(s)});return;default:return}},a=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((f,y)=>{let u=s[y];if(u)switch(f.t){case"field":case"image":t.add(f.field);return;case"title":case"text":case"badge":case"headline":a(f.parts);return;case"number":o(f.value),a(f.label);return;case"progress":o(f.value),o(f.max);return;case"group":u.t==="group"&&d(f.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(f.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:t,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function Xe(e,n){let t=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:t,more:0,problem:r.problem};let o=r.value,a=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(a=Ze(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??L),i=l.slice(0,I),s=l.slice(I),f=(e.limit===void 0?d:l.length)-i.length,y=c=>e.group&&n.schema&&c.length>0?Ye(c,e.group,n.schema,n.graph):void 0,u=y(i),m=s.length>0?y(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:t,...i.length===0&&e.empty?{empty:e.empty}:{},more:f,total:d}}function $(e,n,t){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,t)?_(r[t]):void 0;return o?.type==="enum"?o.options??[]:[]}var U=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function Ze(e,n,t){let r=o=>{let a=$(t,o.kind,n).indexOf(String(U(o,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((o,a)=>({node:o,i:a,rank:r(o)})).sort((o,a)=>o.rank-a.rank||o.i-a.i).map(o=>o.node)}function Ye(e,n,t,r){let o=e.some(i=>$(t,i.kind,n.by).length>0)?void 0:ye(n.by);if(o&&r)return qe(e,o,n.headings,t,r);let a=[];for(let i of e)for(let s of $(t,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(y=>U(y,n.by)===i);if(s.length===0)continue;let f=t.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??J(x(f,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String(U(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function qe(e,n,t,r,o){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=v(r),s;for(let u of e){let m=a(u)==="out"?o.out(u.id,n.edge):o.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let R=d.get(c.id)??{node:c,members:[]};R.members.push(u),d.set(c.id,R)}}let f=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:t[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let y=s&&s!=="*"?Y(r.tryDefinition(s),s):void 0;return l.length>0&&f.push({value:null,...y?{heading:`No ${y}`}:{},members:l}),f}function xe(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(xe):e.t==="when"?e.show.some(xe):!1}function ve(e,n){let t=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,a]of Object.entries(t)){let d=_(a);d&&(r[o]=d)}return r}var Pe=new WeakMap;function W(e){let n=Pe.get(e);return n||Pe.set(e,n=me(e)),n}function Qe(e,n,t,r={}){let o=W(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:Z(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(t?t.kind:te)?.computed??[])try{let f=[],y=G(s,{graph:n,subject:t,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>f.push(u)});f.length>0&&(y===null||y instanceof j&&y.nodes.length===0)?d[i]=re(f[0]):a[i]=l(y)}catch(f){if(!(f instanceof oe))throw f;d[i]=f.sentence}return{values:a,refused:d}}function Mn(e,n,t){let{values:r}=Qe(e,n,t);if(Object.keys(r).length===0)return t;let o=a=>Array.isArray(a)?a.map(o):a!==null&&typeof a=="object"?a.label:a;return{...t,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,o(d)]))}}function Cn(e,n){return[...pe(e.tryDefinition(n)).keys()]}var en=500,nn=2e4,Fe=new WeakMap;function rn(e,n){let t=Fe.get(e);t||Fe.set(e,t=new Map);let r=t.get(n);return r||t.set(n,r=ve(e,n)),r}function Dn(e,n,t,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,a=n&&t?o.graph.getNode(t.id)??null:t,d=o.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:f}=r;return{node:a,graph:o.graph,schema:d,kinds:W(d),fields:a?rn(d,a.kind):{},definition:l||void 0,today:r.today??o.today?.()??K(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:f,budget:r.budget??(i?nn:en),...i?{}:{glance:!0}}}export{Re as a,dn as b,Ne as c,sn as d,ke as e,je as f,Te as g,Gn as h,xe as i,W as j,Qe as k,Mn as l,Cn as m,Dn as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as b,e as c,f as d,g as e,h as f,i as g}from"./chunk.T6DPWW2K.js";import"./chunk.CEVGND3Y.js";import{r as a}from"./chunk.JMYUQNXN.js";import"./chunk.NYLKG25K.js";import"./chunk.TBY5IR7C.js";import"./chunk.QFHWG4LN.js";import"./chunk.YIPXZUTT.js";import"./chunk.BJUUSIQY.js";import"./chunk.PPSYUOH7.js";import"./chunk.XOZU4OFA.js";import"./chunk.GME63ZHI.js";import"./chunk.NJRLJEJY.js";import"./chunk.MIE4TJRW.js";import"./chunk.5LJVOLKR.js";import"./chunk.OJGHDWI6.js";import"./chunk.OWFS2YDQ.js";import"./chunk.WSDJPXJD.js";import"./chunk.F4VB6Q2W.js";import"./chunk.FFOD5B4B.js";import"./chunk.Z7Y3R3YR.js";import"./chunk.YXEO3Y65.js";import"./chunk.U3HERHAI.js";import"./chunk.FBILPNGH.js";import"./chunk.MODLZJD4.js";import"./chunk.SDO3U72B.js";import"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{f as Highlighter,g as LOOK,e as SectionCard,b as SectionDrawn,a as SectionOutline,c as placeBeside,d as readPart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as A,b as $,c as S}from"./chunk.U5P23GO7.js";import{a as I}from"./chunk.PSQYDCVM.js";import{D as k,G as T,W as b,ea as y}from"./chunk.MODLZJD4.js";import{eb as w}from"./chunk.6HY6ZGEE.js";import{b as u}from"./chunk.AJZBJBMO.js";var x=u(T(),1);var o=u(b(),1),l={display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"};function L({shows:t,onShows:i,mine:a,onMine:e}){let s={all:"All",changes:"Changes",ai:"AI"};return(0,o.jsxs)("div",{"data-testid":"activity-filter",role:"group","aria-label":"Show",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"},children:[["all","changes","ai"].map(n=>(0,o.jsx)("button",{type:"button","data-shows":n,"aria-pressed":t===n,onClick:()=>i(n),style:{...l,...t===n?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:s[n]},n)),(0,o.jsx)("button",{type:"button","data-testid":"activity-mine","aria-pressed":a,onClick:()=>e(!a),style:{...l,marginLeft:"auto",...a?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:"Just mine"})]})}var j=t=>t.ask.kind==="suggest"?"suggest":t.ask.kind==="fill"?"fill in":t.ask.kind==="record"?"add one":t.ask.kind==="panel"?"draw a panel":t.ask.kind==="section"?t.ask.said.replace(/^M/,"m"):`answer \u201C${t.ask.said}\u201D`;function O(t){let i=t.offered.filter(a=>t.accepted?.includes(a.id)).map(a=>a.label);switch(t.outcome){case"accepted":return i.length>0?`Took ${i.join(", ")}`:"Taken";case"partly":return`Took ${i.length} of ${t.offered.length}: ${i.join(", ")}`;case"dismissed":return"Dismissed";case"drawn":return t.panel?`Drew \u201C${t.panel.title}\u201D`:"Drew a panel";case"failed":return t.failed??"Failed";default:return"Offered, not yet taken"}}function R(t){let i=[...new Set((t.usage??[]).map(s=>s.model))];if(i.length===0)return null;let a=(t.usage??[]).flatMap(s=>s.costUsd===void 0?[]:[s.costUsd]),e=a.length>0?a.reduce((s,n)=>s+n,0):void 0;return`${i.join(", ")}${e!==void 0?` \xB7 $${e<.01?e.toPrecision(2):e.toFixed(2)}`:""}`}function D(t){let i=t.context;if(!i)return null;let a=(n,c,d)=>`${n===0?"no":n} ${n===1?c:d}`,e=`${a(i.candidates.length,"thing it could do","things it could do")} and ${a(i.records.length,"record","records")}`,s=i.model===void 0?"the Fast slot":/^jev\b|^jev-/i.test(i.model)?"Jev":i.model;return i.by==="fast"?`Told the model of ${e}, as ${s} picked them`:`Told the model of ${e} around it`}function P(t){let i=t.stages??[];if(i.length===0)return null;let a=e=>e.stage==="compose"?"composed":e.model?/^jev\b|^jev-/i.test(e.model)?"Jev":e.model:e.stage;return i.map(e=>`${a(e)} ${e.ms<1e3?`${Math.round(e.ms)} ms`:`${(e.ms/1e3).toFixed(1)} s`}`).join(" \xB7 ")}function V({entry:t,undo:i}){let{store:a,principal:e,seats:s,people:n,ai:c}=y(),d=I(),[m,p]=(0,x.useState)(!1),C=t.by.kind==="human"&&t.by.onBehalfOf===void 0&&(t.by.id===void 0||e.id===void 0||t.by.id===e.id)?"you":w(t.by,{graph:a.graph,schema:a.schema,seats:s,people:n}),f=R(t),g=D(t),v=P(t),W=k(c),h=r=>{p(!0),(__graviewPreload(import.meta.url,["./chunk.MWGZKZD6.js","./chunk.QFHWG4LN.js","./chunk.YIPXZUTT.js","./chunk.BJUUSIQY.js","./chunk.EMFOMSMI.js","./chunk.PSQYDCVM.js","./chunk.QOS5T46W.js","./chunk.PPSYUOH7.js","./chunk.XOZU4OFA.js","./chunk.GME63ZHI.js","./chunk.NJRLJEJY.js","./chunk.WSDJPXJD.js","./chunk.F4VB6Q2W.js","./chunk.FFOD5B4B.js","./chunk.Z7Y3R3YR.js","./chunk.YXEO3Y65.js","./chunk.U3HERHAI.js","./chunk.FBILPNGH.js","./chunk.MODLZJD4.js","./chunk.SDO3U72B.js","./chunk.6HY6ZGEE.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.TTGKX7LT.js")).then(r).finally(()=>p(!1))};return(0,o.jsxs)("li",{"data-testid":"activity-interaction","data-interaction":t.id,"data-outcome":t.outcome,style:A,children:[(0,o.jsx)("div",{"data-graview-activity-head":"",style:$,children:(0,o.jsxs)("span",{"data-graview-activity-words":"",style:S,children:[(0,o.jsx)("strong",{style:{fontWeight:600},children:C})," ",(0,o.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:t.ask.kind==="ask"?`told Graview \u201C${t.ask.said}\u201D`:`asked AI to ${j(t)}`}),(0,o.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",t.targetLabel]})]})}),t.offered.length>0&&t.outcome!=="accepted"&&t.outcome!=="partly"?(0,o.jsxs)("div",{"data-testid":"interaction-offered",style:{color:"var(--graview-ink-muted)"},children:["Offered ",t.offered.map(r=>r.label).join(", ")]}):null,(0,o.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,flexWrap:"wrap"},children:[(0,o.jsx)("span",{"data-testid":"interaction-outcome",style:{color:t.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)"},children:O(t)}),(t.batches??[]).map(r=>(0,o.jsx)("span",{"data-interaction-batch":r,style:{marginLeft:"auto"},children:i(r)},r))]}),f?(0,o.jsx)("div",{"data-testid":"interaction-model",style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:f}):null,g?(0,o.jsx)("div",{"data-testid":"interaction-context","data-context-by":t.context?.by,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:g}):null,v?(0,o.jsxs)("details",{"data-testid":"interaction-stages",style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:[(0,o.jsx)("summary",{children:"How long it took"}),v]}):null,W?(0,o.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[t.panel?(0,o.jsx)("button",{type:"button","data-testid":"interaction-reopen",disabled:m,onClick:()=>h(r=>r.drawPanel(d,t.panel)),style:l,children:"Show the panel"}):null,(0,o.jsx)("button",{type:"button","data-testid":"interaction-again",disabled:m,onClick:()=>h(r=>r.askAgain(d,t)),style:l,children:"Again"})]}):null]})}export{L as a,V as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as L}from"./chunk.YIPXZUTT.js";import"./chunk.BJUUSIQY.js";import"./chunk.NJRLJEJY.js";import"./chunk.YXEO3Y65.js";import{Qd as I,oa as O,ua as j}from"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var m=e=>e.charAt(0).toUpperCase()+e.slice(1),N=e=>/^(?:[aeio]|u(?![sn]i|se|ser))/i.test(e),q=e=>e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"one",D=(e,s)=>e===s?`step ${e}`:`steps ${e}\u2013${s}`;function G(e){let s=e.store.schema,t=Object.fromEntries(s.definitions.map(o=>[o.kind,{noun:j(o,o.kind),plural:O(s,o.kind),fields:Object.fromEntries(Object.keys(o.fields.shape??{}).map(c=>[c,{type:"string"}])),edges:o.edges??{}}]));return{name:e.app.name??"app",kinds:t,acts:{}}}function H(e){let s=(e.store.policy?.grants??[]).filter(o=>o.mutations==="*"&&!o.self&&o.roles!=="*").flatMap(o=>o.roles),t=[...new Set(s)];return t.length>0?`${N(t[0])?"an":"a"} ${t.join(" or ")}`:"whoever may change this app"}function K(e){let s=e.place?e.places.find(t=>t.as===e.place):void 0;return s?`in ${s.title}`:"here"}async function U(e,s){let{missing:t}=s;if(!t.need)return{refused:t.said};let o=await (__graviewPreload(import.meta.url,["./chunk.W4YDPHCQ.js","./chunk.TBY5IR7C.js","./chunk.BIDL7GQD.js","./chunk.Q5WEOX3Q.js","./chunk.4FCFNAA4.js","./chunk.4AC2QM7T.js","./chunk.CVPMSPCH.js","./chunk.OTV5XTBB.js","./chunk.KBPJ7X7W.js","./chunk.OEIWIZCP.js","./chunk.6HY6ZGEE.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.BCQWAFGD.js")),c=o.documentOfApp(e.app),k=c??G(e),a=L(k,t.need);if("refused"in a)return{refused:`${t.said} ${a.refused}`};let i=a.steps.map(n=>({part:"app",said:n})),b=i.length,C=n=>n.filter(r=>e.store.graph.getNode(r)?.kind===a.on),x=n=>[...e.store.graph.in(n),...e.store.graph.out(n)].filter(r=>r.kind===a.on).map(r=>r.id),f=C(s.members).length>0?C(s.members):[...new Set(s.members.flatMap(x))],p=[],y=f.length,w=n=>k.kinds[n]??void 0,P=n=>(w(n)?.plural??`${w(n)?.noun??n}s`).toLowerCase(),R=n=>(w(n)?.noun??n).toLowerCase(),S=s.where?`in ${s.where}`:K(e);if(y===0)return{refused:`${t.said} There is nothing here to do it to.`};let $=y===1?`the ${R(a.on)} ${S}`:`the ${y} ${P(a.on)} ${S}`,v=m(a.called);if(a.relation&&a.to){let n=t.who;if(!n)return{refused:`${t.said} Say whom to give them to.`};let r=a.made?m(a.edits[0].plural??"people"):m(P(a.to)),h=(a.made?void 0:e.store.graph.allNodes().find(d=>d.kind===a.to&&Object.values(d).some(l=>typeof l=="string"&&l.toLowerCase()===n.toLowerCase())))?.id;if(!h){h=`${a.to}-${q(n)}`;let d=a.makes??e.store.allMutations().find(l=>l.creates?.includes(a.to))?.name;if(!d){let l=e.store.graph.allNodes().filter(g=>g.kind===a.to).slice(0,3).map(g=>String(g.label??g.name??"")).filter(Boolean);return{refused:`${t.said} There is nobody called ${n} among the ${r.toLowerCase()} here${l.length>0?` (${l.join(", ")})`:""}, and no way to add one from here.`}}p.push({name:d,args:{name:n},mintedHint:h}),i.push({part:"record",said:`Add ${n} to ${r}.`})}for(let d of f)p.push({name:a.act,args:{id:d,[a.arg]:h}});let M=/^(\w+?)ed to$/i.exec(a.called)?.[1];i.push({part:"record",said:M?`${m(M.toLowerCase())} ${n} to ${$}.`:`Set \u201C${v}\u201D to ${n} on ${$}.`})}else if(a.field){let n=t.value;if(n===void 0)return{refused:`${t.said} Say what to set it to.`};for(let r of f)p.push({name:a.act,args:{id:r,[a.arg]:n}});i.push({part:"record",said:`Set \u201C${v}\u201D to ${n} on ${$}.`})}let A=i.length;if(!(!!c&&s.host&&s.compose!==void 0&&o.mayChangeDeclaration(e.store,e.principal))){let n=c?!s.host||!s.compose?"whoever hosts this app":H(e):"whoever develops this app";return{question:`${t.said} ${m(n)} would add ${D(1,b)}; then I can do ${D(b+1,A)}.`,parts:i,whoMay:n}}let E=s.compose({document:c,edits:a.edits});if(!E.ok)return{refused:`${t.said} That change could not be made here.`};let u=E.app;try{new I({schema:u.schema,mutations:u.mutations??[],invariants:u.invariants??[],...u.policy?{policy:u.policy}:{},snapshot:e.store.graph.snapshot()}).previewAll(p,{author:e.principal})}catch{return{refused:`${t.said} I could not make that work here.`}}return{question:`${t.said} I can do it in ${A} steps. Should I?`,parts:i,proposal:{said:s.said,add:[],drop:[],card:{said:i.map(n=>n.said).join(" "),adds:[],keeps:[],drops:[],breaking:[]},edits:a.edits,records:p,via:`ai:${e.ai.name??"model"}`}}}export{U as planFor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as H,e as R,f as k}from"./chunk.MWGZKZD6.js";import{b as L}from"./chunk.QFHWG4LN.js";import{b as C}from"./chunk.YIPXZUTT.js";import"./chunk.BJUUSIQY.js";import"./chunk.EMFOMSMI.js";import{a as S}from"./chunk.PSQYDCVM.js";import"./chunk.QOS5T46W.js";import"./chunk.PPSYUOH7.js";import"./chunk.XOZU4OFA.js";import"./chunk.GME63ZHI.js";import"./chunk.NJRLJEJY.js";import"./chunk.WSDJPXJD.js";import"./chunk.F4VB6Q2W.js";import"./chunk.FFOD5B4B.js";import"./chunk.Z7Y3R3YR.js";import"./chunk.YXEO3Y65.js";import"./chunk.U3HERHAI.js";import"./chunk.FBILPNGH.js";import{G as T,Va as E,W as b}from"./chunk.MODLZJD4.js";import"./chunk.SDO3U72B.js";import{td as x}from"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import{b as g}from"./chunk.AJZBJBMO.js";var t=g(T(),1);var c=g(b(),1);function N(n){if(!n||n.interaction.outcome==="failed")return null;let s=n.offers[0],o=s?n.interaction.offered.find(i=>i.id===s.id)?.confidence:void 0;return s&&o!==void 0&&o>=.6?{offer:s,confidence:o}:null}function V({rest:n,hold:s,leave:o}){let i=S(),u=(0,t.useMemo)(()=>C(n.target,e=>i.store.graph.has(e)),[n.target,i.store]),l=u.on==="record"&&L(i.ai)!==void 0,m=l?H(i,u):void 0,p=JSON.stringify(u),[y,I]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!l||m!==void 0)return;let e=!0;return R(i,u).then(r=>{e&&I({key:p,result:r})}),()=>{e=!1}},[p,l]);let w=m??(y?.key===p?y.result:void 0),f=l?N(w):null,v=f?.offer.id??null,h=(0,t.useRef)(null);if((0,t.useEffect)(()=>{if(v===null)return;let e=r=>{r.target instanceof Node&&h.current?.contains(r.target)||o(!0)};return document.addEventListener("pointerdown",e,{capture:!0,passive:!0}),document.addEventListener("contextmenu",e,{capture:!0,passive:!0}),addEventListener("scroll",e,{capture:!0,passive:!0}),addEventListener("resize",e,{passive:!0}),()=>{document.removeEventListener("pointerdown",e,{capture:!0}),document.removeEventListener("contextmenu",e,{capture:!0}),removeEventListener("scroll",e,{capture:!0}),removeEventListener("resize",e)}},[v,o]),(0,t.useLayoutEffect)(()=>{let e=h.current;if(!e)return;if(typeof e.showPopover=="function"&&!E(e))try{e.showPopover()}catch{}let r=n.element.getBoundingClientRect(),d=e.getBoundingClientRect(),O=r.top-d.height-4>=4?r.top-d.height-4:Math.min(innerHeight-d.height-4,r.top+4),A=Math.max(4,Math.min(innerWidth-d.width-4,r.right-d.width));e.style.top=`${Math.round(O)}px`,e.style.left=`${Math.round(A)}px`},[v,n.element]),!f)return null;let{offer:a,confidence:P}=f,M=a.type==="panel"?"a panel":a.type==="place"?"go there":a.type==="record"?"open it":"suggested";return(0,c.jsxs)("button",{ref:h,type:"button",popover:"manual","data-testid":"hover-chip","data-ai-offer":a.id,"data-ai-offer-type":a.type,"data-graview-overlay":"","data-graview-popover":"","aria-label":`Suggested by AI: ${a.label}`,title:`Suggested by AI, ${Math.round(P*100)}% sure`,onPointerEnter:s,onPointerLeave:()=>o(),onClick:()=>{n.element.closest("[tabindex], a[href], button")?.focus({preventScroll:!0}),o(!0),k(i,w,a)},style:$,children:[(0,c.jsxs)("span",{"aria-hidden":"true",style:{color:"var(--graview-accent)"},children:["\u2726"," "]}),a.label,(0,c.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",M]})]})}var $={position:"fixed",inset:"auto",top:0,left:0,margin:0,zIndex:x("toast"),boxSizing:"border-box",width:"max-content",maxWidth:"min(320px, calc(100vw - 8px))",height:"auto",minHeight:24,padding:"2px 10px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",borderRadius:999,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",font:"inherit",fontSize:"0.75rem",cursor:"pointer"};export{V as HoverChip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as I,c as x}from"./chunk.
|
|
1
|
+
import{a as I,c as x}from"./chunk.6LXIEM6B.js";import"./chunk.U3HERHAI.js";import"./chunk.FBILPNGH.js";import{b,c as A,j as v,q as w,s as O,v as G}from"./chunk.MODLZJD4.js";import"./chunk.SDO3U72B.js";import{Zd as k,oe as E,ve as S,we as W}from"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var F=(e,i)=>k(e,i).slice(1);function j(e,i){let l=e.split("/").filter(Boolean);return l.length===i.length&&l.every((s,h)=>s.startsWith(":")||s==="*"||s===i[h])}var $=["problems","search","map","places"];function R(e,i,l,s,h=[]){let{schema:r}=i,o=r.kinds,f=t=>{if(t.startsWith(w))return(t.slice(w.length).split("|")[0]??"").split("+").every(V=>o.includes(V));let y=O(t);return y!==null?o.includes(y):t.startsWith("edge:")||l.graph.getNode(t)!==void 0},[p="/",u]=e.path.split("?"),n=p.split("/").filter(Boolean),m=u?`?${u}`:"",d=n.length>0&&!$.includes(n[0])?o.find(t=>F(r,t)===n[0]):void 0,c=e.path;if(n[0]==="places"&&n.length===2)`/places/${n[1]}`!==E&&!s.some(t=>t.as===decodeURIComponent(n[1]))&&(c="/");else if(d){let t=n[1]===void 0?void 0:decodeURIComponent(n[1]);c=`/${F(r,d)}${t!==void 0&&l.graph.getNode(t)?.kind===d?`/${n[1]}`:""}${m}`}else n.length>0&&n.length<=2&&!$.includes(n[0])&&!h.some(t=>j(t.path,n))&&(c="/");let g=A(e.stop),P=g.within?.view,U=P!==void 0&&!s.some(t=>t.as===P),a=g;if(U){let{view:t,...y}=g.within??{};a={...a,within:y}}if(g.focusId&&!f(g.focusId)){let t=e.kind&&o.includes(e.kind)?G(e.kind):null;a={...v(a,t),zoom:!1}}return a={...a,relation:a.relation&&(o.includes(a.relation)||r.edgeKinds.includes(a.relation))?a.relation:null,expanded:a.expanded.filter(f),pins:Object.fromEntries(Object.entries(a.pins).filter(([t])=>f(t))),...a.selection?{selection:a.selection.filter(f)}:{}},{face:e.face,path:c,stop:b(a),...e.kind?{kind:e.kind}:{}}}function B(e,i,l){let s=e.at,h=e.pages?.routes()??[];if(e.routing!=="address"||typeof window>"u")return R(s,e.app,i,l,h);let{pathname:r,search:o,hash:f}=window.location,p=W(r,e.basePath),u=I({routing:"address",...e.basePath===void 0?{}:{basePath:e.basePath},face:s.face}),n=u==="pages",m={...s,face:u,...p===null?{}:n?{path:p+o}:{stop:x(e.basePath)??s.stop}},d=R(m,e.app,i,l,h),c=n?d.path===m.path?null:S(d.path,e.basePath===void 0?{}:{basePath:e.basePath}):d.stop===b(A(m.stop))?null:r+o+d.stop;return p!==null&&c!==null&&c!==r+o+f&&window.history.replaceState(window.history.state,"",c),d}export{R as settle,B as settleAt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk.WVUJXDXZ.js";import{k as x}from"./chunk.I2737CPF.js";import"./chunk.NJRLJEJY.js";import"./chunk.CVPMSPCH.js";import"./chunk.OTV5XTBB.js";import"./chunk.KBPJ7X7W.js";import"./chunk.OEIWIZCP.js";import"./chunk.Z7Y3R3YR.js";import"./chunk.YXEO3Y65.js";import{gb as f,ib as N,la as S}from"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var k=(n,r,t)=>({untrusted:!0,authoredBy:t.say(r),text:n});function O(n,r){let t;for(let[a,e]of Object.entries(n)){if(typeof e!="string"||a==="id"||a==="kind")continue;let o=r.fieldBy(n.id,a);o&&(t??={...n},t[a]=k(e,o,r))}return t??n}function L(n,r,t){let a=e=>{if(Array.isArray(e))return e.map(a);if(e!==null&&typeof e=="object"&&"id"in e&&"label"in e){let o=e,i=t.recordBy(o.id);return i?{...o,label:k(o.label,i,t)}:o}if(typeof e=="string"){let o=t.recordBy(n);return o?k(e,o,t):e}return e};return Object.fromEntries(Object.entries(r).map(([e,o])=>[e,a(o)]))}function $(n,r){return n.map(t=>{let a=r.recordBy(t.id);return a?{...t,label:k(t.label,a,r)}:t})}function D(n,r){return{...n,nodes:n.nodes.map(t=>O(t,r))}}var E=n=>(JSON.stringify(n)??"null").length,R=n=>typeof n=="number"&&Number.isFinite(n)&&n>0?Math.floor(n):0;function w(n,r,t,a,e,o=""){let i=n-r-t;return i>0?`and ${i} more ${e}: call ${a} with ${o}offset ${r+t} for the next page.`:void 0}var j=({line:n,...r})=>r;function T(n){let r;for(let[t,a]of Object.entries(n))typeof a!="string"||a.length<=600||(r??={...n},r[t]=`${a.slice(0,600)}\u2026 (cut at ${600} of ${a.length} characters)`);return r??n}function B(n,r,t,a){let e=Math.min(t,Math.max(0,n.length-r)),o=n.slice(r,r+e),i=a(o);for(;e>1&&E(i)>8e3;)e=Math.max(1,Math.floor(e*.75)),o=n.slice(r,r+e),i=a(o);return{page:o,answer:i}}function C(n,r){let t=JSON.stringify(r)??"null";if(t.length<=8e3)return r;let a=`This answer was ${t.length} characters, more than the ${8e3} one read answers, so it is cut. Ask ${n} for less, or use search_graph and get_node to read one thing.`;for(let e=8e3-a.length-40;;){let o={cut:a,partial:t.slice(0,e)},i=E(o)-8e3;if(i<=0)return o;e=Math.max(0,e-i-8)}}function I(n,r){let{matched:t,later:a,...e}=r,o=n.hits.filter(i=>i.about==="node").length;return n.total>o?{...e,more:`and ${n.total-o} more records match: narrow the words, or add kind:<kind>.`}:e}function P(n,r,t){let a=N(t.archived),e={nodes:n.graph.allNodes({archived:a}),edges:n.graph.allEdges({archived:"all"})},o=R(t.offset),i=e.nodes.length,{page:h,answer:u}=B(e.nodes,o,25,d=>{let g=new Set(d.map(s=>s.id)),l=new Set(d.map(s=>s.id)),c=w(i,o,d.length,"get_graph","nodes"),p=s=>l.has(s)||(a==="all"?n.graph.has(s):n.graph.has(s)&&f(n.graph.getNode(s))===a);return{...D({nodes:d.map(T),edges:e.edges.filter(s=>g.has(s.from)&&p(s.to))},r),total:i,...c?{more:c}:{}}});return{data:u,reads:h.map(d=>d.id)}}function U(n,r,t,a){let e=n.graph.getNode(t),o=R(a.offset),i=n.graph.outEdges(t),h=n.graph.inEdges(t),u=i.slice(o,o+20),d=h.slice(o,o+20),g=(s,A)=>{let m=n.graph.getNode(A);return{kind:s,id:A,label:m?S(n.schema.tryDefinition(m.kind),m):A,...f(m)?{archived:!0}:{}}},l=x(n.schema,n.graph,e),c=n.violations().filter(s=>s.nodeIds.includes(t)),p=[w(i.length,o,u.length,"get_node","links out",`id "${t}" and `),w(h.length,o,d.length,"get_node","links in",`id "${t}" and `),c.length>20?`and ${c.length-20} more problems: get_violations lists them.`:void 0].filter(Boolean);return{data:{node:O(T(e),r),...f(e)?{archived:!0}:{},...Object.keys(l.values).length>0?{computed:L(t,l.values,r)}:{},...Object.keys(l.refused).length>0?{uncomputed:l.refused}:{},out:$(u.map(s=>g(s.kind,s.to)),r),in:$(d.map(s=>g(s.kind,s.from)),r),violations:c.slice(0,20).map(j),...p.length>0?{more:p.join(" ")}:{}},reads:[t,...u.map(s=>s.to),...d.map(s=>s.from)]}}function F(n,r){let t=R(r.offset),{page:a,answer:e}=B(n,t,20,o=>{let i=w(n.length,t,o.length,"get_violations","problems");return{violations:o.map(j),total:n.length,...i?{more:i}:{}}});return{data:e,reads:[...new Set(a.flatMap(o=>o.nodeIds))]}}export{P as graphRead,U as nodeRead,I as searchRead,F as violationsRead,C as withinReadChars};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk.
|
|
1
|
+
import"./chunk.U3HERHAI.js";import"./chunk.FBILPNGH.js";import{W as T}from"./chunk.MODLZJD4.js";import"./chunk.SDO3U72B.js";import"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import{b as A}from"./chunk.AJZBJBMO.js";var F=/^ {0,3}(`{3,}|~{3,})[ \t]*([^`\s]*)/,D=/^ {0,3}(#{1,6})(?:[ \t]+|$)/,R=/^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,v=/^ {0,3}>[ \t]?/,_=/^([ \t]*)([-*+]|(\d{1,9})[.)])(?:[ \t]+|$)/,K=/^\|?\s*:?-+:?\s*(?:\|\s*:?-+:?\s*)+\|?$|^\|\s*:?-+:?\s*\|$/,w=/^[ \t]*$/;function O(t){let n=F.exec(t);if(!(!n||n[1][0]==="`"&&t.indexOf("`",n[0].length)>=0))return{mark:n[1],lang:n[2]}}function U(t,n){let r=t.trim().slice(n).trim(),e=r.length;for(;e>0&&r[e-1]==="#";)e--;return(e===0||r[e-1]===" "||r[e-1]===" ")&&(r=r.slice(0,e).trim()),r}var $=t=>O(t)!==void 0||D.test(t)||R.test(t)||v.test(t)||_.test(t),b=t=>[...t].reduce((n,r)=>r===" "?n+4-n%4:n+1,0);function E(t){let n=t.trim().replace(/^\|/,"").replace(/(?<!\\)\|$/,""),r=[],e="",l=!1;for(let c=0;c<n.length;c++){let h=n[c];h==="\\"&&n[c+1]==="|"?(e+="|",c++):h==="`"?(l=!l,e+=h):h==="|"&&!l?(r.push(e.trim()),e=""):e+=h}return r.push(e.trim()),r}function W(t){return B(t.replace(/\r\n?/g,`
|
|
2
2
|
`).replace(/\0/g,"\uFFFD").split(`
|
|
3
3
|
`),0)}function B(t,n){let r=[],e=0;for(;e<t.length;){let l=t[e];if(w.test(l)){e++;continue}let c=O(l);if(c){let o=new RegExp(`^ {0,3}${c.mark[0]==="`"?"`":"~"}{${c.mark.length},}[ \\t]*$`),a=[];for(e++;e<t.length&&!o.test(t[e]);)a.push(t[e++]);e++,r.push({t:"code",text:a.join(`
|
|
4
4
|
`),...c.lang?{lang:c.lang}:{}});continue}let h=D.exec(l);if(h){r.push({t:"heading",level:h[1].length,children:k(U(l,h[1].length),0)}),e++;continue}if(R.test(l)){r.push({t:"rule"}),e++;continue}if(v.test(l)){let o=[];for(;e<t.length&&(v.test(t[e])||o.length>0&&!w.test(t[e])&&!$(t[e])&&!w.test(o[o.length-1]));)o.push(t[e++].replace(v,""));r.push(n<8?{t:"quote",blocks:B(o,n+1)}:{t:"p",children:k(o.join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk.IAEHUSQQ.js";import"./chunk.U5P23GO7.js";import"./chunk.PSQYDCVM.js";import"./chunk.U3HERHAI.js";import"./chunk.FBILPNGH.js";import"./chunk.MODLZJD4.js";import"./chunk.SDO3U72B.js";import"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{a as ActivityFilter,b as InteractionRow};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as G}from"./chunk.NYLKG25K.js";import{c as $}from"./chunk.QFHWG4LN.js";import{G as ce,W as z}from"./chunk.MODLZJD4.js";import{td as L}from"./chunk.6HY6ZGEE.js";import{b as T}from"./chunk.AJZBJBMO.js";function ze(e){let t=e.elements[0]?.getRootNode();return t?.host?.closest("[data-worker-view-place]")??t?.host?.parentElement??void 0}var ge=["no","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve"],R=e=>ge[e]??String(e),V=e=>e.replace(/\s+/g," ").trim(),b={li:["item","items"],a:["link","links"],button:["button","buttons"],img:["picture","pictures"],p:["paragraph","paragraphs"],ul:["list","lists"],ol:["list","lists"],table:["table","tables"],tr:["row","rows"],td:["cell","cells"],th:["column heading","column headings"],section:["section","sections"],article:["card","cards"],nav:["menu","menus"],form:["form","forms"],input:["field","fields"],label:["label","labels"]},ue=new Set(["js","is","has","item","items","wrap","inner","outer","box","el","block","row","col","cell","card","pick","active","selected"]);function K(e){return e.split(/[-_]+/).filter(n=>/^[a-z]{3,}$/i.test(n)&&!ue.has(n.toLowerCase())).at(-1)?.toLowerCase()}function he(e){if(e.length<2)return;let t=(n,r)=>Math.abs(n-r)<=6;if(e.every(n=>t(n.top,e[0].top)))return"columns";if(e.every(n=>t(n.left,e[0].left)))return"rows"}function Ge(e){if(e.length===0)return"nothing";if(e.length===1){let[i]=e,l=/^h[1-6]$/.test(i.tag)?"heading":b[i.tag]?.[0]??i.classes.map(K).find(Boolean)??"part",g=V(i.text);return g?`the ${l} \u201C${g.length>40?`${g.slice(0,39)}\u2026`:g}\u201D`:`the ${l}`}let n=e[0].classes.filter(i=>e.every(c=>c.classes.includes(i))).map(K).find(Boolean),r=new Set(e.map(i=>i.tag)),s=he(e.map(i=>i.box));if(n)return`the ${R(e.length)} ${n} ${s??(r.size===1&&b[e[0].tag]?b[e[0].tag][1]:"blocks")}`;if(r.size===1){let i=b[e[0].tag]?.[1]??(/^h[1-6]$/.test(e[0].tag)?"headings":s??"parts");return`the ${R(e.length)} ${i}`}let a=new Map;for(let i of e){let c=/^h[1-6]$/.test(i.tag)?"heading":b[i.tag]?.[0]??"part";a.set(c,(a.get(c)??0)+1)}let o=[...a].map(([i,c])=>c===1?`a ${i}`:`${R(c)} ${b[Object.keys(b).find(l=>b[l][0]===i)??""]?.[1]??`${i}s`}`);return o.length===1?o[0]:`${o.slice(0,-1).join(", ")} and ${o.at(-1)}`}function Ke(e){return e.map(t=>`<${t.tag}${t.classes.length?` class="${t.classes.join(" ")}"`:""}> ${V(t.text).slice(0,60)}`.trim())}function Ve(e){if(e.length===1)for(let t of e){let n=t.matches("h1, h2, h3, h4, [role='heading']")?t:t.querySelector("h1, h2, h3, h4, [role='heading']");if(!n)continue;let r=n.cloneNode(!0);for(let a of r.querySelectorAll("span"))/^[\s·\d]+$/.test(a.textContent??"")&&a.remove();let s=(r.textContent??"").replace(/\s+/g," ").trim().replace(/^[▸▾]\s*/,"").replace(/\s*\d+$/,"");if(s)return s.length>60?`${s.slice(0,57)}\u2026`:s}}var W=e=>e===void 0||e.off?void 0:e.fast??(e.decide?{model:e.name??"decide",decide:e.decide}:void 0),fe=/\b(look|looks|looking|nicer|prettier|cleaner|ugly|layout|laid out|lay it out|design|style|styled|theme|colou?rs?|font|bigger|smaller|larger|wider|narrower|taller|shorter|spacing|space|padding|margin|compact|dense|denser|roomier|columns?|grid|cards?|rows?|show (?:the )?\S+ (?:on|in) (?:each|every|the)|sort(?:ed)? by|order(?:ed)? by|group(?:ed)? by|readable|easier to read|at a glance|icons?|badges?|headings?|bold|highlight)\b/i;async function pe(e,t,n){let r=t.trim(),s=W(e);if(s&&r)try{let a=await s.decide({typed:r,on:n},{about:{type:"choice",instructions:`Somebody right-clicked \u201C${n}\u201D in an app and typed \u201C${r}\u201D. Is it about how \u201C${n}\u201D looks or is laid out, or about the records in it?`,criteria:{look:"How it looks or is laid out: making it look better, its style, size or spacing, what each row, card or page shows, its order or grouping",records:"The records themselves: changing, closing, assigning, adding, deleting or moving them, or a question about them"}}});e?.meter?.({tier:"fast",model:s.model,inputTokens:a.usage.inputTokens,outputTokens:a.usage.outputTokens,interaction:"menu"});let o=a.answers.about;if(o?.type==="choice"&&(o.choice==="look"||o.choice==="records"))return{about:o.choice,by:"fast",confidence:o.confidence}}catch{}return{about:fe.test(r)?"look":"records",by:"words"}}var ye=/\b(colou?rs?|font|typeface|bigger|smaller|larger|wider|narrower|taller|spacing|padding|margin|border|shadow|rounded|corners?|columns? side by side|side by side|grid|chart|graph|picture of|animation|background|gradient|icons?|css|kanban|calendar)\b/i,H=.6;async function me(e,t,n){let r=t.trim();if(!r)return{can:!0,by:"words"};let s=W(e);if(s)try{let a=await s.decide({asked:r,on:n.name,page:n.slot},{can:{type:"choice",instructions:`Somebody asked of the page \u201C${n.name}\u201D: \u201C${r}\u201D. Can the app's view settings do it, or does it need drawing of its own?`,criteria:{spec:"The view settings can do it: which fields a card, a row or a page shows and in what order, a headline, a badge with a tone, a figure, a progress bar, a list of related records, how a list is sorted, grouped or filtered, a field's label or format",drawing:"It needs drawing the settings have no word for: colors, fonts, sizes, spacing, borders or shadows, a layout or columns side by side, a chart, a calendar, a board, or markup and styles of its own"}}});e?.meter?.({tier:"fast",model:s.model,inputTokens:a.usage.inputTokens,outputTokens:a.usage.outputTokens,interaction:"section"});let o=a.answers.can;if(o?.type==="choice"&&(o.choice==="spec"||o.choice==="drawing"))return{can:o.choice==="spec"||o.confidence<H,by:"fast",confidence:o.confidence}}catch{}return{can:!ye.test(r),by:"words"}}var F=["set-view","set-glance","set-page-fields","arrange-pages","set-label","set-format"],we=new Set(["sort","group","filters"]);function J(e){let t=[];e.length===0&&t.push("It changed nothing.");for(let n of e){let r=n?.op;if(typeof r!="string"||!F.includes(r)){t.push(`\u201C${String(r)}\u201D is not a change to how a page reads.`);continue}if(r==="arrange-pages")for(let s of Object.keys(n))s!=="op"&&!we.has(s)&&t.push(`arrange-pages may say only sort, group and filters here, not \u201C${s}\u201D.`);r==="set-label"&&n.field===void 0&&t.push("set-label may name only a field's label here, not a kind's.")}return t}var q=["You change how one page of a Graview app reads, by editing its view spec: data that says what a kind's card, row and page show, and how a list opens. Nothing in it is code: no CSS, no markup, no colors or sizes of your own.","You are told the page (a kind's list, one group of it, a record's page, or the home), what was asked, the kind's fields and relations, and its spec as it stands.",'Answer with one JSON object and nothing else: {"edits": [...], "said": "<one sentence to the person saying what will change>"}. Or, where the spec has no word for it (colors, fonts, sizes, spacing, layout, a chart), answer {"cannot": "<one sentence saying what it would need>"}.',"The edits you may use, and no others:",`{"op":"set-view","kind":K,"slot":"card"|"row"|"page","blocks":[...]} \u2014 a kind's card, its row on a list, the blocks over its record page; {"op":"set-view","slot":"home","blocks":[...]} \u2014 the home. Blocks: {"title":"{name}"}, {"headline":"{count(out('rel'))} things"}, {"text":"{field}","lines":2}, {"badge":"{field}","tone":"good"|"warn"|"bad"|"neutral"|"accent"}, {"field":"due","as":"date"|"time"|"datetime"|"relative"|"money"|"percent"|"count","label":"Due"}, {"figure":"expr","as":"number"|"money"|"percent","label":"..."}, {"progress":{"value":"done","max":"total"},"label":"..."}, {"list":"out('rel')" or "all('kind')","as":"row"|"card","sort":{"by":"f","direction":"asc"|"desc"},"limit":5,"group":{"by":"f"},"empty":"None yet."}, {"group":[...blocks],"direction":"row"|"column"}, {"when":"rule expression","show":[...blocks]}, {"divider":true}. Templates say {field}; a row always leads with {"title":"{name}"} or the record's label field.`,`{"op":"set-glance","kind":K,"fields":[...]} \u2014 the few facts said beside a record's name on a list.`,`{"op":"set-page-fields","kind":K,"fields":[...],"groups":[{"title":"...","fields":[...]}]} \u2014 the order and groups of a record page's facts.`,`{"op":"arrange-pages","sort":{K:{"by":"f","direction":"asc"|"desc"}},"group":{K:{"by":"f"}},"filters":{K:["f"]}} \u2014 how a kind's list opens. A list sorts by one of its kind's fields or computed values, and groups only by a choice or a yes-or-no field of its own: grouping by a relation or by the record that holds it is not the spec's to say.`,'{"op":"set-label","kind":K,"field":F,"label":"..."}, {"op":"set-format","kind":K,"field":F,"format":"money"|"percent"|"duration"|null}.',"Name only fields and relations the kind has. Change only what the ask needs, on this page's kind. Keep every fact the page shows now unless asked to drop one.","Do what was asked or answer cannot: never something else in its place (grouping by another field than the one asked for, say)."].join(`
|
|
2
|
+
`);function _(e){let t=e.part.kind,n=e.document,r=t?n.kinds[t]:void 0,s=e.mode==="just"?"Make this page better: easier to read at a glance, the facts a person needs first. Change no data.":(e.words??"").trim();return JSON.stringify({page:{name:e.part.name,is:e.part.slot==="list"?"a kind's list":e.part.slot==="group"?`one group of a kind's list (\u201C${e.part.group}\u201D)`:e.part.slot==="record"?"a record's page (every record of the kind)":e.part.slot==="home"?"the home":"a place",...t?{kind:t}:{}},asked:s,...e.highlighted?.length?{pointed_at:e.highlighted}:{},...r?{fields:r.fields,relations:r.edges??r.relations,computed:r.computed,glance:r.glance,pageFields:r.pageFields}:{kinds:Object.keys(n.kinds)},now:{...t?{views:n.views?.[t]??null,list:n.pages?.lists?.[t]??null}:{home:n.views?.home??null}},...e.shows?{shows:e.shows.slice(0,1500)}:{},...e.findings?.length?{your_last_answer:e.last,what_broke:e.findings,repair:"Your last answer was refused as said in what_broke. Answer again, fixing each one \u2014 or, where the spec cannot do what was asked, answer cannot."}:{}})}function B(e){let t=/```(?:json|js|javascript)?\s*([\s\S]*?)```/.exec(e)?.[1];for(let n of t?[t,e]:[e]){let r=n.indexOf("{"),s=n.lastIndexOf("}");if(!(r<0||s<=r))try{let a=JSON.parse(n.slice(r,s+1));if(a&&typeof a=="object"&&!Array.isArray(a))return a}catch{}}}function U(e){let t=B(e);if(t){if(typeof t.cannot=="string"&&t.cannot.trim())return{cannot:t.cannot.trim()};if(Array.isArray(t.edits))return{edits:t.edits,said:typeof t.said=="string"&&t.said.trim()?t.said.trim():"Changed how this page reads."}}}function ke(e){return async(t,n,r,s)=>{let a=Date.now();try{let o=await t.think({system:r,prompt:s,state:{},catalog:{candidates:[]}});return e.push({stage:n,model:t.model,ms:Date.now()-a,...o.usage?{usage:o.usage}:{}}),o.text}catch{e.push({stage:n,model:t.model,ms:Date.now()-a});return}}}async function be(e){let t=[],n=e.ai.off?void 0:e.ai.light,r=$(e.ai),s=n??r;if(!s)return{ok:!1,refused:e.ai.withoutModel??"Changing a page needs AI, and none is on here.",stages:t};let a=ke(t),o={part:e.part,document:e.document,mode:e.mode,...e.words?{words:e.words}:{},...e.highlighted?{highlighted:e.highlighted}:{},...e.shows?{shows:e.shows}:{}},i=async(h,u,p)=>{let k=await a(h,u,q,p);return k===void 0?void 0:U(k)},c=await i(s,n?"light":"thinking",_(o));if(!c&&n&&(c=await i(n,"light",_(o))),!c)return{ok:!1,refused:"The model did not answer with a change to this page.",stages:t};if("cannot"in c)return{ok:!1,cannot:c.cannot,refused:c.cannot,stages:t};let l=async h=>{let u=J(h);return u.length>0?u:[...await e.judge(h)]},g=await l(c.edits);if(g.length===0)return{ok:!0,edits:c.edits,said:c.said,repaired:!1,stages:t};let m=s;e.repairing?.(g);let y=await i(m,m===n?"light":"thinking",_({...o,findings:g,last:c}));return y&&"cannot"in y?{ok:!1,cannot:y.cannot,refused:y.cannot,stages:t}:y?(g=await l(y.edits),g.length>0?{ok:!1,refused:`It could not be changed so: ${g.join(" ")}`,stages:t}:{ok:!0,edits:y.edits,said:y.said,repaired:!0,stages:t}):{ok:!1,refused:`It could not be changed so: ${g.join(" ")}`,stages:t}}var Y=e=>e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,40)||"page";function ve(e,t,n=[]){let r={...t.kinds.length?{kinds:[...t.kinds]}:{},...t.edges.length?{edges:[...t.edges]}:{}},s={...Object.keys(r).length>0?{reads:r}:{},...n.length>0?{acts:[...n]}:{}};if((e.slot==="list"||e.slot==="group")&&e.kind)return{name:`${Y(e.kind)}-list`,attach:e.kind,cardinality:"many",replaces:"page",...s};if(e.slot==="record"&&e.kind)return{name:`${Y(e.kind)}-page`,attach:e.kind,cardinality:"one",replaces:"page",...s};if(e.slot==="home")return{name:"home-page",attach:"home",cardinality:"many",...s}}var D=["You write a Graview worker view: one plain script, no imports and no build, that draws one page of an app through the global `graview`, in place of the page the app drew by itself.","The global: graview.style(css) a stylesheet; graview.onProps((props) => \u2026) on every push of what it is shown; graview.render(graview.html`\u2026`) draws markup, every ${value} escaped; graview.html`` nests: a list is ${items.map((one) => graview.html`<li>\u2026</li>`)}. Never build HTML as a string or with join(): a string is drawn as its words.","props.nodes holds the records a view of many is drawn for and those it reads; props.node the record a view of one is drawn for. A record is plain data: id, kind, label, and each field by name. props.edges are {kind, from, to}. props.choices[kind][field][option] is a choice's label.",'Link to a record with <a data-record="${node.id}">\u2026</a>. Give repeated rows data-key="${node.id}". Name each part a person would name with a heading inside a <section aria-labelledby="x-h"> whose heading has id="x-h"; never aria-label.',"The page draws its own title above your view: never draw the page's title again. Draw each other heading the page had, with the same words, and every record the page showed: each record still says what its row said (its status, its dates, its counts, in words) and stays under the heading it was under, unless what was asked changes that.",'Say things in words a person reads: a date as the page said it (\u201CSep 3\u201D), never as stored (2026-09-03). A date kept as YYYY-MM-DD is a day, not an instant: read it as new Date(`${value}T00:00`) \u2014 new Date(value) alone is midnight in London and the day before here \u2014 then .toLocaleDateString(props.locale, { month: "short", day: "numeric" }); never show a field\'s own name (order, done, holds), an id, true, false, null or undefined. Leave out a value the page did not show unless asked for it.',`CSS the host keeps: plain rules on your own classes and elements, one level, and @media. Give your outer element a class (class="pg") and style that: never :host, ::slotted or ::part, no url(), @import, @font-face, @keyframes or nesting. Colors, type and corners only through var(--graview-ink), var(--graview-ink-muted), var(--graview-panel), var(--graview-edge), var(--graview-accent), var(--graview-ground), var(--graview-radius). position may be static, relative, absolute or sticky. Set no height; lay it out well at a phone's width and at a desk's.`,"Never write the words import, export or require, nor <script>, <style>, or on\u2026= attributes.",'Answer with one JSON object and nothing else: {"source": "<the whole script>", "said": "<a few words on what you changed>"}.'].join(`
|
|
3
|
+
`);function P(e){return e.records.map(t=>{let n=e.says?.[t];return{record:t,...n?.id?{id:n.id}:{},...n?.shows?.length?{must_show:n.shows}:{},...n?.under?{under:n.under}:{}}})}function O(e){let[t,n]=e.record==="from"?["from","to"]:["to","from"];return`Group the records as the page did: each record sits under a heading that is the label of the ${e.kind} it is linked to \u2014 find the edge in props.edges with kind "${e.edge}" whose ${t} is the record's id; the ${e.kind} is props.nodes' node whose id is the edge's ${n}. Draw the headings in keep_these_headings' order; never guess a record's group from its fields.`}function j(e){let t=B(e),n=t?.source,r=typeof n=="string"?n.trim().replace(/^```(?:js|javascript)?\s*/i,"").replace(/\s*```$/,"").replace(/^<script[^>]*>\s*/i,"").replace(/\s*<\/script>\s*$/i,""):void 0;if(!(typeof r!="string"||!/graview\.(render|onProps)/.test(r)))return{source:r,said:typeof t.said=="string"?t.said.trim():""}}var Q=12,E=[D.split(`
|
|
4
|
+
`).filter(e=>!e.startsWith("Answer with one JSON object")).join(`
|
|
5
|
+
`),"","You are Graview, redesigning one page of an app with the person who is looking at it. You work in steps, and each answer is ONE JSON object and nothing else:",'{"say": "<one short plain sentence the person reads: what you are doing or what you found>", "do": "look" | "read" | "draft" | "done" | "ask", "source": "<the whole script, only with draft>"}',"You are shown, before your first step, what the page draws now (what_the_page_draws: its headings, each record's words and the heading it sits under, how they stand) and the records your view is handed (records_it_is_handed): draft first.","- look: see what the page draws now again, as it stands.","- read: the records and fields your view is handed, again.",'- draft: your whole script, drawn where only you see it, with "say" one sentence of what it does, as the person will read it once it is on the page ("Tasks are cards now, side by side, each with its status and date."). You are told what the checks found (records, headings, dates, statuses or groups it lost; words it shows as the computer keeps them; styles the page will not keep) and what it drew. A draft the checks pass is shown to the person on the page, and your turn ends there.',"- done: you have finished this request; say in one sentence what you changed. Only once a draft passed, unless you must ask.","- ask: ask the person one short question, and wait for their answer.",`A control that changes a record is a press bound to one of the app's acts (acts_a_press_may_ask_for): <button data-act="finish" data-record="\${task.id}">Done</button> \u2014 the host runs the act for that record when it is pressed. A field the person types into is named for the act's argument, inside a fieldset with the press; data-prefill="field" fills it with the record's own text; data-save on a field saves it as it is typed. Never a checkbox, a toggle or a button bound to nothing, and never graview.act from your own click handler: it is refused. Every control on a record the page let a person press (marking it done, opening it) is kept, bound to the same act. A press that marks a record (an act with \`marks\`) shows what it marked from the record's own field: a record already marked says so and offers the act that undoes it (reopen), so a person sees the press land. The code presses every control headless and tells you what each one did.`,"Keep everything the page showed unless the person asked otherwise: every record, every heading, each record's words (its status, its dates, its counts) and its group. Fix what the checks found and draft again; keep going until a draft passes. Write to a person, never about code: no words like view, script, spec, host, CSS or stylesheet in what you say."].join(`
|
|
6
|
+
`);function N(e,t){let n=e.keep;return JSON.stringify({page:e.part.name,view:{attach:e.manifest.attach,cardinality:e.manifest.cardinality,reads:e.manifest.reads??{}},conversation:e.talk.map(r=>({[r.who==="person"?"person":"you"]:r.said})),...e.about&&e.about.name!==e.part.name?{about:e.about.name,...e.about.lines?.length?{pointed_at:e.about.lines}:{}}:{},...e.acts?.length?{acts_a_press_may_ask_for:e.acts.map(r=>({act:r.act,title:r.title,record_goes_in:r.record,...r.toggle?{marks:r.toggle}:{}}))}:{},...e.pressed?.length?{the_controls_as_pressed:e.pressed,then:"The person says something does not work. This is what pressing every control of your draft found: fix what failed, with controls bound to acts."}:{},...e.section?{only_change:`Change only the part \u201C${e.section}\u201D of your_draft_on_the_page; keep every other part of the script as it is, byte for byte.`}:{},...n?{...n.title?{the_page_draws_its_title:n.title}:{},keep_these_headings:n.headings,records:P(n),...n.grouping?{grouping:O(n.grouping)}:{}}:{},...e.markup&&!e.current?{the_page_as_html:e.markup.slice(0,5e3)}:{},...e.current?{your_draft_on_the_page:e.current.slice(0,9e3)}:{},your_steps:t.map((r,s)=>({said:r.said,did:r.did,...r.result!==void 0?{result:r.result}:{},...s<t.length-1&&r.did==="draft"?{note:"an earlier draft"}:{}})),...t.length===0&&e.seen?{what_the_page_draws:e.seen.look,records_it_is_handed:e.seen.read}:{},next:t.length===0?"Draft first, as one JSON object.":"Your next step, as one JSON object."})}function X(e){let t=e.indexOf("{"),n=e.lastIndexOf("}");if(t<0||n<=t)return;let r;try{r=JSON.parse(e.slice(t,n+1))}catch{return}let s=r.do;if(s!=="look"&&s!=="read"&&s!=="draft"&&s!=="done"&&s!=="ask")return;let a=typeof r.say=="string"?r.say.trim():"";if(s!=="draft")return{say:a,do:s};let o=j(JSON.stringify({source:r.source,said:a}));return o?{say:a,do:"draft",source:o.source}:void 0}function ee(e,t="records"){let n=[];for(let s of e){let a=/no longer says what it said: (.*?)(?: and (\d+) more)?\. Show/.exec(s);if(a){let i=new Set([...a[1].matchAll(/” on “([^”]+)”/g)].map(g=>g[1])),c=[...a[1].matchAll(/“([^”]+)” on “/g)].some(g=>/\b(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*\.?\s+\d|\d{1,2}\s+(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i.test(g[1])),l=i.size+Number(a[2]??0);n.push(`${c?"dates":"details"} lost on ${l===1?`one of the ${t}`:`${l} ${t}`}`);continue}let o=/^It no longer shows (.*?)(?: and (\d+) more)?: show every record/.exec(s);if(o){let i=[...o[1].matchAll(/“/g)].length+Number(o[2]??0);n.push(`${i===1?`one of the ${t}`:`${i} ${t}`} missing`)}else/no longer shows the heading/.test(s)?n.push("headings missing"):/moved to another group|more often than the page did/.test(s)?n.push(`${t} in the wrong group`):/drawn twice/.test(s)?n.push("the title drawn twice"):/markup as words|a date as “|as the computer keeps it|a field's name/.test(s)?n.push("words shown as the computer keeps them"):/did not draw|not drawn|threw/.test(s)?n.push("it didn't draw"):/not allowed|removed|reaches outside/.test(s)&&n.push("styles the page won't keep")}let r=[...new Set(n)];return r.length>0?r.slice(0,3).join(", "):"something didn't draw right"}async function Z(e,t,n){if(t?.aborted)return"stopped";let r,s,a=await Promise.race([e.then(o=>({value:o})),...t?[new Promise(o=>t.addEventListener("abort",r=()=>o("stopped"),{once:!0}))]:[],...n!==void 0?[new Promise(o=>s=setTimeout(()=>o("late"),n))]:[]]);return r&&t?.removeEventListener("abort",r),s&&clearTimeout(s),a}async function Se(e){let t=[],n=[],r=e.ai.off?void 0:e.ai.design??$(e.ai)??e.ai.light;if(!r)return{ended:"no-model",said:e.ai.withoutModel??"Changing how a page looks needs AI, and none is on here.",steps:n,stages:t};let s=m=>e.onEvent?.(m),a=e.noun??(e.part.slot==="record"?"parts":"records"),o,i,c=0,l=Math.max(2,e.steps??Q);s({kind:"look",text:`Looking at ${e.part.name}`});let g={look:e.host.look(),read:e.host.read()};for(let m=0;m<l;m++){let y=Date.now(),h=await Z((r.stream?r.stream({system:E,prompt:N({...e,seen:g},n),state:{},catalog:{candidates:[]}},p=>s({kind:"streaming",text:te(p)}),e.signal):r.think({system:E,prompt:N({...e,seen:g},n),state:{},catalog:{candidates:[]}})).then(p=>(t.push({stage:"thinking",model:r.model,ms:Date.now()-y,...p.usage?{usage:p.usage}:{}}),p.text),()=>{t.push({stage:"thinking",model:r.model,ms:Date.now()-y})}),e.signal,e.stepMs??10*6e4);if(h==="late")return{ended:"steps",said:o?"The model stopped answering; here is where it got to.":"The model didn't answer in time. Ask again, or say it another way.",...o?{passed:o}:{},...i?{last:i}:{},steps:n,stages:t};if(h==="stopped")return{ended:"stopped",said:"Stopped.",...o?{passed:o}:{},...i?{last:i}:{},steps:n,stages:t};let u=h.value===void 0?void 0:X(h.value);if(!u){if(c+=1,c>=3)break;n.push({said:"",did:"look",result:{error:"Your answer was not one JSON object with say and do (and the whole script in source for a draft). Answer again."}});continue}if(u.do==="look")s({kind:"look",text:`Looking at ${e.part.name}`}),n.push({said:u.say,did:"look",result:e.host.look()});else if(u.do==="read")s({kind:"read",text:`Reading what ${e.part.name} shows`}),n.push({said:u.say,did:"read",result:e.host.read()});else if(u.do==="draft"){s({kind:"draft",text:u.say?`Drafting: ${u.say.replace(/\.$/,"")}`:"Drafting"});let p=M(u.source),k=p.length>0?{findings:p,drew:void 0}:await Z(e.host.draft(u.source),e.signal).then(x=>typeof x=="string"?void 0:x.value);if(!k)return{ended:"stopped",said:"Stopped.",...o?{passed:o}:{},...i?{last:i}:{},steps:n,stages:t};if(i={source:u.source,findings:k.findings},k.findings.length===0)return o={source:u.source},s({kind:"passed",text:"Check: nothing lost \u2014 it's on the page"}),n.push({said:u.say,did:"draft",result:{findings:[],drew:k.drew,shown:"It passed and is on the page now."}}),{ended:"done",said:u.say||"Here it is.",passed:o,last:i,steps:n,stages:t};s({kind:"check",text:`Check: ${ee(k.findings,a)} \u2014 fixing`}),n.push({said:u.say,did:"draft",result:{findings:k.findings,drew:k.drew}})}else{if(u.do==="ask")return{ended:"ask",said:u.say||"What would you like it to look like?",...o?{passed:o}:{},...i?{last:i}:{},steps:n,stages:t};if(!o&&i&&i.findings.length>0&&m<l-2){n.push({said:u.say,did:"done",result:{not_yet:"No draft has passed the checks yet. Fix what the last check found and draft again, or ask the person."}});continue}return{ended:"done",said:u.say||(o?"Done.":"I stopped here."),...o?{passed:o}:{},...i?{last:i}:{},steps:n,stages:t}}}return{ended:"steps",said:o?"Here is where it got to.":"I haven't got it right yet. Tell me more, or ask me to keep going.",...o?{passed:o}:{},...i?{last:i}:{},steps:n,stages:t}}function te(e){let t=/"say"\s*:\s*"((?:[^"\\]|\\.)*)/.exec(e)?.[1],n="";if(t!==void 0)try{n=JSON.parse(`"${t.replace(/\\$/,"")}"`)}catch{n=t}let r=e.indexOf('"source"'),s=r>=0?e.slice(r).split("\\n").length:0,a=s>1?`writing it, ${s} lines so far`:"";return n&&a?`${n.replace(/\.$/,"")} \u2014 ${a}`:n||(a?`Writing the design, ${s} lines so far`:"Thinking\u2026")}function xe(e){return{headings:e.headings,records:e.records.map(t=>({record:t.label,says:t.facts??[],...t.under?{under:t.under}:{},at:{top:t.top,left:t.left},type_px:t.size}))}}function re(e){let t=[];for(let n of e.matchAll(/graview\.style\(\s*([`"'])/g)){let r=n[1],s=n.index+n[0].length,a=s;for(;a<e.length&&e[a]!==r;)a+=e[a]==="\\"?2:1;a<e.length&&t.push({start:s,end:a,quote:r})}return t}var st=["You revise one section of a view in a Graview app.","The view is a plain script: it draws HTML with graview.html`\u2026` templates and styles it with graview.style(css).","You are given the section's markup exactly as it stands in the script's template. It may hold ${\u2026} interpolations: keep each one you keep exactly as written, and never name a variable that is not already in them.","You are given the stylesheet rules that style only this section (you rewrite them), the rules it shares with the rest of the view (never restate or change those), the app's look (its scheme and the values of its --graview-* tokens), and the words the section shows now.",`Answer with one JSON object and nothing else: {"markup": "<the section's whole new markup>", "css": "<every rule that styles it now>", "said": "<one sentence to the person saying what you changed>"}.`,"Keep the same outer element, and keep its name \u2014 its label or its heading's words \u2014 so it is still found. Show the same data. Style every class the markup uses, or stop using it. Use var(--graview-\u2026) tokens for colors, type and corners, never colors of your own.","Never use import, export, require, <script>, <style>, or on\u2026= attributes."].join(" ");var f=e=>e.replace(/\s+/g," ").trim().toLowerCase(),Pe=["no","one","two","three","four","five","six","seven","eight","nine","ten"];function Oe(e){let t=e.name?`\u201C${e.name}\u201D`:"";switch(e.reason){case"selector":return`The selector \u201C${/^(host|host-context)$/.test(e.name??"")?":":/^(slotted|part)$/.test(e.name??"")?"::":""}${e.name??""}\u201D reaches outside the view and is removed with its rule: give the view's outer element a class and style that instead.`;case"at-rule":return`${t||"An at-rule"} is not allowed and is removed with what it holds: use plain rules and @media only.`;case"property":return`The property ${t} is not allowed and is removed: use ordinary layout, color and type properties.`;case"function":return`The function ${t}() is not allowed and is removed: use var(--graview-\u2026), calc(), min(), max(), clamp() or repeat().`;case"url":return"url() is not allowed and is removed: draw nothing from an address.";case"value":return`A value of ${t||"a property"} is not allowed and is removed (position may be static, relative, absolute or sticky).`;case"size":return"The stylesheet is too long and is removed whole: keep it short.";default:return`A rule ${t?`near ${t} `:""}could not be read and is removed: write plain CSS, one rule at a time, no nesting.`}}function M(e){let t=new Set;for(let n of re(e)){let r=e.slice(n.start,n.end).replace(/\$\{(?:[^{}]|\{[^{}]*\})*\}/g,"0");for(let s of G(r).refused)t.add(Oe(s))}return[...t]}var se=/\b\d{4}-\d{2}-\d{2}(?:T[\d:.]+Z?)?\b/,ae=/<\/?[a-z][a-z0-9-]*(?:\s[^<>]*)?>/i,je=/\b(undefined|null|NaN|\[object Object\]|true|false)\b/,Ee=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],I=/\b(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*\.?\s+(\d{1,2})\b|\b(\d{1,2})\s+(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*\b/,de=/\b(mon|tue|wed|thu|fri|sat|sun)[a-z]*\b|\b(today|tomorrow|yesterday)\b/;function ne(e,t){let n=f(e),r=f(t);if(!r||n.includes(r))return!0;let s=i=>i.replace(/[^\p{L}\p{N}]+/gu,"");if(s(r).length>=3&&s(n).includes(s(r)))return!0;let a=I.exec(r);if(a){let i=a[1]??a[4],c=Number(a[2]??a[3]);for(let l of n.matchAll(new RegExp(I.source,"g")))if((l[1]??l[4])===i&&Number(l[2]??l[3])===c)return!0;return Ee.every(l=>!n.includes(l))&&de.test(n)}let o=/^\D*(\d+(?:[.,]\d+)?)\D*$/.exec(r);return o?new RegExp(`(^|\\D)${o[1].replace(/[.,]/g,"[.,]")}(\\D|$)`).test(n):!1}var Ne=/\b(hide|hides|hiding|remove|drop|without|no more|less|fewer|only|just|minimal|simpler|declutter|strip)\b/i,oe=/\b(group|groups|grouped|regroup|section|sections|categor\w*|split|move|moved|bucket\w*|by (status|date|day|list|owner|person))\b/i;function Me(e,t){if(!e||!Ne.test(e))return!1;let n=e.toLowerCase();return/\b(only|just)\b[^.]*\b(name|names|title|titles|label|labels)\b/.test(n)?!0:I.test(f(t))||de.test(f(t))?/\b(date|dates|due|day|days|when|deadline|deadlines)\b/.test(n):/^\D*\d/.test(t)?/\b(count|counts|number|numbers|how many|total|totals)\b/.test(n):/\b(status|statuses|state|tag|tags|chip|chips|badge|badges|label|labels|pill|pills|meta|details)\b/.test(n)||n.includes(f(t))}function $e(e,t,n={}){let r=[],s=f(t.text),a=e.records.map(d=>d.label).filter(d=>d&&!s.includes(f(d)));a.length>0&&r.push(`It no longer shows ${a.slice(0,4).map(d=>`\u201C${d}\u201D`).join(", ")}${a.length>4?` and ${a.length-4} more`:""}: show every record the page showed.`);let o=(d,w)=>d.split(f(w)).length-1,i=f(e.text),c=e.records.map(d=>d.label).filter(d=>d&&o(s,d)>o(i,d));c.length>0&&!(n.asked&&oe.test(n.asked))&&r.push(`It shows ${c.slice(0,4).map(d=>`\u201C${d}\u201D`).join(", ")}${c.length>4?` and ${c.length-4} more`:""} more often than the page did: show each record where the page showed it, and nowhere else.`);let l=[],g=[];for(let d of e.records){let w=t.records.find(v=>f(v.label)===f(d.label));if(!w)continue;let le=`${w.row??""} ${w.under??""}`;for(let v of d.facts??[])!ne(le,v)&&!Me(n.asked,v)&&l.push(`\u201C${v}\u201D on \u201C${d.label}\u201D`);d.under&&w.under&&f(d.under)!==f(w.under)&&t.headings.some(v=>f(v)===f(d.under))&&!(n.asked&&oe.test(n.asked))&&g.push(`\u201C${d.label}\u201D is under \u201C${w.under}\u201D, and was under \u201C${d.under}\u201D`)}l.length>0&&r.push(`A record no longer says what it said: ${l.slice(0,4).join(", ")}${l.length>4?` and ${l.length-4} more`:""}. Show on each record what the page showed on it (its status, its dates, its counts), in words.`),g.length>0&&r.push(`A record moved to another group: ${g.slice(0,3).join("; ")}${g.length>3?` and ${g.length-3} more`:""}. Keep each record under the heading it was under.`);let m=e.headings.filter(d=>d&&!s.includes(f(d)));m.length>0&&r.push(`It no longer shows the heading${m.length>1?"s":""} ${m.map(d=>`\u201C${d}\u201D`).join(", ")}: keep each heading the page had.`);let y=new Map;for(let d of t.headings)d.trim()&&y.set(f(d),(y.get(f(d))??0)+1);let h=[...y].filter(([,d])=>d>1).map(([d])=>t.headings.find(w=>f(w)===d)),u=e.headings.filter(d=>!h.some(w=>f(w)===f(d)));h.length>0&&r.push(`The heading${h.length>1?"s":""} ${h.map(d=>`\u201C${d}\u201D`).join(", ")} ${h.length>1?"are":"is"} drawn twice: the page already draws its title above the view, so leave it out${u.length>0?` \u2014 and keep every other heading as it was: ${u.map(d=>`\u201C${d}\u201D`).join(", ")}`:""}.`);let p=ae.exec(t.text);p&&!ae.test(e.text)&&r.push(`It shows its own markup as words (\u201C${p[0].slice(0,40)}\u201D): build it with graview.html\`\u2026\`, nesting graview.html for each list, never a string of HTML.`);let k=se.exec(t.text);k&&!se.test(e.text)&&r.push(`It shows a date as \u201C${k[0]}\u201D: say dates in words, as the page did (\u201CSep 3\u201D).`);let x=je.exec(t.text);x&&!new RegExp(`\\b${x[1].replace(/[[\]]/g,"\\$&")}\\b`).test(e.text)&&r.push(`It shows \u201C${x[1]}\u201D, which is a value as the computer keeps it, not words for a person: say it in words or leave it out.`);for(let d of n.fields??[]){if(d.length<3||["label","name","title"].includes(d))continue;let w=/[A-Z]/.test(d)?new RegExp(`\\b${d}\\b`):new RegExp(`(?:^|[^\\w])${d}(?:\\s*[:=]|\\s+(?:\\d|true|false|null))`);if(w.test(t.text)&&!w.test(e.text)){r.push(`It shows \u201C${d}\u201D, a field's name, not words for a person: say what it means, or leave it out.`);break}}return r}function ie(e){let t=new Map;for(let n of e){let r=[...t.keys()].find(s=>Math.abs(s-n.top)<=6)??n.top;t.set(r,(t.get(r)??0)+1)}return Math.max(0,...t.values())}function _e(e,t,n){let r=[],s=ie(t.records),a=ie(n.records);a>1&&a!==s?r.push(`side by side, ${Pe[a]??a} to a line`):a===1&&s>1&&r.push("one under another");let o=h=>h.length?h.reduce((u,p)=>u+p.size,0)/h.length:0,i=o(t.records)>0?o(n.records)/o(t.records):1;i>=1.12?r.push("in bigger type"):i<=.89&&r.push("in smaller type");let c=(h,u)=>h.map(p=>f(p.label)).filter(p=>u.has(p)),l=new Set(t.records.map(h=>f(h.label)).filter(h=>n.records.some(u=>f(u.label)===h)));c(t.records,l).join("|")!==c(n.records,l).join("|")&&r.push("in a new order");let g=new Set(t.records.map(h=>f(h.label))),m=n.headings.filter(h=>h.trim()&&!t.headings.some(u=>f(u)===f(h))&&f(h)!==f(e)&&!g.has(f(h)));if(m.length>0&&r.push(`under ${m.length===1?"a new heading":"new headings"}: ${m.slice(0,3).map(h=>`\u201C${h}\u201D`).join(", ")}`),r.length===0)return;let y=/s$/i.test(e.trim());return`${e} now ${y?"show":"shows"} ${r.length===1?r[0]:`${r.slice(0,-1).join(", ")} and ${r.at(-1)}`}.`}var S=(e,t)=>new RegExp(`\\s${t}="([^"]*)"`).exec(e)?.[1];function Ae(e,t,n,r="record"){let s=e.problems.slice(0,5).map(l=>`${l.control}: ${l.says}`),a=l=>e.controls.some(g=>g.ok&&g.does==="act"&&S(g.element,"data-record")===l&&n.includes(S(g.element,"data-act")??"")),o=l=>e.controls.some(g=>g.ok&&g.does==="link"&&S(g.element,"data-record")===l),i=n.length>0?t.filter(l=>l.presses&&!a(l.id)):[];i.length>0&&s.push(`${i.slice(0,3).map(l=>`\u201C${l.label}\u201D`).join(", ")}${i.length>3?` and ${i.length-3} more`:""} can no longer be marked as the page let a person mark ${i.length===1?"it":"them"}: give each ${r} a press bound to ${n.map(l=>`\u201C${l}\u201D`).join(" or ")}, e.g. <button data-act="${n[0]}" data-record="${i[0].id}">\u2026</button>.`);let c=t.filter(l=>l.opens&&!o(l.id));return c.length>0&&s.push(`${c.slice(0,3).map(l=>`\u201C${l.label}\u201D`).join(", ")}${c.length>3?` and ${c.length-3} more`:""} no longer ${c.length===1?"opens its":"open their"} page: link each with data-record="its id".`),s}function Te(e,t,n="records"){let r=[];for(let a of t){let o=new Set(e.controls.filter(i=>i.ok&&i.does==="act"&&S(i.element,"data-act")===a.act).map(i=>S(i.element,"data-record")??i.control));o.size>0&&r.push(`${a.title.replace(/[.…]+$/,"")} works on ${o.size===1?"one of the":`${o.size}`} ${n}`)}let s=new Set(e.controls.filter(a=>a.ok&&a.does==="link"&&S(a.element,"data-record")).map(a=>S(a.element,"data-record")));if(s.size>0&&r.push(`${s.size} open${s.size===1?"s its":" their"} page${s.size===1?"":"s"}`),r.length!==0)return`Pressing each control checked it: ${r.length<2?r[0]:`${r.slice(0,-1).join(", ")} and ${r.at(-1)}`}.`}var Re=/\b(check ?box(es)?|button|click|tap|press|toggle|mark(ed|s|ing)?|complet(e|ed|ing)|finish(ed|es|ing)?|persist|sav(e|es|ed|ing)|updat(e|es|ed|ing)|works?|working|data)\b/i,De=/\b(does(n'?t| not)|did(n'?t| not)|can'?t|cannot|won'?t|not)\s+(work|working|persist|save|stick|change|update|do anything|mark|finish|complete|click|press)|\bfake\b|\bbroken\b|\bstill (broken|not)\b/i;var A=T(ce(),1),C=T(z(),1);function Ie(e){let t=null;for(let n of e){if(!n.isConnected)continue;let r=n.getBoundingClientRect();r.width===0&&r.height===0||(t=t?{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top),right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)}:{left:r.left,top:r.top,right:r.right,bottom:r.bottom})}return t?new DOMRect(t.left,t.top,t.right-t.left,t.bottom-t.top):null}function ft({elements:e,label:t}){let n=(0,A.useRef)(null);return(0,A.useEffect)(()=>{let r=0,s=()=>{let a=Ie(e),o=n.current;o&&(o.style.display=a?"block":"none",a&&(o.style.left=`${Math.round(a.left-3)}px`,o.style.top=`${Math.round(a.top-3)}px`,o.style.width=`${Math.round(a.width+6)}px`,o.style.height=`${Math.round(a.height+6)}px`)),r=requestAnimationFrame(s)};return s(),()=>cancelAnimationFrame(r)},[e]),(0,C.jsx)("div",{ref:n,"aria-hidden":"true","data-testid":"section-outline",style:Ce,children:t?(0,C.jsx)("span",{style:Le,children:t}):null})}var Ce={position:"fixed",display:"none",boxSizing:"border-box",border:"2px dashed var(--graview-accent)",borderRadius:8,pointerEvents:"none",zIndex:L("popover")},Le={position:"absolute",top:-11,left:8,padding:"0 6px",fontSize:"0.6875rem",lineHeight:"18px",borderRadius:999,color:"var(--graview-accent-ink, #fff)",background:"var(--graview-accent)"};export{ze as a,Ge as b,Ke as c,Ve as d,$e as e,_e as f,Ae as g,Te as h,Re as i,De as j,pe as k,me as l,be as m,ve as n,Se as o,xe as p,Ie as q,ft as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Symbol.for("graview.view.clicked");function s(e,n){e[t]=Object.freeze([...n])}function d(e){for(let n=e,o=0;n&&o<64;o+=1){let r=n[t];if(Array.isArray(r))return r;n=n.host??n.parentNode}}export{s as a,d as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Hb as O,Ib as P,Kb as h,Lb as j,Ub as x,vd as E,wd as G,yb as k,yd as F,zd as J}from"./chunk.6HY6ZGEE.js";var W=(o,a)=>{let t=o.kindOf(a);return t===void 0?void 0:o.kept?.({id:a,kind:t})};function w(o,a){return o.flatMap(t=>{if(t.op==="splice-text")return W(a,t.id)?.(t.field)?[]:[t];if(t.op!=="patch-node")return[t];let i=W(a,t.id);if(!i||!Object.keys(t.after).some(i))return[t];let c=r=>Object.fromEntries(Object.entries(r).filter(([f])=>!i(f))),n=c(t.after);return Object.keys(n).length===0?[]:[{op:"patch-node",id:t.id,before:c(t.before),after:n}]})}function _(o,a,t){if(!G(o,a))return t;let i=F(o,a),c=r=>o.graph.getNode(r)!==void 0||x(o.log).kindOf(r)!==void 0,n={...t};if(t.diff){let r=t.diff,f=E(o.log),l=o.log.length??o.log.all().length,u=t.ops?.[0]?.seq??l,M=k(a).id,y=(e,s)=>d=>f.writerAt(e,d,s),m=(e,s)=>i.shows(e.id)?i.servedWith(e,s):void 0,b=(e,s)=>e.flatMap(d=>m(d,s(d.id))??[]),S=e=>i.shows(e.from)&&i.shows(e.to)&&!h(e,i.sees),v=(e,s)=>t.ops?y(e,l):d=>s===void 0||s.includes(d)?M:f.writerAt(e,d,l),D=r.changedNodes.flatMap(e=>{let s=m(e.before,y(e.before.id,u)),d=m(e.after,v(e.after.id,e.fields));return s&&d?[{before:s,after:d,fields:e.fields.filter(p=>p in s||p in d)}]:[]}),B=new Set(r.changedNodes.map(e=>e.after.id)),g=new Map;for(let e of t.ops?.flatMap(s=>s.primitives)??t.primitives??[])e.op!=="patch-node"&&e.op!=="splice-text"||B.has(e.id)||g.set(e.id,[...g.get(e.id)??[],...e.op==="splice-text"?[e.field]:Object.keys(e.after)]);let I=[...g].flatMap(([e,s])=>{let d=o.graph.getNode(e);if(!d)return[];let p=m(d,y(e,u)),N=m(d,v(e,s));return p&&N&&JSON.stringify(p)!==JSON.stringify(N)?[{before:p,after:N,fields:s}]:[]});n.diff={addedNodes:b(r.addedNodes,e=>v(e)),removedNodes:b(r.removedNodes,e=>y(e,u)),changedNodes:[...D,...I],addedEdges:r.addedEdges.filter(S),removedEdges:r.removedEdges.filter(S),touched:[...r.touched.filter(i.shows),...[...g.keys()].filter(e=>i.shows(e)&&!r.touched.includes(e))]}}if(t.ops&&(n.ops=j(t.ops,i)),t.primitives){let r=n.ops;n.primitives=r?r.flatMap(f=>f.primitives):i.timeline?O(t.primitives,i.timeline,{served:(f,l)=>i.servedWith(f,l),edgeClean:f=>!h(f,i.sees),sees:i.sees},k(a).id):j([{id:"",seq:0,batch:"",author:{kind:"system"},intent:"",mutation:null,primitives:t.primitives,reads:[],writes:[],at:""}],i)[0].primitives}return i.kept&&n.primitives&&(n.primitives=w(n.primitives,i)),t.reads&&(n.reads=t.reads.filter(r=>i.shows(r)&&c(r))),t.writes&&(n.writes=t.writes.filter(i.shows)),t.intent!==void 0&&h(t.intent,i.sees)&&(n.intent=P),t.violationsAfter&&Object.assign(n,A?A(o,J(o,a),!!t.ops,n.primitives??[]):{introduces:[],resolves:[],violationsAfter:[]}),n}var A,z=o=>void(A=o);export{_ as a,z as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i}from"./chunk.QQAZQDRW.js";import"./chunk.72ZCLEQC.js";import"./chunk.ONYBW45K.js";import"./chunk.2VR7YEJ6.js";import"./chunk.WVLEGCRI.js";import"./chunk.LETAQTLJ.js";import"./chunk.BUVTUAB5.js";import"./chunk.7VP6Y6D2.js";import"./chunk.WSO7JOW5.js";import"./chunk.XOE4KNP2.js";import"./chunk.2KFZHUAC.js";import"./chunk.V5I4GZEY.js";import"./chunk.WVUJXDXZ.js";import{e as l}from"./chunk.I2737CPF.js";import"./chunk.NJRLJEJY.js";import"./chunk.CVPMSPCH.js";import"./chunk.OTV5XTBB.js";import"./chunk.KBPJ7X7W.js";import"./chunk.OEIWIZCP.js";import"./chunk.MIE4TJRW.js";import"./chunk.5LJVOLKR.js";import"./chunk.OJGHDWI6.js";import"./chunk.OWFS2YDQ.js";import"./chunk.WSDJPXJD.js";import"./chunk.F4VB6Q2W.js";import"./chunk.FFOD5B4B.js";import"./chunk.Z7Y3R3YR.js";import"./chunk.YXEO3Y65.js";import"./chunk.U3HERHAI.js";import"./chunk.FBILPNGH.js";import{W as m}from"./chunk.MODLZJD4.js";import"./chunk.SDO3U72B.js";import"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import{b as g}from"./chunk.AJZBJBMO.js";var a=g(m(),1),r=new WeakMap;function c(n){let o=r.get(n);if(!o){let t=l(n);o=e=>e.mode==="fullscreen"?(0,a.jsx)(i,{blocks:t,slot:"home",heading:2,firstHeading:1,...e.flagged?{flagged:e.flagged}:{}}):(0,a.jsx)(i,{blocks:t,slot:"home",heading:3,firstHeading:2,...e.flagged?{flagged:e.flagged}:{}}),r.set(n,o)}return o}export{c as homeView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{pc as k}from"./chunk.6HY6ZGEE.js";function C(e){let o=e+1;return o*o-x(o).length}function x(e){if(e<3)return[];if(e%2===1){let s=(e-1)/2;return[[s,s]]}let o=e/2-1,t=e/2;return[[o,o],[t,o],[o,t],[t,t]]}function M(e){let o=2166136261;for(let t=0;t<e.length;t++)o=Math.imul(o^e.charCodeAt(t),16777619);return(o>>>0)%1e3/1e3}function O(e,o){let t=e.side+1,s=new Set(x(t).map(([r,d])=>`${r},${d}`)),a=e.side/t,l=[];for(let r=0;r<t;r++)for(let d=0;d<t;d++)s.has(`${d},${r}`)||l.push([d,r]);l.sort((r,d)=>r[0]+r[1]-(d[0]+d[1])||r[0]-d[0]);let i=o.slice(0,l.length);return{buildings:i.map((r,d)=>{let[m,y]=l[d];return{id:r,col:e.col+(m+.5)*a,row:e.row+(y+.5)*a,footprint:a*.62,height:.55+M(r)*.7}}),rest:Math.max(0,o.length-i.length)}}var S={done:.12,waiting:.55,active:1.05};function T(e,o,t=[]){let s=e.side,a=s/Math.max(1,o.length),l=Math.max(1,...o.map(n=>n.length)),i=a;for(let n=1;a/n>=s/8-1e-9&&(i=a/n,!(n*Math.floor(s/i+1e-9)>=l));n++);let c=Math.max(1,Math.floor(a/i+1e-9)),r=Math.max(1,Math.floor(s/i+1e-9)),d=s/r,m=[],y=[];return o.forEach((n,u)=>{let g=n.slice(0,c*r);if(g.forEach((j,b)=>{m.push({id:j,lane:u,col:e.col+(b%r+.5)*d,row:e.row+u*a+(Math.floor(b/r)+.5)*i,footprint:Math.min(d,i)*.66,height:t[u]??S.waiting})}),n.length<=g.length)return;let p=y[0],w=n.length-g.length;p?y[0]={...p,count:p.count+w,rows:p.rows+1}:y.push({lane:u,count:w,rows:1,col:e.col-.15,row:e.row+(u+.5)*a})}),m.sort((n,u)=>n.col+n.row-(u.col+u.row)||n.col-u.col),{blocks:m,rests:y}}var R=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),f=e=>typeof e=="string"?[e]:Array.isArray(e)?e.filter(o=>typeof o=="string"):[];function $(e,o,t){let s=Object.entries(o??{});if(s.length===0)return[];let a=new Set(e.schema.kinds),l=new Map(t.map(c=>[c.name,c])),i=c=>{let r=l.get(c);return r?[...k(e.schema,r),...r.creates??[]]:[]};return s.map(([c,r])=>{let d=[],m=[];for(let n of r.when??[])d.push(...f(n.made),...f(n.changed));for(let n of r.steps??[]){let u=R(n.over)?f(n.over.kind):[],g=Array.isArray(n.from)?n.from.flatMap(p=>R(p)?f(p.kind):[]):[];d.push(...u,...f(n.reads),...g,...f(n.archive),...f(n.classify)),m.push(...[...f(n.act),...f(n.acts)].flatMap(i),...f(n.generate),...f(n.archive),...f(n.classify))}let y=n=>[...new Set(n)].filter(u=>a.has(u));return{name:c,title:r.title,status:r.status==="paused"?"paused":"active",reads:y(d),writes:y(m)}})}function v(e,o){let t=new Map,s=[];for(let a of e){let l=[...a.writes,...a.reads].find(r=>o.has(r));if(l===void 0)continue;let i=o.get(l),c=t.get(l)??0;t.set(l,c+1),s.push({name:a.name,beside:l,col:i.col+i.side+1,row:i.row+.5+c})}return s}var h=e=>typeof e=="number"?Number.isFinite(e)&&e>0?Math.floor(e):0:Array.isArray(e)?e.length:0;function A(e,o=Date.now()){let t=Math.floor((new Date(o).getTime()-new Date(e).getTime())/6e4);if(!Number.isFinite(t)||t<1)return"just now";if(t<60)return t===1?"a minute ago":`${t} minutes ago`;let s=Math.floor(t/60);if(s<24)return s===1?"an hour ago":`${s} hours ago`;let a=Math.floor(s/24);return a===1?"yesterday":`${a} days ago`}function D(e,o=Date.now()){if(!e)return"Has not run yet";let t=`Last ran ${A(e.finished,o)}`;if(e.outcome==="failed")return`${t} and failed`;if(e.outcome==="held")return`${t}: held back`;let a=[[h(e.made),e.dry?"would make":"made"],[h(e.changed),e.dry?"would change":"changed"],[h(e.archived),e.dry?"would set aside":"set aside"],[h(e.suggested),e.dry?"would suggest":"suggested"]].filter(([i])=>i>0).map(([i,c])=>`${c} ${i}`),l=a.length>0?a.join(", "):"nothing new";return`${t}${e.dry?", as a dry run":""}: ${l}${e.outcome==="partial"?" (part of it did not run)":""}`}export{C as a,M as b,O as c,S as d,T as e,$ as f,v as g,D as h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as F,l as b}from"./chunk.
|
|
1
|
+
import{g as F,l as b}from"./chunk.OEIWIZCP.js";function L(t,o){return o===1&&["every","some","sum","min","max","sort"].includes(t.fn)}function M(t){let o=new Set,e=new Set,r=[],s=[],a=new Set(F),i=(l,f)=>{switch(l.t){case"lit":return;case"ident":f||o.add(l.name);return;case"list":l.items.forEach(c=>i(c,f));return;case"member":i(l.object,f);return;case"unary":i(l.operand,f);return;case"binary":i(l.left,f),i(l.right,f);return;case"where":i(l.set,f),i(l.filter,!0);return;case"call":{e.add(l.fn);let c=(l.fn==="out"||l.fn==="in")&&l.args.length===2?l.args[1]:l.args[0],g=c?.t==="lit"&&typeof c.value=="string"?c.value:void 0;l.fn==="all"&&g&&r.push(g),(l.fn==="out"||l.fn==="in")&&g&&s.push(g),l.args.forEach((v,k)=>i(v,f||L(l,k)));return}}};return i(t,!1),{names:o,functions:e,unknownFunctions:[...e].filter(l=>!a.has(l)),sweeps:r,edges:s}}var p=class extends Error{constructor(e,r,s){super(`${e} (at character ${r+1} of "${s}")`);this.sentence=e;this.at=r;this.source=s}},D=["||","&&","==","!=","<=",">=","<",">","!","|","&","+","-","*","/","%","(",")","[","]",",","."],j={and:"&&",or:"||",not:"!"},T=2e3;function H(t){let o=[],e=0;for(;e<t.length;){let r=t[e];if(r===" "||r===" "||r===`
|
|
2
2
|
`||r==="\r"){e++;continue}if(r>="0"&&r<="9"){let a=e;for(;e<t.length&&/[0-9.]/.test(t[e]);)e++;let i=t.slice(a,e),l=Number(i);if(!Number.isFinite(l)||i.split(".").length>2)throw new p(`"${i}" is not a number`,a,t);o.push({k:"num",v:l,at:a});continue}if(r==="'"||r==='"'){let a=e++,i="";for(;e<t.length&&t[e]!==r;)t[e]==="\\"&&e+1<t.length&&e++,i+=t[e++];if(e>=t.length)throw new p("a quoted word is never closed",a,t);e++,o.push({k:"str",v:i,at:a});continue}if(/[A-Za-z_]/.test(r)){let a=e;for(;e<t.length&&/[A-Za-z0-9_]/.test(t[e]);)e++;let i=t.slice(a,e),l=Object.hasOwn(j,i)?j[i]:void 0;o.push(l?{k:"op",v:l,at:a}:{k:"id",v:i,at:a});continue}let s=D.find(a=>t.startsWith(a,e));if(!s)throw new p(`"${r}" is not part of the rule language`,e,t);o.push({k:"op",v:s,at:e}),e+=s.length}return o.push({k:"end",at:t.length}),o}function w(t){if(t.length>T)throw new p(`an expression may be at most ${T} characters`,0,t.slice(0,40));let o=H(t),e=0,r=()=>o[e],s=n=>{let d=r();return d.k==="op"&&d.v===n},a=n=>{let d=r();return d.k==="id"&&d.v===n},i=(n,d)=>{if(!s(n))throw new p(`expected ${d}`,r().at,t);e++},l=0,f=(n,d)=>{if(++l>64)throw new p("the expression nests too deeply",n,t);try{return d()}finally{l--}},c=(n,d)=>()=>{let m=d();for(;;){let y=r(),S=y.k==="op"?n.find(q=>q===y.v):y.k==="id"&&y.v==="in"&&n.includes("in")?"in":void 0;if(!S)return m;e++,m={t:"binary",op:S,left:m,right:d(),at:y.at}}},g=()=>{let n=r();if(n.k==="num")return e++,{t:"lit",value:n.v,at:n.at};if(n.k==="str")return e++,{t:"lit",value:n.v,at:n.at};if(n.k==="id"){if(e++,n.v==="true"||n.v==="false")return{t:"lit",value:n.v==="true",at:n.at};if(n.v==="null")return{t:"lit",value:null,at:n.at};if(s("(")){e++;let d=[];if(!s(")"))for(;;){if(d.push(h()),s(",")){e++;continue}break}return i(")",`")" to close ${n.v}(\u2026)`),{t:"call",fn:n.v,args:d,at:n.at}}return{t:"ident",name:n.v,at:n.at}}if(n.k==="op"&&n.v==="("){e++;let d=f(n.at,h);return i(")",'a ")"'),d}if(n.k==="op"&&n.v==="["){e++;let d=[];if(!s("]"))for(;;){if(d.push(h()),s(",")){e++;continue}break}return i("]",'a "]" to close the list'),{t:"list",items:d,at:n.at}}throw n.k==="end"?new p("the expression ends too soon",n.at,t):new p(`"${n.k==="op"?n.v:""}" cannot start a value here`,n.at,t)},v=()=>{let n=g();for(;;){if(s(".")){let d=r();e++;let m=r();if(m.k!=="id")throw new p('expected a field name after "."',m.at,t);e++,n={t:"member",object:n,name:m.v,at:d.at};continue}if(a("where")){let d=r().at;e++,n={t:"where",set:n,filter:f(d,h),at:d};continue}return n}},k=()=>{let n=r();return n.k==="op"&&(n.v==="!"||n.v==="-")?(e++,{t:"unary",op:n.v,operand:f(n.at,k),at:n.at}):v()},P=c(["*","/","%"],k),z=c(["+","-"],P),N=c(["&"],z),R=c(["|"],N),_=()=>{let n=R(),d=r(),m=d.k==="op"&&["==","!=","<","<=",">",">="].includes(d.v)?d.v:d.k==="id"&&d.v==="in"?"in":void 0;return m?(e++,{t:"binary",op:m,left:n,right:R(),at:d.at}):n},O=()=>{let n=r();return n.k==="op"&&n.v==="!"?(e++,{t:"unary",op:"!",operand:f(n.at,O),at:n.at}):_()},B=c(["&&"],O),I=c(["||"],B);function h(){return I()}let K=h();if(r().k!=="end")throw new p("there is more after the end of the expression",r().at,t);return K}function E(t){let o,e=-1,r=0;for(let s=0;s<t.length;s++){let a=t[s];if(o){a==="\\"?s++:a===o&&(o=void 0);continue}a==="'"||a==='"'?o=a:a==="("||a==="["?r++:a===")"||a==="]"?r--:a==="|"&&r===0&&(t[s+1]==="|"?s++:e=s)}if(e>0&&t.slice(e+1).trim()===x){let s=E(t.slice(0,e));if(s>=0)return s}return e}var x="capital",$=/\s*(?:'((?:[^'\\]|\\.)*)'|"((?:[^"\\]|\\.)*)")\s*(,|$)/y;function U(t){let o=E(t);if(o>=0){if(t.slice(o+1).trim()!==x)throw new u('only "capital" may follow another formatter, like {n | words | capital}');let e=t.slice(0,o);if(e.trim()===x)throw new u('"capital" is said once');return{...C(e),capital:!0}}return t.trim()===x?{args:[],capital:!0}:C(t)}function C(t){let o=t.indexOf(":"),e=(o>=0?t.slice(0,o):t).trim();if(!b.includes(e))throw new u(`"${e}" is not a formatter; use one of ${[...b,x].join(", ")}`);let r=[];if(o>=0&&e==="excerpt"){let s=t.slice(o+1).trim();if(!/^\d+$/.test(s)||Number(s)<20||Number(s)>1e3)throw new u("excerpt is told at most how many characters, 20 to 1000: {summary | excerpt: 80}");r.push(s)}else if(o>=0&&e==="money"){if(t.slice(o+1).trim()!=="0")throw new u("money is told 0 for whole units, rounded \u2014 {total | money: 0} \u2014 or nothing, for cents only where a sum has them");r.push("0")}else if(o>=0){let s=t.slice(o+1),a=0;for(;a<s.length;){$.lastIndex=a;let i=$.exec(s);if(!i)throw new u(`"${e}" is told quoted words, like ${e}: 'offer'`);if(r.push((i[1]??i[2]??"").replace(/\\(.)/g,"$1")),a=$.lastIndex,i[3]==="")break}}if(e==="plural"&&(r.length<1||r.length>2))throw new u("plural is told its noun, like {count | plural: 'offer'}, and its plural where English does not make it: plural: 'person', 'people'");if(e!=="plural"&&e!=="excerpt"&&e!=="money"&&r.length>0)throw new u(`"${e}" takes nothing after it`);return{format:e,args:r}}var u=class extends Error{constructor(e){super(e);this.sentence=e}};function Y(t){let o=[],e=0;for(;e<t.length;){let r=t.indexOf("{",e);if(r<0){o.push({text:t.slice(e)});break}r>e&&o.push({text:t.slice(e,r)});let s=t.indexOf("}",r);if(s<0)throw new u(`a "{" at character ${r+1} is never closed`);let a=t.slice(r+1,s),i=E(a),l=(i>=0?a.slice(0,i):a).trim(),f=i>=0?U(a.slice(i+1)):void 0,c=E(l);if(c>=0&&b.includes(l.slice(c+1).split(":")[0].trim()))throw new u('only "capital" may follow another formatter, like {n | words | capital}');o.push({expr:w(l),source:l,...f?.format?{format:f.format}:{},...f&&f.args.length>0?{formatArgs:f.args}:{},...f?.capital?{capital:!0}:{}}),e=s+1}return o}function A(t){let o=new Map;for(let[e,r]of Object.entries(t?.computed??{}))o.set(e,typeof r=="string"?{expr:r}:r);return o}function re(t){let o=A(t);if(o.size===0)return;let e=new Map;for(let[r,s]of o)try{e.set(r,w(s.expr))}catch(a){if(!(a instanceof p))throw a}return e}function Z(t,o,e=new Set){let r=A(t).get(o);if(!r||e.has(o))return!1;let s;try{s=w(r.expr)}catch{return!1}let a=M(s);if(a.edges.length>0||a.sweeps.length>0||[...a.functions].some(c=>c==="out"||c==="in"||c==="all"))return!1;let i=t.fields,l=c=>i instanceof Set?i.has(c):Object.hasOwn(i,c),f=new Set([...e,o]);return[...a.names].every(c=>l(c)||Z(t,c,f))}export{M as a,p as b,w as c,u as d,Y as e,A as f,re as g,Z as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p}from"./chunk.QWNSHISU.js";import"./chunk.G4JJXA63.js";import{a}from"./chunk.TBY5IR7C.js";import"./chunk.FIFUMX5X.js";import"./chunk.BIDL7GQD.js";import"./chunk.V7W5AQKL.js";import"./chunk.PPSYUOH7.js";import"./chunk.XOZU4OFA.js";import"./chunk.GME63ZHI.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.4FCFNAA4.js";import"./chunk.4AC2QM7T.js";import"./chunk.JXNVNFV4.js";import"./chunk.WVUJXDXZ.js";import"./chunk.I2737CPF.js";import"./chunk.NJRLJEJY.js";import"./chunk.CVPMSPCH.js";import"./chunk.OTV5XTBB.js";import"./chunk.KBPJ7X7W.js";import"./chunk.OEIWIZCP.js";import"./chunk.WSDJPXJD.js";import"./chunk.F4VB6Q2W.js";import"./chunk.FFOD5B4B.js";import"./chunk.Z7Y3R3YR.js";import"./chunk.YXEO3Y65.js";import"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{j as draftAnswer,i as draftFromLens,c as draftSight,m as draftView,b as isDraftFailure,d as judgeLens,e as lensEditOf,g as lensFromSpec,a as mayChangeDeclaration,k as recipeDraft,h as recipeOfLens,n as refineDraft,p as runDraftTool,f as takeBackEditOf,l as templateDraft,o as withReaderLenses};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Zc as g}from"./chunk.6HY6ZGEE.js";function b(){let t=new Uint8Array(16);return globalThis.crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}function k(t,e){if(!t)return;let i={..."filter"in e&&e.filter?{filter:e.filter}:{},...e.section?{section:e.section}:{}};"record"in e?t.record(e.record,i):"list"in e?t.list(e.list,i):t.place(e.place,i)}function w(t,e){if(!t?.href)return;let i={..."filter"in e&&e.filter?{filter:e.filter}:{},...e.section?{section:e.section}:{}};return t.href("record"in e?{record:e.record}:"list"in e?{list:e.list}:{place:e.place},i)}var v=[["accent","--graview-accent"],["ground","--graview-ground"],["panel","--graview-panel"],["ink","--graview-ink"],["inkMuted","--graview-ink-muted"],["edge","--graview-edge"],["fontBody","--graview-font-body"],["fontDisplay","--graview-font-display"],["fontMono","--graview-font-mono"],["radius","--graview-radius"]];function B(t){let e=t.ownerDocument.defaultView,i=e.getComputedStyle(t),s=t.closest("[data-graview-scheme]")?.getAttribute("data-graview-scheme"),d={scheme:s==="dark"||s==="light"?s:/\bdark\b/.test(i.colorScheme??"")?"dark":/\blight\b/.test(i.colorScheme??"")?"light":e.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"};for(let[l,u]of v)d[l]=i.getPropertyValue(u).trim();return d}function R(t,e){let i=t.defaultView;if(!i||typeof i.MutationObserver!="function")return()=>{};let s=new i.MutationObserver(e);s.observe(t.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-graview-scheme","data-theme"]});let o=i.matchMedia?.("(prefers-color-scheme: dark)");return o?.addEventListener?.("change",e),()=>{s.disconnect(),o?.removeEventListener?.("change",e)}}function T(t,e,i){let s=e?.(),o=t(),d=s?.logo,l=i.url(typeof d=="string"||d===void 0?d:o.scheme==="dark"&&d.dark?d.dark:d.light);return{...o,...s?.name?{name:s.name}:{},...l?{logo:l}:{}}}function x(t,e,i){let s,o,d=n=>{n?.startsWith("blob:")&&t.URL.revokeObjectURL(n)},l=async n=>{if(n.startsWith("<"))return g(n)===null?new t.Blob([n],{type:"image/svg+xml"}):void 0;if(/\\|%2e/i.test(n)||n.split(/[?#]/)[0].split("/").some(m=>m==="."||m===".."))return;let r=new t.URL(n,t.document.baseURI);if(r.origin!==t.location.origin||!/^https?:$/.test(r.protocol))return;let a=await t.fetch(r.href,{credentials:"same-origin"}),c=(a.headers.get("content-type")??"").split(";")[0].trim();return a.ok&&c.startsWith("image/")?new t.Blob([await a.arrayBuffer()],{type:c}):void 0},u=n=>new Promise(r=>{let a=new t.Image;a.onload=()=>r(!0),a.onerror=()=>r(!1),t.setTimeout(()=>r(!1),2e3),a.src=n}),p=n=>new Promise((r,a)=>{let c=new t.FileReader;c.onload=()=>r(String(c.result)),c.onerror=a,c.readAsDataURL(n)}),h=async n=>{if(/^data:image\//i.test(n))return n;let r=await l(n);if(!(!r||s!==n)){if(i==="blob"){let a=t.URL.createObjectURL(r);if(await u(a))return a;t.URL.revokeObjectURL(a)}return p(r)}},f=(n,r)=>{if(s!==n)return d(r);r!==o&&(d(o),o=r,e())};return{url(n){let r=n?.trim()||void 0;return r!==s&&(s=r,r?h(r).then(a=>f(r,a),()=>f(r,void 0)):(d(o),o=void 0)),o},dispose(){s=void 0,d(o),o=void 0}}}export{b as a,k as b,w as c,B as d,R as e,T as f,x as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as n}from"./chunk.IAEHUSQQ.js";import{c as a}from"./chunk.7VADSNPZ.js";import"./chunk.FK722SHI.js";import"./chunk.U5P23GO7.js";import"./chunk.6EHHMWPP.js";import"./chunk.TXHYGFIZ.js";import"./chunk.WAB3L3ZI.js";import"./chunk.W53YNBSM.js";import"./chunk.2KFZHUAC.js";import"./chunk.V5I4GZEY.js";import"./chunk.PSQYDCVM.js";import"./chunk.QOS5T46W.js";import"./chunk.MIE4TJRW.js";import"./chunk.5LJVOLKR.js";import"./chunk.OJGHDWI6.js";import"./chunk.OWFS2YDQ.js";import"./chunk.WSDJPXJD.js";import"./chunk.F4VB6Q2W.js";import"./chunk.FFOD5B4B.js";import"./chunk.Z7Y3R3YR.js";import"./chunk.YXEO3Y65.js";import"./chunk.U3HERHAI.js";import"./chunk.FBILPNGH.js";import{W as i}from"./chunk.MODLZJD4.js";import"./chunk.SDO3U72B.js";import"./chunk.6HY6ZGEE.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Y,b as _,c as D,e as R,h as z,i as q,j as k,k as S,l as N,o as H,p as P}from"./chunk.
|
|
1
|
+
import{a as Y,b as _,c as D,e as R,h as z,i as q,j as k,k as S,l as N,o as H,p as P}from"./chunk.BUVTUAB5.js";import{b as V}from"./chunk.FFOD5B4B.js";import{G,L as T,T as A,aa as W,cb as F,ga as j,ha as B,hb as U,la as I}from"./chunk.6HY6ZGEE.js";function ne(e,r){return e===void 0||e===!0?!0:e===!1?!1:e[r]!==!1}function oe(e){let r={};return e.query&&e.query.trim().length>0&&(r.q=e.query),e.archived!==void 0&&e.archived!==!1&&(r.archived=String(e.archived)),e.sort&&(r.sort=e.sort.direction==="desc"?`${e.sort.by}:desc`:e.sort.by),e.filter?.length&&(r.filter=e.filter.map(n=>`${n.key}:${n.value}`).join(",")),e.group&&(r.group=e.group.bucket?`${e.group.by}:${e.group.bucket}`:e.group.by),r}function ie(e,r){let n=[],d={};if(e.query&&(d.query=e.query),e.archived!==void 0&&e.archived!==!1&&(d.archived=e.archived),e.sort&&(r.sorts.some(u=>u.key===e.sort.by)?d.sort=e.sort:n.push(`sort ${e.sort.by}`)),e.filter){let u=e.filter.filter(c=>r.filters.find(a=>a.key===c.key)?!0:(n.push(`filter ${c.key}`),!1));u.length>0&&(d.filter=u)}return e.group&&(r.groups.some(u=>u.key===e.group.by)?d.group=e.group:n.push(`group ${e.group.by}`)),{arrangement:d,dropped:n}}function x(e,r){return I(e.schema.tryDefinition(r.kind),k(r))}var se=(e,r)=>e==null?r==null?0:1:r==null?-1:typeof e=="number"&&typeof r=="number"?e-r:typeof e=="boolean"&&typeof r=="boolean"?e===r?0:e?1:-1:String(e).localeCompare(String(r),void 0,{numeric:!0,sensitivity:"base"});function de(e,r,n){if(n==="label")return x(e,r);let d=e.schema.tryDefinition(r.kind);return d&&n in(d.fields.shape??{})?F(q(r),n,e.today??T()):d?.computed?.[n]!==void 0?e.read?.(r,n):S(e.graph,r.id,n).map(c=>x(e,c)).sort()[0]}var ue=/^(\d{4})-(\d{2})-(\d{2})/;function Z(e,r){if(G.test(e)){let[s,i]=[e.slice(0,4),e.slice(5,7)];return r==="year"?`${s}-01-01`:r==="decade"?`${String(Number(s)-Number(s)%10).padStart(4,"0")}-01-01`:r==="month"&&i?`${s}-${i}-01`:e}let n=ue.exec(e);if(!n)return;let[,d,u,c]=n;if(r==="day")return`${d}-${u}-${c}`;if(r==="month")return`${d}-${u}-01`;if(r==="year")return`${d}-01-01`;if(r==="decade")return`${String(Number(d)-Number(d)%10).padStart(4,"0")}-01-01`;let l=new Date(Date.UTC(Number(d),Number(u)-1,Number(c))),a=(l.getUTCDay()+6)%7;return l.setUTCDate(l.getUTCDate()-a),l.toISOString().slice(0,10)}function le(e,r){return G.test(e)?A(e):r==="month"?W(e):r==="week"?`Week of ${A(e)}`:r==="year"?e.slice(0,4):r==="decade"?`The ${e.slice(0,4)}s`:A(e)}function ae(e,r,n){return Q(e,n)(r)}function Q(e,r){let{words:n,conditions:d}=H(r);if(n.length===0&&d.length===0)return()=>!0;let u=new Map,c=l=>{let a=u.get(l);return a||(a=new Set(R(e.schema,l).filters.map(s=>s.key)),u.set(l,a)),a};return l=>{let a=c(l.kind),s=d.filter(i=>a.has(i.key));return s.every(i=>N(e,l,i))?n.length>0?P(e.schema.tryDefinition(l.kind),k(l),n,e.searchIn)!==void 0:s.length>0:!1}}function fe(e,r,n){let d=r.query?.trim(),u=r.archived===void 0?e:e.filter(t=>U(t,r.archived)),c=d?u.filter(Q(n,d)):u,l=r.filter?.length?c.filter(t=>r.filter.every(f=>N(n,t,f))):[...c],a=[];for(let t=r.sort;t&&a.length<4;t=t.then)a.push(t);let s=a.length>0?l.map((t,f)=>({node:t,index:f,values:a.map(o=>de(n,t,o.by))})).sort((t,f)=>{for(let[o,p]of a.entries()){let[b,E]=[t.values[o],f.values[o]],C=se(b,E),M=p.direction==="desc"&&C!==0&&b!==void 0&&E!==void 0?-C:C;if(M!==0)return M}return t.index-f.index}).map(t=>t.node):l,i=r.group;if(!i)return{nodes:s,groups:[{key:"",label:"",nodes:s}],grouped:!1};let y=new Map,g=(t,f,o)=>{let p=y.get(t)??{label:f,nodes:[]};p.nodes.push(o),y.set(t,p)},O=s[0],m=O?n.schema.tryDefinition(O.kind):void 0,L=m?.fields.shape??{},ee=m?Y(m,i.by):j(i.by),$=i.by in L,h=$?_(L[i.by]):void 0,re=D(n.schema,O?.kind??"").find(t=>t.key===i.by)?.label,w=$?`No ${ee.toLowerCase()}`:`Without ${(re??j(i.by)).toLowerCase()}`,K=$?new Map:V([...new Map(s.flatMap(t=>S(n.graph,t.id,i.by)).map(t=>[t.id,t])).values()].map(k),t=>n.schema.tryDefinition(t));for(let t of s){if($){let o=F(q(t),i.by,n.today??T());if(o==null||o==="")g("",w,t);else if(h==="date"){let p=i.bucket??"day",b=Z(String(o),p);b?g(b,le(b,p),t):g("",w,t)}else if(h==="boolean")g(o?"1":"0",o?"Yes":"No",t);else{let p=m?.display?.format?.[i.by];g(String(o),p?p(o):h==="choice"?B(String(o)):String(o),t)}continue}let f=S(n.graph,t.id,i.by).map(o=>({id:o.id,label:K.has(o.id)?`${x(n,o)} \xB7 ${K.get(o.id)}`:x(n,o)})).sort((o,p)=>o.label.localeCompare(p.label));f.length===0?g("",w,t):g(f.map(o=>o.id).join(","),f.map(o=>o.label).join(", "),t)}let v=h==="choice"?z(L[i.by]):void 0,te=[...y.entries()].sort(([t,f],[o,p])=>t===""?1:o===""?-1:v?v.indexOf(t)-v.indexOf(o):h==="boolean"?o.localeCompare(t):h==="date"?t.localeCompare(o):f.label.localeCompare(p.label)).map(([t,f])=>({key:t,label:f.label,nodes:f.nodes}));return{nodes:s,groups:te,grouped:!0}}function J(e){if(e===void 0)return;if(typeof e=="string")return{by:e,direction:"asc"};let r=e.then===void 0?void 0:typeof e.then=="string"?{by:e.then,direction:"asc"}:{by:e.then.by,direction:e.then.direction??"asc"};return{by:e.by,direction:e.direction??"asc",...r?{then:r}:{}}}function X(e){if(e!==void 0)return typeof e=="string"?{by:e}:e}function ce(e){let r=J(e?.sort),n=X(e?.group);if(!(!r&&!n))return{...r?{sort:r}:{},...n?{group:{by:n.by}}:{}}}var pe=(e,r)=>r?e==="1"?"true":"false":e;function ge(e,r,n){let d=n.type==="boolean",u=d?["true","false"]:n.options??[],c=[...new Set([...(r.order??[]).filter(s=>u.includes(s)),...u])],l=r.closed??[],a=s=>{if(s.key==="")return[1,0];let i=pe(s.key,d);if(l.includes(i))return[2,l.indexOf(i)];let y=c.indexOf(i);return[0,y<0?c.length:y]};return e.map((s,i)=>({group:s,at:i,rank:a(s)})).sort((s,i)=>s.rank[0]-i.rank[0]||s.rank[1]-i.rank[1]||s.at-i.at).map(({group:s,rank:i})=>({...s,closed:i[0]===2}))}export{X as a,ce as b,ge as c,ne as d,oe as e,ie as f,ae as g,fe as h};
|