@gramlot/gramlot 0.3.33 → 0.3.34
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/components/audio/__init__.py +1 -1
- package/dist/components/audio/assets/collection.js +2 -2
- package/dist/components/audio/assets/index.js +1 -1
- package/dist/components/charts/__init__.py +2 -2
- package/dist/components/charts/assets/collection.js +10 -44
- package/dist/components/charts/assets/index.js +1 -1
- package/dist/components/charts/assets/modules/chunk-USZCUBTC.js +1 -0
- package/dist/components/charts/assets/modules/echarts-gl.min-N6L67H2M.js +4282 -0
- package/dist/components/charts/assets/modules/echarts.esm.min-VHLRZDVQ.js +61 -0
- package/dist/components/charts/assets/modules/{plotly.min-4LB7HE7P.js → plotly.min-SSDU2DOH.js} +1 -1
- package/dist/components/charts/assets/modules/{uPlot.esm-5JJNHHRF.js → uPlot.esm-Q2UYUQHJ.js} +1 -1
- package/dist/components/charts/assets/modules/{uPlot.min-N3E3FA74.js → uPlot.min-XXHNQFXH.js} +1 -1
- package/dist/components/charts/assets/modules/{vega.module-2QCOVQ3A.js → vega.module-Y5CWNSZO.js} +1 -1
- package/dist/components/chat/__init__.py +1 -1
- package/dist/components/chat/assets/collection.js +3 -3
- package/dist/components/chat/assets/index.js +1 -1
- package/dist/components/drawing/__init__.py +1 -1
- package/dist/components/drawing/assets/collection.js +3 -24
- package/dist/components/drawing/assets/index.js +1 -1
- package/dist/components/editors/__init__.py +2 -2
- package/dist/components/editors/assets/collection.js +2 -47
- package/dist/components/editors/assets/index.js +1 -1
- package/dist/components/editors/assets/modules/{jodit-engine-MTSA4GZ3.js → jodit-engine-CXRSFV47.js} +6 -6
- package/dist/components/grid/__init__.py +2 -2
- package/dist/components/grid/assets/collection.js +6 -28
- package/dist/components/grid/assets/index.js +1 -1
- package/dist/components/grid/assets/modules/{browser-LVJHKBBV.js → browser-Y2BRNI3P.js} +1 -1
- package/dist/components/grid/assets/modules/chunk-BLMUM44K.js +1 -0
- package/dist/components/grouplets/__init__.py +1 -1
- package/dist/components/grouplets/assets/collection.js +3 -3
- package/dist/components/grouplets/assets/index.js +1 -1
- package/dist/components/inputs/__init__.py +1 -1
- package/dist/components/inputs/assets/collection.js +8 -65
- package/dist/components/inputs/assets/index.js +1 -1
- package/dist/components/layout/__init__.py +1 -1
- package/dist/components/layout/assets/collection.js +9 -30
- package/dist/components/layout/assets/index.js +1 -1
- package/dist/components/selection_trial/__init__.py +1 -1
- package/dist/components/selection_trial/assets/collection.js +3 -3
- package/dist/components/selection_trial/assets/index.js +1 -1
- package/dist/components/tree/__init__.py +1 -1
- package/dist/components/tree/assets/collection.js +6 -27
- package/dist/components/tree/assets/index.js +1 -1
- package/dist/components/typst/__init__.py +1 -1
- package/dist/components/typst/assets/collection.js +3 -3
- package/dist/components/typst/assets/index.js +1 -1
- package/dist/components/uploads/__init__.py +1 -1
- package/dist/components/uploads/assets/collection.js +3 -30
- package/dist/components/uploads/assets/index.js +1 -1
- package/dist/components/vizabi/__init__.py +1 -1
- package/dist/components/vizabi/assets/collection.js +3 -21
- package/dist/components/vizabi/assets/index.js +1 -1
- package/dist/gramlot.js +1577 -49
- package/dist/gramlot.min.js +49 -48
- package/dist/libraries.json +126 -0
- package/dist/runtime-notices.json +4 -0
- package/dist/standard-collections.js +1 -1
- package/package.json +2 -2
- package/src/components/chart-engines/echarts.js +10 -4
- package/src/components/chart-engines/plotly.js +3 -2
- package/src/components/chart-engines/uplot.js +5 -3
- package/src/components/chart-engines/vega.js +2 -1
- package/src/components/chart-gauge.js +7 -3
- package/src/components/chart-renderer.js +1 -1
- package/src/components/code-mirror.js +2 -1
- package/src/components/grid-tools.js +2 -1
- package/src/components/html-editor.js +2 -1
- package/src/components/markdown-editor.js +2 -1
- package/src/components/typst-preview.js +2 -1
- package/src/index.d.ts +16 -0
- package/src/index.js +5 -0
- package/src/libraries.js +83 -0
- package/src/server/gramlot-server.d.ts +8 -0
- package/src/server/gramlot-server.js +40 -4
- package/src/shared-modules.js +79 -0
- package/dist/components/charts/assets/modules/chunk-2CCTLZE7.js +0 -76
- package/dist/components/charts/assets/modules/chunk-RMRBEYTI.js +0 -1
- package/dist/components/charts/assets/modules/echarts-gl-CXVTZA6G.js +0 -4409
- package/dist/components/grid/assets/modules/chunk-RMRBEYTI.js +0 -1
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
var So=Object.create;var Bn=Object.defineProperty;var Oo=Object.getOwnPropertyDescriptor;var Io=Object.getOwnPropertyNames;var Bo=Object.getPrototypeOf,Mo=Object.prototype.hasOwnProperty;var Xe=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Xi=(t,e)=>{for(var r in e)Bn(t,r,{get:e[r],enumerable:!0})},In=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Io(e))!Mo.call(t,i)&&i!==r&&Bn(t,i,{get:()=>e[i],enumerable:!(n=Oo(e,i))||n.enumerable});return t},Yt=(t,e,r)=>(In(t,e,"default"),r&&In(r,e,"default")),Gi=(t,e,r)=>(r=t!=null?So(Bo(t)):{},In(e||!t||!t.__esModule?Bn(r,"default",{value:t,enumerable:!0}):r,t));var ht=Xe(se=>{"use strict";function su(t,e,r){if(r===void 0&&(r=Array.prototype),t&&typeof r.find=="function")return r.find.call(t,e);for(var n=0;n<t.length;n++)if(pt(t,n)){var i=t[n];if(e.call(void 0,i,n,t))return i}}function xt(t,e){return e===void 0&&(e=Object),e&&typeof e.getOwnPropertyDescriptors=="function"&&(t=e.create(null,e.getOwnPropertyDescriptors(t))),e&&typeof e.freeze=="function"?e.freeze(t):t}function pt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function au(t,e){if(t===null||typeof t!="object")throw new TypeError("target is not an object");for(var r in e)pt(e,r)&&(t[r]=e[r]);return t}var Ss=xt({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function ou(t){return pt(Ss,t.toLowerCase())}var Os=xt({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function lu(t){return pt(Os,t.toLowerCase())}var ir=xt({script:!1,style:!1,textarea:!0,title:!0});function uu(t){var e=t.toLowerCase();return pt(ir,e)&&!ir[e]}function cu(t){var e=t.toLowerCase();return pt(ir,e)&&ir[e]}function Is(t){return t===sr.HTML}function fu(t){return Is(t)||t===sr.XML_XHTML_APPLICATION}var sr=xt({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),du=Object.keys(sr).map(function(t){return sr[t]});function pu(t){return du.indexOf(t)>-1}var hu=xt({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});se.assign=au;se.find=su;se.freeze=xt;se.HTML_BOOLEAN_ATTRIBUTES=Ss;se.HTML_RAW_TEXT_ELEMENTS=ir;se.HTML_VOID_ELEMENTS=Os;se.hasDefaultHTMLNamespace=fu;se.hasOwn=pt;se.isHTMLBooleanAttribute=ou;se.isHTMLRawTextElement=uu;se.isHTMLEscapableRawTextElement=cu;se.isHTMLMimeType=Is;se.isHTMLVoidElement=lu;se.isValidMimeType=pu;se.MIME_TYPE=sr;se.NAMESPACE=hu});var cr=Xe(ur=>{"use strict";var mu=ht();function Ms(t,e){t.prototype=Object.create(Error.prototype,{constructor:{value:t},name:{value:t.name,enumerable:!0,writable:e}})}var or=mu.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),Rs=Object.keys(or);function Ls(t){return typeof t=="number"&&t>=1&&t<=25}function _u(t){return typeof t=="string"&&t.substring(t.length-or.Error.length)===or.Error}function lr(t,e){Ls(t)?(this.name=Rs[t],this.message=e||""):(this.message=t,this.name=_u(e)?e:or.Error),Error.captureStackTrace&&Error.captureStackTrace(this,lr)}Ms(lr,!0);Object.defineProperties(lr.prototype,{code:{enumerable:!0,get:function(){var t=Rs.indexOf(this.name);return Ls(t)?t:0}}});var $s={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},ti=Object.entries($s);for(ar=0;ar<ti.length;ar++)Bs=ti[ar][0],lr[Bs]=ti[ar][1];var Bs,ar;function ri(t,e,r){this.message=t,this.locator=e,this.cause=r,Error.captureStackTrace&&Error.captureStackTrace(this,ri)}Ms(ri);ur.DOMException=lr;ur.DOMExceptionName=or;ur.ExceptionCode=$s;ur.ParseError=ri});var ui=Xe(C=>{"use strict";function Vs(t){try{typeof t!="function"&&(t=RegExp);var e=new t("\u{1D306}","u").exec("\u{1D306}");return!!e&&e[0].length===2}catch{}return!1}var Nt=Vs();function et(t){if(t.source[0]!=="[")throw new Error(t+" can not be used with chars");return t.source.slice(1,t.source.lastIndexOf("]"))}function Tt(t,e){if(t.source[0]!=="[")throw new Error("/"+t.source+"/ can not be used with chars_without");if(!e||typeof e!="string")throw new Error(JSON.stringify(e)+" is not a valid search");if(t.source.indexOf(e)===-1)throw new Error('"'+e+'" is not is /'+t.source+"/");if(e==="-"&&t.source.indexOf(e)!==1)throw new Error('"'+e+'" is not at the first postion of /'+t.source+"/");return new RegExp(t.source.replace(e,""),Nt?"u":"")}function O(t){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(r){var n=typeof r=="string";if(n&&e===void 0&&r==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return n?r:r.source}).join(""),Nt?"u":"")}function x(t){if(arguments.length===0)throw new Error("no parameters provided");return O.apply(x,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var gu="\uFFFD",tt=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;Nt&&(tt=O("[",et(tt),"\\u{10000}-\\u{10FFFF}","]"));var bu=new RegExp("[^"+et(tt)+"]",Nt?"u":""),Qr=/[\x20\x09\x0D\x0A]/,wu=et(Qr),U=O(Qr,"+"),q=O(Qr,"*"),fr=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;Nt&&(fr=O("[",et(fr),"\\u{10000}-\\u{10FFFF}","]"));var yu=et(fr),si=O("[",yu,et(/[-.0-9\xB7]/),et(/[\u0300-\u036F\u203F-\u2040]/),"]"),_e=O(fr,si,"*"),vu=O("^",_e,"$"),Us=O(si,"+"),ku=O("&",_e,";"),Eu=x(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),dr=x(ku,"|",Eu),pr=O("%",_e,";"),ai=x(O('"',x(/[^%&"]/,"|",pr,"|",dr),"*",'"'),"|",O("'",x(/[^%&']/,"|",pr,"|",dr),"*","'")),Du=x('"',x(/[^<&"]/,"|",dr),"*",'"',"|","'",x(/[^<&']/,"|",dr),"*","'"),Au=Tt(fr,":"),xu=Tt(si,":"),ni=O(Au,xu,"*"),Tu=O("^",ni,"$"),hr=O(ni,x(":",ni),"?"),Cu=O("^",hr,"$"),Nu=O("(",hr,")"),Ct=x(/"[^"]*"|'[^']*'/),Su=O(/^<\?/,"(",_e,")",x(U,"(?!",Qr,")(",tt,"*?)"),"?",/\?>/),Fs=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,mr=x('"',Fs,'*"',"|","'",Tt(Fs,"'"),"*'"),zs="<!--",Hs="-->",Ou=O(zs,x(Tt(tt,"-"),"|",O("-",Tt(tt,"-"))),"*",Hs),Ps="#PCDATA",Iu=x(O(/\(/,q,Ps,x(q,/\|/,q,hr),"*",q,/\)\*/),"|",O(/\(/,q,Ps,q,/\)/)),Bu=/[?*+]?/,Mu=O(/\([^>]+\)/,Bu),Ru=x("EMPTY","|","ANY","|",Iu,"|",Mu),Lu="<!ELEMENT",$u=O(Lu,U,x(hr,"|",pr),U,x(Ru,"|",pr),q,">"),Uu=O("NOTATION",U,/\(/,q,_e,x(q,/\|/,q,_e),"*",q,/\)/),Fu=O(/\(/,q,Us,x(q,/\|/,q,Us),"*",q,/\)/),Pu=x(Uu,"|",Fu),qu=x(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",Pu),ju=x(/#REQUIRED|#IMPLIED/,"|",x(x("#FIXED",U),"?",Du)),Vu=x(U,_e,U,qu,U,ju),zu="<!ATTLIST",Hu=O(zu,U,_e,Vu,"*",q,">"),ii="about:legacy-compat",Wu=x('"'+ii+'"',"|","'"+ii+"'"),oi="SYSTEM",en="PUBLIC",tn=x(x(oi,U,Ct),"|",x(en,U,mr,U,Ct)),Xu=O("^",x(x(oi,U,"(?<SystemLiteralOnly>",Ct,")"),"|",x(en,U,"(?<PubidLiteral>",mr,")",U,"(?<SystemLiteral>",Ct,")"))),Gu=O("^",mr,"$"),Yu=O("^",Ct,"$"),Zu=x(U,"NDATA",U,_e),Ju=x(ai,"|",x(tn,Zu,"?")),Ws="<!ENTITY",Ku=O(Ws,U,_e,U,Ju,q,">"),Qu=x(ai,"|",tn),ec=O(Ws,U,"%",U,_e,U,Qu,q,">"),tc=x(Ku,"|",ec),rc=O(en,U,mr),nc=O("<!NOTATION",U,_e,U,x(tn,"|",rc),q,">"),li=O(q,"=",q),qs=/1[.]\d+/,ic=O(U,"version",li,x("'",qs,"'","|",'"',qs,'"')),js=/[A-Za-z][-A-Za-z0-9._]*/,sc=x(U,"encoding",li,x('"',js,'"',"|","'",js,"'")),ac=x(U,"standalone",li,x("'",x("yes","|","no"),"'","|",'"',x("yes","|","no"),'"')),oc=O(/^<\?xml/,ic,sc,"?",ac,"?",q,/\?>/),lc="<!DOCTYPE",uc="<![CDATA[",cc="]]>",fc=/<!\[CDATA\[/,dc=/\]\]>/,pc=O(tt,"*?",dc),hc=O(fc,pc);C.chars=et;C.chars_without=Tt;C.detectUnicodeSupport=Vs;C.reg=O;C.regg=x;C.ABOUT_LEGACY_COMPAT=ii;C.ABOUT_LEGACY_COMPAT_SystemLiteral=Wu;C.AttlistDecl=Hu;C.CDATA_START=uc;C.CDATA_END=cc;C.CDSect=hc;C.Char=tt;C.Comment=Ou;C.COMMENT_START=zs;C.COMMENT_END=Hs;C.DOCTYPE_DECL_START=lc;C.elementdecl=$u;C.EntityDecl=tc;C.EntityValue=ai;C.ExternalID=tn;C.ExternalID_match=Xu;C.Name=_e;C.Name_exact=vu;C.NCName_exact=Tu;C.NotationDecl=nc;C.Reference=dr;C.PEReference=pr;C.PI=Su;C.PUBLIC=en;C.PubidLiteral=mr;C.PubidLiteral_match=Gu;C.QName=hr;C.QName_exact=Cu;C.QName_group=Nu;C.S=U;C.SChar_s=wu;C.S_OPT=q;C.SYSTEM=oi;C.SystemLiteral=Ct;C.SystemLiteral_match=Yu;C.InvalidChar=bu;C.UNICODE_REPLACEMENT_CHARACTER=gu;C.UNICODE_SUPPORT=Nt;C.XMLDecl=oc});var wi=Xe(z=>{"use strict";var ve=ht(),Oe=ve.find,mc=ve.hasDefaultHTMLNamespace,Ot=ve.hasOwn,_c=ve.isHTMLMimeType,gc=ve.isHTMLRawTextElement,bc=ve.isHTMLVoidElement,_r=ve.MIME_TYPE,Ie=ve.NAMESPACE,fe=Symbol(),Qs=cr(),w=Qs.DOMException,ue=Qs.DOMExceptionName,V=ui();function pe(t){if(t!==fe)throw new TypeError("Illegal constructor")}function wc(t){return t!==""}function yc(t){return t?t.split(/[\t\n\f\r ]+/).filter(wc):[]}function vc(t,e){return Ot(t,e)||(t[e]=!0),t}function Xs(t){if(!t)return[];var e=yc(t);return Object.keys(e.reduce(vc,{}))}function kc(t){return function(e){return t&&t.indexOf(e)!==-1}}function ea(t){if(!V.QName_exact.test(t))throw new w(w.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+t+'"')}function fi(t,e){ea(e),t=t||null;var r=null,n=e;if(e.indexOf(":")>=0){var i=e.split(":");r=i[0],n=i[1]}if(r!==null&&t===null)throw new w(w.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(r==="xml"&&t!==ve.NAMESPACE.XML)throw new w(w.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((r==="xmlns"||e==="xmlns")&&t!==ve.NAMESPACE.XMLNS)throw new w(w.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(t===ve.NAMESPACE.XMLNS&&r!=="xmlns"&&e!=="xmlns")throw new w(w.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[t,r,n]}function Mt(t,e){for(var r in t)Ot(t,r)&&(e[r]=t[r])}function he(t,e){var r=t.prototype;if(!(r instanceof e)){let n=function(){};n.prototype=e.prototype,n=new n,Mt(r,n),t.prototype=r=n}r.constructor!=t&&(typeof t!="function"&&console.error("unknown Class:"+t),r.constructor=t)}var me={},ye=me.ELEMENT_NODE=1,It=me.ATTRIBUTE_NODE=2,gr=me.TEXT_NODE=3,ta=me.CDATA_SECTION_NODE=4,ra=me.ENTITY_REFERENCE_NODE=5,Ec=me.ENTITY_NODE=6,di=me.PROCESSING_INSTRUCTION_NODE=7,pi=me.COMMENT_NODE=8,St=me.DOCUMENT_NODE=9,na=me.DOCUMENT_TYPE_NODE=10,rt=me.DOCUMENT_FRAGMENT_NODE=11,Dc=me.NOTATION_NODE=12,j=ve.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function ia(t,e){if(e.length<t.length)return ia(e,t);var r=null;for(var n in t){if(t[n]!==e[n])return r;r=t[n]}return r}function Gs(t){return t.guid||(t.guid=Math.random()),t.guid}function J(){}J.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t){var e;typeof t=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:t}:t?e={requireWellFormed:!!t.requireWellFormed,splitCDATASections:t.splitCDATASections!==!1,nodeFilter:t.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};for(var r=[],n=0;n<this.length;n++)bi(this[n],r,null,e);return r.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}};J.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Se(t,e){this._node=t,this._refresh=e,an(this)}function an(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var r=t._refresh(t._node);if(ma(t,"length",r.length),!t.$$length||r.length<t.$$length)for(var n=r.length;n in t;n++)Ot(t,n)&&delete t[n];Mt(r,t),t._inc=e}}Se.prototype.item=function(t){return an(this),this[t]||null};he(Se,J);function Bt(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function sa(t,e){for(var r=0;r<t.length;){if(t[r]===e)return r;r++}}function hi(t,e,r){if(!e)return t._noNsIndex;var n=t._nsIndex[e];return!n&&r&&(n=t._nsIndex[e]=Object.create(null)),n}function Ac(t,e,r){var n=hi(t,e,!1),i=n&&n[r];return i||null}function xc(t,e){hi(t,e.namespaceURI,!0)[e.localName]=e}function Tc(t,e){var r=hi(t,e.namespaceURI,!1);r&&delete r[e.localName]}function Cc(t,e,r,n){if(n?e[sa(e,n)]=r:(e[e.length]=r,e.length++),xc(e,r),t){r.ownerElement=t;var i=t.ownerDocument;i&&(n&&la(i,t,n),Nc(i,t,r))}}function Ys(t,e,r){var n=sa(e,r);if(n>=0){for(var i=e.length-1;n<=i;)e[n]=e[++n];if(e.length=i,Tc(e,r),t){var s=t.ownerDocument;s&&la(s,t,r),r.ownerElement=null}}}Bt.prototype={length:0,item:J.prototype.item,getNamedItem:function(t){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());for(var e=0;e<this.length;){var r=this[e];if(r.nodeName===t)return r;e++}return null},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!==this._ownerElement)throw new w(w.INUSE_ATTRIBUTE_ERR);var r=Ac(this,t.namespaceURI,t.localName);return r===t?t:(Cc(this._ownerElement,this,t,r),r)},setNamedItemNS:function(t){return this.setNamedItem(t)},removeNamedItem:function(t){var e=this.getNamedItem(t);if(!e)throw new w(w.NOT_FOUND_ERR,t);return Ys(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var r=this.getNamedItemNS(t,e);if(!r)throw new w(w.NOT_FOUND_ERR,t?t+" : "+e:e);return Ys(this._ownerElement,this,r),r},getNamedItemNS:function(t,e){t||(t=null);for(var r=0;r<this.length;){var n=this[r];if(n.localName===e&&n.namespaceURI===t)return n;r++}return null}};Bt.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function aa(){}aa.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,r){var n=_r.XML_APPLICATION;t===Ie.HTML?n=_r.XML_XHTML_APPLICATION:t===Ie.SVG&&(n=_r.XML_SVG_IMAGE);var i=new qe(fe,{contentType:n});if(i.implementation=this,i.childNodes=new J,i.doctype=r||null,r&&i.appendChild(r),e){var s=i.createElementNS(t,e);i.appendChild(s)}return i},createDocumentType:function(t,e,r,n){ea(t);var i=new un(fe);return i.name=t,i.nodeName=t,i.publicId=e||"",i.systemId=r||"",i.internalSubset=n||"",i.childNodes=new J,i},createHTMLDocument:function(t){var e=new qe(fe,{contentType:_r.HTML});if(e.implementation=this,e.childNodes=new J,t!==!1){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var r=e.createElement("html");e.appendChild(r);var n=e.createElement("head");if(r.appendChild(n),typeof t=="string"){var i=e.createElement("title");i.appendChild(e.createTextNode(t)),n.appendChild(i)}r.appendChild(e.createElement("body"))}return e}};function B(t){pe(t)}B.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var t=this.getRootNode();return t&&t.nodeType===t.DOCUMENT_NODE},contains:function(t){if(!t)return!1;var e=t;do{if(this===e)return!0;e=e.parentNode}while(e);return!1},getRootNode:function(t){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},isEqualNode:function(t){if(!t)return!1;for(var e=[{node:this,other:t}];e.length>0;){var r=e.pop(),n=r.node,i=r.other;if(n.nodeType!==i.nodeType)return!1;switch(n.nodeType){case n.DOCUMENT_TYPE_NODE:if(n.name!==i.name||n.publicId!==i.publicId||n.systemId!==i.systemId)return!1;break;case n.ELEMENT_NODE:if(n.namespaceURI!==i.namespaceURI||n.prefix!==i.prefix||n.localName!==i.localName||n.attributes.length!==i.attributes.length)return!1;for(var s=0;s<n.attributes.length;s++){var a=n.attributes.item(s),o=i.getAttributeNodeNS(a.namespaceURI,a.localName);if(!o)return!1;e.push({node:a,other:o})}break;case n.ATTRIBUTE_NODE:if(n.namespaceURI!==i.namespaceURI||n.localName!==i.localName||n.value!==i.value)return!1;break;case n.PROCESSING_INSTRUCTION_NODE:if(n.target!==i.target||n.data!==i.data)return!1;break;case n.TEXT_NODE:case n.CDATA_SECTION_NODE:case n.COMMENT_NODE:if(n.data!==i.data)return!1;break}if(n.childNodes.length!==i.childNodes.length)return!1;for(var s=n.childNodes.length-1;s>=0;s--)e.push({node:n.childNodes[s],other:i.childNodes[s]})}return!0},isSameNode:function(t){return this===t},insertBefore:function(t,e){return sn(this,t,e)},replaceChild:function(t,e){sn(this,t,e,fa),e&&this.removeChild(e)},removeChild:function(t){return ua(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(t){return ha(this.ownerDocument||this,this,t)},normalize:function(){ae(this,null,{enter:function(t){for(var e=t.firstChild;e;){var r=e.nextSibling;if(r!==null&&r.nodeType===gr&&e.nodeType===gr){for(var n=[],i=r;i!==null&&i.nodeType===gr;)n.push(i.data),i=i.nextSibling;for(var s=e.nextSibling;s!==i;){var a=s.nextSibling;s.parentNode=null,s.previousSibling=null,s.nextSibling=null,s=a}e.nextSibling=i,i!==null?i.previousSibling=e:t.lastChild=e,e.appendData(n.join("")),mi(t.ownerDocument,t),e=i}else e=r}return!0}})},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},lookupPrefix:function(t){for(var e=this;e;){var r=e._nsMap;if(r){for(var n in r)if(Ot(r,n)&&r[n]===t)return n}e=e.nodeType==It?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var r=e._nsMap;if(r&&Ot(r,t))return r[t];e=e.nodeType==It?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return e==null},compareDocumentPosition:function(t){if(this===t)return 0;var e=t,r=this,n=null,i=null;if(e instanceof mt&&(n=e,e=n.ownerElement),r instanceof mt&&(i=r,r=i.ownerElement,n&&e&&r===e))for(var s=0,a;a=r.attributes[s];s++){if(a===n)return j.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+j.DOCUMENT_POSITION_PRECEDING;if(a===i)return j.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+j.DOCUMENT_POSITION_FOLLOWING}if(!e||!r||r.ownerDocument!==e.ownerDocument)return j.DOCUMENT_POSITION_DISCONNECTED+j.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(Gs(r.ownerDocument)>Gs(e.ownerDocument)?j.DOCUMENT_POSITION_FOLLOWING:j.DOCUMENT_POSITION_PRECEDING);if(i&&e===r)return j.DOCUMENT_POSITION_CONTAINS+j.DOCUMENT_POSITION_PRECEDING;if(n&&e===r)return j.DOCUMENT_POSITION_CONTAINED_BY+j.DOCUMENT_POSITION_FOLLOWING;for(var o=[],u=e.parentNode;u;){if(!i&&u===r)return j.DOCUMENT_POSITION_CONTAINED_BY+j.DOCUMENT_POSITION_FOLLOWING;o.push(u),u=u.parentNode}o.reverse();for(var l=[],c=r.parentNode;c;){if(!n&&c===e)return j.DOCUMENT_POSITION_CONTAINS+j.DOCUMENT_POSITION_PRECEDING;l.push(c),c=c.parentNode}l.reverse();var f=ia(o,l);for(var d in f.childNodes){var p=f.childNodes[d];if(p===r)return j.DOCUMENT_POSITION_FOLLOWING;if(p===e)return j.DOCUMENT_POSITION_PRECEDING;if(l.indexOf(p)>=0)return j.DOCUMENT_POSITION_FOLLOWING;if(o.indexOf(p)>=0)return j.DOCUMENT_POSITION_PRECEDING}return 0}};function oa(t){return t=="<"&&"<"||t==">"&&">"||t=="&"&&"&"||t=='"'&&"""||"&#"+t.charCodeAt()+";"}Mt(me,B);Mt(me,B.prototype);Mt(j,B);Mt(j,B.prototype);function nn(t,e){ae(t,null,{enter:function(r){return e(r)?ae.STOP:!0}})}function ae(t,e,r){for(var n=[{node:t,context:e,phase:ae.ENTER}];n.length>0;){var i=n.pop();if(i.phase===ae.ENTER){var s=r.enter(i.node,i.context);if(s===ae.STOP)return ae.STOP;if(n.push({node:i.node,context:s,phase:ae.EXIT}),s==null)continue;for(var a=i.node.lastChild;a;)n.push({node:a,context:s,phase:ae.ENTER}),a=a.previousSibling}else r.exit&&r.exit(i.node,i.context)}}ae.STOP=Symbol("walkDOM.STOP");ae.ENTER=0;ae.EXIT=1;function qe(t,e){pe(t);var r=e||{};this.ownerDocument=this,this.contentType=r.contentType||_r.XML_APPLICATION,this.type=_c(this.contentType)?"html":"xml"}function Nc(t,e,r){t&&t._inc++;var n=r.namespaceURI;n===Ie.XMLNS&&(e._nsMap[r.prefix?r.localName:""]=r.value)}function la(t,e,r,n){t&&t._inc++;var i=r.namespaceURI;i===Ie.XMLNS&&delete e._nsMap[r.prefix?r.localName:""]}function mi(t,e,r){if(t&&t._inc){t._inc++;var n=e.childNodes;if(r&&!r.nextSibling)n[n.length++]=r;else{for(var i=e.firstChild,s=0;i;)n[s++]=i,i=i.nextSibling;n.length=s,delete n[n.length]}}}function ua(t,e){if(t!==e.parentNode)throw new w(w.NOT_FOUND_ERR,"child's parent is not parent");var r=e.previousSibling,n=e.nextSibling;return r?r.nextSibling=n:t.firstChild=n,n?n.previousSibling=r:t.lastChild=r,mi(t.ownerDocument,t),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}function Sc(t){return t&&(t.nodeType===B.DOCUMENT_NODE||t.nodeType===B.DOCUMENT_FRAGMENT_NODE||t.nodeType===B.ELEMENT_NODE)}function Oc(t){return t&&(t.nodeType===B.CDATA_SECTION_NODE||t.nodeType===B.COMMENT_NODE||t.nodeType===B.DOCUMENT_FRAGMENT_NODE||t.nodeType===B.DOCUMENT_TYPE_NODE||t.nodeType===B.ELEMENT_NODE||t.nodeType===B.PROCESSING_INSTRUCTION_NODE||t.nodeType===B.TEXT_NODE)}function nt(t){return t&&t.nodeType===B.DOCUMENT_TYPE_NODE}function Pe(t){return t&&t.nodeType===B.ELEMENT_NODE}function ca(t){return t&&t.nodeType===B.TEXT_NODE}function Zs(t,e){var r=t.childNodes||[];if(Oe(r,Pe)||nt(e))return!1;var n=Oe(r,nt);return!(e&&n&&r.indexOf(n)>r.indexOf(e))}function Js(t,e){var r=t.childNodes||[];function n(s){return Pe(s)&&s!==e}if(Oe(r,n))return!1;var i=Oe(r,nt);return!(e&&i&&r.indexOf(i)>r.indexOf(e))}function Ic(t,e,r){if(!Sc(t))throw new w(w.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+t.nodeType);if(r&&r.parentNode!==t)throw new w(w.NOT_FOUND_ERR,"child not in parent");if(!Oc(e)||nt(e)&&t.nodeType!==B.DOCUMENT_NODE)throw new w(w.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function Bc(t,e,r){var n=t.childNodes||[],i=e.childNodes||[];if(e.nodeType===B.DOCUMENT_FRAGMENT_NODE){var s=i.filter(Pe);if(s.length>1||Oe(i,ca))throw new w(w.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(s.length===1&&!Zs(t,r))throw new w(w.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Pe(e)&&!Zs(t,r))throw new w(w.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(nt(e)){if(Oe(n,nt))throw new w(w.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Oe(n,Pe);if(r&&n.indexOf(a)<n.indexOf(r))throw new w(w.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!r&&a)throw new w(w.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function fa(t,e,r){var n=t.childNodes||[],i=e.childNodes||[];if(e.nodeType===B.DOCUMENT_FRAGMENT_NODE){var s=i.filter(Pe);if(s.length>1||Oe(i,ca))throw new w(w.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(s.length===1&&!Js(t,r))throw new w(w.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Pe(e)&&!Js(t,r))throw new w(w.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(nt(e)){if(Oe(n,function(u){return nt(u)&&u!==r}))throw new w(w.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Oe(n,Pe);if(r&&n.indexOf(a)<n.indexOf(r))throw new w(w.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function sn(t,e,r,n){Ic(t,e,r),t.nodeType===B.DOCUMENT_NODE&&(n||Bc)(t,e,r);var i=e.parentNode;if(i&&i.removeChild(e),e.nodeType===rt){var s=e.firstChild;if(s==null)return e;var a=e.lastChild}else s=a=e;var o=r?r.previousSibling:t.lastChild;s.previousSibling=o,a.nextSibling=r,o?o.nextSibling=s:t.firstChild=s,r==null?t.lastChild=a:r.previousSibling=a;do s.parentNode=t;while(s!==a&&(s=s.nextSibling));return mi(t.ownerDocument||t,t,e),e.nodeType==rt&&(e.firstChild=e.lastChild=null),e}qe.prototype={implementation:null,nodeName:"#document",nodeType:St,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType===rt){for(var r=t.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,e),r=n}return t}return sn(this,t,e),t.ownerDocument=this,this.documentElement===null&&t.nodeType===ye&&(this.documentElement=t),t},removeChild:function(t){var e=ua(this,t);return e===this.documentElement&&(this.documentElement=null),e},replaceChild:function(t,e){sn(this,t,e,fa),t.ownerDocument=this,e&&this.removeChild(e),Pe(t)&&(this.documentElement=t)},importNode:function(t,e){return Mc(this,t,e)},getElementById:function(t){var e=null;return nn(this.documentElement,function(r){if(r.nodeType==ye&&r.getAttribute("id")==t)return e=r,!0}),e},createElement:function(t){var e=new je(fe);e.ownerDocument=this,this.type==="html"&&(t=t.toLowerCase()),mc(this.contentType)&&(e.namespaceURI=Ie.HTML),e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new J;var r=e.attributes=new Bt;return r._ownerElement=e,e},createDocumentFragment:function(){var t=new Rt(fe);return t.ownerDocument=this,t.childNodes=new J,t},createTextNode:function(t){var e=new br(fe);return e.ownerDocument=this,e.childNodes=new J,e.appendData(t),e},createComment:function(t){var e=new on(fe);return e.ownerDocument=this,e.childNodes=new J,e.appendData(t),e},createCDATASection:function(t){if(t.indexOf("]]>")!==-1)throw new w(w.INVALID_CHARACTER_ERR,'data contains "]]>"');var e=new ln(fe);return e.ownerDocument=this,e.childNodes=new J,e.appendData(t),e},createProcessingInstruction:function(t,e){var r=new fn(fe);return r.ownerDocument=this,r.childNodes=new J,r.nodeName=r.target=t,r.nodeValue=r.data=e,r},createAttribute:function(t){if(!V.QName_exact.test(t))throw new w(w.INVALID_CHARACTER_ERR,'invalid character in name "'+t+'"');return this.type==="html"&&(t=t.toLowerCase()),this._createAttribute(t)},_createAttribute:function(t){var e=new mt(fe);return e.ownerDocument=this,e.childNodes=new J,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){if(!V.Name_exact.test(t))throw new w(w.INVALID_CHARACTER_ERR,'not a valid xml name "'+t+'"');if(this.type==="html")throw new w("document is an html document",ue.NotSupportedError);var e=new cn(fe);return e.ownerDocument=this,e.childNodes=new J,e.nodeName=t,e},createElementNS:function(t,e){var r=fi(t,e),n=new je(fe),i=n.attributes=new Bt;return n.childNodes=new J,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],i._ownerElement=n,n},createAttributeNS:function(t,e){var r=fi(t,e),n=new mt(fe);return n.ownerDocument=this,n.childNodes=new J,n.nodeName=e,n.name=e,n.specified=!0,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],n}};he(qe,B);function je(t){pe(t),this._nsMap=Object.create(null)}je.prototype={nodeType:ye,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type==="html"&&this.namespaceURI===Ie.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(t){return!!this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e?e.value:null},getAttributeNode:function(t){return this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase()),this.attributes.getNamedItem(t)},setAttribute:function(t,e){this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());var r=this.getAttributeNode(t);r?r.value=r.nodeValue=""+e:(r=this.ownerDocument._createAttribute(t),r.value=r.nodeValue=""+e,this.setAttributeNode(r))},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var r=this.getAttributeNodeNS(t,e);r&&this.removeAttributeNode(r)},hasAttributeNS:function(t,e){return this.getAttributeNodeNS(t,e)!=null},getAttributeNS:function(t,e){var r=this.getAttributeNodeNS(t,e);return r?r.value:null},setAttributeNS:function(t,e,r){var n=fi(t,e),i=n[2],s=this.getAttributeNodeNS(t,i);s?s.value=s.nodeValue=""+r:(s=this.ownerDocument.createAttributeNS(t,e),s.value=s.nodeValue=""+r,this.setAttributeNode(s))},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByClassName:function(t){var e=Xs(t);return new Se(this,function(r){var n=[];return e.length>0&&nn(r,function(i){if(i!==r&&i.nodeType===ye){var s=i.getAttribute("class");if(s){var a=t===s;if(!a){var o=Xs(s);a=e.every(kc(o))}a&&n.push(i)}}}),n})},getElementsByTagName:function(t){var e=(this.nodeType===St?this:this.ownerDocument).type==="html",r=t.toLowerCase();return new Se(this,function(n){var i=[];return nn(n,function(s){if(!(s===n||s.nodeType!==ye))if(t==="*")i.push(s);else{var a=s.getQualifiedName(),o=e&&s.namespaceURI===Ie.HTML?r:t;a===o&&i.push(s)}}),i})},getElementsByTagNameNS:function(t,e){return new Se(this,function(r){var n=[];return nn(r,function(i){i!==r&&i.nodeType===ye&&(t==="*"||i.namespaceURI===t)&&(e==="*"||i.localName==e)&&n.push(i)}),n})}};qe.prototype.getElementsByClassName=je.prototype.getElementsByClassName;qe.prototype.getElementsByTagName=je.prototype.getElementsByTagName;qe.prototype.getElementsByTagNameNS=je.prototype.getElementsByTagNameNS;he(je,B);function mt(t){pe(t),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}mt.prototype.nodeType=It;he(mt,B);function it(t){pe(t)}it.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,r){var n=this.data.substring(0,t),i=this.data.substring(t+e);r=n+r+i,this.nodeValue=this.data=r,this.length=r.length}};he(it,B);function br(t){pe(t)}br.prototype={nodeName:"#text",nodeType:gr,splitText:function(t){var e=this.data,r=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};he(br,it);function on(t){pe(t)}on.prototype={nodeName:"#comment",nodeType:pi};he(on,it);function ln(t){pe(t)}ln.prototype={nodeName:"#cdata-section",nodeType:ta};he(ln,br);function un(t){pe(t)}un.prototype.nodeType=na;he(un,B);function _i(t){pe(t)}_i.prototype.nodeType=Dc;he(_i,B);function gi(t){pe(t)}gi.prototype.nodeType=Ec;he(gi,B);function cn(t){pe(t)}cn.prototype.nodeType=ra;he(cn,B);function Rt(t){pe(t)}Rt.prototype.nodeName="#document-fragment";Rt.prototype.nodeType=rt;he(Rt,B);function fn(t){pe(t)}fn.prototype.nodeType=di;he(fn,it);function da(){}da.prototype.serializeToString=function(t,e){return pa.call(t,e)};B.prototype.toString=pa;function pa(t){var e;typeof t=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:t}:t!=null?e={requireWellFormed:!!t.requireWellFormed,splitCDATASections:t.splitCDATASections!==!1,nodeFilter:t.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};var r=[],n=this.nodeType===St&&this.documentElement||this,i=n.prefix,s=n.namespaceURI;if(s&&i==null){var i=n.lookupPrefix(s);if(i==null)var a=[{namespace:s,prefix:null}]}return bi(this,r,a,e),r.join("")}function Ks(t,e,r){var n=t.prefix||"",i=t.namespaceURI;if(!i||n==="xml"&&i===Ie.XML||i===Ie.XMLNS)return!1;for(var s=r.length;s--;){var a=r[s];if(a.prefix===n)return a.namespace!==i}return!0}function rn(t,e,r,n){if(n&&!V.QName_exact.test(e))throw new w('The attribute name "'+e+'" is not a valid XML QName',ue.InvalidStateError);t.push(" ",e,'="',r.replace(/[<>&"\t\n\r]/g,oa),'"')}function bi(t,e,r,n){r||(r=[]);var i=n.nodeFilter,s=n.requireWellFormed,a=n.splitCDATASections,o=t.nodeType===St?t:t.ownerDocument,u=o.type==="html";ae(t,{ns:r},{enter:function(l,c){var f=c.ns;if(i)if(l=i(l),l){if(typeof l=="string")return e.push(l),null}else return null;switch(l.nodeType){case ye:var d=l.attributes,p=d.length,m=l.tagName,h=m;if(!u&&!l.prefix&&l.namespaceURI){for(var g,b=0;b<d.length;b++)if(d.item(b).name==="xmlns"){g=d.item(b).value;break}if(!g)for(var k=f.length-1;k>=0;k--){var y=f[k];if(y.prefix===""&&y.namespace===l.namespaceURI){g=y.namespace;break}}if(g!==l.namespaceURI)for(var k=f.length-1;k>=0;k--){var y=f[k];if(y.namespace===l.namespaceURI){y.prefix&&(h=y.prefix+":"+m);break}}}if(s&&!V.QName_exact.test(h))throw new w('The element name "'+h+'" is not a valid XML QName',ue.InvalidStateError);e.push("<",h);for(var A=f.slice(),I=0;I<p;I++){var L=d.item(I);L.prefix=="xmlns"?A.push({prefix:L.localName,namespace:L.value}):L.nodeName=="xmlns"&&A.push({prefix:"",namespace:L.value})}for(var I=0;I<p;I++){var L=d.item(I);if(Ks(L,u,A)){var X=L.prefix||"",te=L.namespaceURI;rn(e,X?"xmlns:"+X:"xmlns",te,s),A.push({prefix:X,namespace:te})}var re=i?i(L):L;re&&(typeof re=="string"?e.push(re):rn(e,re.name,re.value,s))}if(m===h&&Ks(l,u,A)){var $e=l.prefix||"",te=l.namespaceURI;rn(e,$e?"xmlns:"+$e:"xmlns",te,s),A.push({prefix:$e,namespace:te})}var Y=!l.firstChild;if(Y&&(u||l.namespaceURI===Ie.HTML)&&(Y=bc(m)),Y)return e.push("/>"),null;if(e.push(">"),u&&gc(m)){for(var ce=l.firstChild;ce;)ce.data?e.push(ce.data):bi(ce,e,A.slice(),n),ce=ce.nextSibling;return e.push("</",h,">"),null}return{ns:A,tag:h};case St:case rt:if(s&&l.nodeType===St&&l.documentElement==null)throw new w("The Document has no documentElement",ue.InvalidStateError);return{ns:f};case It:return rn(e,l.name,l.value,s),null;case gr:if(s&&V.InvalidChar.test(l.data))throw new w("The Text node data contains characters outside the XML Char production",ue.InvalidStateError);return e.push(l.data.replace(/[<&>]/g,oa)),null;case ta:if(s&&l.data.indexOf("]]>")!==-1)throw new w('The CDATASection data contains "]]>"',ue.InvalidStateError);return a?e.push(V.CDATA_START,l.data.replace(/]]>/g,"]]]]><![CDATA[>"),V.CDATA_END):e.push(V.CDATA_START,l.data,V.CDATA_END),null;case pi:if(s){if(V.InvalidChar.test(l.data))throw new w("The comment node data contains characters outside the XML Char production",ue.InvalidStateError);if(l.data.indexOf("--")!==-1||l.data[l.data.length-1]==="-")throw new w('The comment node data contains "--" or ends with "-"',ue.InvalidStateError)}return e.push(V.COMMENT_START,l.data,V.COMMENT_END),null;case na:var be=l.publicId,F=l.systemId;if(s){if(!V.Name_exact.test(l.name))throw new w('The doctype name "'+l.name+'" is not a valid XML Name',ue.InvalidStateError);if(be&&!V.PubidLiteral_match.test(be))throw new w("DocumentType publicId is not a valid PubidLiteral",ue.InvalidStateError);if(F&&F!=="."&&!V.SystemLiteral_match.test(F))throw new w("DocumentType systemId is not a valid SystemLiteral",ue.InvalidStateError);if(l.internalSubset&&l.internalSubset.indexOf("]>")!==-1)throw new w('DocumentType internalSubset contains "]>"',ue.InvalidStateError)}return e.push(V.DOCTYPE_DECL_START," ",l.name),be?(e.push(" ",V.PUBLIC," ",be),F&&F!=="."&&e.push(" ",F)):F&&F!=="."&&e.push(" ",V.SYSTEM," ",F),l.internalSubset&&e.push(" [",l.internalSubset,"]"),e.push(">"),null;case di:if(s){if(!V.NCName_exact.test(l.target)||l.target.toLowerCase()==="xml")throw new w('The processing instruction target "'+l.target+'" is not a valid XML NCName or is reserved',ue.InvalidStateError);if(V.InvalidChar.test(l.data))throw new w("The ProcessingInstruction data contains characters outside the XML Char production",ue.InvalidStateError);if(l.data.indexOf("?>")!==-1)throw new w('The ProcessingInstruction data contains "?>"',ue.InvalidStateError)}return e.push("<?",l.target," ",l.data,"?>"),null;case ra:if(s&&!V.Name_exact.test(l.nodeName))throw new w('The entity reference name "'+l.nodeName+'" is not a valid XML Name',ue.InvalidStateError);return e.push("&",l.nodeName,";"),null;default:return e.push("??",l.nodeName),null}},exit:function(l,c){c&&c.tag&&e.push("</",c.tag,">")}})}function Mc(t,e,r){var n;return ae(e,null,{enter:function(i,s){var a=i.cloneNode(!1);a.ownerDocument=t,a.parentNode=null,s===null?n=a:s.appendChild(a);var o=i.nodeType===It||r;return o?a:null}}),n}function ha(t,e,r){var n;return ae(e,null,{enter:function(i,s){var a=new i.constructor(fe);for(var o in i)if(Ot(i,o)){var u=i[o];typeof u!="object"&&u!=a[o]&&(a[o]=u)}i.childNodes&&(a.childNodes=new J),a.ownerDocument=t;var l=r;switch(a.nodeType){case ye:var c=i.attributes,f=a.attributes=new Bt,d=c.length;f._ownerElement=a;for(var p=0;p<d;p++)a.setAttributeNode(ha(t,c.item(p),!0));break;case It:l=!0}return s!==null?s.appendChild(a):n=a,l?a:null}}),n}function ma(t,e,r){t[e]=r}function ci(t){for(var e=[],r=t.firstChild;r;)r.nodeType===ye&&e.push(r),r=r.nextSibling;return e}try{Object.defineProperty&&(Object.defineProperty(Se.prototype,"length",{get:function(){return an(this),this.$$length}}),Object.defineProperty(B.prototype,"textContent",{get:function(){if(this.nodeType===ye||this.nodeType===rt){var t=[];return ae(this,null,{enter:function(e){if(e.nodeType===ye||e.nodeType===rt)return!0;if(e.nodeType===di||e.nodeType===pi)return null;t.push(e.nodeValue)}}),t.join("")}return this.nodeValue},set:function(t){switch(this.nodeType){case ye:case rt:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),Object.defineProperty(it.prototype,"data",{get:function(){return this._data!=null?this._data:""},set:function(t){this._data=t,this.length=typeof t=="string"?t.length:0}}),Object.defineProperty(it.prototype,"nodeValue",{get:function(){return this.data},set:function(t){this.data=t},enumerable:!0,configurable:!0}),Object.defineProperty(je.prototype,"children",{get:function(){return new Se(this,ci)}}),Object.defineProperty(qe.prototype,"children",{get:function(){return new Se(this,ci)}}),Object.defineProperty(Rt.prototype,"children",{get:function(){return new Se(this,ci)}}),ma=function(t,e,r){t["$$"+e]=r})}catch{}z._updateLiveList=an;z.Attr=mt;z.CDATASection=ln;z.CharacterData=it;z.Comment=on;z.Document=qe;z.DocumentFragment=Rt;z.DocumentType=un;z.DOMImplementation=aa;z.Element=je;z.Entity=gi;z.EntityReference=cn;z.LiveNodeList=Se;z.NamedNodeMap=Bt;z.Node=B;z.NodeList=J;z.Notation=_i;z.Text=br;z.ProcessingInstruction=fn;z.walkDOM=ae;z.XMLSerializer=da});var ga=Xe(wr=>{"use strict";var _a=ht().freeze;wr.XML_ENTITIES=_a({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});wr.HTML_ENTITIES=_a({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
2
|
-
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});wr.entityMap=wr.HTML_ENTITIES});var xa=Xe(pn=>{"use strict";var Pt=ht(),N=ui(),va=cr(),Rc=Pt.isHTMLEscapableRawTextElement,Lc=Pt.isHTMLMimeType,$c=Pt.isHTMLRawTextElement,kr=Pt.hasOwn,ba=Pt.NAMESPACE,Uc=va.ParseError,Fc=va.DOMException,Lt=0,st=1,$t=2,yr=3,Ut=4,Ft=5,vr=6,dn=7;function ka(){}ka.prototype={parse:function(t,e,r){var n=this.domBuilder;n.startDocument(),Vc(e,e=Object.create(null)),Pc(t,e,r,n,this.errorHandler),n.endDocument()}};var yi=/&#?\w+;?/g;function Pc(t,e,r,n,i){var s=Lc(n.mimeType);t.indexOf(N.UNICODE_REPLACEMENT_CHARACTER)>=0&&i.warning("Unicode replacement character detected, source encoding issues?");function a(R){if(R>65535){R-=65536;var we=55296+(R>>10),Lr=56320+(R&1023);return String.fromCharCode(we,Lr)}else return String.fromCharCode(R)}function o(R){var we=R[R.length-1]===";"?R:R+";";if(!s&&we!==R)return i.error("EntityRef: expecting ;"),R;var Lr=N.Reference.exec(we);if(!Lr||Lr[0].length!==we.length)return i.error("entity not matching Reference production: "+R),R;var $r=we.slice(1,-1);return kr(r,$r)?r[$r]:$r.charAt(0)==="#"?a(parseInt($r.substring(1).replace("x","0x"))):(i.error("entity not found:"+R),R)}function u(R){if(R>g){var we=t.substring(g,R).replace(yi,o);d&&p(g),n.characters(we,0,R-g),g=R}}var l=0,c=0,f=/\r\n?|\n|$/g,d=n.locator;function p(R,we){for(;R>=c&&(we=f.exec(t));)l=c,c=we.index+we[0].length,d.lineNumber++;d.columnNumber=R-l+1}for(var m=[{currentNSMap:e}],h=[],g=0;;){try{var b=t.indexOf("<",g);if(b<0){if(!s&&h.length>0)return i.fatalError("unclosed xml tag(s): "+h.join(", "));if(!t.substring(g).match(/^\s*$/)){var k=n.doc,y=k.createTextNode(t.substring(g));if(k.documentElement)return i.error("Extra content at the end of the document");k.appendChild(y),n.currentElement=y}return}if(b>g){var A=t.substring(g,b);!s&&h.length===0&&(A=A.replace(new RegExp(N.S_OPT.source,"g"),""),A&&i.error("Unexpected content outside root element: '"+A+"'")),u(b)}switch(t.charAt(b+1)){case"/":var S=t.indexOf(">",b+2),I=t.substring(b+2,S>0?S:void 0);if(!I)return i.fatalError("end tag name missing");var L=N.reg("^",N.QName_group,N.S_OPT,"$"),X=S>0&&L.exec(I);if(!X){var te=S>0&&N.reg("^",N.QName_group).exec(I);if(s&&te)i.warning('end tag name contains invalid trailing characters: "'+I+'"'),X=te;else if(te&&new RegExp(L.source,L.flags+"m").test(I))i.error('end tag name is followed by a line break and trailing content: "'+I+'"'),X=te;else return i.fatalError('end tag name contains invalid characters: "'+I+'"')}if(!n.currentElement&&!n.doc.documentElement)return;var re=h[h.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(re!==X[1]){var $e=X[1].toLowerCase();if(!s||re.toLowerCase()!==$e)return i.fatalError('Opening and ending tag mismatch: "'+re+'" != "'+I+'"')}var Y=m.pop();h.pop();var ce=Y.localNSMap;if(n.endElement(Y.uri,Y.localName,re),ce)for(var be in ce)kr(ce,be)&&n.endPrefixMapping(be);S++;break;case"?":d&&p(b),S=Hc(t,b,n,i);break;case"!":d&&p(b),S=Da(t,b,n,i,s);break;default:d&&p(b);var F=new Aa,G=m[m.length-1].currentNSMap,S=qc(t,b,F,G,o,i,s),Hi=F.length;if(F.closed||(s&&Pt.isHTMLVoidElement(F.tagName)?F.closed=!0:h.push(F.tagName)),d&&Hi){for(var No=wa(d,{}),On=0;On<Hi;On++){var Wi=F[On];p(Wi.offset),Wi.locator=wa(d,{})}n.locator=No,ya(F,n,G)&&m.push(F),n.locator=d}else ya(F,n,G)&&m.push(F);s&&!F.closed?S=jc(t,S,F.tagName,o,n):S++}}catch(R){if(R instanceof Uc)throw R;if(R instanceof Fc)return i.fatalError("Error constructing the DOM: "+R.name+": "+R.message,R);i.error("element parse error: "+R),S=-1}S>g?g=S:u(Math.max(b,g)+1)}}function wa(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function qc(t,e,r,n,i,s,a){function o(p,m,h){if(kr(r.attributeNames,p))return s.fatalError("Attribute "+p+" redefined");if(!a&&m.indexOf("<")>=0)return s.fatalError("Unescaped '<' not allowed in attributes values");r.addValue(p,m.replace(/[\t\n\r]/g," ").replace(yi,i),h)}for(var u,l,c=++e,f=Lt;;){var d=t.charAt(c);if(f===Lt&&d==="<")throw new Error("unexpected < in tag name: "+t.slice(e,c));switch(d){case"=":if(f===st)u=t.slice(e,c),f=yr;else if(f===$t)f=yr;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(f===yr||f===st)if(f===st&&(s.warning('attribute value must after "="'),u=t.slice(e,c)),e=c+1,c=t.indexOf(d,e),c>0)l=t.slice(e,c),o(u,l,e-1),f=Ft;else throw new Error("attribute value no end '"+d+"' match");else if(f==Ut)l=t.slice(e,c),o(u,l,e),s.warning('attribute "'+u+'" missed start quot('+d+")!!"),e=c+1,f=Ft;else throw new Error('attribute value must after "="');break;case"/":switch(f){case Lt:r.setTagName(t.slice(e,c));case Ft:case vr:case dn:f=dn,r.closed=!0;case Ut:case st:break;case $t:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),f==Lt&&r.setTagName(t.slice(e,c)),c;case">":switch(f){case Lt:r.setTagName(t.slice(e,c));case Ft:case vr:case dn:break;case Ut:case st:l=t.slice(e,c),l.slice(-1)==="/"&&(r.closed=!0,l=l.slice(0,-1));case $t:f===$t&&(l=u),f==Ut?(s.warning('attribute "'+l+'" missed quot(")!'),o(u,l,e)):(a||s.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),o(l,l,e));break;case yr:if(!a)return s.fatalError(`AttValue: ' or " expected`)}return c;case"\x80":d=" ";default:if(d<=" ")switch(f){case Lt:r.setTagName(t.slice(e,c)),f=vr;break;case st:u=t.slice(e,c),f=$t;break;case Ut:var l=t.slice(e,c);s.warning('attribute "'+l+'" missed quot(")!!'),o(u,l,e);case Ft:f=vr;break}else switch(f){case $t:a||s.warning('attribute "'+u+'" missed value!! "'+u+'" instead2!!'),o(u,u,e),e=c,f=st;break;case Ft:s.warning('attribute space is required"'+u+'"!!');case vr:f=st,e=c;break;case yr:f=Ut,e=c;break;case dn:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function ya(t,e,r){for(var n=t.tagName,i=null,f=t.length;f--;){var s=t[f],a=s.qName,o=s.value,d=a.indexOf(":");if(d>0)var u=s.prefix=a.slice(0,d),l=a.slice(d+1),c=u==="xmlns"&&l;else l=a,u=null,c=a==="xmlns"&&"";s.localName=l,c!==!1&&(i==null&&(i=Object.create(null),r=Object.create(r)),r[c]=i[c]=o,s.uri=ba.XMLNS,e.startPrefixMapping(c,o))}for(var f=t.length;f--;)s=t[f],s.prefix&&(s.prefix==="xml"&&(s.uri=ba.XML),s.prefix!=="xmlns"&&(s.uri=r[s.prefix]));var d=n.indexOf(":");d>0?(u=t.prefix=n.slice(0,d),l=t.localName=n.slice(d+1)):(u=null,l=t.localName=n);var p=t.uri=r[u||""];if(e.startElement(p,l,n,t),t.closed){if(e.endElement(p,l,n),i)for(u in i)kr(i,u)&&e.endPrefixMapping(u)}else return t.currentNSMap=r,t.localNSMap=i,!0}function jc(t,e,r,n,i){var s=Rc(r);if(s||$c(r)){var a=new RegExp("</"+r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+">","ig");a.lastIndex=e;var o=a.exec(t),u=o?o.index:-1;if(u<0)return e+1;var l=t.substring(e+1,u);return s&&(l=l.replace(yi,n)),i.characters(l,0,l.length),u}return e+1}function Vc(t,e){for(var r in t)kr(t,r)&&(e[r]=t[r])}function Ea(t,e){var r=e;function n(c){return c=c||0,t.charAt(r+c)}function i(c){c=c||1,r+=c}function s(){for(var c=0;r<t.length;){var f=n();if(f!==" "&&f!==`
|
|
3
|
-
`&&f!==" "&&f!=="\r")return c;c++,i()}return-1}function a(){return t.substring(r)}function o(c){return t.substring(r,r+c.length)===c}function u(c){return t.substring(r,r+c.length).toUpperCase()===c.toUpperCase()}function l(c){var f=N.reg("^",c),d=f.exec(a());return d?(i(d[0].length),d[0]):null}return{char:n,getIndex:function(){return r},getMatch:l,getSource:function(){return t},skip:i,skipBlanks:s,substringFromIndex:a,substringStartsWith:o,substringStartsWithCaseInsensitive:u}}function zc(t,e){function r(o,u){var l=N.PI.exec(o.substringFromIndex());return l?l[1].toLowerCase()==="xml"?u.fatalError("xml declaration is only allowed at the start of the document, but found at position "+o.getIndex()):(o.skip(l[0].length),l[0]):u.fatalError("processing instruction is not well-formed at position "+o.getIndex())}var n=t.getSource();if(t.char()==="["){t.skip(1);for(var i=t.getIndex();t.getIndex()<n.length;){if(t.skipBlanks(),t.char()==="]"){var s=n.substring(i,t.getIndex());return t.skip(1),s}var a=null;if(t.char()==="<"&&t.char(1)==="!")switch(t.char(2)){case"E":t.char(3)==="L"?a=t.getMatch(N.elementdecl):t.char(3)==="N"&&(a=t.getMatch(N.EntityDecl));break;case"A":a=t.getMatch(N.AttlistDecl);break;case"N":a=t.getMatch(N.NotationDecl);break;case"-":a=t.getMatch(N.Comment);break}else if(t.char()==="<"&&t.char(1)==="?")a=r(t,e);else if(t.char()==="%")a=t.getMatch(N.PEReference);else return e.fatalError("Error detected in Markup declaration");if(!a)return e.fatalError("Error in internal subset at position "+t.getIndex())}return e.fatalError("doctype internal subset is not well-formed, missing ]")}}function Da(t,e,r,n,i){var s=Ea(t,e);switch(i?s.char(2).toUpperCase():s.char(2)){case"-":var a=s.getMatch(N.Comment);return a?(r.comment(a,N.COMMENT_START.length,a.length-N.COMMENT_START.length-N.COMMENT_END.length),s.getIndex()):n.fatalError("comment is not well-formed at position "+s.getIndex());case"[":var o=s.getMatch(N.CDSect);return o?!i&&!r.currentElement?n.fatalError("CDATA outside of element"):(r.startCDATA(),r.characters(o,N.CDATA_START.length,o.length-N.CDATA_START.length-N.CDATA_END.length),r.endCDATA(),s.getIndex()):n.fatalError("Invalid CDATA starting at position "+e);case"D":{if(r.doc&&r.doc.documentElement)return n.fatalError("Doctype not allowed inside or after documentElement at position "+s.getIndex());if(i?!s.substringStartsWithCaseInsensitive(N.DOCTYPE_DECL_START):!s.substringStartsWith(N.DOCTYPE_DECL_START))return n.fatalError("Expected "+N.DOCTYPE_DECL_START+" at position "+s.getIndex());if(s.skip(N.DOCTYPE_DECL_START.length),s.skipBlanks()<1)return n.fatalError("Expected whitespace after "+N.DOCTYPE_DECL_START+" at position "+s.getIndex());var u={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(u.name=s.getMatch(N.Name),!u.name)return n.fatalError("doctype name missing or contains unexpected characters at position "+s.getIndex());if(i&&u.name.toLowerCase()!=="html"&&n.warning("Unexpected DOCTYPE in HTML document at position "+s.getIndex()),s.skipBlanks(),s.substringStartsWith(N.PUBLIC)||s.substringStartsWith(N.SYSTEM)){var l=N.ExternalID_match.exec(s.substringFromIndex());if(!l)return n.fatalError("doctype external id is not well-formed at position "+s.getIndex());l.groups.SystemLiteralOnly!==void 0?u.systemId=l.groups.SystemLiteralOnly:(u.systemId=l.groups.SystemLiteral,u.publicId=l.groups.PubidLiteral),s.skip(l[0].length)}else if(i&&s.substringStartsWithCaseInsensitive(N.SYSTEM)){if(s.skip(N.SYSTEM.length),s.skipBlanks()<1)return n.fatalError("Expected whitespace after "+N.SYSTEM+" at position "+s.getIndex());if(u.systemId=s.getMatch(N.ABOUT_LEGACY_COMPAT_SystemLiteral),!u.systemId)return n.fatalError("Expected "+N.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+N.SYSTEM+" at position "+s.getIndex())}return i&&u.systemId&&!N.ABOUT_LEGACY_COMPAT_SystemLiteral.test(u.systemId)&&n.warning("Unexpected doctype.systemId in HTML document at position "+s.getIndex()),i||(s.skipBlanks(),u.internalSubset=zc(s,n)),s.skipBlanks(),s.char()!==">"?n.fatalError("doctype not terminated with > at position "+s.getIndex()):(s.skip(1),r.startDTD(u.name,u.publicId,u.systemId,u.internalSubset),r.endDTD(),s.getIndex())}default:return n.fatalError('Not well-formed XML starting with "<!" at position '+e)}}function Hc(t,e,r,n){var i=t.substring(e).match(N.PI);if(!i)return n.fatalError("Invalid processing instruction starting at position "+e);if(i[1].toLowerCase()==="xml"){if(e>0)return n.fatalError("processing instruction at position "+e+" is an xml declaration which is only at the start of the document");if(!N.XMLDecl.test(t.substring(e)))return n.fatalError("xml declaration is not well-formed")}return r.processingInstruction(i[1],i[2]),e+i[0].length}function Aa(){this.attributeNames=Object.create(null)}Aa.prototype={setTagName:function(t){if(!N.QName_exact.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,r){if(!N.QName_exact.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:r}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}};pn.XMLReader=ka;pn.parseUtils=Ea;pn.parseDoctypeCommentOrCData=Da});var Ba=Xe(jt=>{"use strict";var _t=ht(),Wc=wi(),Xc=cr(),Ta=ga(),Gc=xa(),Yc=Wc.DOMImplementation,Zc=_t.hasDefaultHTMLNamespace,Jc=_t.isHTMLMimeType,Kc=_t.isValidMimeType,Sa=_t.MIME_TYPE,vi=_t.NAMESPACE,Ca=Xc.ParseError,Qc=Gc.XMLReader;function Oa(t){return t.replace(/\r[\n\u0085]/g,`
|
|
4
|
-
`).replace(/[\r\u0085\u2028\u2029]/g,`
|
|
5
|
-
`)}function Ia(t){if(t=t||{},t.locator===void 0&&(t.locator=!0),this.assign=t.assign||_t.assign,this.domHandler=t.domHandler||mn,this.onError=t.onError||t.errorHandler,t.errorHandler&&typeof t.errorHandler!="function")throw new TypeError("errorHandler object is no longer supported, switch to onError!");t.errorHandler&&t.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=t.normalizeLineEndings||Oa,this.locator=!!t.locator,this.xmlns=this.assign(Object.create(null),t.xmlns)}Ia.prototype.parseFromString=function(t,e){if(!Kc(e))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+e+'" is not valid.');var r=this.assign(Object.create(null),this.xmlns),n=Ta.XML_ENTITIES,i=r[""]||null;Zc(e)?(n=Ta.HTML_ENTITIES,i=vi.HTML):e===Sa.XML_SVG_IMAGE&&(i=vi.SVG),r[""]=i,r.xml=r.xml||vi.XML;var s=new this.domHandler({mimeType:e,defaultNamespace:i,onError:this.onError}),a=this.locator?{}:void 0;this.locator&&s.setDocumentLocator(a);var o=new Qc;o.errorHandler=s,o.domBuilder=s;var u=!_t.isHTMLMimeType(e);return u&&typeof t!="string"&&o.errorHandler.fatalError("source is not a string"),o.parse(this.normalizeLineEndings(String(t)),r,n),s.doc.documentElement||o.errorHandler.fatalError("missing root element"),s.doc};function mn(t){var e=t||{};this.mimeType=e.mimeType||Sa.XML_APPLICATION,this.defaultNamespace=e.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=e.onError}function qt(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}mn.prototype={startDocument:function(){var t=new Yc;this.doc=Jc(this.mimeType)?t.createHTMLDocument(!1):t.createDocument(this.defaultNamespace,"")},startElement:function(t,e,r,n){var i=this.doc,s=i.createElementNS(t,r||e),a=n.length;hn(this,s),this.currentElement=s,this.locator&&qt(this.locator,s);for(var o=0;o<a;o++){var t=n.getURI(o),u=n.getValue(o),r=n.getQName(o),l=i.createAttributeNS(t,r);this.locator&&qt(n.getLocator(o),l),l.value=l.nodeValue=u,s.setAttributeNode(l)}},endElement:function(t,e,r){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var r=this.doc.createProcessingInstruction(t,e);this.locator&&qt(this.locator,r),hn(this,r)},ignorableWhitespace:function(t,e,r){},characters:function(t,e,r){if(t=Na.apply(this,arguments),t){if(this.cdata)var n=this.doc.createCDATASection(t);else var n=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(t)&&this.doc.appendChild(n),this.locator&&qt(this.locator,n)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){t&&(t.lineNumber=0),this.locator=t},comment:function(t,e,r){t=Na.apply(this,arguments);var n=this.doc.createComment(t);this.locator&&qt(this.locator,n),hn(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,r,n){var i=this.doc.implementation;if(i&&i.createDocumentType){var s=i.createDocumentType(t,e,r,n);this.locator&&qt(this.locator,s),hn(this,s),this.doc.doctype=s}},reportError:function(t,e){if(typeof this.onError=="function")try{this.onError(t,e,this)}catch(r){throw new Ca("Reporting "+t+' "'+e+'" caused '+r,this.locator)}else console.error("[xmldom "+t+"] "+e,ef(this.locator))},warning:function(t){this.reportError("warning",t)},error:function(t){this.reportError("error",t)},fatalError:function(t,e){throw this.reportError("fatalError",t),new Ca(t,this.locator,e)}};function ef(t){if(t)return`
|
|
6
|
-
@#[line:`+t.lineNumber+",col:"+t.columnNumber+"]"}function Na(t,e,r){return typeof t=="string"?t.substr(e,r):t.length>=e+r||e?new java.lang.String(t,e,r)+"":t}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(t){mn.prototype[t]=function(){return null}});function hn(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}function tf(t){if(t==="error")throw"onErrorStopParsing"}function rf(){throw"onWarningStopParsing"}jt.__DOMHandler=mn;jt.DOMParser=Ia;jt.normalizeLineEndings=Oa;jt.onErrorStopParsing=tf;jt.onWarningStopParsing=rf});var ki=Xe(M=>{"use strict";var Vt=ht();M.assign=Vt.assign;M.hasDefaultHTMLNamespace=Vt.hasDefaultHTMLNamespace;M.isHTMLMimeType=Vt.isHTMLMimeType;M.isValidMimeType=Vt.isValidMimeType;M.MIME_TYPE=Vt.MIME_TYPE;M.NAMESPACE=Vt.NAMESPACE;var _n=cr();M.DOMException=_n.DOMException;M.DOMExceptionName=_n.DOMExceptionName;M.ExceptionCode=_n.ExceptionCode;M.ParseError=_n.ParseError;var K=wi();M.Attr=K.Attr;M.CDATASection=K.CDATASection;M.CharacterData=K.CharacterData;M.Comment=K.Comment;M.Document=K.Document;M.DocumentFragment=K.DocumentFragment;M.DocumentType=K.DocumentType;M.DOMImplementation=K.DOMImplementation;M.Element=K.Element;M.Entity=K.Entity;M.EntityReference=K.EntityReference;M.LiveNodeList=K.LiveNodeList;M.NamedNodeMap=K.NamedNodeMap;M.Node=K.Node;M.NodeList=K.NodeList;M.Notation=K.Notation;M.ProcessingInstruction=K.ProcessingInstruction;M.Text=K.Text;M.XMLSerializer=K.XMLSerializer;var gn=Ba();M.DOMParser=gn.DOMParser;M.normalizeLineEndings=gn.normalizeLineEndings;M.onErrorStopParsing=gn.onErrorStopParsing;M.onWarningStopParsing=gn.onWarningStopParsing});import{Bag as Le,sourceTarget as _d}from"@gramlot/gramlot";import gd from"@gramlot/collections/inputs";import bd from"@gramlot/collections/layout";var Ue={};Xi(Ue,{defineCollection:()=>Mn});Yt(Ue,Ad);import*as Ad from"@gramlot/gramlot/components";import{defineCollection as Ro}from"@gramlot/gramlot/components";function Mn(t){if(t.name!=="drawing")throw new Error("Unexpected bundled collection");let e=[],r={};t.css?.forEach((n,i)=>{n.href=e[i].href});for(let[n,i]of Object.entries(t.assets??{}))i.href=r[n].href;return Ro({...t,css:e,assets:r})}function Yi(t,e){return t.parameters=Lo(t.constructor.gramlotComponent,e),Object.fromEntries(Object.entries(e).filter(([r])=>!Object.hasOwn(t.parameters,r)))}function Lo(t,e){return Object.fromEntries(Object.entries(t.parameters).map(([r,n])=>[r,Object.hasOwn(e,r)?e[r]:n.default]))}function Rn(t){return class extends t{constructor(){super();let e=this.attachShadow({mode:"open"}),r=this.ownerDocument.createElement("style");r.textContent=`:host{box-sizing:border-box;display:block;min-width:0;font:inherit;color:var(--gramlot-ink,CanvasText)}
|
|
1
|
+
var C=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var E=(n,t)=>{for(var e in t)C(n,e,{get:t[e],enumerable:!0})},k=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of z(t))!A.call(n,s)&&s!==e&&C(n,s,{get:()=>t[s],enumerable:!(i=$(t,s))||i.enumerable});return n},m=(n,t,e)=>(k(n,t,"default"),e&&k(e,t,"default"));import{Bag as h,sourceTarget as _}from"@gramlot/gramlot";import L from"@gramlot/collections/inputs";import R from"@gramlot/collections/layout";var d={};E(d,{defineCollection:()=>b});m(d,Y);import*as Y from"@gramlot/gramlot/components";import{defineCollection as B}from"@gramlot/gramlot/components";function b(n){if(n.name!=="drawing")throw new Error("Unexpected bundled collection");let t=[],e={};n.css?.forEach((i,s)=>{i.href=t[s].href});for(let[i,s]of Object.entries(n.assets??{}))s.href=e[i].href;return B({...n,css:t,assets:e})}import{sharedModules as P}from"@gramlot/gramlot";var N=n=>P["./components/parameters.js"][n];var I=N("projectParameters");function y(n){return class extends n{constructor(){super();let t=this.attachShadow({mode:"open"}),e=this.ownerDocument.createElement("style");e.textContent=`:host{box-sizing:border-box;display:block;min-width:0;font:inherit;color:var(--gramlot-ink,CanvasText)}
|
|
7
2
|
*,*::before,*::after{box-sizing:border-box}.control-box{min-width:0}slot{display:contents}
|
|
8
|
-
::slotted(*){min-width:0;max-width:100%}`,this.controlBox=this.ownerDocument.createElement("div"),this.controlBox.className="control-box",this.control=this.controlBox,this.control.id="control",this.control.append(this.ownerDocument.createElement("slot")),
|
|
9
|
-
`,s),s<0&&(s=t.length),n+=t.slice(a,s);continue}if(t.startsWith("/*",s)){let c=t.indexOf("*/",s+2);s=c<0?t.length:c+2,n+=t.slice(a,s);continue}if(o==="/"&&i){let c=!1;for(s++;s<t.length;){let f=t[s++];if(f==="\\"){s++;continue}if(f==="[")c=!0;else if(f==="]")c=!1;else if(f==="/"&&!c)break}for(;/[a-z]/i.test(t[s]??"")&&s<t.length;)s++;n+=t.slice(a,s),i=!1;continue}let u=o==="{"?t.slice(s).match(Zi):null;if(u){let c=u[1]??"";if(c.startsWith("?"))throw new SyntaxError("Optional slots are supported in pointer templates only");n+=`_pointerValues[${e.length}]`,e.push(c),s+=u[0].length,i=!1;continue}let l=t.slice(s).match(/^[A-Za-z_$][\w$]*/);if(l){r.add(l[0]),n+=l[0],s+=l[0].length,i=["return","typeof","void","delete","new","in","instanceof","yield","await"].includes(l[0]);continue}n+=o,s++,/\s/.test(o)||(i=/[([{,:;=!?&|+*%~<>\/-]/.test(o))}return{text:n,slots:e,identifiers:r}}function Ji(t,e,r=()=>null){let n=new Map,i=[],s=a=>{if(n.has(a))return n.get(a);if(!t.has(a))throw new Error(`Referenced Source attribute '${a}' does not exist`);if(i.includes(a))throw new Error(`Cyclic attribute dependency: ${[...i,a].join(" -> ")}`);i.push(a);try{let o=t.get(a),u=typeof a=="string"?Ge(o):null,l=e.get(a);if(u){let c=f=>f?s(f):e.get(a);if(u.expression){let f=$n(u.body);l=r(a,o,f,f.slots.map(c))}else l=Ln(u.body,c),e.get(a)==null&&(l=null)}return n.set(a,l),l}finally{i.pop()}};return new Map([...t.keys()].map(a=>[a,s(a)]))}function Un(t,e){let r=new Map([...Object.entries(t.getAttr()),...t.fixedAttrItems()]),n=new Set,i=[],s=a=>{let o=Ge(a);if(!o)return;let u=[];o.expression?u.push(...$n(o.body).slots):Ln(o.body,l=>(u.push(l),""));for(let l of u.filter(Boolean)){if(!r.has(l))throw new Error(`Referenced Source attribute '${l}' does not exist`);if(i.includes(l))throw new Error(`Cyclic attribute dependency: ${[...i,l].join(" -> ")}`);n.has(l)||(i.push(l),s(r.get(l)),i.pop(),n.add(l))}};return s(e),n}/*!
|
|
10
|
-
* decimal.js v10.6.0
|
|
11
|
-
* An arbitrary-precision Decimal type for JavaScript.
|
|
12
|
-
* https://github.com/MikeMcl/decimal.js
|
|
13
|
-
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
14
|
-
* MIT Licence
|
|
15
|
-
*/var Et=9e15,Ke=1e9,Fn="0123456789abcdef",Pr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",qr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Pn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Et,maxE:Et,crypto:!1},ts,Fe,T=!0,Vr="[DecimalError] ",Je=Vr+"Invalid argument: ",rs=Vr+"Precision limit exceeded",ns=Vr+"crypto unavailable",is="[object Decimal]",oe=Math.floor,Z=Math.pow,$o=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Uo=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Fo=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ss=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ee=1e7,D=7,Po=9007199254740991,qo=Pr.length-1,qn=qr.length-1,_={toStringTag:is};_.absoluteValue=_.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),E(t)};_.ceil=function(){return E(new this.constructor(this),this.e+1,2)};_.clampedTo=_.clamp=function(t,e){var r,n=this,i=n.constructor;if(t=new i(t),e=new i(e),!t.s||!e.s)return new i(NaN);if(t.gt(e))throw Error(Je+e);return r=n.cmp(t),r<0?t:n.cmp(e)>0?e:new i(n)};_.comparedTo=_.cmp=function(t){var e,r,n,i,s=this,a=s.d,o=(t=new s.constructor(t)).d,u=s.s,l=t.s;if(!a||!o)return!u||!l?NaN:u!==l?u:a===o?0:!a^u<0?1:-1;if(!a[0]||!o[0])return a[0]?u:o[0]?-l:0;if(u!==l)return u;if(s.e!==t.e)return s.e>t.e^u<0?1:-1;for(n=a.length,i=o.length,e=0,r=n<i?n:i;e<r;++e)if(a[e]!==o[e])return a[e]>o[e]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1};_.cosine=_.cos=function(){var t,e,r=this,n=r.constructor;return r.d?r.d[0]?(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+D,n.rounding=1,r=jo(n,cs(n,r)),n.precision=t,n.rounding=e,E(Fe==2||Fe==3?r.neg():r,t,e,!0)):new n(1):new n(NaN)};_.cubeRoot=_.cbrt=function(){var t,e,r,n,i,s,a,o,u,l,c=this,f=c.constructor;if(!c.isFinite()||c.isZero())return new f(c);for(T=!1,s=c.s*Z(c.s*c,1/3),!s||Math.abs(s)==1/0?(r=ie(c.d),t=c.e,(s=(t-r.length+1)%3)&&(r+=s==1||s==-2?"0":"00"),s=Z(r,1/3),t=oe((t+1)/3)-(t%3==(t<0?-1:2)),s==1/0?r="5e"+t:(r=s.toExponential(),r=r.slice(0,r.indexOf("e")+1)+t),n=new f(r),n.s=c.s):n=new f(s.toString()),a=(t=f.precision)+3;;)if(o=n,u=o.times(o).times(o),l=u.plus(c),n=P(l.plus(c).times(o),l.plus(u),a+2,1),ie(o.d).slice(0,a)===(r=ie(n.d)).slice(0,a))if(r=r.slice(a-3,a+1),r=="9999"||!i&&r=="4999"){if(!i&&(E(o,t+1,0),o.times(o).times(o).eq(c))){n=o;break}a+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(E(n,t+1,1),e=!n.times(n).times(n).eq(c));break}return T=!0,E(n,t,f.rounding,e)};_.decimalPlaces=_.dp=function(){var t,e=this.d,r=NaN;if(e){if(t=e.length-1,r=(t-oe(this.e/D))*D,t=e[t],t)for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r};_.dividedBy=_.div=function(t){return P(this,new this.constructor(t))};_.dividedToIntegerBy=_.divToInt=function(t){var e=this,r=e.constructor;return E(P(e,new r(t),0,1,1),r.precision,r.rounding)};_.equals=_.eq=function(t){return this.cmp(t)===0};_.floor=function(){return E(new this.constructor(this),this.e+1,3)};_.greaterThan=_.gt=function(t){return this.cmp(t)>0};_.greaterThanOrEqualTo=_.gte=function(t){var e=this.cmp(t);return e==1||e===0};_.hyperbolicCosine=_.cosh=function(){var t,e,r,n,i,s=this,a=s.constructor,o=new a(1);if(!s.isFinite())return new a(s.s?1/0:NaN);if(s.isZero())return o;r=a.precision,n=a.rounding,a.precision=r+Math.max(s.e,s.sd())+4,a.rounding=1,i=s.d.length,i<32?(t=Math.ceil(i/3),e=(1/Hr(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),s=Dt(a,1,s.times(e),new a(1),!0);for(var u,l=t,c=new a(8);l--;)u=s.times(s),s=o.minus(u.times(c.minus(u.times(c))));return E(s,a.precision=r,a.rounding=n,!0)};_.hyperbolicSine=_.sinh=function(){var t,e,r,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(e=s.precision,r=s.rounding,s.precision=e+Math.max(i.e,i.sd())+4,s.rounding=1,n=i.d.length,n<3)i=Dt(s,2,i,i,!0);else{t=1.4*Math.sqrt(n),t=t>16?16:t|0,i=i.times(1/Hr(5,t)),i=Dt(s,2,i,i,!0);for(var a,o=new s(5),u=new s(16),l=new s(20);t--;)a=i.times(i),i=i.times(o.plus(a.times(u.times(a).plus(l))))}return s.precision=e,s.rounding=r,E(i,e,r,!0)};_.hyperbolicTangent=_.tanh=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+7,n.rounding=1,P(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)};_.inverseCosine=_.acos=function(){var t=this,e=t.constructor,r=t.abs().cmp(1),n=e.precision,i=e.rounding;return r!==-1?r===0?t.isNeg()?Te(e,n,i):new e(0):new e(NaN):t.isZero()?Te(e,n+4,i).times(.5):(e.precision=n+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=n,e.rounding=i,t.times(2))};_.inverseHyperbolicCosine=_.acosh=function(){var t,e,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(t=n.precision,e=n.rounding,n.precision=t+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,T=!1,r=r.times(r).minus(1).sqrt().plus(r),T=!0,n.precision=t,n.rounding=e,r.ln()):new n(r)};_.inverseHyperbolicSine=_.asinh=function(){var t,e,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,T=!1,r=r.times(r).plus(1).sqrt().plus(r),T=!0,n.precision=t,n.rounding=e,r.ln())};_.inverseHyperbolicTangent=_.atanh=function(){var t,e,r,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=s.precision,e=s.rounding,n=i.sd(),Math.max(n,t)<2*-i.e-1?E(new s(i),t,e,!0):(s.precision=r=n-i.e,i=P(i.plus(1),new s(1).minus(i),r+t,1),s.precision=t+4,s.rounding=1,i=i.ln(),s.precision=t,s.rounding=e,i.times(.5))):new s(NaN)};_.inverseSine=_.asin=function(){var t,e,r,n,i=this,s=i.constructor;return i.isZero()?new s(i):(e=i.abs().cmp(1),r=s.precision,n=s.rounding,e!==-1?e===0?(t=Te(s,r+4,n).times(.5),t.s=i.s,t):new s(NaN):(s.precision=r+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=r,s.rounding=n,i.times(2)))};_.inverseTangent=_.atan=function(){var t,e,r,n,i,s,a,o,u,l=this,c=l.constructor,f=c.precision,d=c.rounding;if(l.isFinite()){if(l.isZero())return new c(l);if(l.abs().eq(1)&&f+4<=qn)return a=Te(c,f+4,d).times(.25),a.s=l.s,a}else{if(!l.s)return new c(NaN);if(f+4<=qn)return a=Te(c,f+4,d).times(.5),a.s=l.s,a}for(c.precision=o=f+10,c.rounding=1,r=Math.min(28,o/D+2|0),t=r;t;--t)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(T=!1,e=Math.ceil(o/D),n=1,u=l.times(l),a=new c(l),i=l;t!==-1;)if(i=i.times(u),s=a.minus(i.div(n+=2)),i=i.times(u),a=s.plus(i.div(n+=2)),a.d[e]!==void 0)for(t=e;a.d[t]===s.d[t]&&t--;);return r&&(a=a.times(2<<r-1)),T=!0,E(a,c.precision=f,c.rounding=d,!0)};_.isFinite=function(){return!!this.d};_.isInteger=_.isInt=function(){return!!this.d&&oe(this.e/D)>this.d.length-2};_.isNaN=function(){return!this.s};_.isNegative=_.isNeg=function(){return this.s<0};_.isPositive=_.isPos=function(){return this.s>0};_.isZero=function(){return!!this.d&&this.d[0]===0};_.lessThan=_.lt=function(t){return this.cmp(t)<0};_.lessThanOrEqualTo=_.lte=function(t){return this.cmp(t)<1};_.logarithm=_.log=function(t){var e,r,n,i,s,a,o,u,l=this,c=l.constructor,f=c.precision,d=c.rounding,p=5;if(t==null)t=new c(10),e=!0;else{if(t=new c(t),r=t.d,t.s<0||!r||!r[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new c(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(e)if(r.length>1)s=!0;else{for(i=r[0];i%10===0;)i/=10;s=i!==1}if(T=!1,o=f+p,a=Ze(l,o),n=e?jr(c,o+10):Ze(t,o),u=P(a,n,o,1),Jt(u.d,i=f,d))do if(o+=10,a=Ze(l,o),n=e?jr(c,o+10):Ze(t,o),u=P(a,n,o,1),!s){+ie(u.d).slice(i+1,i+15)+1==1e14&&(u=E(u,f+1,0));break}while(Jt(u.d,i+=10,d));return T=!0,E(u,f,d)};_.minus=_.sub=function(t){var e,r,n,i,s,a,o,u,l,c,f,d,p=this,m=p.constructor;if(t=new m(t),!p.d||!t.d)return!p.s||!t.s?t=new m(NaN):p.d?t.s=-t.s:t=new m(t.d||p.s!==t.s?p:NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(l=p.d,d=t.d,o=m.precision,u=m.rounding,!l[0]||!d[0]){if(d[0])t.s=-t.s;else if(l[0])t=new m(p);else return new m(u===3?-0:0);return T?E(t,o,u):t}if(r=oe(t.e/D),c=oe(p.e/D),l=l.slice(),s=c-r,s){for(f=s<0,f?(e=l,s=-s,a=d.length):(e=d,r=c,a=l.length),n=Math.max(Math.ceil(o/D),a)+2,s>n&&(s=n,e.length=1),e.reverse(),n=s;n--;)e.push(0);e.reverse()}else{for(n=l.length,a=d.length,f=n<a,f&&(a=n),n=0;n<a;n++)if(l[n]!=d[n]){f=l[n]<d[n];break}s=0}for(f&&(e=l,l=d,d=e,t.s=-t.s),a=l.length,n=d.length-a;n>0;--n)l[a++]=0;for(n=d.length;n>s;){if(l[--n]<d[n]){for(i=n;i&&l[--i]===0;)l[i]=Ee-1;--l[i],l[n]+=Ee}l[n]-=d[n]}for(;l[--a]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=zr(l,r),T?E(t,o,u):t):new m(u===3?-0:0)};_.modulo=_.mod=function(t){var e,r=this,n=r.constructor;return t=new n(t),!r.d||!t.s||t.d&&!t.d[0]?new n(NaN):!t.d||r.d&&!r.d[0]?E(new n(r),n.precision,n.rounding):(T=!1,n.modulo==9?(e=P(r,t.abs(),0,3,1),e.s*=t.s):e=P(r,t,0,n.modulo,1),e=e.times(t),T=!0,r.minus(e))};_.naturalExponential=_.exp=function(){return jn(this)};_.naturalLogarithm=_.ln=function(){return Ze(this)};_.negated=_.neg=function(){var t=new this.constructor(this);return t.s=-t.s,E(t)};_.plus=_.add=function(t){var e,r,n,i,s,a,o,u,l,c,f=this,d=f.constructor;if(t=new d(t),!f.d||!t.d)return!f.s||!t.s?t=new d(NaN):f.d||(t=new d(t.d||f.s===t.s?f:NaN)),t;if(f.s!=t.s)return t.s=-t.s,f.minus(t);if(l=f.d,c=t.d,o=d.precision,u=d.rounding,!l[0]||!c[0])return c[0]||(t=new d(f)),T?E(t,o,u):t;if(s=oe(f.e/D),n=oe(t.e/D),l=l.slice(),i=s-n,i){for(i<0?(r=l,i=-i,a=c.length):(r=c,n=s,a=l.length),s=Math.ceil(o/D),a=s>a?s+1:a+1,i>a&&(i=a,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(a=l.length,i=c.length,a-i<0&&(i=a,r=c,c=l,l=r),e=0;i;)e=(l[--i]=l[i]+c[i]+e)/Ee|0,l[i]%=Ee;for(e&&(l.unshift(e),++n),a=l.length;l[--a]==0;)l.pop();return t.d=l,t.e=zr(l,n),T?E(t,o,u):t};_.precision=_.sd=function(t){var e,r=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Je+t);return r.d?(e=as(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e};_.round=function(){var t=this,e=t.constructor;return E(new e(t),t.e+1,e.rounding)};_.sine=_.sin=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+D,n.rounding=1,r=zo(n,cs(n,r)),n.precision=t,n.rounding=e,E(Fe>2?r.neg():r,t,e,!0)):new n(NaN)};_.squareRoot=_.sqrt=function(){var t,e,r,n,i,s,a=this,o=a.d,u=a.e,l=a.s,c=a.constructor;if(l!==1||!o||!o[0])return new c(!l||l<0&&(!o||o[0])?NaN:o?a:1/0);for(T=!1,l=Math.sqrt(+a),l==0||l==1/0?(e=ie(o),(e.length+u)%2==0&&(e+="0"),l=Math.sqrt(e),u=oe((u+1)/2)-(u<0||u%2),l==1/0?e="5e"+u:(e=l.toExponential(),e=e.slice(0,e.indexOf("e")+1)+u),n=new c(e)):n=new c(l.toString()),r=(u=c.precision)+3;;)if(s=n,n=s.plus(P(a,s,r+2,1)).times(.5),ie(s.d).slice(0,r)===(e=ie(n.d)).slice(0,r))if(e=e.slice(r-3,r+1),e=="9999"||!i&&e=="4999"){if(!i&&(E(s,u+1,0),s.times(s).eq(a))){n=s;break}r+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(E(n,u+1,1),t=!n.times(n).eq(a));break}return T=!0,E(n,u,c.rounding,t)};_.tangent=_.tan=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+10,n.rounding=1,r=r.sin(),r.s=1,r=P(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,E(Fe==2||Fe==4?r.neg():r,t,e,!0)):new n(NaN)};_.times=_.mul=function(t){var e,r,n,i,s,a,o,u,l,c=this,f=c.constructor,d=c.d,p=(t=new f(t)).d;if(t.s*=c.s,!d||!d[0]||!p||!p[0])return new f(!t.s||d&&!d[0]&&!p||p&&!p[0]&&!d?NaN:!d||!p?t.s/0:t.s*0);for(r=oe(c.e/D)+oe(t.e/D),u=d.length,l=p.length,u<l&&(s=d,d=p,p=s,a=u,u=l,l=a),s=[],a=u+l,n=a;n--;)s.push(0);for(n=l;--n>=0;){for(e=0,i=u+n;i>n;)o=s[i]+p[n]*d[i-n-1]+e,s[i--]=o%Ee|0,e=o/Ee|0;s[i]=(s[i]+e)%Ee|0}for(;!s[--a];)s.pop();return e?++r:s.shift(),t.d=s,t.e=zr(s,r),T?E(t,f.precision,f.rounding):t};_.toBinary=function(t,e){return Vn(this,2,t,e)};_.toDecimalPlaces=_.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(de(t,0,Ke),e===void 0?e=n.rounding:de(e,0,8),E(r,t+r.e+1,e))};_.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Ce(n,!0):(de(t,0,Ke),e===void 0?e=i.rounding:de(e,0,8),n=E(new i(n),t+1,e),r=Ce(n,!0,t+1)),n.isNeg()&&!n.isZero()?"-"+r:r};_.toFixed=function(t,e){var r,n,i=this,s=i.constructor;return t===void 0?r=Ce(i):(de(t,0,Ke),e===void 0?e=s.rounding:de(e,0,8),n=E(new s(i),t+i.e+1,e),r=Ce(n,!1,t+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};_.toFraction=function(t){var e,r,n,i,s,a,o,u,l,c,f,d,p=this,m=p.d,h=p.constructor;if(!m)return new h(p);if(l=r=new h(1),n=u=new h(0),e=new h(n),s=e.e=as(m)-p.e-1,a=s%D,e.d[0]=Z(10,a<0?D+a:a),t==null)t=s>0?e:l;else{if(o=new h(t),!o.isInt()||o.lt(l))throw Error(Je+o);t=o.gt(e)?s>0?e:l:o}for(T=!1,o=new h(ie(m)),c=h.precision,h.precision=s=m.length*D*2;f=P(o,e,0,1,1),i=r.plus(f.times(n)),i.cmp(t)!=1;)r=n,n=i,i=l,l=u.plus(f.times(i)),u=i,i=e,e=o.minus(f.times(i)),o=i;return i=P(t.minus(r),n,0,1,1),u=u.plus(i.times(l)),r=r.plus(i.times(n)),u.s=l.s=p.s,d=P(l,n,s,1).minus(p).abs().cmp(P(u,r,s,1).minus(p).abs())<1?[l,n]:[u,r],h.precision=c,T=!0,d};_.toHexadecimal=_.toHex=function(t,e){return Vn(this,16,t,e)};_.toNearest=function(t,e){var r=this,n=r.constructor;if(r=new n(r),t==null){if(!r.d)return r;t=new n(1),e=n.rounding}else{if(t=new n(t),e===void 0?e=n.rounding:de(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(T=!1,r=P(r,t,0,e,1).times(t),T=!0,E(r)):(t.s=r.s,r=t),r};_.toNumber=function(){return+this};_.toOctal=function(t,e){return Vn(this,8,t,e)};_.toPower=_.pow=function(t){var e,r,n,i,s,a,o=this,u=o.constructor,l=+(t=new u(t));if(!o.d||!t.d||!o.d[0]||!t.d[0])return new u(Z(+o,l));if(o=new u(o),o.eq(1))return o;if(n=u.precision,s=u.rounding,t.eq(1))return E(o,n,s);if(e=oe(t.e/D),e>=t.d.length-1&&(r=l<0?-l:l)<=Po)return i=os(u,o,r,n),t.s<0?new u(1).div(i):E(i,n,s);if(a=o.s,a<0){if(e<t.d.length-1)return new u(NaN);if((t.d[e]&1)==0&&(a=1),o.e==0&&o.d[0]==1&&o.d.length==1)return o.s=a,o}return r=Z(+o,l),e=r==0||!isFinite(r)?oe(l*(Math.log("0."+ie(o.d))/Math.LN10+o.e+1)):new u(r+"").e,e>u.maxE+1||e<u.minE-1?new u(e>0?a/0:0):(T=!1,u.rounding=o.s=1,r=Math.min(12,(e+"").length),i=jn(t.times(Ze(o,n+r)),n),i.d&&(i=E(i,n+5,1),Jt(i.d,n,s)&&(e=n+10,i=E(jn(t.times(Ze(o,e+r)),e),e+5,1),+ie(i.d).slice(n+1,n+15)+1==1e14&&(i=E(i,n+1,0)))),i.s=a,T=!0,u.rounding=s,E(i,n,s))};_.toPrecision=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Ce(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(de(t,1,Ke),e===void 0?e=i.rounding:de(e,0,8),n=E(new i(n),t,e),r=Ce(n,t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+r:r};_.toSignificantDigits=_.toSD=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(de(t,1,Ke),e===void 0?e=n.rounding:de(e,0,8)),E(new n(r),t,e)};_.toString=function(){var t=this,e=t.constructor,r=Ce(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r};_.truncated=_.trunc=function(){return E(new this.constructor(this),this.e+1,1)};_.valueOf=_.toJSON=function(){var t=this,e=t.constructor,r=Ce(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};function ie(t){var e,r,n,i=t.length-1,s="",a=t[0];if(i>0){for(s+=a,e=1;e<i;e++)n=t[e]+"",r=D-n.length,r&&(s+=Ye(r)),s+=n;a=t[e],n=a+"",r=D-n.length,r&&(s+=Ye(r))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}function de(t,e,r){if(t!==~~t||t<e||t>r)throw Error(Je+t)}function Jt(t,e,r,n){var i,s,a,o;for(s=t[0];s>=10;s/=10)--e;return--e<0?(e+=D,i=0):(i=Math.ceil((e+1)/D),e%=D),s=Z(10,D-e),o=t[i]%s|0,n==null?e<3?(e==0?o=o/100|0:e==1&&(o=o/10|0),a=r<4&&o==99999||r>3&&o==49999||o==5e4||o==0):a=(r<4&&o+1==s||r>3&&o+1==s/2)&&(t[i+1]/s/100|0)==Z(10,e-2)-1||(o==s/2||o==0)&&(t[i+1]/s/100|0)==0:e<4?(e==0?o=o/1e3|0:e==1?o=o/100|0:e==2&&(o=o/10|0),a=(n||r<4)&&o==9999||!n&&r>3&&o==4999):a=((n||r<4)&&o+1==s||!n&&r>3&&o+1==s/2)&&(t[i+1]/s/1e3|0)==Z(10,e-3)-1,a}function Ur(t,e,r){for(var n,i=[0],s,a=0,o=t.length;a<o;){for(s=i.length;s--;)i[s]*=e;for(i[0]+=Fn.indexOf(t.charAt(a++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function jo(t,e){var r,n,i;if(e.isZero())return e;n=e.d.length,n<32?(r=Math.ceil(n/3),i=(1/Hr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),t.precision+=r,e=Dt(t,1,e.times(i),new t(1));for(var s=r;s--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return t.precision-=r,e}var P=(function(){function t(n,i,s){var a,o=0,u=n.length;for(n=n.slice();u--;)a=n[u]*i+o,n[u]=a%s|0,o=a/s|0;return o&&n.unshift(o),n}function e(n,i,s,a){var o,u;if(s!=a)u=s>a?1:-1;else for(o=u=0;o<s;o++)if(n[o]!=i[o]){u=n[o]>i[o]?1:-1;break}return u}function r(n,i,s,a){for(var o=0;s--;)n[s]-=o,o=n[s]<i[s]?1:0,n[s]=o*a+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,a,o,u){var l,c,f,d,p,m,h,g,b,k,y,A,I,L,X,te,re,$e,Y,ce,be=n.constructor,F=n.s==i.s?1:-1,G=n.d,S=i.d;if(!G||!G[0]||!S||!S[0])return new be(!n.s||!i.s||(G?S&&G[0]==S[0]:!S)?NaN:G&&G[0]==0||!S?F*0:F/0);for(u?(p=1,c=n.e-i.e):(u=Ee,p=D,c=oe(n.e/p)-oe(i.e/p)),Y=S.length,re=G.length,b=new be(F),k=b.d=[],f=0;S[f]==(G[f]||0);f++);if(S[f]>(G[f]||0)&&c--,s==null?(L=s=be.precision,a=be.rounding):o?L=s+(n.e-i.e)+1:L=s,L<0)k.push(1),m=!0;else{if(L=L/p+2|0,f=0,Y==1){for(d=0,S=S[0],L++;(f<re||d)&&L--;f++)X=d*u+(G[f]||0),k[f]=X/S|0,d=X%S|0;m=d||f<re}else{for(d=u/(S[0]+1)|0,d>1&&(S=t(S,d,u),G=t(G,d,u),Y=S.length,re=G.length),te=Y,y=G.slice(0,Y),A=y.length;A<Y;)y[A++]=0;ce=S.slice(),ce.unshift(0),$e=S[0],S[1]>=u/2&&++$e;do d=0,l=e(S,y,Y,A),l<0?(I=y[0],Y!=A&&(I=I*u+(y[1]||0)),d=I/$e|0,d>1?(d>=u&&(d=u-1),h=t(S,d,u),g=h.length,A=y.length,l=e(h,y,g,A),l==1&&(d--,r(h,Y<g?ce:S,g,u))):(d==0&&(l=d=1),h=S.slice()),g=h.length,g<A&&h.unshift(0),r(y,h,A,u),l==-1&&(A=y.length,l=e(S,y,Y,A),l<1&&(d++,r(y,Y<A?ce:S,A,u))),A=y.length):l===0&&(d++,y=[0]),k[f++]=d,l&&y[0]?y[A++]=G[te]||0:(y=[G[te]],A=1);while((te++<re||y[0]!==void 0)&&L--);m=y[0]!==void 0}k[0]||k.shift()}if(p==1)b.e=c,ts=m;else{for(f=1,d=k[0];d>=10;d/=10)f++;b.e=f+c*p-1,E(b,o?s+b.e+1:s,a,m)}return b}})();function E(t,e,r,n){var i,s,a,o,u,l,c,f,d,p=t.constructor;e:if(e!=null){if(f=t.d,!f)return t;for(i=1,o=f[0];o>=10;o/=10)i++;if(s=e-i,s<0)s+=D,a=e,c=f[d=0],u=c/Z(10,i-a-1)%10|0;else if(d=Math.ceil((s+1)/D),o=f.length,d>=o)if(n){for(;o++<=d;)f.push(0);c=u=0,i=1,s%=D,a=s-D+1}else break e;else{for(c=o=f[d],i=1;o>=10;o/=10)i++;s%=D,a=s-D+i,u=a<0?0:c/Z(10,i-a-1)%10|0}if(n=n||e<0||f[d+1]!==void 0||(a<0?c:c%Z(10,i-a-1)),l=r<4?(u||n)&&(r==0||r==(t.s<0?3:2)):u>5||u==5&&(r==4||n||r==6&&(s>0?a>0?c/Z(10,i-a):0:f[d-1])%10&1||r==(t.s<0?8:7)),e<1||!f[0])return f.length=0,l?(e-=t.e+1,f[0]=Z(10,(D-e%D)%D),t.e=-e||0):f[0]=t.e=0,t;if(s==0?(f.length=d,o=1,d--):(f.length=d+1,o=Z(10,D-s),f[d]=a>0?(c/Z(10,i-a)%Z(10,a)|0)*o:0),l)for(;;)if(d==0){for(s=1,a=f[0];a>=10;a/=10)s++;for(a=f[0]+=o,o=1;a>=10;a/=10)o++;s!=o&&(t.e++,f[0]==Ee&&(f[0]=1));break}else{if(f[d]+=o,f[d]!=Ee)break;f[d--]=0,o=1}for(s=f.length;f[--s]===0;)f.pop()}return T&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e<p.minE&&(t.e=0,t.d=[0])),t}function Ce(t,e,r){if(!t.isFinite())return us(t);var n,i=t.e,s=ie(t.d),a=s.length;return e?(r&&(n=r-a)>0?s=s.charAt(0)+"."+s.slice(1)+Ye(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(t.e<0?"e":"e+")+t.e):i<0?(s="0."+Ye(-i-1)+s,r&&(n=r-a)>0&&(s+=Ye(n))):i>=a?(s+=Ye(i+1-a),r&&(n=r-i-1)>0&&(s=s+"."+Ye(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-a)>0&&(i+1===a&&(s+="."),s+=Ye(n))),s}function zr(t,e){var r=t[0];for(e*=D;r>=10;r/=10)e++;return e}function jr(t,e,r){if(e>qo)throw T=!0,r&&(t.precision=r),Error(rs);return E(new t(Pr),e,1,!0)}function Te(t,e,r){if(e>qn)throw Error(rs);return E(new t(qr),e,r,!0)}function as(t){var e=t.length-1,r=e*D+1;if(e=t[e],e){for(;e%10==0;e/=10)r--;for(e=t[0];e>=10;e/=10)r++}return r}function Ye(t){for(var e="";t--;)e+="0";return e}function os(t,e,r,n){var i,s=new t(1),a=Math.ceil(n/D+4);for(T=!1;;){if(r%2&&(s=s.times(e),Qi(s.d,a)&&(i=!0)),r=oe(r/2),r===0){r=s.d.length-1,i&&s.d[r]===0&&++s.d[r];break}e=e.times(e),Qi(e.d,a)}return T=!0,s}function Ki(t){return t.d[t.d.length-1]&1}function ls(t,e,r){for(var n,i,s=new t(e[0]),a=0;++a<e.length;){if(i=new t(e[a]),!i.s){s=i;break}n=s.cmp(i),(n===r||n===0&&s.s===r)&&(s=i)}return s}function jn(t,e){var r,n,i,s,a,o,u,l=0,c=0,f=0,d=t.constructor,p=d.rounding,m=d.precision;if(!t.d||!t.d[0]||t.e>17)return new d(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(e==null?(T=!1,u=m):u=e,o=new d(.03125);t.e>-2;)t=t.times(o),f+=5;for(n=Math.log(Z(2,f))/Math.LN10*2+5|0,u+=n,r=s=a=new d(1),d.precision=u;;){if(s=E(s.times(t),u,1),r=r.times(++c),o=a.plus(P(s,r,u,1)),ie(o.d).slice(0,u)===ie(a.d).slice(0,u)){for(i=f;i--;)a=E(a.times(a),u,1);if(e==null)if(l<3&&Jt(a.d,u-n,p,l))d.precision=u+=10,r=s=o=new d(1),c=0,l++;else return E(a,d.precision=m,p,T=!0);else return d.precision=m,a}a=o}}function Ze(t,e){var r,n,i,s,a,o,u,l,c,f,d,p=1,m=10,h=t,g=h.d,b=h.constructor,k=b.rounding,y=b.precision;if(h.s<0||!g||!g[0]||!h.e&&g[0]==1&&g.length==1)return new b(g&&!g[0]?-1/0:h.s!=1?NaN:g?0:h);if(e==null?(T=!1,c=y):c=e,b.precision=c+=m,r=ie(g),n=r.charAt(0),Math.abs(s=h.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(t),r=ie(h.d),n=r.charAt(0),p++;s=h.e,n>1?(h=new b("0."+r),s++):h=new b(n+"."+r.slice(1))}else return l=jr(b,c+2,y).times(s+""),h=Ze(new b(n+"."+r.slice(1)),c-m).plus(l),b.precision=y,e==null?E(h,y,k,T=!0):h;for(f=h,u=a=h=P(h.minus(1),h.plus(1),c,1),d=E(h.times(h),c,1),i=3;;){if(a=E(a.times(d),c,1),l=u.plus(P(a,new b(i),c,1)),ie(l.d).slice(0,c)===ie(u.d).slice(0,c))if(u=u.times(2),s!==0&&(u=u.plus(jr(b,c+2,y).times(s+""))),u=P(u,new b(p),c,1),e==null)if(Jt(u.d,c-m,k,o))b.precision=c+=m,l=a=h=P(f.minus(1),f.plus(1),c,1),d=E(h.times(h),c,1),i=o=1;else return E(u,b.precision=y,k,T=!0);else return b.precision=y,u;u=l,i+=2}}function us(t){return String(t.s*t.s/0)}function Fr(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;n++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(n,i),e){if(i-=n,t.e=r=r-n-1,t.d=[],n=(r+1)%D,r<0&&(n+=D),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=D;n<i;)t.d.push(+e.slice(n,n+=D));e=e.slice(n),n=D-e.length}else n-=i;for(;n--;)e+="0";t.d.push(+e),T&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function Vo(t,e){var r,n,i,s,a,o,u,l,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),ss.test(e))return Fr(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(Uo.test(e))r=16,e=e.toLowerCase();else if($o.test(e))r=2;else if(Fo.test(e))r=8;else throw Error(Je+e);for(s=e.search(/p/i),s>0?(u=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),s=e.indexOf("."),a=s>=0,n=t.constructor,a&&(e=e.replace(".",""),o=e.length,s=o-s,i=os(n,new n(r),s,s*2)),l=Ur(e,r,Ee),c=l.length-1,s=c;l[s]===0;--s)l.pop();return s<0?new n(t.s*0):(t.e=zr(l,c),t.d=l,T=!1,a&&(t=P(t,i,o*4)),u&&(t=t.times(Math.abs(u)<54?Z(2,u):Kt.pow(2,u))),T=!0,t)}function zo(t,e){var r,n=e.d.length;if(n<3)return e.isZero()?e:Dt(t,2,e,e);r=1.4*Math.sqrt(n),r=r>16?16:r|0,e=e.times(1/Hr(5,r)),e=Dt(t,2,e,e);for(var i,s=new t(5),a=new t(16),o=new t(20);r--;)i=e.times(e),e=e.times(s.plus(i.times(a.times(i).minus(o))));return e}function Dt(t,e,r,n,i){var s,a,o,u,l=1,c=t.precision,f=Math.ceil(c/D);for(T=!1,u=r.times(r),o=new t(n);;){if(a=P(o.times(u),new t(e++*e++),c,1),o=i?n.plus(a):n.minus(a),n=P(a.times(u),new t(e++*e++),c,1),a=o.plus(n),a.d[f]!==void 0){for(s=f;a.d[s]===o.d[s]&&s--;);if(s==-1)break}s=o,o=n,n=a,a=s,l++}return T=!0,a.d.length=f+1,a}function Hr(t,e){for(var r=t;--e;)r*=t;return r}function cs(t,e){var r,n=e.s<0,i=Te(t,t.precision,1),s=i.times(.5);if(e=e.abs(),e.lte(s))return Fe=n?4:1,e;if(r=e.divToInt(i),r.isZero())Fe=n?3:2;else{if(e=e.minus(r.times(i)),e.lte(s))return Fe=Ki(r)?n?2:3:n?4:1,e;Fe=Ki(r)?n?1:4:n?3:2}return e.minus(i).abs()}function Vn(t,e,r,n){var i,s,a,o,u,l,c,f,d,p=t.constructor,m=r!==void 0;if(m?(de(r,1,Ke),n===void 0?n=p.rounding:de(n,0,8)):(r=p.precision,n=p.rounding),!t.isFinite())c=us(t);else{for(c=Ce(t),a=c.indexOf("."),m?(i=2,e==16?r=r*4-3:e==8&&(r=r*3-2)):i=e,a>=0&&(c=c.replace(".",""),d=new p(1),d.e=c.length-a,d.d=Ur(Ce(d),10,i),d.e=d.d.length),f=Ur(c,10,i),s=u=f.length;f[--u]==0;)f.pop();if(!f[0])c=m?"0p+0":"0";else{if(a<0?s--:(t=new p(t),t.d=f,t.e=s,t=P(t,d,r,n,0,i),f=t.d,s=t.e,l=ts),a=f[r],o=i/2,l=l||f[r+1]!==void 0,l=n<4?(a!==void 0||l)&&(n===0||n===(t.s<0?3:2)):a>o||a===o&&(n===4||l||n===6&&f[r-1]&1||n===(t.s<0?8:7)),f.length=r,l)for(;++f[--r]>i-1;)f[r]=0,r||(++s,f.unshift(1));for(u=f.length;!f[u-1];--u);for(a=0,c="";a<u;a++)c+=Fn.charAt(f[a]);if(m){if(u>1)if(e==16||e==8){for(a=e==16?4:3,--u;u%a;u++)c+="0";for(f=Ur(c,i,e),u=f.length;!f[u-1];--u);for(a=1,c="1.";a<u;a++)c+=Fn.charAt(f[a])}else c=c.charAt(0)+"."+c.slice(1);c=c+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)c="0"+c;c="0."+c}else if(++s>u)for(s-=u;s--;)c+="0";else s<u&&(c=c.slice(0,s)+"."+c.slice(s))}c=(e==16?"0x":e==2?"0b":e==8?"0o":"")+c}return t.s<0?"-"+c:c}function Qi(t,e){if(t.length>e)return t.length=e,!0}function Ho(t){return new this(t).abs()}function Wo(t){return new this(t).acos()}function Xo(t){return new this(t).acosh()}function Go(t,e){return new this(t).plus(e)}function Yo(t){return new this(t).asin()}function Zo(t){return new this(t).asinh()}function Jo(t){return new this(t).atan()}function Ko(t){return new this(t).atanh()}function Qo(t,e){t=new this(t),e=new this(e);var r,n=this.precision,i=this.rounding,s=n+4;return!t.s||!e.s?r=new this(NaN):!t.d&&!e.d?(r=Te(this,s,1).times(e.s>0?.25:.75),r.s=t.s):!e.d||t.isZero()?(r=e.s<0?Te(this,n,i):new this(0),r.s=t.s):!t.d||e.isZero()?(r=Te(this,s,1).times(.5),r.s=t.s):e.s<0?(this.precision=s,this.rounding=1,r=this.atan(P(t,e,s,1)),e=Te(this,s,1),this.precision=n,this.rounding=i,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(P(t,e,s,1)),r}function el(t){return new this(t).cbrt()}function tl(t){return E(t=new this(t),t.e+1,2)}function rl(t,e,r){return new this(t).clamp(e,r)}function nl(t){if(!t||typeof t!="object")throw Error(Vr+"Object expected");var e,r,n,i=t.defaults===!0,s=["precision",1,Ke,"rounding",0,8,"toExpNeg",-Et,0,"toExpPos",0,Et,"maxE",0,Et,"minE",-Et,0,"modulo",0,9];for(e=0;e<s.length;e+=3)if(r=s[e],i&&(this[r]=Pn[r]),(n=t[r])!==void 0)if(oe(n)===n&&n>=s[e+1]&&n<=s[e+2])this[r]=n;else throw Error(Je+r+": "+n);if(r="crypto",i&&(this[r]=Pn[r]),(n=t[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(ns);else this[r]=!1;else throw Error(Je+r+": "+n);return this}function il(t){return new this(t).cos()}function sl(t){return new this(t).cosh()}function fs(t){var e,r,n;function i(s){var a,o,u,l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,es(s)){l.s=s.s,T?!s.d||s.e>i.maxE?(l.e=NaN,l.d=null):s.e<i.minE?(l.e=0,l.d=[0]):(l.e=s.e,l.d=s.d.slice()):(l.e=s.e,l.d=s.d?s.d.slice():s.d);return}if(u=typeof s,u==="number"){if(s===0){l.s=1/s<0?-1:1,l.e=0,l.d=[0];return}if(s<0?(s=-s,l.s=-1):l.s=1,s===~~s&&s<1e7){for(a=0,o=s;o>=10;o/=10)a++;T?a>i.maxE?(l.e=NaN,l.d=null):a<i.minE?(l.e=0,l.d=[0]):(l.e=a,l.d=[s]):(l.e=a,l.d=[s]);return}if(s*0!==0){s||(l.s=NaN),l.e=NaN,l.d=null;return}return Fr(l,s.toString())}if(u==="string")return(o=s.charCodeAt(0))===45?(s=s.slice(1),l.s=-1):(o===43&&(s=s.slice(1)),l.s=1),ss.test(s)?Fr(l,s):Vo(l,s);if(u==="bigint")return s<0?(s=-s,l.s=-1):l.s=1,Fr(l,s.toString());throw Error(Je+s)}if(i.prototype=_,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=nl,i.clone=fs,i.isDecimal=es,i.abs=Ho,i.acos=Wo,i.acosh=Xo,i.add=Go,i.asin=Yo,i.asinh=Zo,i.atan=Jo,i.atanh=Ko,i.atan2=Qo,i.cbrt=el,i.ceil=tl,i.clamp=rl,i.cos=il,i.cosh=sl,i.div=al,i.exp=ol,i.floor=ll,i.hypot=ul,i.ln=cl,i.log=fl,i.log10=pl,i.log2=dl,i.max=hl,i.min=ml,i.mod=_l,i.mul=gl,i.pow=bl,i.random=wl,i.round=yl,i.sign=vl,i.sin=kl,i.sinh=El,i.sqrt=Dl,i.sub=Al,i.sum=xl,i.tan=Tl,i.tanh=Cl,i.trunc=Nl,t===void 0&&(t={}),t&&t.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)t.hasOwnProperty(r=n[e++])||(t[r]=this[r]);return i.config(t),i}function al(t,e){return new this(t).div(e)}function ol(t){return new this(t).exp()}function ll(t){return E(t=new this(t),t.e+1,3)}function ul(){var t,e,r=new this(0);for(T=!1,t=0;t<arguments.length;)if(e=new this(arguments[t++]),e.d)r.d&&(r=r.plus(e.times(e)));else{if(e.s)return T=!0,new this(1/0);r=e}return T=!0,r.sqrt()}function es(t){return t instanceof Kt||t&&t.toStringTag===is||!1}function cl(t){return new this(t).ln()}function fl(t,e){return new this(t).log(e)}function dl(t){return new this(t).log(2)}function pl(t){return new this(t).log(10)}function hl(){return ls(this,arguments,-1)}function ml(){return ls(this,arguments,1)}function _l(t,e){return new this(t).mod(e)}function gl(t,e){return new this(t).mul(e)}function bl(t,e){return new this(t).pow(e)}function wl(t){var e,r,n,i,s=0,a=new this(1),o=[];if(t===void 0?t=this.precision:de(t,1,Ke),n=Math.ceil(t/D),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));s<n;)i=e[s],i>=429e7?e[s]=crypto.getRandomValues(new Uint32Array(1))[0]:o[s++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);s<n;)i=e[s]+(e[s+1]<<8)+(e[s+2]<<16)+((e[s+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(e,s):(o.push(i%1e7),s+=4);s=n/4}else throw Error(ns);else for(;s<n;)o[s++]=Math.random()*1e7|0;for(n=o[--s],t%=D,n&&t&&(i=Z(10,D-t),o[s]=(n/i|0)*i);o[s]===0;s--)o.pop();if(s<0)r=0,o=[0];else{for(r=-1;o[0]===0;r-=D)o.shift();for(n=1,i=o[0];i>=10;i/=10)n++;n<D&&(r-=D-n)}return a.e=r,a.d=o,a}function yl(t){return E(t=new this(t),t.e+1,this.rounding)}function vl(t){return t=new this(t),t.d?t.d[0]?t.s:0*t.s:t.s||NaN}function kl(t){return new this(t).sin()}function El(t){return new this(t).sinh()}function Dl(t){return new this(t).sqrt()}function Al(t,e){return new this(t).sub(e)}function xl(){var t=0,e=arguments,r=new this(e[t]);for(T=!1;r.s&&++t<e.length;)r=r.plus(e[t]);return T=!0,E(r,this.precision,this.rounding)}function Tl(t){return new this(t).tan()}function Cl(t){return new this(t).tanh()}function Nl(t){return E(t=new this(t),t.e+1,1)}_[Symbol.for("nodejs.util.inspect.custom")]=_.toString;_[Symbol.toStringTag]="Decimal";var Kt=_.constructor=fs(Pn);Pr=new Kt(Pr);qr=new Kt(qr);var ds=Kt;var Sl=20,Ol=1,ut=1e6,ps=1e6,Il=-7,Bl=21,Ml=!1,Qt="[big.js] ",ct=Qt+"Invalid ",Wr=ct+"decimal places",Rl=ct+"rounding mode",hs=Qt+"Division by zero",$={},Ne=void 0,Ll=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function ms(){function t(e){var r=this;if(!(r instanceof t))return e===Ne?ms():new t(e);if(e instanceof t)r.s=e.s,r.e=e.e,r.c=e.c.slice();else{if(typeof e!="string"){if(t.strict===!0&&typeof e!="bigint")throw TypeError(ct+"value");e=e===0&&1/e<0?"-0":String(e)}$l(r,e)}r.constructor=t}return t.prototype=$,t.DP=Sl,t.RM=Ol,t.NE=Il,t.PE=Bl,t.strict=Ml,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function $l(t,e){var r,n,i;if(!Ll.test(e))throw Error(ct+"number");for(t.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),i=e.length,n=0;n<i&&e.charAt(n)=="0";)++n;if(n==i)t.c=[t.e=0];else{for(;i>0&&e.charAt(--i)=="0";);for(t.e=r-n-1,t.c=[],r=0;n<=i;)t.c[r++]=+e.charAt(n++)}return t}function ft(t,e,r,n){var i=t.c;if(r===Ne&&(r=t.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(Rl);if(e<1)n=r===3&&(n||!!i[0])||e===0&&(r===1&&i[0]>=5||r===2&&(i[0]>5||i[0]===5&&(n||i[1]!==Ne))),i.length=1,n?(t.e=t.e-e+1,i[0]=1):i[0]=t.e=0;else if(e<i.length){if(n=r===1&&i[e]>=5||r===2&&(i[e]>5||i[e]===5&&(n||i[e+1]!==Ne||i[e-1]&1))||r===3&&(n||!!i[0]),i.length=e,n){for(;++i[--e]>9;)if(i[e]=0,e===0){++t.e,i.unshift(1);break}}for(e=i.length;!i[--e];)i.pop()}return t}function dt(t,e,r){var n=t.e,i=t.c.join(""),s=i.length;if(e)i=i.charAt(0)+(s>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0)if(++n>s)for(n-=s;n--;)i+="0";else n<s&&(i=i.slice(0,n)+"."+i.slice(n));else s>1&&(i=i.charAt(0)+"."+i.slice(1));return t.s<0&&r?"-"+i:i}$.abs=function(){var t=new this.constructor(this);return t.s=1,t};$.cmp=function(t){var e,r=this,n=r.c,i=(t=new r.constructor(t)).c,s=r.s,a=t.s,o=r.e,u=t.e;if(!n[0]||!i[0])return n[0]?s:i[0]?-a:0;if(s!=a)return s;if(e=s<0,o!=u)return o>u^e?1:-1;for(a=(o=n.length)<(u=i.length)?o:u,s=-1;++s<a;)if(n[s]!=i[s])return n[s]>i[s]^e?1:-1;return o==u?0:o>u^e?1:-1};$.div=function(t){var e=this,r=e.constructor,n=e.c,i=(t=new r(t)).c,s=e.s==t.s?1:-1,a=r.DP;if(a!==~~a||a<0||a>ut)throw Error(Wr);if(!i[0])throw Error(hs);if(!n[0])return t.s=s,t.c=[t.e=0],t;var o,u,l,c,f,d=i.slice(),p=o=i.length,m=n.length,h=n.slice(0,o),g=h.length,b=t,k=b.c=[],y=0,A=a+(b.e=e.e-t.e)+1;for(b.s=s,s=A<0?0:A,d.unshift(0);g++<o;)h.push(0);do{for(l=0;l<10;l++){if(o!=(g=h.length))c=o>g?1:-1;else for(f=-1,c=0;++f<o;)if(i[f]!=h[f]){c=i[f]>h[f]?1:-1;break}if(c<0){for(u=g==o?i:d;g;){if(h[--g]<u[g]){for(f=g;f&&!h[--f];)h[f]=9;--h[f],h[g]+=10}h[g]-=u[g]}for(;!h[0];)h.shift()}else break}k[y++]=c?l:++l,h[0]&&c?h[g]=n[p]||0:h=[n[p]]}while((p++<m||h[0]!==Ne)&&s--);return!k[0]&&y!=1&&(k.shift(),b.e--,A--),y>A&&ft(b,A,r.RM,h[0]!==Ne),b};$.eq=function(t){return this.cmp(t)===0};$.gt=function(t){return this.cmp(t)>0};$.gte=function(t){return this.cmp(t)>-1};$.lt=function(t){return this.cmp(t)<0};$.lte=function(t){return this.cmp(t)<1};$.minus=$.sub=function(t){var e,r,n,i,s=this,a=s.constructor,o=s.s,u=(t=new a(t)).s;if(o!=u)return t.s=-u,s.plus(t);var l=s.c.slice(),c=s.e,f=t.c,d=t.e;if(!l[0]||!f[0])return f[0]?t.s=-u:l[0]?t=new a(s):t.s=1,t;if(o=c-d){for((i=o<0)?(o=-o,n=l):(d=c,n=f),n.reverse(),u=o;u--;)n.push(0);n.reverse()}else for(r=((i=l.length<f.length)?l:f).length,o=u=0;u<r;u++)if(l[u]!=f[u]){i=l[u]<f[u];break}if(i&&(n=l,l=f,f=n,t.s=-t.s),(u=(r=f.length)-(e=l.length))>0)for(;u--;)l[e++]=0;for(u=e;r>o;){if(l[--r]<f[r]){for(e=r;e&&!l[--e];)l[e]=9;--l[e],l[r]+=10}l[r]-=f[r]}for(;l[--u]===0;)l.pop();for(;l[0]===0;)l.shift(),--d;return l[0]||(t.s=1,l=[d=0]),t.c=l,t.e=d,t};$.mod=function(t){var e,r=this,n=r.constructor,i=r.s,s=(t=new n(t)).s;if(!t.c[0])throw Error(hs);return r.s=t.s=1,e=t.cmp(r)==1,r.s=i,t.s=s,e?new n(r):(i=n.DP,s=n.RM,n.DP=n.RM=0,r=r.div(t),n.DP=i,n.RM=s,this.minus(r.times(t)))};$.neg=function(){var t=new this.constructor(this);return t.s=-t.s,t};$.plus=$.add=function(t){var e,r,n,i=this,s=i.constructor;if(t=new s(t),i.s!=t.s)return t.s=-t.s,i.minus(t);var a=i.e,o=i.c,u=t.e,l=t.c;if(!o[0]||!l[0])return l[0]||(o[0]?t=new s(i):t.s=i.s),t;if(o=o.slice(),e=a-u){for(e>0?(u=a,n=l):(e=-e,n=o),n.reverse();e--;)n.push(0);n.reverse()}for(o.length-l.length<0&&(n=l,l=o,o=n),e=l.length,r=0;e;o[e]%=10)r=(o[--e]=o[e]+l[e]+r)/10|0;for(r&&(o.unshift(r),++u),e=o.length;o[--e]===0;)o.pop();return t.c=o,t.e=u,t};$.pow=function(t){var e=this,r=new e.constructor("1"),n=r,i=t<0;if(t!==~~t||t<-ps||t>ps)throw Error(ct+"exponent");for(i&&(t=-t);t&1&&(n=n.times(e)),t>>=1,!!t;)e=e.times(e);return i?r.div(n):n};$.prec=function(t,e){if(t!==~~t||t<1||t>ut)throw Error(ct+"precision");return ft(new this.constructor(this),t,e)};$.round=function(t,e){if(t===Ne)t=0;else if(t!==~~t||t<-ut||t>ut)throw Error(Wr);return ft(new this.constructor(this),t+this.e+1,e)};$.sqrt=function(){var t,e,r,n=this,i=n.constructor,s=n.s,a=n.e,o=new i("0.5");if(!n.c[0])return new i(n);if(s<0)throw Error(Qt+"No square root");s=Math.sqrt(+dt(n,!0,!0)),s===0||s===1/0?(e=n.c.join(""),e.length+a&1||(e+="0"),s=Math.sqrt(e),a=((a+1)/2|0)-(a<0||a&1),t=new i((s==1/0?"5e":(s=s.toExponential()).slice(0,s.indexOf("e")+1))+a)):t=new i(s+""),a=t.e+(i.DP+=4);do r=t,t=o.times(r.plus(n.div(r)));while(r.c.slice(0,a).join("")!==t.c.slice(0,a).join(""));return ft(t,(i.DP-=4)+t.e+1,i.RM)};$.times=$.mul=function(t){var e,r=this,n=r.constructor,i=r.c,s=(t=new n(t)).c,a=i.length,o=s.length,u=r.e,l=t.e;if(t.s=r.s==t.s?1:-1,!i[0]||!s[0])return t.c=[t.e=0],t;for(t.e=u+l,a<o&&(e=i,i=s,s=e,l=a,a=o,o=l),e=new Array(l=a+o);l--;)e[l]=0;for(u=o;u--;){for(o=0,l=a+u;l>u;)o=e[l]+s[u]*i[l-u-1]+o,e[l--]=o%10,o=o/10|0;e[l]=o}for(o?++t.e:e.shift(),u=e.length;!e[--u];)e.pop();return t.c=e,t};$.toExponential=function(t,e){var r=this,n=r.c[0];if(t!==Ne){if(t!==~~t||t<0||t>ut)throw Error(Wr);for(r=ft(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return dt(r,!0,!!n)};$.toFixed=function(t,e){var r=this,n=r.c[0];if(t!==Ne){if(t!==~~t||t<0||t>ut)throw Error(Wr);for(r=ft(new r.constructor(r),t+r.e+1,e),t=t+r.e+1;r.c.length<t;)r.c.push(0)}return dt(r,!1,!!n)};$[Symbol.for("nodejs.util.inspect.custom")]=$.toJSON=$.toString=function(){var t=this,e=t.constructor;return dt(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])};$.toNumber=function(){var t=+dt(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(t.toString()))throw Error(Qt+"Imprecise conversion");return t};$.toPrecision=function(t,e){var r=this,n=r.constructor,i=r.c[0];if(t!==Ne){if(t!==~~t||t<1||t>ut)throw Error(ct+"precision");for(r=ft(new n(r),t,e);r.c.length<t;)r.c.push(0)}return dt(r,t<=r.e||r.e<=n.NE||r.e>=n.PE,!!i)};$.valueOf=function(){var t=this,e=t.constructor;if(e.strict===!0)throw Error(Qt+"valueOf disallowed");return dt(t,t.e<=e.NE||t.e>=e.PE,!0)};var Ul=ms(),_s=Ul;var ei={};Xi(ei,{DecodeError:()=>le,Decoder:()=>Ae,EXT_TIMESTAMP:()=>Hn,Encoder:()=>At,ExtData:()=>De,ExtensionCodec:()=>Qe,decode:()=>As,decodeArrayStream:()=>Cs,decodeAsync:()=>Ts,decodeMulti:()=>xs,decodeMultiStream:()=>Ns,decodeTimestampExtension:()=>Zn,decodeTimestampToTimeSpec:()=>Yn,encode:()=>Yr,encodeDateToTimeSpec:()=>Xn,encodeTimeSpecToTimestamp:()=>Wn,encodeTimestampExtension:()=>Gn});function gs(t){let e=t.length,r=0,n=0;for(;n<e;){let i=t.charCodeAt(n++);if((i&4294967168)===0){r++;continue}else if((i&4294965248)===0)r+=2;else{if(i>=55296&&i<=56319&&n<e){let s=t.charCodeAt(n);(s&64512)===56320&&(++n,i=((i&1023)<<10)+(s&1023)+65536)}(i&4294901760)===0?r+=3:r+=4}}return r}function Fl(t,e,r){let n=t.length,i=r,s=0;for(;s<n;){let a=t.charCodeAt(s++);if((a&4294967168)===0){e[i++]=a;continue}else if((a&4294965248)===0)e[i++]=a>>6&31|192;else{if(a>=55296&&a<=56319&&s<n){let o=t.charCodeAt(s);(o&64512)===56320&&(++s,a=((a&1023)<<10)+(o&1023)+65536)}(a&4294901760)===0?(e[i++]=a>>12&15|224,e[i++]=a>>6&63|128):(e[i++]=a>>18&7|240,e[i++]=a>>12&63|128,e[i++]=a>>6&63|128)}e[i++]=a&63|128}}var Pl=new TextEncoder,ql=50;function jl(t,e,r){Pl.encodeInto(t,e.subarray(r))}function bs(t,e,r){t.length>ql?jl(t,e,r):Fl(t,e,r)}var Vl=4096;function zn(t,e,r){let n=e,i=n+r,s=[],a="";for(;n<i;){let o=t[n++];if((o&128)===0)s.push(o);else if((o&224)===192){let u=t[n++]&63;s.push((o&31)<<6|u)}else if((o&240)===224){let u=t[n++]&63,l=t[n++]&63;s.push((o&31)<<12|u<<6|l)}else if((o&248)===240){let u=t[n++]&63,l=t[n++]&63,c=t[n++]&63,f=(o&7)<<18|u<<12|l<<6|c;f>65535&&(f-=65536,s.push(f>>>10&1023|55296),f=56320|f&1023),s.push(f)}else s.push(o);s.length>=Vl&&(a+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(a+=String.fromCharCode(...s)),a}var zl=new TextDecoder,Hl=200;function Wl(t,e,r){let n=t.subarray(e,e+r);return zl.decode(n)}function ws(t,e,r){return r>Hl?Wl(t,e,r):zn(t,e,r)}var De=class{type;data;constructor(e,r){this.type=e,this.data=r}};var le=class t extends Error{constructor(e){super(e);let r=Object.create(t.prototype);Object.setPrototypeOf(this,r),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:t.name})}};function ys(t,e,r){let n=r/4294967296,i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function Xr(t,e,r){let n=Math.floor(r/4294967296),i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function Gr(t,e){let r=t.getInt32(e),n=t.getUint32(e+4);return r*4294967296+n}function vs(t,e){let r=t.getUint32(e),n=t.getUint32(e+4);return r*4294967296+n}var Hn=-1,Xl=4294967296-1,Gl=17179869184-1;function Wn({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=Gl)if(e===0&&t<=Xl){let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t),r}else{let r=t/4294967296,n=t&4294967295,i=new Uint8Array(8),s=new DataView(i.buffer);return s.setUint32(0,e<<2|r&3),s.setUint32(4,n),i}else{let r=new Uint8Array(12),n=new DataView(r.buffer);return n.setUint32(0,e),Xr(n,4,t),r}}function Xn(t){let e=t.getTime(),r=Math.floor(e/1e3),n=(e-r*1e3)*1e6,i=Math.floor(n/1e9);return{sec:r+i,nsec:n-i*1e9}}function Gn(t){if(t instanceof Date){let e=Xn(t);return Wn(e)}else return null}function Yn(t){let e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{let r=e.getUint32(0),n=e.getUint32(4),i=(r&3)*4294967296+n,s=r>>>2;return{sec:i,nsec:s}}case 12:{let r=Gr(e,4),n=e.getUint32(0);return{sec:r,nsec:n}}default:throw new le(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function Zn(t){let e=Yn(t);return new Date(e.sec*1e3+e.nsec/1e6)}var ks={type:Hn,encode:Gn,decode:Zn};var Qe=class t{static defaultCodec=new t;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(ks)}register({type:e,encode:r,decode:n}){if(e>=0)this.encoders[e]=r,this.decoders[e]=n;else{let i=-1-e;this.builtInEncoders[i]=r,this.builtInDecoders[i]=n}}tryToEncode(e,r){for(let n=0;n<this.builtInEncoders.length;n++){let i=this.builtInEncoders[n];if(i!=null){let s=i(e,r);if(s!=null){let a=-1-n;return new De(a,s)}}}for(let n=0;n<this.encoders.length;n++){let i=this.encoders[n];if(i!=null){let s=i(e,r);if(s!=null){let a=n;return new De(a,s)}}}return e instanceof De?e:null}decode(e,r,n){let i=r<0?this.builtInDecoders[-1-r]:this.decoders[r];return i?i(e,r,n):new De(r,e)}};function Yl(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function er(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Yl(t)?new Uint8Array(t):Uint8Array.from(t)}var Zl=100,Jl=2048,At=class t{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??Qe.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??Zl,this.initialBufferSize=e?.initialBufferSize??Jl,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new t({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,r){if(r>this.maxDepth)throw new Error(`Too deep objects in depth ${r}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,r)}ensureBufferSizeToWrite(e){let r=this.pos+e;this.view.byteLength<r&&this.resizeBuffer(r*2)}resizeBuffer(e){let r=new ArrayBuffer(e),n=new Uint8Array(r),i=new DataView(r);n.set(this.bytes),this.view=i,this.bytes=n}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){let n=gs(e);this.ensureBufferSizeToWrite(5+n),this.writeStringHeader(n),bs(e,this.bytes,this.pos),this.pos+=n}encodeObject(e,r){let n=this.extensionCodec.tryToEncode(e,this.context);if(n!=null)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,r);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,r);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){let r=e.byteLength;if(r<256)this.writeU8(196),this.writeU8(r);else if(r<65536)this.writeU8(197),this.writeU16(r);else if(r<4294967296)this.writeU8(198),this.writeU32(r);else throw new Error(`Too large binary: ${r}`);let n=er(e);this.writeU8a(n)}encodeArray(e,r){let n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else if(n<4294967296)this.writeU8(221),this.writeU32(n);else throw new Error(`Too large array: ${n}`);for(let i of e)this.doEncode(i,r+1)}countWithoutUndefined(e,r){let n=0;for(let i of r)e[i]!==void 0&&n++;return n}encodeMap(e,r){let n=Object.keys(e);this.sortKeys&&n.sort();let i=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(`Too large map object: ${i}`);for(let s of n){let a=e[s];this.ignoreUndefined&&a===void 0||(this.encodeString(s),this.doEncode(a,r+1))}}encodeExtension(e){if(typeof e.data=="function"){let n=e.data(this.pos+6),i=n.length;if(i>=4294967296)throw new Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(n);return}let r=e.data.length;if(r===1)this.writeU8(212);else if(r===2)this.writeU8(213);else if(r===4)this.writeU8(214);else if(r===8)this.writeU8(215);else if(r===16)this.writeU8(216);else if(r<256)this.writeU8(199),this.writeU8(r);else if(r<65536)this.writeU8(200),this.writeU16(r);else if(r<4294967296)this.writeU8(201),this.writeU32(r);else throw new Error(`Too large extension object: ${r}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){let r=e.length;this.ensureBufferSizeToWrite(r),this.bytes.set(e,this.pos),this.pos+=r}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),ys(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),Xr(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};function Yr(t,e){return new At(e).encodeSharedRef(t)}function Zr(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}var Kl=16,Ql=16,Jr=class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(e=Kl,r=Ql){this.maxKeyLength=e,this.maxLengthPerKey=r,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,r,n){let i=this.caches[n-1];e:for(let s of i){let a=s.bytes;for(let o=0;o<n;o++)if(a[o]!==e[r+o])continue e;return s.str}return null}store(e,r){let n=this.caches[e.length-1],i={bytes:e,str:r};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=i:n.push(i)}decode(e,r,n){let i=this.find(e,r,n);if(i!=null)return this.hit++,i;this.miss++;let s=zn(e,r,n),a=Uint8Array.prototype.slice.call(e,r,r+n);return this.store(a,s),s}};var Jn="array",nr="map_key",Ds="map_value",eu=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new le("The type of key must be string or number but "+typeof t)},Kn=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let r=this.getUninitializedStateFromPool();r.type=Jn,r.position=0,r.size=e,r.array=new Array(e)}pushMapState(e){let r=this.getUninitializedStateFromPool();r.type=nr,r.readCount=0,r.size=e,r.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===Jn){let n=e;n.size=0,n.array=void 0,n.position=0,n.type=void 0}if(e.type===nr||e.type===Ds){let n=e;n.size=0,n.map=void 0,n.readCount=0,n.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},rr=-1,Qn=new DataView(new ArrayBuffer(0)),tu=new Uint8Array(Qn.buffer);try{Qn.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var Es=new RangeError("Insufficient data"),ru=new Jr,Ae=class t{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=Qn;bytes=tu;headByte=rr;stack=new Kn;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??Qe.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??4294967295,this.maxBinLength=e?.maxBinLength??4294967295,this.maxArrayLength=e?.maxArrayLength??4294967295,this.maxMapLength=e?.maxMapLength??4294967295,this.maxExtLength=e?.maxExtLength??4294967295,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:ru,this.mapKeyConverter=e?.mapKeyConverter??eu}clone(){return new t({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=rr,this.stack.reset()}setBuffer(e){let r=er(e);this.bytes=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===rr&&!this.hasRemaining(1))this.setBuffer(e);else{let r=this.bytes.subarray(this.pos),n=er(e),i=new Uint8Array(r.length+n.length);i.set(r),i.set(n,r.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){let{view:r,pos:n}=this;return new RangeError(`Extra ${r.byteLength-n} of ${r.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);let r=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return r}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let r=!1,n;for await(let o of e){if(r)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(o);try{n=this.doDecodeSync(),r=!0}catch(u){if(!(u instanceof RangeError))throw u}this.totalPos+=this.pos}if(r){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return n}let{headByte:i,pos:s,totalPos:a}=this;throw new RangeError(`Insufficient data in parsing ${Zr(i)} at ${a} (${s} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,r){if(this.entered){yield*this.clone().decodeMultiAsync(e,r);return}try{this.entered=!0;let n=r,i=-1;for await(let s of e){if(r&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),n&&(i=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(a){if(!(a instanceof RangeError))throw a}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){let e=this.readHeadByte(),r;if(e>=224)r=e-256;else if(e<192)if(e<128)r=e;else if(e<144){let i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e<160){let i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else{let i=e-160;r=this.decodeString(i,0)}else if(e===192)r=null;else if(e===194)r=!1;else if(e===195)r=!0;else if(e===202)r=this.readF32();else if(e===203)r=this.readF64();else if(e===204)r=this.readU8();else if(e===205)r=this.readU16();else if(e===206)r=this.readU32();else if(e===207)this.useBigInt64?r=this.readU64AsBigInt():r=this.readU64();else if(e===208)r=this.readI8();else if(e===209)r=this.readI16();else if(e===210)r=this.readI32();else if(e===211)this.useBigInt64?r=this.readI64AsBigInt():r=this.readI64();else if(e===217){let i=this.lookU8();r=this.decodeString(i,1)}else if(e===218){let i=this.lookU16();r=this.decodeString(i,2)}else if(e===219){let i=this.lookU32();r=this.decodeString(i,4)}else if(e===220){let i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else if(e===221){let i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else if(e===222){let i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e===223){let i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e===196){let i=this.lookU8();r=this.decodeBinary(i,1)}else if(e===197){let i=this.lookU16();r=this.decodeBinary(i,2)}else if(e===198){let i=this.lookU32();r=this.decodeBinary(i,4)}else if(e===212)r=this.decodeExtension(1,0);else if(e===213)r=this.decodeExtension(2,0);else if(e===214)r=this.decodeExtension(4,0);else if(e===215)r=this.decodeExtension(8,0);else if(e===216)r=this.decodeExtension(16,0);else if(e===199){let i=this.lookU8();r=this.decodeExtension(i,1)}else if(e===200){let i=this.lookU16();r=this.decodeExtension(i,2)}else if(e===201){let i=this.lookU32();r=this.decodeExtension(i,4)}else throw new le(`Unrecognized type byte: ${Zr(e)}`);this.complete();let n=this.stack;for(;n.length>0;){let i=n.top();if(i.type===Jn)if(i.array[i.position]=r,i.position++,i.position===i.size)r=i.array,n.release(i);else continue e;else if(i.type===nr){if(r==="__proto__")throw new le("The key __proto__ is not allowed");i.key=this.mapKeyConverter(r),i.type=Ds;continue e}else if(i.map[i.key]=r,i.readCount++,i.readCount===i.size)r=i.map,n.release(i);else{i.key=null,i.type=nr;continue e}}return r}}readHeadByte(){return this.headByte===rr&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=rr}readArraySize(){let e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new le(`Unrecognized array type byte: ${Zr(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new le(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new le(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,r){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,r):this.decodeBinary(e,r)}decodeUtf8String(e,r){if(e>this.maxStrLength)throw new le(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+r+e)throw Es;let n=this.pos+r,i;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?i=this.keyDecoder.decode(this.bytes,n,e):i=ws(this.bytes,n,e),this.pos+=r+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===nr:!1}decodeBinary(e,r){if(e>this.maxBinLength)throw new le(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+r))throw Es;let n=this.pos+r,i=this.bytes.subarray(n,n+e);return this.pos+=r+e,i}decodeExtension(e,r){if(e>this.maxExtLength)throw new le(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);let n=this.view.getInt8(this.pos+r),i=this.decodeBinary(e,r+1);return this.extensionCodec.decode(i,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){let e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){let e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){let e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){let e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){let e=vs(this.view,this.pos);return this.pos+=8,e}readI64(){let e=Gr(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){let e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){let e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){let e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){let e=this.view.getFloat64(this.pos);return this.pos+=8,e}};function As(t,e){return new Ae(e).decode(t)}function xs(t,e){return new Ae(e).decodeMulti(t)}function nu(t){return t[Symbol.asyncIterator]!=null}async function*iu(t){let e=t.getReader();try{for(;;){let{done:r,value:n}=await e.read();if(r)return;yield n}}finally{e.releaseLock()}}function Kr(t){return nu(t)?t:iu(t)}async function Ts(t,e){let r=Kr(t);return new Ae(e).decodeAsync(r)}function Cs(t,e){let r=Kr(t);return new Ae(e).decodeArrayStream(r)}function Ns(t,e){let r=Kr(t);return new Ae(e).decodeStream(r)}var bn=Gi(ki(),1),Ei=ds,Di=_s,Be=ei,Ma=bn.DOMParser,Ra=bn.XMLSerializer;var La=Be!==null;function $a(){if(!La)throw new Error("@msgpack/msgpack is required for MessagePack support. Install with: npm install @msgpack/msgpack")}var Ua=nf();function nf(){if(!La)return null;let t=new TextEncoder,e=new TextDecoder,r=new Be.ExtensionCodec;return r.register({type:-1,encode:n=>{if(n instanceof Date){let i=gt(n);if(i==="D"||i==="H")return null}return Be.encodeTimestampExtension(n)},decode:n=>Be.decodeTimestampExtension(n)}),r.register({type:1,encode:n=>ke(n)?t.encode(n.toString()):null,decode:n=>wn(e.decode(n))}),r.register({type:2,encode:n=>{if(n instanceof Date&>(n)==="D"){let i=n.getUTCFullYear(),s=String(n.getUTCMonth()+1).padStart(2,"0"),a=String(n.getUTCDate()).padStart(2,"0");return t.encode(`${i}-${s}-${a}`)}return null},decode:n=>new Date(e.decode(n)+"T00:00:00.000Z")}),r.register({type:3,encode:n=>{if(n instanceof Date&>(n)==="H"){let i=String(n.getUTCHours()).padStart(2,"0"),s=String(n.getUTCMinutes()).padStart(2,"0"),a=String(n.getUTCSeconds()).padStart(2,"0"),o=String(n.getUTCMilliseconds()).padStart(3,"0");return t.encode(`${i}:${s}:${a}.${o}`)}return null},decode:n=>{let i=e.decode(n),s=i.indexOf("."),a=s>=0?i.substring(0,s):i,o=s>=0?i.substring(s+1):"0",[u,l,c]=a.split(":"),f=Math.round(+o.substring(0,3));return new Date(Date.UTC(1970,0,1,+u,+l,+c,f))}}),r.register({type:4,encode:n=>{let i=Ai(n);if(i!==null){let[s,a]=i;return t.encode(`${s}:${a(n)}`)}return null},decode:n=>{let i=e.decode(n),s=i.indexOf(":"),a=i.slice(0,s),o=i.slice(s+1),u=at[a];if(u!==void 0){let[,l]=u;return l(o)}return`${o}::${a}`}}),r}function Fa(t){return $a(),Be.encode(t,{extensionCodec:Ua})}function Pa(t){return $a(),Be.decode(t,{extensionCodec:Ua})}function vn(t,e=!1){let r=kn(t);if(r===null)return[!1,String(t)];let[n,i,s]=r;return s&&!e?[!1,String(t)]:[!0,`${i(t)}::${n}`]}function xi(t){if(!t.includes("::"))return[!1,t];let e=t.lastIndexOf("::"),r=t.slice(0,e),n=t.slice(e+2),i=at[n];if(i===void 0)return[!1,t];let[,s]=i;return[!0,s(r)]}function yn(t,e,r){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let n={};for(let[i,s]of Object.entries(t))n[i]=yn(s,e,r);return n}return Array.isArray(t)?t.map(n=>yn(n,e,r)):r(t)?e(t):t}function Ti(t){let e=kn(t);if(e!==null){let[r,n,i]=e;return i?[t,!1]:[`${n(t)}::${r}`,!0]}if(Array.isArray(t)){let r=!1;return[t.map(i=>{let[s,a]=Ti(i);return a&&(r=!0),s}),r]}if(t!==null&&typeof t=="object"){let r=!1,n={};for(let[i,s]of Object.entries(t)){let[a,o]=Ti(s);o&&(r=!0),n[i]=a}return[n,r]}return[t,!1]}function sf(t,e=!1){let[r,n]=vn(t,e);if(r)return n;let[i,s]=Ti(t),a=JSON.stringify(i);return s?`${a}::JS`:a}function af(t){return JSON.stringify(t)}function of(t){if(!Be)throw new Error("@msgpack/msgpack is required for MessagePack support");return Be.encode(t)}function ge(t,e=null,{raw:r=!1,qs:n=!1,_forceSuffix:i=!1}={}){if(n)return`${ja(t)}::QS`;if(r){if(e===null||e==="json")return af(t);if(e==="msgpack")return of(t);throw e==="xml"?new Error("raw=true is not supported for XML transport"):new Error(`Unknown transport: ${e}`)}if(e===null||e==="json"){let s=sf(t,i);return e==="json"?`"${s}"`:s}else{if(e==="xml")return`<?xml version="1.0" ?><tytx_root>${qa(t)}</tytx_root>`;if(e==="msgpack")return Fa(t);throw new Error(`Unknown transport: ${e}`)}}var zt,Ci;typeof window<"u"&&window.DOMParser?(zt=window.DOMParser,Ci=window.XMLSerializer):(zt=Ma,Ci=Ra);function Va(t){if(t===null||typeof t!="object"||Array.isArray(t))return!1;let e=Object.keys(t);if(e.length!==1)return!1;let r=t[e[0]];return r!==null&&typeof r=="object"&&"value"in r}function za(t,e,r){let n=t.createElement(e),i=r.attrs||{},s=r.value;for(let[a,o]of Object.entries(i))n.setAttribute(a,ge(o,null,{_forceSuffix:!0}));if(Array.isArray(s))for(let a of s)if(Va(a)){let[o]=Object.keys(a),u=a[o],l=za(t,o,u);n.appendChild(l)}else{n.textContent=ge(s);break}else n.textContent=ge(s);return n}function qa(t){if(!zt)throw new Error("XML support requires @xmldom/xmldom package in Node.js");if(Va(t)){let[e]=Object.keys(t),r=t[e],n=new zt().parseFromString("<root/>","text/xml"),i=za(n,e,r);return new Ci().serializeToString(i)}else return ge(t)}function Ni(t){let e={};for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=Q(i.value)}let r=[];for(let n=0;n<t.childNodes.length;n++){let i=t.childNodes[n];i.nodeType===1&&r.push(i)}if(r.length>0)if(r.length===1){let n=r[0],i=Ni(n);return{attrs:e,value:{[n.tagName]:i}}}else{let n=[];for(let i of r){let s=Ni(i);n.push({[i.tagName]:s})}return{attrs:e,value:n}}return{attrs:e,value:Q(t.textContent)}}function Ha(t){if(!zt)throw new Error("XML support requires @xmldom/xmldom package in Node.js");let n=new zt().parseFromString(t,"text/xml").documentElement;if(n.tagName==="tytx_root"){let s=null;for(let a=0;a<n.childNodes.length;a++)if(n.childNodes[a].nodeType===1){s=n.childNodes[a];break}if(!s)return Q(n.textContent);n=s}let i=Ni(n);return{[n.tagName]:i}}function lf(t){return typeof t=="string"}function uf(t){let[e,r]=xi(t);if(e)return r;let n=t;n.endsWith("::JS")&&(n=n.slice(0,-4));let i;try{i=JSON.parse(n)}catch{return t}return yn(i,cf,lf)}function cf(t){return t.includes("::")?xi(t)[1]:t}function ff(t){let e=Ha(t);return typeof e=="string"?Q(e):e}function df(t){return Pa(t)}function Q(t,e=null){if(t===null)return null;if(e===null||e==="json"){let r=t;return e==="json"&&t.startsWith('"')&&t.endsWith('"')&&(r=t.slice(1,-1)),uf(r)}else{if(e==="xml")return ff(t);if(e==="msgpack")return df(t);throw new Error(`Unknown transport: ${e}`)}}function ja(t){if(Array.isArray(t))return t.map(e=>String(e)).join("&");if(t!==null&&typeof t=="object"){let e=[];for(let[r,n]of Object.entries(t)){let[i,s]=vn(n,!0);i?e.push(`${r}=${s}`):e.push(`${r}=${n}`)}return e.join("&")}throw new TypeError(`toQs expects object or array, got ${typeof t}`)}function Wa(t){if(!t)return[];let e=t.split("&"),r=e.map(a=>a.includes("=")),n=r.every(Boolean),i=!r.some(Boolean);if(!n&&!i)throw new Error("QS format error: mixed items with and without '='");if(i)return e.map(a=>Q(a));let s={};for(let a of e){let o=a.indexOf("="),u=a.slice(0,o),l=a.slice(o+1);s[u]=Q(l)}return s}var Ga=Ei||Di||Number,pf=Ei?"decimal.js":Di?"big.js":"number";function wn(t){return new Ga(t)}function ke(t){return pf==="number"?!1:t instanceof Ga}function gt(t){let e=t.getUTCFullYear()===1970&&t.getUTCMonth()===0&&t.getUTCDate()===1,r=t.getUTCHours()===0&&t.getUTCMinutes()===0&&t.getUTCSeconds()===0&&t.getUTCMilliseconds()===0;return e&&!r?"H":r&&!e?"D":"DHZ"}function hf(t){return t.toString()}function mf(t){let e=t.getUTCFullYear(),r=String(t.getUTCMonth()+1).padStart(2,"0"),n=String(t.getUTCDate()).padStart(2,"0");return`${e}-${r}-${n}`}function _f(t){return t.toISOString()}function gf(t){let e=String(t.getUTCHours()).padStart(2,"0"),r=String(t.getUTCMinutes()).padStart(2,"0"),n=String(t.getUTCSeconds()).padStart(2,"0"),i=String(t.getUTCMilliseconds()).padStart(3,"0");return`${e}:${r}:${n}.${i}`}function bf(t){return t?"true":"false"}function wf(t){return t.toString()}function yf(t){return t.toString()}function vf(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode.apply(null,t.subarray(r,r+32768));return btoa(e)}var En=[],Si=new Map;function Ai(t){if(t===null||typeof t!="object")return null;for(let e=Object.getPrototypeOf(t);e!==null;e=Object.getPrototypeOf(e))for(let[r,n,i,s]of En)if(r.prototype===e)return[n,i,s];return null}function kn(t){if(t===null)return["NN",()=>"",!0];if(ke(t))return["N",hf,!1];if(t instanceof Uint8Array)return["RAW",vf,!1];if(t instanceof Date){let e=gt(t);return e==="D"?["D",mf,!1]:e==="H"?["H",gf,!1]:["DHZ",_f,!1]}return typeof t=="boolean"?["B",bf,!0]:typeof t=="number"?Number.isInteger(t)?["L",wf,!0]:["R",yf,!0]:Ai(t)}function kf(t){return wn(t)}function Ef(t){let[e,r,n]=t.split("-").map(Number);return new Date(Date.UTC(e,r-1,n,0,0,0,0))}function Xa(t){return new Date(t)}function Df(t){let[e,r,n]=t.split(":"),[i,s]=n.split(".");return new Date(Date.UTC(1970,0,1,Number(e),Number(r),Number(i),Number(s||0)))}function Af(t){return t.toLowerCase()==="true"}function xf(t){return parseInt(t,10)}function Tf(t){return parseFloat(t)}function Cf(t){return t}function Nf(t){return null}var Sf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function Of(t){if(!Sf.test(t))throw new Error(`RAW payload is not standard padded base64: '${t}'`);let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function If(t){return Wa(t)}var Bf=/^[A-Z]+$/,at={N:[Object,kf],D:[Date,Ef],DH:[Date,Xa],DHZ:[Date,Xa],H:[Date,Df],L:[Number,xf],R:[Number,Tf],T:[String,Cf],B:[Boolean,Af],QS:[Object,If],NN:[null,Nf],RAW:[Uint8Array,Of]};function Er(t){return Object.hasOwn(at,t)?at[t][0]:null}function Oi(t,e,r,n,i=!1){if(typeof e!="string"||!Bf.test(e))throw new Error(`TYTX suffix '${e}' is invalid: expected uppercase ASCII letters only`);let s=at[e];if(s!==void 0&&s[0]!==t){let a=s[0]===null?"null":s[0].name;throw new Error(`TYTX suffix '${e}' is already registered for ${a}`)}En=En.filter(([a])=>a!==t),En.push([t,e,r,i]),at[e]=[t,n]}function Dr(t,e){Si.set(t,e)}function Ve(t){return Si.has(t)?Si.get(t):{}}var Ya={network:{maxAttempts:3,delay:1,backoff:2,jitter:!0,on:["TypeError","NetworkError","AbortError"]},aggressive:{maxAttempts:5,delay:.5,backoff:2,jitter:!0,on:["Error"]},gentle:{maxAttempts:2,delay:2,backoff:1.5,jitter:!1,on:["TypeError","NetworkError"]}};function Rf(t){let e=t._retryPolicy;return e==null?null:typeof e=="string"?Ya[e]||null:e}function Lf(t,e){return e.some(r=>r==="Error"?!0:t.name===r||t.constructor.name===r)}function $f(t){return new Promise(e=>setTimeout(e,t))}async function Uf(t,e){if(!e)return t();let r=e.maxAttempts||3,n=e.delay||1,i=e.backoff||2,s=e.jitter!==!1,a=e.on||["Error"],o=null,u=n*1e3;for(let l=0;l<r;l++)try{let c=t();return c instanceof Promise?await c:c}catch(c){if(o=c,l<r-1&&Lf(c,a)){let f=u;s&&(f*=1+Math.random()*.1),await $f(f),u*=i}else throw c}throw o}var ee=class t{static classKwargs={cacheTime:0,readOnly:!1,asBag:null,retryPolicy:null};static classArgs=[];static internalParams=new Set(["cacheTime","readOnly","asBag","retryPolicy"]);constructor(e={}){let n={...this.constructor.classKwargs,...e};for(let s of["interval","reactive"])if(Object.hasOwn(n,s))throw new TypeError(`Removed resolver option: ${s}. Schedule updates in the application; use reset() and read explicitly.`);this.cacheTime=n.cacheTime,this._readOnly=n.readOnly,this._asBag=n.asBag,this._retryPolicy=n.retryPolicy,this._kw={};let i=this.constructor.internalParams;for(let[s,a]of Object.entries(n))i.has(s)||(this._kw[s]=a);this._lastUpdate=null,this._node=null,this._lastEffectiveFingerprint=null,this._cachedValue=null,this.init()}init(){}setNode(e){e!==this._node&&!this.readOnly&&this._lastUpdate!==null&&this.reset(),this._node=e,this.onSetResolver(e)}onSetResolver(e){}get node(){return this._node}get cacheTime(){return this._cacheTime}set cacheTime(e){if(typeof e=="boolean")throw new TypeError("cacheTime must be numeric; use a negative value for infinite caching");this._cacheTime=e}get readOnly(){return this._readOnly}get expired(){return this._cacheTime<0?this._lastUpdate===null:this._cacheTime===0||this._lastUpdate===null?!0:(Date.now()-this._lastUpdate)/1e3>this._cacheTime}reset(...e){if(e.length)throw new TypeError("reset() takes no arguments. It invalidates the cache for the next explicit read.");this._lastUpdate=null,this._lastEffectiveFingerprint=null}get cachedValue(){return!this.readOnly&&this._node?this._node._value:this._cachedValue}set cachedValue(e){!this.readOnly&&this._node?this._node.setValue(e,!1):this._cachedValue=e}_computeEffectiveFingerprint(e){return JSON.stringify(Object.entries(e).sort())}_buildEffectiveKw(){let e={...this._kw};if(this._node&&this._node.attr)for(let r of Object.keys(this._kw))Object.hasOwn(this._node.attr,r)&&(e[r]=this._node.attr[r]);return e}resolve(e={}){let{static:r=!1,...n}=e;if(r)return this._node?this._node._value:this.cachedValue;let i=this._buildEffectiveKw();if(Object.keys(n).length>0)return this._load({...i,...n},a=>this._prepareValue(a));let s=this._computeEffectiveFingerprint(i);return s===this._lastEffectiveFingerprint&&!this.expired?this.cachedValue:(this._lastEffectiveFingerprint=s,this._load(i,a=>this._finalize(a)))}_load(e,r){let n=Rf(this),i=()=>this.load(e);if(n)return Uf(i,n).then(r);let s=i();return s&&typeof s.then=="function"?s.then(r):r(s)}_finalize(e){return e=this._prepareValue(e),this._lastUpdate=Date.now(),(!this.readOnly||this.cacheTime!==0)&&(this.cachedValue=e),e}_prepareValue(e){let r;return this._asBag===!0?r=!0:this._asBag===!1?r=!1:r=!this._readOnly,r&&e!==null&&e!==void 0&&(e=this._convertToBag(e)),e}_convertToBag(e){let r=t._BagClass;if(!r||e&&typeof e._htraverse=="function")return e;if(typeof e=="string"){if(e=e.trim(),e.startsWith("<")&&r.fromXml)return r.fromXml(e);if((e.startsWith("{")||e.startsWith("["))&&r.fromTytx)return r.fromTytx(e)}return e}static registerBagClass(e){t._BagClass=e}load(e){return null}};ee._BagClass=null;var Ar=class extends ee{static classKwargs={cacheTime:0,readOnly:!1,asBag:!1,retryPolicy:null,callback:null};static classArgs=["callback"];static internalParams=new Set(["cacheTime","readOnly","asBag","retryPolicy","callback"]);constructor(e={}){typeof e=="function"&&(e={callback:e}),super(e),this._callback=e.callback||null}load(e){return this._callback?this._callback.call(this,e):null}};var ze=class t{constructor(e,r,n=null,i=null,s=null,a=null,o=null,u=!0){this.label=r,this._value=null,this._attr={},this._parentBag=null,this._resolver=null,this._nodeSubscribers={},this._onChangedValue=null,this.nodeTag=a,this.xmlTag=o,this._compiled=null,this.parentBag=e,i&&this.setAttr(i,!1,!0,u),n!==null&&this.setValue(n,!1),s&&(this.resolver=s)}get parentBag(){return this._parentBag}set parentBag(e){e===null&&this._value?.parentNode===this&&this._value.setBackref(),this._parentBag=e,e?.backref&&this._value&&typeof this._value._htraverse=="function"&&this._value.setBackref(this,e)}get value(){return this.getValue()}set value(e){this.setValue(e)}getValue(e=!1,r=null,n={}){if(r!==null){let i=Q(`${r}::QS`);if(Array.isArray(i)){let s=i.length?i:Object.keys(this._attr),a=s.map(u=>{let l=this.getAttr(u);return!e&&l instanceof ee?l.resolve():l}),o=u=>i.length===0?Object.fromEntries(s.map((l,c)=>[l,u[c]])):u.length===1?u[0]:u;return a.some(u=>u&&typeof u.then=="function")?Promise.all(a).then(o):o(a)}else{if(!this._resolver)throw new Error("Cannot use kwargs syntax without resolver");n={...n,...i}}}return this._resolver!==null?this._resolver.resolve({static:e,...n}):this._value}setValue(e,r=!0,n=null,i=null,s=!0,a=null,o=!1){e instanceof ee?(this.resolver=e,e=null):e instanceof t&&(n=n||{},Object.assign(n,e._attr),e.resolver&&(this.resolver=e.resolver),e=e._value);let u=this._value;u!==e&&u?.parentNode===this&&u.setBackref(),this._value=e;let l=u!==this._value,c=r??!0,f=null;if(n!==null){let p={...this._attr};this.setAttr(n,!1,i,s);let m=this._buildAttrDiff(p,this._attr);f=Object.keys(m).length>0?m:null}r=c&&(l||f!==null);let d=f?l?"upd_value_attr":"upd_attrs":"upd_value";if(this._onChangedValue&&this._onChangedValue(this,e,u,c),r){let p=f!==null?{oldvalue:u,attrs_diff:f}:{oldvalue:u};for(let m of Object.values(this._nodeSubscribers))m({node:this,info:p,evt:d})}this._parentBag!==null&&this._parentBag.backref&&(e&&typeof e._htraverse=="function"&&e.setBackref(this,this._parentBag),r&&this._parentBag._onNodeChanged(this,[this.label],d,u,f,a,o))}replace(e){if(!(e instanceof t))throw new TypeError("BagNode.replace expects a BagNode");if(e===this)return this;let r=e.staticValue;r&&typeof r._htraverse=="function"&&(r=r.createChildBag().replace(r));let n=null;e.resolver&&(n=Object.create(Object.getPrototypeOf(e.resolver),Object.getOwnPropertyDescriptors(e.resolver)),n._node=null,n._kw={...e.resolver._kw});let i=this._value,s={...this._attr},a=this.resolver;a&&a._node===this&&(a._node=null),this.resolver=n,this.setValue(r,!1,{...e.attr},!1,!1,null);let o=this._buildAttrDiff(s,this._attr),u=Object.keys(o).length?o:null,l=i!==r||a!==n;if(l||u){let c=u?l?"upd_value_attr":"upd_attrs":"upd_value",f=u?{oldvalue:i,attrs_diff:u}:{oldvalue:i};for(let d of Object.values(this._nodeSubscribers))d({node:this,info:f,evt:c});this._parentBag!==null&&this._parentBag.backref&&this._parentBag._onNodeChanged(this,[this.label],c,i,u)}return this}get staticValue(){return this._value}set staticValue(e){this._value=e}get resolver(){return this._resolver}set resolver(e){this._resolver=e,e&&e.setNode&&e.setNode(this)}resetResolver(){if(!this._resolver)throw new Error("Cannot reset resolver: node has no resolver");this._resolver.reset(),this.setValue(null)}get attr(){return this._attr}getAttr(e=null,r=null){return e?e in this._attr?this._attr[e]:r:this._attr}_buildAttrDiff(e,r){let n={},i=new Set([...Object.keys(e),...Object.keys(r)]);for(let s of i){let a=s in e?e[s]:null,o=s in r?r[s]:null;a!==o&&(n[s]={old:a,new:o})}return n}setAttr(e=null,r=!0,n=!0,i=!0){let s=e||{},a=Object.keys(this._nodeSubscribers).length>0,u=r&&(a||this._parentBag!==null&&this._parentBag.backref)?{...this._attr}:null;if(n?Object.assign(this._attr,s):this._attr={...s},i)for(let l of Object.keys(this._attr))this._attr[l]===null&&delete this._attr[l];if(r&&u!==null){let l=this._buildAttrDiff(u,this._attr);if(Object.keys(l).length>0&&a)for(let c of Object.values(this._nodeSubscribers))c({node:this,info:{attrs_diff:l},evt:"upd_attrs"});if(Object.keys(l).length>0&&this._parentBag!==null&&this._parentBag.backref){let c=r===!0?"true":String(r);this._parentBag._onNodeChanged(this,[this.label],"upd_attrs",null,l,c)}}}delAttr(...e){for(let r of e)if(typeof r=="string"&&r.includes(","))for(let n of r.split(","))delete this._attr[n.trim()];else delete this._attr[r]}hasAttr(e,r=null){return e in this._attr?r!==null?this._attr[e]===r:!0:!1}getInheritedAttributes(){let e={};return this._parentBag&&this._parentBag.parentNode&&(e=this._parentBag.parentNode.getInheritedAttributes()),{...e,...this._attr}}subscribe(e,r){this._nodeSubscribers[e]=r}unsubscribe(e){delete this._nodeSubscribers[e]}get compiled(){return this._compiled||(this._compiled={}),this._compiled}get isBranch(){return this._value!=null&&typeof this._value._htraverse=="function"}get position(){return this._parentBag===null?null:this._parentBag._nodes.index(this.label)}get fullpath(){if(this._parentBag!==null){let e=this._parentBag.fullpath;return e?`${e}.${this.label}`:this.label}return null}get parentNode(){return this._parentBag?this._parentBag.parentNode:null}attributeOwnerNode(e,r=null){let n=this;if(r===null)for(;n&&!(e in n._attr);)n=n.parentNode;else for(;n&&n._attr[e]!==r;)n=n.parentNode;return n}asTuple(){return[this.label,this.value,this._attr,this._resolver||null]}isEqual(e){if(!(e instanceof t)||this.label!==e.label)return!1;let r=Object.keys(this._attr),n=Object.keys(e._attr);if(r.length!==n.length)return!1;for(let i of r)if(this._attr[i]!==e._attr[i])return!1;return this._resolver!==null?this._resolver===e._resolver:this._value&&typeof this._value.equalTo=="function"?this._value.equalTo(e._value):this._value&&typeof this._value.isEqual=="function"?this._value.isEqual(e._value):this._value===e._value}diff(e){if(this.label!==e.label)return`Other label: ${e.label}`;let r=Object.keys(this._attr),n=Object.keys(e._attr);return r.length!==n.length||r.some(i=>this._attr[i]!==e._attr[i])?`attributes self:${JSON.stringify(this._attr)} --- other:${JSON.stringify(e._attr)}`:this._value!==e._value?`value self:${this._value} --- other:${e._value}`:null}toJson(e=!0){let r=this.value;return r&&typeof r.toJson=="function"&&(r=r.toJson(e,!0)),{label:this.label,value:r,attr:this._attr}}toString(){return`BagNode : ${this.label}`}};var xr=class t{constructor(){this._dict=Object.create(null),this._list=[],this._parentBag=null}index(e){if(e in this._dict)return this._list.findIndex(n=>n.label===e);let r=e.match(/^#(\d+)$/);if(r){let n=parseInt(r[1],10);return n<this._list.length?n:-1}if(r=e.match(/^#(\w*)=(.*)$/),r){let[,n,i]=r,s=i.includes("::")?Q(i):i;return n?this._list.findIndex(a=>a.getAttr(n)===s):this._list.findIndex(a=>a._value===s)}return-1}_parsePosition(e){let r=this._list.length;if(e==null||e===">")return r;if(typeof e=="number")return e<0&&(e=r+e),Math.max(0,Math.min(e,r));if(e==="<")return 0;if(e.startsWith("#")){let n=this._parseSharpIndex(e.slice(1),e);return Math.min(n,r)}if(e.startsWith("<")){let n=e.slice(1);if(n.startsWith("#")){let s=this._parseSharpIndex(n.slice(1),e);return Math.min(s,r)}let i=this.index(n);if(i<0)throw new Error(`Invalid node_position '${e}': label '${n}' not found`);return i}if(e.startsWith(">")){let n=e.slice(1);if(n.startsWith("#")){let s=this._parseSharpIndex(n.slice(1),e);return Math.min(s+1,r)}let i=this.index(n);if(i<0)throw new Error(`Invalid node_position '${e}': label '${n}' not found`);return i+1}throw new Error(`Invalid node_position '${e}': unrecognized syntax`)}_parseSharpIndex(e,r){if(!/^-?\d+$/.test(e))throw new Error(`Invalid node_position '${r}': '${e}' is not an integer`);let n=parseInt(e,10);if(n<0)throw new Error(`Invalid node_position '${r}': negative index not allowed in '#n' syntax`);return n}get(e){if(typeof e=="number")return e>=0&&e<this._list.length?this._list[e]:null;if(e.startsWith("#")){let r=this.index(e);return r>=0?this._list[r]:null}return this._dict[e]||null}set(e,r,n=">",i=null,s=null,a=null,o=!1,u=!0,l=null,c=!0,f=!1,d=null){let p=null;if(e.includes("?")&&([e,p]=e.split("?",2)),e==null||e.startsWith("#"))throw new Error("Cannot create new node with #n syntax");if(p){let h=p.split("&");if(h.length===1)i={[h[0]]:r};else{if(!Array.isArray(r)||r.length!==h.length)throw new Error("Wrong attributes assignment");i={};for(let g=0;g<h.length;g++)i[h[g]]=r[g]}r=null}let m=this._dict[e];if(m)d&&(m.nodeTag=d),a!==null&&(a===!1?m.resolver=null:m.resolver=a),p?m.setAttr(i,c,!0,u):m.setValue(r,c,i,o,u,l,f);else{let h=s&&s.nodeClass?s.nodeClass:ze;m=new h(s,e,p?null:r,i,a,d,null,u);let g=this._parsePosition(n);this._dict[e]=m,this._list.splice(g,0,m),c&&s&&s.backref&&s._onNodeInserted(m,g,null,l,f)}return f&&m.setValue(null,!1),m}pop(e){let r=this.get(e);if(r){delete this._dict[r.label];let n=this._list.indexOf(r);return n>=0&&this._list.splice(n,1),r}return null}has(e){return e in this._dict}get length(){return this._list.length}clear(){this._dict=Object.create(null),this._list=[]}keys(){return this._list.map(e=>e.label)}values(){return this._list.map(e=>e.getValue())}items(){return this._list.map(e=>[e.label,e.getValue()])}[Symbol.iterator](){return this._list[Symbol.iterator]()}move(e,r,n=!0){if(r<0)return;let i=Array.isArray(e)?e:[e];if(i.length===0||r>=this._list.length)return;let s=this._list[r].label;if(i.length>1){let a=[...i].sort((c,f)=>c-f),o=a[0]<r?1:0,u=[];for(let c=a.length-1;c>=0;c--){let f=a[c];if(f>=0&&f<this._list.length){let d=this._list[f];this._list.splice(f,1),u.push(d),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(d,f)}}let l=this.index(s);l<0&&(l=this._list.length),l+=o;for(let c of u)this._list.splice(l,0,c),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(c,l)}else{let a=i[0];if(a===r||a<0||a>=this._list.length)return;let o=this._list[a];this._list.splice(a,1),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(o,a),this._list.splice(r,0,o),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(o,r)}}isEqual(e){if(!(e instanceof t)||this._list.length!==e._list.length)return!1;for(let r=0;r<this._list.length;r++){let n=this._list[r],i=e._list[r];if(!n.isEqual(i))return!1}return!0}};var Qa=Gi(ki(),1);var Ii="::RSLV:",Ff=new Map,Pf=new Map,Dn=new WeakMap,W=class extends Error{constructor(e){super(e),this.name="BagSerializationError"}},Tr=class extends ee{constructor(e){super({asBag:!1}),Dn.set(this,e)}get payload(){return Dn.get(this)}load(){throw new W("This resolver is opaque; local execution is unavailable")}};function Za(t){if(!t||typeof t!="object"||Array.isArray(t)||typeof t.resolver_module!="string"||typeof t.resolver_class!="string"||!Array.isArray(t.args??[])||!t.kwargs||typeof t.kwargs!="object"||Array.isArray(t.kwargs))throw new W("Invalid resolver description")}function Ja(t,e=new Set){if(!(t===null||typeof t=="string"||typeof t=="boolean")&&!(typeof t=="number"&&Number.isFinite(t))){if(typeof t!="object"||e.has(t)||!Array.isArray(t)&&Object.getPrototypeOf(t)!==Object.prototype&&Object.getPrototypeOf(t)!==null)throw new W("Resolver parameters must be JSON data; callbacks cannot travel");e.add(t);for(let r of Object.values(t))Ja(r,e);e.delete(t)}}function Cr(t){if(Dn.has(t))return Dn.get(t);let e=Pf.get(t.constructor);if(!e)throw new W(`Unregistered resolver: ${t.constructor.name}`);let r=e.encode(t),n={resolver_module:e.module,resolver_class:e.name,args:r.args??[],kwargs:r.kwargs??{}};return Za(n),Ja(n),Ii+JSON.stringify(n)}function An(t){if(typeof t!="string"||!t.startsWith(Ii))return null;let e=t.slice(Ii.length);if(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+$/.test(e))return new Tr(t);let r;try{r=JSON.parse(e)}catch{throw new W("Invalid resolver JSON or signed token")}Za(r);let n=Ff.get(JSON.stringify([r.resolver_module,r.resolver_class]));if(!n)return new Tr(t);let i=n.decode({args:r.args??[],kwargs:r.kwargs});if(!(i instanceof n.cls))throw new W("Resolver decoder returned an incompatible instance");return i}function xn(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[e,r instanceof ee?Cr(r):r]))}function Bi(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[e,An(r)??r]))}var xe="__cls";function Ht(t,e){return t!==null&&t.tytxSuffix===e?t:Er(e)}function qf(t){let e=t.tytxSuffix,r=Object.entries(Ve(e)).filter(([,n])=>n===t).map(([n])=>n);if(r.length===0)throw new W(`${t.name} is not in the TYTX subtype dictionary of '${e}'`);if(r.length>1)throw new W(`${t.name} is in the TYTX subtype dictionary of '${e}' under several names: ${r.sort().join(", ")}`);return r[0]}function Mi(t,e){let r=Ve(t);if(!Object.hasOwn(r,e))throw new W(`Unknown Bag class '${e}' for TYTX type '${t}'`);return r[e]}function Ri(t,e){return t===e?null:qf(t)}function*eo(t,e=[]){for(let r of t){let n=[...e,r.label];yield[n,r];let i=r.getValue(!0);!r.resolver&&i instanceof ne&&(yield*eo(i,n))}}function jf(t){let e=t.toISOString(),r=t.getUTCFullYear()===1970&&t.getUTCMonth()===0&&t.getUTCDate()===1,n=t.getUTCHours()===0&&t.getUTCMinutes()===0&&t.getUTCSeconds()===0&&t.getUTCMilliseconds()===0;if(n&&!r)return e.slice(0,e.indexOf("T"));let i=e.replace(/\.000Z$/,"Z");return r&&!n?i.slice(i.indexOf("T")+1):i}function Wt(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function ot(t){return typeof t=="string"?t.includes("::")?`${t}::T`:t:Array.isArray(t)?t.map(ot):Wt(t)?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,ot(r)])):t}function Li(t){if(!Wt(t))throw new TypeError("Bag options must be an object");let{recursive:e=!0}=t;if(typeof e!="boolean")throw new TypeError("recursive must be a boolean");return e}var Ka=!1,ne=class t{static tytxSuffix="X";constructor(e=null,r={}){this._nodes=new xr,this._backref=!1,this._parent=null,this._parentNode=null,this._rootAttributes=null,this._updSubscribers={},this._insSubscribers={},this._delSubscribers={},Li(r),e!=null&&this.fillFrom(e,r)}get parent(){return this._parent}set parent(e){this._parent=e}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e}get backref(){return!!this._backref}get nodeClass(){return ze}createChildBag(){return new this.constructor}get fullpath(){if(this._parent!==null&&this._parentNode!==null){let e=this._parent.fullpath;return e?`${e}.${this._parentNode.label}`:this._parentNode.label}return null}relativePath(e){let r=[],n=e;for(;n!==null;){if(n.parentBag===this)return r.push(n.label),r.reverse(),r.join(".");r.push(n.label),n=n.parentNode}return null}get length(){return this._nodes.length}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}get attributes(){return this._parentNode!==null?this._parentNode.getAttr():{}}get rootAttributes(){return this._rootAttributes}set rootAttributes(e){this._rootAttributes=e!==null?{...e}:null}_htraverseBefore(e){let r=this,n;for(typeof e=="string"?(e=e.replace(/\.\.\//g,"#parent."),n=e.split(".").filter(i=>i)):n=[...e];n.length&&n[0]==="#parent"&&r!==null;)n.shift(),r=r.parent;return[r,n]}_htraverse(e,r=!1,n=!0){let[i,s]=this._htraverseBefore(e);if(i===null)return[null,null];if(s.length===0)return[i,""];for(;s.length>1&&i instanceof t;){let a=s[0];if(a==="#parent"){if(i.parent===null||i.parent===void 0)break;s.shift(),i=i.parent;continue}let o=i._nodes.get(a);if(!o)break;let u=o.getValue(n);if(u instanceof t)s.shift(),i=u;else if(r){let l=i.createChildBag();o.setValue(l,!0,null,!0,!0,"autocreate"),s.shift(),i=l}else break}if(!r)return s.length>1?[null,null]:[i,s[0]];for(;s.length>1;){let a=s.shift();if(a.startsWith("#"))throw new Nr("Not existing index in #n syntax");let o=i.createChildBag();i._nodes.set(a,o,">",null,i,null,!1,!0,"autocreate"),i=o}return[i,s[0]]}get(e,r=null,n=!0,i={}){if(!e)return this;if(e==="#parent")return this.parent;let s=null;e.includes("?")&&([e,s]=e.split("?",2));let a=this._nodes.get(e);return a?a.getValue(n,s,i):r}getItem(e,r=null,n=!1,i={}){if(!e)return this;let[s,a]=this._htraverse(e,!1,n);return s instanceof t?s.get(a,r,n,i):r}setItem(e,r,n=null,i=">",s=!1,a=!0,o=null,u=!1,l=!0,c=null,f=null){if(e==="")throw new RangeError("setItem requires a non-empty path");let[d,p]=this._htraverse(e,!0);return d._nodes.set(p,r,i,n,d,c,s,a,o,l,u,f)}_pop(e,r=null){let n=this._nodes.index(e);if(n>=0){let i=this._nodes.pop(n);return this.backref&&this._onNodeDeleted(i,n,null,r),i}return null}pop(e,r=null,n=null){let i=this.popNode(e,n);return i?i.value:r}delItem(e,r=null,n=null){return this.pop(e,r,n)}popNode(e,r=null){let[n,i]=this._htraverse(e,!1,!0);if(!n||!i)return null;let s=n._nodes.get(i);if(!s)return null;try{return n._pop(i,r)}finally{s.parentBag===n&&n._nodes._dict[s.label]!==s&&(s.parentBag=null)}}clear(){let e=[...this._nodes];this._nodes.clear(),this.backref&&this._onNodeDeleted(e,-1);for(let r of e)r.parentBag=null}getNode(e,r=!0,n=!1,i=null){if(e==null||e==="")return this.parentNode;if(typeof e=="number")return this._nodes.get(e);typeof e=="string"&&(e=e.split("?",1)[0]);let[s,a]=this._htraverse(e,n,r);if(s instanceof t&&a){let o=s._nodes.get(a);if(o)return o;if(n)return s._nodes.set(a,i,">",null,s,null,!1,!0,"autocreate"),s._nodes.get(a)}return null}setBackref(e=null,r=null){let n=this._backref;if(this._backref=!0,this._parent=r,this._parentNode=e,!n){this._nodes._parentBag=this;for(let i of this)i.parentBag=this}}delParentRef(){this._parent=null,this._parentNode=null,this._backref=!1}clearBackref(){if(this._backref){this._backref=!1,this._parent=null,this._parentNode=null,this._nodes._parentBag=null;for(let e of this){e.parentBag=null;let r=e.getValue(!0);r instanceof t&&r.clearBackref()}}}_onNodeChanged(e,r,n,i=null,s=null,a=null,o=!1){for(let u of Object.values(this._updSubscribers))u({node:e,pathlist:r,oldvalue:i,attrs_diff:s,evt:n,reason:a,fired:o});this._parent&&this._parentNode&&this._parent._onNodeChanged(e,[this._parentNode.label,...r],n,i,s,a,o)}_onNodeInserted(e,r,n=null,i=null,s=!1){let a=e.parentBag,o=e.getValue(!0);a!==null&&a.backref&&o instanceof t&&o.setBackref(e,a),n===null&&(n=[]);for(let u of Object.values(this._insSubscribers))u({node:e,pathlist:n,ind:r,evt:"ins",reason:i,fired:s});this._parent&&this._parentNode&&this._parent._onNodeInserted(e,r,[this._parentNode.label,...n],i,s)}_onNodeDeleted(e,r,n=null,i=null){for(let s of Object.values(this._delSubscribers))s({node:e,pathlist:n,ind:r,evt:"del",reason:i});this._parent&&this._parentNode&&(n===null&&(n=[]),this._parent._onNodeDeleted(e,r,[this._parentNode.label,...n],i))}_subscribe(e,r,n){n!=null&&(r[e]=n)}subscribe(e,r={}){if(Object.hasOwn(r,"timer")||Object.hasOwn(r,"interval"))throw new TypeError("Timer subscriptions were removed. Schedule polling in the application.");let{update:n=null,insert:i=null,delete:s=null,any:a=null}=r;this.backref||this.setBackref(),this._subscribe(e,this._updSubscribers,n||a),this._subscribe(e,this._insSubscribers,i||a),this._subscribe(e,this._delSubscribers,s||a)}unsubscribe(e,r={}){if(Object.hasOwn(r,"timer")||Object.hasOwn(r,"interval"))throw new TypeError("Timer subscriptions were removed. Schedule polling in the application.");let{update:n=!1,insert:i=!1,delete:s=!1,any:a=!1}=r;(n||a)&&delete this._updSubscribers[e],(i||a)&&delete this._insSubscribers[e],(s||a)&&delete this._delSubscribers[e]}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}keys(){return this._nodes.keys()}values(){return this._nodes.values()}items(){return[...this._nodes].map(e=>({key:e.label,value:e.getValue()}))}get nodes(){return this.getNodes()}node(e){return this._nodes.get(e)}setAttr(e=null,r=null,n=!0){let i=t.prototype.getNode.call(this,e,!0,!0);i&&i.setAttr(r,!0,!0,n)}getAttr(e=null,r=null,n=null){let i=this.getNode(e);return i?i.getAttr(r,n):n}delAttr(e=null,...r){let n=this.getNode(e);n&&n.delAttr(...r)}getInheritedAttributes(){return this._parentNode?this._parentNode.getInheritedAttributes():{}}getNodes(e=null){return e?[...this._nodes].filter(r=>e(r)):[...this._nodes]}getNodeByValue(e,r){for(let n of this._nodes){let i=n.value;if(i instanceof t){if(i.getItem(e)===r)return n}else if(i&&i.get&&i.get(e)===r)return n}return null}getNodeByAttr(e,r,n=!1,i=!1){let s=r===void 0,a=n&&typeof r=="string"?r.toLowerCase():r,o=u=>{let l=[];for(let c of u._nodes){if(e in c.attr){let f=n&&typeof c.attr[e]=="string"?c.attr[e].toLowerCase():c.attr[e];if(s||f==a)return c}if(c._value instanceof t)if(i){let f=o(c._value);if(f)return f}else l.push(c._value)}for(let c of l){let f=o(c);if(f)return f}return null};return o(this)}isEmpty(e=!1,r=!1){if(this._nodes.length===0)return!0;for(let n of this._nodes){if(n._resolver!==null)return!1;let i=n.getValue(!0);if(i!=null&&!(e&&i===0)&&!(r&&i===""))return!1}return!0}query(e=null,r=null,n=!1,i=!1,s=!0,a=!0,o=null,u=!0){e||(e="#k,#v,#a");let l=this,c;if(typeof e=="string"){if(e.includes(":")){let[p,m]=e.split(":");l=this.getItem(p),e=m}c=e.split(",").map(p=>p.trim())}else c=e;let f=(p,m,h,g,b)=>{if(m==="#k")return p.label;if(m==="#p")return h;if(m==="#n")return p;if(typeof m=="function")return m(p);if(m==="#v"){let k=b();return g&&k instanceof t?null:k}else if(m.startsWith("#v.")){let k=m.split(".").slice(1).join("."),y=b();return y&&y.getItem?y.getItem(k):null}else{if(m==="#__v")return p.getValue(!0);if(m.startsWith("#a")){let k=m.includes(".")?m.split(".").slice(1).join("."):null;return p.getAttr(k)}else{let k=b();return k&&k.getItem?k.getItem(m):null}}};function*d(){let p=0;function*m(h,g){for(let b of h._nodes){let k=g?`${g}.${b.label}`:b.label,y=!1,A,I=()=>(y||(A=b.getValue(u),y=!0),A);if((s&&a||(I()instanceof t?a:s))&&(r===null||r(b))&&(yield c.length===1?f(b,c[0],k,i,I):c.map(X=>f(b,X,k,i,I)),p++,o!==null&&p>=o))return;if(i){let X=I();if(X instanceof t&&(yield*m(X,k),o!==null&&p>=o))return}}}yield*m(l,"")}return n?d():[...d()]}getLeaves(){let e=[],r=(n,i)=>{for(let s of n._nodes){let a=i?`${i}.${s.label}`:s.label,o=s.getValue(!1);o instanceof t?r(o,a):e.push([a,o])}};return r(this,""),e}digest(e=null,r=null,n=!1){typeof r=="boolean"&&(console.warn("Bag.digest(what, asColumns) is deprecated; use digest(what, null, asColumns)."),n=r,r=null);let i=this.query(e,r,!1,!1,!0,!0,null,!1);if(n){if(!i||i.length===0)return(typeof e=="string"?e:"#k,#v,#a").split(",").map(u=>u.trim()).map(()=>[]);let s=[...i];if(s.length&&Array.isArray(s[0])){let a=s[0].length,o=[];for(let u=0;u<a;u++)o.push(s.map(l=>l[u]));return o}return[s]}return[...i]}columns(e,r=!1){typeof e=="string"&&(e=e.split(","));let n=r?"#a.":"",i=e.map(s=>`${n}${s}`).join(",");return this.digest(i,null,!0)}sum(e="#v",r=!1,n=null){if(r!=null&&typeof r!="boolean")throw new TypeError("sum strict must be a boolean; pass condition as the third argument");if(n!=null&&typeof n!="function")throw new TypeError("sum condition must be callable; deep is no longer supported");let i=s=>{let a=0,o=!1;for(let u of this.query(s,n)){if(u==null||u===""){o=!0;continue}if(typeof u!="number"&&typeof u!="boolean"){if(r)throw new TypeError(`sum encountered non-numeric value: ${typeof u}`);continue}a+=u}return r&&o?null:a};return e.includes(",")?e.split(",").map(s=>i(s.trim())):i(e)}sort(e="#k:a"){let r=(i,s)=>i==null?[-1,""]:s&&typeof i=="string"?[0,i.toLowerCase()]:[0,i],n=(i,s)=>i[0]!==s[0]?i[0]-s[0]:i[1]<s[1]?-1:i[1]>s[1]?1:0;if(typeof e=="function")this._nodes._list.sort((i,s)=>{let a=e(i),o=e(s);return a<o?-1:a>o?1:0});else{let i=e.split(",");i.reverse();for(let s of i){let a,o;s.includes(":")?[a,o]=s.split(":",2):(a=s,o="a"),a=a.trim(),o=o.trim();let u=o==="d"||o==="D",l=o==="a"||o==="d",c;if(a.toLowerCase()==="#k")c=f=>r(f.label,l);else if(a.toLowerCase()==="#v")c=f=>r(f.value,l);else if(a.toLowerCase().startsWith("#a.")){let f=a.slice(3);c=d=>r(d.getAttr(f),l)}else c=f=>{let d=f.value,p=d instanceof t?d.getItem(a):d?d[a]:null;return r(p,l)};this._nodes._list.sort((f,d)=>{let p=n(c(f),c(d));return u?-p:p})}}return this}equalTo(e){return e instanceof t?this._nodes.isEqual(e._nodes):!1}has(e){if(typeof e=="string"){let r=null;e.includes("?")&&([e,r]=e.split("?",2));let n=this.getNode(e);return n===null?!1:r===null?!0:r.split("&").every(i=>i in n.attr)}else if(e&&e.label!==void 0)return[...this._nodes].includes(e);return!1}getResolver(e){let r=this.getNode(e);return r?r.resolver:null}setResolver(e,r){let n=this.getNode(e);n||(this.setItem(e,null),n=this.getNode(e)),n.resolver=r}setCallbackItem(e,r,n={}){let i=new Ar({callback:r,...n});this.setResolver(e,i)}move(e,r,n=!0){this._nodes.move(e,r,n)}asDict(e=!1,r=!1,n=!1,i=!1){let s={};for(let a of this._nodes){let o=a.value;if(i&&o==null)continue;let u=a.label;e&&(u=String(u)),r&&(u=u.toLowerCase()),n&&o instanceof t&&(o=t.prototype.asDict.call(o,e,r,n,i)),Object.defineProperty(s,u,{value:o,enumerable:!0,writable:!0,configurable:!0})}return s}setdefault(e,r=null){let n=this.getNode(e);return n?n.value:(this.setItem(e,r),r)}deepcopy(e=!1){let r=this.createChildBag();for(let n of this._nodes){let i=n.getValue(!e);i instanceof t&&(i=i.deepcopy(e));let s=new r.nodeClass(r,n.label,i);s.setAttr({...n.attr},!1,!1,!1),s.nodeTag=n.nodeTag,s.xmlTag=n.xmlTag,r._nodes._list.push(s),r._nodes._dict[s.label]=s}return r}update(e,r=null,n=null,i=!1){if(!(e instanceof t)){for(let s in e){let a=e[s];(!i||a!==null||!this._nodes.has(s))&&this.setItem(s,a,null,">",!1,!1,n,!1,n!==!1)}return}for(let s of[...e]){let a=s.label,o=r==="static"?s.resolver:null,u=o?null:s.getValue(),l=s.attr.__replace;delete s.attr.__replace;let c=this._nodes.get(a);if(c)if(c.setAttr(s.attr,n===null?!0:n,!0,!1),s.nodeTag!=null&&(c.nodeTag=s.nodeTag),s.xmlTag!=null&&(c.xmlTag=s.xmlTag),o)c.resolver=o,c.setValue(null,n===null?!0:n,null,null,!1,n);else{s.resolver&&(c.resolver=null);let f=c.getValue();u instanceof t&&f instanceof t&&!l?f.update(u,r,n,i):(!i||u!==null)&&c.setValue(u,n===null?!0:n,null,null,!1,n)}else{let f=this.setItem(a,o||u,s.attr,">",!1,!1,n,!1,n!==!1);f.nodeTag=s.nodeTag,f.xmlTag=s.xmlTag}}}_fillFromBag(e){this.clear();for(let r of e){let n=new this.nodeClass(this,r.label);n.replace(r),n.nodeTag=r.nodeTag,n.xmlTag=r.xmlTag,this._nodes._list.push(n),this._nodes._dict[n.label]=n}}_appendLiteral(e,r,n=null,i=null,s=null){if(typeof e!="string")throw new TypeError("Bag labels must be strings");let a=new this.nodeClass(this,e,null,n,i,s,null,!1);return r instanceof ee?a.resolver=r:a._value=r,this._nodes._dict[e]=a,this._nodes._list.push(a),a}fillFrom(e=null,r={}){let n=Li(r);if(e!=null&&!Wt(e)&&!Array.isArray(e))throw new TypeError("Bag source must be a dictionary, array or null");let i=this.createChildBag(),s=new Set,a=(o,u,l)=>{if(s.has(u))throw new TypeError(`Cyclic Bag source at ${l}`);s.add(u);try{let c=Array.isArray(u)?String(u.length).length+1:0,f=Array.isArray(u)?Array.from(u,(d,p)=>[`r_${String(p).padStart(c,"0")}`,d]):Object.entries(u);if(!Array.isArray(u)&&Object.getOwnPropertySymbols(u).some(d=>Object.prototype.propertyIsEnumerable.call(u,d)))throw new TypeError(`Bag labels must be strings at ${l}`);for(let[d,p]of f){let m=p;n&&(Wt(m)||Array.isArray(m))&&(m=this.createChildBag(),a(m,p,`${l}[${JSON.stringify(d)}]`)),o._appendLiteral(d,m)}}finally{s.delete(u)}};return e!=null&&a(i,e,"$"),this._replacePrepared(i)}_loadSource(e,r={}){return this.fillFrom(e,r)}replace(e){if(!(e instanceof t))throw new TypeError("Bag.replace expects a Bag");if(e===this)return this;let r=this.createChildBag();return r._fillFromBag(e),this._replacePrepared(r)}_replacePrepared(e){for(let n of this._nodes){n.parentBag=null;let i=n.getValue(!0);i instanceof t&&i.clearBackref()}let r=this._nodes;this._nodes=e._nodes,e._nodes=r,this._nodes._parentBag=this.backref?this:null,e._nodes._parentBag=null;for(let n of this._nodes)n.parentBag=this;for(let n of e._nodes)n._parentBag=e;return this.backref&&this.parent&&this.parentNode&&this.parent._onNodeChanged(this.parentNode,[this.parentNode.label],"upd_value",e),this}forEach(e,{static:r=!0,deep:n=!1,kwargs:i={}}={}){if(typeof e!="function")throw new TypeError("forEach requires a callback");let s=(a,o)=>{for(let u=0;u<a._nodes.length;u++){let l=a._nodes._list[u],c={...o};"_pathlist"in o&&(c._pathlist=[...o._pathlist,l.label]),"_indexlist"in o&&(c._indexlist=[...o._indexlist,u]);let f=e(l,c,u);if(f)return f;if(f==null&&n){let d=l.getValue(r);if(d instanceof t){let p=s(d,c);if(p)return p}}}return null};return s(this,i)}*traverse(){for(let e of this._nodes){yield e;let r=e.getValue(!0);r instanceof t&&(yield*r.traverse())}}*_iterNodesWithPaths(e=!0,r=""){for(let n of this._nodes){let i=r?`${r}.${n.label}`:n.label;yield[i,n];let s=n.getValue(e);s instanceof t&&(yield*s._iterNodesWithPaths(e,i))}}*_nodeFlattener(e=null){let r=e!==null,n=r?Object.create(null):null,i=0,s=new Map([["[]",this.constructor]]);for(let[a,o]of eo(this)){let u=a.slice(0,-1),l=JSON.stringify(a),c=JSON.stringify(u),f=o.getValue(!0),d,p=null;if(o.resolver)d=Cr(o.resolver);else if(f instanceof t){let g=f.constructor,b=g.tytxSuffix;s.set(l,g),p=Ri(g,Ht(s.get(c),b)),d=`::${b}`}else f===null?d="::NN":d=ot(f);if(o.attr&&Object.hasOwn(o.attr,xe))throw new W(`node '${a}': the attribute '${xe}' is reserved for the Bag class name`);let m=xn(ot(o.attr));p!==null&&(m[xe]=p);let h=o.nodeTag;r?(yield[u.length?n[c]:null,o.label,h,d,m],f instanceof t&&(n[l]=i,e[i]=a,i++)):yield[u,o.label,h,d,m]}}toTytx(e="json",r=!1){let n=this._toTytxPayload(r),i=this.constructor.tytxSuffix;if(e==="json")return`${n}::${i}`;if(e==="msgpack")return Yr(new De(4,new TextEncoder().encode(`${i}:${n}`)));throw new TypeError(`Unsupported transport: ${e}`)}_toTytxPayload(e=!1){let r;if(e){let s={};r={rows:[...this._nodeFlattener(s)],paths:s}}else r={rows:[...this._nodeFlattener(null)]};let n=this.constructor,i=Ri(n,Ht(null,n.tytxSuffix));return i!==null&&(r[xe]=i),r.rows=r.rows.map(([s,a,o,u,l])=>[ot(s),ot(a),ot(o),u,l]),r.paths&&(r.paths=ot(r.paths)),ge(r)}static fromTytx(e,r="json",n={}){if(Wt(r)&&(n=r,r="json"),Li(n),typeof e!="string"&&!(e instanceof Uint8Array))throw new TypeError("fromTytx requires serialized text or bytes");if(r!=="json"&&r!=="msgpack")throw new TypeError(`Unsupported transport: ${r}`);r==="json"&&e instanceof Uint8Array&&(e=new TextDecoder().decode(e));let i=Q(e,r==="json"?null:r);if(i instanceof t)return i;if(!Wt(i)&&!Array.isArray(i))throw new TypeError("fromTytx requires a dictionary, array or typed Bag root");return new this(i,n)}static _fromTytxPayload(e){let r=this.tytxSuffix;if(e==="")return new(Ht(null,r));let n=Q(e);if(!n||!Array.isArray(n.rows))throw new W("Invalid TYTX Bag: expected rows");let i=n.paths,s=i!=null,a=Object.hasOwn(n,xe)?Mi(r,n[xe]):Ht(null,r),o=new a,u=new Map([["[]",o]]);for(let l of n.rows){if(!Array.isArray(l)||l.length!==5)throw new W("Invalid TYTX Bag row");let[c,f,d,p,m]=l,h=c??"";if(s){if(c!==null&&!Object.hasOwn(i,c))throw new W(`Unknown TYTX parent reference: ${c}`);h=c===null?"":i[c]}if(typeof h=="string"&&(h=h?h.split("."):[]),!Array.isArray(h))throw new W("Invalid TYTX parent path");let g=JSON.stringify(h);if(!u.has(g))throw new W(`Missing or undecodable TYTX parent branch: ${h}`);let b=u.get(g),k=JSON.stringify([...h,f]),y=p,A=An(y),I=Bi(m),L=Object.hasOwn(I,xe)?I[xe]:null;if(delete I[xe],y instanceof t){let te=y.constructor.tytxSuffix,re=L!==null?Mi(te,L):Ht(b.constructor,te);y=new re,u.set(k,y)}else if(L!==null)throw new W(`node '${k}': the attribute '${xe}' is reserved for the Bag class name of a branch`);let X=b._appendLiteral(f,A?null:y,I,A);X.nodeTag=d??null}return o}toXml(e={}){let{pretty:r=!1,encoding:n="UTF-8",docHeader:i=null,selfClosedTags:s=null}=e,a=this._bagToXml(s,r);return i===!0?a=`<?xml version='1.0' encoding='${n}'?>
|
|
16
|
-
${a}`:typeof i=="string"&&(a=`${i}
|
|
17
|
-
${a}`),a}_bagToXml(e=null,r=!1,n=0){let i=[];for(let s of this._nodes)i.push((r?" ".repeat(n):"")+this._nodeToXml(s,e,r,n));return i.join(r?`
|
|
18
|
-
`:"")}_nodeToXml(e,r=null,n=!1,i=0){let s=e.xmlTag||e.nodeTag||e.label,a=this._sanitizeTag(s),o=[];if(a!==s&&o.push(`_tag="${this._escapeAttr(s)}"`),e.resolver&&o.push(`_resolver="${this._escapeAttr(Cr(e.resolver))}"`),e.attr)for(let[d,p]of Object.entries(xn(e.attr)))p!==null&&p!==!1&&p!==void 0&&o.push(`${d}="${this._escapeAttr(String(p))}"`);let u=o.length?" "+o.join(" "):"",l=e.resolver?null:e.getValue(!0);if(l&&typeof l._bagToXml=="function"){n=n&&e.attr?.["xml:space"]!=="preserve";let d=l._bagToXml(r,n,i+1);return d?n?`<${a}${u}>
|
|
19
|
-
${d}
|
|
20
|
-
${" ".repeat(i)}</${a}>`:`<${a}${u}>${d}</${a}>`:r===null||r.includes(a)?`<${a}${u}/>`:`<${a}${u}></${a}>`}if(l==null||l==="")return r===null||r.includes(a)?`<${a}${u}/>`:`<${a}${u}></${a}>`;let c=l instanceof Date&&!Number.isNaN(l.getTime())?jf(l):String(l),f=this._escapeXml(c);return`<${a}${u}>${f}</${a}>`}_sanitizeTag(e){return e?e.replace(/[^a-zA-Z0-9_\-.:]/g,"_"):"_none_"}_escapeXml(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}_escapeAttr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}static fromXml(e,r={}){let{tagAttribute:n=null}=r,i;if(typeof DOMParser<"u"){i=new DOMParser().parseFromString(e,"application/xml");let a=i.querySelector("parsererror");if(a)throw new Error(`XML parse error: ${a.textContent}`)}else i=new Qa.DOMParser().parseFromString(e,"application/xml");return this._xmlElementToBag(i.documentElement,n)}static _xmlElementToBag(e,r=null){let n=new this,i=Array.from(e.childNodes).filter(s=>s.nodeType===1);for(let s of i){let a=s.tagName,o={};for(let h=0;h<s.attributes.length;h++){let g=s.attributes[h];o[g.name]=g.value}let u=An(o._resolver);u&&delete o._resolver;let l=String(o._T||"").toUpperCase()==="BAG";Object.assign(o,Bi(o));let c=a;"_tag"in o&&(c=o._tag,delete o._tag),r&&r in o&&(c=o[r],delete o[r]);let f=c,d=1;for(;n.getNode(c);)c=`${f}_${d++}`;let p=Array.from(s.childNodes).filter(h=>h.nodeType===1),m;if(p.length>0||l){let h=this._xmlElementToBag(s,r);m=n.setItem(c,h,Object.keys(o).length>0?o:null)}else{let h=s.textContent||"";m=n.setItem(c,h,Object.keys(o).length>0?o:null)}u&&(m.resolver=u),m.xmlTag=a}return n}static async fromUrl(e,r={}){let{timeout:n=30}=r,i={};n&&(i.signal=AbortSignal.timeout(n*1e3));let s=await fetch(e,i),a=s.headers.get("content-type")||"",o=await s.text();if(a.includes("json"))return t.fromTytx(o);if(a.includes("xml"))return t.fromXml(o);let u=o.trim();if(u.startsWith("<"))return t.fromXml(o);if(u.startsWith("{")||u.startsWith("["))return t.fromTytx(o);throw new Nr(`Unsupported content-type: ${a}`)}toJson(e=!0){let r=[];for(let n of this._nodes)r.push(this._nodeToJsonDict(n,e));return e?ge(r):JSON.stringify(r)}_nodeToJsonDict(e,r){let n=e.resolver?null:e.getValue(!0);if(n&&typeof n._nodeToJsonDict=="function"){let s=[];for(let a of n._nodes)s.push(n._nodeToJsonDict(a,r));n=s}let i={label:e.label,value:n,attr:xn(e.attr)};return e.nodeTag!==null&&(i.tag=e.nodeTag),e.resolver&&(i.resolver=Cr(e.resolver)),i}static fromJson(e,r={}){return Ka||(console.warn("Bag.fromJson is deprecated; use Bag.fromTytx"),Ka=!0),this.fromTytx(e,"json",r)}toStringTree(e=!0,r=null,n="",i=!0){r===null&&(r=new Map);let s=[],a=[...this._nodes];for(let o=0;o<a.length;o++){let u=a[o],l=o===a.length-1,c=u.getValue(e),f=u.getAttr(),d="",p=Object.keys(f);p.length>0&&(d=" ["+p.map(b=>`${b}=${JSON.stringify(f[b])}`).join(", ")+"]");let m=l?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",h=n+(l?" ":"\u2502 ");if(c instanceof t){let g=u,b=c.backref?"(*)":"";if(r.has(g))s.push(`${n}${m}${u.label}${b}${d} \u2192 (circular ref)`);else{r.set(g,u.label),s.push(`${n}${m}${u.label}${b}${d}`);let k=c.toStringTree(e,r,h,l);k&&s.push(k)}}else{let g;if(c===null)g="null";else if(c===void 0)g="undefined";else if(c instanceof ArrayBuffer||c instanceof Uint8Array){let b=new TextDecoder("utf-8",{fatal:!1}),k=c instanceof ArrayBuffer?new Uint8Array(c):c;g=b.decode(k)}else typeof c=="string"?c.length>50?g=JSON.stringify(c.slice(0,47)+"..."):g=JSON.stringify(c):g=String(c);s.push(`${n}${m}${u.label}: ${g}${d}`)}}return s.join(`
|
|
21
|
-
`)}toString(e=!0,r=null,n=""){r||(r=new Set);let i=[],s=[...this._nodes];for(let a=0;a<s.length;a++){let o=s[a],u=a===s.length-1,l=o.getValue(e),c="",f=o.attr;f&&Object.keys(f).length>0&&(c=` [${Object.entries(f).map(([h,g])=>`${h}=${JSON.stringify(g)}`).join(", ")}]`);let d=u?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",p=n+(u?" ":"\u2502 ");if(l&&typeof l._htraverse=="function"){let m=o;if(r.has(m))i.push(`${n}${d}${o.label}${c} \u2192 (circular ref)`);else{r.add(m),i.push(`${n}${d}${o.label}${c}`);let h=l.toString(e,r,p);h&&i.push(h)}}else{let m;l==null?m="null":typeof l=="string"&&l.length>50?m=JSON.stringify(l.slice(0,47)+"..."):typeof l=="string"?m=JSON.stringify(l):m=String(l),i.push(`${n}${d}${o.label}: ${m}${c}`)}}return i.join(`
|
|
22
|
-
`)}},Nr=class extends Error{constructor(e){super(e),this.name="BagException"}};ee.registerBagClass(ne);Oi(ne,"X",t=>t._toTytxPayload(),t=>ne._fromTytxPayload(t));Dr(ne.tytxSuffix,{...Ve(ne.tytxSuffix),Bag:ne});var to=new Set(["False","None","True","and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"]);function ro(t){return t.endsWith("_")&&to.has(t.slice(0,-1))?t.slice(0,-1):t}function no(t){let e=ro(t);return e!==t?e:t.startsWith("_")&&to.has(t.slice(1))?t.slice(1):t}function $i(t,{renderTag:e=null,ns:r=null,dialectName:n=null}={}){let i=e||t;if(!i)return i;if(i=ro(i),r&&!e){let s=`${n}_`;i.startsWith(s)&&(i=i.slice(s.length)),i=`${r}:${i}`}return i}var Gt=Symbol("value"),so=new Set(["_meta","datapath","nodeId","ns","form","formId","_anchor","updateOn"]);function Ui(t){return Object.entries(t||{}).filter(([e])=>!so.has(e)).map(([e,r])=>[no(e),r])}var Xt=class extends ze{constructor(e,r,n=null,i=null,s=null,a=null,o=null){super(e,r,n,i,s,a,o),this._builder=e?._insertingBuilder??e?._builder??null,this._targetId=null}get builder(){if(this._builder)return this._builder;let e=this.parentBag;return e?e._builder:null}get data(){return this.builder.data}get rootBuilder(){return this.parentBag.root._builder}_getMeta(e){let r=this.getAttr("_meta")||{},n=e.split(",").map(i=>i.trim());return n.length===1?r[n[0]]!==void 0?r[n[0]]:null:n.map(i=>r[i]!==void 0?r[i]:null)}pointerType(e){return typeof e=="string"&&(e[0]==="^"||e[0]==="=")&&!e.startsWith("==")?e[0]:null}pointers(){this.builder.validateCustomTypes(this);let e=[];for(let[r,n]of Object.entries(this.getAttr()||{}))this.pointerType(n)==="^"&&e.push([r,n.split(":",1)[0]]);return this.pointerType(this.value)==="^"&&e.push(["",this.value.split(":",1)[0]]),e}fixedAttrItems(){return Ui(this.getAttr())}runtimeToEvaluate(){let e=new Map(this.fixedAttrItems());return e.set(Gt,this.value),e}absDatapath(e){let r=e;this.pointerType(e)&&(e=(Ge(e)?.pointer??e).slice(1));let n=null;return e.includes("?")&&([e,n]=e.split("?",2)),e.startsWith("#")?this._finalizeAbsPath(this._resolveSymbolicDatapath(e,r),n):(e.startsWith(".")&&(e=this._composeRelativeDatapath(e,r)),this._finalizeAbsPath(e,n))}_finalizeAbsPath(e,r){return e=this._collapseParentDatapath(e,e),r?`${e}?${r}`:e}_composeRelativeDatapath(e,r){let n=this;for(;n!==null&&e.startsWith(".");){let i=n.getAttr("datapath");i!=null&&(e=e==="."?i:i+e),n=n.parentNode}if(e.startsWith("."))throw new Error(`unresolved relative datapath: ${r}`);return e}_collapseParentDatapath(e,r){let n=[];for(let i of e.split("."))if(i==="#parent"){if(n.length===0)throw new Error(`#parent has no segment to cancel: ${r}`);n.pop()}else n.push(i);return n.join(".")}_resolveSymbolicDatapath(e,r){let n=e.slice(1),i=n.indexOf("."),s=i===-1?n:n.slice(0,i),a=i===-1?"":n.slice(i+1),o;if(s==="FORM")o=this._findMarkedDatapathAncestor(!0,!1,r);else if(s==="ANCHOR")o=this._findMarkedDatapathAncestor(!1,!0,r);else{let u=this.rootBuilder;if(!u)throw new Error(`#<id>: cannot resolve ${r} on a node without builder`);if(o=u.source.getNodeByAttr("nodeId",s),o==null)throw new Error(`#<id>: cannot resolve ${r}`)}return o.absDatapath(a?`.${a}`:".")}_findMarkedDatapathAncestor(e,r,n){let i=this;for(;i!=null;){let a=i.getAttr()||{};if(e&&(a.formId!=null||a.form===!0)||r&&"_anchor"in a)return i;i=i.parentNode}let s=e?"FORM":"ANCHOR";throw new Error(`#${s}: no marked ancestor found for ${n}`)}getRelativeData(e,r=null,{autocreate:n=!1}={}){let i=this.data,s=this.absDatapath(e);return n&&i.getItem(s)==null&&i.setItem(s,r),i.getItem(s,r)}setRelativeData(e,r,{attributes:n=null,fired:i=!1,reason:s=null}={}){let a=this.data,o=this.absDatapath(e);a.setItem(o,r,n,">",!1,!0,s===null?!0:s,i)}fireEvent(e,r=!0,{attributes:n=null,reason:i=null}={}){this.setRelativeData(e,r,{attributes:n,fired:!0,reason:i})}SET(e,r){this.setRelativeData(e,r)}GET(e){return this.getRelativeData(e)}PUT(e,r){this.setRelativeData(e,r,{reason:!1})}FIRE(e,r=!0){this.setRelativeData(e,r,{fired:!0})}},H=class t extends ne{constructor(e=null,r=null){super(e),this._builder=r,this._insertingBuilder=null}get nodeClass(){return Xt}_setBuilderItem(e,r,n,...i){let s=r?.map(([o])=>[o,o._builder])||null;if(r)for(let[o,u]of r)o._builder=u;let a=this._insertingBuilder;this._insertingBuilder=e;try{return this.setItem(n,...i)}catch(o){if(this.node(n)==null&&s)for(let[u,l]of s)u._builder=l;throw o}finally{this._insertingBuilder=a}}bindBuilder(e){if(!e)throw new Error("SourceBag.bindBuilder requires a builder");let r=this._builderBindingPlan(e);for(let[n,i]of r)n._builder=i;return this.setBackref(),this}_builderBindingPlan(e){let r=[],n=new WeakSet,i=(s,a)=>{if(n.has(s))throw new Error("source contains a cyclic or shared SourceBag branch");n.add(s),r.push([s,a]);for(let o of s.getNodes()){let u=a,l=o._getMeta("subbuilder");l!=null&&(u=a._resolveSubbuilderReference(l,o.getAttr()||{},o.nodeTag)),r.push([o,u]);let c=o.getValue(!0);c instanceof t&&i(c,u)}};return i(this,e),r}};if((Ve(H.tytxSuffix).SourceBag??H)!==H)throw new Error("TYTX subtype name 'SourceBag' is already registered for another class");Dr(H.tytxSuffix,{...Ve(H.tytxSuffix),SourceBag:H});function Wf(t){if(t.length===0)return{value:null,attrs:{}};let e=t[0];if(e!==null&&typeof e=="object"){let r=Object.getPrototypeOf(e);if(r===Object.prototype||r===null)return{value:null,attrs:e}}return{value:e,attrs:t[1]||{}}}var Xf=new Set(["then","toJSON"]),ao=new WeakMap;function Sr(t){return ao.get(t)||t}function Fi(t){if(t==null)return t;t=Sr(t);let e=t._builder||t.parentBag&&t.parentBag._builder;return e?e.wrapSource(t):t}function oo(t,e){let r=e instanceof ne,n=new Proxy(e,{get(i,s){if(typeof s=="symbol"||s.startsWith("_")||Xf.has(s))return Reflect.get(i,s,i);let a=t.schemaTag(s);if(r&&a)return io(t,i,a,r);if(s in i){let u=Reflect.get(i,s,i);return typeof u=="function"?u.bind(i):u}if(a)return io(t,i,a,r);let o=t.containerMethod(s);if(o)return(...u)=>t[o](t.wrapSource(i),...u)}});return ao.set(n,e),n}function io(t,e,r,n){return(...i)=>{let{value:s,attrs:a}=Wf(i),o=n?t.bagCall(e,r,s,a):t.commandOnNode(e,r,s,a);return o.builder.wrapSource(o)}}var uo=/^[A-Za-z_][A-Za-z0-9_]*$/,Gf=new Set(["positional_only","positional_or_keyword","keyword_only","var_positional","var_keyword"]),Yf=new Set(["framework","value","attribute"]),Zf=new Map([["builtins.str",t=>typeof t=="string"],["builtins.int",t=>Number.isInteger(t)],["builtins.float",t=>typeof t=="number"&&Number.isFinite(t)],["builtins.bool",t=>typeof t=="boolean"],["builtins.list",t=>Array.isArray(t)],["builtins.dict",t=>t!==null&&typeof t=="object"&&!Array.isArray(t)],["builtins.tuple",t=>Array.isArray(t)],["builtins.set",t=>Array.isArray(t)||t instanceof Set],["builtins.NoneType",t=>t===null],["builtins.object",t=>!0]]);function wt(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function v(t,e){throw new TypeError(`${t}: ${e}`)}function Me(t,e,r,n){wt(t)||v(n,"must be an object");for(let i of Object.keys(t))e.includes(i)||v(n,`unknown field '${i}'`);for(let i of r)Object.hasOwn(t,i)||v(n,`missing field '${i}'`)}function yt(t,e){if(!(t===null||typeof t=="string"||typeof t=="boolean")&&!(typeof t=="number"&&Number.isFinite(t))){if(Array.isArray(t))return t.forEach((r,n)=>yt(r,`${e}[${n}]`));if(wt(t))return Object.entries(t).forEach(([r,n])=>yt(n,`${e}.${r}`));v(e,"must be lossless JSON data")}}function Jf(t,e){let r="",n=!1;for(let i=0;i<t.length;i++){let s=t[i];if(s==="\\"){r+=s+(t[++i]??"");continue}s==="["&&(n=!0),!n&&s==="."&&!(e&16)?r+="[^\\n]":!n&&s==="^"&&e&8?r+="(?:^|(?<=\\n))":!n&&s==="$"?r+=e&8?"(?=\\n|(?![\\s\\S]))":"(?=\\n?(?![\\s\\S]))":r+=s,s==="]"&&(n=!1)}return r}function bt(t,e,r=!1,n=null){if(t===null)return null;switch(Me(t,["kind","dtype","module","name","origin","arguments","items","values","base","metadata","pattern","flags","ge","le","gt","lt","value"],["kind"],e),t.kind){case"custom":return Me(t,["kind","name"],["kind","name"],e),n||v(e,"custom references require a catalog; nested catalog references are unsupported"),n.resolve(t.name,e);case"dtype":{Me(t,["kind","dtype"],["kind","dtype"],e);let i=t.dtype;typeof i!="string"&&v(e,"dtype must be a string");let s=Er(i);return!s&&i!=="NN"&&v(e,`unknown dtype '${i}'`),{...t,test:o=>i==="NN"?o===null:i==="N"?ke(o)&&!["NaN","Infinity","-Infinity"].includes(o.toString()):s===Number?typeof o=="number"&&Number.isFinite(o)&&(i!=="L"||Number.isInteger(o)):s===String?typeof o=="string":s===Boolean?typeof o=="boolean":s===Date?o instanceof Date&&Number.isFinite(o.getTime()):s===Object?wt(o)&&[Object.prototype,null].includes(Object.getPrototypeOf(o)):o instanceof s}}case"any":return{...t,test:i=>!0};case"type":{(typeof t.module!="string"||typeof t.name!="string")&&v(e,"type requires string module/name");let i=`${t.module}.${t.name}`;if(i==="collections.abc.Callable")return{...t,test:a=>typeof a=="function",portable:!1};let s=Zf.get(i);return s||v(e,`unsupported type '${i}'`),{...t,test:s}}case"union":{(!Array.isArray(t.items)||!t.items.length)&&v(e,"union items must be non-empty");let i=t.items.map((s,a)=>bt(s,`${e}.items[${a}]`,!0,n));return{...t,items:i,inputConstraint:i.some(s=>s.inputConstraint),test:s=>i.some(a=>a.test&&a.test(s))}}case"literal":return Array.isArray(t.values)||v(e,"literal values must be an array"),t.values.forEach((i,s)=>yt(i,`${e}.values[${s}]`)),{...t,test:i=>t.values.some(s=>Object.is(s,i))};case"annotated":{Array.isArray(t.metadata)||v(e,"annotated metadata must be an array"),t.metadata.some(a=>!["regex","range","value"].includes(a?.kind))&&v(e,"unsupported annotation metadata kind");let i=bt(t.base,`${e}.base`,!0,n),s=t.metadata.map((a,o)=>bt(a,`${e}.metadata[${o}]`,!0,n));return{...t,base:i,metadata:s,inputConstraint:i.inputConstraint,test:a=>i.test(a)&&s.every(o=>!o.test||o.test(a))}}case"range":{for(let i of["ge","le","gt","lt"])Object.hasOwn(t,i)||v(e,`range missing '${i}'`);for(let i of["ge","le","gt","lt"])t[i]!==null&&(typeof t[i]!="number"||!Number.isFinite(t[i]))&&v(e,`${i} must be finite number or null`);return{...t,test:i=>typeof i=="number"&&(t.ge===null||i>=t.ge)&&(t.le===null||i<=t.le)&&(t.gt===null||i>t.gt)&&(t.lt===null||i<t.lt)}}case"regex":{(typeof t.pattern!="string"||!Number.isInteger(t.flags)||t.flags<0)&&v(e,"regex requires pattern and non-negative integer flags");let i=t.flags&-59;i&&v(e,`unsupported Python regex flags ${i}`),t.flags&2&&v(e,"IGNORECASE is not portable across Python and JavaScript Unicode rules"),/\\[AZzUwWdDsSabBN0-9]|\(\?P[<=!]|\(\?\(|\(\?>|\(\?#|\(\?[aiLmsux-]|[+*?}]\+|\{,/.test(t.pattern.replaceAll(String.raw`[\s\S]`,"."))&&v(e,"regex uses a non-portable construct or character class");let s="uy";t.flags&16&&(s+="s");let a;try{a=new RegExp(`(?:${Jf(t.pattern,t.flags)})(?![\\s\\S])`,s)}catch(o){v(e,`invalid portable regex: ${o.message}`)}return{...t,test:o=>typeof o!="string"?!1:(a.lastIndex=0,a.test(o))}}case"value":return yt(t.value,`${e}.value`),{...t};case"generic":{let i=bt(t.origin,`${e}.origin`,!0,n);(t.origin?.kind!=="type"||t.origin.module!=="builtins"||!["list","dict","tuple","set"].includes(t.origin.name))&&v(e,"only list, dict, tuple and set generic origins are supported"),Array.isArray(t.arguments)||v(e,"generic arguments must be an array");let s=t.arguments.map((a,o)=>bt(a,`${e}.arguments[${o}]`,!0,n));return{...t,origin:i,arguments:s,inputConstraint:s.some(a=>a.inputConstraint),test:a=>i.test(a)&&Kf(t.origin,s,a)}}case"arguments":v(e,"Callable argument-list descriptors are not supported by Python validation");case"ellipsis":return r||v(e,"ellipsis is only valid as a nested descriptor"),{...t};default:v(e,`unknown annotation kind '${t.kind}'`)}}function Kf(t,e,r){let n=`${t.module}.${t.name}`;return n==="builtins.tuple"&&e.length&&e[1]?.kind!=="ellipsis"?r.length===e.length&&r.every((i,s)=>e[s].test(i)):n==="builtins.list"||n==="builtins.set"||n==="builtins.tuple"?[...r].every(i=>!e[0]?.test||e[0].test(i)):n==="builtins.dict"?Object.entries(r).every(([i,s])=>(!e[0]?.test||e[0].test(i))&&(!e[1]?.test||e[1].test(s))):!1}function co(t,e){if(t===null)return null;if(typeof t!="string"&&v(e,"must be string or null"),t==="")return new Map;let r=new Map;for(let n of t.split(",")){let i=n.trim();/^[A-Za-z_][A-Za-z0-9_]*\[\]$/.test(i)&&v(e,`invalid cardinality item '${n}'`);let s=i.match(/^([A-Za-z_][A-Za-z0-9_]*|\*)(?:\[(?:(\d+)|(?:(\d*):(\d*)))\])?$/);s||v(e,`invalid cardinality item '${n}'`);let[,a,o,u,l]=s;r.has(a)&&v(e,`duplicate tag '${a}'`);let c=0,f=1/0;i.includes("[")&&(i.includes(":")?(c=u?Number(u):0,f=l?Number(l):1/0):c=f=Number(o)),f<c&&v(e,`maximum ${f} is below minimum ${c}`),r.set(a,{min:c,max:f})}return r.has("*")&&r.size>1&&v(e,"wildcard '*' cannot be combined with named tags"),r}function fo(t,e){if(t===null)return null;typeof t!="string"&&v(e,"must be string or null");let r=new Set;for(let n of t.split(",")){let i=n.trim();i&&((!uo.test(i)||r.has(i))&&v(e,`invalid or duplicate parent '${n}'`),r.add(i))}return r}function Qf(t,e,r){if(t===null)return null;Me(t,["parameters","accepts_var_keyword","accepts_var_positional"],[],e);let n=t.parameters??[];Array.isArray(n)||v(e,"parameters must be an array"),t={parameters:n,accepts_var_keyword:n.some(u=>u.kind==="var_keyword"),accepts_var_positional:n.some(u=>u.kind==="var_positional"),...t},(!Array.isArray(t.parameters)||typeof t.accepts_var_keyword!="boolean"||typeof t.accepts_var_positional!="boolean")&&v(e,"invalid signature descriptor");let i=new Set,s=!1,a=!1,o=t.parameters.map((u,l)=>{let c=`${e}.parameters[${l}]`;return Me(u,["name","kind","role","annotation","has_default","default"],["name","kind","role","annotation","has_default"],c),(typeof u.name!="string"||!uo.test(u.name)||i.has(u.name))&&v(c,"invalid or duplicate parameter name"),i.add(u.name),(!Gf.has(u.kind)||!Yf.has(u.role)||typeof u.has_default!="boolean")&&v(c,"invalid kind, role, or has_default"),u.has_default!==Object.hasOwn(u,"default")&&v(c,"default presence must equal has_default"),u.has_default&&yt(u.default,`${c}.default`),s||=u.kind==="var_keyword",a||=u.kind==="var_positional",{...u,annotation:bt(u.annotation,`${c}.annotation`,!1,r)}});return(s!==t.accepts_var_keyword||a!==t.accepts_var_positional)&&v(e,"variadic summary flags do not match parameters"),{...t,parameters:o}}function lo(t,e,r,n){let i=["doc","sub_tags","parent_tags","inherits_from","ns","attributes",...r?["node_label","collection_key"]:[],"_meta"];Me(t,i,[],e),t={...Object.fromEntries(i.map(s=>[s,null])),...t};for(let s of["doc","inherits_from","ns",...r?["node_label","collection_key"]:[]])t[s]!==null&&typeof t[s]!="string"&&v(e,`${s} must be string or null`);return t._meta!==null&&(wt(t._meta)||v(e,"_meta must be object or null"),yt(t._meta,`${e}._meta`)),co(t.sub_tags,`${e}.sub_tags`),fo(t.parent_tags,`${e}.parent_tags`),{...t,attributes:Qf(t.attributes,`${e}.attributes`,n)}}function po(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}function ho(t,e){let r={...e};for(let[n,i]of Object.entries(t))n==="inherits_from"||n.startsWith("_")||r[n]||(r[n]=i);return r._meta={...t._meta||{},...e._meta||{}},r}function mo(t){let e={...t};return e._subSpec=Object.hasOwn(e,"sub_tags")?co(e.sub_tags,"resolved.sub_tags"):null,e._parentSpec=Object.hasOwn(e,"parent_tags")?fo(e.parent_tags,"resolved.parent_tags"):null,e}function _o(t,e,r,n){if(r.get(t)===1&&v(n,`inheritance cycle at '${t}'`),r.get(t)===2)return e[t];let i=e[t];i||v(n,`unknown abstract '${t}'`),r.set(t,1);let s={...i};for(let a of po(i.inherits_from))s=ho(_o(a,e,r,n),s);return s=mo(s),r.set(t,2),e[t]=s,s}function Pi({abstracts:t={},elements:e={}}){let r={...t},n=new Map;for(let s of Object.keys(r))_o(s,r,n,`abstracts.${s}.inherits_from`);let i={};for(let[s,a]of Object.entries(e)){let o={...a};for(let u of po(a.inherits_from)){let l=r[u];l||v(`elements.${s}.inherits_from`,`unknown abstract '${u}'`),o=ho(l,o)}i[s]=mo(o)}return{abstracts:r,elements:i}}function qi(t){Me(t,["document_format","grammar","abstracts","elements","custom_types"],["document_format","grammar","abstracts","elements"],"grammar document"),Me(t.document_format,["name","version"],["name","version"],"document_format"),(t.document_format.name!=="builder_grammar"||!["1.1","1.2"].includes(t.document_format.version))&&v("document_format","expected builder_grammar version 1.1 or 1.2"),Me(t.grammar,["name","version","title","description"],["name","version","title","description"],"grammar"),(typeof t.grammar.name!="string"||!t.grammar.name)&&v("grammar.name","must be non-empty string");for(let i of["version","title","description"])t.grammar[i]!==null&&typeof t.grammar[i]!="string"&&v(`grammar.${i}`,"must be string or null");(!wt(t.abstracts)||!wt(t.elements))&&v("grammar document","abstracts/elements must be objects"),Object.hasOwn(t,"custom_types")&&t.document_format.version!=="1.2"&&v("custom_types","requires version 1.2");let e=Tn.fromJSON(t.custom_types??{}),r={};for(let[i,s]of Object.entries(t.abstracts))(!i||i.startsWith("_"))&&v("abstracts",`invalid public name '${i}'`),r[i]=lo(s,`abstracts.${i}`,!1,e);let n={};for(let[i,s]of Object.entries(t.elements))(!i||i.startsWith("_"))&&v("elements",`invalid public name '${i}'`),n[i]=lo(s,`elements.${i}`,!0,e);return{grammar:structuredClone(t.grammar),abstracts:r,elements:n}}function go(t,e,r,n){let i=e.attributes;if(!i)return;let s={...n};r!=null&&(s.node_value=r);let a=new Set(i.parameters.filter(l=>l.role==="attribute").map(l=>l.name)),o=new Set(["node_label","node_position","nodeId","target_id","datapath","iterate","store","_tag","_meta","ns"]);if(!i.accepts_var_keyword)for(let l of Object.keys(n))!a.has(l)&&!o.has(l)&&v(t,`unknown attribute '${l}'`);let u=e._meta?.component?i.parameters.find(l=>l.role!=="framework"&&["positional_only","positional_or_keyword"].includes(l.kind))?.name:null;for(let l of i.parameters){if(l.name===u||l.role==="framework"||l.kind.startsWith("var_"))continue;let c=Object.hasOwn(s,l.name);!c&&!l.has_default&&v(t,`missing required ${l.role} '${l.name}'`),c&&l.annotation!==null&&(!l.annotation.test||!l.annotation.test(s[l.name]))&&v(t,`invalid value for ${l.role} '${l.name}'`)}}var Tn=class t{#e=new Map;#o=new Map;register(e,r,n){let i=new Map([[String,"str"],[Number,"float"],["string","str"],["integer","int"],["number","float"]]),s=i.has(r)?{kind:"type",module:"builtins",name:i.get(r)}:r;return this.#n(e,{kind:"annotated",base:s,metadata:[n]})}#n(e,r){(typeof e!="string"||!/^[A-Za-z][A-Za-z0-9_]*$/.test(e)||e in this||["to_dict","from_dict"].includes(e)||ed.has(e))&&v("custom_types",`invalid, reserved or duplicate name '${e}'`),Me(r,["kind","base","metadata"],["kind","base","metadata"],`custom_types.${e}`),(r.kind!=="annotated"||!Array.isArray(r.metadata)||r.metadata.length!==1||!["regex","range"].includes(r.metadata[0]?.kind))&&v(`custom_types.${e}`,"requires an annotated base with one Regex or Range validator");let n=r.metadata[0].kind==="regex"?["str"]:["int","float"];(r.base?.kind!=="type"||r.base.module!=="builtins"||!n.includes(r.base.name))&&v(`custom_types.${e}`,"portable Regex requires str; portable Range requires int or float"),yt(r,`custom_types.${e}`);let i=structuredClone(r),s=bt(i,`custom_types.${e}`),a=Object.freeze({kind:"custom",name:e});return Object.defineProperty(this,e,{value:a,enumerable:!0}),this.#e.set(e,i),this.#o.set(e,{...a,inputConstraint:!0,test:s.test}),a}resolve(e,r="custom_types"){return this.#o.has(e)||v(r,`unknown custom type '${e}'`),{...this.#o.get(e)}}validate(e,r){return this.resolve(e).test(r)||v(`custom_types.${e}`,"invalid input value"),!0}toJSON(){return structuredClone(Object.fromEntries(this.#e))}static fromJSON(e){wt(e)||v("custom_types","must be an object");let r=new t;for(let[n,i]of Object.entries(e))r.#n(n,i);return r}},ed=new Set("False None True and as assert async await break class continue def del elif else except finally for from global if import in is lambda nonlocal not or pass raise return try while with yield".split(" "));function bo(t,e,r,n){let i=e?.attributes;if(i)for(let s of i.parameters){if(!s.annotation?.inputConstraint||s.role==="framework"||["var_keyword","var_positional"].includes(s.kind))continue;let a=s.role==="value"?r:n[s.name];a!==void 0&&(s.annotation.test(a)||v(t,`invalid input for '${s.name}' (custom type)`))}}function wo(t,e,r=[]){if(e===null)return structuredClone(t);if(r.length===2&&r[0]==="custom_types"&&t!==void 0){if(!ji(t,e))throw new TypeError(`conflicting custom type '${r[1]}'`);return structuredClone(t)}if(r.length===2&&["abstracts","elements"].includes(r[0]))return structuredClone(e);if(He(t)&&He(e)){let n=structuredClone(t);for(let[i,s]of Object.entries(e))s!==null&&Object.defineProperty(n,i,{value:wo(n[i],s,[...r,i]),enumerable:!0,writable:!0,configurable:!0});return n}return structuredClone(e)}function ji(t,e){return Object.is(t,e)?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,n)=>ji(r,e[n])):He(t)&&He(e)?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).every(r=>Object.hasOwn(e,r)&&ji(t[r],e[r])):!1}function He(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype}function Vi(t){if(!(t===null||typeof t=="string"||typeof t=="boolean")&&!(typeof t=="number"&&Number.isFinite(t))){if(Array.isArray(t)){t.forEach(Vi);return}if(He(t)){Object.values(t).forEach(Vi);return}throw new TypeError("collection must contain only finite JSON values")}}var We=class t{#e;constructor(e){Vi(e);let r=["document_format","grammar","abstracts","elements"];if(!He(e)||Object.keys(e).some(i=>![...r,"custom_types"].includes(i))||r.some(i=>!Object.hasOwn(e,i)))throw new TypeError("collection requires document_format, grammar, abstracts and elements");let n=e.document_format;if(!He(n)||Object.keys(n).length!==2||n.name!=="builder_grammar"||!["1.1","1.2"].includes(n.version))throw new TypeError("expected builder_grammar version 1.1 or 1.2");for(let i of["grammar","abstracts","elements"])if(!He(e[i]))throw new TypeError(`${i} must be an object`);if(Object.hasOwn(e,"custom_types")&&(n.version!=="1.2"||!He(e.custom_types)))throw new TypeError("custom_types requires an object catalog and version 1.2");this.#e=structuredClone(e)}update(e){let r=new t(e),n=wo(this.#e,r.#e);return(this.#e.document_format.version==="1.2"||r.#e.document_format.version==="1.2")&&(n.document_format.version="1.2"),this.#e=n,this}toDocument(){return structuredClone(this.#e)}};var vt=class{static renderType="string";static mode=null;constructor(e){this._builder=e,this.renders=new Map([[e,this]])}get builder(){return this._builder}get renderType(){return this.constructor.renderType}get mode(){return this.constructor.mode}addRender(e,r){this.renders.set(e,r)}getRender(e){let r=this.renders.get(e);if(r!==void 0)return r;let n=e.getRenderer();return this.renders.set(e,n),n}render(e,r={}){let n=e.builder,[i,s]=n.runtimeValues(e);if(e._getMeta("data_element"))return null;if(e._getMeta("component"))return this._renderComponent(e,s,r);let a=this.getRender(n),o;return[o,s]=a._handleMeta(e,s),e._getMeta("subbuilder")||(s=a.adaptAttrs(s)),e.value instanceof H&&(i=this.renderChildren(e.value,r)),a.renderedItem(e,i,s,{tag:o,...r})}renderChildren(e,r={}){let n=[];for(let i of e.getNodes()){let s=this.render(i,r);s!==null&&(Array.isArray(s)?n.push(...s):n.push(s))}return n}_renderComponent(e,r,n){let[i,s,a,o]=this._expansionInputs(e,r);if(!Object.hasOwn(e.getAttr(),"iterate"))return this._expandBlock(e,i,a,o,n);if(s==null)return[];if(!(s instanceof ne))throw new TypeError(`component '${e.nodeTag}': iterate must resolve to a Bag, got ${s?.constructor?.name||typeof s}`);return s.getNodes().map(u=>this._expandBlock(e,i,a,{node_label:u.label},n))}_expansionInputs(e,r){let n=e.builder,i=n.componentMethod(e.nodeTag),s=i&&n[i];if(typeof s!="function")throw new Error(`component '${e.nodeTag}' has no implementation`);let a=r.iterate;delete r.iterate,delete r.store;let o=e.getAttr("iterate")||e.getAttr("store");o!=null?(e.pointerType(o)&&(o=o.slice(1)),o.startsWith(".")&&(o=e._composeRelativeDatapath(o,o))):o=null;for(let u of Object.keys(r)){let l=e.getAttr(u);e.pointerType(l)==="^"&&(r[u]=`^${e.absDatapath(l)}`)}return[s,a,o,r]}_expandBlock(e,r,n,i,s){let a=e.builder._expansionRoot(n);r.call(e.builder,Fi(a),i);let o=a.getNodes();if(o.length!==1)throw new Error(`component '${e.nodeTag}' must build a tree, not a forest: ${o.length} root nodes`);let u={...s,depthOffset:this._nodeDepth(e,s.depthOffset||0)};return this.render(o[0],u)}preprocess(e){return e}renderedItem(e,r,n,i){throw new Error(`${this.constructor.name} does not implement renderedItem`)}_handleMeta(e,r){let[n,i]=e._getMeta("render_tag,render_attributes"),s=$i(e.nodeTag,{renderTag:n,ns:e.getAttr("ns"),dialectName:e.builder?.constructor._name});if(!s)throw new Error(`node ${e.label} has no tag to render (no render_tag, no node_tag)`);return i&&(r={...r,...i}),[s,r]}adaptAttrs(e){return e}adapt(e){let r=`${this.builder.constructor._name}_`;return e.startsWith(r)?e.slice(r.length):e}finalize(e,r=null,n={}){let i=this._composeStringFragments(e);if(r==null)return i;if(typeof r=="string")throw new TypeError("string render targets require filesystem support, which is unavailable in the portable renderer; pass a callable or writable target instead");if(typeof r.full=="function"&&typeof r.write!="function")return r.full(i),null;if(typeof r.write=="function")return r.write(i),null;if(typeof r=="function")return r(i),null;throw new TypeError("render target must be writable (.write), callable, or expose .full")}_composeStringFragments(e){if(!Array.isArray(e))return e;if(e.some(r=>typeof r!="string"))throw new TypeError("String composition requires string fragments; object renderers must define their own composition");return e.join("")}_escapeText(e){return String(e).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}_escapeAttr(e){return this._escapeText(e).replaceAll('"',""")}_nodeDepth(e,r=0){let i=((e.fullpath||"").match(/\./g)||[]).length;return Math.max(i-1,0)+r}};var kt=class extends vt{static mode="xml";renderedItem(e,r,n,{tag:i,pretty:s=!1,depthOffset:a=0}={}){let o=this._formatAttrs(n),u=s?" ".repeat(this._nodeDepth(e,a)):"",l=s?`
|
|
23
|
-
`:"";if(Array.isArray(r)){let c=this._composeStringFragments(r);return`${u}<${i}${o}>${l}${c}${u}</${i}>${l}`}return r==null?`${u}<${i}${o}></${i}>${l}`:`${u}<${i}${o}>${this._escapeText(r)}</${i}>${l}`}finalize(e,r=null,{docHeader:n=null}={}){let i=this._composeStringFragments(e);return n===!0?i=`<?xml version='1.0' encoding='UTF-8'?>${i}`:typeof n=="string"&&(i=n+i),super.finalize(i,r)}_formatAttrs(e){return Object.entries(e||{}).map(([r,n])=>` ${r.startsWith("xmlns_")?`xmlns:${r.slice(6)}`:r}="${this._escapeAttr(n)}"`).join("")}};var yo={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"base",version:null,title:null,description:null},abstracts:{},elements:{dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};function vo(t){let e=[];for(;t&&t!==Function.prototype;)e.push(t),t=Object.getPrototypeOf(t);return e.reverse()}function rd(t){let e=Object.create(null),r=(n,i)=>{let s=n.toLowerCase(),a=e[s];if(a!==void 0&&a!==i)throw new Error(`container '${n}' is already tied to implementation method '${a}' (cannot rebind to '${i}')`);e[s]=i};for(let n of vo(t))if(Object.hasOwn(n,"containers"))for(let i of n.containers||[])r(i,i);return e}function Or(t){let e=Object.create(null);for(let r of Object.keys(t)){let n=r.toLowerCase();if(Object.hasOwn(e,n))throw new Error(`element declaration '${r}' has a case-insensitive collision with '${e[n]}'`);e[n]=r}return e}var Ir="_root_",zi="_root_",ko=new Set(["destination","func","value","_on_start"]),Re=class t{static _sourceClass=H;static registerBuilder(e){if(typeof e!="function"||!(e.prototype instanceof t))throw new TypeError("registerBuilder requires a BuilderBase subclass");let r=e._name;if(typeof r!="string"||!r)throw new TypeError("registered builders require a non-empty static _name");let n=t._registry.get(r);if(n&&n!==e)throw new Error(`Builder name '${r}' is already registered to ${n.name}; cannot register ${e.name}`);return t._registry.set(r,e),e}static getBuilderClass(e){let r=t._registry.get(e);if(!r)throw new Error(`No builder registered with name '${e}'`);return r}constructor(e=null){this.name=e||this.constructor._name,this._dataroot=new ne,this._dataroot.setBackref(),this._dataroot.setItem(zi,new ne),this.data=this._dataroot.getItem(zi),this._defaultTargets=new Map,this.materialized=Object.create(null),this._collection=null,this._schemaOverride=null,this._tagNamesOverride=null,this._componentMap=null,this._targetSerial=0,this._subbuilders=new Map,this._sourceHandles=new WeakMap;let r=this.constructor._sourceClass;this._sourceroot=new r(null,this),this._sourceroot.setBackref(),this._sourceroot.setItem(Ir,new r(null,this)),this.source=this._sourceroot.getItem(Ir)}wrapSource(e){if(e=Sr(e),!(e instanceof H)&&!(e instanceof Xt))throw new TypeError("wrapSource requires a SourceBag or SourceBagNode");let r=this._sourceHandles.get(e);return r||(r=oo(this,e),this._sourceHandles.set(e,r)),r}get root(){return this.wrapSource(this.source)}getSubbuilder(e){if(typeof e!="string"||!e||e.includes(":"))throw new Error(`unsupported subbuilder reference '${e}'`);let r=this._subbuilders.get(e);if(!r){let n=t.getBuilderClass(e);r=new n,this._subbuilders.set(e,r)}return r._dataroot=this._dataroot,r.data=this.data,r}_resolveSubbuilderReference(e,r,n){if(typeof e!="string"||!e)throw new Error(`'${n}': subbuilder declaration must be a non-empty string`);if(e.includes(":"))throw new Error(`'${n}': runtime subbuilder reference '${e}' is unsupported`);return this.getSubbuilder(e)}static defineGrammar(e){let r=this._classCollection,n=r?new We(r.toDocument()).update(e):new We(e),i=qi(n.toDocument()),s=Pi(i),a=Or(s.elements);this._classCollection=n,this._classSchema=s.elements,this._abstracts=s.abstracts,this._tagNames=a}static{this.defineGrammar(yo)}get _containers(){return rd(this.constructor)}containerMethod(e){return this._containers[e.toLowerCase()]||null}componentMethod(e){return this._componentMap?.[e.toLowerCase()]||null}get schema(){return this._schemaOverride||this.constructor._classSchema||{}}get schemaTagNames(){return this._schemaOverride?this._tagNamesOverride??=Or(this.schema):this.constructor._tagNames??=Or(this.schema)}schemaTag(e){let r=e.toLowerCase(),n=this.schemaTagNames[r];if(n)return n;let i=`${this.constructor._name}_`;return r.startsWith(i)&&this.schemaTagNames[r.slice(i.length)]||null}loadGrammar(e,{replace:r=!1}={}){let n=this._collection||this.constructor._classCollection,i=r?new We(e):new We(n.toDocument()).update(e),s=qi(i.toDocument()),a=Pi(s),o=Or(a.elements);return this._collection=i,this._schemaOverride=a.elements,this._tagNamesOverride=o,this}validateCustomTypes(e){let r=e.parentBag?.parentNode?.builder||e.parentBag?._builder,n=r&&r!==this&&r.schema[e.nodeTag]?._meta?.subbuilder?r:this;bo(e.nodeTag,n.schema[e.nodeTag],e.value,e.getAttr()||{})}validateNodeValues(e,r,n={}){let i=this.schemaTag(e);if(!i)throw new Error(`unknown element '${e}'`);return go(i,this.schema[i],r,n),!0}validateNode(e,{value:r,attrs:n,childTags:i}={}){if(!e||typeof e.nodeTag!="string")throw new TypeError("validateNode requires a source node");let s=r!==void 0?r:e.value instanceof H?null:e.value;this.validateNodeValues(e.nodeTag,s,n||e.getAttr?.()||{});let a=this.schema[this.schemaTag(e.nodeTag)],o=i||(e.value instanceof H?e.value.getNodes().map(u=>u.nodeTag):null);return o&&this._validateChildren(e.nodeTag,a,o,!1),!0}validateChildren(e,r,{includeMinimum:n=!1}={}){let i=this.schemaTag(e);if(!i)throw new Error(`unknown element '${e}'`);if(!Array.isArray(r)||r.some(s=>typeof s!="string"))throw new TypeError("childTags must be an array of strings");return this._validateChildren(i,this.schema[i],r,n)}validateParent(e,r=null){let n=this.schemaTag(e);if(!n)throw new Error(`unknown element '${e}'`);let i=this.schema[n];if(!this._countsForGrammar(i))return!0;let s=i._parentSpec;if(s==null||s.has("*"))return!0;if(r===null)throw new Error(`'${n}' requires a declared parent`);let a=this.schemaTag(r);if(!a)throw new Error(`unknown parent element '${r}'`);return this._validateParent(n,i,a),!0}bagCall(e,r,n,i){return this.setChild(e,r,n,i)}commandOnNode(e,r,n,i){if(e=Sr(e),e.value instanceof H)return this.setChild(e.value,r,n,i);let s=e.value,a=new e.parentBag.constructor(null,e.builder||this),o=this.setChild(a,r,n,i,e);return this.promoteNodeValue(e,s,a),o}promoteNodeValue(e,r,n){e.setValue(n)}setChild(e,r,n,i,s=null){let a={...i},o=this.schema[r];if(!o)throw new Error(`unknown element '${r}'`);this.validateNodeValues(r,n,a);let u=o._meta?.subbuilder,c=(u==null?null:this._resolveSubbuilderReference(u,a,r))||this,f=n instanceof H?n._builderBindingPlan(c):null,d=s?.rootBuilder||e.root._builder||this;if(a.nodeId!=null&&d.source.getNodeByAttr("nodeId",a.nodeId))throw new Error(`Duplicate nodeId '${a.nodeId}'`);n instanceof H&&this._validateChildren(r,o,n.getNodes().map(y=>y.nodeTag),!1);let p=s||e.parentNode,m=p?.nodeTag?this.schema[p.nodeTag]:null;if(m&&!p._getMeta("subbuilder")&&this._countsForGrammar(o))this._validateParent(r,o,p.nodeTag),this._validateChildren(p.nodeTag,m,[...e.getNodes().map(y=>y.nodeTag),r],!1);else if(!m&&!p?._getMeta("subbuilder")&&o._parentSpec!=null&&this._countsForGrammar(o))throw new Error(`'${r}' requires a declared parent`);o._meta&&!("_meta"in a)&&(a._meta=o._meta),o.ns&&!("ns"in a)&&(a.ns=o.ns);let h=a.node_position;delete a.node_position;let g=a.node_label;delete a.node_label;let b;if(m?.collection_key){if(g!=null)throw new Error(`'${r}': node_label is not allowed in a collection`);b=this._collectionLabel(m.collection_key,r,a)}else{let y=m?._subSpec?.get(r);if(y&&y.max===1){if(g!=null)throw new Error(`'${r}': node_label is not allowed on a singleton`);b=r}else b=g||o.node_label||this._autoLabel(e,r)}if(e.node(b)!=null)throw new Error(`duplicate node label '${b}'`);return e._setBuilderItem(c,f,b,n,a,h||">",!1,!0,null,!1,!0,null,r)}_countsForGrammar(e){let r=e?._meta||{};return!(r.data_element||r.subbuilder||r.component)}_validateParent(e,r,n){let i=r._parentSpec;if(!(i==null||i.has("*")||!this._countsForGrammar(r))&&!i.has(n))throw new Error(`'${e}' not allowed as child of '${n}'`)}_validateChildren(e,r,n,i){let s=r._subSpec;if(s==null||s.has("*")||r._meta?.subbuilder)return[];let a=new Map;for(let o of n){let u=this.schema[o];if(u&&!this._countsForGrammar(u))continue;let l=s.get(o);if(!l)throw new Error(`'${o}' not allowed as child of '${e}'`);let c=(a.get(o)||0)+1;if(a.set(o,c),c>l.max)throw new Error(`too many '${o}' in '${e}'`)}return i?[...s].filter(([o,u])=>(a.get(o)||0)<u.min).map(([o])=>o):[]}_collectionLabel(e,r,n){let i=s=>{if(n[s]===null||n[s]===void 0)throw new Error(`'${r}': collection key needs attribute '${s}'`);return String(n[s])};return e.includes("${")?e.replace(/\$\{([^}]+)\}/g,(s,a)=>i(a)):i(e)}validateSource(){let e=[],r=(n,i="")=>{for(let s of n.getNodes()){let a=i?`${i}.${s.label}`:s.label,o=s.builder;o.validateCustomTypes(s);let u=o.schema[s.nodeTag];if(u&&!s._getMeta("data_element,subbuilder,component").some(Boolean)){let l=s.value instanceof H?s.value.getNodes().map(f=>f.nodeTag):[],c=o._validateChildren(s.nodeTag,u,l,!0);c.length&&e.push([a,c])}s.value instanceof H&&r(s.value,a)}};return r(this.source),e}_autoLabel(e,r){let n=0;for(;e.node(`${r}_${n}`)!==null&&e.node(`${r}_${n}`)!==void 0;)n+=1;return`${r}_${n}`}nodeById(e){let r=this.source.getNodeByAttr("nodeId",e);if(r==null)throw new Error(`nodeId not found: ${e}`);return r.builder.wrapSource(r)}runtimeValues(e){e.builder.validateCustomTypes(e);let r=new Map,n={},i=e.runtimeToEvaluate(),s=new Set(i.keys()),a=new Map([...Object.entries(e.getAttr()),...e.fixedAttrItems()]);for(let[c,f]of[...i])if(!(typeof c!="string"||!Ge(f)))for(let d of Un(e,f))i.has(d)||i.set(d,a.get(d));let o=e._getMeta("data_element");for(let[c,f]of i){if(f instanceof ee){r.set(c,f.resolve());continue}let d=typeof c=="string"?Ge(f)?.pointer??f:f;if(!e.pointerType(d)){r.set(c,typeof c=="string"&&typeof f=="string"&&f.startsWith("==")?null:f);continue}let p=e.absDatapath(d);if(r.set(c,this.data.getItem(p)),!o&&!p.includes("?")&&c===Gt){let m=this.data.getNode(p);m&&Object.assign(n,m.getAttr("_wdg"))}}let u=Ji(i,r,(c,f,d,p)=>this.evaluatePointerExpression(e,c,f,d,p)),l=u.get(Gt);u.delete(Gt);for(let c of u.keys())s.has(c)||u.delete(c);return[l,{...Object.fromEntries(u),...n}]}evaluatePointerExpression(e,r,n,i,s){return null}targetId(e){if(e._targetId)return e._targetId;let r=e.rootBuilder;return e.parentBag.root!==r.source.root?null:(r._targetSerial+=1,e._targetId=`n${r._targetSerial}`,e._targetId)}get dataLogic(){if(!this._dataLogic){let e=this._buildDataLogic();this._dataLogic=Array.isArray(e)?e:[e]}return this._dataLogic}_buildDataLogic(){return this}_resolveLogicFunc(e){if(typeof e=="function")return e;if(typeof e!="string")throw new Error("data-element func must be a name or a function");for(let r of this.dataLogic){let i=(typeof r=="function"?r:r.constructor)[e];if(typeof i=="function")return i}throw new Error(`data-element func '${e}' not found on any data_logic source`)}_bindings(e){let[,r]=this.runtimeValues(e),n={};for(let[i,s]of Object.entries(r))ko.has(i)||(n[i]=s);return n}computeLogic(e){for(let r of e)this._computeNode(r)}_computeNode(e){let r=e.getAttr()||{};if(e.nodeTag==="dataSetter"){let n={};for(let[i,s]of Object.entries(r))i!=="destination"&&i!=="value"&&!i.startsWith("_")&&(n[i]=s);e.setRelativeData(r.destination,r.value,{attributes:Object.keys(n).length?n:null})}else if(e.nodeTag==="dataFormula"){let n=this._resolveLogicFunc(r.func);e.setRelativeData(r.destination,n(this._bindings(e)))}else e.nodeTag==="dataController"&&this._resolveLogicFunc(r.func)(e,this._bindings(e))}_dataElementNodes(){let e=[],r=n=>{for(let i of n.getNodes())i._getMeta("data_element")&&e.push(i),i.value instanceof H&&r(i.value)};return r(this.source),e}setup(e){}main(e){throw new Error(`${this.constructor.name}.main() not implemented: a bare builder is grammar, not a renderable page`)}_resolveComponents(){let e={};for(let o of vo(this.constructor))if(Object.hasOwn(o,"components"))for(let u of o.components||[])e[u]=u;if(!Object.keys(e).length)return;let r={...this.schema},n={};for(let[o,u]of Object.entries(e))r[o]={sub_tags:"",_meta:{component:!0}},n[o.toLowerCase()]=u;let i=Or(r),s=this._collection||this.constructor._classCollection,a=s.toDocument();a.abstracts={},a.elements=Object.fromEntries(Object.keys(e).map(o=>[o,r[o]])),this._collection=new We(s.toDocument()).update(a),this._schemaOverride=r,this._componentMap=n,this._tagNamesOverride=i}_expansionRoot(e=null){let r=this.constructor._sourceClass,n=new r(null,this);return n.setBackref(),n.setItem(Ir,new r(null,this),e?{datapath:e}:null),n.getItem(Ir)}create(){this.setup(this.data),this._resolveComponents(),this.main(this.root),this.computeLogic(this._dataElementNodes())}get renderer_xml(){return new kt(this)}getRenderer(e=null){e??=this.constructor._defaultRenderMode;let r=this[`renderer_${e}`];if(!r)throw new Error(`${this.constructor.name} does not expose renderer_${e}`);return r}materialize(e=null,r={}){e??=this.constructor._defaultRenderMode;let n=this.getRenderer(e),i=n.renderChildren(n.preprocess(this.source),r);return this.materialized[e]=i,i}setRenderTarget(e,r=null){r??=this.constructor._defaultRenderMode,this._defaultTargets.set(r,e)}render({mode:e=null,target:r=null,...n}={}){e??=this.constructor._defaultRenderMode;let i=this.getRenderer(e);if(r===!1&&i.renderType!=="string")throw new TypeError("target=false is not valid for an object renderer");let s=r===!1?null:r||this._defaultTargets.get(i.mode)||null,a={...s?.renderOpts,...n};return i.finalize(this.materialize(e,a),s,a)}};Re._registry=new Map;var nd=new Set(["short","medium","long","full"]),id=/('(?:[^']|'')*'|[a-zA-Z]+|[^a-zA-Z']+)/g;function sd(t,e){if(!(t instanceof Date))throw new TypeError("Temporal formats require a typed Date value");if(!Number.isFinite(t.getTime()))throw new RangeError("Invalid date");let r=e||ge(t).split("::").at(-1);if(!["D","H","DH","DHZ"].includes(r))throw new RangeError(`Unsupported temporal dtype: ${r}`);return r}function ad(t,e,r,n){let i=e.match(id)||[];if(i.join("")!==e)throw new RangeError("Unclosed format literal");let s=(c,f=2)=>String(c).padStart(f,"0"),a=c=>new Intl.DateTimeFormat(r,{timeZone:"UTC",...c}).format(t),l={...n==="H"?{}:{y:()=>String(t.getUTCFullYear()),yy:()=>s(t.getUTCFullYear()%100),yyyy:()=>s(t.getUTCFullYear(),4),M:()=>String(t.getUTCMonth()+1),MM:()=>s(t.getUTCMonth()+1),MMM:()=>a({month:"short"}),MMMM:()=>a({month:"long"}),d:()=>String(t.getUTCDate()),dd:()=>s(t.getUTCDate()),EEE:()=>a({weekday:"short"}),EEEE:()=>a({weekday:"long"})},...n==="D"?{}:{H:()=>String(t.getUTCHours()),HH:()=>s(t.getUTCHours()),h:()=>String(t.getUTCHours()%12||12),hh:()=>s(t.getUTCHours()%12||12),m:()=>String(t.getUTCMinutes()),mm:()=>s(t.getUTCMinutes()),s:()=>String(t.getUTCSeconds()),ss:()=>s(t.getUTCSeconds()),a:()=>new Intl.DateTimeFormat(r,{hour:"numeric",hour12:!0,timeZone:"UTC"}).formatToParts(t).find(c=>c.type==="dayPeriod").value}};return i.map(c=>{if(c.startsWith("'"))return c==="''"?"'":c.slice(1,-1).replaceAll("''","'");if(!/^[a-zA-Z]/.test(c))return c;if(!l[c])throw new RangeError(`Unsupported date format token: ${c}`);return l[c]()}).join("")}function Eo(t,{format:e,mask:r,locale:n,dtype:i,places:s}={}){let a=t==null?"":String(t);if(t!=null&&t!==""&&(e!=null&&e!==""||s!=null))if(typeof t=="number"||ke(t))a=ld(t,{format:e,locale:n,places:s});else{let o=sd(t,i);if(nd.has(e)){let u={timeZone:"UTC"};o!=="H"&&(u.dateStyle=e),o!=="D"&&(u.timeStyle=e),a=new Intl.DateTimeFormat(n||void 0,u).format(t)}else a=ad(t,String(e),n||void 0,o)}return r==null?a:String(r).replaceAll("%s",()=>a)}function od({format:t="decimal",places:e}={}){let r={maximumFractionDigits:20};if(!t||t==="decimal")r.style="decimal";else if(t==="percent")r.style="percent";else if(t==="scientific")r.notation="scientific";else{let n=/^(0|#,##0)(?:\.(0*)(#*))?$/.exec(t);if(!n||t.includes(".")&&!n[2]&&!n[3])throw new RangeError(`Unsupported number format: ${t}`);r.useGrouping=n[1].includes(","),r.minimumFractionDigits=(n[2]||"").length,r.maximumFractionDigits=(n[2]||"").length+(n[3]||"").length}if(e!=null&&e!==""){let n=Number(e);if(!Number.isInteger(n)||n<0||n>20)throw new RangeError("places must be an integer from 0 to 20");r.minimumFractionDigits=n,r.maximumFractionDigits=n}return r}function ld(t,e={}){if(typeof t!="number"&&!ke(t))throw new TypeError("Number formatting requires a Number or Decimal");if(!Number.isFinite(Number(t)))throw new RangeError("Number must be finite");let r=new Intl.NumberFormat(e.locale||void 0,od(e));if(ke(t)&&new Intl.NumberFormat("en",{useGrouping:!1}).format("9007199254740993")!=="9007199254740993")throw new Error("This browser cannot format Decimal values without precision loss");return r.format(ke(t)?t.toString():t)}var ud=new Set(["style","script"]),cd=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),Do=new Set(["width","height","top","left","right","bottom","padding","margin","border","position","display","overflow","float","clear","resize","z_index","min_width","min_height","max_width","max_height","color","background","font","text","line_height","white_space","vertical_align","flex","gap","row_gap","column_gap","grid","align_content","justify_content","align_items","justify_items","visibility","opacity","cursor"]),Br=new Set(["rounded","gradient","shadow","transform","transition","zoom","filter"]),Ao=t=>t===!0?"true":t===!1?"false":String(t),Cn=t=>typeof t=="number"&&Number.isFinite(t)?`${t}px`:String(t);function fd(t){if(Do.has(t))return!0;for(let e of Do)if(t.startsWith(`${e}_`))return!0;return!1}function dd(t){let e=new Map;if(!t)return e;let r=[],n=0,i=null,s=!1,a=!1,o=0,u=String(t);for(let l=0;l<u.length;l+=1){let c=u[l],f=u[l+1];if(a){c==="*"&&f==="/"&&(a=!1,l+=1);continue}if(s){s=!1;continue}if(c==="\\"){s=!0;continue}if(i){c===i&&(i=null);continue}c==='"'||c==="'"?i=c:c==="/"&&f==="*"?(a=!0,l+=1):"([{".includes(c)?o+=1:")]}".includes(c)&&o>0?o-=1:c===";"&&o===0&&(r.push(u.slice(n,l)),n=l+1)}r.push(u.slice(n));for(let l of r){let c=l.trim();if(!c)continue;let f=c.indexOf(":");if(f<0)throw new TypeError(`malformed style declaration '${c}'`);e.set(c.slice(0,f).trim(),c.slice(f+1).trim())}return e}var Mr=class extends vt{static mode="html";renderedItem(e,r,n,{tag:i,xml:s=!0,pretty:a=!1,depthOffset:o=0,includeDatapath:u=!1}={}){e.parentNode?._getMeta("subbuilder")==="html"&&(n={xmlns:"http://www.w3.org/1999/xhtml",...n});let{format:c,mask:f,locale:d,places:p,dtype:m,...h}=n;!Array.isArray(r)&&(c!=null||f!=null||p!=null)&&(r=Eo(r,{format:c,mask:f,places:p,dtype:m,locale:this._displayLocale(e,d)}));let g=this._formatAttrs(h);if(u){if(!Object.hasOwn(n,"id")){let A=this.builder.targetId(e);A!==null&&(g+=` id="${this._htmlAttrValue(A)}"`)}for(let[A,I]of Object.entries(e.getAttr()))e.pointerType(I)&&(g+=` data-${this.adapt(A)}-pointer="${this._htmlAttrValue(e.absDatapath(I))}"`)}let b=a?" ".repeat(this._nodeDepth(e,o)):"",k=a?`
|
|
24
|
-
`:"";if(e._getMeta("void"))return`${b}<${i}${g}${s?"/":""}>${k}`;if(Array.isArray(r)){let A=this._composeStringFragments(r);return`${b}<${i}${g}>${k}${A}${b}</${i}>${k}`}if(r==null)return`${b}<${i}${g}></${i}>${k}`;let y=typeof r=="string"&&r.endsWith("::HTML")?r.slice(0,-6):ud.has(i)?String(r):this._escapeText(r);return`${b}<${i}${g}>${y}</${i}>${k}`}_displayLocale(e,r){if(r)return r;for(let n=e.parentNode;n;n=n.parentNode){let i=n.getAttr("locale");if(i==null)continue;let s=n.pointerType(i)?n.data.getItem(n.absDatapath(i)):i;if(s)return s}}adaptAttrs(e){let r={},n={};for(let[s,a]of Object.entries(e||{}))if(s.startsWith(`${this.builder.constructor._name}_`))r[this.adapt(s)]=a;else if(s==="dtype")r.dtype=a;else{if(this.builder.constructor.retainedAttrPrefixes.some(o=>s.startsWith(o)))continue;this._isStyleContribution(s)?n[s]=a:r[s]=a}let i=this._adaptStyle(n);return i&&(r.style=i),r}_isStyleContribution(e){if(e==="style"||e.startsWith("style_")||Br.has(e))return!0;let r=e.includes("_")?e.slice(0,e.indexOf("_")):null;return r!==null&&Br.has(r)||fd(e)}_adaptStyle(e){let r=dd(e.style),n=new Map,i=new Map;for(let[s,a]of Object.entries(e))if(s!=="style")if(s.startsWith("style_"))r.set(s.slice(6).replaceAll("_","-"),Ao(a));else if(Br.has(s))n.set(s,a);else{let o=s.indexOf("_"),u=o<0?s:s.slice(0,o);o>=0&&Br.has(u)?(i.has(u)||i.set(u,{}),i.get(u)[s.slice(o+1)]=a):r.set(s.replaceAll("_","-"),Ao(a))}for(let s of Br)(n.has(s)||i.has(s))&&this[`_macro_${s}`](n.get(s),i.get(s)||{},r);return[...r].map(([s,a])=>`${s}: ${a}`).join("; ")}_formatAttrs(e){let r=[];for(let[n,i]of Object.entries(e||{}))cd.has(n)?i&&r.push(` ${n}`):r.push(` ${n}="${this._htmlAttrValue(i)}"`);return r.join("")}_htmlAttrValue(e){return(e===!0?"true":e===!1?"false":String(e)).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}_macro_rounded(e,r,n){let i=e===void 0?{}:{top_left:e,top_right:e,bottom_left:e,bottom_right:e};for(let[s,a]of Object.entries(r))if(s==="top"||s==="bottom")i[`${s}_left`]=a,i[`${s}_right`]=a;else if(s==="left"||s==="right")i[`top_${s}`]=a,i[`bottom_${s}`]=a;else if(["top_left","top_right","bottom_left","bottom_right"].includes(s))i[s]=a;else throw new TypeError(`rounded: unknown sub-kwarg '${s}'`);for(let[s,a]of Object.entries(i))n.set(`border-${s.replaceAll("_","-")}-radius`,Cn(a))}_macro_transform(e,r,n){let i=e===void 0?[]:[String(e)];for(let[s,a]of Object.entries(r))s==="rotate"?i.push(`rotate(${a}deg)`):s==="scale"||s==="translate"?i.push(`${s}(${a})`):s==="translate_x"?i.push(`translateX(${Cn(a)})`):s==="translate_y"?i.push(`translateY(${Cn(a)})`):s==="skew_x"?i.push(`skewX(${a}deg)`):s==="skew_y"?i.push(`skewY(${a}deg)`):i.push(`${s.replaceAll("_","-")}(${a})`);i.length&&n.set("transform",i.join(" "))}_macro_filter(e,r,n){let i=e===void 0?[]:[String(e)];for(let[s,a]of Object.entries(r))s==="rotate"?i.push(`hue-rotate(${a}deg)`):s==="blur"?i.push(`blur(${Cn(a)})`):s==="drop_shadow"?i.push(`drop-shadow(${a})`):i.push(`${s.replaceAll("_","-")}(${a})`);i.length&&n.set("filter",i.join(" "))}_macro_transition(e,r,n){e!==void 0&&n.set("transition",String(e));for(let[i,s]of Object.entries(r))n.set(`transition-${i.replaceAll("_","-")}`,String(s))}_macro_zoom(e,r,n){e!==void 0&&n.set("zoom",String(e))}_macro_shadow(e,r,n){e!==void 0&&n.set("box-shadow",String(e));for(let[i,s]of Object.entries(r))n.set(`box-shadow-${i.replaceAll("_","-")}`,String(s))}_macro_gradient(e,r,n){e!==void 0&&n.set("background-image",String(e))}};var pd=new Set(["alignment_baseline","baseline_shift","clip_path","clip_rule","color_interpolation","color_interpolation_filters","dominant_baseline","fill_opacity","fill_rule","flood_color","flood_opacity","font_family","font_size","font_size_adjust","font_stretch","font_style","font_variant","font_weight","glyph_orientation_horizontal","glyph_orientation_vertical","image_rendering","letter_spacing","lighting_color","marker_end","marker_mid","marker_start","overline_position","overline_thickness","paint_order","pointer_events","shape_rendering","stop_color","stop_opacity","strikethrough_position","strikethrough_thickness","stroke_dasharray","stroke_dashoffset","stroke_linecap","stroke_linejoin","stroke_miterlimit","stroke_opacity","stroke_width","text_anchor","text_decoration","text_rendering","underline_position","underline_thickness","unicode_bidi","word_spacing","writing_mode"]);function xo(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[pd.has(e)?e.replaceAll("_","-"):e,r]))}var Rr=class extends kt{static mode="svg";adaptAttrs(e){return xo(e)}};var To={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"html",version:null,title:null,description:null},abstracts:{},elements:{svg:{doc:"Switch to the SVG dialect from this node down (BLD.2).\n\n A sub-builder element: ``_meta['subbuilder']`` switches the active\n dialect to SVG from this node down. No ``render_tag``: ``<svg>`` is\n emitted verbatim (HTML5 has a native ``<svg>`` tag).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{subbuilder:"svg"}},a:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},abbr:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},address:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},area:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},article:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},aside:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},audio:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},b:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},base:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},bdi:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},bdo:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},blockquote:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},body:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},br:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},button:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},canvas:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},caption:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},cite:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},code:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},col:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},colgroup:{doc:null,sub_tags:"col,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},data:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},datalist:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,option,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dd:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},del_:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},details:{doc:null,sub_tags:"summary[0:1],a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dfn:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dialog:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},div:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dl:{doc:null,sub_tags:"dd,div,dt,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dt:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},em:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},embed:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},fieldset:{doc:null,sub_tags:"legend[0:1],a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},figcaption:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},figure:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figcaption[0:1],figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},footer:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},form:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h1:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h2:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h3:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h4:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h5:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h6:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},head:{doc:null,sub_tags:"base[0:1],link,meta,noscript,script,style,template,title[0:1]",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},header:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},hgroup:{doc:null,sub_tags:"h1,h2,h3,h4,h5,h6,p,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},hr:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},html:{doc:null,sub_tags:"head[0:1],body[0:1]",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},i:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},iframe:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},img:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},input:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},ins:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},kbd:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},label:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},legend:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,h1,h2,h3,h4,h5,h6,hgroup,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},li:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},link:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},main:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},map:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},mark:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},menu:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},meta:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},meter:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},nav:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},noscript:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},object:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ol:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},optgroup:{doc:null,sub_tags:"div,legend,noscript,option,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},option:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,div,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},output:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},p:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},picture:{doc:null,sub_tags:"img[0:1],script,source,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},pre:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},progress:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},q:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rp:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rt:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ruby:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},s:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},samp:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},script:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},search:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},section:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},select:{doc:null,sub_tags:"button,div,hr,noscript,optgroup,option,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},slot:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},small:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},source:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},span:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},strong:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},style:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},sub:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},summary:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,h1,h2,h3,h4,h5,h6,hgroup,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},sup:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},table:{doc:null,sub_tags:"caption[0:1],colgroup,script,tbody,template,tfoot[0:1],thead[0:1],tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tbody:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},td:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},template:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,caption,cite,code,col,colgroup,data,datalist,del_,details,dfn,dialog,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,legend,li,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,optgroup,option,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,source,span,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,tr,track,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},textarea:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tfoot:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},th:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},thead:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},time:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},title:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tr:{doc:null,sub_tags:"script,td,template,th",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},track:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},u:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ul:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},var:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},video:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},wbr:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},selectedcontent:{doc:"Mirror of the selected option for Customizable Select (HTML 2024).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var Nn=class extends Re{static _name="html";static _defaultRenderMode="html";static retainedAttrPrefixes=["validate_","dtype"];static{this.defineGrammar(To)}get renderer_html(){return new Mr(this)}};Re.registerBuilder(Nn);var Co={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"svg",version:null,title:null,description:null},abstracts:{graphics:{doc:"SVG graphics content: any graphical element.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},_meta:null},containerElement:{doc:"SVG container content: elements that can hold children.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},_meta:null}},elements:{html:{doc:"Switch to the HTML dialect from this node down (BLD.2).\n\n A sub-builder element: ``_meta['subbuilder']`` switches the active\n dialect to HTML from this node down. The source tag ``html`` is\n rendered as ``_meta['render_tag']`` (``<foreignObject>``) carrying\n ``_meta['render_attributes']`` (the SVG namespace). The immediate\n HTML child declares XHTML so both sides of the XML boundary retain\n their native namespace.\n ",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{subbuilder:"html",render_tag:"foreignObject",render_attributes:{xmlns:"http://www.w3.org/2000/svg"}}},svg:{doc:"Root SVG container or nested SVG viewport.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},g:{doc:"Group container for applying transforms and styles.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},defs:{doc:"Container for referenced elements (gradients, patterns, etc.).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},symbol:{doc:"Reusable graphical template, rendered only when referenced by <use>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},use:{doc:"Reference and render a <symbol> or other element.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rect:{doc:"Rectangle.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},circle:{doc:"Circle.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ellipse:{doc:"Ellipse.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},line:{doc:"Line segment between two points.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},polyline:{doc:"Open shape of connected line segments.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},polygon:{doc:"Closed shape of connected line segments.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},path:{doc:"Arbitrary shape defined by path commands (d attribute).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},image:{doc:"Embedded raster image.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},text:{doc:"Text block. Contains text content and optional <tspan>/<textPath>.",sub_tags:"tspan,textPath",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tspan:{doc:"Inline text span within <text>.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},textPath:{doc:"Text rendered along a path shape.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},linearGradient:{doc:"Linear gradient definition. Place inside <defs>.",sub_tags:"stop",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},radialGradient:{doc:"Radial gradient definition. Place inside <defs>.",sub_tags:"stop",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},stop:{doc:"Gradient stop (color and offset).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},pattern:{doc:"Tile pattern definition. Place inside <defs>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},clipPath:{doc:"Clipping path definition.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},mask:{doc:"Alpha mask definition.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},marker:{doc:"Marker symbol for line endpoints or vertices.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},filter:{doc:"Filter effect container. Place inside <defs>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feGaussianBlur:{doc:"Gaussian blur filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feOffset:{doc:"Offset filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feBlend:{doc:"Blend filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feColorMatrix:{doc:"Color matrix filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feComposite:{doc:"Composite filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feFlood:{doc:"Flood fill filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMerge:{doc:"Merge filter primitive (container for feMergeNode).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMergeNode:{doc:"Single input for feMerge.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDropShadow:{doc:"Drop shadow filter primitive (SVG 2).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDiffuseLighting:{doc:"Diffuse lighting filter primitive.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feSpecularLighting:{doc:"Specular lighting filter primitive.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},fePointLight:{doc:"Point light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDistantLight:{doc:"Distant light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feSpotLight:{doc:"Spot light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMorphology:{doc:"Morphology filter primitive (erode/dilate).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feTurbulence:{doc:"Turbulence noise filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDisplacementMap:{doc:"Displacement map filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feConvolveMatrix:{doc:"Convolution matrix filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feImage:{doc:"Image filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feTile:{doc:"Tile filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animate:{doc:"Animate an attribute over time.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animateTransform:{doc:"Animate a transform attribute.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animateMotion:{doc:"Animate motion along a path.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},set:{doc:"Set an attribute to a value for a duration.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},title:{doc:"Accessible title (tooltip in browsers).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},desc:{doc:"Accessible description.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},metadata:{doc:"Metadata container (RDF, Dublin Core, etc.).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},a:{doc:"Hyperlink wrapper.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},foreignObject:{doc:"Container for non-SVG content (HTML, MathML).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},switch:{doc:"Conditional processing (renders first matching child).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var Sn=class extends Re{static _name="svg";static _defaultRenderMode="svg";static{this.defineGrammar(Co)}get renderer_svg(){return new Rr(this)}};Re.registerBuilder(Sn);var lt="http://www.w3.org/2000/svg";var wd=(0,Ue.defineComponent)({name:"drawingPane",tag:"gramlot-drawing-pane",base:Rn,sourceContext:!0,subTags:"*",parameters:{image:{dtype:"T",nullable:!0,default:null,binding:"read"},annotations:{dtype:"X",binding:"read"}},implementation:t=>class extends t{#e;#o;#n;#h;#t;#s;#E=`drawing-state-${Zt()}`;#y=!1;#v=!1;#m;#_;#i;#k=`drawing-${Zt()}`;#u="select";#l=null;#r=null;#c=[1e3,1e3];#d=null;#g;constructor(){super();let e=this.ownerDocument,r=e.createElement("style");r.textContent=`:host{display:block;height:100%;min-height:0}.control-box{height:100%;display:flex;flex-direction:row;min-height:0;position:relative}
|
|
3
|
+
::slotted(*){min-width:0;max-width:100%}`,this.controlBox=this.ownerDocument.createElement("div"),this.controlBox.className="control-box",this.control=this.controlBox,this.control.id="control",this.control.append(this.ownerDocument.createElement("slot")),t.append(e,this.controlBox)}projectAttributes(t){return I(this,t)}}}y.parameters={};import{sharedModules as T}from"@gramlot/gramlot";var D=n=>T["./random-id.js"][n],f=D("randomId");import{sharedModules as j}from"@gramlot/gramlot";var V=n=>j["./renderer/attributes.js"][n],u=V("SVG_NS");var q=(0,d.defineComponent)({name:"drawingPane",tag:"gramlot-drawing-pane",base:y,sourceContext:!0,subTags:"*",parameters:{image:{dtype:"T",nullable:!0,default:null,binding:"read"},annotations:{dtype:"X",binding:"read"}},implementation:n=>class extends n{#t;#c;#s;#x;#e;#n;#k=`drawing-state-${f()}`;#w=!1;#v=!1;#m;#f;#o;#S=`drawing-${f()}`;#l="select";#a=null;#i=null;#h=[1e3,1e3];#u=null;#g;constructor(){super();let t=this.ownerDocument,e=t.createElement("style");e.textContent=`:host{display:block;height:100%;min-height:0}.control-box{height:100%;display:flex;flex-direction:row;min-height:0;position:relative}
|
|
25
4
|
slot{display:contents} ::slotted(gramlot-menu){flex:0 0 56px;box-sizing:border-box;padding:6px;background:var(--gramlot-surface,Canvas);border-right:1px solid var(--gramlot-border-control,#a8b2bf);overflow:hidden}
|
|
26
5
|
.canvas{display:block;flex:1;width:0;height:100%;min-width:0;min-height:0;background:var(--gramlot-surface-subtle,#eee);touch-action:none;user-select:none}
|
|
27
6
|
.text-editor{position:absolute;z-index:2;min-width:120px;padding:2px 4px;border:1px solid #3977bc;border-radius:3px;background:white;color:#222;box-shadow:0 2px 8px #0003}
|
|
28
|
-
.text-editor[hidden]{display:none}.shape{cursor:pointer}.selected{stroke:#1683ff}.selected [data-text-hit]{stroke:#3977bc;stroke-width:1;stroke-dasharray:4 3}`,this.shadowRoot.append(r),this.control.replaceChildren(),this.#n=e.createElement("input"),this.#n.type="text",this.#n.className="text-editor",this.#n.hidden=!0,this.#n.setAttribute("aria-label","Annotation text"),this.#e=e.createElementNS(lt,"svg"),this.#e.setAttribute("role","img"),this.#e.setAttribute("aria-label","Annotated image"),this.#e.setAttribute("class","canvas"),this.#e.setAttribute("viewBox","0 0 1000 1000"),this.#e.setAttribute("preserveAspectRatio","xMidYMid meet"),this.controlBox.append(e.createElement("slot"),this.#e,this.#n),this.#o=e.createElement("img")}setSourceContext(e){this.context=e}projectAttributes(e,r){let n=super.projectAttributes(e,r);return this.isConnected&&this.#D(),n}connectedCallback(){this.#g=new this.ownerDocument.defaultView.AbortController;let e={signal:this.#g.signal};this.#O(),this.isConnected&&(this.#t.subscribe(this.#E,{any:()=>this.#I()}),this.#e.addEventListener("pointerdown",r=>this.#B(r),e),this.#e.addEventListener("pointermove",r=>this.#x(r),e),this.#e.addEventListener("pointerup",r=>this.#M(r),e),this.#e.addEventListener("pointercancel",()=>{this.#r=null,this.#a()},e),this.#e.addEventListener("dblclick",r=>{let n=r.target.closest("[data-id]")?.dataset.id;n&&this.#i.getItem(n)?.getItem("type")==="text"&&(this.#r=null,this.#C(n),r.preventDefault())},e),this.#n.addEventListener("keydown",r=>{r.key==="Enter"?(r.preventDefault(),this.#p(!0)):r.key==="Escape"&&(r.preventDefault(),this.#p(!1))},e),this.#n.addEventListener("blur",()=>this.#p(!0),e),this.#D())}disconnectedCallback(){this.#p(!1),this.#g?.abort(),this.#g=null,this.#t?.unsubscribe(this.#E,{any:!0}),this.#i?.unsubscribe(this.#k,{any:!0}),this.#i=null,this.#o.onload=null,this.#o.onerror=null,this.#d=null,this.#r=null}#D(){let e=this.parameters.annotations;if(!(e instanceof Le))throw new TypeError("drawingPane annotations requires a Data Bag");e!==this.#i&&(this.#i?.unsubscribe(this.#k,{any:!0}),this.#i=e,e.subscribe(this.#k,{any:()=>this.#a()}),this.#l=null);let r=this.parameters.image;r!==this.#d&&(this.#d=r,this.#r=null,r?(this.#c=null,this.#a(),this.#o.onload=()=>{this.#d===r&&(this.#c=[this.#o.naturalWidth,this.#o.naturalHeight],this.#a())},this.#o.onerror=()=>{this.#d===r&&(this.#c=null,this.context.reportError(new Error("Cannot load image"),"Drawing image"),this.#a())},this.#o.src=r):(this.#c=[1e3,1e3],this.#a())),this.#a()}#O(){if(this.#v)return;let e=this.context.sourceNode,r=e.rootBuilder,n=e.value?.getNode("bar");if(n){this.#t=e.drawingState,this.#s=e.drawingStatePath,n.drawingController=this,this.#v=!0,this.#u=this.#t.getItem("tool"),this.#m=this.#t.getItem("color"),this.#_=this.#t.getItem("size");return}this.#s=`_gramlot.drawing.${Zt()}`,this.#t=new Le({tool:"select",color:"#dd2222",size:3}),e.setRelativeData(this.#s,this.#t),Object.defineProperty(e,"drawingState",{value:this.#t,configurable:!0}),Object.defineProperty(e,"drawingStatePath",{value:this.#s,configurable:!0}),this.#m=this.#t.getItem("color"),this.#_=this.#t.getItem("size");let i=new r.source.constructor(null,r),a=r.wrapSource(i).menu({node_label:"bar",presentation:"bar",orientation:"vertical",labelPosition:"tooltip",iconSize:20,aria_label:"Image annotations"});Object.defineProperty(_d(a),"drawingController",{value:this,configurable:!0,writable:!0});let o={select:"M5 3l13 11-6 .5-3 5z",freehand:"M4 20l3.5-.7L19 7.8 16.2 5 4.7 16.5z M14.7 6.5l2.8 2.8",arrow:"M4 19L19 4 M12 4h7v7",circle:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0z",text:"M4 5h16 M12 5v14 M8 19h8",delete:"M4 7h16 M9 7V4h6v3 M7 7l1 13h8l1-13 M10 10v7 M14 10v7"},u=h=>"data:image/svg+xml,"+encodeURIComponent(`<svg xmlns="${lt}" viewBox="0 0 24 24" fill="none" stroke="#7e93ad" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="${o[h]}"/></svg>`);for(let[h,g]of[["select","Select"],["freehand","Draw"],["arrow","Arrow"],["circle","Circle"],["text","Text"]])a.menuline({caption:g,tooltip:g,iconSrc:u(h),checked:`^${this.#s}.tool:={} === '${h}'`,action:`this.parentBag.parentNode.drawingController.setTool('${h}')`});a.contentPane({height:"1px",margin:"6px 4px",background:"var(--gramlot-border-control,#a8b2bf)"});let l=h=>"data:image/svg+xml,"+encodeURIComponent(`<svg xmlns="${lt}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8" fill="${h}" stroke="#8793a3" stroke-width="1.5"/></svg>`),c=a.menuline({caption:"Color",tooltip:"Color",iconSrc:`^${this.#s}.color:='data:image/svg+xml,' + encodeURIComponent('<svg xmlns="${lt}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8" fill="' + {} + '" stroke="#8793a3" stroke-width="1.5"/></svg>')`}).menu({aria_label:"Annotation colors"});for(let[h,g]of[["#dd2222","Red"],["#e6a700","Yellow"],["#16834a","Green"],["#1677d2","Blue"],["#ffffff","White"],["#202733","Black"]])c.menuline({caption:g,iconSrc:l(h),checked:`^${this.#s}.color:={} === '${h}'`,action:`this.SET('${this.#s}.color', '${h}');`});c.contentPane({padding:"8px"}).colorpicker({value:`^${this.#s}.color`,lbl:"Custom color",aria_label:"Color",width:"140px"});let f=h=>"data:image/svg+xml,"+encodeURIComponent(`<svg xmlns="${lt}" viewBox="0 0 24 24"><path d="M4 12h16" stroke="#7e93ad" stroke-width="${h}" stroke-linecap="round"/></svg>`),d=a.menuline({caption:"Pen size",tooltip:"Pen size",iconSrc:`^${this.#s}.size:='data:image/svg+xml,' + encodeURIComponent('<svg xmlns="${lt}" viewBox="0 0 24 24"><path d="M4 12h16" stroke="#7e93ad" stroke-width="' + Math.min({}, 12) + '" stroke-linecap="round"/></svg>')`}).menu({aria_label:"Pen size"});for(let h of[1,3,5,7,12,20])d.menuline({caption:`${h} px`,iconSrc:f(Math.min(h,12)),checked:`^${this.#s}.size:={} === ${h}`,action:`this.SET('${this.#s}.size', ${h});`});d.contentPane({padding:"8px"}).numberTextBox({value:`^${this.#s}.size`,lbl:"Custom size",aria_label:"Pen size",dtype:"L",min:1,max:20,width:"140px"}),a.contentPane({flex:"1",min_height:"12px"}),a.menuline({caption:"Delete",tooltip:"Delete",iconSrc:u("delete"),action:"this.parentBag.parentNode.drawingController.deleteSelection()"});let p=r.binding.gramlot,m=p.src.prepareSource(i);p.src.renderer.validateCandidate(m),this.#v=!0,e.setValue(m)}setTool(e){this.#p(!0),this.#r=null,this.#t.setItem("tool",e)}deleteSelection(){this.#l&&(this.#i.popNode(this.#l),this.#l=null,this.#a())}#I(){let e=this.#t.getItem("tool");this.#u=e;let r=this.#t.getItem("color"),n=this.#t.getItem("size"),i=r!==this.#m||n!==this.#_;this.#m=r,this.#_=n,i&&!this.#y&&this.#R(),this.#a()}#A(e){let r=this.#e.getScreenCTM();if(!r)return null;let n=this.#e.createSVGPoint();n.x=e.clientX,n.y=e.clientY;let i=n.matrixTransform(r.inverse());return{x:Math.max(0,Math.min(this.#c[0],i.x)),y:Math.max(0,Math.min(this.#c[1],i.y))}}#B(e){if(e.button!==0||!this.#c)return;let r=this.#A(e);if(!r)return;let n=e.target.closest("[data-id]")?.getAttribute("data-id");if(this.#u==="select"){if(this.#l=n||null,n){let i=this.#i.getItem(n);if(!(i instanceof Le))throw new TypeError("Annotation must be a Bag");let s=this.#w(i);this.#y=!0;try{this.#t.setItem("color",s.color),this.#t.setItem("size",s.width)}finally{this.#y=!1}this.#r={id:n,start:r,original:s}}}else if(this.#u==="text"){let i=n?this.#i.getItem(n):null;this.#C(i instanceof Le&&i.getItem("type")==="text"?n:null,r)}else this.#l=null,this.#r={start:r,current:r,points:[r]};this.#r&&this.#e.setPointerCapture(e.pointerId),this.#a(),e.preventDefault()}#x(e){if(!this.#r||!this.#c)return;let r=this.#A(e);r&&(this.#r.current=r,this.#u==="freehand"&&this.#r.points.push(r),this.#a())}#M(e){if(!this.#r)return;this.#x(e);let r=this.#r;if(this.#r=null,r.id){let n={x:r.current.x-r.start.x,y:r.current.y-r.start.y},i=this.#N(r.original,n);this.#i.setItem(r.id,new Le(i))}else{let{start:n,current:i,points:s}=r,a;this.#u==="arrow"?a={type:"arrow",x:n.x,y:n.y,x2:i.x,y2:i.y}:this.#u==="circle"?a={type:"circle",x:n.x,y:n.y,radius:Math.hypot(i.x-n.x,i.y-n.y)}:this.#u==="freehand"&&(a={type:"freehand",points:s}),a&&this.#T({...a,color:this.#t.getItem("color"),width:this.#b()})}this.#e.hasPointerCapture(e.pointerId)&&this.#e.releasePointerCapture(e.pointerId),this.#a()}#T(e){let r=`item_${Zt()}`;this.#i.setItem(r,new Le(e)),this.#l=r}#b(){let e=this.#t.getItem("size");return Number.isFinite(e)?Math.max(1,Math.min(20,e)):3}#R(){if(!this.#l)return;let e=this.#i.getItem(this.#l);if(!(e instanceof Le))return;let r=this.#w(e);r.color=this.#t.getItem("color"),r.width=this.#b(),this.#i.setItem(this.#l,new Le(r))}#C(e,r){this.#p(!0);let n=e?this.#w(this.#i.getItem(e)):{type:"text",...r,text:"",color:this.#t.getItem("color"),width:this.#b()};this.#l=e,this.#h={id:e,row:n},this.#n.value=n.text,this.#n.hidden=!1;let i=this.#e.createSVGPoint();i.x=n.x,i.y=n.y;let s=this.#e.getScreenCTM();if(!s){this.#p(!1);return}let a=i.matrixTransform(s),o=this.controlBox.getBoundingClientRect(),u=Math.max(14,Math.max(14,12+n.width*2)*s.a);this.#n.style.left=`${a.x-o.left}px`,this.#n.style.top=`${a.y-o.top-u}px`,this.#n.style.fontSize=`${u}px`,this.#n.focus(),this.#n.select()}#p(e){if(!this.#h)return;let{id:r,row:n}=this.#h;this.#h=null;let i=this.#n.value.trim();this.#n.hidden=!0,e&&i&&(n.text=i,r?this.#i.setItem(r,new Le(n)):this.#T(n)),e&&this.#t.setItem("tool","select"),this.#a()}#w(e){let r=Object.fromEntries(e.getNodes().map(n=>[n.label,n.getValue()]));return r.type==="freehand"&&(r.points=r.points.getNodes().map(n=>({x:n.getValue().getItem("x"),y:n.getValue().getItem("y")}))),r}#N(e,r){let n={...e};return e.type==="freehand"?n.points=e.points.map(i=>({x:i.x+r.x,y:i.y+r.y})):(n.x+=r.x,n.y+=r.y,e.type==="arrow"&&(n.x2+=r.x,n.y2+=r.y)),n}#f(e,r){let n=this.ownerDocument.createElementNS(lt,e);for(let[i,s]of Object.entries(r))n.setAttribute(i,String(s));return n}#S(e,r){let n=this.#f("g",{"data-id":r,class:`shape${r===this.#l?" selected":""}`,fill:"none",stroke:e.color,"stroke-width":e.width,"stroke-linecap":"round","stroke-linejoin":"round"});if(e.type==="circle"&&n.append(this.#f("circle",{cx:e.x,cy:e.y,r:e.radius})),e.type==="arrow"){n.append(this.#f("line",{x1:e.x,y1:e.y,x2:e.x2,y2:e.y2}));let i=Math.atan2(e.y2-e.y,e.x2-e.x),s=Math.max(12,e.width*5),a=e.x2-s*Math.cos(i-.45),o=e.y2-s*Math.sin(i-.45),u=e.x2-s*Math.cos(i+.45),l=e.y2-s*Math.sin(i+.45);n.append(this.#f("polyline",{points:`${a},${o} ${e.x2},${e.y2} ${u},${l}`}))}if(e.type==="freehand"&&n.append(this.#f("polyline",{points:e.points.map(i=>`${i.x},${i.y}`).join(" ")})),e.type==="text"){let i=this.#f("rect",{"data-text-hit":"",fill:"transparent",stroke:"none","pointer-events":"all"}),s=this.#f("text",{x:e.x,y:e.y,fill:e.color,stroke:"none","font-size":Math.max(14,12+e.width*2)});s.textContent=e.text,n.append(i,s)}return n}#a(){if(!this.#e||!this.#i||(this.#e.replaceChildren(),!this.#c))return;let[e,r]=this.#c;this.#e.setAttribute("viewBox",`0 0 ${e} ${r}`),this.#d&&this.#e.append(this.#f("image",{href:this.#d,x:0,y:0,width:e,height:r,"pointer-events":"none"}));for(let i of this.#i.getNodes()){let s=i.getValue();if(!(s instanceof Le))throw new TypeError("Annotation must be a Bag");let a=this.#w(s);this.#r?.id===i.label&&this.#r.current&&(a=this.#N(this.#r.original,{x:this.#r.current.x-this.#r.start.x,y:this.#r.current.y-this.#r.start.y}));let o=this.#S(a,i.label);if(this.#e.append(o),a.type==="text"){let u=o.querySelector("text").getBBox(),l=o.querySelector("[data-text-hit]");for(let c of["x","y","width","height"])l.setAttribute(c,u[c])}}let n=this.#r;if(n&&!n.id&&n.current){let i;this.#u==="arrow"&&(i={type:"arrow",x:n.start.x,y:n.start.y,x2:n.current.x,y2:n.current.y}),this.#u==="circle"&&(i={type:"circle",x:n.start.x,y:n.start.y,radius:Math.hypot(n.current.x-n.start.x,n.current.y-n.start.y)}),this.#u==="freehand"&&(i={type:"freehand",points:n.points}),i&&this.#e.append(this.#S({...i,color:this.#t.getItem("color"),width:this.#b()},""))}}}}),x_=Mn({name:"drawing",dependencies:[gd,bd],components:[wd]});export{wd as DrawingPane,x_ as default};
|
|
7
|
+
.text-editor[hidden]{display:none}.shape{cursor:pointer}.selected{stroke:#1683ff}.selected [data-text-hit]{stroke:#3977bc;stroke-width:1;stroke-dasharray:4 3}`,this.shadowRoot.append(e),this.control.replaceChildren(),this.#s=t.createElement("input"),this.#s.type="text",this.#s.className="text-editor",this.#s.hidden=!0,this.#s.setAttribute("aria-label","Annotation text"),this.#t=t.createElementNS(u,"svg"),this.#t.setAttribute("role","img"),this.#t.setAttribute("aria-label","Annotated image"),this.#t.setAttribute("class","canvas"),this.#t.setAttribute("viewBox","0 0 1000 1000"),this.#t.setAttribute("preserveAspectRatio","xMidYMid meet"),this.controlBox.append(t.createElement("slot"),this.#t,this.#s),this.#c=t.createElement("img")}setSourceContext(t){this.context=t}projectAttributes(t,e){let i=super.projectAttributes(t,e);return this.isConnected&&this.#C(),i}connectedCallback(){this.#g=new this.ownerDocument.defaultView.AbortController;let t={signal:this.#g.signal};this.#B(),this.isConnected&&(this.#e.subscribe(this.#k,{any:()=>this.#P()}),this.#t.addEventListener("pointerdown",e=>this.#N(e),t),this.#t.addEventListener("pointermove",e=>this.#M(e),t),this.#t.addEventListener("pointerup",e=>this.#T(e),t),this.#t.addEventListener("pointercancel",()=>{this.#i=null,this.#r()},t),this.#t.addEventListener("dblclick",e=>{let i=e.target.closest("[data-id]")?.dataset.id;i&&this.#o.getItem(i)?.getItem("type")==="text"&&(this.#i=null,this.#z(i),e.preventDefault())},t),this.#s.addEventListener("keydown",e=>{e.key==="Enter"?(e.preventDefault(),this.#p(!0)):e.key==="Escape"&&(e.preventDefault(),this.#p(!1))},t),this.#s.addEventListener("blur",()=>this.#p(!0),t),this.#C())}disconnectedCallback(){this.#p(!1),this.#g?.abort(),this.#g=null,this.#e?.unsubscribe(this.#k,{any:!0}),this.#o?.unsubscribe(this.#S,{any:!0}),this.#o=null,this.#c.onload=null,this.#c.onerror=null,this.#u=null,this.#i=null}#C(){let t=this.parameters.annotations;if(!(t instanceof h))throw new TypeError("drawingPane annotations requires a Data Bag");t!==this.#o&&(this.#o?.unsubscribe(this.#S,{any:!0}),this.#o=t,t.subscribe(this.#S,{any:()=>this.#r()}),this.#a=null);let e=this.parameters.image;e!==this.#u&&(this.#u=e,this.#i=null,e?(this.#h=null,this.#r(),this.#c.onload=()=>{this.#u===e&&(this.#h=[this.#c.naturalWidth,this.#c.naturalHeight],this.#r())},this.#c.onerror=()=>{this.#u===e&&(this.#h=null,this.context.reportError(new Error("Cannot load image"),"Drawing image"),this.#r())},this.#c.src=e):(this.#h=[1e3,1e3],this.#r())),this.#r()}#B(){if(this.#v)return;let t=this.context.sourceNode,e=t.rootBuilder,i=t.value?.getNode("bar");if(i){this.#e=t.drawingState,this.#n=t.drawingStatePath,i.drawingController=this,this.#v=!0,this.#l=this.#e.getItem("tool"),this.#m=this.#e.getItem("color"),this.#f=this.#e.getItem("size");return}this.#n=`_gramlot.drawing.${f()}`,this.#e=new h({tool:"select",color:"#dd2222",size:3}),t.setRelativeData(this.#n,this.#e),Object.defineProperty(t,"drawingState",{value:this.#e,configurable:!0}),Object.defineProperty(t,"drawingStatePath",{value:this.#n,configurable:!0}),this.#m=this.#e.getItem("color"),this.#f=this.#e.getItem("size");let s=new e.source.constructor(null,e),r=e.wrapSource(s).menu({node_label:"bar",presentation:"bar",orientation:"vertical",labelPosition:"tooltip",iconSize:20,aria_label:"Image annotations"});Object.defineProperty(_(r),"drawingController",{value:this,configurable:!0,writable:!0});let l={select:"M5 3l13 11-6 .5-3 5z",freehand:"M4 20l3.5-.7L19 7.8 16.2 5 4.7 16.5z M14.7 6.5l2.8 2.8",arrow:"M4 19L19 4 M12 4h7v7",circle:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0z",text:"M4 5h16 M12 5v14 M8 19h8",delete:"M4 7h16 M9 7V4h6v3 M7 7l1 13h8l1-13 M10 10v7 M14 10v7"},c=a=>"data:image/svg+xml,"+encodeURIComponent(`<svg xmlns="${u}" viewBox="0 0 24 24" fill="none" stroke="#7e93ad" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="${l[a]}"/></svg>`);for(let[a,g]of[["select","Select"],["freehand","Draw"],["arrow","Arrow"],["circle","Circle"],["text","Text"]])r.menuline({caption:g,tooltip:g,iconSrc:c(a),checked:`^${this.#n}.tool:={} === '${a}'`,action:`this.parentBag.parentNode.drawingController.setTool('${a}')`});r.contentPane({height:"1px",margin:"6px 4px",background:"var(--gramlot-border-control,#a8b2bf)"});let p=a=>"data:image/svg+xml,"+encodeURIComponent(`<svg xmlns="${u}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8" fill="${a}" stroke="#8793a3" stroke-width="1.5"/></svg>`),x=r.menuline({caption:"Color",tooltip:"Color",iconSrc:`^${this.#n}.color:='data:image/svg+xml,' + encodeURIComponent('<svg xmlns="${u}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8" fill="' + {} + '" stroke="#8793a3" stroke-width="1.5"/></svg>')`}).menu({aria_label:"Annotation colors"});for(let[a,g]of[["#dd2222","Red"],["#e6a700","Yellow"],["#16834a","Green"],["#1677d2","Blue"],["#ffffff","White"],["#202733","Black"]])x.menuline({caption:g,iconSrc:p(a),checked:`^${this.#n}.color:={} === '${a}'`,action:`this.SET('${this.#n}.color', '${a}');`});x.contentPane({padding:"8px"}).colorpicker({value:`^${this.#n}.color`,lbl:"Custom color",aria_label:"Color",width:"140px"});let M=a=>"data:image/svg+xml,"+encodeURIComponent(`<svg xmlns="${u}" viewBox="0 0 24 24"><path d="M4 12h16" stroke="#7e93ad" stroke-width="${a}" stroke-linecap="round"/></svg>`),w=r.menuline({caption:"Pen size",tooltip:"Pen size",iconSrc:`^${this.#n}.size:='data:image/svg+xml,' + encodeURIComponent('<svg xmlns="${u}" viewBox="0 0 24 24"><path d="M4 12h16" stroke="#7e93ad" stroke-width="' + Math.min({}, 12) + '" stroke-linecap="round"/></svg>')`}).menu({aria_label:"Pen size"});for(let a of[1,3,5,7,12,20])w.menuline({caption:`${a} px`,iconSrc:M(Math.min(a,12)),checked:`^${this.#n}.size:={} === ${a}`,action:`this.SET('${this.#n}.size', ${a});`});w.contentPane({padding:"8px"}).numberTextBox({value:`^${this.#n}.size`,lbl:"Custom size",aria_label:"Pen size",dtype:"L",min:1,max:20,width:"140px"}),r.contentPane({flex:"1",min_height:"12px"}),r.menuline({caption:"Delete",tooltip:"Delete",iconSrc:c("delete"),action:"this.parentBag.parentNode.drawingController.deleteSelection()"});let v=e.binding.gramlot,S=v.src.prepareSource(s);v.src.renderer.validateCandidate(S),this.#v=!0,t.setValue(S)}setTool(t){this.#p(!0),this.#i=null,this.#e.setItem("tool",t)}deleteSelection(){this.#a&&(this.#o.popNode(this.#a),this.#a=null,this.#r())}#P(){let t=this.#e.getItem("tool");this.#l=t;let e=this.#e.getItem("color"),i=this.#e.getItem("size"),s=e!==this.#m||i!==this.#f;this.#m=e,this.#f=i,s&&!this.#w&&this.#D(),this.#r()}#I(t){let e=this.#t.getScreenCTM();if(!e)return null;let i=this.#t.createSVGPoint();i.x=t.clientX,i.y=t.clientY;let s=i.matrixTransform(e.inverse());return{x:Math.max(0,Math.min(this.#h[0],s.x)),y:Math.max(0,Math.min(this.#h[1],s.y))}}#N(t){if(t.button!==0||!this.#h)return;let e=this.#I(t);if(!e)return;let i=t.target.closest("[data-id]")?.getAttribute("data-id");if(this.#l==="select"){if(this.#a=i||null,i){let s=this.#o.getItem(i);if(!(s instanceof h))throw new TypeError("Annotation must be a Bag");let o=this.#y(s);this.#w=!0;try{this.#e.setItem("color",o.color),this.#e.setItem("size",o.width)}finally{this.#w=!1}this.#i={id:i,start:e,original:o}}}else if(this.#l==="text"){let s=i?this.#o.getItem(i):null;this.#z(s instanceof h&&s.getItem("type")==="text"?i:null,e)}else this.#a=null,this.#i={start:e,current:e,points:[e]};this.#i&&this.#t.setPointerCapture(t.pointerId),this.#r(),t.preventDefault()}#M(t){if(!this.#i||!this.#h)return;let e=this.#I(t);e&&(this.#i.current=e,this.#l==="freehand"&&this.#i.points.push(e),this.#r())}#T(t){if(!this.#i)return;this.#M(t);let e=this.#i;if(this.#i=null,e.id){let i={x:e.current.x-e.start.x,y:e.current.y-e.start.y},s=this.#A(e.original,i);this.#o.setItem(e.id,new h(s))}else{let{start:i,current:s,points:o}=e,r;this.#l==="arrow"?r={type:"arrow",x:i.x,y:i.y,x2:s.x,y2:s.y}:this.#l==="circle"?r={type:"circle",x:i.x,y:i.y,radius:Math.hypot(s.x-i.x,s.y-i.y)}:this.#l==="freehand"&&(r={type:"freehand",points:o}),r&&this.#$({...r,color:this.#e.getItem("color"),width:this.#b()})}this.#t.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId),this.#r()}#$(t){let e=`item_${f()}`;this.#o.setItem(e,new h(t)),this.#a=e}#b(){let t=this.#e.getItem("size");return Number.isFinite(t)?Math.max(1,Math.min(20,t)):3}#D(){if(!this.#a)return;let t=this.#o.getItem(this.#a);if(!(t instanceof h))return;let e=this.#y(t);e.color=this.#e.getItem("color"),e.width=this.#b(),this.#o.setItem(this.#a,new h(e))}#z(t,e){this.#p(!0);let i=t?this.#y(this.#o.getItem(t)):{type:"text",...e,text:"",color:this.#e.getItem("color"),width:this.#b()};this.#a=t,this.#x={id:t,row:i},this.#s.value=i.text,this.#s.hidden=!1;let s=this.#t.createSVGPoint();s.x=i.x,s.y=i.y;let o=this.#t.getScreenCTM();if(!o){this.#p(!1);return}let r=s.matrixTransform(o),l=this.controlBox.getBoundingClientRect(),c=Math.max(14,Math.max(14,12+i.width*2)*o.a);this.#s.style.left=`${r.x-l.left}px`,this.#s.style.top=`${r.y-l.top-c}px`,this.#s.style.fontSize=`${c}px`,this.#s.focus(),this.#s.select()}#p(t){if(!this.#x)return;let{id:e,row:i}=this.#x;this.#x=null;let s=this.#s.value.trim();this.#s.hidden=!0,t&&s&&(i.text=s,e?this.#o.setItem(e,new h(i)):this.#$(i)),t&&this.#e.setItem("tool","select"),this.#r()}#y(t){let e=Object.fromEntries(t.getNodes().map(i=>[i.label,i.getValue()]));return e.type==="freehand"&&(e.points=e.points.getNodes().map(i=>({x:i.getValue().getItem("x"),y:i.getValue().getItem("y")}))),e}#A(t,e){let i={...t};return t.type==="freehand"?i.points=t.points.map(s=>({x:s.x+e.x,y:s.y+e.y})):(i.x+=e.x,i.y+=e.y,t.type==="arrow"&&(i.x2+=e.x,i.y2+=e.y)),i}#d(t,e){let i=this.ownerDocument.createElementNS(u,t);for(let[s,o]of Object.entries(e))i.setAttribute(s,String(o));return i}#E(t,e){let i=this.#d("g",{"data-id":e,class:`shape${e===this.#a?" selected":""}`,fill:"none",stroke:t.color,"stroke-width":t.width,"stroke-linecap":"round","stroke-linejoin":"round"});if(t.type==="circle"&&i.append(this.#d("circle",{cx:t.x,cy:t.y,r:t.radius})),t.type==="arrow"){i.append(this.#d("line",{x1:t.x,y1:t.y,x2:t.x2,y2:t.y2}));let s=Math.atan2(t.y2-t.y,t.x2-t.x),o=Math.max(12,t.width*5),r=t.x2-o*Math.cos(s-.45),l=t.y2-o*Math.sin(s-.45),c=t.x2-o*Math.cos(s+.45),p=t.y2-o*Math.sin(s+.45);i.append(this.#d("polyline",{points:`${r},${l} ${t.x2},${t.y2} ${c},${p}`}))}if(t.type==="freehand"&&i.append(this.#d("polyline",{points:t.points.map(s=>`${s.x},${s.y}`).join(" ")})),t.type==="text"){let s=this.#d("rect",{"data-text-hit":"",fill:"transparent",stroke:"none","pointer-events":"all"}),o=this.#d("text",{x:t.x,y:t.y,fill:t.color,stroke:"none","font-size":Math.max(14,12+t.width*2)});o.textContent=t.text,i.append(s,o)}return i}#r(){if(!this.#t||!this.#o||(this.#t.replaceChildren(),!this.#h))return;let[t,e]=this.#h;this.#t.setAttribute("viewBox",`0 0 ${t} ${e}`),this.#u&&this.#t.append(this.#d("image",{href:this.#u,x:0,y:0,width:t,height:e,"pointer-events":"none"}));for(let s of this.#o.getNodes()){let o=s.getValue();if(!(o instanceof h))throw new TypeError("Annotation must be a Bag");let r=this.#y(o);this.#i?.id===s.label&&this.#i.current&&(r=this.#A(this.#i.original,{x:this.#i.current.x-this.#i.start.x,y:this.#i.current.y-this.#i.start.y}));let l=this.#E(r,s.label);if(this.#t.append(l),r.type==="text"){let c=l.querySelector("text").getBBox(),p=l.querySelector("[data-text-hit]");for(let x of["x","y","width","height"])p.setAttribute(x,c[x])}}let i=this.#i;if(i&&!i.id&&i.current){let s;this.#l==="arrow"&&(s={type:"arrow",x:i.start.x,y:i.start.y,x2:i.current.x,y2:i.current.y}),this.#l==="circle"&&(s={type:"circle",x:i.start.x,y:i.start.y,radius:Math.hypot(i.current.x-i.start.x,i.current.y-i.start.y)}),this.#l==="freehand"&&(s={type:"freehand",points:i.points}),s&&this.#t.append(this.#E({...s,color:this.#e.getItem("color"),width:this.#b()},""))}}}}),ct=b({name:"drawing",dependencies:[L,R],components:[q]});export{q as DrawingPane,ct as default};
|