graview 0.1.60 → 0.1.62
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.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/preview/{chunk.QDSEVPF3.js → chunk.22BZU7ME.js} +1 -1
- package/dist/preview/chunk.2AT3GRXM.js +1 -0
- package/dist/preview/chunk.2B6P4GPS.js +1 -0
- package/dist/preview/chunk.2GEJNG2U.js +1 -0
- package/dist/preview/{chunk.7N32AVIJ.js → chunk.2N4Z5K5S.js} +1 -1
- package/dist/preview/{chunk.NHUQ2N6J.js → chunk.3FON2Y72.js} +1 -1
- package/dist/preview/chunk.3L37FY3G.js +4 -0
- package/dist/preview/{chunk.ZYM2SSGW.js → chunk.4HEFUOLV.js} +1 -1
- package/dist/preview/chunk.4HRYB7HF.js +1 -0
- package/dist/preview/{chunk.YZ7FUKAL.js → chunk.4TX6VCBT.js} +1 -1
- package/dist/preview/{chunk.IGJZ4UH3.js → chunk.5HGD6OWL.js} +2 -2
- package/dist/preview/{chunk.2USDHXB4.js → chunk.5J3O2FVG.js} +1 -1
- package/dist/preview/{chunk.H45Q3O4F.js → chunk.5MZYCELA.js} +1 -1
- package/dist/preview/{chunk.SRVQJZRT.js → chunk.5ODHHH35.js} +1 -1
- package/dist/preview/{chunk.HDUO2USQ.js → chunk.5STU3KYG.js} +1 -1
- package/dist/preview/{chunk.TFWIG6LL.js → chunk.5YAOKOGV.js} +1 -1
- package/dist/preview/{chunk.BQIHNT7C.js → chunk.66P5IDTH.js} +1 -1
- package/dist/preview/{chunk.M4UD4ARP.js → chunk.6AKW7TXM.js} +1 -1
- package/dist/preview/{chunk.URWAFZHF.js → chunk.6JO5HQDR.js} +1 -1
- package/dist/preview/{chunk.HUJ6YTWE.js → chunk.75GVFX7L.js} +1 -1
- package/dist/preview/{chunk.A3ZXDG6V.js → chunk.7KVUUEZA.js} +1 -1
- package/dist/preview/{chunk.FFTYMBBT.js → chunk.7M4HNKDR.js} +1 -1
- package/dist/preview/chunk.7OBIBPYH.js +1 -0
- package/dist/preview/chunk.7V56P2A7.js +1 -0
- package/dist/preview/chunk.7XLS6XTY.js +1 -0
- package/dist/preview/chunk.7YOAW7ED.js +1 -0
- package/dist/preview/{chunk.FBJARKDT.js → chunk.A3OL2BI2.js} +1 -1
- package/dist/preview/{chunk.NGTRL5U4.js → chunk.A3ZC2JBO.js} +1 -1
- package/dist/preview/{chunk.A5PDXNY6.js → chunk.ACTXR2MI.js} +1 -1
- package/dist/preview/chunk.AFNSAQEQ.js +1 -0
- package/dist/preview/chunk.AI34V6WV.js +74 -0
- package/dist/preview/{chunk.3XGA65Y3.js → chunk.AJSUHPBE.js} +1 -1
- package/dist/preview/chunk.AQRB7LDA.js +1 -0
- package/dist/preview/{chunk.GNBIVVL3.js → chunk.B23WZQXQ.js} +1 -1
- package/dist/preview/chunk.BIDL7GQD.js +0 -0
- package/dist/preview/chunk.BLUKSGI4.js +1 -0
- package/dist/preview/chunk.BZMQDEIY.js +1 -0
- package/dist/preview/chunk.CAKFNKN5.js +1 -0
- package/dist/preview/chunk.CGALLZ54.js +1 -0
- package/dist/preview/{chunk.LSY256J4.js → chunk.CHHYIMB7.js} +1 -1
- package/dist/preview/chunk.CXDGE5ZS.js +1 -0
- package/dist/preview/{chunk.CC5BJH5A.js → chunk.CY3ELWCM.js} +1 -1
- package/dist/preview/chunk.DC35FJAB.js +1 -0
- package/dist/preview/{chunk.AVBTPSQF.js → chunk.DD2NKFDX.js} +1 -1
- package/dist/preview/{chunk.6HF6POIX.js → chunk.DDO3GLEJ.js} +1 -1
- package/dist/preview/{chunk.TLJOZSDD.js → chunk.DDUCIUVW.js} +1 -1
- package/dist/preview/chunk.DEAP3H2L.js +1 -0
- package/dist/preview/chunk.DHJ3FQTR.js +1 -0
- package/dist/preview/{chunk.P6RORYOT.js → chunk.DNVWSWL2.js} +1 -1
- package/dist/preview/chunk.DPEIT3TW.js +1 -0
- package/dist/preview/chunk.DVSTLVIH.js +15 -0
- package/dist/preview/chunk.DZZL5IDD.js +5 -0
- package/dist/preview/{chunk.IGVASEZU.js → chunk.ELOFPE25.js} +1 -1
- package/dist/preview/{chunk.MVWC3VR3.js → chunk.ELTV44HU.js} +2 -2
- package/dist/preview/chunk.EVBCEEQ4.js +1 -0
- package/dist/preview/{chunk.TKVLNBRD.js → chunk.F7YXLYLX.js} +1 -1
- package/dist/preview/{chunk.DCHQHKSA.js → chunk.FULEUL34.js} +1 -1
- package/dist/preview/{chunk.VNDKKTED.js → chunk.G4ULQK64.js} +14 -14
- package/dist/preview/{chunk.Y7G3OGDE.js → chunk.GX4G4BX3.js} +1 -1
- package/dist/preview/chunk.H24OC6OE.js +1 -0
- package/dist/preview/chunk.H5S7OL2U.js +1 -0
- package/dist/preview/chunk.H73ZPYUX.js +1 -0
- package/dist/preview/{chunk.GTKJJYQH.js → chunk.H7N7WN4U.js} +1 -1
- package/dist/preview/chunk.HANJZ6FA.js +1 -0
- package/dist/preview/chunk.HIMQ65QT.js +1 -0
- package/dist/preview/chunk.I77ZGIFE.js +1 -0
- package/dist/preview/{chunk.MJVYWLQQ.js → chunk.ILIIBSGA.js} +1 -1
- package/dist/preview/chunk.IQ3PRWGO.js +104 -0
- package/dist/preview/{chunk.NC7FXY2H.js → chunk.IQMD7DG3.js} +1 -1
- package/dist/preview/chunk.IQPILSV3.js +18 -0
- package/dist/preview/chunk.IYBEXENQ.js +1 -0
- package/dist/preview/{chunk.ULL6ZIJJ.js → chunk.J7Q2WAF4.js} +1 -1
- package/dist/preview/{chunk.TLWT67ON.js → chunk.JT3MFPRD.js} +1 -1
- package/dist/preview/chunk.JYFZCJ4N.js +2 -0
- package/dist/preview/chunk.K2HDEL7I.js +1 -0
- package/dist/preview/chunk.KDXU5DT3.js +1 -0
- package/dist/preview/chunk.KL7E4YHJ.js +1 -0
- package/dist/preview/{chunk.FRYBMS3W.js → chunk.KMV6PJFL.js} +1 -1
- package/dist/preview/{chunk.RXYNW5QB.js → chunk.L3WTKQQL.js} +1 -1
- package/dist/preview/chunk.LAYQ5PFS.js +1 -0
- package/dist/preview/{chunk.KBVTLNS5.js → chunk.LGRLVJGS.js} +3 -3
- package/dist/preview/chunk.LTZUF5VG.js +1 -0
- package/dist/preview/{chunk.OLFJH4RK.js → chunk.M4AYA2PL.js} +1 -1
- package/dist/preview/chunk.M7RESZB6.js +25 -0
- package/dist/preview/{chunk.WXUFATY5.js → chunk.MAKODQO3.js} +1 -1
- package/dist/preview/{chunk.F6V7RWDK.js → chunk.MDEX6ZVE.js} +1 -1
- package/dist/preview/chunk.MGALQLRW.js +1 -0
- package/dist/preview/{chunk.7OPM55I2.js → chunk.MYNMBOLD.js} +1 -1
- package/dist/preview/chunk.N6EJXXQK.js +2 -0
- package/dist/preview/chunk.NAD7ZXYP.js +1 -0
- package/dist/preview/chunk.NHTGAP3G.js +3 -0
- package/dist/preview/{chunk.5IEFTFKQ.js → chunk.NJSK3UO2.js} +1 -1
- package/dist/preview/{chunk.VFOON3Z3.js → chunk.NOGGSLVG.js} +1 -1
- package/dist/preview/chunk.NUWDMH47.js +1 -0
- package/dist/preview/chunk.NUYA4BWI.js +1 -0
- package/dist/preview/{chunk.VUBNBTJP.js → chunk.O2BHPYA4.js} +2 -2
- package/dist/preview/chunk.O75HWF3F.js +1 -0
- package/dist/preview/chunk.OFWNMTGB.js +21 -0
- package/dist/preview/chunk.OKZT2QBM.js +2 -0
- package/dist/preview/{chunk.EL5ICOOM.js → chunk.OUDATENL.js} +1 -1
- package/dist/preview/chunk.OUPURRDE.js +1 -0
- package/dist/preview/{chunk.Y5C4RXG7.js → chunk.OWOOKLIU.js} +2 -1
- package/dist/preview/{chunk.PI44XMY2.js → chunk.OWT3VVOT.js} +1 -1
- package/dist/preview/{chunk.VDMDPZ6U.js → chunk.PCDUV3WP.js} +1 -1
- package/dist/preview/chunk.PD2DECOP.js +1 -0
- package/dist/preview/{chunk.ZXOT3IXJ.js → chunk.PKWQKFPE.js} +1 -1
- package/dist/preview/{chunk.ENL2JJ47.js → chunk.PLTH2LW5.js} +1 -1
- package/dist/preview/{chunk.ZP5RT2EK.js → chunk.PZQNR4KZ.js} +1 -1
- package/dist/preview/chunk.Q5WEOX3Q.js +1 -0
- package/dist/preview/chunk.QDWSU47A.js +1 -0
- package/dist/preview/{chunk.VADQ7ZGA.js → chunk.QGU5QTR6.js} +1 -1
- package/dist/preview/chunk.QHY5NVYH.js +1 -0
- package/dist/preview/{chunk.6ZQAR5ZA.js → chunk.QIPASE42.js} +1 -1
- package/dist/preview/{chunk.7MHCGVGM.js → chunk.RD2X25XB.js} +1 -1
- package/dist/preview/chunk.RMR24LFJ.js +4 -0
- package/dist/preview/chunk.ROZTJ6IY.js +6 -0
- package/dist/preview/{chunk.RQOX5YDW.js → chunk.RPDH32XV.js} +1 -1
- package/dist/preview/chunk.RRKI24WY.js +1 -0
- package/dist/preview/{chunk.HDP3PS7N.js → chunk.RYRQ66JN.js} +1 -1
- package/dist/preview/chunk.SEHRPTNA.js +7 -0
- package/dist/preview/chunk.SGCW2XRC.js +1 -0
- package/dist/preview/{chunk.JPONLMU7.js → chunk.SS7234R6.js} +1 -1
- package/dist/preview/{chunk.BXDM3UMN.js → chunk.SVPKUWZU.js} +1 -1
- package/dist/preview/{chunk.LQVAABPS.js → chunk.SWMDFXUX.js} +1 -1
- package/dist/preview/{chunk.6WHAWOO7.js → chunk.T3UQ7ZQK.js} +1 -1
- package/dist/preview/chunk.T6PU3NKP.js +1 -0
- package/dist/preview/{chunk.6C2MHWSX.js → chunk.T6WHGKWR.js} +1 -1
- package/dist/preview/{chunk.QBLKTFF4.js → chunk.THVC2BEC.js} +1 -1
- package/dist/preview/{chunk.KDRLUBVF.js → chunk.TIALD6SC.js} +1 -1
- package/dist/preview/{chunk.Z2ERZ4S6.js → chunk.TM4EPUNO.js} +1 -1
- package/dist/preview/chunk.U5P23GO7.js +1 -0
- package/dist/preview/chunk.U6ZRJKVM.js +1 -0
- package/dist/preview/chunk.UFDJXQQQ.js +32 -0
- package/dist/preview/{chunk.IOK4GVJC.js → chunk.UKQUUPKE.js} +1 -1
- package/dist/preview/{chunk.TAT2IQUR.js → chunk.UQQKDBIH.js} +1 -1
- package/dist/preview/{chunk.QHDCTAD7.js → chunk.UVA7AALY.js} +1 -1
- package/dist/preview/chunk.UXMPFPFH.js +20 -0
- package/dist/preview/chunk.VACKSKGJ.js +1 -0
- package/dist/preview/{chunk.3UOKUF5Z.js → chunk.VC3V7HLL.js} +1 -1
- package/dist/preview/chunk.VIH5AX7S.js +5 -0
- package/dist/preview/{chunk.4LR64TPU.js → chunk.VJBBVLGZ.js} +1 -1
- package/dist/preview/chunk.VN23AGIY.js +1 -0
- package/dist/preview/{chunk.VZJWJ5XM.js → chunk.W4BKYSZX.js} +1 -1
- package/dist/preview/{chunk.CQT3W2SF.js → chunk.WEOVK2T4.js} +1 -1
- package/dist/preview/chunk.WKI5INH7.js +1 -0
- package/dist/preview/chunk.WPXPVD33.js +88 -0
- package/dist/preview/chunk.X6KYRBL6.js +1 -0
- package/dist/preview/chunk.Y2YYH3JN.js +1 -0
- package/dist/preview/chunk.Y4FZKUOK.js +1 -0
- package/dist/preview/chunk.Y4S7CDRB.js +1 -0
- package/dist/preview/{chunk.YFSBVZTG.js → chunk.YP2QSPXU.js} +1 -1
- package/dist/preview/{chunk.VWJGQDCE.js → chunk.Z2TDZSMN.js} +1 -1
- package/dist/preview/chunk.ZN3PUM2I.js +1 -0
- package/dist/preview/index.html +53 -51
- package/dist/preview/page.js +2 -2
- package/dist/preview/splash.js +57 -0
- package/package.json +6 -6
- package/dist/preview/chunk.2K4TT2BV.js +0 -1
- package/dist/preview/chunk.37TVS7CA.js +0 -1
- package/dist/preview/chunk.3IZ3ABII.js +0 -1
- package/dist/preview/chunk.3MOJF7BA.js +0 -1
- package/dist/preview/chunk.3V4WP7RY.js +0 -18
- package/dist/preview/chunk.3ZT5WQYL.js +0 -1
- package/dist/preview/chunk.4MP72LPR.js +0 -25
- package/dist/preview/chunk.4TCKEG6I.js +0 -1
- package/dist/preview/chunk.5DD62IOW.js +0 -21
- package/dist/preview/chunk.5YOLUDVO.js +0 -1
- package/dist/preview/chunk.644FUGSX.js +0 -1
- package/dist/preview/chunk.67U6M7OV.js +0 -1
- package/dist/preview/chunk.7TFLRR7D.js +0 -1
- package/dist/preview/chunk.7VKSXGTX.js +0 -1
- package/dist/preview/chunk.BF6S5UE4.js +0 -1
- package/dist/preview/chunk.BLPYNNR4.js +0 -1
- package/dist/preview/chunk.BRT27WON.js +0 -1
- package/dist/preview/chunk.BYKD5RLA.js +0 -1
- package/dist/preview/chunk.C7OLSEWK.js +0 -1
- package/dist/preview/chunk.CFKZXLXS.js +0 -1
- package/dist/preview/chunk.CMN6BBAD.js +0 -1
- package/dist/preview/chunk.D7YSL3NK.js +0 -2
- package/dist/preview/chunk.EQXB7LKI.js +0 -1
- package/dist/preview/chunk.ERFT54HT.js +0 -1
- package/dist/preview/chunk.FLUK3UXF.js +0 -1
- package/dist/preview/chunk.G3R4BTI7.js +0 -1
- package/dist/preview/chunk.G4YJPKRG.js +0 -5
- package/dist/preview/chunk.GLWSVSQL.js +0 -1
- package/dist/preview/chunk.I4XQBQRC.js +0 -1
- package/dist/preview/chunk.IBOKXVWN.js +0 -1
- package/dist/preview/chunk.IHBUBZQT.js +0 -2
- package/dist/preview/chunk.JEYQBH33.js +0 -32
- package/dist/preview/chunk.JJGCTGWA.js +0 -1
- package/dist/preview/chunk.KGW75Z5L.js +0 -3
- package/dist/preview/chunk.KI37ZEV3.js +0 -1
- package/dist/preview/chunk.KNYLY7MH.js +0 -1
- package/dist/preview/chunk.L6AWE76F.js +0 -1
- package/dist/preview/chunk.LGEA5257.js +0 -6
- package/dist/preview/chunk.LLYRFVIN.js +0 -104
- package/dist/preview/chunk.LZIBQ3VX.js +0 -1
- package/dist/preview/chunk.MDJWK5W2.js +0 -1
- package/dist/preview/chunk.MSWWWLEA.js +0 -1
- package/dist/preview/chunk.PFSYXD6Q.js +0 -1
- package/dist/preview/chunk.PHC2MI4C.js +0 -1
- package/dist/preview/chunk.PHJ6WPWH.js +0 -1
- package/dist/preview/chunk.PNW5K7BW.js +0 -1
- package/dist/preview/chunk.PXQVXBNG.js +0 -1
- package/dist/preview/chunk.QFUMFQJU.js +0 -1
- package/dist/preview/chunk.QI4SLPQ4.js +0 -4
- package/dist/preview/chunk.QUJS63OJ.js +0 -13
- package/dist/preview/chunk.SB2PZKN5.js +0 -88
- package/dist/preview/chunk.T7LQD67N.js +0 -20
- package/dist/preview/chunk.TY4GQJKC.js +0 -1
- package/dist/preview/chunk.UDCDK7XJ.js +0 -4
- package/dist/preview/chunk.UITT6JWW.js +0 -2
- package/dist/preview/chunk.UJTE7UAP.js +0 -1
- package/dist/preview/chunk.UQWTZJBV.js +0 -1
- package/dist/preview/chunk.VMV464JK.js +0 -1
- package/dist/preview/chunk.VSCIXAHN.js +0 -5
- package/dist/preview/chunk.W3W54DSX.js +0 -1
- package/dist/preview/chunk.WC3DENU4.js +0 -67
- package/dist/preview/chunk.WQ6RCEUQ.js +0 -1
- package/dist/preview/chunk.X6A4VSSD.js +0 -1
- package/dist/preview/chunk.XGASJAV2.js +0 -7
- package/dist/preview/chunk.XR6YR6RV.js +0 -1
- package/dist/preview/chunk.XZPKBHJT.js +0 -1
- package/dist/preview/chunk.YEBGI6ED.js +0 -1
- package/dist/preview/chunk.YH63KQ2G.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk.AJZBJBMO.js";var e='"use strict";\n/*! @remote-dom/core and @remote-dom/polyfill \u2014 Copyright 2020-present, Shopify Inc. \u2014 MIT License.\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * @graview/guest\'s worker runtime \u2014 Elastic License 2.0. */\n"use strict";(()=>{var Ae=globalThis,no=Ae.addEventListener,ro=Ae.removeEventListener,oo=Ae.postMessage,so=globalThis.queueMicrotask,dn=globalThis.performance,io=dn?dn.now.bind(dn):Date.now,_e={listen:t=>no.call(Ae,"message",t),unlisten:t=>ro.call(Ae,"message",t),post:t=>oo.call(Ae,t),microtask:t=>so.call(globalThis,t),now:()=>io()};var x=Symbol("name"),fe=Symbol("prefix"),me=Symbol("value"),S=Symbol("ns"),z=Symbol("owner"),I=Symbol("owner_document"),re=Symbol("attributes"),D=Symbol("prev"),p=Symbol("next"),R=Symbol("child"),Y=Symbol("parent"),pe=Symbol("host"),K=Symbol("data"),Te=Symbol("listeners"),fn=Symbol("isTrusted"),Pe=Symbol("path"),Ce=Symbol("stop_immediate_propagation"),Me=Symbol("dispatching"),ie=Symbol("content"),k=Symbol("hooks"),mt=Symbol("extensions"),Oe=Symbol("hooks_dispatch"),U=Symbol("is_connected"),Ie=Symbol("create_element"),$n=0,X=1,De=2,ke=3,Le=8,we=9,Kn=10,he=11,A="http://www.w3.org/1999/xhtml",Z="http://www.w3.org/2000/svg",Zn="http://www.w3.org/XML/1998/namespace",$e="http://www.w3.org/2000/xmlns/";function pt(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function G(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function Qn(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function C(t,e){let n=globalThis.DOMException;if(typeof n=="function")return new n(t,e);let r=new Error(t);return r.name=e,r}var Jn=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,er=/[\\0\\t\\n\\f\\r />=]/u,ao=/[\\0\\t\\n\\f\\r />]/u;function ae(t){if(t==null)return null;let e=String(t);return e===""?null:e}function tr(t){Jn.test(t)||pn(t)}function mn(t){(t===""||er.test(t))&&pn(t)}function ht(t,e,n){let r=ae(t),o=String(e),s=o.indexOf(":"),i=s<0?null:o.slice(0,s),a=s<0?o:o.slice(s+1);if((i!=null&&(i===""||ao.test(i))||(n==="element"?!Jn.test(a):a===""||er.test(a)))&&pn(o),i!=null&&r==null)throw C(`A namespace is required for the prefix in "${o}"`,"NamespaceError");if(i==="xml"&&r!==Zn)throw C("The xml prefix requires the XML namespace","NamespaceError");if((o==="xmlns"||i==="xmlns")&&r!==$e)throw C("The xmlns name requires the XMLNS namespace","NamespaceError");if(r===$e&&o!=="xmlns"&&i!=="xmlns")throw C("The XMLNS namespace requires the xmlns name or prefix","NamespaceError");return{namespace:r,qualifiedName:o,prefix:i,localName:a}}function pn(t){throw C(`Invalid name: "${t}"`,"InvalidCharacterError")}var gt=0,yt=1,nr=2,hn=3,lo=typeof performance>"u"?Date.now:performance.now.bind(performance),B=class{static NONE=gt;static CAPTURING_PHASE=yt;static AT_TARGET=nr;static BUBBLING_PHASE=hn;timeStamp=lo();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=gt;[Pe]=[];[Ce]=!1;[Me]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,fn,{writable:!0,value:!1}),n&&(n.bubbles&&(this.bubbles=n.bubbles),n.cancelable&&(this.cancelable=n.cancelable),n.composed&&(this.composed=n.composed))}get isTrusted(){return this[fn]}composedPath(){return[...this[Pe]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[Ce]=!0,this.cancelBubble=!0}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}set returnValue(e){e||this.preventDefault()}get returnValue(){return!this.defaultPrevented}initEvent(e,n,r){this.type=e,this.bubbles=!!n,this.cancelable=!!r}};function gn(t,e,n){if(t.cancelBubble)return;let o=e[Te]?.get(t.type)?.[n===yt?"capture":"bubble"];if(o)for(let s of[...o]){if(!o.has(s)||s.signal?.aborted)continue;t.eventPhase=t.target===e?nr:n,t.currentTarget=e;let i=s.normalizedListener;try{typeof i=="object"?i.handleEvent(t):i.call(e,t)}catch(a){setTimeout(co,0,a)}if(t[Ce])break}}function co(t){throw t}var Ke=[],Et=new WeakMap;function bt(t,e){let n=Et.get(t);n?n.push(e):Et.set(t,[e]),Ke[Ke.length-1].push(t)}function V(t){let e=[];Ke.push(e);let n;try{n=t()}catch(r){Ke.pop();try{rr(e)}catch{}throw r}return Ke.pop(),rr(e),n}function rr(t){let e,n=!1;for(let r of t){let o=Et.get(r);if(o){for(;o.length>0;){let s=o.shift();try{s()}catch(i){n||(e=i,n=!0)}}Et.delete(r)}}if(n)throw e}var Nt=[],Ze=[],yn=!1;function xe(t){for(let e of t)Nt.push(e),e[1]&&Ze.push(e[1]);if(!yn){yn=!0;try{let e,n=!1;for(let r=0;r<Nt.length;r++){let[o,s]=Nt[r];s&&Ze.splice(Ze.indexOf(s),1);try{o()}catch(i){n||(e=i,n=!0)}}if(n)throw e}finally{Nt.length=0,Ze.length=0,yn=!1}}}function Qe(t){let e=t;for(;e;){if(Ze.includes(e))return!0;e=e[Y]??e[pe]}return!1}var Je=Symbol("listenerRegistrations"),ge=class{[Te]=void 0;[Je]=void 0;[I]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r=="object"&&r.capture===!0,s=typeof r=="object"&&r.once===!0,i=typeof r=="object"?r.signal:void 0;if(i?.aborted)return;let a=En(o),c=this[Je];c||(c=new Map,this[Je]=c);let u=c.get(e);u||(u={},c.set(e,u));let f=u[a];if(f||(f=new Map,u[a]=f),f.has(n))return;let h=this,g={type:e,listener:n,capture:o,once:s,normalizedListener:n,signal:i};(s||i)&&(g.normalizedListener=function(...M){if(g.signal?.aborted){Tt(h,g);return}return g.once&&Tt(h,g),typeof g.listener=="object"?g.listener.handleEvent(...M):g.listener.call(this,...M)});let y=this[Te];y||(y=new Map,this[Te]=y);let v=y.get(e);v||(v={},y.set(e,v));let b=v[a];if(b||(b=new Set,v[a]=b),f.set(n,g),b.add(g),i){let N=()=>{Tt(h,g)};g.abortListener=N,i.addEventListener("abort",N,{once:!0})}this[I]?.defaultView[Oe].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return uo.call(this,e,n,r)}dispatchEvent(e){if(e[Me])throw C("Failed to execute \'dispatchEvent\' on \'EventTarget\': The event is already being dispatched.","InvalidStateError");e[Me]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[Pe]=n;for(let s=n.length;s--;)if(gn(e,n[s],yt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let s=0;s<o.length;s++)if(gn(e,o[s],hn),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[Me]=!1,e.cancelBubble=!1,e[Ce]=!1,e.eventPhase=gt,e.currentTarget=null,e[Pe]=[]}}};function uo(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=En(!!r),s=this[Je]?.get(t)?.[o]?.get(e);s&&Tt(this,s)}function En(t){return t?"capture":"bubble"}function Tt(t,e){let n=En(e.capture),r=t[Je],o=r?.get(e.type);if(!o)return;let s=o[n];if(!s||s.get(e.listener)!==e)return;s.delete(e.listener),s.size===0&&delete o[n],!o.bubble&&!o.capture&&r?.delete(e.type),e.signal&&e.abortListener&&e.signal.removeEventListener("abort",e.abortListener);let i=t[Te],a=i?.get(e.type);if(!a)return;let c=a[n];c?.delete(e)&&(c.size===0&&delete a[n],!a.bubble&&!a.capture&&i?.delete(e.type),t[I]?.defaultView[Oe].removeEventListener?.(t,e.type,e.listener,e.capture))}var Q=class extends Array{item(e){return this[e]??null}};var tt=0,or=1,Tn=2,On=3,nt=4,sr=0,ir=1,xt=2,St=3,ar=4,Nn=5,lr=6,cr=7,Ot=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function fo(t,e){let n=1,r=null;for(let o=e;o<t.length;o++){let s=t[o];if(r){s==="\\\\"?o++:s===r&&(r=null);continue}if(s===\'"\'||s==="\'")r=s;else if(s==="(")n++;else if(s===")"&&--n===0)return[t.slice(e,o),o+1]}return[t.slice(e),t.length]}function W(t){throw C(`Invalid or unsupported selector: "${t}"`,"SyntaxError")}function vt(t,e){let n=typeof e=="string"?rt(e):[{combinator:nt,matchers:e}],r=null,o=t[R];return o&&n[0].matchers.length&&wn(o,n,s=>(r=s,!1)),r}function Rt(t,e){let n=typeof e=="string"?rt(e):[{combinator:nt,matchers:e}],r=new Q,o=t[R];return o&&n[0].matchers.length&&wn(o,n,s=>{r.push(s)}),r}function rt(t,e=!1,n=!1){let r={combinator:nt,matchers:[]},o=[r],s=/[\\t\\n\\f\\r ]*?([>\\t\\n\\f\\r +~]?)[\\t\\n\\f\\r ]*?(?:(?:\\[[\\t\\n\\f\\r ]*([^\\]=\\t\\n\\f\\r ]+)[\\t\\n\\f\\r ]*(?:=[\\t\\n\\f\\r ]*(?:([\'"])(.*?)\\3|([^\\]\\t\\n\\f\\r ]+)))?[\\t\\n\\f\\r ]*(?:\\]|$))|([#.]?)([^\\t\\n\\f\\r #.[>:+~()]+)|:(\\w+)(\\()?)/gi,i=t.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g,"");i===""&&W(t);let a=0,c;for(;c=s.exec(i);){c.index!==a&&W(t),c[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&W(t),c[1]===">"?r.combinator=or:c[1]==="+"?r.combinator=On:c[1]==="~"?r.combinator=Tn:r.combinator=tt,r={combinator:nt,matchers:[]},o.push(r));let u=c[8]?G(c[8]):c[2]||c[7];c[7]!=null&&!c[6]&&r.matchers.length>0&&W(t);let h,g=c[4]??c[5]??c[7];if(c[2]){Ot.test(u)||W(t);let y=c[5],v=y?.[0];if(c[3]==null&&(v===\'"\'||v==="\'")){let b=c[0].lastIndexOf(y);g=i.slice(c.index+b+1),s.lastIndex=i.length}else y!=null&&!Ot.test(y)&&W(t);h=ar}else c[6]?(Ot.test(u)||W(t),h=c[6]==="#"?xt:St):c[8]?h=c[9]==null?Nn:lr:c[7]==="*"?h=sr:c[7]&&Ot.test(c[7])?h=ir:W(t);c[9]?([g,s.lastIndex]=fo(i,s.lastIndex),u!=="has"&&u!=="not"&&W(t),u==="has"&&e&&W(t),rt(g,e||u==="has",u==="has")):h===Nn&&W(t),r.matchers.push({type:h,name:u,value:g}),a=s.lastIndex}return(a!==i.length||r.matchers.length===0)&&W(t),o}function mo(t,e){let n=rt(e);return n[0]?.matchers.length?et(t,n):!1}function po(t,e){let n=rt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=tt,s={type:cr,name:":scope"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(s)):n.unshift({combinator:tt,matchers:[s]}),n.some(({matchers:c})=>c.length===0))return!1;let i=o===On||o===Tn?t[p]:t[R];if(!i)return!1;let a=!1;return wn(i,n,()=>(a=!0,!1),t),a}function wn(t,e,n,r){let o=[],s=t;for(;s;){if(j(s)){if(et(s,e,r)&&n(s)===!1)return!1;let i=s[R];if(i){let a=s[p];a&&o.push(a),s=i;continue}}s=s[p]??o.pop()??null}return!0}function et(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===nt){if(!wt(t,o,n))return!1;let a=e.slice(0,-1);return a.length===0||et(t,a,n)}let s=r===or||r===tt?Y:D,i=t[s];if(!i)return!1;if(r===tt||r===Tn){for(;i;){if(j(i)&&wt(i,o,n)){let a=e.slice(0,-1);if(a.length===0||et(i,a,n))return!0}i=i[s]}return!1}else{if(r===On&&!j(i)){for(;i&&!j(i);)i=i[s];if(!i)return!1}if(!j(i)||!wt(i,o,n))return!1;let a=e.slice(0,-1);return a.length===0||et(i,a,n)}}function bn(t,e){return t.getAttributeNS(null,t.namespaceURI===A?G(e):e)}function wt(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let i of e)if(wt(t,i,n)===!1)return!1;return!0}let{type:r,name:o,value:s}=e;switch(r){case sr:return o==="*";case ir:return t.namespaceURI===A?t.localName===G(o):t.localName===o;case xt:return bn(t,"id")===o;case St:let i=bn(t,"class");return i?pt(i).includes(o):!1;case ar:let a=bn(t,o);return s==null?a!=null:a===s;case cr:return t===n;case Nn:W(`:${o}`);case lr:switch(o){case"has":return po(t,s||"");case"not":return!mo(t,s||"");default:W(`:${o}(${s})`)}}return!1}function ho(t){return t.nodeType===De}function ot(t){return K in t}function Sn(t){return t.nodeType===ke}function go(t){return t.nodeType===Le}function j(t){return t.nodeType===X}function xn(t){return t.nodeType===he}function mr(t){return"appendChild"in t}function At(t){let e=[],n=[t],r=new Set(n),o=new Set,s;for(;n.length>0;){let i=n.pop();if(r.delete(i),o.has(i))continue;let a=[];for(let c of it(i)){if(o.has(c)||(o.add(c),e.push(c),a.push(c),!j(c)))continue;let u=c[re];if(u)for(let h of u)o.has(h)||(o.add(h),e.push(h));let f=c[ie];f&&!o.has(f)&&!r.has(f)&&(r.add(f),n.push(f))}s??=a}return{nodes:e,treeNodes:s}}function st(t,e){for(let n of t)n[I]=e}function ur(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[I]=e,r}function dr(t,e){if(Sn(t))return e.createTextNode(t.data);if(go(t))return e.createComment(t.data);if(ho(t))return ur(t,e);if(j(t)){let n=e[Ie](t[x],t.namespaceURI,t[fe],t.localName);if(t[re])for(let r=0;r<t[re].length;r++){let o=t[re].item(r);n.attributes.setNamedItem(ur(o,e))}return n}else{if(xn(t))return e.createDocumentFragment();{let n=new t.constructor;return n[I]=e,n}}}function _t(t,e,n=t.ownerDocument){if(t.nodeType===we)throw C("Cannot clone a document node","NotSupportedError");let r=dr(t,n);if(!e||!j(t)&&!xn(t))return r;let o=new Set([t]),s=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;s.length>0;){let i=s[s.length-1],a,c;if(i.cloningContent)if(i.contentSource&&i.contentDestination)a=i.contentSource.childNodes[i.childIndex++],c=i.contentDestination;else{s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}else if(a=i.source.childNodes[i.childIndex++],c=i.destination,!a){if(i.cloningContent=!0,i.childIndex=0,j(i.source)&&i.source.namespaceURI===A&&i.source.localName==="template"){let f=i.source[ie];f&&(o.has(f)&&fr(),o.add(f),i.contentSource=f,i.contentDestination=i.destination.content)}continue}if(!a){s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}o.has(a)&&fr(),o.add(a);let u=dr(a,n);j(a)||xn(a)?s.push({source:a,destination:u,appendTo:c,childIndex:0,cloningContent:!1}):c.appendChild(u)}return r}function fr(){throw new Error("Cannot clone a cyclic or repeated node graph")}function Pt(t,e){let n=String(e);return n===""?null:vt(t,[{type:xt,name:n}])}function Ct(t,e){let n=[...new Set(pt(String(e)))];return Rt(t,n.map(r=>({type:St,name:r})))}function Mt(t,e){let n=String(e),r=G(n),o=[];for(let s of It(t))j(s)&&(n==="*"||(s.namespaceURI===A?s[x]===r:s[x]===n))&&o.push(s);return o}function It(t){let e=[],n=[],r=t[R];for(;r;){e.push(r);let o=r[R],s=r[p];o?(s&&n.push(s),r=o):r=s??n.pop()??null}return e}function it(t){let e=It(t);return e.unshift(t),e}var J=class extends ge{nodeType=$n;[x]="";[Y]=null;[pe]=null;[R]=null;[D]=null;[p]=null;[U]=!1;get[k](){return this[I].defaultView[Oe]}get localName(){return this[x]}get nodeName(){return this[x]}get ownerDocument(){return this[I]}get isConnected(){return this[U]}isDefaultNamespace(e){let n=ae(e);return yo(this)===n}get parentNode(){return this[Y]}set parentNode(e){}get parentElement(){let e=this[Y];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[D]}set previousSibling(e){}get nextSibling(){return this[p]}set nextSibling(e){}get previousElementSibling(){let e=this[D];for(;e&&e.nodeType!==1;)e=e[D];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[p];for(;e&&e.nodeType!==1;)e=e[p];return e}set nextElementSibling(e){}get firstChild(){return this[R]}set firstChild(e){}get lastChild(){let e=this[R];for(;e;){let n=e[p];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return ot(this)?this.data:null}set nodeValue(e){ot(this)&&(this.data=e)}get textContent(){if(ot(this))return this.data;let e="";for(let n of It(this))Sn(n)&&(e+=n.data);return e}set textContent(e){if(ot(this))this.data=e;else if(mr(this)){let n=e==null?"":String(e);n===""?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return _t(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function yo(t){let e=t;for(;e;)switch(e.nodeType){case X:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS($e,"xmlns");if(r!=null&&r.prefix==null)return ae(r.value);e=n.parentElement;break}case we:e=e.documentElement;break;case Kn:case he:return null;case De:e=e.ownerElement;break;default:e=e.parentElement}return null}var ee=Symbol("insertNode"),An=Symbol("preflightInsertions"),Dt=Symbol("replaceNode"),ye=class extends J{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=Se(e),r=this.parentNode;if(r)return vn(o=>{le(r,n);let s=this[p];for(;s&&n.includes(s);)s=s[p];let i=Rn(r,n,o);this.parentNode===r?r[Dt](i,this,o):r[ee](i,s,o)})}before(...e){let n=Se(e),r=this.parentNode;if(r)return vn(o=>{le(r,n);let s=this[D];for(;s&&n.includes(s);)s=s[D];let i=Rn(r,n,o);r[ee](i,s?s[p]:r.firstChild,o)})}after(...e){let n=Se(e),r=this.parentNode;if(r)return vn(o=>{le(r,n);let s=this[p];for(;s&&n.includes(s);)s=s[p];let i=Rn(r,n,o);r[ee](i,s,o)})}};function vn(t){return V(()=>{let e=[];try{t(e)}catch(n){try{xe(e)}catch{}throw n}xe(e)})}function Se(t){return t.map(e=>e instanceof J?e:String(e))}function at(t,e){return e instanceof J?e:t.ownerDocument.createTextNode(String(e))}function le(t,e){for(let n of e){if(!(n instanceof J))continue;let r=t;for(;r;){if(r===n)throw C("Cannot insert a node into itself or one of its descendants","HierarchyRequestError");r=r[Y]??r[pe]}}}function Rn(t,e,n){let r=[];for(let s of e)r.push(at(t,s));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[An](r);for(let s of r)o[ee](s,null,n);return o}var kt,_n=0,pr=0,hr=0,gr=0,Ge=!1,Cn=!1,lt=!1,Lt=class{#t;#n=[];#e=new Set;#r=!1;constructor(e){if(typeof e!="function")throw new TypeError("MutationObserver callback must be a function");this.#t=e}observe(e,n={}){let r=Eo(n),o=kt??=new WeakMap,s=o.get(e);s==null&&(s=new Map,o.set(e,s));let i=s.get(this);i==null?_n++:Pn(i,-1),s.set(this,r),Pn(r,1),this.#e.add(e)}disconnect(){let e=kt;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),_n--,Pn(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,_n===0&&(kt=void 0)}}takeRecords(){return this.#n.splice(0)}enqueue(e){this.#n.push(e),!this.#r&&(this.#r=!0,queueMicrotask(()=>{this.#r=!1;let n=this.takeRecords();n.length>0&&this.#t.call(this,n,this)}))}};function te(t){let e=kt;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[s,i]of o){if(r!==t.target&&!i.subtree)continue;let a=!1;if(t.type==="attributes"){if(!i.attributes||i.attributeFilter&&!i.attributeFilter.has(t.attributeName??""))continue;a=i.attributeOldValue}else if(t.type==="characterData"){if(!i.characterData)continue;a=i.characterDataOldValue}else if(!i.childList)continue;n.set(s,n.get(s)===!0||a)}r=r.parentNode}for(let[o,s]of n)o.enqueue({addedNodes:t.addedNodes??new Q,attributeName:t.attributeName??null,attributeNamespace:t.attributeNamespace??null,nextSibling:t.nextSibling??null,oldValue:s?t.oldValue??null:null,previousSibling:t.previousSibling??null,removedNodes:t.removedNodes??new Q,target:t.target,type:t.type})}function Gt(...t){let e=new Q;return e.push(...t),e}function Eo(t){if(t.attributes===!1&&(t.attributeOldValue||t.attributeFilter!=null))throw new TypeError("attributeOldValue and attributeFilter require attributes to be enabled");if(t.characterData===!1&&t.characterDataOldValue)throw new TypeError("characterDataOldValue requires characterData to be enabled");let e=t.attributes??(t.attributeOldValue===!0||t.attributeFilter!=null),n=t.characterData??t.characterDataOldValue===!0,r=t.childList===!0;if(!e&&!n&&!r)throw new TypeError("MutationObserver options must enable childList, attributes, or characterData");return{attributes:e,attributeFilter:t.attributeFilter==null?void 0:new Set(t.attributeFilter.map(String)),attributeOldValue:t.attributeOldValue===!0,characterData:n,characterDataOldValue:t.characterDataOldValue===!0,childList:r,subtree:t.subtree===!0}}function Pn(t,e){t.attributes&&(pr+=e),t.characterData&&(hr+=e),t.childList&&(gr+=e),Ge=pr>0,Cn=hr>0,lt=gr>0}var oe=class extends ye{childNodes=new Q;children=new Q;appendChild(e){return V(()=>this[ee](e,null))}insertBefore(e,n){return V(()=>this[ee](e,n||null))}append(...e){return V(()=>{let n=Se(e.filter(r=>r!=null));n.length>1&&le(this,n);for(let r of n)this[ee](at(this,r),null)})}prepend(...e){return V(()=>{let n=Se(e.filter(o=>o!=null));n.length>1&&le(this,n);let r=this.firstChild;for(let o of n)this[ee](at(this,o),r)})}replaceChildren(...e){return V(()=>{let n=Se(e.filter(o=>o!=null));le(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[ee](at(this,o),null)})}removeChild(e){return V(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw C("The node is not a child of this node","NotFoundError");let n=this[U]?it(e):void 0,r=e[D],o=e[p],s=Ht(this,e);if(n)for(let i of n)i[U]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,"disconnectedCallback"),xe(this.collectRemovalHookEffects(e,s))}replaceChild(e,n){return V(()=>this[Dt](e,n))}[Dt](e,n,r){if(le(this,[e]),n.parentNode!==this)throw C("The reference node is not a child of this parent","NotFoundError");let o=n[D],s=n[p],i=this.prepareInsertion(e),a=this[U]?it(n):void 0,c=new Set(i.map(({node:g})=>g)),u=s;for(;u&&c.has(u);)u=u[p];let f=Ht(this,n);if(a){for(let y of a)y[U]=!1;let g=new Set(a);for(let y of i)g.has(y.node)&&(y.shouldDisconnect=!1)}this.commitInsertion(i,u);let h=this[U];return this.queueRemovalMutationRecord(this,n,o,s),this.queueInsertionMutationRecords(i),a&&this.enqueueTreeReactions(a,"disconnectedCallback"),this.enqueueInsertionReactions(i,h),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,f),...this.collectInsertionHookEffects(i)],r),n}querySelectorAll(e){return Rt(this,e)}querySelector(e){return vt(this,e)}[ee](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[An](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(le(this,[e]),n&&n.parentNode!==this)throw C("The reference node is not a child of this parent","NotFoundError")}insertIntoValidated(e,n,r){e===n&&(n=e[p]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let s=this[U];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,s),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):xe(e)}prepareInsertion(e){let n=[];if(e.nodeType===he){let i=e[R];for(;i;)n.push(i),i=i[p]}else n.push(e);let r=this[U],o=this[I],s=[];for(let i of n){let a=i[U],c=a||r,u,f;if(i[I]===o)c&&(u=it(i));else{let h=At(i);f=h.nodes,c&&(u=h.treeNodes)}s.push({node:i,nodes:u,adoption:f,shouldDisconnect:a})}return s}commitInsertion(e,n){for(let s of e){let i=s.node[Y];if(i){let a=s.node[D],c=s.node[p];s.source={parent:i,index:Ht(i,s.node),previousSibling:a,nextSibling:c}}}for(let s of e){let i=this.attachChild(s.node,n);s.insertIndex=i.index,s.previousSibling=i.previousSibling,s.nextSibling=i.nextSibling}let r=this[I];for(let{adoption:s}of e)s&&st(s,r);let o=this[U];for(let{nodes:s}of e)if(s)for(let i of s)i[U]=o}attachChild(e,n){if(n){let s=n[D];e[p]=n,e[D]=s,s?s[p]=e:this[R]=e,n[D]=e}else{e[p]=null;let s=this[R];if(s){let i;for(;i=s[p];)s=i;s[p]=e,e[D]=s}else this[R]=e,e[D]=null}let r=j(e);e[Y]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let s=n;for(;s&&!j(s);)s=s[p];s?this.children.splice(this.children.indexOf(s),0,e):this.children.push(e)}}else o=this.childNodes.length,this.childNodes.push(e),r&&this.children.push(e);return{index:o,previousSibling:e[D],nextSibling:e[p]}}queueRemovalMutationRecord(e,n,r,o){lt&&te({type:"childList",target:e,removedNodes:Gt(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(lt)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),te({type:"childList",target:this,addedNodes:Gt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==X||Qe(this)?[]:[[()=>this[k].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:s}=r;s?.parent.nodeType===X&&!Qe(s.parent)&&n.push([()=>s.parent[k].removeChild?.(s.parent,o,s.index)]),this.nodeType===X&&!Qe(this)&&n.push([()=>this[k].insertChild?.(this,o,r.insertIndex),o])}return n}enqueueInsertionReactions(e,n){for(let r of e){let{nodes:o}=r;o&&(r.shouldDisconnect&&this.enqueueTreeReactions(o,"disconnectedCallback"),n&&this.enqueueTreeReactions(o,"connectedCallback"))}}enqueueTreeReactions(e,n){Er(e,n)}};function yr(t,e,n,r){if(e.parentNode!==t)throw Error("not a child of this node");let o=t[U]?n.treeNodes:void 0,s=e[D],i=e[p],a=Ht(t,e);if(o)for(let u of o)u[U]=!1;st(n.nodes,r),lt&&te({type:"childList",target:t,removedNodes:Gt(e),previousSibling:s,nextSibling:i}),o&&Er(o,"disconnectedCallback");let c=[];t.nodeType===X&&!Qe(t)&&c.push([()=>t[k].removeChild?.(t,e,a)]),xe(c)}function Ht(t,e){let n=e[D],r=e[p];n?n[p]=r:t[R]=r,r&&(r[D]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),j(e)&&t.children.splice(t.children.indexOf(e),1),e[Y]=null,e[p]=null,e[D]=null,o}function Er(t,e){for(let n of t){let r=n[e];typeof r=="function"&&bt(n,()=>r.call(n))}}function ct(t,e,n,r,o){let{observedAttributes:s}=t.constructor,{attributeChangedCallback:i}=t;i==null||s==null||!s.includes(e)||bt(t,()=>i.call(t,e,n,r,o))}var Ut=class{[R]=null;constructor(e){this[z]=e}getNamedItem(e){let n=String(e),r=this[z][S]===A?G(n):n,o=this[R];for(;o;){if(o.name===r)return o;o=o[p]}return null}getNamedItemNS(e,n){let r=ae(e),o=String(n),s=this[R];for(;s;){if(s.localName===o&&s[S]===r)return s;s=s[p]}return null}item(e){let n=this[R],r=0;for(;n;){if(r++===e)return n;n=n[p]}return null}get length(){let e=0,n=this[R];for(;n;)e++,n=n[p];return e}removeNamedItem(e){let n=String(e),r=this[z][S]===A?G(n):n;return V(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ae(e),o=String(n);return V(()=>this.removeNamedItemImmediately(s=>s.localName===o&&s[S]===r))}removeNamedItemImmediately(e){let n=this[z],r=this[R],o=null;for(;r!=null;){if(e(r)){o&&(o[p]=r[p]),this[R]===r&&(this[R]=r[p]);let s=r.value;return r[p]=null,r[z]=null,Ge&&te({type:"attributes",target:n,attributeName:r.name,attributeNamespace:r[S],oldValue:s}),n[k].removeAttribute?.(n,r.name,r[S]),ct(n,r.localName,s,null,r[S]),r}o=r,r=r[p]}return null}setNamedItem(e){return V(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[z],r=e[z];if(r!=null&&r!==n)throw C("The attribute is already in use by another element.","InUseAttributeError");let o=null,s=this[R],i=null;for(;s;){if(s.localName===e.localName&&s[S]===e[S]){if(s===e)return s;i?i[p]=e:this[R]=e,e[p]=s[p],s[p]=null,o=s;break}i=s,s=s[p]}o==null&&(i?i[p]=e:this[R]=e),e[z]=n,e[I]=n[I],o&&(o[z]=null);let a=o==null||o.value!==e.value,c=o!=null&&o.name!==e.name;return a&&Ge&&te({type:"attributes",target:n,attributeName:e.name,attributeNamespace:e[S],oldValue:o?.value??null}),c&&n[k].removeAttribute?.(n,o.name,o[S]),(a||c)&&n[k].setAttribute?.(n,e.name,e.value,e[S]),a&&ct(n,e.localName,o?.value??null,e.value,e[S]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[R];for(;e;)yield e,e=e[p]}};var ve=class extends J{nodeType=De;[S]=null;[p]=null;[z]=null;constructor(e,n,r){super(),this[x]=e,this[me]=n,r&&(this[S]=r)}get nodeName(){return this[x]}set nodeName(e){}get name(){return this[x]}set name(e){}get localName(){if(this[S]==null)return this[x];let e=this[x].indexOf(":");return e<0?this[x]:this[x].slice(e+1)}get prefix(){if(this[S]==null)return null;let e=this[x].indexOf(":");return e<0?null:this[x].slice(0,e)}get value(){return this[me]}set value(e){let n=String(e),r=this[z];if(!r){this[me]=n;return}V(()=>{let o=this[me];this[me]=n,Ge&&o!==n&&te({type:"attributes",target:r,attributeName:this[x],attributeNamespace:this[S],oldValue:o}),this[k].setAttribute?.(r,this[x],n,this[S]),ct(r,this.localName,o,n,this[S])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[z]}get namespaceURI(){return this[S]}get specified(){return!0}};var bo={amp:"&",AMP:"&",apos:"\'",gt:">",GT:">",lt:"<",LT:"<",quot:\'"\',QUOT:\'"\'},No=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),To=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>\'"=/\\s]+(?:=([\'"])[^]*?\\3|=[^>\'"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,Tr=/\\s([^<>\'"=/\\n\\s]+)(?:=(["\'])([\\s\\S]*?)\\2|=([^>\'"\\n\\s]*)|)/g,Oo="|b|big|blockquote|body|br|center|code|dd|div|dl|dt|em|embed|h1|h2|h3|h4|h5|h6|head|hr|i|img|li|listing|menu|meta|nobr|ol|p|pre|ruby|s|small|span|strong|strike|sub|sup|table|tt|u|ul|var|",wo=/^(?:color|face|size)$/i;function br(t){return t.replace(/&(?:(amp|AMP|apos|gt|GT|lt|LT|quot|QUOT)|#(\\d+)|#[xX]([\\da-fA-F]+));/g,(e,n,r,o)=>{if(n)return bo[n];let s=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(s)}catch{return e}})}function Or(t){return t.namespaceURI===A&&No.has(t.localName)}function Nr(t){let e=t.localName;return t[S]===Z&&(e==="foreignObject"||e==="desc"||e==="title")}function xo(t,e){if(Oo.includes(`|${t}|`))return!0;if(t!=="font")return!1;for(let n of e.matchAll(Tr))if(wo.test(n[1]))return!0;return!1}function Bt(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],s=r;for(let i of t.matchAll(To)){let a=i[1];if(a){let c=i[2],u=G(a),f=o[o.length-1]?.element??e,h=f[S]===Z?Z:A;if(u==="svg")h=Z;else if(h===Z){if(Nr(f))h=A;else if(xo(u,c)){for(;o.length>0;){let v=o[o.length-1];if(v.element[S]!==Z||Nr(v.element))break;o.pop(),s=v.target}h=A}}let g=h===A?u:a,y=n[Ie](g,h,null,g);for(let v of c.matchAll(Tr))y.setAttribute(v[1],br(v[3]||v[4]||""));if(s.append(y),Or(y)||h!==A&&i[4])continue;o.push({element:y,target:s}),s=h===A&&u==="template"?y.content:y}else if(i[5]){let c=G(i[5]);for(let u=o.length-1;u>=0;u--){let f=o[u],h=G(f.element[x]);if(h===c){s=f.target,o.length=u;break}if(f.element[S]===A&&h==="template")break}}else i[6]?s.append(n.createComment(i[6])):s.append(br(i[7]))}return r}function Vt(t){return xr([{type:"content",child:t[R]}])}function wr(t){return xr([{type:"opening",node:t}])}function xr(t){let e=[],n;for(;n=t.pop();)switch(n.type){case"opening":{let r=n.node;switch(r.nodeType){case X:{let o=r;e.push(`<${o[x]}`);let s=o[re]?.[R];for(;s;){e.push(` ${s[x]}`);let a=s[me];a!==""&&(a=String(a).replace(/&/g,"&").replace(/"/g,"""),e.push(`="${a}"`)),s=s[p]}if(e.push(">"),Or(o))break;let i=o.namespaceURI===A&&o.localName==="template"?o[ie]:o;t.push({type:"closing",name:o[x]}),t.push({type:"content",child:i?.[R]??null});break}case ke:{let o=r;e.push(o[K].replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"));break}case Le:{let o=r;e.push(`<!--${o[K]}-->`);break}}break}case"content":{let r=n.child;r&&(t.push({type:"content",child:r[p]}),t.push({type:"opening",node:r}));break}case"closing":e.push(`</${n.name}>`);break}return e.join("")}var H=class extends oe{nodeType=X;[S]=A;[fe]=null;get namespaceURI(){return this[S]}get prefix(){return this[fe]}get localName(){let e=this[fe];return e==null?this[x]:this[x].slice(e.length+1)}get nodeName(){return this[S]===A?Qn(this[x]):this[x]}get tagName(){return this.nodeName}get id(){return this.getAttributeNS(null,"id")??""}set id(e){this.setAttribute("id",String(e))}get slot(){return this.getAttributeNS(null,"slot")??""}set slot(e){let n=String(e);this.getAttributeNS(null,"slot")!==n&&this.attributes.setNamedItem(new ve("slot",n))}get attributes(){let e=this[re];return e||(e=new Ut(this),this[re]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Mt(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return Ct(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);mn(r);let s=this[S]===A?G(r):r,i=this.attributes.getNamedItemNS(null,s);i?i.value=o:this.attributes.setNamedItem(new ve(s,o))}setAttributeNS(e,n,r){let o=ae(e),s=String(n),i=String(r),a=ht(o,s,"attribute"),c=this.attributes.getNamedItemNS(a.namespace,a.localName);c?c.value=i:this.attributes.setNamedItemNS(new ve(a.qualifiedName,i,a.namespace))}toggleAttribute(e,n){let r=String(e);mn(r);let o=this[S]===A?G(r):r,s=this.attributes.getNamedItemNS(null,o),i=n===void 0?void 0:!!n;return s==null?i===!1?!1:(this.attributes.setNamedItem(new ve(o,"")),!0):i===!0?!0:(this.attributes.removeNamedItemNS(null,o),!1)}getAttribute(e){let n=this.attributes.getNamedItem(e);return n&&n.value}getAttributeNS(e,n){let r=this.attributes.getNamedItemNS(e,n);return r&&r.value}hasAttribute(e){return this.attributes.getNamedItem(e)!=null}hasAttributeNS(e,n){return this.attributes.getNamedItemNS(e,n)!=null}removeAttribute(e){let n=String(e),r=this[S]===A?G(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return wr(this)}get innerHTML(){return Vt(this)}set innerHTML(e){if(e==null||e==="")this.replaceChildren();else{let n=Bt(String(e),this);this.replaceChildren(n)}}};var He=class t extends H{[S]=Z;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var Ee=class extends ye{[K]="";constructor(e){super(),this[K]=e==null?"":String(e)}setData(e){let n=Cn,r=n?this[K]:null,o="";e!=null&&(o=typeof e=="string"?e:String(e)),this[K]=o,n&&r!==o&&te({type:"characterData",target:this,oldValue:r}),this[k].setText?.(this,o)}get data(){return this[K]}set data(e){this.setData(e)}};var Ue=class extends Ee{nodeType=ke;[x]="#text"};var Be=class extends Ee{nodeType=Le;[x]="#comment"};var Ve=class extends oe{nodeType=he;[x]="#document-fragment";[I]=typeof window<"u"?window.document:null;getElementById(e){return Pt(this,e)}};var Fe=class extends H{get content(){let e=this[ie];return e||(e=this.ownerDocument.createDocumentFragment(),e[pe]=this,this[ie]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Bt(String(e),this))}get innerHTML(){let e=this[ie];return e?Vt(e):""}};var Ft=class extends H{};var jt=class extends H{};var qt=class extends H{};var ut=class extends oe{nodeType=we;[x]="#document";[U]=!0;constructor(e){super(),this.defaultView=e,this[I]=this,this.documentElement=Yt(new qt,this,"html"),this.body=Yt(new Ft,this,"body"),this.head=Yt(new jt,this,"head"),this.appendChild(this.documentElement),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body)}get textContent(){return null}set textContent(e){}getElementsByClassName(e){return Ct(this,e)}createElement(e){let n=String(e);return tr(n),Mn(this,G(n))}createElementNS(e,n){let r=ht(e,n,"element");return Mn(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ie](e,n,r,o){return Mn(this,e,n,r,o)}createTextNode(e){let n=zt(new Ue(e),this);return this[k].createText?.(n,n.data),n}createComment(e){return zt(new Be(e),this)}createDocumentFragment(){return zt(new Ve,this)}createEvent(){return new B("")}getElementById(e){return Pt(this,e)}getElementsByTagName(e){return Mt(this,e)}importNode(e,n){if(e.nodeType===we)throw C("Cannot import a document node","NotSupportedError");return _t(e,n,this)}adoptNode(e){if(e[I]===this)return e;let n=At(e);return V(()=>{let r=e.parentNode;return r?yr(r,e,n,this):st(n.nodes,this),e})}};function zt(t,e){return Object.defineProperty(t,I,{value:e,writable:!0,enumerable:!1}),t}function Mn(t,e,n=A,r=null,o=e){let s;if(n===Z)s=new He;else if(n===A&&o==="template")s=new Fe;else if(n===A){let i=t.defaultView.customElements.get(o);s=i?new i:new H}else s=new H;return Yt(s,t,e,n,r)}function Yt(t,e,n,r=A,o=null){return zt(t,e),Object.defineProperties(t,{[x]:{value:n},[S]:{value:r},[fe]:{value:o}}),e[k].createElement?.(t,r),t}var Wt=class extends B{constructor(e,n){super(e,n),this.detail=n?.detail??null}initCustomEvent(e,n,r,o){super.initEvent(e,n,r),this.detail=o??null}};var Xt=class extends B{constructor(e,n){super(e,n),this.message=n.message,this.filename=n.filename,this.lineno=n.lineno,this.colno=n.colno,this.error=n.error}};var $t=class extends B{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var Kt=class extends B{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Zt=class extends B{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var Qt=class extends B{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var Jt=class extends H{};var So=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,vo=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function Sr(t){return So.test(t)&&!vo.has(t)}function vr(t){return C(`Invalid custom element name: "${t}"`,"SyntaxError")}var en=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!Sr(e))throw vr(e);if(this.registry.has(e))throw C(`A custom element named "${e}" has already been defined`,"NotSupportedError");if(this.getName(n)!=null)throw C("This constructor has already been registered in this custom element registry","NotSupportedError");this.registry.set(e,n);let o=this.listenersByName.get(e);if(o!=null){this.listenersByName.delete(e);for(let s of o)s(n)}}get(e){return this.registry.get(e)}getName(e){for(let[n,r]of this.registry)if(r===e)return n;return null}whenDefined(e){if(!Sr(e))return Promise.reject(vr(e));let n=this.registry.get(e);if(n!=null)return Promise.resolve(n);let r=this.listenersByName.get(e);return r==null&&(r=[],this.listenersByName.set(e,r)),new Promise(o=>{r.push(o)})}upgrade(e){}initialize(e){}};var Ro=["onerror","onunhandledrejection"],Ar=Symbol.for("@remote-dom/polyfill/global-property");function _r(t){return Object.getOwnPropertyDescriptors(t)}function Pr(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(ge.prototype)))n!=="constructor"&&typeof r.value=="function"&&(r.value=In(r.value.bind(t)),e[n]=r);return e}function Cr(t){let e={};for(let n of Ro)e[n]={configurable:!0,enumerable:!0,get:In(()=>t[n]),set:In(r=>{t[n]=r})};return e}function Ao(t){return Object.assign(_r(t),Pr(t),Cr(t))}function In(t){return Object.defineProperty(t,Ar,{value:!0}),t}function Rr(t,e){for(let n of Reflect.ownKeys(e)){let r=_o(t,n);(r==null||Po(r))&&Object.defineProperty(t,n,e[n])}}function _o(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function Po(t){return[t.value,t.get,t.set].some(e=>typeof e=="function"&&e[Ar]===!0)}var Re=class extends ge{[k]={};[mt]=[];[Oe]=Mo(this);name="";window=this;parent=this;self=this;top=this;document=new ut(this);customElements=new en;location=globalThis.location;navigator=globalThis.navigator;Event=B;ErrorEvent=Xt;PromiseRejectionEvent=$t;ToggleEvent=Kt;FocusEvent=Zt;ClipboardEvent=Qt;EventTarget=ge;CustomEvent=Wt;Node=J;ParentNode=oe;ChildNode=ye;DocumentFragment=Ve;Document=ut;CharacterData=Ee;Comment=Be;Text=Ue;Element=H;HTMLElement=Jt;SVGElement=He;HTMLTemplateElement=Fe;MutationObserver=Lt;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)Co(this,o)}}}get onerror(){return this.#n}set onerror(e){this.#t&&this.removeEventListener("error",this.#t),e&&typeof e=="function"?(this.#n=e,this.#t=n=>{e(n.message??"Error",n.filename,n.lineno,n.colno,n.error)},this.addEventListener("error",this.#t)):(this.#t=null,this.#n=null)}get onunhandledrejection(){return this.#e}set onunhandledrejection(e){this.#e&&this.removeEventListener("unhandledrejection",this.#e),e&&typeof e=="function"?(this.#e=e,this.addEventListener("unhandledrejection",this.#e)):this.#e=null}static setGlobal(e){let n=globalThis.self,r=globalThis.window,o=_r(e),s=Object.assign(Pr(e),Cr(e));delete o.self,Object.defineProperties(globalThis,o),Rr(globalThis,s),typeof n>"u"||n===r&&n!==globalThis?Object.defineProperty(globalThis,"self",{value:e,configurable:!0,writable:!0,enumerable:!0}):n!==globalThis&&(Object.defineProperties(n,o),Rr(n,s))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,Ao(e))}};function Co(t,e){t[mt].push(e(t)??{})}function Mo(t){return{createElement:ce.bind(null,t,"createElement"),setAttribute:ce.bind(null,t,"setAttribute"),removeAttribute:ce.bind(null,t,"removeAttribute"),createText:ce.bind(null,t,"createText"),setText:ce.bind(null,t,"setText"),insertChild:ce.bind(null,t,"insertChild"),removeChild:ce.bind(null,t,"removeChild"),addEventListener:ce.bind(null,t,"addEventListener"),removeEventListener:ce.bind(null,t,"removeEventListener")}}function ce(t,e,...n){for(let s of t[mt])s[e]?.apply(s,n);let r=t[k];r[e]?.apply(r,n)}var tn=new Re;var Dn="~";var be=new WeakMap;function je(t){return be.get(t)}var Hn=new WeakMap,Do=0;function $(t){let e=Hn.get(t);return e==null&&(e=String(Do++),nn(t,e)),e}function nn(t,e){Hn.set(t,e)}var Ln=new WeakMap;function ko(t){return Ln.get(t)}var Gn=new WeakMap;function Lo(t){let e=Gn.get(t);if(e!=null)return e;if(!(!(t instanceof Element)||t.tagName.includes("-"))){e={};for(let{name:n,value:r}of t.attributes)e[n]=r;return e}}var Go=new WeakMap;function Ho(t){return Go.get(t)}function Un(t,e,n){let r=Ln.get(t);if(r==null&&(r={},Ln.set(t,r)),r[e]===n)return;r[e]=n;let o=be.get(t);o?.mutate([[3,$(t),e,n,1]])}function Ne(t,e,n){let r=Gn.get(t);if(r==null&&(r={},Gn.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=be.get(t);o?.mutate([[3,$(t),e,n,2]])}function qe(t,e){if(be.get(t)!==e&&(be.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)qe(t.childNodes[r],e)}function rn(t){if(be.get(t)!=null&&(be.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)rn(t.childNodes[n])}function ze(t){let{nodeType:e}=t;switch(e){case 1:return{id:$(t),type:e,element:t.localName,properties:kn(ko(t)),attributes:kn(Lo(t)),eventListeners:kn(Ho(t)),children:Array.from(t.childNodes).map(ze)};case 3:case 8:return{id:$(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function kn(t){return t?{...t}:void 0}function Bn(t,e,...n){let r=Hn.get(t),o=be.get(t);if(r==null||o==null)throw new Error(`Cannot call method ${e} on an unconnected node`);return o.call(r,e,...n)}var Ye=tn[k];Ye.insertChild=(t,e,n)=>{let r=je(t);r!=null&&(qe(e,r),r.mutate([[0,$(t),ze(e),n]]))};Ye.removeChild=(t,e,n)=>{let r=je(t);r!=null&&(rn(e),r.mutate([[1,$(t),n]]))};Ye.setText=(t,e)=>{let n=je(t);n?.mutate([[2,$(t),e]])};Ye.setAttribute=(t,e,n)=>{t.tagName.includes("-")||Ne(t,e,n)};Ye.removeAttribute=(t,e)=>{t.tagName.includes("-")||Ne(t,e)};Re.setGlobal(tn);function on(t){if(typeof t=="string")return{type:"navigate",to:t};let{place:e,record:n,where:r,section:o}=t??{},s={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e=="string"?{type:"navigate",place:e,...s}:typeof n=="string"?{type:"navigate",to:n,...s}:void 0}var Ir=["wheel","drag","pinch"];function Dr(t){let e=t;return typeof t=="object"&&t!==null&&e.graview==="host-hello"&&typeof e.nonce=="string"}function Lr(t,e={}){let n,r="",o,s=0,i=new Set,a=new Map,c=[],u=b=>{n?n.postMessage({...b,nonce:r}):c.push(b)},f=b=>{let N=b.data;if(!(!N||typeof N!="object")){if(N.type==="props"){o=N.props;for(let M of i)M(N.props)}else N.type==="answer"?(a.get(N.id)?.(N),a.delete(N.id)):N.type==="event"&&typeof N.listener=="number"?e.onEvent?.(N):N.type==="heartbeat"&&typeof N.beat=="number"&&u({type:"heartbeat",beat:N.beat});e.onMessage?.(N)}},h=()=>{},g=b=>{if(n||!t.fromHost(b)||!Dr(b.data)||b.data.protocol!==1)return;let N=b.ports[0];if(N){n=N,r=b.data.nonce,n.onmessage=f,n.start?.(),h();for(let M of c.splice(0))u(M)}};h=t.listen(g),t.ready({graview:"guest-ready",protocol:1});let y,v={get props(){return o},subscribe(b){return i.add(b),()=>i.delete(b)},act(b,N={}){let M=s+=1;return new Promise(L=>{a.set(M,L),u({type:"act",id:M,name:b,args:N})})},navigate(b){let N=on(b);N&&u(N)},size(b){u({type:"size",height:b})},autoSize(b){let N=b??globalThis.document?.documentElement,M=globalThis.ResizeObserver;if(!N||!M||typeof N.getBoundingClientRect!="function")return()=>{};y?.disconnect();let L=new M(()=>v.size(Math.ceil(N.getBoundingClientRect().height)));return L.observe(N),y=L,()=>L.disconnect()},close(){y?.disconnect(),h(),n?.close(),i.clear()}};return{guest:v,send:u}}var Hr=["globalThis","Infinity","NaN","undefined","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape","Object","Function","Array","Number","Boolean","String","Symbol","BigInt","Date","Promise","RegExp","Math","JSON","Reflect","Proxy","Intl","Error","AggregateError","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","SuppressedError","Map","Set","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Iterator","AsyncIterator","DisposableStack","AsyncDisposableStack","ArrayBuffer","SharedArrayBuffer","DataView","Atomics","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],Ur=["window","parent","top","document","customElements","Event","ErrorEvent","PromiseRejectionEvent","ToggleEvent","FocusEvent","ClipboardEvent","CustomEvent","EventTarget","Node","ParentNode","ChildNode","DocumentFragment","Document","CharacterData","Comment","Text","Element","HTMLElement","SVGElement","HTMLTemplateElement","MutationObserver"],Br=["self","postMessage","setTimeout","clearTimeout","setInterval","clearInterval","queueMicrotask","structuredClone","crypto","console","DOMException"],Vr=["TEMPORARY","PERSISTENT"],gl=Object.freeze([...Hr,...Ur,...Br,...Vr]),yl=Object.freeze(["constructor","__defineGetter__","__defineSetter__","hasOwnProperty","__lookupGetter__","__lookupSetter__","isPrototypeOf","propertyIsEnumerable","toString","valueOf","__proto__","toLocaleString"]),Gr=t=>typeof t=="symbol"?`[${t.description??"symbol"}]`:t;function Fr(t=globalThis,e=[],n={}){let r=[],o=[],s=new Set([...Hr,...Ur,...Br,...e,"constructor",Symbol.toStringTag]),i=(w,P)=>{let q=Reflect.getOwnPropertyDescriptor(w,P);return q===void 0||!("value"in q)||q.writable||q.configurable?!1:n.primitivesStay&&typeof P=="symbol"&&(typeof q.value!="object"||q.value===null)&&typeof q.value!="function"?!0:Vr.includes(P)&&typeof q.value=="number"},a=t,c=a.setTimeout,u=a.setInterval,f=a.crypto,h=(w,P)=>function(q,We,...ft){if(typeof q!="function")throw new TypeError(`${P} takes a function: a guest view cannot run code from text`);return w.call(t,q,We,...ft)},g=f?Object.freeze({getRandomValues:w=>f.getRandomValues(w)}):void 0,y=a.document?.defaultView;if(y&&y!==a)for(let w of Reflect.ownKeys(y))typeof w=="symbol"||s.has(w)||Reflect.deleteProperty(y,w)||o.push(`window.${w}`);let v=[];for(let w=t;w&&w!==Object.prototype;w=Object.getPrototypeOf(w))v.push(w);for(let w of v)for(let P of Reflect.ownKeys(w))s.has(P)||(Reflect.deleteProperty(w,P)?r.push(Gr(P)):i(w,P)||o.push(Gr(P)));let b=()=>function(){throw new EvalError("A guest view cannot make code from text.")},N=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let w of N){let P=b();Object.defineProperty(P,"prototype",{value:w,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(w,"constructor",{value:P,writable:!1,enumerable:!1,configurable:!1})||o.push("Function.prototype.constructor"),w===Function.prototype&&Reflect.defineProperty(t,"Function",{value:P,writable:!0,enumerable:!1,configurable:!0})}let M=(w,P)=>{Reflect.defineProperty(t,w,{value:P,writable:!0,enumerable:!0,configurable:!0})||o.push(w)};M("setTimeout",h(c,"setTimeout")),M("setInterval",h(u,"setInterval")),g&&M("crypto",g);for(let w of v.slice(1))Object.freeze(w);for(let w of Reflect.ownKeys(t)){let P=Reflect.getOwnPropertyDescriptor(t,w);Reflect.defineProperty(t,w,"value"in P?{...P,writable:!1,configurable:!1}:{...P,configurable:!1})}let L;try{L=Reflect.preventExtensions(t)}catch{L=!1}return{removed:r,stuck:o,sealed:L}}var dt=class extends HTMLElement{constructor(){super(),nn(this,Dn)}connect(e){if(je(this)===e||(qe(this,e),this.childNodes.length===0))return;let n=[];for(let r=0;r<this.childNodes.length;r++){let o=this.childNodes[r];n.push([0,Dn,ze(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Un(this,e,n)}callRemoteMethod(e,...n){return Bn(this,e,...n)}};var d={},Vn={empty:!0},Uo={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"},Fn={div:d,section:d,article:d,aside:d,header:d,footer:d,nav:d,hgroup:d,search:d,address:d,figure:d,figcaption:d,blockquote:d,p:d,pre:d,hr:Vn,br:Vn,wbr:Vn,h1:d,h2:d,h3:d,h4:d,h5:d,h6:d,span:d,strong:d,em:d,b:d,i:d,u:d,s:d,small:d,mark:d,abbr:d,cite:d,q:d,code:d,kbd:d,samp:d,var:d,sub:d,sup:d,dfn:d,bdi:d,bdo:d,ruby:d,rt:d,rp:d,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:{attributes:{href:"link"}},ul:d,menu:d,dl:d,dt:d,dd:d,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:d,caption:d,thead:d,tbody:d,tfoot:d,tr:d,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:d,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:d,output:d,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"}}},Bo=["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"],Vo={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(Bo.map(t=>[t,"css"]))},ue={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},sn={viewBox:"geometry",preserveAspectRatio:"geometry"},jr={oneOf:["userSpaceOnUse","objectBoundingBox"]},qr={oneOf:["R","G","B","A"]},ne={...ue,in:"text",result:"text"},zr={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},Yr={svg:{attributes:{...ue,...sn}},g:d,defs:d,symbol:{attributes:{...ue,...sn,refX:"geometry",refY:"geometry"}},use:{attributes:{...ue,href:"fragment"}},title:d,desc:d,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...ue,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",...zr}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...zr}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...ue,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...ue,...sn,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...sn,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}},a:d,filter:{attributes:{...ue,filterUnits:jr,primitiveUnits:jr}},feBlend:{attributes:{...ne,in2:"text",mode:"text"}},feColorMatrix:{attributes:{...ne,type:{oneOf:["matrix","saturate","hueRotate","luminanceToAlpha"]},values:"geometry"}},feComponentTransfer:{attributes:ne},...Object.fromEntries(["feFuncR","feFuncG","feFuncB","feFuncA"].map(t=>[t,{attributes:{type:{oneOf:["identity","table","discrete","linear","gamma"]},tableValues:"geometry",slope:"number",intercept:"number",amplitude:"number",exponent:"number",offset:"number"}}])),feComposite:{attributes:{...ne,in2:"text",operator:{oneOf:["over","in","out","atop","xor","lighter","arithmetic"]},k1:"number",k2:"number",k3:"number",k4:"number"}},feDisplacementMap:{attributes:{...ne,in2:"text",scale:"number",xChannelSelector:qr,yChannelSelector:qr}},feDropShadow:{attributes:{...ne,dx:"number",dy:"number",stdDeviation:"geometry"}},feFlood:{attributes:ne},feGaussianBlur:{attributes:{...ne,stdDeviation:"geometry",edgeMode:{oneOf:["duplicate","wrap","none"]}}},feMerge:{attributes:ne},feMergeNode:{attributes:{in:"text"}},feMorphology:{attributes:{...ne,operator:{oneOf:["erode","dilate"]},radius:"geometry"}},feOffset:{attributes:{...ne,dx:"number",dy:"number"}},feTurbulence:{attributes:{...ue,result:"text",type:{oneOf:["fractalNoise","turbulence"]},baseFrequency:"geometry",numOctaves:"number",seed:"number",stitchTiles:{oneOf:["stitch","noStitch"]}}}};var Wr={section:["aria-label","title"]};function Fo(t){return/^aria-[a-z]+$/.test(t)}function jo(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var qo=new Map(Object.keys(Yr).map(t=>[t.toLowerCase(),t]));function Xr(t){return qo.get(t.toLowerCase())}function $r(t,e,n){let r=n.toLowerCase(),o=t==="html"?[Fn[e]?.attributes,Uo]:[Yr[e]?.attributes,Vo],s=t==="svg"&&r==="xlink:href"?"href":r;for(let i of o)if(i){for(let[a,c]of Object.entries(i))if(a.toLowerCase()===s)return{name:a,kind:c}}if(Fo(r)||jo(r))return{name:r,kind:"text"}}var Kr="~",an=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),se=(t,e=0)=>{if(t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===void 0)return t;if(!(e>64||typeof t!="object"))return Array.isArray(t)?t.map(n=>se(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,se(r,e+1)]))};function Zr(){let t=new Map,e=new Map,n=new Map([[Kr,{children:[],listeners:new Map}]]),r=0,o=u=>{let f=e.get(u);return f===void 0&&(f=r+=1,e.set(u,f),t.set(f,{listener:u,count:0})),t.get(f).count+=1,f},s=u=>{let f=t.get(u);f&&(f.count-=1,!(f.count>0)&&(t.delete(u),e.delete(f.listener)))},i=u=>{let f=n.get(u);if(f){n.delete(u);for(let h of f.listeners.values())s(h);for(let h of f.children)i(h)}},a=(u,f,h=0)=>{if(!an(u)||h>64)return se(u);let g=typeof u.id=="string"?u.id:void 0,y=f&&g!==void 0&&g!==Kr;y&&i(g);let v={children:[],listeners:new Map};y&&n.set(g,v);let b={};for(let[N,M]of Object.entries(u))N==="children"&&Array.isArray(M)?b[N]=M.map(L=>{let w=a(L,y,h+1);return y&&an(L)&&typeof L.id=="string"&&v.children.push(L.id),w}):N==="eventListeners"&&an(M)?b[N]=Object.fromEntries(Object.entries(M).map(([L,w])=>{if(typeof w!="function"||!y)return[L,void 0];let P=o(w);return v.listeners.set(L,P),[L,{listener:P}]})):b[N]=se(M,h+1);return b},c=u=>{if(!Array.isArray(u))return se(u);let[f,h]=u,g=typeof h=="string"?n.get(h):void 0;if(f===0){let y=a(u[2],g!==void 0),v=an(u[2])?u[2].id:void 0;if(g&&typeof v=="string"&&n.has(v)){let b=Number(u[3]);g.children.splice(Number.isInteger(b)&&b>=0&&b<=g.children.length?b:g.children.length,0,v)}return[f,se(h),y,se(u[3])]}if(f===1){let y=Number(u[2]);return g&&Number.isInteger(y)&&y>=0&&y<g.children.length&&i(g.children.splice(y,1)[0]),se(u)}if(f===3&&u[4]===3){let y=String(u[2]),v=u[3],b=g&&typeof v=="function"?o(v):void 0,N=g?.listeners.get(y);return N!==void 0&&s(N),b===void 0?g?.listeners.delete(y):g.listeners.set(y,b),[f,se(h),y,b===void 0?void 0:{listener:b},3]}return se(u)};return{encode:u=>u.map(c),listener:u=>t.get(u)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var ln="graview-view-root",zo=["value","checked","key","pressed","files","refused","x","y","width","height","deltaX","deltaY","deltaMode","ctrlKey","metaKey","phase","pointerId","button","pressure","dx","dy","scale","rotation"],Yo=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/\'/g,"'"),Wo=t=>Object.freeze({html:t,toString:()=>t}),Qr=t=>typeof t=="object"&&t!==null&&typeof t.html=="string"&&Object.isFrozen(t),Jr=t=>t==null||t===!1?"":Array.isArray(t)?t.map(Jr).join(""):Qr(t)?t.html:Yo(String(t));function eo(t){customElements.get(ln)||customElements.define(ln,dt);let e=Event,n=Zr(),r=new Set,o=new Set,s,i=[],a=new Set;for(let l of["closest","matches","dataset"]){let m=()=>{throw new TypeError(`A view\'s element has no ${l}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute("data-\\u2026").`)};l in Element.prototype||Object.defineProperty(Element.prototype,l,l==="dataset"?{get:m}:{value:m})}let c=document.createElement(ln),u=l=>{let m=E=>{for(let O of Array.from(E.childNodes)){if(O.nodeType!==1)continue;if($(O)===l)return O;let T=m(O);if(T)return T}};return m(c)},f=l=>{let m=u(l.target);if(!m)return;let E=new e(l.event,{bubbles:!0}),O={};for(let T of zo)l[T]!==void 0&&(O[T]=l[T]);for(let T of Object.keys(O))Object.defineProperty(E,T,{value:O[T],enumerable:!0});m.dispatchEvent(E);for(let T of o){if(T.type!==l.event)continue;let _;try{_=new Set(Array.from(c.querySelectorAll(T.selector)))}catch{continue}for(let F=m;F&&F!==c;F=F.parentNode)if(_.has(F)){T.listener(Object.freeze({type:l.event,target:m,element:F,...O}));break}}},h=l=>{if(l.type==="dom-event"&&typeof l.target=="string")return f(l);if(l.type==="notice")return t.warn(l.text);if(l.type!=="props")return;s=l.props;let m=t.now();for(let T of r)try{T(l.props)}catch(_){t.threw(_)}let E=t.now()-m,O=l.push;typeof O=="number"&&t.microtask(()=>t.microtask(()=>t.send({type:"pushed",push:O,ms:E})))},g;c.connect({mutate(l){g||(g=[],t.microtask(()=>{let m=g??[];g=void 0,t.send({type:"render",records:n.encode(m)})})),g.push(...l)},call:()=>{}});let y=l=>l.nodeType===1?l.getAttribute("data-key")??l.getAttribute("id"):null,v=(l,m)=>l.nodeType===m.nodeType&&(l.nodeType!==1||l.localName===m.localName&&l.namespaceURI===m.namespaceURI&&y(l)===y(m));function b(l,m){let E=Array.from(m.childNodes),O=0;for(let T of E){let _=l.childNodes[O]??null;if(_&&v(_,T)){N(_,T),O+=1;continue}if(y(T)!==null){let de=Array.from(l.childNodes).slice(O+1).find(Xe=>v(Xe,T));if(de){l.insertBefore(de,_),N(de,T),O+=1;continue}}l.insertBefore(T,_),O+=1}for(;l.childNodes.length>O;)l.removeChild(l.lastChild)}function N(l,m){if(l.nodeType!==1){l.data!==m.data&&(l.data=m.data);return}let E=l,O=m,T=M(E);for(let _ of E.getAttributeNames())O.hasAttribute(_)||(E.removeAttribute(_),T&&Ne(E,_,void 0));for(let _ of O.getAttributeNames()){let F=O.getAttribute(_);E.getAttribute(_)!==F&&E.setAttribute(_,F),T&&Ne(E,_,F)}b(E,O)}let M=l=>l.localName.includes("-");function L(l){for(let m of Array.from(l.childNodes)){if(m.nodeType!==1)continue;let E=m;if(M(E))for(let O of E.getAttributeNames())Ne(E,O,E.getAttribute(O)??void 0);L(E)}}function w(l,m,E){for(let O of Array.from(l.childNodes)){if(O.nodeType!==1)continue;let T=O,_=T.localName,F=m||_.toLowerCase()==="svg",de=F?Xr(_):Object.prototype.hasOwnProperty.call(Fn,_.toLowerCase())?_.toLowerCase():void 0;if(!de){E.add(`<${_}>`);continue}for(let Xe of T.getAttributeNames())(!$r(F?"svg":"html",de,Xe)||!F&&Wr[de]?.includes(Xe.toLowerCase()))&&E.add(`${de} ${Xe}`);w(T,F,E)}}function P(l){let m=document.createElement("div"),E=Array.isArray(l)?l:[l];for(let T of E)if(T!=null)if(typeof T=="string"||Qr(T)){let _=document.createElement("div");_.innerHTML=typeof T=="string"?T:T.html,m.append(...Array.from(_.childNodes))}else m.append(T);let O=new Set;w(m,!1,O),i=[...O],i.length>0&&t.warn(`The host will not draw: ${i.join(", ")}`),L(m),b(c,m)}let q=[],We=new Set(Ir),ft="[]",cn=!1,Yn=()=>{cn||(cn=!0,t.microtask(()=>{cn=!1;let l=[...new Map([...o].filter(E=>We.has(E.type)).map(E=>[`${E.type} ${E.selector}`,{event:E.type,selector:E.selector}])).entries()].sort(([E],[O])=>E<O?-1:E>O?1:0).map(([,E])=>E),m=JSON.stringify(l);m!==ft&&(ft=m,t.send({type:"gestures",bound:l}))}))},Wn="[]",un=!1,Xn=()=>{un||(un=!0,t.microtask(()=>{un=!1;let l=[...new Set([...o].filter(E=>E.type==="click"&&typeof E.selector=="string").map(E=>E.selector))].sort().slice(0,200),m=JSON.stringify(l);m!==Wn&&(Wn=m,t.send({type:"clicks",selectors:l}))}))};return{view:Object.freeze({get props(){return s},onProps(l){return r.add(l),s&&l(s),()=>void r.delete(l)},render:P,style(l){typeof l!="string"||q.includes(l)||(q.push(l),t.send({type:"style",sheets:[...q]}))},on(l,m,E){let O={type:l,selector:m,listener:E};return o.add(O),typeof l=="string"&&!a.has(l)&&(a.add(l),t.send({type:"hears",events:[l]})),We.has(l)&&Yn(),l==="click"&&Xn(),()=>{o.delete(O),We.has(l)&&Yn(),l==="click"&&Xn()}},act:(l,m={})=>t.act(l,m),navigate(l){if(typeof l=="string")return t.navigate(l);let m=on(l);m&&t.send(m)},html(l,...m){return Wo(l.reduce((E,O,T)=>E+O+(T<m.length?Jr(m[T]):""),""))},get refused(){return i},get hardening(){return t.hardening()}}),hear:h,find:l=>{try{let m=c.querySelectorAll(l)[0];return m?$(m):void 0}catch{return}},listened:l=>{let m=new Set;for(let E of o)if(E.type===l)try{for(let O of Array.from(c.querySelectorAll(E.selector))){let T=$(O);T&&m.add(T)}}catch{}return[...m]}}}var zn={removed:[],stuck:[],sealed:!1,worker:!1},jn=Lr({listen(t){return _e.listen(t),()=>_e.unlisten(t)},fromHost:()=>!0,ready:t=>_e.post(t)},{onMessage:t=>to.hear(t)}),to=eo({send:t=>jn.send(t),act:(t,e)=>jn.guest.act(t,e),navigate:t=>jn.guest.navigate(t),microtask:_e.microtask,now:_e.now,threw:t=>console.error(t),warn:t=>console.warn(t),hardening:()=>zn}),Xo=to.view;Object.defineProperty(globalThis,"graview",{value:Xo,enumerable:!0,configurable:!0,writable:!1});var qn="WorkerGlobalScope"in globalThis?Fr(globalThis,["graview"]):zn;zn=qn;if(qn.stuck.length>0)throw new Error(`The view\'s worker could not be hardened: ${qn.stuck.join(", ")} would not go.`);})();\n';export{e as VIEW_RUNTIME};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a}from"./chunk.
|
|
1
|
+
import{s as a}from"./chunk.UKQUUPKE.js";import{G as f,T as s,ba as l}from"./chunk.M7RESZB6.js";import{b as i}from"./chunk.AJZBJBMO.js";var d=i(f(),1),p=i(s(),1),c=new Set;function B(e){return c.add(e),()=>void c.delete(e)}function S(){let{store:e,principal:o}=l();return(0,d.useMemo)(()=>n=>{let t=n.on===void 0?void 0:e.graph.getNode(n.on);if(!t)return null;let u=[...c].filter(r=>r.store===e&&r.kind===t.kind);return(n.element?u.find(r=>r.root()?.contains(n.element)??!1):u[0])?.section(t.id,o)??null},[e,o])}function v({children:e}){let o=S(),n=(0,d.useMemo)(()=>[o],[o]);return(0,p.jsx)(a,{sections:n,children:e})}export{B as a,S as b,v as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk.WVUJXDXZ.js";import{a as F,b as K,c as pe}from"./chunk.SGCW2XRC.js";import"./chunk.ZN3PUM2I.js";import"./chunk.QIPASE42.js";import"./chunk.EVBCEEQ4.js";import"./chunk.OWT3VVOT.js";import"./chunk.NHTGAP3G.js";import"./chunk.GZHZLJBF.js";import{n as me}from"./chunk.UKQUUPKE.js";import"./chunk.OJGHDWI6.js";import"./chunk.DDUCIUVW.js";import"./chunk.NUYA4BWI.js";import"./chunk.OKZT2QBM.js";import"./chunk.ACTXR2MI.js";import"./chunk.AI34V6WV.js";import"./chunk.G4ULQK64.js";import{G as Te,M as C,O as ue,T as ce,ba as ge,ea as he}from"./chunk.M7RESZB6.js";import"./chunk.SDO3U72B.js";import{hd as de,pa as oe,sa as x,ua as le,wa as W,xa as E,ya as se,za as Y}from"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import{b as q}from"./chunk.AJZBJBMO.js";var g=q(Te(),1);async function ye(e,t){let a=await createImageBitmap(e);try{let i=Math.min(1,t/Math.max(a.width,a.height)),r=document.createElement("canvas");r.width=Math.max(1,Math.round(a.width*i)),r.height=Math.max(1,Math.round(a.height*i));let l=r.getContext("2d");if(l===null)throw new Error("This browser will not give us a canvas to resize with.");return l.drawImage(a,0,0,r.width,r.height),r}finally{a.close()}}var n=q(ce(),1),He=2048,Ie=.85;function T(e){return e<1e3?`${e} bytes`:e<1e6?`${Math.round(e/1e3)} KB`:`${(e/1e6).toFixed(e<1e7?1:0)} MB`}function H(e){if(e.type==="application/pdf")return"PDF";let t=/\.([a-z0-9]{2,5})$/i.exec(e.name??"")?.[1];return t?t.toUpperCase():(e.type.split("/")[1]??e.type).replace(/^x-|^vnd\./,"").split(/[.+-]/)[0].toUpperCase()}function ke(e){let t=[...new Set(e.map(a=>a==="image/*"?"pictures":a==="video/*"?"videos":a==="*/*"||a==="*"?"any file":`${H({type:a})} files`))];return t.length<=1?t[0]??"no files":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}function xe(e,t){if(e.length===0)return!0;let a=`${t.split("/")[0]}/*`;return e.some(i=>i==="*"||i==="*/*"||i===t||i===a)}var fe=/^image\/hei[cf]$|\.hei[cf]$/i,be=e=>fe.test(e.type)||fe.test(e.name),De={mov:"video/quicktime",mp4:"video/mp4",m4v:"video/mp4",webm:"video/webm",ogv:"video/ogg"},Be=e=>De[/\.([a-z0-9]{2,4})$/i.exec(e)?.[1]?.toLowerCase()??""];async function je(e,t,a){let i=e.name||(a.camera?"photo.jpg":"file"),r=e.type||(be({type:"",name:i})?"image/heic":Be(i)??"application/octet-stream"),l=be({type:r,name:i}),u=r.startsWith("image/")||l;if(a.image&&!u)return{refused:`\u201C${i}\u201D isn\u2019t a picture.`};if(a.video)return r.startsWith("video/")?J({blob:e,name:i,type:r},t):{refused:`\u201C${i}\u201D isn\u2019t a video.`};if(l||u&&/^image\/(jpeg|webp)$/.test(r)&&(a.camera||e.size>t.maxBytes||e.size>15e5))try{let c=await ye(e,He),b=await new Promise(m=>c.toBlob(m,"image/jpeg",Ie));if(b)return J({blob:b,name:l?i.replace(/\.hei[cf]$/i,"")+".jpg":i,type:"image/jpeg",width:c.width,height:c.height},t)}catch{if(l&&!xe(t.kinds,r))return{refused:`\u201C${i}\u201D is a HEIC photo, which this browser can\u2019t turn into a JPEG and this host doesn\u2019t take. Save it as a JPEG and try again.`}}let p={};if(u&&!l)try{let c=await createImageBitmap(e);p={width:c.width,height:c.height},c.close()}catch{}return J({blob:e,name:i,type:r,...p},t)}function J(e,t){return xe(t.kinds,e.type)?e.blob.size>t.maxBytes?{refused:`\u201C${e.name}\u201D is ${T(e.blob.size)}; this host takes files up to ${T(t.maxBytes)}.`}:e:{refused:`\u201C${e.name}\u201D is a ${H(e)} file; this host takes ${ke(t.kinds)}.`}}async function _e(e,t,a,i=!1){let r;try{r=await t.upload(e.blob,e.name)}catch(u){let s=u instanceof Error&&u.message.trim()?u.message.trim():"the host refused it";return{refused:`\u201C${e.name}\u201D wasn\u2019t kept: ${s}`}}return le(r)?a&&!W(r)?{refused:`\u201C${e.name}\u201D isn\u2019t a picture.`}:i&&!E(r)?{refused:`The host kept \u201C${e.name}\u201D as ${H(r)}, not as a video.`}:{...r,...r.width===void 0&&e.width?{width:e.width}:{},...r.height===void 0&&e.height?{height:e.height}:{}}:{refused:`The host\u2019s answer for \u201C${e.name}\u201D isn\u2019t a file a record can keep.`}}var $="var(--graview-radius, 8px)",P={color:"var(--graview-ink-muted)",fontSize:"0.8125rem"};function ee(e){let t=C(),a=ue()?.past!=null,[i,r]=(0,g.useState)(!1),l=t?.kept?ze(t,e.href):!0,[,u]=(0,g.useState)(0);return(0,g.useEffect)(()=>{if(typeof l!="object")return;let s=!0;return l.then(()=>s&&u(p=>p+1)),()=>void(s=!1)},[l]),[l===!1||a&&i,()=>r(!0)]}var Q=new WeakMap;function ze(e,t){let a=Q.get(e)?.get(t);if(a!==void 0)return a;let i;try{i=e.kept(t)}catch{return!0}if(typeof i=="boolean")return i;let r=Q.get(e)??new Map;Q.set(e,r);let l=Promise.resolve(i).then(u=>u!==!1,()=>!0);return r.set(t,l),l.then(u=>r.set(t,u)),l}function te({file:e,style:t}){return(0,n.jsx)("span",{role:"img","aria-label":`${F(e)}, removed later`,"data-graview-removed-later":e.href,style:{display:"grid",placeItems:"center",textAlign:"center",padding:4,boxSizing:"border-box",fontSize:"0.6875rem",lineHeight:1.2,color:"var(--graview-ink-muted)",border:"1px dashed var(--graview-edge-bright)",borderRadius:$,...t},children:"removed later"})}function X({file:e,size:t=56,style:a}){let i=C(),[r,l]=ee(e);return r?(0,n.jsx)(te,{file:e,style:{width:t,height:t,flex:"none",...a}}):E(e)?(0,n.jsx)(Ae,{file:e,size:t,...a?{style:a}:{},onError:l}):(0,n.jsx)("img",{onError:l,src:x(i,e.href),alt:F(e),width:t,height:t,loading:"lazy",decoding:"async","data-graview-thumb":e.href,style:{width:t,height:t,objectFit:"cover",borderRadius:$,display:"block",flex:"none",background:"var(--graview-edge)",...a}})}function Fe(e){let[t,a]=(0,g.useState)({}),i=e.duration??t.duration;return[{...i!==void 0?{duration:i}:{},width:e.width??t.width,height:e.height??t.height},u=>{let s=u.currentTarget;a({...Number.isFinite(s.duration)&&s.duration>0?{duration:s.duration}:{},...s.videoWidth>0&&s.videoHeight>0?{width:s.videoWidth,height:s.videoHeight}:{}})}]}var Ne=320,$e=(e,t)=>`${F(e)}, ${se({...t!==void 0?{duration:t}:{}})}`,Oe=(0,n.jsx)("span",{"data-graview-play-glyph":"","aria-hidden":"true",style:{position:"absolute",inset:0,display:"grid",placeItems:"center",pointerEvents:"none"},children:(0,n.jsxs)("svg",{viewBox:"0 0 24 24",width:"40%",height:"40%",style:{maxWidth:40,maxHeight:40,filter:"drop-shadow(0 1px 2px rgb(0 0 0 / 0.5))"},children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"11",fill:"rgb(0 0 0 / 0.55)"}),(0,n.jsx)("path",{d:"M9.5 7.5v9l7-4.5z",fill:"#fff"})]})});function Ae({file:e,size:t,style:a,onError:i}){let r=C(),[l,u]=Fe(e),s={width:t,height:t,objectFit:"cover",display:"block",borderRadius:$,background:"var(--graview-edge)"};return(0,n.jsxs)("span",{role:"img","aria-label":$e(e,l.duration),"data-graview-thumb":e.href,"data-graview-video-thumb":"",style:{position:"relative",display:"block",width:t,height:t,flex:"none",...a},children:[e.poster?(0,n.jsx)("img",{src:x(r,e.poster),alt:"",width:t,height:t,loading:"lazy",decoding:"async",onError:i,style:s}):(0,n.jsx)("video",{src:x(r,e.href),preload:"metadata",muted:!0,playsInline:!0,"aria-hidden":"true",tabIndex:-1,width:t,height:t,onLoadedMetadata:u,onError:i,style:s}),Oe,l.duration!==void 0?(0,n.jsx)("span",{"data-graview-video-clock":"","aria-hidden":"true",style:{position:"absolute",right:3,bottom:3,padding:"0 4px",borderRadius:4,background:"rgb(0 0 0 / 0.65)",color:"#fff",fontSize:"0.6875rem",lineHeight:"16px",fontVariantNumeric:"tabular-nums"},children:K(l.duration)}):null]})}function Ge(){let e=()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):void 0,[t,a]=(0,g.useState)(()=>e()?.matches===!0);return(0,g.useEffect)(()=>{let i=e();if(!i)return;let r=()=>a(i.matches);return r(),i.addEventListener?.("change",r),()=>i.removeEventListener?.("change",r)},[]),t}function Ue({file:e,autoplay:t=!1,cover:a=!1}){let i=C(),[r,l]=ee(e),[u,s]=Fe(e),p=Ge(),c=t&&p,b=(0,g.useRef)(null),m=(0,g.useRef)(c);if((0,g.useEffect)(()=>{let d=b.current;!d||!t||(c?d.pause():m.current&&d.play?.()?.catch?.(()=>{}),m.current=c)},[t,c]),r)return(0,n.jsx)(te,{file:e,style:{width:"100%",aspectRatio:"16 / 9"}});let v=u.width!==void 0&&u.height!==void 0,w=a?{display:"block",width:"100%",height:"100%",objectFit:"cover",background:"#000"}:{display:"block",width:"100%",maxWidth:v?Math.max(u.width,Ne):"100%",height:"auto",maxHeight:"80vh",aspectRatio:v?`${u.width} / ${u.height}`:"16 / 9",borderRadius:$,background:"#000"};return(0,n.jsxs)("figure",{"data-graview-video-figure":e.href,style:{margin:0,display:"grid",gap:4,minWidth:0,...a?{height:"100%"}:{}},children:[(0,n.jsx)("video",{ref:b,"data-graview-video":e.href,...t?{"data-graview-video-autoplay":""}:{},...a?{"data-graview-video-cover":""}:{},...c?{"data-graview-video-still":""}:{},src:x(i,e.href),...e.poster?{poster:x(i,e.poster)}:{},...t?{muted:!0,loop:!0,...c?{}:{autoPlay:!0}}:{controls:!0},preload:t&&!c?"auto":"metadata",playsInline:!0,...v?{width:u.width,height:u.height}:{},"aria-label":$e(e,u.duration),onLoadedMetadata:s,onError:l,style:w,children:e.captions?(0,n.jsx)("track",{kind:"captions",src:x(i,e.captions),srcLang:"en",label:"Captions",default:!0}):null}),t?null:(0,n.jsx)("figcaption",{"data-graview-video-said":"",style:P,children:[e.caption??e.name,...u.duration!==void 0?[K(u.duration)]:[]].join(" \xB7 ")})]})}function qe({file:e,onOpen:t}){let a=C(),[i,r]=ee(e);return i?(0,n.jsx)(te,{file:e,style:{width:"100%",aspectRatio:"1"}}):(0,n.jsx)("button",{type:"button","aria-label":`Open ${F(e)} full size`,onClick:l=>t(l.currentTarget),style:{padding:0,border:0,background:"none",cursor:"zoom-in",display:"block",width:"100%",borderRadius:$},children:(0,n.jsx)("img",{src:x(a,e.href),alt:F(e),loading:"lazy",decoding:"async",onError:r,style:{width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:$,display:"block",background:"var(--graview-edge)"}})})}function Ye({src:e,file:t}){let[a,i]=(0,g.useState)(!1);return(0,n.jsx)("object",{data:e,type:"application/pdf","aria-label":F(t),"data-graview-pdf":a?"shown":"waiting",onLoad:()=>i(!0),style:a?{width:"100%",height:420,border:"1px solid var(--graview-edge)",borderRadius:$}:{width:"100%",height:0,display:"block"}})}function Z({files:e,label:t,autoplay:a,cover:i}){let r=C(),l=d=>x(r,d.href),u=e.filter(W),s=e.filter(E),p=e.filter(d=>!W(d)&&!E(d)),[c,b]=(0,g.useState)(null),m=(0,g.useRef)(null),v=(0,g.useRef)(null);(0,g.useEffect)(()=>{let d=m.current;c!==null&&d&&!d.open&&d.showModal?.()},[c]);let w=c===null?void 0:u[c];return(0,n.jsxs)("div",{style:{display:"grid",gap:10,minWidth:0},children:[u.length>0?(0,n.jsx)("ul",{"data-graview-gallery":"","aria-label":t,style:{listStyle:"none",margin:0,padding:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:8},children:u.map((d,I)=>(0,n.jsx)("li",{style:{minWidth:0},children:(0,n.jsx)(qe,{file:d,onOpen:M=>{v.current=M,b(I)}})},d.href))}):null,s.length>0?(0,n.jsx)("ul",{"data-graview-videos":"","aria-label":t,style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:12},children:s.map(d=>(0,n.jsx)("li",{style:{minWidth:0},children:(0,n.jsx)(Ue,{file:d,...a?{autoplay:a}:{},...i?{cover:i}:{}})},d.href))}):null,p.length>0?(0,n.jsx)("ul",{"data-graview-documents":"",style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:10},children:p.map(d=>(0,n.jsxs)("li",{"data-graview-document":d.type,style:{display:"grid",gap:6,minWidth:0},children:[d.type==="application/pdf"?(0,n.jsx)(Ye,{src:l(d),file:d}):null,d.type==="application/pdf"?(0,n.jsxs)("span",{"data-graview-file-line":"",style:{minWidth:0,overflowWrap:"anywhere",lineHeight:1.5},children:[d.name," ",(0,n.jsxs)("span",{style:P,children:["\xB7 ",H(d)," \xB7 ",T(d.bytes)," \u2014"]})," ",(0,n.jsx)("a",{href:l(d),target:"_blank",rel:"noopener",children:"Open"})," ",(0,n.jsx)("span",{style:P,"aria-hidden":"true",children:"/"})," ",(0,n.jsx)("a",{href:l(d),download:d.name,children:"Download"})]}):(0,n.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",gap:"2px 10px",alignItems:"baseline",minWidth:0,overflowWrap:"anywhere"},children:[(0,n.jsx)("a",{href:l(d),download:d.name,children:d.name}),(0,n.jsxs)("span",{style:P,children:[H(d)," \xB7 ",T(d.bytes)]})]}),d.caption?(0,n.jsx)("span",{style:P,children:d.caption}):null]},d.href))}):null,w?(0,n.jsx)("dialog",{ref:m,"data-graview-full":w.href,"aria-label":F(w),onClose:()=>{b(null),v.current?.focus()},onClick:d=>{d.target===d.currentTarget&&d.currentTarget.close()},style:{padding:0,border:0,borderRadius:$,maxWidth:"min(96vw, 1600px)",maxHeight:"94vh",background:"var(--graview-panel)",color:"var(--graview-ink)"},children:(0,n.jsxs)("figure",{style:{margin:0,display:"grid",gap:8,padding:10},children:[(0,n.jsx)("img",{src:l(w),alt:F(w),style:{maxWidth:"100%",maxHeight:"80vh",objectFit:"contain",display:"block",margin:"0 auto"}}),(0,n.jsxs)("figcaption",{style:{display:"flex",gap:12,alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsx)("span",{children:w.caption??w.name}),(0,n.jsx)("form",{method:"dialog",style:{margin:0},children:(0,n.jsx)("button",{type:"submit",autoFocus:!0,children:"Close"})})]})]})}):null]})}function Se({value:e,onChange:t,several:a,image:i,video:r=!1,label:l,thumbs:u=!0}){let s=C(),p=(0,g.useId)(),c=(0,g.useRef)(null),b=(0,g.useRef)(null),[m,v]=(0,g.useState)(null),[w,d]=(0,g.useState)(null),[I,M]=(0,g.useState)([]),[O,A]=(0,g.useState)(!1),L=i?"image/":r?"video/":void 0,R=s?L?s.kinds.filter(o=>o.startsWith(L)||o==="*"||o==="*/*"):s.kinds:[],Pe=s?s.kinds.length===0||R.length>0:!1,We=!r&&(s?s.kinds.length===0||(i?R:s.kinds).some(o=>o.startsWith("image/")||o.startsWith("*")):!1),ne=!!s&&s.maxBytes>0,D=ne&&(!L||Pe),B=i?"picture":r?"video":"file",ae=a?`${B}s`:`a ${B}`,ie=L?R.length>0?R.join(","):`${L}*`:s?.kinds.join(",")||void 0,Me=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches,G=(0,g.useRef)(e);G.current=e;let re=(0,g.useRef)(null),j=(0,g.useRef)(null);(0,g.useEffect)(()=>{let o=j.current;if(!o||o.from===e)return;j.current=null;let h=re.current?.children,f=h?.[Math.min(o.at,h.length-1)];((o.what==="move"?f?.querySelector("[data-graview-file-move]"):null)??f?.querySelector("[data-graview-file-remove]")??c.current?.parentElement?.querySelector("[data-graview-file-choose]"))?.focus()});let _=async(o,h)=>{if(!s||o.length===0)return;let f=a?o:o.slice(0,1),y=[],S=[];f.length<o.length&&S.push(`${l} holds one ${B}, so ${o.slice(1).map(k=>`\u201C${k.name||"the photo"}\u201D`).join(", ")} ${o.length>2?"were":"was"} left out.`),M([]),d(null);for(let k of f){v(`Sending ${k.name||"the photo"}\u2026`);let U=await je(k,s,{image:i,video:r,camera:h==="camera"});if("refused"in U){S.push(U.refused);continue}let V=await _e(U,s,i,r);"refused"in V?S.push(V.refused):[...a?G.current:[],...y].some(Ve=>Ve.href===V.href)?S.push(`\u201C${V.name}\u201D is already here.`):y.push(V)}if(v(null),M(S),y.length!==0)try{t(a?[...G.current,...y]:y.slice(-1)),d(`Added ${y.map(k=>k.name).join(", ")}.`)}catch(k){M([...S,k instanceof Error?k.message:String(k)])}},z=(o,h,f)=>{try{j.current=f?{...f,from:e}:null,t(o),d(h)}catch(y){j.current=null,M([y instanceof Error?y.message:String(y)])}},N=o=>o?Array.from(o):[],Re=o=>{let h=N(o.clipboardData?.files);!D||h.length===0||(o.preventDefault(),_(h,"pasted"))},Le=o=>{A(!1),D&&(o.preventDefault(),_(N(o.dataTransfer?.files),"dropped"))};return(0,n.jsxs)("div",{role:"group","aria-labelledby":`${p}-label`,"data-graview-file-editor":"","data-graview-dropping":O?"":void 0,onPaste:Re,onDragOver:o=>{D&&(o.preventDefault(),A(!0))},onDragLeave:()=>A(!1),onDrop:Le,style:{display:"grid",gap:8,minWidth:0,padding:O?6:0,outline:O?"2px dashed var(--graview-accent)":"none",borderRadius:$},children:[(0,n.jsx)("span",{id:`${p}-label`,style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"},children:l}),e.length>0&&(a||e.length>1)?(0,n.jsx)("ul",{ref:re,style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:6},children:e.map((o,h)=>(0,n.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",minWidth:0},children:[u&&(W(o)||E(o))?(0,n.jsx)(X,{file:o,size:40}):null,(0,n.jsx)("span",{style:{flex:"1 1 8rem",minWidth:0,overflowWrap:"anywhere"},children:o.name}),(0,n.jsx)(we,{file:o,onCaption:f=>z(e.map((y,S)=>S===h?ve(y,f):y),f?`${o.name} now says \u201C${f}\u201D.`:`${o.name} says its name again.`)}),a&&h>0?(0,n.jsx)("button",{type:"button","data-graview-file-move":"","aria-label":`Move ${o.name} earlier`,onClick:()=>z(e.map((f,y)=>y===h-1?o:y===h?e[h-1]:f),`Moved ${o.name} earlier.`,{at:h-1,what:"move"}),children:"\u2191"}):null,a?(0,n.jsx)("button",{type:"button","data-graview-file-remove":"","aria-label":`Remove ${o.name}`,onClick:()=>z(e.filter((f,y)=>y!==h),`Removed ${o.name}.`,{at:h,what:"remove"}),children:"Remove"}):null]},`${h}:${o.href}`))}):e.length===1?(0,n.jsx)(we,{file:e[0],onCaption:o=>z([ve(e[0],o)],o?`${e[0].name} now says \u201C${o}\u201D.`:`${e[0].name} says its name again.`)}):null,D?(0,n.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:[(0,n.jsx)("input",{ref:c,type:"file",hidden:!0,multiple:a,...ie?{accept:ie}:{},"data-graview-file-input":"","aria-label":`Choose ${ae}`,onChange:o=>{let h=N(o.currentTarget.files);o.currentTarget.value="",_(h,"picked")}}),(0,n.jsx)("button",{type:"button",disabled:m!==null,onClick:()=>c.current?.click(),"data-graview-file-choose":"",children:e.length>0&&!a?`Replace the ${B}`:`Choose ${ae}`}),We?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("input",{ref:b,type:"file",hidden:!0,accept:"image/*",capture:"environment","data-graview-photo-input":"","aria-label":"Take a photo",onChange:o=>{let h=N(o.currentTarget.files);o.currentTarget.value="",_(h,"camera")}}),Me?(0,n.jsx)("button",{type:"button",disabled:m!==null,onClick:()=>b.current?.click(),children:"Take a photo"}):null]}):null,(0,n.jsxs)("span",{style:P,"data-graview-file-takes":"",children:["or drop or paste ",a?"them":"it"," here \xB7 ",s.kinds.length>0?ke(R.length>0?R:s.kinds):"any file",", up to ",T(s.maxBytes)]})]}):(0,n.jsx)("p",{style:{...P,margin:0},"data-graview-file-none":"",children:ne?`This host doesn\u2019t take ${r?"videos":"pictures"}, so none can be added here.`:"This host doesn\u2019t take files, so none can be added here."}),(0,n.jsx)("p",{"aria-live":"polite",style:{...P,margin:0,minHeight:m||w?void 0:0},"data-graview-file-status":"",children:m??w??""}),I.length>0?(0,n.jsx)("div",{role:"alert","data-graview-file-refused":"",style:{color:"var(--graview-warn)",fontSize:"0.875rem",display:"grid",gap:2},children:I.map((o,h)=>(0,n.jsx)("p",{style:{margin:0},children:o},h))}):null]})}var ve=(e,t)=>{let{caption:a,...i}=e;return t?{...i,caption:t}:i};function we({file:e,onCaption:t}){let[a,i]=(0,g.useState)(e.caption??"");(0,g.useEffect)(()=>i(e.caption??""),[e.caption]);let r=()=>{let l=a.trim().slice(0,500);l!==(e.caption??"")&&t(l)};return(0,n.jsx)("input",{type:"text",value:a,placeholder:W(e)||E(e)?"What it shows":"What it is","aria-label":`What ${e.name} ${W(e)||E(e)?"shows":"is"}`,"data-graview-file-caption":e.href,onChange:l=>i(l.target.value),onBlur:r,onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),r())},style:{flex:"1 1 10rem",minWidth:0,font:"inherit",fontSize:"0.875rem",minHeight:24}})}function Ee({field:e,label:t,labelStyle:a,valueStyle:i,style:r,children:l}){return(0,n.jsxs)("div",{"data-graview-files":e,style:{display:"grid",gap:6,minWidth:0,gridColumn:"1 / -1",...r},children:[(0,n.jsx)("dt",{style:a,children:t}),(0,n.jsx)("dd",{style:{margin:0,minWidth:0,display:"grid",gap:10,...i},children:l})]})}function Ce(e){let{nodeId:t,field:a,label:i,files:r}=e,{fields:l,commit:u}=me(t),s=l.find(m=>m.field===a&&m.takesValue),p=s?.shape,c=p?.type==="several"?p.of:p,b=p?.type==="several";return r.length===0&&c?.type!=="file"?null:(0,n.jsxs)(Ee,{...e,children:[(0,n.jsx)(Z,{files:r,label:i}),s&&c?.type==="file"?(0,n.jsx)(Se,{value:r,thumbs:!1,several:b,image:c.image===!0,video:c.video===!0,label:i,onChange:m=>{let v=b?m:m[m.length-1];v!==void 0&&u(s,v)}}):null]})}function nt(e){switch(e.as){case"field":{if(!e.read)return(0,n.jsx)(Ce,{...e});let{autoplay:t,cover:a,...i}=e;return e.files.length>0?(0,n.jsx)(Ee,{...i,children:(0,n.jsx)(Z,{files:e.files,label:e.label,...t?{autoplay:t}:{},...a?{cover:a}:{}})}):null}case"unfilled":return(0,n.jsx)(Ke,{...e});case"thumb":return(0,n.jsx)(X,{...e});case"block":return e.files.length>0?(0,n.jsx)("span",{className:"graview-spec-image","data-graview-field":e.field,"data-graview-image":e.view,style:{display:"block",minWidth:0,...e.view==="gallery"?{position:"relative",zIndex:de.raised}:{}},children:e.view==="thumb"?(0,n.jsx)(X,{file:e.files[0],size:72}):(0,n.jsx)(Z,{files:e.files,label:e.label,...e.autoplay?{autoplay:!0}:{},...e.cover?{cover:!0}:{}})}):null;case"control":{let t=(0,n.jsx)(Se,{value:Y(e.value),several:e.several,image:e.image,video:e.video===!0,label:e.label,onChange:a=>e.onChange(e.several?a:a[a.length-1])});return e.title===void 0?t:(0,n.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.several?"files":"file",children:[(0,n.jsx)("legend",{"data-graview-part":"label",children:e.title}),t]})}}}function Ke({nodeId:e,skip:t,labels:a,labelStyle:i,style:r}){let{store:l}=ge(),u=he(e),s=u?l.schema.tryDefinition(u.kind):void 0,p=pe(s).filter(c=>!t.includes(c)&&!(s?.display?.hide??[]).includes(c)&&Y(u?.[c]).length===0);return p.length===0?null:(0,n.jsx)("dl",{style:{margin:0,display:"grid",gap:14,minWidth:0},children:p.map(c=>(0,n.jsx)(Ce,{nodeId:e,field:c,label:a?.[c]??oe(s,c),files:[],...i?{labelStyle:i}:{},...r?{style:r}:{}},c))})}export{Se as FilesEditor,He as SEND_EDGE,nt as drawFiles,ke as kindsWords,je as prepare,_e as send,T as sizeWords,xe as takes,H as typeWords};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as K}from"./chunk.RQOX5YDW.js";import{Db as V,fc as Y,gc as X,h as P,jb as G,jc as B,k as R,oa as q,q as I,rc as $,sc as N,vb as h,wb as v,x as _}from"./chunk.VSCIXAHN.js";import{a as T,c as C,h as L}from"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var te=Symbol.for("@graview/core:markdown"),ne=500;function ie(e){let n=e;for(let i=0;i<6;i++){let t=N(n);if(!t)return!1;if(t[$]!==void 0)return t[$]===1;if(t[te]===1)return!0;if(t.type==="string")return(t.checks??[]).some(s=>{let f=N(s);return f?.check==="max_length"&&(f.maximum??0)>ne});if(t.innerType===void 0)return!1;n=t.innerType}return!1}function O(e,n,i){if(n===void 0||i==="id"||i==="kind")return!1;let t=e.tryDefinition(n)?.fields?.shape;return!!t&&Object.prototype.hasOwnProperty.call(t,i)&&ie(t[i])}var re=e=>e>=55296&&e<=56319,oe=e=>e>=56320&&e<=57343;function S(e,n){let i=Math.min(e.length,n.length),t=0;for(;t<i&&e.charCodeAt(t)===n.charCodeAt(t);)t++;t>0&&re(e.charCodeAt(t-1))&&t--;let s=0;for(;s<i-t&&e.charCodeAt(e.length-1-s)===n.charCodeAt(n.length-1-s);)s++;return s>0&&oe(e.charCodeAt(e.length-s))&&s--,{at:t,removed:e.slice(t,e.length-s),inserted:n.slice(t,n.length-s)}}var w=e=>e.at+e.removed.length;function H(e){let n=S(e.removed,e.inserted);return{...n,at:e.at+n.at}}function U(e,n,i){if(w(e)<n.at)return e;if(e.at>w(n))return{...e,at:e.at+n.inserted.length-n.removed.length};let t=Math.min(e.at,n.at),s=w(e)-w(n),f=e.removed.slice(0,n.at-t)+n.inserted+(s>0?e.removed.slice(e.removed.length-s):""),r=n.at<e.at||n.at===e.at&&i;return H({at:t,removed:f,inserted:r?n.inserted+e.inserted:e.inserted+n.inserted})}function b(e,n){return[U(e,n,!1),U(n,e,!0)]}function D(e,n){let i=e.at+e.inserted.length;if(w(n)<e.at||n.at>i)return;let t=Math.min(e.at,n.at),s=w(n)-i,f=n.removed.slice(0,e.at-t),r=s>0?n.removed.slice(n.removed.length-s):"",l=T(f+e.inserted+r,{...n,at:n.at-t});return H({at:t,removed:f+e.removed+r,inserted:l})}function M(e,n,i){switch(e.op){case"patch-node":return e.id===n&&Object.prototype.hasOwnProperty.call(e.after,i);case"add-node":case"remove-node":return e.node.id===n;default:return!1}}function j(e,n,i){if(e.op!=="patch-node"||e.id!==n||!Object.prototype.hasOwnProperty.call(e.after,i))return;let t=e.before[i],s=e.after[i];return typeof s=="string"&&(t===void 0||t===""||C(t))?{at:0,removed:"",inserted:s}:void 0}var J=(e,n,i)=>e.flatMap(t=>t.op==="splice-text"&&t.id===n&&t.field===i?[t]:[]);function E(e,n,i,t,s,f){if(typeof f!="string"||s<n-1)return;let r=[];for(let o of e)if(!(o.seq<=s))for(let p of o.primitives){let a=j(p,i,t);if(a){r.push(a);continue}if(M(p,i,t))return;p.op==="splice-text"&&p.id===i&&p.field===t&&r.push(p)}let l=f;try{for(let o=r.length-1;o>=0;o--){let p=r[o];l=T(l,{at:p.at,removed:p.inserted,inserted:p.removed})}}catch{return}return{then:l,since:r}}function A(e,n){let i=e;for(let t of n)i=b(t,i)[1];return{at:i.at,removed:i.removed,inserted:i.inserted}}function Q(e,n,i){let t=i?A(S(i.then,n),i.since):S(e,n);return t.removed===""&&t.inserted===""?void 0:t}function Z(e){let n=e.schema,i=t=>{throw new V(t,"invalid")};return{name:h,title:"Type text",input:I({node:P(),field:P(),at:R(),remove:R(),insert:P(),rev:_(R())}),subject:{kinds:"*",arg:"node"},writes:[],describe:(t,s)=>{let{node:f,field:r,insert:l,remove:o}=t;return K({node:f,field:r,inserted:[...String(l??"")].length,removed:Number(o)||0},n,s)},apply(t,s){let{node:f,field:r,at:l,remove:o,insert:p,rev:a}=s;(![l,o,a??0].every(k=>Number.isInteger(k)&&k>=-1)||l<0||o<0)&&i("at and remove are whole numbers, none below 0, and rev a revision");let d=t.graph.getNode(f);if(!d)throw new G(f,"\u201CType text\u201D names a record that is not there.");if(O(n,d.kind,r)||i(`${q(n.tryDefinition(d.kind),d.kind)}'s "${r}" is not text typed together: write it whole, as its edit does`),o===0&&p==="")return;let c=d[r];if(typeof c!="string"||c===""){t.patchNode(f,{[r]:p});return}let g=e.graph.getNode(f)?.[r],m=a===void 0?{then:c,since:[]}:E(e.log.all(),e.log.horizon,f,r,Math.max(a,-1),g);m||i(`${r} was written whole since revision ${a}: read it again and type over what it holds now`);let{then:u,since:y}=m;l+o>u.length&&i(`${r} held ${u.length} characters at revision ${a??"now"}, so there is nothing at ${l}${o>0?`\u2013${l+o}`:""} to type over`);let x=A({at:l,removed:u.slice(l,l+o),inserted:p},y);x.removed===""&&x.inserted===""||t.emit({op:"splice-text",id:f,field:r,...x})}}}function ee(e,n,i,t,s=()=>!0){let f=i===void 0?void 0:e.tryDefinition(i);if(!f||typeof t!="string")return[];let r=new Set;for(let l of n)if(!(l.name===h||!Y(e,l).includes(i)||!X(l,f).includes(t))&&s(l)){r.add(l.name);for(let o of B(e,n,l)??[])r.add(o)}return[...r]}function se(e,n,i){if(!n.some(r=>r.op==="patch-node"))return[...n];let t=new Set,s=new Set,f=[];for(let r of n){if(r.op==="add-node"&&t.add(r.node.id),r.op!=="patch-node"||t.has(r.id)){r.op==="splice-text"&&s.add(`${r.id}\0${r.field}`),f.push(r);continue}let l=e.graph.getNode(r.id),o={},p={},a=[];for(let[d,c]of Object.entries(r.after)){let g=l?.[d],m=`${r.id}\0${d}`;if(typeof c=="string"&&typeof g=="string"&&g!==""&&!s.has(m)&&O(e.schema,l?.kind,d)){let u=i?.find(x=>x.node===r.id&&x.field===d),y=Q(g,c,u?E(e.log.all(),e.log.horizon,r.id,d,u.rev,g):void 0);if(y){a.push({op:"splice-text",id:r.id,field:d,...y}),s.add(m);continue}}o[d]=r.before[d],p[d]=c,s.add(m)}Object.keys(p).length>0&&f.push(a.length>0?{op:"patch-node",id:r.id,before:o,after:p}:r),f.push(...a)}return f}function de(e,n){let i=[];return[...n].sort((t,s)=>s.seq-t.seq).map(t=>{let s=L(t);if(!s.some(o=>o.op==="splice-text"))return i.push(...s),{op:t,primitives:s};let f=e.filter(o=>o.seq>t.seq).flatMap(o=>o.primitives),r=t.primitives.length,l=[];return s.forEach((o,p)=>{if(o.op!=="splice-text")return void l.push(o);let a=A(o,J([...t.primitives.slice(r-p),...f,...i,...l],o.id,o.field));(a.removed!==""||a.inserted!=="")&&l.push({op:"splice-text",id:o.id,field:o.field,...a})}),i.push(...l),{op:t,primitives:l}})}function ae(e,n){let i=(t,s)=>e.some(f=>M(f,t,s));return n.undoes!==void 0&&n.primitives.length===0&&e.some(t=>t.op==="splice-text")||n.primitives.length>0&&n.primitives.every(t=>t.op==="splice-text"&&!i(t.id,t.field))?!0:e.flatMap(t=>t.op==="splice-text"&&n.primitives.some(s=>M(s,t.id,t.field))?[t.id]:[])}function le(e,n,i){let t=new Map,s=[],f=new Set;for(let a of e){let d=a.primitives[0],c=a.mutation?.args,g=a.mutation?.name!==h||a.primitives.length!==1||!d?void 0:d.op==="splice-text"?d:j(d,String(c?.node),String(c?.field));g?s.push({batch:a.batch,node:String(c?.node),field:String(c?.field),splice:g}):f.add(a.batch)}if(s.length===0)return t;let r=a=>`${a.node}\0${a.field}`,l=new Set,o=new Set(e.map(a=>a.batch).filter(a=>!i.includes(a))),p=s;for(let a of n){if(o.has(a.batch)){p=p.filter(d=>d.batch!==a.batch);continue}for(let d of a.primitives){if(d.op==="add-edge"||d.op==="remove-edge")continue;let c=d.op==="add-node"||d.op==="remove-node"?d.node.id:d.id;for(let g of new Set(p.filter(m=>m.node===c).map(m=>m.field))){let m=d.op==="splice-text"?d.field===g?d:void 0:j(d,c,g);for(let u of p)u.node!==c||u.field!==g||(m?[m,u.splice]=b(m,u.splice):M(d,u.node,u.field)&&l.add(r(u)))}}}p.forEach((a,d)=>{if(!o.has(a.batch))return;let c={at:a.splice.at,removed:a.splice.inserted,inserted:a.splice.removed};for(let g of p.slice(d+1))r(g)===r(a)&&([c,g.splice]=b(c,g.splice))});for(let a of i){let d=p.filter(c=>c.batch===a);d.length===0||f.has(a)||d.some(c=>l.has(r(c)))||t.set(a,d.map(c=>({name:h,args:{node:c.node,field:c.field,at:c.splice.at,remove:c.splice.removed.length,insert:c.splice.inserted}})))}return t}v.typeText=Z;v.via=ee;v.collaborative=O;v.asSplices=se;v.undone=de;v.aside=ae;v.carried=le;function Ye(e){let{store:n,author:i,pending:t,provisional:s,asked:f}=e,r=new Map,l=(o,p)=>{r.get(o)?.(p),r.delete(o)};return{store:n,apply:(o,p)=>e.appliedAll(o,{...i?{author:i}:{},...p!==void 0?{batch:p}:{}}),hold(o){t.push(o),s.add(o),e.answers.set(o,new Promise(p=>r.set(o,p)))},ask:(o,p)=>void f.set(o,{calls:p}),send(o,p){f.set(o,{calls:p});let a=e.sent(o,p),d=()=>l(o,a);return a.then(c=>{Array.isArray(c?.ops)&&c.ops.length===0&&e.letGo.add(o),d()},d),a},drop(o){e.letGo.add(o),e.settle(o),f.delete(o),e.land([],[o]),l(o)},seen:e.seen,gone:e.gone,ahead(o,p,a){let d=t.indexOf(o),c=n.log.all(),g=m=>c.some(u=>u.batch===m&&u.primitives.some(y=>y.op==="splice-text"&&y.id===p&&y.field===a||y.op==="patch-node"&&y.id===p&&a in y.after));return t.slice(0,Math.max(0,d)).flatMap(m=>{let u=e.answers.get(m);return u&&g(m)?[{batch:m,answer:u}]:[]})}}}var ce=400,pe=/[\s.,;:!?)\]}]$/u,W=e=>typeof e=="string"?e:"";function z(e,n,i,t){let s=e.log.all(),f=s.findIndex(o=>o.batch===n);if(f<0)return;let r=W(e.graph.getNode(i)?.[t]),l;for(let o=s.length-1;o>=f;o--){let p=s[o];p.batch===n&&l===void 0&&(l=r);for(let a=p.primitives.length-1;a>=0;a--){let d=p.primitives[a];d.op==="splice-text"&&d.id===i&&d.field===t?r=T(r,{at:d.at,removed:d.inserted,inserted:d.removed}):d.op==="patch-node"&&d.id===i&&t in d.after&&(r=C(d.before[t])?"":W(d.before[t]))}}if(!(l===void 0||l===r))return S(r,l)}function Xe(e,n,i){let t,s=[],f,r,l=!1,o=new Set,p=c=>({name:h,args:{node:e,field:n,at:c.at,remove:c.removed.length,insert:c.inserted,rev:i.seen()}}),a=()=>{r&&clearTimeout(r),r=void 0,t!==void 0&&s.push(t),t=void 0,d()},d=()=>{if(f!==void 0||l||i.gone())return;let c=s.shift();if(c===void 0)return;let g=i.ahead(c,e,n).filter(u=>!o.has(u.batch));if(g.length>0){s.unshift(c),l=!0,Promise.allSettled(g.map(u=>u.answer)).then(()=>{for(let u of g)o.add(u.batch);l=!1,d()});return}let m=z(i.store,c,e,n);if(!m)return i.drop(c),d();f=c,i.send(c,[p(m)]).finally(()=>{f=void 0,d()})};return{splice(c,g,m){if(i.gone())return;let u=W(i.store.graph.getNode(e)?.[n]),y={at:c,removed:u.slice(c,c+g),inserted:m};if(t!==void 0){let F=z(i.store,t,e,n);(!F||!D(F,y))&&a()}let x=i.apply([{name:h,args:{node:e,field:n,at:c,remove:g,insert:m}}],t);if(x.ops.length===0)return;t===void 0&&(t=x.batch,i.hold(t));let k=z(i.store,t,e,n);if(k&&i.ask(t,[p(k)]),pe.test(m))return a();r&&clearTimeout(r),r=setTimeout(a,ce),r.unref?.()},flush:a,waiting:()=>s.length+(t!==void 0?1:0)+(f!==void 0?1:0)}}function Be(e,n){let i=n.find(l=>l.name===h)?.args;if(typeof i?.node!="string"||typeof i.field!="string")return;let{node:t,field:s}=i,f=()=>e.graph.getNode(t)?.[s],r=f();return{node:t,field:s,yours:r,over:l=>{let o=f();return{name:h,args:{node:t,field:s,at:0,remove:typeof o=="string"?o.length:0,insert:typeof r=="string"?r:"",rev:l}}}}}export{ce as TYPING_IDLE_MS,z as runSplice,Xe as typingOf,Ye as wireOf,Be as yoursOf};
|
|
1
|
+
import{d as K}from"./chunk.RPDH32XV.js";import{Ab as v,Hb as V,h as P,jc as Y,k as R,kc as X,nb as G,nc as B,q as I,ra as q,x as _,yc as $,zb as h,zc as N}from"./chunk.DZZL5IDD.js";import{a as T,c as C,h as L}from"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var te=Symbol.for("@graview/core:markdown"),ne=500;function ie(e){let n=e;for(let i=0;i<6;i++){let t=N(n);if(!t)return!1;if(t[$]!==void 0)return t[$]===1;if(t[te]===1)return!0;if(t.type==="string")return(t.checks??[]).some(s=>{let f=N(s);return f?.check==="max_length"&&(f.maximum??0)>ne});if(t.innerType===void 0)return!1;n=t.innerType}return!1}function O(e,n,i){if(n===void 0||i==="id"||i==="kind")return!1;let t=e.tryDefinition(n)?.fields?.shape;return!!t&&Object.prototype.hasOwnProperty.call(t,i)&&ie(t[i])}var re=e=>e>=55296&&e<=56319,oe=e=>e>=56320&&e<=57343;function S(e,n){let i=Math.min(e.length,n.length),t=0;for(;t<i&&e.charCodeAt(t)===n.charCodeAt(t);)t++;t>0&&re(e.charCodeAt(t-1))&&t--;let s=0;for(;s<i-t&&e.charCodeAt(e.length-1-s)===n.charCodeAt(n.length-1-s);)s++;return s>0&&oe(e.charCodeAt(e.length-s))&&s--,{at:t,removed:e.slice(t,e.length-s),inserted:n.slice(t,n.length-s)}}var w=e=>e.at+e.removed.length;function H(e){let n=S(e.removed,e.inserted);return{...n,at:e.at+n.at}}function U(e,n,i){if(w(e)<n.at)return e;if(e.at>w(n))return{...e,at:e.at+n.inserted.length-n.removed.length};let t=Math.min(e.at,n.at),s=w(e)-w(n),f=e.removed.slice(0,n.at-t)+n.inserted+(s>0?e.removed.slice(e.removed.length-s):""),r=n.at<e.at||n.at===e.at&&i;return H({at:t,removed:f,inserted:r?n.inserted+e.inserted:e.inserted+n.inserted})}function b(e,n){return[U(e,n,!1),U(n,e,!0)]}function D(e,n){let i=e.at+e.inserted.length;if(w(n)<e.at||n.at>i)return;let t=Math.min(e.at,n.at),s=w(n)-i,f=n.removed.slice(0,e.at-t),r=s>0?n.removed.slice(n.removed.length-s):"",l=T(f+e.inserted+r,{...n,at:n.at-t});return H({at:t,removed:f+e.removed+r,inserted:l})}function M(e,n,i){switch(e.op){case"patch-node":return e.id===n&&Object.prototype.hasOwnProperty.call(e.after,i);case"add-node":case"remove-node":return e.node.id===n;default:return!1}}function j(e,n,i){if(e.op!=="patch-node"||e.id!==n||!Object.prototype.hasOwnProperty.call(e.after,i))return;let t=e.before[i],s=e.after[i];return typeof s=="string"&&(t===void 0||t===""||C(t))?{at:0,removed:"",inserted:s}:void 0}var J=(e,n,i)=>e.flatMap(t=>t.op==="splice-text"&&t.id===n&&t.field===i?[t]:[]);function E(e,n,i,t,s,f){if(typeof f!="string"||s<n-1)return;let r=[];for(let o of e)if(!(o.seq<=s))for(let p of o.primitives){let a=j(p,i,t);if(a){r.push(a);continue}if(M(p,i,t))return;p.op==="splice-text"&&p.id===i&&p.field===t&&r.push(p)}let l=f;try{for(let o=r.length-1;o>=0;o--){let p=r[o];l=T(l,{at:p.at,removed:p.inserted,inserted:p.removed})}}catch{return}return{then:l,since:r}}function A(e,n){let i=e;for(let t of n)i=b(t,i)[1];return{at:i.at,removed:i.removed,inserted:i.inserted}}function Q(e,n,i){let t=i?A(S(i.then,n),i.since):S(e,n);return t.removed===""&&t.inserted===""?void 0:t}function Z(e){let n=e.schema,i=t=>{throw new V(t,"invalid")};return{name:h,title:"Type text",input:I({node:P(),field:P(),at:R(),remove:R(),insert:P(),rev:_(R())}),subject:{kinds:"*",arg:"node"},writes:[],describe:(t,s)=>{let{node:f,field:r,insert:l,remove:o}=t;return K({node:f,field:r,inserted:[...String(l??"")].length,removed:Number(o)||0},n,s)},apply(t,s){let{node:f,field:r,at:l,remove:o,insert:p,rev:a}=s;(![l,o,a??0].every(k=>Number.isInteger(k)&&k>=-1)||l<0||o<0)&&i("at and remove are whole numbers, none below 0, and rev a revision");let d=t.graph.getNode(f);if(!d)throw new G(f,"\u201CType text\u201D names a record that is not there.");if(O(n,d.kind,r)||i(`${q(n.tryDefinition(d.kind),d.kind)}'s "${r}" is not text typed together: write it whole, as its edit does`),o===0&&p==="")return;let c=d[r];if(typeof c!="string"||c===""){t.patchNode(f,{[r]:p});return}let g=e.graph.getNode(f)?.[r],m=a===void 0?{then:c,since:[]}:E(e.log.all(),e.log.horizon,f,r,Math.max(a,-1),g);m||i(`${r} was written whole since revision ${a}: read it again and type over what it holds now`);let{then:u,since:y}=m;l+o>u.length&&i(`${r} held ${u.length} characters at revision ${a??"now"}, so there is nothing at ${l}${o>0?`\u2013${l+o}`:""} to type over`);let x=A({at:l,removed:u.slice(l,l+o),inserted:p},y);x.removed===""&&x.inserted===""||t.emit({op:"splice-text",id:f,field:r,...x})}}}function ee(e,n,i,t,s=()=>!0){let f=i===void 0?void 0:e.tryDefinition(i);if(!f||typeof t!="string")return[];let r=new Set;for(let l of n)if(!(l.name===h||!Y(e,l).includes(i)||!X(l,f).includes(t))&&s(l)){r.add(l.name);for(let o of B(e,n,l)??[])r.add(o)}return[...r]}function se(e,n,i){if(!n.some(r=>r.op==="patch-node"))return[...n];let t=new Set,s=new Set,f=[];for(let r of n){if(r.op==="add-node"&&t.add(r.node.id),r.op!=="patch-node"||t.has(r.id)){r.op==="splice-text"&&s.add(`${r.id}\0${r.field}`),f.push(r);continue}let l=e.graph.getNode(r.id),o={},p={},a=[];for(let[d,c]of Object.entries(r.after)){let g=l?.[d],m=`${r.id}\0${d}`;if(typeof c=="string"&&typeof g=="string"&&g!==""&&!s.has(m)&&O(e.schema,l?.kind,d)){let u=i?.find(x=>x.node===r.id&&x.field===d),y=Q(g,c,u?E(e.log.all(),e.log.horizon,r.id,d,u.rev,g):void 0);if(y){a.push({op:"splice-text",id:r.id,field:d,...y}),s.add(m);continue}}o[d]=r.before[d],p[d]=c,s.add(m)}Object.keys(p).length>0&&f.push(a.length>0?{op:"patch-node",id:r.id,before:o,after:p}:r),f.push(...a)}return f}function de(e,n){let i=[];return[...n].sort((t,s)=>s.seq-t.seq).map(t=>{let s=L(t);if(!s.some(o=>o.op==="splice-text"))return i.push(...s),{op:t,primitives:s};let f=e.filter(o=>o.seq>t.seq).flatMap(o=>o.primitives),r=t.primitives.length,l=[];return s.forEach((o,p)=>{if(o.op!=="splice-text")return void l.push(o);let a=A(o,J([...t.primitives.slice(r-p),...f,...i,...l],o.id,o.field));(a.removed!==""||a.inserted!=="")&&l.push({op:"splice-text",id:o.id,field:o.field,...a})}),i.push(...l),{op:t,primitives:l}})}function ae(e,n){let i=(t,s)=>e.some(f=>M(f,t,s));return n.undoes!==void 0&&n.primitives.length===0&&e.some(t=>t.op==="splice-text")||n.primitives.length>0&&n.primitives.every(t=>t.op==="splice-text"&&!i(t.id,t.field))?!0:e.flatMap(t=>t.op==="splice-text"&&n.primitives.some(s=>M(s,t.id,t.field))?[t.id]:[])}function le(e,n,i){let t=new Map,s=[],f=new Set;for(let a of e){let d=a.primitives[0],c=a.mutation?.args,g=a.mutation?.name!==h||a.primitives.length!==1||!d?void 0:d.op==="splice-text"?d:j(d,String(c?.node),String(c?.field));g?s.push({batch:a.batch,node:String(c?.node),field:String(c?.field),splice:g}):f.add(a.batch)}if(s.length===0)return t;let r=a=>`${a.node}\0${a.field}`,l=new Set,o=new Set(e.map(a=>a.batch).filter(a=>!i.includes(a))),p=s;for(let a of n){if(o.has(a.batch)){p=p.filter(d=>d.batch!==a.batch);continue}for(let d of a.primitives){if(d.op==="add-edge"||d.op==="remove-edge")continue;let c=d.op==="add-node"||d.op==="remove-node"?d.node.id:d.id;for(let g of new Set(p.filter(m=>m.node===c).map(m=>m.field))){let m=d.op==="splice-text"?d.field===g?d:void 0:j(d,c,g);for(let u of p)u.node!==c||u.field!==g||(m?[m,u.splice]=b(m,u.splice):M(d,u.node,u.field)&&l.add(r(u)))}}}p.forEach((a,d)=>{if(!o.has(a.batch))return;let c={at:a.splice.at,removed:a.splice.inserted,inserted:a.splice.removed};for(let g of p.slice(d+1))r(g)===r(a)&&([c,g.splice]=b(c,g.splice))});for(let a of i){let d=p.filter(c=>c.batch===a);d.length===0||f.has(a)||d.some(c=>l.has(r(c)))||t.set(a,d.map(c=>({name:h,args:{node:c.node,field:c.field,at:c.splice.at,remove:c.splice.removed.length,insert:c.splice.inserted}})))}return t}v.typeText=Z;v.via=ee;v.collaborative=O;v.asSplices=se;v.undone=de;v.aside=ae;v.carried=le;function Ye(e){let{store:n,author:i,pending:t,provisional:s,asked:f}=e,r=new Map,l=(o,p)=>{r.get(o)?.(p),r.delete(o)};return{store:n,apply:(o,p)=>e.appliedAll(o,{...i?{author:i}:{},...p!==void 0?{batch:p}:{}}),hold(o){t.push(o),s.add(o),e.answers.set(o,new Promise(p=>r.set(o,p)))},ask:(o,p)=>void f.set(o,{calls:p}),send(o,p){f.set(o,{calls:p});let a=e.sent(o,p),d=()=>l(o,a);return a.then(c=>{Array.isArray(c?.ops)&&c.ops.length===0&&e.letGo.add(o),d()},d),a},drop(o){e.letGo.add(o),e.settle(o),f.delete(o),e.land([],[o]),l(o)},seen:e.seen,gone:e.gone,ahead(o,p,a){let d=t.indexOf(o),c=n.log.all(),g=m=>c.some(u=>u.batch===m&&u.primitives.some(y=>y.op==="splice-text"&&y.id===p&&y.field===a||y.op==="patch-node"&&y.id===p&&a in y.after));return t.slice(0,Math.max(0,d)).flatMap(m=>{let u=e.answers.get(m);return u&&g(m)?[{batch:m,answer:u}]:[]})}}}var ce=400,pe=/[\s.,;:!?)\]}]$/u,W=e=>typeof e=="string"?e:"";function z(e,n,i,t){let s=e.log.all(),f=s.findIndex(o=>o.batch===n);if(f<0)return;let r=W(e.graph.getNode(i)?.[t]),l;for(let o=s.length-1;o>=f;o--){let p=s[o];p.batch===n&&l===void 0&&(l=r);for(let a=p.primitives.length-1;a>=0;a--){let d=p.primitives[a];d.op==="splice-text"&&d.id===i&&d.field===t?r=T(r,{at:d.at,removed:d.inserted,inserted:d.removed}):d.op==="patch-node"&&d.id===i&&t in d.after&&(r=C(d.before[t])?"":W(d.before[t]))}}if(!(l===void 0||l===r))return S(r,l)}function Xe(e,n,i){let t,s=[],f,r,l=!1,o=new Set,p=c=>({name:h,args:{node:e,field:n,at:c.at,remove:c.removed.length,insert:c.inserted,rev:i.seen()}}),a=()=>{r&&clearTimeout(r),r=void 0,t!==void 0&&s.push(t),t=void 0,d()},d=()=>{if(f!==void 0||l||i.gone())return;let c=s.shift();if(c===void 0)return;let g=i.ahead(c,e,n).filter(u=>!o.has(u.batch));if(g.length>0){s.unshift(c),l=!0,Promise.allSettled(g.map(u=>u.answer)).then(()=>{for(let u of g)o.add(u.batch);l=!1,d()});return}let m=z(i.store,c,e,n);if(!m)return i.drop(c),d();f=c,i.send(c,[p(m)]).finally(()=>{f=void 0,d()})};return{splice(c,g,m){if(i.gone())return;let u=W(i.store.graph.getNode(e)?.[n]),y={at:c,removed:u.slice(c,c+g),inserted:m};if(t!==void 0){let F=z(i.store,t,e,n);(!F||!D(F,y))&&a()}let x=i.apply([{name:h,args:{node:e,field:n,at:c,remove:g,insert:m}}],t);if(x.ops.length===0)return;t===void 0&&(t=x.batch,i.hold(t));let k=z(i.store,t,e,n);if(k&&i.ask(t,[p(k)]),pe.test(m))return a();r&&clearTimeout(r),r=setTimeout(a,ce),r.unref?.()},flush:a,waiting:()=>s.length+(t!==void 0?1:0)+(f!==void 0?1:0)}}function Be(e,n){let i=n.find(l=>l.name===h)?.args;if(typeof i?.node!="string"||typeof i.field!="string")return;let{node:t,field:s}=i,f=()=>e.graph.getNode(t)?.[s],r=f();return{node:t,field:s,yours:r,over:l=>{let o=f();return{name:h,args:{node:t,field:s,at:0,remove:typeof o=="string"?o.length:0,insert:typeof r=="string"?r:"",rev:l}}}}}export{ce as TYPING_IDLE_MS,z as runSplice,Xe as typingOf,Ye as wireOf,Be as yoursOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as x}from"./chunk.
|
|
1
|
+
import{b as x}from"./chunk.LAYQ5PFS.js";import"./chunk.KDXU5DT3.js";import"./chunk.O2BHPYA4.js";import"./chunk.WVUJXDXZ.js";import"./chunk.SGCW2XRC.js";import"./chunk.ZN3PUM2I.js";import"./chunk.QIPASE42.js";import"./chunk.EVBCEEQ4.js";import"./chunk.OWT3VVOT.js";import"./chunk.NHTGAP3G.js";import"./chunk.GZHZLJBF.js";import{n as R}from"./chunk.UKQUUPKE.js";import"./chunk.OJGHDWI6.js";import"./chunk.DDUCIUVW.js";import"./chunk.NUYA4BWI.js";import"./chunk.OKZT2QBM.js";import"./chunk.ACTXR2MI.js";import"./chunk.AI34V6WV.js";import"./chunk.G4ULQK64.js";import{G as A,T as v,ca as g}from"./chunk.M7RESZB6.js";import"./chunk.SDO3U72B.js";import{hd as k,pa as y,ta as c}from"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import{b as u}from"./chunk.AJZBJBMO.js";var f=u(A(),1);var L=u(A(),1),S=(0,L.createContext)(void 0);var i=u(v(),1),W=new WeakMap,m=new WeakMap,P=(e,n)=>`${n.kind}\0${n.id??""}\0${e}`;function b(e,n,a){let p=P(n,a),o=W.get(e);o||W.set(e,o=new Map);let t=o.get(p);return t||(t=Promise.resolve().then(()=>e(n,a)).then(r=>C(r)?r:null,()=>null).then(r=>{let s=m.get(e);return s||m.set(e,s=new Map),s.set(p,r),r}),o.set(p,t)),t}function C(e){if(e===null)return!0;if(typeof e!="object"||e===void 0)return!1;if(e.denied===!0)return!0;let n=e;return typeof n.name=="string"&&n.name.trim()!==""&&typeof n.href=="string"}function h(e){if(/^https?:\/\//i.test(e))try{return new URL(e).href}catch{return}}var N=e=>h(e)??(c(e)?e:void 0),E=e=>h(e)??(e.startsWith("/")&&c(e)?e:void 0),I={kind:"human"},w={color:"var(--graview-ink-muted)"};function M({icon:e}){if(!e)return null;let n=E(e);if(n)return(0,i.jsx)("img",{src:n,alt:"",width:20,height:20,"data-graview-app-icon":"",style:{width:20,height:20,borderRadius:5,objectFit:"cover",flex:"0 0 auto"}});let a=[...e.trim()].slice(0,2).join("");return a?(0,i.jsx)("span",{"aria-hidden":"true","data-graview-app-icon":"",style:{flex:"0 0 auto",lineHeight:"20px"},children:a}):null}function V(e){let n=g(),a=(0,f.useContext)(S)??n?.resolveApp,p=n?.principal??I,o=()=>a?m.get(a)?.get(P(e,p))??"asking":null,[t,r]=(0,f.useState)(o);return(0,f.useEffect)(()=>{let s=o();if(r(s),s!=="asking"||!a)return;let l=!0;return b(a,e,p).then(d=>l&&r(d)),()=>{l=!1}},[a,e,p.kind,p.id]),t}function D({address:e,as:n="chip",nodeId:a,field:p,style:o}){let t=V(e),r={position:"relative",zIndex:k.raised,overflowWrap:"anywhere",minWidth:0,maxWidth:"100%",...o},s;if(t==="asking")s=(0,i.jsx)("span",{"data-graview-app-link":"","data-graview-app-state":"asking","aria-busy":"true",style:{...w,...r},children:"Linked app"});else if(t&&"denied"in t)s=(0,i.jsx)("span",{"data-graview-app-link":"","data-graview-app-state":"denied",style:{...w,fontStyle:"italic",...r},children:"linked app (no access)"});else if(t){let l=N(t.href),d=n==="record"?t.headline?.trim():void 0;s=(0,i.jsxs)(l?"a":"span",{"data-graview-app-link":"","data-graview-app-state":"found",...l?{href:l}:{},...!d&&t.headline?{title:t.headline}:{},style:{display:"inline-flex",alignItems:d?"flex-start":"center",minHeight:24,gap:8,color:"inherit",textUnderlineOffset:3,...r},children:[(0,i.jsx)(M,{icon:t.icon}),(0,i.jsxs)("span",{style:{display:"grid",minWidth:0},children:[(0,i.jsx)("span",{"data-graview-app-name":"",style:{fontWeight:600},children:t.name}),d?(0,i.jsx)("span",{"data-graview-app-headline":"",style:{...w,fontSize:"0.8125em",fontWeight:400},children:d}):null]})]})}else{let l=h(e);s=l?(0,i.jsx)("a",{"data-graview-app-link":"","data-graview-app-state":"plain",href:l,rel:"noopener noreferrer",target:"_blank",style:{color:"var(--graview-accent)",display:"inline-flex",alignItems:"center",minHeight:24,...r},children:e}):(0,i.jsx)("span",{"data-graview-app-link":"","data-graview-app-state":"plain",style:r,children:e})}return a&&p?(0,i.jsx)(H,{nodeId:a,field:p,address:e,drawn:s}):s}function H({nodeId:e,field:n,address:a,drawn:p}){let o=R(e).fields.some(s=>s.field===n),t=g()?.store;if(!o)return p;let r=y(t?t.schema.tryDefinition(String(t.graph.getNode(e)?.kind)):void 0,n).toLowerCase();return(0,i.jsxs)("span",{style:{display:"inline-flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px",maxWidth:"100%",minWidth:0},children:[p,(0,i.jsx)("span",{style:{fontSize:"0.8125rem"},children:(0,i.jsx)(x,{nodeId:e,field:n,value:"Change",stored:a,said:`Change the ${r}`})})]})}var Y=e=>(0,i.jsx)(D,{...e});export{D as AppLink,Y as drawAppLink};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as w,Na as c,aa as f,ba as h,da as g}from"./chunk.
|
|
1
|
+
import{G as w,Na as c,aa as f,ba as h,da as g}from"./chunk.M7RESZB6.js";import{b as m}from"./chunk.AJZBJBMO.js";var d=m(w(),1);function j(){let e=c();return(0,d.useMemo)(()=>[...new Set(e.flatMap(n=>n.nodeIds))],[e])}function x(){let e=I(),n=f();return(0,d.useMemo)(()=>{if(!n)return e;let t=n.matched;return t.length===0&&e.length===0?[k]:[...new Set([...e,...t])]},[n,e])}function I(){let{store:e,selection:n}=h(),t=g(),r=c();return(0,d.useMemo)(()=>{if(n.length===0)return v;let u=n.join(`
|
|
2
2
|
`),s=y.get(e);if(s&&s.violations===r&&s.key===u)return s.reached;let a=new Set(n),i=new Set(a);for(let o of e.graph.allEdges())a.has(o.from)&&i.add(o.to),a.has(o.to)&&i.add(o.from);for(let o of r)if(o.subjectId!==void 0&&a.has(o.subjectId))for(let p of o.nodeIds)i.add(p);let l=[...i];return y.set(e,{violations:r,key:u,reached:l}),l},[e,n,t,r])}var v=[],y=new WeakMap,k="search:nothing";export{j as a,x as b,I as c};
|
|
@@ -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 t}from"./chunk.SDO3U72B.js";var d=t(()=>(__graviewPreload(import.meta.url,["./chunk.6JO5HQDR.js","./chunk.BBLIT7S7.js","./chunk.NJSK3UO2.js","./chunk.X6KYRBL6.js","./chunk.BZMQDEIY.js","./chunk.3L37FY3G.js","./chunk.FULEUL34.js","./chunk.B3WVCSW5.js","./chunk.L3WTKQQL.js","./chunk.QDWSU47A.js","./chunk.H5S7OL2U.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.OFWNMTGB.js")));function v(i,r){let e=!1,n=()=>{window.removeEventListener("online",n),e||o()},o=()=>void i().then(m=>{e||r(m)},()=>{e||window.addEventListener("online",n)});return o(),()=>{e=!0,window.removeEventListener("online",n)}}export{d as a,v as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk.KHRS2SKB.js";import"./chunk.4HRYB7HF.js";import"./chunk.25VJPUDH.js";import"./chunk.T6PU3NKP.js";import"./chunk.ELOFPE25.js";import{a as x,b as P,c as L}from"./chunk.BLUKSGI4.js";import{b as R}from"./chunk.UFDJXQQQ.js";import"./chunk.ELTV44HU.js";import"./chunk.CY3ELWCM.js";import"./chunk.RMR24LFJ.js";import"./chunk.I77ZGIFE.js";import"./chunk.OWOOKLIU.js";import"./chunk.RD2X25XB.js";import"./chunk.KMV6PJFL.js";import"./chunk.SWMDFXUX.js";import"./chunk.A3ZC2JBO.js";import"./chunk.NAD7ZXYP.js";import"./chunk.2GEJNG2U.js";import"./chunk.HJCQ6I3S.js";import"./chunk.22BZU7ME.js";import"./chunk.2N4Z5K5S.js";import"./chunk.JYFZCJ4N.js";import"./chunk.U6ZRJKVM.js";import"./chunk.PLTH2LW5.js";import"./chunk.66P5IDTH.js";import"./chunk.UQQKDBIH.js";import"./chunk.AJSUHPBE.js";import"./chunk.LAYQ5PFS.js";import"./chunk.KDXU5DT3.js";import"./chunk.O2BHPYA4.js";import"./chunk.M4AYA2PL.js";import"./chunk.H5S7OL2U.js";import"./chunk.PZQNR4KZ.js";import"./chunk.W4BKYSZX.js";import"./chunk.T6WHGKWR.js";import"./chunk.XOZU4OFA.js";import"./chunk.Y2YYH3JN.js";import"./chunk.YFVJUHAK.js";import"./chunk.NOGGSLVG.js";import"./chunk.WVUJXDXZ.js";import"./chunk.SGCW2XRC.js";import"./chunk.ZN3PUM2I.js";import"./chunk.QIPASE42.js";import"./chunk.EVBCEEQ4.js";import"./chunk.OWT3VVOT.js";import"./chunk.NHTGAP3G.js";import"./chunk.GZHZLJBF.js";import{r as T}from"./chunk.UKQUUPKE.js";import"./chunk.OJGHDWI6.js";import"./chunk.DDUCIUVW.js";import"./chunk.NUYA4BWI.js";import"./chunk.OKZT2QBM.js";import"./chunk.ACTXR2MI.js";import"./chunk.AI34V6WV.js";import"./chunk.G4ULQK64.js";import{G as S,I as $,T as p,ba as C,da as A}from"./chunk.M7RESZB6.js";import"./chunk.SDO3U72B.js";import{ia as v,id as k}from"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import{b as i}from"./chunk.AJZBJBMO.js";var r=i(S(),1);var l=i(S(),1);var g=i(p(),1);var m={font:"inherit",fontSize:"0.875rem",minHeight:24,padding:0,border:0,borderRadius:2,background:"transparent",boxShadow:"none",color:"var(--graview-accent)",textDecoration:"underline",textUnderlineOffset:3,textAlign:"start",cursor:"pointer"};var e=i(p(),1);function Q({page:n=!1,go:E,onPick:y,onDiscard:N}){let{store:d,seatTalk:c}=C(),u=$(c),D=L(),h=E??D,{keep:M}=x(h),[H,f]=(0,r.useState)(!1);A();let t=u.draft;(0,r.useEffect)(()=>f(!1),[t]),(0,r.useEffect)(()=>{n||P(!1)},[n]);let w=(0,r.useRef)(null),b=t!==null&&!n;if((0,r.useLayoutEffect)(()=>{let s=w.current;if(!b||!s?.parentElement)return;let o=[];for(let a=s.previousElementSibling;a;a=a.previousElementSibling)a instanceof HTMLElement&&!a.inert&&a.tagName!=="STYLE"&&(a.inert=!0,o.push(a));return()=>{for(let a of o)a.inert=!1}},[b]),!t)return null;let G=R(t.drawn),F=d.schema.tryDefinition(t.kind),O=d.graph.nodesOfKind(t.kind).filter(s=>v(F,s)),q=()=>{c.setDraft(null),N?.()};return(0,e.jsxs)("section",{ref:w,"data-testid":"draft-frame","data-graview-draft-frame":n?"page":"scene","aria-label":`Draft: ${t.title}`,style:n?{display:"grid",gap:12,minWidth:0}:{position:"absolute",inset:12,zIndex:k("rail"),display:"grid",gridTemplateRows:"auto auto minmax(0, 1fr)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:12,boxShadow:"var(--graview-lift-high)",overflow:"hidden",minHeight:0},children:[(0,e.jsxs)("p",{"data-testid":"draft-line",style:{...z,...n?{}:{padding:"10px 16px"}},children:[n?(0,e.jsx)("span",{children:"Draft"}):(0,e.jsxs)("span",{children:["Draft \u2014 ",(0,e.jsx)("span",{"data-testid":"draft-title",style:{color:"var(--graview-ink)",fontWeight:600},children:t.title})]}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-keep",disabled:H,title:`Keep \u201C${t.title}\u201D as a lens: a place of its own`,onClick:()=>{f(!0),M(t).finally(()=>f(!1))},style:m,children:"Keep as a lens"}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-discard",onClick:q,style:m,children:"Discard"})]}),u.draftNote?(0,e.jsx)("p",{"data-testid":"draft-note",role:"status",style:{margin:0,padding:n?0:"0 16px 8px",fontSize:"0.8125rem",color:"var(--graview-warn)"},children:u.draftNote}):(0,e.jsx)("span",{}),(0,e.jsx)("div",{"data-testid":"draft-lens","data-graview-draft":t.lens.name,role:"group","aria-label":t.title,tabIndex:0,style:n?{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",scrollbarGutter:"stable",border:"1px solid var(--graview-edge)",borderRadius:12,background:"var(--graview-panel)"}:{minHeight:0,overflow:"auto",scrollbarGutter:"stable",display:"grid",gridTemplateRows:"minmax(0, 1fr)"},onClick:s=>{let o=s.target?.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(!o||!d.graph.getNode(o))return;s.preventDefault();let a=d.graph.getNode(o);y?(c.setDraft(null),y(o)):h({to:"record",id:o,kind:a.kind,label:o,address:"",said:""})},children:(0,e.jsx)(T,{kind:t.kind,view:t.title,children:(0,e.jsx)(G,{nodes:O,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})]})}var z={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};export{Q as DraftFrame};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as k,b as A,c as L,d as _,e as E,r as B,s as V,t as H,u as N,v as q}from"./chunk.OJGHDWI6.js";import"./chunk.
|
|
1
|
+
import{a as k,b as A,c as L,d as _,e as E,r as B,s as V,t as H,u as N,v as q}from"./chunk.OJGHDWI6.js";import"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var W=["drawElementImageToTexture","copyElementImageToTexture"],S=null,P=(r,e)=>r==="texture"?{texture:e}:{destination:{texture:e}};function Z(){return typeof globalThis>"u"?void 0:globalThis}function v(r,e){let t=[],n=Z(),o=!!(n?.navigator&&"gpu"in n.navigator);o||t.push("navigator.gpu is absent \u2014 WebGPU is unavailable.");let i=r??n?.GPUQueue?.prototype??void 0,a=null;if(i){for(let d of W)if(typeof i[d]=="function"){a=d;break}}a||t.push("No element-capture method on GPUQueue. Run Chromium 147+ with --enable-blink-features=CanvasDrawElement.");let c=e??n?.HTMLCanvasElement?.prototype??void 0,l=typeof c?.updateElementGeometry=="function";l||t.push("canvas.updateElementGeometry is absent \u2014 geometry cannot be reported.");let p=typeof c?.requestPaint=="function";p||t.push("canvas.requestPaint is absent \u2014 there is no capture-safe moment to hook.");let w=!1,h="unknown";if(typeof document<"u"){let d=document.createElement("canvas");w="layoutSubtree"in d||typeof d.captureElementImage=="function","layoutSubtree"in d?h="no":typeof d.captureElementImage=="function"&&(h="yes")}return{available:a!==null,captureMethod:a,geometrySync:l,hitTestFollowsGeometry:l?h:"no",layoutSubtree:w,paintEvents:p,webgpu:o,usable:o&&a!==null,notes:t}}var g=class extends Error{constructor(t){super(`HTML-in-Canvas is unavailable:
|
|
2
2
|
${t.notes.join(`
|
|
3
3
|
`)}`);this.capabilities=t;this.name="PlatformUnavailableError"}};function G(r,e,t){let n=r;for(let o of W){let i=n[o];if(typeof i=="function"){if(S){i.call(n,{source:e},P(S,t));return}try{i.call(n,{source:e},P("texture",t)),S="texture"}catch(a){if(!(a instanceof TypeError)||!/texture/i.test(a.message))throw a;i.call(n,{source:e},P("destination",t)),S="destination"}return}}throw new g(v(r))}function M(r,e=!0){e?r.setAttribute("drawable",""):r.removeAttribute("drawable")}function F(r){let e=r.changedElements;return e?new Set(Array.from(e)):null}function ee(r,e){let t=r;if(typeof t.captureElementImage!="function")throw new g(v(void 0,r));return t.captureElementImage(e)}function O(r,e,t){let n=r;if(typeof n.updateElementGeometry!="function")throw new g(v(void 0,r));n.updateElementGeometry(e,t)}function te(r,e){r.clearElementGeometry?.(e)}function m(r){r.requestPaint?.()}function D(r,e=!0){let t=r;e?t.setAttribute("content","drawable"):t.removeAttribute("content"),"layoutSubtree"in t?t.layoutSubtree=e:e?t.setAttribute("layoutsubtree",""):t.removeAttribute("layoutsubtree")}var I=`
|
|
4
4
|
struct Plane {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v,b as w,c as x}from"./chunk.MB7LKKUD.js";import"./chunk.AI34V6WV.js";import"./chunk.G4ULQK64.js";import{G as R,Sa as g,T as y,Ua as h}from"./chunk.M7RESZB6.js";import"./chunk.SDO3U72B.js";import{ib as b,id as m}from"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import{b as p}from"./chunk.AJZBJBMO.js";var c=p(R(),1);var r=p(y(),1);function W({notices:e,anchor:n,board:a,report:i}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k,{notices:e.filter(s=>s.kind==="banner"),at:"top",anchor:n,board:a,report:i}),(0,r.jsx)(k,{notices:e.filter(s=>s.kind==="toast"),at:"foot",anchor:n,board:a,report:i})]})}var E={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"},C={info:"i",good:"\u2713",warn:"!",bad:"!"};function k({notices:e,at:n,anchor:a,board:i,report:s}){let l=(0,c.useRef)(null),t=e.length>0;return(0,c.useLayoutEffect)(()=>{let o=l.current;if(!t||!o)return;if(typeof o.showPopover=="function"&&!g(o))try{o.showPopover()}catch{}let d=()=>(n==="top"?x:w)(o,a());d(),n==="foot"&&i.hold?.(()=>o.matches(":hover")||o.contains(document.activeElement));let N=h(o);addEventListener("resize",d),addEventListener("scroll",d,!0),n==="foot"&&addEventListener(v,d);let u=typeof ResizeObserver=="function"?new ResizeObserver(d):null;return u?.observe(o),()=>{if(N(),u?.disconnect(),removeEventListener("resize",d),removeEventListener("scroll",d,!0),removeEventListener(v,d),o.isConnected&&g(o))try{o.hidePopover()}catch{}}},[t,n,a,i]),t?(0,r.jsx)("div",{ref:l,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:m("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:e.map(o=>(0,r.jsx)(O,{notice:o,board:i,report:s},o.id))}):null}var T=e=>e.split(/\s+/).filter(Boolean).map(n=>n.replace(/^Meta\+/,"\u2318").replace(/^Control\+/,"Ctrl+").replace(/^Alt\+/,"Alt+")).join(" or "),H=e=>/^.*?[.!?](?=\s|$)/.exec(e.trim())?.[0]??e.trim(),L=e=>e.from==="framework"&&(e.tone==="bad"||e.tone==="warn");function O({notice:e,board:n,report:a}){let i=e.tone??"info",s=[...e.action?[e.action]:[],...e.actions??[]],l=()=>n.dismiss(e.id);return(0,r.jsxs)("div",{"data-testid":"notice","data-kind":e.kind,"data-tone":i,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:e.kind==="banner"?"8px 10px 8px 12px":"10px 12px 10px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,r.jsx)("span",{"aria-hidden":"true","data-testid":"notice-chip",style:{width:20,height:20,borderRadius:"var(--graview-radius-sm, 6px)",flex:"0 0 auto",display:"inline-grid",placeItems:"center",fontSize:"0.75rem",fontWeight:700,lineHeight:1,color:"var(--graview-ink)",background:`color-mix(in srgb, ${E[i]} 22%, transparent)`},children:C[i]}),(0,r.jsx)("span",{"data-testid":"notice-sentence",style:{flex:"1 1 16rem",minWidth:0},children:e.sentence}),s.length>0?(0,r.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:s.map((t,o)=>t.href!==void 0?(0,r.jsx)("a",{href:t.href,...t.target?{target:t.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{t.onSelect?.(),l()},style:{...f,...o===0?S:{}},children:t.label},t.label):(0,r.jsx)("button",{type:"button","data-testid":"notice-action",...t.keys?{"aria-keyshortcuts":t.keys,title:`${t.label} \u2014 ${T(t.keys)}`}:{},onClick:()=>{l(),t.onSelect?.()},style:{...f,...o===0?S:{}},children:t.label},t.label))}):null,a&&L(e)?(0,r.jsx)("button",{type:"button","data-testid":"notice-report","aria-label":`Report this: ${H(e.sentence)}`,onClick:()=>a.tell({message:e.sentence,...e.code?{code:e.code}:{},...a.where(),version:b}),style:f,children:"Report this"}):null,(0,r.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${e.sentence}`,title:"Dismiss",onClick:l,style:z,children:"\xD7"})]})}var f={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},S={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},z={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{W as NoticeStacks,H as firstSentenceOf,L as reportable};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{a as j,b as P,c as H,d as B,e as _,f as G,g as U,h as V,i as M,k as I}from"./chunk.3L37FY3G.js";import"./chunk.AJZBJBMO.js";var te=0,ne=1,re=2,ie=3,$=1,oe=2,W=3,ae=1,se=3,de=8,z="~",C=i=>typeof i=="object"&&i!==null&&!Array.isArray(i),K=new Set(["input","select","textarea","option"]),le=new Set(["value","checked","selected"]),X=["aria-label","aria-labelledby","title"],ce=i=>X.some(t=>(i.getAttribute(t)??"").trim()!=="");function Y(i,t){let u=i.ownerDocument??i,h=t.maxNodes??5e3,y=[],v=new Map,w=new WeakMap,N={dom:i,name:"div",namespace:"html",children:[],id:z};v.set(z,N);let R=0,x=!1,S=new WeakMap,E=new Map,A=new Map,f=e=>{y.push(e),y.length>200&&y.shift(),t.onRefused?.(e)},T=()=>({dom:u.createComment(""),children:[],refused:!0}),D=(e,d)=>{if(e.namespace==="html"&&e.name&&K.has(e.name))return e.dom;if(d?.namespace==="html"&&d.name==="textarea")return d.dom},L=(e,d)=>{let o=e.dom,a=S.get(o)??o.getAttribute("role");if(a===null||!a.split(/\s+/).some(r=>H.includes(r.toLowerCase())))return void S.delete(o);if(ce(o)){S.delete(o),o.getAttribute("role")!==a&&o.setAttribute("role",a);return}S.set(o,a),o.removeAttribute("role"),d&&f({reason:"value",element:e.name,name:"role"})},l=()=>{if(A.size===0)return;let e=new Set,d=o=>{for(let a of o.children){if(a.refused||a.text)continue;let r=a.dom.getAttribute("id");r&&e.add(r),d(a)}};d(N);for(let[o,a]of A){if(o.id===void 0||v.get(o.id)!==o){A.delete(o);continue}let r=o.dom;for(let[n,p]of a){let c=p.value.split(/\s+/).filter(b=>b!==""),g=c.filter(b=>!e.has(b));if(c.length>0&&g.length===0){if(p.drawn)continue;p.drawn=!0,r.setAttribute(n,p.value),L(o,!1)}else p.drawn&&(p.drawn=!1,r.removeAttribute(n),f({reason:"reference",element:o.name,name:n,ids:g.length>0?g:c}),L(o,!0))}}},s=(e,d,o,a=!0)=>{let r=e.dom;if(o!=null&&typeof o!="string")return f({reason:"value",element:e.name,name:d});let n=I(e.namespace,e.name,d,o??null,t);if("refused"in n){let b=I(e.namespace,e.name,d,null,t);return"refused"in b||r.removeAttribute(b.name),!("refused"in b)&&b.name==="role"&&S.delete(r),f(n.refused)}for(let b of n.dropped??[])f(b);let p=e.namespace==="html"&&le.has(n.name)&&K.has(e.name),c=r,g=p?n.name==="value"?c.value:n.name==="checked"?c.checked:c.selected:void 0;if(n.name==="role"&&S.delete(r),B.includes(n.name)){let b=A.get(e)??new Map;n.value===null?b.delete(n.name):b.set(n.name,{value:n.value,drawn:!0}),b.size>0?A.set(e,b):A.delete(e)}n.value===null?r.removeAttribute(n.name):r.setAttribute(n.name,n.value),a&&(n.name==="role"||X.includes(n.name))&&L(e,n.name==="role"),t.onAttribute?.(r,n.name),p&&(n.name==="value"&&"value"in c?(c.value=n.value??"",g!==c.value&&t.onFieldSet?.(r)):n.name==="checked"&&"checked"in c?(c.checked=n.value!==null,g!==c.checked&&t.onFieldSet?.(r)):n.name==="selected"&&"selected"in c&&(c.selected=n.value!==null,g!==c.selected&&t.onFieldSet?.(r.parentElement?.closest("select")??r)))},m=e=>{if(!e.refused){R-=1,e.id!==void 0&&v.delete(e.id);for(let d of e.children)m(d)}},k=(e,d)=>{if(!C(e)||typeof e.id!="string"||v.has(e.id))return f({reason:"record"}),T();if(R>=h)return f({reason:"budget"}),x||(x=!0,t.onOverBudget?.()),T();let o=e.id;if(e.type===de)return T();if(e.type===se){if(M(d.namespace,d.name))return f({reason:"child",element:d.name}),T();let c=u.createTextNode(String(e.data??"").slice(0,_)),g={dom:c,children:[],text:!0,id:o,parent:d};return v.set(o,g),w.set(c,o),R+=1,g}if(e.type!==ae)return f({reason:"record"}),T();let a=String(e.element);if(M(d.namespace,d.name))return f({reason:"child",element:a}),T();let r=V(a,d.namespace);if("refused"in r)return f(r.refused),T();let n=u.createElementNS(r.namespace==="svg"?U:G,r.name);r.as&&n.setAttribute("data-graview-as",r.as),r.namespace==="html"&&r.name==="img"&&n.setAttribute("referrerpolicy","no-referrer"),r.namespace==="html"&&r.name==="a"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("referrerpolicy","no-referrer"));let p={dom:n,name:r.name,namespace:r.namespace,children:[],id:o,parent:d};if(v.set(o,p),w.set(n,o),R+=1,C(e.attributes)){for(let[c,g]of Object.entries(e.attributes))s(p,c,g,!1);L(p,!0)}if(t.decorate?.(n,r.name,r.namespace),C(e.properties))for(let c of Object.keys(e.properties))f({reason:"attribute",element:r.name,name:c});if(C(e.eventListeners))for(let c of Object.keys(e.eventListeners))e.eventListeners[c]!=null&&f({reason:"attribute",element:r.name,name:`on${c}`});if(Array.isArray(e.children))for(let c of e.children){let g=k(c,p);p.children.push(g),n.appendChild(g.dom)}return p},O=e=>{if(!Array.isArray(e))return f({reason:"record"});let[d,o]=e,a=typeof o=="string"?v.get(o):void 0;if(!a)return f({reason:"record"});switch(d){case te:{if(a.text)return f({reason:"record"});let r=Number(e[3]),n=Number.isInteger(r)&&r>=0&&r<=a.children.length?r:a.children.length,p=e[2],c=C(p)&&typeof p.id=="string"?E.get(p.id):void 0,g;c&&c.parent?.namespace===a.namespace&&!M(a.namespace,a.name)?(E.delete(p.id),c.parent=a,g=c):g=k(p,a),a.dom.insertBefore(g.dom,a.children[n]?.dom??null),a.children.splice(n,0,g),a.namespace==="html"&&a.name==="textarea"&&t.onFieldSet?.(a.dom);return}case ne:{let r=Number(e[2]),n=a.children[r];if(!n)return f({reason:"record"});a.children.splice(r,1),n.dom.parentNode?.removeChild(n.dom),n.id!==void 0&&!n.refused?E.set(n.id,n):m(n);return}case re:{if(!a.text)return f({reason:"record"});a.dom.data=String(e[2]??"").slice(0,_);let r=D(a,a.parent);r&&t.onFieldSet?.(r);return}case ie:{if(a===N||a.text)return f({reason:"record"});let r=String(e[2]),n=e[4]??$;return n===oe?s(a,r,e[3]):f(n===$||n===W?{reason:"attribute",element:a.name,name:n===W?`on${r}`:r}:{reason:"record"})}default:return f({reason:"record"})}};return{apply(e,d){if(!Array.isArray(e))return f({reason:"record"}),!0;try{for(let o=0;o<e.length;o+=1){if(d&&o%32===0&&d())return!1;O(e[o])}return!0}finally{for(let o of E.values())m(o);E.clear(),l()}},get refused(){return y},get size(){return R},idOf:e=>w.get(e),elementOf(e){let d=v.get(e);return d&&!d.text&&d!==N?d.dom:void 0},dispose(){for(let e of N.children)m(e);for(N.children.length=0;i.firstChild;)i.removeChild(i.firstChild)}}}var J=["https:","mailto:","tel:"];function q(i){if(!(typeof i!="string"||i.length>2e3||/[\s<>"]/.test(i.trim())||i.trim()!==i))try{let t=new URL(i);return!J.includes(t.protocol)||t.protocol==="https:"&&(t.hostname===""||t.username!==""||t.password!=="")?void 0:t.href}catch{return}}function ue(i){let t=new Set,u=h=>{if(typeof h!="string"||!/^(https|mailto|tel):/i.test(h))return;let y=q(h);y&&t.add(y)};for(let h of[...i?.node?[i.node]:[],...i?.nodes??[]])for(let[y,v]of Object.entries(h))y==="id"||y==="kind"||(Array.isArray(v)?v.forEach(u):u(v));return t}function Q(i){return(i??[]).flatMap(t=>{try{let u=new URL(t);return u.protocol==="https:"&&u.hostname!==""&&u.username===""&&u.password===""?[u.origin]:[]}catch{return[]}})}function fe(i,t){let u=q(i);if(u&&(t.handed.has(u)||u.startsWith("https:")&&Q(t.origins).includes(new URL(u).origin)))return u}function me(i,t){let u=i.length>120?`${i.slice(0,119)}\u2026`:i,h="";try{h=new URL(i).protocol}catch{h=""}if(!J.includes(h))return`The link "${u}" was not drawn: a view links only to an https:, mailto: or tel: address.`;let y=Q(t);return`The link "${u}" was not drawn: it is no address this view was handed. A view links out only to an address a record it was shown holds (a url field), as the record holds it${y.length>0?`, or an https: address on ${y.join(", ")}`:""}; a record or a place of this app is <a data-record> or <a data-place>.`}var F=180,pe=`
|
|
2
|
+
:host { display: block; position: relative; contain: layout paint style; isolation: isolate; overflow: clip; min-width: 0; }
|
|
3
|
+
:host(:focus-within) { overflow-clip-margin: var(--graview-ring-reach, 4px); }
|
|
4
|
+
[data-graview-view-root] { display: flow-root; color: var(--graview-ink, CanvasText); font-family: var(--graview-font-body, system-ui, sans-serif); line-height: 1.45; }
|
|
5
|
+
:where([data-graview-view-root]) :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; text-align: inherit; appearance: none; cursor: pointer; }
|
|
6
|
+
:where([data-graview-view-root]) :where(a[data-graview-link]) { color: inherit; text-decoration: none; }
|
|
7
|
+
[data-graview-view-root] :is([data-graview-link], [data-graview-press]) { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: rgb(128 128 128 / 0.16); }
|
|
8
|
+
[data-graview-view-root] :focus-visible { outline: max(2px, var(--graview-focus-width, 2px)) solid var(--graview-focus-color, var(--graview-accent, Highlight)) !important; outline-offset: var(--graview-focus-offset, 2px) !important; }
|
|
9
|
+
[data-graview-view-root] [data-graview-ring-inside]:focus-visible { outline-offset: calc(-1 * max(2px, var(--graview-focus-width, 2px))) !important; }
|
|
10
|
+
[data-graview-view-root] .graview-sr { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
|
|
11
|
+
[data-graview-view-root] a[href]:not([data-graview-link])::after { content: " \u2197" !important; content: " \u2197" / " (opens in a new tab)" !important; }
|
|
12
|
+
[data-graview-view-root][data-graview-motion="fade"] { transition: opacity ${F}ms ease; }
|
|
13
|
+
[data-graview-view-root][data-graview-fade] { opacity: 0; }
|
|
14
|
+
@layer graview-motion { @media (prefers-reduced-motion: reduce) { [data-graview-view-root], [data-graview-view-root] *, [data-graview-view-root] ::before, [data-graview-view-root] ::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-timeline: auto !important; transition-duration: 1ms !important; scroll-behavior: auto !important; } } }
|
|
15
|
+
`,Z=4,ge=16;function he(i){let t=i.ownerDocument.defaultView?.getComputedStyle(i);if(!t)return Z;let u=Number.parseFloat(t.outlineWidth)||0,h=Math.max(0,Number.parseFloat(t.outlineOffset)||0);return Math.min(ge,Math.max(Z,Math.ceil(u+h)))}var ye=new Set(["Enter"," ","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]),ee=["click","input","change","keydown"];function Ae(i,t){let u=i.ownerDocument,h=u.createElement("style");h.setAttribute("data-graview-region",""),h.textContent=pe;let y=u.createElement("style");y.setAttribute("data-graview-view-theme","");let v=u.createElement("style");v.setAttribute("data-graview-view-style","");let w=u.createElement("div");w.setAttribute("data-graview-view-root",""),i.append(h,y,v,w);let N=u.defaultView,R,x,S=()=>{x!==void 0&&clearTimeout(x),x=void 0,R=void 0,w.removeAttribute("data-graview-fade")},E=Y(w,{origin:t.origin,...t.asset?{asset:t.asset}:{},...t.imageOrigins?{imageOrigins:t.imageOrigins}:{},...t.picture?{picture:t.picture}:{},...t.link?{link:t.link}:{},...t.onRefused?{onRefused:t.onRefused}:{},...t.maxNodes!==void 0?{maxNodes:t.maxNodes}:{},...t.onOverBudget?{onOverBudget:t.onOverBudget}:{},decorate:(l,s,m)=>{m==="html"&&s==="button"&&l.setAttribute("type","button"),m==="html"&&(s==="input"||s==="textarea"||s==="select")&&l.setAttribute("autocomplete","off"),t.decorate?.(l,s,m)},...t.onFieldSet?{onFieldSet:t.onFieldSet}:{},...t.onAttribute?{onAttribute:t.onAttribute}:{}}),A=[],f="",T=l=>{for(let s=l.composedPath()[0];s&&s!==w&&s!==i;s=s.parentNode)if(s.nodeType===1&&E.idOf(s)!==void 0)return s},D=l=>{let s=T(l);if(!s||l.type==="keydown"&&!ye.has(l.key))return;let m=t.before?.(l,s,w);if(m===!1)return;let k=s,O=s.namespaceURI==="http://www.w3.org/1999/xhtml"&&["input","select","textarea"].includes(s.localName);t.send({type:"dom-event",target:E.idOf(s),event:l.type,...O?{value:String(k.value??"")}:{},...O&&(k.type==="checkbox"||k.type==="radio")?{checked:k.checked}:{},...l.type==="keydown"?{key:l.key}:{},...m??{}});let e=l.type==="keydown"?l.key:void 0;(e==="Enter"||e===" ")&&s.hasAttribute("data-graview-press")&&l.composedPath()[0]===s&&(l.preventDefault(),t.send({type:"dom-event",target:E.idOf(s),event:"click"}))};for(let l of ee)i.addEventListener(l,D);i.addEventListener("toggle",D,!0);let L=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("overflow-clip-margin","4px");return i.addEventListener("focusin",l=>{let s=l.composedPath()[0],m=i.host;if(!s||s.nodeType!==1||!w.contains(s))return;let k=he(s);if(L){m.style.setProperty("--graview-ring-reach",`${k}px`);return}let O=m.getBoundingClientRect(),e=s.getBoundingClientRect(),d=k*(m.offsetWidth>0?O.width/m.offsetWidth:1),o=e.left-O.left<d||O.right-e.right<d||e.top-O.top<d||O.bottom-e.bottom<d;s.toggleAttribute("data-graview-ring-inside",o)}),{apply(l,s){let m=i.activeElement,k=m?E.idOf(m):void 0,O=E.apply(l,s);if(k!==void 0&&i.activeElement!==m){let e=E.elementOf(k);e?.isConnected&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}return R!==void 0&&(x!==void 0&&clearTimeout(x),x=setTimeout(S,Math.max(0,F-(Date.now()-R)))),O},theme(l){y.textContent=l?j(l).css:""},motion(l){l==="fade"?w.setAttribute("data-graview-motion","fade"):(w.removeAttribute("data-graview-motion"),S())},fade(){w.getAttribute("data-graview-motion")!=="fade"||w.childNodes.length===0||N?.matchMedia?.("(prefers-reduced-motion: reduce)").matches||(R===void 0&&w.setAttribute("data-graview-fade",""),R=Date.now(),x!==void 0&&clearTimeout(x),x=setTimeout(S,F*4))},style(l){let s=P(l);A.length=0;for(let m of s.refused)A.push({reason:"css",name:"stylesheet",css:m}),A.length>200&&A.shift();f=s.css,v.textContent=f},renderer:E,get refused(){return[...E.refused,...A]},get css(){return f},dispose(){for(let l of ee)i.removeEventListener(l,D);i.removeEventListener("toggle",D,!0),S(),E.dispose(),i.replaceChildren()}}}export{F as FADE_MS,pe as REGION_CSS,Ae as createOpenDrawing,ue as handedLinks,fe as judgeLink,me as linkRefusedWords,he as ringReach};
|