@gramlot/gramlot 0.3.26 → 0.3.27

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.
Files changed (71) hide show
  1. package/dist/components/chat/__init__.py +1 -1
  2. package/dist/components/chat/assets/collection.js +3 -3
  3. package/dist/components/chat/assets/index.js +1 -1
  4. package/dist/components/editors/__init__.py +1 -1
  5. package/dist/components/editors/assets/collection.js +16 -16
  6. package/dist/components/editors/assets/index.js +1 -1
  7. package/dist/components/grid/__init__.py +1 -1
  8. package/dist/components/grid/assets/collection.js +28 -19
  9. package/dist/components/grid/assets/index.js +1 -1
  10. package/dist/components/grid/grammar.json +21 -0
  11. package/dist/components/grouplets/__init__.py +1 -1
  12. package/dist/components/grouplets/assets/collection.js +2 -2
  13. package/dist/components/grouplets/assets/index.js +1 -1
  14. package/dist/components/inputs/__init__.py +1 -1
  15. package/dist/components/inputs/assets/collection.js +21 -21
  16. package/dist/components/inputs/assets/index.js +1 -1
  17. package/dist/components/layout/__init__.py +1 -1
  18. package/dist/components/layout/assets/collection.js +15 -15
  19. package/dist/components/layout/assets/index.js +1 -1
  20. package/dist/components/selection_trial/__init__.py +1 -1
  21. package/dist/components/selection_trial/assets/collection.js +3 -3
  22. package/dist/components/selection_trial/assets/index.js +1 -1
  23. package/dist/components/tree/__init__.py +1 -1
  24. package/dist/components/tree/assets/collection.js +11 -11
  25. package/dist/components/tree/assets/index.js +1 -1
  26. package/dist/components/typst/__init__.py +1 -1
  27. package/dist/components/typst/assets/collection.js +3 -3
  28. package/dist/components/typst/assets/index.js +1 -1
  29. package/dist/components/uploads/__init__.py +1 -1
  30. package/dist/components/uploads/assets/collection.js +8 -8
  31. package/dist/components/uploads/assets/index.js +1 -1
  32. package/dist/gramlot.js +624 -86
  33. package/dist/gramlot.min.js +47 -46
  34. package/package.json +1 -1
  35. package/src/binding/grid-struct.js +1 -1
  36. package/src/binding/validation-context.js +2 -1
  37. package/src/components/bases.js +5 -3
  38. package/src/components/choice-editor.js +28 -13
  39. package/src/components/database-choices.js +9 -6
  40. package/src/components/field-state.js +8 -1
  41. package/src/components/grid-cell-editor.js +83 -19
  42. package/src/components/grid-grammar.json +21 -0
  43. package/src/components/grid-structure.js +4 -1
  44. package/src/components/grid-styles.js +11 -2
  45. package/src/components/grid.js +16 -1
  46. package/src/components/inputs.js +2 -2
  47. package/src/components/parameters.js +6 -2
  48. package/src/components/tree.js +1 -0
  49. package/src/components/typed-editor.js +4 -4
  50. package/src/components/validation.js +1 -1
  51. package/src/editing-session.d.ts +1 -0
  52. package/src/editing-session.js +113 -15
  53. package/src/editor-values.js +57 -0
  54. package/src/gramlot.d.ts +1 -0
  55. package/src/gramlot.js +7 -4
  56. package/src/index.d.ts +1 -1
  57. package/src/renderer/gramlot-renderer.d.ts +1 -0
  58. package/src/renderer/gramlot-renderer.js +11 -0
  59. package/src/server/source-import.d.ts +1 -1
  60. package/src/server/source-import.js +5 -1
  61. package/src/server/visual-editor.d.ts +1 -1
  62. package/src/server/visual-editor.js +30 -20
  63. package/src/source-picker.d.ts +1 -1
  64. package/src/source-picker.js +1 -2
  65. package/src/visual-editor-canvas.js +29 -0
  66. package/src/visual-editor-catalogue.js +34 -0
  67. package/src/visual-editor.d.ts +5 -0
  68. package/src/visual-editor.js +244 -26
  69. package/themes/gramlot-base/theme.css +78 -36
  70. package/tools/gramlot-tools-inspector.js +1 -1
  71. package/tools/inspector-agent.js +1 -1
@@ -1,27 +1,27 @@
1
- var Rl=Object.create;var ui=Object.defineProperty;var Ll=Object.getOwnPropertyDescriptor;var Pl=Object.getOwnPropertyNames;var $l=Object.getPrototypeOf,Ul=Object.prototype.hasOwnProperty;var Je=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ia=(t,e)=>{for(var r in e)ui(t,r,{get:e[r],enumerable:!0})},li=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Pl(e))!Ul.call(t,i)&&i!==r&&ui(t,i,{get:()=>e[i],enumerable:!(n=Ll(e,i))||n.enumerable});return t},nn=(t,e,r)=>(li(t,e,"default"),r&&li(r,e,"default")),Ma=(t,e,r)=>(r=t!=null?Rl($l(t)):{},li(e||!t||!t.__esModule?ui(r,"default",{value:t,enumerable:!0}):r,t));var _t=Je(le=>{"use strict";function uc(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(bt(t,n)){var i=t[n];if(e.call(void 0,i,n,t))return i}}function Lt(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 bt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function cc(t,e){if(t===null||typeof t!="object")throw new TypeError("target is not an object");for(var r in e)bt(e,r)&&(t[r]=e[r]);return t}var ms=Lt({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 dc(t){return bt(ms,t.toLowerCase())}var gs=Lt({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 fc(t){return bt(gs,t.toLowerCase())}var hr=Lt({script:!1,style:!1,textarea:!0,title:!0});function pc(t){var e=t.toLowerCase();return bt(hr,e)&&!hr[e]}function hc(t){var e=t.toLowerCase();return bt(hr,e)&&hr[e]}function bs(t){return t===mr.HTML}function mc(t){return bs(t)||t===mr.XML_XHTML_APPLICATION}var mr=Lt({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),gc=Object.keys(mr).map(function(t){return mr[t]});function bc(t){return gc.indexOf(t)>-1}var _c=Lt({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/"});le.assign=cc;le.find=uc;le.freeze=Lt;le.HTML_BOOLEAN_ATTRIBUTES=ms;le.HTML_RAW_TEXT_ELEMENTS=hr;le.HTML_VOID_ELEMENTS=gs;le.hasDefaultHTMLNamespace=mc;le.hasOwn=bt;le.isHTMLBooleanAttribute=dc;le.isHTMLRawTextElement=pc;le.isHTMLEscapableRawTextElement=hc;le.isHTMLMimeType=bs;le.isHTMLVoidElement=fc;le.isValidMimeType=bc;le.MIME_TYPE=mr;le.NAMESPACE=_c});var yr=Je(wr=>{"use strict";var wc=_t();function ws(t,e){t.prototype=Object.create(Error.prototype,{constructor:{value:t},name:{value:t.name,enumerable:!0,writable:e}})}var br=wc.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"}),ys=Object.keys(br);function vs(t){return typeof t=="number"&&t>=1&&t<=25}function yc(t){return typeof t=="string"&&t.substring(t.length-br.Error.length)===br.Error}function _r(t,e){vs(t)?(this.name=ys[t],this.message=e||""):(this.message=t,this.name=yc(e)?e:br.Error),Error.captureStackTrace&&Error.captureStackTrace(this,_r)}ws(_r,!0);Object.defineProperties(_r.prototype,{code:{enumerable:!0,get:function(){var t=ys.indexOf(this.name);return vs(t)?t:0}}});var ks={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},Si=Object.entries(ks);for(gr=0;gr<Si.length;gr++)_s=Si[gr][0],_r[_s]=Si[gr][1];var _s,gr;function Oi(t,e,r){this.message=t,this.locator=e,this.cause=r,Error.captureStackTrace&&Error.captureStackTrace(this,Oi)}ws(Oi);wr.DOMException=_r;wr.DOMExceptionName=br;wr.ExceptionCode=ks;wr.ParseError=Oi});var $i=Je(C=>{"use strict";function Cs(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 Ut=Cs();function it(t){if(t.source[0]!=="[")throw new Error(t+" can not be used with chars");return t.source.slice(1,t.source.lastIndexOf("]"))}function Pt(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,""),Ut?"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(""),Ut?"u":"")}function A(t){if(arguments.length===0)throw new Error("no parameters provided");return O.apply(A,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var vc="\uFFFD",at=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;Ut&&(at=O("[",it(at),"\\u{10000}-\\u{10FFFF}","]"));var kc=new RegExp("[^"+it(at)+"]",Ut?"u":""),vn=/[\x20\x09\x0D\x0A]/,Ec=it(vn),U=O(vn,"+"),j=O(vn,"*"),vr=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;Ut&&(vr=O("[",it(vr),"\\u{10000}-\\u{10FFFF}","]"));var xc=it(vr),Mi=O("[",xc,it(/[-.0-9\xB7]/),it(/[\u0300-\u036F\u203F-\u2040]/),"]"),ye=O(vr,Mi,"*"),Dc=O("^",ye,"$"),Es=O(Mi,"+"),Ac=O("&",ye,";"),Tc=A(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),kr=A(Ac,"|",Tc),Er=O("%",ye,";"),Ri=A(O('"',A(/[^%&"]/,"|",Er,"|",kr),"*",'"'),"|",O("'",A(/[^%&']/,"|",Er,"|",kr),"*","'")),Cc=A('"',A(/[^<&"]/,"|",kr),"*",'"',"|","'",A(/[^<&']/,"|",kr),"*","'"),Nc=Pt(vr,":"),Sc=Pt(Mi,":"),Bi=O(Nc,Sc,"*"),Oc=O("^",Bi,"$"),xr=O(Bi,A(":",Bi),"?"),Bc=O("^",xr,"$"),Ic=O("(",xr,")"),$t=A(/"[^"]*"|'[^']*'/),Mc=O(/^<\?/,"(",ye,")",A(U,"(?!",vn,")(",at,"*?)"),"?",/\?>/),xs=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Dr=A('"',xs,'*"',"|","'",Pt(xs,"'"),"*'"),Ns="<!--",Ss="-->",Rc=O(Ns,A(Pt(at,"-"),"|",O("-",Pt(at,"-"))),"*",Ss),Ds="#PCDATA",Lc=A(O(/\(/,j,Ds,A(j,/\|/,j,xr),"*",j,/\)\*/),"|",O(/\(/,j,Ds,j,/\)/)),Pc=/[?*+]?/,$c=O(/\([^>]+\)/,Pc),Uc=A("EMPTY","|","ANY","|",Lc,"|",$c),Fc="<!ELEMENT",qc=O(Fc,U,A(xr,"|",Er),U,A(Uc,"|",Er),j,">"),jc=O("NOTATION",U,/\(/,j,ye,A(j,/\|/,j,ye),"*",j,/\)/),Vc=O(/\(/,j,Es,A(j,/\|/,j,Es),"*",j,/\)/),zc=A(jc,"|",Vc),Hc=A(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",zc),Wc=A(/#REQUIRED|#IMPLIED/,"|",A(A("#FIXED",U),"?",Cc)),Gc=A(U,ye,U,Hc,U,Wc),Yc="<!ATTLIST",Xc=O(Yc,U,ye,Gc,"*",j,">"),Ii="about:legacy-compat",Zc=A('"'+Ii+'"',"|","'"+Ii+"'"),Li="SYSTEM",kn="PUBLIC",En=A(A(Li,U,$t),"|",A(kn,U,Dr,U,$t)),Jc=O("^",A(A(Li,U,"(?<SystemLiteralOnly>",$t,")"),"|",A(kn,U,"(?<PubidLiteral>",Dr,")",U,"(?<SystemLiteral>",$t,")"))),Kc=O("^",Dr,"$"),Qc=O("^",$t,"$"),ed=A(U,"NDATA",U,ye),td=A(Ri,"|",A(En,ed,"?")),Os="<!ENTITY",rd=O(Os,U,ye,U,td,j,">"),nd=A(Ri,"|",En),id=O(Os,U,"%",U,ye,U,nd,j,">"),ad=A(rd,"|",id),sd=O(kn,U,Dr),od=O("<!NOTATION",U,ye,U,A(En,"|",sd),j,">"),Pi=O(j,"=",j),As=/1[.]\d+/,ld=O(U,"version",Pi,A("'",As,"'","|",'"',As,'"')),Ts=/[A-Za-z][-A-Za-z0-9._]*/,ud=A(U,"encoding",Pi,A('"',Ts,'"',"|","'",Ts,"'")),cd=A(U,"standalone",Pi,A("'",A("yes","|","no"),"'","|",'"',A("yes","|","no"),'"')),dd=O(/^<\?xml/,ld,ud,"?",cd,"?",j,/\?>/),fd="<!DOCTYPE",pd="<![CDATA[",hd="]]>",md=/<!\[CDATA\[/,gd=/\]\]>/,bd=O(at,"*?",gd),_d=O(md,bd);C.chars=it;C.chars_without=Pt;C.detectUnicodeSupport=Cs;C.reg=O;C.regg=A;C.ABOUT_LEGACY_COMPAT=Ii;C.ABOUT_LEGACY_COMPAT_SystemLiteral=Zc;C.AttlistDecl=Xc;C.CDATA_START=pd;C.CDATA_END=hd;C.CDSect=_d;C.Char=at;C.Comment=Rc;C.COMMENT_START=Ns;C.COMMENT_END=Ss;C.DOCTYPE_DECL_START=fd;C.elementdecl=qc;C.EntityDecl=ad;C.EntityValue=Ri;C.ExternalID=En;C.ExternalID_match=Jc;C.Name=ye;C.Name_exact=Dc;C.NCName_exact=Oc;C.NotationDecl=od;C.Reference=kr;C.PEReference=Er;C.PI=Mc;C.PUBLIC=kn;C.PubidLiteral=Dr;C.PubidLiteral_match=Kc;C.QName=xr;C.QName_exact=Bc;C.QName_group=Ic;C.S=U;C.SChar_s=Ec;C.S_OPT=j;C.SYSTEM=Li;C.SystemLiteral=$t;C.SystemLiteral_match=Qc;C.InvalidChar=kc;C.UNICODE_REPLACEMENT_CHARACTER=vc;C.UNICODE_SUPPORT=Ut;C.XMLDecl=dd});var Yi=Je(H=>{"use strict";var Ae=_t(),Le=Ae.find,wd=Ae.hasDefaultHTMLNamespace,qt=Ae.hasOwn,yd=Ae.isHTMLMimeType,vd=Ae.isHTMLRawTextElement,kd=Ae.isHTMLVoidElement,Ar=Ae.MIME_TYPE,Pe=Ae.NAMESPACE,me=Symbol(),$s=yr(),y=$s.DOMException,fe=$s.DOMExceptionName,z=$i();function be(t){if(t!==me)throw new TypeError("Illegal constructor")}function Ed(t){return t!==""}function xd(t){return t?t.split(/[\t\n\f\r ]+/).filter(Ed):[]}function Dd(t,e){return qt(t,e)||(t[e]=!0),t}function Bs(t){if(!t)return[];var e=xd(t);return Object.keys(e.reduce(Dd,{}))}function Ad(t){return function(e){return t&&t.indexOf(e)!==-1}}function Us(t){if(!z.QName_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+t+'"')}function Fi(t,e){Us(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 y(y.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(r==="xml"&&t!==Ae.NAMESPACE.XML)throw new y(y.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((r==="xmlns"||e==="xmlns")&&t!==Ae.NAMESPACE.XMLNS)throw new y(y.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(t===Ae.NAMESPACE.XMLNS&&r!=="xmlns"&&e!=="xmlns")throw new y(y.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[t,r,n]}function zt(t,e){for(var r in t)qt(t,r)&&(e[r]=t[r])}function _e(t,e){var r=t.prototype;if(!(r instanceof e)){let n=function(){};n.prototype=e.prototype,n=new n,zt(r,n),t.prototype=r=n}r.constructor!=t&&(typeof t!="function"&&console.error("unknown Class:"+t),r.constructor=t)}var we={},De=we.ELEMENT_NODE=1,jt=we.ATTRIBUTE_NODE=2,Tr=we.TEXT_NODE=3,Fs=we.CDATA_SECTION_NODE=4,qs=we.ENTITY_REFERENCE_NODE=5,Td=we.ENTITY_NODE=6,qi=we.PROCESSING_INSTRUCTION_NODE=7,ji=we.COMMENT_NODE=8,Ft=we.DOCUMENT_NODE=9,js=we.DOCUMENT_TYPE_NODE=10,st=we.DOCUMENT_FRAGMENT_NODE=11,Cd=we.NOTATION_NODE=12,V=Ae.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 Vs(t,e){if(e.length<t.length)return Vs(e,t);var r=null;for(var n in t){if(t[n]!==e[n])return r;r=t[n]}return r}function Is(t){return t.guid||(t.guid=Math.random()),t.guid}function ee(){}ee.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++)Gi(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)}};ee.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 Re(t,e){this._node=t,this._refresh=e,Tn(this)}function Tn(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var r=t._refresh(t._node);if(eo(t,"length",r.length),!t.$$length||r.length<t.$$length)for(var n=r.length;n in t;n++)qt(t,n)&&delete t[n];zt(r,t),t._inc=e}}Re.prototype.item=function(t){return Tn(this),this[t]||null};_e(Re,ee);function Vt(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function zs(t,e){for(var r=0;r<t.length;){if(t[r]===e)return r;r++}}function Vi(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 Nd(t,e,r){var n=Vi(t,e,!1),i=n&&n[r];return i||null}function Sd(t,e){Vi(t,e.namespaceURI,!0)[e.localName]=e}function Od(t,e){var r=Vi(t,e.namespaceURI,!1);r&&delete r[e.localName]}function Bd(t,e,r,n){if(n?e[zs(e,n)]=r:(e[e.length]=r,e.length++),Sd(e,r),t){r.ownerElement=t;var i=t.ownerDocument;i&&(n&&Gs(i,t,n),Id(i,t,r))}}function Ms(t,e,r){var n=zs(e,r);if(n>=0){for(var i=e.length-1;n<=i;)e[n]=e[++n];if(e.length=i,Od(e,r),t){var a=t.ownerDocument;a&&Gs(a,t,r),r.ownerElement=null}}}Vt.prototype={length:0,item:ee.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 y(y.INUSE_ATTRIBUTE_ERR);var r=Nd(this,t.namespaceURI,t.localName);return r===t?t:(Bd(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 y(y.NOT_FOUND_ERR,t);return Ms(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var r=this.getNamedItemNS(t,e);if(!r)throw new y(y.NOT_FOUND_ERR,t?t+" : "+e:e);return Ms(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}};Vt.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 Hs(){}Hs.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,r){var n=Ar.XML_APPLICATION;t===Pe.HTML?n=Ar.XML_XHTML_APPLICATION:t===Pe.SVG&&(n=Ar.XML_SVG_IMAGE);var i=new He(me,{contentType:n});if(i.implementation=this,i.childNodes=new ee,i.doctype=r||null,r&&i.appendChild(r),e){var a=i.createElementNS(t,e);i.appendChild(a)}return i},createDocumentType:function(t,e,r,n){Us(t);var i=new Sn(me);return i.name=t,i.nodeName=t,i.publicId=e||"",i.systemId=r||"",i.internalSubset=n||"",i.childNodes=new ee,i},createHTMLDocument:function(t){var e=new He(me,{contentType:Ar.HTML});if(e.implementation=this,e.childNodes=new ee,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 I(t){be(t)}I.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 a=0;a<n.attributes.length;a++){var s=n.attributes.item(a),o=i.getAttributeNodeNS(s.namespaceURI,s.localName);if(!o)return!1;e.push({node:s,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 a=n.childNodes.length-1;a>=0;a--)e.push({node:n.childNodes[a],other:i.childNodes[a]})}return!0},isSameNode:function(t){return this===t},insertBefore:function(t,e){return An(this,t,e)},replaceChild:function(t,e){An(this,t,e,Zs),e&&this.removeChild(e)},removeChild:function(t){return Ys(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(t){return Qs(this.ownerDocument||this,this,t)},normalize:function(){ue(this,null,{enter:function(t){for(var e=t.firstChild;e;){var r=e.nextSibling;if(r!==null&&r.nodeType===Tr&&e.nodeType===Tr){for(var n=[],i=r;i!==null&&i.nodeType===Tr;)n.push(i.data),i=i.nextSibling;for(var a=e.nextSibling;a!==i;){var s=a.nextSibling;a.parentNode=null,a.previousSibling=null,a.nextSibling=null,a=s}e.nextSibling=i,i!==null?i.previousSibling=e:t.lastChild=e,e.appendData(n.join("")),zi(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(qt(r,n)&&r[n]===t)return n}e=e.nodeType==jt?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var r=e._nsMap;if(r&&qt(r,t))return r[t];e=e.nodeType==jt?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 wt&&(n=e,e=n.ownerElement),r instanceof wt&&(i=r,r=i.ownerElement,n&&e&&r===e))for(var a=0,s;s=r.attributes[a];a++){if(s===n)return V.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+V.DOCUMENT_POSITION_PRECEDING;if(s===i)return V.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+V.DOCUMENT_POSITION_FOLLOWING}if(!e||!r||r.ownerDocument!==e.ownerDocument)return V.DOCUMENT_POSITION_DISCONNECTED+V.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(Is(r.ownerDocument)>Is(e.ownerDocument)?V.DOCUMENT_POSITION_FOLLOWING:V.DOCUMENT_POSITION_PRECEDING);if(i&&e===r)return V.DOCUMENT_POSITION_CONTAINS+V.DOCUMENT_POSITION_PRECEDING;if(n&&e===r)return V.DOCUMENT_POSITION_CONTAINED_BY+V.DOCUMENT_POSITION_FOLLOWING;for(var o=[],l=e.parentNode;l;){if(!i&&l===r)return V.DOCUMENT_POSITION_CONTAINED_BY+V.DOCUMENT_POSITION_FOLLOWING;o.push(l),l=l.parentNode}o.reverse();for(var u=[],c=r.parentNode;c;){if(!n&&c===e)return V.DOCUMENT_POSITION_CONTAINS+V.DOCUMENT_POSITION_PRECEDING;u.push(c),c=c.parentNode}u.reverse();var d=Vs(o,u);for(var f in d.childNodes){var p=d.childNodes[f];if(p===r)return V.DOCUMENT_POSITION_FOLLOWING;if(p===e)return V.DOCUMENT_POSITION_PRECEDING;if(u.indexOf(p)>=0)return V.DOCUMENT_POSITION_FOLLOWING;if(o.indexOf(p)>=0)return V.DOCUMENT_POSITION_PRECEDING}return 0}};function Ws(t){return t=="<"&&"&lt;"||t==">"&&"&gt;"||t=="&"&&"&amp;"||t=='"'&&"&quot;"||"&#"+t.charCodeAt()+";"}zt(we,I);zt(we,I.prototype);zt(V,I);zt(V,I.prototype);function Dn(t,e){ue(t,null,{enter:function(r){return e(r)?ue.STOP:!0}})}function ue(t,e,r){for(var n=[{node:t,context:e,phase:ue.ENTER}];n.length>0;){var i=n.pop();if(i.phase===ue.ENTER){var a=r.enter(i.node,i.context);if(a===ue.STOP)return ue.STOP;if(n.push({node:i.node,context:a,phase:ue.EXIT}),a==null)continue;for(var s=i.node.lastChild;s;)n.push({node:s,context:a,phase:ue.ENTER}),s=s.previousSibling}else r.exit&&r.exit(i.node,i.context)}}ue.STOP=Symbol("walkDOM.STOP");ue.ENTER=0;ue.EXIT=1;function He(t,e){be(t);var r=e||{};this.ownerDocument=this,this.contentType=r.contentType||Ar.XML_APPLICATION,this.type=yd(this.contentType)?"html":"xml"}function Id(t,e,r){t&&t._inc++;var n=r.namespaceURI;n===Pe.XMLNS&&(e._nsMap[r.prefix?r.localName:""]=r.value)}function Gs(t,e,r,n){t&&t._inc++;var i=r.namespaceURI;i===Pe.XMLNS&&delete e._nsMap[r.prefix?r.localName:""]}function zi(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,a=0;i;)n[a++]=i,i=i.nextSibling;n.length=a,delete n[n.length]}}}function Ys(t,e){if(t!==e.parentNode)throw new y(y.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,zi(t.ownerDocument,t),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}function Md(t){return t&&(t.nodeType===I.DOCUMENT_NODE||t.nodeType===I.DOCUMENT_FRAGMENT_NODE||t.nodeType===I.ELEMENT_NODE)}function Rd(t){return t&&(t.nodeType===I.CDATA_SECTION_NODE||t.nodeType===I.COMMENT_NODE||t.nodeType===I.DOCUMENT_FRAGMENT_NODE||t.nodeType===I.DOCUMENT_TYPE_NODE||t.nodeType===I.ELEMENT_NODE||t.nodeType===I.PROCESSING_INSTRUCTION_NODE||t.nodeType===I.TEXT_NODE)}function ot(t){return t&&t.nodeType===I.DOCUMENT_TYPE_NODE}function ze(t){return t&&t.nodeType===I.ELEMENT_NODE}function Xs(t){return t&&t.nodeType===I.TEXT_NODE}function Rs(t,e){var r=t.childNodes||[];if(Le(r,ze)||ot(e))return!1;var n=Le(r,ot);return!(e&&n&&r.indexOf(n)>r.indexOf(e))}function Ls(t,e){var r=t.childNodes||[];function n(a){return ze(a)&&a!==e}if(Le(r,n))return!1;var i=Le(r,ot);return!(e&&i&&r.indexOf(i)>r.indexOf(e))}function Ld(t,e,r){if(!Md(t))throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+t.nodeType);if(r&&r.parentNode!==t)throw new y(y.NOT_FOUND_ERR,"child not in parent");if(!Rd(e)||ot(e)&&t.nodeType!==I.DOCUMENT_NODE)throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function Pd(t,e,r){var n=t.childNodes||[],i=e.childNodes||[];if(e.nodeType===I.DOCUMENT_FRAGMENT_NODE){var a=i.filter(ze);if(a.length>1||Le(i,Xs))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(a.length===1&&!Rs(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ze(e)&&!Rs(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ot(e)){if(Le(n,ot))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var s=Le(n,ze);if(r&&n.indexOf(s)<n.indexOf(r))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!r&&s)throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function Zs(t,e,r){var n=t.childNodes||[],i=e.childNodes||[];if(e.nodeType===I.DOCUMENT_FRAGMENT_NODE){var a=i.filter(ze);if(a.length>1||Le(i,Xs))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(a.length===1&&!Ls(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ze(e)&&!Ls(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ot(e)){if(Le(n,function(l){return ot(l)&&l!==r}))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var s=Le(n,ze);if(r&&n.indexOf(s)<n.indexOf(r))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function An(t,e,r,n){Ld(t,e,r),t.nodeType===I.DOCUMENT_NODE&&(n||Pd)(t,e,r);var i=e.parentNode;if(i&&i.removeChild(e),e.nodeType===st){var a=e.firstChild;if(a==null)return e;var s=e.lastChild}else a=s=e;var o=r?r.previousSibling:t.lastChild;a.previousSibling=o,s.nextSibling=r,o?o.nextSibling=a:t.firstChild=a,r==null?t.lastChild=s:r.previousSibling=s;do a.parentNode=t;while(a!==s&&(a=a.nextSibling));return zi(t.ownerDocument||t,t,e),e.nodeType==st&&(e.firstChild=e.lastChild=null),e}He.prototype={implementation:null,nodeName:"#document",nodeType:Ft,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType===st){for(var r=t.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,e),r=n}return t}return An(this,t,e),t.ownerDocument=this,this.documentElement===null&&t.nodeType===De&&(this.documentElement=t),t},removeChild:function(t){var e=Ys(this,t);return e===this.documentElement&&(this.documentElement=null),e},replaceChild:function(t,e){An(this,t,e,Zs),t.ownerDocument=this,e&&this.removeChild(e),ze(t)&&(this.documentElement=t)},importNode:function(t,e){return $d(this,t,e)},getElementById:function(t){var e=null;return Dn(this.documentElement,function(r){if(r.nodeType==De&&r.getAttribute("id")==t)return e=r,!0}),e},createElement:function(t){var e=new We(me);e.ownerDocument=this,this.type==="html"&&(t=t.toLowerCase()),wd(this.contentType)&&(e.namespaceURI=Pe.HTML),e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new ee;var r=e.attributes=new Vt;return r._ownerElement=e,e},createDocumentFragment:function(){var t=new Ht(me);return t.ownerDocument=this,t.childNodes=new ee,t},createTextNode:function(t){var e=new Cr(me);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(t),e},createComment:function(t){var e=new Cn(me);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(t),e},createCDATASection:function(t){if(t.indexOf("]]>")!==-1)throw new y(y.INVALID_CHARACTER_ERR,'data contains "]]>"');var e=new Nn(me);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(t),e},createProcessingInstruction:function(t,e){var r=new Bn(me);return r.ownerDocument=this,r.childNodes=new ee,r.nodeName=r.target=t,r.nodeValue=r.data=e,r},createAttribute:function(t){if(!z.QName_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in name "'+t+'"');return this.type==="html"&&(t=t.toLowerCase()),this._createAttribute(t)},_createAttribute:function(t){var e=new wt(me);return e.ownerDocument=this,e.childNodes=new ee,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){if(!z.Name_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'not a valid xml name "'+t+'"');if(this.type==="html")throw new y("document is an html document",fe.NotSupportedError);var e=new On(me);return e.ownerDocument=this,e.childNodes=new ee,e.nodeName=t,e},createElementNS:function(t,e){var r=Fi(t,e),n=new We(me),i=n.attributes=new Vt;return n.childNodes=new ee,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 wt(me);return n.ownerDocument=this,n.childNodes=new ee,n.nodeName=e,n.name=e,n.specified=!0,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],n}};_e(He,I);function We(t){be(t),this._nsMap=Object.create(null)}We.prototype={nodeType:De,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type==="html"&&this.namespaceURI===Pe.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],a=this.getAttributeNodeNS(t,i);a?a.value=a.nodeValue=""+r:(a=this.ownerDocument.createAttributeNS(t,e),a.value=a.nodeValue=""+r,this.setAttributeNode(a))},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByClassName:function(t){var e=Bs(t);return new Re(this,function(r){var n=[];return e.length>0&&Dn(r,function(i){if(i!==r&&i.nodeType===De){var a=i.getAttribute("class");if(a){var s=t===a;if(!s){var o=Bs(a);s=e.every(Ad(o))}s&&n.push(i)}}}),n})},getElementsByTagName:function(t){var e=(this.nodeType===Ft?this:this.ownerDocument).type==="html",r=t.toLowerCase();return new Re(this,function(n){var i=[];return Dn(n,function(a){if(!(a===n||a.nodeType!==De))if(t==="*")i.push(a);else{var s=a.getQualifiedName(),o=e&&a.namespaceURI===Pe.HTML?r:t;s===o&&i.push(a)}}),i})},getElementsByTagNameNS:function(t,e){return new Re(this,function(r){var n=[];return Dn(r,function(i){i!==r&&i.nodeType===De&&(t==="*"||i.namespaceURI===t)&&(e==="*"||i.localName==e)&&n.push(i)}),n})}};He.prototype.getElementsByClassName=We.prototype.getElementsByClassName;He.prototype.getElementsByTagName=We.prototype.getElementsByTagName;He.prototype.getElementsByTagNameNS=We.prototype.getElementsByTagNameNS;_e(We,I);function wt(t){be(t),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}wt.prototype.nodeType=jt;_e(wt,I);function lt(t){be(t)}lt.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}};_e(lt,I);function Cr(t){be(t)}Cr.prototype={nodeName:"#text",nodeType:Tr,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}};_e(Cr,lt);function Cn(t){be(t)}Cn.prototype={nodeName:"#comment",nodeType:ji};_e(Cn,lt);function Nn(t){be(t)}Nn.prototype={nodeName:"#cdata-section",nodeType:Fs};_e(Nn,Cr);function Sn(t){be(t)}Sn.prototype.nodeType=js;_e(Sn,I);function Hi(t){be(t)}Hi.prototype.nodeType=Cd;_e(Hi,I);function Wi(t){be(t)}Wi.prototype.nodeType=Td;_e(Wi,I);function On(t){be(t)}On.prototype.nodeType=qs;_e(On,I);function Ht(t){be(t)}Ht.prototype.nodeName="#document-fragment";Ht.prototype.nodeType=st;_e(Ht,I);function Bn(t){be(t)}Bn.prototype.nodeType=qi;_e(Bn,lt);function Js(){}Js.prototype.serializeToString=function(t,e){return Ks.call(t,e)};I.prototype.toString=Ks;function Ks(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===Ft&&this.documentElement||this,i=n.prefix,a=n.namespaceURI;if(a&&i==null){var i=n.lookupPrefix(a);if(i==null)var s=[{namespace:a,prefix:null}]}return Gi(this,r,s,e),r.join("")}function Ps(t,e,r){var n=t.prefix||"",i=t.namespaceURI;if(!i||n==="xml"&&i===Pe.XML||i===Pe.XMLNS)return!1;for(var a=r.length;a--;){var s=r[a];if(s.prefix===n)return s.namespace!==i}return!0}function xn(t,e,r,n){if(n&&!z.QName_exact.test(e))throw new y('The attribute name "'+e+'" is not a valid XML QName',fe.InvalidStateError);t.push(" ",e,'="',r.replace(/[<>&"\t\n\r]/g,Ws),'"')}function Gi(t,e,r,n){r||(r=[]);var i=n.nodeFilter,a=n.requireWellFormed,s=n.splitCDATASections,o=t.nodeType===Ft?t:t.ownerDocument,l=o.type==="html";ue(t,{ns:r},{enter:function(u,c){var d=c.ns;if(i)if(u=i(u),u){if(typeof u=="string")return e.push(u),null}else return null;switch(u.nodeType){case De:var f=u.attributes,p=f.length,h=u.tagName,m=h;if(!l&&!u.prefix&&u.namespaceURI){for(var g,_=0;_<f.length;_++)if(f.item(_).name==="xmlns"){g=f.item(_).value;break}if(!g)for(var v=d.length-1;v>=0;v--){var w=d[v];if(w.prefix===""&&w.namespace===u.namespaceURI){g=w.namespace;break}}if(g!==u.namespaceURI)for(var v=d.length-1;v>=0;v--){var w=d[v];if(w.namespace===u.namespaceURI){w.prefix&&(m=w.prefix+":"+h);break}}}if(a&&!z.QName_exact.test(m))throw new y('The element name "'+m+'" is not a valid XML QName',fe.InvalidStateError);e.push("<",m);for(var x=d.slice(),B=0;B<p;B++){var L=f.item(B);L.prefix=="xmlns"?x.push({prefix:L.localName,namespace:L.value}):L.nodeName=="xmlns"&&x.push({prefix:"",namespace:L.value})}for(var B=0;B<p;B++){var L=f.item(B);if(Ps(L,l,x)){var Z=L.prefix||"",ie=L.namespaceURI;xn(e,Z?"xmlns:"+Z:"xmlns",ie,a),x.push({prefix:Z,namespace:ie})}var ae=i?i(L):L;ae&&(typeof ae=="string"?e.push(ae):xn(e,ae.name,ae.value,a))}if(h===m&&Ps(u,l,x)){var je=u.prefix||"",ie=u.namespaceURI;xn(e,je?"xmlns:"+je:"xmlns",ie,a),x.push({prefix:je,namespace:ie})}var K=!u.firstChild;if(K&&(l||u.namespaceURI===Pe.HTML)&&(K=kd(h)),K)return e.push("/>"),null;if(e.push(">"),l&&vd(h)){for(var he=u.firstChild;he;)he.data?e.push(he.data):Gi(he,e,x.slice(),n),he=he.nextSibling;return e.push("</",m,">"),null}return{ns:x,tag:m};case Ft:case st:if(a&&u.nodeType===Ft&&u.documentElement==null)throw new y("The Document has no documentElement",fe.InvalidStateError);return{ns:d};case jt:return xn(e,u.name,u.value,a),null;case Tr:if(a&&z.InvalidChar.test(u.data))throw new y("The Text node data contains characters outside the XML Char production",fe.InvalidStateError);return e.push(u.data.replace(/[<&>]/g,Ws)),null;case Fs:if(a&&u.data.indexOf("]]>")!==-1)throw new y('The CDATASection data contains "]]>"',fe.InvalidStateError);return s?e.push(z.CDATA_START,u.data.replace(/]]>/g,"]]]]><![CDATA[>"),z.CDATA_END):e.push(z.CDATA_START,u.data,z.CDATA_END),null;case ji:if(a){if(z.InvalidChar.test(u.data))throw new y("The comment node data contains characters outside the XML Char production",fe.InvalidStateError);if(u.data.indexOf("--")!==-1||u.data[u.data.length-1]==="-")throw new y('The comment node data contains "--" or ends with "-"',fe.InvalidStateError)}return e.push(z.COMMENT_START,u.data,z.COMMENT_END),null;case js:var Ee=u.publicId,F=u.systemId;if(a){if(!z.Name_exact.test(u.name))throw new y('The doctype name "'+u.name+'" is not a valid XML Name',fe.InvalidStateError);if(Ee&&!z.PubidLiteral_match.test(Ee))throw new y("DocumentType publicId is not a valid PubidLiteral",fe.InvalidStateError);if(F&&F!=="."&&!z.SystemLiteral_match.test(F))throw new y("DocumentType systemId is not a valid SystemLiteral",fe.InvalidStateError);if(u.internalSubset&&u.internalSubset.indexOf("]>")!==-1)throw new y('DocumentType internalSubset contains "]>"',fe.InvalidStateError)}return e.push(z.DOCTYPE_DECL_START," ",u.name),Ee?(e.push(" ",z.PUBLIC," ",Ee),F&&F!=="."&&e.push(" ",F)):F&&F!=="."&&e.push(" ",z.SYSTEM," ",F),u.internalSubset&&e.push(" [",u.internalSubset,"]"),e.push(">"),null;case qi:if(a){if(!z.NCName_exact.test(u.target)||u.target.toLowerCase()==="xml")throw new y('The processing instruction target "'+u.target+'" is not a valid XML NCName or is reserved',fe.InvalidStateError);if(z.InvalidChar.test(u.data))throw new y("The ProcessingInstruction data contains characters outside the XML Char production",fe.InvalidStateError);if(u.data.indexOf("?>")!==-1)throw new y('The ProcessingInstruction data contains "?>"',fe.InvalidStateError)}return e.push("<?",u.target," ",u.data,"?>"),null;case qs:if(a&&!z.Name_exact.test(u.nodeName))throw new y('The entity reference name "'+u.nodeName+'" is not a valid XML Name',fe.InvalidStateError);return e.push("&",u.nodeName,";"),null;default:return e.push("??",u.nodeName),null}},exit:function(u,c){c&&c.tag&&e.push("</",c.tag,">")}})}function $d(t,e,r){var n;return ue(e,null,{enter:function(i,a){var s=i.cloneNode(!1);s.ownerDocument=t,s.parentNode=null,a===null?n=s:a.appendChild(s);var o=i.nodeType===jt||r;return o?s:null}}),n}function Qs(t,e,r){var n;return ue(e,null,{enter:function(i,a){var s=new i.constructor(me);for(var o in i)if(qt(i,o)){var l=i[o];typeof l!="object"&&l!=s[o]&&(s[o]=l)}i.childNodes&&(s.childNodes=new ee),s.ownerDocument=t;var u=r;switch(s.nodeType){case De:var c=i.attributes,d=s.attributes=new Vt,f=c.length;d._ownerElement=s;for(var p=0;p<f;p++)s.setAttributeNode(Qs(t,c.item(p),!0));break;case jt:u=!0}return a!==null?a.appendChild(s):n=s,u?s:null}}),n}function eo(t,e,r){t[e]=r}function Ui(t){for(var e=[],r=t.firstChild;r;)r.nodeType===De&&e.push(r),r=r.nextSibling;return e}try{Object.defineProperty&&(Object.defineProperty(Re.prototype,"length",{get:function(){return Tn(this),this.$$length}}),Object.defineProperty(I.prototype,"textContent",{get:function(){if(this.nodeType===De||this.nodeType===st){var t=[];return ue(this,null,{enter:function(e){if(e.nodeType===De||e.nodeType===st)return!0;if(e.nodeType===qi||e.nodeType===ji)return null;t.push(e.nodeValue)}}),t.join("")}return this.nodeValue},set:function(t){switch(this.nodeType){case De:case st: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(lt.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(lt.prototype,"nodeValue",{get:function(){return this.data},set:function(t){this.data=t},enumerable:!0,configurable:!0}),Object.defineProperty(We.prototype,"children",{get:function(){return new Re(this,Ui)}}),Object.defineProperty(He.prototype,"children",{get:function(){return new Re(this,Ui)}}),Object.defineProperty(Ht.prototype,"children",{get:function(){return new Re(this,Ui)}}),eo=function(t,e,r){t["$$"+e]=r})}catch{}H._updateLiveList=Tn;H.Attr=wt;H.CDATASection=Nn;H.CharacterData=lt;H.Comment=Cn;H.Document=He;H.DocumentFragment=Ht;H.DocumentType=Sn;H.DOMImplementation=Hs;H.Element=We;H.Entity=Wi;H.EntityReference=On;H.LiveNodeList=Re;H.NamedNodeMap=Vt;H.Node=I;H.NodeList=ee;H.Notation=Hi;H.Text=Cr;H.ProcessingInstruction=Bn;H.walkDOM=ue;H.XMLSerializer=Js});var ro=Je(Nr=>{"use strict";var to=_t().freeze;Nr.XML_ENTITIES=to({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Nr.HTML_ENTITIES=to({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"});Nr.entityMap=Nr.HTML_ENTITIES});var fo=Je(Mn=>{"use strict";var Zt=_t(),N=$i(),so=yr(),Ud=Zt.isHTMLEscapableRawTextElement,Fd=Zt.isHTMLMimeType,qd=Zt.isHTMLRawTextElement,Br=Zt.hasOwn,no=Zt.NAMESPACE,jd=so.ParseError,Vd=so.DOMException,Wt=0,ut=1,Gt=2,Sr=3,Yt=4,Xt=5,Or=6,In=7;function oo(){}oo.prototype={parse:function(t,e,r){var n=this.domBuilder;n.startDocument(),Gd(e,e=Object.create(null)),zd(t,e,r,n,this.errorHandler),n.endDocument()}};var Xi=/&#?\w+;?/g;function zd(t,e,r,n,i){var a=Fd(n.mimeType);t.indexOf(N.UNICODE_REPLACEMENT_CHARACTER)>=0&&i.warning("Unicode replacement character detected, source encoding issues?");function s(R){if(R>65535){R-=65536;var xe=55296+(R>>10),tn=56320+(R&1023);return String.fromCharCode(xe,tn)}else return String.fromCharCode(R)}function o(R){var xe=R[R.length-1]===";"?R:R+";";if(!a&&xe!==R)return i.error("EntityRef: expecting ;"),R;var tn=N.Reference.exec(xe);if(!tn||tn[0].length!==xe.length)return i.error("entity not matching Reference production: "+R),R;var rn=xe.slice(1,-1);return Br(r,rn)?r[rn]:rn.charAt(0)==="#"?s(parseInt(rn.substring(1).replace("x","0x"))):(i.error("entity not found:"+R),R)}function l(R){if(R>g){var xe=t.substring(g,R).replace(Xi,o);f&&p(g),n.characters(xe,0,R-g),g=R}}var u=0,c=0,d=/\r\n?|\n|$/g,f=n.locator;function p(R,xe){for(;R>=c&&(xe=d.exec(t));)u=c,c=xe.index+xe[0].length,f.lineNumber++;f.columnNumber=R-u+1}for(var h=[{currentNSMap:e}],m=[],g=0;;){try{var _=t.indexOf("<",g);if(_<0){if(!a&&m.length>0)return i.fatalError("unclosed xml tag(s): "+m.join(", "));if(!t.substring(g).match(/^\s*$/)){var v=n.doc,w=v.createTextNode(t.substring(g));if(v.documentElement)return i.error("Extra content at the end of the document");v.appendChild(w),n.currentElement=w}return}if(_>g){var x=t.substring(g,_);!a&&m.length===0&&(x=x.replace(new RegExp(N.S_OPT.source,"g"),""),x&&i.error("Unexpected content outside root element: '"+x+"'")),l(_)}switch(t.charAt(_+1)){case"/":var S=t.indexOf(">",_+2),B=t.substring(_+2,S>0?S:void 0);if(!B)return i.fatalError("end tag name missing");var L=N.reg("^",N.QName_group,N.S_OPT,"$"),Z=S>0&&L.exec(B);if(!Z){var ie=S>0&&N.reg("^",N.QName_group).exec(B);if(a&&ie)i.warning('end tag name contains invalid trailing characters: "'+B+'"'),Z=ie;else if(ie&&new RegExp(L.source,L.flags+"m").test(B))i.error('end tag name is followed by a line break and trailing content: "'+B+'"'),Z=ie;else return i.fatalError('end tag name contains invalid characters: "'+B+'"')}if(!n.currentElement&&!n.doc.documentElement)return;var ae=m[m.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(ae!==Z[1]){var je=Z[1].toLowerCase();if(!a||ae.toLowerCase()!==je)return i.fatalError('Opening and ending tag mismatch: "'+ae+'" != "'+B+'"')}var K=h.pop();m.pop();var he=K.localNSMap;if(n.endElement(K.uri,K.localName,ae),he)for(var Ee in he)Br(he,Ee)&&n.endPrefixMapping(Ee);S++;break;case"?":f&&p(_),S=Xd(t,_,n,i);break;case"!":f&&p(_),S=uo(t,_,n,i,a);break;default:f&&p(_);var F=new co,J=h[h.length-1].currentNSMap,S=Hd(t,_,F,J,o,i,a),Oa=F.length;if(F.closed||(a&&Zt.isHTMLVoidElement(F.tagName)?F.closed=!0:m.push(F.tagName)),f&&Oa){for(var Ml=io(f,{}),oi=0;oi<Oa;oi++){var Ba=F[oi];p(Ba.offset),Ba.locator=io(f,{})}n.locator=Ml,ao(F,n,J)&&h.push(F),n.locator=f}else ao(F,n,J)&&h.push(F);a&&!F.closed?S=Wd(t,S,F.tagName,o,n):S++}}catch(R){if(R instanceof jd)throw R;if(R instanceof Vd)return i.fatalError("Error constructing the DOM: "+R.name+": "+R.message,R);i.error("element parse error: "+R),S=-1}S>g?g=S:l(Math.max(_,g)+1)}}function io(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function Hd(t,e,r,n,i,a,s){function o(p,h,m){if(Br(r.attributeNames,p))return a.fatalError("Attribute "+p+" redefined");if(!s&&h.indexOf("<")>=0)return a.fatalError("Unescaped '<' not allowed in attributes values");r.addValue(p,h.replace(/[\t\n\r]/g," ").replace(Xi,i),m)}for(var l,u,c=++e,d=Wt;;){var f=t.charAt(c);if(d===Wt&&f==="<")throw new Error("unexpected < in tag name: "+t.slice(e,c));switch(f){case"=":if(d===ut)l=t.slice(e,c),d=Sr;else if(d===Gt)d=Sr;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(d===Sr||d===ut)if(d===ut&&(a.warning('attribute value must after "="'),l=t.slice(e,c)),e=c+1,c=t.indexOf(f,e),c>0)u=t.slice(e,c),o(l,u,e-1),d=Xt;else throw new Error("attribute value no end '"+f+"' match");else if(d==Yt)u=t.slice(e,c),o(l,u,e),a.warning('attribute "'+l+'" missed start quot('+f+")!!"),e=c+1,d=Xt;else throw new Error('attribute value must after "="');break;case"/":switch(d){case Wt:r.setTagName(t.slice(e,c));case Xt:case Or:case In:d=In,r.closed=!0;case Yt:case ut:break;case Gt:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),d==Wt&&r.setTagName(t.slice(e,c)),c;case">":switch(d){case Wt:r.setTagName(t.slice(e,c));case Xt:case Or:case In:break;case Yt:case ut:u=t.slice(e,c),u.slice(-1)==="/"&&(r.closed=!0,u=u.slice(0,-1));case Gt:d===Gt&&(u=l),d==Yt?(a.warning('attribute "'+u+'" missed quot(")!'),o(l,u,e)):(s||a.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,e));break;case Sr:if(!s)return a.fatalError(`AttValue: ' or " expected`)}return c;case"\x80":f=" ";default:if(f<=" ")switch(d){case Wt:r.setTagName(t.slice(e,c)),d=Or;break;case ut:l=t.slice(e,c),d=Gt;break;case Yt:var u=t.slice(e,c);a.warning('attribute "'+u+'" missed quot(")!!'),o(l,u,e);case Xt:d=Or;break}else switch(d){case Gt:s||a.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,e),e=c,d=ut;break;case Xt:a.warning('attribute space is required"'+l+'"!!');case Or:d=ut,e=c;break;case Sr:d=Yt,e=c;break;case In:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function ao(t,e,r){for(var n=t.tagName,i=null,d=t.length;d--;){var a=t[d],s=a.qName,o=a.value,f=s.indexOf(":");if(f>0)var l=a.prefix=s.slice(0,f),u=s.slice(f+1),c=l==="xmlns"&&u;else u=s,l=null,c=s==="xmlns"&&"";a.localName=u,c!==!1&&(i==null&&(i=Object.create(null),r=Object.create(r)),r[c]=i[c]=o,a.uri=no.XMLNS,e.startPrefixMapping(c,o))}for(var d=t.length;d--;)a=t[d],a.prefix&&(a.prefix==="xml"&&(a.uri=no.XML),a.prefix!=="xmlns"&&(a.uri=r[a.prefix]));var f=n.indexOf(":");f>0?(l=t.prefix=n.slice(0,f),u=t.localName=n.slice(f+1)):(l=null,u=t.localName=n);var p=t.uri=r[l||""];if(e.startElement(p,u,n,t),t.closed){if(e.endElement(p,u,n),i)for(l in i)Br(i,l)&&e.endPrefixMapping(l)}else return t.currentNSMap=r,t.localNSMap=i,!0}function Wd(t,e,r,n,i){var a=Ud(r);if(a||qd(r)){var s=new RegExp("</"+r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+">","ig");s.lastIndex=e;var o=s.exec(t),l=o?o.index:-1;if(l<0)return e+1;var u=t.substring(e+1,l);return a&&(u=u.replace(Xi,n)),i.characters(u,0,u.length),l}return e+1}function Gd(t,e){for(var r in t)Br(t,r)&&(e[r]=t[r])}function lo(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 a(){for(var c=0;r<t.length;){var d=n();if(d!==" "&&d!==`
3
- `&&d!==" "&&d!=="\r")return c;c++,i()}return-1}function s(){return t.substring(r)}function o(c){return t.substring(r,r+c.length)===c}function l(c){return t.substring(r,r+c.length).toUpperCase()===c.toUpperCase()}function u(c){var d=N.reg("^",c),f=d.exec(s());return f?(i(f[0].length),f[0]):null}return{char:n,getIndex:function(){return r},getMatch:u,getSource:function(){return t},skip:i,skipBlanks:a,substringFromIndex:s,substringStartsWith:o,substringStartsWithCaseInsensitive:l}}function Yd(t,e){function r(o,l){var u=N.PI.exec(o.substringFromIndex());return u?u[1].toLowerCase()==="xml"?l.fatalError("xml declaration is only allowed at the start of the document, but found at position "+o.getIndex()):(o.skip(u[0].length),u[0]):l.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 a=n.substring(i,t.getIndex());return t.skip(1),a}var s=null;if(t.char()==="<"&&t.char(1)==="!")switch(t.char(2)){case"E":t.char(3)==="L"?s=t.getMatch(N.elementdecl):t.char(3)==="N"&&(s=t.getMatch(N.EntityDecl));break;case"A":s=t.getMatch(N.AttlistDecl);break;case"N":s=t.getMatch(N.NotationDecl);break;case"-":s=t.getMatch(N.Comment);break}else if(t.char()==="<"&&t.char(1)==="?")s=r(t,e);else if(t.char()==="%")s=t.getMatch(N.PEReference);else return e.fatalError("Error detected in Markup declaration");if(!s)return e.fatalError("Error in internal subset at position "+t.getIndex())}return e.fatalError("doctype internal subset is not well-formed, missing ]")}}function uo(t,e,r,n,i){var a=lo(t,e);switch(i?a.char(2).toUpperCase():a.char(2)){case"-":var s=a.getMatch(N.Comment);return s?(r.comment(s,N.COMMENT_START.length,s.length-N.COMMENT_START.length-N.COMMENT_END.length),a.getIndex()):n.fatalError("comment is not well-formed at position "+a.getIndex());case"[":var o=a.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(),a.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 "+a.getIndex());if(i?!a.substringStartsWithCaseInsensitive(N.DOCTYPE_DECL_START):!a.substringStartsWith(N.DOCTYPE_DECL_START))return n.fatalError("Expected "+N.DOCTYPE_DECL_START+" at position "+a.getIndex());if(a.skip(N.DOCTYPE_DECL_START.length),a.skipBlanks()<1)return n.fatalError("Expected whitespace after "+N.DOCTYPE_DECL_START+" at position "+a.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=a.getMatch(N.Name),!l.name)return n.fatalError("doctype name missing or contains unexpected characters at position "+a.getIndex());if(i&&l.name.toLowerCase()!=="html"&&n.warning("Unexpected DOCTYPE in HTML document at position "+a.getIndex()),a.skipBlanks(),a.substringStartsWith(N.PUBLIC)||a.substringStartsWith(N.SYSTEM)){var u=N.ExternalID_match.exec(a.substringFromIndex());if(!u)return n.fatalError("doctype external id is not well-formed at position "+a.getIndex());u.groups.SystemLiteralOnly!==void 0?l.systemId=u.groups.SystemLiteralOnly:(l.systemId=u.groups.SystemLiteral,l.publicId=u.groups.PubidLiteral),a.skip(u[0].length)}else if(i&&a.substringStartsWithCaseInsensitive(N.SYSTEM)){if(a.skip(N.SYSTEM.length),a.skipBlanks()<1)return n.fatalError("Expected whitespace after "+N.SYSTEM+" at position "+a.getIndex());if(l.systemId=a.getMatch(N.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return n.fatalError("Expected "+N.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+N.SYSTEM+" at position "+a.getIndex())}return i&&l.systemId&&!N.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&n.warning("Unexpected doctype.systemId in HTML document at position "+a.getIndex()),i||(a.skipBlanks(),l.internalSubset=Yd(a,n)),a.skipBlanks(),a.char()!==">"?n.fatalError("doctype not terminated with > at position "+a.getIndex()):(a.skip(1),r.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),r.endDTD(),a.getIndex())}default:return n.fatalError('Not well-formed XML starting with "<!" at position '+e)}}function Xd(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 co(){this.attributeNames=Object.create(null)}co.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}};Mn.XMLReader=oo;Mn.parseUtils=lo;Mn.parseDoctypeCommentOrCData=uo});var wo=Je(Kt=>{"use strict";var yt=_t(),Zd=Yi(),Jd=yr(),po=ro(),Kd=fo(),Qd=Zd.DOMImplementation,ef=yt.hasDefaultHTMLNamespace,tf=yt.isHTMLMimeType,rf=yt.isValidMimeType,go=yt.MIME_TYPE,Zi=yt.NAMESPACE,ho=Jd.ParseError,nf=Kd.XMLReader;function bo(t){return t.replace(/\r[\n\u0085]/g,`
1
+ var Pl=Object.create;var ui=Object.defineProperty;var $l=Object.getOwnPropertyDescriptor;var Ul=Object.getOwnPropertyNames;var Fl=Object.getPrototypeOf,ql=Object.prototype.hasOwnProperty;var Je=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ma=(t,e)=>{for(var r in e)ui(t,r,{get:e[r],enumerable:!0})},li=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ul(e))!ql.call(t,i)&&i!==r&&ui(t,i,{get:()=>e[i],enumerable:!(n=$l(e,i))||n.enumerable});return t},nn=(t,e,r)=>(li(t,e,"default"),r&&li(r,e,"default")),Ra=(t,e,r)=>(r=t!=null?Pl(Fl(t)):{},li(e||!t||!t.__esModule?ui(r,"default",{value:t,enumerable:!0}):r,t));var _t=Je(le=>{"use strict";function dc(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(bt(t,n)){var i=t[n];if(e.call(void 0,i,n,t))return i}}function Lt(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 bt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function fc(t,e){if(t===null||typeof t!="object")throw new TypeError("target is not an object");for(var r in e)bt(e,r)&&(t[r]=e[r]);return t}var gs=Lt({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 pc(t){return bt(gs,t.toLowerCase())}var bs=Lt({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 hc(t){return bt(bs,t.toLowerCase())}var hr=Lt({script:!1,style:!1,textarea:!0,title:!0});function mc(t){var e=t.toLowerCase();return bt(hr,e)&&!hr[e]}function gc(t){var e=t.toLowerCase();return bt(hr,e)&&hr[e]}function _s(t){return t===mr.HTML}function bc(t){return _s(t)||t===mr.XML_XHTML_APPLICATION}var mr=Lt({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),_c=Object.keys(mr).map(function(t){return mr[t]});function wc(t){return _c.indexOf(t)>-1}var yc=Lt({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/"});le.assign=fc;le.find=dc;le.freeze=Lt;le.HTML_BOOLEAN_ATTRIBUTES=gs;le.HTML_RAW_TEXT_ELEMENTS=hr;le.HTML_VOID_ELEMENTS=bs;le.hasDefaultHTMLNamespace=bc;le.hasOwn=bt;le.isHTMLBooleanAttribute=pc;le.isHTMLRawTextElement=mc;le.isHTMLEscapableRawTextElement=gc;le.isHTMLMimeType=_s;le.isHTMLVoidElement=hc;le.isValidMimeType=wc;le.MIME_TYPE=mr;le.NAMESPACE=yc});var yr=Je(wr=>{"use strict";var vc=_t();function ys(t,e){t.prototype=Object.create(Error.prototype,{constructor:{value:t},name:{value:t.name,enumerable:!0,writable:e}})}var br=vc.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"}),vs=Object.keys(br);function ks(t){return typeof t=="number"&&t>=1&&t<=25}function kc(t){return typeof t=="string"&&t.substring(t.length-br.Error.length)===br.Error}function _r(t,e){ks(t)?(this.name=vs[t],this.message=e||""):(this.message=t,this.name=kc(e)?e:br.Error),Error.captureStackTrace&&Error.captureStackTrace(this,_r)}ys(_r,!0);Object.defineProperties(_r.prototype,{code:{enumerable:!0,get:function(){var t=vs.indexOf(this.name);return ks(t)?t:0}}});var Es={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},Oi=Object.entries(Es);for(gr=0;gr<Oi.length;gr++)ws=Oi[gr][0],_r[ws]=Oi[gr][1];var ws,gr;function Bi(t,e,r){this.message=t,this.locator=e,this.cause=r,Error.captureStackTrace&&Error.captureStackTrace(this,Bi)}ys(Bi);wr.DOMException=_r;wr.DOMExceptionName=br;wr.ExceptionCode=Es;wr.ParseError=Bi});var Ui=Je(C=>{"use strict";function Ns(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 Ut=Ns();function it(t){if(t.source[0]!=="[")throw new Error(t+" can not be used with chars");return t.source.slice(1,t.source.lastIndexOf("]"))}function Pt(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,""),Ut?"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(""),Ut?"u":"")}function A(t){if(arguments.length===0)throw new Error("no parameters provided");return O.apply(A,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var Ec="\uFFFD",at=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;Ut&&(at=O("[",it(at),"\\u{10000}-\\u{10FFFF}","]"));var xc=new RegExp("[^"+it(at)+"]",Ut?"u":""),vn=/[\x20\x09\x0D\x0A]/,Dc=it(vn),U=O(vn,"+"),j=O(vn,"*"),vr=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;Ut&&(vr=O("[",it(vr),"\\u{10000}-\\u{10FFFF}","]"));var Ac=it(vr),Ri=O("[",Ac,it(/[-.0-9\xB7]/),it(/[\u0300-\u036F\u203F-\u2040]/),"]"),ye=O(vr,Ri,"*"),Tc=O("^",ye,"$"),xs=O(Ri,"+"),Cc=O("&",ye,";"),Nc=A(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),kr=A(Cc,"|",Nc),Er=O("%",ye,";"),Li=A(O('"',A(/[^%&"]/,"|",Er,"|",kr),"*",'"'),"|",O("'",A(/[^%&']/,"|",Er,"|",kr),"*","'")),Sc=A('"',A(/[^<&"]/,"|",kr),"*",'"',"|","'",A(/[^<&']/,"|",kr),"*","'"),Oc=Pt(vr,":"),Bc=Pt(Ri,":"),Ii=O(Oc,Bc,"*"),Ic=O("^",Ii,"$"),xr=O(Ii,A(":",Ii),"?"),Mc=O("^",xr,"$"),Rc=O("(",xr,")"),$t=A(/"[^"]*"|'[^']*'/),Lc=O(/^<\?/,"(",ye,")",A(U,"(?!",vn,")(",at,"*?)"),"?",/\?>/),Ds=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Dr=A('"',Ds,'*"',"|","'",Pt(Ds,"'"),"*'"),Ss="<!--",Os="-->",Pc=O(Ss,A(Pt(at,"-"),"|",O("-",Pt(at,"-"))),"*",Os),As="#PCDATA",$c=A(O(/\(/,j,As,A(j,/\|/,j,xr),"*",j,/\)\*/),"|",O(/\(/,j,As,j,/\)/)),Uc=/[?*+]?/,Fc=O(/\([^>]+\)/,Uc),qc=A("EMPTY","|","ANY","|",$c,"|",Fc),jc="<!ELEMENT",Vc=O(jc,U,A(xr,"|",Er),U,A(qc,"|",Er),j,">"),zc=O("NOTATION",U,/\(/,j,ye,A(j,/\|/,j,ye),"*",j,/\)/),Hc=O(/\(/,j,xs,A(j,/\|/,j,xs),"*",j,/\)/),Wc=A(zc,"|",Hc),Gc=A(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",Wc),Yc=A(/#REQUIRED|#IMPLIED/,"|",A(A("#FIXED",U),"?",Sc)),Xc=A(U,ye,U,Gc,U,Yc),Zc="<!ATTLIST",Jc=O(Zc,U,ye,Xc,"*",j,">"),Mi="about:legacy-compat",Kc=A('"'+Mi+'"',"|","'"+Mi+"'"),Pi="SYSTEM",kn="PUBLIC",En=A(A(Pi,U,$t),"|",A(kn,U,Dr,U,$t)),Qc=O("^",A(A(Pi,U,"(?<SystemLiteralOnly>",$t,")"),"|",A(kn,U,"(?<PubidLiteral>",Dr,")",U,"(?<SystemLiteral>",$t,")"))),ed=O("^",Dr,"$"),td=O("^",$t,"$"),rd=A(U,"NDATA",U,ye),nd=A(Li,"|",A(En,rd,"?")),Bs="<!ENTITY",id=O(Bs,U,ye,U,nd,j,">"),ad=A(Li,"|",En),sd=O(Bs,U,"%",U,ye,U,ad,j,">"),od=A(id,"|",sd),ld=O(kn,U,Dr),ud=O("<!NOTATION",U,ye,U,A(En,"|",ld),j,">"),$i=O(j,"=",j),Ts=/1[.]\d+/,cd=O(U,"version",$i,A("'",Ts,"'","|",'"',Ts,'"')),Cs=/[A-Za-z][-A-Za-z0-9._]*/,dd=A(U,"encoding",$i,A('"',Cs,'"',"|","'",Cs,"'")),fd=A(U,"standalone",$i,A("'",A("yes","|","no"),"'","|",'"',A("yes","|","no"),'"')),pd=O(/^<\?xml/,cd,dd,"?",fd,"?",j,/\?>/),hd="<!DOCTYPE",md="<![CDATA[",gd="]]>",bd=/<!\[CDATA\[/,_d=/\]\]>/,wd=O(at,"*?",_d),yd=O(bd,wd);C.chars=it;C.chars_without=Pt;C.detectUnicodeSupport=Ns;C.reg=O;C.regg=A;C.ABOUT_LEGACY_COMPAT=Mi;C.ABOUT_LEGACY_COMPAT_SystemLiteral=Kc;C.AttlistDecl=Jc;C.CDATA_START=md;C.CDATA_END=gd;C.CDSect=yd;C.Char=at;C.Comment=Pc;C.COMMENT_START=Ss;C.COMMENT_END=Os;C.DOCTYPE_DECL_START=hd;C.elementdecl=Vc;C.EntityDecl=od;C.EntityValue=Li;C.ExternalID=En;C.ExternalID_match=Qc;C.Name=ye;C.Name_exact=Tc;C.NCName_exact=Ic;C.NotationDecl=ud;C.Reference=kr;C.PEReference=Er;C.PI=Lc;C.PUBLIC=kn;C.PubidLiteral=Dr;C.PubidLiteral_match=ed;C.QName=xr;C.QName_exact=Mc;C.QName_group=Rc;C.S=U;C.SChar_s=Dc;C.S_OPT=j;C.SYSTEM=Pi;C.SystemLiteral=$t;C.SystemLiteral_match=td;C.InvalidChar=xc;C.UNICODE_REPLACEMENT_CHARACTER=Ec;C.UNICODE_SUPPORT=Ut;C.XMLDecl=pd});var Xi=Je(H=>{"use strict";var Ae=_t(),Le=Ae.find,vd=Ae.hasDefaultHTMLNamespace,qt=Ae.hasOwn,kd=Ae.isHTMLMimeType,Ed=Ae.isHTMLRawTextElement,xd=Ae.isHTMLVoidElement,Ar=Ae.MIME_TYPE,Pe=Ae.NAMESPACE,me=Symbol(),Us=yr(),y=Us.DOMException,fe=Us.DOMExceptionName,z=Ui();function be(t){if(t!==me)throw new TypeError("Illegal constructor")}function Dd(t){return t!==""}function Ad(t){return t?t.split(/[\t\n\f\r ]+/).filter(Dd):[]}function Td(t,e){return qt(t,e)||(t[e]=!0),t}function Is(t){if(!t)return[];var e=Ad(t);return Object.keys(e.reduce(Td,{}))}function Cd(t){return function(e){return t&&t.indexOf(e)!==-1}}function Fs(t){if(!z.QName_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+t+'"')}function qi(t,e){Fs(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 y(y.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(r==="xml"&&t!==Ae.NAMESPACE.XML)throw new y(y.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((r==="xmlns"||e==="xmlns")&&t!==Ae.NAMESPACE.XMLNS)throw new y(y.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(t===Ae.NAMESPACE.XMLNS&&r!=="xmlns"&&e!=="xmlns")throw new y(y.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[t,r,n]}function zt(t,e){for(var r in t)qt(t,r)&&(e[r]=t[r])}function _e(t,e){var r=t.prototype;if(!(r instanceof e)){let n=function(){};n.prototype=e.prototype,n=new n,zt(r,n),t.prototype=r=n}r.constructor!=t&&(typeof t!="function"&&console.error("unknown Class:"+t),r.constructor=t)}var we={},De=we.ELEMENT_NODE=1,jt=we.ATTRIBUTE_NODE=2,Tr=we.TEXT_NODE=3,qs=we.CDATA_SECTION_NODE=4,js=we.ENTITY_REFERENCE_NODE=5,Nd=we.ENTITY_NODE=6,ji=we.PROCESSING_INSTRUCTION_NODE=7,Vi=we.COMMENT_NODE=8,Ft=we.DOCUMENT_NODE=9,Vs=we.DOCUMENT_TYPE_NODE=10,st=we.DOCUMENT_FRAGMENT_NODE=11,Sd=we.NOTATION_NODE=12,V=Ae.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 zs(t,e){if(e.length<t.length)return zs(e,t);var r=null;for(var n in t){if(t[n]!==e[n])return r;r=t[n]}return r}function Ms(t){return t.guid||(t.guid=Math.random()),t.guid}function ee(){}ee.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++)Yi(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)}};ee.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 Re(t,e){this._node=t,this._refresh=e,Tn(this)}function Tn(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var r=t._refresh(t._node);if(to(t,"length",r.length),!t.$$length||r.length<t.$$length)for(var n=r.length;n in t;n++)qt(t,n)&&delete t[n];zt(r,t),t._inc=e}}Re.prototype.item=function(t){return Tn(this),this[t]||null};_e(Re,ee);function Vt(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function Hs(t,e){for(var r=0;r<t.length;){if(t[r]===e)return r;r++}}function zi(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 Od(t,e,r){var n=zi(t,e,!1),i=n&&n[r];return i||null}function Bd(t,e){zi(t,e.namespaceURI,!0)[e.localName]=e}function Id(t,e){var r=zi(t,e.namespaceURI,!1);r&&delete r[e.localName]}function Md(t,e,r,n){if(n?e[Hs(e,n)]=r:(e[e.length]=r,e.length++),Bd(e,r),t){r.ownerElement=t;var i=t.ownerDocument;i&&(n&&Ys(i,t,n),Rd(i,t,r))}}function Rs(t,e,r){var n=Hs(e,r);if(n>=0){for(var i=e.length-1;n<=i;)e[n]=e[++n];if(e.length=i,Id(e,r),t){var a=t.ownerDocument;a&&Ys(a,t,r),r.ownerElement=null}}}Vt.prototype={length:0,item:ee.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 y(y.INUSE_ATTRIBUTE_ERR);var r=Od(this,t.namespaceURI,t.localName);return r===t?t:(Md(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 y(y.NOT_FOUND_ERR,t);return Rs(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var r=this.getNamedItemNS(t,e);if(!r)throw new y(y.NOT_FOUND_ERR,t?t+" : "+e:e);return Rs(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}};Vt.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 Ws(){}Ws.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,r){var n=Ar.XML_APPLICATION;t===Pe.HTML?n=Ar.XML_XHTML_APPLICATION:t===Pe.SVG&&(n=Ar.XML_SVG_IMAGE);var i=new He(me,{contentType:n});if(i.implementation=this,i.childNodes=new ee,i.doctype=r||null,r&&i.appendChild(r),e){var a=i.createElementNS(t,e);i.appendChild(a)}return i},createDocumentType:function(t,e,r,n){Fs(t);var i=new Sn(me);return i.name=t,i.nodeName=t,i.publicId=e||"",i.systemId=r||"",i.internalSubset=n||"",i.childNodes=new ee,i},createHTMLDocument:function(t){var e=new He(me,{contentType:Ar.HTML});if(e.implementation=this,e.childNodes=new ee,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 I(t){be(t)}I.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 a=0;a<n.attributes.length;a++){var s=n.attributes.item(a),o=i.getAttributeNodeNS(s.namespaceURI,s.localName);if(!o)return!1;e.push({node:s,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 a=n.childNodes.length-1;a>=0;a--)e.push({node:n.childNodes[a],other:i.childNodes[a]})}return!0},isSameNode:function(t){return this===t},insertBefore:function(t,e){return An(this,t,e)},replaceChild:function(t,e){An(this,t,e,Js),e&&this.removeChild(e)},removeChild:function(t){return Xs(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(t){return eo(this.ownerDocument||this,this,t)},normalize:function(){ue(this,null,{enter:function(t){for(var e=t.firstChild;e;){var r=e.nextSibling;if(r!==null&&r.nodeType===Tr&&e.nodeType===Tr){for(var n=[],i=r;i!==null&&i.nodeType===Tr;)n.push(i.data),i=i.nextSibling;for(var a=e.nextSibling;a!==i;){var s=a.nextSibling;a.parentNode=null,a.previousSibling=null,a.nextSibling=null,a=s}e.nextSibling=i,i!==null?i.previousSibling=e:t.lastChild=e,e.appendData(n.join("")),Hi(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(qt(r,n)&&r[n]===t)return n}e=e.nodeType==jt?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var r=e._nsMap;if(r&&qt(r,t))return r[t];e=e.nodeType==jt?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 wt&&(n=e,e=n.ownerElement),r instanceof wt&&(i=r,r=i.ownerElement,n&&e&&r===e))for(var a=0,s;s=r.attributes[a];a++){if(s===n)return V.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+V.DOCUMENT_POSITION_PRECEDING;if(s===i)return V.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+V.DOCUMENT_POSITION_FOLLOWING}if(!e||!r||r.ownerDocument!==e.ownerDocument)return V.DOCUMENT_POSITION_DISCONNECTED+V.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(Ms(r.ownerDocument)>Ms(e.ownerDocument)?V.DOCUMENT_POSITION_FOLLOWING:V.DOCUMENT_POSITION_PRECEDING);if(i&&e===r)return V.DOCUMENT_POSITION_CONTAINS+V.DOCUMENT_POSITION_PRECEDING;if(n&&e===r)return V.DOCUMENT_POSITION_CONTAINED_BY+V.DOCUMENT_POSITION_FOLLOWING;for(var o=[],l=e.parentNode;l;){if(!i&&l===r)return V.DOCUMENT_POSITION_CONTAINED_BY+V.DOCUMENT_POSITION_FOLLOWING;o.push(l),l=l.parentNode}o.reverse();for(var u=[],c=r.parentNode;c;){if(!n&&c===e)return V.DOCUMENT_POSITION_CONTAINS+V.DOCUMENT_POSITION_PRECEDING;u.push(c),c=c.parentNode}u.reverse();var d=zs(o,u);for(var f in d.childNodes){var p=d.childNodes[f];if(p===r)return V.DOCUMENT_POSITION_FOLLOWING;if(p===e)return V.DOCUMENT_POSITION_PRECEDING;if(u.indexOf(p)>=0)return V.DOCUMENT_POSITION_FOLLOWING;if(o.indexOf(p)>=0)return V.DOCUMENT_POSITION_PRECEDING}return 0}};function Gs(t){return t=="<"&&"&lt;"||t==">"&&"&gt;"||t=="&"&&"&amp;"||t=='"'&&"&quot;"||"&#"+t.charCodeAt()+";"}zt(we,I);zt(we,I.prototype);zt(V,I);zt(V,I.prototype);function Dn(t,e){ue(t,null,{enter:function(r){return e(r)?ue.STOP:!0}})}function ue(t,e,r){for(var n=[{node:t,context:e,phase:ue.ENTER}];n.length>0;){var i=n.pop();if(i.phase===ue.ENTER){var a=r.enter(i.node,i.context);if(a===ue.STOP)return ue.STOP;if(n.push({node:i.node,context:a,phase:ue.EXIT}),a==null)continue;for(var s=i.node.lastChild;s;)n.push({node:s,context:a,phase:ue.ENTER}),s=s.previousSibling}else r.exit&&r.exit(i.node,i.context)}}ue.STOP=Symbol("walkDOM.STOP");ue.ENTER=0;ue.EXIT=1;function He(t,e){be(t);var r=e||{};this.ownerDocument=this,this.contentType=r.contentType||Ar.XML_APPLICATION,this.type=kd(this.contentType)?"html":"xml"}function Rd(t,e,r){t&&t._inc++;var n=r.namespaceURI;n===Pe.XMLNS&&(e._nsMap[r.prefix?r.localName:""]=r.value)}function Ys(t,e,r,n){t&&t._inc++;var i=r.namespaceURI;i===Pe.XMLNS&&delete e._nsMap[r.prefix?r.localName:""]}function Hi(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,a=0;i;)n[a++]=i,i=i.nextSibling;n.length=a,delete n[n.length]}}}function Xs(t,e){if(t!==e.parentNode)throw new y(y.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,Hi(t.ownerDocument,t),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}function Ld(t){return t&&(t.nodeType===I.DOCUMENT_NODE||t.nodeType===I.DOCUMENT_FRAGMENT_NODE||t.nodeType===I.ELEMENT_NODE)}function Pd(t){return t&&(t.nodeType===I.CDATA_SECTION_NODE||t.nodeType===I.COMMENT_NODE||t.nodeType===I.DOCUMENT_FRAGMENT_NODE||t.nodeType===I.DOCUMENT_TYPE_NODE||t.nodeType===I.ELEMENT_NODE||t.nodeType===I.PROCESSING_INSTRUCTION_NODE||t.nodeType===I.TEXT_NODE)}function ot(t){return t&&t.nodeType===I.DOCUMENT_TYPE_NODE}function ze(t){return t&&t.nodeType===I.ELEMENT_NODE}function Zs(t){return t&&t.nodeType===I.TEXT_NODE}function Ls(t,e){var r=t.childNodes||[];if(Le(r,ze)||ot(e))return!1;var n=Le(r,ot);return!(e&&n&&r.indexOf(n)>r.indexOf(e))}function Ps(t,e){var r=t.childNodes||[];function n(a){return ze(a)&&a!==e}if(Le(r,n))return!1;var i=Le(r,ot);return!(e&&i&&r.indexOf(i)>r.indexOf(e))}function $d(t,e,r){if(!Ld(t))throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+t.nodeType);if(r&&r.parentNode!==t)throw new y(y.NOT_FOUND_ERR,"child not in parent");if(!Pd(e)||ot(e)&&t.nodeType!==I.DOCUMENT_NODE)throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function Ud(t,e,r){var n=t.childNodes||[],i=e.childNodes||[];if(e.nodeType===I.DOCUMENT_FRAGMENT_NODE){var a=i.filter(ze);if(a.length>1||Le(i,Zs))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(a.length===1&&!Ls(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ze(e)&&!Ls(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ot(e)){if(Le(n,ot))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var s=Le(n,ze);if(r&&n.indexOf(s)<n.indexOf(r))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!r&&s)throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function Js(t,e,r){var n=t.childNodes||[],i=e.childNodes||[];if(e.nodeType===I.DOCUMENT_FRAGMENT_NODE){var a=i.filter(ze);if(a.length>1||Le(i,Zs))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(a.length===1&&!Ps(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ze(e)&&!Ps(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ot(e)){if(Le(n,function(l){return ot(l)&&l!==r}))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var s=Le(n,ze);if(r&&n.indexOf(s)<n.indexOf(r))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function An(t,e,r,n){$d(t,e,r),t.nodeType===I.DOCUMENT_NODE&&(n||Ud)(t,e,r);var i=e.parentNode;if(i&&i.removeChild(e),e.nodeType===st){var a=e.firstChild;if(a==null)return e;var s=e.lastChild}else a=s=e;var o=r?r.previousSibling:t.lastChild;a.previousSibling=o,s.nextSibling=r,o?o.nextSibling=a:t.firstChild=a,r==null?t.lastChild=s:r.previousSibling=s;do a.parentNode=t;while(a!==s&&(a=a.nextSibling));return Hi(t.ownerDocument||t,t,e),e.nodeType==st&&(e.firstChild=e.lastChild=null),e}He.prototype={implementation:null,nodeName:"#document",nodeType:Ft,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType===st){for(var r=t.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,e),r=n}return t}return An(this,t,e),t.ownerDocument=this,this.documentElement===null&&t.nodeType===De&&(this.documentElement=t),t},removeChild:function(t){var e=Xs(this,t);return e===this.documentElement&&(this.documentElement=null),e},replaceChild:function(t,e){An(this,t,e,Js),t.ownerDocument=this,e&&this.removeChild(e),ze(t)&&(this.documentElement=t)},importNode:function(t,e){return Fd(this,t,e)},getElementById:function(t){var e=null;return Dn(this.documentElement,function(r){if(r.nodeType==De&&r.getAttribute("id")==t)return e=r,!0}),e},createElement:function(t){var e=new We(me);e.ownerDocument=this,this.type==="html"&&(t=t.toLowerCase()),vd(this.contentType)&&(e.namespaceURI=Pe.HTML),e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new ee;var r=e.attributes=new Vt;return r._ownerElement=e,e},createDocumentFragment:function(){var t=new Ht(me);return t.ownerDocument=this,t.childNodes=new ee,t},createTextNode:function(t){var e=new Cr(me);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(t),e},createComment:function(t){var e=new Cn(me);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(t),e},createCDATASection:function(t){if(t.indexOf("]]>")!==-1)throw new y(y.INVALID_CHARACTER_ERR,'data contains "]]>"');var e=new Nn(me);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(t),e},createProcessingInstruction:function(t,e){var r=new Bn(me);return r.ownerDocument=this,r.childNodes=new ee,r.nodeName=r.target=t,r.nodeValue=r.data=e,r},createAttribute:function(t){if(!z.QName_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in name "'+t+'"');return this.type==="html"&&(t=t.toLowerCase()),this._createAttribute(t)},_createAttribute:function(t){var e=new wt(me);return e.ownerDocument=this,e.childNodes=new ee,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){if(!z.Name_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'not a valid xml name "'+t+'"');if(this.type==="html")throw new y("document is an html document",fe.NotSupportedError);var e=new On(me);return e.ownerDocument=this,e.childNodes=new ee,e.nodeName=t,e},createElementNS:function(t,e){var r=qi(t,e),n=new We(me),i=n.attributes=new Vt;return n.childNodes=new ee,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=qi(t,e),n=new wt(me);return n.ownerDocument=this,n.childNodes=new ee,n.nodeName=e,n.name=e,n.specified=!0,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],n}};_e(He,I);function We(t){be(t),this._nsMap=Object.create(null)}We.prototype={nodeType:De,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type==="html"&&this.namespaceURI===Pe.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=qi(t,e),i=n[2],a=this.getAttributeNodeNS(t,i);a?a.value=a.nodeValue=""+r:(a=this.ownerDocument.createAttributeNS(t,e),a.value=a.nodeValue=""+r,this.setAttributeNode(a))},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByClassName:function(t){var e=Is(t);return new Re(this,function(r){var n=[];return e.length>0&&Dn(r,function(i){if(i!==r&&i.nodeType===De){var a=i.getAttribute("class");if(a){var s=t===a;if(!s){var o=Is(a);s=e.every(Cd(o))}s&&n.push(i)}}}),n})},getElementsByTagName:function(t){var e=(this.nodeType===Ft?this:this.ownerDocument).type==="html",r=t.toLowerCase();return new Re(this,function(n){var i=[];return Dn(n,function(a){if(!(a===n||a.nodeType!==De))if(t==="*")i.push(a);else{var s=a.getQualifiedName(),o=e&&a.namespaceURI===Pe.HTML?r:t;s===o&&i.push(a)}}),i})},getElementsByTagNameNS:function(t,e){return new Re(this,function(r){var n=[];return Dn(r,function(i){i!==r&&i.nodeType===De&&(t==="*"||i.namespaceURI===t)&&(e==="*"||i.localName==e)&&n.push(i)}),n})}};He.prototype.getElementsByClassName=We.prototype.getElementsByClassName;He.prototype.getElementsByTagName=We.prototype.getElementsByTagName;He.prototype.getElementsByTagNameNS=We.prototype.getElementsByTagNameNS;_e(We,I);function wt(t){be(t),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}wt.prototype.nodeType=jt;_e(wt,I);function lt(t){be(t)}lt.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}};_e(lt,I);function Cr(t){be(t)}Cr.prototype={nodeName:"#text",nodeType:Tr,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}};_e(Cr,lt);function Cn(t){be(t)}Cn.prototype={nodeName:"#comment",nodeType:Vi};_e(Cn,lt);function Nn(t){be(t)}Nn.prototype={nodeName:"#cdata-section",nodeType:qs};_e(Nn,Cr);function Sn(t){be(t)}Sn.prototype.nodeType=Vs;_e(Sn,I);function Wi(t){be(t)}Wi.prototype.nodeType=Sd;_e(Wi,I);function Gi(t){be(t)}Gi.prototype.nodeType=Nd;_e(Gi,I);function On(t){be(t)}On.prototype.nodeType=js;_e(On,I);function Ht(t){be(t)}Ht.prototype.nodeName="#document-fragment";Ht.prototype.nodeType=st;_e(Ht,I);function Bn(t){be(t)}Bn.prototype.nodeType=ji;_e(Bn,lt);function Ks(){}Ks.prototype.serializeToString=function(t,e){return Qs.call(t,e)};I.prototype.toString=Qs;function Qs(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===Ft&&this.documentElement||this,i=n.prefix,a=n.namespaceURI;if(a&&i==null){var i=n.lookupPrefix(a);if(i==null)var s=[{namespace:a,prefix:null}]}return Yi(this,r,s,e),r.join("")}function $s(t,e,r){var n=t.prefix||"",i=t.namespaceURI;if(!i||n==="xml"&&i===Pe.XML||i===Pe.XMLNS)return!1;for(var a=r.length;a--;){var s=r[a];if(s.prefix===n)return s.namespace!==i}return!0}function xn(t,e,r,n){if(n&&!z.QName_exact.test(e))throw new y('The attribute name "'+e+'" is not a valid XML QName',fe.InvalidStateError);t.push(" ",e,'="',r.replace(/[<>&"\t\n\r]/g,Gs),'"')}function Yi(t,e,r,n){r||(r=[]);var i=n.nodeFilter,a=n.requireWellFormed,s=n.splitCDATASections,o=t.nodeType===Ft?t:t.ownerDocument,l=o.type==="html";ue(t,{ns:r},{enter:function(u,c){var d=c.ns;if(i)if(u=i(u),u){if(typeof u=="string")return e.push(u),null}else return null;switch(u.nodeType){case De:var f=u.attributes,p=f.length,h=u.tagName,m=h;if(!l&&!u.prefix&&u.namespaceURI){for(var g,_=0;_<f.length;_++)if(f.item(_).name==="xmlns"){g=f.item(_).value;break}if(!g)for(var v=d.length-1;v>=0;v--){var w=d[v];if(w.prefix===""&&w.namespace===u.namespaceURI){g=w.namespace;break}}if(g!==u.namespaceURI)for(var v=d.length-1;v>=0;v--){var w=d[v];if(w.namespace===u.namespaceURI){w.prefix&&(m=w.prefix+":"+h);break}}}if(a&&!z.QName_exact.test(m))throw new y('The element name "'+m+'" is not a valid XML QName',fe.InvalidStateError);e.push("<",m);for(var x=d.slice(),B=0;B<p;B++){var L=f.item(B);L.prefix=="xmlns"?x.push({prefix:L.localName,namespace:L.value}):L.nodeName=="xmlns"&&x.push({prefix:"",namespace:L.value})}for(var B=0;B<p;B++){var L=f.item(B);if($s(L,l,x)){var Z=L.prefix||"",ie=L.namespaceURI;xn(e,Z?"xmlns:"+Z:"xmlns",ie,a),x.push({prefix:Z,namespace:ie})}var ae=i?i(L):L;ae&&(typeof ae=="string"?e.push(ae):xn(e,ae.name,ae.value,a))}if(h===m&&$s(u,l,x)){var je=u.prefix||"",ie=u.namespaceURI;xn(e,je?"xmlns:"+je:"xmlns",ie,a),x.push({prefix:je,namespace:ie})}var K=!u.firstChild;if(K&&(l||u.namespaceURI===Pe.HTML)&&(K=xd(h)),K)return e.push("/>"),null;if(e.push(">"),l&&Ed(h)){for(var he=u.firstChild;he;)he.data?e.push(he.data):Yi(he,e,x.slice(),n),he=he.nextSibling;return e.push("</",m,">"),null}return{ns:x,tag:m};case Ft:case st:if(a&&u.nodeType===Ft&&u.documentElement==null)throw new y("The Document has no documentElement",fe.InvalidStateError);return{ns:d};case jt:return xn(e,u.name,u.value,a),null;case Tr:if(a&&z.InvalidChar.test(u.data))throw new y("The Text node data contains characters outside the XML Char production",fe.InvalidStateError);return e.push(u.data.replace(/[<&>]/g,Gs)),null;case qs:if(a&&u.data.indexOf("]]>")!==-1)throw new y('The CDATASection data contains "]]>"',fe.InvalidStateError);return s?e.push(z.CDATA_START,u.data.replace(/]]>/g,"]]]]><![CDATA[>"),z.CDATA_END):e.push(z.CDATA_START,u.data,z.CDATA_END),null;case Vi:if(a){if(z.InvalidChar.test(u.data))throw new y("The comment node data contains characters outside the XML Char production",fe.InvalidStateError);if(u.data.indexOf("--")!==-1||u.data[u.data.length-1]==="-")throw new y('The comment node data contains "--" or ends with "-"',fe.InvalidStateError)}return e.push(z.COMMENT_START,u.data,z.COMMENT_END),null;case Vs:var Ee=u.publicId,F=u.systemId;if(a){if(!z.Name_exact.test(u.name))throw new y('The doctype name "'+u.name+'" is not a valid XML Name',fe.InvalidStateError);if(Ee&&!z.PubidLiteral_match.test(Ee))throw new y("DocumentType publicId is not a valid PubidLiteral",fe.InvalidStateError);if(F&&F!=="."&&!z.SystemLiteral_match.test(F))throw new y("DocumentType systemId is not a valid SystemLiteral",fe.InvalidStateError);if(u.internalSubset&&u.internalSubset.indexOf("]>")!==-1)throw new y('DocumentType internalSubset contains "]>"',fe.InvalidStateError)}return e.push(z.DOCTYPE_DECL_START," ",u.name),Ee?(e.push(" ",z.PUBLIC," ",Ee),F&&F!=="."&&e.push(" ",F)):F&&F!=="."&&e.push(" ",z.SYSTEM," ",F),u.internalSubset&&e.push(" [",u.internalSubset,"]"),e.push(">"),null;case ji:if(a){if(!z.NCName_exact.test(u.target)||u.target.toLowerCase()==="xml")throw new y('The processing instruction target "'+u.target+'" is not a valid XML NCName or is reserved',fe.InvalidStateError);if(z.InvalidChar.test(u.data))throw new y("The ProcessingInstruction data contains characters outside the XML Char production",fe.InvalidStateError);if(u.data.indexOf("?>")!==-1)throw new y('The ProcessingInstruction data contains "?>"',fe.InvalidStateError)}return e.push("<?",u.target," ",u.data,"?>"),null;case js:if(a&&!z.Name_exact.test(u.nodeName))throw new y('The entity reference name "'+u.nodeName+'" is not a valid XML Name',fe.InvalidStateError);return e.push("&",u.nodeName,";"),null;default:return e.push("??",u.nodeName),null}},exit:function(u,c){c&&c.tag&&e.push("</",c.tag,">")}})}function Fd(t,e,r){var n;return ue(e,null,{enter:function(i,a){var s=i.cloneNode(!1);s.ownerDocument=t,s.parentNode=null,a===null?n=s:a.appendChild(s);var o=i.nodeType===jt||r;return o?s:null}}),n}function eo(t,e,r){var n;return ue(e,null,{enter:function(i,a){var s=new i.constructor(me);for(var o in i)if(qt(i,o)){var l=i[o];typeof l!="object"&&l!=s[o]&&(s[o]=l)}i.childNodes&&(s.childNodes=new ee),s.ownerDocument=t;var u=r;switch(s.nodeType){case De:var c=i.attributes,d=s.attributes=new Vt,f=c.length;d._ownerElement=s;for(var p=0;p<f;p++)s.setAttributeNode(eo(t,c.item(p),!0));break;case jt:u=!0}return a!==null?a.appendChild(s):n=s,u?s:null}}),n}function to(t,e,r){t[e]=r}function Fi(t){for(var e=[],r=t.firstChild;r;)r.nodeType===De&&e.push(r),r=r.nextSibling;return e}try{Object.defineProperty&&(Object.defineProperty(Re.prototype,"length",{get:function(){return Tn(this),this.$$length}}),Object.defineProperty(I.prototype,"textContent",{get:function(){if(this.nodeType===De||this.nodeType===st){var t=[];return ue(this,null,{enter:function(e){if(e.nodeType===De||e.nodeType===st)return!0;if(e.nodeType===ji||e.nodeType===Vi)return null;t.push(e.nodeValue)}}),t.join("")}return this.nodeValue},set:function(t){switch(this.nodeType){case De:case st: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(lt.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(lt.prototype,"nodeValue",{get:function(){return this.data},set:function(t){this.data=t},enumerable:!0,configurable:!0}),Object.defineProperty(We.prototype,"children",{get:function(){return new Re(this,Fi)}}),Object.defineProperty(He.prototype,"children",{get:function(){return new Re(this,Fi)}}),Object.defineProperty(Ht.prototype,"children",{get:function(){return new Re(this,Fi)}}),to=function(t,e,r){t["$$"+e]=r})}catch{}H._updateLiveList=Tn;H.Attr=wt;H.CDATASection=Nn;H.CharacterData=lt;H.Comment=Cn;H.Document=He;H.DocumentFragment=Ht;H.DocumentType=Sn;H.DOMImplementation=Ws;H.Element=We;H.Entity=Gi;H.EntityReference=On;H.LiveNodeList=Re;H.NamedNodeMap=Vt;H.Node=I;H.NodeList=ee;H.Notation=Wi;H.Text=Cr;H.ProcessingInstruction=Bn;H.walkDOM=ue;H.XMLSerializer=Ks});var no=Je(Nr=>{"use strict";var ro=_t().freeze;Nr.XML_ENTITIES=ro({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Nr.HTML_ENTITIES=ro({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"});Nr.entityMap=Nr.HTML_ENTITIES});var po=Je(Mn=>{"use strict";var Zt=_t(),N=Ui(),oo=yr(),qd=Zt.isHTMLEscapableRawTextElement,jd=Zt.isHTMLMimeType,Vd=Zt.isHTMLRawTextElement,Br=Zt.hasOwn,io=Zt.NAMESPACE,zd=oo.ParseError,Hd=oo.DOMException,Wt=0,ut=1,Gt=2,Sr=3,Yt=4,Xt=5,Or=6,In=7;function lo(){}lo.prototype={parse:function(t,e,r){var n=this.domBuilder;n.startDocument(),Xd(e,e=Object.create(null)),Wd(t,e,r,n,this.errorHandler),n.endDocument()}};var Zi=/&#?\w+;?/g;function Wd(t,e,r,n,i){var a=jd(n.mimeType);t.indexOf(N.UNICODE_REPLACEMENT_CHARACTER)>=0&&i.warning("Unicode replacement character detected, source encoding issues?");function s(R){if(R>65535){R-=65536;var xe=55296+(R>>10),tn=56320+(R&1023);return String.fromCharCode(xe,tn)}else return String.fromCharCode(R)}function o(R){var xe=R[R.length-1]===";"?R:R+";";if(!a&&xe!==R)return i.error("EntityRef: expecting ;"),R;var tn=N.Reference.exec(xe);if(!tn||tn[0].length!==xe.length)return i.error("entity not matching Reference production: "+R),R;var rn=xe.slice(1,-1);return Br(r,rn)?r[rn]:rn.charAt(0)==="#"?s(parseInt(rn.substring(1).replace("x","0x"))):(i.error("entity not found:"+R),R)}function l(R){if(R>g){var xe=t.substring(g,R).replace(Zi,o);f&&p(g),n.characters(xe,0,R-g),g=R}}var u=0,c=0,d=/\r\n?|\n|$/g,f=n.locator;function p(R,xe){for(;R>=c&&(xe=d.exec(t));)u=c,c=xe.index+xe[0].length,f.lineNumber++;f.columnNumber=R-u+1}for(var h=[{currentNSMap:e}],m=[],g=0;;){try{var _=t.indexOf("<",g);if(_<0){if(!a&&m.length>0)return i.fatalError("unclosed xml tag(s): "+m.join(", "));if(!t.substring(g).match(/^\s*$/)){var v=n.doc,w=v.createTextNode(t.substring(g));if(v.documentElement)return i.error("Extra content at the end of the document");v.appendChild(w),n.currentElement=w}return}if(_>g){var x=t.substring(g,_);!a&&m.length===0&&(x=x.replace(new RegExp(N.S_OPT.source,"g"),""),x&&i.error("Unexpected content outside root element: '"+x+"'")),l(_)}switch(t.charAt(_+1)){case"/":var S=t.indexOf(">",_+2),B=t.substring(_+2,S>0?S:void 0);if(!B)return i.fatalError("end tag name missing");var L=N.reg("^",N.QName_group,N.S_OPT,"$"),Z=S>0&&L.exec(B);if(!Z){var ie=S>0&&N.reg("^",N.QName_group).exec(B);if(a&&ie)i.warning('end tag name contains invalid trailing characters: "'+B+'"'),Z=ie;else if(ie&&new RegExp(L.source,L.flags+"m").test(B))i.error('end tag name is followed by a line break and trailing content: "'+B+'"'),Z=ie;else return i.fatalError('end tag name contains invalid characters: "'+B+'"')}if(!n.currentElement&&!n.doc.documentElement)return;var ae=m[m.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(ae!==Z[1]){var je=Z[1].toLowerCase();if(!a||ae.toLowerCase()!==je)return i.fatalError('Opening and ending tag mismatch: "'+ae+'" != "'+B+'"')}var K=h.pop();m.pop();var he=K.localNSMap;if(n.endElement(K.uri,K.localName,ae),he)for(var Ee in he)Br(he,Ee)&&n.endPrefixMapping(Ee);S++;break;case"?":f&&p(_),S=Jd(t,_,n,i);break;case"!":f&&p(_),S=co(t,_,n,i,a);break;default:f&&p(_);var F=new fo,J=h[h.length-1].currentNSMap,S=Gd(t,_,F,J,o,i,a),Ba=F.length;if(F.closed||(a&&Zt.isHTMLVoidElement(F.tagName)?F.closed=!0:m.push(F.tagName)),f&&Ba){for(var Ll=ao(f,{}),oi=0;oi<Ba;oi++){var Ia=F[oi];p(Ia.offset),Ia.locator=ao(f,{})}n.locator=Ll,so(F,n,J)&&h.push(F),n.locator=f}else so(F,n,J)&&h.push(F);a&&!F.closed?S=Yd(t,S,F.tagName,o,n):S++}}catch(R){if(R instanceof zd)throw R;if(R instanceof Hd)return i.fatalError("Error constructing the DOM: "+R.name+": "+R.message,R);i.error("element parse error: "+R),S=-1}S>g?g=S:l(Math.max(_,g)+1)}}function ao(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function Gd(t,e,r,n,i,a,s){function o(p,h,m){if(Br(r.attributeNames,p))return a.fatalError("Attribute "+p+" redefined");if(!s&&h.indexOf("<")>=0)return a.fatalError("Unescaped '<' not allowed in attributes values");r.addValue(p,h.replace(/[\t\n\r]/g," ").replace(Zi,i),m)}for(var l,u,c=++e,d=Wt;;){var f=t.charAt(c);if(d===Wt&&f==="<")throw new Error("unexpected < in tag name: "+t.slice(e,c));switch(f){case"=":if(d===ut)l=t.slice(e,c),d=Sr;else if(d===Gt)d=Sr;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(d===Sr||d===ut)if(d===ut&&(a.warning('attribute value must after "="'),l=t.slice(e,c)),e=c+1,c=t.indexOf(f,e),c>0)u=t.slice(e,c),o(l,u,e-1),d=Xt;else throw new Error("attribute value no end '"+f+"' match");else if(d==Yt)u=t.slice(e,c),o(l,u,e),a.warning('attribute "'+l+'" missed start quot('+f+")!!"),e=c+1,d=Xt;else throw new Error('attribute value must after "="');break;case"/":switch(d){case Wt:r.setTagName(t.slice(e,c));case Xt:case Or:case In:d=In,r.closed=!0;case Yt:case ut:break;case Gt:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),d==Wt&&r.setTagName(t.slice(e,c)),c;case">":switch(d){case Wt:r.setTagName(t.slice(e,c));case Xt:case Or:case In:break;case Yt:case ut:u=t.slice(e,c),u.slice(-1)==="/"&&(r.closed=!0,u=u.slice(0,-1));case Gt:d===Gt&&(u=l),d==Yt?(a.warning('attribute "'+u+'" missed quot(")!'),o(l,u,e)):(s||a.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,e));break;case Sr:if(!s)return a.fatalError(`AttValue: ' or " expected`)}return c;case"\x80":f=" ";default:if(f<=" ")switch(d){case Wt:r.setTagName(t.slice(e,c)),d=Or;break;case ut:l=t.slice(e,c),d=Gt;break;case Yt:var u=t.slice(e,c);a.warning('attribute "'+u+'" missed quot(")!!'),o(l,u,e);case Xt:d=Or;break}else switch(d){case Gt:s||a.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,e),e=c,d=ut;break;case Xt:a.warning('attribute space is required"'+l+'"!!');case Or:d=ut,e=c;break;case Sr:d=Yt,e=c;break;case In:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function so(t,e,r){for(var n=t.tagName,i=null,d=t.length;d--;){var a=t[d],s=a.qName,o=a.value,f=s.indexOf(":");if(f>0)var l=a.prefix=s.slice(0,f),u=s.slice(f+1),c=l==="xmlns"&&u;else u=s,l=null,c=s==="xmlns"&&"";a.localName=u,c!==!1&&(i==null&&(i=Object.create(null),r=Object.create(r)),r[c]=i[c]=o,a.uri=io.XMLNS,e.startPrefixMapping(c,o))}for(var d=t.length;d--;)a=t[d],a.prefix&&(a.prefix==="xml"&&(a.uri=io.XML),a.prefix!=="xmlns"&&(a.uri=r[a.prefix]));var f=n.indexOf(":");f>0?(l=t.prefix=n.slice(0,f),u=t.localName=n.slice(f+1)):(l=null,u=t.localName=n);var p=t.uri=r[l||""];if(e.startElement(p,u,n,t),t.closed){if(e.endElement(p,u,n),i)for(l in i)Br(i,l)&&e.endPrefixMapping(l)}else return t.currentNSMap=r,t.localNSMap=i,!0}function Yd(t,e,r,n,i){var a=qd(r);if(a||Vd(r)){var s=new RegExp("</"+r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+">","ig");s.lastIndex=e;var o=s.exec(t),l=o?o.index:-1;if(l<0)return e+1;var u=t.substring(e+1,l);return a&&(u=u.replace(Zi,n)),i.characters(u,0,u.length),l}return e+1}function Xd(t,e){for(var r in t)Br(t,r)&&(e[r]=t[r])}function uo(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 a(){for(var c=0;r<t.length;){var d=n();if(d!==" "&&d!==`
3
+ `&&d!==" "&&d!=="\r")return c;c++,i()}return-1}function s(){return t.substring(r)}function o(c){return t.substring(r,r+c.length)===c}function l(c){return t.substring(r,r+c.length).toUpperCase()===c.toUpperCase()}function u(c){var d=N.reg("^",c),f=d.exec(s());return f?(i(f[0].length),f[0]):null}return{char:n,getIndex:function(){return r},getMatch:u,getSource:function(){return t},skip:i,skipBlanks:a,substringFromIndex:s,substringStartsWith:o,substringStartsWithCaseInsensitive:l}}function Zd(t,e){function r(o,l){var u=N.PI.exec(o.substringFromIndex());return u?u[1].toLowerCase()==="xml"?l.fatalError("xml declaration is only allowed at the start of the document, but found at position "+o.getIndex()):(o.skip(u[0].length),u[0]):l.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 a=n.substring(i,t.getIndex());return t.skip(1),a}var s=null;if(t.char()==="<"&&t.char(1)==="!")switch(t.char(2)){case"E":t.char(3)==="L"?s=t.getMatch(N.elementdecl):t.char(3)==="N"&&(s=t.getMatch(N.EntityDecl));break;case"A":s=t.getMatch(N.AttlistDecl);break;case"N":s=t.getMatch(N.NotationDecl);break;case"-":s=t.getMatch(N.Comment);break}else if(t.char()==="<"&&t.char(1)==="?")s=r(t,e);else if(t.char()==="%")s=t.getMatch(N.PEReference);else return e.fatalError("Error detected in Markup declaration");if(!s)return e.fatalError("Error in internal subset at position "+t.getIndex())}return e.fatalError("doctype internal subset is not well-formed, missing ]")}}function co(t,e,r,n,i){var a=uo(t,e);switch(i?a.char(2).toUpperCase():a.char(2)){case"-":var s=a.getMatch(N.Comment);return s?(r.comment(s,N.COMMENT_START.length,s.length-N.COMMENT_START.length-N.COMMENT_END.length),a.getIndex()):n.fatalError("comment is not well-formed at position "+a.getIndex());case"[":var o=a.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(),a.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 "+a.getIndex());if(i?!a.substringStartsWithCaseInsensitive(N.DOCTYPE_DECL_START):!a.substringStartsWith(N.DOCTYPE_DECL_START))return n.fatalError("Expected "+N.DOCTYPE_DECL_START+" at position "+a.getIndex());if(a.skip(N.DOCTYPE_DECL_START.length),a.skipBlanks()<1)return n.fatalError("Expected whitespace after "+N.DOCTYPE_DECL_START+" at position "+a.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=a.getMatch(N.Name),!l.name)return n.fatalError("doctype name missing or contains unexpected characters at position "+a.getIndex());if(i&&l.name.toLowerCase()!=="html"&&n.warning("Unexpected DOCTYPE in HTML document at position "+a.getIndex()),a.skipBlanks(),a.substringStartsWith(N.PUBLIC)||a.substringStartsWith(N.SYSTEM)){var u=N.ExternalID_match.exec(a.substringFromIndex());if(!u)return n.fatalError("doctype external id is not well-formed at position "+a.getIndex());u.groups.SystemLiteralOnly!==void 0?l.systemId=u.groups.SystemLiteralOnly:(l.systemId=u.groups.SystemLiteral,l.publicId=u.groups.PubidLiteral),a.skip(u[0].length)}else if(i&&a.substringStartsWithCaseInsensitive(N.SYSTEM)){if(a.skip(N.SYSTEM.length),a.skipBlanks()<1)return n.fatalError("Expected whitespace after "+N.SYSTEM+" at position "+a.getIndex());if(l.systemId=a.getMatch(N.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return n.fatalError("Expected "+N.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+N.SYSTEM+" at position "+a.getIndex())}return i&&l.systemId&&!N.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&n.warning("Unexpected doctype.systemId in HTML document at position "+a.getIndex()),i||(a.skipBlanks(),l.internalSubset=Zd(a,n)),a.skipBlanks(),a.char()!==">"?n.fatalError("doctype not terminated with > at position "+a.getIndex()):(a.skip(1),r.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),r.endDTD(),a.getIndex())}default:return n.fatalError('Not well-formed XML starting with "<!" at position '+e)}}function Jd(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 fo(){this.attributeNames=Object.create(null)}fo.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}};Mn.XMLReader=lo;Mn.parseUtils=uo;Mn.parseDoctypeCommentOrCData=co});var yo=Je(Kt=>{"use strict";var yt=_t(),Kd=Xi(),Qd=yr(),ho=no(),ef=po(),tf=Kd.DOMImplementation,rf=yt.hasDefaultHTMLNamespace,nf=yt.isHTMLMimeType,af=yt.isValidMimeType,bo=yt.MIME_TYPE,Ji=yt.NAMESPACE,mo=Qd.ParseError,sf=ef.XMLReader;function _o(t){return t.replace(/\r[\n\u0085]/g,`
4
4
  `).replace(/[\r\u0085\u2028\u2029]/g,`
5
- `)}function _o(t){if(t=t||{},t.locator===void 0&&(t.locator=!0),this.assign=t.assign||yt.assign,this.domHandler=t.domHandler||Ln,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||bo,this.locator=!!t.locator,this.xmlns=this.assign(Object.create(null),t.xmlns)}_o.prototype.parseFromString=function(t,e){if(!rf(e))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+e+'" is not valid.');var r=this.assign(Object.create(null),this.xmlns),n=po.XML_ENTITIES,i=r[""]||null;ef(e)?(n=po.HTML_ENTITIES,i=Zi.HTML):e===go.XML_SVG_IMAGE&&(i=Zi.SVG),r[""]=i,r.xml=r.xml||Zi.XML;var a=new this.domHandler({mimeType:e,defaultNamespace:i,onError:this.onError}),s=this.locator?{}:void 0;this.locator&&a.setDocumentLocator(s);var o=new nf;o.errorHandler=a,o.domBuilder=a;var l=!yt.isHTMLMimeType(e);return l&&typeof t!="string"&&o.errorHandler.fatalError("source is not a string"),o.parse(this.normalizeLineEndings(String(t)),r,n),a.doc.documentElement||o.errorHandler.fatalError("missing root element"),a.doc};function Ln(t){var e=t||{};this.mimeType=e.mimeType||go.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 Jt(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}Ln.prototype={startDocument:function(){var t=new Qd;this.doc=tf(this.mimeType)?t.createHTMLDocument(!1):t.createDocument(this.defaultNamespace,"")},startElement:function(t,e,r,n){var i=this.doc,a=i.createElementNS(t,r||e),s=n.length;Rn(this,a),this.currentElement=a,this.locator&&Jt(this.locator,a);for(var o=0;o<s;o++){var t=n.getURI(o),l=n.getValue(o),r=n.getQName(o),u=i.createAttributeNS(t,r);this.locator&&Jt(n.getLocator(o),u),u.value=u.nodeValue=l,a.setAttributeNode(u)}},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&&Jt(this.locator,r),Rn(this,r)},ignorableWhitespace:function(t,e,r){},characters:function(t,e,r){if(t=mo.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&&Jt(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=mo.apply(this,arguments);var n=this.doc.createComment(t);this.locator&&Jt(this.locator,n),Rn(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 a=i.createDocumentType(t,e,r,n);this.locator&&Jt(this.locator,a),Rn(this,a),this.doc.doctype=a}},reportError:function(t,e){if(typeof this.onError=="function")try{this.onError(t,e,this)}catch(r){throw new ho("Reporting "+t+' "'+e+'" caused '+r,this.locator)}else console.error("[xmldom "+t+"] "+e,af(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 ho(t,this.locator,e)}};function af(t){if(t)return`
6
- @#[line:`+t.lineNumber+",col:"+t.columnNumber+"]"}function mo(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){Ln.prototype[t]=function(){return null}});function Rn(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}function sf(t){if(t==="error")throw"onErrorStopParsing"}function of(){throw"onWarningStopParsing"}Kt.__DOMHandler=Ln;Kt.DOMParser=_o;Kt.normalizeLineEndings=bo;Kt.onErrorStopParsing=sf;Kt.onWarningStopParsing=of});var Ji=Je(M=>{"use strict";var Qt=_t();M.assign=Qt.assign;M.hasDefaultHTMLNamespace=Qt.hasDefaultHTMLNamespace;M.isHTMLMimeType=Qt.isHTMLMimeType;M.isValidMimeType=Qt.isValidMimeType;M.MIME_TYPE=Qt.MIME_TYPE;M.NAMESPACE=Qt.NAMESPACE;var Pn=yr();M.DOMException=Pn.DOMException;M.DOMExceptionName=Pn.DOMExceptionName;M.ExceptionCode=Pn.ExceptionCode;M.ParseError=Pn.ParseError;var te=Yi();M.Attr=te.Attr;M.CDATASection=te.CDATASection;M.CharacterData=te.CharacterData;M.Comment=te.Comment;M.Document=te.Document;M.DocumentFragment=te.DocumentFragment;M.DocumentType=te.DocumentType;M.DOMImplementation=te.DOMImplementation;M.Element=te.Element;M.Entity=te.Entity;M.EntityReference=te.EntityReference;M.LiveNodeList=te.LiveNodeList;M.NamedNodeMap=te.NamedNodeMap;M.Node=te.Node;M.NodeList=te.NodeList;M.Notation=te.Notation;M.ProcessingInstruction=te.ProcessingInstruction;M.Text=te.Text;M.XMLSerializer=te.XMLSerializer;var $n=wo();M.DOMParser=$n.DOMParser;M.normalizeLineEndings=$n.normalizeLineEndings;M.onErrorStopParsing=$n.onErrorStopParsing;M.onWarningStopParsing=$n.onWarningStopParsing});import{Bag as yp}from"@gramlot/gramlot";var P={};Ia(P,{defineCollection:()=>ci});nn(P,ah);import*as ah from"@gramlot/gramlot/components";import{defineCollection as Fl}from"@gramlot/gramlot/components";function ci(t){if(t.name!=="inputs")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 Fl({...t,css:e,assets:r})}function an(t,e){return t.parameters=Object.fromEntries(Object.entries(t.constructor.gramlotComponent.parameters).map(([r,n])=>[r,Object.hasOwn(e,r)?e[r]:n.default])),Object.fromEntries(Object.entries(e).filter(([r])=>!Object.hasOwn(t.parameters,r)))}function di(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)}
5
+ `)}function wo(t){if(t=t||{},t.locator===void 0&&(t.locator=!0),this.assign=t.assign||yt.assign,this.domHandler=t.domHandler||Ln,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||_o,this.locator=!!t.locator,this.xmlns=this.assign(Object.create(null),t.xmlns)}wo.prototype.parseFromString=function(t,e){if(!af(e))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+e+'" is not valid.');var r=this.assign(Object.create(null),this.xmlns),n=ho.XML_ENTITIES,i=r[""]||null;rf(e)?(n=ho.HTML_ENTITIES,i=Ji.HTML):e===bo.XML_SVG_IMAGE&&(i=Ji.SVG),r[""]=i,r.xml=r.xml||Ji.XML;var a=new this.domHandler({mimeType:e,defaultNamespace:i,onError:this.onError}),s=this.locator?{}:void 0;this.locator&&a.setDocumentLocator(s);var o=new sf;o.errorHandler=a,o.domBuilder=a;var l=!yt.isHTMLMimeType(e);return l&&typeof t!="string"&&o.errorHandler.fatalError("source is not a string"),o.parse(this.normalizeLineEndings(String(t)),r,n),a.doc.documentElement||o.errorHandler.fatalError("missing root element"),a.doc};function Ln(t){var e=t||{};this.mimeType=e.mimeType||bo.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 Jt(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}Ln.prototype={startDocument:function(){var t=new tf;this.doc=nf(this.mimeType)?t.createHTMLDocument(!1):t.createDocument(this.defaultNamespace,"")},startElement:function(t,e,r,n){var i=this.doc,a=i.createElementNS(t,r||e),s=n.length;Rn(this,a),this.currentElement=a,this.locator&&Jt(this.locator,a);for(var o=0;o<s;o++){var t=n.getURI(o),l=n.getValue(o),r=n.getQName(o),u=i.createAttributeNS(t,r);this.locator&&Jt(n.getLocator(o),u),u.value=u.nodeValue=l,a.setAttributeNode(u)}},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&&Jt(this.locator,r),Rn(this,r)},ignorableWhitespace:function(t,e,r){},characters:function(t,e,r){if(t=go.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&&Jt(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=go.apply(this,arguments);var n=this.doc.createComment(t);this.locator&&Jt(this.locator,n),Rn(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 a=i.createDocumentType(t,e,r,n);this.locator&&Jt(this.locator,a),Rn(this,a),this.doc.doctype=a}},reportError:function(t,e){if(typeof this.onError=="function")try{this.onError(t,e,this)}catch(r){throw new mo("Reporting "+t+' "'+e+'" caused '+r,this.locator)}else console.error("[xmldom "+t+"] "+e,of(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 mo(t,this.locator,e)}};function of(t){if(t)return`
6
+ @#[line:`+t.lineNumber+",col:"+t.columnNumber+"]"}function go(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){Ln.prototype[t]=function(){return null}});function Rn(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}function lf(t){if(t==="error")throw"onErrorStopParsing"}function uf(){throw"onWarningStopParsing"}Kt.__DOMHandler=Ln;Kt.DOMParser=wo;Kt.normalizeLineEndings=_o;Kt.onErrorStopParsing=lf;Kt.onWarningStopParsing=uf});var Ki=Je(M=>{"use strict";var Qt=_t();M.assign=Qt.assign;M.hasDefaultHTMLNamespace=Qt.hasDefaultHTMLNamespace;M.isHTMLMimeType=Qt.isHTMLMimeType;M.isValidMimeType=Qt.isValidMimeType;M.MIME_TYPE=Qt.MIME_TYPE;M.NAMESPACE=Qt.NAMESPACE;var Pn=yr();M.DOMException=Pn.DOMException;M.DOMExceptionName=Pn.DOMExceptionName;M.ExceptionCode=Pn.ExceptionCode;M.ParseError=Pn.ParseError;var te=Xi();M.Attr=te.Attr;M.CDATASection=te.CDATASection;M.CharacterData=te.CharacterData;M.Comment=te.Comment;M.Document=te.Document;M.DocumentFragment=te.DocumentFragment;M.DocumentType=te.DocumentType;M.DOMImplementation=te.DOMImplementation;M.Element=te.Element;M.Entity=te.Entity;M.EntityReference=te.EntityReference;M.LiveNodeList=te.LiveNodeList;M.NamedNodeMap=te.NamedNodeMap;M.Node=te.Node;M.NodeList=te.NodeList;M.Notation=te.Notation;M.ProcessingInstruction=te.ProcessingInstruction;M.Text=te.Text;M.XMLSerializer=te.XMLSerializer;var $n=yo();M.DOMParser=$n.DOMParser;M.normalizeLineEndings=$n.normalizeLineEndings;M.onErrorStopParsing=$n.onErrorStopParsing;M.onWarningStopParsing=$n.onWarningStopParsing});import{Bag as kp}from"@gramlot/gramlot";var P={};Ma(P,{defineCollection:()=>ci});nn(P,oh);import*as oh from"@gramlot/gramlot/components";import{defineCollection as jl}from"@gramlot/gramlot/components";function ci(t){if(t.name!=="inputs")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 jl({...t,css:e,assets:r})}function an(t,e){return t.parameters=di(t.constructor.gramlotComponent,e),Object.fromEntries(Object.entries(e).filter(([r])=>!Object.hasOwn(t.parameters,r)))}function di(t,e){return Object.fromEntries(Object.entries(t.parameters).map(([r,n])=>[r,Object.hasOwn(e,r)?e[r]:n.default]))}function fi(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)}
7
7
  *,*::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")),e.append(r,this.controlBox)}projectAttributes(e){return an(this,e)}}}di.parameters={};function Ke(t){if(typeof t!="string"||!["^","="].includes(t[0])||t.startsWith("=="))return null;let e=t.indexOf(":");if(e<0)return null;let r=t[e+1]==="=";return{pointer:t.slice(0,e),expression:r,body:t.slice(e+(r?2:1))}}var Ra=/^\{(\??[A-Za-z_][A-Za-z0-9_]*|\?)?\}/;function sr(t,e){let r="",n=!1;for(let i=0;i<t.length;){if(t[i]!=="{"&&t[i]!=="}"){r+=t[i++];continue}let a=t.slice(i).match(Ra);if(!a)throw new SyntaxError("Invalid pointer template placeholder");let s=a[1]??"",o=s.startsWith("?"),l=e(o?s.slice(1):s);l==null||l===""&&!o?n=!0:r+=String(l),i+=a[0].length}return n?null:r}function fi(t){let e=[],r=new Set,n="",i=!0;for(let a=0;a<t.length;){let s=a,o=t[a];if(o==='"'||o==="'"||o==="`"){for(a++;a<t.length;){if(t[a]==="\\"){a+=2;continue}if(t[a++]===o)break}n+=t.slice(s,a),i=!1;continue}if(t.startsWith("//",a)){a=t.indexOf(`
9
- `,a),a<0&&(a=t.length),n+=t.slice(s,a);continue}if(t.startsWith("/*",a)){let c=t.indexOf("*/",a+2);a=c<0?t.length:c+2,n+=t.slice(s,a);continue}if(o==="/"&&i){let c=!1;for(a++;a<t.length;){let d=t[a++];if(d==="\\"){a++;continue}if(d==="[")c=!0;else if(d==="]")c=!1;else if(d==="/"&&!c)break}for(;/[a-z]/i.test(t[a]??"")&&a<t.length;)a++;n+=t.slice(s,a),i=!1;continue}let l=o==="{"?t.slice(a).match(Ra):null;if(l){let c=l[1]??"";if(c.startsWith("?"))throw new SyntaxError("Optional slots are supported in pointer templates only");n+=`_pointerValues[${e.length}]`,e.push(c),a+=l[0].length,i=!1;continue}let u=t.slice(a).match(/^[A-Za-z_$][\w$]*/);if(u){r.add(u[0]),n+=u[0],a+=u[0].length,i=["return","typeof","void","delete","new","in","instanceof","yield","await"].includes(u[0]);continue}n+=o,a++,/\s/.test(o)||(i=/[([{,:;=!?&|+*%~<>\/-]/.test(o))}return{text:n,slots:e,identifiers:r}}function La(t,e,r=()=>null){let n=new Map,i=[],a=s=>{if(n.has(s))return n.get(s);if(!t.has(s))throw new Error(`Referenced Source attribute '${s}' does not exist`);if(i.includes(s))throw new Error(`Cyclic attribute dependency: ${[...i,s].join(" -> ")}`);i.push(s);try{let o=t.get(s),l=typeof s=="string"?Ke(o):null,u=e.get(s);if(l){let c=d=>d?a(d):e.get(s);if(l.expression){let d=fi(l.body);u=r(s,o,d,d.slots.map(c))}else u=sr(l.body,c),e.get(s)==null&&(u=null)}return n.set(s,u),u}finally{i.pop()}};return new Map([...t.keys()].map(s=>[s,a(s)]))}function pi(t,e){let r=new Map([...Object.entries(t.getAttr()),...t.fixedAttrItems()]),n=new Set,i=[],a=s=>{let o=Ke(s);if(!o)return;let l=[];o.expression?l.push(...fi(o.body).slots):sr(o.body,u=>(l.push(u),""));for(let u of l.filter(Boolean)){if(!r.has(u))throw new Error(`Referenced Source attribute '${u}' does not exist`);if(i.includes(u))throw new Error(`Cyclic attribute dependency: ${[...i,u].join(" -> ")}`);n.has(u)||(i.push(u),a(r.get(u)),i.pop(),n.add(u))}};return a(e),n}/*!
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")),e.append(r,this.controlBox)}projectAttributes(e){return an(this,e)}}}fi.parameters={};function Ke(t){if(typeof t!="string"||!["^","="].includes(t[0])||t.startsWith("=="))return null;let e=t.indexOf(":");if(e<0)return null;let r=t[e+1]==="=";return{pointer:t.slice(0,e),expression:r,body:t.slice(e+(r?2:1))}}var La=/^\{(\??[A-Za-z_][A-Za-z0-9_]*|\?)?\}/;function sr(t,e){let r="",n=!1;for(let i=0;i<t.length;){if(t[i]!=="{"&&t[i]!=="}"){r+=t[i++];continue}let a=t.slice(i).match(La);if(!a)throw new SyntaxError("Invalid pointer template placeholder");let s=a[1]??"",o=s.startsWith("?"),l=e(o?s.slice(1):s);l==null||l===""&&!o?n=!0:r+=String(l),i+=a[0].length}return n?null:r}function pi(t){let e=[],r=new Set,n="",i=!0;for(let a=0;a<t.length;){let s=a,o=t[a];if(o==='"'||o==="'"||o==="`"){for(a++;a<t.length;){if(t[a]==="\\"){a+=2;continue}if(t[a++]===o)break}n+=t.slice(s,a),i=!1;continue}if(t.startsWith("//",a)){a=t.indexOf(`
9
+ `,a),a<0&&(a=t.length),n+=t.slice(s,a);continue}if(t.startsWith("/*",a)){let c=t.indexOf("*/",a+2);a=c<0?t.length:c+2,n+=t.slice(s,a);continue}if(o==="/"&&i){let c=!1;for(a++;a<t.length;){let d=t[a++];if(d==="\\"){a++;continue}if(d==="[")c=!0;else if(d==="]")c=!1;else if(d==="/"&&!c)break}for(;/[a-z]/i.test(t[a]??"")&&a<t.length;)a++;n+=t.slice(s,a),i=!1;continue}let l=o==="{"?t.slice(a).match(La):null;if(l){let c=l[1]??"";if(c.startsWith("?"))throw new SyntaxError("Optional slots are supported in pointer templates only");n+=`_pointerValues[${e.length}]`,e.push(c),a+=l[0].length,i=!1;continue}let u=t.slice(a).match(/^[A-Za-z_$][\w$]*/);if(u){r.add(u[0]),n+=u[0],a+=u[0].length,i=["return","typeof","void","delete","new","in","instanceof","yield","await"].includes(u[0]);continue}n+=o,a++,/\s/.test(o)||(i=/[([{,:;=!?&|+*%~<>\/-]/.test(o))}return{text:n,slots:e,identifiers:r}}function Pa(t,e,r=()=>null){let n=new Map,i=[],a=s=>{if(n.has(s))return n.get(s);if(!t.has(s))throw new Error(`Referenced Source attribute '${s}' does not exist`);if(i.includes(s))throw new Error(`Cyclic attribute dependency: ${[...i,s].join(" -> ")}`);i.push(s);try{let o=t.get(s),l=typeof s=="string"?Ke(o):null,u=e.get(s);if(l){let c=d=>d?a(d):e.get(s);if(l.expression){let d=pi(l.body);u=r(s,o,d,d.slots.map(c))}else u=sr(l.body,c),e.get(s)==null&&(u=null)}return n.set(s,u),u}finally{i.pop()}};return new Map([...t.keys()].map(s=>[s,a(s)]))}function hi(t,e){let r=new Map([...Object.entries(t.getAttr()),...t.fixedAttrItems()]),n=new Set,i=[],a=s=>{let o=Ke(s);if(!o)return;let l=[];o.expression?l.push(...pi(o.body).slots):sr(o.body,u=>(l.push(u),""));for(let u of l.filter(Boolean)){if(!r.has(u))throw new Error(`Referenced Source attribute '${u}' does not exist`);if(i.includes(u))throw new Error(`Cyclic attribute dependency: ${[...i,u].join(" -> ")}`);n.has(u)||(i.push(u),a(r.get(u)),i.pop(),n.add(u))}};return a(e),n}/*!
10
10
  * decimal.js v10.6.0
11
11
  * An arbitrary-precision Decimal type for JavaScript.
12
12
  * https://github.com/MikeMcl/decimal.js
13
13
  * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
14
14
  * MIT Licence
15
- */var It=9e15,rt=1e9,hi="0123456789abcdef",ln="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",un="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",mi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-It,maxE:It,crypto:!1},Fa,Ve,T=!0,dn="[DecimalError] ",tt=dn+"Invalid argument: ",qa=dn+"Precision limit exceeded",ja=dn+"crypto unavailable",Va="[object Decimal]",ce=Math.floor,Q=Math.pow,ql=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,jl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Vl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,za=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ce=1e7,D=7,zl=9007199254740991,Hl=ln.length-1,gi=un.length-1,b={toStringTag:Va};b.absoluteValue=b.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),E(t)};b.ceil=function(){return E(new this.constructor(this),this.e+1,2)};b.clampedTo=b.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(tt+e);return r=n.cmp(t),r<0?t:n.cmp(e)>0?e:new i(n)};b.comparedTo=b.cmp=function(t){var e,r,n,i,a=this,s=a.d,o=(t=new a.constructor(t)).d,l=a.s,u=t.s;if(!s||!o)return!l||!u?NaN:l!==u?l:s===o?0:!s^l<0?1:-1;if(!s[0]||!o[0])return s[0]?l:o[0]?-u:0;if(l!==u)return l;if(a.e!==t.e)return a.e>t.e^l<0?1:-1;for(n=s.length,i=o.length,e=0,r=n<i?n:i;e<r;++e)if(s[e]!==o[e])return s[e]>o[e]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};b.cosine=b.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=Wl(n,Xa(n,r)),n.precision=t,n.rounding=e,E(Ve==2||Ve==3?r.neg():r,t,e,!0)):new n(1):new n(NaN)};b.cubeRoot=b.cbrt=function(){var t,e,r,n,i,a,s,o,l,u,c=this,d=c.constructor;if(!c.isFinite()||c.isZero())return new d(c);for(T=!1,a=c.s*Q(c.s*c,1/3),!a||Math.abs(a)==1/0?(r=oe(c.d),t=c.e,(a=(t-r.length+1)%3)&&(r+=a==1||a==-2?"0":"00"),a=Q(r,1/3),t=ce((t+1)/3)-(t%3==(t<0?-1:2)),a==1/0?r="5e"+t:(r=a.toExponential(),r=r.slice(0,r.indexOf("e")+1)+t),n=new d(r),n.s=c.s):n=new d(a.toString()),s=(t=d.precision)+3;;)if(o=n,l=o.times(o).times(o),u=l.plus(c),n=q(u.plus(c).times(o),u.plus(l),s+2,1),oe(o.d).slice(0,s)===(r=oe(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(E(o,t+1,0),o.times(o).times(o).eq(c))){n=o;break}s+=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,d.rounding,e)};b.decimalPlaces=b.dp=function(){var t,e=this.d,r=NaN;if(e){if(t=e.length-1,r=(t-ce(this.e/D))*D,t=e[t],t)for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r};b.dividedBy=b.div=function(t){return q(this,new this.constructor(t))};b.dividedToIntegerBy=b.divToInt=function(t){var e=this,r=e.constructor;return E(q(e,new r(t),0,1,1),r.precision,r.rounding)};b.equals=b.eq=function(t){return this.cmp(t)===0};b.floor=function(){return E(new this.constructor(this),this.e+1,3)};b.greaterThan=b.gt=function(t){return this.cmp(t)>0};b.greaterThanOrEqualTo=b.gte=function(t){var e=this.cmp(t);return e==1||e===0};b.hyperbolicCosine=b.cosh=function(){var t,e,r,n,i,a=this,s=a.constructor,o=new s(1);if(!a.isFinite())return new s(a.s?1/0:NaN);if(a.isZero())return o;r=s.precision,n=s.rounding,s.precision=r+Math.max(a.e,a.sd())+4,s.rounding=1,i=a.d.length,i<32?(t=Math.ceil(i/3),e=(1/pn(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),a=Mt(s,1,a.times(e),new s(1),!0);for(var l,u=t,c=new s(8);u--;)l=a.times(a),a=o.minus(l.times(c.minus(l.times(c))));return E(a,s.precision=r,s.rounding=n,!0)};b.hyperbolicSine=b.sinh=function(){var t,e,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(e=a.precision,r=a.rounding,a.precision=e+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=Mt(a,2,i,i,!0);else{t=1.4*Math.sqrt(n),t=t>16?16:t|0,i=i.times(1/pn(5,t)),i=Mt(a,2,i,i,!0);for(var s,o=new a(5),l=new a(16),u=new a(20);t--;)s=i.times(i),i=i.times(o.plus(s.times(l.times(s).plus(u))))}return a.precision=e,a.rounding=r,E(i,e,r,!0)};b.hyperbolicTangent=b.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,q(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)};b.inverseCosine=b.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()?Be(e,n,i):new e(0):new e(NaN):t.isZero()?Be(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))};b.inverseHyperbolicCosine=b.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)};b.inverseHyperbolicSine=b.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())};b.inverseHyperbolicTangent=b.atanh=function(){var t,e,r,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=a.precision,e=a.rounding,n=i.sd(),Math.max(n,t)<2*-i.e-1?E(new a(i),t,e,!0):(a.precision=r=n-i.e,i=q(i.plus(1),new a(1).minus(i),r+t,1),a.precision=t+4,a.rounding=1,i=i.ln(),a.precision=t,a.rounding=e,i.times(.5))):new a(NaN)};b.inverseSine=b.asin=function(){var t,e,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(e=i.abs().cmp(1),r=a.precision,n=a.rounding,e!==-1?e===0?(t=Be(a,r+4,n).times(.5),t.s=i.s,t):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))};b.inverseTangent=b.atan=function(){var t,e,r,n,i,a,s,o,l,u=this,c=u.constructor,d=c.precision,f=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&d+4<=gi)return s=Be(c,d+4,f).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(d+4<=gi)return s=Be(c,d+4,f).times(.5),s.s=u.s,s}for(c.precision=o=d+10,c.rounding=1,r=Math.min(28,o/D+2|0),t=r;t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(T=!1,e=Math.ceil(o/D),n=1,l=u.times(u),s=new c(u),i=u;t!==-1;)if(i=i.times(l),a=s.minus(i.div(n+=2)),i=i.times(l),s=a.plus(i.div(n+=2)),s.d[e]!==void 0)for(t=e;s.d[t]===a.d[t]&&t--;);return r&&(s=s.times(2<<r-1)),T=!0,E(s,c.precision=d,c.rounding=f,!0)};b.isFinite=function(){return!!this.d};b.isInteger=b.isInt=function(){return!!this.d&&ce(this.e/D)>this.d.length-2};b.isNaN=function(){return!this.s};b.isNegative=b.isNeg=function(){return this.s<0};b.isPositive=b.isPos=function(){return this.s>0};b.isZero=function(){return!!this.d&&this.d[0]===0};b.lessThan=b.lt=function(t){return this.cmp(t)<0};b.lessThanOrEqualTo=b.lte=function(t){return this.cmp(t)<1};b.logarithm=b.log=function(t){var e,r,n,i,a,s,o,l,u=this,c=u.constructor,d=c.precision,f=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=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(e)if(r.length>1)a=!0;else{for(i=r[0];i%10===0;)i/=10;a=i!==1}if(T=!1,o=d+p,s=et(u,o),n=e?cn(c,o+10):et(t,o),l=q(s,n,o,1),or(l.d,i=d,f))do if(o+=10,s=et(u,o),n=e?cn(c,o+10):et(t,o),l=q(s,n,o,1),!a){+oe(l.d).slice(i+1,i+15)+1==1e14&&(l=E(l,d+1,0));break}while(or(l.d,i+=10,f));return T=!0,E(l,d,f)};b.minus=b.sub=function(t){var e,r,n,i,a,s,o,l,u,c,d,f,p=this,h=p.constructor;if(t=new h(t),!p.d||!t.d)return!p.s||!t.s?t=new h(NaN):p.d?t.s=-t.s:t=new h(t.d||p.s!==t.s?p:NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(u=p.d,f=t.d,o=h.precision,l=h.rounding,!u[0]||!f[0]){if(f[0])t.s=-t.s;else if(u[0])t=new h(p);else return new h(l===3?-0:0);return T?E(t,o,l):t}if(r=ce(t.e/D),c=ce(p.e/D),u=u.slice(),a=c-r,a){for(d=a<0,d?(e=u,a=-a,s=f.length):(e=f,r=c,s=u.length),n=Math.max(Math.ceil(o/D),s)+2,a>n&&(a=n,e.length=1),e.reverse(),n=a;n--;)e.push(0);e.reverse()}else{for(n=u.length,s=f.length,d=n<s,d&&(s=n),n=0;n<s;n++)if(u[n]!=f[n]){d=u[n]<f[n];break}a=0}for(d&&(e=u,u=f,f=e,t.s=-t.s),s=u.length,n=f.length-s;n>0;--n)u[s++]=0;for(n=f.length;n>a;){if(u[--n]<f[n]){for(i=n;i&&u[--i]===0;)u[i]=Ce-1;--u[i],u[n]+=Ce}u[n]-=f[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(t.d=u,t.e=fn(u,r),T?E(t,o,l):t):new h(l===3?-0:0)};b.modulo=b.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=q(r,t.abs(),0,3,1),e.s*=t.s):e=q(r,t,0,n.modulo,1),e=e.times(t),T=!0,r.minus(e))};b.naturalExponential=b.exp=function(){return bi(this)};b.naturalLogarithm=b.ln=function(){return et(this)};b.negated=b.neg=function(){var t=new this.constructor(this);return t.s=-t.s,E(t)};b.plus=b.add=function(t){var e,r,n,i,a,s,o,l,u,c,d=this,f=d.constructor;if(t=new f(t),!d.d||!t.d)return!d.s||!t.s?t=new f(NaN):d.d||(t=new f(t.d||d.s===t.s?d:NaN)),t;if(d.s!=t.s)return t.s=-t.s,d.minus(t);if(u=d.d,c=t.d,o=f.precision,l=f.rounding,!u[0]||!c[0])return c[0]||(t=new f(d)),T?E(t,o,l):t;if(a=ce(d.e/D),n=ce(t.e/D),u=u.slice(),i=a-n,i){for(i<0?(r=u,i=-i,s=c.length):(r=c,n=a,s=u.length),a=Math.ceil(o/D),s=a>s?a+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,r=c,c=u,u=r),e=0;i;)e=(u[--i]=u[i]+c[i]+e)/Ce|0,u[i]%=Ce;for(e&&(u.unshift(e),++n),s=u.length;u[--s]==0;)u.pop();return t.d=u,t.e=fn(u,n),T?E(t,o,l):t};b.precision=b.sd=function(t){var e,r=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(tt+t);return r.d?(e=Ha(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e};b.round=function(){var t=this,e=t.constructor;return E(new e(t),t.e+1,e.rounding)};b.sine=b.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=Yl(n,Xa(n,r)),n.precision=t,n.rounding=e,E(Ve>2?r.neg():r,t,e,!0)):new n(NaN)};b.squareRoot=b.sqrt=function(){var t,e,r,n,i,a,s=this,o=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!o||!o[0])return new c(!u||u<0&&(!o||o[0])?NaN:o?s:1/0);for(T=!1,u=Math.sqrt(+s),u==0||u==1/0?(e=oe(o),(e.length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=ce((l+1)/2)-(l<0||l%2),u==1/0?e="5e"+l:(e=u.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),n=new c(e)):n=new c(u.toString()),r=(l=c.precision)+3;;)if(a=n,n=a.plus(q(s,a,r+2,1)).times(.5),oe(a.d).slice(0,r)===(e=oe(n.d)).slice(0,r))if(e=e.slice(r-3,r+1),e=="9999"||!i&&e=="4999"){if(!i&&(E(a,l+1,0),a.times(a).eq(s))){n=a;break}r+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(E(n,l+1,1),t=!n.times(n).eq(s));break}return T=!0,E(n,l,c.rounding,t)};b.tangent=b.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=q(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,E(Ve==2||Ve==4?r.neg():r,t,e,!0)):new n(NaN)};b.times=b.mul=function(t){var e,r,n,i,a,s,o,l,u,c=this,d=c.constructor,f=c.d,p=(t=new d(t)).d;if(t.s*=c.s,!f||!f[0]||!p||!p[0])return new d(!t.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?t.s/0:t.s*0);for(r=ce(c.e/D)+ce(t.e/D),l=f.length,u=p.length,l<u&&(a=f,f=p,p=a,s=l,l=u,u=s),a=[],s=l+u,n=s;n--;)a.push(0);for(n=u;--n>=0;){for(e=0,i=l+n;i>n;)o=a[i]+p[n]*f[i-n-1]+e,a[i--]=o%Ce|0,e=o/Ce|0;a[i]=(a[i]+e)%Ce|0}for(;!a[--s];)a.pop();return e?++r:a.shift(),t.d=a,t.e=fn(a,r),T?E(t,d.precision,d.rounding):t};b.toBinary=function(t,e){return _i(this,2,t,e)};b.toDecimalPlaces=b.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(ge(t,0,rt),e===void 0?e=n.rounding:ge(e,0,8),E(r,t+r.e+1,e))};b.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Ie(n,!0):(ge(t,0,rt),e===void 0?e=i.rounding:ge(e,0,8),n=E(new i(n),t+1,e),r=Ie(n,!0,t+1)),n.isNeg()&&!n.isZero()?"-"+r:r};b.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?r=Ie(i):(ge(t,0,rt),e===void 0?e=a.rounding:ge(e,0,8),n=E(new a(i),t+i.e+1,e),r=Ie(n,!1,t+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};b.toFraction=function(t){var e,r,n,i,a,s,o,l,u,c,d,f,p=this,h=p.d,m=p.constructor;if(!h)return new m(p);if(u=r=new m(1),n=l=new m(0),e=new m(n),a=e.e=Ha(h)-p.e-1,s=a%D,e.d[0]=Q(10,s<0?D+s:s),t==null)t=a>0?e:u;else{if(o=new m(t),!o.isInt()||o.lt(u))throw Error(tt+o);t=o.gt(e)?a>0?e:u:o}for(T=!1,o=new m(oe(h)),c=m.precision,m.precision=a=h.length*D*2;d=q(o,e,0,1,1),i=r.plus(d.times(n)),i.cmp(t)!=1;)r=n,n=i,i=u,u=l.plus(d.times(i)),l=i,i=e,e=o.minus(d.times(i)),o=i;return i=q(t.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=p.s,f=q(u,n,a,1).minus(p).abs().cmp(q(l,r,a,1).minus(p).abs())<1?[u,n]:[l,r],m.precision=c,T=!0,f};b.toHexadecimal=b.toHex=function(t,e){return _i(this,16,t,e)};b.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:ge(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=q(r,t,0,e,1).times(t),T=!0,E(r)):(t.s=r.s,r=t),r};b.toNumber=function(){return+this};b.toOctal=function(t,e){return _i(this,8,t,e)};b.toPower=b.pow=function(t){var e,r,n,i,a,s,o=this,l=o.constructor,u=+(t=new l(t));if(!o.d||!t.d||!o.d[0]||!t.d[0])return new l(Q(+o,u));if(o=new l(o),o.eq(1))return o;if(n=l.precision,a=l.rounding,t.eq(1))return E(o,n,a);if(e=ce(t.e/D),e>=t.d.length-1&&(r=u<0?-u:u)<=zl)return i=Wa(l,o,r,n),t.s<0?new l(1).div(i):E(i,n,a);if(s=o.s,s<0){if(e<t.d.length-1)return new l(NaN);if((t.d[e]&1)==0&&(s=1),o.e==0&&o.d[0]==1&&o.d.length==1)return o.s=s,o}return r=Q(+o,u),e=r==0||!isFinite(r)?ce(u*(Math.log("0."+oe(o.d))/Math.LN10+o.e+1)):new l(r+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?s/0:0):(T=!1,l.rounding=o.s=1,r=Math.min(12,(e+"").length),i=bi(t.times(et(o,n+r)),n),i.d&&(i=E(i,n+5,1),or(i.d,n,a)&&(e=n+10,i=E(bi(t.times(et(o,e+r)),e),e+5,1),+oe(i.d).slice(n+1,n+15)+1==1e14&&(i=E(i,n+1,0)))),i.s=s,T=!0,l.rounding=a,E(i,n,a))};b.toPrecision=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Ie(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ge(t,1,rt),e===void 0?e=i.rounding:ge(e,0,8),n=E(new i(n),t,e),r=Ie(n,t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+r:r};b.toSignificantDigits=b.toSD=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(ge(t,1,rt),e===void 0?e=n.rounding:ge(e,0,8)),E(new n(r),t,e)};b.toString=function(){var t=this,e=t.constructor,r=Ie(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r};b.truncated=b.trunc=function(){return E(new this.constructor(this),this.e+1,1)};b.valueOf=b.toJSON=function(){var t=this,e=t.constructor,r=Ie(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};function oe(t){var e,r,n,i=t.length-1,a="",s=t[0];if(i>0){for(a+=s,e=1;e<i;e++)n=t[e]+"",r=D-n.length,r&&(a+=Qe(r)),a+=n;s=t[e],n=s+"",r=D-n.length,r&&(a+=Qe(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}function ge(t,e,r){if(t!==~~t||t<e||t>r)throw Error(tt+t)}function or(t,e,r,n){var i,a,s,o;for(a=t[0];a>=10;a/=10)--e;return--e<0?(e+=D,i=0):(i=Math.ceil((e+1)/D),e%=D),a=Q(10,D-e),o=t[i]%a|0,n==null?e<3?(e==0?o=o/100|0:e==1&&(o=o/10|0),s=r<4&&o==99999||r>3&&o==49999||o==5e4||o==0):s=(r<4&&o+1==a||r>3&&o+1==a/2)&&(t[i+1]/a/100|0)==Q(10,e-2)-1||(o==a/2||o==0)&&(t[i+1]/a/100|0)==0:e<4?(e==0?o=o/1e3|0:e==1?o=o/100|0:e==2&&(o=o/10|0),s=(n||r<4)&&o==9999||!n&&r>3&&o==4999):s=((n||r<4)&&o+1==a||!n&&r>3&&o+1==a/2)&&(t[i+1]/a/1e3|0)==Q(10,e-3)-1,s}function sn(t,e,r){for(var n,i=[0],a,s=0,o=t.length;s<o;){for(a=i.length;a--;)i[a]*=e;for(i[0]+=hi.indexOf(t.charAt(s++)),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 Wl(t,e){var r,n,i;if(e.isZero())return e;n=e.d.length,n<32?(r=Math.ceil(n/3),i=(1/pn(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),t.precision+=r,e=Mt(t,1,e.times(i),new t(1));for(var a=r;a--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=r,e}var q=(function(){function t(n,i,a){var s,o=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+o,n[l]=s%a|0,o=s/a|0;return o&&n.unshift(o),n}function e(n,i,a,s){var o,l;if(a!=s)l=a>s?1:-1;else for(o=l=0;o<a;o++)if(n[o]!=i[o]){l=n[o]>i[o]?1:-1;break}return l}function r(n,i,a,s){for(var o=0;a--;)n[a]-=o,o=n[a]<i[a]?1:0,n[a]=o*s+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,s,o,l){var u,c,d,f,p,h,m,g,_,v,w,x,B,L,Z,ie,ae,je,K,he,Ee=n.constructor,F=n.s==i.s?1:-1,J=n.d,S=i.d;if(!J||!J[0]||!S||!S[0])return new Ee(!n.s||!i.s||(J?S&&J[0]==S[0]:!S)?NaN:J&&J[0]==0||!S?F*0:F/0);for(l?(p=1,c=n.e-i.e):(l=Ce,p=D,c=ce(n.e/p)-ce(i.e/p)),K=S.length,ae=J.length,_=new Ee(F),v=_.d=[],d=0;S[d]==(J[d]||0);d++);if(S[d]>(J[d]||0)&&c--,a==null?(L=a=Ee.precision,s=Ee.rounding):o?L=a+(n.e-i.e)+1:L=a,L<0)v.push(1),h=!0;else{if(L=L/p+2|0,d=0,K==1){for(f=0,S=S[0],L++;(d<ae||f)&&L--;d++)Z=f*l+(J[d]||0),v[d]=Z/S|0,f=Z%S|0;h=f||d<ae}else{for(f=l/(S[0]+1)|0,f>1&&(S=t(S,f,l),J=t(J,f,l),K=S.length,ae=J.length),ie=K,w=J.slice(0,K),x=w.length;x<K;)w[x++]=0;he=S.slice(),he.unshift(0),je=S[0],S[1]>=l/2&&++je;do f=0,u=e(S,w,K,x),u<0?(B=w[0],K!=x&&(B=B*l+(w[1]||0)),f=B/je|0,f>1?(f>=l&&(f=l-1),m=t(S,f,l),g=m.length,x=w.length,u=e(m,w,g,x),u==1&&(f--,r(m,K<g?he:S,g,l))):(f==0&&(u=f=1),m=S.slice()),g=m.length,g<x&&m.unshift(0),r(w,m,x,l),u==-1&&(x=w.length,u=e(S,w,K,x),u<1&&(f++,r(w,K<x?he:S,x,l))),x=w.length):u===0&&(f++,w=[0]),v[d++]=f,u&&w[0]?w[x++]=J[ie]||0:(w=[J[ie]],x=1);while((ie++<ae||w[0]!==void 0)&&L--);h=w[0]!==void 0}v[0]||v.shift()}if(p==1)_.e=c,Fa=h;else{for(d=1,f=v[0];f>=10;f/=10)d++;_.e=d+c*p-1,E(_,o?a+_.e+1:a,s,h)}return _}})();function E(t,e,r,n){var i,a,s,o,l,u,c,d,f,p=t.constructor;e:if(e!=null){if(d=t.d,!d)return t;for(i=1,o=d[0];o>=10;o/=10)i++;if(a=e-i,a<0)a+=D,s=e,c=d[f=0],l=c/Q(10,i-s-1)%10|0;else if(f=Math.ceil((a+1)/D),o=d.length,f>=o)if(n){for(;o++<=f;)d.push(0);c=l=0,i=1,a%=D,s=a-D+1}else break e;else{for(c=o=d[f],i=1;o>=10;o/=10)i++;a%=D,s=a-D+i,l=s<0?0:c/Q(10,i-s-1)%10|0}if(n=n||e<0||d[f+1]!==void 0||(s<0?c:c%Q(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(t.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(a>0?s>0?c/Q(10,i-s):0:d[f-1])%10&1||r==(t.s<0?8:7)),e<1||!d[0])return d.length=0,u?(e-=t.e+1,d[0]=Q(10,(D-e%D)%D),t.e=-e||0):d[0]=t.e=0,t;if(a==0?(d.length=f,o=1,f--):(d.length=f+1,o=Q(10,D-a),d[f]=s>0?(c/Q(10,i-s)%Q(10,s)|0)*o:0),u)for(;;)if(f==0){for(a=1,s=d[0];s>=10;s/=10)a++;for(s=d[0]+=o,o=1;s>=10;s/=10)o++;a!=o&&(t.e++,d[0]==Ce&&(d[0]=1));break}else{if(d[f]+=o,d[f]!=Ce)break;d[f--]=0,o=1}for(a=d.length;d[--a]===0;)d.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 Ie(t,e,r){if(!t.isFinite())return Ya(t);var n,i=t.e,a=oe(t.d),s=a.length;return e?(r&&(n=r-s)>0?a=a.charAt(0)+"."+a.slice(1)+Qe(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(t.e<0?"e":"e+")+t.e):i<0?(a="0."+Qe(-i-1)+a,r&&(n=r-s)>0&&(a+=Qe(n))):i>=s?(a+=Qe(i+1-s),r&&(n=r-i-1)>0&&(a=a+"."+Qe(n))):((n=i+1)<s&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(a+="."),a+=Qe(n))),a}function fn(t,e){var r=t[0];for(e*=D;r>=10;r/=10)e++;return e}function cn(t,e,r){if(e>Hl)throw T=!0,r&&(t.precision=r),Error(qa);return E(new t(ln),e,1,!0)}function Be(t,e,r){if(e>gi)throw Error(qa);return E(new t(un),e,r,!0)}function Ha(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 Qe(t){for(var e="";t--;)e+="0";return e}function Wa(t,e,r,n){var i,a=new t(1),s=Math.ceil(n/D+4);for(T=!1;;){if(r%2&&(a=a.times(e),$a(a.d,s)&&(i=!0)),r=ce(r/2),r===0){r=a.d.length-1,i&&a.d[r]===0&&++a.d[r];break}e=e.times(e),$a(e.d,s)}return T=!0,a}function Pa(t){return t.d[t.d.length-1]&1}function Ga(t,e,r){for(var n,i,a=new t(e[0]),s=0;++s<e.length;){if(i=new t(e[s]),!i.s){a=i;break}n=a.cmp(i),(n===r||n===0&&a.s===r)&&(a=i)}return a}function bi(t,e){var r,n,i,a,s,o,l,u=0,c=0,d=0,f=t.constructor,p=f.rounding,h=f.precision;if(!t.d||!t.d[0]||t.e>17)return new f(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,l=h):l=e,o=new f(.03125);t.e>-2;)t=t.times(o),d+=5;for(n=Math.log(Q(2,d))/Math.LN10*2+5|0,l+=n,r=a=s=new f(1),f.precision=l;;){if(a=E(a.times(t),l,1),r=r.times(++c),o=s.plus(q(a,r,l,1)),oe(o.d).slice(0,l)===oe(s.d).slice(0,l)){for(i=d;i--;)s=E(s.times(s),l,1);if(e==null)if(u<3&&or(s.d,l-n,p,u))f.precision=l+=10,r=a=o=new f(1),c=0,u++;else return E(s,f.precision=h,p,T=!0);else return f.precision=h,s}s=o}}function et(t,e){var r,n,i,a,s,o,l,u,c,d,f,p=1,h=10,m=t,g=m.d,_=m.constructor,v=_.rounding,w=_.precision;if(m.s<0||!g||!g[0]||!m.e&&g[0]==1&&g.length==1)return new _(g&&!g[0]?-1/0:m.s!=1?NaN:g?0:m);if(e==null?(T=!1,c=w):c=e,_.precision=c+=h,r=oe(g),n=r.charAt(0),Math.abs(a=m.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(t),r=oe(m.d),n=r.charAt(0),p++;a=m.e,n>1?(m=new _("0."+r),a++):m=new _(n+"."+r.slice(1))}else return u=cn(_,c+2,w).times(a+""),m=et(new _(n+"."+r.slice(1)),c-h).plus(u),_.precision=w,e==null?E(m,w,v,T=!0):m;for(d=m,l=s=m=q(m.minus(1),m.plus(1),c,1),f=E(m.times(m),c,1),i=3;;){if(s=E(s.times(f),c,1),u=l.plus(q(s,new _(i),c,1)),oe(u.d).slice(0,c)===oe(l.d).slice(0,c))if(l=l.times(2),a!==0&&(l=l.plus(cn(_,c+2,w).times(a+""))),l=q(l,new _(p),c,1),e==null)if(or(l.d,c-h,v,o))_.precision=c+=h,u=s=m=q(d.minus(1),d.plus(1),c,1),f=E(m.times(m),c,1),i=o=1;else return E(l,_.precision=w,v,T=!0);else return _.precision=w,l;l=u,i+=2}}function Ya(t){return String(t.s*t.s/0)}function on(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 Gl(t,e){var r,n,i,a,s,o,l,u,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),za.test(e))return on(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(jl.test(e))r=16,e=e.toLowerCase();else if(ql.test(e))r=2;else if(Vl.test(e))r=8;else throw Error(tt+e);for(a=e.search(/p/i),a>0?(l=+e.slice(a+1),e=e.substring(2,a)):e=e.slice(2),a=e.indexOf("."),s=a>=0,n=t.constructor,s&&(e=e.replace(".",""),o=e.length,a=o-a,i=Wa(n,new n(r),a,a*2)),u=sn(e,r,Ce),c=u.length-1,a=c;u[a]===0;--a)u.pop();return a<0?new n(t.s*0):(t.e=fn(u,c),t.d=u,T=!1,s&&(t=q(t,i,o*4)),l&&(t=t.times(Math.abs(l)<54?Q(2,l):lr.pow(2,l))),T=!0,t)}function Yl(t,e){var r,n=e.d.length;if(n<3)return e.isZero()?e:Mt(t,2,e,e);r=1.4*Math.sqrt(n),r=r>16?16:r|0,e=e.times(1/pn(5,r)),e=Mt(t,2,e,e);for(var i,a=new t(5),s=new t(16),o=new t(20);r--;)i=e.times(e),e=e.times(a.plus(i.times(s.times(i).minus(o))));return e}function Mt(t,e,r,n,i){var a,s,o,l,u=1,c=t.precision,d=Math.ceil(c/D);for(T=!1,l=r.times(r),o=new t(n);;){if(s=q(o.times(l),new t(e++*e++),c,1),o=i?n.plus(s):n.minus(s),n=q(s.times(l),new t(e++*e++),c,1),s=o.plus(n),s.d[d]!==void 0){for(a=d;s.d[a]===o.d[a]&&a--;);if(a==-1)break}a=o,o=n,n=s,s=a,u++}return T=!0,s.d.length=d+1,s}function pn(t,e){for(var r=t;--e;)r*=t;return r}function Xa(t,e){var r,n=e.s<0,i=Be(t,t.precision,1),a=i.times(.5);if(e=e.abs(),e.lte(a))return Ve=n?4:1,e;if(r=e.divToInt(i),r.isZero())Ve=n?3:2;else{if(e=e.minus(r.times(i)),e.lte(a))return Ve=Pa(r)?n?2:3:n?4:1,e;Ve=Pa(r)?n?1:4:n?3:2}return e.minus(i).abs()}function _i(t,e,r,n){var i,a,s,o,l,u,c,d,f,p=t.constructor,h=r!==void 0;if(h?(ge(r,1,rt),n===void 0?n=p.rounding:ge(n,0,8)):(r=p.precision,n=p.rounding),!t.isFinite())c=Ya(t);else{for(c=Ie(t),s=c.indexOf("."),h?(i=2,e==16?r=r*4-3:e==8&&(r=r*3-2)):i=e,s>=0&&(c=c.replace(".",""),f=new p(1),f.e=c.length-s,f.d=sn(Ie(f),10,i),f.e=f.d.length),d=sn(c,10,i),a=l=d.length;d[--l]==0;)d.pop();if(!d[0])c=h?"0p+0":"0";else{if(s<0?a--:(t=new p(t),t.d=d,t.e=a,t=q(t,f,r,n,0,i),d=t.d,a=t.e,u=Fa),s=d[r],o=i/2,u=u||d[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(t.s<0?3:2)):s>o||s===o&&(n===4||u||n===6&&d[r-1]&1||n===(t.s<0?8:7)),d.length=r,u)for(;++d[--r]>i-1;)d[r]=0,r||(++a,d.unshift(1));for(l=d.length;!d[l-1];--l);for(s=0,c="";s<l;s++)c+=hi.charAt(d[s]);if(h){if(l>1)if(e==16||e==8){for(s=e==16?4:3,--l;l%s;l++)c+="0";for(d=sn(c,i,e),l=d.length;!d[l-1];--l);for(s=1,c="1.";s<l;s++)c+=hi.charAt(d[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)c="0"+c;c="0."+c}else if(++a>l)for(a-=l;a--;)c+="0";else a<l&&(c=c.slice(0,a)+"."+c.slice(a))}c=(e==16?"0x":e==2?"0b":e==8?"0o":"")+c}return t.s<0?"-"+c:c}function $a(t,e){if(t.length>e)return t.length=e,!0}function Xl(t){return new this(t).abs()}function Zl(t){return new this(t).acos()}function Jl(t){return new this(t).acosh()}function Kl(t,e){return new this(t).plus(e)}function Ql(t){return new this(t).asin()}function eu(t){return new this(t).asinh()}function tu(t){return new this(t).atan()}function ru(t){return new this(t).atanh()}function nu(t,e){t=new this(t),e=new this(e);var r,n=this.precision,i=this.rounding,a=n+4;return!t.s||!e.s?r=new this(NaN):!t.d&&!e.d?(r=Be(this,a,1).times(e.s>0?.25:.75),r.s=t.s):!e.d||t.isZero()?(r=e.s<0?Be(this,n,i):new this(0),r.s=t.s):!t.d||e.isZero()?(r=Be(this,a,1).times(.5),r.s=t.s):e.s<0?(this.precision=a,this.rounding=1,r=this.atan(q(t,e,a,1)),e=Be(this,a,1),this.precision=n,this.rounding=i,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(q(t,e,a,1)),r}function iu(t){return new this(t).cbrt()}function au(t){return E(t=new this(t),t.e+1,2)}function su(t,e,r){return new this(t).clamp(e,r)}function ou(t){if(!t||typeof t!="object")throw Error(dn+"Object expected");var e,r,n,i=t.defaults===!0,a=["precision",1,rt,"rounding",0,8,"toExpNeg",-It,0,"toExpPos",0,It,"maxE",0,It,"minE",-It,0,"modulo",0,9];for(e=0;e<a.length;e+=3)if(r=a[e],i&&(this[r]=mi[r]),(n=t[r])!==void 0)if(ce(n)===n&&n>=a[e+1]&&n<=a[e+2])this[r]=n;else throw Error(tt+r+": "+n);if(r="crypto",i&&(this[r]=mi[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(ja);else this[r]=!1;else throw Error(tt+r+": "+n);return this}function lu(t){return new this(t).cos()}function uu(t){return new this(t).cosh()}function Za(t){var e,r,n;function i(a){var s,o,l,u=this;if(!(u instanceof i))return new i(a);if(u.constructor=i,Ua(a)){u.s=a.s,T?!a.d||a.e>i.maxE?(u.e=NaN,u.d=null):a.e<i.minE?(u.e=0,u.d=[0]):(u.e=a.e,u.d=a.d.slice()):(u.e=a.e,u.d=a.d?a.d.slice():a.d);return}if(l=typeof a,l==="number"){if(a===0){u.s=1/a<0?-1:1,u.e=0,u.d=[0];return}if(a<0?(a=-a,u.s=-1):u.s=1,a===~~a&&a<1e7){for(s=0,o=a;o>=10;o/=10)s++;T?s>i.maxE?(u.e=NaN,u.d=null):s<i.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[a]):(u.e=s,u.d=[a]);return}if(a*0!==0){a||(u.s=NaN),u.e=NaN,u.d=null;return}return on(u,a.toString())}if(l==="string")return(o=a.charCodeAt(0))===45?(a=a.slice(1),u.s=-1):(o===43&&(a=a.slice(1)),u.s=1),za.test(a)?on(u,a):Gl(u,a);if(l==="bigint")return a<0?(a=-a,u.s=-1):u.s=1,on(u,a.toString());throw Error(tt+a)}if(i.prototype=b,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=ou,i.clone=Za,i.isDecimal=Ua,i.abs=Xl,i.acos=Zl,i.acosh=Jl,i.add=Kl,i.asin=Ql,i.asinh=eu,i.atan=tu,i.atanh=ru,i.atan2=nu,i.cbrt=iu,i.ceil=au,i.clamp=su,i.cos=lu,i.cosh=uu,i.div=cu,i.exp=du,i.floor=fu,i.hypot=pu,i.ln=hu,i.log=mu,i.log10=bu,i.log2=gu,i.max=_u,i.min=wu,i.mod=yu,i.mul=vu,i.pow=ku,i.random=Eu,i.round=xu,i.sign=Du,i.sin=Au,i.sinh=Tu,i.sqrt=Cu,i.sub=Nu,i.sum=Su,i.tan=Ou,i.tanh=Bu,i.trunc=Iu,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 cu(t,e){return new this(t).div(e)}function du(t){return new this(t).exp()}function fu(t){return E(t=new this(t),t.e+1,3)}function pu(){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 Ua(t){return t instanceof lr||t&&t.toStringTag===Va||!1}function hu(t){return new this(t).ln()}function mu(t,e){return new this(t).log(e)}function gu(t){return new this(t).log(2)}function bu(t){return new this(t).log(10)}function _u(){return Ga(this,arguments,-1)}function wu(){return Ga(this,arguments,1)}function yu(t,e){return new this(t).mod(e)}function vu(t,e){return new this(t).mul(e)}function ku(t,e){return new this(t).pow(e)}function Eu(t){var e,r,n,i,a=0,s=new this(1),o=[];if(t===void 0?t=this.precision:ge(t,1,rt),n=Math.ceil(t/D),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));a<n;)i=e[a],i>=429e7?e[a]=crypto.getRandomValues(new Uint32Array(1))[0]:o[a++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);a<n;)i=e[a]+(e[a+1]<<8)+(e[a+2]<<16)+((e[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(e,a):(o.push(i%1e7),a+=4);a=n/4}else throw Error(ja);else for(;a<n;)o[a++]=Math.random()*1e7|0;for(n=o[--a],t%=D,n&&t&&(i=Q(10,D-t),o[a]=(n/i|0)*i);o[a]===0;a--)o.pop();if(a<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 s.e=r,s.d=o,s}function xu(t){return E(t=new this(t),t.e+1,this.rounding)}function Du(t){return t=new this(t),t.d?t.d[0]?t.s:0*t.s:t.s||NaN}function Au(t){return new this(t).sin()}function Tu(t){return new this(t).sinh()}function Cu(t){return new this(t).sqrt()}function Nu(t,e){return new this(t).sub(e)}function Su(){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 Ou(t){return new this(t).tan()}function Bu(t){return new this(t).tanh()}function Iu(t){return E(t=new this(t),t.e+1,1)}b[Symbol.for("nodejs.util.inspect.custom")]=b.toString;b[Symbol.toStringTag]="Decimal";var lr=b.constructor=Za(mi);ln=new lr(ln);un=new lr(un);var Ja=lr;var Mu=20,Ru=1,pt=1e6,Ka=1e6,Lu=-7,Pu=21,$u=!1,ur="[big.js] ",ht=ur+"Invalid ",hn=ht+"decimal places",Uu=ht+"rounding mode",Qa=ur+"Division by zero",$={},Me=void 0,Fu=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function es(){function t(e){var r=this;if(!(r instanceof t))return e===Me?es():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(ht+"value");e=e===0&&1/e<0?"-0":String(e)}qu(r,e)}r.constructor=t}return t.prototype=$,t.DP=Mu,t.RM=Ru,t.NE=Lu,t.PE=Pu,t.strict=$u,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function qu(t,e){var r,n,i;if(!Fu.test(e))throw Error(ht+"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 mt(t,e,r,n){var i=t.c;if(r===Me&&(r=t.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(Uu);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]!==Me))),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]!==Me||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 gt(t,e,r){var n=t.e,i=t.c.join(""),a=i.length;if(e)i=i.charAt(0)+(a>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>a)for(n-=a;n--;)i+="0";else n<a&&(i=i.slice(0,n)+"."+i.slice(n));else a>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,a=r.s,s=t.s,o=r.e,l=t.e;if(!n[0]||!i[0])return n[0]?a:i[0]?-s:0;if(a!=s)return a;if(e=a<0,o!=l)return o>l^e?1:-1;for(s=(o=n.length)<(l=i.length)?o:l,a=-1;++a<s;)if(n[a]!=i[a])return n[a]>i[a]^e?1:-1;return o==l?0:o>l^e?1:-1};$.div=function(t){var e=this,r=e.constructor,n=e.c,i=(t=new r(t)).c,a=e.s==t.s?1:-1,s=r.DP;if(s!==~~s||s<0||s>pt)throw Error(hn);if(!i[0])throw Error(Qa);if(!n[0])return t.s=a,t.c=[t.e=0],t;var o,l,u,c,d,f=i.slice(),p=o=i.length,h=n.length,m=n.slice(0,o),g=m.length,_=t,v=_.c=[],w=0,x=s+(_.e=e.e-t.e)+1;for(_.s=a,a=x<0?0:x,f.unshift(0);g++<o;)m.push(0);do{for(u=0;u<10;u++){if(o!=(g=m.length))c=o>g?1:-1;else for(d=-1,c=0;++d<o;)if(i[d]!=m[d]){c=i[d]>m[d]?1:-1;break}if(c<0){for(l=g==o?i:f;g;){if(m[--g]<l[g]){for(d=g;d&&!m[--d];)m[d]=9;--m[d],m[g]+=10}m[g]-=l[g]}for(;!m[0];)m.shift()}else break}v[w++]=c?u:++u,m[0]&&c?m[g]=n[p]||0:m=[n[p]]}while((p++<h||m[0]!==Me)&&a--);return!v[0]&&w!=1&&(v.shift(),_.e--,x--),w>x&&mt(_,x,r.RM,m[0]!==Me),_};$.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,a=this,s=a.constructor,o=a.s,l=(t=new s(t)).s;if(o!=l)return t.s=-l,a.plus(t);var u=a.c.slice(),c=a.e,d=t.c,f=t.e;if(!u[0]||!d[0])return d[0]?t.s=-l:u[0]?t=new s(a):t.s=1,t;if(o=c-f){for((i=o<0)?(o=-o,n=u):(f=c,n=d),n.reverse(),l=o;l--;)n.push(0);n.reverse()}else for(r=((i=u.length<d.length)?u:d).length,o=l=0;l<r;l++)if(u[l]!=d[l]){i=u[l]<d[l];break}if(i&&(n=u,u=d,d=n,t.s=-t.s),(l=(r=d.length)-(e=u.length))>0)for(;l--;)u[e++]=0;for(l=e;r>o;){if(u[--r]<d[r]){for(e=r;e&&!u[--e];)u[e]=9;--u[e],u[r]+=10}u[r]-=d[r]}for(;u[--l]===0;)u.pop();for(;u[0]===0;)u.shift(),--f;return u[0]||(t.s=1,u=[f=0]),t.c=u,t.e=f,t};$.mod=function(t){var e,r=this,n=r.constructor,i=r.s,a=(t=new n(t)).s;if(!t.c[0])throw Error(Qa);return r.s=t.s=1,e=t.cmp(r)==1,r.s=i,t.s=a,e?new n(r):(i=n.DP,a=n.RM,n.DP=n.RM=0,r=r.div(t),n.DP=i,n.RM=a,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,a=i.constructor;if(t=new a(t),i.s!=t.s)return t.s=-t.s,i.minus(t);var s=i.e,o=i.c,l=t.e,u=t.c;if(!o[0]||!u[0])return u[0]||(o[0]?t=new a(i):t.s=i.s),t;if(o=o.slice(),e=s-l){for(e>0?(l=s,n=u):(e=-e,n=o),n.reverse();e--;)n.push(0);n.reverse()}for(o.length-u.length<0&&(n=u,u=o,o=n),e=u.length,r=0;e;o[e]%=10)r=(o[--e]=o[e]+u[e]+r)/10|0;for(r&&(o.unshift(r),++l),e=o.length;o[--e]===0;)o.pop();return t.c=o,t.e=l,t};$.pow=function(t){var e=this,r=new e.constructor("1"),n=r,i=t<0;if(t!==~~t||t<-Ka||t>Ka)throw Error(ht+"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>pt)throw Error(ht+"precision");return mt(new this.constructor(this),t,e)};$.round=function(t,e){if(t===Me)t=0;else if(t!==~~t||t<-pt||t>pt)throw Error(hn);return mt(new this.constructor(this),t+this.e+1,e)};$.sqrt=function(){var t,e,r,n=this,i=n.constructor,a=n.s,s=n.e,o=new i("0.5");if(!n.c[0])return new i(n);if(a<0)throw Error(ur+"No square root");a=Math.sqrt(+gt(n,!0,!0)),a===0||a===1/0?(e=n.c.join(""),e.length+s&1||(e+="0"),a=Math.sqrt(e),s=((s+1)/2|0)-(s<0||s&1),t=new i((a==1/0?"5e":(a=a.toExponential()).slice(0,a.indexOf("e")+1))+s)):t=new i(a+""),s=t.e+(i.DP+=4);do r=t,t=o.times(r.plus(n.div(r)));while(r.c.slice(0,s).join("")!==t.c.slice(0,s).join(""));return mt(t,(i.DP-=4)+t.e+1,i.RM)};$.times=$.mul=function(t){var e,r=this,n=r.constructor,i=r.c,a=(t=new n(t)).c,s=i.length,o=a.length,l=r.e,u=t.e;if(t.s=r.s==t.s?1:-1,!i[0]||!a[0])return t.c=[t.e=0],t;for(t.e=l+u,s<o&&(e=i,i=a,a=e,u=s,s=o,o=u),e=new Array(u=s+o);u--;)e[u]=0;for(l=o;l--;){for(o=0,u=s+l;u>l;)o=e[u]+a[l]*i[u-l-1]+o,e[u--]=o%10,o=o/10|0;e[u]=o}for(o?++t.e:e.shift(),l=e.length;!e[--l];)e.pop();return t.c=e,t};$.toExponential=function(t,e){var r=this,n=r.c[0];if(t!==Me){if(t!==~~t||t<0||t>pt)throw Error(hn);for(r=mt(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return gt(r,!0,!!n)};$.toFixed=function(t,e){var r=this,n=r.c[0];if(t!==Me){if(t!==~~t||t<0||t>pt)throw Error(hn);for(r=mt(new r.constructor(r),t+r.e+1,e),t=t+r.e+1;r.c.length<t;)r.c.push(0)}return gt(r,!1,!!n)};$[Symbol.for("nodejs.util.inspect.custom")]=$.toJSON=$.toString=function(){var t=this,e=t.constructor;return gt(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])};$.toNumber=function(){var t=+gt(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(t.toString()))throw Error(ur+"Imprecise conversion");return t};$.toPrecision=function(t,e){var r=this,n=r.constructor,i=r.c[0];if(t!==Me){if(t!==~~t||t<1||t>pt)throw Error(ht+"precision");for(r=mt(new n(r),t,e);r.c.length<t;)r.c.push(0)}return gt(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(ur+"valueOf disallowed");return gt(t,t.e<=e.NE||t.e>=e.PE,!0)};var ju=es(),ts=ju;var Ni={};Ia(Ni,{DecodeError:()=>de,Decoder:()=>Se,EXT_TIMESTAMP:()=>yi,Encoder:()=>Rt,ExtData:()=>Ne,ExtensionCodec:()=>nt,decode:()=>cs,decodeArrayStream:()=>ps,decodeAsync:()=>fs,decodeMulti:()=>ds,decodeMultiStream:()=>hs,decodeTimestampExtension:()=>Di,decodeTimestampToTimeSpec:()=>xi,encode:()=>bn,encodeDateToTimeSpec:()=>ki,encodeTimeSpecToTimestamp:()=>vi,encodeTimestampExtension:()=>Ei});function rs(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 a=t.charCodeAt(n);(a&64512)===56320&&(++n,i=((i&1023)<<10)+(a&1023)+65536)}(i&4294901760)===0?r+=3:r+=4}}return r}function Vu(t,e,r){let n=t.length,i=r,a=0;for(;a<n;){let s=t.charCodeAt(a++);if((s&4294967168)===0){e[i++]=s;continue}else if((s&4294965248)===0)e[i++]=s>>6&31|192;else{if(s>=55296&&s<=56319&&a<n){let o=t.charCodeAt(a);(o&64512)===56320&&(++a,s=((s&1023)<<10)+(o&1023)+65536)}(s&4294901760)===0?(e[i++]=s>>12&15|224,e[i++]=s>>6&63|128):(e[i++]=s>>18&7|240,e[i++]=s>>12&63|128,e[i++]=s>>6&63|128)}e[i++]=s&63|128}}var zu=new TextEncoder,Hu=50;function Wu(t,e,r){zu.encodeInto(t,e.subarray(r))}function ns(t,e,r){t.length>Hu?Wu(t,e,r):Vu(t,e,r)}var Gu=4096;function wi(t,e,r){let n=e,i=n+r,a=[],s="";for(;n<i;){let o=t[n++];if((o&128)===0)a.push(o);else if((o&224)===192){let l=t[n++]&63;a.push((o&31)<<6|l)}else if((o&240)===224){let l=t[n++]&63,u=t[n++]&63;a.push((o&31)<<12|l<<6|u)}else if((o&248)===240){let l=t[n++]&63,u=t[n++]&63,c=t[n++]&63,d=(o&7)<<18|l<<12|u<<6|c;d>65535&&(d-=65536,a.push(d>>>10&1023|55296),d=56320|d&1023),a.push(d)}else a.push(o);a.length>=Gu&&(s+=String.fromCharCode(...a),a.length=0)}return a.length>0&&(s+=String.fromCharCode(...a)),s}var Yu=new TextDecoder,Xu=200;function Zu(t,e,r){let n=t.subarray(e,e+r);return Yu.decode(n)}function is(t,e,r){return r>Xu?Zu(t,e,r):wi(t,e,r)}var Ne=class{type;data;constructor(e,r){this.type=e,this.data=r}};var de=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 as(t,e,r){let n=r/4294967296,i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function mn(t,e,r){let n=Math.floor(r/4294967296),i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function gn(t,e){let r=t.getInt32(e),n=t.getUint32(e+4);return r*4294967296+n}function ss(t,e){let r=t.getUint32(e),n=t.getUint32(e+4);return r*4294967296+n}var yi=-1,Ju=4294967296-1,Ku=17179869184-1;function vi({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=Ku)if(e===0&&t<=Ju){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),a=new DataView(i.buffer);return a.setUint32(0,e<<2|r&3),a.setUint32(4,n),i}else{let r=new Uint8Array(12),n=new DataView(r.buffer);return n.setUint32(0,e),mn(n,4,t),r}}function ki(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 Ei(t){if(t instanceof Date){let e=ki(t);return vi(e)}else return null}function xi(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,a=r>>>2;return{sec:i,nsec:a}}case 12:{let r=gn(e,4),n=e.getUint32(0);return{sec:r,nsec:n}}default:throw new de(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function Di(t){let e=xi(t);return new Date(e.sec*1e3+e.nsec/1e6)}var os={type:yi,encode:Ei,decode:Di};var nt=class t{static defaultCodec=new t;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(os)}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 a=i(e,r);if(a!=null){let s=-1-n;return new Ne(s,a)}}}for(let n=0;n<this.encoders.length;n++){let i=this.encoders[n];if(i!=null){let a=i(e,r);if(a!=null){let s=n;return new Ne(s,a)}}}return e instanceof Ne?e:null}decode(e,r,n){let i=r<0?this.builtInDecoders[-1-r]:this.decoders[r];return i?i(e,r,n):new Ne(r,e)}};function Qu(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function cr(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Qu(t)?new Uint8Array(t):Uint8Array.from(t)}var ec=100,tc=2048,Rt=class t{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??nt.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??ec,this.initialBufferSize=e?.initialBufferSize??tc,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=rs(e);this.ensureBufferSizeToWrite(5+n),this.writeStringHeader(n),ns(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=cr(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 a of n){let s=e[a];this.ignoreUndefined&&s===void 0||(this.encodeString(a),this.doEncode(s,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),as(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),mn(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 bn(t,e){return new Rt(e).encodeSharedRef(t)}function _n(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}var rc=16,nc=16,wn=class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(e=rc,r=nc){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 a of i){let s=a.bytes;for(let o=0;o<n;o++)if(s[o]!==e[r+o])continue e;return a.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 a=wi(e,r,n),s=Uint8Array.prototype.slice.call(e,r,r+n);return this.store(s,a),a}};var Ai="array",pr="map_key",us="map_value",ic=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new de("The type of key must be string or number but "+typeof t)},Ti=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let r=this.getUninitializedStateFromPool();r.type=Ai,r.position=0,r.size=e,r.array=new Array(e)}pushMapState(e){let r=this.getUninitializedStateFromPool();r.type=pr,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===Ai){let n=e;n.size=0,n.array=void 0,n.position=0,n.type=void 0}if(e.type===pr||e.type===us){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}},fr=-1,Ci=new DataView(new ArrayBuffer(0)),ac=new Uint8Array(Ci.buffer);try{Ci.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 ls=new RangeError("Insufficient data"),sc=new wn,Se=class t{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=Ci;bytes=ac;headByte=fr;stack=new Ti;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??nt.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:sc,this.mapKeyConverter=e?.mapKeyConverter??ic}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=fr,this.stack.reset()}setBuffer(e){let r=cr(e);this.bytes=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===fr&&!this.hasRemaining(1))this.setBuffer(e);else{let r=this.bytes.subarray(this.pos),n=cr(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(l){if(!(l instanceof RangeError))throw l}this.totalPos+=this.pos}if(r){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return n}let{headByte:i,pos:a,totalPos:s}=this;throw new RangeError(`Insufficient data in parsing ${_n(i)} at ${s} (${a} 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 a of e){if(r&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a),n&&(i=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(s){if(!(s instanceof RangeError))throw s}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 de(`Unrecognized type byte: ${_n(e)}`);this.complete();let n=this.stack;for(;n.length>0;){let i=n.top();if(i.type===Ai)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===pr){if(r==="__proto__")throw new de("The key __proto__ is not allowed");i.key=this.mapKeyConverter(r),i.type=us;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=pr;continue e}}return r}}readHeadByte(){return this.headByte===fr&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=fr}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 de(`Unrecognized array type byte: ${_n(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new de(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new de(`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 de(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+r+e)throw ls;let n=this.pos+r,i;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?i=this.keyDecoder.decode(this.bytes,n,e):i=is(this.bytes,n,e),this.pos+=r+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===pr:!1}decodeBinary(e,r){if(e>this.maxBinLength)throw new de(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+r))throw ls;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 de(`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=ss(this.view,this.pos);return this.pos+=8,e}readI64(){let e=gn(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 cs(t,e){return new Se(e).decode(t)}function ds(t,e){return new Se(e).decodeMulti(t)}function oc(t){return t[Symbol.asyncIterator]!=null}async function*lc(t){let e=t.getReader();try{for(;;){let{done:r,value:n}=await e.read();if(r)return;yield n}}finally{e.releaseLock()}}function yn(t){return oc(t)?t:lc(t)}async function fs(t,e){let r=yn(t);return new Se(e).decodeAsync(r)}function ps(t,e){let r=yn(t);return new Se(e).decodeArrayStream(r)}function hs(t,e){let r=yn(t);return new Se(e).decodeStream(r)}var Un=Ma(Ji(),1),Ki=Ja,Qi=ts,$e=Ni,yo=Un.DOMParser,vo=Un.XMLSerializer;var ko=$e!==null;function Eo(){if(!ko)throw new Error("@msgpack/msgpack is required for MessagePack support. Install with: npm install @msgpack/msgpack")}var xo=lf();function lf(){if(!ko)return null;let t=new TextEncoder,e=new TextDecoder,r=new $e.ExtensionCodec;return r.register({type:-1,encode:n=>{if(n instanceof Date){let i=vt(n);if(i==="D"||i==="H")return null}return $e.encodeTimestampExtension(n)},decode:n=>$e.decodeTimestampExtension(n)}),r.register({type:1,encode:n=>Te(n)?t.encode(n.toString()):null,decode:n=>Fn(e.decode(n))}),r.register({type:2,encode:n=>{if(n instanceof Date&&vt(n)==="D"){let i=n.getUTCFullYear(),a=String(n.getUTCMonth()+1).padStart(2,"0"),s=String(n.getUTCDate()).padStart(2,"0");return t.encode(`${i}-${a}-${s}`)}return null},decode:n=>new Date(e.decode(n)+"T00:00:00.000Z")}),r.register({type:3,encode:n=>{if(n instanceof Date&&vt(n)==="H"){let i=String(n.getUTCHours()).padStart(2,"0"),a=String(n.getUTCMinutes()).padStart(2,"0"),s=String(n.getUTCSeconds()).padStart(2,"0"),o=String(n.getUTCMilliseconds()).padStart(3,"0");return t.encode(`${i}:${a}:${s}.${o}`)}return null},decode:n=>{let i=e.decode(n),a=i.indexOf("."),s=a>=0?i.substring(0,a):i,o=a>=0?i.substring(a+1):"0",[l,u,c]=s.split(":"),d=Math.round(+o.substring(0,3));return new Date(Date.UTC(1970,0,1,+l,+u,+c,d))}}),r.register({type:4,encode:n=>{let i=ea(n);if(i!==null){let[a,s]=i;return t.encode(`${a}:${s(n)}`)}return null},decode:n=>{let i=e.decode(n),a=i.indexOf(":"),s=i.slice(0,a),o=i.slice(a+1),l=ct[s];if(l!==void 0){let[,u]=l;return u(o)}return`${o}::${s}`}}),r}function Do(t){return Eo(),$e.encode(t,{extensionCodec:xo})}function Ao(t){return Eo(),$e.decode(t,{extensionCodec:xo})}function jn(t,e=!1){let r=Vn(t);if(r===null)return[!1,String(t)];let[n,i,a]=r;return a&&!e?[!1,String(t)]:[!0,`${i(t)}::${n}`]}function ta(t){if(!t.includes("::"))return[!1,t];let e=t.lastIndexOf("::"),r=t.slice(0,e),n=t.slice(e+2),i=ct[n];if(i===void 0)return[!1,t];let[,a]=i;return[!0,a(r)]}function qn(t,e,r){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let n={};for(let[i,a]of Object.entries(t))n[i]=qn(a,e,r);return n}return Array.isArray(t)?t.map(n=>qn(n,e,r)):r(t)?e(t):t}function ra(t){let e=Vn(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[a,s]=ra(i);return s&&(r=!0),a}),r]}if(t!==null&&typeof t=="object"){let r=!1,n={};for(let[i,a]of Object.entries(t)){let[s,o]=ra(a);o&&(r=!0),n[i]=s}return[n,r]}return[t,!1]}function uf(t,e=!1){let[r,n]=jn(t,e);if(r)return n;let[i,a]=ra(t),s=JSON.stringify(i);return a?`${s}::JS`:s}function cf(t){return JSON.stringify(t)}function df(t){if(!$e)throw new Error("@msgpack/msgpack is required for MessagePack support");return $e.encode(t)}function ve(t,e=null,{raw:r=!1,qs:n=!1,_forceSuffix:i=!1}={}){if(n)return`${Co(t)}::QS`;if(r){if(e===null||e==="json")return cf(t);if(e==="msgpack")return df(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 a=uf(t,i);return e==="json"?`"${a}"`:a}else{if(e==="xml")return`<?xml version="1.0" ?><tytx_root>${To(t)}</tytx_root>`;if(e==="msgpack")return Do(t);throw new Error(`Unknown transport: ${e}`)}}var er,na;typeof window<"u"&&window.DOMParser?(er=window.DOMParser,na=window.XMLSerializer):(er=yo,na=vo);function No(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 So(t,e,r){let n=t.createElement(e),i=r.attrs||{},a=r.value;for(let[s,o]of Object.entries(i))n.setAttribute(s,ve(o,null,{_forceSuffix:!0}));if(Array.isArray(a))for(let s of a)if(No(s)){let[o]=Object.keys(s),l=s[o],u=So(t,o,l);n.appendChild(u)}else{n.textContent=ve(a);break}else n.textContent=ve(a);return n}function To(t){if(!er)throw new Error("XML support requires @xmldom/xmldom package in Node.js");if(No(t)){let[e]=Object.keys(t),r=t[e],n=new er().parseFromString("<root/>","text/xml"),i=So(n,e,r);return new na().serializeToString(i)}else return ve(t)}function ia(t){let e={};for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=re(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=ia(n);return{attrs:e,value:{[n.tagName]:i}}}else{let n=[];for(let i of r){let a=ia(i);n.push({[i.tagName]:a})}return{attrs:e,value:n}}return{attrs:e,value:re(t.textContent)}}function Oo(t){if(!er)throw new Error("XML support requires @xmldom/xmldom package in Node.js");let n=new er().parseFromString(t,"text/xml").documentElement;if(n.tagName==="tytx_root"){let a=null;for(let s=0;s<n.childNodes.length;s++)if(n.childNodes[s].nodeType===1){a=n.childNodes[s];break}if(!a)return re(n.textContent);n=a}let i=ia(n);return{[n.tagName]:i}}function ff(t){return typeof t=="string"}function pf(t){let[e,r]=ta(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 qn(i,hf,ff)}function hf(t){return t.includes("::")?ta(t)[1]:t}function mf(t){let e=Oo(t);return typeof e=="string"?re(e):e}function gf(t){return Ao(t)}function re(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)),pf(r)}else{if(e==="xml")return mf(t);if(e==="msgpack")return gf(t);throw new Error(`Unknown transport: ${e}`)}}function Co(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,a]=jn(n,!0);i?e.push(`${r}=${a}`):e.push(`${r}=${n}`)}return e.join("&")}throw new TypeError(`toQs expects object or array, got ${typeof t}`)}function Bo(t){if(!t)return[];let e=t.split("&"),r=e.map(s=>s.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(s=>re(s));let a={};for(let s of e){let o=s.indexOf("="),l=s.slice(0,o),u=s.slice(o+1);a[l]=re(u)}return a}var Mo=Ki||Qi||Number,bf=Ki?"decimal.js":Qi?"big.js":"number";function Fn(t){return new Mo(t)}function Te(t){return bf==="number"?!1:t instanceof Mo}function vt(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 _f(t){return t.toString()}function wf(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 yf(t){return t.toISOString()}function vf(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 kf(t){return t?"true":"false"}function Ef(t){return t.toString()}function xf(t){return t.toString()}function Df(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 zn=[],aa=new Map;function ea(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,a]of zn)if(r.prototype===e)return[n,i,a];return null}function Vn(t){if(t===null)return["NN",()=>"",!0];if(Te(t))return["N",_f,!1];if(t instanceof Uint8Array)return["RAW",Df,!1];if(t instanceof Date){let e=vt(t);return e==="D"?["D",wf,!1]:e==="H"?["H",vf,!1]:["DHZ",yf,!1]}return typeof t=="boolean"?["B",kf,!0]:typeof t=="number"?Number.isInteger(t)?["L",Ef,!0]:["R",xf,!0]:ea(t)}function Af(t){return Fn(t)}function Tf(t){let[e,r,n]=t.split("-").map(Number);return new Date(Date.UTC(e,r-1,n,0,0,0,0))}function Io(t){return new Date(t)}function Cf(t){let[e,r,n]=t.split(":"),[i,a]=n.split(".");return new Date(Date.UTC(1970,0,1,Number(e),Number(r),Number(i),Number(a||0)))}function Nf(t){return t.toLowerCase()==="true"}function Sf(t){return parseInt(t,10)}function Of(t){return parseFloat(t)}function Bf(t){return t}function If(t){return null}var Mf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function Rf(t){if(!Mf.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 Lf(t){return Bo(t)}var Pf=/^[A-Z]+$/,ct={N:[Object,Af],D:[Date,Tf],DH:[Date,Io],DHZ:[Date,Io],H:[Date,Cf],L:[Number,Sf],R:[Number,Of],T:[String,Bf],B:[Boolean,Nf],QS:[Object,Lf],NN:[null,If],RAW:[Uint8Array,Rf]};function Ir(t){return Object.hasOwn(ct,t)?ct[t][0]:null}function sa(t,e,r,n,i=!1){if(typeof e!="string"||!Pf.test(e))throw new Error(`TYTX suffix '${e}' is invalid: expected uppercase ASCII letters only`);let a=ct[e];if(a!==void 0&&a[0]!==t){let s=a[0]===null?"null":a[0].name;throw new Error(`TYTX suffix '${e}' is already registered for ${s}`)}zn=zn.filter(([s])=>s!==t),zn.push([t,e,r,i]),ct[e]=[t,n]}function Mr(t,e){aa.set(t,e)}function Ge(t){return aa.has(t)?aa.get(t):{}}var Ro={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 Uf(t){let e=t._retryPolicy;return e==null?null:typeof e=="string"?Ro[e]||null:e}function Ff(t,e){return e.some(r=>r==="Error"?!0:t.name===r||t.constructor.name===r)}function qf(t){return new Promise(e=>setTimeout(e,t))}async function jf(t,e){if(!e)return t();let r=e.maxAttempts||3,n=e.delay||1,i=e.backoff||2,a=e.jitter!==!1,s=e.on||["Error"],o=null,l=n*1e3;for(let u=0;u<r;u++)try{let c=t();return c instanceof Promise?await c:c}catch(c){if(o=c,u<r-1&&Ff(c,s)){let d=l;a&&(d*=1+Math.random()*.1),await qf(d),l*=i}else throw c}throw o}var ne=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 a of["interval","reactive"])if(Object.hasOwn(n,a))throw new TypeError(`Removed resolver option: ${a}. 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[a,s]of Object.entries(n))i.has(a)||(this._kw[a]=s);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},s=>this._prepareValue(s));let a=this._computeEffectiveFingerprint(i);return a===this._lastEffectiveFingerprint&&!this.expired?this.cachedValue:(this._lastEffectiveFingerprint=a,this._load(i,s=>this._finalize(s)))}_load(e,r){let n=Uf(this),i=()=>this.load(e);if(n)return jf(i,n).then(r);let a=i();return a&&typeof a.then=="function"?a.then(r):r(a)}_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}};ne._BagClass=null;var Rr=class extends ne{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 Ye=class t{constructor(e,r,n=null,i=null,a=null,s=null,o=null,l=!0){this.label=r,this._value=null,this._attr={},this._parentBag=null,this._resolver=null,this._nodeSubscribers={},this._onChangedValue=null,this.nodeTag=s,this.xmlTag=o,this._compiled=null,this.parentBag=e,i&&this.setAttr(i,!1,!0,l),n!==null&&this.setValue(n,!1),a&&(this.resolver=a)}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=re(`${r}::QS`);if(Array.isArray(i)){let a=i.length?i:Object.keys(this._attr),s=a.map(l=>{let u=this.getAttr(l);return!e&&u instanceof ne?u.resolve():u}),o=l=>i.length===0?Object.fromEntries(a.map((u,c)=>[u,l[c]])):l.length===1?l[0]:l;return s.some(l=>l&&typeof l.then=="function")?Promise.all(s).then(o):o(s)}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,a=!0,s=null,o=!1){e instanceof ne?(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 l=this._value;l!==e&&l?.parentNode===this&&l.setBackref(),this._value=e;let u=l!==this._value,c=r??!0,d=null;if(n!==null){let p={...this._attr};this.setAttr(n,!1,i,a);let h=this._buildAttrDiff(p,this._attr);d=Object.keys(h).length>0?h:null}r=c&&(u||d!==null);let f=d?u?"upd_value_attr":"upd_attrs":"upd_value";if(this._onChangedValue&&this._onChangedValue(this,e,l,c),r){let p=d!==null?{oldvalue:l,attrs_diff:d}:{oldvalue:l};for(let h of Object.values(this._nodeSubscribers))h({node:this,info:p,evt:f})}this._parentBag!==null&&this._parentBag.backref&&(e&&typeof e._htraverse=="function"&&e.setBackref(this,this._parentBag),r&&this._parentBag._onNodeChanged(this,[this.label],f,l,d,s,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,a={...this._attr},s=this.resolver;s&&s._node===this&&(s._node=null),this.resolver=n,this.setValue(r,!1,{...e.attr},!1,!1,null);let o=this._buildAttrDiff(a,this._attr),l=Object.keys(o).length?o:null,u=i!==r||s!==n;if(u||l){let c=l?u?"upd_value_attr":"upd_attrs":"upd_value",d=l?{oldvalue:i,attrs_diff:l}:{oldvalue:i};for(let f of Object.values(this._nodeSubscribers))f({node:this,info:d,evt:c});this._parentBag!==null&&this._parentBag.backref&&this._parentBag._onNodeChanged(this,[this.label],c,i,l)}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 a of i){let s=a in e?e[a]:null,o=a in r?r[a]:null;s!==o&&(n[a]={old:s,new:o})}return n}setAttr(e=null,r=!0,n=!0,i=!0){let a=e||{},s=Object.keys(this._nodeSubscribers).length>0,l=r&&(s||this._parentBag!==null&&this._parentBag.backref)?{...this._attr}:null;if(n?Object.assign(this._attr,a):this._attr={...a},i)for(let u of Object.keys(this._attr))this._attr[u]===null&&delete this._attr[u];if(r&&l!==null){let u=this._buildAttrDiff(l,this._attr);if(Object.keys(u).length>0&&s)for(let c of Object.values(this._nodeSubscribers))c({node:this,info:{attrs_diff:u},evt:"upd_attrs"});if(Object.keys(u).length>0&&this._parentBag!==null&&this._parentBag.backref){let c=r===!0?"true":String(r);this._parentBag._onNodeChanged(this,[this.label],"upd_attrs",null,u,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 Lr=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,a=i.includes("::")?re(i):i;return n?this._list.findIndex(s=>s.getAttr(n)===a):this._list.findIndex(s=>s._value===a)}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 a=this._parseSharpIndex(n.slice(1),e);return Math.min(a,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 a=this._parseSharpIndex(n.slice(1),e);return Math.min(a+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,a=null,s=null,o=!1,l=!0,u=null,c=!0,d=!1,f=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 m=p.split("&");if(m.length===1)i={[m[0]]:r};else{if(!Array.isArray(r)||r.length!==m.length)throw new Error("Wrong attributes assignment");i={};for(let g=0;g<m.length;g++)i[m[g]]=r[g]}r=null}let h=this._dict[e];if(h)f&&(h.nodeTag=f),s!==null&&(s===!1?h.resolver=null:h.resolver=s),p?h.setAttr(i,c,!0,l):h.setValue(r,c,i,o,l,u,d);else{let m=a&&a.nodeClass?a.nodeClass:Ye;h=new m(a,e,p?null:r,i,s,f,null,l);let g=this._parsePosition(n);this._dict[e]=h,this._list.splice(g,0,h),c&&a&&a.backref&&a._onNodeInserted(h,g,null,u,d)}return d&&h.setValue(null,!1),h}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 a=this._list[r].label;if(i.length>1){let s=[...i].sort((c,d)=>c-d),o=s[0]<r?1:0,l=[];for(let c=s.length-1;c>=0;c--){let d=s[c];if(d>=0&&d<this._list.length){let f=this._list[d];this._list.splice(d,1),l.push(f),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(f,d)}}let u=this.index(a);u<0&&(u=this._list.length),u+=o;for(let c of l)this._list.splice(u,0,c),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(c,u)}else{let s=i[0];if(s===r||s<0||s>=this._list.length)return;let o=this._list[s];this._list.splice(s,1),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(o,s),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 Uo=Ma(Ji(),1);var oa="::RSLV:",Vf=new Map,zf=new Map,Hn=new WeakMap,Y=class extends Error{constructor(e){super(e),this.name="BagSerializationError"}},Pr=class extends ne{constructor(e){super({asBag:!1}),Hn.set(this,e)}get payload(){return Hn.get(this)}load(){throw new Y("This resolver is opaque; local execution is unavailable")}};function Lo(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 Y("Invalid resolver description")}function Po(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 Y("Resolver parameters must be JSON data; callbacks cannot travel");e.add(t);for(let r of Object.values(t))Po(r,e);e.delete(t)}}function $r(t){if(Hn.has(t))return Hn.get(t);let e=zf.get(t.constructor);if(!e)throw new Y(`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 Lo(n),Po(n),oa+JSON.stringify(n)}function Wn(t){if(typeof t!="string"||!t.startsWith(oa))return null;let e=t.slice(oa.length);if(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+$/.test(e))return new Pr(t);let r;try{r=JSON.parse(e)}catch{throw new Y("Invalid resolver JSON or signed token")}Lo(r);let n=Vf.get(JSON.stringify([r.resolver_module,r.resolver_class]));if(!n)return new Pr(t);let i=n.decode({args:r.args??[],kwargs:r.kwargs});if(!(i instanceof n.cls))throw new Y("Resolver decoder returned an incompatible instance");return i}function Gn(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[e,r instanceof ne?$r(r):r]))}function la(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[e,Wn(r)??r]))}var Oe="__cls";function tr(t,e){return t!==null&&t.tytxSuffix===e?t:Ir(e)}function Hf(t){let e=t.tytxSuffix,r=Object.entries(Ge(e)).filter(([,n])=>n===t).map(([n])=>n);if(r.length===0)throw new Y(`${t.name} is not in the TYTX subtype dictionary of '${e}'`);if(r.length>1)throw new Y(`${t.name} is in the TYTX subtype dictionary of '${e}' under several names: ${r.sort().join(", ")}`);return r[0]}function ua(t,e){let r=Ge(t);if(!Object.hasOwn(r,e))throw new Y(`Unknown Bag class '${e}' for TYTX type '${t}'`);return r[e]}function ca(t,e){return t===e?null:Hf(t)}function*Fo(t,e=[]){for(let r of t){let n=[...e,r.label];yield[n,r];let i=r.getValue(!0);!r.resolver&&i instanceof se&&(yield*Fo(i,n))}}function Wf(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 rr(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function dt(t){return typeof t=="string"?t.includes("::")?`${t}::T`:t:Array.isArray(t)?t.map(dt):rr(t)?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,dt(r)])):t}function da(t){if(!rr(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 $o=!1,se=class t{static tytxSuffix="X";constructor(e=null,r={}){this._nodes=new Lr,this._backref=!1,this._parent=null,this._parentNode=null,this._rootAttributes=null,this._updSubscribers={},this._insSubscribers={},this._delSubscribers={},da(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 Ye}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,a]=this._htraverseBefore(e);if(i===null)return[null,null];if(a.length===0)return[i,""];for(;a.length>1&&i instanceof t;){let s=a[0];if(s==="#parent"){if(i.parent===null||i.parent===void 0)break;a.shift(),i=i.parent;continue}let o=i._nodes.get(s);if(!o)break;let l=o.getValue(n);if(l instanceof t)a.shift(),i=l;else if(r){let u=i.createChildBag();o.setValue(u,!0,null,!0,!0,"autocreate"),a.shift(),i=u}else break}if(!r)return a.length>1?[null,null]:[i,a[0]];for(;a.length>1;){let s=a.shift();if(s.startsWith("#"))throw new Ur("Not existing index in #n syntax");let o=i.createChildBag();i._nodes.set(s,o,">",null,i,null,!1,!0,"autocreate"),i=o}return[i,a[0]]}get(e,r=null,n=!0,i={}){if(!e)return this;if(e==="#parent")return this.parent;let a=null;e.includes("?")&&([e,a]=e.split("?",2));let s=this._nodes.get(e);return s?s.getValue(n,a,i):r}getItem(e,r=null,n=!1,i={}){if(!e)return this;let[a,s]=this._htraverse(e,!1,n);return a instanceof t?a.get(s,r,n,i):r}setItem(e,r,n=null,i=">",a=!1,s=!0,o=null,l=!1,u=!0,c=null,d=null){if(e==="")throw new RangeError("setItem requires a non-empty path");let[f,p]=this._htraverse(e,!0);return f._nodes.set(p,r,i,n,f,c,a,s,o,u,l,d)}_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 a=n._nodes.get(i);if(!a)return null;try{return n._pop(i,r)}finally{a.parentBag===n&&n._nodes._dict[a.label]!==a&&(a.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[a,s]=this._htraverse(e,n,r);if(a instanceof t&&s){let o=a._nodes.get(s);if(o)return o;if(n)return a._nodes.set(s,i,">",null,a,null,!1,!0,"autocreate"),a._nodes.get(s)}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,a=null,s=null,o=!1){for(let l of Object.values(this._updSubscribers))l({node:e,pathlist:r,oldvalue:i,attrs_diff:a,evt:n,reason:s,fired:o});this._parent&&this._parentNode&&this._parent._onNodeChanged(e,[this._parentNode.label,...r],n,i,a,s,o)}_onNodeInserted(e,r,n=null,i=null,a=!1){let s=e.parentBag,o=e.getValue(!0);s!==null&&s.backref&&o instanceof t&&o.setBackref(e,s),n===null&&(n=[]);for(let l of Object.values(this._insSubscribers))l({node:e,pathlist:n,ind:r,evt:"ins",reason:i,fired:a});this._parent&&this._parentNode&&this._parent._onNodeInserted(e,r,[this._parentNode.label,...n],i,a)}_onNodeDeleted(e,r,n=null,i=null){for(let a of Object.values(this._delSubscribers))a({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:a=null,any:s=null}=r;this.backref||this.setBackref(),this._subscribe(e,this._updSubscribers,n||s),this._subscribe(e,this._insSubscribers,i||s),this._subscribe(e,this._delSubscribers,a||s)}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:a=!1,any:s=!1}=r;(n||s)&&delete this._updSubscribers[e],(i||s)&&delete this._insSubscribers[e],(a||s)&&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 a=r===void 0,s=n&&typeof r=="string"?r.toLowerCase():r,o=l=>{let u=[];for(let c of l._nodes){if(e in c.attr){let d=n&&typeof c.attr[e]=="string"?c.attr[e].toLowerCase():c.attr[e];if(a||d==s)return c}if(c._value instanceof t)if(i){let d=o(c._value);if(d)return d}else u.push(c._value)}for(let c of u){let d=o(c);if(d)return d}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,a=!0,s=!0,o=null,l=!0){e||(e="#k,#v,#a");let u=this,c;if(typeof e=="string"){if(e.includes(":")){let[p,h]=e.split(":");u=this.getItem(p),e=h}c=e.split(",").map(p=>p.trim())}else c=e;let d=(p,h,m,g,_)=>{if(h==="#k")return p.label;if(h==="#p")return m;if(h==="#n")return p;if(typeof h=="function")return h(p);if(h==="#v"){let v=_();return g&&v instanceof t?null:v}else if(h.startsWith("#v.")){let v=h.split(".").slice(1).join("."),w=_();return w&&w.getItem?w.getItem(v):null}else{if(h==="#__v")return p.getValue(!0);if(h.startsWith("#a")){let v=h.includes(".")?h.split(".").slice(1).join("."):null;return p.getAttr(v)}else{let v=_();return v&&v.getItem?v.getItem(h):null}}};function*f(){let p=0;function*h(m,g){for(let _ of m._nodes){let v=g?`${g}.${_.label}`:_.label,w=!1,x,B=()=>(w||(x=_.getValue(l),w=!0),x);if((a&&s||(B()instanceof t?s:a))&&(r===null||r(_))&&(yield c.length===1?d(_,c[0],v,i,B):c.map(Z=>d(_,Z,v,i,B)),p++,o!==null&&p>=o))return;if(i){let Z=B();if(Z instanceof t&&(yield*h(Z,v),o!==null&&p>=o))return}}}yield*h(u,"")}return n?f():[...f()]}getLeaves(){let e=[],r=(n,i)=>{for(let a of n._nodes){let s=i?`${i}.${a.label}`:a.label,o=a.getValue(!1);o instanceof t?r(o,s):e.push([s,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(l=>l.trim()).map(()=>[]);let a=[...i];if(a.length&&Array.isArray(a[0])){let s=a[0].length,o=[];for(let l=0;l<s;l++)o.push(a.map(u=>u[l]));return o}return[a]}return[...i]}columns(e,r=!1){typeof e=="string"&&(e=e.split(","));let n=r?"#a.":"",i=e.map(a=>`${n}${a}`).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=a=>{let s=0,o=!1;for(let l of this.query(a,n)){if(l==null||l===""){o=!0;continue}if(typeof l!="number"&&typeof l!="boolean"){if(r)throw new TypeError(`sum encountered non-numeric value: ${typeof l}`);continue}s+=l}return r&&o?null:s};return e.includes(",")?e.split(",").map(a=>i(a.trim())):i(e)}sort(e="#k:a"){let r=(i,a)=>i==null?[-1,""]:a&&typeof i=="string"?[0,i.toLowerCase()]:[0,i],n=(i,a)=>i[0]!==a[0]?i[0]-a[0]:i[1]<a[1]?-1:i[1]>a[1]?1:0;if(typeof e=="function")this._nodes._list.sort((i,a)=>{let s=e(i),o=e(a);return s<o?-1:s>o?1:0});else{let i=e.split(",");i.reverse();for(let a of i){let s,o;a.includes(":")?[s,o]=a.split(":",2):(s=a,o="a"),s=s.trim(),o=o.trim();let l=o==="d"||o==="D",u=o==="a"||o==="d",c;if(s.toLowerCase()==="#k")c=d=>r(d.label,u);else if(s.toLowerCase()==="#v")c=d=>r(d.value,u);else if(s.toLowerCase().startsWith("#a.")){let d=s.slice(3);c=f=>r(f.getAttr(d),u)}else c=d=>{let f=d.value,p=f instanceof t?f.getItem(s):f?f[s]:null;return r(p,u)};this._nodes._list.sort((d,f)=>{let p=n(c(d),c(f));return l?-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 Rr({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 a={};for(let s of this._nodes){let o=s.value;if(i&&o==null)continue;let l=s.label;e&&(l=String(l)),r&&(l=l.toLowerCase()),n&&o instanceof t&&(o=t.prototype.asDict.call(o,e,r,n,i)),Object.defineProperty(a,l,{value:o,enumerable:!0,writable:!0,configurable:!0})}return a}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 a=new r.nodeClass(r,n.label,i);a.setAttr({...n.attr},!1,!1,!1),a.nodeTag=n.nodeTag,a.xmlTag=n.xmlTag,r._nodes._list.push(a),r._nodes._dict[a.label]=a}return r}update(e,r=null,n=null,i=!1){if(!(e instanceof t)){for(let a in e){let s=e[a];(!i||s!==null||!this._nodes.has(a))&&this.setItem(a,s,null,">",!1,!1,n,!1,n!==!1)}return}for(let a of[...e]){let s=a.label,o=r==="static"?a.resolver:null,l=o?null:a.getValue(),u=a.attr.__replace;delete a.attr.__replace;let c=this._nodes.get(s);if(c)if(c.setAttr(a.attr,n===null?!0:n,!0,!1),a.nodeTag!=null&&(c.nodeTag=a.nodeTag),a.xmlTag!=null&&(c.xmlTag=a.xmlTag),o)c.resolver=o,c.setValue(null,n===null?!0:n,null,null,!1,n);else{a.resolver&&(c.resolver=null);let d=c.getValue();l instanceof t&&d instanceof t&&!u?d.update(l,r,n,i):(!i||l!==null)&&c.setValue(l,n===null?!0:n,null,null,!1,n)}else{let d=this.setItem(s,o||l,a.attr,">",!1,!1,n,!1,n!==!1);d.nodeTag=a.nodeTag,d.xmlTag=a.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,a=null){if(typeof e!="string")throw new TypeError("Bag labels must be strings");let s=new this.nodeClass(this,e,null,n,i,a,null,!1);return r instanceof ne?s.resolver=r:s._value=r,this._nodes._dict[e]=s,this._nodes._list.push(s),s}fillFrom(e=null,r={}){let n=da(r);if(e!=null&&!rr(e)&&!Array.isArray(e))throw new TypeError("Bag source must be a dictionary, array or null");let i=this.createChildBag(),a=new Set,s=(o,l,u)=>{if(a.has(l))throw new TypeError(`Cyclic Bag source at ${u}`);a.add(l);try{let c=Array.isArray(l)?String(l.length).length+1:0,d=Array.isArray(l)?Array.from(l,(f,p)=>[`r_${String(p).padStart(c,"0")}`,f]):Object.entries(l);if(!Array.isArray(l)&&Object.getOwnPropertySymbols(l).some(f=>Object.prototype.propertyIsEnumerable.call(l,f)))throw new TypeError(`Bag labels must be strings at ${u}`);for(let[f,p]of d){let h=p;n&&(rr(h)||Array.isArray(h))&&(h=this.createChildBag(),s(h,p,`${u}[${JSON.stringify(f)}]`)),o._appendLiteral(f,h)}}finally{a.delete(l)}};return e!=null&&s(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 a=(s,o)=>{for(let l=0;l<s._nodes.length;l++){let u=s._nodes._list[l],c={...o};"_pathlist"in o&&(c._pathlist=[...o._pathlist,u.label]),"_indexlist"in o&&(c._indexlist=[...o._indexlist,l]);let d=e(u,c,l);if(d)return d;if(d==null&&n){let f=u.getValue(r);if(f instanceof t){let p=a(f,c);if(p)return p}}}return null};return a(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 a=n.getValue(e);a instanceof t&&(yield*a._iterNodesWithPaths(e,i))}}*_nodeFlattener(e=null){let r=e!==null,n=r?Object.create(null):null,i=0,a=new Map([["[]",this.constructor]]);for(let[s,o]of Fo(this)){let l=s.slice(0,-1),u=JSON.stringify(s),c=JSON.stringify(l),d=o.getValue(!0),f,p=null;if(o.resolver)f=$r(o.resolver);else if(d instanceof t){let g=d.constructor,_=g.tytxSuffix;a.set(u,g),p=ca(g,tr(a.get(c),_)),f=`::${_}`}else d===null?f="::NN":f=dt(d);if(o.attr&&Object.hasOwn(o.attr,Oe))throw new Y(`node '${s}': the attribute '${Oe}' is reserved for the Bag class name`);let h=Gn(dt(o.attr));p!==null&&(h[Oe]=p);let m=o.nodeTag;r?(yield[l.length?n[c]:null,o.label,m,f,h],d instanceof t&&(n[u]=i,e[i]=s,i++)):yield[l,o.label,m,f,h]}}toTytx(e="json",r=!1){let n=this._toTytxPayload(r),i=this.constructor.tytxSuffix;if(e==="json")return`${n}::${i}`;if(e==="msgpack")return bn(new Ne(4,new TextEncoder().encode(`${i}:${n}`)));throw new TypeError(`Unsupported transport: ${e}`)}_toTytxPayload(e=!1){let r;if(e){let a={};r={rows:[...this._nodeFlattener(a)],paths:a}}else r={rows:[...this._nodeFlattener(null)]};let n=this.constructor,i=ca(n,tr(null,n.tytxSuffix));return i!==null&&(r[Oe]=i),r.rows=r.rows.map(([a,s,o,l,u])=>[dt(a),dt(s),dt(o),l,u]),r.paths&&(r.paths=dt(r.paths)),ve(r)}static fromTytx(e,r="json",n={}){if(rr(r)&&(n=r,r="json"),da(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=re(e,r==="json"?null:r);if(i instanceof t)return i;if(!rr(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(tr(null,r));let n=re(e);if(!n||!Array.isArray(n.rows))throw new Y("Invalid TYTX Bag: expected rows");let i=n.paths,a=i!=null,s=Object.hasOwn(n,Oe)?ua(r,n[Oe]):tr(null,r),o=new s,l=new Map([["[]",o]]);for(let u of n.rows){if(!Array.isArray(u)||u.length!==5)throw new Y("Invalid TYTX Bag row");let[c,d,f,p,h]=u,m=c??"";if(a){if(c!==null&&!Object.hasOwn(i,c))throw new Y(`Unknown TYTX parent reference: ${c}`);m=c===null?"":i[c]}if(typeof m=="string"&&(m=m?m.split("."):[]),!Array.isArray(m))throw new Y("Invalid TYTX parent path");let g=JSON.stringify(m);if(!l.has(g))throw new Y(`Missing or undecodable TYTX parent branch: ${m}`);let _=l.get(g),v=JSON.stringify([...m,d]),w=p,x=Wn(w),B=la(h),L=Object.hasOwn(B,Oe)?B[Oe]:null;if(delete B[Oe],w instanceof t){let ie=w.constructor.tytxSuffix,ae=L!==null?ua(ie,L):tr(_.constructor,ie);w=new ae,l.set(v,w)}else if(L!==null)throw new Y(`node '${v}': the attribute '${Oe}' is reserved for the Bag class name of a branch`);let Z=_._appendLiteral(d,x?null:w,B,x);Z.nodeTag=f??null}return o}toXml(e={}){let{pretty:r=!1,encoding:n="UTF-8",docHeader:i=null,selfClosedTags:a=null}=e,s=this._bagToXml(a,r);return i===!0?s=`<?xml version='1.0' encoding='${n}'?>
15
+ */var It=9e15,rt=1e9,mi="0123456789abcdef",ln="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",un="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",gi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-It,maxE:It,crypto:!1},qa,Ve,T=!0,dn="[DecimalError] ",tt=dn+"Invalid argument: ",ja=dn+"Precision limit exceeded",Va=dn+"crypto unavailable",za="[object Decimal]",ce=Math.floor,Q=Math.pow,Vl=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,zl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Hl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ha=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ce=1e7,D=7,Wl=9007199254740991,Gl=ln.length-1,bi=un.length-1,b={toStringTag:za};b.absoluteValue=b.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),E(t)};b.ceil=function(){return E(new this.constructor(this),this.e+1,2)};b.clampedTo=b.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(tt+e);return r=n.cmp(t),r<0?t:n.cmp(e)>0?e:new i(n)};b.comparedTo=b.cmp=function(t){var e,r,n,i,a=this,s=a.d,o=(t=new a.constructor(t)).d,l=a.s,u=t.s;if(!s||!o)return!l||!u?NaN:l!==u?l:s===o?0:!s^l<0?1:-1;if(!s[0]||!o[0])return s[0]?l:o[0]?-u:0;if(l!==u)return l;if(a.e!==t.e)return a.e>t.e^l<0?1:-1;for(n=s.length,i=o.length,e=0,r=n<i?n:i;e<r;++e)if(s[e]!==o[e])return s[e]>o[e]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};b.cosine=b.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=Yl(n,Za(n,r)),n.precision=t,n.rounding=e,E(Ve==2||Ve==3?r.neg():r,t,e,!0)):new n(1):new n(NaN)};b.cubeRoot=b.cbrt=function(){var t,e,r,n,i,a,s,o,l,u,c=this,d=c.constructor;if(!c.isFinite()||c.isZero())return new d(c);for(T=!1,a=c.s*Q(c.s*c,1/3),!a||Math.abs(a)==1/0?(r=oe(c.d),t=c.e,(a=(t-r.length+1)%3)&&(r+=a==1||a==-2?"0":"00"),a=Q(r,1/3),t=ce((t+1)/3)-(t%3==(t<0?-1:2)),a==1/0?r="5e"+t:(r=a.toExponential(),r=r.slice(0,r.indexOf("e")+1)+t),n=new d(r),n.s=c.s):n=new d(a.toString()),s=(t=d.precision)+3;;)if(o=n,l=o.times(o).times(o),u=l.plus(c),n=q(u.plus(c).times(o),u.plus(l),s+2,1),oe(o.d).slice(0,s)===(r=oe(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(E(o,t+1,0),o.times(o).times(o).eq(c))){n=o;break}s+=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,d.rounding,e)};b.decimalPlaces=b.dp=function(){var t,e=this.d,r=NaN;if(e){if(t=e.length-1,r=(t-ce(this.e/D))*D,t=e[t],t)for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r};b.dividedBy=b.div=function(t){return q(this,new this.constructor(t))};b.dividedToIntegerBy=b.divToInt=function(t){var e=this,r=e.constructor;return E(q(e,new r(t),0,1,1),r.precision,r.rounding)};b.equals=b.eq=function(t){return this.cmp(t)===0};b.floor=function(){return E(new this.constructor(this),this.e+1,3)};b.greaterThan=b.gt=function(t){return this.cmp(t)>0};b.greaterThanOrEqualTo=b.gte=function(t){var e=this.cmp(t);return e==1||e===0};b.hyperbolicCosine=b.cosh=function(){var t,e,r,n,i,a=this,s=a.constructor,o=new s(1);if(!a.isFinite())return new s(a.s?1/0:NaN);if(a.isZero())return o;r=s.precision,n=s.rounding,s.precision=r+Math.max(a.e,a.sd())+4,s.rounding=1,i=a.d.length,i<32?(t=Math.ceil(i/3),e=(1/pn(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),a=Mt(s,1,a.times(e),new s(1),!0);for(var l,u=t,c=new s(8);u--;)l=a.times(a),a=o.minus(l.times(c.minus(l.times(c))));return E(a,s.precision=r,s.rounding=n,!0)};b.hyperbolicSine=b.sinh=function(){var t,e,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(e=a.precision,r=a.rounding,a.precision=e+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=Mt(a,2,i,i,!0);else{t=1.4*Math.sqrt(n),t=t>16?16:t|0,i=i.times(1/pn(5,t)),i=Mt(a,2,i,i,!0);for(var s,o=new a(5),l=new a(16),u=new a(20);t--;)s=i.times(i),i=i.times(o.plus(s.times(l.times(s).plus(u))))}return a.precision=e,a.rounding=r,E(i,e,r,!0)};b.hyperbolicTangent=b.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,q(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)};b.inverseCosine=b.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()?Be(e,n,i):new e(0):new e(NaN):t.isZero()?Be(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))};b.inverseHyperbolicCosine=b.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)};b.inverseHyperbolicSine=b.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())};b.inverseHyperbolicTangent=b.atanh=function(){var t,e,r,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=a.precision,e=a.rounding,n=i.sd(),Math.max(n,t)<2*-i.e-1?E(new a(i),t,e,!0):(a.precision=r=n-i.e,i=q(i.plus(1),new a(1).minus(i),r+t,1),a.precision=t+4,a.rounding=1,i=i.ln(),a.precision=t,a.rounding=e,i.times(.5))):new a(NaN)};b.inverseSine=b.asin=function(){var t,e,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(e=i.abs().cmp(1),r=a.precision,n=a.rounding,e!==-1?e===0?(t=Be(a,r+4,n).times(.5),t.s=i.s,t):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))};b.inverseTangent=b.atan=function(){var t,e,r,n,i,a,s,o,l,u=this,c=u.constructor,d=c.precision,f=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&d+4<=bi)return s=Be(c,d+4,f).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(d+4<=bi)return s=Be(c,d+4,f).times(.5),s.s=u.s,s}for(c.precision=o=d+10,c.rounding=1,r=Math.min(28,o/D+2|0),t=r;t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(T=!1,e=Math.ceil(o/D),n=1,l=u.times(u),s=new c(u),i=u;t!==-1;)if(i=i.times(l),a=s.minus(i.div(n+=2)),i=i.times(l),s=a.plus(i.div(n+=2)),s.d[e]!==void 0)for(t=e;s.d[t]===a.d[t]&&t--;);return r&&(s=s.times(2<<r-1)),T=!0,E(s,c.precision=d,c.rounding=f,!0)};b.isFinite=function(){return!!this.d};b.isInteger=b.isInt=function(){return!!this.d&&ce(this.e/D)>this.d.length-2};b.isNaN=function(){return!this.s};b.isNegative=b.isNeg=function(){return this.s<0};b.isPositive=b.isPos=function(){return this.s>0};b.isZero=function(){return!!this.d&&this.d[0]===0};b.lessThan=b.lt=function(t){return this.cmp(t)<0};b.lessThanOrEqualTo=b.lte=function(t){return this.cmp(t)<1};b.logarithm=b.log=function(t){var e,r,n,i,a,s,o,l,u=this,c=u.constructor,d=c.precision,f=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=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(e)if(r.length>1)a=!0;else{for(i=r[0];i%10===0;)i/=10;a=i!==1}if(T=!1,o=d+p,s=et(u,o),n=e?cn(c,o+10):et(t,o),l=q(s,n,o,1),or(l.d,i=d,f))do if(o+=10,s=et(u,o),n=e?cn(c,o+10):et(t,o),l=q(s,n,o,1),!a){+oe(l.d).slice(i+1,i+15)+1==1e14&&(l=E(l,d+1,0));break}while(or(l.d,i+=10,f));return T=!0,E(l,d,f)};b.minus=b.sub=function(t){var e,r,n,i,a,s,o,l,u,c,d,f,p=this,h=p.constructor;if(t=new h(t),!p.d||!t.d)return!p.s||!t.s?t=new h(NaN):p.d?t.s=-t.s:t=new h(t.d||p.s!==t.s?p:NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(u=p.d,f=t.d,o=h.precision,l=h.rounding,!u[0]||!f[0]){if(f[0])t.s=-t.s;else if(u[0])t=new h(p);else return new h(l===3?-0:0);return T?E(t,o,l):t}if(r=ce(t.e/D),c=ce(p.e/D),u=u.slice(),a=c-r,a){for(d=a<0,d?(e=u,a=-a,s=f.length):(e=f,r=c,s=u.length),n=Math.max(Math.ceil(o/D),s)+2,a>n&&(a=n,e.length=1),e.reverse(),n=a;n--;)e.push(0);e.reverse()}else{for(n=u.length,s=f.length,d=n<s,d&&(s=n),n=0;n<s;n++)if(u[n]!=f[n]){d=u[n]<f[n];break}a=0}for(d&&(e=u,u=f,f=e,t.s=-t.s),s=u.length,n=f.length-s;n>0;--n)u[s++]=0;for(n=f.length;n>a;){if(u[--n]<f[n]){for(i=n;i&&u[--i]===0;)u[i]=Ce-1;--u[i],u[n]+=Ce}u[n]-=f[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(t.d=u,t.e=fn(u,r),T?E(t,o,l):t):new h(l===3?-0:0)};b.modulo=b.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=q(r,t.abs(),0,3,1),e.s*=t.s):e=q(r,t,0,n.modulo,1),e=e.times(t),T=!0,r.minus(e))};b.naturalExponential=b.exp=function(){return _i(this)};b.naturalLogarithm=b.ln=function(){return et(this)};b.negated=b.neg=function(){var t=new this.constructor(this);return t.s=-t.s,E(t)};b.plus=b.add=function(t){var e,r,n,i,a,s,o,l,u,c,d=this,f=d.constructor;if(t=new f(t),!d.d||!t.d)return!d.s||!t.s?t=new f(NaN):d.d||(t=new f(t.d||d.s===t.s?d:NaN)),t;if(d.s!=t.s)return t.s=-t.s,d.minus(t);if(u=d.d,c=t.d,o=f.precision,l=f.rounding,!u[0]||!c[0])return c[0]||(t=new f(d)),T?E(t,o,l):t;if(a=ce(d.e/D),n=ce(t.e/D),u=u.slice(),i=a-n,i){for(i<0?(r=u,i=-i,s=c.length):(r=c,n=a,s=u.length),a=Math.ceil(o/D),s=a>s?a+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,r=c,c=u,u=r),e=0;i;)e=(u[--i]=u[i]+c[i]+e)/Ce|0,u[i]%=Ce;for(e&&(u.unshift(e),++n),s=u.length;u[--s]==0;)u.pop();return t.d=u,t.e=fn(u,n),T?E(t,o,l):t};b.precision=b.sd=function(t){var e,r=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(tt+t);return r.d?(e=Wa(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e};b.round=function(){var t=this,e=t.constructor;return E(new e(t),t.e+1,e.rounding)};b.sine=b.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=Zl(n,Za(n,r)),n.precision=t,n.rounding=e,E(Ve>2?r.neg():r,t,e,!0)):new n(NaN)};b.squareRoot=b.sqrt=function(){var t,e,r,n,i,a,s=this,o=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!o||!o[0])return new c(!u||u<0&&(!o||o[0])?NaN:o?s:1/0);for(T=!1,u=Math.sqrt(+s),u==0||u==1/0?(e=oe(o),(e.length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=ce((l+1)/2)-(l<0||l%2),u==1/0?e="5e"+l:(e=u.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),n=new c(e)):n=new c(u.toString()),r=(l=c.precision)+3;;)if(a=n,n=a.plus(q(s,a,r+2,1)).times(.5),oe(a.d).slice(0,r)===(e=oe(n.d)).slice(0,r))if(e=e.slice(r-3,r+1),e=="9999"||!i&&e=="4999"){if(!i&&(E(a,l+1,0),a.times(a).eq(s))){n=a;break}r+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(E(n,l+1,1),t=!n.times(n).eq(s));break}return T=!0,E(n,l,c.rounding,t)};b.tangent=b.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=q(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,E(Ve==2||Ve==4?r.neg():r,t,e,!0)):new n(NaN)};b.times=b.mul=function(t){var e,r,n,i,a,s,o,l,u,c=this,d=c.constructor,f=c.d,p=(t=new d(t)).d;if(t.s*=c.s,!f||!f[0]||!p||!p[0])return new d(!t.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?t.s/0:t.s*0);for(r=ce(c.e/D)+ce(t.e/D),l=f.length,u=p.length,l<u&&(a=f,f=p,p=a,s=l,l=u,u=s),a=[],s=l+u,n=s;n--;)a.push(0);for(n=u;--n>=0;){for(e=0,i=l+n;i>n;)o=a[i]+p[n]*f[i-n-1]+e,a[i--]=o%Ce|0,e=o/Ce|0;a[i]=(a[i]+e)%Ce|0}for(;!a[--s];)a.pop();return e?++r:a.shift(),t.d=a,t.e=fn(a,r),T?E(t,d.precision,d.rounding):t};b.toBinary=function(t,e){return wi(this,2,t,e)};b.toDecimalPlaces=b.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(ge(t,0,rt),e===void 0?e=n.rounding:ge(e,0,8),E(r,t+r.e+1,e))};b.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Ie(n,!0):(ge(t,0,rt),e===void 0?e=i.rounding:ge(e,0,8),n=E(new i(n),t+1,e),r=Ie(n,!0,t+1)),n.isNeg()&&!n.isZero()?"-"+r:r};b.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?r=Ie(i):(ge(t,0,rt),e===void 0?e=a.rounding:ge(e,0,8),n=E(new a(i),t+i.e+1,e),r=Ie(n,!1,t+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};b.toFraction=function(t){var e,r,n,i,a,s,o,l,u,c,d,f,p=this,h=p.d,m=p.constructor;if(!h)return new m(p);if(u=r=new m(1),n=l=new m(0),e=new m(n),a=e.e=Wa(h)-p.e-1,s=a%D,e.d[0]=Q(10,s<0?D+s:s),t==null)t=a>0?e:u;else{if(o=new m(t),!o.isInt()||o.lt(u))throw Error(tt+o);t=o.gt(e)?a>0?e:u:o}for(T=!1,o=new m(oe(h)),c=m.precision,m.precision=a=h.length*D*2;d=q(o,e,0,1,1),i=r.plus(d.times(n)),i.cmp(t)!=1;)r=n,n=i,i=u,u=l.plus(d.times(i)),l=i,i=e,e=o.minus(d.times(i)),o=i;return i=q(t.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=p.s,f=q(u,n,a,1).minus(p).abs().cmp(q(l,r,a,1).minus(p).abs())<1?[u,n]:[l,r],m.precision=c,T=!0,f};b.toHexadecimal=b.toHex=function(t,e){return wi(this,16,t,e)};b.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:ge(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=q(r,t,0,e,1).times(t),T=!0,E(r)):(t.s=r.s,r=t),r};b.toNumber=function(){return+this};b.toOctal=function(t,e){return wi(this,8,t,e)};b.toPower=b.pow=function(t){var e,r,n,i,a,s,o=this,l=o.constructor,u=+(t=new l(t));if(!o.d||!t.d||!o.d[0]||!t.d[0])return new l(Q(+o,u));if(o=new l(o),o.eq(1))return o;if(n=l.precision,a=l.rounding,t.eq(1))return E(o,n,a);if(e=ce(t.e/D),e>=t.d.length-1&&(r=u<0?-u:u)<=Wl)return i=Ga(l,o,r,n),t.s<0?new l(1).div(i):E(i,n,a);if(s=o.s,s<0){if(e<t.d.length-1)return new l(NaN);if((t.d[e]&1)==0&&(s=1),o.e==0&&o.d[0]==1&&o.d.length==1)return o.s=s,o}return r=Q(+o,u),e=r==0||!isFinite(r)?ce(u*(Math.log("0."+oe(o.d))/Math.LN10+o.e+1)):new l(r+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?s/0:0):(T=!1,l.rounding=o.s=1,r=Math.min(12,(e+"").length),i=_i(t.times(et(o,n+r)),n),i.d&&(i=E(i,n+5,1),or(i.d,n,a)&&(e=n+10,i=E(_i(t.times(et(o,e+r)),e),e+5,1),+oe(i.d).slice(n+1,n+15)+1==1e14&&(i=E(i,n+1,0)))),i.s=s,T=!0,l.rounding=a,E(i,n,a))};b.toPrecision=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Ie(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ge(t,1,rt),e===void 0?e=i.rounding:ge(e,0,8),n=E(new i(n),t,e),r=Ie(n,t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+r:r};b.toSignificantDigits=b.toSD=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(ge(t,1,rt),e===void 0?e=n.rounding:ge(e,0,8)),E(new n(r),t,e)};b.toString=function(){var t=this,e=t.constructor,r=Ie(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r};b.truncated=b.trunc=function(){return E(new this.constructor(this),this.e+1,1)};b.valueOf=b.toJSON=function(){var t=this,e=t.constructor,r=Ie(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};function oe(t){var e,r,n,i=t.length-1,a="",s=t[0];if(i>0){for(a+=s,e=1;e<i;e++)n=t[e]+"",r=D-n.length,r&&(a+=Qe(r)),a+=n;s=t[e],n=s+"",r=D-n.length,r&&(a+=Qe(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}function ge(t,e,r){if(t!==~~t||t<e||t>r)throw Error(tt+t)}function or(t,e,r,n){var i,a,s,o;for(a=t[0];a>=10;a/=10)--e;return--e<0?(e+=D,i=0):(i=Math.ceil((e+1)/D),e%=D),a=Q(10,D-e),o=t[i]%a|0,n==null?e<3?(e==0?o=o/100|0:e==1&&(o=o/10|0),s=r<4&&o==99999||r>3&&o==49999||o==5e4||o==0):s=(r<4&&o+1==a||r>3&&o+1==a/2)&&(t[i+1]/a/100|0)==Q(10,e-2)-1||(o==a/2||o==0)&&(t[i+1]/a/100|0)==0:e<4?(e==0?o=o/1e3|0:e==1?o=o/100|0:e==2&&(o=o/10|0),s=(n||r<4)&&o==9999||!n&&r>3&&o==4999):s=((n||r<4)&&o+1==a||!n&&r>3&&o+1==a/2)&&(t[i+1]/a/1e3|0)==Q(10,e-3)-1,s}function sn(t,e,r){for(var n,i=[0],a,s=0,o=t.length;s<o;){for(a=i.length;a--;)i[a]*=e;for(i[0]+=mi.indexOf(t.charAt(s++)),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 Yl(t,e){var r,n,i;if(e.isZero())return e;n=e.d.length,n<32?(r=Math.ceil(n/3),i=(1/pn(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),t.precision+=r,e=Mt(t,1,e.times(i),new t(1));for(var a=r;a--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=r,e}var q=(function(){function t(n,i,a){var s,o=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+o,n[l]=s%a|0,o=s/a|0;return o&&n.unshift(o),n}function e(n,i,a,s){var o,l;if(a!=s)l=a>s?1:-1;else for(o=l=0;o<a;o++)if(n[o]!=i[o]){l=n[o]>i[o]?1:-1;break}return l}function r(n,i,a,s){for(var o=0;a--;)n[a]-=o,o=n[a]<i[a]?1:0,n[a]=o*s+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,s,o,l){var u,c,d,f,p,h,m,g,_,v,w,x,B,L,Z,ie,ae,je,K,he,Ee=n.constructor,F=n.s==i.s?1:-1,J=n.d,S=i.d;if(!J||!J[0]||!S||!S[0])return new Ee(!n.s||!i.s||(J?S&&J[0]==S[0]:!S)?NaN:J&&J[0]==0||!S?F*0:F/0);for(l?(p=1,c=n.e-i.e):(l=Ce,p=D,c=ce(n.e/p)-ce(i.e/p)),K=S.length,ae=J.length,_=new Ee(F),v=_.d=[],d=0;S[d]==(J[d]||0);d++);if(S[d]>(J[d]||0)&&c--,a==null?(L=a=Ee.precision,s=Ee.rounding):o?L=a+(n.e-i.e)+1:L=a,L<0)v.push(1),h=!0;else{if(L=L/p+2|0,d=0,K==1){for(f=0,S=S[0],L++;(d<ae||f)&&L--;d++)Z=f*l+(J[d]||0),v[d]=Z/S|0,f=Z%S|0;h=f||d<ae}else{for(f=l/(S[0]+1)|0,f>1&&(S=t(S,f,l),J=t(J,f,l),K=S.length,ae=J.length),ie=K,w=J.slice(0,K),x=w.length;x<K;)w[x++]=0;he=S.slice(),he.unshift(0),je=S[0],S[1]>=l/2&&++je;do f=0,u=e(S,w,K,x),u<0?(B=w[0],K!=x&&(B=B*l+(w[1]||0)),f=B/je|0,f>1?(f>=l&&(f=l-1),m=t(S,f,l),g=m.length,x=w.length,u=e(m,w,g,x),u==1&&(f--,r(m,K<g?he:S,g,l))):(f==0&&(u=f=1),m=S.slice()),g=m.length,g<x&&m.unshift(0),r(w,m,x,l),u==-1&&(x=w.length,u=e(S,w,K,x),u<1&&(f++,r(w,K<x?he:S,x,l))),x=w.length):u===0&&(f++,w=[0]),v[d++]=f,u&&w[0]?w[x++]=J[ie]||0:(w=[J[ie]],x=1);while((ie++<ae||w[0]!==void 0)&&L--);h=w[0]!==void 0}v[0]||v.shift()}if(p==1)_.e=c,qa=h;else{for(d=1,f=v[0];f>=10;f/=10)d++;_.e=d+c*p-1,E(_,o?a+_.e+1:a,s,h)}return _}})();function E(t,e,r,n){var i,a,s,o,l,u,c,d,f,p=t.constructor;e:if(e!=null){if(d=t.d,!d)return t;for(i=1,o=d[0];o>=10;o/=10)i++;if(a=e-i,a<0)a+=D,s=e,c=d[f=0],l=c/Q(10,i-s-1)%10|0;else if(f=Math.ceil((a+1)/D),o=d.length,f>=o)if(n){for(;o++<=f;)d.push(0);c=l=0,i=1,a%=D,s=a-D+1}else break e;else{for(c=o=d[f],i=1;o>=10;o/=10)i++;a%=D,s=a-D+i,l=s<0?0:c/Q(10,i-s-1)%10|0}if(n=n||e<0||d[f+1]!==void 0||(s<0?c:c%Q(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(t.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(a>0?s>0?c/Q(10,i-s):0:d[f-1])%10&1||r==(t.s<0?8:7)),e<1||!d[0])return d.length=0,u?(e-=t.e+1,d[0]=Q(10,(D-e%D)%D),t.e=-e||0):d[0]=t.e=0,t;if(a==0?(d.length=f,o=1,f--):(d.length=f+1,o=Q(10,D-a),d[f]=s>0?(c/Q(10,i-s)%Q(10,s)|0)*o:0),u)for(;;)if(f==0){for(a=1,s=d[0];s>=10;s/=10)a++;for(s=d[0]+=o,o=1;s>=10;s/=10)o++;a!=o&&(t.e++,d[0]==Ce&&(d[0]=1));break}else{if(d[f]+=o,d[f]!=Ce)break;d[f--]=0,o=1}for(a=d.length;d[--a]===0;)d.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 Ie(t,e,r){if(!t.isFinite())return Xa(t);var n,i=t.e,a=oe(t.d),s=a.length;return e?(r&&(n=r-s)>0?a=a.charAt(0)+"."+a.slice(1)+Qe(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(t.e<0?"e":"e+")+t.e):i<0?(a="0."+Qe(-i-1)+a,r&&(n=r-s)>0&&(a+=Qe(n))):i>=s?(a+=Qe(i+1-s),r&&(n=r-i-1)>0&&(a=a+"."+Qe(n))):((n=i+1)<s&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(a+="."),a+=Qe(n))),a}function fn(t,e){var r=t[0];for(e*=D;r>=10;r/=10)e++;return e}function cn(t,e,r){if(e>Gl)throw T=!0,r&&(t.precision=r),Error(ja);return E(new t(ln),e,1,!0)}function Be(t,e,r){if(e>bi)throw Error(ja);return E(new t(un),e,r,!0)}function Wa(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 Qe(t){for(var e="";t--;)e+="0";return e}function Ga(t,e,r,n){var i,a=new t(1),s=Math.ceil(n/D+4);for(T=!1;;){if(r%2&&(a=a.times(e),Ua(a.d,s)&&(i=!0)),r=ce(r/2),r===0){r=a.d.length-1,i&&a.d[r]===0&&++a.d[r];break}e=e.times(e),Ua(e.d,s)}return T=!0,a}function $a(t){return t.d[t.d.length-1]&1}function Ya(t,e,r){for(var n,i,a=new t(e[0]),s=0;++s<e.length;){if(i=new t(e[s]),!i.s){a=i;break}n=a.cmp(i),(n===r||n===0&&a.s===r)&&(a=i)}return a}function _i(t,e){var r,n,i,a,s,o,l,u=0,c=0,d=0,f=t.constructor,p=f.rounding,h=f.precision;if(!t.d||!t.d[0]||t.e>17)return new f(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,l=h):l=e,o=new f(.03125);t.e>-2;)t=t.times(o),d+=5;for(n=Math.log(Q(2,d))/Math.LN10*2+5|0,l+=n,r=a=s=new f(1),f.precision=l;;){if(a=E(a.times(t),l,1),r=r.times(++c),o=s.plus(q(a,r,l,1)),oe(o.d).slice(0,l)===oe(s.d).slice(0,l)){for(i=d;i--;)s=E(s.times(s),l,1);if(e==null)if(u<3&&or(s.d,l-n,p,u))f.precision=l+=10,r=a=o=new f(1),c=0,u++;else return E(s,f.precision=h,p,T=!0);else return f.precision=h,s}s=o}}function et(t,e){var r,n,i,a,s,o,l,u,c,d,f,p=1,h=10,m=t,g=m.d,_=m.constructor,v=_.rounding,w=_.precision;if(m.s<0||!g||!g[0]||!m.e&&g[0]==1&&g.length==1)return new _(g&&!g[0]?-1/0:m.s!=1?NaN:g?0:m);if(e==null?(T=!1,c=w):c=e,_.precision=c+=h,r=oe(g),n=r.charAt(0),Math.abs(a=m.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(t),r=oe(m.d),n=r.charAt(0),p++;a=m.e,n>1?(m=new _("0."+r),a++):m=new _(n+"."+r.slice(1))}else return u=cn(_,c+2,w).times(a+""),m=et(new _(n+"."+r.slice(1)),c-h).plus(u),_.precision=w,e==null?E(m,w,v,T=!0):m;for(d=m,l=s=m=q(m.minus(1),m.plus(1),c,1),f=E(m.times(m),c,1),i=3;;){if(s=E(s.times(f),c,1),u=l.plus(q(s,new _(i),c,1)),oe(u.d).slice(0,c)===oe(l.d).slice(0,c))if(l=l.times(2),a!==0&&(l=l.plus(cn(_,c+2,w).times(a+""))),l=q(l,new _(p),c,1),e==null)if(or(l.d,c-h,v,o))_.precision=c+=h,u=s=m=q(d.minus(1),d.plus(1),c,1),f=E(m.times(m),c,1),i=o=1;else return E(l,_.precision=w,v,T=!0);else return _.precision=w,l;l=u,i+=2}}function Xa(t){return String(t.s*t.s/0)}function on(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 Xl(t,e){var r,n,i,a,s,o,l,u,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),Ha.test(e))return on(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(zl.test(e))r=16,e=e.toLowerCase();else if(Vl.test(e))r=2;else if(Hl.test(e))r=8;else throw Error(tt+e);for(a=e.search(/p/i),a>0?(l=+e.slice(a+1),e=e.substring(2,a)):e=e.slice(2),a=e.indexOf("."),s=a>=0,n=t.constructor,s&&(e=e.replace(".",""),o=e.length,a=o-a,i=Ga(n,new n(r),a,a*2)),u=sn(e,r,Ce),c=u.length-1,a=c;u[a]===0;--a)u.pop();return a<0?new n(t.s*0):(t.e=fn(u,c),t.d=u,T=!1,s&&(t=q(t,i,o*4)),l&&(t=t.times(Math.abs(l)<54?Q(2,l):lr.pow(2,l))),T=!0,t)}function Zl(t,e){var r,n=e.d.length;if(n<3)return e.isZero()?e:Mt(t,2,e,e);r=1.4*Math.sqrt(n),r=r>16?16:r|0,e=e.times(1/pn(5,r)),e=Mt(t,2,e,e);for(var i,a=new t(5),s=new t(16),o=new t(20);r--;)i=e.times(e),e=e.times(a.plus(i.times(s.times(i).minus(o))));return e}function Mt(t,e,r,n,i){var a,s,o,l,u=1,c=t.precision,d=Math.ceil(c/D);for(T=!1,l=r.times(r),o=new t(n);;){if(s=q(o.times(l),new t(e++*e++),c,1),o=i?n.plus(s):n.minus(s),n=q(s.times(l),new t(e++*e++),c,1),s=o.plus(n),s.d[d]!==void 0){for(a=d;s.d[a]===o.d[a]&&a--;);if(a==-1)break}a=o,o=n,n=s,s=a,u++}return T=!0,s.d.length=d+1,s}function pn(t,e){for(var r=t;--e;)r*=t;return r}function Za(t,e){var r,n=e.s<0,i=Be(t,t.precision,1),a=i.times(.5);if(e=e.abs(),e.lte(a))return Ve=n?4:1,e;if(r=e.divToInt(i),r.isZero())Ve=n?3:2;else{if(e=e.minus(r.times(i)),e.lte(a))return Ve=$a(r)?n?2:3:n?4:1,e;Ve=$a(r)?n?1:4:n?3:2}return e.minus(i).abs()}function wi(t,e,r,n){var i,a,s,o,l,u,c,d,f,p=t.constructor,h=r!==void 0;if(h?(ge(r,1,rt),n===void 0?n=p.rounding:ge(n,0,8)):(r=p.precision,n=p.rounding),!t.isFinite())c=Xa(t);else{for(c=Ie(t),s=c.indexOf("."),h?(i=2,e==16?r=r*4-3:e==8&&(r=r*3-2)):i=e,s>=0&&(c=c.replace(".",""),f=new p(1),f.e=c.length-s,f.d=sn(Ie(f),10,i),f.e=f.d.length),d=sn(c,10,i),a=l=d.length;d[--l]==0;)d.pop();if(!d[0])c=h?"0p+0":"0";else{if(s<0?a--:(t=new p(t),t.d=d,t.e=a,t=q(t,f,r,n,0,i),d=t.d,a=t.e,u=qa),s=d[r],o=i/2,u=u||d[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(t.s<0?3:2)):s>o||s===o&&(n===4||u||n===6&&d[r-1]&1||n===(t.s<0?8:7)),d.length=r,u)for(;++d[--r]>i-1;)d[r]=0,r||(++a,d.unshift(1));for(l=d.length;!d[l-1];--l);for(s=0,c="";s<l;s++)c+=mi.charAt(d[s]);if(h){if(l>1)if(e==16||e==8){for(s=e==16?4:3,--l;l%s;l++)c+="0";for(d=sn(c,i,e),l=d.length;!d[l-1];--l);for(s=1,c="1.";s<l;s++)c+=mi.charAt(d[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)c="0"+c;c="0."+c}else if(++a>l)for(a-=l;a--;)c+="0";else a<l&&(c=c.slice(0,a)+"."+c.slice(a))}c=(e==16?"0x":e==2?"0b":e==8?"0o":"")+c}return t.s<0?"-"+c:c}function Ua(t,e){if(t.length>e)return t.length=e,!0}function Jl(t){return new this(t).abs()}function Kl(t){return new this(t).acos()}function Ql(t){return new this(t).acosh()}function eu(t,e){return new this(t).plus(e)}function tu(t){return new this(t).asin()}function ru(t){return new this(t).asinh()}function nu(t){return new this(t).atan()}function iu(t){return new this(t).atanh()}function au(t,e){t=new this(t),e=new this(e);var r,n=this.precision,i=this.rounding,a=n+4;return!t.s||!e.s?r=new this(NaN):!t.d&&!e.d?(r=Be(this,a,1).times(e.s>0?.25:.75),r.s=t.s):!e.d||t.isZero()?(r=e.s<0?Be(this,n,i):new this(0),r.s=t.s):!t.d||e.isZero()?(r=Be(this,a,1).times(.5),r.s=t.s):e.s<0?(this.precision=a,this.rounding=1,r=this.atan(q(t,e,a,1)),e=Be(this,a,1),this.precision=n,this.rounding=i,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(q(t,e,a,1)),r}function su(t){return new this(t).cbrt()}function ou(t){return E(t=new this(t),t.e+1,2)}function lu(t,e,r){return new this(t).clamp(e,r)}function uu(t){if(!t||typeof t!="object")throw Error(dn+"Object expected");var e,r,n,i=t.defaults===!0,a=["precision",1,rt,"rounding",0,8,"toExpNeg",-It,0,"toExpPos",0,It,"maxE",0,It,"minE",-It,0,"modulo",0,9];for(e=0;e<a.length;e+=3)if(r=a[e],i&&(this[r]=gi[r]),(n=t[r])!==void 0)if(ce(n)===n&&n>=a[e+1]&&n<=a[e+2])this[r]=n;else throw Error(tt+r+": "+n);if(r="crypto",i&&(this[r]=gi[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(Va);else this[r]=!1;else throw Error(tt+r+": "+n);return this}function cu(t){return new this(t).cos()}function du(t){return new this(t).cosh()}function Ja(t){var e,r,n;function i(a){var s,o,l,u=this;if(!(u instanceof i))return new i(a);if(u.constructor=i,Fa(a)){u.s=a.s,T?!a.d||a.e>i.maxE?(u.e=NaN,u.d=null):a.e<i.minE?(u.e=0,u.d=[0]):(u.e=a.e,u.d=a.d.slice()):(u.e=a.e,u.d=a.d?a.d.slice():a.d);return}if(l=typeof a,l==="number"){if(a===0){u.s=1/a<0?-1:1,u.e=0,u.d=[0];return}if(a<0?(a=-a,u.s=-1):u.s=1,a===~~a&&a<1e7){for(s=0,o=a;o>=10;o/=10)s++;T?s>i.maxE?(u.e=NaN,u.d=null):s<i.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[a]):(u.e=s,u.d=[a]);return}if(a*0!==0){a||(u.s=NaN),u.e=NaN,u.d=null;return}return on(u,a.toString())}if(l==="string")return(o=a.charCodeAt(0))===45?(a=a.slice(1),u.s=-1):(o===43&&(a=a.slice(1)),u.s=1),Ha.test(a)?on(u,a):Xl(u,a);if(l==="bigint")return a<0?(a=-a,u.s=-1):u.s=1,on(u,a.toString());throw Error(tt+a)}if(i.prototype=b,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=uu,i.clone=Ja,i.isDecimal=Fa,i.abs=Jl,i.acos=Kl,i.acosh=Ql,i.add=eu,i.asin=tu,i.asinh=ru,i.atan=nu,i.atanh=iu,i.atan2=au,i.cbrt=su,i.ceil=ou,i.clamp=lu,i.cos=cu,i.cosh=du,i.div=fu,i.exp=pu,i.floor=hu,i.hypot=mu,i.ln=gu,i.log=bu,i.log10=wu,i.log2=_u,i.max=yu,i.min=vu,i.mod=ku,i.mul=Eu,i.pow=xu,i.random=Du,i.round=Au,i.sign=Tu,i.sin=Cu,i.sinh=Nu,i.sqrt=Su,i.sub=Ou,i.sum=Bu,i.tan=Iu,i.tanh=Mu,i.trunc=Ru,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 fu(t,e){return new this(t).div(e)}function pu(t){return new this(t).exp()}function hu(t){return E(t=new this(t),t.e+1,3)}function mu(){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 Fa(t){return t instanceof lr||t&&t.toStringTag===za||!1}function gu(t){return new this(t).ln()}function bu(t,e){return new this(t).log(e)}function _u(t){return new this(t).log(2)}function wu(t){return new this(t).log(10)}function yu(){return Ya(this,arguments,-1)}function vu(){return Ya(this,arguments,1)}function ku(t,e){return new this(t).mod(e)}function Eu(t,e){return new this(t).mul(e)}function xu(t,e){return new this(t).pow(e)}function Du(t){var e,r,n,i,a=0,s=new this(1),o=[];if(t===void 0?t=this.precision:ge(t,1,rt),n=Math.ceil(t/D),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));a<n;)i=e[a],i>=429e7?e[a]=crypto.getRandomValues(new Uint32Array(1))[0]:o[a++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);a<n;)i=e[a]+(e[a+1]<<8)+(e[a+2]<<16)+((e[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(e,a):(o.push(i%1e7),a+=4);a=n/4}else throw Error(Va);else for(;a<n;)o[a++]=Math.random()*1e7|0;for(n=o[--a],t%=D,n&&t&&(i=Q(10,D-t),o[a]=(n/i|0)*i);o[a]===0;a--)o.pop();if(a<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 s.e=r,s.d=o,s}function Au(t){return E(t=new this(t),t.e+1,this.rounding)}function Tu(t){return t=new this(t),t.d?t.d[0]?t.s:0*t.s:t.s||NaN}function Cu(t){return new this(t).sin()}function Nu(t){return new this(t).sinh()}function Su(t){return new this(t).sqrt()}function Ou(t,e){return new this(t).sub(e)}function Bu(){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 Iu(t){return new this(t).tan()}function Mu(t){return new this(t).tanh()}function Ru(t){return E(t=new this(t),t.e+1,1)}b[Symbol.for("nodejs.util.inspect.custom")]=b.toString;b[Symbol.toStringTag]="Decimal";var lr=b.constructor=Ja(gi);ln=new lr(ln);un=new lr(un);var Ka=lr;var Lu=20,Pu=1,pt=1e6,Qa=1e6,$u=-7,Uu=21,Fu=!1,ur="[big.js] ",ht=ur+"Invalid ",hn=ht+"decimal places",qu=ht+"rounding mode",es=ur+"Division by zero",$={},Me=void 0,ju=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function ts(){function t(e){var r=this;if(!(r instanceof t))return e===Me?ts():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(ht+"value");e=e===0&&1/e<0?"-0":String(e)}Vu(r,e)}r.constructor=t}return t.prototype=$,t.DP=Lu,t.RM=Pu,t.NE=$u,t.PE=Uu,t.strict=Fu,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function Vu(t,e){var r,n,i;if(!ju.test(e))throw Error(ht+"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 mt(t,e,r,n){var i=t.c;if(r===Me&&(r=t.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(qu);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]!==Me))),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]!==Me||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 gt(t,e,r){var n=t.e,i=t.c.join(""),a=i.length;if(e)i=i.charAt(0)+(a>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>a)for(n-=a;n--;)i+="0";else n<a&&(i=i.slice(0,n)+"."+i.slice(n));else a>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,a=r.s,s=t.s,o=r.e,l=t.e;if(!n[0]||!i[0])return n[0]?a:i[0]?-s:0;if(a!=s)return a;if(e=a<0,o!=l)return o>l^e?1:-1;for(s=(o=n.length)<(l=i.length)?o:l,a=-1;++a<s;)if(n[a]!=i[a])return n[a]>i[a]^e?1:-1;return o==l?0:o>l^e?1:-1};$.div=function(t){var e=this,r=e.constructor,n=e.c,i=(t=new r(t)).c,a=e.s==t.s?1:-1,s=r.DP;if(s!==~~s||s<0||s>pt)throw Error(hn);if(!i[0])throw Error(es);if(!n[0])return t.s=a,t.c=[t.e=0],t;var o,l,u,c,d,f=i.slice(),p=o=i.length,h=n.length,m=n.slice(0,o),g=m.length,_=t,v=_.c=[],w=0,x=s+(_.e=e.e-t.e)+1;for(_.s=a,a=x<0?0:x,f.unshift(0);g++<o;)m.push(0);do{for(u=0;u<10;u++){if(o!=(g=m.length))c=o>g?1:-1;else for(d=-1,c=0;++d<o;)if(i[d]!=m[d]){c=i[d]>m[d]?1:-1;break}if(c<0){for(l=g==o?i:f;g;){if(m[--g]<l[g]){for(d=g;d&&!m[--d];)m[d]=9;--m[d],m[g]+=10}m[g]-=l[g]}for(;!m[0];)m.shift()}else break}v[w++]=c?u:++u,m[0]&&c?m[g]=n[p]||0:m=[n[p]]}while((p++<h||m[0]!==Me)&&a--);return!v[0]&&w!=1&&(v.shift(),_.e--,x--),w>x&&mt(_,x,r.RM,m[0]!==Me),_};$.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,a=this,s=a.constructor,o=a.s,l=(t=new s(t)).s;if(o!=l)return t.s=-l,a.plus(t);var u=a.c.slice(),c=a.e,d=t.c,f=t.e;if(!u[0]||!d[0])return d[0]?t.s=-l:u[0]?t=new s(a):t.s=1,t;if(o=c-f){for((i=o<0)?(o=-o,n=u):(f=c,n=d),n.reverse(),l=o;l--;)n.push(0);n.reverse()}else for(r=((i=u.length<d.length)?u:d).length,o=l=0;l<r;l++)if(u[l]!=d[l]){i=u[l]<d[l];break}if(i&&(n=u,u=d,d=n,t.s=-t.s),(l=(r=d.length)-(e=u.length))>0)for(;l--;)u[e++]=0;for(l=e;r>o;){if(u[--r]<d[r]){for(e=r;e&&!u[--e];)u[e]=9;--u[e],u[r]+=10}u[r]-=d[r]}for(;u[--l]===0;)u.pop();for(;u[0]===0;)u.shift(),--f;return u[0]||(t.s=1,u=[f=0]),t.c=u,t.e=f,t};$.mod=function(t){var e,r=this,n=r.constructor,i=r.s,a=(t=new n(t)).s;if(!t.c[0])throw Error(es);return r.s=t.s=1,e=t.cmp(r)==1,r.s=i,t.s=a,e?new n(r):(i=n.DP,a=n.RM,n.DP=n.RM=0,r=r.div(t),n.DP=i,n.RM=a,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,a=i.constructor;if(t=new a(t),i.s!=t.s)return t.s=-t.s,i.minus(t);var s=i.e,o=i.c,l=t.e,u=t.c;if(!o[0]||!u[0])return u[0]||(o[0]?t=new a(i):t.s=i.s),t;if(o=o.slice(),e=s-l){for(e>0?(l=s,n=u):(e=-e,n=o),n.reverse();e--;)n.push(0);n.reverse()}for(o.length-u.length<0&&(n=u,u=o,o=n),e=u.length,r=0;e;o[e]%=10)r=(o[--e]=o[e]+u[e]+r)/10|0;for(r&&(o.unshift(r),++l),e=o.length;o[--e]===0;)o.pop();return t.c=o,t.e=l,t};$.pow=function(t){var e=this,r=new e.constructor("1"),n=r,i=t<0;if(t!==~~t||t<-Qa||t>Qa)throw Error(ht+"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>pt)throw Error(ht+"precision");return mt(new this.constructor(this),t,e)};$.round=function(t,e){if(t===Me)t=0;else if(t!==~~t||t<-pt||t>pt)throw Error(hn);return mt(new this.constructor(this),t+this.e+1,e)};$.sqrt=function(){var t,e,r,n=this,i=n.constructor,a=n.s,s=n.e,o=new i("0.5");if(!n.c[0])return new i(n);if(a<0)throw Error(ur+"No square root");a=Math.sqrt(+gt(n,!0,!0)),a===0||a===1/0?(e=n.c.join(""),e.length+s&1||(e+="0"),a=Math.sqrt(e),s=((s+1)/2|0)-(s<0||s&1),t=new i((a==1/0?"5e":(a=a.toExponential()).slice(0,a.indexOf("e")+1))+s)):t=new i(a+""),s=t.e+(i.DP+=4);do r=t,t=o.times(r.plus(n.div(r)));while(r.c.slice(0,s).join("")!==t.c.slice(0,s).join(""));return mt(t,(i.DP-=4)+t.e+1,i.RM)};$.times=$.mul=function(t){var e,r=this,n=r.constructor,i=r.c,a=(t=new n(t)).c,s=i.length,o=a.length,l=r.e,u=t.e;if(t.s=r.s==t.s?1:-1,!i[0]||!a[0])return t.c=[t.e=0],t;for(t.e=l+u,s<o&&(e=i,i=a,a=e,u=s,s=o,o=u),e=new Array(u=s+o);u--;)e[u]=0;for(l=o;l--;){for(o=0,u=s+l;u>l;)o=e[u]+a[l]*i[u-l-1]+o,e[u--]=o%10,o=o/10|0;e[u]=o}for(o?++t.e:e.shift(),l=e.length;!e[--l];)e.pop();return t.c=e,t};$.toExponential=function(t,e){var r=this,n=r.c[0];if(t!==Me){if(t!==~~t||t<0||t>pt)throw Error(hn);for(r=mt(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return gt(r,!0,!!n)};$.toFixed=function(t,e){var r=this,n=r.c[0];if(t!==Me){if(t!==~~t||t<0||t>pt)throw Error(hn);for(r=mt(new r.constructor(r),t+r.e+1,e),t=t+r.e+1;r.c.length<t;)r.c.push(0)}return gt(r,!1,!!n)};$[Symbol.for("nodejs.util.inspect.custom")]=$.toJSON=$.toString=function(){var t=this,e=t.constructor;return gt(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])};$.toNumber=function(){var t=+gt(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(t.toString()))throw Error(ur+"Imprecise conversion");return t};$.toPrecision=function(t,e){var r=this,n=r.constructor,i=r.c[0];if(t!==Me){if(t!==~~t||t<1||t>pt)throw Error(ht+"precision");for(r=mt(new n(r),t,e);r.c.length<t;)r.c.push(0)}return gt(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(ur+"valueOf disallowed");return gt(t,t.e<=e.NE||t.e>=e.PE,!0)};var zu=ts(),rs=zu;var Si={};Ma(Si,{DecodeError:()=>de,Decoder:()=>Se,EXT_TIMESTAMP:()=>vi,Encoder:()=>Rt,ExtData:()=>Ne,ExtensionCodec:()=>nt,decode:()=>ds,decodeArrayStream:()=>hs,decodeAsync:()=>ps,decodeMulti:()=>fs,decodeMultiStream:()=>ms,decodeTimestampExtension:()=>Ai,decodeTimestampToTimeSpec:()=>Di,encode:()=>bn,encodeDateToTimeSpec:()=>Ei,encodeTimeSpecToTimestamp:()=>ki,encodeTimestampExtension:()=>xi});function ns(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 a=t.charCodeAt(n);(a&64512)===56320&&(++n,i=((i&1023)<<10)+(a&1023)+65536)}(i&4294901760)===0?r+=3:r+=4}}return r}function Hu(t,e,r){let n=t.length,i=r,a=0;for(;a<n;){let s=t.charCodeAt(a++);if((s&4294967168)===0){e[i++]=s;continue}else if((s&4294965248)===0)e[i++]=s>>6&31|192;else{if(s>=55296&&s<=56319&&a<n){let o=t.charCodeAt(a);(o&64512)===56320&&(++a,s=((s&1023)<<10)+(o&1023)+65536)}(s&4294901760)===0?(e[i++]=s>>12&15|224,e[i++]=s>>6&63|128):(e[i++]=s>>18&7|240,e[i++]=s>>12&63|128,e[i++]=s>>6&63|128)}e[i++]=s&63|128}}var Wu=new TextEncoder,Gu=50;function Yu(t,e,r){Wu.encodeInto(t,e.subarray(r))}function is(t,e,r){t.length>Gu?Yu(t,e,r):Hu(t,e,r)}var Xu=4096;function yi(t,e,r){let n=e,i=n+r,a=[],s="";for(;n<i;){let o=t[n++];if((o&128)===0)a.push(o);else if((o&224)===192){let l=t[n++]&63;a.push((o&31)<<6|l)}else if((o&240)===224){let l=t[n++]&63,u=t[n++]&63;a.push((o&31)<<12|l<<6|u)}else if((o&248)===240){let l=t[n++]&63,u=t[n++]&63,c=t[n++]&63,d=(o&7)<<18|l<<12|u<<6|c;d>65535&&(d-=65536,a.push(d>>>10&1023|55296),d=56320|d&1023),a.push(d)}else a.push(o);a.length>=Xu&&(s+=String.fromCharCode(...a),a.length=0)}return a.length>0&&(s+=String.fromCharCode(...a)),s}var Zu=new TextDecoder,Ju=200;function Ku(t,e,r){let n=t.subarray(e,e+r);return Zu.decode(n)}function as(t,e,r){return r>Ju?Ku(t,e,r):yi(t,e,r)}var Ne=class{type;data;constructor(e,r){this.type=e,this.data=r}};var de=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 ss(t,e,r){let n=r/4294967296,i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function mn(t,e,r){let n=Math.floor(r/4294967296),i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function gn(t,e){let r=t.getInt32(e),n=t.getUint32(e+4);return r*4294967296+n}function os(t,e){let r=t.getUint32(e),n=t.getUint32(e+4);return r*4294967296+n}var vi=-1,Qu=4294967296-1,ec=17179869184-1;function ki({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=ec)if(e===0&&t<=Qu){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),a=new DataView(i.buffer);return a.setUint32(0,e<<2|r&3),a.setUint32(4,n),i}else{let r=new Uint8Array(12),n=new DataView(r.buffer);return n.setUint32(0,e),mn(n,4,t),r}}function Ei(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 xi(t){if(t instanceof Date){let e=Ei(t);return ki(e)}else return null}function Di(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,a=r>>>2;return{sec:i,nsec:a}}case 12:{let r=gn(e,4),n=e.getUint32(0);return{sec:r,nsec:n}}default:throw new de(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function Ai(t){let e=Di(t);return new Date(e.sec*1e3+e.nsec/1e6)}var ls={type:vi,encode:xi,decode:Ai};var nt=class t{static defaultCodec=new t;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(ls)}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 a=i(e,r);if(a!=null){let s=-1-n;return new Ne(s,a)}}}for(let n=0;n<this.encoders.length;n++){let i=this.encoders[n];if(i!=null){let a=i(e,r);if(a!=null){let s=n;return new Ne(s,a)}}}return e instanceof Ne?e:null}decode(e,r,n){let i=r<0?this.builtInDecoders[-1-r]:this.decoders[r];return i?i(e,r,n):new Ne(r,e)}};function tc(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function cr(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):tc(t)?new Uint8Array(t):Uint8Array.from(t)}var rc=100,nc=2048,Rt=class t{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??nt.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??rc,this.initialBufferSize=e?.initialBufferSize??nc,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=ns(e);this.ensureBufferSizeToWrite(5+n),this.writeStringHeader(n),is(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=cr(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 a of n){let s=e[a];this.ignoreUndefined&&s===void 0||(this.encodeString(a),this.doEncode(s,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),ss(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),mn(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 bn(t,e){return new Rt(e).encodeSharedRef(t)}function _n(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}var ic=16,ac=16,wn=class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(e=ic,r=ac){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 a of i){let s=a.bytes;for(let o=0;o<n;o++)if(s[o]!==e[r+o])continue e;return a.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 a=yi(e,r,n),s=Uint8Array.prototype.slice.call(e,r,r+n);return this.store(s,a),a}};var Ti="array",pr="map_key",cs="map_value",sc=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new de("The type of key must be string or number but "+typeof t)},Ci=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let r=this.getUninitializedStateFromPool();r.type=Ti,r.position=0,r.size=e,r.array=new Array(e)}pushMapState(e){let r=this.getUninitializedStateFromPool();r.type=pr,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===Ti){let n=e;n.size=0,n.array=void 0,n.position=0,n.type=void 0}if(e.type===pr||e.type===cs){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}},fr=-1,Ni=new DataView(new ArrayBuffer(0)),oc=new Uint8Array(Ni.buffer);try{Ni.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 us=new RangeError("Insufficient data"),lc=new wn,Se=class t{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=Ni;bytes=oc;headByte=fr;stack=new Ci;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??nt.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:lc,this.mapKeyConverter=e?.mapKeyConverter??sc}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=fr,this.stack.reset()}setBuffer(e){let r=cr(e);this.bytes=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===fr&&!this.hasRemaining(1))this.setBuffer(e);else{let r=this.bytes.subarray(this.pos),n=cr(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(l){if(!(l instanceof RangeError))throw l}this.totalPos+=this.pos}if(r){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return n}let{headByte:i,pos:a,totalPos:s}=this;throw new RangeError(`Insufficient data in parsing ${_n(i)} at ${s} (${a} 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 a of e){if(r&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a),n&&(i=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(s){if(!(s instanceof RangeError))throw s}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 de(`Unrecognized type byte: ${_n(e)}`);this.complete();let n=this.stack;for(;n.length>0;){let i=n.top();if(i.type===Ti)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===pr){if(r==="__proto__")throw new de("The key __proto__ is not allowed");i.key=this.mapKeyConverter(r),i.type=cs;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=pr;continue e}}return r}}readHeadByte(){return this.headByte===fr&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=fr}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 de(`Unrecognized array type byte: ${_n(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new de(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new de(`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 de(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+r+e)throw us;let n=this.pos+r,i;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?i=this.keyDecoder.decode(this.bytes,n,e):i=as(this.bytes,n,e),this.pos+=r+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===pr:!1}decodeBinary(e,r){if(e>this.maxBinLength)throw new de(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+r))throw us;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 de(`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=os(this.view,this.pos);return this.pos+=8,e}readI64(){let e=gn(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 ds(t,e){return new Se(e).decode(t)}function fs(t,e){return new Se(e).decodeMulti(t)}function uc(t){return t[Symbol.asyncIterator]!=null}async function*cc(t){let e=t.getReader();try{for(;;){let{done:r,value:n}=await e.read();if(r)return;yield n}}finally{e.releaseLock()}}function yn(t){return uc(t)?t:cc(t)}async function ps(t,e){let r=yn(t);return new Se(e).decodeAsync(r)}function hs(t,e){let r=yn(t);return new Se(e).decodeArrayStream(r)}function ms(t,e){let r=yn(t);return new Se(e).decodeStream(r)}var Un=Ra(Ki(),1),Qi=Ka,ea=rs,$e=Si,vo=Un.DOMParser,ko=Un.XMLSerializer;var Eo=$e!==null;function xo(){if(!Eo)throw new Error("@msgpack/msgpack is required for MessagePack support. Install with: npm install @msgpack/msgpack")}var Do=cf();function cf(){if(!Eo)return null;let t=new TextEncoder,e=new TextDecoder,r=new $e.ExtensionCodec;return r.register({type:-1,encode:n=>{if(n instanceof Date){let i=vt(n);if(i==="D"||i==="H")return null}return $e.encodeTimestampExtension(n)},decode:n=>$e.decodeTimestampExtension(n)}),r.register({type:1,encode:n=>Te(n)?t.encode(n.toString()):null,decode:n=>Fn(e.decode(n))}),r.register({type:2,encode:n=>{if(n instanceof Date&&vt(n)==="D"){let i=n.getUTCFullYear(),a=String(n.getUTCMonth()+1).padStart(2,"0"),s=String(n.getUTCDate()).padStart(2,"0");return t.encode(`${i}-${a}-${s}`)}return null},decode:n=>new Date(e.decode(n)+"T00:00:00.000Z")}),r.register({type:3,encode:n=>{if(n instanceof Date&&vt(n)==="H"){let i=String(n.getUTCHours()).padStart(2,"0"),a=String(n.getUTCMinutes()).padStart(2,"0"),s=String(n.getUTCSeconds()).padStart(2,"0"),o=String(n.getUTCMilliseconds()).padStart(3,"0");return t.encode(`${i}:${a}:${s}.${o}`)}return null},decode:n=>{let i=e.decode(n),a=i.indexOf("."),s=a>=0?i.substring(0,a):i,o=a>=0?i.substring(a+1):"0",[l,u,c]=s.split(":"),d=Math.round(+o.substring(0,3));return new Date(Date.UTC(1970,0,1,+l,+u,+c,d))}}),r.register({type:4,encode:n=>{let i=ta(n);if(i!==null){let[a,s]=i;return t.encode(`${a}:${s(n)}`)}return null},decode:n=>{let i=e.decode(n),a=i.indexOf(":"),s=i.slice(0,a),o=i.slice(a+1),l=ct[s];if(l!==void 0){let[,u]=l;return u(o)}return`${o}::${s}`}}),r}function Ao(t){return xo(),$e.encode(t,{extensionCodec:Do})}function To(t){return xo(),$e.decode(t,{extensionCodec:Do})}function jn(t,e=!1){let r=Vn(t);if(r===null)return[!1,String(t)];let[n,i,a]=r;return a&&!e?[!1,String(t)]:[!0,`${i(t)}::${n}`]}function ra(t){if(!t.includes("::"))return[!1,t];let e=t.lastIndexOf("::"),r=t.slice(0,e),n=t.slice(e+2),i=ct[n];if(i===void 0)return[!1,t];let[,a]=i;return[!0,a(r)]}function qn(t,e,r){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let n={};for(let[i,a]of Object.entries(t))n[i]=qn(a,e,r);return n}return Array.isArray(t)?t.map(n=>qn(n,e,r)):r(t)?e(t):t}function na(t){let e=Vn(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[a,s]=na(i);return s&&(r=!0),a}),r]}if(t!==null&&typeof t=="object"){let r=!1,n={};for(let[i,a]of Object.entries(t)){let[s,o]=na(a);o&&(r=!0),n[i]=s}return[n,r]}return[t,!1]}function df(t,e=!1){let[r,n]=jn(t,e);if(r)return n;let[i,a]=na(t),s=JSON.stringify(i);return a?`${s}::JS`:s}function ff(t){return JSON.stringify(t)}function pf(t){if(!$e)throw new Error("@msgpack/msgpack is required for MessagePack support");return $e.encode(t)}function ve(t,e=null,{raw:r=!1,qs:n=!1,_forceSuffix:i=!1}={}){if(n)return`${No(t)}::QS`;if(r){if(e===null||e==="json")return ff(t);if(e==="msgpack")return pf(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 a=df(t,i);return e==="json"?`"${a}"`:a}else{if(e==="xml")return`<?xml version="1.0" ?><tytx_root>${Co(t)}</tytx_root>`;if(e==="msgpack")return Ao(t);throw new Error(`Unknown transport: ${e}`)}}var er,ia;typeof window<"u"&&window.DOMParser?(er=window.DOMParser,ia=window.XMLSerializer):(er=vo,ia=ko);function So(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 Oo(t,e,r){let n=t.createElement(e),i=r.attrs||{},a=r.value;for(let[s,o]of Object.entries(i))n.setAttribute(s,ve(o,null,{_forceSuffix:!0}));if(Array.isArray(a))for(let s of a)if(So(s)){let[o]=Object.keys(s),l=s[o],u=Oo(t,o,l);n.appendChild(u)}else{n.textContent=ve(a);break}else n.textContent=ve(a);return n}function Co(t){if(!er)throw new Error("XML support requires @xmldom/xmldom package in Node.js");if(So(t)){let[e]=Object.keys(t),r=t[e],n=new er().parseFromString("<root/>","text/xml"),i=Oo(n,e,r);return new ia().serializeToString(i)}else return ve(t)}function aa(t){let e={};for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=re(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=aa(n);return{attrs:e,value:{[n.tagName]:i}}}else{let n=[];for(let i of r){let a=aa(i);n.push({[i.tagName]:a})}return{attrs:e,value:n}}return{attrs:e,value:re(t.textContent)}}function Bo(t){if(!er)throw new Error("XML support requires @xmldom/xmldom package in Node.js");let n=new er().parseFromString(t,"text/xml").documentElement;if(n.tagName==="tytx_root"){let a=null;for(let s=0;s<n.childNodes.length;s++)if(n.childNodes[s].nodeType===1){a=n.childNodes[s];break}if(!a)return re(n.textContent);n=a}let i=aa(n);return{[n.tagName]:i}}function hf(t){return typeof t=="string"}function mf(t){let[e,r]=ra(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 qn(i,gf,hf)}function gf(t){return t.includes("::")?ra(t)[1]:t}function bf(t){let e=Bo(t);return typeof e=="string"?re(e):e}function _f(t){return To(t)}function re(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)),mf(r)}else{if(e==="xml")return bf(t);if(e==="msgpack")return _f(t);throw new Error(`Unknown transport: ${e}`)}}function No(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,a]=jn(n,!0);i?e.push(`${r}=${a}`):e.push(`${r}=${n}`)}return e.join("&")}throw new TypeError(`toQs expects object or array, got ${typeof t}`)}function Io(t){if(!t)return[];let e=t.split("&"),r=e.map(s=>s.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(s=>re(s));let a={};for(let s of e){let o=s.indexOf("="),l=s.slice(0,o),u=s.slice(o+1);a[l]=re(u)}return a}var Ro=Qi||ea||Number,wf=Qi?"decimal.js":ea?"big.js":"number";function Fn(t){return new Ro(t)}function Te(t){return wf==="number"?!1:t instanceof Ro}function vt(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 yf(t){return t.toString()}function vf(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 kf(t){return t.toISOString()}function Ef(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 xf(t){return t?"true":"false"}function Df(t){return t.toString()}function Af(t){return t.toString()}function Tf(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 zn=[],sa=new Map;function ta(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,a]of zn)if(r.prototype===e)return[n,i,a];return null}function Vn(t){if(t===null)return["NN",()=>"",!0];if(Te(t))return["N",yf,!1];if(t instanceof Uint8Array)return["RAW",Tf,!1];if(t instanceof Date){let e=vt(t);return e==="D"?["D",vf,!1]:e==="H"?["H",Ef,!1]:["DHZ",kf,!1]}return typeof t=="boolean"?["B",xf,!0]:typeof t=="number"?Number.isInteger(t)?["L",Df,!0]:["R",Af,!0]:ta(t)}function Cf(t){return Fn(t)}function Nf(t){let[e,r,n]=t.split("-").map(Number);return new Date(Date.UTC(e,r-1,n,0,0,0,0))}function Mo(t){return new Date(t)}function Sf(t){let[e,r,n]=t.split(":"),[i,a]=n.split(".");return new Date(Date.UTC(1970,0,1,Number(e),Number(r),Number(i),Number(a||0)))}function Of(t){return t.toLowerCase()==="true"}function Bf(t){return parseInt(t,10)}function If(t){return parseFloat(t)}function Mf(t){return t}function Rf(t){return null}var Lf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function Pf(t){if(!Lf.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 $f(t){return Io(t)}var Uf=/^[A-Z]+$/,ct={N:[Object,Cf],D:[Date,Nf],DH:[Date,Mo],DHZ:[Date,Mo],H:[Date,Sf],L:[Number,Bf],R:[Number,If],T:[String,Mf],B:[Boolean,Of],QS:[Object,$f],NN:[null,Rf],RAW:[Uint8Array,Pf]};function Ir(t){return Object.hasOwn(ct,t)?ct[t][0]:null}function oa(t,e,r,n,i=!1){if(typeof e!="string"||!Uf.test(e))throw new Error(`TYTX suffix '${e}' is invalid: expected uppercase ASCII letters only`);let a=ct[e];if(a!==void 0&&a[0]!==t){let s=a[0]===null?"null":a[0].name;throw new Error(`TYTX suffix '${e}' is already registered for ${s}`)}zn=zn.filter(([s])=>s!==t),zn.push([t,e,r,i]),ct[e]=[t,n]}function Mr(t,e){sa.set(t,e)}function Ge(t){return sa.has(t)?sa.get(t):{}}var Lo={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 qf(t){let e=t._retryPolicy;return e==null?null:typeof e=="string"?Lo[e]||null:e}function jf(t,e){return e.some(r=>r==="Error"?!0:t.name===r||t.constructor.name===r)}function Vf(t){return new Promise(e=>setTimeout(e,t))}async function zf(t,e){if(!e)return t();let r=e.maxAttempts||3,n=e.delay||1,i=e.backoff||2,a=e.jitter!==!1,s=e.on||["Error"],o=null,l=n*1e3;for(let u=0;u<r;u++)try{let c=t();return c instanceof Promise?await c:c}catch(c){if(o=c,u<r-1&&jf(c,s)){let d=l;a&&(d*=1+Math.random()*.1),await Vf(d),l*=i}else throw c}throw o}var ne=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 a of["interval","reactive"])if(Object.hasOwn(n,a))throw new TypeError(`Removed resolver option: ${a}. 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[a,s]of Object.entries(n))i.has(a)||(this._kw[a]=s);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},s=>this._prepareValue(s));let a=this._computeEffectiveFingerprint(i);return a===this._lastEffectiveFingerprint&&!this.expired?this.cachedValue:(this._lastEffectiveFingerprint=a,this._load(i,s=>this._finalize(s)))}_load(e,r){let n=qf(this),i=()=>this.load(e);if(n)return zf(i,n).then(r);let a=i();return a&&typeof a.then=="function"?a.then(r):r(a)}_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}};ne._BagClass=null;var Rr=class extends ne{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 Ye=class t{constructor(e,r,n=null,i=null,a=null,s=null,o=null,l=!0){this.label=r,this._value=null,this._attr={},this._parentBag=null,this._resolver=null,this._nodeSubscribers={},this._onChangedValue=null,this.nodeTag=s,this.xmlTag=o,this._compiled=null,this.parentBag=e,i&&this.setAttr(i,!1,!0,l),n!==null&&this.setValue(n,!1),a&&(this.resolver=a)}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=re(`${r}::QS`);if(Array.isArray(i)){let a=i.length?i:Object.keys(this._attr),s=a.map(l=>{let u=this.getAttr(l);return!e&&u instanceof ne?u.resolve():u}),o=l=>i.length===0?Object.fromEntries(a.map((u,c)=>[u,l[c]])):l.length===1?l[0]:l;return s.some(l=>l&&typeof l.then=="function")?Promise.all(s).then(o):o(s)}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,a=!0,s=null,o=!1){e instanceof ne?(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 l=this._value;l!==e&&l?.parentNode===this&&l.setBackref(),this._value=e;let u=l!==this._value,c=r??!0,d=null;if(n!==null){let p={...this._attr};this.setAttr(n,!1,i,a);let h=this._buildAttrDiff(p,this._attr);d=Object.keys(h).length>0?h:null}r=c&&(u||d!==null);let f=d?u?"upd_value_attr":"upd_attrs":"upd_value";if(this._onChangedValue&&this._onChangedValue(this,e,l,c),r){let p=d!==null?{oldvalue:l,attrs_diff:d}:{oldvalue:l};for(let h of Object.values(this._nodeSubscribers))h({node:this,info:p,evt:f})}this._parentBag!==null&&this._parentBag.backref&&(e&&typeof e._htraverse=="function"&&e.setBackref(this,this._parentBag),r&&this._parentBag._onNodeChanged(this,[this.label],f,l,d,s,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,a={...this._attr},s=this.resolver;s&&s._node===this&&(s._node=null),this.resolver=n,this.setValue(r,!1,{...e.attr},!1,!1,null);let o=this._buildAttrDiff(a,this._attr),l=Object.keys(o).length?o:null,u=i!==r||s!==n;if(u||l){let c=l?u?"upd_value_attr":"upd_attrs":"upd_value",d=l?{oldvalue:i,attrs_diff:l}:{oldvalue:i};for(let f of Object.values(this._nodeSubscribers))f({node:this,info:d,evt:c});this._parentBag!==null&&this._parentBag.backref&&this._parentBag._onNodeChanged(this,[this.label],c,i,l)}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 a of i){let s=a in e?e[a]:null,o=a in r?r[a]:null;s!==o&&(n[a]={old:s,new:o})}return n}setAttr(e=null,r=!0,n=!0,i=!0){let a=e||{},s=Object.keys(this._nodeSubscribers).length>0,l=r&&(s||this._parentBag!==null&&this._parentBag.backref)?{...this._attr}:null;if(n?Object.assign(this._attr,a):this._attr={...a},i)for(let u of Object.keys(this._attr))this._attr[u]===null&&delete this._attr[u];if(r&&l!==null){let u=this._buildAttrDiff(l,this._attr);if(Object.keys(u).length>0&&s)for(let c of Object.values(this._nodeSubscribers))c({node:this,info:{attrs_diff:u},evt:"upd_attrs"});if(Object.keys(u).length>0&&this._parentBag!==null&&this._parentBag.backref){let c=r===!0?"true":String(r);this._parentBag._onNodeChanged(this,[this.label],"upd_attrs",null,u,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 Lr=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,a=i.includes("::")?re(i):i;return n?this._list.findIndex(s=>s.getAttr(n)===a):this._list.findIndex(s=>s._value===a)}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 a=this._parseSharpIndex(n.slice(1),e);return Math.min(a,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 a=this._parseSharpIndex(n.slice(1),e);return Math.min(a+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,a=null,s=null,o=!1,l=!0,u=null,c=!0,d=!1,f=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 m=p.split("&");if(m.length===1)i={[m[0]]:r};else{if(!Array.isArray(r)||r.length!==m.length)throw new Error("Wrong attributes assignment");i={};for(let g=0;g<m.length;g++)i[m[g]]=r[g]}r=null}let h=this._dict[e];if(h)f&&(h.nodeTag=f),s!==null&&(s===!1?h.resolver=null:h.resolver=s),p?h.setAttr(i,c,!0,l):h.setValue(r,c,i,o,l,u,d);else{let m=a&&a.nodeClass?a.nodeClass:Ye;h=new m(a,e,p?null:r,i,s,f,null,l);let g=this._parsePosition(n);this._dict[e]=h,this._list.splice(g,0,h),c&&a&&a.backref&&a._onNodeInserted(h,g,null,u,d)}return d&&h.setValue(null,!1),h}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 a=this._list[r].label;if(i.length>1){let s=[...i].sort((c,d)=>c-d),o=s[0]<r?1:0,l=[];for(let c=s.length-1;c>=0;c--){let d=s[c];if(d>=0&&d<this._list.length){let f=this._list[d];this._list.splice(d,1),l.push(f),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(f,d)}}let u=this.index(a);u<0&&(u=this._list.length),u+=o;for(let c of l)this._list.splice(u,0,c),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(c,u)}else{let s=i[0];if(s===r||s<0||s>=this._list.length)return;let o=this._list[s];this._list.splice(s,1),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(o,s),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 Fo=Ra(Ki(),1);var la="::RSLV:",Hf=new Map,Wf=new Map,Hn=new WeakMap,Y=class extends Error{constructor(e){super(e),this.name="BagSerializationError"}},Pr=class extends ne{constructor(e){super({asBag:!1}),Hn.set(this,e)}get payload(){return Hn.get(this)}load(){throw new Y("This resolver is opaque; local execution is unavailable")}};function Po(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 Y("Invalid resolver description")}function $o(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 Y("Resolver parameters must be JSON data; callbacks cannot travel");e.add(t);for(let r of Object.values(t))$o(r,e);e.delete(t)}}function $r(t){if(Hn.has(t))return Hn.get(t);let e=Wf.get(t.constructor);if(!e)throw new Y(`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 Po(n),$o(n),la+JSON.stringify(n)}function Wn(t){if(typeof t!="string"||!t.startsWith(la))return null;let e=t.slice(la.length);if(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+$/.test(e))return new Pr(t);let r;try{r=JSON.parse(e)}catch{throw new Y("Invalid resolver JSON or signed token")}Po(r);let n=Hf.get(JSON.stringify([r.resolver_module,r.resolver_class]));if(!n)return new Pr(t);let i=n.decode({args:r.args??[],kwargs:r.kwargs});if(!(i instanceof n.cls))throw new Y("Resolver decoder returned an incompatible instance");return i}function Gn(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[e,r instanceof ne?$r(r):r]))}function ua(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[e,Wn(r)??r]))}var Oe="__cls";function tr(t,e){return t!==null&&t.tytxSuffix===e?t:Ir(e)}function Gf(t){let e=t.tytxSuffix,r=Object.entries(Ge(e)).filter(([,n])=>n===t).map(([n])=>n);if(r.length===0)throw new Y(`${t.name} is not in the TYTX subtype dictionary of '${e}'`);if(r.length>1)throw new Y(`${t.name} is in the TYTX subtype dictionary of '${e}' under several names: ${r.sort().join(", ")}`);return r[0]}function ca(t,e){let r=Ge(t);if(!Object.hasOwn(r,e))throw new Y(`Unknown Bag class '${e}' for TYTX type '${t}'`);return r[e]}function da(t,e){return t===e?null:Gf(t)}function*qo(t,e=[]){for(let r of t){let n=[...e,r.label];yield[n,r];let i=r.getValue(!0);!r.resolver&&i instanceof se&&(yield*qo(i,n))}}function Yf(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 rr(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function dt(t){return typeof t=="string"?t.includes("::")?`${t}::T`:t:Array.isArray(t)?t.map(dt):rr(t)?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,dt(r)])):t}function fa(t){if(!rr(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 Uo=!1,se=class t{static tytxSuffix="X";constructor(e=null,r={}){this._nodes=new Lr,this._backref=!1,this._parent=null,this._parentNode=null,this._rootAttributes=null,this._updSubscribers={},this._insSubscribers={},this._delSubscribers={},fa(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 Ye}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,a]=this._htraverseBefore(e);if(i===null)return[null,null];if(a.length===0)return[i,""];for(;a.length>1&&i instanceof t;){let s=a[0];if(s==="#parent"){if(i.parent===null||i.parent===void 0)break;a.shift(),i=i.parent;continue}let o=i._nodes.get(s);if(!o)break;let l=o.getValue(n);if(l instanceof t)a.shift(),i=l;else if(r){let u=i.createChildBag();o.setValue(u,!0,null,!0,!0,"autocreate"),a.shift(),i=u}else break}if(!r)return a.length>1?[null,null]:[i,a[0]];for(;a.length>1;){let s=a.shift();if(s.startsWith("#"))throw new Ur("Not existing index in #n syntax");let o=i.createChildBag();i._nodes.set(s,o,">",null,i,null,!1,!0,"autocreate"),i=o}return[i,a[0]]}get(e,r=null,n=!0,i={}){if(!e)return this;if(e==="#parent")return this.parent;let a=null;e.includes("?")&&([e,a]=e.split("?",2));let s=this._nodes.get(e);return s?s.getValue(n,a,i):r}getItem(e,r=null,n=!1,i={}){if(!e)return this;let[a,s]=this._htraverse(e,!1,n);return a instanceof t?a.get(s,r,n,i):r}setItem(e,r,n=null,i=">",a=!1,s=!0,o=null,l=!1,u=!0,c=null,d=null){if(e==="")throw new RangeError("setItem requires a non-empty path");let[f,p]=this._htraverse(e,!0);return f._nodes.set(p,r,i,n,f,c,a,s,o,u,l,d)}_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 a=n._nodes.get(i);if(!a)return null;try{return n._pop(i,r)}finally{a.parentBag===n&&n._nodes._dict[a.label]!==a&&(a.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[a,s]=this._htraverse(e,n,r);if(a instanceof t&&s){let o=a._nodes.get(s);if(o)return o;if(n)return a._nodes.set(s,i,">",null,a,null,!1,!0,"autocreate"),a._nodes.get(s)}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,a=null,s=null,o=!1){for(let l of Object.values(this._updSubscribers))l({node:e,pathlist:r,oldvalue:i,attrs_diff:a,evt:n,reason:s,fired:o});this._parent&&this._parentNode&&this._parent._onNodeChanged(e,[this._parentNode.label,...r],n,i,a,s,o)}_onNodeInserted(e,r,n=null,i=null,a=!1){let s=e.parentBag,o=e.getValue(!0);s!==null&&s.backref&&o instanceof t&&o.setBackref(e,s),n===null&&(n=[]);for(let l of Object.values(this._insSubscribers))l({node:e,pathlist:n,ind:r,evt:"ins",reason:i,fired:a});this._parent&&this._parentNode&&this._parent._onNodeInserted(e,r,[this._parentNode.label,...n],i,a)}_onNodeDeleted(e,r,n=null,i=null){for(let a of Object.values(this._delSubscribers))a({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:a=null,any:s=null}=r;this.backref||this.setBackref(),this._subscribe(e,this._updSubscribers,n||s),this._subscribe(e,this._insSubscribers,i||s),this._subscribe(e,this._delSubscribers,a||s)}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:a=!1,any:s=!1}=r;(n||s)&&delete this._updSubscribers[e],(i||s)&&delete this._insSubscribers[e],(a||s)&&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 a=r===void 0,s=n&&typeof r=="string"?r.toLowerCase():r,o=l=>{let u=[];for(let c of l._nodes){if(e in c.attr){let d=n&&typeof c.attr[e]=="string"?c.attr[e].toLowerCase():c.attr[e];if(a||d==s)return c}if(c._value instanceof t)if(i){let d=o(c._value);if(d)return d}else u.push(c._value)}for(let c of u){let d=o(c);if(d)return d}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,a=!0,s=!0,o=null,l=!0){e||(e="#k,#v,#a");let u=this,c;if(typeof e=="string"){if(e.includes(":")){let[p,h]=e.split(":");u=this.getItem(p),e=h}c=e.split(",").map(p=>p.trim())}else c=e;let d=(p,h,m,g,_)=>{if(h==="#k")return p.label;if(h==="#p")return m;if(h==="#n")return p;if(typeof h=="function")return h(p);if(h==="#v"){let v=_();return g&&v instanceof t?null:v}else if(h.startsWith("#v.")){let v=h.split(".").slice(1).join("."),w=_();return w&&w.getItem?w.getItem(v):null}else{if(h==="#__v")return p.getValue(!0);if(h.startsWith("#a")){let v=h.includes(".")?h.split(".").slice(1).join("."):null;return p.getAttr(v)}else{let v=_();return v&&v.getItem?v.getItem(h):null}}};function*f(){let p=0;function*h(m,g){for(let _ of m._nodes){let v=g?`${g}.${_.label}`:_.label,w=!1,x,B=()=>(w||(x=_.getValue(l),w=!0),x);if((a&&s||(B()instanceof t?s:a))&&(r===null||r(_))&&(yield c.length===1?d(_,c[0],v,i,B):c.map(Z=>d(_,Z,v,i,B)),p++,o!==null&&p>=o))return;if(i){let Z=B();if(Z instanceof t&&(yield*h(Z,v),o!==null&&p>=o))return}}}yield*h(u,"")}return n?f():[...f()]}getLeaves(){let e=[],r=(n,i)=>{for(let a of n._nodes){let s=i?`${i}.${a.label}`:a.label,o=a.getValue(!1);o instanceof t?r(o,s):e.push([s,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(l=>l.trim()).map(()=>[]);let a=[...i];if(a.length&&Array.isArray(a[0])){let s=a[0].length,o=[];for(let l=0;l<s;l++)o.push(a.map(u=>u[l]));return o}return[a]}return[...i]}columns(e,r=!1){typeof e=="string"&&(e=e.split(","));let n=r?"#a.":"",i=e.map(a=>`${n}${a}`).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=a=>{let s=0,o=!1;for(let l of this.query(a,n)){if(l==null||l===""){o=!0;continue}if(typeof l!="number"&&typeof l!="boolean"){if(r)throw new TypeError(`sum encountered non-numeric value: ${typeof l}`);continue}s+=l}return r&&o?null:s};return e.includes(",")?e.split(",").map(a=>i(a.trim())):i(e)}sort(e="#k:a"){let r=(i,a)=>i==null?[-1,""]:a&&typeof i=="string"?[0,i.toLowerCase()]:[0,i],n=(i,a)=>i[0]!==a[0]?i[0]-a[0]:i[1]<a[1]?-1:i[1]>a[1]?1:0;if(typeof e=="function")this._nodes._list.sort((i,a)=>{let s=e(i),o=e(a);return s<o?-1:s>o?1:0});else{let i=e.split(",");i.reverse();for(let a of i){let s,o;a.includes(":")?[s,o]=a.split(":",2):(s=a,o="a"),s=s.trim(),o=o.trim();let l=o==="d"||o==="D",u=o==="a"||o==="d",c;if(s.toLowerCase()==="#k")c=d=>r(d.label,u);else if(s.toLowerCase()==="#v")c=d=>r(d.value,u);else if(s.toLowerCase().startsWith("#a.")){let d=s.slice(3);c=f=>r(f.getAttr(d),u)}else c=d=>{let f=d.value,p=f instanceof t?f.getItem(s):f?f[s]:null;return r(p,u)};this._nodes._list.sort((d,f)=>{let p=n(c(d),c(f));return l?-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 Rr({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 a={};for(let s of this._nodes){let o=s.value;if(i&&o==null)continue;let l=s.label;e&&(l=String(l)),r&&(l=l.toLowerCase()),n&&o instanceof t&&(o=t.prototype.asDict.call(o,e,r,n,i)),Object.defineProperty(a,l,{value:o,enumerable:!0,writable:!0,configurable:!0})}return a}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 a=new r.nodeClass(r,n.label,i);a.setAttr({...n.attr},!1,!1,!1),a.nodeTag=n.nodeTag,a.xmlTag=n.xmlTag,r._nodes._list.push(a),r._nodes._dict[a.label]=a}return r}update(e,r=null,n=null,i=!1){if(!(e instanceof t)){for(let a in e){let s=e[a];(!i||s!==null||!this._nodes.has(a))&&this.setItem(a,s,null,">",!1,!1,n,!1,n!==!1)}return}for(let a of[...e]){let s=a.label,o=r==="static"?a.resolver:null,l=o?null:a.getValue(),u=a.attr.__replace;delete a.attr.__replace;let c=this._nodes.get(s);if(c)if(c.setAttr(a.attr,n===null?!0:n,!0,!1),a.nodeTag!=null&&(c.nodeTag=a.nodeTag),a.xmlTag!=null&&(c.xmlTag=a.xmlTag),o)c.resolver=o,c.setValue(null,n===null?!0:n,null,null,!1,n);else{a.resolver&&(c.resolver=null);let d=c.getValue();l instanceof t&&d instanceof t&&!u?d.update(l,r,n,i):(!i||l!==null)&&c.setValue(l,n===null?!0:n,null,null,!1,n)}else{let d=this.setItem(s,o||l,a.attr,">",!1,!1,n,!1,n!==!1);d.nodeTag=a.nodeTag,d.xmlTag=a.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,a=null){if(typeof e!="string")throw new TypeError("Bag labels must be strings");let s=new this.nodeClass(this,e,null,n,i,a,null,!1);return r instanceof ne?s.resolver=r:s._value=r,this._nodes._dict[e]=s,this._nodes._list.push(s),s}fillFrom(e=null,r={}){let n=fa(r);if(e!=null&&!rr(e)&&!Array.isArray(e))throw new TypeError("Bag source must be a dictionary, array or null");let i=this.createChildBag(),a=new Set,s=(o,l,u)=>{if(a.has(l))throw new TypeError(`Cyclic Bag source at ${u}`);a.add(l);try{let c=Array.isArray(l)?String(l.length).length+1:0,d=Array.isArray(l)?Array.from(l,(f,p)=>[`r_${String(p).padStart(c,"0")}`,f]):Object.entries(l);if(!Array.isArray(l)&&Object.getOwnPropertySymbols(l).some(f=>Object.prototype.propertyIsEnumerable.call(l,f)))throw new TypeError(`Bag labels must be strings at ${u}`);for(let[f,p]of d){let h=p;n&&(rr(h)||Array.isArray(h))&&(h=this.createChildBag(),s(h,p,`${u}[${JSON.stringify(f)}]`)),o._appendLiteral(f,h)}}finally{a.delete(l)}};return e!=null&&s(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 a=(s,o)=>{for(let l=0;l<s._nodes.length;l++){let u=s._nodes._list[l],c={...o};"_pathlist"in o&&(c._pathlist=[...o._pathlist,u.label]),"_indexlist"in o&&(c._indexlist=[...o._indexlist,l]);let d=e(u,c,l);if(d)return d;if(d==null&&n){let f=u.getValue(r);if(f instanceof t){let p=a(f,c);if(p)return p}}}return null};return a(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 a=n.getValue(e);a instanceof t&&(yield*a._iterNodesWithPaths(e,i))}}*_nodeFlattener(e=null){let r=e!==null,n=r?Object.create(null):null,i=0,a=new Map([["[]",this.constructor]]);for(let[s,o]of qo(this)){let l=s.slice(0,-1),u=JSON.stringify(s),c=JSON.stringify(l),d=o.getValue(!0),f,p=null;if(o.resolver)f=$r(o.resolver);else if(d instanceof t){let g=d.constructor,_=g.tytxSuffix;a.set(u,g),p=da(g,tr(a.get(c),_)),f=`::${_}`}else d===null?f="::NN":f=dt(d);if(o.attr&&Object.hasOwn(o.attr,Oe))throw new Y(`node '${s}': the attribute '${Oe}' is reserved for the Bag class name`);let h=Gn(dt(o.attr));p!==null&&(h[Oe]=p);let m=o.nodeTag;r?(yield[l.length?n[c]:null,o.label,m,f,h],d instanceof t&&(n[u]=i,e[i]=s,i++)):yield[l,o.label,m,f,h]}}toTytx(e="json",r=!1){let n=this._toTytxPayload(r),i=this.constructor.tytxSuffix;if(e==="json")return`${n}::${i}`;if(e==="msgpack")return bn(new Ne(4,new TextEncoder().encode(`${i}:${n}`)));throw new TypeError(`Unsupported transport: ${e}`)}_toTytxPayload(e=!1){let r;if(e){let a={};r={rows:[...this._nodeFlattener(a)],paths:a}}else r={rows:[...this._nodeFlattener(null)]};let n=this.constructor,i=da(n,tr(null,n.tytxSuffix));return i!==null&&(r[Oe]=i),r.rows=r.rows.map(([a,s,o,l,u])=>[dt(a),dt(s),dt(o),l,u]),r.paths&&(r.paths=dt(r.paths)),ve(r)}static fromTytx(e,r="json",n={}){if(rr(r)&&(n=r,r="json"),fa(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=re(e,r==="json"?null:r);if(i instanceof t)return i;if(!rr(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(tr(null,r));let n=re(e);if(!n||!Array.isArray(n.rows))throw new Y("Invalid TYTX Bag: expected rows");let i=n.paths,a=i!=null,s=Object.hasOwn(n,Oe)?ca(r,n[Oe]):tr(null,r),o=new s,l=new Map([["[]",o]]);for(let u of n.rows){if(!Array.isArray(u)||u.length!==5)throw new Y("Invalid TYTX Bag row");let[c,d,f,p,h]=u,m=c??"";if(a){if(c!==null&&!Object.hasOwn(i,c))throw new Y(`Unknown TYTX parent reference: ${c}`);m=c===null?"":i[c]}if(typeof m=="string"&&(m=m?m.split("."):[]),!Array.isArray(m))throw new Y("Invalid TYTX parent path");let g=JSON.stringify(m);if(!l.has(g))throw new Y(`Missing or undecodable TYTX parent branch: ${m}`);let _=l.get(g),v=JSON.stringify([...m,d]),w=p,x=Wn(w),B=ua(h),L=Object.hasOwn(B,Oe)?B[Oe]:null;if(delete B[Oe],w instanceof t){let ie=w.constructor.tytxSuffix,ae=L!==null?ca(ie,L):tr(_.constructor,ie);w=new ae,l.set(v,w)}else if(L!==null)throw new Y(`node '${v}': the attribute '${Oe}' is reserved for the Bag class name of a branch`);let Z=_._appendLiteral(d,x?null:w,B,x);Z.nodeTag=f??null}return o}toXml(e={}){let{pretty:r=!1,encoding:n="UTF-8",docHeader:i=null,selfClosedTags:a=null}=e,s=this._bagToXml(a,r);return i===!0?s=`<?xml version='1.0' encoding='${n}'?>
16
16
  ${s}`:typeof i=="string"&&(s=`${i}
17
17
  ${s}`),s}_bagToXml(e=null,r=!1,n=0){let i=[];for(let a of this._nodes)i.push((r?" ".repeat(n):"")+this._nodeToXml(a,e,r,n));return i.join(r?`
18
18
  `:"")}_nodeToXml(e,r=null,n=!1,i=0){let a=e.xmlTag||e.nodeTag||e.label,s=this._sanitizeTag(a),o=[];if(s!==a&&o.push(`_tag="${this._escapeAttr(a)}"`),e.resolver&&o.push(`_resolver="${this._escapeAttr($r(e.resolver))}"`),e.attr)for(let[f,p]of Object.entries(Gn(e.attr)))p!==null&&p!==!1&&p!==void 0&&o.push(`${f}="${this._escapeAttr(String(p))}"`);let l=o.length?" "+o.join(" "):"",u=e.resolver?null:e.getValue(!0);if(u&&typeof u._bagToXml=="function"){n=n&&e.attr?.["xml:space"]!=="preserve";let f=u._bagToXml(r,n,i+1);return f?n?`<${s}${l}>
19
19
  ${f}
20
- ${" ".repeat(i)}</${s}>`:`<${s}${l}>${f}</${s}>`:r===null||r.includes(s)?`<${s}${l}/>`:`<${s}${l}></${s}>`}if(u==null||u==="")return r===null||r.includes(s)?`<${s}${l}/>`:`<${s}${l}></${s}>`;let c=u instanceof Date&&!Number.isNaN(u.getTime())?Wf(u):String(u),d=this._escapeXml(c);return`<${s}${l}>${d}</${s}>`}_sanitizeTag(e){return e?e.replace(/[^a-zA-Z0-9_\-.:]/g,"_"):"_none_"}_escapeXml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}_escapeAttr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}static fromXml(e,r={}){let{tagAttribute:n=null}=r,i;if(typeof DOMParser<"u"){i=new DOMParser().parseFromString(e,"application/xml");let s=i.querySelector("parsererror");if(s)throw new Error(`XML parse error: ${s.textContent}`)}else i=new Uo.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(a=>a.nodeType===1);for(let a of i){let s=a.tagName,o={};for(let m=0;m<a.attributes.length;m++){let g=a.attributes[m];o[g.name]=g.value}let l=Wn(o._resolver);l&&delete o._resolver;let u=String(o._T||"").toUpperCase()==="BAG";Object.assign(o,la(o));let c=s;"_tag"in o&&(c=o._tag,delete o._tag),r&&r in o&&(c=o[r],delete o[r]);let d=c,f=1;for(;n.getNode(c);)c=`${d}_${f++}`;let p=Array.from(a.childNodes).filter(m=>m.nodeType===1),h;if(p.length>0||u){let m=this._xmlElementToBag(a,r);h=n.setItem(c,m,Object.keys(o).length>0?o:null)}else{let m=a.textContent||"";h=n.setItem(c,m,Object.keys(o).length>0?o:null)}l&&(h.resolver=l),h.xmlTag=s}return n}static async fromUrl(e,r={}){let{timeout:n=30}=r,i={};n&&(i.signal=AbortSignal.timeout(n*1e3));let a=await fetch(e,i),s=a.headers.get("content-type")||"",o=await a.text();if(s.includes("json"))return t.fromTytx(o);if(s.includes("xml"))return t.fromXml(o);let l=o.trim();if(l.startsWith("<"))return t.fromXml(o);if(l.startsWith("{")||l.startsWith("["))return t.fromTytx(o);throw new Ur(`Unsupported content-type: ${s}`)}toJson(e=!0){let r=[];for(let n of this._nodes)r.push(this._nodeToJsonDict(n,e));return e?ve(r):JSON.stringify(r)}_nodeToJsonDict(e,r){let n=e.resolver?null:e.getValue(!0);if(n&&typeof n._nodeToJsonDict=="function"){let a=[];for(let s of n._nodes)a.push(n._nodeToJsonDict(s,r));n=a}let i={label:e.label,value:n,attr:Gn(e.attr)};return e.nodeTag!==null&&(i.tag=e.nodeTag),e.resolver&&(i.resolver=$r(e.resolver)),i}static fromJson(e,r={}){return $o||(console.warn("Bag.fromJson is deprecated; use Bag.fromTytx"),$o=!0),this.fromTytx(e,"json",r)}toStringTree(e=!0,r=null,n="",i=!0){r===null&&(r=new Map);let a=[],s=[...this._nodes];for(let o=0;o<s.length;o++){let l=s[o],u=o===s.length-1,c=l.getValue(e),d=l.getAttr(),f="",p=Object.keys(d);p.length>0&&(f=" ["+p.map(_=>`${_}=${JSON.stringify(d[_])}`).join(", ")+"]");let h=u?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",m=n+(u?" ":"\u2502 ");if(c instanceof t){let g=l,_=c.backref?"(*)":"";if(r.has(g))a.push(`${n}${h}${l.label}${_}${f} \u2192 (circular ref)`);else{r.set(g,l.label),a.push(`${n}${h}${l.label}${_}${f}`);let v=c.toStringTree(e,r,m,u);v&&a.push(v)}}else{let g;if(c===null)g="null";else if(c===void 0)g="undefined";else if(c instanceof ArrayBuffer||c instanceof Uint8Array){let _=new TextDecoder("utf-8",{fatal:!1}),v=c instanceof ArrayBuffer?new Uint8Array(c):c;g=_.decode(v)}else typeof c=="string"?c.length>50?g=JSON.stringify(c.slice(0,47)+"..."):g=JSON.stringify(c):g=String(c);a.push(`${n}${h}${l.label}: ${g}${f}`)}}return a.join(`
20
+ ${" ".repeat(i)}</${s}>`:`<${s}${l}>${f}</${s}>`:r===null||r.includes(s)?`<${s}${l}/>`:`<${s}${l}></${s}>`}if(u==null||u==="")return r===null||r.includes(s)?`<${s}${l}/>`:`<${s}${l}></${s}>`;let c=u instanceof Date&&!Number.isNaN(u.getTime())?Yf(u):String(u),d=this._escapeXml(c);return`<${s}${l}>${d}</${s}>`}_sanitizeTag(e){return e?e.replace(/[^a-zA-Z0-9_\-.:]/g,"_"):"_none_"}_escapeXml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}_escapeAttr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}static fromXml(e,r={}){let{tagAttribute:n=null}=r,i;if(typeof DOMParser<"u"){i=new DOMParser().parseFromString(e,"application/xml");let s=i.querySelector("parsererror");if(s)throw new Error(`XML parse error: ${s.textContent}`)}else i=new Fo.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(a=>a.nodeType===1);for(let a of i){let s=a.tagName,o={};for(let m=0;m<a.attributes.length;m++){let g=a.attributes[m];o[g.name]=g.value}let l=Wn(o._resolver);l&&delete o._resolver;let u=String(o._T||"").toUpperCase()==="BAG";Object.assign(o,ua(o));let c=s;"_tag"in o&&(c=o._tag,delete o._tag),r&&r in o&&(c=o[r],delete o[r]);let d=c,f=1;for(;n.getNode(c);)c=`${d}_${f++}`;let p=Array.from(a.childNodes).filter(m=>m.nodeType===1),h;if(p.length>0||u){let m=this._xmlElementToBag(a,r);h=n.setItem(c,m,Object.keys(o).length>0?o:null)}else{let m=a.textContent||"";h=n.setItem(c,m,Object.keys(o).length>0?o:null)}l&&(h.resolver=l),h.xmlTag=s}return n}static async fromUrl(e,r={}){let{timeout:n=30}=r,i={};n&&(i.signal=AbortSignal.timeout(n*1e3));let a=await fetch(e,i),s=a.headers.get("content-type")||"",o=await a.text();if(s.includes("json"))return t.fromTytx(o);if(s.includes("xml"))return t.fromXml(o);let l=o.trim();if(l.startsWith("<"))return t.fromXml(o);if(l.startsWith("{")||l.startsWith("["))return t.fromTytx(o);throw new Ur(`Unsupported content-type: ${s}`)}toJson(e=!0){let r=[];for(let n of this._nodes)r.push(this._nodeToJsonDict(n,e));return e?ve(r):JSON.stringify(r)}_nodeToJsonDict(e,r){let n=e.resolver?null:e.getValue(!0);if(n&&typeof n._nodeToJsonDict=="function"){let a=[];for(let s of n._nodes)a.push(n._nodeToJsonDict(s,r));n=a}let i={label:e.label,value:n,attr:Gn(e.attr)};return e.nodeTag!==null&&(i.tag=e.nodeTag),e.resolver&&(i.resolver=$r(e.resolver)),i}static fromJson(e,r={}){return Uo||(console.warn("Bag.fromJson is deprecated; use Bag.fromTytx"),Uo=!0),this.fromTytx(e,"json",r)}toStringTree(e=!0,r=null,n="",i=!0){r===null&&(r=new Map);let a=[],s=[...this._nodes];for(let o=0;o<s.length;o++){let l=s[o],u=o===s.length-1,c=l.getValue(e),d=l.getAttr(),f="",p=Object.keys(d);p.length>0&&(f=" ["+p.map(_=>`${_}=${JSON.stringify(d[_])}`).join(", ")+"]");let h=u?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",m=n+(u?" ":"\u2502 ");if(c instanceof t){let g=l,_=c.backref?"(*)":"";if(r.has(g))a.push(`${n}${h}${l.label}${_}${f} \u2192 (circular ref)`);else{r.set(g,l.label),a.push(`${n}${h}${l.label}${_}${f}`);let v=c.toStringTree(e,r,m,u);v&&a.push(v)}}else{let g;if(c===null)g="null";else if(c===void 0)g="undefined";else if(c instanceof ArrayBuffer||c instanceof Uint8Array){let _=new TextDecoder("utf-8",{fatal:!1}),v=c instanceof ArrayBuffer?new Uint8Array(c):c;g=_.decode(v)}else typeof c=="string"?c.length>50?g=JSON.stringify(c.slice(0,47)+"..."):g=JSON.stringify(c):g=String(c);a.push(`${n}${h}${l.label}: ${g}${f}`)}}return a.join(`
21
21
  `)}toString(e=!0,r=null,n=""){r||(r=new Set);let i=[],a=[...this._nodes];for(let s=0;s<a.length;s++){let o=a[s],l=s===a.length-1,u=o.getValue(e),c="",d=o.attr;d&&Object.keys(d).length>0&&(c=` [${Object.entries(d).map(([m,g])=>`${m}=${JSON.stringify(g)}`).join(", ")}]`);let f=l?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",p=n+(l?" ":"\u2502 ");if(u&&typeof u._htraverse=="function"){let h=o;if(r.has(h))i.push(`${n}${f}${o.label}${c} \u2192 (circular ref)`);else{r.add(h),i.push(`${n}${f}${o.label}${c}`);let m=u.toString(e,r,p);m&&i.push(m)}}else{let h;u==null?h="null":typeof u=="string"&&u.length>50?h=JSON.stringify(u.slice(0,47)+"..."):typeof u=="string"?h=JSON.stringify(u):h=String(u),i.push(`${n}${f}${o.label}: ${h}${c}`)}}return i.join(`
22
- `)}},Ur=class extends Error{constructor(e){super(e),this.name="BagException"}};ne.registerBagClass(se);sa(se,"X",t=>t._toTytxPayload(),t=>se._fromTytxPayload(t));Mr(se.tytxSuffix,{...Ge(se.tytxSuffix),Bag:se});var qo=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 jo(t){return t.endsWith("_")&&qo.has(t.slice(0,-1))?t.slice(0,-1):t}function Vo(t){let e=jo(t);return e!==t?e:t.startsWith("_")&&qo.has(t.slice(1))?t.slice(1):t}function fa(t,{renderTag:e=null,ns:r=null,dialectName:n=null}={}){let i=e||t;if(!i)return i;if(i=jo(i),r&&!e){let a=`${n}_`;i.startsWith(a)&&(i=i.slice(a.length)),i=`${r}:${i}`}return i}var ir=Symbol("value"),Ho=new Set(["_meta","datapath","nodeId","ns","form","formId","_anchor","updateOn"]);function pa(t){return Object.entries(t||{}).filter(([e])=>!Ho.has(e)).map(([e,r])=>[Vo(e),r])}var nr=class extends Ye{constructor(e,r,n=null,i=null,a=null,s=null,o=null){super(e,r,n,i,a,s,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 pa(this.getAttr())}runtimeToEvaluate(){let e=new Map(this.fixedAttrItems());return e.set(ir,this.value),e}absDatapath(e){let r=e;this.pointerType(e)&&(e=(Ke(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("."),a=i===-1?n:n.slice(0,i),s=i===-1?"":n.slice(i+1),o;if(a==="FORM")o=this._findMarkedDatapathAncestor(!0,!1,r);else if(a==="ANCHOR")o=this._findMarkedDatapathAncestor(!1,!0,r);else{let l=this.rootBuilder;if(!l)throw new Error(`#<id>: cannot resolve ${r} on a node without builder`);if(o=l.source.getNodeByAttr("nodeId",a),o==null)throw new Error(`#<id>: cannot resolve ${r}`)}return o.absDatapath(s?`.${s}`:".")}_findMarkedDatapathAncestor(e,r,n){let i=this;for(;i!=null;){let s=i.getAttr()||{};if(e&&(s.formId!=null||s.form===!0)||r&&"_anchor"in s)return i;i=i.parentNode}let a=e?"FORM":"ANCHOR";throw new Error(`#${a}: no marked ancestor found for ${n}`)}getRelativeData(e,r=null,{autocreate:n=!1}={}){let i=this.data,a=this.absDatapath(e);return n&&i.getItem(a)==null&&i.setItem(a,r),i.getItem(a,r)}setRelativeData(e,r,{attributes:n=null,fired:i=!1,reason:a=null}={}){let s=this.data,o=this.absDatapath(e);s.setItem(o,r,n,">",!1,!0,a===null?!0:a,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})}},W=class t extends se{constructor(e=null,r=null){super(e),this._builder=r,this._insertingBuilder=null}get nodeClass(){return nr}_setBuilderItem(e,r,n,...i){let a=r?.map(([o])=>[o,o._builder])||null;if(r)for(let[o,l]of r)o._builder=l;let s=this._insertingBuilder;this._insertingBuilder=e;try{return this.setItem(n,...i)}catch(o){if(this.node(n)==null&&a)for(let[l,u]of a)l._builder=u;throw o}finally{this._insertingBuilder=s}}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=(a,s)=>{if(n.has(a))throw new Error("source contains a cyclic or shared SourceBag branch");n.add(a),r.push([a,s]);for(let o of a.getNodes()){let l=s,u=o._getMeta("subbuilder");u!=null&&(l=s._resolveSubbuilderReference(u,o.getAttr()||{},o.nodeTag)),r.push([o,l]);let c=o.getValue(!0);c instanceof t&&i(c,l)}};return i(this,e),r}};if((Ge(W.tytxSuffix).SourceBag??W)!==W)throw new Error("TYTX subtype name 'SourceBag' is already registered for another class");Mr(W.tytxSuffix,{...Ge(W.tytxSuffix),SourceBag:W});function Zf(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 Jf=new Set(["then","toJSON"]),Wo=new WeakMap;function Fr(t){return Wo.get(t)||t}function ha(t){if(t==null)return t;t=Fr(t);let e=t._builder||t.parentBag&&t.parentBag._builder;return e?e.wrapSource(t):t}function Go(t,e){let r=e instanceof se,n=new Proxy(e,{get(i,a){if(typeof a=="symbol"||a.startsWith("_")||Jf.has(a))return Reflect.get(i,a,i);let s=t.schemaTag(a);if(r&&s)return zo(t,i,s,r);if(a in i){let l=Reflect.get(i,a,i);return typeof l=="function"?l.bind(i):l}if(s)return zo(t,i,s,r);let o=t.containerMethod(a);if(o)return(...l)=>t[o](t.wrapSource(i),...l)}});return Wo.set(n,e),n}function zo(t,e,r,n){return(...i)=>{let{value:a,attrs:s}=Zf(i),o=n?t.bagCall(e,r,a,s):t.commandOnNode(e,r,a,s);return o.builder.wrapSource(o)}}var Xo=/^[A-Za-z_][A-Za-z0-9_]*$/,Kf=new Set(["positional_only","positional_or_keyword","keyword_only","var_positional","var_keyword"]),Qf=new Set(["framework","value","attribute"]),ep=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 Et(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function k(t,e){throw new TypeError(`${t}: ${e}`)}function Ue(t,e,r,n){Et(t)||k(n,"must be an object");for(let i of Object.keys(t))e.includes(i)||k(n,`unknown field '${i}'`);for(let i of r)Object.hasOwn(t,i)||k(n,`missing field '${i}'`)}function xt(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)=>xt(r,`${e}[${n}]`));if(Et(t))return Object.entries(t).forEach(([r,n])=>xt(n,`${e}.${r}`));k(e,"must be lossless JSON data")}}function tp(t,e){let r="",n=!1;for(let i=0;i<t.length;i++){let a=t[i];if(a==="\\"){r+=a+(t[++i]??"");continue}a==="["&&(n=!0),!n&&a==="."&&!(e&16)?r+="[^\\n]":!n&&a==="^"&&e&8?r+="(?:^|(?<=\\n))":!n&&a==="$"?r+=e&8?"(?=\\n|(?![\\s\\S]))":"(?=\\n?(?![\\s\\S]))":r+=a,a==="]"&&(n=!1)}return r}function kt(t,e,r=!1,n=null){if(t===null)return null;switch(Ue(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 Ue(t,["kind","name"],["kind","name"],e),n||k(e,"custom references require a catalog; nested catalog references are unsupported"),n.resolve(t.name,e);case"dtype":{Ue(t,["kind","dtype"],["kind","dtype"],e);let i=t.dtype;typeof i!="string"&&k(e,"dtype must be a string");let a=Ir(i);return!a&&i!=="NN"&&k(e,`unknown dtype '${i}'`),{...t,test:o=>i==="NN"?o===null:i==="N"?Te(o)&&!["NaN","Infinity","-Infinity"].includes(o.toString()):a===Number?typeof o=="number"&&Number.isFinite(o)&&(i!=="L"||Number.isInteger(o)):a===String?typeof o=="string":a===Boolean?typeof o=="boolean":a===Date?o instanceof Date&&Number.isFinite(o.getTime()):a===Object?Et(o)&&[Object.prototype,null].includes(Object.getPrototypeOf(o)):o instanceof a}}case"any":return{...t,test:i=>!0};case"type":{(typeof t.module!="string"||typeof t.name!="string")&&k(e,"type requires string module/name");let i=`${t.module}.${t.name}`;if(i==="collections.abc.Callable")return{...t,test:s=>typeof s=="function",portable:!1};let a=ep.get(i);return a||k(e,`unsupported type '${i}'`),{...t,test:a}}case"union":{(!Array.isArray(t.items)||!t.items.length)&&k(e,"union items must be non-empty");let i=t.items.map((a,s)=>kt(a,`${e}.items[${s}]`,!0,n));return{...t,items:i,inputConstraint:i.some(a=>a.inputConstraint),test:a=>i.some(s=>s.test&&s.test(a))}}case"literal":return Array.isArray(t.values)||k(e,"literal values must be an array"),t.values.forEach((i,a)=>xt(i,`${e}.values[${a}]`)),{...t,test:i=>t.values.some(a=>Object.is(a,i))};case"annotated":{Array.isArray(t.metadata)||k(e,"annotated metadata must be an array"),t.metadata.some(s=>!["regex","range","value"].includes(s?.kind))&&k(e,"unsupported annotation metadata kind");let i=kt(t.base,`${e}.base`,!0,n),a=t.metadata.map((s,o)=>kt(s,`${e}.metadata[${o}]`,!0,n));return{...t,base:i,metadata:a,inputConstraint:i.inputConstraint,test:s=>i.test(s)&&a.every(o=>!o.test||o.test(s))}}case"range":{for(let i of["ge","le","gt","lt"])Object.hasOwn(t,i)||k(e,`range missing '${i}'`);for(let i of["ge","le","gt","lt"])t[i]!==null&&(typeof t[i]!="number"||!Number.isFinite(t[i]))&&k(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)&&k(e,"regex requires pattern and non-negative integer flags");let i=t.flags&-59;i&&k(e,`unsupported Python regex flags ${i}`),t.flags&2&&k(e,"IGNORECASE is not portable across Python and JavaScript Unicode rules"),/\\[AZzUwWdDsSabBN0-9]|\(\?P[<=!]|\(\?\(|\(\?>|\(\?#|\(\?[aiLmsux-]|[+*?}]\+|\{,/.test(t.pattern.replaceAll(String.raw`[\s\S]`,"."))&&k(e,"regex uses a non-portable construct or character class");let a="uy";t.flags&16&&(a+="s");let s;try{s=new RegExp(`(?:${tp(t.pattern,t.flags)})(?![\\s\\S])`,a)}catch(o){k(e,`invalid portable regex: ${o.message}`)}return{...t,test:o=>typeof o!="string"?!1:(s.lastIndex=0,s.test(o))}}case"value":return xt(t.value,`${e}.value`),{...t};case"generic":{let i=kt(t.origin,`${e}.origin`,!0,n);(t.origin?.kind!=="type"||t.origin.module!=="builtins"||!["list","dict","tuple","set"].includes(t.origin.name))&&k(e,"only list, dict, tuple and set generic origins are supported"),Array.isArray(t.arguments)||k(e,"generic arguments must be an array");let a=t.arguments.map((s,o)=>kt(s,`${e}.arguments[${o}]`,!0,n));return{...t,origin:i,arguments:a,inputConstraint:a.some(s=>s.inputConstraint),test:s=>i.test(s)&&rp(t.origin,a,s)}}case"arguments":k(e,"Callable argument-list descriptors are not supported by Python validation");case"ellipsis":return r||k(e,"ellipsis is only valid as a nested descriptor"),{...t};default:k(e,`unknown annotation kind '${t.kind}'`)}}function rp(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,a)=>e[a].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,a])=>(!e[0]?.test||e[0].test(i))&&(!e[1]?.test||e[1].test(a))):!1}function Zo(t,e){if(t===null)return null;if(typeof t!="string"&&k(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)&&k(e,`invalid cardinality item '${n}'`);let a=i.match(/^([A-Za-z_][A-Za-z0-9_]*|\*)(?:\[(?:(\d+)|(?:(\d*):(\d*)))\])?$/);a||k(e,`invalid cardinality item '${n}'`);let[,s,o,l,u]=a;r.has(s)&&k(e,`duplicate tag '${s}'`);let c=0,d=1/0;i.includes("[")&&(i.includes(":")?(c=l?Number(l):0,d=u?Number(u):1/0):c=d=Number(o)),d<c&&k(e,`maximum ${d} is below minimum ${c}`),r.set(s,{min:c,max:d})}return r.has("*")&&r.size>1&&k(e,"wildcard '*' cannot be combined with named tags"),r}function Jo(t,e){if(t===null)return null;typeof t!="string"&&k(e,"must be string or null");let r=new Set;for(let n of t.split(",")){let i=n.trim();i&&((!Xo.test(i)||r.has(i))&&k(e,`invalid or duplicate parent '${n}'`),r.add(i))}return r}function np(t,e,r){if(t===null)return null;Ue(t,["parameters","accepts_var_keyword","accepts_var_positional"],[],e);let n=t.parameters??[];Array.isArray(n)||k(e,"parameters must be an array"),t={parameters:n,accepts_var_keyword:n.some(l=>l.kind==="var_keyword"),accepts_var_positional:n.some(l=>l.kind==="var_positional"),...t},(!Array.isArray(t.parameters)||typeof t.accepts_var_keyword!="boolean"||typeof t.accepts_var_positional!="boolean")&&k(e,"invalid signature descriptor");let i=new Set,a=!1,s=!1,o=t.parameters.map((l,u)=>{let c=`${e}.parameters[${u}]`;return Ue(l,["name","kind","role","annotation","has_default","default"],["name","kind","role","annotation","has_default"],c),(typeof l.name!="string"||!Xo.test(l.name)||i.has(l.name))&&k(c,"invalid or duplicate parameter name"),i.add(l.name),(!Kf.has(l.kind)||!Qf.has(l.role)||typeof l.has_default!="boolean")&&k(c,"invalid kind, role, or has_default"),l.has_default!==Object.hasOwn(l,"default")&&k(c,"default presence must equal has_default"),l.has_default&&xt(l.default,`${c}.default`),a||=l.kind==="var_keyword",s||=l.kind==="var_positional",{...l,annotation:kt(l.annotation,`${c}.annotation`,!1,r)}});return(a!==t.accepts_var_keyword||s!==t.accepts_var_positional)&&k(e,"variadic summary flags do not match parameters"),{...t,parameters:o}}function Yo(t,e,r,n){let i=["doc","sub_tags","parent_tags","inherits_from","ns","attributes",...r?["node_label","collection_key"]:[],"_meta"];Ue(t,i,[],e),t={...Object.fromEntries(i.map(a=>[a,null])),...t};for(let a of["doc","inherits_from","ns",...r?["node_label","collection_key"]:[]])t[a]!==null&&typeof t[a]!="string"&&k(e,`${a} must be string or null`);return t._meta!==null&&(Et(t._meta)||k(e,"_meta must be object or null"),xt(t._meta,`${e}._meta`)),Zo(t.sub_tags,`${e}.sub_tags`),Jo(t.parent_tags,`${e}.parent_tags`),{...t,attributes:np(t.attributes,`${e}.attributes`,n)}}function Ko(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}function Qo(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 el(t){let e={...t};return e._subSpec=Object.hasOwn(e,"sub_tags")?Zo(e.sub_tags,"resolved.sub_tags"):null,e._parentSpec=Object.hasOwn(e,"parent_tags")?Jo(e.parent_tags,"resolved.parent_tags"):null,e}function tl(t,e,r,n){if(r.get(t)===1&&k(n,`inheritance cycle at '${t}'`),r.get(t)===2)return e[t];let i=e[t];i||k(n,`unknown abstract '${t}'`),r.set(t,1);let a={...i};for(let s of Ko(i.inherits_from))a=Qo(tl(s,e,r,n),a);return a=el(a),r.set(t,2),e[t]=a,a}function ma({abstracts:t={},elements:e={}}){let r={...t},n=new Map;for(let a of Object.keys(r))tl(a,r,n,`abstracts.${a}.inherits_from`);let i={};for(let[a,s]of Object.entries(e)){let o={...s};for(let l of Ko(s.inherits_from)){let u=r[l];u||k(`elements.${a}.inherits_from`,`unknown abstract '${l}'`),o=Qo(u,o)}i[a]=el(o)}return{abstracts:r,elements:i}}function ga(t){Ue(t,["document_format","grammar","abstracts","elements","custom_types"],["document_format","grammar","abstracts","elements"],"grammar document"),Ue(t.document_format,["name","version"],["name","version"],"document_format"),(t.document_format.name!=="builder_grammar"||!["1.1","1.2"].includes(t.document_format.version))&&k("document_format","expected builder_grammar version 1.1 or 1.2"),Ue(t.grammar,["name","version","title","description"],["name","version","title","description"],"grammar"),(typeof t.grammar.name!="string"||!t.grammar.name)&&k("grammar.name","must be non-empty string");for(let i of["version","title","description"])t.grammar[i]!==null&&typeof t.grammar[i]!="string"&&k(`grammar.${i}`,"must be string or null");(!Et(t.abstracts)||!Et(t.elements))&&k("grammar document","abstracts/elements must be objects"),Object.hasOwn(t,"custom_types")&&t.document_format.version!=="1.2"&&k("custom_types","requires version 1.2");let e=Yn.fromJSON(t.custom_types??{}),r={};for(let[i,a]of Object.entries(t.abstracts))(!i||i.startsWith("_"))&&k("abstracts",`invalid public name '${i}'`),r[i]=Yo(a,`abstracts.${i}`,!1,e);let n={};for(let[i,a]of Object.entries(t.elements))(!i||i.startsWith("_"))&&k("elements",`invalid public name '${i}'`),n[i]=Yo(a,`elements.${i}`,!0,e);return{grammar:structuredClone(t.grammar),abstracts:r,elements:n}}function rl(t,e,r,n){let i=e.attributes;if(!i)return;let a={...n};r!=null&&(a.node_value=r);let s=new Set(i.parameters.filter(u=>u.role==="attribute").map(u=>u.name)),o=new Set(["node_label","node_position","nodeId","target_id","datapath","iterate","store","_tag","_meta","ns"]);if(!i.accepts_var_keyword)for(let u of Object.keys(n))!s.has(u)&&!o.has(u)&&k(t,`unknown attribute '${u}'`);let l=e._meta?.component?i.parameters.find(u=>u.role!=="framework"&&["positional_only","positional_or_keyword"].includes(u.kind))?.name:null;for(let u of i.parameters){if(u.name===l||u.role==="framework"||u.kind.startsWith("var_"))continue;let c=Object.hasOwn(a,u.name);!c&&!u.has_default&&k(t,`missing required ${u.role} '${u.name}'`),c&&u.annotation!==null&&(!u.annotation.test||!u.annotation.test(a[u.name]))&&k(t,`invalid value for ${u.role} '${u.name}'`)}}var Yn=class t{#e=new Map;#t=new Map;register(e,r,n){let i=new Map([[String,"str"],[Number,"float"],["string","str"],["integer","int"],["number","float"]]),a=i.has(r)?{kind:"type",module:"builtins",name:i.get(r)}:r;return this.#n(e,{kind:"annotated",base:a,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)||ip.has(e))&&k("custom_types",`invalid, reserved or duplicate name '${e}'`),Ue(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))&&k(`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))&&k(`custom_types.${e}`,"portable Regex requires str; portable Range requires int or float"),xt(r,`custom_types.${e}`);let i=structuredClone(r),a=kt(i,`custom_types.${e}`),s=Object.freeze({kind:"custom",name:e});return Object.defineProperty(this,e,{value:s,enumerable:!0}),this.#e.set(e,i),this.#t.set(e,{...s,inputConstraint:!0,test:a.test}),s}resolve(e,r="custom_types"){return this.#t.has(e)||k(r,`unknown custom type '${e}'`),{...this.#t.get(e)}}validate(e,r){return this.resolve(e).test(r)||k(`custom_types.${e}`,"invalid input value"),!0}toJSON(){return structuredClone(Object.fromEntries(this.#e))}static fromJSON(e){Et(e)||k("custom_types","must be an object");let r=new t;for(let[n,i]of Object.entries(e))r.#n(n,i);return r}},ip=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 nl(t,e,r,n){let i=e?.attributes;if(i)for(let a of i.parameters){if(!a.annotation?.inputConstraint||a.role==="framework"||["var_keyword","var_positional"].includes(a.kind))continue;let s=a.role==="value"?r:n[a.name];s!==void 0&&(a.annotation.test(s)||k(t,`invalid input for '${a.name}' (custom type)`))}}function il(t,e,r=[]){if(e===null)return structuredClone(t);if(r.length===2&&r[0]==="custom_types"&&t!==void 0){if(!ba(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(Xe(t)&&Xe(e)){let n=structuredClone(t);for(let[i,a]of Object.entries(e))a!==null&&Object.defineProperty(n,i,{value:il(n[i],a,[...r,i]),enumerable:!0,writable:!0,configurable:!0});return n}return structuredClone(e)}function ba(t,e){return Object.is(t,e)?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,n)=>ba(r,e[n])):Xe(t)&&Xe(e)?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).every(r=>Object.hasOwn(e,r)&&ba(t[r],e[r])):!1}function Xe(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype}function _a(t){if(!(t===null||typeof t=="string"||typeof t=="boolean")&&!(typeof t=="number"&&Number.isFinite(t))){if(Array.isArray(t)){t.forEach(_a);return}if(Xe(t)){Object.values(t).forEach(_a);return}throw new TypeError("collection must contain only finite JSON values")}}var Ze=class t{#e;constructor(e){_a(e);let r=["document_format","grammar","abstracts","elements"];if(!Xe(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(!Xe(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(!Xe(e[i]))throw new TypeError(`${i} must be an object`);if(Object.hasOwn(e,"custom_types")&&(n.version!=="1.2"||!Xe(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=il(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 Dt=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,a]=n.runtimeValues(e);if(e._getMeta("data_element"))return null;if(e._getMeta("component"))return this._renderComponent(e,a,r);let s=this.getRender(n),o;return[o,a]=s._handleMeta(e,a),e._getMeta("subbuilder")||(a=s.adaptAttrs(a)),e.value instanceof W&&(i=this.renderChildren(e.value,r)),s.renderedItem(e,i,a,{tag:o,...r})}renderChildren(e,r={}){let n=[];for(let i of e.getNodes()){let a=this.render(i,r);a!==null&&(Array.isArray(a)?n.push(...a):n.push(a))}return n}_renderComponent(e,r,n){let[i,a,s,o]=this._expansionInputs(e,r);if(!Object.hasOwn(e.getAttr(),"iterate"))return this._expandBlock(e,i,s,o,n);if(a==null)return[];if(!(a instanceof se))throw new TypeError(`component '${e.nodeTag}': iterate must resolve to a Bag, got ${a?.constructor?.name||typeof a}`);return a.getNodes().map(l=>this._expandBlock(e,i,s,{node_label:l.label},n))}_expansionInputs(e,r){let n=e.builder,i=n.componentMethod(e.nodeTag),a=i&&n[i];if(typeof a!="function")throw new Error(`component '${e.nodeTag}' has no implementation`);let s=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 l of Object.keys(r)){let u=e.getAttr(l);e.pointerType(u)==="^"&&(r[l]=`^${e.absDatapath(u)}`)}return[a,s,o,r]}_expandBlock(e,r,n,i,a){let s=e.builder._expansionRoot(n);r.call(e.builder,ha(s),i);let o=s.getNodes();if(o.length!==1)throw new Error(`component '${e.nodeTag}' must build a tree, not a forest: ${o.length} root nodes`);let l={...a,depthOffset:this._nodeDepth(e,a.depthOffset||0)};return this.render(o[0],l)}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"),a=fa(e.nodeTag,{renderTag:n,ns:e.getAttr("ns"),dialectName:e.builder?.constructor._name});if(!a)throw new Error(`node ${e.label} has no tag to render (no render_tag, no node_tag)`);return i&&(r={...r,...i}),[a,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("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}_escapeAttr(e){return this._escapeText(e).replaceAll('"',"&quot;")}_nodeDepth(e,r=0){let i=((e.fullpath||"").match(/\./g)||[]).length;return Math.max(i-1,0)+r}};var At=class extends Dt{static mode="xml";renderedItem(e,r,n,{tag:i,pretty:a=!1,depthOffset:s=0}={}){let o=this._formatAttrs(n),l=a?" ".repeat(this._nodeDepth(e,s)):"",u=a?`
23
- `:"";if(Array.isArray(r)){let c=this._composeStringFragments(r);return`${l}<${i}${o}>${u}${c}${l}</${i}>${u}`}return r==null?`${l}<${i}${o}></${i}>${u}`:`${l}<${i}${o}>${this._escapeText(r)}</${i}>${u}`}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 al={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 sl(t){let e=[];for(;t&&t!==Function.prototype;)e.push(t),t=Object.getPrototypeOf(t);return e.reverse()}function sp(t){let e=Object.create(null),r=(n,i)=>{let a=n.toLowerCase(),s=e[a];if(s!==void 0&&s!==i)throw new Error(`container '${n}' is already tied to implementation method '${s}' (cannot rebind to '${i}')`);e[a]=i};for(let n of sl(t))if(Object.hasOwn(n,"containers"))for(let i of n.containers||[])r(i,i);return e}function qr(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 jr="_root_",wa="_root_",ol=new Set(["destination","func","value","_on_start"]),Fe=class t{static _sourceClass=W;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 se,this._dataroot.setBackref(),this._dataroot.setItem(wa,new se),this.data=this._dataroot.getItem(wa),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(jr,new r(null,this)),this.source=this._sourceroot.getItem(jr)}wrapSource(e){if(e=Fr(e),!(e instanceof W)&&!(e instanceof nr))throw new TypeError("wrapSource requires a SourceBag or SourceBagNode");let r=this._sourceHandles.get(e);return r||(r=Go(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 Ze(r.toDocument()).update(e):new Ze(e),i=ga(n.toDocument()),a=ma(i),s=qr(a.elements);this._classCollection=n,this._classSchema=a.elements,this._abstracts=a.abstracts,this._tagNames=s}static{this.defineGrammar(al)}get _containers(){return sp(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??=qr(this.schema):this.constructor._tagNames??=qr(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 Ze(e):new Ze(n.toDocument()).update(e),a=ga(i.toDocument()),s=ma(a),o=qr(s.elements);return this._collection=i,this._schemaOverride=s.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;nl(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 rl(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 a=r!==void 0?r:e.value instanceof W?null:e.value;this.validateNodeValues(e.nodeTag,a,n||e.getAttr?.()||{});let s=this.schema[this.schemaTag(e.nodeTag)],o=i||(e.value instanceof W?e.value.getNodes().map(l=>l.nodeTag):null);return o&&this._validateChildren(e.nodeTag,s,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(a=>typeof a!="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 a=i._parentSpec;if(a==null||a.has("*"))return!0;if(r===null)throw new Error(`'${n}' requires a declared parent`);let s=this.schemaTag(r);if(!s)throw new Error(`unknown parent element '${r}'`);return this._validateParent(n,i,s),!0}bagCall(e,r,n,i){return this.setChild(e,r,n,i)}commandOnNode(e,r,n,i){if(e=Fr(e),e.value instanceof W)return this.setChild(e.value,r,n,i);let a=e.value,s=new e.parentBag.constructor(null,e.builder||this),o=this.setChild(s,r,n,i,e);return this.promoteNodeValue(e,a,s),o}promoteNodeValue(e,r,n){e.setValue(n)}setChild(e,r,n,i,a=null){let s={...i},o=this.schema[r];if(!o)throw new Error(`unknown element '${r}'`);this.validateNodeValues(r,n,s);let l=o._meta?.subbuilder,c=(l==null?null:this._resolveSubbuilderReference(l,s,r))||this,d=n instanceof W?n._builderBindingPlan(c):null,f=a?.rootBuilder||e.root._builder||this;if(s.nodeId!=null&&f.source.getNodeByAttr("nodeId",s.nodeId))throw new Error(`Duplicate nodeId '${s.nodeId}'`);n instanceof W&&this._validateChildren(r,o,n.getNodes().map(w=>w.nodeTag),!1);let p=a||e.parentNode,h=p?.nodeTag?this.schema[p.nodeTag]:null;if(h&&!p._getMeta("subbuilder")&&this._countsForGrammar(o))this._validateParent(r,o,p.nodeTag),this._validateChildren(p.nodeTag,h,[...e.getNodes().map(w=>w.nodeTag),r],!1);else if(!h&&!p?._getMeta("subbuilder")&&o._parentSpec!=null&&this._countsForGrammar(o))throw new Error(`'${r}' requires a declared parent`);o._meta&&!("_meta"in s)&&(s._meta=o._meta),o.ns&&!("ns"in s)&&(s.ns=o.ns);let m=s.node_position;delete s.node_position;let g=s.node_label;delete s.node_label;let _;if(h?.collection_key){if(g!=null)throw new Error(`'${r}': node_label is not allowed in a collection`);_=this._collectionLabel(h.collection_key,r,s)}else{let w=h?._subSpec?.get(r);if(w&&w.max===1){if(g!=null)throw new Error(`'${r}': node_label is not allowed on a singleton`);_=r}else _=g||o.node_label||this._autoLabel(e,r)}if(e.node(_)!=null)throw new Error(`duplicate node label '${_}'`);return e._setBuilderItem(c,d,_,n,s,m||">",!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 a=r._subSpec;if(a==null||a.has("*")||r._meta?.subbuilder)return[];let s=new Map;for(let o of n){let l=this.schema[o];if(l&&!this._countsForGrammar(l))continue;let u=a.get(o);if(!u)throw new Error(`'${o}' not allowed as child of '${e}'`);let c=(s.get(o)||0)+1;if(s.set(o,c),c>u.max)throw new Error(`too many '${o}' in '${e}'`)}return i?[...a].filter(([o,l])=>(s.get(o)||0)<l.min).map(([o])=>o):[]}_collectionLabel(e,r,n){let i=a=>{if(n[a]===null||n[a]===void 0)throw new Error(`'${r}': collection key needs attribute '${a}'`);return String(n[a])};return e.includes("${")?e.replace(/\$\{([^}]+)\}/g,(a,s)=>i(s)):i(e)}validateSource(){let e=[],r=(n,i="")=>{for(let a of n.getNodes()){let s=i?`${i}.${a.label}`:a.label,o=a.builder;o.validateCustomTypes(a);let l=o.schema[a.nodeTag];if(l&&!a._getMeta("data_element,subbuilder,component").some(Boolean)){let u=a.value instanceof W?a.value.getNodes().map(d=>d.nodeTag):[],c=o._validateChildren(a.nodeTag,l,u,!0);c.length&&e.push([s,c])}a.value instanceof W&&r(a.value,s)}};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(),a=new Set(i.keys()),s=new Map([...Object.entries(e.getAttr()),...e.fixedAttrItems()]);for(let[c,d]of[...i])if(!(typeof c!="string"||!Ke(d)))for(let f of pi(e,d))i.has(f)||i.set(f,s.get(f));let o=e._getMeta("data_element");for(let[c,d]of i){if(d instanceof ne){r.set(c,d.resolve());continue}let f=typeof c=="string"?Ke(d)?.pointer??d:d;if(!e.pointerType(f)){r.set(c,typeof c=="string"&&typeof d=="string"&&d.startsWith("==")?null:d);continue}let p=e.absDatapath(f);if(r.set(c,this.data.getItem(p)),!o&&!p.includes("?")&&c===ir){let h=this.data.getNode(p);h&&Object.assign(n,h.getAttr("_wdg"))}}let l=La(i,r,(c,d,f,p)=>this.evaluatePointerExpression(e,c,d,f,p)),u=l.get(ir);l.delete(ir);for(let c of l.keys())a.has(c)||l.delete(c);return[u,{...Object.fromEntries(l),...n}]}evaluatePointerExpression(e,r,n,i,a){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,a]of Object.entries(r))ol.has(i)||(n[i]=a);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,a]of Object.entries(r))i!=="destination"&&i!=="value"&&!i.startsWith("_")&&(n[i]=a);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 W&&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 sl(this.constructor))if(Object.hasOwn(o,"components"))for(let l of o.components||[])e[l]=l;if(!Object.keys(e).length)return;let r={...this.schema},n={};for(let[o,l]of Object.entries(e))r[o]={sub_tags:"",_meta:{component:!0}},n[o.toLowerCase()]=l;let i=qr(r),a=this._collection||this.constructor._classCollection,s=a.toDocument();s.abstracts={},s.elements=Object.fromEntries(Object.keys(e).map(o=>[o,r[o]])),this._collection=new Ze(a.toDocument()).update(s),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(jr,new r(null,this),e?{datapath:e}:null),n.getItem(jr)}create(){this.setup(this.data),this._resolveComponents(),this.main(this.root),this.computeLogic(this._dataElementNodes())}get renderer_xml(){return new At(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 a=r===!1?null:r||this._defaultTargets.get(i.mode)||null,s={...a?.renderOpts,...n};return i.finalize(this.materialize(e,s),a,s)}};Fe._registry=new Map;var op=new Set(["short","medium","long","full"]),lp=/('(?:[^']|'')*'|[a-zA-Z]+|[^a-zA-Z']+)/g;function up(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||ve(t).split("::").at(-1);if(!["D","H","DH","DHZ"].includes(r))throw new RangeError(`Unsupported temporal dtype: ${r}`);return r}function cp(t,e,r,n){let i=e.match(lp)||[];if(i.join("")!==e)throw new RangeError("Unclosed format literal");let a=(c,d=2)=>String(c).padStart(d,"0"),s=c=>new Intl.DateTimeFormat(r,{timeZone:"UTC",...c}).format(t),u={...n==="H"?{}:{y:()=>String(t.getUTCFullYear()),yy:()=>a(t.getUTCFullYear()%100),yyyy:()=>a(t.getUTCFullYear(),4),M:()=>String(t.getUTCMonth()+1),MM:()=>a(t.getUTCMonth()+1),MMM:()=>s({month:"short"}),MMMM:()=>s({month:"long"}),d:()=>String(t.getUTCDate()),dd:()=>a(t.getUTCDate()),EEE:()=>s({weekday:"short"}),EEEE:()=>s({weekday:"long"})},...n==="D"?{}:{H:()=>String(t.getUTCHours()),HH:()=>a(t.getUTCHours()),h:()=>String(t.getUTCHours()%12||12),hh:()=>a(t.getUTCHours()%12||12),m:()=>String(t.getUTCMinutes()),mm:()=>a(t.getUTCMinutes()),s:()=>String(t.getUTCSeconds()),ss:()=>a(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(!u[c])throw new RangeError(`Unsupported date format token: ${c}`);return u[c]()}).join("")}function ll(t,{format:e,mask:r,locale:n,dtype:i,places:a}={}){let s=t==null?"":String(t);if(t!=null&&t!==""&&(e!=null&&e!==""||a!=null))if(typeof t=="number"||Te(t))s=fp(t,{format:e,locale:n,places:a});else{let o=up(t,i);if(op.has(e)){let l={timeZone:"UTC"};o!=="H"&&(l.dateStyle=e),o!=="D"&&(l.timeStyle=e),s=new Intl.DateTimeFormat(n||void 0,l).format(t)}else s=cp(t,String(e),n||void 0,o)}return r==null?s:String(r).replaceAll("%s",()=>s)}function dp({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 fp(t,e={}){if(typeof t!="number"&&!Te(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,dp(e));if(Te(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(Te(t)?t.toString():t)}var pp=new Set(["style","script"]),hp=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"]),ul=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"]),Vr=new Set(["rounded","gradient","shadow","transform","transition","zoom","filter"]),cl=t=>t===!0?"true":t===!1?"false":String(t),Xn=t=>typeof t=="number"&&Number.isFinite(t)?`${t}px`:String(t);function mp(t){if(ul.has(t))return!0;for(let e of ul)if(t.startsWith(`${e}_`))return!0;return!1}function gp(t){let e=new Map;if(!t)return e;let r=[],n=0,i=null,a=!1,s=!1,o=0,l=String(t);for(let u=0;u<l.length;u+=1){let c=l[u],d=l[u+1];if(s){c==="*"&&d==="/"&&(s=!1,u+=1);continue}if(a){a=!1;continue}if(c==="\\"){a=!0;continue}if(i){c===i&&(i=null);continue}c==='"'||c==="'"?i=c:c==="/"&&d==="*"?(s=!0,u+=1):"([{".includes(c)?o+=1:")]}".includes(c)&&o>0?o-=1:c===";"&&o===0&&(r.push(l.slice(n,u)),n=u+1)}r.push(l.slice(n));for(let u of r){let c=u.trim();if(!c)continue;let d=c.indexOf(":");if(d<0)throw new TypeError(`malformed style declaration '${c}'`);e.set(c.slice(0,d).trim(),c.slice(d+1).trim())}return e}var zr=class extends Dt{static mode="html";renderedItem(e,r,n,{tag:i,xml:a=!0,pretty:s=!1,depthOffset:o=0,includeDatapath:l=!1}={}){e.parentNode?._getMeta("subbuilder")==="html"&&(n={xmlns:"http://www.w3.org/1999/xhtml",...n});let{format:c,mask:d,locale:f,places:p,dtype:h,...m}=n;!Array.isArray(r)&&(c!=null||d!=null||p!=null)&&(r=ll(r,{format:c,mask:d,places:p,dtype:h,locale:this._displayLocale(e,f)}));let g=this._formatAttrs(m);if(l){if(!Object.hasOwn(n,"id")){let x=this.builder.targetId(e);x!==null&&(g+=` id="${this._htmlAttrValue(x)}"`)}for(let[x,B]of Object.entries(e.getAttr()))e.pointerType(B)&&(g+=` data-${this.adapt(x)}-pointer="${this._htmlAttrValue(e.absDatapath(B))}"`)}let _=s?" ".repeat(this._nodeDepth(e,o)):"",v=s?`
24
- `:"";if(e._getMeta("void"))return`${_}<${i}${g}${a?"/":""}>${v}`;if(Array.isArray(r)){let x=this._composeStringFragments(r);return`${_}<${i}${g}>${v}${x}${_}</${i}>${v}`}if(r==null)return`${_}<${i}${g}></${i}>${v}`;let w=typeof r=="string"&&r.endsWith("::HTML")?r.slice(0,-6):pp.has(i)?String(r):this._escapeText(r);return`${_}<${i}${g}>${w}</${i}>${v}`}_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 a=n.pointerType(i)?n.data.getItem(n.absDatapath(i)):i;if(a)return a}}adaptAttrs(e){let r={},n={};for(let[a,s]of Object.entries(e||{}))if(a.startsWith(`${this.builder.constructor._name}_`))r[this.adapt(a)]=s;else if(a==="dtype")r.dtype=s;else{if(this.builder.constructor.retainedAttrPrefixes.some(o=>a.startsWith(o)))continue;this._isStyleContribution(a)?n[a]=s:r[a]=s}let i=this._adaptStyle(n);return i&&(r.style=i),r}_isStyleContribution(e){if(e==="style"||e.startsWith("style_")||Vr.has(e))return!0;let r=e.includes("_")?e.slice(0,e.indexOf("_")):null;return r!==null&&Vr.has(r)||mp(e)}_adaptStyle(e){let r=gp(e.style),n=new Map,i=new Map;for(let[a,s]of Object.entries(e))if(a!=="style")if(a.startsWith("style_"))r.set(a.slice(6).replaceAll("_","-"),cl(s));else if(Vr.has(a))n.set(a,s);else{let o=a.indexOf("_"),l=o<0?a:a.slice(0,o);o>=0&&Vr.has(l)?(i.has(l)||i.set(l,{}),i.get(l)[a.slice(o+1)]=s):r.set(a.replaceAll("_","-"),cl(s))}for(let a of Vr)(n.has(a)||i.has(a))&&this[`_macro_${a}`](n.get(a),i.get(a)||{},r);return[...r].map(([a,s])=>`${a}: ${s}`).join("; ")}_formatAttrs(e){let r=[];for(let[n,i]of Object.entries(e||{}))hp.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("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}_macro_rounded(e,r,n){let i=e===void 0?{}:{top_left:e,top_right:e,bottom_left:e,bottom_right:e};for(let[a,s]of Object.entries(r))if(a==="top"||a==="bottom")i[`${a}_left`]=s,i[`${a}_right`]=s;else if(a==="left"||a==="right")i[`top_${a}`]=s,i[`bottom_${a}`]=s;else if(["top_left","top_right","bottom_left","bottom_right"].includes(a))i[a]=s;else throw new TypeError(`rounded: unknown sub-kwarg '${a}'`);for(let[a,s]of Object.entries(i))n.set(`border-${a.replaceAll("_","-")}-radius`,Xn(s))}_macro_transform(e,r,n){let i=e===void 0?[]:[String(e)];for(let[a,s]of Object.entries(r))a==="rotate"?i.push(`rotate(${s}deg)`):a==="scale"||a==="translate"?i.push(`${a}(${s})`):a==="translate_x"?i.push(`translateX(${Xn(s)})`):a==="translate_y"?i.push(`translateY(${Xn(s)})`):a==="skew_x"?i.push(`skewX(${s}deg)`):a==="skew_y"?i.push(`skewY(${s}deg)`):i.push(`${a.replaceAll("_","-")}(${s})`);i.length&&n.set("transform",i.join(" "))}_macro_filter(e,r,n){let i=e===void 0?[]:[String(e)];for(let[a,s]of Object.entries(r))a==="rotate"?i.push(`hue-rotate(${s}deg)`):a==="blur"?i.push(`blur(${Xn(s)})`):a==="drop_shadow"?i.push(`drop-shadow(${s})`):i.push(`${a.replaceAll("_","-")}(${s})`);i.length&&n.set("filter",i.join(" "))}_macro_transition(e,r,n){e!==void 0&&n.set("transition",String(e));for(let[i,a]of Object.entries(r))n.set(`transition-${i.replaceAll("_","-")}`,String(a))}_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,a]of Object.entries(r))n.set(`box-shadow-${i.replaceAll("_","-")}`,String(a))}_macro_gradient(e,r,n){e!==void 0&&n.set("background-image",String(e))}};var bp=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 dl(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[bp.has(e)?e.replaceAll("_","-"):e,r]))}var Hr=class extends At{static mode="svg";adaptAttrs(e){return dl(e)}};var fl={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 Zn=class extends Fe{static _name="html";static _defaultRenderMode="html";static retainedAttrPrefixes=["validate_","dtype"];static{this.defineGrammar(fl)}get renderer_html(){return new zr(this)}};Fe.registerBuilder(Zn);var pl={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 Jn=class extends Fe{static _name="svg";static _defaultRenderMode="svg";static{this.defineGrammar(pl)}get renderer_svg(){return new Hr(this)}};Fe.registerBuilder(Jn);var ar="http://www.w3.org/2000/svg";function ft(t,e,{align:r="start",matchWidth:n=!1,inset:i=0,placement:a="bottom",point:s=null}={}){let o=e.ownerDocument.defaultView,l=s?{left:s.x,right:s.x,top:s.y,bottom:s.y,width:0}:e.getBoundingClientRect(),u=Math.max(0,o.innerWidth-16);t.style.setProperty("--gramlot-popup-available-width",`${u}px`),n&&(t.style.width=`${Math.min(Math.max(0,l.width-2*i),u)}px`),t.style.removeProperty("--gramlot-popup-available-height");let c=t.getBoundingClientRect();if(a==="side"){let _=Math.max(0,o.innerWidth-8-l.right-3),v=Math.max(0,l.left-8-3),w=c.width>_&&v>_;t.style.setProperty("--gramlot-popup-available-width",`${w?v:_}px`),t.style.setProperty("--gramlot-popup-available-height",`${Math.max(0,o.innerHeight-16)}px`);let x=t.getBoundingClientRect(),B=w?l.left-x.width-3:l.right+3;t.style.left=`${Math.max(8,Math.min(B,o.innerWidth-x.width-8))}px`,t.style.top=`${Math.max(8,Math.min(l.top,o.innerHeight-x.height-8))}px`;return}let d=Math.max(0,o.innerHeight-8-l.bottom-3),f=Math.max(0,l.top-8-3),p=c.height>d&&f>d;t.style.setProperty("--gramlot-popup-available-height",`${p?f:d}px`);let h=t.getBoundingClientRect(),m=r==="end"?l.right-h.width-i:l.left+i,g=p?l.top-h.height-3:l.bottom+3;t.style.left=`${Math.max(8,Math.min(m,o.innerWidth-h.width-8))}px`,t.style.top=`${Math.max(8,Math.min(g,o.innerHeight-h.height-8))}px`}var hl=`
22
+ `)}},Ur=class extends Error{constructor(e){super(e),this.name="BagException"}};ne.registerBagClass(se);oa(se,"X",t=>t._toTytxPayload(),t=>se._fromTytxPayload(t));Mr(se.tytxSuffix,{...Ge(se.tytxSuffix),Bag:se});var jo=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 Vo(t){return t.endsWith("_")&&jo.has(t.slice(0,-1))?t.slice(0,-1):t}function zo(t){let e=Vo(t);return e!==t?e:t.startsWith("_")&&jo.has(t.slice(1))?t.slice(1):t}function pa(t,{renderTag:e=null,ns:r=null,dialectName:n=null}={}){let i=e||t;if(!i)return i;if(i=Vo(i),r&&!e){let a=`${n}_`;i.startsWith(a)&&(i=i.slice(a.length)),i=`${r}:${i}`}return i}var ir=Symbol("value"),Wo=new Set(["_meta","datapath","nodeId","ns","form","formId","_anchor","updateOn"]);function ha(t){return Object.entries(t||{}).filter(([e])=>!Wo.has(e)).map(([e,r])=>[zo(e),r])}var nr=class extends Ye{constructor(e,r,n=null,i=null,a=null,s=null,o=null){super(e,r,n,i,a,s,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 ha(this.getAttr())}runtimeToEvaluate(){let e=new Map(this.fixedAttrItems());return e.set(ir,this.value),e}absDatapath(e){let r=e;this.pointerType(e)&&(e=(Ke(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("."),a=i===-1?n:n.slice(0,i),s=i===-1?"":n.slice(i+1),o;if(a==="FORM")o=this._findMarkedDatapathAncestor(!0,!1,r);else if(a==="ANCHOR")o=this._findMarkedDatapathAncestor(!1,!0,r);else{let l=this.rootBuilder;if(!l)throw new Error(`#<id>: cannot resolve ${r} on a node without builder`);if(o=l.source.getNodeByAttr("nodeId",a),o==null)throw new Error(`#<id>: cannot resolve ${r}`)}return o.absDatapath(s?`.${s}`:".")}_findMarkedDatapathAncestor(e,r,n){let i=this;for(;i!=null;){let s=i.getAttr()||{};if(e&&(s.formId!=null||s.form===!0)||r&&"_anchor"in s)return i;i=i.parentNode}let a=e?"FORM":"ANCHOR";throw new Error(`#${a}: no marked ancestor found for ${n}`)}getRelativeData(e,r=null,{autocreate:n=!1}={}){let i=this.data,a=this.absDatapath(e);return n&&i.getItem(a)==null&&i.setItem(a,r),i.getItem(a,r)}setRelativeData(e,r,{attributes:n=null,fired:i=!1,reason:a=null}={}){let s=this.data,o=this.absDatapath(e);s.setItem(o,r,n,">",!1,!0,a===null?!0:a,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})}},W=class t extends se{constructor(e=null,r=null){super(e),this._builder=r,this._insertingBuilder=null}get nodeClass(){return nr}_setBuilderItem(e,r,n,...i){let a=r?.map(([o])=>[o,o._builder])||null;if(r)for(let[o,l]of r)o._builder=l;let s=this._insertingBuilder;this._insertingBuilder=e;try{return this.setItem(n,...i)}catch(o){if(this.node(n)==null&&a)for(let[l,u]of a)l._builder=u;throw o}finally{this._insertingBuilder=s}}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=(a,s)=>{if(n.has(a))throw new Error("source contains a cyclic or shared SourceBag branch");n.add(a),r.push([a,s]);for(let o of a.getNodes()){let l=s,u=o._getMeta("subbuilder");u!=null&&(l=s._resolveSubbuilderReference(u,o.getAttr()||{},o.nodeTag)),r.push([o,l]);let c=o.getValue(!0);c instanceof t&&i(c,l)}};return i(this,e),r}};if((Ge(W.tytxSuffix).SourceBag??W)!==W)throw new Error("TYTX subtype name 'SourceBag' is already registered for another class");Mr(W.tytxSuffix,{...Ge(W.tytxSuffix),SourceBag:W});function Kf(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 Qf=new Set(["then","toJSON"]),Go=new WeakMap;function Fr(t){return Go.get(t)||t}function ma(t){if(t==null)return t;t=Fr(t);let e=t._builder||t.parentBag&&t.parentBag._builder;return e?e.wrapSource(t):t}function Yo(t,e){let r=e instanceof se,n=new Proxy(e,{get(i,a){if(typeof a=="symbol"||a.startsWith("_")||Qf.has(a))return Reflect.get(i,a,i);let s=t.schemaTag(a);if(r&&s)return Ho(t,i,s,r);if(a in i){let l=Reflect.get(i,a,i);return typeof l=="function"?l.bind(i):l}if(s)return Ho(t,i,s,r);let o=t.containerMethod(a);if(o)return(...l)=>t[o](t.wrapSource(i),...l)}});return Go.set(n,e),n}function Ho(t,e,r,n){return(...i)=>{let{value:a,attrs:s}=Kf(i),o=n?t.bagCall(e,r,a,s):t.commandOnNode(e,r,a,s);return o.builder.wrapSource(o)}}var Zo=/^[A-Za-z_][A-Za-z0-9_]*$/,ep=new Set(["positional_only","positional_or_keyword","keyword_only","var_positional","var_keyword"]),tp=new Set(["framework","value","attribute"]),rp=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 Et(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function k(t,e){throw new TypeError(`${t}: ${e}`)}function Ue(t,e,r,n){Et(t)||k(n,"must be an object");for(let i of Object.keys(t))e.includes(i)||k(n,`unknown field '${i}'`);for(let i of r)Object.hasOwn(t,i)||k(n,`missing field '${i}'`)}function xt(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)=>xt(r,`${e}[${n}]`));if(Et(t))return Object.entries(t).forEach(([r,n])=>xt(n,`${e}.${r}`));k(e,"must be lossless JSON data")}}function np(t,e){let r="",n=!1;for(let i=0;i<t.length;i++){let a=t[i];if(a==="\\"){r+=a+(t[++i]??"");continue}a==="["&&(n=!0),!n&&a==="."&&!(e&16)?r+="[^\\n]":!n&&a==="^"&&e&8?r+="(?:^|(?<=\\n))":!n&&a==="$"?r+=e&8?"(?=\\n|(?![\\s\\S]))":"(?=\\n?(?![\\s\\S]))":r+=a,a==="]"&&(n=!1)}return r}function kt(t,e,r=!1,n=null){if(t===null)return null;switch(Ue(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 Ue(t,["kind","name"],["kind","name"],e),n||k(e,"custom references require a catalog; nested catalog references are unsupported"),n.resolve(t.name,e);case"dtype":{Ue(t,["kind","dtype"],["kind","dtype"],e);let i=t.dtype;typeof i!="string"&&k(e,"dtype must be a string");let a=Ir(i);return!a&&i!=="NN"&&k(e,`unknown dtype '${i}'`),{...t,test:o=>i==="NN"?o===null:i==="N"?Te(o)&&!["NaN","Infinity","-Infinity"].includes(o.toString()):a===Number?typeof o=="number"&&Number.isFinite(o)&&(i!=="L"||Number.isInteger(o)):a===String?typeof o=="string":a===Boolean?typeof o=="boolean":a===Date?o instanceof Date&&Number.isFinite(o.getTime()):a===Object?Et(o)&&[Object.prototype,null].includes(Object.getPrototypeOf(o)):o instanceof a}}case"any":return{...t,test:i=>!0};case"type":{(typeof t.module!="string"||typeof t.name!="string")&&k(e,"type requires string module/name");let i=`${t.module}.${t.name}`;if(i==="collections.abc.Callable")return{...t,test:s=>typeof s=="function",portable:!1};let a=rp.get(i);return a||k(e,`unsupported type '${i}'`),{...t,test:a}}case"union":{(!Array.isArray(t.items)||!t.items.length)&&k(e,"union items must be non-empty");let i=t.items.map((a,s)=>kt(a,`${e}.items[${s}]`,!0,n));return{...t,items:i,inputConstraint:i.some(a=>a.inputConstraint),test:a=>i.some(s=>s.test&&s.test(a))}}case"literal":return Array.isArray(t.values)||k(e,"literal values must be an array"),t.values.forEach((i,a)=>xt(i,`${e}.values[${a}]`)),{...t,test:i=>t.values.some(a=>Object.is(a,i))};case"annotated":{Array.isArray(t.metadata)||k(e,"annotated metadata must be an array"),t.metadata.some(s=>!["regex","range","value"].includes(s?.kind))&&k(e,"unsupported annotation metadata kind");let i=kt(t.base,`${e}.base`,!0,n),a=t.metadata.map((s,o)=>kt(s,`${e}.metadata[${o}]`,!0,n));return{...t,base:i,metadata:a,inputConstraint:i.inputConstraint,test:s=>i.test(s)&&a.every(o=>!o.test||o.test(s))}}case"range":{for(let i of["ge","le","gt","lt"])Object.hasOwn(t,i)||k(e,`range missing '${i}'`);for(let i of["ge","le","gt","lt"])t[i]!==null&&(typeof t[i]!="number"||!Number.isFinite(t[i]))&&k(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)&&k(e,"regex requires pattern and non-negative integer flags");let i=t.flags&-59;i&&k(e,`unsupported Python regex flags ${i}`),t.flags&2&&k(e,"IGNORECASE is not portable across Python and JavaScript Unicode rules"),/\\[AZzUwWdDsSabBN0-9]|\(\?P[<=!]|\(\?\(|\(\?>|\(\?#|\(\?[aiLmsux-]|[+*?}]\+|\{,/.test(t.pattern.replaceAll(String.raw`[\s\S]`,"."))&&k(e,"regex uses a non-portable construct or character class");let a="uy";t.flags&16&&(a+="s");let s;try{s=new RegExp(`(?:${np(t.pattern,t.flags)})(?![\\s\\S])`,a)}catch(o){k(e,`invalid portable regex: ${o.message}`)}return{...t,test:o=>typeof o!="string"?!1:(s.lastIndex=0,s.test(o))}}case"value":return xt(t.value,`${e}.value`),{...t};case"generic":{let i=kt(t.origin,`${e}.origin`,!0,n);(t.origin?.kind!=="type"||t.origin.module!=="builtins"||!["list","dict","tuple","set"].includes(t.origin.name))&&k(e,"only list, dict, tuple and set generic origins are supported"),Array.isArray(t.arguments)||k(e,"generic arguments must be an array");let a=t.arguments.map((s,o)=>kt(s,`${e}.arguments[${o}]`,!0,n));return{...t,origin:i,arguments:a,inputConstraint:a.some(s=>s.inputConstraint),test:s=>i.test(s)&&ip(t.origin,a,s)}}case"arguments":k(e,"Callable argument-list descriptors are not supported by Python validation");case"ellipsis":return r||k(e,"ellipsis is only valid as a nested descriptor"),{...t};default:k(e,`unknown annotation kind '${t.kind}'`)}}function ip(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,a)=>e[a].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,a])=>(!e[0]?.test||e[0].test(i))&&(!e[1]?.test||e[1].test(a))):!1}function Jo(t,e){if(t===null)return null;if(typeof t!="string"&&k(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)&&k(e,`invalid cardinality item '${n}'`);let a=i.match(/^([A-Za-z_][A-Za-z0-9_]*|\*)(?:\[(?:(\d+)|(?:(\d*):(\d*)))\])?$/);a||k(e,`invalid cardinality item '${n}'`);let[,s,o,l,u]=a;r.has(s)&&k(e,`duplicate tag '${s}'`);let c=0,d=1/0;i.includes("[")&&(i.includes(":")?(c=l?Number(l):0,d=u?Number(u):1/0):c=d=Number(o)),d<c&&k(e,`maximum ${d} is below minimum ${c}`),r.set(s,{min:c,max:d})}return r.has("*")&&r.size>1&&k(e,"wildcard '*' cannot be combined with named tags"),r}function Ko(t,e){if(t===null)return null;typeof t!="string"&&k(e,"must be string or null");let r=new Set;for(let n of t.split(",")){let i=n.trim();i&&((!Zo.test(i)||r.has(i))&&k(e,`invalid or duplicate parent '${n}'`),r.add(i))}return r}function ap(t,e,r){if(t===null)return null;Ue(t,["parameters","accepts_var_keyword","accepts_var_positional"],[],e);let n=t.parameters??[];Array.isArray(n)||k(e,"parameters must be an array"),t={parameters:n,accepts_var_keyword:n.some(l=>l.kind==="var_keyword"),accepts_var_positional:n.some(l=>l.kind==="var_positional"),...t},(!Array.isArray(t.parameters)||typeof t.accepts_var_keyword!="boolean"||typeof t.accepts_var_positional!="boolean")&&k(e,"invalid signature descriptor");let i=new Set,a=!1,s=!1,o=t.parameters.map((l,u)=>{let c=`${e}.parameters[${u}]`;return Ue(l,["name","kind","role","annotation","has_default","default"],["name","kind","role","annotation","has_default"],c),(typeof l.name!="string"||!Zo.test(l.name)||i.has(l.name))&&k(c,"invalid or duplicate parameter name"),i.add(l.name),(!ep.has(l.kind)||!tp.has(l.role)||typeof l.has_default!="boolean")&&k(c,"invalid kind, role, or has_default"),l.has_default!==Object.hasOwn(l,"default")&&k(c,"default presence must equal has_default"),l.has_default&&xt(l.default,`${c}.default`),a||=l.kind==="var_keyword",s||=l.kind==="var_positional",{...l,annotation:kt(l.annotation,`${c}.annotation`,!1,r)}});return(a!==t.accepts_var_keyword||s!==t.accepts_var_positional)&&k(e,"variadic summary flags do not match parameters"),{...t,parameters:o}}function Xo(t,e,r,n){let i=["doc","sub_tags","parent_tags","inherits_from","ns","attributes",...r?["node_label","collection_key"]:[],"_meta"];Ue(t,i,[],e),t={...Object.fromEntries(i.map(a=>[a,null])),...t};for(let a of["doc","inherits_from","ns",...r?["node_label","collection_key"]:[]])t[a]!==null&&typeof t[a]!="string"&&k(e,`${a} must be string or null`);return t._meta!==null&&(Et(t._meta)||k(e,"_meta must be object or null"),xt(t._meta,`${e}._meta`)),Jo(t.sub_tags,`${e}.sub_tags`),Ko(t.parent_tags,`${e}.parent_tags`),{...t,attributes:ap(t.attributes,`${e}.attributes`,n)}}function Qo(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}function el(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 tl(t){let e={...t};return e._subSpec=Object.hasOwn(e,"sub_tags")?Jo(e.sub_tags,"resolved.sub_tags"):null,e._parentSpec=Object.hasOwn(e,"parent_tags")?Ko(e.parent_tags,"resolved.parent_tags"):null,e}function rl(t,e,r,n){if(r.get(t)===1&&k(n,`inheritance cycle at '${t}'`),r.get(t)===2)return e[t];let i=e[t];i||k(n,`unknown abstract '${t}'`),r.set(t,1);let a={...i};for(let s of Qo(i.inherits_from))a=el(rl(s,e,r,n),a);return a=tl(a),r.set(t,2),e[t]=a,a}function ga({abstracts:t={},elements:e={}}){let r={...t},n=new Map;for(let a of Object.keys(r))rl(a,r,n,`abstracts.${a}.inherits_from`);let i={};for(let[a,s]of Object.entries(e)){let o={...s};for(let l of Qo(s.inherits_from)){let u=r[l];u||k(`elements.${a}.inherits_from`,`unknown abstract '${l}'`),o=el(u,o)}i[a]=tl(o)}return{abstracts:r,elements:i}}function ba(t){Ue(t,["document_format","grammar","abstracts","elements","custom_types"],["document_format","grammar","abstracts","elements"],"grammar document"),Ue(t.document_format,["name","version"],["name","version"],"document_format"),(t.document_format.name!=="builder_grammar"||!["1.1","1.2"].includes(t.document_format.version))&&k("document_format","expected builder_grammar version 1.1 or 1.2"),Ue(t.grammar,["name","version","title","description"],["name","version","title","description"],"grammar"),(typeof t.grammar.name!="string"||!t.grammar.name)&&k("grammar.name","must be non-empty string");for(let i of["version","title","description"])t.grammar[i]!==null&&typeof t.grammar[i]!="string"&&k(`grammar.${i}`,"must be string or null");(!Et(t.abstracts)||!Et(t.elements))&&k("grammar document","abstracts/elements must be objects"),Object.hasOwn(t,"custom_types")&&t.document_format.version!=="1.2"&&k("custom_types","requires version 1.2");let e=Yn.fromJSON(t.custom_types??{}),r={};for(let[i,a]of Object.entries(t.abstracts))(!i||i.startsWith("_"))&&k("abstracts",`invalid public name '${i}'`),r[i]=Xo(a,`abstracts.${i}`,!1,e);let n={};for(let[i,a]of Object.entries(t.elements))(!i||i.startsWith("_"))&&k("elements",`invalid public name '${i}'`),n[i]=Xo(a,`elements.${i}`,!0,e);return{grammar:structuredClone(t.grammar),abstracts:r,elements:n}}function nl(t,e,r,n){let i=e.attributes;if(!i)return;let a={...n};r!=null&&(a.node_value=r);let s=new Set(i.parameters.filter(u=>u.role==="attribute").map(u=>u.name)),o=new Set(["node_label","node_position","nodeId","target_id","datapath","iterate","store","_tag","_meta","ns"]);if(!i.accepts_var_keyword)for(let u of Object.keys(n))!s.has(u)&&!o.has(u)&&k(t,`unknown attribute '${u}'`);let l=e._meta?.component?i.parameters.find(u=>u.role!=="framework"&&["positional_only","positional_or_keyword"].includes(u.kind))?.name:null;for(let u of i.parameters){if(u.name===l||u.role==="framework"||u.kind.startsWith("var_"))continue;let c=Object.hasOwn(a,u.name);!c&&!u.has_default&&k(t,`missing required ${u.role} '${u.name}'`),c&&u.annotation!==null&&(!u.annotation.test||!u.annotation.test(a[u.name]))&&k(t,`invalid value for ${u.role} '${u.name}'`)}}var Yn=class t{#e=new Map;#t=new Map;register(e,r,n){let i=new Map([[String,"str"],[Number,"float"],["string","str"],["integer","int"],["number","float"]]),a=i.has(r)?{kind:"type",module:"builtins",name:i.get(r)}:r;return this.#n(e,{kind:"annotated",base:a,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)||sp.has(e))&&k("custom_types",`invalid, reserved or duplicate name '${e}'`),Ue(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))&&k(`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))&&k(`custom_types.${e}`,"portable Regex requires str; portable Range requires int or float"),xt(r,`custom_types.${e}`);let i=structuredClone(r),a=kt(i,`custom_types.${e}`),s=Object.freeze({kind:"custom",name:e});return Object.defineProperty(this,e,{value:s,enumerable:!0}),this.#e.set(e,i),this.#t.set(e,{...s,inputConstraint:!0,test:a.test}),s}resolve(e,r="custom_types"){return this.#t.has(e)||k(r,`unknown custom type '${e}'`),{...this.#t.get(e)}}validate(e,r){return this.resolve(e).test(r)||k(`custom_types.${e}`,"invalid input value"),!0}toJSON(){return structuredClone(Object.fromEntries(this.#e))}static fromJSON(e){Et(e)||k("custom_types","must be an object");let r=new t;for(let[n,i]of Object.entries(e))r.#n(n,i);return r}},sp=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 il(t,e,r,n){let i=e?.attributes;if(i)for(let a of i.parameters){if(!a.annotation?.inputConstraint||a.role==="framework"||["var_keyword","var_positional"].includes(a.kind))continue;let s=a.role==="value"?r:n[a.name];s!==void 0&&(a.annotation.test(s)||k(t,`invalid input for '${a.name}' (custom type)`))}}function al(t,e,r=[]){if(e===null)return structuredClone(t);if(r.length===2&&r[0]==="custom_types"&&t!==void 0){if(!_a(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(Xe(t)&&Xe(e)){let n=structuredClone(t);for(let[i,a]of Object.entries(e))a!==null&&Object.defineProperty(n,i,{value:al(n[i],a,[...r,i]),enumerable:!0,writable:!0,configurable:!0});return n}return structuredClone(e)}function _a(t,e){return Object.is(t,e)?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,n)=>_a(r,e[n])):Xe(t)&&Xe(e)?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).every(r=>Object.hasOwn(e,r)&&_a(t[r],e[r])):!1}function Xe(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype}function wa(t){if(!(t===null||typeof t=="string"||typeof t=="boolean")&&!(typeof t=="number"&&Number.isFinite(t))){if(Array.isArray(t)){t.forEach(wa);return}if(Xe(t)){Object.values(t).forEach(wa);return}throw new TypeError("collection must contain only finite JSON values")}}var Ze=class t{#e;constructor(e){wa(e);let r=["document_format","grammar","abstracts","elements"];if(!Xe(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(!Xe(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(!Xe(e[i]))throw new TypeError(`${i} must be an object`);if(Object.hasOwn(e,"custom_types")&&(n.version!=="1.2"||!Xe(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=al(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 Dt=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,a]=n.runtimeValues(e);if(e._getMeta("data_element"))return null;if(e._getMeta("component"))return this._renderComponent(e,a,r);let s=this.getRender(n),o;return[o,a]=s._handleMeta(e,a),e._getMeta("subbuilder")||(a=s.adaptAttrs(a)),e.value instanceof W&&(i=this.renderChildren(e.value,r)),s.renderedItem(e,i,a,{tag:o,...r})}renderChildren(e,r={}){let n=[];for(let i of e.getNodes()){let a=this.render(i,r);a!==null&&(Array.isArray(a)?n.push(...a):n.push(a))}return n}_renderComponent(e,r,n){let[i,a,s,o]=this._expansionInputs(e,r);if(!Object.hasOwn(e.getAttr(),"iterate"))return this._expandBlock(e,i,s,o,n);if(a==null)return[];if(!(a instanceof se))throw new TypeError(`component '${e.nodeTag}': iterate must resolve to a Bag, got ${a?.constructor?.name||typeof a}`);return a.getNodes().map(l=>this._expandBlock(e,i,s,{node_label:l.label},n))}_expansionInputs(e,r){let n=e.builder,i=n.componentMethod(e.nodeTag),a=i&&n[i];if(typeof a!="function")throw new Error(`component '${e.nodeTag}' has no implementation`);let s=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 l of Object.keys(r)){let u=e.getAttr(l);e.pointerType(u)==="^"&&(r[l]=`^${e.absDatapath(u)}`)}return[a,s,o,r]}_expandBlock(e,r,n,i,a){let s=e.builder._expansionRoot(n);r.call(e.builder,ma(s),i);let o=s.getNodes();if(o.length!==1)throw new Error(`component '${e.nodeTag}' must build a tree, not a forest: ${o.length} root nodes`);let l={...a,depthOffset:this._nodeDepth(e,a.depthOffset||0)};return this.render(o[0],l)}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"),a=pa(e.nodeTag,{renderTag:n,ns:e.getAttr("ns"),dialectName:e.builder?.constructor._name});if(!a)throw new Error(`node ${e.label} has no tag to render (no render_tag, no node_tag)`);return i&&(r={...r,...i}),[a,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("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}_escapeAttr(e){return this._escapeText(e).replaceAll('"',"&quot;")}_nodeDepth(e,r=0){let i=((e.fullpath||"").match(/\./g)||[]).length;return Math.max(i-1,0)+r}};var At=class extends Dt{static mode="xml";renderedItem(e,r,n,{tag:i,pretty:a=!1,depthOffset:s=0}={}){let o=this._formatAttrs(n),l=a?" ".repeat(this._nodeDepth(e,s)):"",u=a?`
23
+ `:"";if(Array.isArray(r)){let c=this._composeStringFragments(r);return`${l}<${i}${o}>${u}${c}${l}</${i}>${u}`}return r==null?`${l}<${i}${o}></${i}>${u}`:`${l}<${i}${o}>${this._escapeText(r)}</${i}>${u}`}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 sl={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 ol(t){let e=[];for(;t&&t!==Function.prototype;)e.push(t),t=Object.getPrototypeOf(t);return e.reverse()}function lp(t){let e=Object.create(null),r=(n,i)=>{let a=n.toLowerCase(),s=e[a];if(s!==void 0&&s!==i)throw new Error(`container '${n}' is already tied to implementation method '${s}' (cannot rebind to '${i}')`);e[a]=i};for(let n of ol(t))if(Object.hasOwn(n,"containers"))for(let i of n.containers||[])r(i,i);return e}function qr(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 jr="_root_",ya="_root_",ll=new Set(["destination","func","value","_on_start"]),Fe=class t{static _sourceClass=W;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 se,this._dataroot.setBackref(),this._dataroot.setItem(ya,new se),this.data=this._dataroot.getItem(ya),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(jr,new r(null,this)),this.source=this._sourceroot.getItem(jr)}wrapSource(e){if(e=Fr(e),!(e instanceof W)&&!(e instanceof nr))throw new TypeError("wrapSource requires a SourceBag or SourceBagNode");let r=this._sourceHandles.get(e);return r||(r=Yo(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 Ze(r.toDocument()).update(e):new Ze(e),i=ba(n.toDocument()),a=ga(i),s=qr(a.elements);this._classCollection=n,this._classSchema=a.elements,this._abstracts=a.abstracts,this._tagNames=s}static{this.defineGrammar(sl)}get _containers(){return lp(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??=qr(this.schema):this.constructor._tagNames??=qr(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 Ze(e):new Ze(n.toDocument()).update(e),a=ba(i.toDocument()),s=ga(a),o=qr(s.elements);return this._collection=i,this._schemaOverride=s.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;il(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 nl(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 a=r!==void 0?r:e.value instanceof W?null:e.value;this.validateNodeValues(e.nodeTag,a,n||e.getAttr?.()||{});let s=this.schema[this.schemaTag(e.nodeTag)],o=i||(e.value instanceof W?e.value.getNodes().map(l=>l.nodeTag):null);return o&&this._validateChildren(e.nodeTag,s,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(a=>typeof a!="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 a=i._parentSpec;if(a==null||a.has("*"))return!0;if(r===null)throw new Error(`'${n}' requires a declared parent`);let s=this.schemaTag(r);if(!s)throw new Error(`unknown parent element '${r}'`);return this._validateParent(n,i,s),!0}bagCall(e,r,n,i){return this.setChild(e,r,n,i)}commandOnNode(e,r,n,i){if(e=Fr(e),e.value instanceof W)return this.setChild(e.value,r,n,i);let a=e.value,s=new e.parentBag.constructor(null,e.builder||this),o=this.setChild(s,r,n,i,e);return this.promoteNodeValue(e,a,s),o}promoteNodeValue(e,r,n){e.setValue(n)}setChild(e,r,n,i,a=null){let s={...i},o=this.schema[r];if(!o)throw new Error(`unknown element '${r}'`);this.validateNodeValues(r,n,s);let l=o._meta?.subbuilder,c=(l==null?null:this._resolveSubbuilderReference(l,s,r))||this,d=n instanceof W?n._builderBindingPlan(c):null,f=a?.rootBuilder||e.root._builder||this;if(s.nodeId!=null&&f.source.getNodeByAttr("nodeId",s.nodeId))throw new Error(`Duplicate nodeId '${s.nodeId}'`);n instanceof W&&this._validateChildren(r,o,n.getNodes().map(w=>w.nodeTag),!1);let p=a||e.parentNode,h=p?.nodeTag?this.schema[p.nodeTag]:null;if(h&&!p._getMeta("subbuilder")&&this._countsForGrammar(o))this._validateParent(r,o,p.nodeTag),this._validateChildren(p.nodeTag,h,[...e.getNodes().map(w=>w.nodeTag),r],!1);else if(!h&&!p?._getMeta("subbuilder")&&o._parentSpec!=null&&this._countsForGrammar(o))throw new Error(`'${r}' requires a declared parent`);o._meta&&!("_meta"in s)&&(s._meta=o._meta),o.ns&&!("ns"in s)&&(s.ns=o.ns);let m=s.node_position;delete s.node_position;let g=s.node_label;delete s.node_label;let _;if(h?.collection_key){if(g!=null)throw new Error(`'${r}': node_label is not allowed in a collection`);_=this._collectionLabel(h.collection_key,r,s)}else{let w=h?._subSpec?.get(r);if(w&&w.max===1){if(g!=null)throw new Error(`'${r}': node_label is not allowed on a singleton`);_=r}else _=g||o.node_label||this._autoLabel(e,r)}if(e.node(_)!=null)throw new Error(`duplicate node label '${_}'`);return e._setBuilderItem(c,d,_,n,s,m||">",!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 a=r._subSpec;if(a==null||a.has("*")||r._meta?.subbuilder)return[];let s=new Map;for(let o of n){let l=this.schema[o];if(l&&!this._countsForGrammar(l))continue;let u=a.get(o);if(!u)throw new Error(`'${o}' not allowed as child of '${e}'`);let c=(s.get(o)||0)+1;if(s.set(o,c),c>u.max)throw new Error(`too many '${o}' in '${e}'`)}return i?[...a].filter(([o,l])=>(s.get(o)||0)<l.min).map(([o])=>o):[]}_collectionLabel(e,r,n){let i=a=>{if(n[a]===null||n[a]===void 0)throw new Error(`'${r}': collection key needs attribute '${a}'`);return String(n[a])};return e.includes("${")?e.replace(/\$\{([^}]+)\}/g,(a,s)=>i(s)):i(e)}validateSource(){let e=[],r=(n,i="")=>{for(let a of n.getNodes()){let s=i?`${i}.${a.label}`:a.label,o=a.builder;o.validateCustomTypes(a);let l=o.schema[a.nodeTag];if(l&&!a._getMeta("data_element,subbuilder,component").some(Boolean)){let u=a.value instanceof W?a.value.getNodes().map(d=>d.nodeTag):[],c=o._validateChildren(a.nodeTag,l,u,!0);c.length&&e.push([s,c])}a.value instanceof W&&r(a.value,s)}};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(),a=new Set(i.keys()),s=new Map([...Object.entries(e.getAttr()),...e.fixedAttrItems()]);for(let[c,d]of[...i])if(!(typeof c!="string"||!Ke(d)))for(let f of hi(e,d))i.has(f)||i.set(f,s.get(f));let o=e._getMeta("data_element");for(let[c,d]of i){if(d instanceof ne){r.set(c,d.resolve());continue}let f=typeof c=="string"?Ke(d)?.pointer??d:d;if(!e.pointerType(f)){r.set(c,typeof c=="string"&&typeof d=="string"&&d.startsWith("==")?null:d);continue}let p=e.absDatapath(f);if(r.set(c,this.data.getItem(p)),!o&&!p.includes("?")&&c===ir){let h=this.data.getNode(p);h&&Object.assign(n,h.getAttr("_wdg"))}}let l=Pa(i,r,(c,d,f,p)=>this.evaluatePointerExpression(e,c,d,f,p)),u=l.get(ir);l.delete(ir);for(let c of l.keys())a.has(c)||l.delete(c);return[u,{...Object.fromEntries(l),...n}]}evaluatePointerExpression(e,r,n,i,a){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,a]of Object.entries(r))ll.has(i)||(n[i]=a);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,a]of Object.entries(r))i!=="destination"&&i!=="value"&&!i.startsWith("_")&&(n[i]=a);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 W&&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 ol(this.constructor))if(Object.hasOwn(o,"components"))for(let l of o.components||[])e[l]=l;if(!Object.keys(e).length)return;let r={...this.schema},n={};for(let[o,l]of Object.entries(e))r[o]={sub_tags:"",_meta:{component:!0}},n[o.toLowerCase()]=l;let i=qr(r),a=this._collection||this.constructor._classCollection,s=a.toDocument();s.abstracts={},s.elements=Object.fromEntries(Object.keys(e).map(o=>[o,r[o]])),this._collection=new Ze(a.toDocument()).update(s),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(jr,new r(null,this),e?{datapath:e}:null),n.getItem(jr)}create(){this.setup(this.data),this._resolveComponents(),this.main(this.root),this.computeLogic(this._dataElementNodes())}get renderer_xml(){return new At(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 a=r===!1?null:r||this._defaultTargets.get(i.mode)||null,s={...a?.renderOpts,...n};return i.finalize(this.materialize(e,s),a,s)}};Fe._registry=new Map;var up=new Set(["short","medium","long","full"]),cp=/('(?:[^']|'')*'|[a-zA-Z]+|[^a-zA-Z']+)/g;function dp(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||ve(t).split("::").at(-1);if(!["D","H","DH","DHZ"].includes(r))throw new RangeError(`Unsupported temporal dtype: ${r}`);return r}function fp(t,e,r,n){let i=e.match(cp)||[];if(i.join("")!==e)throw new RangeError("Unclosed format literal");let a=(c,d=2)=>String(c).padStart(d,"0"),s=c=>new Intl.DateTimeFormat(r,{timeZone:"UTC",...c}).format(t),u={...n==="H"?{}:{y:()=>String(t.getUTCFullYear()),yy:()=>a(t.getUTCFullYear()%100),yyyy:()=>a(t.getUTCFullYear(),4),M:()=>String(t.getUTCMonth()+1),MM:()=>a(t.getUTCMonth()+1),MMM:()=>s({month:"short"}),MMMM:()=>s({month:"long"}),d:()=>String(t.getUTCDate()),dd:()=>a(t.getUTCDate()),EEE:()=>s({weekday:"short"}),EEEE:()=>s({weekday:"long"})},...n==="D"?{}:{H:()=>String(t.getUTCHours()),HH:()=>a(t.getUTCHours()),h:()=>String(t.getUTCHours()%12||12),hh:()=>a(t.getUTCHours()%12||12),m:()=>String(t.getUTCMinutes()),mm:()=>a(t.getUTCMinutes()),s:()=>String(t.getUTCSeconds()),ss:()=>a(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(!u[c])throw new RangeError(`Unsupported date format token: ${c}`);return u[c]()}).join("")}function ul(t,{format:e,mask:r,locale:n,dtype:i,places:a}={}){let s=t==null?"":String(t);if(t!=null&&t!==""&&(e!=null&&e!==""||a!=null))if(typeof t=="number"||Te(t))s=hp(t,{format:e,locale:n,places:a});else{let o=dp(t,i);if(up.has(e)){let l={timeZone:"UTC"};o!=="H"&&(l.dateStyle=e),o!=="D"&&(l.timeStyle=e),s=new Intl.DateTimeFormat(n||void 0,l).format(t)}else s=fp(t,String(e),n||void 0,o)}return r==null?s:String(r).replaceAll("%s",()=>s)}function pp({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 hp(t,e={}){if(typeof t!="number"&&!Te(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,pp(e));if(Te(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(Te(t)?t.toString():t)}var mp=new Set(["style","script"]),gp=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"]),cl=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"]),Vr=new Set(["rounded","gradient","shadow","transform","transition","zoom","filter"]),dl=t=>t===!0?"true":t===!1?"false":String(t),Xn=t=>typeof t=="number"&&Number.isFinite(t)?`${t}px`:String(t);function bp(t){if(cl.has(t))return!0;for(let e of cl)if(t.startsWith(`${e}_`))return!0;return!1}function _p(t){let e=new Map;if(!t)return e;let r=[],n=0,i=null,a=!1,s=!1,o=0,l=String(t);for(let u=0;u<l.length;u+=1){let c=l[u],d=l[u+1];if(s){c==="*"&&d==="/"&&(s=!1,u+=1);continue}if(a){a=!1;continue}if(c==="\\"){a=!0;continue}if(i){c===i&&(i=null);continue}c==='"'||c==="'"?i=c:c==="/"&&d==="*"?(s=!0,u+=1):"([{".includes(c)?o+=1:")]}".includes(c)&&o>0?o-=1:c===";"&&o===0&&(r.push(l.slice(n,u)),n=u+1)}r.push(l.slice(n));for(let u of r){let c=u.trim();if(!c)continue;let d=c.indexOf(":");if(d<0)throw new TypeError(`malformed style declaration '${c}'`);e.set(c.slice(0,d).trim(),c.slice(d+1).trim())}return e}var zr=class extends Dt{static mode="html";renderedItem(e,r,n,{tag:i,xml:a=!0,pretty:s=!1,depthOffset:o=0,includeDatapath:l=!1}={}){e.parentNode?._getMeta("subbuilder")==="html"&&(n={xmlns:"http://www.w3.org/1999/xhtml",...n});let{format:c,mask:d,locale:f,places:p,dtype:h,...m}=n;!Array.isArray(r)&&(c!=null||d!=null||p!=null)&&(r=ul(r,{format:c,mask:d,places:p,dtype:h,locale:this._displayLocale(e,f)}));let g=this._formatAttrs(m);if(l){if(!Object.hasOwn(n,"id")){let x=this.builder.targetId(e);x!==null&&(g+=` id="${this._htmlAttrValue(x)}"`)}for(let[x,B]of Object.entries(e.getAttr()))e.pointerType(B)&&(g+=` data-${this.adapt(x)}-pointer="${this._htmlAttrValue(e.absDatapath(B))}"`)}let _=s?" ".repeat(this._nodeDepth(e,o)):"",v=s?`
24
+ `:"";if(e._getMeta("void"))return`${_}<${i}${g}${a?"/":""}>${v}`;if(Array.isArray(r)){let x=this._composeStringFragments(r);return`${_}<${i}${g}>${v}${x}${_}</${i}>${v}`}if(r==null)return`${_}<${i}${g}></${i}>${v}`;let w=typeof r=="string"&&r.endsWith("::HTML")?r.slice(0,-6):mp.has(i)?String(r):this._escapeText(r);return`${_}<${i}${g}>${w}</${i}>${v}`}_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 a=n.pointerType(i)?n.data.getItem(n.absDatapath(i)):i;if(a)return a}}adaptAttrs(e){let r={},n={};for(let[a,s]of Object.entries(e||{}))if(a.startsWith(`${this.builder.constructor._name}_`))r[this.adapt(a)]=s;else if(a==="dtype")r.dtype=s;else{if(this.builder.constructor.retainedAttrPrefixes.some(o=>a.startsWith(o)))continue;this._isStyleContribution(a)?n[a]=s:r[a]=s}let i=this._adaptStyle(n);return i&&(r.style=i),r}_isStyleContribution(e){if(e==="style"||e.startsWith("style_")||Vr.has(e))return!0;let r=e.includes("_")?e.slice(0,e.indexOf("_")):null;return r!==null&&Vr.has(r)||bp(e)}_adaptStyle(e){let r=_p(e.style),n=new Map,i=new Map;for(let[a,s]of Object.entries(e))if(a!=="style")if(a.startsWith("style_"))r.set(a.slice(6).replaceAll("_","-"),dl(s));else if(Vr.has(a))n.set(a,s);else{let o=a.indexOf("_"),l=o<0?a:a.slice(0,o);o>=0&&Vr.has(l)?(i.has(l)||i.set(l,{}),i.get(l)[a.slice(o+1)]=s):r.set(a.replaceAll("_","-"),dl(s))}for(let a of Vr)(n.has(a)||i.has(a))&&this[`_macro_${a}`](n.get(a),i.get(a)||{},r);return[...r].map(([a,s])=>`${a}: ${s}`).join("; ")}_formatAttrs(e){let r=[];for(let[n,i]of Object.entries(e||{}))gp.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("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}_macro_rounded(e,r,n){let i=e===void 0?{}:{top_left:e,top_right:e,bottom_left:e,bottom_right:e};for(let[a,s]of Object.entries(r))if(a==="top"||a==="bottom")i[`${a}_left`]=s,i[`${a}_right`]=s;else if(a==="left"||a==="right")i[`top_${a}`]=s,i[`bottom_${a}`]=s;else if(["top_left","top_right","bottom_left","bottom_right"].includes(a))i[a]=s;else throw new TypeError(`rounded: unknown sub-kwarg '${a}'`);for(let[a,s]of Object.entries(i))n.set(`border-${a.replaceAll("_","-")}-radius`,Xn(s))}_macro_transform(e,r,n){let i=e===void 0?[]:[String(e)];for(let[a,s]of Object.entries(r))a==="rotate"?i.push(`rotate(${s}deg)`):a==="scale"||a==="translate"?i.push(`${a}(${s})`):a==="translate_x"?i.push(`translateX(${Xn(s)})`):a==="translate_y"?i.push(`translateY(${Xn(s)})`):a==="skew_x"?i.push(`skewX(${s}deg)`):a==="skew_y"?i.push(`skewY(${s}deg)`):i.push(`${a.replaceAll("_","-")}(${s})`);i.length&&n.set("transform",i.join(" "))}_macro_filter(e,r,n){let i=e===void 0?[]:[String(e)];for(let[a,s]of Object.entries(r))a==="rotate"?i.push(`hue-rotate(${s}deg)`):a==="blur"?i.push(`blur(${Xn(s)})`):a==="drop_shadow"?i.push(`drop-shadow(${s})`):i.push(`${a.replaceAll("_","-")}(${s})`);i.length&&n.set("filter",i.join(" "))}_macro_transition(e,r,n){e!==void 0&&n.set("transition",String(e));for(let[i,a]of Object.entries(r))n.set(`transition-${i.replaceAll("_","-")}`,String(a))}_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,a]of Object.entries(r))n.set(`box-shadow-${i.replaceAll("_","-")}`,String(a))}_macro_gradient(e,r,n){e!==void 0&&n.set("background-image",String(e))}};var wp=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 fl(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[wp.has(e)?e.replaceAll("_","-"):e,r]))}var Hr=class extends At{static mode="svg";adaptAttrs(e){return fl(e)}};var pl={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 Zn=class extends Fe{static _name="html";static _defaultRenderMode="html";static retainedAttrPrefixes=["validate_","dtype"];static{this.defineGrammar(pl)}get renderer_html(){return new zr(this)}};Fe.registerBuilder(Zn);var hl={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 Jn=class extends Fe{static _name="svg";static _defaultRenderMode="svg";static{this.defineGrammar(hl)}get renderer_svg(){return new Hr(this)}};Fe.registerBuilder(Jn);var ar="http://www.w3.org/2000/svg";function ft(t,e,{align:r="start",matchWidth:n=!1,inset:i=0,placement:a="bottom",point:s=null}={}){let o=e.ownerDocument.defaultView,l=s?{left:s.x,right:s.x,top:s.y,bottom:s.y,width:0}:e.getBoundingClientRect(),u=Math.max(0,o.innerWidth-16);t.style.setProperty("--gramlot-popup-available-width",`${u}px`),n&&(t.style.width=`${Math.min(Math.max(0,l.width-2*i),u)}px`),t.style.removeProperty("--gramlot-popup-available-height");let c=t.getBoundingClientRect();if(a==="side"){let _=Math.max(0,o.innerWidth-8-l.right-3),v=Math.max(0,l.left-8-3),w=c.width>_&&v>_;t.style.setProperty("--gramlot-popup-available-width",`${w?v:_}px`),t.style.setProperty("--gramlot-popup-available-height",`${Math.max(0,o.innerHeight-16)}px`);let x=t.getBoundingClientRect(),B=w?l.left-x.width-3:l.right+3;t.style.left=`${Math.max(8,Math.min(B,o.innerWidth-x.width-8))}px`,t.style.top=`${Math.max(8,Math.min(l.top,o.innerHeight-x.height-8))}px`;return}let d=Math.max(0,o.innerHeight-8-l.bottom-3),f=Math.max(0,l.top-8-3),p=c.height>d&&f>d;t.style.setProperty("--gramlot-popup-available-height",`${p?f:d}px`);let h=t.getBoundingClientRect(),m=r==="end"?l.right-h.width-i:l.left+i,g=p?l.top-h.height-3:l.bottom+3;t.style.left=`${Math.max(8,Math.min(m,o.innerWidth-h.width-8))}px`,t.style.top=`${Math.max(8,Math.min(g,o.innerHeight-h.height-8))}px`}var ml=`
25
25
  :host{display:inline-block;font:inherit;color:var(--gramlot-ink,CanvasText)}
26
26
  .control-box{display:flex;align-items:center;gap:.35rem}
27
27
  button{font:inherit;color:inherit;cursor:pointer;border:0;background:transparent;border-radius:var(--gramlot-radius-sm,4px)}
@@ -45,7 +45,7 @@ li button{display:block;width:100%;text-align:start;padding:.55rem .35rem}
45
45
  .previous,.notice{color:var(--gramlot-text-secondary,GrayText)}
46
46
  .arrow{padding:0 .5rem}
47
47
  .notice{font-size:.9em;margin:.5rem .35rem .15rem}
48
- `;var ml=(0,P.defineComponent)({name:"editingStatus",tag:"gramlot-editing-status",base:di,sourceContext:!0,parameters:{},implementation:t=>class extends t{#e;#t;#n=new Map;#r;#a;#i;#s;#o;constructor(){super();let e=this.ownerDocument,r=e.createElement("style");r.textContent=hl,this.shadowRoot.append(r),this.control.replaceChildren(),this.control.setAttribute("role","group"),this.control.setAttribute("aria-label","Editing reports");for(let[a,s,o]of[["errors","Errors","M12 3L22 21H2ZM12 9V14M12 17V17.1"],["changes","Changes","M4 5H14M4 10H10M4 15H8M13 20L20 13L17 10L10 17L9 21Z"]]){let l=e.createElement("button");l.type="button",l.dataset.kind=a,l.setAttribute("aria-haspopup","dialog"),l.setAttribute("aria-expanded","false"),l.setAttribute("aria-controls","editing-report");let u=e.createElementNS(ar,"svg");u.setAttribute("viewBox","0 0 24 24"),u.setAttribute("aria-hidden","true");let c=e.createElementNS(ar,"path");c.setAttribute("d",o),u.append(c);let d=e.createElement("span");d.textContent=s;let f=e.createElement("span");f.className="count",f.textContent="0",l.append(u,d,f),this.control.append(l),this.#n.set(a,{button:l,count:f}),l.addEventListener("click",()=>{let p=this.#r.matches(":popover-open");if(p&&this.#o===a){this.#r.hidePopover();return}this.#o=a,this.#d(),p||this.#r.showPopover(),this.#f(),ft(this.#r,l,{align:"end"})})}this.#r=e.createElement("section"),this.#r.id="editing-report",this.#r.className="report",this.#r.setAttribute("popover","auto"),this.#r.setAttribute("role","dialog"),this.#r.setAttribute("aria-labelledby","report-title");let n=e.createElement("header");this.#a=e.createElement("strong"),this.#a.id="report-title";let i=e.createElement("button");i.type="button",i.textContent="\xD7",i.setAttribute("aria-label","Close report"),i.addEventListener("click",()=>this.#r.hidePopover()),n.append(this.#a,i),this.#i=e.createElement("ul"),this.#s=e.createElement("p"),this.#s.className="notice",this.#s.setAttribute("role","status"),this.#r.append(n,this.#i,this.#s),this.shadowRoot.append(this.#r),this.#r.addEventListener("toggle",()=>this.#f())}setSourceContext(e){if(this.#t?.(),this.#t=null,this.#e=e.sourceNode.formState,!this.#e)throw new Error("editingStatus requires a shared editing session.");this.#u()}connectedCallback(){this.#u()}disconnectedCallback(){this.#t?.(),this.#t=null,this.#r.matches(":popover-open")&&this.#r.hidePopover()}#u(){!this.#e||this.#t||!this.isConnected||(this.#t=this.#e.subscribe(()=>this.#c()),this.#c())}#f(){let e=this.#r.matches(":popover-open");for(let[r,{button:n}]of this.#n)n.setAttribute("aria-expanded",String(e&&r===this.#o))}#c(){this.#n.get("errors").count.textContent=String(this.#e.errorEntries.length),this.#n.get("changes").count.textContent=String(this.#e.changeEntries.length),this.#n.get("errors").button.classList.toggle("invalid",this.#e.errorEntries.length>0),this.#r.matches(":popover-open")&&this.#d()}#l(e,r){return r?e==null?"\u2205":e instanceof yp?`${e.length} fields`:e instanceof Date?e.toLocaleString():String(e):"Not present"}#d(){let e=this.#o==="errors",r=e?this.#e.errorEntries:this.#e.changeEntries;this.#a.textContent=e?"Validation errors":"Unsaved changes",this.#s.textContent=r.length?"Select an entry to return to its field.":e?"No validation errors.":"No changes since the accepted snapshot.";let n=this.shadowRoot.activeElement?.dataset.path;this.#i.replaceChildren();for(let i of r){let a=this.ownerDocument,s=a.createElement("li"),o=a.createElement("button");o.type="button",o.dataset.path=i.path;let l=a.createElement("span");l.className="field",l.textContent=i.path.slice(this.#e.path?this.#e.path.length+1:0);let u=a.createElement("span");if(u.className="detail",e)u.textContent=i.message;else{let c=a.createElement("span");c.className="previous",c.textContent=this.#l(i.previous,i.existed);let d=a.createElement("span");d.className="arrow",d.textContent="\u2192";let f=a.createElement("span");f.className="current",f.textContent=this.#l(i.current,i.exists),u.append(c,d,f)}o.append(l,u),s.append(o),this.#i.append(s),o.addEventListener("click",()=>{this.#e.focusField(i.path)?this.#r.hidePopover():this.#s.textContent="This field is not visible. Check the grid filter or whether the row still exists."}),i.path===n&&o.focus({preventScroll:!0})}}}});function Kn(t,e=","){if(typeof e!="string"||!e)throw new TypeError("separator must be a nonempty string");if(t==="")return[];let r=new Set;return t.split(e).map(n=>{let i=n.indexOf(":"),a=i<0?n:n.slice(0,i),s=i<0?n:n.slice(i+1);if(!a||r.has(a))throw new Error("Invalid or duplicate choice code");return r.add(a),{id:a,caption:s}})}function Qn(t){return class extends t{constructor(){super();let e=this.attachShadow({mode:"open"}),r=this.ownerDocument.createElement("style");r.textContent=`:host{display:inline-block;font:inherit} *,*::before,*::after{box-sizing:border-box}
48
+ `;var gl=(0,P.defineComponent)({name:"editingStatus",tag:"gramlot-editing-status",base:fi,sourceContext:!0,parameters:{},implementation:t=>class extends t{#e;#t;#n=new Map;#r;#a;#i;#s;#o;constructor(){super();let e=this.ownerDocument,r=e.createElement("style");r.textContent=ml,this.shadowRoot.append(r),this.control.replaceChildren(),this.control.setAttribute("role","group"),this.control.setAttribute("aria-label","Editing reports");for(let[a,s,o]of[["errors","Errors","M12 3L22 21H2ZM12 9V14M12 17V17.1"],["changes","Changes","M4 5H14M4 10H10M4 15H8M13 20L20 13L17 10L10 17L9 21Z"]]){let l=e.createElement("button");l.type="button",l.dataset.kind=a,l.setAttribute("aria-haspopup","dialog"),l.setAttribute("aria-expanded","false"),l.setAttribute("aria-controls","editing-report");let u=e.createElementNS(ar,"svg");u.setAttribute("viewBox","0 0 24 24"),u.setAttribute("aria-hidden","true");let c=e.createElementNS(ar,"path");c.setAttribute("d",o),u.append(c);let d=e.createElement("span");d.textContent=s;let f=e.createElement("span");f.className="count",f.textContent="0",l.append(u,d,f),this.control.append(l),this.#n.set(a,{button:l,count:f}),l.addEventListener("click",()=>{let p=this.#r.matches(":popover-open");if(p&&this.#o===a){this.#r.hidePopover();return}this.#o=a,this.#d(),p||this.#r.showPopover(),this.#f(),ft(this.#r,l,{align:"end"})})}this.#r=e.createElement("section"),this.#r.id="editing-report",this.#r.className="report",this.#r.setAttribute("popover","auto"),this.#r.setAttribute("role","dialog"),this.#r.setAttribute("aria-labelledby","report-title");let n=e.createElement("header");this.#a=e.createElement("strong"),this.#a.id="report-title";let i=e.createElement("button");i.type="button",i.textContent="\xD7",i.setAttribute("aria-label","Close report"),i.addEventListener("click",()=>this.#r.hidePopover()),n.append(this.#a,i),this.#i=e.createElement("ul"),this.#s=e.createElement("p"),this.#s.className="notice",this.#s.setAttribute("role","status"),this.#r.append(n,this.#i,this.#s),this.shadowRoot.append(this.#r),this.#r.addEventListener("toggle",()=>this.#f())}setSourceContext(e){if(this.#t?.(),this.#t=null,this.#e=e.sourceNode.formState,!this.#e)throw new Error("editingStatus requires a shared editing session.");this.#u()}connectedCallback(){this.#u()}disconnectedCallback(){this.#t?.(),this.#t=null,this.#r.matches(":popover-open")&&this.#r.hidePopover()}#u(){!this.#e||this.#t||!this.isConnected||(this.#t=this.#e.subscribe(()=>this.#c()),this.#c())}#f(){let e=this.#r.matches(":popover-open");for(let[r,{button:n}]of this.#n)n.setAttribute("aria-expanded",String(e&&r===this.#o))}#c(){this.#n.get("errors").count.textContent=String(this.#e.errorEntries.length),this.#n.get("changes").count.textContent=String(this.#e.changeEntries.length),this.#n.get("errors").button.classList.toggle("invalid",this.#e.errorEntries.length>0),this.#r.matches(":popover-open")&&this.#d()}#l(e,r){return r?e==null?"\u2205":e instanceof kp?`${e.length} fields`:e instanceof Date?e.toLocaleString():String(e):"Not present"}#d(){let e=this.#o==="errors",r=e?this.#e.errorEntries:this.#e.changeEntries;this.#a.textContent=e?"Validation errors":"Unsaved changes",this.#s.textContent=r.length?"Select an entry to return to its field.":e?"No validation errors.":"No changes since the accepted snapshot.";let n=this.shadowRoot.activeElement?.dataset.path;this.#i.replaceChildren();for(let i of r){let a=this.ownerDocument,s=a.createElement("li"),o=a.createElement("button");o.type="button",o.dataset.path=i.path;let l=a.createElement("span");l.className="field",l.textContent=i.path.slice(this.#e.path?this.#e.path.length+1:0);let u=a.createElement("span");if(u.className="detail",e)u.textContent=i.message;else{let c=a.createElement("span");c.className="previous",c.textContent=this.#l(i.previous,i.existed);let d=a.createElement("span");d.className="arrow",d.textContent="\u2192";let f=a.createElement("span");f.className="current",f.textContent=this.#l(i.current,i.exists),u.append(c,d,f)}o.append(l,u),s.append(o),this.#i.append(s),o.addEventListener("click",()=>{this.#e.focusField(i.path)?this.#r.hidePopover():this.#s.textContent="This field is not visible. Check the grid filter or whether the row still exists."}),i.path===n&&o.focus({preventScroll:!0})}}}});function Kn(t,e=","){if(typeof e!="string"||!e)throw new TypeError("separator must be a nonempty string");if(t==="")return[];let r=new Set;return t.split(e).map(n=>{let i=n.indexOf(":"),a=i<0?n:n.slice(0,i),s=i<0?n:n.slice(i+1);if(!a||r.has(a))throw new Error("Invalid or duplicate choice code");return r.add(a),{id:a,caption:s}})}function Qn(t){return class extends t{constructor(){super();let e=this.attachShadow({mode:"open"}),r=this.ownerDocument.createElement("style");r.textContent=`:host{display:inline-block;font:inherit} *,*::before,*::after{box-sizing:border-box}
49
49
  input,textarea{font:inherit;max-width:100%} .control-box{min-width:0;color:var(--gramlot-ink,CanvasText)}
50
50
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),textarea{
51
51
  appearance:none;box-sizing:border-box;width:100%;border:1px solid var(--gramlot-border-control,#7a8798);
@@ -61,7 +61,7 @@ li button{display:block;width:100%;text-align:start;padding:.55rem .35rem}
61
61
  input[type=range],input[type=color],button{min-width:var(--gramlot-touch-target,0px);min-height:var(--gramlot-touch-target,0px)}
62
62
  input[type=checkbox],input[type=radio]{min-width:calc(var(--gramlot-touch-target,0px) / 2);min-height:calc(var(--gramlot-touch-target,0px) / 2)}
63
63
  .options{display:grid;gap:.3em .8em} .option{display:flex;align-items:center;gap:.35em;min-width:var(--gramlot-touch-target,0px);min-height:var(--gramlot-touch-target,0px)}
64
- .caption:empty{display:none}`,this.controlBox=this.ownerDocument.createElement("div"),this.controlBox.className="control-box",e.append(r,this.controlBox)}projectAttributes(e){return an(this,e)}setPageContext(e){this.pageContext=e}connectedCallback(){}releaseControl(){}get liveWrites(){return this.control.localName==="textarea"||["text","password","range","color"].includes(this.control.type)}validateCandidate(e,r){return r(e),{ok:!0,value:e,isCurrent:()=>this.pageContext.isActive()}}finishValidation(){}validationValueCheck(){let e=this.constructor.gramlotComponent.parameters.value.nullable;return(r,n)=>{if(r==null&&!e)throw new TypeError("This component requires a non-null value.");if(r!=null&&n!=null&&typeof r!=typeof n)throw new TypeError("Validation must preserve the component value type.")}}validationSelection(){return()=>{throw new TypeError("validate_select requires a constrained choice editor.")}}validateSelection(e){return this.validationSelection()(e)}shouldProjectControlValue(){return!0}acceptControlValue(){let e=this.readControlValue();return this.validateCandidate(e,r=>{this.validationValueCheck()(r,e),this.sameControlValue(e,r)||this.writeControlValue(r)})}restoreFormDraft(e){this.control.value=e}restoreFormValue(e){this.writeControlValue(e)}sameControlValue(e,r){return Object.is(e,r)}focus(e){this.control.focus(e)}}}function pe(t){return class extends Qn(t){constructor(){super(),this.control=this.createControl(),(this.control.localName==="textarea"||this.control.localName==="input"&&["text","password"].includes(this.control.type))&&(this.control.setAttribute("autocomplete","off"),this.control.setAttribute("autocorrect","off"),this.control.setAttribute("autocapitalize","off"),this.control.setAttribute("spellcheck","false")),this.control.id="control";let e=this.ownerDocument.createElement("label");e.className="option",this.optionCaption=this.ownerDocument.createElement("span"),this.optionCaption.className="caption",e.append(this.control,this.optionCaption),this.controlBox.append(e)}projectAttributes(e,r){let n=super.projectAttributes(e,r),{disabled:i,readonly:a}=this.parameters;this.control.disabled=!!i,this.control.readOnly=!!a;for(let[s,o]of Object.entries(this.constructor.gramlotComponent.parameters)){if(o.target==="control"){let l=this.parameters[s]??"";String(this.control[s])!==String(l)&&(this.control[s]=l)}o.target==="optionCaption"&&(this.optionCaption.textContent=this.parameters[s]??"")}return n}}}pe.parameters={disabled:{dtype:"B",default:!1,binding:"read"},readonly:{dtype:"B",default:!1,binding:"read"},live:{dtype:"B",default:!1,binding:"read"}};function ei(t){return class extends Qn(t){#e=new Map;#t;#n=null;constructor(){super(),this.control=this.ownerDocument.createElement("div"),this.control.className="options",this.control.id="control",this.control.setAttribute("role",this.multiple?"group":"radiogroup"),this.controlBox.append(this.control),this.control.addEventListener("keydown",e=>{if(!this.multiple||!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Home","End"].includes(e.key))return;let r=[...this.control.querySelectorAll("input:not(:disabled)")],n=r.indexOf(e.target);if(n<0)return;e.preventDefault();let i=e.key==="Home"?0:e.key==="End"?r.length-1:Math.max(0,Math.min(r.length-1,n+(["ArrowDown","ArrowRight"].includes(e.key)?1:-1)));r[i].focus()})}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.parameters.values??"";if(i!==this.#t){let s=Kn(i),o=new Set,l=null;for(let{id:u,caption:c}of s){let d=this.#e.get(u);if(!d){let p=this.ownerDocument.createElement("label");p.className="option";let h=this.ownerDocument.createElement("input");h.type=this.choiceType,h.name="choice",h.value=u;let m=this.ownerDocument.createElement("span");p.append(h,m),d={label:p,input:h,text:m},this.#e.set(u,d)}d.text.textContent=c;let f=l?l.nextSibling:this.control.firstChild;f!==d.label&&this.control.insertBefore(d.label,f),l=d.label,o.add(u)}for(let[u,c]of this.#e)o.has(u)||(c.label.remove(),this.#e.delete(u));this.#t=i}let a=this.parameters.cols;if(!Number.isInteger(a)||a<1)throw new TypeError("cols must be a positive integer");this.control.style.gridTemplateColumns=`repeat(${a}, minmax(0, 1fr))`,this.control.disabled=!!this.parameters.disabled,this.control.readOnly=!!this.parameters.readonly;for(let{input:s}of this.#e.values())s.disabled=this.control.disabled||this.control.readOnly;return n}readControlValue(){if(this.multiple){let r=(this.#n?this.#n.split(","):[]).filter(n=>!this.#e.has(n)||this.#e.get(n).input.checked);for(let[n,{input:i}]of this.#e)i.checked&&!r.includes(n)&&r.push(n);return r.join(",")||null}for(let[e,{input:r}]of this.#e)if(r.checked)return e;return null}writeControlValue(e){this.#n=e;let r=this.multiple?new Set(e?e.split(","):[]):null;for(let[n,{input:i}]of this.#e)i.checked=this.multiple?r.has(n):n===e}acceptControlValue(){let e=this.readControlValue();return this.validateCandidate(e,r=>this.writeControlValue(r))}focus(e){let r=[...this.#e.values()];(r.find(({input:n})=>n.checked&&!n.disabled)??r.find(({input:n})=>!n.disabled))?.input.focus(e)}}}ei.parameters={disabled:{dtype:"B",default:!1,binding:"read"},readonly:{dtype:"B",default:!1,binding:"read"}};var gl=["TL","TC","TR","L","R","BL","BC","BR"];function G(t){return class extends t{setLabelbox(e){let{box:r,labelBox:n,fieldLabel:i}=e;Object.assign(this,{box:r,labelBox:n,fieldLabel:i}),i.addEventListener("click",()=>{this.control.focus(),this.control.localName==="input"&&["checkbox","radio"].includes(this.control.type)&&this.control.click()})}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.parameters.lbl??"";return i?this.control.setAttribute("aria-label",i):this.control.removeAttribute("aria-label"),n}}}G.labelbox=!0;G.parameters={lbl:{dtype:"T",qualification:"intl_str",nullable:!0,binding:"read"},lbl_position:{dtype:"T",default:"TL",binding:"read",enum:gl}};function Tt(t,e){return e===2?t%4===0&&(t%100!==0||t%400===0)?29:28:[4,6,9,11].includes(e)?30:31}function ke(t,e,r){if(![t,e,r].every(Number.isInteger)||t<1||t>9999||e<1||e>12||r<1||r>Tt(t,e))throw new RangeError("Date must exist in Gregorian years 0001\u20139999.");return`${String(t).padStart(4,"0")}-${String(e).padStart(2,"0")}-${String(r).padStart(2,"0")}`}function Ct(t){if(typeof t!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(t))throw new RangeError("Expected a civil date in YYYY-MM-DD format.");let e=t.split("-").map(Number);return ke(...e),e}function Wr(t,e,r){let n=t-1,i=365*n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400)+r-1;for(let a=1;a<e;a++)i+=Tt(t,a);return i}function Gr(t,e){let r=Wr(...Ct(t))+e;if(!Number.isSafeInteger(r)||r<0||r>Wr(9999,12,31))throw new RangeError("Date offset exceeds Gregorian years 0001\u20139999.");let n=1,i=1e4;for(;i-n>1;){let s=Math.floor((n+i)/2);Wr(s,1,1)<=r?n=s:i=s}r-=Wr(n,1,1);let a=1;for(;r>=Tt(n,a);)r-=Tt(n,a++);return ke(n,a,r+1)}function ya(t){return Gr(t,-(Wr(...Ct(t))%7))}function bl(t,e,r=0,n=1){let i=t*12+e-1+r,a=Math.floor(i/12),s=(i%12+12)%12+1,o=i+n-1,l=Math.floor(o/12),u=(o%12+12)%12+1;return{start:ke(a,s,1),end:ke(l,u,Tt(l,u))}}var ti={en:{months:{january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12,jan:1,feb:2,mar:3,apr:4,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},weekdays:{monday:0,tuesday:1,wednesday:2,thursday:3,friday:4,saturday:5,sunday:6,mon:0,tue:1,wed:2,thu:3,fri:4,sat:5,sun:6},quarters:{"1st quarter":1,"2nd quarter":2,"3rd quarter":3,"4th quarter":4,q1:1,q2:2,q3:3,q4:4},keywords:{today:["today"],yesterday:["yesterday"],tomorrow:["tomorrow"],this_week:["this week","week"],last_week:["last week"],next_week:["next week"],this_month:["this month","month"],last_month:["last month"],next_month:["next month"],last:["last"],next:["next"],articles:["the"],from:["from","between"],to:["to","and"],no_period:["no period","always"]},date_order:{default:"MDY",GB:"DMY",AU:"DMY",IE:"DMY",NZ:"DMY",IN:"DMY"}},it:{months:{gennaio:1,febbraio:2,marzo:3,aprile:4,maggio:5,giugno:6,luglio:7,agosto:8,settembre:9,ottobre:10,novembre:11,dicembre:12,gen:1,feb:2,mar:3,apr:4,mag:5,giu:6,lug:7,ago:8,set:9,ott:10,nov:11,dic:12},weekdays:{luned\u00EC:0,marted\u00EC:1,mercoled\u00EC:2,gioved\u00EC:3,venerd\u00EC:4,sabato:5,domenica:6,lun:0,mar:1,mer:2,gio:3,ven:4,sab:5,dom:6},quarters:{"1\xBA trimestre":1,"2\xBA trimestre":2,"3\xBA trimestre":3,"4\xBA trimestre":4,"1\xB0 trimestre":1,"2\xB0 trimestre":2,"3\xB0 trimestre":3,"4\xB0 trimestre":4,t1:1,t2:2,t3:3,t4:4,q1:1,q2:2,q3:3,q4:4},keywords:{today:["oggi"],yesterday:["ieri"],tomorrow:["domani"],this_week:["questa settimana","settimana"],last_week:["settimana scorsa"],next_week:["settimana prossima"],this_month:["questo mese","mese"],last_month:["mese scorso"],next_month:["mese prossimo"],last:["scorso","scorsa"],next:["prossimo","prossima"],articles:["il","lo","la"],from:["da","dal","dalla","tra","fra"],to:["a","al","alla","e"],no_period:["-","senza periodo","sempre"]},date_order:{default:"DMY"}}};function _l(t){if(typeof t!="string")throw new RangeError("A supported locale is required.");let e=t.replaceAll("-","_"),r=e.indexOf("_"),n=(r<0?e:e.slice(0,r)).toLowerCase(),i=(r<0?"":e.slice(r+1)).toUpperCase();if(!Object.hasOwn(ti,n))throw new RangeError(`Unsupported locale: ${t}`);let a=ti[n];return{dictionary:a,phrases:o=>[...new Set([...a.keywords[o],...ti.en.keywords[o]])],order:a.date_order[i]??a.date_order.default}}var Nt=/^(?:\d{4}|\d{2})$/,wl=/^\d{1,2}$/,Yr=(t,e)=>({ok:!1,error:{code:t,message:e}}),Ot=(t="UNRECOGNIZED_EXPRESSION",e="Text is not a supported date expression.")=>{throw Object.assign(new SyntaxError(e),{code:t})},kl=(t,e)=>Object.hasOwn(t,e);function St(t,e){if(t.length===4)return Number(t);let r=e.year+e.twoDigitYearAhead-100;return r+((Number(t)-r)%100+100)%100}function vp(t,e){if(t.includes(";")){let i=t.split(";").map(a=>a.trim());return i.length!==2?Ot("INVALID_RANGE","A range must have exactly two endpoints."):{bounds:i,range:!0}}if(e.phrases("no_period").includes(t))return{bounds:["",""],range:!0};let r=e.phrases("to"),n=e.phrases("from");for(let i of r)if(t.startsWith(`${i} `))return{bounds:["",t.slice(i.length+1).trim()],range:!0};for(let i of r){let a=` ${i} `;if(!t.includes(a))continue;for(let o of n)if(t.startsWith(`${o} `)){t=t.slice(o.length+1);break}let s=t.split(a).map(o=>o.trim());return s.length!==2?Ot("INVALID_RANGE","A range must have exactly two endpoints."):{bounds:s,range:!0}}for(let i of n)if(t.startsWith(`${i} `))return{bounds:[t.slice(i.length+1).trim(),""],range:!0};return{bounds:[t,t],range:!1}}function kp(t,e,r){let n=[[t,0]],i=/^(.+?)\s*([+-])\s*(\d+)$/.exec(t);i&&n.push([i[1],Number(i[2]+i[3])]);let a={today:0,yesterday:-1,tomorrow:1,this_week:0,last_week:-1,next_week:1,this_month:0,last_month:-1,next_month:1};for(let[s,o]of n)for(let[l,u]of Object.entries(a))if(e.phrases(l).includes(s)){if(l.endsWith("_week"))return Gr(ya(e.workdate),(u+o)*7+(r?6:0));if(l.endsWith("_month")){let c=bl(e.year,e.month,u+o);return r?c.end:c.start}return Gr(e.workdate,u+o)}return null}function Ep(t,e,r){let n=Object.entries(e.dictionary.quarters).sort((i,a)=>a[0].length-i[0].length);for(let[i,a]of n){let s;if(t===i)s=null;else if(t.startsWith(i)&&Nt.test(t.slice(i.length).trim()))s=St(t.slice(i.length).trim(),e);else if(t.endsWith(i)&&Nt.test(t.slice(0,-i.length).trim()))s=St(t.slice(0,-i.length).trim(),e);else continue;return{year:s,month:r?a*3:a*3-2}}return null}function yl(t,e){if(kl(e.months,t))return e.months[t];let r=/^m(\d{1,2})$/.exec(t);return r&&Number(r[1])>=1&&Number(r[1])<=12?Number(r[1]):null}function xp(t,e){let r=t.split(/\s+/),n=r.map((u,c)=>yl(u,e.dictionary)?c:-1).filter(u=>u>=0);if(!n.length)return null;if(n.length!==1)return Ot();let i=n[0],a=yl(r[i],e.dictionary),s=r.slice(0,i),o=r.slice(i+1),l=[...s,...o];if(l.length===1&&e.phrases("last").includes(l[0]))return{year:e.year-(a>e.month?1:0),month:a};if(l.length===1&&e.phrases("next").includes(l[0]))return{year:e.year+(a<e.month?1:0),month:a};if(!l.length)return{year:null,month:a};if(!s.length&&o.length===1&&Nt.test(o[0]))return{year:St(o[0],e),month:a};if(s.length===1&&wl.test(s[0])){if(!o.length)return ke(e.year,a,Number(s[0]));if(o.length===1&&Nt.test(o[0]))return ke(St(o[0],e),a,Number(s[0]))}return!s.length&&o.length===2&&wl.test(o[0])&&Nt.test(o[1])?ke(St(o[1],e),a,Number(o[0])):Ot()}function Dp(t,e){let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(r)return ke(...r.slice(1).map(Number));let n=/^(\d{1,4})[/\-. ]+(\d{1,4})[/\-. ]+(\d{1,4})$/.exec(t),i={};if(n)e.order.split("").forEach((o,l)=>{i[o]=n[l+1]});else if(/^(?:\d{6}|\d{8})$/.test(t)){let o=t.length===8?4:2;for(let l of e.order){let u=l==="Y"?o:2;i[l]=t.slice(0,u),t=t.slice(u)}}else return null;if(!Nt.test(i.Y)||i.D.length>2||i.M.length>2)return Ot();let a=Number(i.D),s=Number(i.M);return n&&s>12&&a<=12&&([a,s]=[s,a]),ke(St(i.Y,e),s,a)}function vl(t,e,r){if(!t)return null;let n=e.phrases("articles");if(t=t.split(/\s+/).filter(a=>!n.includes(a)).join(" "),!t)return Ot();if(Nt.test(t))return ke(St(t,e),r?12:1,r?31:1);let i=kp(t,e,r)??Ep(t,e,r)??xp(t,e);return i!==null?i:kl(e.dictionary.weekdays,t)?Gr(ya(e.workdate),e.dictionary.weekdays[t]):Dp(t,e)??Ot()}function Ap(t,e,r){if(t===null||typeof t=="string")return t;let n=t.year??r.year,i=typeof e=="string"?Ct(e)[0]:e?.year,a=typeof e=="string"?Ct(e)[1]:e?.month;return i&&(n>i&&(n=i),n===i&&t.month>a&&n--),ke(n,t.month,1)}function Tp(t,e,r){if(t===null||typeof t=="string")return t;let n=t.year??r.year;if(e!==null){let[i,a]=Ct(e);n<i&&(n=i),n===i&&a>t.month&&n++}return ke(n,t.month,Tt(n,t.month))}function va(t,e={}){if(!e||typeof e!="object"||Array.isArray(e))return Yr("INVALID_CONTEXT","Options must provide a civil workdate and supported locale.");let r;try{let{locale:n="it-IT",workdate:i,twoDigitYearAhead:a=20}=e,[s,o]=Ct(i);if(!Number.isInteger(a)||a<0||a>99)throw new RangeError("twoDigitYearAhead must be an integer from 0 to 99.");r={..._l(n),workdate:i,year:s,month:o,twoDigitYearAhead:a}}catch(n){return Yr("INVALID_CONTEXT",n.message)}if(typeof t!="string")return Yr("INVALID_INPUT","Expression must be a string.");try{let n=t.toLowerCase().trim().replaceAll(",",""),{bounds:i,range:a}=vp(n,r),s=vl(i[1],r,!0),o=vl(i[0],r,!1),l=Ap(o,s,r),u=Tp(s,l,r);return!a&&typeof o=="string"&&l===u?{ok:!0,kind:"date",date:l}:{ok:!0,kind:"period",start:l,end:u}}catch(n){if(n instanceof RangeError)return Yr("INVALID_DATE",n.message);if(n instanceof SyntaxError)return Yr(n.code,n.message);throw n}}function qe(t,e,r){let n=new Date(0);return n.setUTCFullYear(t,e,r),n}function Zr(t){if(t!==null&&(!(t instanceof Date)||!Number.isFinite(t.getTime())||t.getUTCHours()||t.getUTCMinutes()||t.getUTCSeconds()||t.getUTCMilliseconds()))throw new TypeError("Expected a civil Date at UTC midnight")}var ri=(t,e)=>t===e||t instanceof Date&&e instanceof Date&&t.getTime()===e.getTime(),Cp=t=>t.toISOString().slice(0,10),Xr=class{constructor(e,r){this.container=e,this.select=r,this.value=null;let n=e.ownerDocument,i=n.createElement("style");i.textContent=`.calendar{width:var(--gramlot-calendar-width,18em);max-width:100%;font:inherit;color:inherit}
64
+ .caption:empty{display:none}`,this.controlBox=this.ownerDocument.createElement("div"),this.controlBox.className="control-box",e.append(r,this.controlBox)}projectAttributes(e){return an(this,e)}setPageContext(e){this.pageContext=e}connectedCallback(){}releaseControl(){}get liveWrites(){return this.control.localName==="textarea"||["text","password","range","color"].includes(this.control.type)}validateCandidate(e,r){return r(e),{ok:!0,value:e,isCurrent:()=>this.pageContext.isActive()}}finishValidation(){}validationValueCheck(){return this.constructor.validationValueCheck(this.pageContext)}static validationValueCheck(){let e=this.gramlotComponent.parameters.value.nullable;return(r,n)=>{if(r==null&&!e)throw new TypeError("This component requires a non-null value.");if(r!=null&&n!=null&&typeof r!=typeof n)throw new TypeError("Validation must preserve the component value type.")}}validationSelection(){return this.constructor.validationSelection(this.parameters,this.pageContext)}static validationSelection(){return()=>{throw new TypeError("validate_select requires a constrained choice editor.")}}validateSelection(e){return this.validationSelection()(e)}shouldProjectControlValue(){return!0}acceptControlValue(){let e=this.readControlValue();return this.validateCandidate(e,r=>{this.validationValueCheck()(r,e),this.sameControlValue(e,r)||this.writeControlValue(r)})}restoreFormDraft(e){this.control.value=e}restoreFormValue(e){this.writeControlValue(e)}sameControlValue(e,r){return Object.is(e,r)}focus(e){this.control.focus(e)}}}function pe(t){return class extends Qn(t){constructor(){super(),this.control=this.createControl(),(this.control.localName==="textarea"||this.control.localName==="input"&&["text","password"].includes(this.control.type))&&(this.control.setAttribute("autocomplete","off"),this.control.setAttribute("autocorrect","off"),this.control.setAttribute("autocapitalize","off"),this.control.setAttribute("spellcheck","false")),this.control.id="control";let e=this.ownerDocument.createElement("label");e.className="option",this.optionCaption=this.ownerDocument.createElement("span"),this.optionCaption.className="caption",e.append(this.control,this.optionCaption),this.controlBox.append(e)}projectAttributes(e,r){let n=super.projectAttributes(e,r),{disabled:i,readonly:a}=this.parameters;this.control.disabled=!!i,this.control.readOnly=!!a;for(let[s,o]of Object.entries(this.constructor.gramlotComponent.parameters)){if(o.target==="control"){let l=this.parameters[s]??"";String(this.control[s])!==String(l)&&(this.control[s]=l)}o.target==="optionCaption"&&(this.optionCaption.textContent=this.parameters[s]??"")}return n}}}pe.parameters={disabled:{dtype:"B",default:!1,binding:"read"},readonly:{dtype:"B",default:!1,binding:"read"},live:{dtype:"B",default:!1,binding:"read"}};function ei(t){return class extends Qn(t){#e=new Map;#t;#n=null;constructor(){super(),this.control=this.ownerDocument.createElement("div"),this.control.className="options",this.control.id="control",this.control.setAttribute("role",this.multiple?"group":"radiogroup"),this.controlBox.append(this.control),this.control.addEventListener("keydown",e=>{if(!this.multiple||!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Home","End"].includes(e.key))return;let r=[...this.control.querySelectorAll("input:not(:disabled)")],n=r.indexOf(e.target);if(n<0)return;e.preventDefault();let i=e.key==="Home"?0:e.key==="End"?r.length-1:Math.max(0,Math.min(r.length-1,n+(["ArrowDown","ArrowRight"].includes(e.key)?1:-1)));r[i].focus()})}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.parameters.values??"";if(i!==this.#t){let s=Kn(i),o=new Set,l=null;for(let{id:u,caption:c}of s){let d=this.#e.get(u);if(!d){let p=this.ownerDocument.createElement("label");p.className="option";let h=this.ownerDocument.createElement("input");h.type=this.choiceType,h.name="choice",h.value=u;let m=this.ownerDocument.createElement("span");p.append(h,m),d={label:p,input:h,text:m},this.#e.set(u,d)}d.text.textContent=c;let f=l?l.nextSibling:this.control.firstChild;f!==d.label&&this.control.insertBefore(d.label,f),l=d.label,o.add(u)}for(let[u,c]of this.#e)o.has(u)||(c.label.remove(),this.#e.delete(u));this.#t=i}let a=this.parameters.cols;if(!Number.isInteger(a)||a<1)throw new TypeError("cols must be a positive integer");this.control.style.gridTemplateColumns=`repeat(${a}, minmax(0, 1fr))`,this.control.disabled=!!this.parameters.disabled,this.control.readOnly=!!this.parameters.readonly;for(let{input:s}of this.#e.values())s.disabled=this.control.disabled||this.control.readOnly;return n}readControlValue(){if(this.multiple){let r=(this.#n?this.#n.split(","):[]).filter(n=>!this.#e.has(n)||this.#e.get(n).input.checked);for(let[n,{input:i}]of this.#e)i.checked&&!r.includes(n)&&r.push(n);return r.join(",")||null}for(let[e,{input:r}]of this.#e)if(r.checked)return e;return null}writeControlValue(e){this.#n=e;let r=this.multiple?new Set(e?e.split(","):[]):null;for(let[n,{input:i}]of this.#e)i.checked=this.multiple?r.has(n):n===e}acceptControlValue(){let e=this.readControlValue();return this.validateCandidate(e,r=>this.writeControlValue(r))}focus(e){let r=[...this.#e.values()];(r.find(({input:n})=>n.checked&&!n.disabled)??r.find(({input:n})=>!n.disabled))?.input.focus(e)}}}ei.parameters={disabled:{dtype:"B",default:!1,binding:"read"},readonly:{dtype:"B",default:!1,binding:"read"}};var bl=["TL","TC","TR","L","R","BL","BC","BR"];function G(t){return class extends t{setLabelbox(e){let{box:r,labelBox:n,fieldLabel:i}=e;Object.assign(this,{box:r,labelBox:n,fieldLabel:i}),i.addEventListener("click",()=>{this.control.focus(),this.control.localName==="input"&&["checkbox","radio"].includes(this.control.type)&&this.control.click()})}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.parameters.lbl??"";return i?this.control.setAttribute("aria-label",i):this.control.removeAttribute("aria-label"),n}}}G.labelbox=!0;G.parameters={lbl:{dtype:"T",qualification:"intl_str",nullable:!0,binding:"read"},lbl_position:{dtype:"T",default:"TL",binding:"read",enum:bl}};function Tt(t,e){return e===2?t%4===0&&(t%100!==0||t%400===0)?29:28:[4,6,9,11].includes(e)?30:31}function ke(t,e,r){if(![t,e,r].every(Number.isInteger)||t<1||t>9999||e<1||e>12||r<1||r>Tt(t,e))throw new RangeError("Date must exist in Gregorian years 0001\u20139999.");return`${String(t).padStart(4,"0")}-${String(e).padStart(2,"0")}-${String(r).padStart(2,"0")}`}function Ct(t){if(typeof t!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(t))throw new RangeError("Expected a civil date in YYYY-MM-DD format.");let e=t.split("-").map(Number);return ke(...e),e}function Wr(t,e,r){let n=t-1,i=365*n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400)+r-1;for(let a=1;a<e;a++)i+=Tt(t,a);return i}function Gr(t,e){let r=Wr(...Ct(t))+e;if(!Number.isSafeInteger(r)||r<0||r>Wr(9999,12,31))throw new RangeError("Date offset exceeds Gregorian years 0001\u20139999.");let n=1,i=1e4;for(;i-n>1;){let s=Math.floor((n+i)/2);Wr(s,1,1)<=r?n=s:i=s}r-=Wr(n,1,1);let a=1;for(;r>=Tt(n,a);)r-=Tt(n,a++);return ke(n,a,r+1)}function va(t){return Gr(t,-(Wr(...Ct(t))%7))}function _l(t,e,r=0,n=1){let i=t*12+e-1+r,a=Math.floor(i/12),s=(i%12+12)%12+1,o=i+n-1,l=Math.floor(o/12),u=(o%12+12)%12+1;return{start:ke(a,s,1),end:ke(l,u,Tt(l,u))}}var ti={en:{months:{january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12,jan:1,feb:2,mar:3,apr:4,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},weekdays:{monday:0,tuesday:1,wednesday:2,thursday:3,friday:4,saturday:5,sunday:6,mon:0,tue:1,wed:2,thu:3,fri:4,sat:5,sun:6},quarters:{"1st quarter":1,"2nd quarter":2,"3rd quarter":3,"4th quarter":4,q1:1,q2:2,q3:3,q4:4},keywords:{today:["today"],yesterday:["yesterday"],tomorrow:["tomorrow"],this_week:["this week","week"],last_week:["last week"],next_week:["next week"],this_month:["this month","month"],last_month:["last month"],next_month:["next month"],last:["last"],next:["next"],articles:["the"],from:["from","between"],to:["to","and"],no_period:["no period","always"]},date_order:{default:"MDY",GB:"DMY",AU:"DMY",IE:"DMY",NZ:"DMY",IN:"DMY"}},it:{months:{gennaio:1,febbraio:2,marzo:3,aprile:4,maggio:5,giugno:6,luglio:7,agosto:8,settembre:9,ottobre:10,novembre:11,dicembre:12,gen:1,feb:2,mar:3,apr:4,mag:5,giu:6,lug:7,ago:8,set:9,ott:10,nov:11,dic:12},weekdays:{luned\u00EC:0,marted\u00EC:1,mercoled\u00EC:2,gioved\u00EC:3,venerd\u00EC:4,sabato:5,domenica:6,lun:0,mar:1,mer:2,gio:3,ven:4,sab:5,dom:6},quarters:{"1\xBA trimestre":1,"2\xBA trimestre":2,"3\xBA trimestre":3,"4\xBA trimestre":4,"1\xB0 trimestre":1,"2\xB0 trimestre":2,"3\xB0 trimestre":3,"4\xB0 trimestre":4,t1:1,t2:2,t3:3,t4:4,q1:1,q2:2,q3:3,q4:4},keywords:{today:["oggi"],yesterday:["ieri"],tomorrow:["domani"],this_week:["questa settimana","settimana"],last_week:["settimana scorsa"],next_week:["settimana prossima"],this_month:["questo mese","mese"],last_month:["mese scorso"],next_month:["mese prossimo"],last:["scorso","scorsa"],next:["prossimo","prossima"],articles:["il","lo","la"],from:["da","dal","dalla","tra","fra"],to:["a","al","alla","e"],no_period:["-","senza periodo","sempre"]},date_order:{default:"DMY"}}};function wl(t){if(typeof t!="string")throw new RangeError("A supported locale is required.");let e=t.replaceAll("-","_"),r=e.indexOf("_"),n=(r<0?e:e.slice(0,r)).toLowerCase(),i=(r<0?"":e.slice(r+1)).toUpperCase();if(!Object.hasOwn(ti,n))throw new RangeError(`Unsupported locale: ${t}`);let a=ti[n];return{dictionary:a,phrases:o=>[...new Set([...a.keywords[o],...ti.en.keywords[o]])],order:a.date_order[i]??a.date_order.default}}var Nt=/^(?:\d{4}|\d{2})$/,yl=/^\d{1,2}$/,Yr=(t,e)=>({ok:!1,error:{code:t,message:e}}),Ot=(t="UNRECOGNIZED_EXPRESSION",e="Text is not a supported date expression.")=>{throw Object.assign(new SyntaxError(e),{code:t})},El=(t,e)=>Object.hasOwn(t,e);function St(t,e){if(t.length===4)return Number(t);let r=e.year+e.twoDigitYearAhead-100;return r+((Number(t)-r)%100+100)%100}function Ep(t,e){if(t.includes(";")){let i=t.split(";").map(a=>a.trim());return i.length!==2?Ot("INVALID_RANGE","A range must have exactly two endpoints."):{bounds:i,range:!0}}if(e.phrases("no_period").includes(t))return{bounds:["",""],range:!0};let r=e.phrases("to"),n=e.phrases("from");for(let i of r)if(t.startsWith(`${i} `))return{bounds:["",t.slice(i.length+1).trim()],range:!0};for(let i of r){let a=` ${i} `;if(!t.includes(a))continue;for(let o of n)if(t.startsWith(`${o} `)){t=t.slice(o.length+1);break}let s=t.split(a).map(o=>o.trim());return s.length!==2?Ot("INVALID_RANGE","A range must have exactly two endpoints."):{bounds:s,range:!0}}for(let i of n)if(t.startsWith(`${i} `))return{bounds:[t.slice(i.length+1).trim(),""],range:!0};return{bounds:[t,t],range:!1}}function xp(t,e,r){let n=[[t,0]],i=/^(.+?)\s*([+-])\s*(\d+)$/.exec(t);i&&n.push([i[1],Number(i[2]+i[3])]);let a={today:0,yesterday:-1,tomorrow:1,this_week:0,last_week:-1,next_week:1,this_month:0,last_month:-1,next_month:1};for(let[s,o]of n)for(let[l,u]of Object.entries(a))if(e.phrases(l).includes(s)){if(l.endsWith("_week"))return Gr(va(e.workdate),(u+o)*7+(r?6:0));if(l.endsWith("_month")){let c=_l(e.year,e.month,u+o);return r?c.end:c.start}return Gr(e.workdate,u+o)}return null}function Dp(t,e,r){let n=Object.entries(e.dictionary.quarters).sort((i,a)=>a[0].length-i[0].length);for(let[i,a]of n){let s;if(t===i)s=null;else if(t.startsWith(i)&&Nt.test(t.slice(i.length).trim()))s=St(t.slice(i.length).trim(),e);else if(t.endsWith(i)&&Nt.test(t.slice(0,-i.length).trim()))s=St(t.slice(0,-i.length).trim(),e);else continue;return{year:s,month:r?a*3:a*3-2}}return null}function vl(t,e){if(El(e.months,t))return e.months[t];let r=/^m(\d{1,2})$/.exec(t);return r&&Number(r[1])>=1&&Number(r[1])<=12?Number(r[1]):null}function Ap(t,e){let r=t.split(/\s+/),n=r.map((u,c)=>vl(u,e.dictionary)?c:-1).filter(u=>u>=0);if(!n.length)return null;if(n.length!==1)return Ot();let i=n[0],a=vl(r[i],e.dictionary),s=r.slice(0,i),o=r.slice(i+1),l=[...s,...o];if(l.length===1&&e.phrases("last").includes(l[0]))return{year:e.year-(a>e.month?1:0),month:a};if(l.length===1&&e.phrases("next").includes(l[0]))return{year:e.year+(a<e.month?1:0),month:a};if(!l.length)return{year:null,month:a};if(!s.length&&o.length===1&&Nt.test(o[0]))return{year:St(o[0],e),month:a};if(s.length===1&&yl.test(s[0])){if(!o.length)return ke(e.year,a,Number(s[0]));if(o.length===1&&Nt.test(o[0]))return ke(St(o[0],e),a,Number(s[0]))}return!s.length&&o.length===2&&yl.test(o[0])&&Nt.test(o[1])?ke(St(o[1],e),a,Number(o[0])):Ot()}function Tp(t,e){let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(r)return ke(...r.slice(1).map(Number));let n=/^(\d{1,4})[/\-. ]+(\d{1,4})[/\-. ]+(\d{1,4})$/.exec(t),i={};if(n)e.order.split("").forEach((o,l)=>{i[o]=n[l+1]});else if(/^(?:\d{6}|\d{8})$/.test(t)){let o=t.length===8?4:2;for(let l of e.order){let u=l==="Y"?o:2;i[l]=t.slice(0,u),t=t.slice(u)}}else return null;if(!Nt.test(i.Y)||i.D.length>2||i.M.length>2)return Ot();let a=Number(i.D),s=Number(i.M);return n&&s>12&&a<=12&&([a,s]=[s,a]),ke(St(i.Y,e),s,a)}function kl(t,e,r){if(!t)return null;let n=e.phrases("articles");if(t=t.split(/\s+/).filter(a=>!n.includes(a)).join(" "),!t)return Ot();if(Nt.test(t))return ke(St(t,e),r?12:1,r?31:1);let i=xp(t,e,r)??Dp(t,e,r)??Ap(t,e);return i!==null?i:El(e.dictionary.weekdays,t)?Gr(va(e.workdate),e.dictionary.weekdays[t]):Tp(t,e)??Ot()}function Cp(t,e,r){if(t===null||typeof t=="string")return t;let n=t.year??r.year,i=typeof e=="string"?Ct(e)[0]:e?.year,a=typeof e=="string"?Ct(e)[1]:e?.month;return i&&(n>i&&(n=i),n===i&&t.month>a&&n--),ke(n,t.month,1)}function Np(t,e,r){if(t===null||typeof t=="string")return t;let n=t.year??r.year;if(e!==null){let[i,a]=Ct(e);n<i&&(n=i),n===i&&a>t.month&&n++}return ke(n,t.month,Tt(n,t.month))}function ka(t,e={}){if(!e||typeof e!="object"||Array.isArray(e))return Yr("INVALID_CONTEXT","Options must provide a civil workdate and supported locale.");let r;try{let{locale:n="it-IT",workdate:i,twoDigitYearAhead:a=20}=e,[s,o]=Ct(i);if(!Number.isInteger(a)||a<0||a>99)throw new RangeError("twoDigitYearAhead must be an integer from 0 to 99.");r={...wl(n),workdate:i,year:s,month:o,twoDigitYearAhead:a}}catch(n){return Yr("INVALID_CONTEXT",n.message)}if(typeof t!="string")return Yr("INVALID_INPUT","Expression must be a string.");try{let n=t.toLowerCase().trim().replaceAll(",",""),{bounds:i,range:a}=Ep(n,r),s=kl(i[1],r,!0),o=kl(i[0],r,!1),l=Cp(o,s,r),u=Np(s,l,r);return!a&&typeof o=="string"&&l===u?{ok:!0,kind:"date",date:l}:{ok:!0,kind:"period",start:l,end:u}}catch(n){if(n instanceof RangeError)return Yr("INVALID_DATE",n.message);if(n instanceof SyntaxError)return Yr(n.code,n.message);throw n}}function qe(t,e,r){let n=new Date(0);return n.setUTCFullYear(t,e,r),n}function Zr(t){if(t!==null&&(!(t instanceof Date)||!Number.isFinite(t.getTime())||t.getUTCHours()||t.getUTCMinutes()||t.getUTCSeconds()||t.getUTCMilliseconds()))throw new TypeError("Expected a civil Date at UTC midnight")}var ri=(t,e)=>t===e||t instanceof Date&&e instanceof Date&&t.getTime()===e.getTime(),Sp=t=>t.toISOString().slice(0,10),Xr=class{constructor(e,r){this.container=e,this.select=r,this.value=null;let n=e.ownerDocument,i=n.createElement("style");i.textContent=`.calendar{width:var(--gramlot-calendar-width,18em);max-width:100%;font:inherit;color:inherit}
65
65
  .calendar button{min-height:var(--gramlot-touch-target,0px);font:inherit;color:inherit;border:1px solid transparent;border-radius:3px;background:transparent;cursor:pointer;padding:.25em}
66
66
  .calendar button:focus-visible{outline:2px solid var(--gramlot-focus-ring,#4369c5);outline-offset:-2px}
67
67
  .calendar button:disabled{opacity:.5;cursor:default}
@@ -71,22 +71,22 @@ li button{display:block;width:100%;text-align:start;padding:.55rem .35rem}
71
71
  .calendar-weekday{text-align:center;font-size:.85em;color:var(--gramlot-text-secondary,#64748b)}
72
72
  .calendar button[aria-pressed=true]{background:var(--gramlot-brand-blue,#4369c5);color:white}
73
73
  .calendar button[data-today=true]{border-color:var(--gramlot-brand-blue,#4369c5)}
74
- .calendar button:hover:not(:disabled){background:var(--gramlot-selected,#e5ebf7);color:var(--gramlot-ink,#203047)}`,e.classList.add("calendar"),this.header=n.createElement("div"),this.header.className="calendar-header",this.month=n.createElement("span"),this.month.className="calendar-month",this.month.setAttribute("aria-live","polite"),this.previous=this.button("\u2039","Previous month",()=>this.moveMonth(-1)),this.next=this.button("\u203A","Next month",()=>this.moveMonth(1)),this.header.append(this.previous,this.month,this.next),this.grid=n.createElement("div"),this.grid.className="calendar-grid",this.footer=n.createElement("div"),this.footer.className="calendar-footer",this.todayButton=this.button("Today","Today",()=>this.choose(this.today)),this.clearButton=this.button("Clear","Clear date",()=>this.choose(null)),this.footer.append(this.todayButton,this.clearButton),e.append(i,this.header,this.grid,this.footer),this.grid.addEventListener("keydown",a=>{if(this.locked||!a.target.dataset.date)return;let s={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};if(a.key in s)a.preventDefault(),this.active=qe(this.active.getUTCFullYear(),this.active.getUTCMonth(),this.active.getUTCDate()+s[a.key]);else if(a.key==="Home"||a.key==="End"){a.preventDefault();let o=(this.active.getUTCDay()+6)%7;this.active=qe(this.active.getUTCFullYear(),this.active.getUTCMonth(),this.active.getUTCDate()+(a.key==="Home"?-o:6-o))}else if(a.key==="PageUp"||a.key==="PageDown"){a.preventDefault(),this.moveMonth(a.key==="PageUp"?-1:1,!0);return}else return;this.render(),this.focusDay()})}button(e,r,n){let i=this.container.ownerDocument.createElement("button");return i.type="button",i.textContent=e,i.setAttribute("aria-label",r),i.addEventListener("click",n),i}configure({value:e,locale:r,workdate:n,locked:i=!1}){Zr(e);let a=new Date;this.today=n?qe(...n.split("-").map((o,l)=>Number(o)-(l===1?1:0))):qe(a.getFullYear(),a.getMonth(),a.getDate()),(!this.active||!ri(this.value,e))&&(this.active=e??this.today),this.value=e,this.locale=r,this.locked=i;let s=this.grid.contains(this.container.getRootNode().activeElement);this.render(),s&&!i&&this.focusDay()}choose(e){this.locked||(this.value=e,this.active=e??this.today,this.render(),this.focusDay(),this.select(e))}moveMonth(e,r=!1){if(this.locked)return;let n=this.active.getUTCFullYear(),i=this.active.getUTCMonth()+e;this.active=qe(n,i,Math.min(this.active.getUTCDate(),qe(n,i+1,0).getUTCDate())),this.render(),r&&this.focusDay()}render(){let e=this.active.getUTCFullYear(),r=this.active.getUTCMonth();this.month.textContent=new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric",timeZone:"UTC"}).format(this.active),this.grid.replaceChildren();let n=new Intl.DateTimeFormat(this.locale,{weekday:"short",timeZone:"UTC"});for(let s=0;s<7;s++){let o=this.container.ownerDocument.createElement("span");o.className="calendar-weekday",o.textContent=n.format(qe(2024,0,1+s)),this.grid.append(o)}let i=(qe(e,r,1).getUTCDay()+6)%7;for(let s=0;s<i;s++)this.grid.append(this.container.ownerDocument.createElement("span"));let a=new Intl.DateTimeFormat(this.locale,{dateStyle:"full",timeZone:"UTC"});for(let s=1;s<=qe(e,r+1,0).getUTCDate();s++){let o=qe(e,r,s),l=this.button(String(s),a.format(o),()=>this.choose(o));l.dataset.date=Cp(o),l.dataset.today=String(ri(o,this.today)),l.setAttribute("aria-pressed",String(ri(o,this.value))),l.disabled=this.locked,l.tabIndex=s===this.active.getUTCDate()?0:-1,this.grid.append(l)}for(let s of[this.previous,this.next,this.todayButton,this.clearButton])s.disabled=this.locked}focusDay(){this.grid.querySelector('button[tabindex="0"]')?.focus()}};function ka(t){return class extends Qn(t){#e=null;constructor(){super(),this.control=this.ownerDocument.createElement("div"),this.control.id="control",this.control.setAttribute("role","group"),this.controlBox.append(this.control),this.calendarView=new Xr(this.control,e=>{this.#e=e,this.control.dispatchEvent(new this.ownerDocument.defaultView.Event("change",{bubbles:!0}))})}get commitOnChange(){return!0}readControlValue(){return this.#e}sameControlValue(e,r){return ri(e,r)}writeControlValue(e){Zr(e),this.#e=e,this.syncCalendar()}projectAttributes(e,r){let n=super.projectAttributes(e,r);return this.control.disabled=!!this.parameters.disabled,this.control.readOnly=!!this.parameters.readonly,this.syncCalendar(),n}syncCalendar(){!this.pageContext||!this.parameters||this.calendarView.configure({value:this.#e,locale:this.parameters.locale??this.pageContext.locale,workdate:this.parameters.workdate,locked:this.control.disabled||this.control.readOnly})}focus(){this.calendarView.focusDay()}releaseControl(){this.calendarView.locked=!0}}}ka.parameters={value:{dtype:"D",nullable:!0,binding:"twoWay"},disabled:{dtype:"B",default:!1,binding:"read"},readonly:{dtype:"B",default:!1,binding:"read"},locale:{dtype:"T",nullable:!0,binding:"read"},workdate:{dtype:"T",nullable:!0,binding:"read"}};var Np=(t,e,r)=>t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():r(t)&&r(e)?t.eq(e):Object.is(t,e),Sp=t=>!["NaN","Infinity","-Infinity"].includes(t.toString()),Jr=t=>String(t).padStart(2,"0");function El(t){let e=new Intl.NumberFormat(t).formatToParts(-12345.6);return{decimal:e.find(r=>r.type==="decimal").value,group:e.find(r=>r.type==="group")?.value,minus:e.find(r=>r.type==="minusSign").value}}function Kr(t){return class extends pe(t){#e=null;#t=!1;#n=!1;#r=null;#a=null;#i=!1;constructor(){super(),this.control.addEventListener("focus",()=>{if(this.#n=!0,!this.#t){let e=this.control.selectionStart,r=this.control.selectionEnd,n=e===0&&r===this.control.value.length;this.#r=this.context(),this.display(),this.control.setSelectionRange(e,n?this.control.value.length:r)}}),this.control.addEventListener("input",()=>{this.#i||(this.#a=null),this.#t=!0,this.#r??=this.context(),this.error("")}),this.control.addEventListener("blur",()=>{this.#n=!1,this.#t&&this.control.dispatchEvent(new this.ownerDocument.defaultView.Event("change")),this.#t||(this.#r=null,this.display())}),this.control.addEventListener("keydown",e=>{e.isComposing||this.control.disabled||this.control.readOnly||(e.key==="Escape"?(e.preventDefault(),this.#a=null,this.#t=!1,this.#r=null,this.pageContext.form&&this.pageContext.formClearDraft(),this.error(""),this.display(),this.pageContext.form&&this.validateCandidate(this.#e,()=>{})):e.key==="Enter"&&(e.preventDefault(),this.control.dispatchEvent(new this.ownerDocument.defaultView.Event("change"))))})}createControl(){let e=this.ownerDocument.createElement("input");return e.type="text",e}context(){return{locale:this.parameters.locale??this.pageContext.locale,timeZone:this.pageContext.timeZone,pattern:this.parameters.format,dtype:this.parameters.dtype}}readControlValue(){return this.#e}readDraftValue(){return this.#t?this.control.value.trim()===""?null:this.parse(this.control.value,this.#r??this.context()):this.#e}sameControlValue(e,r){return Np(e,r,this.pageContext.isDecimal)}writeControlValue(e){if(this.checkValue(e),this.sameControlValue(e,this.#e)){!this.#t&&!this.#n&&this.display();return}this.#e=e,this.#a=null,this.#t=!1,this.#r=null,this.error(""),this.display()}selectControlValue(e){this.checkValue(e),this.control.value=e===null?"":this.editText(e,this.context()),this.#a={value:e},this.#i=!0;try{for(let r of["input","change"])this.control.dispatchEvent(new this.ownerDocument.defaultView.Event(r,{bubbles:!0}))}finally{this.#i=!1}}acceptControlValue(){if(!this.#t)return{ok:!1};try{let e=this.#a?this.#a.value:this.readDraftValue();return this.checkValue(e),this.validateCandidate(e,r=>{this.checkValue(r),this.#e=r,this.#a=null,this.#t=!1,(!this.#n||!this.sameControlValue(e,r))&&(this.#r=null,this.display())})}catch(e){return this.pageContext.form&&this.pageContext.formParseError(e.message),this.error(e.message),{ok:!1}}}restoreFormDraft(e){this.#t=!0,this.#r=this.context(),this.control.value=e}restoreFormValue(e){this.#t=!1,this.#r=null,this.#a=null,this.error(""),this.writeControlValue(e),this.display()}display(){if(!this.pageContext||!this.parameters)return;let e=this.#e==null?"":this.#n?this.editText(this.#e,this.#r??this.context()):this.pageContext.format(this.#e,this.context());this.control.value!==e&&(this.control.value=e)}projectAttributes(e,r){let n=super.projectAttributes(e,r);return!this.#t&&!this.#n&&this.display(),n}}}Kr.parameters={...pe.parameters,placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"},locale:{dtype:"T",nullable:!0,binding:"read"},format:{dtype:"T",nullable:!0,binding:"read"}};var Al=t=>class extends t{createControl(){let e=super.createControl();return e.inputMode="decimal",e}validationValueCheck(){let e=this.pageContext.isDecimal;return r=>xl(r,e)}checkValue(e){xl(e,this.pageContext.isDecimal)}context(){return{...super.context(),pattern:this.parameters.format??"0.####################"}}editText(e,r){return String(e).replace(".",El(r.locale).decimal)}parse(e,r){let{decimal:n,group:i,minus:a}=El(r.locale),s=e.trim().replaceAll(a,"-");if(i&&s.includes(i))throw new Error("Enter the number without grouping separators.");if(s=s.replace(n,"."),!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(s))throw new Error("Enter a complete number.");let o=r.dtype==="N"||this.pageContext.isDecimal(this.readControlValue());if(o&&this.pageContext.getDecimalLibrary()==="number")throw new Error("A Decimal backend is required.");let l=o?this.pageContext.createDecimal(s):Number(s);if(this.checkValue(l),r.dtype==="L"&&!Number.isSafeInteger(l))throw new Error("Enter a safe integer.");for(let[u,c]of[["min",-1],["max",1]]){let d=this.parameters[u];if(d!=null&&(o?l.cmp(d):Math.sign(l-d))===c)throw new Error(`${u}: ${d}`)}return l}},Tl=t=>class extends t{#e=!1;#t;constructor(){super();let e=this.ownerDocument,r=e.createElement("style");r.textContent=`.date-entry{position:relative;max-width:100%}
74
+ .calendar button:hover:not(:disabled){background:var(--gramlot-selected,#e5ebf7);color:var(--gramlot-ink,#203047)}`,e.classList.add("calendar"),this.header=n.createElement("div"),this.header.className="calendar-header",this.month=n.createElement("span"),this.month.className="calendar-month",this.month.setAttribute("aria-live","polite"),this.previous=this.button("\u2039","Previous month",()=>this.moveMonth(-1)),this.next=this.button("\u203A","Next month",()=>this.moveMonth(1)),this.header.append(this.previous,this.month,this.next),this.grid=n.createElement("div"),this.grid.className="calendar-grid",this.footer=n.createElement("div"),this.footer.className="calendar-footer",this.todayButton=this.button("Today","Today",()=>this.choose(this.today)),this.clearButton=this.button("Clear","Clear date",()=>this.choose(null)),this.footer.append(this.todayButton,this.clearButton),e.append(i,this.header,this.grid,this.footer),this.grid.addEventListener("keydown",a=>{if(this.locked||!a.target.dataset.date)return;let s={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};if(a.key in s)a.preventDefault(),this.active=qe(this.active.getUTCFullYear(),this.active.getUTCMonth(),this.active.getUTCDate()+s[a.key]);else if(a.key==="Home"||a.key==="End"){a.preventDefault();let o=(this.active.getUTCDay()+6)%7;this.active=qe(this.active.getUTCFullYear(),this.active.getUTCMonth(),this.active.getUTCDate()+(a.key==="Home"?-o:6-o))}else if(a.key==="PageUp"||a.key==="PageDown"){a.preventDefault(),this.moveMonth(a.key==="PageUp"?-1:1,!0);return}else return;this.render(),this.focusDay()})}button(e,r,n){let i=this.container.ownerDocument.createElement("button");return i.type="button",i.textContent=e,i.setAttribute("aria-label",r),i.addEventListener("click",n),i}configure({value:e,locale:r,workdate:n,locked:i=!1}){Zr(e);let a=new Date;this.today=n?qe(...n.split("-").map((o,l)=>Number(o)-(l===1?1:0))):qe(a.getFullYear(),a.getMonth(),a.getDate()),(!this.active||!ri(this.value,e))&&(this.active=e??this.today),this.value=e,this.locale=r,this.locked=i;let s=this.grid.contains(this.container.getRootNode().activeElement);this.render(),s&&!i&&this.focusDay()}choose(e){this.locked||(this.value=e,this.active=e??this.today,this.render(),this.focusDay(),this.select(e))}moveMonth(e,r=!1){if(this.locked)return;let n=this.active.getUTCFullYear(),i=this.active.getUTCMonth()+e;this.active=qe(n,i,Math.min(this.active.getUTCDate(),qe(n,i+1,0).getUTCDate())),this.render(),r&&this.focusDay()}render(){let e=this.active.getUTCFullYear(),r=this.active.getUTCMonth();this.month.textContent=new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric",timeZone:"UTC"}).format(this.active),this.grid.replaceChildren();let n=new Intl.DateTimeFormat(this.locale,{weekday:"short",timeZone:"UTC"});for(let s=0;s<7;s++){let o=this.container.ownerDocument.createElement("span");o.className="calendar-weekday",o.textContent=n.format(qe(2024,0,1+s)),this.grid.append(o)}let i=(qe(e,r,1).getUTCDay()+6)%7;for(let s=0;s<i;s++)this.grid.append(this.container.ownerDocument.createElement("span"));let a=new Intl.DateTimeFormat(this.locale,{dateStyle:"full",timeZone:"UTC"});for(let s=1;s<=qe(e,r+1,0).getUTCDate();s++){let o=qe(e,r,s),l=this.button(String(s),a.format(o),()=>this.choose(o));l.dataset.date=Sp(o),l.dataset.today=String(ri(o,this.today)),l.setAttribute("aria-pressed",String(ri(o,this.value))),l.disabled=this.locked,l.tabIndex=s===this.active.getUTCDate()?0:-1,this.grid.append(l)}for(let s of[this.previous,this.next,this.todayButton,this.clearButton])s.disabled=this.locked}focusDay(){this.grid.querySelector('button[tabindex="0"]')?.focus()}};function Ea(t){return class extends Qn(t){#e=null;constructor(){super(),this.control=this.ownerDocument.createElement("div"),this.control.id="control",this.control.setAttribute("role","group"),this.controlBox.append(this.control),this.calendarView=new Xr(this.control,e=>{this.#e=e,this.control.dispatchEvent(new this.ownerDocument.defaultView.Event("change",{bubbles:!0}))})}get commitOnChange(){return!0}readControlValue(){return this.#e}sameControlValue(e,r){return ri(e,r)}writeControlValue(e){Zr(e),this.#e=e,this.syncCalendar()}projectAttributes(e,r){let n=super.projectAttributes(e,r);return this.control.disabled=!!this.parameters.disabled,this.control.readOnly=!!this.parameters.readonly,this.syncCalendar(),n}syncCalendar(){!this.pageContext||!this.parameters||this.calendarView.configure({value:this.#e,locale:this.parameters.locale??this.pageContext.locale,workdate:this.parameters.workdate,locked:this.control.disabled||this.control.readOnly})}focus(){this.calendarView.focusDay()}releaseControl(){this.calendarView.locked=!0}}}Ea.parameters={value:{dtype:"D",nullable:!0,binding:"twoWay"},disabled:{dtype:"B",default:!1,binding:"read"},readonly:{dtype:"B",default:!1,binding:"read"},locale:{dtype:"T",nullable:!0,binding:"read"},workdate:{dtype:"T",nullable:!0,binding:"read"}};var Op=(t,e,r)=>t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():r(t)&&r(e)?t.eq(e):Object.is(t,e),Bp=t=>!["NaN","Infinity","-Infinity"].includes(t.toString()),Jr=t=>String(t).padStart(2,"0");function xl(t){let e=new Intl.NumberFormat(t).formatToParts(-12345.6);return{decimal:e.find(r=>r.type==="decimal").value,group:e.find(r=>r.type==="group")?.value,minus:e.find(r=>r.type==="minusSign").value}}function Kr(t){return class extends pe(t){#e=null;#t=!1;#n=!1;#r=null;#a=null;#i=!1;constructor(){super(),this.control.addEventListener("focus",()=>{if(this.#n=!0,!this.#t){let e=this.control.selectionStart,r=this.control.selectionEnd,n=e===0&&r===this.control.value.length;this.#r=this.context(),this.display(),this.control.setSelectionRange(e,n?this.control.value.length:r)}}),this.control.addEventListener("input",()=>{this.#i||(this.#a=null),this.#t=!0,this.#r??=this.context(),this.error("")}),this.control.addEventListener("blur",()=>{this.#n=!1,this.#t&&this.control.dispatchEvent(new this.ownerDocument.defaultView.Event("change")),this.#t||(this.#r=null,this.display())}),this.control.addEventListener("keydown",e=>{e.isComposing||this.control.disabled||this.control.readOnly||(e.key==="Escape"?(e.preventDefault(),this.#a=null,this.#t=!1,this.#r=null,this.pageContext.form&&this.pageContext.formClearDraft(),this.error(""),this.display(),this.pageContext.form&&this.validateCandidate(this.#e,()=>{})):e.key==="Enter"&&(e.preventDefault(),this.control.dispatchEvent(new this.ownerDocument.defaultView.Event("change"))))})}createControl(){let e=this.ownerDocument.createElement("input");return e.type="text",e}context(){return{locale:this.parameters.locale??this.pageContext.locale,timeZone:this.pageContext.timeZone,pattern:this.parameters.format,dtype:this.parameters.dtype}}readControlValue(){return this.#e}readDraftValue(){return this.#t?this.control.value.trim()===""?null:this.parse(this.control.value,this.#r??this.context()):this.#e}sameControlValue(e,r){return Op(e,r,this.pageContext.isDecimal)}writeControlValue(e){if(this.checkValue(e),this.sameControlValue(e,this.#e)){!this.#t&&!this.#n&&this.display();return}this.#e=e,this.#a=null,this.#t=!1,this.#r=null,this.error(""),this.display()}selectControlValue(e){this.checkValue(e),this.control.value=e===null?"":this.editText(e,this.context()),this.#a={value:e},this.#i=!0;try{for(let r of["input","change"])this.control.dispatchEvent(new this.ownerDocument.defaultView.Event(r,{bubbles:!0}))}finally{this.#i=!1}}acceptControlValue(){if(!this.#t)return{ok:!1};try{let e=this.#a?this.#a.value:this.readDraftValue();return this.checkValue(e),this.validateCandidate(e,r=>{this.checkValue(r),this.#e=r,this.#a=null,this.#t=!1,(!this.#n||!this.sameControlValue(e,r))&&(this.#r=null,this.display())})}catch(e){return this.pageContext.form&&this.pageContext.formParseError(e.message),this.error(e.message),{ok:!1}}}restoreFormDraft(e){this.#t=!0,this.#r=this.context(),this.control.value=e}restoreFormValue(e){this.#t=!1,this.#r=null,this.#a=null,this.error(""),this.writeControlValue(e),this.display()}display(){if(!this.pageContext||!this.parameters)return;let e=this.#e==null?"":this.#n?this.editText(this.#e,this.#r??this.context()):this.pageContext.format(this.#e,this.context());this.control.value!==e&&(this.control.value=e)}projectAttributes(e,r){let n=super.projectAttributes(e,r);return!this.#t&&!this.#n&&this.display(),n}}}Kr.parameters={...pe.parameters,placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"},locale:{dtype:"T",nullable:!0,binding:"read"},format:{dtype:"T",nullable:!0,binding:"read"}};var Tl=t=>class extends t{createControl(){let e=super.createControl();return e.inputMode="decimal",e}static validationValueCheck(e){let r=e.isDecimal;return n=>Dl(n,r)}checkValue(e){Dl(e,this.pageContext.isDecimal)}context(){return{...super.context(),pattern:this.parameters.format??"0.####################"}}editText(e,r){return String(e).replace(".",xl(r.locale).decimal)}parse(e,r){let{decimal:n,group:i,minus:a}=xl(r.locale),s=e.trim().replaceAll(a,"-");if(i&&s.includes(i))throw new Error("Enter the number without grouping separators.");if(s=s.replace(n,"."),!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(s))throw new Error("Enter a complete number.");let o=r.dtype==="N"||this.pageContext.isDecimal(this.readControlValue());if(o&&this.pageContext.getDecimalLibrary()==="number")throw new Error("A Decimal backend is required.");let l=o?this.pageContext.createDecimal(s):Number(s);if(this.checkValue(l),r.dtype==="L"&&!Number.isSafeInteger(l))throw new Error("Enter a safe integer.");for(let[u,c]of[["min",-1],["max",1]]){let d=this.parameters[u];if(d!=null&&(o?l.cmp(d):Math.sign(l-d))===c)throw new Error(`${u}: ${d}`)}return l}},Cl=t=>class extends t{#e=!1;#t;constructor(){super();let e=this.ownerDocument,r=e.createElement("style");r.textContent=`.date-entry{position:relative;max-width:100%}
75
75
  .date-entry #control{display:block;min-width:0;width:100%}
76
76
  .date-entry:has(.calendar-toggle:not([hidden])) #control{padding-right:calc(var(--gramlot-touch-target,1.6em) + .4em)}
77
77
  .calendar-toggle{position:absolute;right:0;top:0;bottom:0;width:var(--gramlot-touch-target,1.6em);min-width:0;min-height:0;font:inherit;font-size:var(--gramlot-field-font-size,1em);line-height:inherit;padding:0;border:0;border-radius:var(--gramlot-radius-sm,4px);background:transparent;color:inherit;cursor:pointer}
78
78
  .calendar-toggle:disabled{cursor:default;opacity:.6}
79
79
  .calendar-toggle svg{display:block;width:1.1em;height:1.1em;margin:auto;pointer-events:none}
80
80
  .calendar-popup{position:fixed;inset:auto;margin:0;padding:.5em;max-width:var(--gramlot-popup-available-width,100vw);max-height:var(--gramlot-popup-available-height,100vh);overflow:auto;
81
- border:1px solid var(--gramlot-border-control,#aab4c4);border-radius:var(--gramlot-radius,5px);background:var(--gramlot-surface,Canvas);color:var(--gramlot-ink,CanvasText);box-shadow:var(--gramlot-shadow,0 3px 12px #0003);font:inherit}`,this.shadowRoot.append(r);let n=e.createElement("div");n.className="date-entry",this.control.parentElement.replaceWith(n),n.append(this.control),this.calendarButton=e.createElement("button"),this.calendarButton.type="button",this.calendarButton.className="calendar-toggle";let i=e.createElementNS(ar,"svg");for(let[o,l]of Object.entries({viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))i.setAttribute(o,l);let a=e.createElementNS(ar,"path");a.setAttribute("d","M5 5h14a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z M7 2v6 M17 2v6 M3 11h18 M7 15h2 M15 15h2 M7 18h2 M15 18h2"),i.append(a),this.calendarButton.append(i),this.calendarButton.setAttribute("aria-label","Open calendar"),this.calendarButton.setAttribute("aria-haspopup","dialog"),this.calendarButton.setAttribute("aria-expanded","false"),this.calendarButton.setAttribute("aria-controls","calendar-popup"),n.append(this.calendarButton),this.calendarPopup=e.createElement("div"),this.calendarPopup.className="calendar-popup",this.calendarPopup.id="calendar-popup",this.calendarPopup.setAttribute("popover","auto"),this.calendarPopup.setAttribute("role","dialog"),this.calendarPopup.setAttribute("aria-label","Choose date"),this.shadowRoot.append(this.calendarPopup);let s=e.createElement("div");this.calendarPopup.append(s),this.calendarView=new Xr(s,o=>{this.control.disabled||this.control.readOnly||!this.pageContext.isActive()||(this.closeCalendar(),this.control.focus(),this.selectControlValue(o))}),this.calendarButton.addEventListener("click",()=>this.#e?this.closeCalendar():this.openCalendar()),this.control.addEventListener("keydown",o=>{o.altKey&&o.key==="ArrowDown"&&(o.preventDefault(),this.openCalendar())}),this.calendarPopup.addEventListener("keydown",o=>{o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),this.closeCalendar(),this.control.focus())}),this.calendarPopup.addEventListener("toggle",o=>{o.newState==="closed"&&(this.#e=!1,this.cleanupCalendar())})}openCalendar(){if(!this.parameters.calendar||this.control.disabled||this.control.readOnly||!this.pageContext.isActive())return;let e=this.readControlValue();try{e=this.readDraftValue()}catch{}this.calendarView.configure({value:e,locale:this.context().locale,workdate:this.parameters.workdate}),this.calendarPopup.showPopover(),this.#e=!0,this.calendarButton.setAttribute("aria-expanded","true");let r=this.ownerDocument.defaultView,n=()=>ft(this.calendarPopup,this.control);this.#t?.(),n(),r.addEventListener("resize",n),r.addEventListener("scroll",n,!0),this.#t=()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n,!0)},this.calendarView.focusDay()}cleanupCalendar(){this.#t?.(),this.#t=null,this.calendarButton.setAttribute("aria-expanded","false")}closeCalendar(){this.#e&&this.calendarPopup.hidePopover(),this.#e=!1,this.cleanupCalendar()}projectAttributes(e,r){let n=super.projectAttributes(e,r);return this.calendarButton.hidden=!this.parameters.calendar,this.calendarButton.disabled=this.control.disabled||this.control.readOnly,!this.parameters.calendar||this.calendarButton.disabled?this.closeCalendar():this.#e&&this.calendarView.configure({value:this.readControlValue(),locale:this.context().locale,workdate:this.parameters.workdate}),n}writeControlValue(e){super.writeControlValue(e),this.#e&&this.calendarView.configure({value:e,locale:this.context().locale,workdate:this.parameters.workdate})}releaseControl(){this.closeCalendar(),super.releaseControl()}context(){return{...super.context(),dtype:"D",pattern:this.parameters.format??"short"}}validationValueCheck(){return Zr}checkValue(e){Zr(e)}editText(e,r){return this.pageContext.format(e,{...r,pattern:"short"})}parse(e,r){let n=new Date,i=this.parameters.workdate??`${n.getFullYear()}-${Jr(n.getMonth()+1)}-${Jr(n.getDate())}`,a={locale:r.locale,workdate:i},s=va(e,a);if(!s.ok)throw new Error(s.error.message);if(s.kind!=="date")throw new Error("Enter one complete date, not a period.");let[o,l,u]=s.date.split("-").map(Number),c=new Date(0);return c.setUTCFullYear(o,l-1,u),c}},Cl=t=>class extends t{context(){return{...super.context(),dtype:"H",pattern:this.parameters.format??"short"}}validationValueCheck(){return Dl}checkValue(e){Dl(e)}editText(e){return`${Jr(e.getUTCHours())}:${Jr(e.getUTCMinutes())}:${Jr(e.getUTCSeconds())}`+(e.getUTCMilliseconds()?`.${String(e.getUTCMilliseconds()).padStart(3,"0")}`:"")}parse(e){let r=/^(\d{1,2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/.exec(e.trim());if(!r||+r[1]>23||+r[2]>59||+(r[3]??0)>59)throw new Error("Enter HH:mm or HH:mm:ss, using the 24-hour clock.");return new Date(Date.UTC(1970,0,1,+r[1],+r[2],+(r[3]??0),+(r[4]??"").padEnd(3,"0")))}};function xl(t,e){if(t!==null&&!(typeof t=="number"&&Number.isFinite(t))&&!(e(t)&&Sp(t)))throw new TypeError("Expected a finite number or Decimal")}function Dl(t){if(t!==null&&(!(t instanceof Date)||!Number.isFinite(t.getTime())||t.getUTCFullYear()!==1970||t.getUTCMonth()!==0||t.getUTCDate()!==1))throw new TypeError("Expected a civil time on the TYTX epoch date")}import{Bag as Op}from"@gramlot/gramlot";var Da=["select","notnull","empty","case","len","min","max","email","regex","call","remote"],Bp=["nodup","exist","gridnodup"],ni=t=>t==null||t==="",Ea=(t,e)=>t instanceof Promise?t.then(e):e(t);function Aa(t,e,r={}){let n={value:t,modified:!1,error:null,warnings:[],issues:[],datachanges:[]},i=Object.fromEntries(Object.entries(e).map(([u,c])=>[u.slice(9),c])),a=u=>Object.hasOwn(e,`validate_${u}`)&&e[`validate_${u}`]!=null;for(let u of Bp)if(a(u))throw new Error(`validate_${u} requires the DB/grid integration.`);let s=(u,c,d=!1)=>r.invoke(u,e[u],{...i,value:c,result:n,validations:i,userChange:!0,signal:r.signal},d),o=(u,c)=>{if(c==null||c===!0)return;if(typeof c!="boolean"&&typeof c!="string"&&(typeof c!="object"||Array.isArray(c)))throw new TypeError("A validator returns true, false, null, an error code, or a result object/Bag.");let d=`validate_${u}`,f=c instanceof Op?Object.fromEntries(c.getNodes().map(_=>[_.label,_.value])):typeof c=="object"?c:{errorcode:c===!1?"error":c};if(Object.hasOwn(f,"value")&&(n.modified||=!Object.is(n.value,f.value),n.value=f.value),f.data!=null&&(r.checkDataPatch(f.data),n.datachanges.push(f.data)),!f.errorcode)return;let p=e[`${d}_iswarning`]??f.iswarning??!!(e[`${d}_warning`]&&!e[`${d}_error`]),h=e[`${d}_${f.errorcode}`]||e[`${d}_${p?"warning":"error"}`]||f.message||e[`${d}_${p?"error":"warning"}`]||String(f.errorcode),m=sr(h,_=>_?{...i,...f,value:n.value}[_]:n.value);if(m==null)throw new Error("A validation message references a missing value.");let g={rule:u,code:f.errorcode,severity:p?"warning":"error",message:m};n.issues.push(g),p?n.warnings.push(m):(n.error=m,n.required=!!f.required)},l=u=>{if(r.signal?.aborted)throw r.signal.reason;if(n.error||u===Da.length)return n;let c=Da[u],d=`validate_${c}`,f=e[d];if(!a(c)||f===!1&&c!=="empty")return l(u+1);let p=m=>{if(!m)return l(u+1);let g;return c==="remote"&&n.value==null?l(u+1):(c==="call"?g=s(d,n.value):c==="remote"?g=r.remote(f,{...Ip(e),value:n.value},r.signal):g=Mp(c,f,n.value,r),Ea(g,_=>{if(r.signal?.aborted)throw r.signal.reason;let v=()=>(o(c,_),l(u+1));return c==="remote"&&e.validate__onResult?Ea(r.invoke("validate__onResult",e.validate__onResult,{result:_,value:n.value,validations:i,signal:r.signal}),v):v()}))},h=e[`${d}_if`];return Ea(h==null?!0:typeof h=="boolean"?h:s(`${d}_if`,n.value,!0),p)};return l(0)}function Ip(t){let e=new Set(["if","error","warning","iswarning"]);return Object.fromEntries(Object.entries(t).filter(([r])=>r.startsWith("validate_remote_")&&!e.has(r.slice(16))).map(([r,n])=>[r.slice(16),n]))}function Qr(t,e,r={}){return{errorcode:t,message:e,...r}}function Mp(t,e,r,n){if(t==="select")return n.selection(r);if(t==="notnull")return ni(r)&&e?Qr("notnull","A value is required.",{required:!0}):null;if(t==="empty")return ni(r)?{value:e}:null;if(t==="len"){if(typeof e!="string"||!/^(?:\d+|\d+:\d*|:\d+)$/.test(e))throw new Error("Invalid validate_len: use a length or min:max.");let[i,a]=e.split(":"),s=Number(i||0),o=a===void 0?s:a===""?1/0:Number(a);if(s>o)throw new Error("Invalid validate_len: minimum exceeds maximum.");if(ni(r))return;if(typeof r!="string")throw new TypeError("validate_len requires a text value.");return r.length<s||r.length>o?Qr(s===o?"wrong length":r.length<s?"too short":"too long",s===o?`Enter exactly ${s} characters.`:o===1/0?`Enter at least ${s} characters.`:s===0?`Enter no more than ${o} characters.`:`Enter between ${s} and ${o} characters.`):void 0}if(!ni(r)){if(t==="case"){if(typeof r!="string")throw new TypeError("validate_case requires a text value.");switch(e){case"upper":case"u":return{value:r.toUpperCase()};case"lower":case"l":return{value:r.toLowerCase()};case"title":case"t":return{value:r.replace(/\p{L}[\p{L}\p{M}]*/gu,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())};case"capitalize":case"c":return{value:r[0].toUpperCase()+r.slice(1).toLowerCase()};default:throw new Error("Invalid validate_case: use upper, lower, title or capitalize.")}}if(t==="min"||t==="max"){let i;if(n.isDecimal?.(r))i=r.comparedTo(e);else if(r instanceof Date&&e instanceof Date)i=r.getTime()-e.getTime();else if(typeof r=="number"&&Number.isFinite(r)&&typeof e=="number"&&Number.isFinite(e))i=r-e;else throw new TypeError(`validate_${t} requires matching numeric or date/time values.`);return(t==="min"?i<0:i>0)?Qr(t,`Value must be ${t==="min"?"at least":"at most"} ${e}.`):void 0}if(t==="email"){if(typeof r!="string")throw new TypeError("validate_email requires a text value.");return/^[^\s@]+@[^\s@]+\.[^\s@]+$/u.test(r)?null:Qr("email","Check email format.",{iswarning:!0})}if(t==="regex"){if(typeof r!="string"||typeof e!="string")throw new TypeError("validate_regex requires text.");let i=e.trim(),a=i.startsWith("!");return new RegExp(a?i.slice(1):i,"u").test(r)!==a?null:Qr("regex","The value does not match the required pattern.")}}}var en={dtype:"T",nullable:!0,binding:"read"},ii={dtype:"B",nullable:!0,binding:"read"},xa={dtype:["T","L","N","R","B","D","H","DH","DHZ"],nullable:!0,binding:"read"},Nl={validate_select:ii,validate_notnull:{...ii,default:!1},validate_empty:xa,validate_case:{...en,enum:["upper","lower","title","capitalize","u","l","t","c"]},validate_len:en,validate_min:xa,validate_max:xa,validate_email:ii,validate_regex:en,validate_call:{dtype:"T",nullable:!0},validate_remote:en,validate_onAccept:{dtype:"T",nullable:!0},validate_onReject:{dtype:"T",nullable:!0},validate__onResult:{dtype:"T",nullable:!0},validate_timeout:{dtype:"L",nullable:!0,binding:"read"},...Object.fromEntries(Da.flatMap(t=>[[`validate_${t}_if`,{dtype:["T","B"],nullable:!0}],[`validate_${t}_iswarning`,ii],...["error","warning"].map(e=>[`validate_${t}_${e}`,{...en,qualification:"intl_str"}])]))};var ai=class{epoch=0;controller=null;cancel(){this.epoch++,this.controller?.abort(),this.controller=null}start(e,r,n,i,a,s=()=>{}){this.cancel();let o=new AbortController,l=this.epoch;this.controller=o;let u=n.validationCurrent(),c=()=>l===this.epoch&&!o.signal.aborted&&u(),d=m=>({value:e,modified:!1,error:m.message,warnings:[],issues:[],datachanges:[]}),f=!1,p=m=>{if(f||!c())return{ok:!1};f=!0,this.controller=null;let g={ok:!m.error,value:m.value,result:m,rules:r,isCurrent:c};return a(g),g},h;try{if(r.validate_timeout!=null&&(!Number.isInteger(r.validate_timeout)||r.validate_timeout<=0))throw new TypeError("validate_timeout must be a positive integer in milliseconds.");h=i(e,r,{...n,signal:o.signal})}catch(m){return p(d(m))}return h instanceof Promise?(s(),new Promise(m=>{let g,_=()=>{clearTimeout(g),m({ok:!1})};o.signal.addEventListener("abort",_,{once:!0});let v=w=>{clearTimeout(g),o.signal.removeEventListener("abort",_);try{m(p(w))}catch(x){n.reportError(x,"Validation completion failed"),m({ok:!1})}};r.validate_timeout!=null&&(g=setTimeout(()=>{v(d(new Error("Validation timed out."))),o.abort()},r.validate_timeout)),h.then(v,w=>v(d(w)))})):p(h)}};var Rp=1800,Sl=200;function X(t){return class extends t{get supportsFormValidation(){return!0}get validationExecutor(){return Aa}connectedCallback(){super.connectedCallback(),this.pageContext?.form&&this.pageContext.formValidate()}#e=!1;#t;#n;#r;#a=new ai;#i;#s={};validationResult=null;constructor(){super(),this.message=this.ownerDocument.createElement("small"),this.message.id="field-message",this.message.hidden=!0,this.message.setAttribute("aria-live","polite"),this.message.setAttribute("popover","manual"),this.message.setAttribute("role","tooltip");let e=this.ownerDocument.createElement("style");e.textContent=`#control[aria-invalid="true"]{background:var(--gramlot-error-background,#fff1f0)}
81
+ border:1px solid var(--gramlot-border-control,#aab4c4);border-radius:var(--gramlot-radius,5px);background:var(--gramlot-surface,Canvas);color:var(--gramlot-ink,CanvasText);box-shadow:var(--gramlot-shadow,0 3px 12px #0003);font:inherit}`,this.shadowRoot.append(r);let n=e.createElement("div");n.className="date-entry",this.control.parentElement.replaceWith(n),n.append(this.control),this.calendarButton=e.createElement("button"),this.calendarButton.type="button",this.calendarButton.className="calendar-toggle";let i=e.createElementNS(ar,"svg");for(let[o,l]of Object.entries({viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"}))i.setAttribute(o,l);let a=e.createElementNS(ar,"path");a.setAttribute("d","M5 5h14a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z M7 2v6 M17 2v6 M3 11h18 M7 15h2 M15 15h2 M7 18h2 M15 18h2"),i.append(a),this.calendarButton.append(i),this.calendarButton.setAttribute("aria-label","Open calendar"),this.calendarButton.setAttribute("aria-haspopup","dialog"),this.calendarButton.setAttribute("aria-expanded","false"),this.calendarButton.setAttribute("aria-controls","calendar-popup"),n.append(this.calendarButton),this.calendarPopup=e.createElement("div"),this.calendarPopup.className="calendar-popup",this.calendarPopup.id="calendar-popup",this.calendarPopup.setAttribute("popover","auto"),this.calendarPopup.setAttribute("role","dialog"),this.calendarPopup.setAttribute("aria-label","Choose date"),this.shadowRoot.append(this.calendarPopup);let s=e.createElement("div");this.calendarPopup.append(s),this.calendarView=new Xr(s,o=>{this.control.disabled||this.control.readOnly||!this.pageContext.isActive()||(this.closeCalendar(),this.control.focus(),this.selectControlValue(o))}),this.calendarButton.addEventListener("click",()=>this.#e?this.closeCalendar():this.openCalendar()),this.control.addEventListener("keydown",o=>{o.altKey&&o.key==="ArrowDown"&&(o.preventDefault(),this.openCalendar())}),this.calendarPopup.addEventListener("keydown",o=>{o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),this.closeCalendar(),this.control.focus())}),this.calendarPopup.addEventListener("toggle",o=>{o.newState==="closed"&&(this.#e=!1,this.cleanupCalendar())})}openCalendar(){if(!this.parameters.calendar||this.control.disabled||this.control.readOnly||!this.pageContext.isActive())return;let e=this.readControlValue();try{e=this.readDraftValue()}catch{}this.calendarView.configure({value:e,locale:this.context().locale,workdate:this.parameters.workdate}),this.calendarPopup.showPopover(),this.#e=!0,this.calendarButton.setAttribute("aria-expanded","true");let r=this.ownerDocument.defaultView,n=()=>ft(this.calendarPopup,this.control);this.#t?.(),n(),r.addEventListener("resize",n),r.addEventListener("scroll",n,!0),this.#t=()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n,!0)},this.calendarView.focusDay()}cleanupCalendar(){this.#t?.(),this.#t=null,this.calendarButton.setAttribute("aria-expanded","false")}closeCalendar(){this.#e&&this.calendarPopup.hidePopover(),this.#e=!1,this.cleanupCalendar()}projectAttributes(e,r){let n=super.projectAttributes(e,r);return this.calendarButton.hidden=!this.parameters.calendar,this.calendarButton.disabled=this.control.disabled||this.control.readOnly,!this.parameters.calendar||this.calendarButton.disabled?this.closeCalendar():this.#e&&this.calendarView.configure({value:this.readControlValue(),locale:this.context().locale,workdate:this.parameters.workdate}),n}writeControlValue(e){super.writeControlValue(e),this.#e&&this.calendarView.configure({value:e,locale:this.context().locale,workdate:this.parameters.workdate})}releaseControl(){this.closeCalendar(),super.releaseControl()}context(){return{...super.context(),dtype:"D",pattern:this.parameters.format??"short"}}static validationValueCheck(){return Zr}checkValue(e){Zr(e)}editText(e,r){return this.pageContext.format(e,{...r,pattern:"short"})}parse(e,r){let n=new Date,i=this.parameters.workdate??`${n.getFullYear()}-${Jr(n.getMonth()+1)}-${Jr(n.getDate())}`,a={locale:r.locale,workdate:i},s=ka(e,a);if(!s.ok)throw new Error(s.error.message);if(s.kind!=="date")throw new Error("Enter one complete date, not a period.");let[o,l,u]=s.date.split("-").map(Number),c=new Date(0);return c.setUTCFullYear(o,l-1,u),c}},Nl=t=>class extends t{context(){return{...super.context(),dtype:"H",pattern:this.parameters.format??"short"}}static validationValueCheck(){return Al}checkValue(e){Al(e)}editText(e){return`${Jr(e.getUTCHours())}:${Jr(e.getUTCMinutes())}:${Jr(e.getUTCSeconds())}`+(e.getUTCMilliseconds()?`.${String(e.getUTCMilliseconds()).padStart(3,"0")}`:"")}parse(e){let r=/^(\d{1,2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/.exec(e.trim());if(!r||+r[1]>23||+r[2]>59||+(r[3]??0)>59)throw new Error("Enter HH:mm or HH:mm:ss, using the 24-hour clock.");return new Date(Date.UTC(1970,0,1,+r[1],+r[2],+(r[3]??0),+(r[4]??"").padEnd(3,"0")))}};function Dl(t,e){if(t!==null&&!(typeof t=="number"&&Number.isFinite(t))&&!(e(t)&&Bp(t)))throw new TypeError("Expected a finite number or Decimal")}function Al(t){if(t!==null&&(!(t instanceof Date)||!Number.isFinite(t.getTime())||t.getUTCFullYear()!==1970||t.getUTCMonth()!==0||t.getUTCDate()!==1))throw new TypeError("Expected a civil time on the TYTX epoch date")}import{Bag as Ip}from"@gramlot/gramlot";var Aa=["select","notnull","empty","case","len","min","max","email","regex","call","remote"],Mp=["nodup","exist","gridnodup"],ni=t=>t==null||t==="",xa=(t,e)=>t instanceof Promise?t.then(e):e(t);function Ta(t,e,r={}){let n={value:t,modified:!1,error:null,warnings:[],issues:[],datachanges:[]},i=Object.fromEntries(Object.entries(e).map(([u,c])=>[u.slice(9),c])),a=u=>Object.hasOwn(e,`validate_${u}`)&&e[`validate_${u}`]!=null;for(let u of Mp)if(a(u))throw new Error(`validate_${u} requires the DB/grid integration.`);let s=(u,c,d=!1)=>r.invoke(u,e[u],{...i,value:c,result:n,validations:i,userChange:!0,signal:r.signal},d),o=(u,c)=>{if(c==null||c===!0)return;if(typeof c!="boolean"&&typeof c!="string"&&(typeof c!="object"||Array.isArray(c)))throw new TypeError("A validator returns true, false, null, an error code, or a result object/Bag.");let d=`validate_${u}`,f=c instanceof Ip?Object.fromEntries(c.getNodes().map(_=>[_.label,_.value])):typeof c=="object"?c:{errorcode:c===!1?"error":c};if(Object.hasOwn(f,"value")&&(n.modified||=!Object.is(n.value,f.value),n.value=f.value),f.data!=null&&(r.checkDataPatch(f.data),n.datachanges.push(f.data)),!f.errorcode)return;let p=e[`${d}_iswarning`]??f.iswarning??!!(e[`${d}_warning`]&&!e[`${d}_error`]),h=e[`${d}_${f.errorcode}`]||e[`${d}_${p?"warning":"error"}`]||f.message||e[`${d}_${p?"error":"warning"}`]||String(f.errorcode),m=sr(h,_=>_?{...i,...f,value:n.value}[_]:n.value);if(m==null)throw new Error("A validation message references a missing value.");let g={rule:u,code:f.errorcode,severity:p?"warning":"error",message:m};n.issues.push(g),p?n.warnings.push(m):(n.error=m,n.required=!!f.required)},l=u=>{if(r.signal?.aborted)throw r.signal.reason;if(n.error||u===Aa.length)return n;let c=Aa[u],d=`validate_${c}`,f=e[d];if(!a(c)||f===!1&&c!=="empty")return l(u+1);let p=m=>{if(!m)return l(u+1);let g;return c==="remote"&&n.value==null?l(u+1):(c==="call"?g=s(d,n.value):c==="remote"?g=r.remote(f,{...Rp(e),value:n.value},r.signal):g=Lp(c,f,n.value,r),xa(g,_=>{if(r.signal?.aborted)throw r.signal.reason;let v=()=>(o(c,_),l(u+1));return c==="remote"&&e.validate__onResult?xa(r.invoke("validate__onResult",e.validate__onResult,{result:_,value:n.value,validations:i,signal:r.signal}),v):v()}))},h=e[`${d}_if`];return xa(h==null?!0:typeof h=="boolean"?h:s(`${d}_if`,n.value,!0),p)};return l(0)}function Rp(t){let e=new Set(["if","error","warning","iswarning"]);return Object.fromEntries(Object.entries(t).filter(([r])=>r.startsWith("validate_remote_")&&!e.has(r.slice(16))).map(([r,n])=>[r.slice(16),n]))}function Qr(t,e,r={}){return{errorcode:t,message:e,...r}}function Lp(t,e,r,n){if(t==="select")return n.selection(r,n.signal);if(t==="notnull")return ni(r)&&e?Qr("notnull","A value is required.",{required:!0}):null;if(t==="empty")return ni(r)?{value:e}:null;if(t==="len"){if(typeof e!="string"||!/^(?:\d+|\d+:\d*|:\d+)$/.test(e))throw new Error("Invalid validate_len: use a length or min:max.");let[i,a]=e.split(":"),s=Number(i||0),o=a===void 0?s:a===""?1/0:Number(a);if(s>o)throw new Error("Invalid validate_len: minimum exceeds maximum.");if(ni(r))return;if(typeof r!="string")throw new TypeError("validate_len requires a text value.");return r.length<s||r.length>o?Qr(s===o?"wrong length":r.length<s?"too short":"too long",s===o?`Enter exactly ${s} characters.`:o===1/0?`Enter at least ${s} characters.`:s===0?`Enter no more than ${o} characters.`:`Enter between ${s} and ${o} characters.`):void 0}if(!ni(r)){if(t==="case"){if(typeof r!="string")throw new TypeError("validate_case requires a text value.");switch(e){case"upper":case"u":return{value:r.toUpperCase()};case"lower":case"l":return{value:r.toLowerCase()};case"title":case"t":return{value:r.replace(/\p{L}[\p{L}\p{M}]*/gu,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())};case"capitalize":case"c":return{value:r[0].toUpperCase()+r.slice(1).toLowerCase()};default:throw new Error("Invalid validate_case: use upper, lower, title or capitalize.")}}if(t==="min"||t==="max"){let i;if(n.isDecimal?.(r))i=r.comparedTo(e);else if(r instanceof Date&&e instanceof Date)i=r.getTime()-e.getTime();else if(typeof r=="number"&&Number.isFinite(r)&&typeof e=="number"&&Number.isFinite(e))i=r-e;else throw new TypeError(`validate_${t} requires matching numeric or date/time values.`);return(t==="min"?i<0:i>0)?Qr(t,`Value must be ${t==="min"?"at least":"at most"} ${e}.`):void 0}if(t==="email"){if(typeof r!="string")throw new TypeError("validate_email requires a text value.");return/^[^\s@]+@[^\s@]+\.[^\s@]+$/u.test(r)?null:Qr("email","Check email format.",{iswarning:!0})}if(t==="regex"){if(typeof r!="string"||typeof e!="string")throw new TypeError("validate_regex requires text.");let i=e.trim(),a=i.startsWith("!");return new RegExp(a?i.slice(1):i,"u").test(r)!==a?null:Qr("regex","The value does not match the required pattern.")}}}var en={dtype:"T",nullable:!0,binding:"read"},ii={dtype:"B",nullable:!0,binding:"read"},Da={dtype:["T","L","N","R","B","D","H","DH","DHZ"],nullable:!0,binding:"read"},Sl={validate_select:ii,validate_notnull:{...ii,default:!1},validate_empty:Da,validate_case:{...en,enum:["upper","lower","title","capitalize","u","l","t","c"]},validate_len:en,validate_min:Da,validate_max:Da,validate_email:ii,validate_regex:en,validate_call:{dtype:"T",nullable:!0},validate_remote:en,validate_onAccept:{dtype:"T",nullable:!0},validate_onReject:{dtype:"T",nullable:!0},validate__onResult:{dtype:"T",nullable:!0},validate_timeout:{dtype:"L",nullable:!0,binding:"read"},...Object.fromEntries(Aa.flatMap(t=>[[`validate_${t}_if`,{dtype:["T","B"],nullable:!0}],[`validate_${t}_iswarning`,ii],...["error","warning"].map(e=>[`validate_${t}_${e}`,{...en,qualification:"intl_str"}])]))};var ai=class{epoch=0;controller=null;cancel(){this.epoch++,this.controller?.abort(),this.controller=null}start(e,r,n,i,a,s=()=>{}){this.cancel();let o=new AbortController,l=this.epoch;this.controller=o;let u=n.validationCurrent(),c=()=>l===this.epoch&&!o.signal.aborted&&u(),d=m=>({value:e,modified:!1,error:m.message,warnings:[],issues:[],datachanges:[]}),f=!1,p=m=>{if(f||!c())return{ok:!1};f=!0,this.controller=null;let g={ok:!m.error,value:m.value,result:m,rules:r,isCurrent:c};return a(g),g},h;try{if(r.validate_timeout!=null&&(!Number.isInteger(r.validate_timeout)||r.validate_timeout<=0))throw new TypeError("validate_timeout must be a positive integer in milliseconds.");h=i(e,r,{...n,signal:o.signal})}catch(m){return p(d(m))}return h instanceof Promise?(s(),new Promise(m=>{let g,_=()=>{clearTimeout(g),m({ok:!1})};o.signal.addEventListener("abort",_,{once:!0});let v=w=>{clearTimeout(g),o.signal.removeEventListener("abort",_);try{m(p(w))}catch(x){n.reportError(x,"Validation completion failed"),m({ok:!1})}};r.validate_timeout!=null&&(g=setTimeout(()=>{v(d(new Error("Validation timed out."))),o.abort()},r.validate_timeout)),h.then(v,w=>v(d(w)))})):p(h)}};var Pp=1800,Ol=200;function X(t){return class extends t{get supportsFormValidation(){return!0}static validationParameters(e){let r={...di(this.gramlotComponent,e),...e};return this.constrained&&r.validate_select==null&&(r.validate_select=!0),r}static get validationExecutor(){return Ta}get validationExecutor(){return this.constructor.validationExecutor}connectedCallback(){super.connectedCallback(),this.pageContext?.form&&this.pageContext.formValidate()}#e=!1;#t;#n;#r;#a=new ai;#i;#s={};validationResult=null;constructor(){super(),this.message=this.ownerDocument.createElement("small"),this.message.id="field-message",this.message.hidden=!0,this.message.setAttribute("aria-live","polite"),this.message.setAttribute("popover","manual"),this.message.setAttribute("role","tooltip");let e=this.ownerDocument.createElement("style");e.textContent=`#control[aria-invalid="true"]{background:var(--gramlot-error-background,#fff1f0)}
82
82
  input#control[aria-invalid="true"],textarea#control[aria-invalid="true"]{color:var(--gramlot-error,#8c1d18)}
83
83
  #field-message{position:fixed;inset:auto;margin:0;padding:.4em .65em;border:1px solid var(--gramlot-error,#b3261e);border-radius:var(--gramlot-radius-sm,4px);
84
84
  color:var(--gramlot-error,#8c1d18);background:var(--gramlot-error-background,#fff1f0);font:inherit;font-size:.85em;box-shadow:var(--gramlot-shadow,0 2px 8px #0003);
85
- max-width:min(28em,var(--gramlot-popup-available-width,100vw));max-height:var(--gramlot-popup-available-height,100vh);overflow:auto;overflow-wrap:anywhere;opacity:1;transition:opacity ${Sl}ms ease-out}
85
+ max-width:min(28em,var(--gramlot-popup-available-width,100vw));max-height:var(--gramlot-popup-available-height,100vh);overflow:auto;overflow-wrap:anywhere;opacity:1;transition:opacity ${Ol}ms ease-out}
86
86
  #field-message[data-severity="warning"]{color:var(--gramlot-warning,#805600);border-color:var(--gramlot-warning,#805600);background:var(--gramlot-warning-background,#fff8df)}
87
87
  #field-message[data-fading]{opacity:0}
88
- @media(prefers-reduced-motion:reduce){#field-message{transition:none}}`,this.shadowRoot.append(e),this.control.setAttribute("aria-describedby",this.message.id),this.controlBox.append(this.message),this.control.addEventListener("input",()=>this.cancelValidation()),this.control.addEventListener("compositionstart",()=>this.cancelValidation()),this.control.addEventListener("focusin",()=>this.#u()),this.control.addEventListener("mouseenter",()=>this.#u()),this.control.addEventListener("keydown",r=>{r.key==="Escape"&&(this.cancelValidation(),this.#o())})}#o(){this.ownerDocument.defaultView.clearTimeout(this.#n),this.#r?.abort(),this.#r=null,this.message.hidden||this.message.hidePopover(),this.message.hidden=!0,this.message.removeAttribute("data-fading")}#u(){if(!this.message.textContent||!this.isConnected)return;this.#o();let e=this.ownerDocument.defaultView;this.message.hidden=!1,this.message.showPopover(),ft(this.message,this.control),this.#n=e.setTimeout(()=>{this.message.hidden||(this.message.setAttribute("data-fading",""),this.#n=e.setTimeout(()=>this.#o(),Sl))},Rp),this.#r=new e.AbortController;let r={capture:!0,signal:this.#r.signal};e.addEventListener("scroll",()=>this.#o(),r),e.addEventListener("resize",()=>this.#o(),r)}releaseControl(){this.#a.cancel(),this.#o(),super.releaseControl()}disconnectedCallback(){this.releaseControl()}setFieldState({invalid:e=!1,pending:r=!1}={}){this.control.setAttribute("aria-invalid",String(e)),this.control.setAttribute("aria-busy",String(r))}error(e){this.#e=!1,["input","textarea"].includes(this.control.localName)&&this.control.setCustomValidity(e),this.control.setAttribute("aria-invalid",String(!!e)),this.message.textContent=e,e?this.#u():this.#o()}restoreFormValue(e){this.error(""),this.#e=!1,super.restoreFormValue(e)}cancelValidation(){this.pageContext?.form&&this.pageContext.formCancelValidation(),this.#a.cancel(),this.#i=null,this.control.setAttribute("aria-busy","false")}presentValidation(e){this.validationResult=e,this.control.setAttribute("aria-busy","false"),this.error(e.error||""),this.message.dataset.severity=e.error?"error":"warning",this.#e=!!e.error,!e.error&&e.warnings.length&&(this.message.textContent=e.warnings.join(`
89
- `),this.#u())}validateCandidate(e,r){if(this.pageContext.form){let n=this.validationSelection();return r(e),this.pageContext.formValidateCandidate(e,n)}return this.cancelValidation(),this.#i=this.pageContext.validationCurrent(),this.#a.start(e,this.#s,{...this.pageContext,selection:n=>this.validateSelection(n)},Aa,n=>{if(this.#i=null,n.ok)try{r(n.value)}catch(i){n.ok=!1,n.result.error=i.message}this.presentValidation(n.result),n.ok||this.finishValidation(n)},()=>this.control.setAttribute("aria-busy","true"))}finishValidation(e){e.result&&this.pageContext.finishValidation(e)}shouldProjectControlValue(e){!this.pageContext?.form&&this.#i&&!this.#i()&&this.cancelValidation();let r=this.sameControlValue(e,this.#t);return r&&this.#e?!1:(!r&&!this.pageContext?.form&&this.cancelValidation(),this.#t=e,!r&&this.#e&&this.error(""),!0)}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=Object.fromEntries(Object.entries(e).filter(([l])=>l.startsWith("validate_"))),a=new Set([...Object.keys(i),...Object.keys(this.#s)]);!this.pageContext?.form&&([...a].some(l=>!Object.is(i[l],this.#s[l]))||e.disabled||e.readonly)&&this.cancelValidation();let s=[...a].some(l=>!Object.is(i[l],this.#s[l]));this.#s=i,s&&this.pageContext?.form&&this.pageContext.formValidate();for(let l of Object.keys(i))delete n[l];let o=!!this.parameters.validate_notnull;return this.control.setAttribute("aria-required",String(o)),(this.control.localName==="textarea"||this.control.localName==="input"&&["text","password"].includes(this.control.type))&&(this.control.required=o),n}}}X.parameters=Nl;import{Bag as Lp}from"@gramlot/gramlot";function Bt(t){return class extends pe(t){#e;#t=[];#n=-1;#r=0;#a=!1;#i=!1;#s=null;#o;#u;#f;#c;#l=!1;#d;constructor(){super();let e=this.ownerDocument,r=e.createElement("style");r.textContent=`.option{position:relative} #control{width:100%;padding-right:calc(var(--gramlot-choice-toggle-width,1.6em) + .2em)}
88
+ @media(prefers-reduced-motion:reduce){#field-message{transition:none}}`,this.shadowRoot.append(e),this.control.setAttribute("aria-describedby",this.message.id),this.controlBox.append(this.message),this.control.addEventListener("input",()=>this.cancelValidation()),this.control.addEventListener("compositionstart",()=>this.cancelValidation()),this.control.addEventListener("focusin",()=>this.#u()),this.control.addEventListener("mouseenter",()=>this.#u()),this.control.addEventListener("keydown",r=>{r.key==="Escape"&&(this.cancelValidation(),this.#o())})}#o(){this.ownerDocument.defaultView.clearTimeout(this.#n),this.#r?.abort(),this.#r=null,this.message.hidden||this.message.hidePopover(),this.message.hidden=!0,this.message.removeAttribute("data-fading")}#u(){if(!this.message.textContent||!this.isConnected)return;this.#o();let e=this.ownerDocument.defaultView;this.message.hidden=!1,this.message.showPopover(),ft(this.message,this.control),this.#n=e.setTimeout(()=>{this.message.hidden||(this.message.setAttribute("data-fading",""),this.#n=e.setTimeout(()=>this.#o(),Ol))},Pp),this.#r=new e.AbortController;let r={capture:!0,signal:this.#r.signal};e.addEventListener("scroll",()=>this.#o(),r),e.addEventListener("resize",()=>this.#o(),r)}releaseControl(){this.#a.cancel(),this.#o(),super.releaseControl()}disconnectedCallback(){this.releaseControl()}setFieldState({invalid:e=!1,pending:r=!1}={}){this.control.setAttribute("aria-invalid",String(e)),this.control.setAttribute("aria-busy",String(r))}error(e){this.#e=!1,["input","textarea"].includes(this.control.localName)&&this.control.setCustomValidity(e),this.control.setAttribute("aria-invalid",String(!!e)),this.message.textContent=e,e?this.#u():this.#o()}restoreFormValue(e){this.error(""),this.#e=!1,super.restoreFormValue(e)}cancelValidation(){this.pageContext?.form&&this.pageContext.formCancelValidation(),this.#a.cancel(),this.#i=null,this.control.setAttribute("aria-busy","false")}presentValidation(e){this.validationResult=e,this.control.setAttribute("aria-busy","false"),this.error(e.error||""),this.message.dataset.severity=e.error?"error":"warning",this.#e=!!e.error,!e.error&&e.warnings.length&&(this.message.textContent=e.warnings.join(`
89
+ `),this.#u())}validateCandidate(e,r){if(this.pageContext.form){let n=this.validationSelection();return r(e),this.pageContext.formValidateCandidate(e,n)}return this.cancelValidation(),this.#i=this.pageContext.validationCurrent(),this.#a.start(e,this.#s,{...this.pageContext,selection:n=>this.validateSelection(n)},Ta,n=>{if(this.#i=null,n.ok)try{r(n.value)}catch(i){n.ok=!1,n.result.error=i.message}this.presentValidation(n.result),n.ok||this.finishValidation(n)},()=>this.control.setAttribute("aria-busy","true"))}finishValidation(e){e.result&&this.pageContext.finishValidation(e)}shouldProjectControlValue(e){!this.pageContext?.form&&this.#i&&!this.#i()&&this.cancelValidation();let r=this.sameControlValue(e,this.#t);return r&&this.#e?!1:(!r&&!this.pageContext?.form&&this.cancelValidation(),this.#t=e,!r&&this.#e&&this.error(""),!0)}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=Object.fromEntries(Object.entries(e).filter(([l])=>l.startsWith("validate_"))),a=new Set([...Object.keys(i),...Object.keys(this.#s)]);!this.pageContext?.form&&([...a].some(l=>!Object.is(i[l],this.#s[l]))||e.disabled||e.readonly)&&this.cancelValidation();let s=[...a].some(l=>!Object.is(i[l],this.#s[l]));this.#s=i,s&&this.pageContext?.form&&this.pageContext.formValidate();for(let l of Object.keys(i))delete n[l];let o=!!this.parameters.validate_notnull;return this.control.setAttribute("aria-required",String(o)),(this.control.localName==="textarea"||this.control.localName==="input"&&["text","password"].includes(this.control.type))&&(this.control.required=o),n}}}X.parameters=Sl;import{Bag as $p}from"@gramlot/gramlot";function Bt(t){return class extends pe(t){#e;#t=[];#n=-1;#r=0;#a=!1;#i=!1;#s=null;#o;#u;#f;#c;#l=!1;#d;constructor(){super();let e=this.ownerDocument,r=e.createElement("style");r.textContent=`.option{position:relative} #control{width:100%;padding-right:calc(var(--gramlot-choice-toggle-width,1.6em) + .2em)}
90
90
  #control:focus-visible{outline:1px solid var(--gramlot-border-control,#7a8798);outline-offset:-3px}
91
91
  .toggle{position:absolute;right:0;top:0;bottom:0;width:var(--gramlot-choice-toggle-width,1.6em);min-width:0;min-height:0;font:inherit;font-size:var(--gramlot-field-font-size,1em);padding:0;border:0;background:transparent;color:inherit}
92
92
  .choices{min-width:min(var(--gramlot-choice-popup-min-width,0px),var(--gramlot-popup-available-width,100vw));max-width:var(--gramlot-popup-available-width,100vw);position:fixed;inset:auto;margin:0;padding:var(--gramlot-popup-padding,4px);box-sizing:border-box;max-height:min(var(--gramlot-choice-max-height,20rem),var(--gramlot-popup-available-height,100vh));overflow:auto;
@@ -95,7 +95,7 @@ li button{display:block;width:100%;text-align:start;padding:.55rem .35rem}
95
95
  .choice:nth-child(even){background:var(--gramlot-choice-alternate-background,var(--gramlot-surface-subtle,transparent))}
96
96
  .choice:hover{background:var(--gramlot-selected,Highlight)}
97
97
  .choice-detail{margin-inline-start:var(--gramlot-space-3,.75rem);color:var(--gramlot-text-secondary,GrayText)}
98
- .choice[aria-selected=true]{background:var(--gramlot-selected,Highlight);color:var(--gramlot-ink,HighlightText)}`,this.toggle=e.createElement("button"),this.toggle.className="toggle",this.toggle.type="button",this.toggle.tabIndex=-1,this.toggle.textContent="\u25BE",this.toggle.setAttribute("aria-label","Show options"),this.control.parentElement.append(this.toggle),this.choices=e.createElement("div"),this.choices.id="choices",this.choices.className="choices",this.choices.hidden=!0,this.choices.setAttribute("role","listbox"),this.choices.setAttribute("popover","manual"),this.controlBox.append(r,this.choices),this.toggle.addEventListener("mousedown",n=>n.preventDefault()),this.toggle.addEventListener("click",()=>{this.locked||(this.control.focus(),this.#a?this.closeChoices():this.search(""))}),this.choices.addEventListener("mousedown",n=>n.preventDefault()),this.control.addEventListener("input",n=>{this.#i=!0,this.#s=null,n.isComposing||this.scheduleSearch(this.control.value)}),this.control.addEventListener("compositionend",()=>this.scheduleSearch(this.control.value)),this.control.addEventListener("keydown",n=>{if(!(n.isComposing||this.locked))if(n.key==="ArrowDown"||n.key==="ArrowUp"){n.preventDefault();let i=n.key==="ArrowDown"?1:-1;this.#a?this.activate(this.#n<0?i>0?0:this.#t.length-1:Math.max(0,this.#n+i)):this.search("",i)}else n.key==="Enter"?(n.preventDefault(),this.#a&&this.#t[this.#n]?this.choose(this.#t[this.#n]):this.commitDraft()):n.key==="Escape"&&(this.closeChoices(),this.#i=!1,this.#s=null,this.constrained?this.resolveValue():(this.control.value=this.#e??"",this.error("")))}),this.control.addEventListener("blur",()=>{!this.autoHighlight&&this.#a&&this.#t[this.#n]?this.choose(this.#t[this.#n]):this.#i&&this.commitDraft(),this.closeChoices()})}createControl(){let e=this.ownerDocument.createElement("input");return e.type="text",e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-controls","choices"),e.setAttribute("aria-expanded","false"),e.autocomplete="off",e}get constrained(){return!0}get revalidateDraftOnSourceChange(){return!1}get autoHighlight(){return!0}get matchTypedChoice(){return!0}get emptyChoice(){return null}get choiceSource(){return this.parameters.store??this.parameters.callback??this.parameters.values}get searchDelay(){return 0}textValue(e){return e}selectionAccepted(e){}selectionResolved(e){}renderChoice(e,r){r.textContent=e.caption}scheduleSearch(e){if(this.closeChoices(),!this.searchDelay)return this.search(e);this.#d=setTimeout(()=>{this.#d=null,this.search(e)},this.searchDelay)}get commitOnChange(){return this.constrained}get locked(){return this.control.disabled||this.control.readOnly}get active(){return this.isConnected&&this.pageContext?.isActive()}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.choiceSource,a=i!==this.#o||this.parameters.separator!==this.#u;return this.#u=this.parameters.separator,this.#o=i,this.toggle.disabled=this.locked,a&&this.revalidateDraftOnSourceChange&&(this.#i=!1),a&&(this.#t=[],this.#s=null),(a||this.locked)&&this.closeChoices({cancelLookup:a}),a&&this.active&&!this.#i&&this.resolveValue(),n}setPageContext(e){super.setPageContext(e),this.resolveValue()}connectedCallback(){super.connectedCallback(),this.resolveValue()}readControlValue(){return this.#e}writeControlValue(e){Object.is(e,this.#e)||(this.#e=e,this.#i=!1,this.#s=null,this.closeChoices({cancelLookup:!0}),this.resolveValue())}restoreFormDraft(e){this.closeChoices({cancelLookup:!0}),this.#i=!0,this.#s=null,this.control.value=e}restoreFormValue(e){this.#e=e,this.#i=!1,this.#s=null,this.closeChoices({cancelLookup:!0}),this.resolveValue()}validationValueCheck(){let e=this.constrained;return(r,n)=>{if(e&&r!==n)throw new Error("Validation cannot replace a selected code; update the Data explicitly.")}}validationSelection(){if(!this.constrained)return super.validationSelection();let e=this.#t.map(({id:n,error:i})=>({id:n,error:i})),r=this.#s?{id:this.#s.id,error:this.#s.error}:null;return n=>{let i=r?.id===n?r:e.find(a=>a.id===n);return i?.error?{errorcode:"condition",message:i.error}:n==null||i?!0:{errorcode:"missing",message:"Choose a value from the list."}}}acceptControlValue(){if(!this.#i)return this.validateCandidate(this.#e,a=>this.writeControlValue(a));let e=this.#s??(!this.autoHighlight&&this.#a?this.#t[this.#n]:null),r=e&&!this.constrained?e.caption:this.control.value,n=e?[e]:this.matchTypedChoice?this.#t.filter(a=>a.caption===r):[];if(this.constrained&&r!==""&&n.length!==1)return this.error("Choose a value from the list."),{ok:!1};let i=this.constrained?r===""?null:n[0].id:this.textValue(r);return this.validateCandidate(i,a=>{this.validationValueCheck()(a,i),this.#e=a,this.#i=!1,this.#s=null,(a==null||!this.constrained)&&(this.control.value=a??""),this.selectionAccepted(n.length===1&&a===i&&n[0].id!==null?n[0]:null),e&&!this.autoHighlight&&this.closeChoices()})}commitDraft(){this.closeChoices();let e=this.ownerDocument.defaultView.Event;this.control.dispatchEvent(new e("change",{bubbles:!0}))}choose(e){this.locked||!this.active||(this.pageContext.form&&this.pageContext.formSelectionError(e.error??""),this.#s=e,this.#i=!0,this.control.value=e.id===null?"":e.caption,this.closeChoices(),this.commitDraft())}async request(e,{selection:r=!1}={}){this.#c?.abort();let n=new AbortController;this.#c=n,this.#l=r||Object.hasOwn(e,"_id"),this.pageContext.form&&this.#l&&this.pageContext.formSelectionPending(!0);let i=++this.#r;this.control.setAttribute("aria-busy","true"),this.error("");try{let a=await this.loadChoices(e,n.signal);return i!==this.#r||!this.active?null:a}catch(a){return i===this.#r&&this.active&&(this.error(a.message),this.pageContext.form&&this.#l&&this.pageContext.formSelectionError(a.message)),null}finally{i===this.#r&&(this.pageContext.form&&this.#l&&this.pageContext.formSelectionPending(!1),this.#c=null,this.#l=!1,this.control.setAttribute("aria-busy","false"))}}async resolveValue(){if(this.#e==null||this.#e===""){this.pageContext?.form&&(this.pageContext.formSelectionPending(!1),this.pageContext.formSelectionError("")),this.control.value="",this.error(""),this.active&&this.selectionResolved(null);return}if(!this.active)return;if(this.control.value=this.#e,!this.constrained){this.error(""),this.selectionResolved(null);return}let e=this.request({_id:this.#e}),r=this.#r,n=await e;if(!n){r===this.#r&&this.active&&(this.selectionResolved(null),this.pageContext.form&&this.pageContext.formValidate());return}let i=n.find(s=>s.id===this.#e);this.#t=n,this.control.value=i?i.caption:this.#e;let a=i?i.error??"":"Value is not in the list.";this.error(a),this.pageContext.form&&(this.pageContext.formSelectionError(a),this.pageContext.formValidate()),this.selectionResolved(i??null)}async search(e,r=0){if(this.locked||!this.active)return;this.closeChoices(),this.#t=[];let n=await this.request({_querystring:e});if(!n||this.locked||this.shadowRoot.activeElement!==this.control)return;let i=this.emptyChoice;this.#t=i?[i,...n]:n;let a=this.ownerDocument;this.choices.replaceChildren(...this.#t.map((f,p)=>{let h=a.createElement("div");return h.id=`choice-${p}`,h.className="choice",h.setAttribute("role","option"),this.renderChoice(f,h),h.addEventListener("click",()=>this.choose(f)),h})),this.#t.length||(this.choices.textContent="No results");let s=a.defaultView;this.choices.hidden=!1,this.choices.showPopover(),this.#a=!0;let o=parseFloat(s.getComputedStyle(this).getPropertyValue("--gramlot-choice-popup-inset")||"2");ft(this.choices,this.control,{matchWidth:!0,inset:o}),this.control.setAttribute("aria-expanded","true");let l=this.constrained&&!this.#i&&e===""&&this.#e!=null;this.activate(l?this.#t.findIndex(f=>f.id===this.#e):r<0?this.#t.length-1:r>0?0:this.autoHighlight&&n.length?i?1:0:-1);let u=()=>this.closeChoices(),c=f=>{f.composedPath().includes(this)||u()},d=f=>{f.composedPath().includes(this.choices)||u()};a.addEventListener("pointerdown",c,!0),a.addEventListener("scroll",d,!0),s.addEventListener("resize",u),this.#f=()=>{a.removeEventListener("pointerdown",c,!0),a.removeEventListener("scroll",d,!0),s.removeEventListener("resize",u)}}activate(e){this.#n=this.#t.length&&e>=0?Math.min(e,this.#t.length-1):-1;for(let[r,n]of[...this.choices.children].entries())n.setAttribute("aria-selected",String(r===this.#n)),r===this.#n&&n.scrollIntoView({block:"nearest"});this.#n<0?this.control.removeAttribute("aria-activedescendant"):this.control.setAttribute("aria-activedescendant",`choice-${this.#n}`)}closeChoices({cancelLookup:e=!1}={}){clearTimeout(this.#d),this.#d=null,(e||!this.#l)&&(this.pageContext?.form&&this.#l&&this.pageContext.formSelectionPending(!1),this.#c?.abort(),this.#c=null,this.#l=!1,++this.#r,this.control.setAttribute("aria-busy","false")),this.#f?.(),this.#f=null,this.#a&&this.choices.hidePopover(),this.#a=!1,this.choices.hidden=!0,this.control.setAttribute("aria-expanded","false"),this.control.removeAttribute("aria-activedescendant")}releaseControl(){this.closeChoices({cancelLookup:!0})}disconnectedCallback(){this.releaseControl()}}}Bt.parameters={...pe.parameters,value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"}};function Ta(t){return class extends t{loadChoices(e){let r;if(this.parameters.store!=null){if(!(this.parameters.store instanceof Lp))throw new TypeError("store must be a Bag");if(this.parameters.values)throw new TypeError("store and values are mutually exclusive");let n=new Set;r=this.parameters.store.getNodes().map(i=>{let a=i.staticValue,s=i.attr.caption;if(typeof a!="string"||!a||typeof s!="string"||n.has(a))throw new TypeError("Invalid or duplicate store choice");return n.add(a),{id:a,caption:s}})}else r=Kn(this.parameters.values??"",this.parameters.separator);return r.filter(n=>Object.hasOwn(e,"_id")?n.id===e._id:n.caption.toLocaleLowerCase().includes(e._querystring.toLocaleLowerCase()))}}}function Ol(t){return class extends t{async loadChoices(e){let r=await this.pageContext.callLogic(this.parameters.callback,e);if(!r||!Array.isArray(r.rows)||typeof r.identifier!="string"||typeof r.caption!="string")throw new TypeError("callbackSelect requires {rows, identifier, caption}");let n=new Set;return r.rows.map(i=>{let a=i[r.identifier],s=i[r.caption];if(typeof a!="string"||!a||typeof s!="string"||n.has(a))throw new TypeError("Invalid or duplicate choice code/caption");return n.add(a),{id:a,caption:s}})}}}import{createDOMPurify as Pp}from"@gramlot/gramlot";var Na={dbtable:{dtype:"T",binding:"read"},caption_field:{dtype:"T",binding:"read"},condition:{dtype:"T",binding:"read"},weakCondition:{dtype:["B","T"],default:!1,binding:"read"},method:{dtype:"T",default:"dbSelect",binding:"read"},columns:{dtype:"T",binding:"read"},hiddenColumns:{dtype:"T",binding:"read"},auxColumns:{dtype:"T",binding:"read"},template:{dtype:"T",binding:"read"},templateNull:{dtype:"T",default:"",binding:"read"},order_by:{dtype:"T",binding:"read"},limit:{dtype:"L",default:10,binding:"read"},searchDelay:{dtype:"L",default:300,binding:"read"},ignoreCase:{dtype:"B",default:!0,binding:"read"},hasDownArrow:{dtype:"B",default:!0,binding:"read"},emptyLabel:{dtype:"T",qualification:"intl_str",default:"Clear selection",binding:"read"},selectedCaption:{dtype:"T"},selectedRecord:{dtype:"T"},selectedCb:{dtype:"T"}},Ca=["dbtable","method","caption_field","columns","hiddenColumns","auxColumns","order_by","limit","ignoreCase","condition","weakCondition"];function Sa(t){return class extends t{#e={};#t=!1;#n={};#r=0;#a;#i;#s;constructor(){super(),this.#s=Pp(this.ownerDocument.defaultView)}get choiceSource(){return this.#r}get searchDelay(){return this.parameters.searchDelay}get revalidateDraftOnSourceChange(){return this.constrained}get autoHighlight(){return this.constrained}get matchTypedChoice(){return this.constrained}get emptyChoice(){return this.constrained&&!this.parameters.validate_notnull?{id:null,caption:this.parameters.emptyLabel}:null}get commitOnChange(){return!0}textValue(e){return e===""?null:e}projectAttributes(e,r){let n=Object.fromEntries(Object.entries(e).filter(([c])=>Ca.includes(c)||["autoSelect","template","templateNull","emptyLabel","validate_notnull"].includes(c)||c.startsWith("condition_")||c.startsWith("selected_"))),i=new Set([...Object.keys(n),...Object.keys(this.#e)].filter(c=>c==="condition"||c==="weakCondition"||c.startsWith("condition_")));Object.keys(this.#e).length&&[...i].some(c=>!Object.is(n[c],this.#e[c]))&&(this.#t=!0),[...new Set([...Object.keys(n),...Object.keys(this.#e)])].some(c=>!Object.is(n[c],this.#e[c]))&&(this.cancelValidation(),this.#a=void 0,this.#e=n,this.#r++),this.#n=Object.fromEntries(Object.entries(e).filter(([c])=>c.startsWith("selected_")));let s=super.projectAttributes(e,r);if(this.#i=null,this.parameters.template!=null){this.#i=this.#s.sanitize(this.parameters.template,{USE_PROFILES:{html:!0},RETURN_DOM_FRAGMENT:!0,FORBID_TAGS:["style","form","input","button","select","textarea","a","audio","video","details","summary"],FORBID_ATTR:["id","name","role","tabindex","contenteditable","autofocus"]});for(let c of this.#i.querySelectorAll("*"))if([...c.attributes].some(d=>/\{[A-Za-z0-9_]+\}/.test(d.value)))throw this.#i=null,new TypeError("Selector template placeholders belong in text, not HTML attributes.")}if(this.choices.style.minWidth=this.#i?"min(var(--gramlot-choice-popup-min-width,28rem),var(--gramlot-popup-available-width,100vw))":"",this.parameters.caption_field!=null&&!this.parameters.caption_field.trim())throw new TypeError("caption_field must be a nonempty field name.");if(this.parameters.condition!=null&&!this.parameters.condition.trim())throw new TypeError("condition must be a nonempty expression.");if(typeof this.parameters.weakCondition!="boolean"&&(typeof this.parameters.weakCondition!="string"||!this.parameters.weakCondition.trim()))throw new TypeError("weakCondition must be boolean or a nonempty expression.");let{limit:o,searchDelay:l,hasDownArrow:u}=this.parameters;if(!Number.isInteger(o)||o<1)throw new TypeError("limit must be a positive integer.");if(!Number.isInteger(l)||l<0)throw new TypeError("searchDelay must be a non-negative integer.");this.toggle.hidden=!u,this.control.style.paddingRight=u?"":"var(--gramlot-field-padding, .25em)";for(let c of Object.keys(s))(c.startsWith("condition_")||c.startsWith("selected_"))&&delete s[c];return s}async loadChoices(e,r){let n=Object.fromEntries(Ca.filter(o=>o!=="method"&&this.parameters[o]!=null).map(o=>[o,this.parameters[o]]));n.weakCondition===!1&&delete n.weakCondition;let i=new Set(Object.entries(this.#n).filter(([,o])=>o).map(([o])=>o.slice(9)));if(this.#i){let o=this.ownerDocument.createTreeWalker(this.#i,4);for(;o.nextNode();)for(let l of o.currentNode.data.matchAll(/\{([A-Za-z0-9_]+)\}/g))i.add(l[1])}i.size&&(n.hiddenColumns=[...new Set([...(n.hiddenColumns??"").split(",").map(o=>o.trim()).filter(Boolean),...i])].join(","));for(let[o,l]of Object.entries(this.#e))if(o.startsWith("condition_")){let u=o.slice(10);if(!u||u.startsWith("_")||Ca.includes(u))throw new TypeError("Invalid condition parameter.");n[u]=l}let a=await this.pageContext.remote(this.parameters.method,{...n,...e},r);if(!a||!Array.isArray(a.rows)||typeof a.identifier!="string"||typeof a.caption!="string")throw new TypeError("Database selectors require {rows, identifier, caption}.");if(n.auxColumns!=null){if(!Array.isArray(a.columns)||!Array.isArray(a.headers)||a.columns.length!==a.headers.length||!a.columns.length||a.columns.some(o=>typeof o!="string"||!o)||a.headers.some(o=>typeof o!="string")||new Set(a.columns).size!==a.columns.length)throw new TypeError("auxColumns requires columns and headers display metadata.");for(let o of a.columns)i.add(o)}if(a.errors!=null&&(typeof a.errors!="string"||!Object.hasOwn(e,"_id")))throw new TypeError("Selector errors must be literal text attached to identity lookup.");let s=new Set;return a.rows.map(o=>{let l=o[a.identifier],u=o[a.caption];if(!(typeof l=="string"&&l.length||Number.isSafeInteger(l))||typeof u!="string"||s.has(l))throw new TypeError("Invalid or duplicate database choice identity/caption.");for(let c of i)if(!Object.hasOwn(o,c))throw new TypeError(`Missing requested selector column: ${c}`);return s.add(l),{id:l,caption:u,record:o,error:a.errors,captionField:a.caption,columns:n.auxColumns!=null?a.columns:null,headers:n.auxColumns!=null?a.headers:null}})}selectionAccepted(e){this.#a=e}renderChoice(e,r){if(e.id===null){super.renderChoice(e,r),r.style.color="var(--gramlot-text-secondary,GrayText)",r.style.borderBottom="1px solid var(--gramlot-border,#d5dce5)",r.style.marginBottom="var(--gramlot-space-1,.25rem)";return}if(this.#i){let n=this.#i.cloneNode(!0),i=this.ownerDocument.createTreeWalker(n,4);for(;i.nextNode();)i.currentNode.data=i.currentNode.data.replace(/\{([A-Za-z0-9_]+)\}/g,(a,s)=>e.record[s]==null?this.parameters.templateNull:String(e.record[s]));r.style.display="block",r.style.overflowWrap="anywhere",r.replaceChildren(n);return}if(e.columns){r.style.display="grid",r.style.gridTemplateColumns=`repeat(${e.columns.length}, minmax(0, 1fr))`,r.style.gap="var(--gramlot-space-3,.75rem)",r.style.alignItems="start",r.replaceChildren(...e.columns.map((n,i)=>{let a=this.ownerDocument.createElement("span");a.style.overflowWrap="anywhere";let s=this.ownerDocument.createElement("small");s.textContent=e.headers[i],s.style.display="block",s.style.opacity=".7";let o=this.ownerDocument.createElement("span");return o.textContent=e.record[n]??"",a.append(s,o),a}));return}super.renderChoice(e,r);for(let n of(this.parameters.columns??"").split(",").map(i=>i.trim()).filter(i=>i&&i!==e.captionField)){let i=this.ownerDocument.createElement("span");i.className="choice-detail",i.textContent=e.record[n]??"",r.append(i)}}selectionResolved(e){this.#o(e)}#o(e){let{selectedCaption:r,selectedRecord:n}=this.parameters;this.pageContext.selectionOutputs({selectedCaption:r,selectedRecord:n,fields:this.#n},e)}finishValidation(e){if(e.ok&&this.#a!==void 0){let r=this.#a;if(this.#a=void 0,this.#o(r),this.parameters.selectedCb){let n=i=>console.error("Selection notification failed:",i);try{let i=this.pageContext.callLogic(this.parameters.selectedCb,{value:e.value,record:r?.record??null});i instanceof Promise&&i.catch(n)}catch(i){n(i)}}}super.finishValidation(e)}async resolveValue(){let e=this.#t;if(this.#t=!1,e&&this.active&&!this.locked&&this.constrained&&this.parameters.validate_notnull){let i=await this.request({_querystring:"",limit:2},{selection:!0});if(!i)return;if(i.length===1){this.choose(i[0]);return}}let r=this.readControlValue(),n=super.resolveValue();if(r!=null&&r!=="")return n;if(await n,this.active&&!this.locked&&this.parameters.autoSelect&&this.readControlValue()==null&&this.control.value===""){let i=await this.request({_querystring:"",limit:2},{selection:!0});i?.length===1&&this.readControlValue()==null&&!this.locked&&this.choose(i[0])}}}}var $p=(0,P.defineComponent)({name:"textbox",tag:"gramlot-textbox",base:pe,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"}},implementation:si("input","text")}),Up=(0,P.defineComponent)({name:"checkbox",tag:"gramlot-checkbox",base:pe,mixins:[G,X],parameters:{value:{dtype:"B",binding:"twoWay"},mode:{dtype:"T",default:"checkbox",binding:"read",enum:["checkbox","switch"]},switch_color:{dtype:"T",nullable:!0,default:null,binding:"read"},label:{dtype:"T",qualification:"intl_str",default:"",target:"optionCaption"}},implementation:t=>class extends t{createControl(){let e=this.ownerDocument.createElement("input");return e.type="checkbox",e}constructor(){super();let e=this.ownerDocument.createElement("style");e.textContent=`input[role=switch]{appearance:none;position:relative;flex:none;cursor:pointer;
98
+ .choice[aria-selected=true]{background:var(--gramlot-selected,Highlight);color:var(--gramlot-ink,HighlightText)}`,this.toggle=e.createElement("button"),this.toggle.className="toggle",this.toggle.type="button",this.toggle.tabIndex=-1,this.toggle.textContent="\u25BE",this.toggle.setAttribute("aria-label","Show options"),this.control.parentElement.append(this.toggle),this.choices=e.createElement("div"),this.choices.id="choices",this.choices.className="choices",this.choices.hidden=!0,this.choices.setAttribute("role","listbox"),this.choices.setAttribute("popover","manual"),this.controlBox.append(r,this.choices),this.toggle.addEventListener("mousedown",n=>n.preventDefault()),this.toggle.addEventListener("click",()=>{this.locked||(this.control.focus(),this.#a?this.closeChoices():this.search(""))}),this.choices.addEventListener("mousedown",n=>n.preventDefault()),this.control.addEventListener("input",n=>{this.#i=!0,this.#s=null,n.isComposing||this.scheduleSearch(this.control.value)}),this.control.addEventListener("compositionend",()=>this.scheduleSearch(this.control.value)),this.control.addEventListener("keydown",n=>{if(!(n.isComposing||this.locked))if(n.key==="ArrowDown"||n.key==="ArrowUp"){n.preventDefault();let i=n.key==="ArrowDown"?1:-1;this.#a?this.activate(this.#n<0?i>0?0:this.#t.length-1:Math.max(0,this.#n+i)):this.search("",i)}else n.key==="Enter"?(n.preventDefault(),this.#a&&this.#t[this.#n]?this.choose(this.#t[this.#n]):this.commitDraft()):n.key==="Escape"&&(this.closeChoices(),this.#i=!1,this.#s=null,this.constrained?this.resolveValue():(this.control.value=this.#e??"",this.error("")))}),this.control.addEventListener("blur",()=>{!this.autoHighlight&&this.#a&&this.#t[this.#n]?this.choose(this.#t[this.#n]):this.#i&&this.commitDraft(),this.closeChoices()})}createControl(){let e=this.ownerDocument.createElement("input");return e.type="text",e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-controls","choices"),e.setAttribute("aria-expanded","false"),e.autocomplete="off",e}static get constrained(){return!0}get constrained(){return this.constructor.constrained}get revalidateDraftOnSourceChange(){return!1}get autoHighlight(){return!0}get matchTypedChoice(){return!0}get emptyChoice(){return null}get choiceSource(){return this.parameters.store??this.parameters.callback??this.parameters.values}get searchDelay(){return 0}textValue(e){return e}selectionAccepted(e){}selectionResolved(e){}renderChoice(e,r){r.textContent=e.caption}scheduleSearch(e){if(this.closeChoices(),!this.searchDelay)return this.search(e);this.#d=setTimeout(()=>{this.#d=null,this.search(e)},this.searchDelay)}get commitOnChange(){return this.constrained}get locked(){return this.control.disabled||this.control.readOnly}get active(){return this.isConnected&&this.pageContext?.isActive()}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.choiceSource,a=i!==this.#o||this.parameters.separator!==this.#u;return this.#u=this.parameters.separator,this.#o=i,this.toggle.disabled=this.locked,a&&this.revalidateDraftOnSourceChange&&(this.#i=!1),a&&(this.#t=[],this.#s=null),(a||this.locked)&&this.closeChoices({cancelLookup:a}),a&&this.active&&!this.#i&&this.resolveValue(),n}setPageContext(e){super.setPageContext(e),this.resolveValue()}connectedCallback(){super.connectedCallback(),this.resolveValue()}readControlValue(){return this.#e}writeControlValue(e){Object.is(e,this.#e)||(this.#e=e,this.#i=!1,this.#s=null,this.closeChoices({cancelLookup:!0}),this.resolveValue())}restoreFormDraft(e){this.closeChoices({cancelLookup:!0}),this.#i=!0,this.#s=null,this.control.value=e}restoreFormValue(e){this.#e=e,this.#i=!1,this.#s=null,this.closeChoices({cancelLookup:!0}),this.resolveValue()}static validationValueCheck(){let e=this.constrained;return(r,n)=>{if(e&&r!==n)throw new Error("Validation cannot replace a selected code; update the Data explicitly.")}}static validationSelection(e,r){return this.constrained?async(n,i)=>{if(n==null)return!0;let a=await this.loadChoices(e,r,{_id:n},i);return Bl(a.find(s=>s.id===n),n)}:super.validationSelection(e,r)}validationSelection(){if(!this.constrained)return super.validationSelection();let e=this.#t.map(({id:n,error:i})=>({id:n,error:i})),r=this.#s?{id:this.#s.id,error:this.#s.error}:null;return n=>{let i=r?.id===n?r:e.find(a=>a.id===n);return Bl(i,n)}}acceptControlValue(){if(!this.#i)return this.validateCandidate(this.#e,a=>this.writeControlValue(a));let e=this.#s??(!this.autoHighlight&&this.#a?this.#t[this.#n]:null),r=e&&!this.constrained?e.caption:this.control.value,n=e?[e]:this.matchTypedChoice?this.#t.filter(a=>a.caption===r):[];if(this.constrained&&r!==""&&n.length!==1)return this.error("Choose a value from the list."),{ok:!1};let i=this.constrained?r===""?null:n[0].id:this.textValue(r);return this.validateCandidate(i,a=>{this.validationValueCheck()(a,i),this.#e=a,this.#i=!1,this.#s=null,(a==null||!this.constrained)&&(this.control.value=a??""),this.selectionAccepted(n.length===1&&a===i&&n[0].id!==null?n[0]:null),e&&!this.autoHighlight&&this.closeChoices()})}commitDraft(){this.closeChoices();let e=this.ownerDocument.defaultView.Event;this.control.dispatchEvent(new e("change",{bubbles:!0}))}choose(e){this.locked||!this.active||(this.pageContext.form&&this.pageContext.formSelectionError(e.error??""),this.#s=e,this.#i=!0,this.control.value=e.id===null?"":e.caption,this.closeChoices(),this.commitDraft())}async request(e,{selection:r=!1}={}){this.#c?.abort();let n=new AbortController;this.#c=n,this.#l=r||Object.hasOwn(e,"_id"),this.pageContext.form&&this.#l&&this.pageContext.formSelectionPending(!0);let i=++this.#r;this.control.setAttribute("aria-busy","true"),this.error("");try{let a=await this.loadChoices(e,n.signal);return i!==this.#r||!this.active?null:a}catch(a){return i===this.#r&&this.active&&(this.error(a.message),this.pageContext.form&&this.#l&&this.pageContext.formSelectionError(a.message)),null}finally{i===this.#r&&(this.pageContext.form&&this.#l&&this.pageContext.formSelectionPending(!1),this.#c=null,this.#l=!1,this.control.setAttribute("aria-busy","false"))}}async resolveValue(){if(this.#e==null||this.#e===""){this.pageContext?.form&&(this.pageContext.formSelectionPending(!1),this.pageContext.formSelectionError("")),this.control.value="",this.error(""),this.active&&this.selectionResolved(null);return}if(!this.active)return;if(this.control.value=this.#e,!this.constrained){this.error(""),this.selectionResolved(null);return}let e=this.request({_id:this.#e}),r=this.#r,n=await e;if(!n){r===this.#r&&this.active&&(this.selectionResolved(null),this.pageContext.form&&this.pageContext.formValidate());return}let i=n.find(s=>s.id===this.#e);this.#t=n,this.control.value=i?i.caption:this.#e;let a=i?i.error??"":"Value is not in the list.";this.error(a),this.pageContext.form&&(this.pageContext.formSelectionError(a),this.pageContext.formValidate()),this.selectionResolved(i??null)}async search(e,r=0){if(this.locked||!this.active)return;this.closeChoices(),this.#t=[];let n=await this.request({_querystring:e});if(!n||this.locked||this.shadowRoot.activeElement!==this.control)return;let i=this.emptyChoice;this.#t=i?[i,...n]:n;let a=this.ownerDocument;this.choices.replaceChildren(...this.#t.map((f,p)=>{let h=a.createElement("div");return h.id=`choice-${p}`,h.className="choice",h.setAttribute("role","option"),this.renderChoice(f,h),h.addEventListener("click",()=>this.choose(f)),h})),this.#t.length||(this.choices.textContent="No results");let s=a.defaultView;this.choices.hidden=!1,this.choices.showPopover(),this.#a=!0;let o=parseFloat(s.getComputedStyle(this).getPropertyValue("--gramlot-choice-popup-inset")||"2");ft(this.choices,this.control,{matchWidth:!0,inset:o}),this.control.setAttribute("aria-expanded","true");let l=this.constrained&&!this.#i&&e===""&&this.#e!=null;this.activate(l?this.#t.findIndex(f=>f.id===this.#e):r<0?this.#t.length-1:r>0?0:this.autoHighlight&&n.length?i?1:0:-1);let u=()=>this.closeChoices(),c=f=>{f.composedPath().includes(this)||u()},d=f=>{f.composedPath().includes(this.choices)||u()};a.addEventListener("pointerdown",c,!0),a.addEventListener("scroll",d,!0),s.addEventListener("resize",u),this.#f=()=>{a.removeEventListener("pointerdown",c,!0),a.removeEventListener("scroll",d,!0),s.removeEventListener("resize",u)}}activate(e){this.#n=this.#t.length&&e>=0?Math.min(e,this.#t.length-1):-1;for(let[r,n]of[...this.choices.children].entries())n.setAttribute("aria-selected",String(r===this.#n)),r===this.#n&&n.scrollIntoView({block:"nearest"});this.#n<0?this.control.removeAttribute("aria-activedescendant"):this.control.setAttribute("aria-activedescendant",`choice-${this.#n}`)}closeChoices({cancelLookup:e=!1}={}){clearTimeout(this.#d),this.#d=null,(e||!this.#l)&&(this.pageContext?.form&&this.#l&&this.pageContext.formSelectionPending(!1),this.#c?.abort(),this.#c=null,this.#l=!1,++this.#r,this.control.setAttribute("aria-busy","false")),this.#f?.(),this.#f=null,this.#a&&this.choices.hidePopover(),this.#a=!1,this.choices.hidden=!0,this.control.setAttribute("aria-expanded","false"),this.control.removeAttribute("aria-activedescendant")}releaseControl(){this.closeChoices({cancelLookup:!0})}disconnectedCallback(){this.releaseControl()}}}Bt.parameters={...pe.parameters,value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"}};function Ca(t){return class extends t{loadChoices(e){return this.constructor.loadChoices(this.parameters,this.pageContext,e)}static loadChoices(e,r,n){let i;if(e.store!=null){if(!(e.store instanceof $p))throw new TypeError("store must be a Bag");if(e.values)throw new TypeError("store and values are mutually exclusive");let a=new Set;i=e.store.getNodes().map(s=>{let o=s.staticValue,l=s.attr.caption;if(typeof o!="string"||!o||typeof l!="string"||a.has(o))throw new TypeError("Invalid or duplicate store choice");return a.add(o),{id:o,caption:l}})}else i=Kn(e.values??"",e.separator);return i.filter(a=>Object.hasOwn(n,"_id")?a.id===n._id:a.caption.toLocaleLowerCase().includes(n._querystring.toLocaleLowerCase()))}}}function Il(t){return class extends t{loadChoices(e){return this.constructor.loadChoices(this.parameters,this.pageContext,e)}static async loadChoices(e,r,n){let i=await r.callLogic(e.callback,n);if(!i||!Array.isArray(i.rows)||typeof i.identifier!="string"||typeof i.caption!="string")throw new TypeError("callbackSelect requires {rows, identifier, caption}");let a=new Set;return i.rows.map(s=>{let o=s[i.identifier],l=s[i.caption];if(typeof o!="string"||!o||typeof l!="string"||a.has(o))throw new TypeError("Invalid or duplicate choice code/caption");return a.add(o),{id:o,caption:l}})}}}function Bl(t,e){return t?.error?{errorcode:"condition",message:t.error}:e==null||t?!0:{errorcode:"missing",message:"Choose a value from the list."}}import{createDOMPurify as Up}from"@gramlot/gramlot";var Sa={dbtable:{dtype:"T",binding:"read"},caption_field:{dtype:"T",binding:"read"},condition:{dtype:"T",binding:"read"},weakCondition:{dtype:["B","T"],default:!1,binding:"read"},method:{dtype:"T",default:"dbSelect",binding:"read"},columns:{dtype:"T",binding:"read"},hiddenColumns:{dtype:"T",binding:"read"},auxColumns:{dtype:"T",binding:"read"},template:{dtype:"T",binding:"read"},templateNull:{dtype:"T",default:"",binding:"read"},order_by:{dtype:"T",binding:"read"},limit:{dtype:"L",default:10,binding:"read"},searchDelay:{dtype:"L",default:300,binding:"read"},ignoreCase:{dtype:"B",default:!0,binding:"read"},hasDownArrow:{dtype:"B",default:!0,binding:"read"},emptyLabel:{dtype:"T",qualification:"intl_str",default:"Clear selection",binding:"read"},selectedCaption:{dtype:"T"},selectedRecord:{dtype:"T"},selectedCb:{dtype:"T"}},Na=["dbtable","method","caption_field","columns","hiddenColumns","auxColumns","order_by","limit","ignoreCase","condition","weakCondition"];function Oa(t){return class extends t{#e={};#t=!1;#n={};#r=0;#a;#i;#s;constructor(){super(),this.#s=Up(this.ownerDocument.defaultView)}get choiceSource(){return this.#r}get searchDelay(){return this.parameters.searchDelay}get revalidateDraftOnSourceChange(){return this.constrained}get autoHighlight(){return this.constrained}get matchTypedChoice(){return this.constrained}get emptyChoice(){return this.constrained&&!this.parameters.validate_notnull?{id:null,caption:this.parameters.emptyLabel}:null}get commitOnChange(){return!0}textValue(e){return e===""?null:e}projectAttributes(e,r){let n=Object.fromEntries(Object.entries(e).filter(([c])=>Na.includes(c)||["autoSelect","template","templateNull","emptyLabel","validate_notnull"].includes(c)||c.startsWith("condition_")||c.startsWith("selected_"))),i=new Set([...Object.keys(n),...Object.keys(this.#e)].filter(c=>c==="condition"||c==="weakCondition"||c.startsWith("condition_")));Object.keys(this.#e).length&&[...i].some(c=>!Object.is(n[c],this.#e[c]))&&(this.#t=!0),[...new Set([...Object.keys(n),...Object.keys(this.#e)])].some(c=>!Object.is(n[c],this.#e[c]))&&(this.cancelValidation(),this.#a=void 0,this.#e=n,this.#r++),this.#n=Object.fromEntries(Object.entries(e).filter(([c])=>c.startsWith("selected_")));let s=super.projectAttributes(e,r);if(this.#i=null,this.parameters.template!=null){this.#i=this.#s.sanitize(this.parameters.template,{USE_PROFILES:{html:!0},RETURN_DOM_FRAGMENT:!0,FORBID_TAGS:["style","form","input","button","select","textarea","a","audio","video","details","summary"],FORBID_ATTR:["id","name","role","tabindex","contenteditable","autofocus"]});for(let c of this.#i.querySelectorAll("*"))if([...c.attributes].some(d=>/\{[A-Za-z0-9_]+\}/.test(d.value)))throw this.#i=null,new TypeError("Selector template placeholders belong in text, not HTML attributes.")}if(this.choices.style.minWidth=this.#i?"min(var(--gramlot-choice-popup-min-width,28rem),var(--gramlot-popup-available-width,100vw))":"",this.parameters.caption_field!=null&&!this.parameters.caption_field.trim())throw new TypeError("caption_field must be a nonempty field name.");if(this.parameters.condition!=null&&!this.parameters.condition.trim())throw new TypeError("condition must be a nonempty expression.");if(typeof this.parameters.weakCondition!="boolean"&&(typeof this.parameters.weakCondition!="string"||!this.parameters.weakCondition.trim()))throw new TypeError("weakCondition must be boolean or a nonempty expression.");let{limit:o,searchDelay:l,hasDownArrow:u}=this.parameters;if(!Number.isInteger(o)||o<1)throw new TypeError("limit must be a positive integer.");if(!Number.isInteger(l)||l<0)throw new TypeError("searchDelay must be a non-negative integer.");this.toggle.hidden=!u,this.control.style.paddingRight=u?"":"var(--gramlot-field-padding, .25em)";for(let c of Object.keys(s))(c.startsWith("condition_")||c.startsWith("selected_"))&&delete s[c];return s}loadChoices(e,r){let n=new Set(Object.entries(this.#n).filter(([,i])=>i).map(([i])=>i.slice(9)));if(this.#i){let i=this.ownerDocument.createTreeWalker(this.#i,4);for(;i.nextNode();)for(let a of i.currentNode.data.matchAll(/\{([A-Za-z0-9_]+)\}/g))n.add(a[1])}return this.constructor.loadChoices({...this.parameters,...this.#e},this.pageContext,e,r,n)}static async loadChoices(e,r,n,i,a=new Set){let s=Object.fromEntries(Na.filter(u=>u!=="method"&&e[u]!=null).map(u=>[u,e[u]]));s.weakCondition===!1&&delete s.weakCondition,a.size&&(s.hiddenColumns=[...new Set([...(s.hiddenColumns??"").split(",").map(u=>u.trim()).filter(Boolean),...a])].join(","));for(let[u,c]of Object.entries(e))if(u.startsWith("condition_")){let d=u.slice(10);if(!d||d.startsWith("_")||Na.includes(d))throw new TypeError("Invalid condition parameter.");s[d]=c}let o=await r.remote(e.method,{...s,...n},i);if(!o||!Array.isArray(o.rows)||typeof o.identifier!="string"||typeof o.caption!="string")throw new TypeError("Database selectors require {rows, identifier, caption}.");if(s.auxColumns!=null){if(!Array.isArray(o.columns)||!Array.isArray(o.headers)||o.columns.length!==o.headers.length||!o.columns.length||o.columns.some(u=>typeof u!="string"||!u)||o.headers.some(u=>typeof u!="string")||new Set(o.columns).size!==o.columns.length)throw new TypeError("auxColumns requires columns and headers display metadata.");for(let u of o.columns)a.add(u)}if(o.errors!=null&&(typeof o.errors!="string"||!Object.hasOwn(n,"_id")))throw new TypeError("Selector errors must be literal text attached to identity lookup.");let l=new Set;return o.rows.map(u=>{let c=u[o.identifier],d=u[o.caption];if(!(typeof c=="string"&&c.length||Number.isSafeInteger(c))||typeof d!="string"||l.has(c))throw new TypeError("Invalid or duplicate database choice identity/caption.");for(let f of a)if(!Object.hasOwn(u,f))throw new TypeError(`Missing requested selector column: ${f}`);return l.add(c),{id:c,caption:d,record:u,error:o.errors,captionField:o.caption,columns:s.auxColumns!=null?o.columns:null,headers:s.auxColumns!=null?o.headers:null}})}selectionAccepted(e){this.#a=e}renderChoice(e,r){if(e.id===null){super.renderChoice(e,r),r.style.color="var(--gramlot-text-secondary,GrayText)",r.style.borderBottom="1px solid var(--gramlot-border,#d5dce5)",r.style.marginBottom="var(--gramlot-space-1,.25rem)";return}if(this.#i){let n=this.#i.cloneNode(!0),i=this.ownerDocument.createTreeWalker(n,4);for(;i.nextNode();)i.currentNode.data=i.currentNode.data.replace(/\{([A-Za-z0-9_]+)\}/g,(a,s)=>e.record[s]==null?this.parameters.templateNull:String(e.record[s]));r.style.display="block",r.style.overflowWrap="anywhere",r.replaceChildren(n);return}if(e.columns){r.style.display="grid",r.style.gridTemplateColumns=`repeat(${e.columns.length}, minmax(0, 1fr))`,r.style.gap="var(--gramlot-space-3,.75rem)",r.style.alignItems="start",r.replaceChildren(...e.columns.map((n,i)=>{let a=this.ownerDocument.createElement("span");a.style.overflowWrap="anywhere";let s=this.ownerDocument.createElement("small");s.textContent=e.headers[i],s.style.display="block",s.style.opacity=".7";let o=this.ownerDocument.createElement("span");return o.textContent=e.record[n]??"",a.append(s,o),a}));return}super.renderChoice(e,r);for(let n of(this.parameters.columns??"").split(",").map(i=>i.trim()).filter(i=>i&&i!==e.captionField)){let i=this.ownerDocument.createElement("span");i.className="choice-detail",i.textContent=e.record[n]??"",r.append(i)}}selectionResolved(e){this.#o(e)}#o(e){let{selectedCaption:r,selectedRecord:n}=this.parameters;this.pageContext.selectionOutputs({selectedCaption:r,selectedRecord:n,fields:this.#n},e)}finishValidation(e){if(e.ok&&this.#a!==void 0){let r=this.#a;if(this.#a=void 0,this.#o(r),this.parameters.selectedCb){let n=i=>console.error("Selection notification failed:",i);try{let i=this.pageContext.callLogic(this.parameters.selectedCb,{value:e.value,record:r?.record??null});i instanceof Promise&&i.catch(n)}catch(i){n(i)}}}super.finishValidation(e)}async resolveValue(){let e=this.#t;if(this.#t=!1,e&&this.active&&!this.locked&&this.constrained&&this.parameters.validate_notnull){let i=await this.request({_querystring:"",limit:2},{selection:!0});if(!i)return;if(i.length===1){this.choose(i[0]);return}}let r=this.readControlValue(),n=super.resolveValue();if(r!=null&&r!=="")return n;if(await n,this.active&&!this.locked&&this.parameters.autoSelect&&this.readControlValue()==null&&this.control.value===""){let i=await this.request({_querystring:"",limit:2},{selection:!0});i?.length===1&&this.readControlValue()==null&&!this.locked&&this.choose(i[0])}}}}var Fp=(0,P.defineComponent)({name:"textbox",tag:"gramlot-textbox",base:pe,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"}},implementation:si("input","text")}),qp=(0,P.defineComponent)({name:"checkbox",tag:"gramlot-checkbox",base:pe,mixins:[G,X],parameters:{value:{dtype:"B",binding:"twoWay"},mode:{dtype:"T",default:"checkbox",binding:"read",enum:["checkbox","switch"]},switch_color:{dtype:"T",nullable:!0,default:null,binding:"read"},label:{dtype:"T",qualification:"intl_str",default:"",target:"optionCaption"}},implementation:t=>class extends t{createControl(){let e=this.ownerDocument.createElement("input");return e.type="checkbox",e}constructor(){super();let e=this.ownerDocument.createElement("style");e.textContent=`input[role=switch]{appearance:none;position:relative;flex:none;cursor:pointer;
99
99
  width:var(--gramlot-switch-width,2.5em);height:var(--gramlot-switch-height,1.4em);min-width:0;min-height:0;
100
100
  margin:0;border:1px solid var(--gramlot-border-control,#888);border-radius:2em;
101
101
  background:var(--gramlot-switch-off,var(--gramlot-field-readonly-background,#bbb));transition:background 120ms}
@@ -104,4 +104,4 @@ li button{display:block;width:100%;text-align:start;padding:.55rem .35rem}
104
104
  input[role=switch]:checked{background:var(--gramlot-switch-on,var(--gramlot-brand-blue,Highlight))}
105
105
  input[role=switch]:checked::before{left:calc(100% - var(--gramlot-switch-height,1.4em) + var(--gramlot-switch-inset,2px) + 2px)}
106
106
  input[role=switch]:disabled{cursor:not-allowed}
107
- @media(prefers-reduced-motion:reduce){input[role=switch],input[role=switch]::before{transition:none}}`,this.shadowRoot.append(e),this.control.addEventListener("click",r=>{this.control.readOnly&&r.preventDefault()})}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.parameters.mode;if(!this.constructor.gramlotComponent.parameters.mode.enum.includes(i))throw new TypeError("checkbox mode must be checkbox or switch");return i==="switch"?this.control.setAttribute("role","switch"):this.control.removeAttribute("role"),i==="switch"&&this.parameters.switch_color!=null?this.control.style.setProperty("--gramlot-switch-on",this.parameters.switch_color):this.control.style.removeProperty("--gramlot-switch-on"),n}readControlValue(){return this.control.checked}writeControlValue(e){this.control.checked=e}}}),Fp=(0,P.defineComponent)({name:"radioButtonText",tag:"gramlot-radio-button-text",base:ei,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},values:{dtype:"T",binding:"read"},cols:{dtype:"L",default:1,binding:"read"}},implementation:t=>class extends t{get choiceType(){return"radio"}get multiple(){return!1}}});function si(t,e){return r=>class extends r{createControl(){let n=this.ownerDocument.createElement(t);return t==="input"&&(n.type=e),n}readControlValue(){return this.control.value}writeControlValue(n){this.control.value!==(n??"")&&(this.control.value=n??"")}}}var qp=(0,P.defineComponent)({name:"textBoxArea",tag:"gramlot-text-box-area",base:pe,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"},rows:{dtype:"L",default:4,binding:"read",target:"control"},cols:{dtype:"L",default:24,binding:"read",target:"control"}},implementation:si("textarea")}),jp=(0,P.defineComponent)({name:"passwordbox",tag:"gramlot-passwordbox",base:pe,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"}},implementation:si("input","password")}),Vp=(0,P.defineComponent)({name:"radioButton",tag:"gramlot-radio-button",base:pe,mixins:[G,X],parameters:{value:{dtype:"B",default:!1,binding:"twoWay"},label:{dtype:"T",qualification:"intl_str",default:"",target:"optionCaption"},group:{dtype:"T",nullable:!0,binding:"read"}},implementation:t=>class extends t{createControl(){let e=this.ownerDocument.createElement("input");return e.type="radio",e}readControlValue(){return this.control.checked}writeControlValue(e){this.control.checked=e}}}),zp=(0,P.defineComponent)({name:"colorpicker",tag:"gramlot-colorpicker",base:pe,mixins:[G,X],parameters:{value:{dtype:"T",default:"#000000",binding:"twoWay"}},implementation:si("input","color")}),Bl={value:{dtype:"R",default:0,binding:"twoWay"},min:{dtype:"R",default:0,binding:"read",target:"control"},max:{dtype:"R",default:100,binding:"read",target:"control"},step:{dtype:"R",default:1,binding:"read",target:"control"}};function Il(t){return e=>class extends e{#e;#t=!1;setSourceContext(r){this.#e=r}projectAttributes(r,n){let i=this.parameters,a=super.projectAttributes(r,n);return i&&["min","max","step"].some(s=>i[s]!==this.parameters[s])&&this.writeControlValue(this.parameters.value),a}createControl(){let r=this.ownerDocument.createElement("input");return r.type="range",t?(r.style.cssText="writing-mode:vertical-lr;direction:rtl;width:var(--gramlot-slider-width,1.5rem);height:var(--gramlot-slider-height,10rem)",r.setAttribute("aria-orientation","vertical")):r.style.width="100%",r}readControlValue(){return this.control.valueAsNumber}writeControlValue(r){this.control.value=String(r);let n=this.control.valueAsNumber;if(!this.#t&&Number.isFinite(r)&&Number.isFinite(n)&&n!==r){this.#t=!0;try{this.#e.writeParameter("value",n)}finally{this.#t=!1}}}}}var Hp=(0,P.defineComponent)({name:"horizontalSlider",tag:"gramlot-horizontal-slider",base:pe,mixins:[G,X],parameters:Bl,sourceContext:!0,implementation:Il(!1)}),Wp=(0,P.defineComponent)({name:"verticalSlider",tag:"gramlot-vertical-slider",base:pe,mixins:[G,X],parameters:Bl,sourceContext:!0,implementation:Il(!0)}),Gp=(0,P.defineComponent)({name:"numberTextBox",tag:"gramlot-number-text-box",base:Kr,mixins:[G,X],parameters:{value:{dtype:["L","R","N"],nullable:!0,binding:"twoWay"},dtype:{dtype:"T",default:"R"},min:{dtype:"R",nullable:!0,binding:"read"},max:{dtype:"R",nullable:!0,binding:"read"}},implementation:Al}),Yp=(0,P.defineComponent)({name:"dateTextBox",tag:"gramlot-date-text-box",base:Kr,mixins:[G,X],parameters:{value:{dtype:"D",nullable:!0,binding:"twoWay"},workdate:{dtype:"T",nullable:!0,binding:"read"},calendar:{dtype:"B",default:!0,binding:"read"}},implementation:Tl}),Xp=(0,P.defineComponent)({name:"dateCalendar",tag:"gramlot-date-calendar",base:ka,mixins:[G,X],parameters:{},implementation:t=>class extends t{}}),Zp=(0,P.defineComponent)({name:"timeTextBox",tag:"gramlot-time-text-box",base:Kr,mixins:[G,X],parameters:{value:{dtype:"H",nullable:!0,binding:"twoWay"}},implementation:Cl}),Jp=(0,P.defineComponent)({name:"filteringSelect",tag:"gramlot-filtering-select",base:Bt,mixins:[G,X],parameters:{values:{dtype:"T",default:"",binding:"read"},separator:{dtype:"T",default:",",binding:"read"}},implementation:Ta}),Kp=(0,P.defineComponent)({name:"callbackSelect",tag:"gramlot-callback-select",base:Bt,mixins:[G,X],parameters:{callback:{dtype:"T"}},implementation:Ol}),Qp=(0,P.defineComponent)({name:"comboBox",tag:"gramlot-combo-box",base:Bt,mixins:[G,X],parameters:{values:{dtype:"T",default:"",binding:"read"},separator:{dtype:"T",default:",",binding:"read"},store:{dtype:"X",nullable:!0,default:null,binding:"read"}},implementation:t=>class extends Ta(t){get constrained(){return!1}}}),eh=(0,P.defineComponent)({name:"dbSelect",tag:"gramlot-db-select",base:Bt,mixins:[G,X],parameters:{...Na,value:{dtype:["T","L"],nullable:!0,binding:"twoWay"},autoSelect:{dtype:"B",default:!1,binding:"read"}},implementation:Sa}),th=(0,P.defineComponent)({name:"dbComboBox",tag:"gramlot-db-combo-box",base:Bt,mixins:[G,X],parameters:Na,implementation:t=>class extends Sa(t){get constrained(){return!1}}}),rh=(0,P.defineComponent)({name:"checkBoxText",tag:"gramlot-check-box-text",base:ei,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},values:{dtype:"T",binding:"read"},cols:{dtype:"L",default:1,binding:"read"}},implementation:t=>class extends t{get choiceType(){return"checkbox"}get multiple(){return!0}}}),g0=ci({name:"inputs",components:[ml,$p,Up,Fp,qp,jp,Vp,zp,Hp,Wp,Gp,Yp,Zp,Jp,Kp,Qp,eh,th,rh,Xp]});export{Kp as CallbackSelect,rh as CheckBoxText,Up as Checkbox,zp as Colorpicker,Qp as ComboBox,Xp as DateCalendar,Yp as DateTextBox,th as DbComboBox,eh as DbSelect,Jp as FilteringSelect,Hp as HorizontalSlider,Gp as NumberTextBox,jp as Passwordbox,Vp as RadioButton,Fp as RadioButtonText,qp as TextBoxArea,$p as Textbox,Zp as TimeTextBox,Wp as VerticalSlider,g0 as default};
107
+ @media(prefers-reduced-motion:reduce){input[role=switch],input[role=switch]::before{transition:none}}`,this.shadowRoot.append(e),this.control.addEventListener("click",r=>{this.control.readOnly&&r.preventDefault()})}projectAttributes(e,r){let n=super.projectAttributes(e,r),i=this.parameters.mode;if(!this.constructor.gramlotComponent.parameters.mode.enum.includes(i))throw new TypeError("checkbox mode must be checkbox or switch");return i==="switch"?this.control.setAttribute("role","switch"):this.control.removeAttribute("role"),i==="switch"&&this.parameters.switch_color!=null?this.control.style.setProperty("--gramlot-switch-on",this.parameters.switch_color):this.control.style.removeProperty("--gramlot-switch-on"),n}readControlValue(){return this.control.checked}writeControlValue(e){this.control.checked=e}}}),jp=(0,P.defineComponent)({name:"radioButtonText",tag:"gramlot-radio-button-text",base:ei,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},values:{dtype:"T",binding:"read"},cols:{dtype:"L",default:1,binding:"read"}},implementation:t=>class extends t{get choiceType(){return"radio"}get multiple(){return!1}}});function si(t,e){return r=>class extends r{createControl(){let n=this.ownerDocument.createElement(t);return t==="input"&&(n.type=e),n}readControlValue(){return this.control.value}writeControlValue(n){this.control.value!==(n??"")&&(this.control.value=n??"")}}}var Vp=(0,P.defineComponent)({name:"textBoxArea",tag:"gramlot-text-box-area",base:pe,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"},rows:{dtype:"L",default:4,binding:"read",target:"control"},cols:{dtype:"L",default:24,binding:"read",target:"control"}},implementation:si("textarea")}),zp=(0,P.defineComponent)({name:"passwordbox",tag:"gramlot-passwordbox",base:pe,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},placeholder:{dtype:"T",qualification:"intl_str",default:"",target:"control"}},implementation:si("input","password")}),Hp=(0,P.defineComponent)({name:"radioButton",tag:"gramlot-radio-button",base:pe,mixins:[G,X],parameters:{value:{dtype:"B",default:!1,binding:"twoWay"},label:{dtype:"T",qualification:"intl_str",default:"",target:"optionCaption"},group:{dtype:"T",nullable:!0,binding:"read"}},implementation:t=>class extends t{createControl(){let e=this.ownerDocument.createElement("input");return e.type="radio",e}readControlValue(){return this.control.checked}writeControlValue(e){this.control.checked=e}}}),Wp=(0,P.defineComponent)({name:"colorpicker",tag:"gramlot-colorpicker",base:pe,mixins:[G,X],parameters:{value:{dtype:"T",default:"#000000",binding:"twoWay"}},implementation:si("input","color")}),Ml={value:{dtype:"R",default:0,binding:"twoWay"},min:{dtype:"R",default:0,binding:"read",target:"control"},max:{dtype:"R",default:100,binding:"read",target:"control"},step:{dtype:"R",default:1,binding:"read",target:"control"}};function Rl(t){return e=>class extends e{#e;#t=!1;setSourceContext(r){this.#e=r}projectAttributes(r,n){let i=this.parameters,a=super.projectAttributes(r,n);return i&&["min","max","step"].some(s=>i[s]!==this.parameters[s])&&this.writeControlValue(this.parameters.value),a}createControl(){let r=this.ownerDocument.createElement("input");return r.type="range",t?(r.style.cssText="writing-mode:vertical-lr;direction:rtl;width:var(--gramlot-slider-width,1.5rem);height:var(--gramlot-slider-height,10rem)",r.setAttribute("aria-orientation","vertical")):r.style.width="100%",r}readControlValue(){return this.control.valueAsNumber}writeControlValue(r){this.control.value=String(r);let n=this.control.valueAsNumber;if(!this.#t&&Number.isFinite(r)&&Number.isFinite(n)&&n!==r){this.#t=!0;try{this.#e.writeParameter("value",n)}finally{this.#t=!1}}}}}var Gp=(0,P.defineComponent)({name:"horizontalSlider",tag:"gramlot-horizontal-slider",base:pe,mixins:[G,X],parameters:Ml,sourceContext:!0,implementation:Rl(!1)}),Yp=(0,P.defineComponent)({name:"verticalSlider",tag:"gramlot-vertical-slider",base:pe,mixins:[G,X],parameters:Ml,sourceContext:!0,implementation:Rl(!0)}),Xp=(0,P.defineComponent)({name:"numberTextBox",tag:"gramlot-number-text-box",base:Kr,mixins:[G,X],parameters:{value:{dtype:["L","R","N"],nullable:!0,binding:"twoWay"},dtype:{dtype:"T",default:"R"},min:{dtype:"R",nullable:!0,binding:"read"},max:{dtype:"R",nullable:!0,binding:"read"}},implementation:Tl}),Zp=(0,P.defineComponent)({name:"dateTextBox",tag:"gramlot-date-text-box",base:Kr,mixins:[G,X],parameters:{value:{dtype:"D",nullable:!0,binding:"twoWay"},workdate:{dtype:"T",nullable:!0,binding:"read"},calendar:{dtype:"B",default:!0,binding:"read"}},implementation:Cl}),Jp=(0,P.defineComponent)({name:"dateCalendar",tag:"gramlot-date-calendar",base:Ea,mixins:[G,X],parameters:{},implementation:t=>class extends t{}}),Kp=(0,P.defineComponent)({name:"timeTextBox",tag:"gramlot-time-text-box",base:Kr,mixins:[G,X],parameters:{value:{dtype:"H",nullable:!0,binding:"twoWay"}},implementation:Nl}),Qp=(0,P.defineComponent)({name:"filteringSelect",tag:"gramlot-filtering-select",base:Bt,mixins:[G,X],parameters:{values:{dtype:"T",default:"",binding:"read"},separator:{dtype:"T",default:",",binding:"read"}},implementation:Ca}),eh=(0,P.defineComponent)({name:"callbackSelect",tag:"gramlot-callback-select",base:Bt,mixins:[G,X],parameters:{callback:{dtype:"T"}},implementation:Il}),th=(0,P.defineComponent)({name:"comboBox",tag:"gramlot-combo-box",base:Bt,mixins:[G,X],parameters:{values:{dtype:"T",default:"",binding:"read"},separator:{dtype:"T",default:",",binding:"read"},store:{dtype:"X",nullable:!0,default:null,binding:"read"}},implementation:t=>class extends Ca(t){static get constrained(){return!1}}}),rh=(0,P.defineComponent)({name:"dbSelect",tag:"gramlot-db-select",base:Bt,mixins:[G,X],parameters:{...Sa,value:{dtype:["T","L"],nullable:!0,binding:"twoWay"},autoSelect:{dtype:"B",default:!1,binding:"read"}},implementation:Oa}),nh=(0,P.defineComponent)({name:"dbComboBox",tag:"gramlot-db-combo-box",base:Bt,mixins:[G,X],parameters:Sa,implementation:t=>class extends Oa(t){static get constrained(){return!1}}}),ih=(0,P.defineComponent)({name:"checkBoxText",tag:"gramlot-check-box-text",base:ei,mixins:[G,X],parameters:{value:{dtype:"T",nullable:!0,binding:"twoWay"},values:{dtype:"T",binding:"read"},cols:{dtype:"L",default:1,binding:"read"}},implementation:t=>class extends t{get choiceType(){return"checkbox"}get multiple(){return!0}}}),w0=ci({name:"inputs",components:[gl,Fp,qp,jp,Vp,zp,Hp,Wp,Gp,Yp,Xp,Zp,Kp,Qp,eh,th,rh,nh,ih,Jp]});export{eh as CallbackSelect,ih as CheckBoxText,qp as Checkbox,Wp as Colorpicker,th as ComboBox,Jp as DateCalendar,Zp as DateTextBox,nh as DbComboBox,rh as DbSelect,Qp as FilteringSelect,Gp as HorizontalSlider,Xp as NumberTextBox,zp as Passwordbox,Hp as RadioButton,jp as RadioButtonText,Vp as TextBoxArea,Fp as Textbox,Kp as TimeTextBox,Yp as VerticalSlider,w0 as default};