edockit 0.4.0-dev.1 → 0.4.1

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 (48) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/README.md +3 -7
  3. package/dist/{certificate-3c9dcdac.js → certificate-85461237.js} +11 -11
  4. package/dist/certificate-85461237.js.map +1 -0
  5. package/dist/{certificate-c7123a37.js → certificate-e6d074b8.js} +11 -11
  6. package/dist/certificate-e6d074b8.js.map +1 -0
  7. package/dist/core/parser/types.d.ts +16 -0
  8. package/dist/core/revocation/index.d.ts +1 -1
  9. package/dist/core/revocation/ocsp.d.ts +21 -0
  10. package/dist/core/trustedlist/build.d.ts +2 -1
  11. package/dist/core/trustedlist/index.d.ts +13 -0
  12. package/dist/core/trustedlist/loader.d.ts +14 -0
  13. package/dist/core/trustedlist/types.d.ts +4 -0
  14. package/dist/{identity-fca881b1.js → identity-2eb76bc9.js} +80 -7
  15. package/dist/identity-2eb76bc9.js.map +1 -0
  16. package/dist/{identity-c9e5052e.js → identity-d8910151.js} +77 -3
  17. package/dist/identity-d8910151.js.map +1 -0
  18. package/dist/index.cjs.js +3566 -164
  19. package/dist/index.cjs.js.map +1 -1
  20. package/dist/index.esm.js +3567 -165
  21. package/dist/index.esm.js.map +1 -1
  22. package/dist/index.umd.js +17 -17
  23. package/dist/index.umd.js.map +1 -1
  24. package/dist/{loader-ad1a5051.js → loader-776cb996.js} +21 -3
  25. package/dist/loader-776cb996.js.map +1 -0
  26. package/dist/{loader-7a0f771f.js → loader-9ce42535.js} +21 -2
  27. package/dist/loader-9ce42535.js.map +1 -0
  28. package/dist/{reference-provider-3838ebfb.js → reference-provider-1dd56087.js} +3 -3
  29. package/dist/{reference-provider-3838ebfb.js.map → reference-provider-1dd56087.js.map} +1 -1
  30. package/dist/{reference-provider-9bbbaab8.js → reference-provider-50466d83.js} +3 -3
  31. package/dist/{reference-provider-9bbbaab8.js.map → reference-provider-50466d83.js.map} +1 -1
  32. package/dist/trusted-list-build.cjs.js +65 -30
  33. package/dist/trusted-list-build.cjs.js.map +1 -1
  34. package/dist/trusted-list-build.esm.js +64 -28
  35. package/dist/trusted-list-build.esm.js.map +1 -1
  36. package/dist/trusted-list-bundled.cjs.js +4 -30392
  37. package/dist/trusted-list-bundled.cjs.js.map +1 -1
  38. package/dist/trusted-list-bundled.esm.js +4 -30392
  39. package/dist/trusted-list-bundled.esm.js.map +1 -1
  40. package/dist/trusted-list.cjs.js +3 -3
  41. package/dist/trusted-list.esm.js +3 -3
  42. package/package.json +8 -1
  43. package/dist/certificate-3c9dcdac.js.map +0 -1
  44. package/dist/certificate-c7123a37.js.map +0 -1
  45. package/dist/identity-c9e5052e.js.map +0 -1
  46. package/dist/identity-fca881b1.js.map +0 -1
  47. package/dist/loader-7a0f771f.js.map +0 -1
  48. package/dist/loader-ad1a5051.js.map +0 -1
package/dist/index.umd.js CHANGED
@@ -1,20 +1,20 @@
1
- var Hf=Object.defineProperty,qf=Object.defineProperties;var jf=Object.getOwnPropertyDescriptors;var Pi=Object.getOwnPropertySymbols;var sl=Object.prototype.hasOwnProperty,ul=Object.prototype.propertyIsEnumerable;var ol=(Ne,ze,ke)=>ze in Ne?Hf(Ne,ze,{enumerable:!0,configurable:!0,writable:!0,value:ke}):Ne[ze]=ke,Fe=(Ne,ze)=>{for(var ke in ze||(ze={}))sl.call(ze,ke)&&ol(Ne,ke,ze[ke]);if(Pi)for(var ke of Pi(ze))ul.call(ze,ke)&&ol(Ne,ke,ze[ke]);return Ne},Qe=(Ne,ze)=>qf(Ne,jf(ze));var We=(Ne,ze)=>{var ke={};for(var Ot in Ne)sl.call(Ne,Ot)&&ze.indexOf(Ot)<0&&(ke[Ot]=Ne[Ot]);if(Ne!=null&&Pi)for(var Ot of Pi(Ne))ze.indexOf(Ot)<0&&ul.call(Ne,Ot)&&(ke[Ot]=Ne[Ot]);return ke};/*!
1
+ var dp=Object.defineProperty,gp=Object.defineProperties;var mp=Object.getOwnPropertyDescriptors;var Ki=Object.getOwnPropertySymbols;var Nl=Object.prototype.hasOwnProperty,wl=Object.prototype.propertyIsEnumerable;var Al=(Ce,We,Le)=>We in Ce?dp(Ce,We,{enumerable:!0,configurable:!0,writable:!0,value:Le}):Ce[We]=Le,Ve=(Ce,We)=>{for(var Le in We||(We={}))Nl.call(We,Le)&&Al(Ce,Le,We[Le]);if(Ki)for(var Le of Ki(We))wl.call(We,Le)&&Al(Ce,Le,We[Le]);return Ce},Je=(Ce,We)=>gp(Ce,mp(We));var Xe=(Ce,We)=>{var Le={};for(var _t in Ce)Nl.call(Ce,_t)&&We.indexOf(_t)<0&&(Le[_t]=Ce[_t]);if(Ce!=null&&Ki)for(var _t of Ki(Ce))We.indexOf(_t)<0&&wl.call(Ce,_t)&&(Le[_t]=Ce[_t]);return Le};/*!
2
2
  * MIT License
3
3
  * Copyright (c) 2025 Edgars Jēkabsons, ZenomyTech SIA
4
- */(function(Ne,ze){typeof exports=="object"&&typeof module!="undefined"?ze(exports,require("fflate"),require("@peculiar/x509")):typeof define=="function"&&define.amd?define(["exports","fflate","@peculiar/x509"],ze):(Ne=typeof globalThis!="undefined"?globalThis:Ne||self,ze(Ne.edockit={},Ne.fflate,Ne.peculiarX509))})(this,(function(Ne,ze,ke){"use strict";function Ot(n,e){return e.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(i){if(i!=="default"&&!(i in n)){var o=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(n,i,o.get?o:{enumerable:!0,get:function(){return r[i]}})}})}),Object.freeze(n)}function al(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var De={},nt={},Rs;function Tr(){if(Rs)return nt;Rs=1;function n(R,K,Ae){if(Ae===void 0&&(Ae=Array.prototype),R&&typeof Ae.find=="function")return Ae.find.call(R,K);for(var be=0;be<R.length;be++)if(r(R,be)){var Ce=R[be];if(K.call(void 0,Ce,be,R))return Ce}}function e(R,K){return K===void 0&&(K=Object),K&&typeof K.getOwnPropertyDescriptors=="function"&&(R=K.create(null,K.getOwnPropertyDescriptors(R))),K&&typeof K.freeze=="function"?K.freeze(R):R}function r(R,K){return Object.prototype.hasOwnProperty.call(R,K)}function i(R,K){if(R===null||typeof R!="object")throw new TypeError("target is not an object");for(var Ae in K)r(K,Ae)&&(R[Ae]=K[Ae]);return R}var o=e({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 u(R){return r(o,R.toLowerCase())}var l=e({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 f(R){return r(l,R.toLowerCase())}var p=e({script:!1,style:!1,textarea:!0,title:!0});function g(R){var K=R.toLowerCase();return r(p,K)&&!p[K]}function N(R){var K=R.toLowerCase();return r(p,K)&&p[K]}function E(R){return R===C.HTML}function S(R){return E(R)||R===C.XML_XHTML_APPLICATION}var C=e({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),I=Object.keys(C).map(function(R){return C[R]});function H(R){return I.indexOf(R)>-1}var U=e({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/"});return nt.assign=i,nt.find=n,nt.freeze=e,nt.HTML_BOOLEAN_ATTRIBUTES=o,nt.HTML_RAW_TEXT_ELEMENTS=p,nt.HTML_VOID_ELEMENTS=l,nt.hasDefaultHTMLNamespace=S,nt.hasOwn=r,nt.isHTMLBooleanAttribute=u,nt.isHTMLRawTextElement=g,nt.isHTMLEscapableRawTextElement=N,nt.isHTMLMimeType=E,nt.isHTMLVoidElement=f,nt.isValidMimeType=H,nt.MIME_TYPE=C,nt.NAMESPACE=U,nt}var Sr={},ks;function Bn(){if(ks)return Sr;ks=1;var n=Tr();function e(S,C){S.prototype=Object.create(Error.prototype,{constructor:{value:S},name:{value:S.name,enumerable:!0,writable:C}})}var r=n.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"}),i=Object.keys(r);function o(S){return typeof S=="number"&&S>=1&&S<=25}function u(S){return typeof S=="string"&&S.substring(S.length-r.Error.length)===r.Error}function l(S,C){o(S)?(this.name=i[S],this.message=C||""):(this.message=S,this.name=u(C)?C:r.Error),Error.captureStackTrace&&Error.captureStackTrace(this,l)}e(l,!0),Object.defineProperties(l.prototype,{code:{enumerable:!0,get:function(){var S=i.indexOf(this.name);return o(S)?S:0}}});for(var f={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},p=Object.entries(f),g=0;g<p.length;g++){var N=p[g][0];l[N]=p[g][1]}function E(S,C){this.message=S,this.locator=C,Error.captureStackTrace&&Error.captureStackTrace(this,E)}return e(E),Sr.DOMException=l,Sr.DOMExceptionName=r,Sr.ExceptionCode=f,Sr.ParseError=E,Sr}var $e={},ye={},_s;function Ls(){if(_s)return ye;_s=1;function n(qe){try{typeof qe!="function"&&(qe=RegExp);var Le=new qe("\u{1D306}","u").exec("\u{1D306}");return!!Le&&Le[0].length===2}catch(t){}return!1}var e=n();function r(qe){if(qe.source[0]!=="[")throw new Error(qe+" can not be used with chars");return qe.source.slice(1,qe.source.lastIndexOf("]"))}function i(qe,Le){if(qe.source[0]!=="[")throw new Error("/"+qe.source+"/ can not be used with chars_without");if(!Le||typeof Le!="string")throw new Error(JSON.stringify(Le)+" is not a valid search");if(qe.source.indexOf(Le)===-1)throw new Error('"'+Le+'" is not is /'+qe.source+"/");if(Le==="-"&&qe.source.indexOf(Le)!==1)throw new Error('"'+Le+'" is not at the first postion of /'+qe.source+"/");return new RegExp(qe.source.replace(Le,""),e?"u":"")}function o(qe){var Le=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(t){var a=typeof t=="string";if(a&&Le===void 0&&t==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return a?t:t.source}).join(""),e?"mu":"m")}function u(qe){if(arguments.length===0)throw new Error("no parameters provided");return o.apply(u,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var l="\uFFFD",f=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;e&&(f=o("[",r(f),"\\u{10000}-\\u{10FFFF}","]"));var p=/[\x20\x09\x0D\x0A]/,g=r(p),N=o(p,"+"),E=o(p,"*"),S=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;e&&(S=o("[",r(S),"\\u{10000}-\\u{10FFFF}","]"));var C=r(S),I=o("[",C,r(/[-.0-9\xB7]/),r(/[\u0300-\u036F\u203F-\u2040]/),"]"),H=o(S,I,"*"),U=o(I,"+"),R=o("&",H,";"),K=u(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),Ae=u(R,"|",K),be=o("%",H,";"),Ce=u(o('"',u(/[^%&"]/,"|",be,"|",Ae),"*",'"'),"|",o("'",u(/[^%&']/,"|",be,"|",Ae),"*","'")),D=u('"',u(/[^<&"]/,"|",Ae),"*",'"',"|","'",u(/[^<&']/,"|",Ae),"*","'"),A=i(S,":"),q=i(I,":"),re=o(A,q,"*"),Q=o(re,u(":",re),"?"),ge=o("^",Q,"$"),Ie=o("(",Q,")"),k=u(/"[^"]*"|'[^']*'/),de=o(/^<\?/,"(",H,")",u(N,"(",f,"*?)"),"?",/\?>/),B=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,F=u('"',B,'*"',"|","'",i(B,"'"),"*'"),Y="<!--",M="-->",V=o(Y,u(i(f,"-"),"|",o("-",i(f,"-"))),"*",M),_="#PCDATA",z=u(o(/\(/,E,_,u(E,/\|/,E,Q),"*",E,/\)\*/),"|",o(/\(/,E,_,E,/\)/)),fe=/[?*+]?/,oe=o(/\([^>]+\)/,fe),G=u("EMPTY","|","ANY","|",z,"|",oe),J="<!ELEMENT",ue=o(J,N,u(Q,"|",be),N,u(G,"|",be),E,">"),pe=o("NOTATION",N,/\(/,E,H,u(E,/\|/,E,H),"*",E,/\)/),le=o(/\(/,E,U,u(E,/\|/,E,U),"*",E,/\)/),Et=u(pe,"|",le),at=u(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",Et),Ze=u(/#REQUIRED|#IMPLIED/,"|",u(u("#FIXED",N),"?",D)),ae=u(N,H,N,at,N,Ze),Gt="<!ATTLIST",et=o(Gt,N,H,ae,"*",E,">"),L="about:legacy-compat",Xt=u('"'+L+'"',"|","'"+L+"'"),$="SYSTEM",Ge="PUBLIC",tt=u(u($,N,k),"|",u(Ge,N,F,N,k)),Oe=o("^",u(u($,N,"(?<SystemLiteralOnly>",k,")"),"|",u(Ge,N,"(?<PubidLiteral>",F,")",N,"(?<SystemLiteral>",k,")"))),ne=u(N,"NDATA",N,H),Z=u(Ce,"|",u(tt,ne,"?")),Re="<!ENTITY",Wt=o(Re,N,H,N,Z,E,">"),X=u(Ce,"|",tt),Xe=o(Re,N,"%",N,H,N,X,E,">"),Cr=u(Wt,"|",Xe),W=o(Ge,N,F),gt=o("<!NOTATION",N,H,N,u(tt,"|",W),E,">"),ce=o(E,"=",E),Te=/1[.]\d+/,_e=o(N,"version",ce,u("'",Te,"'","|",'"',Te,'"')),He=/[A-Za-z][-A-Za-z0-9._]*/,se=u(N,"encoding",ce,u('"',He,'"',"|","'",He,"'")),ee=u(N,"standalone",ce,u("'",u("yes","|","no"),"'","|",'"',u("yes","|","no"),'"')),nr=o(/^<\?xml/,_e,se,"?",ee,"?",E,/\?>/),lt="<!DOCTYPE",ct="<![CDATA[",St="]]>",Dt=/<!\[CDATA\[/,he=/\]\]>/,ir=o(f,"*?",he),xr=o(Dt,ir);return ye.chars=r,ye.chars_without=i,ye.detectUnicodeSupport=n,ye.reg=o,ye.regg=u,ye.ABOUT_LEGACY_COMPAT=L,ye.ABOUT_LEGACY_COMPAT_SystemLiteral=Xt,ye.AttlistDecl=et,ye.CDATA_START=ct,ye.CDATA_END=St,ye.CDSect=xr,ye.Char=f,ye.Comment=V,ye.COMMENT_START=Y,ye.COMMENT_END=M,ye.DOCTYPE_DECL_START=lt,ye.elementdecl=ue,ye.EntityDecl=Cr,ye.EntityValue=Ce,ye.ExternalID=tt,ye.ExternalID_match=Oe,ye.Name=H,ye.NotationDecl=gt,ye.Reference=Ae,ye.PEReference=be,ye.PI=de,ye.PUBLIC=Ge,ye.PubidLiteral=F,ye.QName=Q,ye.QName_exact=ge,ye.QName_group=Ie,ye.S=N,ye.SChar_s=g,ye.S_OPT=E,ye.SYSTEM=$,ye.SystemLiteral=k,ye.UNICODE_REPLACEMENT_CHARACTER=l,ye.UNICODE_SUPPORT=e,ye.XMLDecl=nr,ye}var Ms;function Fs(){if(Ms)return $e;Ms=1;var n=Tr(),e=n.find,r=n.hasDefaultHTMLNamespace,i=n.hasOwn,o=n.isHTMLMimeType,u=n.isHTMLRawTextElement,l=n.isHTMLVoidElement,f=n.MIME_TYPE,p=n.NAMESPACE,g=Symbol(),N=Bn(),E=N.DOMException,S=N.DOMExceptionName,C=Ls();function I(s){if(s!==g)throw new TypeError("Illegal constructor")}function H(s){return s!==""}function U(s){return s?s.split(/[\t\n\f\r ]+/).filter(H):[]}function R(s,c){return i(s,c)||(s[c]=!0),s}function K(s){if(!s)return[];var c=U(s);return Object.keys(c.reduce(R,{}))}function Ae(s){return function(c){return s&&s.indexOf(c)!==-1}}function be(s){if(!C.QName_exact.test(s))throw new E(E.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+s+'"')}function Ce(s,c){be(c),s=s||null;var y=null,b=c;if(c.indexOf(":")>=0){var x=c.split(":");y=x[0],b=x[1]}if(y!==null&&s===null)throw new E(E.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(y==="xml"&&s!==n.NAMESPACE.XML)throw new E(E.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((y==="xmlns"||c==="xmlns")&&s!==n.NAMESPACE.XMLNS)throw new E(E.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(s===n.NAMESPACE.XMLNS&&y!=="xmlns"&&c!=="xmlns")throw new E(E.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[s,y,b]}function D(s,c){for(var y in s)i(s,y)&&(c[y]=s[y])}function A(s,c){var y=s.prototype;if(!(y instanceof c)){let b=function(){};b.prototype=c.prototype,b=new b,D(y,b),s.prototype=y=b}y.constructor!=s&&(typeof s!="function"&&console.error("unknown Class:"+s),y.constructor=s)}var q={},re=q.ELEMENT_NODE=1,Q=q.ATTRIBUTE_NODE=2,ge=q.TEXT_NODE=3,Ie=q.CDATA_SECTION_NODE=4,k=q.ENTITY_REFERENCE_NODE=5,de=q.ENTITY_NODE=6,B=q.PROCESSING_INSTRUCTION_NODE=7,F=q.COMMENT_NODE=8,Y=q.DOCUMENT_NODE=9,M=q.DOCUMENT_TYPE_NODE=10,V=q.DOCUMENT_FRAGMENT_NODE=11,_=q.NOTATION_NODE=12,z=n.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 fe(s,c){if(c.length<s.length)return fe(c,s);var y=null;for(var b in s){if(s[b]!==c[b])return y;y=s[b]}return y}function oe(s){return s.guid||(s.guid=Math.random()),s.guid}function G(){}G.prototype={length:0,item:function(s){return s>=0&&s<this.length?this[s]:null},toString:function(s){for(var c=[],y=0;y<this.length;y++)a(this[y],c,s);return c.join("")},filter:function(s){return Array.prototype.filter.call(this,s)},indexOf:function(s){return Array.prototype.indexOf.call(this,s)}},G.prototype[Symbol.iterator]=function(){var s=this,c=0;return{next:function(){return c<s.length?{value:s[c++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function J(s,c){this._node=s,this._refresh=c,ue(this)}function ue(s){var c=s._node._inc||s._node.ownerDocument._inc;if(s._inc!==c){var y=s._refresh(s._node);if(v(s,"length",y.length),!s.$$length||y.length<s.$$length)for(var b=y.length;b in s;b++)i(s,b)&&delete s[b];D(y,s),s._inc=c}}J.prototype.item=function(s){return ue(this),this[s]||null},A(J,G);function pe(){}function le(s,c){for(var y=0;y<s.length;){if(s[y]===c)return y;y++}}function Et(s,c,y,b){if(b?c[le(c,b)]=y:(c[c.length]=y,c.length++),s){y.ownerElement=s;var x=s.ownerDocument;x&&(b&&$(x,s,b),Xt(x,s,y))}}function at(s,c,y){var b=le(c,y);if(b>=0){for(var x=c.length-1;b<=x;)c[b]=c[++b];if(c.length=x,s){var O=s.ownerDocument;O&&$(O,s,y),y.ownerElement=null}}}pe.prototype={length:0,item:G.prototype.item,getNamedItem:function(s){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(s=s.toLowerCase());for(var c=0;c<this.length;){var y=this[c];if(y.nodeName===s)return y;c++}return null},setNamedItem:function(s){var c=s.ownerElement;if(c&&c!==this._ownerElement)throw new E(E.INUSE_ATTRIBUTE_ERR);var y=this.getNamedItemNS(s.namespaceURI,s.localName);return y===s?s:(Et(this._ownerElement,this,s,y),y)},setNamedItemNS:function(s){return this.setNamedItem(s)},removeNamedItem:function(s){var c=this.getNamedItem(s);if(!c)throw new E(E.NOT_FOUND_ERR,s);return at(this._ownerElement,this,c),c},removeNamedItemNS:function(s,c){var y=this.getNamedItemNS(s,c);if(!y)throw new E(E.NOT_FOUND_ERR,s?s+" : "+c:c);return at(this._ownerElement,this,y),y},getNamedItemNS:function(s,c){s||(s=null);for(var y=0;y<this.length;){var b=this[y];if(b.localName===c&&b.namespaceURI===s)return b;y++}return null}},pe.prototype[Symbol.iterator]=function(){var s=this,c=0;return{next:function(){return c<s.length?{value:s[c++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Ze(){}Ze.prototype={hasFeature:function(s,c){return!0},createDocument:function(s,c,y){var b=f.XML_APPLICATION;s===p.HTML?b=f.XML_XHTML_APPLICATION:s===p.SVG&&(b=f.XML_SVG_IMAGE);var x=new L(g,{contentType:b});if(x.implementation=this,x.childNodes=new G,x.doctype=y||null,y&&x.appendChild(y),c){var O=x.createElementNS(s,c);x.appendChild(O)}return x},createDocumentType:function(s,c,y,b){be(s);var x=new lt(g);return x.name=s,x.nodeName=s,x.publicId=c||"",x.systemId=y||"",x.internalSubset=b||"",x.childNodes=new G,x},createHTMLDocument:function(s){var c=new L(g,{contentType:f.HTML});if(c.implementation=this,c.childNodes=new G,s!==!1){c.doctype=this.createDocumentType("html"),c.doctype.ownerDocument=c,c.appendChild(c.doctype);var y=c.createElement("html");c.appendChild(y);var b=c.createElement("head");if(y.appendChild(b),typeof s=="string"){var x=c.createElement("title");x.appendChild(c.createTextNode(s)),b.appendChild(x)}y.appendChild(c.createElement("body"))}return c}};function ae(s){I(s)}ae.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 s=this.getRootNode();return s&&s.nodeType===s.DOCUMENT_NODE},contains:function(s){if(!s)return!1;var c=s;do{if(this===c)return!0;c=s.parentNode}while(c);return!1},getRootNode:function(s){var c=this;do{if(!c.parentNode)return c;c=c.parentNode}while(c)},isEqualNode:function(s){if(!s||this.nodeType!==s.nodeType)return!1;switch(this.nodeType){case this.DOCUMENT_TYPE_NODE:if(this.name!==s.name||this.publicId!==s.publicId||this.systemId!==s.systemId)return!1;break;case this.ELEMENT_NODE:if(this.namespaceURI!==s.namespaceURI||this.prefix!==s.prefix||this.localName!==s.localName||this.attributes.length!==s.attributes.length)return!1;for(var c=0;c<this.attributes.length;c++){var y=this.attributes.item(c);if(!y.isEqualNode(s.getAttributeNodeNS(y.namespaceURI,y.localName)))return!1}break;case this.ATTRIBUTE_NODE:if(this.namespaceURI!==s.namespaceURI||this.localName!==s.localName||this.value!==s.value)return!1;break;case this.PROCESSING_INSTRUCTION_NODE:if(this.target!==s.target||this.data!==s.data)return!1;break;case this.TEXT_NODE:case this.COMMENT_NODE:if(this.data!==s.data)return!1;break}if(this.childNodes.length!==s.childNodes.length)return!1;for(var c=0;c<this.childNodes.length;c++)if(!this.childNodes[c].isEqualNode(s.childNodes[c]))return!1;return!0},isSameNode:function(s){return this===s},insertBefore:function(s,c){return ce(this,s,c)},replaceChild:function(s,c){ce(this,s,c,gt),c&&this.removeChild(c)},removeChild:function(s){return tt(this,s)},appendChild:function(s){return this.insertBefore(s,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(s){return w(this.ownerDocument||this,this,s)},normalize:function(){for(var s=this.firstChild;s;){var c=s.nextSibling;c&&c.nodeType==ge&&s.nodeType==ge?(this.removeChild(c),s.appendData(c.data)):(s.normalize(),s=c)}},isSupported:function(s,c){return this.ownerDocument.implementation.hasFeature(s,c)},lookupPrefix:function(s){for(var c=this;c;){var y=c._nsMap;if(y){for(var b in y)if(i(y,b)&&y[b]===s)return b}c=c.nodeType==Q?c.ownerDocument:c.parentNode}return null},lookupNamespaceURI:function(s){for(var c=this;c;){var y=c._nsMap;if(y&&i(y,s))return y[s];c=c.nodeType==Q?c.ownerDocument:c.parentNode}return null},isDefaultNamespace:function(s){var c=this.lookupPrefix(s);return c==null},compareDocumentPosition:function(s){if(this===s)return 0;var c=s,y=this,b=null,x=null;if(c instanceof _e&&(b=c,c=b.ownerElement),y instanceof _e&&(x=y,y=x.ownerElement,b&&c&&y===c))for(var O=0,me;me=y.attributes[O];O++){if(me===b)return z.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+z.DOCUMENT_POSITION_PRECEDING;if(me===x)return z.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+z.DOCUMENT_POSITION_FOLLOWING}if(!c||!y||y.ownerDocument!==c.ownerDocument)return z.DOCUMENT_POSITION_DISCONNECTED+z.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(oe(y.ownerDocument)>oe(c.ownerDocument)?z.DOCUMENT_POSITION_FOLLOWING:z.DOCUMENT_POSITION_PRECEDING);if(x&&c===y)return z.DOCUMENT_POSITION_CONTAINS+z.DOCUMENT_POSITION_PRECEDING;if(b&&c===y)return z.DOCUMENT_POSITION_CONTAINED_BY+z.DOCUMENT_POSITION_FOLLOWING;for(var Me=[],je=c.parentNode;je;){if(!x&&je===y)return z.DOCUMENT_POSITION_CONTAINED_BY+z.DOCUMENT_POSITION_FOLLOWING;Me.push(je),je=je.parentNode}Me.reverse();for(var Je=[],Ke=y.parentNode;Ke;){if(!b&&Ke===c)return z.DOCUMENT_POSITION_CONTAINS+z.DOCUMENT_POSITION_PRECEDING;Je.push(Ke),Ke=Ke.parentNode}Je.reverse();var Ct=fe(Me,Je);for(var Pt in Ct.childNodes){var At=Ct.childNodes[Pt];if(At===y)return z.DOCUMENT_POSITION_FOLLOWING;if(At===c)return z.DOCUMENT_POSITION_PRECEDING;if(Je.indexOf(At)>=0)return z.DOCUMENT_POSITION_FOLLOWING;if(Me.indexOf(At)>=0)return z.DOCUMENT_POSITION_PRECEDING}return 0}};function Gt(s){return s=="<"&&"&lt;"||s==">"&&"&gt;"||s=="&"&&"&amp;"||s=='"'&&"&quot;"||"&#"+s.charCodeAt()+";"}D(q,ae),D(q,ae.prototype),D(z,ae),D(z,ae.prototype);function et(s,c){if(c(s))return!0;if(s=s.firstChild)do if(et(s,c))return!0;while(s=s.nextSibling)}function L(s,c){I(s);var y=c||{};this.ownerDocument=this,this.contentType=y.contentType||f.XML_APPLICATION,this.type=o(this.contentType)?"html":"xml"}function Xt(s,c,y){s&&s._inc++;var b=y.namespaceURI;b===p.XMLNS&&(c._nsMap[y.prefix?y.localName:""]=y.value)}function $(s,c,y,b){s&&s._inc++;var x=y.namespaceURI;x===p.XMLNS&&delete c._nsMap[y.prefix?y.localName:""]}function Ge(s,c,y){if(s&&s._inc){s._inc++;var b=c.childNodes;if(y&&!y.nextSibling)b[b.length++]=y;else{for(var x=c.firstChild,O=0;x;)b[O++]=x,x=x.nextSibling;b.length=O,delete b[b.length]}}}function tt(s,c){if(s!==c.parentNode)throw new E(E.NOT_FOUND_ERR,"child's parent is not parent");var y=c.previousSibling,b=c.nextSibling;return y?y.nextSibling=b:s.firstChild=b,b?b.previousSibling=y:s.lastChild=y,Ge(s.ownerDocument,s),c.parentNode=null,c.previousSibling=null,c.nextSibling=null,c}function Oe(s){return s&&(s.nodeType===ae.DOCUMENT_NODE||s.nodeType===ae.DOCUMENT_FRAGMENT_NODE||s.nodeType===ae.ELEMENT_NODE)}function ne(s){return s&&(s.nodeType===ae.CDATA_SECTION_NODE||s.nodeType===ae.COMMENT_NODE||s.nodeType===ae.DOCUMENT_FRAGMENT_NODE||s.nodeType===ae.DOCUMENT_TYPE_NODE||s.nodeType===ae.ELEMENT_NODE||s.nodeType===ae.PROCESSING_INSTRUCTION_NODE||s.nodeType===ae.TEXT_NODE)}function Z(s){return s&&s.nodeType===ae.DOCUMENT_TYPE_NODE}function Re(s){return s&&s.nodeType===ae.ELEMENT_NODE}function Wt(s){return s&&s.nodeType===ae.TEXT_NODE}function X(s,c){var y=s.childNodes||[];if(e(y,Re)||Z(c))return!1;var b=e(y,Z);return!(c&&b&&y.indexOf(b)>y.indexOf(c))}function Xe(s,c){var y=s.childNodes||[];function b(O){return Re(O)&&O!==c}if(e(y,b))return!1;var x=e(y,Z);return!(c&&x&&y.indexOf(x)>y.indexOf(c))}function Cr(s,c,y){if(!Oe(s))throw new E(E.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+s.nodeType);if(y&&y.parentNode!==s)throw new E(E.NOT_FOUND_ERR,"child not in parent");if(!ne(c)||Z(c)&&s.nodeType!==ae.DOCUMENT_NODE)throw new E(E.HIERARCHY_REQUEST_ERR,"Unexpected node type "+c.nodeType+" for parent node type "+s.nodeType)}function W(s,c,y){var b=s.childNodes||[],x=c.childNodes||[];if(c.nodeType===ae.DOCUMENT_FRAGMENT_NODE){var O=x.filter(Re);if(O.length>1||e(x,Wt))throw new E(E.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(O.length===1&&!X(s,y))throw new E(E.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Re(c)&&!X(s,y))throw new E(E.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Z(c)){if(e(b,Z))throw new E(E.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var me=e(b,Re);if(y&&b.indexOf(me)<b.indexOf(y))throw new E(E.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!y&&me)throw new E(E.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function gt(s,c,y){var b=s.childNodes||[],x=c.childNodes||[];if(c.nodeType===ae.DOCUMENT_FRAGMENT_NODE){var O=x.filter(Re);if(O.length>1||e(x,Wt))throw new E(E.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(O.length===1&&!Xe(s,y))throw new E(E.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Re(c)&&!Xe(s,y))throw new E(E.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Z(c)){if(e(b,function(je){return Z(je)&&je!==y}))throw new E(E.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var me=e(b,Re);if(y&&b.indexOf(me)<b.indexOf(y))throw new E(E.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function ce(s,c,y,b){Cr(s,c,y),s.nodeType===ae.DOCUMENT_NODE&&(b||W)(s,c,y);var x=c.parentNode;if(x&&x.removeChild(c),c.nodeType===V){var O=c.firstChild;if(O==null)return c;var me=c.lastChild}else O=me=c;var Me=y?y.previousSibling:s.lastChild;O.previousSibling=Me,me.nextSibling=y,Me?Me.nextSibling=O:s.firstChild=O,y==null?s.lastChild=me:y.previousSibling=me;do O.parentNode=s;while(O!==me&&(O=O.nextSibling));return Ge(s.ownerDocument||s,s,c),c.nodeType==V&&(c.firstChild=c.lastChild=null),c}L.prototype={implementation:null,nodeName:"#document",nodeType:Y,doctype:null,documentElement:null,_inc:1,insertBefore:function(s,c){if(s.nodeType===V){for(var y=s.firstChild;y;){var b=y.nextSibling;this.insertBefore(y,c),y=b}return s}return ce(this,s,c),s.ownerDocument=this,this.documentElement===null&&s.nodeType===re&&(this.documentElement=s),s},removeChild:function(s){var c=tt(this,s);return c===this.documentElement&&(this.documentElement=null),c},replaceChild:function(s,c){ce(this,s,c,gt),s.ownerDocument=this,c&&this.removeChild(c),Re(s)&&(this.documentElement=s)},importNode:function(s,c){return m(this,s,c)},getElementById:function(s){var c=null;return et(this.documentElement,function(y){if(y.nodeType==re&&y.getAttribute("id")==s)return c=y,!0}),c},createElement:function(s){var c=new Te(g);c.ownerDocument=this,this.type==="html"&&(s=s.toLowerCase()),r(this.contentType)&&(c.namespaceURI=p.HTML),c.nodeName=s,c.tagName=s,c.localName=s,c.childNodes=new G;var y=c.attributes=new pe;return y._ownerElement=c,c},createDocumentFragment:function(){var s=new he(g);return s.ownerDocument=this,s.childNodes=new G,s},createTextNode:function(s){var c=new se(g);return c.ownerDocument=this,c.childNodes=new G,c.appendData(s),c},createComment:function(s){var c=new ee(g);return c.ownerDocument=this,c.childNodes=new G,c.appendData(s),c},createCDATASection:function(s){var c=new nr(g);return c.ownerDocument=this,c.childNodes=new G,c.appendData(s),c},createProcessingInstruction:function(s,c){var y=new ir(g);return y.ownerDocument=this,y.childNodes=new G,y.nodeName=y.target=s,y.nodeValue=y.data=c,y},createAttribute:function(s){if(!C.QName_exact.test(s))throw new E(E.INVALID_CHARACTER_ERR,'invalid character in name "'+s+'"');return this.type==="html"&&(s=s.toLowerCase()),this._createAttribute(s)},_createAttribute:function(s){var c=new _e(g);return c.ownerDocument=this,c.childNodes=new G,c.name=s,c.nodeName=s,c.localName=s,c.specified=!0,c},createEntityReference:function(s){if(!C.Name.test(s))throw new E(E.INVALID_CHARACTER_ERR,'not a valid xml name "'+s+'"');if(this.type==="html")throw new E("document is an html document",S.NotSupportedError);var c=new Dt(g);return c.ownerDocument=this,c.childNodes=new G,c.nodeName=s,c},createElementNS:function(s,c){var y=Ce(s,c),b=new Te(g),x=b.attributes=new pe;return b.childNodes=new G,b.ownerDocument=this,b.nodeName=c,b.tagName=c,b.namespaceURI=y[0],b.prefix=y[1],b.localName=y[2],x._ownerElement=b,b},createAttributeNS:function(s,c){var y=Ce(s,c),b=new _e(g);return b.ownerDocument=this,b.childNodes=new G,b.nodeName=c,b.name=c,b.specified=!0,b.namespaceURI=y[0],b.prefix=y[1],b.localName=y[2],b}},A(L,ae);function Te(s){I(s),this._nsMap=Object.create(null)}Te.prototype={nodeType:re,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type==="html"&&this.namespaceURI===p.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(s){return!!this.getAttributeNode(s)},getAttribute:function(s){var c=this.getAttributeNode(s);return c?c.value:null},getAttributeNode:function(s){return this._isInHTMLDocumentAndNamespace()&&(s=s.toLowerCase()),this.attributes.getNamedItem(s)},setAttribute:function(s,c){this._isInHTMLDocumentAndNamespace()&&(s=s.toLowerCase());var y=this.getAttributeNode(s);y?y.value=y.nodeValue=""+c:(y=this.ownerDocument._createAttribute(s),y.value=y.nodeValue=""+c,this.setAttributeNode(y))},removeAttribute:function(s){var c=this.getAttributeNode(s);c&&this.removeAttributeNode(c)},setAttributeNode:function(s){return this.attributes.setNamedItem(s)},setAttributeNodeNS:function(s){return this.attributes.setNamedItemNS(s)},removeAttributeNode:function(s){return this.attributes.removeNamedItem(s.nodeName)},removeAttributeNS:function(s,c){var y=this.getAttributeNodeNS(s,c);y&&this.removeAttributeNode(y)},hasAttributeNS:function(s,c){return this.getAttributeNodeNS(s,c)!=null},getAttributeNS:function(s,c){var y=this.getAttributeNodeNS(s,c);return y?y.value:null},setAttributeNS:function(s,c,y){var b=Ce(s,c),x=b[2],O=this.getAttributeNodeNS(s,x);O?O.value=O.nodeValue=""+y:(O=this.ownerDocument.createAttributeNS(s,c),O.value=O.nodeValue=""+y,this.setAttributeNode(O))},getAttributeNodeNS:function(s,c){return this.attributes.getNamedItemNS(s,c)},getElementsByClassName:function(s){var c=K(s);return new J(this,function(y){var b=[];return c.length>0&&et(y,function(x){if(x!==y&&x.nodeType===re){var O=x.getAttribute("class");if(O){var me=s===O;if(!me){var Me=K(O);me=c.every(Ae(Me))}me&&b.push(x)}}}),b})},getElementsByTagName:function(s){var c=(this.nodeType===Y?this:this.ownerDocument).type==="html",y=s.toLowerCase();return new J(this,function(b){var x=[];return et(b,function(O){if(!(O===b||O.nodeType!==re))if(s==="*")x.push(O);else{var me=O.getQualifiedName(),Me=c&&O.namespaceURI===p.HTML?y:s;me===Me&&x.push(O)}}),x})},getElementsByTagNameNS:function(s,c){return new J(this,function(y){var b=[];return et(y,function(x){x!==y&&x.nodeType===re&&(s==="*"||x.namespaceURI===s)&&(c==="*"||x.localName==c)&&b.push(x)}),b})}},L.prototype.getElementsByClassName=Te.prototype.getElementsByClassName,L.prototype.getElementsByTagName=Te.prototype.getElementsByTagName,L.prototype.getElementsByTagNameNS=Te.prototype.getElementsByTagNameNS,A(Te,ae);function _e(s){I(s),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}_e.prototype.nodeType=Q,A(_e,ae);function He(s){I(s)}He.prototype={data:"",substringData:function(s,c){return this.data.substring(s,s+c)},appendData:function(s){s=this.data+s,this.nodeValue=this.data=s,this.length=s.length},insertData:function(s,c){this.replaceData(s,0,c)},deleteData:function(s,c){this.replaceData(s,c,"")},replaceData:function(s,c,y){var b=this.data.substring(0,s),x=this.data.substring(s+c);y=b+y+x,this.nodeValue=this.data=y,this.length=y.length}},A(He,ae);function se(s){I(s)}se.prototype={nodeName:"#text",nodeType:ge,splitText:function(s){var c=this.data,y=c.substring(s);c=c.substring(0,s),this.data=this.nodeValue=c,this.length=c.length;var b=this.ownerDocument.createTextNode(y);return this.parentNode&&this.parentNode.insertBefore(b,this.nextSibling),b}},A(se,He);function ee(s){I(s)}ee.prototype={nodeName:"#comment",nodeType:F},A(ee,He);function nr(s){I(s)}nr.prototype={nodeName:"#cdata-section",nodeType:Ie},A(nr,se);function lt(s){I(s)}lt.prototype.nodeType=M,A(lt,ae);function ct(s){I(s)}ct.prototype.nodeType=_,A(ct,ae);function St(s){I(s)}St.prototype.nodeType=de,A(St,ae);function Dt(s){I(s)}Dt.prototype.nodeType=k,A(Dt,ae);function he(s){I(s)}he.prototype.nodeName="#document-fragment",he.prototype.nodeType=V,A(he,ae);function ir(s){I(s)}ir.prototype.nodeType=B,A(ir,He);function xr(){}xr.prototype.serializeToString=function(s,c){return qe.call(s,c)},ae.prototype.toString=qe;function qe(s){var c=[],y=this.nodeType===Y&&this.documentElement||this,b=y.prefix,x=y.namespaceURI;if(x&&b==null){var b=y.lookupPrefix(x);if(b==null)var O=[{namespace:x,prefix:null}]}return a(this,c,s,O),c.join("")}function Le(s,c,y){var b=s.prefix||"",x=s.namespaceURI;if(!x||b==="xml"&&x===p.XML||x===p.XMLNS)return!1;for(var O=y.length;O--;){var me=y[O];if(me.prefix===b)return me.namespace!==x}return!0}function t(s,c,y){s.push(" ",c,'="',y.replace(/[<>&"\t\n\r]/g,Gt),'"')}function a(s,c,y,b){b||(b=[]);var x=s.nodeType===Y?s:s.ownerDocument,O=x.type==="html";if(y)if(s=y(s),s){if(typeof s=="string"){c.push(s);return}}else return;switch(s.nodeType){case re:var me=s.attributes,Me=me.length,Pe=s.firstChild,je=s.tagName,Je=je;if(!O&&!s.prefix&&s.namespaceURI){for(var Ke,Ct=0;Ct<me.length;Ct++)if(me.item(Ct).name==="xmlns"){Ke=me.item(Ct).value;break}if(!Ke)for(var Pt=b.length-1;Pt>=0;Pt--){var At=b[Pt];if(At.prefix===""&&At.namespace===s.namespaceURI){Ke=At.namespace;break}}if(Ke!==s.namespaceURI)for(var Pt=b.length-1;Pt>=0;Pt--){var At=b[Pt];if(At.namespace===s.namespaceURI){At.prefix&&(Je=At.prefix+":"+je);break}}}c.push("<",Je);for(var or=0;or<Me;or++){var Bt=me.item(or);Bt.prefix=="xmlns"?b.push({prefix:Bt.localName,namespace:Bt.value}):Bt.nodeName=="xmlns"&&b.push({prefix:"",namespace:Bt.value})}for(var or=0;or<Me;or++){var Bt=me.item(or);if(Le(Bt,O,b)){var P=Bt.prefix||"",Ee=Bt.namespaceURI;t(c,P?"xmlns:"+P:"xmlns",Ee),b.push({prefix:P,namespace:Ee})}a(Bt,c,y,b)}if(je===Je&&Le(s,O,b)){var P=s.prefix||"",Ee=s.namespaceURI;t(c,P?"xmlns:"+P:"xmlns",Ee),b.push({prefix:P,namespace:Ee})}var it=!Pe;if(it&&(O||s.namespaceURI===p.HTML)&&(it=l(je)),it)c.push("/>");else{if(c.push(">"),O&&u(je))for(;Pe;)Pe.data?c.push(Pe.data):a(Pe,c,y,b.slice()),Pe=Pe.nextSibling;else for(;Pe;)a(Pe,c,y,b.slice()),Pe=Pe.nextSibling;c.push("</",Je,">")}return;case Y:case V:for(var Pe=s.firstChild;Pe;)a(Pe,c,y,b.slice()),Pe=Pe.nextSibling;return;case Q:return t(c,s.name,s.value);case ge:return c.push(s.data.replace(/[<&>]/g,Gt));case Ie:return c.push(C.CDATA_START,s.data,C.CDATA_END);case F:return c.push(C.COMMENT_START,s.data,C.COMMENT_END);case M:var Ui=s.publicId,Jr=s.systemId;c.push(C.DOCTYPE_DECL_START," ",s.name),Ui?(c.push(" ",C.PUBLIC," ",Ui),Jr&&Jr!=="."&&c.push(" ",Jr)):Jr&&Jr!=="."&&c.push(" ",C.SYSTEM," ",Jr),s.internalSubset&&c.push(" [",s.internalSubset,"]"),c.push(">");return;case B:return c.push("<?",s.target," ",s.data,"?>");case k:return c.push("&",s.nodeName,";");default:c.push("??",s.nodeName)}}function m(s,c,y){var b;switch(c.nodeType){case re:b=c.cloneNode(!1),b.ownerDocument=s;case V:break;case Q:y=!0;break}if(b||(b=c.cloneNode(!1)),b.ownerDocument=s,b.parentNode=null,y)for(var x=c.firstChild;x;)b.appendChild(m(s,x,y)),x=x.nextSibling;return b}function w(s,c,y){var b=new c.constructor(g);for(var x in c)if(i(c,x)){var O=c[x];typeof O!="object"&&O!=b[x]&&(b[x]=O)}switch(c.childNodes&&(b.childNodes=new G),b.ownerDocument=s,b.nodeType){case re:var me=c.attributes,Me=b.attributes=new pe,je=me.length;Me._ownerElement=b;for(var Je=0;Je<je;Je++)b.setAttributeNode(w(s,me.item(Je),!0));break;case Q:y=!0}if(y)for(var Ke=c.firstChild;Ke;)b.appendChild(w(s,Ke,y)),Ke=Ke.nextSibling;return b}function v(s,c,y){s[c]=y}try{if(Object.defineProperty){let s=function(c){switch(c.nodeType){case re:case V:var y=[];for(c=c.firstChild;c;)c.nodeType!==7&&c.nodeType!==8&&y.push(s(c)),c=c.nextSibling;return y.join("");default:return c.nodeValue}};Object.defineProperty(J.prototype,"length",{get:function(){return ue(this),this.$$length}}),Object.defineProperty(ae.prototype,"textContent",{get:function(){return s(this)},set:function(c){switch(this.nodeType){case re:case V:for(;this.firstChild;)this.removeChild(this.firstChild);(c||String(c))&&this.appendChild(this.ownerDocument.createTextNode(c));break;default:this.data=c,this.value=c,this.nodeValue=c}}}),v=function(c,y,b){c["$$"+y]=b}}}catch(s){}return $e._updateLiveList=ue,$e.Attr=_e,$e.CDATASection=nr,$e.CharacterData=He,$e.Comment=ee,$e.Document=L,$e.DocumentFragment=he,$e.DocumentType=lt,$e.DOMImplementation=Ze,$e.Element=Te,$e.Entity=St,$e.EntityReference=Dt,$e.LiveNodeList=J,$e.NamedNodeMap=pe,$e.Node=ae,$e.NodeList=G,$e.Notation=ct,$e.Text=se,$e.ProcessingInstruction=ir,$e.XMLSerializer=xr,$e}var lr={},Vi={},Us;function ll(){return Us||(Us=1,(function(n){var e=Tr().freeze;n.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),n.HTML_ENTITIES=e({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:`
5
- `,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"}),n.entityMap=n.HTML_ENTITIES})(Vi)),Vi}var Kr={},Ps;function cl(){if(Ps)return Kr;Ps=1;var n=Tr(),e=Ls(),r=Bn(),i=n.isHTMLEscapableRawTextElement,o=n.isHTMLMimeType,u=n.isHTMLRawTextElement,l=n.hasOwn,f=n.NAMESPACE,p=r.ParseError,g=r.DOMException,N=0,E=1,S=2,C=3,I=4,H=5,U=6,R=7;function K(){}K.prototype={parse:function(B,F,Y){var M=this.domBuilder;M.startDocument(),re(F,F=Object.create(null)),be(B,F,Y,M,this.errorHandler),M.endDocument()}};var Ae=/&#?\w+;?/g;function be(B,F,Y,M,V){var _=o(M.mimeType);B.indexOf(e.UNICODE_REPLACEMENT_CHARACTER)>=0&&V.warning("Unicode replacement character detected, source encoding issues?");function z(ce){if(ce>65535){ce-=65536;var Te=55296+(ce>>10),_e=56320+(ce&1023);return String.fromCharCode(Te,_e)}else return String.fromCharCode(ce)}function fe(ce){var Te=ce[ce.length-1]===";"?ce:ce+";";if(!_&&Te!==ce)return V.error("EntityRef: expecting ;"),ce;var _e=e.Reference.exec(Te);if(!_e||_e[0].length!==Te.length)return V.error("entity not matching Reference production: "+ce),ce;var He=Te.slice(1,-1);return l(Y,He)?Y[He]:He.charAt(0)==="#"?z(parseInt(He.substring(1).replace("x","0x"))):(V.error("entity not found:"+ce),ce)}function oe(ce){if(ce>Ze){var Te=B.substring(Ze,ce).replace(Ae,fe);pe&&le(Ze),M.characters(Te,0,ce-Ze),Ze=ce}}var G=0,J=0,ue=/\r\n?|\n|$/g,pe=M.locator;function le(ce,Te){for(;ce>=J&&(Te=ue.exec(B));)G=J,J=Te.index+Te[0].length,pe.lineNumber++;pe.columnNumber=ce-G+1}for(var Et=[{currentNSMap:F}],at=[],Ze=0;;){try{var ae=B.indexOf("<",Ze);if(ae<0){if(!_&&at.length>0)return V.fatalError("unclosed xml tag(s): "+at.join(", "));if(!B.substring(Ze).match(/^\s*$/)){var Gt=M.doc,et=Gt.createTextNode(B.substring(Ze));if(Gt.documentElement)return V.error("Extra content at the end of the document");Gt.appendChild(et),M.currentElement=et}return}if(ae>Ze){var L=B.substring(Ze,ae);!_&&at.length===0&&(L=L.replace(new RegExp(e.S_OPT.source,"g"),""),L&&V.error("Unexpected content outside root element: '"+L+"'")),oe(ae)}switch(B.charAt(ae+1)){case"/":var X=B.indexOf(">",ae+2),Xt=B.substring(ae+2,X>0?X:void 0);if(!Xt)return V.fatalError("end tag name missing");var $=X>0&&e.reg("^",e.QName_group,e.S_OPT,"$").exec(Xt);if(!$)return V.fatalError('end tag name contains invalid characters: "'+Xt+'"');if(!M.currentElement&&!M.doc.documentElement)return;var Ge=at[at.length-1]||M.currentElement.tagName||M.doc.documentElement.tagName||"";if(Ge!==$[1]){var tt=$[1].toLowerCase();if(!_||Ge.toLowerCase()!==tt)return V.fatalError('Opening and ending tag mismatch: "'+Ge+'" != "'+Xt+'"')}var Oe=Et.pop();at.pop();var ne=Oe.localNSMap;if(M.endElement(Oe.uri,Oe.localName,Ge),ne)for(var Z in ne)l(ne,Z)&&M.endPrefixMapping(Z);X++;break;case"?":pe&&le(ae),X=k(B,ae,M,V);break;case"!":pe&&le(ae),X=Ie(B,ae,M,V,_);break;default:pe&&le(ae);var Re=new de,Wt=Et[Et.length-1].currentNSMap,X=D(B,ae,Re,Wt,fe,V,_),Xe=Re.length;if(Re.closed||(_&&n.isHTMLVoidElement(Re.tagName)?Re.closed=!0:at.push(Re.tagName)),pe&&Xe){for(var Cr=Ce(pe,{}),W=0;W<Xe;W++){var gt=Re[W];le(gt.offset),gt.locator=Ce(pe,{})}M.locator=Cr,A(Re,M,Wt)&&Et.push(Re),M.locator=pe}else A(Re,M,Wt)&&Et.push(Re);_&&!Re.closed?X=q(B,X,Re.tagName,fe,M):X++}}catch(ce){if(ce instanceof p)throw ce;if(ce instanceof g)throw new p(ce.name+": "+ce.message,M.locator,ce);V.error("element parse error: "+ce),X=-1}X>Ze?Ze=X:oe(Math.max(ae,Ze)+1)}}function Ce(B,F){return F.lineNumber=B.lineNumber,F.columnNumber=B.columnNumber,F}function D(B,F,Y,M,V,_,z){function fe(le,Et,at){if(l(Y.attributeNames,le))return _.fatalError("Attribute "+le+" redefined");if(!z&&Et.indexOf("<")>=0)return _.fatalError("Unescaped '<' not allowed in attributes values");Y.addValue(le,Et.replace(/[\t\n\r]/g," ").replace(Ae,V),at)}for(var oe,G,J=++F,ue=N;;){var pe=B.charAt(J);switch(pe){case"=":if(ue===E)oe=B.slice(F,J),ue=C;else if(ue===S)ue=C;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ue===C||ue===E)if(ue===E&&(_.warning('attribute value must after "="'),oe=B.slice(F,J)),F=J+1,J=B.indexOf(pe,F),J>0)G=B.slice(F,J),fe(oe,G,F-1),ue=H;else throw new Error("attribute value no end '"+pe+"' match");else if(ue==I)G=B.slice(F,J),fe(oe,G,F),_.warning('attribute "'+oe+'" missed start quot('+pe+")!!"),F=J+1,ue=H;else throw new Error('attribute value must after "="');break;case"/":switch(ue){case N:Y.setTagName(B.slice(F,J));case H:case U:case R:ue=R,Y.closed=!0;case I:case E:break;case S:Y.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return _.error("unexpected end of input"),ue==N&&Y.setTagName(B.slice(F,J)),J;case">":switch(ue){case N:Y.setTagName(B.slice(F,J));case H:case U:case R:break;case I:case E:G=B.slice(F,J),G.slice(-1)==="/"&&(Y.closed=!0,G=G.slice(0,-1));case S:ue===S&&(G=oe),ue==I?(_.warning('attribute "'+G+'" missed quot(")!'),fe(oe,G,F)):(z||_.warning('attribute "'+G+'" missed value!! "'+G+'" instead!!'),fe(G,G,F));break;case C:if(!z)return _.fatalError(`AttValue: ' or " expected`)}return J;case"\x80":pe=" ";default:if(pe<=" ")switch(ue){case N:Y.setTagName(B.slice(F,J)),ue=U;break;case E:oe=B.slice(F,J),ue=S;break;case I:var G=B.slice(F,J);_.warning('attribute "'+G+'" missed quot(")!!'),fe(oe,G,F);case H:ue=U;break}else switch(ue){case S:z||_.warning('attribute "'+oe+'" missed value!! "'+oe+'" instead2!!'),fe(oe,oe,F),F=J,ue=E;break;case H:_.warning('attribute space is required"'+oe+'"!!');case U:ue=E,F=J;break;case C:ue=I,F=J;break;case R:throw new Error("elements closed character '/' and '>' must be connected to")}}J++}}function A(B,F,Y){for(var M=B.tagName,V=null,ue=B.length;ue--;){var _=B[ue],z=_.qName,fe=_.value,pe=z.indexOf(":");if(pe>0)var oe=_.prefix=z.slice(0,pe),G=z.slice(pe+1),J=oe==="xmlns"&&G;else G=z,oe=null,J=z==="xmlns"&&"";_.localName=G,J!==!1&&(V==null&&(V=Object.create(null),re(Y,Y=Object.create(null))),Y[J]=V[J]=fe,_.uri=f.XMLNS,F.startPrefixMapping(J,fe))}for(var ue=B.length;ue--;)_=B[ue],_.prefix&&(_.prefix==="xml"&&(_.uri=f.XML),_.prefix!=="xmlns"&&(_.uri=Y[_.prefix]));var pe=M.indexOf(":");pe>0?(oe=B.prefix=M.slice(0,pe),G=B.localName=M.slice(pe+1)):(oe=null,G=B.localName=M);var le=B.uri=Y[oe||""];if(F.startElement(le,G,M,B),B.closed){if(F.endElement(le,G,M),V)for(oe in V)l(V,oe)&&F.endPrefixMapping(oe)}else return B.currentNSMap=Y,B.localNSMap=V,!0}function q(B,F,Y,M,V){var _=i(Y);if(_||u(Y)){var z=B.indexOf("</"+Y+">",F),fe=B.substring(F+1,z);return _&&(fe=fe.replace(Ae,M)),V.characters(fe,0,fe.length),z}return F+1}function re(B,F){for(var Y in B)l(B,Y)&&(F[Y]=B[Y])}function Q(B,F){var Y=F;function M(J){return J=J||0,B.charAt(Y+J)}function V(J){J=J||1,Y+=J}function _(){for(var J=0;Y<B.length;){var ue=M();if(ue!==" "&&ue!==`
6
- `&&ue!==" "&&ue!=="\r")return J;J++,V()}return-1}function z(){return B.substring(Y)}function fe(J){return B.substring(Y,Y+J.length)===J}function oe(J){return B.substring(Y,Y+J.length).toUpperCase()===J.toUpperCase()}function G(J){var ue=e.reg("^",J),pe=ue.exec(z());return pe?(V(pe[0].length),pe[0]):null}return{char:M,getIndex:function(){return Y},getMatch:G,getSource:function(){return B},skip:V,skipBlanks:_,substringFromIndex:z,substringStartsWith:fe,substringStartsWithCaseInsensitive:oe}}function ge(B,F){function Y(fe,oe){var G=e.PI.exec(fe.substringFromIndex());return G?G[1].toLowerCase()==="xml"?oe.fatalError("xml declaration is only allowed at the start of the document, but found at position "+fe.getIndex()):(fe.skip(G[0].length),G[0]):oe.fatalError("processing instruction is not well-formed at position "+fe.getIndex())}var M=B.getSource();if(B.char()==="["){B.skip(1);for(var V=B.getIndex();B.getIndex()<M.length;){if(B.skipBlanks(),B.char()==="]"){var _=M.substring(V,B.getIndex());return B.skip(1),_}var z=null;if(B.char()==="<"&&B.char(1)==="!")switch(B.char(2)){case"E":B.char(3)==="L"?z=B.getMatch(e.elementdecl):B.char(3)==="N"&&(z=B.getMatch(e.EntityDecl));break;case"A":z=B.getMatch(e.AttlistDecl);break;case"N":z=B.getMatch(e.NotationDecl);break;case"-":z=B.getMatch(e.Comment);break}else if(B.char()==="<"&&B.char(1)==="?")z=Y(B,F);else if(B.char()==="%")z=B.getMatch(e.PEReference);else return F.fatalError("Error detected in Markup declaration");if(!z)return F.fatalError("Error in internal subset at position "+B.getIndex())}return F.fatalError("doctype internal subset is not well-formed, missing ]")}}function Ie(B,F,Y,M,V){var _=Q(B,F);switch(V?_.char(2).toUpperCase():_.char(2)){case"-":var z=_.getMatch(e.Comment);return z?(Y.comment(z,e.COMMENT_START.length,z.length-e.COMMENT_START.length-e.COMMENT_END.length),_.getIndex()):M.fatalError("comment is not well-formed at position "+_.getIndex());case"[":var fe=_.getMatch(e.CDSect);return fe?!V&&!Y.currentElement?M.fatalError("CDATA outside of element"):(Y.startCDATA(),Y.characters(fe,e.CDATA_START.length,fe.length-e.CDATA_START.length-e.CDATA_END.length),Y.endCDATA(),_.getIndex()):M.fatalError("Invalid CDATA starting at position "+F);case"D":{if(Y.doc&&Y.doc.documentElement)return M.fatalError("Doctype not allowed inside or after documentElement at position "+_.getIndex());if(V?!_.substringStartsWithCaseInsensitive(e.DOCTYPE_DECL_START):!_.substringStartsWith(e.DOCTYPE_DECL_START))return M.fatalError("Expected "+e.DOCTYPE_DECL_START+" at position "+_.getIndex());if(_.skip(e.DOCTYPE_DECL_START.length),_.skipBlanks()<1)return M.fatalError("Expected whitespace after "+e.DOCTYPE_DECL_START+" at position "+_.getIndex());var oe={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(oe.name=_.getMatch(e.Name),!oe.name)return M.fatalError("doctype name missing or contains unexpected characters at position "+_.getIndex());if(V&&oe.name.toLowerCase()!=="html"&&M.warning("Unexpected DOCTYPE in HTML document at position "+_.getIndex()),_.skipBlanks(),_.substringStartsWith(e.PUBLIC)||_.substringStartsWith(e.SYSTEM)){var G=e.ExternalID_match.exec(_.substringFromIndex());if(!G)return M.fatalError("doctype external id is not well-formed at position "+_.getIndex());G.groups.SystemLiteralOnly!==void 0?oe.systemId=G.groups.SystemLiteralOnly:(oe.systemId=G.groups.SystemLiteral,oe.publicId=G.groups.PubidLiteral),_.skip(G[0].length)}else if(V&&_.substringStartsWithCaseInsensitive(e.SYSTEM)){if(_.skip(e.SYSTEM.length),_.skipBlanks()<1)return M.fatalError("Expected whitespace after "+e.SYSTEM+" at position "+_.getIndex());if(oe.systemId=_.getMatch(e.ABOUT_LEGACY_COMPAT_SystemLiteral),!oe.systemId)return M.fatalError("Expected "+e.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+e.SYSTEM+" at position "+_.getIndex())}return V&&oe.systemId&&!e.ABOUT_LEGACY_COMPAT_SystemLiteral.test(oe.systemId)&&M.warning("Unexpected doctype.systemId in HTML document at position "+_.getIndex()),V||(_.skipBlanks(),oe.internalSubset=ge(_,M)),_.skipBlanks(),_.char()!==">"?M.fatalError("doctype not terminated with > at position "+_.getIndex()):(_.skip(1),Y.startDTD(oe.name,oe.publicId,oe.systemId,oe.internalSubset),Y.endDTD(),_.getIndex())}default:return M.fatalError('Not well-formed XML starting with "<!" at position '+F)}}function k(B,F,Y,M){var V=B.substring(F).match(e.PI);if(!V)return M.fatalError("Invalid processing instruction starting at position "+F);if(V[1].toLowerCase()==="xml"){if(F>0)return M.fatalError("processing instruction at position "+F+" is an xml declaration which is only at the start of the document");if(!e.XMLDecl.test(B.substring(F)))return M.fatalError("xml declaration is not well-formed")}return Y.processingInstruction(V[1],V[2]),F+V[0].length}function de(){this.attributeNames=Object.create(null)}return de.prototype={setTagName:function(B){if(!e.QName_exact.test(B))throw new Error("invalid tagName:"+B);this.tagName=B},addValue:function(B,F,Y){if(!e.QName_exact.test(B))throw new Error("invalid attribute:"+B);this.attributeNames[B]=this.length,this[this.length++]={qName:B,value:F,offset:Y}},length:0,getLocalName:function(B){return this[B].localName},getLocator:function(B){return this[B].locator},getQName:function(B){return this[B].qName},getURI:function(B){return this[B].uri},getValue:function(B){return this[B].value}},Kr.XMLReader=K,Kr.parseUtils=Q,Kr.parseDoctypeCommentOrCData=Ie,Kr}var Vs;function fl(){if(Vs)return lr;Vs=1;var n=Tr(),e=Fs(),r=Bn(),i=ll(),o=cl(),u=e.DOMImplementation,l=n.hasDefaultHTMLNamespace,f=n.isHTMLMimeType,p=n.isValidMimeType,g=n.MIME_TYPE,N=n.NAMESPACE,E=r.ParseError,S=o.XMLReader;function C(D){return D.replace(/\r[\n\u0085]/g,`
4
+ */(function(Ce,We){typeof exports=="object"&&typeof module!="undefined"?We(exports,require("fflate"),require("@peculiar/x509")):typeof define=="function"&&define.amd?define(["exports","fflate","@peculiar/x509"],We):(Ce=typeof globalThis!="undefined"?globalThis:Ce||self,We(Ce.edockit={},Ce.fflate,Ce.peculiarX509))})(this,(function(Ce,We,Le){"use strict";function _t(n,e){return e.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(i){if(i!=="default"&&!(i in n)){var o=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(n,i,o.get?o:{enumerable:!0,get:function(){return r[i]}})}})}),Object.freeze(n)}function bl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Te={},it={},Ws;function kr(){if(Ws)return it;Ws=1;function n(k,fe,Se){if(Se===void 0&&(Se=Array.prototype),k&&typeof Se.find=="function")return Se.find.call(k,fe);for(var Be=0;Be<k.length;Be++)if(r(k,Be)){var me=k[Be];if(fe.call(void 0,me,Be,k))return me}}function e(k,fe){return fe===void 0&&(fe=Object),fe&&typeof fe.getOwnPropertyDescriptors=="function"&&(k=fe.create(null,fe.getOwnPropertyDescriptors(k))),fe&&typeof fe.freeze=="function"?fe.freeze(k):k}function r(k,fe){return Object.prototype.hasOwnProperty.call(k,fe)}function i(k,fe){if(k===null||typeof k!="object")throw new TypeError("target is not an object");for(var Se in fe)r(fe,Se)&&(k[Se]=fe[Se]);return k}var o=e({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 s(k){return r(o,k.toLowerCase())}var l=e({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 c(k){return r(l,k.toLowerCase())}var h=e({script:!1,style:!1,textarea:!0,title:!0});function y(k){var fe=k.toLowerCase();return r(h,fe)&&!h[fe]}function b(k){var fe=k.toLowerCase();return r(h,fe)&&h[fe]}function E(k){return k===T.HTML}function x(k){return E(k)||k===T.XML_XHTML_APPLICATION}var T=e({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),R=Object.keys(T).map(function(k){return T[k]});function P(k){return R.indexOf(k)>-1}var _=e({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/"});return it.assign=i,it.find=n,it.freeze=e,it.HTML_BOOLEAN_ATTRIBUTES=o,it.HTML_RAW_TEXT_ELEMENTS=h,it.HTML_VOID_ELEMENTS=l,it.hasDefaultHTMLNamespace=x,it.hasOwn=r,it.isHTMLBooleanAttribute=s,it.isHTMLRawTextElement=y,it.isHTMLEscapableRawTextElement=b,it.isHTMLMimeType=E,it.isHTMLVoidElement=c,it.isValidMimeType=P,it.MIME_TYPE=T,it.NAMESPACE=_,it}var _r={},zs;function Un(){if(zs)return _r;zs=1;var n=kr();function e(x,T){x.prototype=Object.create(Error.prototype,{constructor:{value:x},name:{value:x.name,enumerable:!0,writable:T}})}var r=n.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"}),i=Object.keys(r);function o(x){return typeof x=="number"&&x>=1&&x<=25}function s(x){return typeof x=="string"&&x.substring(x.length-r.Error.length)===r.Error}function l(x,T){o(x)?(this.name=i[x],this.message=T||""):(this.message=x,this.name=s(T)?T:r.Error),Error.captureStackTrace&&Error.captureStackTrace(this,l)}e(l,!0),Object.defineProperties(l.prototype,{code:{enumerable:!0,get:function(){var x=i.indexOf(this.name);return o(x)?x:0}}});for(var c={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},h=Object.entries(c),y=0;y<h.length;y++){var b=h[y][0];l[b]=h[y][1]}function E(x,T){this.message=x,this.locator=T,Error.captureStackTrace&&Error.captureStackTrace(this,E)}return e(E),_r.DOMException=l,_r.DOMExceptionName=r,_r.ExceptionCode=c,_r.ParseError=E,_r}var $e={},Ee={},Ys;function Js(){if(Ys)return Ee;Ys=1;function n(u){try{typeof u!="function"&&(u=RegExp);var m=new u("\u{1D306}","u").exec("\u{1D306}");return!!m&&m[0].length===2}catch(w){}return!1}var e=n();function r(u){if(u.source[0]!=="[")throw new Error(u+" can not be used with chars");return u.source.slice(1,u.source.lastIndexOf("]"))}function i(u,m){if(u.source[0]!=="[")throw new Error("/"+u.source+"/ can not be used with chars_without");if(!m||typeof m!="string")throw new Error(JSON.stringify(m)+" is not a valid search");if(u.source.indexOf(m)===-1)throw new Error('"'+m+'" is not is /'+u.source+"/");if(m==="-"&&u.source.indexOf(m)!==1)throw new Error('"'+m+'" is not at the first postion of /'+u.source+"/");return new RegExp(u.source.replace(m,""),e?"u":"")}function o(u){var m=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(w){var v=typeof w=="string";if(v&&m===void 0&&w==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return v?w:w.source}).join(""),e?"mu":"m")}function s(u){if(arguments.length===0)throw new Error("no parameters provided");return o.apply(s,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var l="\uFFFD",c=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;e&&(c=o("[",r(c),"\\u{10000}-\\u{10FFFF}","]"));var h=new RegExp("[^"+r(c)+"]",e?"u":""),y=/[\x20\x09\x0D\x0A]/,b=r(y),E=o(y,"+"),x=o(y,"*"),T=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;e&&(T=o("[",r(T),"\\u{10000}-\\u{10FFFF}","]"));var R=r(T),P=o("[",R,r(/[-.0-9\xB7]/),r(/[\u0300-\u036F\u203F-\u2040]/),"]"),_=o(T,P,"*"),k=o(P,"+"),fe=o("&",_,";"),Se=s(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),Be=s(fe,"|",Se),me=o("%",_,";"),C=s(o('"',s(/[^%&"]/,"|",me,"|",Be),"*",'"'),"|",o("'",s(/[^%&']/,"|",me,"|",Be),"*","'")),A=s('"',s(/[^<&"]/,"|",Be),"*",'"',"|","'",s(/[^<&']/,"|",Be),"*","'"),G=i(T,":"),ee=i(P,":"),pe=o(G,ee,"*"),Ae=o(pe,s(":",pe),"?"),we=o("^",Ae,"$"),te=o("(",Ae,")"),De=s(/"[^"]*"|'[^']*'/),B=o(/^<\?/,"(",_,")",s(E,"(",c,"*?)"),"?",/\?>/),I=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,M=s('"',I,'*"',"|","'",i(I,"'"),"*'"),U="<!--",X="-->",F=o(U,s(i(c,"-"),"|",o("-",i(c,"-"))),"*",X),re="#PCDATA",Q=s(o(/\(/,x,re,s(x,/\|/,x,Ae),"*",x,/\)\*/),"|",o(/\(/,x,re,x,/\)/)),$=/[?*+]?/,j=o(/\([^>]+\)/,$),V=s("EMPTY","|","ANY","|",Q,"|",j),le="<!ELEMENT",ge=o(le,E,s(Ae,"|",me),E,s(V,"|",me),x,">"),he=o("NOTATION",E,/\(/,x,_,s(x,/\|/,x,_),"*",x,/\)/),tt=o(/\(/,x,k,s(x,/\|/,x,k),"*",x,/\)/),lt=s(he,"|",tt),Ke=s(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",lt),de=s(/#REQUIRED|#IMPLIED/,"|",s(s("#FIXED",E),"?",A)),Yt=s(E,_,E,Ke,E,de),rt="<!ATTLIST",L=o(rt,E,_,Yt,"*",x,">"),Qe="about:legacy-compat",Y=s('"'+Qe+'"',"|","'"+Qe+"'"),Ye="SYSTEM",Ze="PUBLIC",Oe=s(s(Ye,E,De),"|",s(Ze,E,M,E,De)),ie=o("^",s(s(Ye,E,"(?<SystemLiteralOnly>",De,")"),"|",s(Ze,E,"(?<PubidLiteral>",M,")",E,"(?<SystemLiteral>",De,")"))),se=o("^",M,"$"),Pe=o("^",De,"$"),ct=s(E,"NDATA",E,_),z=s(C,"|",s(Oe,ct,"?")),Ge="<!ENTITY",pr=o(Ge,E,_,E,z,x,">"),J=s(C,"|",Oe),Nt=o(Ge,E,"%",E,_,E,J,x,">"),ye=s(pr,"|",Nt),Fe=o(Ze,E,M),Me=o("<!NOTATION",E,_,E,s(Oe,"|",Fe),x,">"),Ue=o(x,"=",x),ue=/1[.]\d+/,Z=o(E,"version",Ue,s("'",ue,"'","|",'"',ue,'"')),Jt=/[A-Za-z][-A-Za-z0-9._]*/,ft=s(E,"encoding",Ue,s('"',Jt,'"',"|","'",Jt,"'")),ut=s(E,"standalone",Ue,s("'",s("yes","|","no"),"'","|",'"',s("yes","|","no"),'"')),It=o(/^<\?xml/,Z,ft,"?",ut,"?",x,/\?>/),Rt="<!DOCTYPE",ve="<![CDATA[",qt="]]>",sr=/<!\[CDATA\[/,rn=/\]\]>/,wt=o(c,"*?",rn),t=o(sr,wt);return Ee.chars=r,Ee.chars_without=i,Ee.detectUnicodeSupport=n,Ee.reg=o,Ee.regg=s,Ee.ABOUT_LEGACY_COMPAT=Qe,Ee.ABOUT_LEGACY_COMPAT_SystemLiteral=Y,Ee.AttlistDecl=L,Ee.CDATA_START=ve,Ee.CDATA_END=qt,Ee.CDSect=t,Ee.Char=c,Ee.Comment=F,Ee.COMMENT_START=U,Ee.COMMENT_END=X,Ee.DOCTYPE_DECL_START=Rt,Ee.elementdecl=ge,Ee.EntityDecl=ye,Ee.EntityValue=C,Ee.ExternalID=Oe,Ee.ExternalID_match=ie,Ee.Name=_,Ee.NotationDecl=Me,Ee.Reference=Be,Ee.PEReference=me,Ee.PI=B,Ee.PUBLIC=Ze,Ee.PubidLiteral=M,Ee.PubidLiteral_match=se,Ee.QName=Ae,Ee.QName_exact=we,Ee.QName_group=te,Ee.S=E,Ee.SChar_s=b,Ee.S_OPT=x,Ee.SYSTEM=Ye,Ee.SystemLiteral=De,Ee.SystemLiteral_match=Pe,Ee.InvalidChar=h,Ee.UNICODE_REPLACEMENT_CHARACTER=l,Ee.UNICODE_SUPPORT=e,Ee.XMLDecl=It,Ee}var Ks;function Qs(){if(Ks)return $e;Ks=1;var n=kr(),e=n.find,r=n.hasDefaultHTMLNamespace,i=n.hasOwn,o=n.isHTMLMimeType,s=n.isHTMLRawTextElement,l=n.isHTMLVoidElement,c=n.MIME_TYPE,h=n.NAMESPACE,y=Symbol(),b=Un(),E=b.DOMException,x=b.DOMExceptionName,T=Js();function R(a){if(a!==y)throw new TypeError("Illegal constructor")}function P(a){return a!==""}function _(a){return a?a.split(/[\t\n\f\r ]+/).filter(P):[]}function k(a,f){return i(a,f)||(a[f]=!0),a}function fe(a){if(!a)return[];var f=_(a);return Object.keys(f.reduce(k,{}))}function Se(a){return function(f){return a&&a.indexOf(f)!==-1}}function Be(a){if(!T.QName_exact.test(a))throw new E(E.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+a+'"')}function me(a,f){Be(f),a=a||null;var g=null,N=f;if(f.indexOf(":")>=0){var O=f.split(":");g=O[0],N=O[1]}if(g!==null&&a===null)throw new E(E.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(g==="xml"&&a!==n.NAMESPACE.XML)throw new E(E.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((g==="xmlns"||f==="xmlns")&&a!==n.NAMESPACE.XMLNS)throw new E(E.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(a===n.NAMESPACE.XMLNS&&g!=="xmlns"&&f!=="xmlns")throw new E(E.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[a,g,N]}function C(a,f){for(var g in a)i(a,g)&&(f[g]=a[g])}function A(a,f){var g=a.prototype;if(!(g instanceof f)){let N=function(){};N.prototype=f.prototype,N=new N,C(g,N),a.prototype=g=N}g.constructor!=a&&(typeof a!="function"&&console.error("unknown Class:"+a),g.constructor=a)}var G={},ee=G.ELEMENT_NODE=1,pe=G.ATTRIBUTE_NODE=2,Ae=G.TEXT_NODE=3,we=G.CDATA_SECTION_NODE=4,te=G.ENTITY_REFERENCE_NODE=5,De=G.ENTITY_NODE=6,B=G.PROCESSING_INSTRUCTION_NODE=7,I=G.COMMENT_NODE=8,M=G.DOCUMENT_NODE=9,U=G.DOCUMENT_TYPE_NODE=10,X=G.DOCUMENT_FRAGMENT_NODE=11,F=G.NOTATION_NODE=12,re=n.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 Q(a,f){if(f.length<a.length)return Q(f,a);var g=null;for(var N in a){if(a[N]!==f[N])return g;g=a[N]}return g}function $(a){return a.guid||(a.guid=Math.random()),a.guid}function j(){}j.prototype={length:0,item:function(a){return a>=0&&a<this.length?this[a]:null},toString:function(a){var f;typeof a=="function"?f={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:a}:a?f={requireWellFormed:!!a.requireWellFormed,splitCDATASections:a.splitCDATASections!==!1,nodeFilter:a.nodeFilter||null}:f={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};for(var g=[],N=0;N<this.length;N++)m(this[N],g,null,f);return g.join("")},filter:function(a){return Array.prototype.filter.call(this,a)},indexOf:function(a){return Array.prototype.indexOf.call(this,a)}},j.prototype[Symbol.iterator]=function(){var a=this,f=0;return{next:function(){return f<a.length?{value:a[f++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function V(a,f){this._node=a,this._refresh=f,le(this)}function le(a){var f=a._node._inc||a._node.ownerDocument._inc;if(a._inc!==f){var g=a._refresh(a._node);if(D(a,"length",g.length),!a.$$length||g.length<a.$$length)for(var N=g.length;N in a;N++)i(a,N)&&delete a[N];C(g,a),a._inc=f}}V.prototype.item=function(a){return le(this),this[a]||null},A(V,j);function ge(){}function he(a,f){for(var g=0;g<a.length;){if(a[g]===f)return g;g++}}function tt(a,f,g,N){if(N?f[he(f,N)]=g:(f[f.length]=g,f.length++),a){g.ownerElement=a;var O=a.ownerDocument;O&&(N&&Ye(O,a,N),Y(O,a,g))}}function lt(a,f,g){var N=he(f,g);if(N>=0){for(var O=f.length-1;N<=O;)f[N]=f[++N];if(f.length=O,a){var H=a.ownerDocument;H&&Ye(H,a,g),g.ownerElement=null}}}ge.prototype={length:0,item:j.prototype.item,getNamedItem:function(a){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(a=a.toLowerCase());for(var f=0;f<this.length;){var g=this[f];if(g.nodeName===a)return g;f++}return null},setNamedItem:function(a){var f=a.ownerElement;if(f&&f!==this._ownerElement)throw new E(E.INUSE_ATTRIBUTE_ERR);var g=this.getNamedItemNS(a.namespaceURI,a.localName);return g===a?a:(tt(this._ownerElement,this,a,g),g)},setNamedItemNS:function(a){return this.setNamedItem(a)},removeNamedItem:function(a){var f=this.getNamedItem(a);if(!f)throw new E(E.NOT_FOUND_ERR,a);return lt(this._ownerElement,this,f),f},removeNamedItemNS:function(a,f){var g=this.getNamedItemNS(a,f);if(!g)throw new E(E.NOT_FOUND_ERR,a?a+" : "+f:f);return lt(this._ownerElement,this,g),g},getNamedItemNS:function(a,f){a||(a=null);for(var g=0;g<this.length;){var N=this[g];if(N.localName===f&&N.namespaceURI===a)return N;g++}return null}},ge.prototype[Symbol.iterator]=function(){var a=this,f=0;return{next:function(){return f<a.length?{value:a[f++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Ke(){}Ke.prototype={hasFeature:function(a,f){return!0},createDocument:function(a,f,g){var N=c.XML_APPLICATION;a===h.HTML?N=c.XML_XHTML_APPLICATION:a===h.SVG&&(N=c.XML_SVG_IMAGE);var O=new Qe(y,{contentType:N});if(O.implementation=this,O.childNodes=new j,O.doctype=g||null,g&&O.appendChild(g),f){var H=O.createElementNS(a,f);O.appendChild(H)}return O},createDocumentType:function(a,f,g,N){Be(a);var O=new ut(y);return O.name=a,O.nodeName=a,O.publicId=f||"",O.systemId=g||"",O.internalSubset=N||"",O.childNodes=new j,O},createHTMLDocument:function(a){var f=new Qe(y,{contentType:c.HTML});if(f.implementation=this,f.childNodes=new j,a!==!1){f.doctype=this.createDocumentType("html"),f.doctype.ownerDocument=f,f.appendChild(f.doctype);var g=f.createElement("html");f.appendChild(g);var N=f.createElement("head");if(g.appendChild(N),typeof a=="string"){var O=f.createElement("title");O.appendChild(f.createTextNode(a)),N.appendChild(O)}g.appendChild(f.createElement("body"))}return f}};function de(a){R(a)}de.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 a=this.getRootNode();return a&&a.nodeType===a.DOCUMENT_NODE},contains:function(a){if(!a)return!1;var f=a;do{if(this===f)return!0;f=f.parentNode}while(f);return!1},getRootNode:function(a){var f=this;do{if(!f.parentNode)return f;f=f.parentNode}while(f)},isEqualNode:function(a){if(!a)return!1;for(var f=[{node:this,other:a}];f.length>0;){var g=f.pop(),N=g.node,O=g.other;if(N.nodeType!==O.nodeType)return!1;switch(N.nodeType){case N.DOCUMENT_TYPE_NODE:if(N.name!==O.name||N.publicId!==O.publicId||N.systemId!==O.systemId)return!1;break;case N.ELEMENT_NODE:if(N.namespaceURI!==O.namespaceURI||N.prefix!==O.prefix||N.localName!==O.localName||N.attributes.length!==O.attributes.length)return!1;for(var H=0;H<N.attributes.length;H++){var ce=N.attributes.item(H),Re=O.getAttributeNodeNS(ce.namespaceURI,ce.localName);if(!Re)return!1;f.push({node:ce,other:Re})}break;case N.ATTRIBUTE_NODE:if(N.namespaceURI!==O.namespaceURI||N.localName!==O.localName||N.value!==O.value)return!1;break;case N.PROCESSING_INSTRUCTION_NODE:if(N.target!==O.target||N.data!==O.data)return!1;break;case N.TEXT_NODE:case N.CDATA_SECTION_NODE:case N.COMMENT_NODE:if(N.data!==O.data)return!1;break}if(N.childNodes.length!==O.childNodes.length)return!1;for(var H=N.childNodes.length-1;H>=0;H--)f.push({node:N.childNodes[H],other:O.childNodes[H]})}return!0},isSameNode:function(a){return this===a},insertBefore:function(a,f){return Fe(this,a,f)},replaceChild:function(a,f){Fe(this,a,f,ye),f&&this.removeChild(f)},removeChild:function(a){return Oe(this,a)},appendChild:function(a){return this.insertBefore(a,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(a){return v(this.ownerDocument||this,this,a)},normalize:function(){L(this,null,{enter:function(a){for(var f=a.firstChild;f;){var g=f.nextSibling;g!==null&&g.nodeType===Ae&&f.nodeType===Ae?(a.removeChild(g),f.appendData(g.data)):f=g}return!0}})},isSupported:function(a,f){return this.ownerDocument.implementation.hasFeature(a,f)},lookupPrefix:function(a){for(var f=this;f;){var g=f._nsMap;if(g){for(var N in g)if(i(g,N)&&g[N]===a)return N}f=f.nodeType==pe?f.ownerDocument:f.parentNode}return null},lookupNamespaceURI:function(a){for(var f=this;f;){var g=f._nsMap;if(g&&i(g,a))return g[a];f=f.nodeType==pe?f.ownerDocument:f.parentNode}return null},isDefaultNamespace:function(a){var f=this.lookupPrefix(a);return f==null},compareDocumentPosition:function(a){if(this===a)return 0;var f=a,g=this,N=null,O=null;if(f instanceof Ue&&(N=f,f=N.ownerElement),g instanceof Ue&&(O=g,g=O.ownerElement,N&&f&&g===f))for(var H=0,ce;ce=g.attributes[H];H++){if(ce===N)return re.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+re.DOCUMENT_POSITION_PRECEDING;if(ce===O)return re.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+re.DOCUMENT_POSITION_FOLLOWING}if(!f||!g||g.ownerDocument!==f.ownerDocument)return re.DOCUMENT_POSITION_DISCONNECTED+re.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+($(g.ownerDocument)>$(f.ownerDocument)?re.DOCUMENT_POSITION_FOLLOWING:re.DOCUMENT_POSITION_PRECEDING);if(O&&f===g)return re.DOCUMENT_POSITION_CONTAINS+re.DOCUMENT_POSITION_PRECEDING;if(N&&f===g)return re.DOCUMENT_POSITION_CONTAINED_BY+re.DOCUMENT_POSITION_FOLLOWING;for(var Re=[],je=f.parentNode;je;){if(!O&&je===g)return re.DOCUMENT_POSITION_CONTAINED_BY+re.DOCUMENT_POSITION_FOLLOWING;Re.push(je),je=je.parentNode}Re.reverse();for(var ae=[],gt=g.parentNode;gt;){if(!N&&gt===f)return re.DOCUMENT_POSITION_CONTAINS+re.DOCUMENT_POSITION_PRECEDING;ae.push(gt),gt=gt.parentNode}ae.reverse();var xt=Q(Re,ae);for(var kt in xt.childNodes){var Tt=xt.childNodes[kt];if(Tt===g)return re.DOCUMENT_POSITION_FOLLOWING;if(Tt===f)return re.DOCUMENT_POSITION_PRECEDING;if(ae.indexOf(Tt)>=0)return re.DOCUMENT_POSITION_FOLLOWING;if(Re.indexOf(Tt)>=0)return re.DOCUMENT_POSITION_PRECEDING}return 0}};function Yt(a){return a=="<"&&"&lt;"||a==">"&&"&gt;"||a=="&"&&"&amp;"||a=='"'&&"&quot;"||"&#"+a.charCodeAt()+";"}C(G,de),C(G,de.prototype),C(re,de),C(re,de.prototype);function rt(a,f){L(a,null,{enter:function(g){return f(g)?L.STOP:!0}})}function L(a,f,g){for(var N=[{node:a,context:f,phase:L.ENTER}];N.length>0;){var O=N.pop();if(O.phase===L.ENTER){var H=g.enter(O.node,O.context);if(H===L.STOP)return L.STOP;if(N.push({node:O.node,context:H,phase:L.EXIT}),H==null)continue;for(var ce=O.node.lastChild;ce;)N.push({node:ce,context:H,phase:L.ENTER}),ce=ce.previousSibling}else g.exit&&g.exit(O.node,O.context)}}L.STOP=Symbol("walkDOM.STOP"),L.ENTER=0,L.EXIT=1;function Qe(a,f){R(a);var g=f||{};this.ownerDocument=this,this.contentType=g.contentType||c.XML_APPLICATION,this.type=o(this.contentType)?"html":"xml"}function Y(a,f,g){a&&a._inc++;var N=g.namespaceURI;N===h.XMLNS&&(f._nsMap[g.prefix?g.localName:""]=g.value)}function Ye(a,f,g,N){a&&a._inc++;var O=g.namespaceURI;O===h.XMLNS&&delete f._nsMap[g.prefix?g.localName:""]}function Ze(a,f,g){if(a&&a._inc){a._inc++;var N=f.childNodes;if(g&&!g.nextSibling)N[N.length++]=g;else{for(var O=f.firstChild,H=0;O;)N[H++]=O,O=O.nextSibling;N.length=H,delete N[N.length]}}}function Oe(a,f){if(a!==f.parentNode)throw new E(E.NOT_FOUND_ERR,"child's parent is not parent");var g=f.previousSibling,N=f.nextSibling;return g?g.nextSibling=N:a.firstChild=N,N?N.previousSibling=g:a.lastChild=g,Ze(a.ownerDocument,a),f.parentNode=null,f.previousSibling=null,f.nextSibling=null,f}function ie(a){return a&&(a.nodeType===de.DOCUMENT_NODE||a.nodeType===de.DOCUMENT_FRAGMENT_NODE||a.nodeType===de.ELEMENT_NODE)}function se(a){return a&&(a.nodeType===de.CDATA_SECTION_NODE||a.nodeType===de.COMMENT_NODE||a.nodeType===de.DOCUMENT_FRAGMENT_NODE||a.nodeType===de.DOCUMENT_TYPE_NODE||a.nodeType===de.ELEMENT_NODE||a.nodeType===de.PROCESSING_INSTRUCTION_NODE||a.nodeType===de.TEXT_NODE)}function Pe(a){return a&&a.nodeType===de.DOCUMENT_TYPE_NODE}function ct(a){return a&&a.nodeType===de.ELEMENT_NODE}function z(a){return a&&a.nodeType===de.TEXT_NODE}function Ge(a,f){var g=a.childNodes||[];if(e(g,ct)||Pe(f))return!1;var N=e(g,Pe);return!(f&&N&&g.indexOf(N)>g.indexOf(f))}function pr(a,f){var g=a.childNodes||[];function N(H){return ct(H)&&H!==f}if(e(g,N))return!1;var O=e(g,Pe);return!(f&&O&&g.indexOf(O)>g.indexOf(f))}function J(a,f,g){if(!ie(a))throw new E(E.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+a.nodeType);if(g&&g.parentNode!==a)throw new E(E.NOT_FOUND_ERR,"child not in parent");if(!se(f)||Pe(f)&&a.nodeType!==de.DOCUMENT_NODE)throw new E(E.HIERARCHY_REQUEST_ERR,"Unexpected node type "+f.nodeType+" for parent node type "+a.nodeType)}function Nt(a,f,g){var N=a.childNodes||[],O=f.childNodes||[];if(f.nodeType===de.DOCUMENT_FRAGMENT_NODE){var H=O.filter(ct);if(H.length>1||e(O,z))throw new E(E.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(H.length===1&&!Ge(a,g))throw new E(E.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ct(f)&&!Ge(a,g))throw new E(E.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Pe(f)){if(e(N,Pe))throw new E(E.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var ce=e(N,ct);if(g&&N.indexOf(ce)<N.indexOf(g))throw new E(E.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!g&&ce)throw new E(E.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function ye(a,f,g){var N=a.childNodes||[],O=f.childNodes||[];if(f.nodeType===de.DOCUMENT_FRAGMENT_NODE){var H=O.filter(ct);if(H.length>1||e(O,z))throw new E(E.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(H.length===1&&!pr(a,g))throw new E(E.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ct(f)&&!pr(a,g))throw new E(E.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Pe(f)){if(e(N,function(je){return Pe(je)&&je!==g}))throw new E(E.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var ce=e(N,ct);if(g&&N.indexOf(ce)<N.indexOf(g))throw new E(E.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function Fe(a,f,g,N){J(a,f,g),a.nodeType===de.DOCUMENT_NODE&&(N||Nt)(a,f,g);var O=f.parentNode;if(O&&O.removeChild(f),f.nodeType===X){var H=f.firstChild;if(H==null)return f;var ce=f.lastChild}else H=ce=f;var Re=g?g.previousSibling:a.lastChild;H.previousSibling=Re,ce.nextSibling=g,Re?Re.nextSibling=H:a.firstChild=H,g==null?a.lastChild=ce:g.previousSibling=ce;do H.parentNode=a;while(H!==ce&&(H=H.nextSibling));return Ze(a.ownerDocument||a,a,f),f.nodeType==X&&(f.firstChild=f.lastChild=null),f}Qe.prototype={implementation:null,nodeName:"#document",nodeType:M,doctype:null,documentElement:null,_inc:1,insertBefore:function(a,f){if(a.nodeType===X){for(var g=a.firstChild;g;){var N=g.nextSibling;this.insertBefore(g,f),g=N}return a}return Fe(this,a,f),a.ownerDocument=this,this.documentElement===null&&a.nodeType===ee&&(this.documentElement=a),a},removeChild:function(a){var f=Oe(this,a);return f===this.documentElement&&(this.documentElement=null),f},replaceChild:function(a,f){Fe(this,a,f,ye),a.ownerDocument=this,f&&this.removeChild(f),ct(a)&&(this.documentElement=a)},importNode:function(a,f){return w(this,a,f)},getElementById:function(a){var f=null;return rt(this.documentElement,function(g){if(g.nodeType==ee&&g.getAttribute("id")==a)return f=g,!0}),f},createElement:function(a){var f=new Me(y);f.ownerDocument=this,this.type==="html"&&(a=a.toLowerCase()),r(this.contentType)&&(f.namespaceURI=h.HTML),f.nodeName=a,f.tagName=a,f.localName=a,f.childNodes=new j;var g=f.attributes=new ge;return g._ownerElement=f,f},createDocumentFragment:function(){var a=new qt(y);return a.ownerDocument=this,a.childNodes=new j,a},createTextNode:function(a){var f=new Z(y);return f.ownerDocument=this,f.childNodes=new j,f.appendData(a),f},createComment:function(a){var f=new Jt(y);return f.ownerDocument=this,f.childNodes=new j,f.appendData(a),f},createCDATASection:function(a){if(a.indexOf("]]>")!==-1)throw new E(E.INVALID_CHARACTER_ERR,'data contains "]]>"');var f=new ft(y);return f.ownerDocument=this,f.childNodes=new j,f.appendData(a),f},createProcessingInstruction:function(a,f){var g=new sr(y);return g.ownerDocument=this,g.childNodes=new j,g.nodeName=g.target=a,g.nodeValue=g.data=f,g},createAttribute:function(a){if(!T.QName_exact.test(a))throw new E(E.INVALID_CHARACTER_ERR,'invalid character in name "'+a+'"');return this.type==="html"&&(a=a.toLowerCase()),this._createAttribute(a)},_createAttribute:function(a){var f=new Ue(y);return f.ownerDocument=this,f.childNodes=new j,f.name=a,f.nodeName=a,f.localName=a,f.specified=!0,f},createEntityReference:function(a){if(!T.Name.test(a))throw new E(E.INVALID_CHARACTER_ERR,'not a valid xml name "'+a+'"');if(this.type==="html")throw new E("document is an html document",x.NotSupportedError);var f=new ve(y);return f.ownerDocument=this,f.childNodes=new j,f.nodeName=a,f},createElementNS:function(a,f){var g=me(a,f),N=new Me(y),O=N.attributes=new ge;return N.childNodes=new j,N.ownerDocument=this,N.nodeName=f,N.tagName=f,N.namespaceURI=g[0],N.prefix=g[1],N.localName=g[2],O._ownerElement=N,N},createAttributeNS:function(a,f){var g=me(a,f),N=new Ue(y);return N.ownerDocument=this,N.childNodes=new j,N.nodeName=f,N.name=f,N.specified=!0,N.namespaceURI=g[0],N.prefix=g[1],N.localName=g[2],N}},A(Qe,de);function Me(a){R(a),this._nsMap=Object.create(null)}Me.prototype={nodeType:ee,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type==="html"&&this.namespaceURI===h.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(a){return!!this.getAttributeNode(a)},getAttribute:function(a){var f=this.getAttributeNode(a);return f?f.value:null},getAttributeNode:function(a){return this._isInHTMLDocumentAndNamespace()&&(a=a.toLowerCase()),this.attributes.getNamedItem(a)},setAttribute:function(a,f){this._isInHTMLDocumentAndNamespace()&&(a=a.toLowerCase());var g=this.getAttributeNode(a);g?g.value=g.nodeValue=""+f:(g=this.ownerDocument._createAttribute(a),g.value=g.nodeValue=""+f,this.setAttributeNode(g))},removeAttribute:function(a){var f=this.getAttributeNode(a);f&&this.removeAttributeNode(f)},setAttributeNode:function(a){return this.attributes.setNamedItem(a)},setAttributeNodeNS:function(a){return this.attributes.setNamedItemNS(a)},removeAttributeNode:function(a){return this.attributes.removeNamedItem(a.nodeName)},removeAttributeNS:function(a,f){var g=this.getAttributeNodeNS(a,f);g&&this.removeAttributeNode(g)},hasAttributeNS:function(a,f){return this.getAttributeNodeNS(a,f)!=null},getAttributeNS:function(a,f){var g=this.getAttributeNodeNS(a,f);return g?g.value:null},setAttributeNS:function(a,f,g){var N=me(a,f),O=N[2],H=this.getAttributeNodeNS(a,O);H?H.value=H.nodeValue=""+g:(H=this.ownerDocument.createAttributeNS(a,f),H.value=H.nodeValue=""+g,this.setAttributeNode(H))},getAttributeNodeNS:function(a,f){return this.attributes.getNamedItemNS(a,f)},getElementsByClassName:function(a){var f=fe(a);return new V(this,function(g){var N=[];return f.length>0&&rt(g,function(O){if(O!==g&&O.nodeType===ee){var H=O.getAttribute("class");if(H){var ce=a===H;if(!ce){var Re=fe(H);ce=f.every(Se(Re))}ce&&N.push(O)}}}),N})},getElementsByTagName:function(a){var f=(this.nodeType===M?this:this.ownerDocument).type==="html",g=a.toLowerCase();return new V(this,function(N){var O=[];return rt(N,function(H){if(!(H===N||H.nodeType!==ee))if(a==="*")O.push(H);else{var ce=H.getQualifiedName(),Re=f&&H.namespaceURI===h.HTML?g:a;ce===Re&&O.push(H)}}),O})},getElementsByTagNameNS:function(a,f){return new V(this,function(g){var N=[];return rt(g,function(O){O!==g&&O.nodeType===ee&&(a==="*"||O.namespaceURI===a)&&(f==="*"||O.localName==f)&&N.push(O)}),N})}},Qe.prototype.getElementsByClassName=Me.prototype.getElementsByClassName,Qe.prototype.getElementsByTagName=Me.prototype.getElementsByTagName,Qe.prototype.getElementsByTagNameNS=Me.prototype.getElementsByTagNameNS,A(Me,de);function Ue(a){R(a),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}Ue.prototype.nodeType=pe,A(Ue,de);function ue(a){R(a)}ue.prototype={data:"",substringData:function(a,f){return this.data.substring(a,a+f)},appendData:function(a){a=this.data+a,this.nodeValue=this.data=a,this.length=a.length},insertData:function(a,f){this.replaceData(a,0,f)},deleteData:function(a,f){this.replaceData(a,f,"")},replaceData:function(a,f,g){var N=this.data.substring(0,a),O=this.data.substring(a+f);g=N+g+O,this.nodeValue=this.data=g,this.length=g.length}},A(ue,de);function Z(a){R(a)}Z.prototype={nodeName:"#text",nodeType:Ae,splitText:function(a){var f=this.data,g=f.substring(a);f=f.substring(0,a),this.data=this.nodeValue=f,this.length=f.length;var N=this.ownerDocument.createTextNode(g);return this.parentNode&&this.parentNode.insertBefore(N,this.nextSibling),N}},A(Z,ue);function Jt(a){R(a)}Jt.prototype={nodeName:"#comment",nodeType:I},A(Jt,ue);function ft(a){R(a)}ft.prototype={nodeName:"#cdata-section",nodeType:we},A(ft,Z);function ut(a){R(a)}ut.prototype.nodeType=U,A(ut,de);function It(a){R(a)}It.prototype.nodeType=F,A(It,de);function Rt(a){R(a)}Rt.prototype.nodeType=De,A(Rt,de);function ve(a){R(a)}ve.prototype.nodeType=te,A(ve,de);function qt(a){R(a)}qt.prototype.nodeName="#document-fragment",qt.prototype.nodeType=X,A(qt,de);function sr(a){R(a)}sr.prototype.nodeType=B,A(sr,ue);function rn(){}rn.prototype.serializeToString=function(a,f){return wt.call(a,f)},de.prototype.toString=wt;function wt(a){var f;typeof a=="function"?f={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:a}:a!=null?f={requireWellFormed:!!a.requireWellFormed,splitCDATASections:a.splitCDATASections!==!1,nodeFilter:a.nodeFilter||null}:f={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};var g=[],N=this.nodeType===M&&this.documentElement||this,O=N.prefix,H=N.namespaceURI;if(H&&O==null){var O=N.lookupPrefix(H);if(O==null)var ce=[{namespace:H,prefix:null}]}return m(this,g,ce,f),g.join("")}function t(a,f,g){var N=a.prefix||"",O=a.namespaceURI;if(!O||N==="xml"&&O===h.XML||O===h.XMLNS)return!1;for(var H=g.length;H--;){var ce=g[H];if(ce.prefix===N)return ce.namespace!==O}return!0}function u(a,f,g){a.push(" ",f,'="',g.replace(/[<>&"\t\n\r]/g,Yt),'"')}function m(a,f,g,N){g||(g=[]);var O=N.nodeFilter,H=N.requireWellFormed,ce=N.splitCDATASections,Re=a.nodeType===M?a:a.ownerDocument,je=Re.type==="html";L(a,{ns:g},{enter:function(ae,gt){var xt=gt.ns;if(O)if(ae=O(ae),ae){if(typeof ae=="string")return f.push(ae),null}else return null;switch(ae.nodeType){case ee:var kt=ae.attributes,Tt=kt.length,q=ae.tagName,be=q;if(!je&&!ae.prefix&&ae.namespaceURI){for(var nt,St=0;St<kt.length;St++)if(kt.item(St).name==="xmlns"){nt=kt.item(St).value;break}if(!nt)for(var ur=xt.length-1;ur>=0;ur--){var Ir=xt[ur];if(Ir.prefix===""&&Ir.namespace===ae.namespaceURI){nt=Ir.namespace;break}}if(nt!==ae.namespaceURI)for(var ur=xt.length-1;ur>=0;ur--){var Ir=xt[ur];if(Ir.namespace===ae.namespaceURI){Ir.prefix&&(be=Ir.prefix+":"+q);break}}}f.push("<",be);for(var hr=xt.slice(),Rr=0;Rr<Tt;Rr++){var jt=kt.item(Rr);jt.prefix=="xmlns"?hr.push({prefix:jt.localName,namespace:jt.value}):jt.nodeName=="xmlns"&&hr.push({prefix:"",namespace:jt.value})}for(var Rr=0;Rr<Tt;Rr++){var jt=kt.item(Rr);if(t(jt,je,hr)){var $s=jt.prefix||"",Fn=jt.namespaceURI;u(f,$s?"xmlns:"+$s:"xmlns",Fn),hr.push({prefix:$s,namespace:Fn})}var Pn=O?O(jt):jt;Pn&&(typeof Pn=="string"?f.push(Pn):u(f,Pn.name,Pn.value))}if(q===be&&t(ae,je,hr)){var Gs=ae.prefix||"",Fn=ae.namespaceURI;u(f,Gs?"xmlns:"+Gs:"xmlns",Fn),hr.push({prefix:Gs,namespace:Fn})}var Xs=!ae.firstChild;if(Xs&&(je||ae.namespaceURI===h.HTML)&&(Xs=l(q)),Xs)return f.push("/>"),null;if(f.push(">"),je&&s(q)){for(var nn=ae.firstChild;nn;)nn.data?f.push(nn.data):m(nn,f,hr.slice(),N),nn=nn.nextSibling;return f.push("</",be,">"),null}return{ns:hr,tag:be};case M:case X:if(H&&ae.nodeType===M&&ae.documentElement==null)throw new E("The Document has no documentElement",x.InvalidStateError);return{ns:xt};case pe:return u(f,ae.name,ae.value),null;case Ae:if(H&&T.InvalidChar.test(ae.data))throw new E("The Text node data contains characters outside the XML Char production",x.InvalidStateError);return f.push(ae.data.replace(/[<&>]/g,Yt)),null;case we:if(H&&ae.data.indexOf("]]>")!==-1)throw new E('The CDATASection data contains "]]>"',x.InvalidStateError);return ce?f.push(T.CDATA_START,ae.data.replace(/]]>/g,"]]]]><![CDATA[>"),T.CDATA_END):f.push(T.CDATA_START,ae.data,T.CDATA_END),null;case I:if(H){if(T.InvalidChar.test(ae.data))throw new E("The comment node data contains characters outside the XML Char production",x.InvalidStateError);if(ae.data.indexOf("--")!==-1||ae.data[ae.data.length-1]==="-")throw new E('The comment node data contains "--" or ends with "-"',x.InvalidStateError)}return f.push(T.COMMENT_START,ae.data,T.COMMENT_END),null;case U:var Ji=ae.publicId,ar=ae.systemId;if(H){if(Ji&&!T.PubidLiteral_match.test(Ji))throw new E("DocumentType publicId is not a valid PubidLiteral",x.InvalidStateError);if(ar&&ar!=="."&&!T.SystemLiteral_match.test(ar))throw new E("DocumentType systemId is not a valid SystemLiteral",x.InvalidStateError);if(ae.internalSubset&&ae.internalSubset.indexOf("]>")!==-1)throw new E('DocumentType internalSubset contains "]>"',x.InvalidStateError)}return f.push(T.DOCTYPE_DECL_START," ",ae.name),Ji?(f.push(" ",T.PUBLIC," ",Ji),ar&&ar!=="."&&f.push(" ",ar)):ar&&ar!=="."&&f.push(" ",T.SYSTEM," ",ar),ae.internalSubset&&f.push(" [",ae.internalSubset,"]"),f.push(">"),null;case B:if(H){if(ae.target.indexOf(":")!==-1||ae.target.toLowerCase()==="xml")throw new E("The ProcessingInstruction target is not well-formed",x.InvalidStateError);if(T.InvalidChar.test(ae.data))throw new E("The ProcessingInstruction data contains characters outside the XML Char production",x.InvalidStateError);if(ae.data.indexOf("?>")!==-1)throw new E('The ProcessingInstruction data contains "?>"',x.InvalidStateError)}return f.push("<?",ae.target," ",ae.data,"?>"),null;case te:return f.push("&",ae.nodeName,";"),null;default:return f.push("??",ae.nodeName),null}},exit:function(ae,gt){gt&&gt.tag&&f.push("</",gt.tag,">")}})}function w(a,f,g){var N;return L(f,null,{enter:function(O,H){var ce=O.cloneNode(!1);ce.ownerDocument=a,ce.parentNode=null,H===null?N=ce:H.appendChild(ce);var Re=O.nodeType===pe||g;return Re?ce:null}}),N}function v(a,f,g){var N;return L(f,null,{enter:function(O,H){var ce=new O.constructor(y);for(var Re in O)if(i(O,Re)){var je=O[Re];typeof je!="object"&&je!=ce[Re]&&(ce[Re]=je)}O.childNodes&&(ce.childNodes=new j),ce.ownerDocument=a;var ae=g;switch(ce.nodeType){case ee:var gt=O.attributes,xt=ce.attributes=new ge,kt=gt.length;xt._ownerElement=ce;for(var Tt=0;Tt<kt;Tt++)ce.setAttributeNode(v(a,gt.item(Tt),!0));break;case pe:ae=!0}return H!==null?H.appendChild(ce):N=ce,ae?ce:null}}),N}function D(a,f,g){a[f]=g}function K(a){for(var f=[],g=a.firstChild;g;)g.nodeType===ee&&f.push(g),g=g.nextSibling;return f}try{Object.defineProperty&&(Object.defineProperty(V.prototype,"length",{get:function(){return le(this),this.$$length}}),Object.defineProperty(de.prototype,"textContent",{get:function(){if(this.nodeType===ee||this.nodeType===X){var a=[];return L(this,null,{enter:function(f){if(f.nodeType===ee||f.nodeType===X)return!0;if(f.nodeType===B||f.nodeType===I)return null;a.push(f.nodeValue)}}),a.join("")}return this.nodeValue},set:function(a){switch(this.nodeType){case ee:case X:for(;this.firstChild;)this.removeChild(this.firstChild);(a||String(a))&&this.appendChild(this.ownerDocument.createTextNode(a));break;default:this.data=a,this.value=a,this.nodeValue=a}}}),Object.defineProperty(Me.prototype,"children",{get:function(){return new V(this,K)}}),Object.defineProperty(Qe.prototype,"children",{get:function(){return new V(this,K)}}),Object.defineProperty(qt.prototype,"children",{get:function(){return new V(this,K)}}),D=function(a,f,g){a["$$"+f]=g})}catch(a){}return $e._updateLiveList=le,$e.Attr=Ue,$e.CDATASection=ft,$e.CharacterData=ue,$e.Comment=Jt,$e.Document=Qe,$e.DocumentFragment=qt,$e.DocumentType=ut,$e.DOMImplementation=Ke,$e.Element=Me,$e.Entity=Rt,$e.EntityReference=ve,$e.LiveNodeList=V,$e.NamedNodeMap=ge,$e.Node=de,$e.NodeList=j,$e.Notation=It,$e.Text=Z,$e.ProcessingInstruction=sr,$e.walkDOM=L,$e.XMLSerializer=rn,$e}var dr={},Qi={},Zs;function Dl(){return Zs||(Zs=1,(function(n){var e=kr().freeze;n.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),n.HTML_ENTITIES=e({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:`
5
+ `,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"}),n.entityMap=n.HTML_ENTITIES})(Qi)),Qi}var on={},eu;function Cl(){if(eu)return on;eu=1;var n=kr(),e=Js(),r=Un(),i=n.isHTMLEscapableRawTextElement,o=n.isHTMLMimeType,s=n.isHTMLRawTextElement,l=n.hasOwn,c=n.NAMESPACE,h=r.ParseError,y=r.DOMException,b=0,E=1,x=2,T=3,R=4,P=5,_=6,k=7;function fe(){}fe.prototype={parse:function(B,I,M){var U=this.domBuilder;U.startDocument(),ee(I,I=Object.create(null)),Be(B,I,M,U,this.errorHandler),U.endDocument()}};var Se=/&#?\w+;?/g;function Be(B,I,M,U,X){var F=o(U.mimeType);B.indexOf(e.UNICODE_REPLACEMENT_CHARACTER)>=0&&X.warning("Unicode replacement character detected, source encoding issues?");function re(ye){if(ye>65535){ye-=65536;var Fe=55296+(ye>>10),Me=56320+(ye&1023);return String.fromCharCode(Fe,Me)}else return String.fromCharCode(ye)}function Q(ye){var Fe=ye[ye.length-1]===";"?ye:ye+";";if(!F&&Fe!==ye)return X.error("EntityRef: expecting ;"),ye;var Me=e.Reference.exec(Fe);if(!Me||Me[0].length!==Fe.length)return X.error("entity not matching Reference production: "+ye),ye;var Ue=Fe.slice(1,-1);return l(M,Ue)?M[Ue]:Ue.charAt(0)==="#"?re(parseInt(Ue.substring(1).replace("x","0x"))):(X.error("entity not found:"+ye),ye)}function $(ye){if(ye>Ke){var Fe=B.substring(Ke,ye).replace(Se,Q);ge&&he(Ke),U.characters(Fe,0,ye-Ke),Ke=ye}}var j=0,V=0,le=/\r\n?|\n|$/g,ge=U.locator;function he(ye,Fe){for(;ye>=V&&(Fe=le.exec(B));)j=V,V=Fe.index+Fe[0].length,ge.lineNumber++;ge.columnNumber=ye-j+1}for(var tt=[{currentNSMap:I}],lt=[],Ke=0;;){try{var de=B.indexOf("<",Ke);if(de<0){if(!F&&lt.length>0)return X.fatalError("unclosed xml tag(s): "+lt.join(", "));if(!B.substring(Ke).match(/^\s*$/)){var Yt=U.doc,rt=Yt.createTextNode(B.substring(Ke));if(Yt.documentElement)return X.error("Extra content at the end of the document");Yt.appendChild(rt),U.currentElement=rt}return}if(de>Ke){var L=B.substring(Ke,de);!F&&lt.length===0&&(L=L.replace(new RegExp(e.S_OPT.source,"g"),""),L&&X.error("Unexpected content outside root element: '"+L+"'")),$(de)}switch(B.charAt(de+1)){case"/":var z=B.indexOf(">",de+2),Qe=B.substring(de+2,z>0?z:void 0);if(!Qe)return X.fatalError("end tag name missing");var Y=z>0&&e.reg("^",e.QName_group,e.S_OPT,"$").exec(Qe);if(!Y)return X.fatalError('end tag name contains invalid characters: "'+Qe+'"');if(!U.currentElement&&!U.doc.documentElement)return;var Ye=lt[lt.length-1]||U.currentElement.tagName||U.doc.documentElement.tagName||"";if(Ye!==Y[1]){var Ze=Y[1].toLowerCase();if(!F||Ye.toLowerCase()!==Ze)return X.fatalError('Opening and ending tag mismatch: "'+Ye+'" != "'+Qe+'"')}var Oe=tt.pop();lt.pop();var ie=Oe.localNSMap;if(U.endElement(Oe.uri,Oe.localName,Ye),ie)for(var se in ie)l(ie,se)&&U.endPrefixMapping(se);z++;break;case"?":ge&&he(de),z=te(B,de,U,X);break;case"!":ge&&he(de),z=we(B,de,U,X,F);break;default:ge&&he(de);var Pe=new De,ct=tt[tt.length-1].currentNSMap,z=C(B,de,Pe,ct,Q,X,F),Ge=Pe.length;if(Pe.closed||(F&&n.isHTMLVoidElement(Pe.tagName)?Pe.closed=!0:lt.push(Pe.tagName)),ge&&Ge){for(var pr=me(ge,{}),J=0;J<Ge;J++){var Nt=Pe[J];he(Nt.offset),Nt.locator=me(ge,{})}U.locator=pr,A(Pe,U,ct)&&tt.push(Pe),U.locator=ge}else A(Pe,U,ct)&&tt.push(Pe);F&&!Pe.closed?z=G(B,z,Pe.tagName,Q,U):z++}}catch(ye){if(ye instanceof h)throw ye;if(ye instanceof y)throw new h(ye.name+": "+ye.message,U.locator,ye);X.error("element parse error: "+ye),z=-1}z>Ke?Ke=z:$(Math.max(de,Ke)+1)}}function me(B,I){return I.lineNumber=B.lineNumber,I.columnNumber=B.columnNumber,I}function C(B,I,M,U,X,F,re){function Q(he,tt,lt){if(l(M.attributeNames,he))return F.fatalError("Attribute "+he+" redefined");if(!re&&tt.indexOf("<")>=0)return F.fatalError("Unescaped '<' not allowed in attributes values");M.addValue(he,tt.replace(/[\t\n\r]/g," ").replace(Se,X),lt)}for(var $,j,V=++I,le=b;;){var ge=B.charAt(V);switch(ge){case"=":if(le===E)$=B.slice(I,V),le=T;else if(le===x)le=T;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(le===T||le===E)if(le===E&&(F.warning('attribute value must after "="'),$=B.slice(I,V)),I=V+1,V=B.indexOf(ge,I),V>0)j=B.slice(I,V),Q($,j,I-1),le=P;else throw new Error("attribute value no end '"+ge+"' match");else if(le==R)j=B.slice(I,V),Q($,j,I),F.warning('attribute "'+$+'" missed start quot('+ge+")!!"),I=V+1,le=P;else throw new Error('attribute value must after "="');break;case"/":switch(le){case b:M.setTagName(B.slice(I,V));case P:case _:case k:le=k,M.closed=!0;case R:case E:break;case x:M.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return F.error("unexpected end of input"),le==b&&M.setTagName(B.slice(I,V)),V;case">":switch(le){case b:M.setTagName(B.slice(I,V));case P:case _:case k:break;case R:case E:j=B.slice(I,V),j.slice(-1)==="/"&&(M.closed=!0,j=j.slice(0,-1));case x:le===x&&(j=$),le==R?(F.warning('attribute "'+j+'" missed quot(")!'),Q($,j,I)):(re||F.warning('attribute "'+j+'" missed value!! "'+j+'" instead!!'),Q(j,j,I));break;case T:if(!re)return F.fatalError(`AttValue: ' or " expected`)}return V;case"\x80":ge=" ";default:if(ge<=" ")switch(le){case b:M.setTagName(B.slice(I,V)),le=_;break;case E:$=B.slice(I,V),le=x;break;case R:var j=B.slice(I,V);F.warning('attribute "'+j+'" missed quot(")!!'),Q($,j,I);case P:le=_;break}else switch(le){case x:re||F.warning('attribute "'+$+'" missed value!! "'+$+'" instead2!!'),Q($,$,I),I=V,le=E;break;case P:F.warning('attribute space is required"'+$+'"!!');case _:le=E,I=V;break;case T:le=R,I=V;break;case k:throw new Error("elements closed character '/' and '>' must be connected to")}}V++}}function A(B,I,M){for(var U=B.tagName,X=null,le=B.length;le--;){var F=B[le],re=F.qName,Q=F.value,ge=re.indexOf(":");if(ge>0)var $=F.prefix=re.slice(0,ge),j=re.slice(ge+1),V=$==="xmlns"&&j;else j=re,$=null,V=re==="xmlns"&&"";F.localName=j,V!==!1&&(X==null&&(X=Object.create(null),ee(M,M=Object.create(null))),M[V]=X[V]=Q,F.uri=c.XMLNS,I.startPrefixMapping(V,Q))}for(var le=B.length;le--;)F=B[le],F.prefix&&(F.prefix==="xml"&&(F.uri=c.XML),F.prefix!=="xmlns"&&(F.uri=M[F.prefix]));var ge=U.indexOf(":");ge>0?($=B.prefix=U.slice(0,ge),j=B.localName=U.slice(ge+1)):($=null,j=B.localName=U);var he=B.uri=M[$||""];if(I.startElement(he,j,U,B),B.closed){if(I.endElement(he,j,U),X)for($ in X)l(X,$)&&I.endPrefixMapping($)}else return B.currentNSMap=M,B.localNSMap=X,!0}function G(B,I,M,U,X){var F=i(M);if(F||s(M)){var re=B.indexOf("</"+M+">",I),Q=B.substring(I+1,re);return F&&(Q=Q.replace(Se,U)),X.characters(Q,0,Q.length),re}return I+1}function ee(B,I){for(var M in B)l(B,M)&&(I[M]=B[M])}function pe(B,I){var M=I;function U(V){return V=V||0,B.charAt(M+V)}function X(V){V=V||1,M+=V}function F(){for(var V=0;M<B.length;){var le=U();if(le!==" "&&le!==`
6
+ `&&le!==" "&&le!=="\r")return V;V++,X()}return-1}function re(){return B.substring(M)}function Q(V){return B.substring(M,M+V.length)===V}function $(V){return B.substring(M,M+V.length).toUpperCase()===V.toUpperCase()}function j(V){var le=e.reg("^",V),ge=le.exec(re());return ge?(X(ge[0].length),ge[0]):null}return{char:U,getIndex:function(){return M},getMatch:j,getSource:function(){return B},skip:X,skipBlanks:F,substringFromIndex:re,substringStartsWith:Q,substringStartsWithCaseInsensitive:$}}function Ae(B,I){function M(Q,$){var j=e.PI.exec(Q.substringFromIndex());return j?j[1].toLowerCase()==="xml"?$.fatalError("xml declaration is only allowed at the start of the document, but found at position "+Q.getIndex()):(Q.skip(j[0].length),j[0]):$.fatalError("processing instruction is not well-formed at position "+Q.getIndex())}var U=B.getSource();if(B.char()==="["){B.skip(1);for(var X=B.getIndex();B.getIndex()<U.length;){if(B.skipBlanks(),B.char()==="]"){var F=U.substring(X,B.getIndex());return B.skip(1),F}var re=null;if(B.char()==="<"&&B.char(1)==="!")switch(B.char(2)){case"E":B.char(3)==="L"?re=B.getMatch(e.elementdecl):B.char(3)==="N"&&(re=B.getMatch(e.EntityDecl));break;case"A":re=B.getMatch(e.AttlistDecl);break;case"N":re=B.getMatch(e.NotationDecl);break;case"-":re=B.getMatch(e.Comment);break}else if(B.char()==="<"&&B.char(1)==="?")re=M(B,I);else if(B.char()==="%")re=B.getMatch(e.PEReference);else return I.fatalError("Error detected in Markup declaration");if(!re)return I.fatalError("Error in internal subset at position "+B.getIndex())}return I.fatalError("doctype internal subset is not well-formed, missing ]")}}function we(B,I,M,U,X){var F=pe(B,I);switch(X?F.char(2).toUpperCase():F.char(2)){case"-":var re=F.getMatch(e.Comment);return re?(M.comment(re,e.COMMENT_START.length,re.length-e.COMMENT_START.length-e.COMMENT_END.length),F.getIndex()):U.fatalError("comment is not well-formed at position "+F.getIndex());case"[":var Q=F.getMatch(e.CDSect);return Q?!X&&!M.currentElement?U.fatalError("CDATA outside of element"):(M.startCDATA(),M.characters(Q,e.CDATA_START.length,Q.length-e.CDATA_START.length-e.CDATA_END.length),M.endCDATA(),F.getIndex()):U.fatalError("Invalid CDATA starting at position "+I);case"D":{if(M.doc&&M.doc.documentElement)return U.fatalError("Doctype not allowed inside or after documentElement at position "+F.getIndex());if(X?!F.substringStartsWithCaseInsensitive(e.DOCTYPE_DECL_START):!F.substringStartsWith(e.DOCTYPE_DECL_START))return U.fatalError("Expected "+e.DOCTYPE_DECL_START+" at position "+F.getIndex());if(F.skip(e.DOCTYPE_DECL_START.length),F.skipBlanks()<1)return U.fatalError("Expected whitespace after "+e.DOCTYPE_DECL_START+" at position "+F.getIndex());var $={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if($.name=F.getMatch(e.Name),!$.name)return U.fatalError("doctype name missing or contains unexpected characters at position "+F.getIndex());if(X&&$.name.toLowerCase()!=="html"&&U.warning("Unexpected DOCTYPE in HTML document at position "+F.getIndex()),F.skipBlanks(),F.substringStartsWith(e.PUBLIC)||F.substringStartsWith(e.SYSTEM)){var j=e.ExternalID_match.exec(F.substringFromIndex());if(!j)return U.fatalError("doctype external id is not well-formed at position "+F.getIndex());j.groups.SystemLiteralOnly!==void 0?$.systemId=j.groups.SystemLiteralOnly:($.systemId=j.groups.SystemLiteral,$.publicId=j.groups.PubidLiteral),F.skip(j[0].length)}else if(X&&F.substringStartsWithCaseInsensitive(e.SYSTEM)){if(F.skip(e.SYSTEM.length),F.skipBlanks()<1)return U.fatalError("Expected whitespace after "+e.SYSTEM+" at position "+F.getIndex());if($.systemId=F.getMatch(e.ABOUT_LEGACY_COMPAT_SystemLiteral),!$.systemId)return U.fatalError("Expected "+e.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+e.SYSTEM+" at position "+F.getIndex())}return X&&$.systemId&&!e.ABOUT_LEGACY_COMPAT_SystemLiteral.test($.systemId)&&U.warning("Unexpected doctype.systemId in HTML document at position "+F.getIndex()),X||(F.skipBlanks(),$.internalSubset=Ae(F,U)),F.skipBlanks(),F.char()!==">"?U.fatalError("doctype not terminated with > at position "+F.getIndex()):(F.skip(1),M.startDTD($.name,$.publicId,$.systemId,$.internalSubset),M.endDTD(),F.getIndex())}default:return U.fatalError('Not well-formed XML starting with "<!" at position '+I)}}function te(B,I,M,U){var X=B.substring(I).match(e.PI);if(!X)return U.fatalError("Invalid processing instruction starting at position "+I);if(X[1].toLowerCase()==="xml"){if(I>0)return U.fatalError("processing instruction at position "+I+" is an xml declaration which is only at the start of the document");if(!e.XMLDecl.test(B.substring(I)))return U.fatalError("xml declaration is not well-formed")}return M.processingInstruction(X[1],X[2]),I+X[0].length}function De(){this.attributeNames=Object.create(null)}return De.prototype={setTagName:function(B){if(!e.QName_exact.test(B))throw new Error("invalid tagName:"+B);this.tagName=B},addValue:function(B,I,M){if(!e.QName_exact.test(B))throw new Error("invalid attribute:"+B);this.attributeNames[B]=this.length,this[this.length++]={qName:B,value:I,offset:M}},length:0,getLocalName:function(B){return this[B].localName},getLocator:function(B){return this[B].locator},getQName:function(B){return this[B].qName},getURI:function(B){return this[B].uri},getValue:function(B){return this[B].value}},on.XMLReader=fe,on.parseUtils=pe,on.parseDoctypeCommentOrCData=we,on}var tu;function xl(){if(tu)return dr;tu=1;var n=kr(),e=Qs(),r=Un(),i=Dl(),o=Cl(),s=e.DOMImplementation,l=n.hasDefaultHTMLNamespace,c=n.isHTMLMimeType,h=n.isValidMimeType,y=n.MIME_TYPE,b=n.NAMESPACE,E=r.ParseError,x=o.XMLReader;function T(C){return C.replace(/\r[\n\u0085]/g,`
7
7
  `).replace(/[\r\u0085\u2028\u2029]/g,`
8
- `)}function I(D){if(D=D||{},D.locator===void 0&&(D.locator=!0),this.assign=D.assign||n.assign,this.domHandler=D.domHandler||H,this.onError=D.onError||D.errorHandler,D.errorHandler&&typeof D.errorHandler!="function")throw new TypeError("errorHandler object is no longer supported, switch to onError!");D.errorHandler&&D.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=D.normalizeLineEndings||C,this.locator=!!D.locator,this.xmlns=this.assign(Object.create(null),D.xmlns)}I.prototype.parseFromString=function(D,A){if(!p(A))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+A+'" is not valid.');var q=this.assign(Object.create(null),this.xmlns),re=i.XML_ENTITIES,Q=q[""]||null;l(A)?(re=i.HTML_ENTITIES,Q=N.HTML):A===g.XML_SVG_IMAGE&&(Q=N.SVG),q[""]=Q,q.xml=q.xml||N.XML;var ge=new this.domHandler({mimeType:A,defaultNamespace:Q,onError:this.onError}),Ie=this.locator?{}:void 0;this.locator&&ge.setDocumentLocator(Ie);var k=new S;k.errorHandler=ge,k.domBuilder=ge;var de=!n.isHTMLMimeType(A);return de&&typeof D!="string"&&k.errorHandler.fatalError("source is not a string"),k.parse(this.normalizeLineEndings(String(D)),q,re),ge.doc.documentElement||k.errorHandler.fatalError("missing root element"),ge.doc};function H(D){var A=D||{};this.mimeType=A.mimeType||g.XML_APPLICATION,this.defaultNamespace=A.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=A.onError}function U(D,A){A.lineNumber=D.lineNumber,A.columnNumber=D.columnNumber}H.prototype={startDocument:function(){var D=new u;this.doc=f(this.mimeType)?D.createHTMLDocument(!1):D.createDocument(this.defaultNamespace,"")},startElement:function(D,A,q,re){var Q=this.doc,ge=Q.createElementNS(D,q||A),Ie=re.length;Ae(this,ge),this.currentElement=ge,this.locator&&U(this.locator,ge);for(var k=0;k<Ie;k++){var D=re.getURI(k),de=re.getValue(k),q=re.getQName(k),B=Q.createAttributeNS(D,q);this.locator&&U(re.getLocator(k),B),B.value=B.nodeValue=de,ge.setAttributeNode(B)}},endElement:function(D,A,q){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(D,A){},endPrefixMapping:function(D){},processingInstruction:function(D,A){var q=this.doc.createProcessingInstruction(D,A);this.locator&&U(this.locator,q),Ae(this,q)},ignorableWhitespace:function(D,A,q){},characters:function(D,A,q){if(D=K.apply(this,arguments),D){if(this.cdata)var re=this.doc.createCDATASection(D);else var re=this.doc.createTextNode(D);this.currentElement?this.currentElement.appendChild(re):/^\s*$/.test(D)&&this.doc.appendChild(re),this.locator&&U(this.locator,re)}},skippedEntity:function(D){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(D){D&&(D.lineNumber=0),this.locator=D},comment:function(D,A,q){D=K.apply(this,arguments);var re=this.doc.createComment(D);this.locator&&U(this.locator,re),Ae(this,re)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(D,A,q,re){var Q=this.doc.implementation;if(Q&&Q.createDocumentType){var ge=Q.createDocumentType(D,A,q,re);this.locator&&U(this.locator,ge),Ae(this,ge),this.doc.doctype=ge}},reportError:function(D,A){if(typeof this.onError=="function")try{this.onError(D,A,this)}catch(q){throw new E("Reporting "+D+' "'+A+'" caused '+q,this.locator)}else console.error("[xmldom "+D+"] "+A,R(this.locator))},warning:function(D){this.reportError("warning",D)},error:function(D){this.reportError("error",D)},fatalError:function(D){throw this.reportError("fatalError",D),new E(D,this.locator)}};function R(D){if(D)return`
9
- @#[line:`+D.lineNumber+",col:"+D.columnNumber+"]"}function K(D,A,q){return typeof D=="string"?D.substr(A,q):D.length>=A+q||A?new java.lang.String(D,A,q)+"":D}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(D){H.prototype[D]=function(){return null}});function Ae(D,A){D.currentElement?D.currentElement.appendChild(A):D.doc.appendChild(A)}function be(D){if(D==="error")throw"onErrorStopParsing"}function Ce(){throw"onWarningStopParsing"}return lr.__DOMHandler=H,lr.DOMParser=I,lr.normalizeLineEndings=C,lr.onErrorStopParsing=be,lr.onWarningStopParsing=Ce,lr}var Hs;function pl(){if(Hs)return De;Hs=1;var n=Tr();De.assign=n.assign,De.hasDefaultHTMLNamespace=n.hasDefaultHTMLNamespace,De.isHTMLMimeType=n.isHTMLMimeType,De.isValidMimeType=n.isValidMimeType,De.MIME_TYPE=n.MIME_TYPE,De.NAMESPACE=n.NAMESPACE;var e=Bn();De.DOMException=e.DOMException,De.DOMExceptionName=e.DOMExceptionName,De.ExceptionCode=e.ExceptionCode,De.ParseError=e.ParseError;var r=Fs();De.Attr=r.Attr,De.CDATASection=r.CDATASection,De.CharacterData=r.CharacterData,De.Comment=r.Comment,De.Document=r.Document,De.DocumentFragment=r.DocumentFragment,De.DocumentType=r.DocumentType,De.DOMImplementation=r.DOMImplementation,De.Element=r.Element,De.Entity=r.Entity,De.EntityReference=r.EntityReference,De.LiveNodeList=r.LiveNodeList,De.NamedNodeMap=r.NamedNodeMap,De.Node=r.Node,De.NodeList=r.NodeList,De.Notation=r.Notation,De.ProcessingInstruction=r.ProcessingInstruction,De.Text=r.Text,De.XMLSerializer=r.XMLSerializer;var i=fl();return De.DOMParser=i.DOMParser,De.normalizeLineEndings=i.normalizeLineEndings,De.onErrorStopParsing=i.onErrorStopParsing,De.onWarningStopParsing=i.onWarningStopParsing,De}var qs=pl(),Hi={},js;function hl(){return js||(js=1,(function(n){var e=n;(function(r){var i="__namespace",o=function(t){return t==null},u=function(t){return t===i||Number.isInteger(t)&&t>=1&&t<=11},l=function(t){return t&&u(t.nodeType)&&typeof t.nodeName=="string"};function f(t){var a=Array.prototype.slice,m=t.length,w=function(s,c){return function(){return c.apply(this,s.concat(a.call(arguments)))}},v=function(){var s=a.call(arguments);return s.length<m?w(s,v):t.apply(this,a.apply(arguments,[0,m]))};return v}var p=function(t,a){for(var m=0;m<a.length;m+=1)t(a[m],m,a)},g=function(t,a,m){var w=a;return p(function(v,s){w=t(w,v,s)},m),w},N=function(t,a){var m=new Array(a.length);return p(function(w,v){m[v]=t(w)},a),m},E=function(t,a){var m=[];return p(function(w,v){t(w,v)&&m.push(w)},a),m},S=function(t,a){for(var m=0;m<t.length;m+=1)if(t[m]===a)return!0;return!1};function C(t){return function(){return t}}function I(t){return t.toString()}var H=function(t,a){return a.join(t)},U=function(t,a,m){return t+m+a},R=Array.prototype.concat,K=function(t,a){var m=new W;m.addArray(t);var w=m.toArray();return a?w.reverse():w},Ae=32767;function be(t){for(var a=[],m=0;m<t.length;m+=Ae){var w=t.slice(m,m+Ae);a=R.apply(a,w)}return a}function Ce(t,a){for(var m=Object(t),w=1;w<arguments.length;w++){var v=arguments[w];if(v!=null)for(var s in v)Object.prototype.hasOwnProperty.call(v,s)&&(m[s]=v[s])}return m}var D={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NAMESPACE_NODE:i};A.prototype=new Object,A.prototype.constructor=A,A.superclass=Object.prototype;function A(){this.init()}A.prototype.init=function(){this.reduceActions=[],this.reduceActions[3]=function(t){return new de(t[0],t[2])},this.reduceActions[5]=function(t){return new B(t[0],t[2])},this.reduceActions[7]=function(t){return new F(t[0],t[2])},this.reduceActions[8]=function(t){return new Y(t[0],t[2])},this.reduceActions[10]=function(t){return new M(t[0],t[2])},this.reduceActions[11]=function(t){return new V(t[0],t[2])},this.reduceActions[12]=function(t){return new _(t[0],t[2])},this.reduceActions[13]=function(t){return new z(t[0],t[2])},this.reduceActions[15]=function(t){return new fe(t[0],t[2])},this.reduceActions[16]=function(t){return new oe(t[0],t[2])},this.reduceActions[18]=function(t){return new G(t[0],t[2])},this.reduceActions[19]=function(t){return new J(t[0],t[2])},this.reduceActions[20]=function(t){return new ue(t[0],t[2])},this.reduceActions[22]=function(t){return new Ie(t[1])},this.reduceActions[24]=function(t){return new pe(t[0],t[2])},this.reduceActions[25]=function(t){return new le(void 0,void 0,t[0])},this.reduceActions[27]=function(t){return t[0].locationPath=t[2],t[0]},this.reduceActions[28]=function(t){return t[0].locationPath=t[2],t[0].locationPath.steps.unshift(new L(L.DESCENDANTORSELF,$.nodeTest,[])),t[0]},this.reduceActions[29]=function(t){return new le(t[0],[],void 0)},this.reduceActions[30]=function(t){return ee.instance_of(t[0],le)?(t[0].filterPredicates==null&&(t[0].filterPredicates=[]),t[0].filterPredicates.push(t[1]),t[0]):new le(t[0],[t[1]],void 0)},this.reduceActions[32]=function(t){return t[1]},this.reduceActions[33]=function(t){return new ne(t[0])},this.reduceActions[34]=function(t){return new Z(t[0])},this.reduceActions[36]=function(t){return new tt(t[0],[])},this.reduceActions[37]=function(t){return new tt(t[0],t[2])},this.reduceActions[38]=function(t){return[t[0]]},this.reduceActions[39]=function(t){return t[2].unshift(t[0]),t[2]},this.reduceActions[43]=function(t){return new et(!0,[])},this.reduceActions[44]=function(t){return t[1].absolute=!0,t[1]},this.reduceActions[46]=function(t){return new et(!1,[t[0]])},this.reduceActions[47]=function(t){return t[0].steps.push(t[2]),t[0]},this.reduceActions[49]=function(t){return new L(t[0],t[1],[])},this.reduceActions[50]=function(t){return new L(L.CHILD,t[0],[])},this.reduceActions[51]=function(t){return new L(t[0],t[1],t[2])},this.reduceActions[52]=function(t){return new L(L.CHILD,t[0],t[1])},this.reduceActions[54]=function(t){return[t[0]]},this.reduceActions[55]=function(t){return t[1].unshift(t[0]),t[1]},this.reduceActions[56]=function(t){return t[0]=="ancestor"?L.ANCESTOR:t[0]=="ancestor-or-self"?L.ANCESTORORSELF:t[0]=="attribute"?L.ATTRIBUTE:t[0]=="child"?L.CHILD:t[0]=="descendant"?L.DESCENDANT:t[0]=="descendant-or-self"?L.DESCENDANTORSELF:t[0]=="following"?L.FOLLOWING:t[0]=="following-sibling"?L.FOLLOWINGSIBLING:t[0]=="namespace"?L.NAMESPACE:t[0]=="parent"?L.PARENT:t[0]=="preceding"?L.PRECEDING:t[0]=="preceding-sibling"?L.PRECEDINGSIBLING:t[0]=="self"?L.SELF:-1},this.reduceActions[57]=function(t){return L.ATTRIBUTE},this.reduceActions[59]=function(t){return t[0]=="comment"?$.commentTest:t[0]=="text"?$.textTest:t[0]=="processing-instruction"?$.anyPiTest:t[0]=="node"?$.nodeTest:new $(-1,void 0)},this.reduceActions[60]=function(t){return new $.PITest(t[2])},this.reduceActions[61]=function(t){return t[1]},this.reduceActions[63]=function(t){return t[1].absolute=!0,t[1].steps.unshift(new L(L.DESCENDANTORSELF,$.nodeTest,[])),t[1]},this.reduceActions[64]=function(t){return t[0].steps.push(new L(L.DESCENDANTORSELF,$.nodeTest,[])),t[0].steps.push(t[2]),t[0]},this.reduceActions[65]=function(t){return new L(L.SELF,$.nodeTest,[])},this.reduceActions[66]=function(t){return new L(L.PARENT,$.nodeTest,[])},this.reduceActions[67]=function(t){return new Ge(t[1])},this.reduceActions[68]=function(t){return $.nameTestAny},this.reduceActions[69]=function(t){return new $.NameTestPrefixAny(t[0].split(":")[0])},this.reduceActions[70]=function(t){return new $.NameTestQName(t[0])}},A.actionTable=[" s s sssssssss s ss s ss"," s ","r rrrrrrrrr rrrrrrr rr r "," rrrrr "," s s sssssssss s ss s ss","rs rrrrrrrr s sssssrrrrrr rrs rs "," s s sssssssss s ss s ss"," s "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s "," s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr r ","a ","r s rr r ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrs rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r srrrrrrrr rrrrrrs rr sr ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r "," sssss ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrr rrrrr rr r "," s "," s "," rrrrr "," s s sssssssss s sss s ss","r srrrrrrrr rrrrrrs rr r "," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss ss s ss"," s s sssssssss s ss s ss"," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr rr "," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," rr "," s "," rs ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrr rr r "," r "," s ","r srrrrrrrr rrrrrrs rr r ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s s sssssssss s ss s ss","r rrrrrrrrr rrrrrrr rr rr "," r "],A.actionTableNumber=[` 1 0 /.-,+*)(' & %$ # "!`," J ","a aaaaaaaaa aaaaaaa aa a "," YYYYY ",` 1 0 /.-,+*)(' & %$ # "!`,`K1 KKKKKKKK . +*)('KKKKKK KK# K" `,` 1 0 /.-,+*)(' & %$ # "!`," N "," O ","e eeeeeeeee eeeeeee ee ee ","f fffffffff fffffff ff ff ","d ddddddddd ddddddd dd dd ","B BBBBBBBBB BBBBBBB BB BB ","A AAAAAAAAA AAAAAAA AA AA "," P "," Q ",` 1 . +*)(' # " `,"b bbbbbbbbb bbbbbbb bb b "," ","! S !! ! ",'" T" "" " ',"$ V $$ U $$ $ ","& &ZY&& &XW && & ",") ))))) )))\\[ )) ) ",". ....._^] ..... .. . ","1 11111111 11111 11 1 ","5 55555555 55555` 55 5 ","7 77777777 777777 77 7 ","9 99999999 999999 99 9 ",": c:::::::: ::::::b :: a: ","I fIIIIIIII IIIIIIe II I ","= ========= ======= == == ","? ????????? ??????? ?? ?? ","C CCCCCCCCC CCCCCCC CC CC ","J JJJJJJJJ JJJJJJ JJ J ","M MMMMMMMM MMMMMM MM M ","N NNNNNNNNN NNNNNNN NN N ","P PPPPPPPPP PPPPPPP PP P "," +*)(' ","R RRRRRRRRR RRRRRRR RR aR ","U UUUUUUUUU UUUUUUU UU U ","Z ZZZZZZZZZ ZZZZZZZ ZZ ZZ ","c ccccccccc ccccccc cc cc "," j ","L fLLLLLLLL LLLLLLe LL L ","6 66666666 66666 66 6 "," k "," l "," XXXXX ",` 1 0 /.-,+*)(' & %$m # "!`,"_ f________ ______e __ _ ",` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 . +*)(' # " `,` 1 . +*)(' # " `,"> >>>>>>>>> >>>>>>> >> >> ",` 1 . +*)(' # " `,` 1 . +*)(' # " `,"Q QQQQQQQQQ QQQQQQQ QQ aQ ","V VVVVVVVVV VVVVVVV VV aV ","T TTTTTTTTT TTTTTTT TT T ","@ @@@@@@@@@ @@@@@@@ @@ @@ "," \x87 ","[ [[[[[[[[[ [[[[[[[ [[ [[ ","D DDDDDDDDD DDDDDDD DD DD "," HH "," \x88 "," F\x89 ","# T# ## # ","% V %% U %% % ","' 'ZY'' 'XW '' ' ","( (ZY(( (XW (( ( ","+ +++++ +++\\[ ++ + ","* ***** ***\\[ ** * ","- ----- ---\\[ -- - ",", ,,,,, ,,,\\[ ,, , ","0 00000_^] 00000 00 0 ","/ /////_^] ///// // / ","2 22222222 22222 22 2 ","3 33333333 33333 33 3 ","4 44444444 44444 44 4 ","8 88888888 888888 88 8 "," ^ "," \x8A ","; f;;;;;;;; ;;;;;;e ;; ; ","< f<<<<<<<< <<<<<<e << < ","O OOOOOOOOO OOOOOOO OO O ","` ````````` ``````` `` ` ","S SSSSSSSSS SSSSSSS SS S ","W WWWWWWWWW WWWWWWW WW W ","\\ \\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\ \\\\ \\\\ ","E EEEEEEEEE EEEEEEE EE EE ",` 1 0 /.-,+*)(' & %$ # "!`,"] ]]]]]]]]] ]]]]]]] ]] ]] "," G "],A.gotoTable=["3456789:;<=>?@ AB CDEFGH IJ "," "," "," ","L456789:;<=>?@ AB CDEFGH IJ "," M EFGH IJ "," N;<=>?@ AB CDEFGH IJ "," "," "," "," "," "," "," "," "," "," S EFGH IJ "," "," "," "," "," "," "," "," "," "," "," "," "," e "," "," "," "," "," "," "," "," "," h J "," i j "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ ABpqCDEFGH IJ "," "," r6789:;<=>?@ AB CDEFGH IJ "," s789:;<=>?@ AB CDEFGH IJ "," t89:;<=>?@ AB CDEFGH IJ "," u89:;<=>?@ AB CDEFGH IJ "," v9:;<=>?@ AB CDEFGH IJ "," w9:;<=>?@ AB CDEFGH IJ "," x9:;<=>?@ AB CDEFGH IJ "," y9:;<=>?@ AB CDEFGH IJ "," z:;<=>?@ AB CDEFGH IJ "," {:;<=>?@ AB CDEFGH IJ "," |;<=>?@ AB CDEFGH IJ "," };<=>?@ AB CDEFGH IJ "," ~;<=>?@ AB CDEFGH IJ "," \x7F=>?@ AB CDEFGH IJ ","\x80456789:;<=>?@ AB CDEFGH IJ\x81"," \x82 EFGH IJ "," \x83 EFGH IJ "," "," \x84 GH IJ "," \x85 GH IJ "," i \x86 "," i \x87 "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ AB\x8CqCDEFGH IJ "," "," "],A.productions=[[1,1,2],[2,1,3],[3,1,4],[3,3,3,-9,4],[4,1,5],[4,3,4,-8,5],[5,1,6],[5,3,5,-22,6],[5,3,5,-5,6],[6,1,7],[6,3,6,-23,7],[6,3,6,-24,7],[6,3,6,-6,7],[6,3,6,-7,7],[7,1,8],[7,3,7,-25,8],[7,3,7,-26,8],[8,1,9],[8,3,8,-12,9],[8,3,8,-11,9],[8,3,8,-10,9],[9,1,10],[9,2,-26,9],[10,1,11],[10,3,10,-27,11],[11,1,12],[11,1,13],[11,3,13,-28,14],[11,3,13,-4,14],[13,1,15],[13,2,13,16],[15,1,17],[15,3,-29,2,-30],[15,1,-15],[15,1,-16],[15,1,18],[18,3,-13,-29,-30],[18,4,-13,-29,19,-30],[19,1,20],[19,3,20,-31,19],[20,1,2],[12,1,14],[12,1,21],[21,1,-28],[21,2,-28,14],[21,1,22],[14,1,23],[14,3,14,-28,23],[14,1,24],[23,2,25,26],[23,1,26],[23,3,25,26,27],[23,2,26,27],[23,1,28],[27,1,16],[27,2,16,27],[25,2,-14,-3],[25,1,-32],[26,1,29],[26,3,-20,-29,-30],[26,4,-21,-29,-15,-30],[16,3,-33,30,-34],[30,1,2],[22,2,-4,14],[24,3,14,-4,23],[28,1,-35],[28,1,-2],[17,2,-36,-18],[29,1,-17],[29,1,-19],[29,1,-18]],A.DOUBLEDOT=2,A.DOUBLECOLON=3,A.DOUBLESLASH=4,A.NOTEQUAL=5,A.LESSTHANOREQUAL=6,A.GREATERTHANOREQUAL=7,A.AND=8,A.OR=9,A.MOD=10,A.DIV=11,A.MULTIPLYOPERATOR=12,A.FUNCTIONNAME=13,A.AXISNAME=14,A.LITERAL=15,A.NUMBER=16,A.ASTERISKNAMETEST=17,A.QNAME=18,A.NCNAMECOLONASTERISK=19,A.NODETYPE=20,A.PROCESSINGINSTRUCTIONWITHLITERAL=21,A.EQUALS=22,A.LESSTHAN=23,A.GREATERTHAN=24,A.PLUS=25,A.MINUS=26,A.BAR=27,A.SLASH=28,A.LEFTPARENTHESIS=29,A.RIGHTPARENTHESIS=30,A.COMMA=31,A.AT=32,A.LEFTBRACKET=33,A.RIGHTBRACKET=34,A.DOT=35,A.DOLLAR=36,A.prototype.tokenize=function(t){for(var a=[],m=[],w=t+"\0",v=0,s=w.charAt(v++);;){for(;s==" "||s==" "||s=="\r"||s==`
10
- `;)s=w.charAt(v++);if(s=="\0"||v>=w.length)break;if(s=="("){a.push(A.LEFTPARENTHESIS),m.push(s),s=w.charAt(v++);continue}if(s==")"){a.push(A.RIGHTPARENTHESIS),m.push(s),s=w.charAt(v++);continue}if(s=="["){a.push(A.LEFTBRACKET),m.push(s),s=w.charAt(v++);continue}if(s=="]"){a.push(A.RIGHTBRACKET),m.push(s),s=w.charAt(v++);continue}if(s=="@"){a.push(A.AT),m.push(s),s=w.charAt(v++);continue}if(s==","){a.push(A.COMMA),m.push(s),s=w.charAt(v++);continue}if(s=="|"){a.push(A.BAR),m.push(s),s=w.charAt(v++);continue}if(s=="+"){a.push(A.PLUS),m.push(s),s=w.charAt(v++);continue}if(s=="-"){a.push(A.MINUS),m.push(s),s=w.charAt(v++);continue}if(s=="="){a.push(A.EQUALS),m.push(s),s=w.charAt(v++);continue}if(s=="$"){a.push(A.DOLLAR),m.push(s),s=w.charAt(v++);continue}if(s=="."){if(s=w.charAt(v++),s=="."){a.push(A.DOUBLEDOT),m.push(".."),s=w.charAt(v++);continue}if(s>="0"&&s<="9"){var c="."+s;for(s=w.charAt(v++);s>="0"&&s<="9";)c+=s,s=w.charAt(v++);a.push(A.NUMBER),m.push(c);continue}a.push(A.DOT),m.push(".");continue}if(s=="'"||s=='"'){for(var y=s,b="";v<w.length&&(s=w.charAt(v))!==y;)b+=s,v+=1;if(s!==y)throw lt.fromMessage("Unterminated string literal: "+y+b);v+=1,a.push(A.LITERAL),m.push(b),s=w.charAt(v++);continue}if(s>="0"&&s<="9"){var c=s;for(s=w.charAt(v++);s>="0"&&s<="9";)c+=s,s=w.charAt(v++);if(s=="."&&w.charAt(v)>="0"&&w.charAt(v)<="9")for(c+=s,c+=w.charAt(v++),s=w.charAt(v++);s>="0"&&s<="9";)c+=s,s=w.charAt(v++);a.push(A.NUMBER),m.push(c);continue}if(s=="*"){if(a.length>0){var x=a[a.length-1];if(x!=A.AT&&x!=A.DOUBLECOLON&&x!=A.LEFTPARENTHESIS&&x!=A.LEFTBRACKET&&x!=A.AND&&x!=A.OR&&x!=A.MOD&&x!=A.DIV&&x!=A.MULTIPLYOPERATOR&&x!=A.SLASH&&x!=A.DOUBLESLASH&&x!=A.BAR&&x!=A.PLUS&&x!=A.MINUS&&x!=A.EQUALS&&x!=A.NOTEQUAL&&x!=A.LESSTHAN&&x!=A.LESSTHANOREQUAL&&x!=A.GREATERTHAN&&x!=A.GREATERTHANOREQUAL){a.push(A.MULTIPLYOPERATOR),m.push(s),s=w.charAt(v++);continue}}a.push(A.ASTERISKNAMETEST),m.push(s),s=w.charAt(v++);continue}if(s==":"&&w.charAt(v)==":"){a.push(A.DOUBLECOLON),m.push("::"),v++,s=w.charAt(v++);continue}if(s=="/"){if(s=w.charAt(v++),s=="/"){a.push(A.DOUBLESLASH),m.push("//"),s=w.charAt(v++);continue}a.push(A.SLASH),m.push("/");continue}if(s=="!"&&w.charAt(v)=="="){a.push(A.NOTEQUAL),m.push("!="),v++,s=w.charAt(v++);continue}if(s=="<"){if(w.charAt(v)=="="){a.push(A.LESSTHANOREQUAL),m.push("<="),v++,s=w.charAt(v++);continue}a.push(A.LESSTHAN),m.push("<"),s=w.charAt(v++);continue}if(s==">"){if(w.charAt(v)=="="){a.push(A.GREATERTHANOREQUAL),m.push(">="),v++,s=w.charAt(v++);continue}a.push(A.GREATERTHAN),m.push(">"),s=w.charAt(v++);continue}if(s=="_"||ee.isLetter(s.charCodeAt(0))){var O=s;for(s=w.charAt(v++);ee.isNCNameChar(s.charCodeAt(0));)O+=s,s=w.charAt(v++);if(a.length>0){var x=a[a.length-1];if(x!=A.AT&&x!=A.DOUBLECOLON&&x!=A.LEFTPARENTHESIS&&x!=A.LEFTBRACKET&&x!=A.AND&&x!=A.OR&&x!=A.MOD&&x!=A.DIV&&x!=A.MULTIPLYOPERATOR&&x!=A.SLASH&&x!=A.DOUBLESLASH&&x!=A.BAR&&x!=A.PLUS&&x!=A.MINUS&&x!=A.EQUALS&&x!=A.NOTEQUAL&&x!=A.LESSTHAN&&x!=A.LESSTHANOREQUAL&&x!=A.GREATERTHAN&&x!=A.GREATERTHANOREQUAL){if(O=="and"){a.push(A.AND),m.push(O);continue}if(O=="or"){a.push(A.OR),m.push(O);continue}if(O=="mod"){a.push(A.MOD),m.push(O);continue}if(O=="div"){a.push(A.DIV),m.push(O);continue}}}if(s==":"){if(w.charAt(v)=="*"){a.push(A.NCNAMECOLONASTERISK),m.push(O+":*"),v++,s=w.charAt(v++);continue}if(w.charAt(v)=="_"||ee.isLetter(w.charCodeAt(v))){for(O+=":",s=w.charAt(v++);ee.isNCNameChar(s.charCodeAt(0));)O+=s,s=w.charAt(v++);if(s=="("){a.push(A.FUNCTIONNAME),m.push(O);continue}a.push(A.QNAME),m.push(O);continue}if(w.charAt(v)==":"){a.push(A.AXISNAME),m.push(O);continue}}if(s=="("){if(O=="comment"||O=="text"||O=="node"){a.push(A.NODETYPE),m.push(O);continue}if(O=="processing-instruction"){w.charAt(v)==")"?a.push(A.NODETYPE):a.push(A.PROCESSINGINSTRUCTIONWITHLITERAL),m.push(O);continue}a.push(A.FUNCTIONNAME),m.push(O);continue}a.push(A.QNAME),m.push(O);continue}throw new Error("Unexpected character "+s)}return a.push(1),m.push("[EOF]"),[a,m]},A.SHIFT="s",A.REDUCE="r",A.ACCEPT="a",A.prototype.parse=function(b){if(!b)throw new Error("XPath expression unspecified.");if(typeof b!="string")throw new Error("XPath expression must be a string.");var a,m,w=this.tokenize(b);if(w!=null){a=w[0],m=w[1];var v=0,s=[],c=[],y=[],b,x,O;for(s.push(0),c.push(1),y.push("_S"),x=a[v],O=m[v++];;)switch(b=s[s.length-1],A.actionTable[b].charAt(x-1)){case A.SHIFT:c.push(-x),y.push(O),s.push(A.actionTableNumber[b].charCodeAt(x-1)-32),x=a[v],O=m[v++];break;case A.REDUCE:for(var me=A.productions[A.actionTableNumber[b].charCodeAt(x-1)-32][1],Me=[],je=0;je<me;je++)c.pop(),Me.unshift(y.pop()),s.pop();var Je=s[s.length-1];c.push(A.productions[A.actionTableNumber[b].charCodeAt(x-1)-32][0]),this.reduceActions[A.actionTableNumber[b].charCodeAt(x-1)-32]==null?y.push(Me[0]):y.push(this.reduceActions[A.actionTableNumber[b].charCodeAt(x-1)-32](Me)),s.push(A.gotoTable[Je].charCodeAt(A.productions[A.actionTableNumber[b].charCodeAt(x-1)-32][0]-2)-33);break;case A.ACCEPT:return new q(y.pop());default:throw new Error("XPath parse error")}}},q.prototype=new Object,q.prototype.constructor=q,q.superclass=Object.prototype;function q(t){this.expression=t}q.prototype.toString=function(){return this.expression.toString()};function re(t,a,m){a in t||(t[a]=m)}q.prototype.evaluate=function(t){var a=t.expressionContextNode;if(!(o(a)||l(a)))throw new Error("Context node does not appear to be a valid DOM node.");return t.contextNode=t.expressionContextNode,t.contextSize=1,t.contextPosition=1,t.isHtml&&(re(t,"caseInsensitive",!0),re(t,"allowAnyNamespaceForNoPrefix",!0)),re(t,"caseInsensitive",!1),this.expression.evaluate(t)},q.XML_NAMESPACE_URI="http://www.w3.org/XML/1998/namespace",q.XMLNS_NAMESPACE_URI="http://www.w3.org/2000/xmlns/",Q.prototype=new Object,Q.prototype.constructor=Q,Q.superclass=Object.prototype;function Q(){}Q.prototype.init=function(){},Q.prototype.toString=function(){return"<Expression>"},Q.prototype.evaluate=function(t){throw new Error("Could not evaluate expression.")},ge.prototype=new Q,ge.prototype.constructor=ge,ge.superclass=Q.prototype;function ge(t){arguments.length>0&&this.init(t)}ge.prototype.init=function(t){this.rhs=t},Ie.prototype=new ge,Ie.prototype.constructor=Ie,Ie.superclass=ge.prototype;function Ie(t){arguments.length>0&&this.init(t)}Ie.prototype.init=function(t){Ie.superclass.init.call(this,t)},Ie.prototype.evaluate=function(t){return this.rhs.evaluate(t).number().negate()},Ie.prototype.toString=function(){return"-"+this.rhs.toString()},k.prototype=new Q,k.prototype.constructor=k,k.superclass=Q.prototype;function k(t,a){arguments.length>0&&this.init(t,a)}k.prototype.init=function(t,a){this.lhs=t,this.rhs=a},de.prototype=new k,de.prototype.constructor=de,de.superclass=k.prototype;function de(t,a){arguments.length>0&&this.init(t,a)}de.prototype.init=function(t,a){de.superclass.init.call(this,t,a)},de.prototype.toString=function(){return"("+this.lhs.toString()+" or "+this.rhs.toString()+")"},de.prototype.evaluate=function(t){var a=this.lhs.evaluate(t).bool();return a.booleanValue()?a:this.rhs.evaluate(t).bool()},B.prototype=new k,B.prototype.constructor=B,B.superclass=k.prototype;function B(t,a){arguments.length>0&&this.init(t,a)}B.prototype.init=function(t,a){B.superclass.init.call(this,t,a)},B.prototype.toString=function(){return"("+this.lhs.toString()+" and "+this.rhs.toString()+")"},B.prototype.evaluate=function(t){var a=this.lhs.evaluate(t).bool();return a.booleanValue()?this.rhs.evaluate(t).bool():a},F.prototype=new k,F.prototype.constructor=F,F.superclass=k.prototype;function F(t,a){arguments.length>0&&this.init(t,a)}F.prototype.init=function(t,a){F.superclass.init.call(this,t,a)},F.prototype.toString=function(){return"("+this.lhs.toString()+" = "+this.rhs.toString()+")"},F.prototype.evaluate=function(t){return this.lhs.evaluate(t).equals(this.rhs.evaluate(t))},Y.prototype=new k,Y.prototype.constructor=Y,Y.superclass=k.prototype;function Y(t,a){arguments.length>0&&this.init(t,a)}Y.prototype.init=function(t,a){Y.superclass.init.call(this,t,a)},Y.prototype.toString=function(){return"("+this.lhs.toString()+" != "+this.rhs.toString()+")"},Y.prototype.evaluate=function(t){return this.lhs.evaluate(t).notequal(this.rhs.evaluate(t))},M.prototype=new k,M.prototype.constructor=M,M.superclass=k.prototype;function M(t,a){arguments.length>0&&this.init(t,a)}M.prototype.init=function(t,a){M.superclass.init.call(this,t,a)},M.prototype.evaluate=function(t){return this.lhs.evaluate(t).lessthan(this.rhs.evaluate(t))},M.prototype.toString=function(){return"("+this.lhs.toString()+" < "+this.rhs.toString()+")"},V.prototype=new k,V.prototype.constructor=V,V.superclass=k.prototype;function V(t,a){arguments.length>0&&this.init(t,a)}V.prototype.init=function(t,a){V.superclass.init.call(this,t,a)},V.prototype.evaluate=function(t){return this.lhs.evaluate(t).greaterthan(this.rhs.evaluate(t))},V.prototype.toString=function(){return"("+this.lhs.toString()+" > "+this.rhs.toString()+")"},_.prototype=new k,_.prototype.constructor=_,_.superclass=k.prototype;function _(t,a){arguments.length>0&&this.init(t,a)}_.prototype.init=function(t,a){_.superclass.init.call(this,t,a)},_.prototype.evaluate=function(t){return this.lhs.evaluate(t).lessthanorequal(this.rhs.evaluate(t))},_.prototype.toString=function(){return"("+this.lhs.toString()+" <= "+this.rhs.toString()+")"},z.prototype=new k,z.prototype.constructor=z,z.superclass=k.prototype;function z(t,a){arguments.length>0&&this.init(t,a)}z.prototype.init=function(t,a){z.superclass.init.call(this,t,a)},z.prototype.evaluate=function(t){return this.lhs.evaluate(t).greaterthanorequal(this.rhs.evaluate(t))},z.prototype.toString=function(){return"("+this.lhs.toString()+" >= "+this.rhs.toString()+")"},fe.prototype=new k,fe.prototype.constructor=fe,fe.superclass=k.prototype;function fe(t,a){arguments.length>0&&this.init(t,a)}fe.prototype.init=function(t,a){fe.superclass.init.call(this,t,a)},fe.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().plus(this.rhs.evaluate(t).number())},fe.prototype.toString=function(){return"("+this.lhs.toString()+" + "+this.rhs.toString()+")"},oe.prototype=new k,oe.prototype.constructor=oe,oe.superclass=k.prototype;function oe(t,a){arguments.length>0&&this.init(t,a)}oe.prototype.init=function(t,a){oe.superclass.init.call(this,t,a)},oe.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().minus(this.rhs.evaluate(t).number())},oe.prototype.toString=function(){return"("+this.lhs.toString()+" - "+this.rhs.toString()+")"},G.prototype=new k,G.prototype.constructor=G,G.superclass=k.prototype;function G(t,a){arguments.length>0&&this.init(t,a)}G.prototype.init=function(t,a){G.superclass.init.call(this,t,a)},G.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().multiply(this.rhs.evaluate(t).number())},G.prototype.toString=function(){return"("+this.lhs.toString()+" * "+this.rhs.toString()+")"},J.prototype=new k,J.prototype.constructor=J,J.superclass=k.prototype;function J(t,a){arguments.length>0&&this.init(t,a)}J.prototype.init=function(t,a){J.superclass.init.call(this,t,a)},J.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().div(this.rhs.evaluate(t).number())},J.prototype.toString=function(){return"("+this.lhs.toString()+" div "+this.rhs.toString()+")"},ue.prototype=new k,ue.prototype.constructor=ue,ue.superclass=k.prototype;function ue(t,a){arguments.length>0&&this.init(t,a)}ue.prototype.init=function(t,a){ue.superclass.init.call(this,t,a)},ue.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().mod(this.rhs.evaluate(t).number())},ue.prototype.toString=function(){return"("+this.lhs.toString()+" mod "+this.rhs.toString()+")"},pe.prototype=new k,pe.prototype.constructor=pe,pe.superclass=k.prototype;function pe(t,a){arguments.length>0&&this.init(t,a)}pe.prototype.init=function(t,a){pe.superclass.init.call(this,t,a)},pe.prototype.evaluate=function(t){return this.lhs.evaluate(t).nodeset().union(this.rhs.evaluate(t).nodeset())},pe.prototype.toString=function(){return N(I,[this.lhs,this.rhs]).join(" | ")},le.prototype=new Q,le.prototype.constructor=le,le.superclass=Q.prototype;function le(t,a,m){arguments.length>0&&this.init(t,a,m)}le.prototype.init=function(t,a,m){le.superclass.init.call(this),this.filter=t,this.filterPredicates=a,this.locationPath=m};function Et(t){for(;t&&t.parentNode;)t=t.parentNode;return t}var at=function(t,a,m,w){if(t.length===0)return m;var v=a.extend({});return g(function(s,c){return v.contextSize=s.length,E(function(y,b){return v.contextNode=y,v.contextPosition=b+1,le.predicateMatches(c,v)},s)},K(m,w),t)};le.getRoot=function(t,a){var m=a[0];if(m&&m.nodeType===D.DOCUMENT_NODE)return m;if(t.virtualRoot)return t.virtualRoot;if(!m)throw new Error("Context node not found when determining document root.");var w=m.ownerDocument;if(w)return w;for(var v=m;v.parentNode!=null;)v=v.parentNode;return v};var Ze=function(t){var a=String(t.name);return a==="xmlns"?"":a.substring(0,6)==="xmlns:"?a.substring(6,a.length):null};le.applyStep=function(t,a,m){if(!m)throw new Error("Context node not found when evaluating XPath step: "+t);var w=[];switch(a.contextNode=m,t.axis){case L.ANCESTOR:if(a.contextNode===a.virtualRoot)break;var v;for(a.contextNode.nodeType==D.ATTRIBUTE_NODE?v=le.getOwnerElement(a.contextNode):v=a.contextNode.parentNode;v!=null&&(t.nodeTest.matches(v,a)&&w.push(v),v!==a.virtualRoot);)v=v.parentNode;break;case L.ANCESTORORSELF:for(var v=a.contextNode;v!=null&&(t.nodeTest.matches(v,a)&&w.push(v),v!==a.virtualRoot);v=v.nodeType==D.ATTRIBUTE_NODE?le.getOwnerElement(v):v.parentNode);break;case L.ATTRIBUTE:var s=a.contextNode.attributes;if(s!=null)for(var c=0;c<s.length;c++){var v=s.item(c);t.nodeTest.matches(v,a)&&w.push(v)}break;case L.CHILD:for(var v=a.contextNode.firstChild;v!=null;v=v.nextSibling)t.nodeTest.matches(v,a)&&w.push(v);break;case L.DESCENDANT:for(var O=[a.contextNode.firstChild];O.length>0;)for(var v=O.pop();v!=null;)t.nodeTest.matches(v,a)&&w.push(v),v.firstChild!=null?(O.push(v.nextSibling),v=v.firstChild):v=v.nextSibling;break;case L.DESCENDANTORSELF:t.nodeTest.matches(a.contextNode,a)&&w.push(a.contextNode);for(var O=[a.contextNode.firstChild];O.length>0;)for(var v=O.pop();v!=null;)t.nodeTest.matches(v,a)&&w.push(v),v.firstChild!=null?(O.push(v.nextSibling),v=v.firstChild):v=v.nextSibling;break;case L.FOLLOWING:if(a.contextNode===a.virtualRoot)break;var O=[];a.contextNode.firstChild!=null?O.unshift(a.contextNode.firstChild):O.unshift(a.contextNode.nextSibling);for(var v=a.contextNode.parentNode;v!=null&&v.nodeType!=D.DOCUMENT_NODE&&v!==a.virtualRoot;v=v.parentNode)O.unshift(v.nextSibling);do for(var v=O.pop();v!=null;)t.nodeTest.matches(v,a)&&w.push(v),v.firstChild!=null?(O.push(v.nextSibling),v=v.firstChild):v=v.nextSibling;while(O.length>0);break;case L.FOLLOWINGSIBLING:if(a.contextNode===a.virtualRoot)break;for(var v=a.contextNode.nextSibling;v!=null;v=v.nextSibling)t.nodeTest.matches(v,a)&&w.push(v);break;case L.NAMESPACE:var y={};if(a.contextNode.nodeType==D.ELEMENT_NODE){y.xml=new gt("xml",null,q.XML_NAMESPACE_URI,a.contextNode);for(var v=a.contextNode;v!=null&&v.nodeType==D.ELEMENT_NODE;v=v.parentNode)for(var c=0;c<v.attributes.length;c++){var b=v.attributes.item(c),x=Ze(b);x!=null&&y[x]==null&&(y[x]=new gt(x,b,b.value,a.contextNode))}for(var x in y){var m=y[x];t.nodeTest.matches(m,a)&&w.push(m)}}break;case L.PARENT:v=null,a.contextNode!==a.virtualRoot&&(a.contextNode.nodeType==D.ATTRIBUTE_NODE?v=le.getOwnerElement(a.contextNode):v=a.contextNode.parentNode),v!=null&&t.nodeTest.matches(v,a)&&w.push(v);break;case L.PRECEDING:var O;a.virtualRoot!=null?O=[a.virtualRoot]:O=[Et(a.contextNode)];e:for(;O.length>0;)for(var v=O.pop();v!=null;){if(v==a.contextNode)break e;t.nodeTest.matches(v,a)&&w.unshift(v),v.firstChild!=null?(O.push(v.nextSibling),v=v.firstChild):v=v.nextSibling}break;case L.PRECEDINGSIBLING:if(a.contextNode===a.virtualRoot)break;for(var v=a.contextNode.previousSibling;v!=null;v=v.previousSibling)t.nodeTest.matches(v,a)&&w.push(v);break;case L.SELF:t.nodeTest.matches(a.contextNode,a)&&w.push(a.contextNode);break}return w};function ae(t,a,m){return at(t.predicates,a,le.applyStep(t,a,m),S(Xt,t.axis))}function Gt(t,a,m){return be(N(ae.bind(null,m,t),a))}le.applySteps=function(t,a,m){return g(Gt.bind(null,a),m,t)},le.prototype.applyFilter=function(t,a){if(!this.filter)return{nodes:[t.contextNode]};var m=this.filter.evaluate(t);if(!ee.instance_of(m,W)){if(this.filterPredicates!=null&&this.filterPredicates.length>0||this.locationPath!=null)throw new Error("Path expression filter must evaluate to a nodeset if predicates or location path are used");return{nonNodes:m}}return{nodes:at(this.filterPredicates||[],a,m.toUnsortedArray(),!1)}},le.applyLocationPath=function(t,a,m){if(!t)return m;var w=t.absolute?[le.getRoot(a,m)]:m;return le.applySteps(t.steps,a,w)},le.prototype.evaluate=function(t){var a=Ce(new ce,t),m=this.applyFilter(t,a);if("nonNodes"in m)return m.nonNodes;var w=new W;return w.addArray(le.applyLocationPath(this.locationPath,a,m.nodes)),w},le.predicateMatches=function(t,a){var m=t.evaluate(a);return ee.instance_of(m,Z)?a.contextPosition===m.numberValue():m.booleanValue()},le.predicateString=function(t){return U("[","]",t.toString())},le.predicatesString=function(t){return H("",N(le.predicateString,t))},le.prototype.toString=function(){if(this.filter!=null){var t=I(this.filter);return ee.instance_of(this.filter,ne)?U("'","'",t):this.filterPredicates!=null&&this.filterPredicates.length?U("(",")",t)+le.predicatesString(this.filterPredicates):this.locationPath!=null?t+(this.locationPath.absolute?"":"/")+I(this.locationPath):t}return I(this.locationPath)},le.getOwnerElement=function(t){if(t.ownerElement)return t.ownerElement;try{if(t.selectSingleNode)return t.selectSingleNode("..")}catch(b){}for(var a=t.nodeType==D.DOCUMENT_NODE?t:t.ownerDocument,m=a.getElementsByTagName("*"),w=0;w<m.length;w++)for(var v=m.item(w),s=v.attributes,c=0;c<s.length;c++){var y=s.item(c);if(y===t)return v}return null},et.prototype=new Object,et.prototype.constructor=et,et.superclass=Object.prototype;function et(t,a){arguments.length>0&&this.init(t,a)}et.prototype.init=function(t,a){this.absolute=t,this.steps=a},et.prototype.toString=function(){return(this.absolute?"/":"")+N(I,this.steps).join("/")},L.prototype=new Object,L.prototype.constructor=L,L.superclass=Object.prototype;function L(t,a,m){arguments.length>0&&this.init(t,a,m)}L.prototype.init=function(t,a,m){this.axis=t,this.nodeTest=a,this.predicates=m},L.prototype.toString=function(){return L.STEPNAMES[this.axis]+"::"+this.nodeTest.toString()+le.predicatesString(this.predicates)},L.ANCESTOR=0,L.ANCESTORORSELF=1,L.ATTRIBUTE=2,L.CHILD=3,L.DESCENDANT=4,L.DESCENDANTORSELF=5,L.FOLLOWING=6,L.FOLLOWINGSIBLING=7,L.NAMESPACE=8,L.PARENT=9,L.PRECEDING=10,L.PRECEDINGSIBLING=11,L.SELF=12,L.STEPNAMES=g(function(t,a){return t[a[0]]=a[1],t},{},[[L.ANCESTOR,"ancestor"],[L.ANCESTORORSELF,"ancestor-or-self"],[L.ATTRIBUTE,"attribute"],[L.CHILD,"child"],[L.DESCENDANT,"descendant"],[L.DESCENDANTORSELF,"descendant-or-self"],[L.FOLLOWING,"following"],[L.FOLLOWINGSIBLING,"following-sibling"],[L.NAMESPACE,"namespace"],[L.PARENT,"parent"],[L.PRECEDING,"preceding"],[L.PRECEDINGSIBLING,"preceding-sibling"],[L.SELF,"self"]]);var Xt=[L.ANCESTOR,L.ANCESTORORSELF,L.PARENT,L.PRECEDING,L.PRECEDINGSIBLING];$.prototype=new Object,$.prototype.constructor=$,$.superclass=Object.prototype;function $(t,a){arguments.length>0&&this.init(t,a)}$.prototype.init=function(t,a){this.type=t,this.value=a},$.prototype.toString=function(){return"<unknown nodetest type>"},$.prototype.matches=function(t,a){console.warn("unknown node test type")},$.NAMETESTANY=0,$.NAMETESTPREFIXANY=1,$.NAMETESTQNAME=2,$.COMMENT=3,$.TEXT=4,$.PI=5,$.NODE=6,$.isNodeType=function(t){return function(a){return S(t,a.nodeType)}},$.makeNodeTestType=function(t,a,m){var w=m||function(){};return w.prototype=new $(t),w.prototype.constructor=w,Ce(w.prototype,a),w},$.makeNodeTypeTest=function(t,a,m){return new($.makeNodeTestType(t,{matches:$.isNodeType(a),toString:C(m)}))},$.hasPrefix=function(t){return t.prefix||(t.nodeName||t.tagName).indexOf(":")!==-1},$.isElementOrAttribute=$.isNodeType([1,2]),$.nameSpaceMatches=function(t,a,m){var w=m.namespaceURI||"";if(!t)return!w||a.allowAnyNamespaceForNoPrefix&&!$.hasPrefix(m);var v=a.namespaceResolver.getNamespace(t,a.expressionContextNode);if(v==null)throw new Error("Cannot resolve QName "+t);return v===w},$.localNameMatches=function(t,a,m){var w=m.localName||m.nodeName;return a.caseInsensitive?t.toLowerCase()===w.toLowerCase():t===w},$.NameTestPrefixAny=$.makeNodeTestType($.NAMETESTPREFIXANY,{matches:function(t,a){return $.isElementOrAttribute(t)&&$.nameSpaceMatches(this.prefix,a,t)},toString:function(){return this.prefix+":*"}},function(a){this.prefix=a}),$.NameTestQName=$.makeNodeTestType($.NAMETESTQNAME,{matches:function(t,a){return $.isNodeType([D.ELEMENT_NODE,D.ATTRIBUTE_NODE,D.NAMESPACE_NODE])(t)&&$.nameSpaceMatches(this.prefix,a,t)&&$.localNameMatches(this.localName,a,t)},toString:function(){return this.name}},function(a){var m=a.split(":");this.name=a,this.prefix=m.length>1?m[0]:null,this.localName=m[m.length>1?1:0]}),$.PITest=$.makeNodeTestType($.PI,{matches:function(t,a){return $.isNodeType([D.PROCESSING_INSTRUCTION_NODE])(t)&&(t.target||t.nodeName)===this.name},toString:function(){return U('processing-instruction("','")',this.name)}},function(t){this.name=t}),$.nameTestAny=$.makeNodeTypeTest($.NAMETESTANY,[D.ELEMENT_NODE,D.ATTRIBUTE_NODE,D.NAMESPACE_NODE],"*"),$.textTest=$.makeNodeTypeTest($.TEXT,[D.TEXT_NODE,D.CDATA_SECTION_NODE],"text()"),$.commentTest=$.makeNodeTypeTest($.COMMENT,[D.COMMENT_NODE],"comment()"),$.nodeTest=$.makeNodeTypeTest($.NODE,[D.ELEMENT_NODE,D.ATTRIBUTE_NODE,D.TEXT_NODE,D.CDATA_SECTION_NODE,D.PROCESSING_INSTRUCTION_NODE,D.COMMENT_NODE,D.DOCUMENT_NODE],"node()"),$.anyPiTest=$.makeNodeTypeTest($.PI,[D.PROCESSING_INSTRUCTION_NODE],"processing-instruction()"),Ge.prototype=new Q,Ge.prototype.constructor=Ge,Ge.superclass=Q.prototype;function Ge(t){arguments.length>0&&this.init(t)}Ge.prototype.init=function(t){this.variable=t},Ge.prototype.toString=function(){return"$"+this.variable},Ge.prototype.evaluate=function(t){var a=ee.resolveQName(this.variable,t.namespaceResolver,t.contextNode,!1);if(a[0]==null)throw new Error("Cannot resolve QName "+fn);var m=t.variableResolver.getVariable(a[1],a[0]);if(!m)throw lt.fromMessage("Undeclared variable: "+this.toString());return m},tt.prototype=new Q,tt.prototype.constructor=tt,tt.superclass=Q.prototype;function tt(t,a){arguments.length>0&&this.init(t,a)}tt.prototype.init=function(t,a){this.functionName=t,this.arguments=a},tt.prototype.toString=function(){for(var t=this.functionName+"(",a=0;a<this.arguments.length;a++)a>0&&(t+=", "),t+=this.arguments[a].toString();return t+")"},tt.prototype.evaluate=function(t){var a=_e.getFunctionFromContext(this.functionName,t);if(!a)throw new Error("Unknown function "+this.functionName);var m=[t].concat(this.arguments);return a.apply(t.functionResolver.thisArg,m)};var Oe=new Object;Oe.equals=function(t,a){return t.equals(a)},Oe.notequal=function(t,a){return t.notequal(a)},Oe.lessthan=function(t,a){return t.lessthan(a)},Oe.greaterthan=function(t,a){return t.greaterthan(a)},Oe.lessthanorequal=function(t,a){return t.lessthanorequal(a)},Oe.greaterthanorequal=function(t,a){return t.greaterthanorequal(a)},ne.prototype=new Q,ne.prototype.constructor=ne,ne.superclass=Q.prototype;function ne(t){arguments.length>0&&this.init(t)}ne.prototype.init=function(t){this.str=String(t)},ne.prototype.toString=function(){return this.str},ne.prototype.evaluate=function(t){return this},ne.prototype.string=function(){return this},ne.prototype.number=function(){return new Z(this.str)},ne.prototype.bool=function(){return new X(this.str)},ne.prototype.nodeset=function(){throw new Error("Cannot convert string to nodeset")},ne.prototype.stringValue=function(){return this.str},ne.prototype.numberValue=function(){return this.number().numberValue()},ne.prototype.booleanValue=function(){return this.bool().booleanValue()},ne.prototype.equals=function(t){return ee.instance_of(t,X)?this.bool().equals(t):ee.instance_of(t,Z)?this.number().equals(t):ee.instance_of(t,W)?t.compareWithString(this,Oe.equals):new X(this.str==t.str)},ne.prototype.notequal=function(t){return ee.instance_of(t,X)?this.bool().notequal(t):ee.instance_of(t,Z)?this.number().notequal(t):ee.instance_of(t,W)?t.compareWithString(this,Oe.notequal):new X(this.str!=t.str)},ne.prototype.lessthan=function(t){return this.number().lessthan(t)},ne.prototype.greaterthan=function(t){return this.number().greaterthan(t)},ne.prototype.lessthanorequal=function(t){return this.number().lessthanorequal(t)},ne.prototype.greaterthanorequal=function(t){return this.number().greaterthanorequal(t)},Z.prototype=new Q,Z.prototype.constructor=Z,Z.superclass=Q.prototype;function Z(t){arguments.length>0&&this.init(t)}Z.prototype.init=function(t){this.num=typeof t=="string"?this.parse(t):Number(t)},Z.prototype.numberFormat=/^\s*-?[0-9]*\.?[0-9]+\s*$/,Z.prototype.parse=function(t){return this.numberFormat.test(t)?parseFloat(t):Number.NaN};function Re(t){for(var a=t.split("e-"),m=a[0].replace(".",""),w=Number(a[1]),v=0;v<w-1;v+=1)m="0"+m;return"0."+m}function Wt(t){for(var a=t.split("e"),m=a[0].replace(".",""),w=Number(a[1]),v=w+1-m.length,s=0;s<v;s+=1)m+="0";return m}Z.prototype.toString=function(){var t=this.num.toString();return t.indexOf("e-")!==-1?Re(t):t.indexOf("e")!==-1?Wt(t):t},Z.prototype.evaluate=function(t){return this},Z.prototype.string=function(){return new ne(this.toString())},Z.prototype.number=function(){return this},Z.prototype.bool=function(){return new X(this.num)},Z.prototype.nodeset=function(){throw new Error("Cannot convert number to nodeset")},Z.prototype.stringValue=function(){return this.string().stringValue()},Z.prototype.numberValue=function(){return this.num},Z.prototype.booleanValue=function(){return this.bool().booleanValue()},Z.prototype.negate=function(){return new Z(-this.num)},Z.prototype.equals=function(t){return ee.instance_of(t,X)?this.bool().equals(t):ee.instance_of(t,ne)?this.equals(t.number()):ee.instance_of(t,W)?t.compareWithNumber(this,Oe.equals):new X(this.num==t.num)},Z.prototype.notequal=function(t){return ee.instance_of(t,X)?this.bool().notequal(t):ee.instance_of(t,ne)?this.notequal(t.number()):ee.instance_of(t,W)?t.compareWithNumber(this,Oe.notequal):new X(this.num!=t.num)},Z.prototype.lessthan=function(t){return ee.instance_of(t,W)?t.compareWithNumber(this,Oe.greaterthan):ee.instance_of(t,X)||ee.instance_of(t,ne)?this.lessthan(t.number()):new X(this.num<t.num)},Z.prototype.greaterthan=function(t){return ee.instance_of(t,W)?t.compareWithNumber(this,Oe.lessthan):ee.instance_of(t,X)||ee.instance_of(t,ne)?this.greaterthan(t.number()):new X(this.num>t.num)},Z.prototype.lessthanorequal=function(t){return ee.instance_of(t,W)?t.compareWithNumber(this,Oe.greaterthanorequal):ee.instance_of(t,X)||ee.instance_of(t,ne)?this.lessthanorequal(t.number()):new X(this.num<=t.num)},Z.prototype.greaterthanorequal=function(t){return ee.instance_of(t,W)?t.compareWithNumber(this,Oe.lessthanorequal):ee.instance_of(t,X)||ee.instance_of(t,ne)?this.greaterthanorequal(t.number()):new X(this.num>=t.num)},Z.prototype.plus=function(t){return new Z(this.num+t.num)},Z.prototype.minus=function(t){return new Z(this.num-t.num)},Z.prototype.multiply=function(t){return new Z(this.num*t.num)},Z.prototype.div=function(t){return new Z(this.num/t.num)},Z.prototype.mod=function(t){return new Z(this.num%t.num)},X.prototype=new Q,X.prototype.constructor=X,X.superclass=Q.prototype;function X(t){arguments.length>0&&this.init(t)}X.prototype.init=function(t){this.b=!!t},X.prototype.toString=function(){return this.b.toString()},X.prototype.evaluate=function(t){return this},X.prototype.string=function(){return new ne(this.b)},X.prototype.number=function(){return new Z(this.b)},X.prototype.bool=function(){return this},X.prototype.nodeset=function(){throw new Error("Cannot convert boolean to nodeset")},X.prototype.stringValue=function(){return this.string().stringValue()},X.prototype.numberValue=function(){return this.number().numberValue()},X.prototype.booleanValue=function(){return this.b},X.prototype.not=function(){return new X(!this.b)},X.prototype.equals=function(t){return ee.instance_of(t,ne)||ee.instance_of(t,Z)?this.equals(t.bool()):ee.instance_of(t,W)?t.compareWithBoolean(this,Oe.equals):new X(this.b==t.b)},X.prototype.notequal=function(t){return ee.instance_of(t,ne)||ee.instance_of(t,Z)?this.notequal(t.bool()):ee.instance_of(t,W)?t.compareWithBoolean(this,Oe.notequal):new X(this.b!=t.b)},X.prototype.lessthan=function(t){return this.number().lessthan(t)},X.prototype.greaterthan=function(t){return this.number().greaterthan(t)},X.prototype.lessthanorequal=function(t){return this.number().lessthanorequal(t)},X.prototype.greaterthanorequal=function(t){return this.number().greaterthanorequal(t)},X.true_=new X(!0),X.false_=new X(!1),Xe.prototype=new Object,Xe.prototype.constructor=Xe,Xe.superclass=Object.prototype;function Xe(t){this.init(t)}Xe.prototype.init=function(t){this.left=null,this.right=null,this.node=t,this.depth=1},Xe.prototype.balance=function(){var t=this.left==null?0:this.left.depth,a=this.right==null?0:this.right.depth;if(t>a+1){var m=this.left.left==null?0:this.left.left.depth,w=this.left.right==null?0:this.left.right.depth;m<w&&this.left.rotateRR(),this.rotateLL()}else if(t+1<a){var v=this.right.right==null?0:this.right.right.depth,s=this.right.left==null?0:this.right.left.depth;s>v&&this.right.rotateLL(),this.rotateRR()}},Xe.prototype.rotateLL=function(){var t=this.node,a=this.right;this.node=this.left.node,this.right=this.left,this.left=this.left.left,this.right.left=this.right.right,this.right.right=a,this.right.node=t,this.right.updateInNewLocation(),this.updateInNewLocation()},Xe.prototype.rotateRR=function(){var t=this.node,a=this.left;this.node=this.right.node,this.left=this.right,this.right=this.right.right,this.left.right=this.left.left,this.left.left=a,this.left.node=t,this.left.updateInNewLocation(),this.updateInNewLocation()},Xe.prototype.updateInNewLocation=function(){this.getDepthFromChildren()},Xe.prototype.getDepthFromChildren=function(){this.depth=this.node==null?0:1,this.left!=null&&(this.depth=this.left.depth+1),this.right!=null&&this.depth<=this.right.depth&&(this.depth=this.right.depth+1)};function Cr(t,a){if(t===a)return 0;if(t.compareDocumentPosition){var m=t.compareDocumentPosition(a);return m&1||m&10?1:m&20?-1:0}for(var w=0,v=0,s=t;s!=null;s=s.parentNode||s.ownerElement)w++;for(var c=a;c!=null;c=c.parentNode||c.ownerElement)v++;if(w>v){for(;w>v;)t=t.parentNode||t.ownerElement,w--;if(t===a)return 1}else if(v>w){for(;v>w;)a=a.parentNode||a.ownerElement,v--;if(t===a)return-1}for(var y=t.parentNode||t.ownerElement,b=a.parentNode||a.ownerElement;y!==b;)t=y,a=b,y=t.parentNode||t.ownerElement,b=a.parentNode||a.ownerElement;var x=nr(t),O=nr(a);if(x&&!O)return-1;if(!x&&O)return 1;if(t.isXPathNamespace){if(t.nodeValue===q.XML_NAMESPACE_URI||!a.isXPathNamespace)return-1;if(a.nodeValue===q.XML_NAMESPACE_URI)return 1}else if(a.isXPathNamespace)return 1;if(y)for(var me=x?y.attributes:y.childNodes,Me=me.length,je=t.baseNode||t,Je=a.baseNode||a,Ke=0;Ke<Me;Ke+=1){var Ct=me[Ke];if(Ct===je)return-1;if(Ct===Je)return 1}throw new Error("Unexpected: could not determine node order")}Xe.prototype.add=function(t){if(t===this.node)return!1;var a=Cr(t,this.node),m=!1;return a==-1?this.left==null?(this.left=new Xe(t),m=!0):(m=this.left.add(t),m&&this.balance()):a==1&&(this.right==null?(this.right=new Xe(t),m=!0):(m=this.right.add(t),m&&this.balance())),m&&this.getDepthFromChildren(),m},W.prototype=new Q,W.prototype.constructor=W,W.superclass=Q.prototype;function W(){this.init()}W.prototype.init=function(){this.tree=null,this.nodes=[],this.size=0},W.prototype.toString=function(){var t=this.first();return t==null?"":this.stringForNode(t)},W.prototype.evaluate=function(t){return this},W.prototype.string=function(){return new ne(this.toString())},W.prototype.stringValue=function(){return this.toString()},W.prototype.number=function(){return new Z(this.string())},W.prototype.numberValue=function(){return Number(this.string())},W.prototype.bool=function(){return new X(this.booleanValue())},W.prototype.booleanValue=function(){return!!this.size},W.prototype.nodeset=function(){return this},W.prototype.stringForNode=function(t){return t.nodeType==D.DOCUMENT_NODE||t.nodeType==D.ELEMENT_NODE||t.nodeType===D.DOCUMENT_FRAGMENT_NODE?this.stringForContainerNode(t):t.nodeType===D.ATTRIBUTE_NODE?t.value||t.nodeValue:t.isNamespaceNode?t.namespace:t.nodeValue},W.prototype.stringForContainerNode=function(t){for(var a="",m=t.firstChild;m!=null;m=m.nextSibling){var w=m.nodeType;(w===1||w===3||w===4||w===9||w===11)&&(a+=this.stringForNode(m))}return a},W.prototype.buildTree=function(){if(!this.tree&&this.nodes.length){this.tree=new Xe(this.nodes[0]);for(var t=1;t<this.nodes.length;t+=1)this.tree.add(this.nodes[t])}return this.tree},W.prototype.first=function(){var t=this.buildTree();if(t==null)return null;for(;t.left!=null;)t=t.left;return t.node},W.prototype.add=function(t){for(var a=0;a<this.nodes.length;a+=1)if(t===this.nodes[a])return;this.tree=null,this.nodes.push(t),this.size+=1},W.prototype.addArray=function(t){var a=this;p(function(m){a.add(m)},t)},W.prototype.toArray=function(){var t=[];return this.toArrayRec(this.buildTree(),t),t},W.prototype.toArrayRec=function(t,a){t!=null&&(this.toArrayRec(t.left,a),a.push(t.node),this.toArrayRec(t.right,a))},W.prototype.toUnsortedArray=function(){return this.nodes.slice()},W.prototype.compareWithString=function(t,a){for(var m=this.toUnsortedArray(),w=0;w<m.length;w++){var v=m[w],s=new ne(this.stringForNode(v)),c=a(s,t);if(c.booleanValue())return c}return new X(!1)},W.prototype.compareWithNumber=function(t,a){for(var m=this.toUnsortedArray(),w=0;w<m.length;w++){var v=m[w],s=new Z(this.stringForNode(v)),c=a(s,t);if(c.booleanValue())return c}return new X(!1)},W.prototype.compareWithBoolean=function(t,a){return a(this.bool(),t)},W.prototype.compareWithNodeSet=function(t,a){for(var m=this.toUnsortedArray(),w=function(y,b){return a(b,y)},v=0;v<m.length;v++){var s=new ne(this.stringForNode(m[v])),c=t.compareWithString(s,w);if(c.booleanValue())return c}return new X(!1)},W.compareWith=f(function(t,a){return ee.instance_of(a,ne)?this.compareWithString(a,t):ee.instance_of(a,Z)?this.compareWithNumber(a,t):ee.instance_of(a,X)?this.compareWithBoolean(a,t):this.compareWithNodeSet(a,t)}),W.prototype.equals=W.compareWith(Oe.equals),W.prototype.notequal=W.compareWith(Oe.notequal),W.prototype.lessthan=W.compareWith(Oe.lessthan),W.prototype.greaterthan=W.compareWith(Oe.greaterthan),W.prototype.lessthanorequal=W.compareWith(Oe.lessthanorequal),W.prototype.greaterthanorequal=W.compareWith(Oe.greaterthanorequal),W.prototype.union=function(t){var a=new W;return a.addArray(this.toUnsortedArray()),a.addArray(t.toUnsortedArray()),a},gt.prototype=new Object,gt.prototype.constructor=gt,gt.superclass=Object.prototype;function gt(t,a,m,w){this.isXPathNamespace=!0,this.baseNode=a,this.ownerDocument=w.ownerDocument,this.nodeName=t,this.prefix=t,this.localName=t,this.namespaceURI=null,this.nodeValue=m,this.ownerElement=w,this.nodeType=D.NAMESPACE_NODE}gt.prototype.toString=function(){return'{ "'+this.prefix+'", "'+this.namespaceURI+'" }'},ce.prototype=new Object,ce.prototype.constructor=ce,ce.superclass=Object.prototype;function ce(t,a,m){this.variableResolver=t!=null?t:new Te,this.namespaceResolver=a!=null?a:new He,this.functionResolver=m!=null?m:new _e}ce.prototype.extend=function(t){return Ce(new ce,this,t)},Te.prototype=new Object,Te.prototype.constructor=Te,Te.superclass=Object.prototype;function Te(){}Te.prototype.getVariable=function(t,a){return null},_e.prototype=new Object,_e.prototype.constructor=_e,_e.superclass=Object.prototype;function _e(t){this.thisArg=t!=null?t:se,this.functions=new Object,this.addStandardFunctions()}_e.prototype.addStandardFunctions=function(){this.functions["{}last"]=se.last,this.functions["{}position"]=se.position,this.functions["{}count"]=se.count,this.functions["{}id"]=se.id,this.functions["{}local-name"]=se.localName,this.functions["{}namespace-uri"]=se.namespaceURI,this.functions["{}name"]=se.name,this.functions["{}string"]=se.string,this.functions["{}concat"]=se.concat,this.functions["{}starts-with"]=se.startsWith,this.functions["{}contains"]=se.contains,this.functions["{}substring-before"]=se.substringBefore,this.functions["{}substring-after"]=se.substringAfter,this.functions["{}substring"]=se.substring,this.functions["{}string-length"]=se.stringLength,this.functions["{}normalize-space"]=se.normalizeSpace,this.functions["{}translate"]=se.translate,this.functions["{}boolean"]=se.boolean_,this.functions["{}not"]=se.not,this.functions["{}true"]=se.true_,this.functions["{}false"]=se.false_,this.functions["{}lang"]=se.lang,this.functions["{}number"]=se.number,this.functions["{}sum"]=se.sum,this.functions["{}floor"]=se.floor,this.functions["{}ceiling"]=se.ceiling,this.functions["{}round"]=se.round},_e.prototype.addFunction=function(t,a,m){this.functions["{"+t+"}"+a]=m},_e.getFunctionFromContext=function(t,a){var m=ee.resolveQName(t,a.namespaceResolver,a.contextNode,!1);if(m[0]===null)throw new Error("Cannot resolve QName "+name);return a.functionResolver.getFunction(m[1],m[0])},_e.prototype.getFunction=function(t,a){return this.functions["{"+a+"}"+t]},He.prototype=new Object,He.prototype.constructor=He,He.superclass=Object.prototype;function He(){}He.prototype.getNamespace=function(t,a){if(t=="xml")return q.XML_NAMESPACE_URI;if(t=="xmlns")return q.XMLNS_NAMESPACE_URI;for(a.nodeType==D.DOCUMENT_NODE?a=a.documentElement:a.nodeType==D.ATTRIBUTE_NODE?a=le.getOwnerElement(a):a.nodeType!=D.ELEMENT_NODE&&(a=a.parentNode);a!=null&&a.nodeType==D.ELEMENT_NODE;){for(var m=a.attributes,w=0;w<m.length;w++){var v=m.item(w),s=v.name||v.nodeName;if(s==="xmlns"&&t===""||s==="xmlns:"+t)return String(v.value||v.nodeValue)}a=a.parentNode}return null};var se=new Object;se.last=function(t){if(arguments.length!=1)throw new Error("Function last expects ()");return new Z(t.contextSize)},se.position=function(t){if(arguments.length!=1)throw new Error("Function position expects ()");return new Z(t.contextPosition)},se.count=function(){var t=arguments[0],a;if(arguments.length!=2||!ee.instance_of(a=arguments[1].evaluate(t),W))throw new Error("Function count expects (node-set)");return new Z(a.size)},se.id=function(){var t=arguments[0],a;if(arguments.length!=2)throw new Error("Function id expects (object)");a=arguments[1].evaluate(t),ee.instance_of(a,W)?a=a.toArray().join(" "):a=a.stringValue();for(var m=a.split(/[\x0d\x0a\x09\x20]+/),w=new W,v=t.contextNode.nodeType==D.DOCUMENT_NODE?t.contextNode:t.contextNode.ownerDocument,s=0;s<m.length;s++){var c;v.getElementById?c=v.getElementById(m[s]):c=ee.getElementById(v,m[s]),c!=null&&w.add(c)}return w},se.localName=function(t,a){var m;if(arguments.length==1)m=t.contextNode;else if(arguments.length==2)m=a.evaluate(t).first();else throw new Error("Function local-name expects (node-set?)");return m==null?new ne(""):new ne(m.localName||m.baseName||m.target||m.nodeName||"")},se.namespaceURI=function(){var t=arguments[0],a;if(arguments.length==1)a=t.contextNode;else if(arguments.length==2)a=arguments[1].evaluate(t).first();else throw new Error("Function namespace-uri expects (node-set?)");return a==null?new ne(""):new ne(a.namespaceURI||"")},se.name=function(){var t=arguments[0],a;if(arguments.length==1)a=t.contextNode;else if(arguments.length==2)a=arguments[1].evaluate(t).first();else throw new Error("Function name expects (node-set?)");return a==null?new ne(""):a.nodeType==D.ELEMENT_NODE?new ne(a.nodeName):a.nodeType==D.ATTRIBUTE_NODE?new ne(a.name||a.nodeName):a.nodeType===D.PROCESSING_INSTRUCTION_NODE?new ne(a.target||a.nodeName):a.localName==null?new ne(""):new ne(a.localName)},se.string=function(){var t=arguments[0];if(arguments.length==1)return new ne(W.prototype.stringForNode(t.contextNode));if(arguments.length==2)return arguments[1].evaluate(t).string();throw new Error("Function string expects (object?)")},se.concat=function(t){if(arguments.length<3)throw new Error("Function concat expects (string, string[, string]*)");for(var a="",m=1;m<arguments.length;m++)a+=arguments[m].evaluate(t).stringValue();return new ne(a)},se.startsWith=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function startsWith expects (string, string)");var a=arguments[1].evaluate(t).stringValue(),m=arguments[2].evaluate(t).stringValue();return new X(a.substring(0,m.length)==m)},se.contains=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function contains expects (string, string)");var a=arguments[1].evaluate(t).stringValue(),m=arguments[2].evaluate(t).stringValue();return new X(a.indexOf(m)!==-1)},se.substringBefore=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function substring-before expects (string, string)");var a=arguments[1].evaluate(t).stringValue(),m=arguments[2].evaluate(t).stringValue();return new ne(a.substring(0,a.indexOf(m)))},se.substringAfter=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function substring-after expects (string, string)");var a=arguments[1].evaluate(t).stringValue(),m=arguments[2].evaluate(t).stringValue();if(m.length==0)return new ne(a);var w=a.indexOf(m);return w==-1?new ne(""):new ne(a.substring(w+m.length))},se.substring=function(){var t=arguments[0];if(!(arguments.length==3||arguments.length==4))throw new Error("Function substring expects (string, number, number?)");var a=arguments[1].evaluate(t).stringValue(),m=Math.round(arguments[2].evaluate(t).numberValue())-1,w=arguments.length==4?m+Math.round(arguments[3].evaluate(t).numberValue()):void 0;return new ne(a.substring(m,w))},se.stringLength=function(){var t=arguments[0],a;if(arguments.length==1)a=W.prototype.stringForNode(t.contextNode);else if(arguments.length==2)a=arguments[1].evaluate(t).stringValue();else throw new Error("Function string-length expects (string?)");return new Z(a.length)},se.normalizeSpace=function(){var t=arguments[0],a;if(arguments.length==1)a=W.prototype.stringForNode(t.contextNode);else if(arguments.length==2)a=arguments[1].evaluate(t).stringValue();else throw new Error("Function normalize-space expects (string?)");for(var m=0,w=a.length-1;ee.isSpace(a.charCodeAt(w));)w--;for(var v="";m<=w&&ee.isSpace(a.charCodeAt(m));)m++;for(;m<=w;)if(ee.isSpace(a.charCodeAt(m)))for(v+=" ";m<=w&&ee.isSpace(a.charCodeAt(m));)m++;else v+=a.charAt(m),m++;return new ne(v)},se.translate=function(t,a,m,w){if(arguments.length!=4)throw new Error("Function translate expects (string, string, string)");var v=a.evaluate(t).stringValue(),s=m.evaluate(t).stringValue(),c=w.evaluate(t).stringValue(),y=g(function(x,O,me){return O in x||(x[O]=me>c.length?"":c[me]),x},{},s),b=H("",N(function(x){return x in y?y[x]:x},v));return new ne(b)},se.boolean_=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function boolean expects (object)");return arguments[1].evaluate(t).bool()},se.not=function(t,a){if(arguments.length!=2)throw new Error("Function not expects (object)");return a.evaluate(t).bool().not()},se.true_=function(){if(arguments.length!=1)throw new Error("Function true expects ()");return X.true_},se.false_=function(){if(arguments.length!=1)throw new Error("Function false expects ()");return X.false_},se.lang=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function lang expects (string)");for(var a,m=t.contextNode;m!=null&&m.nodeType!=D.DOCUMENT_NODE;m=m.parentNode){var w=m.getAttributeNS(q.XML_NAMESPACE_URI,"lang");if(w!=null){a=String(w);break}}if(a==null)return X.false_;var v=arguments[1].evaluate(t).stringValue();return new X(a.substring(0,v.length)==v&&(a.length==v.length||a.charAt(v.length)=="-"))},se.number=function(){var t=arguments[0];if(!(arguments.length==1||arguments.length==2))throw new Error("Function number expects (object?)");return arguments.length==1?new Z(W.prototype.stringForNode(t.contextNode)):arguments[1].evaluate(t).number()},se.sum=function(){var t=arguments[0],a;if(arguments.length!=2||!ee.instance_of(a=arguments[1].evaluate(t),W))throw new Error("Function sum expects (node-set)");a=a.toUnsortedArray();for(var m=0,w=0;w<a.length;w++)m+=new Z(W.prototype.stringForNode(a[w])).numberValue();return new Z(m)},se.floor=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function floor expects (number)");return new Z(Math.floor(arguments[1].evaluate(t).numberValue()))},se.ceiling=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function ceiling expects (number)");return new Z(Math.ceil(arguments[1].evaluate(t).numberValue()))},se.round=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function round expects (number)");return new Z(Math.round(arguments[1].evaluate(t).numberValue()))};var ee=new Object,nr=function(t){return t&&(t.nodeType===D.ATTRIBUTE_NODE||t.ownerElement||t.isXPathNamespace)};ee.splitQName=function(t){var a=t.indexOf(":");return a==-1?[null,t]:[t.substring(0,a),t.substring(a+1)]},ee.resolveQName=function(t,a,m,w){var v=ee.splitQName(t);return v[0]!=null?v[0]=a.getNamespace(v[0],m):w?(v[0]=a.getNamespace("",m),v[0]==null&&(v[0]="")):v[0]="",v},ee.isSpace=function(t){return t==9||t==13||t==10||t==32},ee.isLetter=function(t){return t>=65&&t<=90||t>=97&&t<=122||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=255||t>=256&&t<=305||t>=308&&t<=318||t>=321&&t<=328||t>=330&&t<=382||t>=384&&t<=451||t>=461&&t<=496||t>=500&&t<=501||t>=506&&t<=535||t>=592&&t<=680||t>=699&&t<=705||t==902||t>=904&&t<=906||t==908||t>=910&&t<=929||t>=931&&t<=974||t>=976&&t<=982||t==986||t==988||t==990||t==992||t>=994&&t<=1011||t>=1025&&t<=1036||t>=1038&&t<=1103||t>=1105&&t<=1116||t>=1118&&t<=1153||t>=1168&&t<=1220||t>=1223&&t<=1224||t>=1227&&t<=1228||t>=1232&&t<=1259||t>=1262&&t<=1269||t>=1272&&t<=1273||t>=1329&&t<=1366||t==1369||t>=1377&&t<=1414||t>=1488&&t<=1514||t>=1520&&t<=1522||t>=1569&&t<=1594||t>=1601&&t<=1610||t>=1649&&t<=1719||t>=1722&&t<=1726||t>=1728&&t<=1742||t>=1744&&t<=1747||t==1749||t>=1765&&t<=1766||t>=2309&&t<=2361||t==2365||t>=2392&&t<=2401||t>=2437&&t<=2444||t>=2447&&t<=2448||t>=2451&&t<=2472||t>=2474&&t<=2480||t==2482||t>=2486&&t<=2489||t>=2524&&t<=2525||t>=2527&&t<=2529||t>=2544&&t<=2545||t>=2565&&t<=2570||t>=2575&&t<=2576||t>=2579&&t<=2600||t>=2602&&t<=2608||t>=2610&&t<=2611||t>=2613&&t<=2614||t>=2616&&t<=2617||t>=2649&&t<=2652||t==2654||t>=2674&&t<=2676||t>=2693&&t<=2699||t==2701||t>=2703&&t<=2705||t>=2707&&t<=2728||t>=2730&&t<=2736||t>=2738&&t<=2739||t>=2741&&t<=2745||t==2749||t==2784||t>=2821&&t<=2828||t>=2831&&t<=2832||t>=2835&&t<=2856||t>=2858&&t<=2864||t>=2866&&t<=2867||t>=2870&&t<=2873||t==2877||t>=2908&&t<=2909||t>=2911&&t<=2913||t>=2949&&t<=2954||t>=2958&&t<=2960||t>=2962&&t<=2965||t>=2969&&t<=2970||t==2972||t>=2974&&t<=2975||t>=2979&&t<=2980||t>=2984&&t<=2986||t>=2990&&t<=2997||t>=2999&&t<=3001||t>=3077&&t<=3084||t>=3086&&t<=3088||t>=3090&&t<=3112||t>=3114&&t<=3123||t>=3125&&t<=3129||t>=3168&&t<=3169||t>=3205&&t<=3212||t>=3214&&t<=3216||t>=3218&&t<=3240||t>=3242&&t<=3251||t>=3253&&t<=3257||t==3294||t>=3296&&t<=3297||t>=3333&&t<=3340||t>=3342&&t<=3344||t>=3346&&t<=3368||t>=3370&&t<=3385||t>=3424&&t<=3425||t>=3585&&t<=3630||t==3632||t>=3634&&t<=3635||t>=3648&&t<=3653||t>=3713&&t<=3714||t==3716||t>=3719&&t<=3720||t==3722||t==3725||t>=3732&&t<=3735||t>=3737&&t<=3743||t>=3745&&t<=3747||t==3749||t==3751||t>=3754&&t<=3755||t>=3757&&t<=3758||t==3760||t>=3762&&t<=3763||t==3773||t>=3776&&t<=3780||t>=3904&&t<=3911||t>=3913&&t<=3945||t>=4256&&t<=4293||t>=4304&&t<=4342||t==4352||t>=4354&&t<=4355||t>=4357&&t<=4359||t==4361||t>=4363&&t<=4364||t>=4366&&t<=4370||t==4412||t==4414||t==4416||t==4428||t==4430||t==4432||t>=4436&&t<=4437||t==4441||t>=4447&&t<=4449||t==4451||t==4453||t==4455||t==4457||t>=4461&&t<=4462||t>=4466&&t<=4467||t==4469||t==4510||t==4520||t==4523||t>=4526&&t<=4527||t>=4535&&t<=4536||t==4538||t>=4540&&t<=4546||t==4587||t==4592||t==4601||t>=7680&&t<=7835||t>=7840&&t<=7929||t>=7936&&t<=7957||t>=7960&&t<=7965||t>=7968&&t<=8005||t>=8008&&t<=8013||t>=8016&&t<=8023||t==8025||t==8027||t==8029||t>=8031&&t<=8061||t>=8064&&t<=8116||t>=8118&&t<=8124||t==8126||t>=8130&&t<=8132||t>=8134&&t<=8140||t>=8144&&t<=8147||t>=8150&&t<=8155||t>=8160&&t<=8172||t>=8178&&t<=8180||t>=8182&&t<=8188||t==8486||t>=8490&&t<=8491||t==8494||t>=8576&&t<=8578||t>=12353&&t<=12436||t>=12449&&t<=12538||t>=12549&&t<=12588||t>=44032&&t<=55203||t>=19968&&t<=40869||t==12295||t>=12321&&t<=12329},ee.isNCNameChar=function(t){return t>=48&&t<=57||t>=1632&&t<=1641||t>=1776&&t<=1785||t>=2406&&t<=2415||t>=2534&&t<=2543||t>=2662&&t<=2671||t>=2790&&t<=2799||t>=2918&&t<=2927||t>=3047&&t<=3055||t>=3174&&t<=3183||t>=3302&&t<=3311||t>=3430&&t<=3439||t>=3664&&t<=3673||t>=3792&&t<=3801||t>=3872&&t<=3881||t==46||t==45||t==95||ee.isLetter(t)||t>=768&&t<=837||t>=864&&t<=865||t>=1155&&t<=1158||t>=1425&&t<=1441||t>=1443&&t<=1465||t>=1467&&t<=1469||t==1471||t>=1473&&t<=1474||t==1476||t>=1611&&t<=1618||t==1648||t>=1750&&t<=1756||t>=1757&&t<=1759||t>=1760&&t<=1764||t>=1767&&t<=1768||t>=1770&&t<=1773||t>=2305&&t<=2307||t==2364||t>=2366&&t<=2380||t==2381||t>=2385&&t<=2388||t>=2402&&t<=2403||t>=2433&&t<=2435||t==2492||t==2494||t==2495||t>=2496&&t<=2500||t>=2503&&t<=2504||t>=2507&&t<=2509||t==2519||t>=2530&&t<=2531||t==2562||t==2620||t==2622||t==2623||t>=2624&&t<=2626||t>=2631&&t<=2632||t>=2635&&t<=2637||t>=2672&&t<=2673||t>=2689&&t<=2691||t==2748||t>=2750&&t<=2757||t>=2759&&t<=2761||t>=2763&&t<=2765||t>=2817&&t<=2819||t==2876||t>=2878&&t<=2883||t>=2887&&t<=2888||t>=2891&&t<=2893||t>=2902&&t<=2903||t>=2946&&t<=2947||t>=3006&&t<=3010||t>=3014&&t<=3016||t>=3018&&t<=3021||t==3031||t>=3073&&t<=3075||t>=3134&&t<=3140||t>=3142&&t<=3144||t>=3146&&t<=3149||t>=3157&&t<=3158||t>=3202&&t<=3203||t>=3262&&t<=3268||t>=3270&&t<=3272||t>=3274&&t<=3277||t>=3285&&t<=3286||t>=3330&&t<=3331||t>=3390&&t<=3395||t>=3398&&t<=3400||t>=3402&&t<=3405||t==3415||t==3633||t>=3636&&t<=3642||t>=3655&&t<=3662||t==3761||t>=3764&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=3864&&t<=3865||t==3893||t==3895||t==3897||t==3902||t==3903||t>=3953&&t<=3972||t>=3974&&t<=3979||t>=3984&&t<=3989||t==3991||t>=3993&&t<=4013||t>=4017&&t<=4023||t==4025||t>=8400&&t<=8412||t==8417||t>=12330&&t<=12335||t==12441||t==12442||t==183||t==720||t==721||t==903||t==1600||t==3654||t==3782||t==12293||t>=12337&&t<=12341||t>=12445&&t<=12446||t>=12540&&t<=12542},ee.coalesceText=function(t){for(var a=t.firstChild;a!=null;a=a.nextSibling)if(a.nodeType==D.TEXT_NODE||a.nodeType==D.CDATA_SECTION_NODE){var m=a.nodeValue,w=a;for(a=a.nextSibling;a!=null&&(a.nodeType==D.TEXT_NODE||a.nodeType==D.CDATA_SECTION_NODE);){m+=a.nodeValue;var v=a;a=a.nextSibling,v.parentNode.removeChild(v)}if(w.nodeType==D.CDATA_SECTION_NODE){var s=w.parentNode;if(w.nextSibling==null)s.removeChild(w),s.appendChild(s.ownerDocument.createTextNode(m));else{var c=w.nextSibling;s.removeChild(w),s.insertBefore(s.ownerDocument.createTextNode(m),c)}}else w.nodeValue=m;if(a==null)break}else a.nodeType==D.ELEMENT_NODE&&ee.coalesceText(a)},ee.instance_of=function(t,a){for(;t!=null;){if(t.constructor===a)return!0;if(t===Object)return!1;t=t.constructor.superclass}return!1},ee.getElementById=function(t,a){if(t.nodeType==D.ELEMENT_NODE&&(t.getAttribute("id")==a||t.getAttributeNS(null,"id")==a))return t;for(var m=t.firstChild;m!=null;m=m.nextSibling){var w=ee.getElementById(m,a);if(w!=null)return w}return null};var lt=(function(){function t(m,w){var v=w?": "+w.toString():"";switch(m){case a.INVALID_EXPRESSION_ERR:return"Invalid expression"+v;case a.TYPE_ERR:return"Type error"+v}return null}function a(m,w,v){var s=Error.call(this,t(m,w)||v);return s.code=m,s.exception=w,s}return a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a.superclass=Error,a.prototype.toString=function(){return this.message},a.fromMessage=function(m,w){return new a(null,w,m)},a.INVALID_EXPRESSION_ERR=51,a.TYPE_ERR=52,a})();ct.prototype={},ct.prototype.constructor=ct,ct.superclass=Object.prototype;function ct(t,a,m){this.xpath=m.parse(t),this.context=new ce,this.context.namespaceResolver=new St(a)}ct.getOwnerDocument=function(t){return t.nodeType===D.DOCUMENT_NODE?t:t.ownerDocument},ct.detectHtmlDom=function(t){if(!t)return!1;var a=ct.getOwnerDocument(t);try{return a.implementation.hasFeature("HTML","2.0")}catch(m){return!0}},ct.prototype.evaluate=function(t,a,m){this.context.expressionContextNode=t,this.context.caseInsensitive=ct.detectHtmlDom(t);var w=this.xpath.evaluate(this.context);return new he(w,a)},St.prototype={},St.prototype.constructor=St,St.superclass=Object.prototype;function St(t){this.xpathNSResolver=t}St.prototype.getNamespace=function(t,a){return this.xpathNSResolver==null?null:this.xpathNSResolver.lookupNamespaceURI(t)},Dt.prototype={},Dt.prototype.constructor=Dt,Dt.superclass=Object.prototype;function Dt(t){this.node=t,this.namespaceResolver=new He}Dt.prototype.lookupNamespaceURI=function(t){return this.namespaceResolver.getNamespace(t,this.node)},he.prototype={},he.prototype.constructor=he,he.superclass=Object.prototype;function he(t,a){switch(a==he.ANY_TYPE&&(t.constructor===ne?a=he.STRING_TYPE:t.constructor===Z?a=he.NUMBER_TYPE:t.constructor===X?a=he.BOOLEAN_TYPE:t.constructor===W&&(a=he.UNORDERED_NODE_ITERATOR_TYPE)),this.resultType=a,a){case he.NUMBER_TYPE:this.numberValue=t.numberValue();return;case he.STRING_TYPE:this.stringValue=t.stringValue();return;case he.BOOLEAN_TYPE:this.booleanValue=t.booleanValue();return;case he.ANY_UNORDERED_NODE_TYPE:case he.FIRST_ORDERED_NODE_TYPE:if(t.constructor===W){this.singleNodeValue=t.first();return}break;case he.UNORDERED_NODE_ITERATOR_TYPE:case he.ORDERED_NODE_ITERATOR_TYPE:if(t.constructor===W){this.invalidIteratorState=!1,this.nodes=t.toArray(),this.iteratorIndex=0;return}break;case he.UNORDERED_NODE_SNAPSHOT_TYPE:case he.ORDERED_NODE_SNAPSHOT_TYPE:if(t.constructor===W){this.nodes=t.toArray(),this.snapshotLength=this.nodes.length;return}break}throw new lt(lt.TYPE_ERR)}he.prototype.iterateNext=function(){if(this.resultType!=he.UNORDERED_NODE_ITERATOR_TYPE&&this.resultType!=he.ORDERED_NODE_ITERATOR_TYPE)throw new lt(lt.TYPE_ERR);return this.nodes[this.iteratorIndex++]},he.prototype.snapshotItem=function(t){if(this.resultType!=he.UNORDERED_NODE_SNAPSHOT_TYPE&&this.resultType!=he.ORDERED_NODE_SNAPSHOT_TYPE)throw new lt(lt.TYPE_ERR);return this.nodes[t]},he.ANY_TYPE=0,he.NUMBER_TYPE=1,he.STRING_TYPE=2,he.BOOLEAN_TYPE=3,he.UNORDERED_NODE_ITERATOR_TYPE=4,he.ORDERED_NODE_ITERATOR_TYPE=5,he.UNORDERED_NODE_SNAPSHOT_TYPE=6,he.ORDERED_NODE_SNAPSHOT_TYPE=7,he.ANY_UNORDERED_NODE_TYPE=8,he.FIRST_ORDERED_NODE_TYPE=9;function ir(t,a){t.createExpression=function(m,w){try{return new ct(m,w,a)}catch(v){throw new lt(lt.INVALID_EXPRESSION_ERR,v)}},t.createNSResolver=function(m){return new Dt(m)},t.evaluate=function(m,w,v,s,c){if(s<0||s>9)throw{code:0,toString:function(){return"Request type not supported"}};return t.createExpression(m,v,a).evaluate(w,s,c)}}try{var xr=!0;try{document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("XPath",null)&&(xr=!1)}catch(t){}xr&&ir(document,new A)}catch(t){}ir(r,new A),(function(){var t=new A,a=new He,m=new _e,w=new Te;function v(P){return{getNamespace:function(Ee,it){var Pe=P(Ee,it);return Pe||a.getNamespace(Ee,it)}}}function s(P){return v(P.getNamespace.bind(P))}function c(P){return v(function(Ee){return P[Ee]})}function y(P){return P&&typeof P.getNamespace=="function"?s(P):typeof P=="function"?v(P):typeof P=="object"?c(P):a}function b(P){if(P===null||typeof P=="undefined"||P instanceof ne||P instanceof X||P instanceof Z||P instanceof W)return P;switch(typeof P){case"string":return new ne(P);case"boolean":return new X(P);case"number":return new Z(P)}var Ee=new W;return Ee.addArray([].concat(P)),Ee}function x(P){return function(Ee){var it=Array.prototype.slice.call(arguments,1).map(function(Ui){return Ui.evaluate(Ee)}),Pe=P.apply(this,[].concat(Ee,it));return b(Pe)}}function O(P){return{getFunction:function(Ee,it){var Pe=P(Ee,it);return Pe?x(Pe):m.getFunction(Ee,it)}}}function me(P){return O(P.getFunction.bind(P))}function Me(P){return O(function(Ee){return P[Ee]})}function je(P){return P&&typeof P.getFunction=="function"?me(P):typeof P=="function"?O(P):typeof P=="object"?Me(P):m}function Je(P){return{getVariable:function(Ee,it){var Pe=P(Ee,it);return b(Pe)}}}function Ke(P){if(P){if(typeof P.getVariable=="function")return Je(P.getVariable.bind(P));if(typeof P=="function")return Je(P);if(typeof P=="object")return Je(function(Ee){return P[Ee]})}return w}function Ct(P,Ee,it){P in it&&(Ee[P]=it[P])}function Pt(P){var Ee=new ce;return P?(Ee.namespaceResolver=y(P.namespaces),Ee.functionResolver=je(P.functions),Ee.variableResolver=Ke(P.variables),Ee.expressionContextNode=P.node,Ct("allowAnyNamespaceForNoPrefix",Ee,P),Ct("isHtml",Ee,P)):Ee.namespaceResolver=a,Ee}function At(P,Ee){var it=Pt(Ee);return P.evaluate(it)}var or={evaluate:function(P){return At(this.expression,P)},evaluateNumber:function(P){return this.evaluate(P).numberValue()},evaluateString:function(P){return this.evaluate(P).stringValue()},evaluateBoolean:function(P){return this.evaluate(P).booleanValue()},evaluateNodeSet:function(P){return this.evaluate(P).nodeset()},select:function(P){return this.evaluateNodeSet(P).toArray()},select1:function(P){return this.select(P)[0]}};function Bt(P){var Ee=t.parse(P);return Object.create(or,{expression:{value:Ee}})}r.parse=Bt})(),Ce(r,{XPath:q,XPathParser:A,XPathResult:he,Step:L,PathExpr:le,NodeTest:$,LocationPath:et,OrOperation:de,AndOperation:B,BarOperation:pe,EqualsOperation:F,NotEqualOperation:Y,LessThanOperation:M,GreaterThanOperation:V,LessThanOrEqualOperation:_,GreaterThanOrEqualOperation:z,PlusOperation:fe,MinusOperation:oe,MultiplyOperation:G,DivOperation:J,ModOperation:ue,UnaryMinusOperation:Ie,FunctionCall:tt,VariableReference:Ge,XPathContext:ce,XNodeSet:W,XBoolean:X,XString:ne,XNumber:Z,NamespaceResolver:He,FunctionResolver:_e,VariableResolver:Te,Utilities:ee}),r.select=function(t,a,m){return r.selectWithResolver(t,a,null,m)},r.useNamespaces=function(t){var a={mappings:t||{},lookupNamespaceURI:function(m){return this.mappings[m]}};return function(m,w,v){return r.selectWithResolver(m,w,a,v)}},r.selectWithResolver=function(t,a,m,w){var v=new ct(t,m,new A),s=he.ANY_TYPE,c=v.evaluate(a,s,null);return c.resultType==he.STRING_TYPE?c=c.stringValue:c.resultType==he.NUMBER_TYPE?c=c.numberValue:c.resultType==he.BOOLEAN_TYPE?c=c.booleanValue:(c=c.nodes,w&&(c=c[0])),c},r.select1=function(t,a){return r.select(t,a,!0)};var qe=function(t){return Array.isArray(t)&&t.every(l)},Le=function(t){return function(a){return l(a)&&a.nodeType===t}};Ce(r,{isNodeLike:l,isArrayOfNodes:qe,isElement:Le(D.ELEMENT_NODE),isAttribute:Le(D.ATTRIBUTE_NODE),isTextNode:Le(D.TEXT_NODE),isCDATASection:Le(D.CDATA_SECTION_NODE),isProcessingInstruction:Le(D.PROCESSING_INSTRUCTION_NODE),isComment:Le(D.COMMENT_NODE),isDocumentNode:Le(D.DOCUMENT_NODE),isDocumentTypeNode:Le(D.DOCUMENT_TYPE_NODE),isDocumentFragment:Le(D.DOCUMENT_FRAGMENT_NODE)})})(e)})(Hi)),Hi}var $s=hl(),dl=al($s),Gs=Ot({__proto__:null,default:dl},[$s]);function Xs(n,e){const r=[],i=e.split(",").map(l=>l.trim()),o=[];for(const l of i){const f=l.split(/\\:|:/).filter(Boolean);f.length===1?o.push({name:f[0]}):f.length===2&&o.push({ns:f[0],name:f[1]})}function u(l){if(l){if(l.nodeType===1){const f=l,p=f.nodeName,g=f.localName;for(const N of o){if(N.ns&&p===`${N.ns}:${N.name}`){r.push(f);break}if(g===N.name||p===N.name){r.push(f);break}if(p.endsWith(`:${N.name}`)){r.push(f);break}}}if(l.childNodes)for(let f=0;f<l.childNodes.length;f++)u(l.childNodes[f])}}return u(n),r}const Ws={ds:"http://www.w3.org/2000/09/xmldsig#",dsig11:"http://www.w3.org/2009/xmldsig11#",dsig2:"http://www.w3.org/2010/xmldsig2#",ec:"http://www.w3.org/2001/10/xml-exc-c14n#",dsig_more:"http://www.w3.org/2001/04/xmldsig-more#",xenc:"http://www.w3.org/2001/04/xmlenc#",xenc11:"http://www.w3.org/2009/xmlenc11#",xades:"http://uri.etsi.org/01903/v1.3.2#",xades141:"http://uri.etsi.org/01903/v1.4.1#",asic:"http://uri.etsi.org/02918/v1.2.1#"};function zs(){return typeof window!="undefined"&&window.DOMParser?new window.DOMParser:new qs.DOMParser}function gl(n,e,r=Ws){try{if(typeof document!="undefined"&&typeof document.evaluate=="function"){const i="ownerDocument"in n?n.ownerDocument:n;if(!i||typeof i.evaluate!="function")return null;const o=Ys(r);return i.evaluate(e,n,o,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}else{const i=Gs,o=r;try{const u=i.select(e,n,o);return u.length>0?u[0]:null}catch(u){if(typeof u=="object"&&u!==null&&"message"in u&&typeof u.message=="string"&&u.message.includes("Cannot resolve QName")){const l=e.match(/local-name\(\)='([^']+)'/);if(l&&l[1]){const f=`.//*[local-name()='${l[1]}']`,p=i.select(f,n);return p.length>0?p[0]:null}}throw u}}}catch(i){return console.error(`XPath evaluation failed for "${e}":`,i),null}}function ml(n,e,r=Ws){try{if(typeof document!="undefined"&&typeof document.evaluate=="function"){const i="ownerDocument"in n?n.ownerDocument:n;if(!i||typeof i.evaluate!="function")return[];const o=Ys(r),u=i.evaluate(e,n,o,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),l=[];for(let f=0;f<u.snapshotLength;f++)l.push(u.snapshotItem(f));return l}else{const i=Gs,o=r;try{return i.select(e,n,o)}catch(u){if(typeof u=="object"&&u!==null&&"message"in u&&typeof u.message=="string"&&u.message.includes("Cannot resolve QName")){const l=e.match(/local-name\(\)='([^']+)'/);if(l&&l[1]){const f=`.//*[local-name()='${l[1]}']`;return i.select(f,n)}}throw u}}}catch(i){return console.error(`XPath evaluation failed for "${e}":`,i),[]}}function Ys(n){return function(e){return e===null?null:n[e]||null}}function Js(n){const e=n.split(",").map(i=>i.trim()),r=[];for(const i of e){const o=i.split(/\\:|:/).filter(Boolean);o.length===1?r.push(`.//*[local-name()='${o[0]}']`):o.length===2&&r.push(`.//${o[0]}:${o[1]} | .//*[local-name()='${o[1]}']`)}return r.join(" | ")}function ot(n,e){if(typeof n.querySelector=="function")try{const i=n.querySelector(e);if(i)return i}catch(i){}const r=Xs(n,e);if(r.length>0)return r[0];try{const i=Js(e);return gl(n,i)}catch(i){return console.warn("XPath query failed, using direct DOM traversal as fallback"),null}}function On(n,e){if(typeof n.querySelectorAll=="function")try{const i=n.querySelectorAll(e);if(i.length>0){const o=[];for(let u=0;u<i.length;u++)o.push(i[u]);return o}}catch(i){}const r=Xs(n,e);if(r.length>0)return r;try{const i=Js(e);return ml(n,i)}catch(i){return console.warn("XPath query failed, using direct DOM traversal as fallback"),[]}}function yl(n){return typeof window!="undefined"&&window.XMLSerializer?new window.XMLSerializer().serializeToString(n):new qs.XMLSerializer().serializeToString(n)}const Br={default:"c14n","http://www.w3.org/TR/2001/REC-xml-c14n-20010315":"c14n","http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":"c14n","http://www.w3.org/2006/12/xml-c14n11":"c14n11","http://www.w3.org/2006/12/xml-c14n11#WithComments":"c14n11","http://www.w3.org/2001/10/xml-exc-c14n#":"c14n_exc","http://www.w3.org/2001/10/xml-exc-c14n#WithComments":"c14n_exc"},Qr={c14n:{beforeChildren:()=>"",afterChildren:()=>"",betweenChildren:()=>"",afterElement:()=>"",isCanonicalizationMethod:"c14n"},c14n11:{beforeChildren:()=>"",afterChildren:()=>"",betweenChildren:()=>"",afterElement:()=>"",isCanonicalizationMethod:"c14n11"},c14n_exc:{beforeChildren:()=>"",afterChildren:()=>"",betweenChildren:()=>"",afterElement:()=>"",isCanonicalizationMethod:"c14n_exc"}},rt={ELEMENT_NODE:1,TEXT_NODE:3};class Ye{constructor(e=Qr.c14n){this.method=e}static fromMethod(e){const r=Br[e];if(!r)throw new Error(`Unsupported canonicalization method: ${e}`);return new Ye(Qr[r])}setMethod(e){this.method=e}static escapeXml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}static collectNamespaces(e,r=new Map){let i=e;for(;i&&i.nodeType===rt.ELEMENT_NODE;){const o=i,u=o.getAttribute("xmlns");u!==null&&!r.has("")&&r.set("",u);const l=o.attributes;for(let f=0;f<l.length;f++){const p=l[f];if(p.name.startsWith("xmlns:")){const g=p.name.substring(6);r.has(g)||r.set(g,p.value)}}i=i.parentNode}return r}static collectUsedNamespaces(e,r=new Map,i=[]){const o=new Map,u=new Set;function l(f,p=!1){if(f.nodeType===rt.ELEMENT_NODE){const g=f,N=g.namespaceURI,E=g.prefix||"";if(E&&N&&(p||!u.has(E))){u.add(E);const C=r.get(E);C&&C===N&&!o.has(E)&&o.set(E,C)}const S=g.attributes;for(let C=0;C<S.length;C++){const I=S[C];if(I.name.includes(":")&&!I.name.startsWith("xmlns:")){const H=I.name.split(":")[0];if(p||!u.has(H)){u.add(H);const U=r.get(H);U&&!o.has(H)&&o.set(H,U)}}}for(const C of i){const I=r.get(C);I&&!o.has(C)&&o.set(C,I)}for(let C=0;C<f.childNodes.length;C++)l(f.childNodes[C],!1)}}return l(e,!0),o}static isBase64Element(e){if(e.nodeType!==rt.ELEMENT_NODE)return!1;const r=e,i=r.localName||r.nodeName.split(":").pop()||"";return this.base64Elements.has(i)}static analyzeWhitespace(e){const r=e.nodeType===rt.ELEMENT_NODE?e:e.documentElement;function i(o){if(o.nodeType===rt.ELEMENT_NODE){o._whitespace={hasMixedContent:!1,hasExistingLinebreaks:!1,originalContent:{}};const u=Array.from(o.childNodes);let l=!1,f=!1,p=!1;for(const g of u)if(g.nodeType===rt.TEXT_NODE&&(g.nodeValue||"").trim().length>0){l=!0;break}for(const g of u)if(g.nodeType===rt.ELEMENT_NODE){f=!0;break}for(let g=0;g<u.length;g++){const N=u[g];if(N.nodeType===rt.TEXT_NODE){const E=N.nodeValue||"";N._originalText=E,E.includes(`
11
- `)&&(p=!0)}else N.nodeType===rt.ELEMENT_NODE&&i(N)}o._whitespace.hasMixedContent=l&&f,o._whitespace.hasExistingLinebreaks=p}}i(r)}canonicalize(e,r=new Map,i={isStartingNode:!0}){var o;return this.method.isCanonicalizationMethod==="c14n_exc"?this.canonicalizeExclusive(e,r,{inclusiveNamespacePrefixList:i.inclusiveNamespacePrefixList,isStartingNode:i.isStartingNode}):this.canonicalizeStandard(e,r,{isStartingNode:(o=i.isStartingNode)!=null?o:!0})}canonicalizeStandard(e,r=new Map,i={isStartingNode:!0}){var o,u,l;if(!e)return"";let f="";if(e.nodeType===rt.ELEMENT_NODE){const p=new Map(r),g=e,N=g.getAttribute("xmlns");N!==null&&p.set("",N);const E=g.attributes;for(let D=0;D<E.length;D++){const A=E[D];if(A.name.startsWith("xmlns:")){const q=A.name.substring(6);p.set(q,A.value)}}const S=g.prefix||"",C=g.localName||g.nodeName.split(":").pop()||"",I=S?`${S}:${C}`:C;if(f+="<"+I,i.isStartingNode){const D=Ye.collectNamespaces(e),A=Array.from(D.entries()).sort((q,re)=>q[0]===""?-1:re[0]===""?1:q[0].localeCompare(re[0]));for(const[q,re]of A)q===""?f+=` xmlns="${re}"`:f+=` xmlns:${q}="${re}"`}else{const D=Array.from(p.entries()).filter(([A,q])=>!r.has(A)||r.get(A)!==q).sort((A,q)=>A[0]===""?-1:q[0]===""?1:A[0].localeCompare(q[0]));for(const[A,q]of D)A===""?f+=` xmlns="${q}"`:f+=` xmlns:${A}="${q}"`}const H=g.attributes,U=[];for(let D=0;D<H.length;D++){const A=H[D];A.name.startsWith("xmlns")||U.push(A)}U.sort((D,A)=>D.name.localeCompare(A.name));for(const D of U)f+=` ${D.name}="${Ye.escapeXml(D.value)}"`;f+=">";const R=Array.from(e.childNodes);let K=!1,Ae=!1;const be=((o=e._whitespace)==null?void 0:o.hasMixedContent)||!1;for(const D of R)if(D.nodeType===rt.ELEMENT_NODE){K=!0;break}const Ce=this.method.isCanonicalizationMethod==="c14n11"&&K&&!((u=e._whitespace)!=null&&u.hasExistingLinebreaks)&&!be;Ce&&(f+=this.method.beforeChildren(K,be));for(let D=0;D<R.length;D++){const A=R[D],q=A.nodeType===rt.ELEMENT_NODE,re=D<R.length-1?R[D+1]:null;if(re&&(re.nodeType,rt.ELEMENT_NODE),A.nodeType===rt.TEXT_NODE){const Q=A.nodeValue||"";Ye.isBase64Element(e)?f+=Q.replace(/\r/g,"&#xD;"):f+=A._originalText||Q,Ae=!1;continue}q&&(Ae&&this.method.isCanonicalizationMethod==="c14n11"&&!((l=e._whitespace)!=null&&l.hasExistingLinebreaks)&&!be&&(f+=this.method.betweenChildren(!0,!0,be)),f+=this.canonicalizeStandard(A,p,{isStartingNode:!1}),Ae=!0)}Ce&&(f+=this.method.afterChildren(K,be)),f+="</"+I+">"}else if(e.nodeType===rt.TEXT_NODE){const p=e._originalText||e.nodeValue||"";f+=Ye.escapeXml(p)}return f}canonicalizeExclusive(e,r=new Map,i={}){if(!e)return"";const{inclusiveNamespacePrefixList:o=[],isStartingNode:u=!0}=i;let l="";if(e.nodeType===rt.ELEMENT_NODE){const f=e,p=Ye.collectNamespaces(f),g=u?Ye.collectUsedNamespaces(f,p,o):new Map,N=f.prefix||"",E=f.localName||f.nodeName.split(":").pop()||"",S=N?`${N}:${E}`:E;if(l+="<"+S,u){const U=Array.from(g.entries()).sort((R,K)=>R[0]===""?-1:K[0]===""?1:R[0].localeCompare(K[0]));for(const[R,K]of U)R===""?l+=` xmlns="${K}"`:l+=` xmlns:${R}="${K}"`}const C=f.attributes,I=[];for(let U=0;U<C.length;U++){const R=C[U];R.name.startsWith("xmlns")||I.push(R)}I.sort((U,R)=>U.name.localeCompare(R.name));for(const U of I)l+=` ${U.name}="${Ye.escapeXml(U.value)}"`;l+=">";const H=Array.from(e.childNodes);for(let U=0;U<H.length;U++){const R=H[U];if(R.nodeType===rt.TEXT_NODE){const K=R.nodeValue||"";Ye.isBase64Element(e)?l+=K.replace(/\r/g,"&#xD;"):l+=Ye.escapeXml(K)}else R.nodeType===rt.ELEMENT_NODE&&(l+=this.canonicalizeExclusive(R,new Map([...r,...g]),{inclusiveNamespacePrefixList:o,isStartingNode:!1}))}l+="</"+S+">"}else if(e.nodeType===rt.TEXT_NODE){const f=e.nodeValue||"";l+=Ye.escapeXml(f)}return l}static c14n(e){return this.analyzeWhitespace(e),new Ye(Qr.c14n).canonicalize(e)}static c14n11(e){return this.analyzeWhitespace(e),new Ye(Qr.c14n11).canonicalize(e)}static c14n_exc(e,r=[]){return this.analyzeWhitespace(e),new Ye(Qr.c14n_exc).canonicalizeExclusive(e,new Map,{inclusiveNamespacePrefixList:r})}static canonicalize(e,r,i={}){switch(Br[r]||Br.default){case"c14n":return this.c14n(e);case"c14n11":return this.c14n11(e);case"c14n_exc":return this.c14n_exc(e,i.inclusiveNamespacePrefixList||[]);default:throw new Error(`Unsupported canonicalization method: ${r}`)}}}Ye.base64Elements=new Set(["DigestValue","X509Certificate","EncapsulatedTimeStamp","EncapsulatedOCSPValue","IssuerSerialV2"]);var vl=(n,e,r)=>new Promise((i,o)=>{var u=p=>{try{f(r.next(p))}catch(g){o(g)}},l=p=>{try{f(r.throw(p))}catch(g){o(g)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,l);f((r=r.apply(n,e)).next())});function El(n){if(!n)return"";const e=n.replace(/\s+/g,""),r=[];for(let i=0;i<e.length;i+=64)r.push(e.substring(i,i+64));return`-----BEGIN CERTIFICATE-----
8
+ `)}function R(C){if(C=C||{},C.locator===void 0&&(C.locator=!0),this.assign=C.assign||n.assign,this.domHandler=C.domHandler||P,this.onError=C.onError||C.errorHandler,C.errorHandler&&typeof C.errorHandler!="function")throw new TypeError("errorHandler object is no longer supported, switch to onError!");C.errorHandler&&C.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=C.normalizeLineEndings||T,this.locator=!!C.locator,this.xmlns=this.assign(Object.create(null),C.xmlns)}R.prototype.parseFromString=function(C,A){if(!h(A))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+A+'" is not valid.');var G=this.assign(Object.create(null),this.xmlns),ee=i.XML_ENTITIES,pe=G[""]||null;l(A)?(ee=i.HTML_ENTITIES,pe=b.HTML):A===y.XML_SVG_IMAGE&&(pe=b.SVG),G[""]=pe,G.xml=G.xml||b.XML;var Ae=new this.domHandler({mimeType:A,defaultNamespace:pe,onError:this.onError}),we=this.locator?{}:void 0;this.locator&&Ae.setDocumentLocator(we);var te=new x;te.errorHandler=Ae,te.domBuilder=Ae;var De=!n.isHTMLMimeType(A);return De&&typeof C!="string"&&te.errorHandler.fatalError("source is not a string"),te.parse(this.normalizeLineEndings(String(C)),G,ee),Ae.doc.documentElement||te.errorHandler.fatalError("missing root element"),Ae.doc};function P(C){var A=C||{};this.mimeType=A.mimeType||y.XML_APPLICATION,this.defaultNamespace=A.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=A.onError}function _(C,A){A.lineNumber=C.lineNumber,A.columnNumber=C.columnNumber}P.prototype={startDocument:function(){var C=new s;this.doc=c(this.mimeType)?C.createHTMLDocument(!1):C.createDocument(this.defaultNamespace,"")},startElement:function(C,A,G,ee){var pe=this.doc,Ae=pe.createElementNS(C,G||A),we=ee.length;Se(this,Ae),this.currentElement=Ae,this.locator&&_(this.locator,Ae);for(var te=0;te<we;te++){var C=ee.getURI(te),De=ee.getValue(te),G=ee.getQName(te),B=pe.createAttributeNS(C,G);this.locator&&_(ee.getLocator(te),B),B.value=B.nodeValue=De,Ae.setAttributeNode(B)}},endElement:function(C,A,G){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(C,A){},endPrefixMapping:function(C){},processingInstruction:function(C,A){var G=this.doc.createProcessingInstruction(C,A);this.locator&&_(this.locator,G),Se(this,G)},ignorableWhitespace:function(C,A,G){},characters:function(C,A,G){if(C=fe.apply(this,arguments),C){if(this.cdata)var ee=this.doc.createCDATASection(C);else var ee=this.doc.createTextNode(C);this.currentElement?this.currentElement.appendChild(ee):/^\s*$/.test(C)&&this.doc.appendChild(ee),this.locator&&_(this.locator,ee)}},skippedEntity:function(C){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(C){C&&(C.lineNumber=0),this.locator=C},comment:function(C,A,G){C=fe.apply(this,arguments);var ee=this.doc.createComment(C);this.locator&&_(this.locator,ee),Se(this,ee)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(C,A,G,ee){var pe=this.doc.implementation;if(pe&&pe.createDocumentType){var Ae=pe.createDocumentType(C,A,G,ee);this.locator&&_(this.locator,Ae),Se(this,Ae),this.doc.doctype=Ae}},reportError:function(C,A){if(typeof this.onError=="function")try{this.onError(C,A,this)}catch(G){throw new E("Reporting "+C+' "'+A+'" caused '+G,this.locator)}else console.error("[xmldom "+C+"] "+A,k(this.locator))},warning:function(C){this.reportError("warning",C)},error:function(C){this.reportError("error",C)},fatalError:function(C){throw this.reportError("fatalError",C),new E(C,this.locator)}};function k(C){if(C)return`
9
+ @#[line:`+C.lineNumber+",col:"+C.columnNumber+"]"}function fe(C,A,G){return typeof C=="string"?C.substr(A,G):C.length>=A+G||A?new java.lang.String(C,A,G)+"":C}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(C){P.prototype[C]=function(){return null}});function Se(C,A){C.currentElement?C.currentElement.appendChild(A):C.doc.appendChild(A)}function Be(C){if(C==="error")throw"onErrorStopParsing"}function me(){throw"onWarningStopParsing"}return dr.__DOMHandler=P,dr.DOMParser=R,dr.normalizeLineEndings=T,dr.onErrorStopParsing=Be,dr.onWarningStopParsing=me,dr}var ru;function Tl(){if(ru)return Te;ru=1;var n=kr();Te.assign=n.assign,Te.hasDefaultHTMLNamespace=n.hasDefaultHTMLNamespace,Te.isHTMLMimeType=n.isHTMLMimeType,Te.isValidMimeType=n.isValidMimeType,Te.MIME_TYPE=n.MIME_TYPE,Te.NAMESPACE=n.NAMESPACE;var e=Un();Te.DOMException=e.DOMException,Te.DOMExceptionName=e.DOMExceptionName,Te.ExceptionCode=e.ExceptionCode,Te.ParseError=e.ParseError;var r=Qs();Te.Attr=r.Attr,Te.CDATASection=r.CDATASection,Te.CharacterData=r.CharacterData,Te.Comment=r.Comment,Te.Document=r.Document,Te.DocumentFragment=r.DocumentFragment,Te.DocumentType=r.DocumentType,Te.DOMImplementation=r.DOMImplementation,Te.Element=r.Element,Te.Entity=r.Entity,Te.EntityReference=r.EntityReference,Te.LiveNodeList=r.LiveNodeList,Te.NamedNodeMap=r.NamedNodeMap,Te.Node=r.Node,Te.NodeList=r.NodeList,Te.Notation=r.Notation,Te.ProcessingInstruction=r.ProcessingInstruction,Te.Text=r.Text,Te.XMLSerializer=r.XMLSerializer;var i=xl();return Te.DOMParser=i.DOMParser,Te.normalizeLineEndings=i.normalizeLineEndings,Te.onErrorStopParsing=i.onErrorStopParsing,Te.onWarningStopParsing=i.onWarningStopParsing,Te}var nu=Tl(),Zi={},iu;function Sl(){return iu||(iu=1,(function(n){var e=n;(function(r){var i="__namespace",o=function(t){return t==null},s=function(t){return t===i||Number.isInteger(t)&&t>=1&&t<=11},l=function(t){return t&&s(t.nodeType)&&typeof t.nodeName=="string"};function c(t){var u=Array.prototype.slice,m=t.length,w=function(D,K){return function(){return K.apply(this,D.concat(u.call(arguments)))}},v=function(){var D=u.call(arguments);return D.length<m?w(D,v):t.apply(this,u.apply(arguments,[0,m]))};return v}var h=function(t,u){for(var m=0;m<u.length;m+=1)t(u[m],m,u)},y=function(t,u,m){var w=u;return h(function(v,D){w=t(w,v,D)},m),w},b=function(t,u){var m=new Array(u.length);return h(function(w,v){m[v]=t(w)},u),m},E=function(t,u){var m=[];return h(function(w,v){t(w,v)&&m.push(w)},u),m},x=function(t,u){for(var m=0;m<t.length;m+=1)if(t[m]===u)return!0;return!1};function T(t){return function(){return t}}function R(t){return t.toString()}var P=function(t,u){return u.join(t)},_=function(t,u,m){return t+m+u},k=Array.prototype.concat,fe=function(t,u){var m=new J;m.addArray(t);var w=m.toArray();return u?w.reverse():w},Se=32767;function Be(t){for(var u=[],m=0;m<t.length;m+=Se){var w=t.slice(m,m+Se);u=k.apply(u,w)}return u}function me(t,u){for(var m=Object(t),w=1;w<arguments.length;w++){var v=arguments[w];if(v!=null)for(var D in v)Object.prototype.hasOwnProperty.call(v,D)&&(m[D]=v[D])}return m}var C={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NAMESPACE_NODE:i};A.prototype=new Object,A.prototype.constructor=A,A.superclass=Object.prototype;function A(){this.init()}A.prototype.init=function(){this.reduceActions=[],this.reduceActions[3]=function(t){return new De(t[0],t[2])},this.reduceActions[5]=function(t){return new B(t[0],t[2])},this.reduceActions[7]=function(t){return new I(t[0],t[2])},this.reduceActions[8]=function(t){return new M(t[0],t[2])},this.reduceActions[10]=function(t){return new U(t[0],t[2])},this.reduceActions[11]=function(t){return new X(t[0],t[2])},this.reduceActions[12]=function(t){return new F(t[0],t[2])},this.reduceActions[13]=function(t){return new re(t[0],t[2])},this.reduceActions[15]=function(t){return new Q(t[0],t[2])},this.reduceActions[16]=function(t){return new $(t[0],t[2])},this.reduceActions[18]=function(t){return new j(t[0],t[2])},this.reduceActions[19]=function(t){return new V(t[0],t[2])},this.reduceActions[20]=function(t){return new le(t[0],t[2])},this.reduceActions[22]=function(t){return new we(t[1])},this.reduceActions[24]=function(t){return new ge(t[0],t[2])},this.reduceActions[25]=function(t){return new he(void 0,void 0,t[0])},this.reduceActions[27]=function(t){return t[0].locationPath=t[2],t[0]},this.reduceActions[28]=function(t){return t[0].locationPath=t[2],t[0].locationPath.steps.unshift(new L(L.DESCENDANTORSELF,Y.nodeTest,[])),t[0]},this.reduceActions[29]=function(t){return new he(t[0],[],void 0)},this.reduceActions[30]=function(t){return Z.instance_of(t[0],he)?(t[0].filterPredicates==null&&(t[0].filterPredicates=[]),t[0].filterPredicates.push(t[1]),t[0]):new he(t[0],[t[1]],void 0)},this.reduceActions[32]=function(t){return t[1]},this.reduceActions[33]=function(t){return new ie(t[0])},this.reduceActions[34]=function(t){return new se(t[0])},this.reduceActions[36]=function(t){return new Ze(t[0],[])},this.reduceActions[37]=function(t){return new Ze(t[0],t[2])},this.reduceActions[38]=function(t){return[t[0]]},this.reduceActions[39]=function(t){return t[2].unshift(t[0]),t[2]},this.reduceActions[43]=function(t){return new rt(!0,[])},this.reduceActions[44]=function(t){return t[1].absolute=!0,t[1]},this.reduceActions[46]=function(t){return new rt(!1,[t[0]])},this.reduceActions[47]=function(t){return t[0].steps.push(t[2]),t[0]},this.reduceActions[49]=function(t){return new L(t[0],t[1],[])},this.reduceActions[50]=function(t){return new L(L.CHILD,t[0],[])},this.reduceActions[51]=function(t){return new L(t[0],t[1],t[2])},this.reduceActions[52]=function(t){return new L(L.CHILD,t[0],t[1])},this.reduceActions[54]=function(t){return[t[0]]},this.reduceActions[55]=function(t){return t[1].unshift(t[0]),t[1]},this.reduceActions[56]=function(t){return t[0]=="ancestor"?L.ANCESTOR:t[0]=="ancestor-or-self"?L.ANCESTORORSELF:t[0]=="attribute"?L.ATTRIBUTE:t[0]=="child"?L.CHILD:t[0]=="descendant"?L.DESCENDANT:t[0]=="descendant-or-self"?L.DESCENDANTORSELF:t[0]=="following"?L.FOLLOWING:t[0]=="following-sibling"?L.FOLLOWINGSIBLING:t[0]=="namespace"?L.NAMESPACE:t[0]=="parent"?L.PARENT:t[0]=="preceding"?L.PRECEDING:t[0]=="preceding-sibling"?L.PRECEDINGSIBLING:t[0]=="self"?L.SELF:-1},this.reduceActions[57]=function(t){return L.ATTRIBUTE},this.reduceActions[59]=function(t){return t[0]=="comment"?Y.commentTest:t[0]=="text"?Y.textTest:t[0]=="processing-instruction"?Y.anyPiTest:t[0]=="node"?Y.nodeTest:new Y(-1,void 0)},this.reduceActions[60]=function(t){return new Y.PITest(t[2])},this.reduceActions[61]=function(t){return t[1]},this.reduceActions[63]=function(t){return t[1].absolute=!0,t[1].steps.unshift(new L(L.DESCENDANTORSELF,Y.nodeTest,[])),t[1]},this.reduceActions[64]=function(t){return t[0].steps.push(new L(L.DESCENDANTORSELF,Y.nodeTest,[])),t[0].steps.push(t[2]),t[0]},this.reduceActions[65]=function(t){return new L(L.SELF,Y.nodeTest,[])},this.reduceActions[66]=function(t){return new L(L.PARENT,Y.nodeTest,[])},this.reduceActions[67]=function(t){return new Ye(t[1])},this.reduceActions[68]=function(t){return Y.nameTestAny},this.reduceActions[69]=function(t){return new Y.NameTestPrefixAny(t[0].split(":")[0])},this.reduceActions[70]=function(t){return new Y.NameTestQName(t[0])}},A.actionTable=[" s s sssssssss s ss s ss"," s ","r rrrrrrrrr rrrrrrr rr r "," rrrrr "," s s sssssssss s ss s ss","rs rrrrrrrr s sssssrrrrrr rrs rs "," s s sssssssss s ss s ss"," s "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s "," s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr r ","a ","r s rr r ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrs rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r srrrrrrrr rrrrrrs rr sr ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r "," sssss ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrr rrrrr rr r "," s "," s "," rrrrr "," s s sssssssss s sss s ss","r srrrrrrrr rrrrrrs rr r "," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss ss s ss"," s s sssssssss s ss s ss"," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr rr "," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," rr "," s "," rs ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrr rr r "," r "," s ","r srrrrrrrr rrrrrrs rr r ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s s sssssssss s ss s ss","r rrrrrrrrr rrrrrrr rr rr "," r "],A.actionTableNumber=[` 1 0 /.-,+*)(' & %$ # "!`," J ","a aaaaaaaaa aaaaaaa aa a "," YYYYY ",` 1 0 /.-,+*)(' & %$ # "!`,`K1 KKKKKKKK . +*)('KKKKKK KK# K" `,` 1 0 /.-,+*)(' & %$ # "!`," N "," O ","e eeeeeeeee eeeeeee ee ee ","f fffffffff fffffff ff ff ","d ddddddddd ddddddd dd dd ","B BBBBBBBBB BBBBBBB BB BB ","A AAAAAAAAA AAAAAAA AA AA "," P "," Q ",` 1 . +*)(' # " `,"b bbbbbbbbb bbbbbbb bb b "," ","! S !! ! ",'" T" "" " ',"$ V $$ U $$ $ ","& &ZY&& &XW && & ",") ))))) )))\\[ )) ) ",". ....._^] ..... .. . ","1 11111111 11111 11 1 ","5 55555555 55555` 55 5 ","7 77777777 777777 77 7 ","9 99999999 999999 99 9 ",": c:::::::: ::::::b :: a: ","I fIIIIIIII IIIIIIe II I ","= ========= ======= == == ","? ????????? ??????? ?? ?? ","C CCCCCCCCC CCCCCCC CC CC ","J JJJJJJJJ JJJJJJ JJ J ","M MMMMMMMM MMMMMM MM M ","N NNNNNNNNN NNNNNNN NN N ","P PPPPPPPPP PPPPPPP PP P "," +*)(' ","R RRRRRRRRR RRRRRRR RR aR ","U UUUUUUUUU UUUUUUU UU U ","Z ZZZZZZZZZ ZZZZZZZ ZZ ZZ ","c ccccccccc ccccccc cc cc "," j ","L fLLLLLLLL LLLLLLe LL L ","6 66666666 66666 66 6 "," k "," l "," XXXXX ",` 1 0 /.-,+*)(' & %$m # "!`,"_ f________ ______e __ _ ",` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 . +*)(' # " `,` 1 . +*)(' # " `,"> >>>>>>>>> >>>>>>> >> >> ",` 1 . +*)(' # " `,` 1 . +*)(' # " `,"Q QQQQQQQQQ QQQQQQQ QQ aQ ","V VVVVVVVVV VVVVVVV VV aV ","T TTTTTTTTT TTTTTTT TT T ","@ @@@@@@@@@ @@@@@@@ @@ @@ "," \x87 ","[ [[[[[[[[[ [[[[[[[ [[ [[ ","D DDDDDDDDD DDDDDDD DD DD "," HH "," \x88 "," F\x89 ","# T# ## # ","% V %% U %% % ","' 'ZY'' 'XW '' ' ","( (ZY(( (XW (( ( ","+ +++++ +++\\[ ++ + ","* ***** ***\\[ ** * ","- ----- ---\\[ -- - ",", ,,,,, ,,,\\[ ,, , ","0 00000_^] 00000 00 0 ","/ /////_^] ///// // / ","2 22222222 22222 22 2 ","3 33333333 33333 33 3 ","4 44444444 44444 44 4 ","8 88888888 888888 88 8 "," ^ "," \x8A ","; f;;;;;;;; ;;;;;;e ;; ; ","< f<<<<<<<< <<<<<<e << < ","O OOOOOOOOO OOOOOOO OO O ","` ````````` ``````` `` ` ","S SSSSSSSSS SSSSSSS SS S ","W WWWWWWWWW WWWWWWW WW W ","\\ \\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\ \\\\ \\\\ ","E EEEEEEEEE EEEEEEE EE EE ",` 1 0 /.-,+*)(' & %$ # "!`,"] ]]]]]]]]] ]]]]]]] ]] ]] "," G "],A.gotoTable=["3456789:;<=>?@ AB CDEFGH IJ "," "," "," ","L456789:;<=>?@ AB CDEFGH IJ "," M EFGH IJ "," N;<=>?@ AB CDEFGH IJ "," "," "," "," "," "," "," "," "," "," S EFGH IJ "," "," "," "," "," "," "," "," "," "," "," "," "," e "," "," "," "," "," "," "," "," "," h J "," i j "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ ABpqCDEFGH IJ "," "," r6789:;<=>?@ AB CDEFGH IJ "," s789:;<=>?@ AB CDEFGH IJ "," t89:;<=>?@ AB CDEFGH IJ "," u89:;<=>?@ AB CDEFGH IJ "," v9:;<=>?@ AB CDEFGH IJ "," w9:;<=>?@ AB CDEFGH IJ "," x9:;<=>?@ AB CDEFGH IJ "," y9:;<=>?@ AB CDEFGH IJ "," z:;<=>?@ AB CDEFGH IJ "," {:;<=>?@ AB CDEFGH IJ "," |;<=>?@ AB CDEFGH IJ "," };<=>?@ AB CDEFGH IJ "," ~;<=>?@ AB CDEFGH IJ "," \x7F=>?@ AB CDEFGH IJ ","\x80456789:;<=>?@ AB CDEFGH IJ\x81"," \x82 EFGH IJ "," \x83 EFGH IJ "," "," \x84 GH IJ "," \x85 GH IJ "," i \x86 "," i \x87 "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ AB\x8CqCDEFGH IJ "," "," "],A.productions=[[1,1,2],[2,1,3],[3,1,4],[3,3,3,-9,4],[4,1,5],[4,3,4,-8,5],[5,1,6],[5,3,5,-22,6],[5,3,5,-5,6],[6,1,7],[6,3,6,-23,7],[6,3,6,-24,7],[6,3,6,-6,7],[6,3,6,-7,7],[7,1,8],[7,3,7,-25,8],[7,3,7,-26,8],[8,1,9],[8,3,8,-12,9],[8,3,8,-11,9],[8,3,8,-10,9],[9,1,10],[9,2,-26,9],[10,1,11],[10,3,10,-27,11],[11,1,12],[11,1,13],[11,3,13,-28,14],[11,3,13,-4,14],[13,1,15],[13,2,13,16],[15,1,17],[15,3,-29,2,-30],[15,1,-15],[15,1,-16],[15,1,18],[18,3,-13,-29,-30],[18,4,-13,-29,19,-30],[19,1,20],[19,3,20,-31,19],[20,1,2],[12,1,14],[12,1,21],[21,1,-28],[21,2,-28,14],[21,1,22],[14,1,23],[14,3,14,-28,23],[14,1,24],[23,2,25,26],[23,1,26],[23,3,25,26,27],[23,2,26,27],[23,1,28],[27,1,16],[27,2,16,27],[25,2,-14,-3],[25,1,-32],[26,1,29],[26,3,-20,-29,-30],[26,4,-21,-29,-15,-30],[16,3,-33,30,-34],[30,1,2],[22,2,-4,14],[24,3,14,-4,23],[28,1,-35],[28,1,-2],[17,2,-36,-18],[29,1,-17],[29,1,-19],[29,1,-18]],A.DOUBLEDOT=2,A.DOUBLECOLON=3,A.DOUBLESLASH=4,A.NOTEQUAL=5,A.LESSTHANOREQUAL=6,A.GREATERTHANOREQUAL=7,A.AND=8,A.OR=9,A.MOD=10,A.DIV=11,A.MULTIPLYOPERATOR=12,A.FUNCTIONNAME=13,A.AXISNAME=14,A.LITERAL=15,A.NUMBER=16,A.ASTERISKNAMETEST=17,A.QNAME=18,A.NCNAMECOLONASTERISK=19,A.NODETYPE=20,A.PROCESSINGINSTRUCTIONWITHLITERAL=21,A.EQUALS=22,A.LESSTHAN=23,A.GREATERTHAN=24,A.PLUS=25,A.MINUS=26,A.BAR=27,A.SLASH=28,A.LEFTPARENTHESIS=29,A.RIGHTPARENTHESIS=30,A.COMMA=31,A.AT=32,A.LEFTBRACKET=33,A.RIGHTBRACKET=34,A.DOT=35,A.DOLLAR=36,A.prototype.tokenize=function(t){for(var u=[],m=[],w=t+"\0",v=0,D=w.charAt(v++);;){for(;D==" "||D==" "||D=="\r"||D==`
10
+ `;)D=w.charAt(v++);if(D=="\0"||v>=w.length)break;if(D=="("){u.push(A.LEFTPARENTHESIS),m.push(D),D=w.charAt(v++);continue}if(D==")"){u.push(A.RIGHTPARENTHESIS),m.push(D),D=w.charAt(v++);continue}if(D=="["){u.push(A.LEFTBRACKET),m.push(D),D=w.charAt(v++);continue}if(D=="]"){u.push(A.RIGHTBRACKET),m.push(D),D=w.charAt(v++);continue}if(D=="@"){u.push(A.AT),m.push(D),D=w.charAt(v++);continue}if(D==","){u.push(A.COMMA),m.push(D),D=w.charAt(v++);continue}if(D=="|"){u.push(A.BAR),m.push(D),D=w.charAt(v++);continue}if(D=="+"){u.push(A.PLUS),m.push(D),D=w.charAt(v++);continue}if(D=="-"){u.push(A.MINUS),m.push(D),D=w.charAt(v++);continue}if(D=="="){u.push(A.EQUALS),m.push(D),D=w.charAt(v++);continue}if(D=="$"){u.push(A.DOLLAR),m.push(D),D=w.charAt(v++);continue}if(D=="."){if(D=w.charAt(v++),D=="."){u.push(A.DOUBLEDOT),m.push(".."),D=w.charAt(v++);continue}if(D>="0"&&D<="9"){var K="."+D;for(D=w.charAt(v++);D>="0"&&D<="9";)K+=D,D=w.charAt(v++);u.push(A.NUMBER),m.push(K);continue}u.push(A.DOT),m.push(".");continue}if(D=="'"||D=='"'){for(var a=D,f="";v<w.length&&(D=w.charAt(v))!==a;)f+=D,v+=1;if(D!==a)throw ft.fromMessage("Unterminated string literal: "+a+f);v+=1,u.push(A.LITERAL),m.push(f),D=w.charAt(v++);continue}if(D>="0"&&D<="9"){var K=D;for(D=w.charAt(v++);D>="0"&&D<="9";)K+=D,D=w.charAt(v++);if(D=="."&&w.charAt(v)>="0"&&w.charAt(v)<="9")for(K+=D,K+=w.charAt(v++),D=w.charAt(v++);D>="0"&&D<="9";)K+=D,D=w.charAt(v++);u.push(A.NUMBER),m.push(K);continue}if(D=="*"){if(u.length>0){var g=u[u.length-1];if(g!=A.AT&&g!=A.DOUBLECOLON&&g!=A.LEFTPARENTHESIS&&g!=A.LEFTBRACKET&&g!=A.AND&&g!=A.OR&&g!=A.MOD&&g!=A.DIV&&g!=A.MULTIPLYOPERATOR&&g!=A.SLASH&&g!=A.DOUBLESLASH&&g!=A.BAR&&g!=A.PLUS&&g!=A.MINUS&&g!=A.EQUALS&&g!=A.NOTEQUAL&&g!=A.LESSTHAN&&g!=A.LESSTHANOREQUAL&&g!=A.GREATERTHAN&&g!=A.GREATERTHANOREQUAL){u.push(A.MULTIPLYOPERATOR),m.push(D),D=w.charAt(v++);continue}}u.push(A.ASTERISKNAMETEST),m.push(D),D=w.charAt(v++);continue}if(D==":"&&w.charAt(v)==":"){u.push(A.DOUBLECOLON),m.push("::"),v++,D=w.charAt(v++);continue}if(D=="/"){if(D=w.charAt(v++),D=="/"){u.push(A.DOUBLESLASH),m.push("//"),D=w.charAt(v++);continue}u.push(A.SLASH),m.push("/");continue}if(D=="!"&&w.charAt(v)=="="){u.push(A.NOTEQUAL),m.push("!="),v++,D=w.charAt(v++);continue}if(D=="<"){if(w.charAt(v)=="="){u.push(A.LESSTHANOREQUAL),m.push("<="),v++,D=w.charAt(v++);continue}u.push(A.LESSTHAN),m.push("<"),D=w.charAt(v++);continue}if(D==">"){if(w.charAt(v)=="="){u.push(A.GREATERTHANOREQUAL),m.push(">="),v++,D=w.charAt(v++);continue}u.push(A.GREATERTHAN),m.push(">"),D=w.charAt(v++);continue}if(D=="_"||Z.isLetter(D.charCodeAt(0))){var N=D;for(D=w.charAt(v++);Z.isNCNameChar(D.charCodeAt(0));)N+=D,D=w.charAt(v++);if(u.length>0){var g=u[u.length-1];if(g!=A.AT&&g!=A.DOUBLECOLON&&g!=A.LEFTPARENTHESIS&&g!=A.LEFTBRACKET&&g!=A.AND&&g!=A.OR&&g!=A.MOD&&g!=A.DIV&&g!=A.MULTIPLYOPERATOR&&g!=A.SLASH&&g!=A.DOUBLESLASH&&g!=A.BAR&&g!=A.PLUS&&g!=A.MINUS&&g!=A.EQUALS&&g!=A.NOTEQUAL&&g!=A.LESSTHAN&&g!=A.LESSTHANOREQUAL&&g!=A.GREATERTHAN&&g!=A.GREATERTHANOREQUAL){if(N=="and"){u.push(A.AND),m.push(N);continue}if(N=="or"){u.push(A.OR),m.push(N);continue}if(N=="mod"){u.push(A.MOD),m.push(N);continue}if(N=="div"){u.push(A.DIV),m.push(N);continue}}}if(D==":"){if(w.charAt(v)=="*"){u.push(A.NCNAMECOLONASTERISK),m.push(N+":*"),v++,D=w.charAt(v++);continue}if(w.charAt(v)=="_"||Z.isLetter(w.charCodeAt(v))){for(N+=":",D=w.charAt(v++);Z.isNCNameChar(D.charCodeAt(0));)N+=D,D=w.charAt(v++);if(D=="("){u.push(A.FUNCTIONNAME),m.push(N);continue}u.push(A.QNAME),m.push(N);continue}if(w.charAt(v)==":"){u.push(A.AXISNAME),m.push(N);continue}}if(D=="("){if(N=="comment"||N=="text"||N=="node"){u.push(A.NODETYPE),m.push(N);continue}if(N=="processing-instruction"){w.charAt(v)==")"?u.push(A.NODETYPE):u.push(A.PROCESSINGINSTRUCTIONWITHLITERAL),m.push(N);continue}u.push(A.FUNCTIONNAME),m.push(N);continue}u.push(A.QNAME),m.push(N);continue}throw new Error("Unexpected character "+D)}return u.push(1),m.push("[EOF]"),[u,m]},A.SHIFT="s",A.REDUCE="r",A.ACCEPT="a",A.prototype.parse=function(f){if(!f)throw new Error("XPath expression unspecified.");if(typeof f!="string")throw new Error("XPath expression must be a string.");var u,m,w=this.tokenize(f);if(w!=null){u=w[0],m=w[1];var v=0,D=[],K=[],a=[],f,g,N;for(D.push(0),K.push(1),a.push("_S"),g=u[v],N=m[v++];;)switch(f=D[D.length-1],A.actionTable[f].charAt(g-1)){case A.SHIFT:K.push(-g),a.push(N),D.push(A.actionTableNumber[f].charCodeAt(g-1)-32),g=u[v],N=m[v++];break;case A.REDUCE:for(var O=A.productions[A.actionTableNumber[f].charCodeAt(g-1)-32][1],H=[],ce=0;ce<O;ce++)K.pop(),H.unshift(a.pop()),D.pop();var Re=D[D.length-1];K.push(A.productions[A.actionTableNumber[f].charCodeAt(g-1)-32][0]),this.reduceActions[A.actionTableNumber[f].charCodeAt(g-1)-32]==null?a.push(H[0]):a.push(this.reduceActions[A.actionTableNumber[f].charCodeAt(g-1)-32](H)),D.push(A.gotoTable[Re].charCodeAt(A.productions[A.actionTableNumber[f].charCodeAt(g-1)-32][0]-2)-33);break;case A.ACCEPT:return new G(a.pop());default:throw new Error("XPath parse error")}}},G.prototype=new Object,G.prototype.constructor=G,G.superclass=Object.prototype;function G(t){this.expression=t}G.prototype.toString=function(){return this.expression.toString()};function ee(t,u,m){u in t||(t[u]=m)}G.prototype.evaluate=function(t){var u=t.expressionContextNode;if(!(o(u)||l(u)))throw new Error("Context node does not appear to be a valid DOM node.");return t.contextNode=t.expressionContextNode,t.contextSize=1,t.contextPosition=1,t.isHtml&&(ee(t,"caseInsensitive",!0),ee(t,"allowAnyNamespaceForNoPrefix",!0)),ee(t,"caseInsensitive",!1),this.expression.evaluate(t)},G.XML_NAMESPACE_URI="http://www.w3.org/XML/1998/namespace",G.XMLNS_NAMESPACE_URI="http://www.w3.org/2000/xmlns/",pe.prototype=new Object,pe.prototype.constructor=pe,pe.superclass=Object.prototype;function pe(){}pe.prototype.init=function(){},pe.prototype.toString=function(){return"<Expression>"},pe.prototype.evaluate=function(t){throw new Error("Could not evaluate expression.")},Ae.prototype=new pe,Ae.prototype.constructor=Ae,Ae.superclass=pe.prototype;function Ae(t){arguments.length>0&&this.init(t)}Ae.prototype.init=function(t){this.rhs=t},we.prototype=new Ae,we.prototype.constructor=we,we.superclass=Ae.prototype;function we(t){arguments.length>0&&this.init(t)}we.prototype.init=function(t){we.superclass.init.call(this,t)},we.prototype.evaluate=function(t){return this.rhs.evaluate(t).number().negate()},we.prototype.toString=function(){return"-"+this.rhs.toString()},te.prototype=new pe,te.prototype.constructor=te,te.superclass=pe.prototype;function te(t,u){arguments.length>0&&this.init(t,u)}te.prototype.init=function(t,u){this.lhs=t,this.rhs=u},De.prototype=new te,De.prototype.constructor=De,De.superclass=te.prototype;function De(t,u){arguments.length>0&&this.init(t,u)}De.prototype.init=function(t,u){De.superclass.init.call(this,t,u)},De.prototype.toString=function(){return"("+this.lhs.toString()+" or "+this.rhs.toString()+")"},De.prototype.evaluate=function(t){var u=this.lhs.evaluate(t).bool();return u.booleanValue()?u:this.rhs.evaluate(t).bool()},B.prototype=new te,B.prototype.constructor=B,B.superclass=te.prototype;function B(t,u){arguments.length>0&&this.init(t,u)}B.prototype.init=function(t,u){B.superclass.init.call(this,t,u)},B.prototype.toString=function(){return"("+this.lhs.toString()+" and "+this.rhs.toString()+")"},B.prototype.evaluate=function(t){var u=this.lhs.evaluate(t).bool();return u.booleanValue()?this.rhs.evaluate(t).bool():u},I.prototype=new te,I.prototype.constructor=I,I.superclass=te.prototype;function I(t,u){arguments.length>0&&this.init(t,u)}I.prototype.init=function(t,u){I.superclass.init.call(this,t,u)},I.prototype.toString=function(){return"("+this.lhs.toString()+" = "+this.rhs.toString()+")"},I.prototype.evaluate=function(t){return this.lhs.evaluate(t).equals(this.rhs.evaluate(t))},M.prototype=new te,M.prototype.constructor=M,M.superclass=te.prototype;function M(t,u){arguments.length>0&&this.init(t,u)}M.prototype.init=function(t,u){M.superclass.init.call(this,t,u)},M.prototype.toString=function(){return"("+this.lhs.toString()+" != "+this.rhs.toString()+")"},M.prototype.evaluate=function(t){return this.lhs.evaluate(t).notequal(this.rhs.evaluate(t))},U.prototype=new te,U.prototype.constructor=U,U.superclass=te.prototype;function U(t,u){arguments.length>0&&this.init(t,u)}U.prototype.init=function(t,u){U.superclass.init.call(this,t,u)},U.prototype.evaluate=function(t){return this.lhs.evaluate(t).lessthan(this.rhs.evaluate(t))},U.prototype.toString=function(){return"("+this.lhs.toString()+" < "+this.rhs.toString()+")"},X.prototype=new te,X.prototype.constructor=X,X.superclass=te.prototype;function X(t,u){arguments.length>0&&this.init(t,u)}X.prototype.init=function(t,u){X.superclass.init.call(this,t,u)},X.prototype.evaluate=function(t){return this.lhs.evaluate(t).greaterthan(this.rhs.evaluate(t))},X.prototype.toString=function(){return"("+this.lhs.toString()+" > "+this.rhs.toString()+")"},F.prototype=new te,F.prototype.constructor=F,F.superclass=te.prototype;function F(t,u){arguments.length>0&&this.init(t,u)}F.prototype.init=function(t,u){F.superclass.init.call(this,t,u)},F.prototype.evaluate=function(t){return this.lhs.evaluate(t).lessthanorequal(this.rhs.evaluate(t))},F.prototype.toString=function(){return"("+this.lhs.toString()+" <= "+this.rhs.toString()+")"},re.prototype=new te,re.prototype.constructor=re,re.superclass=te.prototype;function re(t,u){arguments.length>0&&this.init(t,u)}re.prototype.init=function(t,u){re.superclass.init.call(this,t,u)},re.prototype.evaluate=function(t){return this.lhs.evaluate(t).greaterthanorequal(this.rhs.evaluate(t))},re.prototype.toString=function(){return"("+this.lhs.toString()+" >= "+this.rhs.toString()+")"},Q.prototype=new te,Q.prototype.constructor=Q,Q.superclass=te.prototype;function Q(t,u){arguments.length>0&&this.init(t,u)}Q.prototype.init=function(t,u){Q.superclass.init.call(this,t,u)},Q.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().plus(this.rhs.evaluate(t).number())},Q.prototype.toString=function(){return"("+this.lhs.toString()+" + "+this.rhs.toString()+")"},$.prototype=new te,$.prototype.constructor=$,$.superclass=te.prototype;function $(t,u){arguments.length>0&&this.init(t,u)}$.prototype.init=function(t,u){$.superclass.init.call(this,t,u)},$.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().minus(this.rhs.evaluate(t).number())},$.prototype.toString=function(){return"("+this.lhs.toString()+" - "+this.rhs.toString()+")"},j.prototype=new te,j.prototype.constructor=j,j.superclass=te.prototype;function j(t,u){arguments.length>0&&this.init(t,u)}j.prototype.init=function(t,u){j.superclass.init.call(this,t,u)},j.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().multiply(this.rhs.evaluate(t).number())},j.prototype.toString=function(){return"("+this.lhs.toString()+" * "+this.rhs.toString()+")"},V.prototype=new te,V.prototype.constructor=V,V.superclass=te.prototype;function V(t,u){arguments.length>0&&this.init(t,u)}V.prototype.init=function(t,u){V.superclass.init.call(this,t,u)},V.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().div(this.rhs.evaluate(t).number())},V.prototype.toString=function(){return"("+this.lhs.toString()+" div "+this.rhs.toString()+")"},le.prototype=new te,le.prototype.constructor=le,le.superclass=te.prototype;function le(t,u){arguments.length>0&&this.init(t,u)}le.prototype.init=function(t,u){le.superclass.init.call(this,t,u)},le.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().mod(this.rhs.evaluate(t).number())},le.prototype.toString=function(){return"("+this.lhs.toString()+" mod "+this.rhs.toString()+")"},ge.prototype=new te,ge.prototype.constructor=ge,ge.superclass=te.prototype;function ge(t,u){arguments.length>0&&this.init(t,u)}ge.prototype.init=function(t,u){ge.superclass.init.call(this,t,u)},ge.prototype.evaluate=function(t){return this.lhs.evaluate(t).nodeset().union(this.rhs.evaluate(t).nodeset())},ge.prototype.toString=function(){return b(R,[this.lhs,this.rhs]).join(" | ")},he.prototype=new pe,he.prototype.constructor=he,he.superclass=pe.prototype;function he(t,u,m){arguments.length>0&&this.init(t,u,m)}he.prototype.init=function(t,u,m){he.superclass.init.call(this),this.filter=t,this.filterPredicates=u,this.locationPath=m};function tt(t){for(;t&&t.parentNode;)t=t.parentNode;return t}var lt=function(t,u,m,w){if(t.length===0)return m;var v=u.extend({});return y(function(D,K){return v.contextSize=D.length,E(function(a,f){return v.contextNode=a,v.contextPosition=f+1,he.predicateMatches(K,v)},D)},fe(m,w),t)};he.getRoot=function(t,u){var m=u[0];if(m&&m.nodeType===C.DOCUMENT_NODE)return m;if(t.virtualRoot)return t.virtualRoot;if(!m)throw new Error("Context node not found when determining document root.");var w=m.ownerDocument;if(w)return w;for(var v=m;v.parentNode!=null;)v=v.parentNode;return v};var Ke=function(t){var u=String(t.name);return u==="xmlns"?"":u.substring(0,6)==="xmlns:"?u.substring(6,u.length):null};he.applyStep=function(t,u,m){if(!m)throw new Error("Context node not found when evaluating XPath step: "+t);var w=[];switch(u.contextNode=m,t.axis){case L.ANCESTOR:if(u.contextNode===u.virtualRoot)break;var v;for(u.contextNode.nodeType==C.ATTRIBUTE_NODE?v=he.getOwnerElement(u.contextNode):v=u.contextNode.parentNode;v!=null&&(t.nodeTest.matches(v,u)&&w.push(v),v!==u.virtualRoot);)v=v.parentNode;break;case L.ANCESTORORSELF:for(var v=u.contextNode;v!=null&&(t.nodeTest.matches(v,u)&&w.push(v),v!==u.virtualRoot);v=v.nodeType==C.ATTRIBUTE_NODE?he.getOwnerElement(v):v.parentNode);break;case L.ATTRIBUTE:var D=u.contextNode.attributes;if(D!=null)for(var K=0;K<D.length;K++){var v=D.item(K);t.nodeTest.matches(v,u)&&w.push(v)}break;case L.CHILD:for(var v=u.contextNode.firstChild;v!=null;v=v.nextSibling)t.nodeTest.matches(v,u)&&w.push(v);break;case L.DESCENDANT:for(var N=[u.contextNode.firstChild];N.length>0;)for(var v=N.pop();v!=null;)t.nodeTest.matches(v,u)&&w.push(v),v.firstChild!=null?(N.push(v.nextSibling),v=v.firstChild):v=v.nextSibling;break;case L.DESCENDANTORSELF:t.nodeTest.matches(u.contextNode,u)&&w.push(u.contextNode);for(var N=[u.contextNode.firstChild];N.length>0;)for(var v=N.pop();v!=null;)t.nodeTest.matches(v,u)&&w.push(v),v.firstChild!=null?(N.push(v.nextSibling),v=v.firstChild):v=v.nextSibling;break;case L.FOLLOWING:if(u.contextNode===u.virtualRoot)break;var N=[];u.contextNode.firstChild!=null?N.unshift(u.contextNode.firstChild):N.unshift(u.contextNode.nextSibling);for(var v=u.contextNode.parentNode;v!=null&&v.nodeType!=C.DOCUMENT_NODE&&v!==u.virtualRoot;v=v.parentNode)N.unshift(v.nextSibling);do for(var v=N.pop();v!=null;)t.nodeTest.matches(v,u)&&w.push(v),v.firstChild!=null?(N.push(v.nextSibling),v=v.firstChild):v=v.nextSibling;while(N.length>0);break;case L.FOLLOWINGSIBLING:if(u.contextNode===u.virtualRoot)break;for(var v=u.contextNode.nextSibling;v!=null;v=v.nextSibling)t.nodeTest.matches(v,u)&&w.push(v);break;case L.NAMESPACE:var a={};if(u.contextNode.nodeType==C.ELEMENT_NODE){a.xml=new Nt("xml",null,G.XML_NAMESPACE_URI,u.contextNode);for(var v=u.contextNode;v!=null&&v.nodeType==C.ELEMENT_NODE;v=v.parentNode)for(var K=0;K<v.attributes.length;K++){var f=v.attributes.item(K),g=Ke(f);g!=null&&a[g]==null&&(a[g]=new Nt(g,f,f.value,u.contextNode))}for(var g in a){var m=a[g];t.nodeTest.matches(m,u)&&w.push(m)}}break;case L.PARENT:v=null,u.contextNode!==u.virtualRoot&&(u.contextNode.nodeType==C.ATTRIBUTE_NODE?v=he.getOwnerElement(u.contextNode):v=u.contextNode.parentNode),v!=null&&t.nodeTest.matches(v,u)&&w.push(v);break;case L.PRECEDING:var N;u.virtualRoot!=null?N=[u.virtualRoot]:N=[tt(u.contextNode)];e:for(;N.length>0;)for(var v=N.pop();v!=null;){if(v==u.contextNode)break e;t.nodeTest.matches(v,u)&&w.unshift(v),v.firstChild!=null?(N.push(v.nextSibling),v=v.firstChild):v=v.nextSibling}break;case L.PRECEDINGSIBLING:if(u.contextNode===u.virtualRoot)break;for(var v=u.contextNode.previousSibling;v!=null;v=v.previousSibling)t.nodeTest.matches(v,u)&&w.push(v);break;case L.SELF:t.nodeTest.matches(u.contextNode,u)&&w.push(u.contextNode);break}return w};function de(t,u,m){return lt(t.predicates,u,he.applyStep(t,u,m),x(Qe,t.axis))}function Yt(t,u,m){return Be(b(de.bind(null,m,t),u))}he.applySteps=function(t,u,m){return y(Yt.bind(null,u),m,t)},he.prototype.applyFilter=function(t,u){if(!this.filter)return{nodes:[t.contextNode]};var m=this.filter.evaluate(t);if(!Z.instance_of(m,J)){if(this.filterPredicates!=null&&this.filterPredicates.length>0||this.locationPath!=null)throw new Error("Path expression filter must evaluate to a nodeset if predicates or location path are used");return{nonNodes:m}}return{nodes:lt(this.filterPredicates||[],u,m.toUnsortedArray(),!1)}},he.applyLocationPath=function(t,u,m){if(!t)return m;var w=t.absolute?[he.getRoot(u,m)]:m;return he.applySteps(t.steps,u,w)},he.prototype.evaluate=function(t){var u=me(new ye,t),m=this.applyFilter(t,u);if("nonNodes"in m)return m.nonNodes;var w=new J;return w.addArray(he.applyLocationPath(this.locationPath,u,m.nodes)),w},he.predicateMatches=function(t,u){var m=t.evaluate(u);return Z.instance_of(m,se)?u.contextPosition===m.numberValue():m.booleanValue()},he.predicateString=function(t){return _("[","]",t.toString())},he.predicatesString=function(t){return P("",b(he.predicateString,t))},he.prototype.toString=function(){if(this.filter!=null){var t=R(this.filter);return Z.instance_of(this.filter,ie)?_("'","'",t):this.filterPredicates!=null&&this.filterPredicates.length?_("(",")",t)+he.predicatesString(this.filterPredicates):this.locationPath!=null?t+(this.locationPath.absolute?"":"/")+R(this.locationPath):t}return R(this.locationPath)},he.getOwnerElement=function(t){if(t.ownerElement)return t.ownerElement;try{if(t.selectSingleNode)return t.selectSingleNode("..")}catch(f){}for(var u=t.nodeType==C.DOCUMENT_NODE?t:t.ownerDocument,m=u.getElementsByTagName("*"),w=0;w<m.length;w++)for(var v=m.item(w),D=v.attributes,K=0;K<D.length;K++){var a=D.item(K);if(a===t)return v}return null},rt.prototype=new Object,rt.prototype.constructor=rt,rt.superclass=Object.prototype;function rt(t,u){arguments.length>0&&this.init(t,u)}rt.prototype.init=function(t,u){this.absolute=t,this.steps=u},rt.prototype.toString=function(){return(this.absolute?"/":"")+b(R,this.steps).join("/")},L.prototype=new Object,L.prototype.constructor=L,L.superclass=Object.prototype;function L(t,u,m){arguments.length>0&&this.init(t,u,m)}L.prototype.init=function(t,u,m){this.axis=t,this.nodeTest=u,this.predicates=m},L.prototype.toString=function(){return L.STEPNAMES[this.axis]+"::"+this.nodeTest.toString()+he.predicatesString(this.predicates)},L.ANCESTOR=0,L.ANCESTORORSELF=1,L.ATTRIBUTE=2,L.CHILD=3,L.DESCENDANT=4,L.DESCENDANTORSELF=5,L.FOLLOWING=6,L.FOLLOWINGSIBLING=7,L.NAMESPACE=8,L.PARENT=9,L.PRECEDING=10,L.PRECEDINGSIBLING=11,L.SELF=12,L.STEPNAMES=y(function(t,u){return t[u[0]]=u[1],t},{},[[L.ANCESTOR,"ancestor"],[L.ANCESTORORSELF,"ancestor-or-self"],[L.ATTRIBUTE,"attribute"],[L.CHILD,"child"],[L.DESCENDANT,"descendant"],[L.DESCENDANTORSELF,"descendant-or-self"],[L.FOLLOWING,"following"],[L.FOLLOWINGSIBLING,"following-sibling"],[L.NAMESPACE,"namespace"],[L.PARENT,"parent"],[L.PRECEDING,"preceding"],[L.PRECEDINGSIBLING,"preceding-sibling"],[L.SELF,"self"]]);var Qe=[L.ANCESTOR,L.ANCESTORORSELF,L.PARENT,L.PRECEDING,L.PRECEDINGSIBLING];Y.prototype=new Object,Y.prototype.constructor=Y,Y.superclass=Object.prototype;function Y(t,u){arguments.length>0&&this.init(t,u)}Y.prototype.init=function(t,u){this.type=t,this.value=u},Y.prototype.toString=function(){return"<unknown nodetest type>"},Y.prototype.matches=function(t,u){console.warn("unknown node test type")},Y.NAMETESTANY=0,Y.NAMETESTPREFIXANY=1,Y.NAMETESTQNAME=2,Y.COMMENT=3,Y.TEXT=4,Y.PI=5,Y.NODE=6,Y.isNodeType=function(t){return function(u){return x(t,u.nodeType)}},Y.makeNodeTestType=function(t,u,m){var w=m||function(){};return w.prototype=new Y(t),w.prototype.constructor=w,me(w.prototype,u),w},Y.makeNodeTypeTest=function(t,u,m){return new(Y.makeNodeTestType(t,{matches:Y.isNodeType(u),toString:T(m)}))},Y.hasPrefix=function(t){return t.prefix||(t.nodeName||t.tagName).indexOf(":")!==-1},Y.isElementOrAttribute=Y.isNodeType([1,2]),Y.nameSpaceMatches=function(t,u,m){var w=m.namespaceURI||"";if(!t)return!w||u.allowAnyNamespaceForNoPrefix&&!Y.hasPrefix(m);var v=u.namespaceResolver.getNamespace(t,u.expressionContextNode);if(v==null)throw new Error("Cannot resolve QName "+t);return v===w},Y.localNameMatches=function(t,u,m){var w=m.localName||m.nodeName;return u.caseInsensitive?t.toLowerCase()===w.toLowerCase():t===w},Y.NameTestPrefixAny=Y.makeNodeTestType(Y.NAMETESTPREFIXANY,{matches:function(t,u){return Y.isElementOrAttribute(t)&&Y.nameSpaceMatches(this.prefix,u,t)},toString:function(){return this.prefix+":*"}},function(u){this.prefix=u}),Y.NameTestQName=Y.makeNodeTestType(Y.NAMETESTQNAME,{matches:function(t,u){return Y.isNodeType([C.ELEMENT_NODE,C.ATTRIBUTE_NODE,C.NAMESPACE_NODE])(t)&&Y.nameSpaceMatches(this.prefix,u,t)&&Y.localNameMatches(this.localName,u,t)},toString:function(){return this.name}},function(u){var m=u.split(":");this.name=u,this.prefix=m.length>1?m[0]:null,this.localName=m[m.length>1?1:0]}),Y.PITest=Y.makeNodeTestType(Y.PI,{matches:function(t,u){return Y.isNodeType([C.PROCESSING_INSTRUCTION_NODE])(t)&&(t.target||t.nodeName)===this.name},toString:function(){return _('processing-instruction("','")',this.name)}},function(t){this.name=t}),Y.nameTestAny=Y.makeNodeTypeTest(Y.NAMETESTANY,[C.ELEMENT_NODE,C.ATTRIBUTE_NODE,C.NAMESPACE_NODE],"*"),Y.textTest=Y.makeNodeTypeTest(Y.TEXT,[C.TEXT_NODE,C.CDATA_SECTION_NODE],"text()"),Y.commentTest=Y.makeNodeTypeTest(Y.COMMENT,[C.COMMENT_NODE],"comment()"),Y.nodeTest=Y.makeNodeTypeTest(Y.NODE,[C.ELEMENT_NODE,C.ATTRIBUTE_NODE,C.TEXT_NODE,C.CDATA_SECTION_NODE,C.PROCESSING_INSTRUCTION_NODE,C.COMMENT_NODE,C.DOCUMENT_NODE],"node()"),Y.anyPiTest=Y.makeNodeTypeTest(Y.PI,[C.PROCESSING_INSTRUCTION_NODE],"processing-instruction()"),Ye.prototype=new pe,Ye.prototype.constructor=Ye,Ye.superclass=pe.prototype;function Ye(t){arguments.length>0&&this.init(t)}Ye.prototype.init=function(t){this.variable=t},Ye.prototype.toString=function(){return"$"+this.variable},Ye.prototype.evaluate=function(t){var u=Z.resolveQName(this.variable,t.namespaceResolver,t.contextNode,!1);if(u[0]==null)throw new Error("Cannot resolve QName "+fn);var m=t.variableResolver.getVariable(u[1],u[0]);if(!m)throw ft.fromMessage("Undeclared variable: "+this.toString());return m},Ze.prototype=new pe,Ze.prototype.constructor=Ze,Ze.superclass=pe.prototype;function Ze(t,u){arguments.length>0&&this.init(t,u)}Ze.prototype.init=function(t,u){this.functionName=t,this.arguments=u},Ze.prototype.toString=function(){for(var t=this.functionName+"(",u=0;u<this.arguments.length;u++)u>0&&(t+=", "),t+=this.arguments[u].toString();return t+")"},Ze.prototype.evaluate=function(t){var u=Me.getFunctionFromContext(this.functionName,t);if(!u)throw new Error("Unknown function "+this.functionName);var m=[t].concat(this.arguments);return u.apply(t.functionResolver.thisArg,m)};var Oe=new Object;Oe.equals=function(t,u){return t.equals(u)},Oe.notequal=function(t,u){return t.notequal(u)},Oe.lessthan=function(t,u){return t.lessthan(u)},Oe.greaterthan=function(t,u){return t.greaterthan(u)},Oe.lessthanorequal=function(t,u){return t.lessthanorequal(u)},Oe.greaterthanorequal=function(t,u){return t.greaterthanorequal(u)},ie.prototype=new pe,ie.prototype.constructor=ie,ie.superclass=pe.prototype;function ie(t){arguments.length>0&&this.init(t)}ie.prototype.init=function(t){this.str=String(t)},ie.prototype.toString=function(){return this.str},ie.prototype.evaluate=function(t){return this},ie.prototype.string=function(){return this},ie.prototype.number=function(){return new se(this.str)},ie.prototype.bool=function(){return new z(this.str)},ie.prototype.nodeset=function(){throw new Error("Cannot convert string to nodeset")},ie.prototype.stringValue=function(){return this.str},ie.prototype.numberValue=function(){return this.number().numberValue()},ie.prototype.booleanValue=function(){return this.bool().booleanValue()},ie.prototype.equals=function(t){return Z.instance_of(t,z)?this.bool().equals(t):Z.instance_of(t,se)?this.number().equals(t):Z.instance_of(t,J)?t.compareWithString(this,Oe.equals):new z(this.str==t.str)},ie.prototype.notequal=function(t){return Z.instance_of(t,z)?this.bool().notequal(t):Z.instance_of(t,se)?this.number().notequal(t):Z.instance_of(t,J)?t.compareWithString(this,Oe.notequal):new z(this.str!=t.str)},ie.prototype.lessthan=function(t){return this.number().lessthan(t)},ie.prototype.greaterthan=function(t){return this.number().greaterthan(t)},ie.prototype.lessthanorequal=function(t){return this.number().lessthanorequal(t)},ie.prototype.greaterthanorequal=function(t){return this.number().greaterthanorequal(t)},se.prototype=new pe,se.prototype.constructor=se,se.superclass=pe.prototype;function se(t){arguments.length>0&&this.init(t)}se.prototype.init=function(t){this.num=typeof t=="string"?this.parse(t):Number(t)},se.prototype.numberFormat=/^\s*-?[0-9]*\.?[0-9]+\s*$/,se.prototype.parse=function(t){return this.numberFormat.test(t)?parseFloat(t):Number.NaN};function Pe(t){for(var u=t.split("e-"),m=u[0].replace(".",""),w=Number(u[1]),v=0;v<w-1;v+=1)m="0"+m;return"0."+m}function ct(t){for(var u=t.split("e"),m=u[0].replace(".",""),w=Number(u[1]),v=w+1-m.length,D=0;D<v;D+=1)m+="0";return m}se.prototype.toString=function(){var t=this.num.toString();return t.indexOf("e-")!==-1?Pe(t):t.indexOf("e")!==-1?ct(t):t},se.prototype.evaluate=function(t){return this},se.prototype.string=function(){return new ie(this.toString())},se.prototype.number=function(){return this},se.prototype.bool=function(){return new z(this.num)},se.prototype.nodeset=function(){throw new Error("Cannot convert number to nodeset")},se.prototype.stringValue=function(){return this.string().stringValue()},se.prototype.numberValue=function(){return this.num},se.prototype.booleanValue=function(){return this.bool().booleanValue()},se.prototype.negate=function(){return new se(-this.num)},se.prototype.equals=function(t){return Z.instance_of(t,z)?this.bool().equals(t):Z.instance_of(t,ie)?this.equals(t.number()):Z.instance_of(t,J)?t.compareWithNumber(this,Oe.equals):new z(this.num==t.num)},se.prototype.notequal=function(t){return Z.instance_of(t,z)?this.bool().notequal(t):Z.instance_of(t,ie)?this.notequal(t.number()):Z.instance_of(t,J)?t.compareWithNumber(this,Oe.notequal):new z(this.num!=t.num)},se.prototype.lessthan=function(t){return Z.instance_of(t,J)?t.compareWithNumber(this,Oe.greaterthan):Z.instance_of(t,z)||Z.instance_of(t,ie)?this.lessthan(t.number()):new z(this.num<t.num)},se.prototype.greaterthan=function(t){return Z.instance_of(t,J)?t.compareWithNumber(this,Oe.lessthan):Z.instance_of(t,z)||Z.instance_of(t,ie)?this.greaterthan(t.number()):new z(this.num>t.num)},se.prototype.lessthanorequal=function(t){return Z.instance_of(t,J)?t.compareWithNumber(this,Oe.greaterthanorequal):Z.instance_of(t,z)||Z.instance_of(t,ie)?this.lessthanorequal(t.number()):new z(this.num<=t.num)},se.prototype.greaterthanorequal=function(t){return Z.instance_of(t,J)?t.compareWithNumber(this,Oe.lessthanorequal):Z.instance_of(t,z)||Z.instance_of(t,ie)?this.greaterthanorequal(t.number()):new z(this.num>=t.num)},se.prototype.plus=function(t){return new se(this.num+t.num)},se.prototype.minus=function(t){return new se(this.num-t.num)},se.prototype.multiply=function(t){return new se(this.num*t.num)},se.prototype.div=function(t){return new se(this.num/t.num)},se.prototype.mod=function(t){return new se(this.num%t.num)},z.prototype=new pe,z.prototype.constructor=z,z.superclass=pe.prototype;function z(t){arguments.length>0&&this.init(t)}z.prototype.init=function(t){this.b=!!t},z.prototype.toString=function(){return this.b.toString()},z.prototype.evaluate=function(t){return this},z.prototype.string=function(){return new ie(this.b)},z.prototype.number=function(){return new se(this.b)},z.prototype.bool=function(){return this},z.prototype.nodeset=function(){throw new Error("Cannot convert boolean to nodeset")},z.prototype.stringValue=function(){return this.string().stringValue()},z.prototype.numberValue=function(){return this.number().numberValue()},z.prototype.booleanValue=function(){return this.b},z.prototype.not=function(){return new z(!this.b)},z.prototype.equals=function(t){return Z.instance_of(t,ie)||Z.instance_of(t,se)?this.equals(t.bool()):Z.instance_of(t,J)?t.compareWithBoolean(this,Oe.equals):new z(this.b==t.b)},z.prototype.notequal=function(t){return Z.instance_of(t,ie)||Z.instance_of(t,se)?this.notequal(t.bool()):Z.instance_of(t,J)?t.compareWithBoolean(this,Oe.notequal):new z(this.b!=t.b)},z.prototype.lessthan=function(t){return this.number().lessthan(t)},z.prototype.greaterthan=function(t){return this.number().greaterthan(t)},z.prototype.lessthanorequal=function(t){return this.number().lessthanorequal(t)},z.prototype.greaterthanorequal=function(t){return this.number().greaterthanorequal(t)},z.true_=new z(!0),z.false_=new z(!1),Ge.prototype=new Object,Ge.prototype.constructor=Ge,Ge.superclass=Object.prototype;function Ge(t){this.init(t)}Ge.prototype.init=function(t){this.left=null,this.right=null,this.node=t,this.depth=1},Ge.prototype.balance=function(){var t=this.left==null?0:this.left.depth,u=this.right==null?0:this.right.depth;if(t>u+1){var m=this.left.left==null?0:this.left.left.depth,w=this.left.right==null?0:this.left.right.depth;m<w&&this.left.rotateRR(),this.rotateLL()}else if(t+1<u){var v=this.right.right==null?0:this.right.right.depth,D=this.right.left==null?0:this.right.left.depth;D>v&&this.right.rotateLL(),this.rotateRR()}},Ge.prototype.rotateLL=function(){var t=this.node,u=this.right;this.node=this.left.node,this.right=this.left,this.left=this.left.left,this.right.left=this.right.right,this.right.right=u,this.right.node=t,this.right.updateInNewLocation(),this.updateInNewLocation()},Ge.prototype.rotateRR=function(){var t=this.node,u=this.left;this.node=this.right.node,this.left=this.right,this.right=this.right.right,this.left.right=this.left.left,this.left.left=u,this.left.node=t,this.left.updateInNewLocation(),this.updateInNewLocation()},Ge.prototype.updateInNewLocation=function(){this.getDepthFromChildren()},Ge.prototype.getDepthFromChildren=function(){this.depth=this.node==null?0:1,this.left!=null&&(this.depth=this.left.depth+1),this.right!=null&&this.depth<=this.right.depth&&(this.depth=this.right.depth+1)};function pr(t,u){if(t===u)return 0;if(t.compareDocumentPosition){var m=t.compareDocumentPosition(u);return m&1||m&10?1:m&20?-1:0}for(var w=0,v=0,D=t;D!=null;D=D.parentNode||D.ownerElement)w++;for(var K=u;K!=null;K=K.parentNode||K.ownerElement)v++;if(w>v){for(;w>v;)t=t.parentNode||t.ownerElement,w--;if(t===u)return 1}else if(v>w){for(;v>w;)u=u.parentNode||u.ownerElement,v--;if(t===u)return-1}for(var a=t.parentNode||t.ownerElement,f=u.parentNode||u.ownerElement;a!==f;)t=a,u=f,a=t.parentNode||t.ownerElement,f=u.parentNode||u.ownerElement;var g=Jt(t),N=Jt(u);if(g&&!N)return-1;if(!g&&N)return 1;if(t.isXPathNamespace){if(t.nodeValue===G.XML_NAMESPACE_URI||!u.isXPathNamespace)return-1;if(u.nodeValue===G.XML_NAMESPACE_URI)return 1}else if(u.isXPathNamespace)return 1;if(a)for(var O=g?a.attributes:a.childNodes,H=O.length,ce=t.baseNode||t,Re=u.baseNode||u,je=0;je<H;je+=1){var ae=O[je];if(ae===ce)return-1;if(ae===Re)return 1}throw new Error("Unexpected: could not determine node order")}Ge.prototype.add=function(t){if(t===this.node)return!1;var u=pr(t,this.node),m=!1;return u==-1?this.left==null?(this.left=new Ge(t),m=!0):(m=this.left.add(t),m&&this.balance()):u==1&&(this.right==null?(this.right=new Ge(t),m=!0):(m=this.right.add(t),m&&this.balance())),m&&this.getDepthFromChildren(),m},J.prototype=new pe,J.prototype.constructor=J,J.superclass=pe.prototype;function J(){this.init()}J.prototype.init=function(){this.tree=null,this.nodes=[],this.size=0},J.prototype.toString=function(){var t=this.first();return t==null?"":this.stringForNode(t)},J.prototype.evaluate=function(t){return this},J.prototype.string=function(){return new ie(this.toString())},J.prototype.stringValue=function(){return this.toString()},J.prototype.number=function(){return new se(this.string())},J.prototype.numberValue=function(){return Number(this.string())},J.prototype.bool=function(){return new z(this.booleanValue())},J.prototype.booleanValue=function(){return!!this.size},J.prototype.nodeset=function(){return this},J.prototype.stringForNode=function(t){return t.nodeType==C.DOCUMENT_NODE||t.nodeType==C.ELEMENT_NODE||t.nodeType===C.DOCUMENT_FRAGMENT_NODE?this.stringForContainerNode(t):t.nodeType===C.ATTRIBUTE_NODE?t.value||t.nodeValue:t.isNamespaceNode?t.namespace:t.nodeValue},J.prototype.stringForContainerNode=function(t){for(var u="",m=t.firstChild;m!=null;m=m.nextSibling){var w=m.nodeType;(w===1||w===3||w===4||w===9||w===11)&&(u+=this.stringForNode(m))}return u},J.prototype.buildTree=function(){if(!this.tree&&this.nodes.length){this.tree=new Ge(this.nodes[0]);for(var t=1;t<this.nodes.length;t+=1)this.tree.add(this.nodes[t])}return this.tree},J.prototype.first=function(){var t=this.buildTree();if(t==null)return null;for(;t.left!=null;)t=t.left;return t.node},J.prototype.add=function(t){for(var u=0;u<this.nodes.length;u+=1)if(t===this.nodes[u])return;this.tree=null,this.nodes.push(t),this.size+=1},J.prototype.addArray=function(t){var u=this;h(function(m){u.add(m)},t)},J.prototype.toArray=function(){var t=[];return this.toArrayRec(this.buildTree(),t),t},J.prototype.toArrayRec=function(t,u){t!=null&&(this.toArrayRec(t.left,u),u.push(t.node),this.toArrayRec(t.right,u))},J.prototype.toUnsortedArray=function(){return this.nodes.slice()},J.prototype.compareWithString=function(t,u){for(var m=this.toUnsortedArray(),w=0;w<m.length;w++){var v=m[w],D=new ie(this.stringForNode(v)),K=u(D,t);if(K.booleanValue())return K}return new z(!1)},J.prototype.compareWithNumber=function(t,u){for(var m=this.toUnsortedArray(),w=0;w<m.length;w++){var v=m[w],D=new se(this.stringForNode(v)),K=u(D,t);if(K.booleanValue())return K}return new z(!1)},J.prototype.compareWithBoolean=function(t,u){return u(this.bool(),t)},J.prototype.compareWithNodeSet=function(t,u){for(var m=this.toUnsortedArray(),w=function(a,f){return u(f,a)},v=0;v<m.length;v++){var D=new ie(this.stringForNode(m[v])),K=t.compareWithString(D,w);if(K.booleanValue())return K}return new z(!1)},J.compareWith=c(function(t,u){return Z.instance_of(u,ie)?this.compareWithString(u,t):Z.instance_of(u,se)?this.compareWithNumber(u,t):Z.instance_of(u,z)?this.compareWithBoolean(u,t):this.compareWithNodeSet(u,t)}),J.prototype.equals=J.compareWith(Oe.equals),J.prototype.notequal=J.compareWith(Oe.notequal),J.prototype.lessthan=J.compareWith(Oe.lessthan),J.prototype.greaterthan=J.compareWith(Oe.greaterthan),J.prototype.lessthanorequal=J.compareWith(Oe.lessthanorequal),J.prototype.greaterthanorequal=J.compareWith(Oe.greaterthanorequal),J.prototype.union=function(t){var u=new J;return u.addArray(this.toUnsortedArray()),u.addArray(t.toUnsortedArray()),u},Nt.prototype=new Object,Nt.prototype.constructor=Nt,Nt.superclass=Object.prototype;function Nt(t,u,m,w){this.isXPathNamespace=!0,this.baseNode=u,this.ownerDocument=w.ownerDocument,this.nodeName=t,this.prefix=t,this.localName=t,this.namespaceURI=null,this.nodeValue=m,this.ownerElement=w,this.nodeType=C.NAMESPACE_NODE}Nt.prototype.toString=function(){return'{ "'+this.prefix+'", "'+this.namespaceURI+'" }'},ye.prototype=new Object,ye.prototype.constructor=ye,ye.superclass=Object.prototype;function ye(t,u,m){this.variableResolver=t!=null?t:new Fe,this.namespaceResolver=u!=null?u:new Ue,this.functionResolver=m!=null?m:new Me}ye.prototype.extend=function(t){return me(new ye,this,t)},Fe.prototype=new Object,Fe.prototype.constructor=Fe,Fe.superclass=Object.prototype;function Fe(){}Fe.prototype.getVariable=function(t,u){return null},Me.prototype=new Object,Me.prototype.constructor=Me,Me.superclass=Object.prototype;function Me(t){this.thisArg=t!=null?t:ue,this.functions=new Object,this.addStandardFunctions()}Me.prototype.addStandardFunctions=function(){this.functions["{}last"]=ue.last,this.functions["{}position"]=ue.position,this.functions["{}count"]=ue.count,this.functions["{}id"]=ue.id,this.functions["{}local-name"]=ue.localName,this.functions["{}namespace-uri"]=ue.namespaceURI,this.functions["{}name"]=ue.name,this.functions["{}string"]=ue.string,this.functions["{}concat"]=ue.concat,this.functions["{}starts-with"]=ue.startsWith,this.functions["{}contains"]=ue.contains,this.functions["{}substring-before"]=ue.substringBefore,this.functions["{}substring-after"]=ue.substringAfter,this.functions["{}substring"]=ue.substring,this.functions["{}string-length"]=ue.stringLength,this.functions["{}normalize-space"]=ue.normalizeSpace,this.functions["{}translate"]=ue.translate,this.functions["{}boolean"]=ue.boolean_,this.functions["{}not"]=ue.not,this.functions["{}true"]=ue.true_,this.functions["{}false"]=ue.false_,this.functions["{}lang"]=ue.lang,this.functions["{}number"]=ue.number,this.functions["{}sum"]=ue.sum,this.functions["{}floor"]=ue.floor,this.functions["{}ceiling"]=ue.ceiling,this.functions["{}round"]=ue.round},Me.prototype.addFunction=function(t,u,m){this.functions["{"+t+"}"+u]=m},Me.getFunctionFromContext=function(t,u){var m=Z.resolveQName(t,u.namespaceResolver,u.contextNode,!1);if(m[0]===null)throw new Error("Cannot resolve QName "+name);return u.functionResolver.getFunction(m[1],m[0])},Me.prototype.getFunction=function(t,u){return this.functions["{"+u+"}"+t]},Ue.prototype=new Object,Ue.prototype.constructor=Ue,Ue.superclass=Object.prototype;function Ue(){}Ue.prototype.getNamespace=function(t,u){if(t=="xml")return G.XML_NAMESPACE_URI;if(t=="xmlns")return G.XMLNS_NAMESPACE_URI;for(u.nodeType==C.DOCUMENT_NODE?u=u.documentElement:u.nodeType==C.ATTRIBUTE_NODE?u=he.getOwnerElement(u):u.nodeType!=C.ELEMENT_NODE&&(u=u.parentNode);u!=null&&u.nodeType==C.ELEMENT_NODE;){for(var m=u.attributes,w=0;w<m.length;w++){var v=m.item(w),D=v.name||v.nodeName;if(D==="xmlns"&&t===""||D==="xmlns:"+t)return String(v.value||v.nodeValue)}u=u.parentNode}return null};var ue=new Object;ue.last=function(t){if(arguments.length!=1)throw new Error("Function last expects ()");return new se(t.contextSize)},ue.position=function(t){if(arguments.length!=1)throw new Error("Function position expects ()");return new se(t.contextPosition)},ue.count=function(){var t=arguments[0],u;if(arguments.length!=2||!Z.instance_of(u=arguments[1].evaluate(t),J))throw new Error("Function count expects (node-set)");return new se(u.size)},ue.id=function(){var t=arguments[0],u;if(arguments.length!=2)throw new Error("Function id expects (object)");u=arguments[1].evaluate(t),Z.instance_of(u,J)?u=u.toArray().join(" "):u=u.stringValue();for(var m=u.split(/[\x0d\x0a\x09\x20]+/),w=new J,v=t.contextNode.nodeType==C.DOCUMENT_NODE?t.contextNode:t.contextNode.ownerDocument,D=0;D<m.length;D++){var K;v.getElementById?K=v.getElementById(m[D]):K=Z.getElementById(v,m[D]),K!=null&&w.add(K)}return w},ue.localName=function(t,u){var m;if(arguments.length==1)m=t.contextNode;else if(arguments.length==2)m=u.evaluate(t).first();else throw new Error("Function local-name expects (node-set?)");return m==null?new ie(""):new ie(m.localName||m.baseName||m.target||m.nodeName||"")},ue.namespaceURI=function(){var t=arguments[0],u;if(arguments.length==1)u=t.contextNode;else if(arguments.length==2)u=arguments[1].evaluate(t).first();else throw new Error("Function namespace-uri expects (node-set?)");return u==null?new ie(""):new ie(u.namespaceURI||"")},ue.name=function(){var t=arguments[0],u;if(arguments.length==1)u=t.contextNode;else if(arguments.length==2)u=arguments[1].evaluate(t).first();else throw new Error("Function name expects (node-set?)");return u==null?new ie(""):u.nodeType==C.ELEMENT_NODE?new ie(u.nodeName):u.nodeType==C.ATTRIBUTE_NODE?new ie(u.name||u.nodeName):u.nodeType===C.PROCESSING_INSTRUCTION_NODE?new ie(u.target||u.nodeName):u.localName==null?new ie(""):new ie(u.localName)},ue.string=function(){var t=arguments[0];if(arguments.length==1)return new ie(J.prototype.stringForNode(t.contextNode));if(arguments.length==2)return arguments[1].evaluate(t).string();throw new Error("Function string expects (object?)")},ue.concat=function(t){if(arguments.length<3)throw new Error("Function concat expects (string, string[, string]*)");for(var u="",m=1;m<arguments.length;m++)u+=arguments[m].evaluate(t).stringValue();return new ie(u)},ue.startsWith=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function startsWith expects (string, string)");var u=arguments[1].evaluate(t).stringValue(),m=arguments[2].evaluate(t).stringValue();return new z(u.substring(0,m.length)==m)},ue.contains=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function contains expects (string, string)");var u=arguments[1].evaluate(t).stringValue(),m=arguments[2].evaluate(t).stringValue();return new z(u.indexOf(m)!==-1)},ue.substringBefore=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function substring-before expects (string, string)");var u=arguments[1].evaluate(t).stringValue(),m=arguments[2].evaluate(t).stringValue();return new ie(u.substring(0,u.indexOf(m)))},ue.substringAfter=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function substring-after expects (string, string)");var u=arguments[1].evaluate(t).stringValue(),m=arguments[2].evaluate(t).stringValue();if(m.length==0)return new ie(u);var w=u.indexOf(m);return w==-1?new ie(""):new ie(u.substring(w+m.length))},ue.substring=function(){var t=arguments[0];if(!(arguments.length==3||arguments.length==4))throw new Error("Function substring expects (string, number, number?)");var u=arguments[1].evaluate(t).stringValue(),m=Math.round(arguments[2].evaluate(t).numberValue())-1,w=arguments.length==4?m+Math.round(arguments[3].evaluate(t).numberValue()):void 0;return new ie(u.substring(m,w))},ue.stringLength=function(){var t=arguments[0],u;if(arguments.length==1)u=J.prototype.stringForNode(t.contextNode);else if(arguments.length==2)u=arguments[1].evaluate(t).stringValue();else throw new Error("Function string-length expects (string?)");return new se(u.length)},ue.normalizeSpace=function(){var t=arguments[0],u;if(arguments.length==1)u=J.prototype.stringForNode(t.contextNode);else if(arguments.length==2)u=arguments[1].evaluate(t).stringValue();else throw new Error("Function normalize-space expects (string?)");for(var m=0,w=u.length-1;Z.isSpace(u.charCodeAt(w));)w--;for(var v="";m<=w&&Z.isSpace(u.charCodeAt(m));)m++;for(;m<=w;)if(Z.isSpace(u.charCodeAt(m)))for(v+=" ";m<=w&&Z.isSpace(u.charCodeAt(m));)m++;else v+=u.charAt(m),m++;return new ie(v)},ue.translate=function(t,u,m,w){if(arguments.length!=4)throw new Error("Function translate expects (string, string, string)");var v=u.evaluate(t).stringValue(),D=m.evaluate(t).stringValue(),K=w.evaluate(t).stringValue(),a=y(function(g,N,O){return N in g||(g[N]=O>K.length?"":K[O]),g},{},D),f=P("",b(function(g){return g in a?a[g]:g},v));return new ie(f)},ue.boolean_=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function boolean expects (object)");return arguments[1].evaluate(t).bool()},ue.not=function(t,u){if(arguments.length!=2)throw new Error("Function not expects (object)");return u.evaluate(t).bool().not()},ue.true_=function(){if(arguments.length!=1)throw new Error("Function true expects ()");return z.true_},ue.false_=function(){if(arguments.length!=1)throw new Error("Function false expects ()");return z.false_},ue.lang=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function lang expects (string)");for(var u,m=t.contextNode;m!=null&&m.nodeType!=C.DOCUMENT_NODE;m=m.parentNode){var w=m.getAttributeNS(G.XML_NAMESPACE_URI,"lang");if(w!=null){u=String(w);break}}if(u==null)return z.false_;var v=arguments[1].evaluate(t).stringValue();return new z(u.substring(0,v.length)==v&&(u.length==v.length||u.charAt(v.length)=="-"))},ue.number=function(){var t=arguments[0];if(!(arguments.length==1||arguments.length==2))throw new Error("Function number expects (object?)");return arguments.length==1?new se(J.prototype.stringForNode(t.contextNode)):arguments[1].evaluate(t).number()},ue.sum=function(){var t=arguments[0],u;if(arguments.length!=2||!Z.instance_of(u=arguments[1].evaluate(t),J))throw new Error("Function sum expects (node-set)");u=u.toUnsortedArray();for(var m=0,w=0;w<u.length;w++)m+=new se(J.prototype.stringForNode(u[w])).numberValue();return new se(m)},ue.floor=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function floor expects (number)");return new se(Math.floor(arguments[1].evaluate(t).numberValue()))},ue.ceiling=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function ceiling expects (number)");return new se(Math.ceil(arguments[1].evaluate(t).numberValue()))},ue.round=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function round expects (number)");return new se(Math.round(arguments[1].evaluate(t).numberValue()))};var Z=new Object,Jt=function(t){return t&&(t.nodeType===C.ATTRIBUTE_NODE||t.ownerElement||t.isXPathNamespace)};Z.splitQName=function(t){var u=t.indexOf(":");return u==-1?[null,t]:[t.substring(0,u),t.substring(u+1)]},Z.resolveQName=function(t,u,m,w){var v=Z.splitQName(t);return v[0]!=null?v[0]=u.getNamespace(v[0],m):w?(v[0]=u.getNamespace("",m),v[0]==null&&(v[0]="")):v[0]="",v},Z.isSpace=function(t){return t==9||t==13||t==10||t==32},Z.isLetter=function(t){return t>=65&&t<=90||t>=97&&t<=122||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=255||t>=256&&t<=305||t>=308&&t<=318||t>=321&&t<=328||t>=330&&t<=382||t>=384&&t<=451||t>=461&&t<=496||t>=500&&t<=501||t>=506&&t<=535||t>=592&&t<=680||t>=699&&t<=705||t==902||t>=904&&t<=906||t==908||t>=910&&t<=929||t>=931&&t<=974||t>=976&&t<=982||t==986||t==988||t==990||t==992||t>=994&&t<=1011||t>=1025&&t<=1036||t>=1038&&t<=1103||t>=1105&&t<=1116||t>=1118&&t<=1153||t>=1168&&t<=1220||t>=1223&&t<=1224||t>=1227&&t<=1228||t>=1232&&t<=1259||t>=1262&&t<=1269||t>=1272&&t<=1273||t>=1329&&t<=1366||t==1369||t>=1377&&t<=1414||t>=1488&&t<=1514||t>=1520&&t<=1522||t>=1569&&t<=1594||t>=1601&&t<=1610||t>=1649&&t<=1719||t>=1722&&t<=1726||t>=1728&&t<=1742||t>=1744&&t<=1747||t==1749||t>=1765&&t<=1766||t>=2309&&t<=2361||t==2365||t>=2392&&t<=2401||t>=2437&&t<=2444||t>=2447&&t<=2448||t>=2451&&t<=2472||t>=2474&&t<=2480||t==2482||t>=2486&&t<=2489||t>=2524&&t<=2525||t>=2527&&t<=2529||t>=2544&&t<=2545||t>=2565&&t<=2570||t>=2575&&t<=2576||t>=2579&&t<=2600||t>=2602&&t<=2608||t>=2610&&t<=2611||t>=2613&&t<=2614||t>=2616&&t<=2617||t>=2649&&t<=2652||t==2654||t>=2674&&t<=2676||t>=2693&&t<=2699||t==2701||t>=2703&&t<=2705||t>=2707&&t<=2728||t>=2730&&t<=2736||t>=2738&&t<=2739||t>=2741&&t<=2745||t==2749||t==2784||t>=2821&&t<=2828||t>=2831&&t<=2832||t>=2835&&t<=2856||t>=2858&&t<=2864||t>=2866&&t<=2867||t>=2870&&t<=2873||t==2877||t>=2908&&t<=2909||t>=2911&&t<=2913||t>=2949&&t<=2954||t>=2958&&t<=2960||t>=2962&&t<=2965||t>=2969&&t<=2970||t==2972||t>=2974&&t<=2975||t>=2979&&t<=2980||t>=2984&&t<=2986||t>=2990&&t<=2997||t>=2999&&t<=3001||t>=3077&&t<=3084||t>=3086&&t<=3088||t>=3090&&t<=3112||t>=3114&&t<=3123||t>=3125&&t<=3129||t>=3168&&t<=3169||t>=3205&&t<=3212||t>=3214&&t<=3216||t>=3218&&t<=3240||t>=3242&&t<=3251||t>=3253&&t<=3257||t==3294||t>=3296&&t<=3297||t>=3333&&t<=3340||t>=3342&&t<=3344||t>=3346&&t<=3368||t>=3370&&t<=3385||t>=3424&&t<=3425||t>=3585&&t<=3630||t==3632||t>=3634&&t<=3635||t>=3648&&t<=3653||t>=3713&&t<=3714||t==3716||t>=3719&&t<=3720||t==3722||t==3725||t>=3732&&t<=3735||t>=3737&&t<=3743||t>=3745&&t<=3747||t==3749||t==3751||t>=3754&&t<=3755||t>=3757&&t<=3758||t==3760||t>=3762&&t<=3763||t==3773||t>=3776&&t<=3780||t>=3904&&t<=3911||t>=3913&&t<=3945||t>=4256&&t<=4293||t>=4304&&t<=4342||t==4352||t>=4354&&t<=4355||t>=4357&&t<=4359||t==4361||t>=4363&&t<=4364||t>=4366&&t<=4370||t==4412||t==4414||t==4416||t==4428||t==4430||t==4432||t>=4436&&t<=4437||t==4441||t>=4447&&t<=4449||t==4451||t==4453||t==4455||t==4457||t>=4461&&t<=4462||t>=4466&&t<=4467||t==4469||t==4510||t==4520||t==4523||t>=4526&&t<=4527||t>=4535&&t<=4536||t==4538||t>=4540&&t<=4546||t==4587||t==4592||t==4601||t>=7680&&t<=7835||t>=7840&&t<=7929||t>=7936&&t<=7957||t>=7960&&t<=7965||t>=7968&&t<=8005||t>=8008&&t<=8013||t>=8016&&t<=8023||t==8025||t==8027||t==8029||t>=8031&&t<=8061||t>=8064&&t<=8116||t>=8118&&t<=8124||t==8126||t>=8130&&t<=8132||t>=8134&&t<=8140||t>=8144&&t<=8147||t>=8150&&t<=8155||t>=8160&&t<=8172||t>=8178&&t<=8180||t>=8182&&t<=8188||t==8486||t>=8490&&t<=8491||t==8494||t>=8576&&t<=8578||t>=12353&&t<=12436||t>=12449&&t<=12538||t>=12549&&t<=12588||t>=44032&&t<=55203||t>=19968&&t<=40869||t==12295||t>=12321&&t<=12329},Z.isNCNameChar=function(t){return t>=48&&t<=57||t>=1632&&t<=1641||t>=1776&&t<=1785||t>=2406&&t<=2415||t>=2534&&t<=2543||t>=2662&&t<=2671||t>=2790&&t<=2799||t>=2918&&t<=2927||t>=3047&&t<=3055||t>=3174&&t<=3183||t>=3302&&t<=3311||t>=3430&&t<=3439||t>=3664&&t<=3673||t>=3792&&t<=3801||t>=3872&&t<=3881||t==46||t==45||t==95||Z.isLetter(t)||t>=768&&t<=837||t>=864&&t<=865||t>=1155&&t<=1158||t>=1425&&t<=1441||t>=1443&&t<=1465||t>=1467&&t<=1469||t==1471||t>=1473&&t<=1474||t==1476||t>=1611&&t<=1618||t==1648||t>=1750&&t<=1756||t>=1757&&t<=1759||t>=1760&&t<=1764||t>=1767&&t<=1768||t>=1770&&t<=1773||t>=2305&&t<=2307||t==2364||t>=2366&&t<=2380||t==2381||t>=2385&&t<=2388||t>=2402&&t<=2403||t>=2433&&t<=2435||t==2492||t==2494||t==2495||t>=2496&&t<=2500||t>=2503&&t<=2504||t>=2507&&t<=2509||t==2519||t>=2530&&t<=2531||t==2562||t==2620||t==2622||t==2623||t>=2624&&t<=2626||t>=2631&&t<=2632||t>=2635&&t<=2637||t>=2672&&t<=2673||t>=2689&&t<=2691||t==2748||t>=2750&&t<=2757||t>=2759&&t<=2761||t>=2763&&t<=2765||t>=2817&&t<=2819||t==2876||t>=2878&&t<=2883||t>=2887&&t<=2888||t>=2891&&t<=2893||t>=2902&&t<=2903||t>=2946&&t<=2947||t>=3006&&t<=3010||t>=3014&&t<=3016||t>=3018&&t<=3021||t==3031||t>=3073&&t<=3075||t>=3134&&t<=3140||t>=3142&&t<=3144||t>=3146&&t<=3149||t>=3157&&t<=3158||t>=3202&&t<=3203||t>=3262&&t<=3268||t>=3270&&t<=3272||t>=3274&&t<=3277||t>=3285&&t<=3286||t>=3330&&t<=3331||t>=3390&&t<=3395||t>=3398&&t<=3400||t>=3402&&t<=3405||t==3415||t==3633||t>=3636&&t<=3642||t>=3655&&t<=3662||t==3761||t>=3764&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=3864&&t<=3865||t==3893||t==3895||t==3897||t==3902||t==3903||t>=3953&&t<=3972||t>=3974&&t<=3979||t>=3984&&t<=3989||t==3991||t>=3993&&t<=4013||t>=4017&&t<=4023||t==4025||t>=8400&&t<=8412||t==8417||t>=12330&&t<=12335||t==12441||t==12442||t==183||t==720||t==721||t==903||t==1600||t==3654||t==3782||t==12293||t>=12337&&t<=12341||t>=12445&&t<=12446||t>=12540&&t<=12542},Z.coalesceText=function(t){for(var u=t.firstChild;u!=null;u=u.nextSibling)if(u.nodeType==C.TEXT_NODE||u.nodeType==C.CDATA_SECTION_NODE){var m=u.nodeValue,w=u;for(u=u.nextSibling;u!=null&&(u.nodeType==C.TEXT_NODE||u.nodeType==C.CDATA_SECTION_NODE);){m+=u.nodeValue;var v=u;u=u.nextSibling,v.parentNode.removeChild(v)}if(w.nodeType==C.CDATA_SECTION_NODE){var D=w.parentNode;if(w.nextSibling==null)D.removeChild(w),D.appendChild(D.ownerDocument.createTextNode(m));else{var K=w.nextSibling;D.removeChild(w),D.insertBefore(D.ownerDocument.createTextNode(m),K)}}else w.nodeValue=m;if(u==null)break}else u.nodeType==C.ELEMENT_NODE&&Z.coalesceText(u)},Z.instance_of=function(t,u){for(;t!=null;){if(t.constructor===u)return!0;if(t===Object)return!1;t=t.constructor.superclass}return!1},Z.getElementById=function(t,u){if(t.nodeType==C.ELEMENT_NODE&&(t.getAttribute("id")==u||t.getAttributeNS(null,"id")==u))return t;for(var m=t.firstChild;m!=null;m=m.nextSibling){var w=Z.getElementById(m,u);if(w!=null)return w}return null};var ft=(function(){function t(m,w){var v=w?": "+w.toString():"";switch(m){case u.INVALID_EXPRESSION_ERR:return"Invalid expression"+v;case u.TYPE_ERR:return"Type error"+v}return null}function u(m,w,v){var D=Error.call(this,t(m,w)||v);return D.code=m,D.exception=w,D}return u.prototype=Object.create(Error.prototype),u.prototype.constructor=u,u.superclass=Error,u.prototype.toString=function(){return this.message},u.fromMessage=function(m,w){return new u(null,w,m)},u.INVALID_EXPRESSION_ERR=51,u.TYPE_ERR=52,u})();ut.prototype={},ut.prototype.constructor=ut,ut.superclass=Object.prototype;function ut(t,u,m){this.xpath=m.parse(t),this.context=new ye,this.context.namespaceResolver=new It(u)}ut.getOwnerDocument=function(t){return t.nodeType===C.DOCUMENT_NODE?t:t.ownerDocument},ut.detectHtmlDom=function(t){if(!t)return!1;var u=ut.getOwnerDocument(t);try{return u.implementation.hasFeature("HTML","2.0")}catch(m){return!0}},ut.prototype.evaluate=function(t,u,m){this.context.expressionContextNode=t,this.context.caseInsensitive=ut.detectHtmlDom(t);var w=this.xpath.evaluate(this.context);return new ve(w,u)},It.prototype={},It.prototype.constructor=It,It.superclass=Object.prototype;function It(t){this.xpathNSResolver=t}It.prototype.getNamespace=function(t,u){return this.xpathNSResolver==null?null:this.xpathNSResolver.lookupNamespaceURI(t)},Rt.prototype={},Rt.prototype.constructor=Rt,Rt.superclass=Object.prototype;function Rt(t){this.node=t,this.namespaceResolver=new Ue}Rt.prototype.lookupNamespaceURI=function(t){return this.namespaceResolver.getNamespace(t,this.node)},ve.prototype={},ve.prototype.constructor=ve,ve.superclass=Object.prototype;function ve(t,u){switch(u==ve.ANY_TYPE&&(t.constructor===ie?u=ve.STRING_TYPE:t.constructor===se?u=ve.NUMBER_TYPE:t.constructor===z?u=ve.BOOLEAN_TYPE:t.constructor===J&&(u=ve.UNORDERED_NODE_ITERATOR_TYPE)),this.resultType=u,u){case ve.NUMBER_TYPE:this.numberValue=t.numberValue();return;case ve.STRING_TYPE:this.stringValue=t.stringValue();return;case ve.BOOLEAN_TYPE:this.booleanValue=t.booleanValue();return;case ve.ANY_UNORDERED_NODE_TYPE:case ve.FIRST_ORDERED_NODE_TYPE:if(t.constructor===J){this.singleNodeValue=t.first();return}break;case ve.UNORDERED_NODE_ITERATOR_TYPE:case ve.ORDERED_NODE_ITERATOR_TYPE:if(t.constructor===J){this.invalidIteratorState=!1,this.nodes=t.toArray(),this.iteratorIndex=0;return}break;case ve.UNORDERED_NODE_SNAPSHOT_TYPE:case ve.ORDERED_NODE_SNAPSHOT_TYPE:if(t.constructor===J){this.nodes=t.toArray(),this.snapshotLength=this.nodes.length;return}break}throw new ft(ft.TYPE_ERR)}ve.prototype.iterateNext=function(){if(this.resultType!=ve.UNORDERED_NODE_ITERATOR_TYPE&&this.resultType!=ve.ORDERED_NODE_ITERATOR_TYPE)throw new ft(ft.TYPE_ERR);return this.nodes[this.iteratorIndex++]},ve.prototype.snapshotItem=function(t){if(this.resultType!=ve.UNORDERED_NODE_SNAPSHOT_TYPE&&this.resultType!=ve.ORDERED_NODE_SNAPSHOT_TYPE)throw new ft(ft.TYPE_ERR);return this.nodes[t]},ve.ANY_TYPE=0,ve.NUMBER_TYPE=1,ve.STRING_TYPE=2,ve.BOOLEAN_TYPE=3,ve.UNORDERED_NODE_ITERATOR_TYPE=4,ve.ORDERED_NODE_ITERATOR_TYPE=5,ve.UNORDERED_NODE_SNAPSHOT_TYPE=6,ve.ORDERED_NODE_SNAPSHOT_TYPE=7,ve.ANY_UNORDERED_NODE_TYPE=8,ve.FIRST_ORDERED_NODE_TYPE=9;function qt(t,u){t.createExpression=function(m,w){try{return new ut(m,w,u)}catch(v){throw new ft(ft.INVALID_EXPRESSION_ERR,v)}},t.createNSResolver=function(m){return new Rt(m)},t.evaluate=function(m,w,v,D,K){if(D<0||D>9)throw{code:0,toString:function(){return"Request type not supported"}};return t.createExpression(m,v,u).evaluate(w,D,K)}}try{var sr=!0;try{document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("XPath",null)&&(sr=!1)}catch(t){}sr&&qt(document,new A)}catch(t){}qt(r,new A),(function(){var t=new A,u=new Ue,m=new Me,w=new Fe;function v(q){return{getNamespace:function(be,nt){var St=q(be,nt);return St||u.getNamespace(be,nt)}}}function D(q){return v(q.getNamespace.bind(q))}function K(q){return v(function(be){return q[be]})}function a(q){return q&&typeof q.getNamespace=="function"?D(q):typeof q=="function"?v(q):typeof q=="object"?K(q):u}function f(q){if(q===null||typeof q=="undefined"||q instanceof ie||q instanceof z||q instanceof se||q instanceof J)return q;switch(typeof q){case"string":return new ie(q);case"boolean":return new z(q);case"number":return new se(q)}var be=new J;return be.addArray([].concat(q)),be}function g(q){return function(be){var nt=Array.prototype.slice.call(arguments,1).map(function(ur){return ur.evaluate(be)}),St=q.apply(this,[].concat(be,nt));return f(St)}}function N(q){return{getFunction:function(be,nt){var St=q(be,nt);return St?g(St):m.getFunction(be,nt)}}}function O(q){return N(q.getFunction.bind(q))}function H(q){return N(function(be){return q[be]})}function ce(q){return q&&typeof q.getFunction=="function"?O(q):typeof q=="function"?N(q):typeof q=="object"?H(q):m}function Re(q){return{getVariable:function(be,nt){var St=q(be,nt);return f(St)}}}function je(q){if(q){if(typeof q.getVariable=="function")return Re(q.getVariable.bind(q));if(typeof q=="function")return Re(q);if(typeof q=="object")return Re(function(be){return q[be]})}return w}function ae(q,be,nt){q in nt&&(be[q]=nt[q])}function gt(q){var be=new ye;return q?(be.namespaceResolver=a(q.namespaces),be.functionResolver=ce(q.functions),be.variableResolver=je(q.variables),be.expressionContextNode=q.node,ae("allowAnyNamespaceForNoPrefix",be,q),ae("isHtml",be,q)):be.namespaceResolver=u,be}function xt(q,be){var nt=gt(be);return q.evaluate(nt)}var kt={evaluate:function(q){return xt(this.expression,q)},evaluateNumber:function(q){return this.evaluate(q).numberValue()},evaluateString:function(q){return this.evaluate(q).stringValue()},evaluateBoolean:function(q){return this.evaluate(q).booleanValue()},evaluateNodeSet:function(q){return this.evaluate(q).nodeset()},select:function(q){return this.evaluateNodeSet(q).toArray()},select1:function(q){return this.select(q)[0]}};function Tt(q){var be=t.parse(q);return Object.create(kt,{expression:{value:be}})}r.parse=Tt})(),me(r,{XPath:G,XPathParser:A,XPathResult:ve,Step:L,PathExpr:he,NodeTest:Y,LocationPath:rt,OrOperation:De,AndOperation:B,BarOperation:ge,EqualsOperation:I,NotEqualOperation:M,LessThanOperation:U,GreaterThanOperation:X,LessThanOrEqualOperation:F,GreaterThanOrEqualOperation:re,PlusOperation:Q,MinusOperation:$,MultiplyOperation:j,DivOperation:V,ModOperation:le,UnaryMinusOperation:we,FunctionCall:Ze,VariableReference:Ye,XPathContext:ye,XNodeSet:J,XBoolean:z,XString:ie,XNumber:se,NamespaceResolver:Ue,FunctionResolver:Me,VariableResolver:Fe,Utilities:Z}),r.select=function(t,u,m){return r.selectWithResolver(t,u,null,m)},r.useNamespaces=function(t){var u={mappings:t||{},lookupNamespaceURI:function(m){return this.mappings[m]}};return function(m,w,v){return r.selectWithResolver(m,w,u,v)}},r.selectWithResolver=function(t,u,m,w){var v=new ut(t,m,new A),D=ve.ANY_TYPE,K=v.evaluate(u,D,null);return K.resultType==ve.STRING_TYPE?K=K.stringValue:K.resultType==ve.NUMBER_TYPE?K=K.numberValue:K.resultType==ve.BOOLEAN_TYPE?K=K.booleanValue:(K=K.nodes,w&&(K=K[0])),K},r.select1=function(t,u){return r.select(t,u,!0)};var rn=function(t){return Array.isArray(t)&&t.every(l)},wt=function(t){return function(u){return l(u)&&u.nodeType===t}};me(r,{isNodeLike:l,isArrayOfNodes:rn,isElement:wt(C.ELEMENT_NODE),isAttribute:wt(C.ATTRIBUTE_NODE),isTextNode:wt(C.TEXT_NODE),isCDATASection:wt(C.CDATA_SECTION_NODE),isProcessingInstruction:wt(C.PROCESSING_INSTRUCTION_NODE),isComment:wt(C.COMMENT_NODE),isDocumentNode:wt(C.DOCUMENT_NODE),isDocumentTypeNode:wt(C.DOCUMENT_TYPE_NODE),isDocumentFragment:wt(C.DOCUMENT_FRAGMENT_NODE)})})(e)})(Zi)),Zi}var ou=Sl(),Bl=bl(ou),su=_t({__proto__:null,default:Bl},[ou]);function uu(n,e){const r=[],i=e.split(",").map(l=>l.trim()),o=[];for(const l of i){const c=l.split(/\\:|:/).filter(Boolean);c.length===1?o.push({name:c[0]}):c.length===2&&o.push({ns:c[0],name:c[1]})}function s(l){if(l){if(l.nodeType===1){const c=l,h=c.nodeName,y=c.localName;for(const b of o){if(b.ns&&h===`${b.ns}:${b.name}`){r.push(c);break}if(y===b.name||h===b.name){r.push(c);break}if(h.endsWith(`:${b.name}`)){r.push(c);break}}}if(l.childNodes)for(let c=0;c<l.childNodes.length;c++)s(l.childNodes[c])}}return s(n),r}const au={ds:"http://www.w3.org/2000/09/xmldsig#",dsig11:"http://www.w3.org/2009/xmldsig11#",dsig2:"http://www.w3.org/2010/xmldsig2#",ec:"http://www.w3.org/2001/10/xml-exc-c14n#",dsig_more:"http://www.w3.org/2001/04/xmldsig-more#",xenc:"http://www.w3.org/2001/04/xmlenc#",xenc11:"http://www.w3.org/2009/xmlenc11#",xades:"http://uri.etsi.org/01903/v1.3.2#",xades141:"http://uri.etsi.org/01903/v1.4.1#",asic:"http://uri.etsi.org/02918/v1.2.1#"};function lu(){return typeof window!="undefined"&&window.DOMParser?new window.DOMParser:new nu.DOMParser}function Ol(n,e,r=au){try{if(typeof document!="undefined"&&typeof document.evaluate=="function"){const i="ownerDocument"in n?n.ownerDocument:n;if(!i||typeof i.evaluate!="function")return null;const o=cu(r);return i.evaluate(e,n,o,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}else{const i=su;try{const o=i.useNamespaces(r)(e,n);return o.length>0?o[0]:null}catch(o){if(typeof o=="object"&&o!==null&&"message"in o&&typeof o.message=="string"&&o.message.includes("Cannot resolve QName")){const s=e.match(/local-name\(\)='([^']+)'/);if(s&&s[1]){const l=`.//*[local-name()='${s[1]}']`,c=i.select(l,n);return c.length>0?c[0]:null}}throw o}}}catch(i){return console.error(`XPath evaluation failed for "${e}":`,i),null}}function Il(n,e,r=au){try{if(typeof document!="undefined"&&typeof document.evaluate=="function"){const i="ownerDocument"in n?n.ownerDocument:n;if(!i||typeof i.evaluate!="function")return[];const o=cu(r),s=i.evaluate(e,n,o,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),l=[];for(let c=0;c<s.snapshotLength;c++)l.push(s.snapshotItem(c));return l}else{const i=su;try{return i.useNamespaces(r)(e,n)}catch(o){if(typeof o=="object"&&o!==null&&"message"in o&&typeof o.message=="string"&&o.message.includes("Cannot resolve QName")){const s=e.match(/local-name\(\)='([^']+)'/);if(s&&s[1]){const l=`.//*[local-name()='${s[1]}']`;return i.select(l,n)}}throw o}}}catch(i){return console.error(`XPath evaluation failed for "${e}":`,i),[]}}function cu(n){return function(e){return e===null?null:n[e]||null}}function fu(n){const e=n.split(",").map(i=>i.trim()),r=[];for(const i of e){const o=i.split(/\\:|:/).filter(Boolean);o.length===1?r.push(`.//*[local-name()='${o[0]}']`):o.length===2&&r.push(`.//${o[0]}:${o[1]} | .//*[local-name()='${o[1]}']`)}return r.join(" | ")}function ot(n,e){if(typeof n.querySelector=="function")try{const i=n.querySelector(e);if(i)return i}catch(i){}const r=uu(n,e);if(r.length>0)return r[0];try{const i=fu(e);return Ol(n,i)}catch(i){return console.warn("XPath query failed, using direct DOM traversal as fallback"),null}}function Lr(n,e){if(typeof n.querySelectorAll=="function")try{const i=n.querySelectorAll(e);if(i.length>0){const o=[];for(let s=0;s<i.length;s++)o.push(i[s]);return o}}catch(i){}const r=uu(n,e);if(r.length>0)return r;try{const i=fu(e);return Il(n,i)}catch(i){return console.warn("XPath query failed, using direct DOM traversal as fallback"),[]}}function Rl(n){return typeof window!="undefined"&&window.XMLSerializer?new window.XMLSerializer().serializeToString(n):new nu.XMLSerializer().serializeToString(n)}const Mr={default:"c14n","http://www.w3.org/TR/2001/REC-xml-c14n-20010315":"c14n","http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":"c14n","http://www.w3.org/2006/12/xml-c14n11":"c14n11","http://www.w3.org/2006/12/xml-c14n11#WithComments":"c14n11","http://www.w3.org/2001/10/xml-exc-c14n#":"c14n_exc","http://www.w3.org/2001/10/xml-exc-c14n#WithComments":"c14n_exc"},sn={c14n:{beforeChildren:()=>"",afterChildren:()=>"",betweenChildren:()=>"",afterElement:()=>"",isCanonicalizationMethod:"c14n"},c14n11:{beforeChildren:()=>"",afterChildren:()=>"",betweenChildren:()=>"",afterElement:()=>"",isCanonicalizationMethod:"c14n11"},c14n_exc:{beforeChildren:()=>"",afterChildren:()=>"",betweenChildren:()=>"",afterElement:()=>"",isCanonicalizationMethod:"c14n_exc"}},et={ELEMENT_NODE:1,TEXT_NODE:3};class ze{constructor(e=sn.c14n){this.method=e}static fromMethod(e){const r=Mr[e];if(!r)throw new Error(`Unsupported canonicalization method: ${e}`);return new ze(sn[r])}setMethod(e){this.method=e}static escapeXml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}static collectNamespaces(e,r=new Map){let i=e;for(;i&&i.nodeType===et.ELEMENT_NODE;){const o=i,s=o.getAttribute("xmlns");s!==null&&!r.has("")&&r.set("",s);const l=o.attributes;for(let c=0;c<l.length;c++){const h=l[c];if(h.name.startsWith("xmlns:")){const y=h.name.substring(6);r.has(y)||r.set(y,h.value)}}i=i.parentNode}return r}static collectUsedNamespaces(e,r=new Map,i=[]){const o=new Map,s=new Set;function l(c,h=!1){if(c.nodeType===et.ELEMENT_NODE){const y=c,b=y.namespaceURI,E=y.prefix||"";if(E&&b&&(h||!s.has(E))){s.add(E);const T=r.get(E);T&&T===b&&!o.has(E)&&o.set(E,T)}const x=y.attributes;for(let T=0;T<x.length;T++){const R=x[T];if(R.name.includes(":")&&!R.name.startsWith("xmlns:")){const P=R.name.split(":")[0];if(h||!s.has(P)){s.add(P);const _=r.get(P);_&&!o.has(P)&&o.set(P,_)}}}for(const T of i){const R=r.get(T);R&&!o.has(T)&&o.set(T,R)}for(let T=0;T<c.childNodes.length;T++)l(c.childNodes[T],!1)}}return l(e,!0),o}static isBase64Element(e){if(e.nodeType!==et.ELEMENT_NODE)return!1;const r=e,i=r.localName||r.nodeName.split(":").pop()||"";return this.base64Elements.has(i)}static analyzeWhitespace(e){const r=e.nodeType===et.ELEMENT_NODE?e:e.documentElement;function i(o){if(o.nodeType===et.ELEMENT_NODE){o._whitespace={hasMixedContent:!1,hasExistingLinebreaks:!1,originalContent:{}};const s=Array.from(o.childNodes);let l=!1,c=!1,h=!1;for(const y of s)if(y.nodeType===et.TEXT_NODE&&(y.nodeValue||"").trim().length>0){l=!0;break}for(const y of s)if(y.nodeType===et.ELEMENT_NODE){c=!0;break}for(let y=0;y<s.length;y++){const b=s[y];if(b.nodeType===et.TEXT_NODE){const E=b.nodeValue||"";b._originalText=E,E.includes(`
11
+ `)&&(h=!0)}else b.nodeType===et.ELEMENT_NODE&&i(b)}o._whitespace.hasMixedContent=l&&c,o._whitespace.hasExistingLinebreaks=h}}i(r)}canonicalize(e,r=new Map,i={isStartingNode:!0}){var o;return this.method.isCanonicalizationMethod==="c14n_exc"?this.canonicalizeExclusive(e,r,{inclusiveNamespacePrefixList:i.inclusiveNamespacePrefixList,isStartingNode:i.isStartingNode}):this.canonicalizeStandard(e,r,{isStartingNode:(o=i.isStartingNode)!=null?o:!0})}canonicalizeStandard(e,r=new Map,i={isStartingNode:!0}){var o,s,l;if(!e)return"";let c="";if(e.nodeType===et.ELEMENT_NODE){const h=new Map(r),y=e,b=y.getAttribute("xmlns");b!==null&&h.set("",b);const E=y.attributes;for(let C=0;C<E.length;C++){const A=E[C];if(A.name.startsWith("xmlns:")){const G=A.name.substring(6);h.set(G,A.value)}}const x=y.prefix||"",T=y.localName||y.nodeName.split(":").pop()||"",R=x?`${x}:${T}`:T;if(c+="<"+R,i.isStartingNode){const C=ze.collectNamespaces(e),A=Array.from(C.entries()).sort((G,ee)=>G[0]===""?-1:ee[0]===""?1:G[0].localeCompare(ee[0]));for(const[G,ee]of A)G===""?c+=` xmlns="${ee}"`:c+=` xmlns:${G}="${ee}"`}else{const C=Array.from(h.entries()).filter(([A,G])=>!r.has(A)||r.get(A)!==G).sort((A,G)=>A[0]===""?-1:G[0]===""?1:A[0].localeCompare(G[0]));for(const[A,G]of C)A===""?c+=` xmlns="${G}"`:c+=` xmlns:${A}="${G}"`}const P=y.attributes,_=[];for(let C=0;C<P.length;C++){const A=P[C];A.name.startsWith("xmlns")||_.push(A)}_.sort((C,A)=>C.name.localeCompare(A.name));for(const C of _)c+=` ${C.name}="${ze.escapeXml(C.value)}"`;c+=">";const k=Array.from(e.childNodes);let fe=!1,Se=!1;const Be=((o=e._whitespace)==null?void 0:o.hasMixedContent)||!1;for(const C of k)if(C.nodeType===et.ELEMENT_NODE){fe=!0;break}const me=this.method.isCanonicalizationMethod==="c14n11"&&fe&&!((s=e._whitespace)!=null&&s.hasExistingLinebreaks)&&!Be;me&&(c+=this.method.beforeChildren(fe,Be));for(let C=0;C<k.length;C++){const A=k[C],G=A.nodeType===et.ELEMENT_NODE,ee=C<k.length-1?k[C+1]:null;if(ee&&(ee.nodeType,et.ELEMENT_NODE),A.nodeType===et.TEXT_NODE){const pe=A.nodeValue||"";ze.isBase64Element(e)?c+=pe.replace(/\r/g,"&#xD;"):c+=A._originalText||pe,Se=!1;continue}G&&(Se&&this.method.isCanonicalizationMethod==="c14n11"&&!((l=e._whitespace)!=null&&l.hasExistingLinebreaks)&&!Be&&(c+=this.method.betweenChildren(!0,!0,Be)),c+=this.canonicalizeStandard(A,h,{isStartingNode:!1}),Se=!0)}me&&(c+=this.method.afterChildren(fe,Be)),c+="</"+R+">"}else if(e.nodeType===et.TEXT_NODE){const h=e._originalText||e.nodeValue||"";c+=ze.escapeXml(h)}return c}canonicalizeExclusive(e,r=new Map,i={}){if(!e)return"";const{inclusiveNamespacePrefixList:o=[],isStartingNode:s=!0}=i;let l="";if(e.nodeType===et.ELEMENT_NODE){const c=e,h=ze.collectNamespaces(c),y=s?ze.collectUsedNamespaces(c,h,o):new Map,b=c.prefix||"",E=c.localName||c.nodeName.split(":").pop()||"",x=b?`${b}:${E}`:E;if(l+="<"+x,s){const _=Array.from(y.entries()).sort((k,fe)=>k[0]===""?-1:fe[0]===""?1:k[0].localeCompare(fe[0]));for(const[k,fe]of _)k===""?l+=` xmlns="${fe}"`:l+=` xmlns:${k}="${fe}"`}const T=c.attributes,R=[];for(let _=0;_<T.length;_++){const k=T[_];k.name.startsWith("xmlns")||R.push(k)}R.sort((_,k)=>_.name.localeCompare(k.name));for(const _ of R)l+=` ${_.name}="${ze.escapeXml(_.value)}"`;l+=">";const P=Array.from(e.childNodes);for(let _=0;_<P.length;_++){const k=P[_];if(k.nodeType===et.TEXT_NODE){const fe=k.nodeValue||"";ze.isBase64Element(e)?l+=fe.replace(/\r/g,"&#xD;"):l+=ze.escapeXml(fe)}else k.nodeType===et.ELEMENT_NODE&&(l+=this.canonicalizeExclusive(k,new Map([...r,...y]),{inclusiveNamespacePrefixList:o,isStartingNode:!1}))}l+="</"+x+">"}else if(e.nodeType===et.TEXT_NODE){const c=e.nodeValue||"";l+=ze.escapeXml(c)}return l}static c14n(e){return this.analyzeWhitespace(e),new ze(sn.c14n).canonicalize(e)}static c14n11(e){return this.analyzeWhitespace(e),new ze(sn.c14n11).canonicalize(e)}static c14n_exc(e,r=[]){return this.analyzeWhitespace(e),new ze(sn.c14n_exc).canonicalizeExclusive(e,new Map,{inclusiveNamespacePrefixList:r})}static canonicalize(e,r,i={}){switch(Mr[r]||Mr.default){case"c14n":return this.c14n(e);case"c14n11":return this.c14n11(e);case"c14n_exc":return this.c14n_exc(e,i.inclusiveNamespacePrefixList||[]);default:throw new Error(`Unsupported canonicalization method: ${r}`)}}}ze.base64Elements=new Set(["DigestValue","X509Certificate","EncapsulatedTimeStamp","EncapsulatedOCSPValue","IssuerSerialV2"]);var kl=(n,e,r)=>new Promise((i,o)=>{var s=h=>{try{c(r.next(h))}catch(y){o(y)}},l=h=>{try{c(r.throw(h))}catch(y){o(y)}},c=h=>h.done?i(h.value):Promise.resolve(h.value).then(s,l);c((r=r.apply(n,e)).next())});function _l(n){if(!n)return"";const e=n.replace(/\s+/g,""),r=[];for(let i=0;i<e.length;i+=64)r.push(e.substring(i,i+64));return`-----BEGIN CERTIFICATE-----
12
12
  ${r.join(`
13
13
  `)}
14
- -----END CERTIFICATE-----`}function Ks(n){var e,r,i,o,u,l,f,p;const g={validFrom:n.notBefore,validTo:n.notAfter,issuer:{}};try{if(typeof n.subject=="object"&&n.subject!==null){const N=n.subject;g.commonName=N.commonName,g.organization=N.organizationName,g.country=N.countryName}if(typeof n.issuer=="object"&&n.issuer!==null){const N=n.issuer;g.issuer.commonName=N.commonName,g.issuer.organization=N.organizationName,g.issuer.country=N.countryName}}catch(N){console.warn("Could not extract subject/issuer as objects:",N)}try{if(typeof n.subject=="string"){const N=n.subject.split(",");for(const E of N){const[S,C]=E.trim().split("=");S==="CN"&&(g.commonName=g.commonName||C),S==="O"&&(g.organization=g.organization||C),S==="C"&&(g.country=g.country||C),S==="SN"&&(g.surname=C),(S==="G"||S==="GN")&&(g.givenName=C),(S==="SERIALNUMBER"||S==="2.5.4.5")&&(g.serialNumber=C==null?void 0:C.replace("PNOLV-",""))}}if(typeof n.issuer=="string"){const N=n.issuer.split(",");for(const E of N){const[S,C]=E.trim().split("=");S==="CN"&&(g.issuer.commonName=g.issuer.commonName||C),S==="O"&&(g.issuer.organization=g.issuer.organization||C),S==="C"&&(g.issuer.country=g.issuer.country||C)}}}catch(N){console.warn("Could not extract subject/issuer as strings:",N)}try{if("subjectName"in n&&(e=n.subjectName)!=null&&e.getField){const N=n.subjectName;g.commonName=g.commonName||((r=N.getField("CN"))==null?void 0:r[0]),g.surname=g.surname||((i=N.getField("SN"))==null?void 0:i[0]),g.givenName=g.givenName||((o=N.getField("G"))==null?void 0:o[0]),g.serialNumber=g.serialNumber||((l=(u=N.getField("2.5.4.5"))==null?void 0:u[0])==null?void 0:l.replace("PNOLV-","")),g.country=g.country||((f=N.getField("C"))==null?void 0:f[0]),g.organization=g.organization||((p=N.getField("O"))==null?void 0:p[0])}}catch(N){console.warn("Could not extract fields using getField method:",N)}return!g.serialNumber&&n.serialNumber&&(g.serialNumber=n.serialNumber),g}function Qs(n){return vl(this,null,function*(){try{let e=n;if(!n.includes("-----BEGIN CERTIFICATE-----")){const o=n.replace(/[\r\n\s]/g,"");e=El(o)}const r=new ke.X509Certificate(e),i=Ks(r);return{subject:{commonName:i.commonName,organization:i.organization,country:i.country,surname:i.surname,givenName:i.givenName,serialNumber:i.serialNumber},validFrom:i.validFrom,validTo:i.validTo,issuer:i.issuer,serialNumber:r.serialNumber}}catch(e){throw console.error("Certificate parsing error:",e),new Error("Failed to parse certificate: "+(e instanceof Error?e.message:String(e)))}})}function Al(n,e=new Date){const r="notBefore"in n?n.notBefore:n.validFrom,i="notAfter"in n?n.notAfter:n.validTo;return e<r?{isValid:!1,reason:`Certificate not yet valid. Valid from ${r.toISOString()}`}:e>i?{isValid:!1,reason:`Certificate expired. Valid until ${i.toISOString()}`}:{isValid:!0}}function Nl(n){const{subject:e}=n;return e.givenName&&e.surname?`${e.givenName} ${e.surname}`:e.commonName?e.commonName:e.serialNumber||"Unknown Signer"}function wl(n){const{validFrom:e,validTo:r}=n,i=o=>o.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"});return`${i(e)} to ${i(r)}`}function In(n){if(!n)return"";const e=n.replace(/\s+/g,""),r=[];for(let i=0;i<e.length;i+=64)r.push(e.substring(i,i+64));return`-----BEGIN CERTIFICATE-----
14
+ -----END CERTIFICATE-----`}function pu(n){var e,r,i,o,s,l,c,h;const y={validFrom:n.notBefore,validTo:n.notAfter,issuer:{}};try{if(typeof n.subject=="object"&&n.subject!==null){const b=n.subject;y.commonName=b.commonName,y.organization=b.organizationName,y.country=b.countryName}if(typeof n.issuer=="object"&&n.issuer!==null){const b=n.issuer;y.issuer.commonName=b.commonName,y.issuer.organization=b.organizationName,y.issuer.country=b.countryName}}catch(b){console.warn("Could not extract subject/issuer as objects:",b)}try{if(typeof n.subject=="string"){const b=n.subject.split(",");for(const E of b){const[x,T]=E.trim().split("=");x==="CN"&&(y.commonName=y.commonName||T),x==="O"&&(y.organization=y.organization||T),x==="C"&&(y.country=y.country||T),x==="SN"&&(y.surname=T),(x==="G"||x==="GN")&&(y.givenName=T),(x==="SERIALNUMBER"||x==="2.5.4.5")&&(y.serialNumber=T==null?void 0:T.replace("PNOLV-",""))}}if(typeof n.issuer=="string"){const b=n.issuer.split(",");for(const E of b){const[x,T]=E.trim().split("=");x==="CN"&&(y.issuer.commonName=y.issuer.commonName||T),x==="O"&&(y.issuer.organization=y.issuer.organization||T),x==="C"&&(y.issuer.country=y.issuer.country||T)}}}catch(b){console.warn("Could not extract subject/issuer as strings:",b)}try{if("subjectName"in n&&(e=n.subjectName)!=null&&e.getField){const b=n.subjectName;y.commonName=y.commonName||((r=b.getField("CN"))==null?void 0:r[0]),y.surname=y.surname||((i=b.getField("SN"))==null?void 0:i[0]),y.givenName=y.givenName||((o=b.getField("G"))==null?void 0:o[0]),y.serialNumber=y.serialNumber||((l=(s=b.getField("2.5.4.5"))==null?void 0:s[0])==null?void 0:l.replace("PNOLV-","")),y.country=y.country||((c=b.getField("C"))==null?void 0:c[0]),y.organization=y.organization||((h=b.getField("O"))==null?void 0:h[0])}}catch(b){console.warn("Could not extract fields using getField method:",b)}return!y.serialNumber&&n.serialNumber&&(y.serialNumber=n.serialNumber),y}function hu(n){return kl(this,null,function*(){try{let e=n;if(!n.includes("-----BEGIN CERTIFICATE-----")){const o=n.replace(/[\r\n\s]/g,"");e=_l(o)}const r=new Le.X509Certificate(e),i=pu(r);return{subject:{commonName:i.commonName,organization:i.organization,country:i.country,surname:i.surname,givenName:i.givenName,serialNumber:i.serialNumber},validFrom:i.validFrom,validTo:i.validTo,issuer:i.issuer,serialNumber:r.serialNumber}}catch(e){throw console.error("Certificate parsing error:",e),new Error("Failed to parse certificate: "+(e instanceof Error?e.message:String(e)))}})}function Ll(n,e=new Date){const r="notBefore"in n?n.notBefore:n.validFrom,i="notAfter"in n?n.notAfter:n.validTo;return e<r?{isValid:!1,reason:`Certificate not yet valid. Valid from ${r.toISOString()}`}:e>i?{isValid:!1,reason:`Certificate expired. Valid until ${i.toISOString()}`}:{isValid:!0}}function Ml(n){const{subject:e}=n;return e.givenName&&e.surname?`${e.givenName} ${e.surname}`:e.commonName?e.commonName:e.serialNumber||"Unknown Signer"}function Fl(n){const{validFrom:e,validTo:r}=n,i=o=>o.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"});return`${i(e)} to ${i(r)}`}function Vn(n){if(!n)return"";const e=n.replace(/\s+/g,""),r=[];for(let i=0;i<e.length;i+=64)r.push(e.substring(i,i+64));return`-----BEGIN CERTIFICATE-----
15
15
  ${r.join(`
16
16
  `)}
17
- -----END CERTIFICATE-----`}var bl=Object.defineProperty,Dl=Object.defineProperties,Cl=Object.getOwnPropertyDescriptors,Zs=Object.getOwnPropertySymbols,xl=Object.prototype.hasOwnProperty,Tl=Object.prototype.propertyIsEnumerable,eu=(n,e,r)=>e in n?bl(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,tu=(n,e)=>{for(var r in e||(e={}))xl.call(e,r)&&eu(n,r,e[r]);if(Zs)for(var r of Zs(e))Tl.call(e,r)&&eu(n,r,e[r]);return n},ru=(n,e)=>Dl(n,Cl(e));function Sl(n){var e;if(!n)return;const r=ot(n,"ec\\:InclusiveNamespaces, InclusiveNamespaces"),i=(e=r==null?void 0:r.getAttribute("PrefixList"))==null?void 0:e.trim();if(!i)return;const o=i.split(/\s+/).filter(Boolean);return o.length>0?o:void 0}function Bl(n){if(!n)return new Ye;try{return Ye.fromMethod(n)}catch(e){return new Ye}}function Ol(n){return Array.from(n.keys()).filter(e=>e.match(/META-INF\/signatures\d*\.xml$/)||e.match(/META-INF\/.*signatures.*\.xml$/i))}function Il(n,e){const r=new TextDecoder().decode(n),i=zs().parseFromString(r,"application/xml"),o=On(i,"ds\\:Signature, Signature");if(o.length===0){if(console.warn(`No Signature elements found in ${e}`),r.includes("XAdESSignatures")){const l=i.documentElement;if(l){const p=ot(l,"ds\\:Signature, Signature");if(p){let g=nu(p,i);return g.rawXml=r,g}}const f=Rl(r);if(f)return ru(tu({},f),{rawXml:r})}return null}let u=nu(o[0],i);return u.rawXml=r,u}function nu(n,e){var r,i,o,u,l;const f=n.getAttribute("Id")||"unknown",p=ot(n,"ds\\:SignedInfo, SignedInfo");if(!p)throw new Error("SignedInfo element not found");const g=ot(p,"ds\\:CanonicalizationMethod, CanonicalizationMethod");let N=Br.default;g&&(N=g.getAttribute("Algorithm")||N);let E="";E=yl(p);const S=ot(p,"ds\\:SignatureMethod, SignatureMethod"),C=(S==null?void 0:S.getAttribute("Algorithm"))||"",I=ot(n,"ds\\:SignatureValue, SignatureValue"),H=((r=I==null?void 0:I.textContent)==null?void 0:r.replace(/\s+/g,""))||"";let U,R,K;const Ae=ot(e,"xades\\:SignatureTimeStamp, SignatureTimeStamp");if(Ae){const M=ot(Ae,"ds\\:CanonicalizationMethod, CanonicalizationMethod");R=(M==null?void 0:M.getAttribute("Algorithm"))||void 0,K=Sl(M);const V=ot(Ae,"xades\\:EncapsulatedTimeStamp, EncapsulatedTimeStamp");V&&V.textContent&&(U=V.textContent.replace(/\s+/g,""))}let be;if(I)try{be=Bl(R).canonicalize(I,new Map,{inclusiveNamespacePrefixList:K})}catch(M){}let Ce="",D="",A=[],q,re;const Q=ot(n,"ds\\:KeyInfo, KeyInfo");if(Q){const M=ot(Q,"ds\\:X509Data, X509Data");if(M){const V=On(M,"ds\\:X509Certificate, X509Certificate");if(V.length>0){Ce=((i=V[0].textContent)==null?void 0:i.replace(/\s+/g,""))||"";for(let _=1;_<V.length;_++){const z=((o=V[_].textContent)==null?void 0:o.replace(/\s+/g,""))||"";z&&A.push(In(z))}}}}if(!Ce){const M=ot(n,"ds\\:X509Certificate, X509Certificate");M&&(Ce=((u=M.textContent)==null?void 0:u.replace(/\s+/g,""))||"")}const ge=ot(e,"xades\\:CertificateValues, CertificateValues");if(ge){const M=On(ge,"xades\\:EncapsulatedX509Certificate, EncapsulatedX509Certificate");for(const V of M){const _=((l=V.textContent)==null?void 0:l.replace(/\s+/g,""))||"";if(_){const z=In(_);A.includes(z)||A.push(z)}}}if(Ce){D=In(Ce);try{const M=new ke.X509Certificate(D),V=M.publicKey.algorithm;re=ru(tu({algorithm:V.name},"namedCurve"in V?{namedCurve:V.namedCurve}:{}),{rawData:M.publicKey.rawData}),q=Ks(M)}catch(M){console.error("Failed to extract certificate information:",M)}}const Ie=ot(e,"xades\\:SigningTime, SigningTime"),k=Ie&&Ie.textContent?new Date(Ie.textContent.trim()):new Date,de=[],B={},F={},Y=On(p,"ds\\:Reference, Reference");for(const M of Y){const V=M.getAttribute("URI")||"",_=M.getAttribute("Type")||"";if(!V||V.startsWith("#")||_.includes("SignedProperties"))continue;let z=V;try{z=decodeURIComponent(V)}catch(J){console.error(`Failed to decode URI: ${V}`,J)}const fe=z.startsWith("./")?z.substring(2):z;de.push(fe);const oe=ot(M,"ds\\:DigestMethod, DigestMethod");if(oe){const J=oe.getAttribute("Algorithm");J&&(F[fe]=J)}const G=ot(M,"ds\\:DigestValue, DigestValue");G&&G.textContent&&(B[fe]=G.textContent.replace(/\s+/g,""))}return{id:f,signingTime:k,certificate:Ce,certificatePEM:D,certificateChain:A.length>0?A:void 0,publicKey:re,signerInfo:q,signedChecksums:B,digestAlgorithms:F,references:de,algorithm:C,signatureValue:H,canonicalSignatureValue:be,signedInfoXml:E,canonicalizationMethod:N,signatureTimestamp:U}}function Rl(n){try{const e=n.match(/<ds:Signature[^>]*Id=["']([^"']*)["']/),r=e&&e[1]?e[1]:"unknown",i=n.match(/<ds:SignatureValue[^>]*>([\s\S]*?)<\/ds:SignatureValue>/),o=i&&i[1]?i[1].replace(/\s+/g,""):"",u=n.match(/<ds:X509Certificate>([\s\S]*?)<\/ds:X509Certificate>/),l=u&&u[1]?u[1].replace(/\s+/g,""):"",f=n.match(/<ds:SignatureMethod[^>]*Algorithm=["']([^"']*)["']/),p=f&&f[1]?f[1]:"",g=n.match(/<xades:SigningTime>([\s\S]*?)<\/xades:SigningTime>/),N=g&&g[1]?new Date(g[1].trim()):new Date,E=[],S={},C=/<ds:Reference[^>]*URI=["']([^#][^"']*)["'][^>]*>[\s\S]*?<ds:DigestValue>([\s\S]*?)<\/ds:DigestValue>/g;let I;for(;(I=C.exec(n))!==null;)if(I[1]&&!I[1].startsWith("#")){const U=decodeURIComponent(I[1]);E.push(U),I[2]&&(S[U]=I[2].replace(/\s+/g,""))}const H=In(l);return{id:r,signingTime:N,certificate:l,certificatePEM:H,signedChecksums:S,references:E,algorithm:p,signatureValue:o}}catch(e){return console.error("Error in fallback text parsing:",e),null}}function kl(n){try{const e=ze.unzipSync(n),r=new Map,i=[],o=[];Object.entries(e).forEach(([g,N])=>{r.set(g,N),g.startsWith("META-INF/")||g==="mimetype"?o.push(g):i.push(g)});const u=[],l=Ol(r),f=new Set;for(const g of l){const N=r.get(g);if(N)try{const E=Il(N,g);E&&(u.push(E),E.references&&E.references.length>0&&E.references.forEach(S=>{r.has(S)&&f.add(S)}))}catch(E){console.error(`Error parsing signature ${g}:`,E)}}const p=Array.from(f);return{files:r,documentFileList:i,metadataFileList:o,signedFileList:p,signatures:u}}catch(e){throw new Error(`Failed to parse eDoc container: ${e instanceof Error?e.message:String(e)}`)}}function _l(n){const e=()=>{},r=new Uint8Array(n);if(r[0]!==48)return n;const i=[6,9,42,134,72,134,247,13,1,1,1];let o=-1;for(let I=0;I<=r.length-i.length;I++){let H=!0;for(let U=0;U<i.length;U++)if(r[I+U]!==i[U]){H=!1;break}if(H){o=I;break}}if(o===-1)return n;let u=-1;for(let I=o+i.length;I<r.length;I++)if(r[I]===3){u=I;break}if(u===-1)return n;let l=0;(r[u+1]&128)===0?l=1:l=1+(r[u+1]&127);const f=u+1+l;if(f>=r.length)return n;const p=f+1;if(p>=r.length||r[p]!==48)return n;let g=0;(r[p+1]&128)===0?g=1:g=1+(r[p+1]&127);const N=p+1+g;if(N>=r.length||r[N]!==2)return n;let E=0,S=0;if((r[N+1]&128)===0)S=r[N+1],E=1;else{const I=r[N+1]&127;E=1+I,S=0;for(let H=0;H<I;H++)S=S<<8|r[N+2+H]}const C=N+1+E;if(C>=r.length)return n;if((r[C]&128)!==0){const I=new Uint8Array(r.length+1);if(I.set(r.slice(0,C)),I[C]=0,I.set(r.slice(C),C+1),(r[N+1]&128)===0)I[N+1]=r[N+1]+1;else{const H=r[N+1]&127;let U=0;for(let R=0;R<H;R++)U=U<<8|r[N+2+R];U+=1;for(let R=H-1;R>=0;R--)I[N+2+R]=U&255,U>>=8}if((r[p+1]&128)===0)I[p+1]=r[p+1]+1;else{const H=r[p+1]&127;let U=0;for(let R=0;R<H;R++)U=U<<8|r[p+2+R];U+=1;for(let R=H-1;R>=0;R--)I[p+2+R]=U&255,U>>=8}if((r[u+1]&128)===0)I[u+1]=r[u+1]+1;else{const H=r[u+1]&127;let U=0;for(let R=0;R<H;R++)U=U<<8|r[u+2+R];U+=1;for(let R=H-1;R>=0;R--)I[u+2+R]=U&255,U>>=8}if((r[1]&128)===0)I[1]=r[1]+1;else{const H=r[1]&127;let U=0;for(let R=0;R<H;R++)U=U<<8|r[2+R];U+=1;for(let R=H-1;R>=0;R--)I[2+R]=U&255,U>>=8}return e("Fixed key length: "+I.length),I.buffer}return n}const Ll={ocspEnabled:!0,crlEnabled:!0,ocspTimeout:5e3,crlTimeout:1e4};/*!
17
+ -----END CERTIFICATE-----`}var Pl=Object.defineProperty,Ul=Object.defineProperties,Vl=Object.getOwnPropertyDescriptors,du=Object.getOwnPropertySymbols,Hl=Object.prototype.hasOwnProperty,ql=Object.prototype.propertyIsEnumerable,gu=(n,e,r)=>e in n?Pl(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,mu=(n,e)=>{for(var r in e||(e={}))Hl.call(e,r)&&gu(n,r,e[r]);if(du)for(var r of du(e))ql.call(e,r)&&gu(n,r,e[r]);return n},yu=(n,e)=>Ul(n,Vl(e));function jl(n){var e;if(!n)return;const r=ot(n,"ec\\:InclusiveNamespaces, InclusiveNamespaces"),i=(e=r==null?void 0:r.getAttribute("PrefixList"))==null?void 0:e.trim();if(!i)return;const o=i.split(/\s+/).filter(Boolean);return o.length>0?o:void 0}function $l(n){if(!n)return new ze;try{return ze.fromMethod(n)}catch(e){return new ze}}function Gl(n){return Array.from(n.keys()).filter(e=>e.match(/META-INF\/signatures\d*\.xml$/)||e.match(/META-INF\/.*signatures.*\.xml$/i))}function Xl(n,e){const r=new TextDecoder().decode(n),i=lu().parseFromString(r,"application/xml"),o=Lr(i,"ds\\:Signature, Signature");if(o.length===0){if(console.warn(`No Signature elements found in ${e}`),r.includes("XAdESSignatures")){const l=i.documentElement;if(l){const h=ot(l,"ds\\:Signature, Signature");if(h){let y=vu(h);return y.rawXml=r,y}}const c=Wl(r);if(c)return yu(mu({},c),{rawXml:r})}return null}let s=vu(o[0]);return s.rawXml=r,s}function vu(n,e){var r,i,o,s,l,c,h;const y=n.getAttribute("Id")||"unknown",b=ot(n,"ds\\:SignedInfo, SignedInfo");if(!b)throw new Error("SignedInfo element not found");const E=ot(b,"ds\\:CanonicalizationMethod, CanonicalizationMethod");let x=Mr.default;E&&(x=E.getAttribute("Algorithm")||x);let T="";T=Rl(b);const R=ot(b,"ds\\:SignatureMethod, SignatureMethod"),P=(R==null?void 0:R.getAttribute("Algorithm"))||"",_=ot(n,"ds\\:SignatureValue, SignatureValue"),k=((r=_==null?void 0:_.textContent)==null?void 0:r.replace(/\s+/g,""))||"";let fe,Se,Be;const me=ot(n,"xades\\:SignatureTimeStamp, SignatureTimeStamp");if(me){const Q=ot(me,"ds\\:CanonicalizationMethod, CanonicalizationMethod");Se=(Q==null?void 0:Q.getAttribute("Algorithm"))||void 0,Be=jl(Q);const $=ot(me,"xades\\:EncapsulatedTimeStamp, EncapsulatedTimeStamp");$&&$.textContent&&(fe=$.textContent.replace(/\s+/g,""))}let C;if(_)try{C=$l(Se).canonicalize(_,new Map,{inclusiveNamespacePrefixList:Be})}catch(Q){}let A="",G="",ee=[],pe,Ae;const we=ot(n,"ds\\:KeyInfo, KeyInfo");if(we){const Q=ot(we,"ds\\:X509Data, X509Data");if(Q){const $=Lr(Q,"ds\\:X509Certificate, X509Certificate");if($.length>0){A=((i=$[0].textContent)==null?void 0:i.replace(/\s+/g,""))||"";for(let j=1;j<$.length;j++){const V=((o=$[j].textContent)==null?void 0:o.replace(/\s+/g,""))||"";V&&ee.push(Vn(V))}}}}if(!A){const Q=ot(n,"ds\\:X509Certificate, X509Certificate");Q&&(A=((s=Q.textContent)==null?void 0:s.replace(/\s+/g,""))||"")}const te=ot(n,"xades\\:CertificateValues, CertificateValues");if(te){const Q=Lr(te,"xades\\:EncapsulatedX509Certificate, EncapsulatedX509Certificate");for(const $ of Q){const j=((l=$.textContent)==null?void 0:l.replace(/\s+/g,""))||"";if(j){const V=Vn(j);ee.includes(V)||ee.push(V)}}}let De;const B=ot(n,"xades\\:RevocationValues, RevocationValues");if(B){const Q=[],$=[];for(const j of Lr(B,"xades\\:EncapsulatedOCSPValue, EncapsulatedOCSPValue")){const V=(c=j.textContent)==null?void 0:c.replace(/\s+/g,"");V&&Q.push(V)}for(const j of Lr(B,"xades\\:EncapsulatedCRLValue, EncapsulatedCRLValue")){const V=(h=j.textContent)==null?void 0:h.replace(/\s+/g,"");V&&$.push(V)}(Q.length>0||$.length>0)&&(De={ocsp:Q,crl:$})}if(A){G=Vn(A);try{const Q=new Le.X509Certificate(G),$=Q.publicKey.algorithm;Ae=yu(mu({algorithm:$.name},"namedCurve"in $?{namedCurve:$.namedCurve}:{}),{rawData:Q.publicKey.rawData}),pe=pu(Q)}catch(Q){console.error("Failed to extract certificate information:",Q)}}const I=ot(n,"xades\\:SigningTime, SigningTime"),M=I&&I.textContent?new Date(I.textContent.trim()):new Date,U=[],X={},F={},re=Lr(b,"ds\\:Reference, Reference");for(const Q of re){const $=Q.getAttribute("URI")||"",j=Q.getAttribute("Type")||"";if(!$||$.startsWith("#")||j.includes("SignedProperties"))continue;let V=$;try{V=decodeURIComponent($)}catch(tt){console.error(`Failed to decode URI: ${$}`,tt)}const le=V.startsWith("./")?V.substring(2):V;U.push(le);const ge=ot(Q,"ds\\:DigestMethod, DigestMethod");if(ge){const tt=ge.getAttribute("Algorithm");tt&&(F[le]=tt)}const he=ot(Q,"ds\\:DigestValue, DigestValue");he&&he.textContent&&(X[le]=he.textContent.replace(/\s+/g,""))}return{id:y,signingTime:M,certificate:A,certificatePEM:G,certificateChain:ee.length>0?ee:void 0,publicKey:Ae,signerInfo:pe,signedChecksums:X,digestAlgorithms:F,references:U,algorithm:P,signatureValue:k,canonicalSignatureValue:C,signedInfoXml:T,canonicalizationMethod:x,signatureTimestamp:fe,revocationValues:De}}function Wl(n){try{const e=n.match(/<ds:Signature[^>]*Id=["']([^"']*)["']/),r=e&&e[1]?e[1]:"unknown",i=n.match(/<ds:SignatureValue[^>]*>([\s\S]*?)<\/ds:SignatureValue>/),o=i&&i[1]?i[1].replace(/\s+/g,""):"",s=n.match(/<ds:X509Certificate>([\s\S]*?)<\/ds:X509Certificate>/),l=s&&s[1]?s[1].replace(/\s+/g,""):"",c=n.match(/<ds:SignatureMethod[^>]*Algorithm=["']([^"']*)["']/),h=c&&c[1]?c[1]:"",y=n.match(/<xades:SigningTime>([\s\S]*?)<\/xades:SigningTime>/),b=y&&y[1]?new Date(y[1].trim()):new Date,E=[],x={},T=/<ds:Reference[^>]*URI=["']([^#][^"']*)["'][^>]*>[\s\S]*?<ds:DigestValue>([\s\S]*?)<\/ds:DigestValue>/g;let R;for(;(R=T.exec(n))!==null;)if(R[1]&&!R[1].startsWith("#")){const _=decodeURIComponent(R[1]);E.push(_),R[2]&&(x[_]=R[2].replace(/\s+/g,""))}const P=Vn(l);return{id:r,signingTime:b,certificate:l,certificatePEM:P,signedChecksums:x,references:E,algorithm:h,signatureValue:o}}catch(e){return console.error("Error in fallback text parsing:",e),null}}function zl(n){try{const e=We.unzipSync(n),r=new Map,i=[],o=[];Object.entries(e).forEach(([y,b])=>{r.set(y,b),y.startsWith("META-INF/")||y==="mimetype"?o.push(y):i.push(y)});const s=[],l=Gl(r),c=new Set;for(const y of l){const b=r.get(y);if(b)try{const E=Xl(b,y);E&&(s.push(E),E.references&&E.references.length>0&&E.references.forEach(x=>{r.has(x)&&c.add(x)}))}catch(E){console.error(`Error parsing signature ${y}:`,E)}}const h=Array.from(c);return{files:r,documentFileList:i,metadataFileList:o,signedFileList:h,signatures:s}}catch(e){throw new Error(`Failed to parse eDoc container: ${e instanceof Error?e.message:String(e)}`)}}function Yl(n){const e=()=>{},r=new Uint8Array(n);if(r[0]!==48)return n;const i=[6,9,42,134,72,134,247,13,1,1,1];let o=-1;for(let R=0;R<=r.length-i.length;R++){let P=!0;for(let _=0;_<i.length;_++)if(r[R+_]!==i[_]){P=!1;break}if(P){o=R;break}}if(o===-1)return n;let s=-1;for(let R=o+i.length;R<r.length;R++)if(r[R]===3){s=R;break}if(s===-1)return n;let l=0;(r[s+1]&128)===0?l=1:l=1+(r[s+1]&127);const c=s+1+l;if(c>=r.length)return n;const h=c+1;if(h>=r.length||r[h]!==48)return n;let y=0;(r[h+1]&128)===0?y=1:y=1+(r[h+1]&127);const b=h+1+y;if(b>=r.length||r[b]!==2)return n;let E=0,x=0;if((r[b+1]&128)===0)x=r[b+1],E=1;else{const R=r[b+1]&127;E=1+R,x=0;for(let P=0;P<R;P++)x=x<<8|r[b+2+P]}const T=b+1+E;if(T>=r.length)return n;if((r[T]&128)!==0){const R=new Uint8Array(r.length+1);if(R.set(r.slice(0,T)),R[T]=0,R.set(r.slice(T),T+1),(r[b+1]&128)===0)R[b+1]=r[b+1]+1;else{const P=r[b+1]&127;let _=0;for(let k=0;k<P;k++)_=_<<8|r[b+2+k];_+=1;for(let k=P-1;k>=0;k--)R[b+2+k]=_&255,_>>=8}if((r[h+1]&128)===0)R[h+1]=r[h+1]+1;else{const P=r[h+1]&127;let _=0;for(let k=0;k<P;k++)_=_<<8|r[h+2+k];_+=1;for(let k=P-1;k>=0;k--)R[h+2+k]=_&255,_>>=8}if((r[s+1]&128)===0)R[s+1]=r[s+1]+1;else{const P=r[s+1]&127;let _=0;for(let k=0;k<P;k++)_=_<<8|r[s+2+k];_+=1;for(let k=P-1;k>=0;k--)R[s+2+k]=_&255,_>>=8}if((r[1]&128)===0)R[1]=r[1]+1;else{const P=r[1]&127;let _=0;for(let k=0;k<P;k++)_=_<<8|r[2+k];_+=1;for(let k=P-1;k>=0;k--)R[2+k]=_&255,_>>=8}return e("Fixed key length: "+R.length),R.buffer}return n}const Jl={ocspEnabled:!0,crlEnabled:!0,ocspTimeout:5e3,crlTimeout:1e4};/*!
18
18
  * MIT License
19
19
  *
20
20
  * Copyright (c) 2017-2024 Peculiar Ventures, LLC
@@ -37,9 +37,9 @@ ${r.join(`
37
37
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38
38
  * SOFTWARE.
39
39
  *
40
- */const Ml="[object ArrayBuffer]";class we{static isArrayBuffer(e){return Object.prototype.toString.call(e)===Ml}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,r){if(e.constructor===r)return e;if(this.isArrayBuffer(e))return new r(e);if(this.isArrayBufferView(e))return new r(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,r){const i=we.toUint8Array(e),o=we.toUint8Array(r);if(i.length!==o.byteLength)return!1;for(let u=0;u<i.length;u++)if(i[u]!==o[u])return!1;return!0}static concat(...e){let r;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?r=e[0]:e[e.length-1]instanceof Function?r=e.slice(0,e.length-1):r=e;let i=0;for(const l of r)i+=l.byteLength;const o=new Uint8Array(i);let u=0;for(const l of r){const f=this.toUint8Array(l);o.set(f,u),u+=f.length}return e[e.length-1]instanceof Function?this.toView(o,e[e.length-1]):o.buffer}}const qi="string",Fl=/^[0-9a-f\s]+$/i,Ul=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Pl=/^[a-zA-Z0-9-_]+$/;class iu{static fromString(e){const r=unescape(encodeURIComponent(e)),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i.buffer}static toString(e){const r=we.toUint8Array(e);let i="";for(let u=0;u<r.length;u++)i+=String.fromCharCode(r[u]);return decodeURIComponent(escape(i))}}class Vt{static toString(e,r=!1){const i=we.toArrayBuffer(e),o=new DataView(i);let u="";for(let l=0;l<i.byteLength;l+=2){const f=o.getUint16(l,r);u+=String.fromCharCode(f)}return u}static fromString(e,r=!1){const i=new ArrayBuffer(e.length*2),o=new DataView(i);for(let u=0;u<e.length;u++)o.setUint16(u*2,e.charCodeAt(u),r);return i}}class Ve{static isHex(e){return typeof e===qi&&Fl.test(e)}static isBase64(e){return typeof e===qi&&Ul.test(e)}static isBase64Url(e){return typeof e===qi&&Pl.test(e)}static ToString(e,r="utf8"){const i=we.toUint8Array(e);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return Vt.toString(i,!0);case"utf16":case"utf16be":return Vt.toString(i);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(e,r="utf8"){if(!e)return new ArrayBuffer(0);switch(r.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return Vt.fromString(e,!0);case"utf16":case"utf16be":return Vt.fromString(e);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(e){const r=we.toUint8Array(e);if(typeof btoa!="undefined"){const i=this.ToString(r,"binary");return btoa(i)}else return Buffer.from(r).toString("base64")}static FromBase64(e){const r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!Ve.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob!="undefined"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(e){const r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!Ve.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,r=Ve.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(e);case"utf8":return iu.fromString(e);case"utf16":case"utf16be":return Vt.fromString(e);case"utf16le":case"usc2":return Vt.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(e,r=Ve.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(e);case"utf8":return iu.toString(e);case"utf16":case"utf16be":return Vt.toString(e);case"utf16le":case"usc2":return Vt.toString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(e){const r=e.length,i=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=e.charCodeAt(o);return i.buffer}static ToBinary(e){const r=we.toUint8Array(e);let i="";for(let o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);return i}static ToHex(e){const r=we.toUint8Array(e);let i="";const o=r.length;for(let u=0;u<o;u++){const l=r[u];l<16&&(i+="0"),i+=l.toString(16)}return i}static FromHex(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!Ve.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);const i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o=o+2){const u=r.slice(o,o+2);i[o/2]=parseInt(u,16)}return i.buffer}static ToUtf16String(e,r=!1){return Vt.toString(e,r)}static FromUtf16String(e,r=!1){return Vt.fromString(e,r)}static Base64Padding(e){const r=4-e.length%4;if(r<4)for(let i=0;i<r;i++)e+="=";return e}static formatString(e){return(e==null?void 0:e.replace(/[\n\r\t ]/g,""))||""}}Ve.DEFAULT_UTF8_ENCODING="utf8";function Vl(n,e){if(!(n&&e)||n.byteLength!==e.byteLength)return!1;const r=new Uint8Array(n),i=new Uint8Array(e);for(let o=0;o<n.byteLength;o++)if(r[o]!==i[o])return!1;return!0}/*!
40
+ */const Kl="[object ArrayBuffer]";class xe{static isArrayBuffer(e){return Object.prototype.toString.call(e)===Kl}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,r){if(e.constructor===r)return e;if(this.isArrayBuffer(e))return new r(e);if(this.isArrayBufferView(e))return new r(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,r){const i=xe.toUint8Array(e),o=xe.toUint8Array(r);if(i.length!==o.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==o[s])return!1;return!0}static concat(...e){let r;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?r=e[0]:e[e.length-1]instanceof Function?r=e.slice(0,e.length-1):r=e;let i=0;for(const l of r)i+=l.byteLength;const o=new Uint8Array(i);let s=0;for(const l of r){const c=this.toUint8Array(l);o.set(c,s),s+=c.length}return e[e.length-1]instanceof Function?this.toView(o,e[e.length-1]):o.buffer}}const eo="string",Ql=/^[0-9a-f\s]+$/i,Zl=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,ec=/^[a-zA-Z0-9-_]+$/;class Eu{static fromString(e){const r=unescape(encodeURIComponent(e)),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i.buffer}static toString(e){const r=xe.toUint8Array(e);let i="";for(let s=0;s<r.length;s++)i+=String.fromCharCode(r[s]);return decodeURIComponent(escape(i))}}class $t{static toString(e,r=!1){const i=xe.toArrayBuffer(e),o=new DataView(i);let s="";for(let l=0;l<i.byteLength;l+=2){const c=o.getUint16(l,r);s+=String.fromCharCode(c)}return s}static fromString(e,r=!1){const i=new ArrayBuffer(e.length*2),o=new DataView(i);for(let s=0;s<e.length;s++)o.setUint16(s*2,e.charCodeAt(s),r);return i}}class qe{static isHex(e){return typeof e===eo&&Ql.test(e)}static isBase64(e){return typeof e===eo&&Zl.test(e)}static isBase64Url(e){return typeof e===eo&&ec.test(e)}static ToString(e,r="utf8"){const i=xe.toUint8Array(e);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return $t.toString(i,!0);case"utf16":case"utf16be":return $t.toString(i);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(e,r="utf8"){if(!e)return new ArrayBuffer(0);switch(r.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return $t.fromString(e,!0);case"utf16":case"utf16be":return $t.fromString(e);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(e){const r=xe.toUint8Array(e);if(typeof btoa!="undefined"){const i=this.ToString(r,"binary");return btoa(i)}else return Buffer.from(r).toString("base64")}static FromBase64(e){const r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!qe.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob!="undefined"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(e){const r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!qe.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,r=qe.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(e);case"utf8":return Eu.fromString(e);case"utf16":case"utf16be":return $t.fromString(e);case"utf16le":case"usc2":return $t.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(e,r=qe.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(e);case"utf8":return Eu.toString(e);case"utf16":case"utf16be":return $t.toString(e);case"utf16le":case"usc2":return $t.toString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(e){const r=e.length,i=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=e.charCodeAt(o);return i.buffer}static ToBinary(e){const r=xe.toUint8Array(e);let i="";for(let o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);return i}static ToHex(e){const r=xe.toUint8Array(e);let i="";const o=r.length;for(let s=0;s<o;s++){const l=r[s];l<16&&(i+="0"),i+=l.toString(16)}return i}static FromHex(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!qe.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);const i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o=o+2){const s=r.slice(o,o+2);i[o/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(e,r=!1){return $t.toString(e,r)}static FromUtf16String(e,r=!1){return $t.fromString(e,r)}static Base64Padding(e){const r=4-e.length%4;if(r<4)for(let i=0;i<r;i++)e+="=";return e}static formatString(e){return(e==null?void 0:e.replace(/[\n\r\t ]/g,""))||""}}qe.DEFAULT_UTF8_ENCODING="utf8";function tc(n,e){if(!(n&&e)||n.byteLength!==e.byteLength)return!1;const r=new Uint8Array(n),i=new Uint8Array(e);for(let o=0;o<n.byteLength;o++)if(r[o]!==i[o])return!1;return!0}/*!
41
41
  Copyright (c) Peculiar Ventures, LLC
42
- */function Or(n,e){let r=0;if(n.length===1)return n[0];for(let i=n.length-1;i>=0;i--)r+=n[n.length-1-i]*Math.pow(2,e*i);return r}function cr(n,e,r=-1){const i=r;let o=n,u=0,l=Math.pow(2,e);for(let f=1;f<8;f++){if(n<l){let p;if(i<0)p=new ArrayBuffer(f),u=f;else{if(i<f)return new ArrayBuffer(0);p=new ArrayBuffer(i),u=i}const g=new Uint8Array(p);for(let N=f-1;N>=0;N--){const E=Math.pow(2,N*e);g[u-N-1]=Math.floor(o/E),o-=g[u-N-1]*E}return p}l*=Math.pow(2,e)}return new ArrayBuffer(0)}function ji(...n){let e=0,r=0;for(const u of n)e+=u.length;const i=new ArrayBuffer(e),o=new Uint8Array(i);for(const u of n)o.set(u,r),r+=u.length;return o}function ou(){const n=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const f=n[0]===255&&n[1]&128,p=n[0]===0&&(n[1]&128)===0;(f||p)&&this.warnings.push("Needlessly long format")}const e=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(e);for(let f=0;f<this.valueHex.byteLength;f++)r[f]=0;r[0]=n[0]&128;const i=Or(r,8),o=new ArrayBuffer(this.valueHex.byteLength),u=new Uint8Array(o);for(let f=0;f<this.valueHex.byteLength;f++)u[f]=n[f];return u[0]&=127,Or(u,8)-i}function Hl(n){const e=n<0?n*-1:n;let r=128;for(let i=1;i<8;i++){if(e<=r){if(n<0){const l=r-e,f=cr(l,8,i),p=new Uint8Array(f);return p[0]|=128,f}let o=cr(e,8,i),u=new Uint8Array(o);if(u[0]&128){const l=o.slice(0),f=new Uint8Array(l);o=new ArrayBuffer(o.byteLength+1),u=new Uint8Array(o);for(let p=0;p<l.byteLength;p++)u[p+1]=f[p];u[0]=0}return o}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function ql(n,e){if(n.byteLength!==e.byteLength)return!1;const r=new Uint8Array(n),i=new Uint8Array(e);for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function Nt(n,e){const r=n.toString(10);if(e<r.length)return"";const i=e-r.length,o=new Array(i);for(let l=0;l<i;l++)o[l]="0";return o.join("").concat(r)}/*!
42
+ */function Fr(n,e){let r=0;if(n.length===1)return n[0];for(let i=n.length-1;i>=0;i--)r+=n[n.length-1-i]*Math.pow(2,e*i);return r}function gr(n,e,r=-1){const i=r;let o=n,s=0,l=Math.pow(2,e);for(let c=1;c<8;c++){if(n<l){let h;if(i<0)h=new ArrayBuffer(c),s=c;else{if(i<c)return new ArrayBuffer(0);h=new ArrayBuffer(i),s=i}const y=new Uint8Array(h);for(let b=c-1;b>=0;b--){const E=Math.pow(2,b*e);y[s-b-1]=Math.floor(o/E),o-=y[s-b-1]*E}return h}l*=Math.pow(2,e)}return new ArrayBuffer(0)}function to(...n){let e=0,r=0;for(const s of n)e+=s.length;const i=new ArrayBuffer(e),o=new Uint8Array(i);for(const s of n)o.set(s,r),r+=s.length;return o}function Au(){const n=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const c=n[0]===255&&n[1]&128,h=n[0]===0&&(n[1]&128)===0;(c||h)&&this.warnings.push("Needlessly long format")}const e=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(e);for(let c=0;c<this.valueHex.byteLength;c++)r[c]=0;r[0]=n[0]&128;const i=Fr(r,8),o=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(o);for(let c=0;c<this.valueHex.byteLength;c++)s[c]=n[c];return s[0]&=127,Fr(s,8)-i}function rc(n){const e=n<0?n*-1:n;let r=128;for(let i=1;i<8;i++){if(e<=r){if(n<0){const l=r-e,c=gr(l,8,i),h=new Uint8Array(c);return h[0]|=128,c}let o=gr(e,8,i),s=new Uint8Array(o);if(s[0]&128){const l=o.slice(0),c=new Uint8Array(l);o=new ArrayBuffer(o.byteLength+1),s=new Uint8Array(o);for(let h=0;h<l.byteLength;h++)s[h+1]=c[h];s[0]=0}return o}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function nc(n,e){if(n.byteLength!==e.byteLength)return!1;const r=new Uint8Array(n),i=new Uint8Array(e);for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function bt(n,e){const r=n.toString(10);if(e<r.length)return"";const i=e-r.length,o=new Array(i);for(let l=0;l<i;l++)o[l]="0";return o.join("").concat(r)}/*!
43
43
  * Copyright (c) 2014, GMO GlobalSign
44
44
  * Copyright (c) 2015-2022, Peculiar Ventures
45
45
  * All rights reserved.
@@ -71,15 +71,15 @@ ${r.join(`
71
71
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
72
72
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
73
73
  *
74
- */function Rn(){if(typeof BigInt=="undefined")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function $i(n){let e=0,r=0;for(let o=0;o<n.length;o++){const u=n[o];e+=u.byteLength}const i=new Uint8Array(e);for(let o=0;o<n.length;o++){const u=n[o];i.set(new Uint8Array(u),r),r+=u.byteLength}return i.buffer}function zt(n,e,r,i){return e instanceof Uint8Array?e.byteLength?r<0?(n.error="Wrong parameter: inputOffset less than zero",!1):i<0?(n.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-r-i<0?(n.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(n.error="Wrong parameter: inputBuffer has zero length",!1):(n.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class kn{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return $i(this.items)}}const Zr=[new Uint8Array([1])],su="0123456789",Gi="name",uu="valueHexView",jl="isHexOnly",$l="idBlock",Gl="tagClass",Xl="tagNumber",Wl="isConstructed",zl="fromBER",Yl="toBER",Jl="local",mt="",Ht=new ArrayBuffer(0),_n=new Uint8Array(0),en="EndOfContent",au="OCTET STRING",lu="BIT STRING";function qt(n){var e;return e=class extends n{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}constructor(...i){var o;super(...i);const u=i[0]||{};this.isHexOnly=(o=u.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=u.valueHex?we.toUint8Array(u.valueHex):_n}fromBER(i,o,u){const l=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!zt(this,l,o,u))return-1;const f=o+u;return this.valueHexView=l.subarray(o,f),this.valueHexView.length?(this.blockLength=u,f):(this.warnings.push("Zero buffer length"),o)}toBER(i=!1){return this.isHexOnly?i?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Ht)}toJSON(){return Qe(Fe({},super.toJSON()),{isHexOnly:this.isHexOnly,valueHex:Ve.ToHex(this.valueHexView)})}},e.NAME="hexBlock",e}class fr{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:r=mt,warnings:i=[],valueBeforeDecode:o=_n}={}){this.blockLength=e,this.error=r,this.warnings=i,this.valueBeforeDecodeView=we.toUint8Array(o)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:Ve.ToHex(this.valueBeforeDecodeView)}}}fr.NAME="baseBlock";class ht extends fr{fromBER(e,r,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}ht.NAME="valueBlock";class cu extends qt(fr){constructor({idBlock:e={}}={}){var r,i,o,u;super(),e?(this.isHexOnly=(r=e.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=e.valueHex?we.toUint8Array(e.valueHex):_n,this.tagClass=(i=e.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(o=e.tagNumber)!==null&&o!==void 0?o:-1,this.isConstructed=(u=e.isConstructed)!==null&&u!==void 0?u:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",Ht}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){const o=new Uint8Array(1);if(!e){let u=this.tagNumber;u&=31,r|=u,o[0]=r}return o.buffer}if(!this.isHexOnly){const o=cr(this.tagNumber,7),u=new Uint8Array(o),l=o.byteLength,f=new Uint8Array(l+1);if(f[0]=r|31,!e){for(let p=0;p<l-1;p++)f[p+1]=u[p]|128;f[l]=u[l-1]}return f.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!e){const o=this.valueHexView;for(let u=0;u<o.length-1;u++)i[u+1]=o[u]|128;i[this.valueHexView.byteLength]=o[o.length-1]}return i.buffer}fromBER(e,r,i){const o=we.toUint8Array(e);if(!zt(this,o,r,i))return-1;const u=o.subarray(r,r+i);if(u.length===0)return this.error="Zero buffer length",-1;switch(u[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(u[0]&32)===32,this.isHexOnly=!1;const f=u[0]&31;if(f!==31)this.tagNumber=f,this.blockLength=1;else{let p=1,g=this.valueHexView=new Uint8Array(255),N=255;for(;u[p]&128;){if(g[p-1]=u[p]&127,p++,p>=u.length)return this.error="End of input reached before message was fully decoded",-1;if(p===N){N+=255;const S=new Uint8Array(N);for(let C=0;C<g.length;C++)S[C]=g[C];g=this.valueHexView=new Uint8Array(N)}}this.blockLength=p+1,g[p-1]=u[p]&127;const E=new Uint8Array(p);for(let S=0;S<p;S++)E[S]=g[S];g=this.valueHexView=new Uint8Array(p),g.set(E),this.blockLength<=9?this.tagNumber=Or(g,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return r+this.blockLength}toJSON(){return Qe(Fe({},super.toJSON()),{tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed})}}cu.NAME="identificationBlock";class fu extends fr{constructor({lenBlock:e={}}={}){var r,i,o;super(),this.isIndefiniteForm=(r=e.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(i=e.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(o=e.length)!==null&&o!==void 0?o:0}fromBER(e,r,i){const o=we.toUint8Array(e);if(!zt(this,o,r,i))return-1;const u=o.subarray(r,r+i);if(u.length===0)return this.error="Zero buffer length",-1;if(u[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=u[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(u[0]&128),this.longFormUsed===!1)return this.length=u[0],this.blockLength=1,r+this.blockLength;const l=u[0]&127;if(l>8)return this.error="Too big integer",-1;if(l+1>u.length)return this.error="End of input reached before message was fully decoded",-1;const f=r+1,p=o.subarray(f,f+l);return p[l-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Or(p,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=l+1,r+this.blockLength}toBER(e=!1){let r,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){const o=cr(this.length,8);if(o.byteLength>127)return this.error="Too big length",Ht;if(r=new ArrayBuffer(o.byteLength+1),e)return r;const u=new Uint8Array(o);i=new Uint8Array(r),i[0]=o.byteLength|128;for(let l=0;l<o.byteLength;l++)i[l+1]=u[l];return r}return r=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(r),i[0]=this.length),r}toJSON(){return Qe(Fe({},super.toJSON()),{isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length})}}fu.NAME="lengthBlock";const te={};class st extends fr{constructor(l={},u){var f=l,{name:e=mt,optional:r=!1,primitiveSchema:i}=f,o=We(f,["name","optional","primitiveSchema"]);super(o),this.name=e,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new cu(o),this.lenBlock=new fu(o),this.valueBlock=u?new u(o):new ht(o)}fromBER(e,r,i){const o=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}toBER(e,r){const i=r||new kn;r||pu(this);const o=this.idBlock.toBER(e);if(i.write(o),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,i),i.write(new ArrayBuffer(2));else{const u=this.valueBlock.toBER(e);this.lenBlock.length=u.byteLength;const l=this.lenBlock.toBER(e);i.write(l),i.write(u)}return r?Ht:i.final()}toJSON(){const e=Qe(Fe({},super.toJSON()),{idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional});return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():Ve.ToHex(this.toBER())}onAsciiEncoding(){const e=this.constructor.NAME,r=Ve.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${r}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const r=this.toBER(),i=e.toBER();return ql(r,i)}}st.NAME="BaseBlock";function pu(n){var e;if(n instanceof te.Constructed)for(const r of n.valueBlock.value)pu(r)&&(n.lenBlock.isIndefiniteForm=!0);return!!(!((e=n.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}class Xi extends st{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(o={},i){var u=o,{value:e=mt}=u,r=We(u,["value"]);super(r,i),e&&this.fromString(e)}fromBER(e,r,i){const o=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}Xi.NAME="BaseStringBlock";class hu extends qt(ht){constructor(i={}){var o=i,{isHexOnly:e=!0}=o,r=We(o,["isHexOnly"]);super(r),this.isHexOnly=e}}hu.NAME="PrimitiveValueBlock";var du;class tn extends st{constructor(e={}){super(e,hu),this.idBlock.isConstructed=!1}}du=tn,te.Primitive=du,tn.NAME="PRIMITIVE";function Kl(n,e){if(n instanceof e)return n;const r=new e;return r.idBlock=n.idBlock,r.lenBlock=n.lenBlock,r.warnings=n.warnings,r.valueBeforeDecodeView=n.valueBeforeDecodeView,r}function Ir(n,e=0,r=n.length){const i=e;let o=new st({},ht);const u=new fr;if(!zt(u,n,e,r))return o.error=u.error,{offset:-1,result:o};if(!n.subarray(e,e+r).length)return o.error="Zero buffer length",{offset:-1,result:o};let f=o.idBlock.fromBER(n,e,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),f===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(e=f,r-=o.idBlock.blockLength,f=o.lenBlock.fromBER(n,e,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),f===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(e=f,r-=o.lenBlock.blockLength,!o.idBlock.isConstructed&&o.lenBlock.isIndefiniteForm)return o.error="Indefinite length form used for primitive encoding form",{offset:-1,result:o};let p=st;switch(o.idBlock.tagClass){case 1:if(o.idBlock.tagNumber>=37&&o.idBlock.isHexOnly===!1)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};p=te.EndOfContent;break;case 1:p=te.Boolean;break;case 2:p=te.Integer;break;case 3:p=te.BitString;break;case 4:p=te.OctetString;break;case 5:p=te.Null;break;case 6:p=te.ObjectIdentifier;break;case 10:p=te.Enumerated;break;case 12:p=te.Utf8String;break;case 13:p=te.RelativeObjectIdentifier;break;case 14:p=te.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:p=te.Sequence;break;case 17:p=te.Set;break;case 18:p=te.NumericString;break;case 19:p=te.PrintableString;break;case 20:p=te.TeletexString;break;case 21:p=te.VideotexString;break;case 22:p=te.IA5String;break;case 23:p=te.UTCTime;break;case 24:p=te.GeneralizedTime;break;case 25:p=te.GraphicString;break;case 26:p=te.VisibleString;break;case 27:p=te.GeneralString;break;case 28:p=te.UniversalString;break;case 29:p=te.CharacterString;break;case 30:p=te.BmpString;break;case 31:p=te.DATE;break;case 32:p=te.TimeOfDay;break;case 33:p=te.DateTime;break;case 34:p=te.Duration;break;default:{const g=o.idBlock.isConstructed?new te.Constructed:new te.Primitive;g.idBlock=o.idBlock,g.lenBlock=o.lenBlock,g.warnings=o.warnings,o=g}}break;default:p=o.idBlock.isConstructed?te.Constructed:te.Primitive}return o=Kl(o,p),f=o.fromBER(n,e,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=n.subarray(i,i+o.blockLength),{offset:f,result:o}}function Rr(n){if(!n.byteLength){const e=new st({},ht);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Ir(we.toUint8Array(n).slice(),0,n.byteLength)}function Ql(n,e){return n?1:e}class sr extends ht{constructor(o={}){var u=o,{value:e=[],isIndefiniteForm:r=!1}=u,i=We(u,["value","isIndefiniteForm"]);super(i),this.value=e,this.isIndefiniteForm=r}fromBER(e,r,i){const o=we.toUint8Array(e);if(!zt(this,o,r,i))return-1;if(this.valueBeforeDecodeView=o.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let u=r;for(;Ql(this.isIndefiniteForm,i)>0;){const l=Ir(o,u,i);if(l.offset===-1)return this.error=l.result.error,this.warnings.concat(l.result.warnings),-1;if(u=l.offset,this.blockLength+=l.result.blockLength,i-=l.result.blockLength,this.value.push(l.result),this.isIndefiniteForm&&l.result.constructor.NAME===en)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===en?this.value.pop():this.warnings.push("No EndOfContent block encoded")),u}toBER(e,r){const i=r||new kn;for(let o=0;o<this.value.length;o++)this.value[o].toBER(e,i);return r?Ht:i.final()}toJSON(){const e=Qe(Fe({},super.toJSON()),{isIndefiniteForm:this.isIndefiniteForm,value:[]});for(const r of this.value)e.value.push(r.toJSON());return e}}sr.NAME="ConstructedValueBlock";var gu;class dt extends st{constructor(e={}){super(e,sr),this.idBlock.isConstructed=!0}fromBER(e,r,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const o=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){const e=[];for(const i of this.valueBlock.value)e.push(i.toString("ascii").split(`
74
+ */function Hn(){if(typeof BigInt=="undefined")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function ro(n){let e=0,r=0;for(let o=0;o<n.length;o++){const s=n[o];e+=s.byteLength}const i=new Uint8Array(e);for(let o=0;o<n.length;o++){const s=n[o];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function Kt(n,e,r,i){return e instanceof Uint8Array?e.byteLength?r<0?(n.error="Wrong parameter: inputOffset less than zero",!1):i<0?(n.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-r-i<0?(n.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(n.error="Wrong parameter: inputBuffer has zero length",!1):(n.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class qn{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return ro(this.items)}}const un=[new Uint8Array([1])],Nu="0123456789",no="name",wu="valueHexView",ic="isHexOnly",oc="idBlock",sc="tagClass",uc="tagNumber",ac="isConstructed",lc="fromBER",cc="toBER",fc="local",yt="",Gt=new ArrayBuffer(0),jn=new Uint8Array(0),an="EndOfContent",bu="OCTET STRING",Du="BIT STRING";function Xt(n){var e;return e=class extends n{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}constructor(...i){var o;super(...i);const s=i[0]||{};this.isHexOnly=(o=s.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=s.valueHex?xe.toUint8Array(s.valueHex):jn}fromBER(i,o,s,l){const c=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!Kt(this,c,o,s))return-1;const h=o+s;return this.valueHexView=c.subarray(o,h),this.valueHexView.length?(this.blockLength=s,h):(this.warnings.push("Zero buffer length"),o)}toBER(i=!1){return this.isHexOnly?i?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Gt)}toJSON(){return Je(Ve({},super.toJSON()),{isHexOnly:this.isHexOnly,valueHex:qe.ToHex(this.valueHexView)})}},e.NAME="hexBlock",e}class mr{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:r=yt,warnings:i=[],valueBeforeDecode:o=jn}={}){this.blockLength=e,this.error=r,this.warnings=i,this.valueBeforeDecodeView=xe.toUint8Array(o)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:qe.ToHex(this.valueBeforeDecodeView)}}}mr.NAME="baseBlock";class pt extends mr{fromBER(e,r,i,o){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}pt.NAME="valueBlock";class Cu extends Xt(mr){constructor({idBlock:e={}}={}){var r,i,o,s;super(),e?(this.isHexOnly=(r=e.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=e.valueHex?xe.toUint8Array(e.valueHex):jn,this.tagClass=(i=e.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(o=e.tagNumber)!==null&&o!==void 0?o:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",Gt}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){const o=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,r|=s,o[0]=r}return o.buffer}if(!this.isHexOnly){const o=gr(this.tagNumber,7),s=new Uint8Array(o),l=o.byteLength,c=new Uint8Array(l+1);if(c[0]=r|31,!e){for(let h=0;h<l-1;h++)c[h+1]=s[h]|128;c[l]=s[l-1]}return c.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!e){const o=this.valueHexView;for(let s=0;s<o.length-1;s++)i[s+1]=o[s]|128;i[this.valueHexView.byteLength]=o[o.length-1]}return i.buffer}fromBER(e,r,i){const o=xe.toUint8Array(e);if(!Kt(this,o,r,i))return-1;const s=o.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const c=s[0]&31;if(c!==31)this.tagNumber=c,this.blockLength=1;else{let h=0;for(;;){const b=h+1;if(b>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(h++,(s[b]&128)===0)break}this.blockLength=h+1;const y=this.valueHexView=new Uint8Array(h);for(let b=0;b<h;b++)y[b]=s[b+1]&127;this.blockLength<=9?this.tagNumber=Fr(y,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return r+this.blockLength}toJSON(){return Je(Ve({},super.toJSON()),{tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed})}}Cu.NAME="identificationBlock";class xu extends mr{constructor({lenBlock:e={}}={}){var r,i,o;super(),this.isIndefiniteForm=(r=e.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(i=e.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(o=e.length)!==null&&o!==void 0?o:0}fromBER(e,r,i){const o=xe.toUint8Array(e);if(!Kt(this,o,r,i))return-1;const s=o.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+this.blockLength;const l=s[0]&127;if(l>8)return this.error="Too big integer",-1;if(l+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const c=r+1,h=o.subarray(c,c+l);return h[l-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Fr(h,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=l+1,r+this.blockLength}toBER(e=!1){let r,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){const o=gr(this.length,8);if(o.byteLength>127)return this.error="Too big length",Gt;if(r=new ArrayBuffer(o.byteLength+1),e)return r;const s=new Uint8Array(o);i=new Uint8Array(r),i[0]=o.byteLength|128;for(let l=0;l<o.byteLength;l++)i[l+1]=s[l];return r}return r=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(r),i[0]=this.length),r}toJSON(){return Je(Ve({},super.toJSON()),{isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length})}}xu.NAME="lengthBlock";const ne={};class st extends mr{constructor(l={},s){var c=l,{name:e=yt,optional:r=!1,primitiveSchema:i}=c,o=Xe(c,["name","optional","primitiveSchema"]);super(o),this.name=e,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new Cu(o),this.lenBlock=new xu(o),this.valueBlock=s?new s(o):new pt(o)}fromBER(e,r,i,o){const s=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length,o);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}toBER(e,r){const i=r||new qn;r||Tu(this);const o=this.idBlock.toBER(e);if(i.write(o),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;const l=this.lenBlock.toBER(e);i.write(l),i.write(s)}return r?Gt:i.final()}toJSON(){const e=Je(Ve({},super.toJSON()),{idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional});return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():qe.ToHex(this.toBER())}onAsciiEncoding(){const e=this.constructor.NAME,r=qe.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${r}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const r=this.toBER(),i=e.toBER();return nc(r,i)}}st.NAME="BaseBlock";function Tu(n){var e;if(n instanceof ne.Constructed)for(const r of n.valueBlock.value)Tu(r)&&(n.lenBlock.isIndefiniteForm=!0);return!!(!((e=n.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}class io extends st{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(o={},i){var s=o,{value:e=yt}=s,r=Xe(s,["value"]);super(r,i),e&&this.fromString(e)}fromBER(e,r,i){const o=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}io.NAME="BaseStringBlock";class Su extends Xt(pt){constructor(i={}){var o=i,{isHexOnly:e=!0}=o,r=Xe(o,["isHexOnly"]);super(r),this.isHexOnly=e}}Su.NAME="PrimitiveValueBlock";var Bu;class ln extends st{constructor(e={}){super(e,Su),this.idBlock.isConstructed=!1}}Bu=ln,ne.Primitive=Bu,ln.NAME="PRIMITIVE";const Ou=100,Iu=1e4,Ru=16*1024*1024,pc="Maximum ASN.1 nesting depth exceeded",hc="Maximum ASN.1 node count exceeded",dc="Maximum ASN.1 content length exceeded";function cn(n={}){var e,r,i;return{depth:0,maxDepth:(e=n.maxDepth)!==null&&e!==void 0?e:Ou,nodesCount:0,maxNodes:(r=n.maxNodes)!==null&&r!==void 0?r:Iu,maxContentLength:(i=n.maxContentLength)!==null&&i!==void 0?i:Ru}}function gc(n){const e=new st({},pt);return e.error=n,{offset:-1,result:e}}function mc(n){if(n.nodesCount+=1,n.nodesCount>n.maxNodes)return hc}function yc(n,e){if(n>e.maxContentLength)return dc}function oo(n,e,r,i){const o=i.depth+1;if(o>i.maxDepth)return gc(pc);i.depth=o;try{return $n(n,e,r,i)}finally{i.depth-=1}}function vc(n,e){if(n instanceof e)return n;const r=new e;return r.idBlock=n.idBlock,r.lenBlock=n.lenBlock,r.warnings=n.warnings,r.valueBeforeDecodeView=n.valueBeforeDecodeView,r}function $n(n,e=0,r=n.length,i=cn()){const o=e;let s=new st({},pt);const l=new mr;if(!Kt(l,n,e,r))return s.error=l.error,{offset:-1,result:s};if(!n.subarray(e,e+r).length)return s.error="Zero buffer length",{offset:-1,result:s};const h=mc(i);if(h)return s.error=h,{offset:-1,result:s};let y=s.idBlock.fromBER(n,e,r);if(s.idBlock.warnings.length&&s.warnings.concat(s.idBlock.warnings),y===-1)return s.error=s.idBlock.error,{offset:-1,result:s};if(e=y,r-=s.idBlock.blockLength,y=s.lenBlock.fromBER(n,e,r),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),y===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};e=y,r-=s.lenBlock.blockLength;const b=s.lenBlock.isIndefiniteForm?r:s.lenBlock.length,E=yc(b,i);if(E)return s.error=E,{offset:-1,result:s};if(!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm)return s.error="Indefinite length form used for primitive encoding form",{offset:-1,result:s};let x=st;switch(s.idBlock.tagClass){case 1:if(s.idBlock.tagNumber>=37&&s.idBlock.isHexOnly===!1)return s.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:s};switch(s.idBlock.tagNumber){case 0:if(s.idBlock.isConstructed&&s.lenBlock.length>0)return s.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:s};x=ne.EndOfContent;break;case 1:x=ne.Boolean;break;case 2:x=ne.Integer;break;case 3:x=ne.BitString;break;case 4:x=ne.OctetString;break;case 5:x=ne.Null;break;case 6:x=ne.ObjectIdentifier;break;case 10:x=ne.Enumerated;break;case 12:x=ne.Utf8String;break;case 13:x=ne.RelativeObjectIdentifier;break;case 14:x=ne.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:x=ne.Sequence;break;case 17:x=ne.Set;break;case 18:x=ne.NumericString;break;case 19:x=ne.PrintableString;break;case 20:x=ne.TeletexString;break;case 21:x=ne.VideotexString;break;case 22:x=ne.IA5String;break;case 23:x=ne.UTCTime;break;case 24:x=ne.GeneralizedTime;break;case 25:x=ne.GraphicString;break;case 26:x=ne.VisibleString;break;case 27:x=ne.GeneralString;break;case 28:x=ne.UniversalString;break;case 29:x=ne.CharacterString;break;case 30:x=ne.BmpString;break;case 31:x=ne.DATE;break;case 32:x=ne.TimeOfDay;break;case 33:x=ne.DateTime;break;case 34:x=ne.Duration;break;default:{const T=s.idBlock.isConstructed?new ne.Constructed:new ne.Primitive;T.idBlock=s.idBlock,T.lenBlock=s.lenBlock,T.warnings=s.warnings,s=T}}break;default:x=s.idBlock.isConstructed?ne.Constructed:ne.Primitive}return s=vc(s,x),y=s.fromBER(n,e,b,i),s.valueBeforeDecodeView=n.subarray(o,o+s.blockLength),{offset:y,result:s}}function yr(n,e={}){if(!n.byteLength){const r=new st({},pt);return r.error="Input buffer has zero length",{offset:-1,result:r}}return $n(xe.toUint8Array(n).slice(),0,n.byteLength,cn(e))}function Ec(n,e){return n?1:e}class lr extends pt{constructor(o={}){var s=o,{value:e=[],isIndefiniteForm:r=!1}=s,i=Xe(s,["value","isIndefiniteForm"]);super(i),this.value=e,this.isIndefiniteForm=r}fromBER(e,r,i,o){const s=xe.toUint8Array(e),l=o!=null?o:cn();if(!Kt(this,s,r,i))return-1;if(this.valueBeforeDecodeView=s.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let c=r;for(;Ec(this.isIndefiniteForm,i)>0;){const h=oo(s,c,i,l);if(h.offset===-1)return this.error=h.result.error,this.warnings.concat(h.result.warnings),-1;if(c=h.offset,this.blockLength+=h.result.blockLength,i-=h.result.blockLength,this.value.push(h.result),this.isIndefiniteForm&&h.result.constructor.NAME===an)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===an?this.value.pop():this.warnings.push("No EndOfContent block encoded")),c}toBER(e,r){const i=r||new qn;for(let o=0;o<this.value.length;o++)this.value[o].toBER(e,i);return r?Gt:i.final()}toJSON(){const e=Je(Ve({},super.toJSON()),{isIndefiniteForm:this.isIndefiniteForm,value:[]});for(const r of this.value)e.value.push(r.toJSON());return e}}lr.NAME="ConstructedValueBlock";var ku;class mt extends st{constructor(e={}){super(e,lr),this.idBlock.isConstructed=!0}fromBER(e,r,i,o){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const s=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length,o);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){const e=[];for(const i of this.valueBlock.value)e.push(i.toString("ascii").split(`
75
75
  `).map(o=>` ${o}`).join(`
76
76
  `));const r=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${r} :
77
77
  ${e.join(`
78
- `)}`:`${r} :`}}gu=dt,te.Constructed=gu,dt.NAME="CONSTRUCTED";class mu extends ht{fromBER(e,r,i){return r}toBER(e){return Ht}}mu.override="EndOfContentValueBlock";var yu;class Wi extends st{constructor(e={}){super(e,mu),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}yu=Wi,te.EndOfContent=yu,Wi.NAME=en;var vu;class pr extends st{constructor(e={}){super(e,ht),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,r,i){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=i,r+i>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(e,r){const i=new ArrayBuffer(2);if(!e){const o=new Uint8Array(i);o[0]=5,o[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}vu=pr,te.Null=vu,pr.NAME="NULL";class Eu extends qt(ht){get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor(i={}){var o=i,{value:e}=o,r=We(o,["value"]);super(r),r.valueHex?this.valueHexView=we.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,r,i){const o=we.toUint8Array(e);return zt(this,o,r,i)?(this.valueHexView=o.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,ou.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return Qe(Fe({},super.toJSON()),{value:this.value})}}Eu.NAME="BooleanValueBlock";var Au;class Ln extends st{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,Eu),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}}Au=Ln,te.Boolean=Au,Ln.NAME="BOOLEAN";class Nu extends qt(sr){constructor(i={}){var o=i,{isConstructed:e=!1}=o,r=We(o,["isConstructed"]);super(r),this.isConstructed=e}fromBER(e,r,i){let o=0;if(this.isConstructed){if(this.isHexOnly=!1,o=sr.prototype.fromBER.call(this,e,r,i),o===-1)return o;for(let u=0;u<this.value.length;u++){const l=this.value[u].constructor.NAME;if(l===en){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(l!==au)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(e,r,i),this.blockLength=i;return o}toBER(e,r){return this.isConstructed?sr.prototype.toBER.call(this,e,r):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return Qe(Fe({},super.toJSON()),{isConstructed:this.isConstructed})}}Nu.NAME="OctetStringValueBlock";var zi;class hr extends st{constructor(o={}){var u=o,{idBlock:e={},lenBlock:r={}}=u,i=We(u,["idBlock","lenBlock"]);var l,f;(l=i.isConstructed)!==null&&l!==void 0||(i.isConstructed=!!(!((f=i.value)===null||f===void 0)&&f.length)),super(Fe({idBlock:Fe({isConstructed:i.isConstructed},e),lenBlock:Qe(Fe({},r),{isIndefiniteForm:!!i.isIndefiniteForm})},i),Nu),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,r,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const u=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(r,r+i);try{if(u.byteLength){const l=Ir(u,0,u.byteLength);l.offset!==-1&&l.offset===i&&(this.valueBlock.value=[l.result])}}catch(l){}}return super.fromBER(e,r,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return dt.prototype.onAsciiEncoding.call(this);const e=this.constructor.NAME,r=Ve.ToHex(this.valueBlock.valueHexView);return`${e} : ${r}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const r of this.valueBlock.value)r instanceof zi&&e.push(r.valueBlock.valueHexView);return we.concat(e)}}zi=hr,te.OctetString=zi,hr.NAME=au;class wu extends qt(sr){constructor(o={}){var u=o,{unusedBits:e=0,isConstructed:r=!1}=u,i=We(u,["unusedBits","isConstructed"]);super(i),this.unusedBits=e,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(e,r,i){if(!i)return r;let o=-1;if(this.isConstructed){if(o=sr.prototype.fromBER.call(this,e,r,i),o===-1)return o;for(const f of this.value){const p=f.constructor.NAME;if(p===en){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(p!==lu)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const g=f.valueBlock;if(this.unusedBits>0&&g.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=g.unusedBits}return o}const u=we.toUint8Array(e);if(!zt(this,u,r,i))return-1;const l=u.subarray(r,r+i);if(this.unusedBits=l[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const f=l.subarray(1);try{if(f.byteLength){const p=Ir(f,0,f.byteLength);p.offset!==-1&&p.offset===i-1&&(this.value=[p.result])}}catch(p){}}return this.valueHexView=l.subarray(1),this.blockLength=l.length,r+i}toBER(e,r){if(this.isConstructed)return sr.prototype.toBER.call(this,e,r);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength){const o=new Uint8Array(1);return o[0]=0,o.buffer}const i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return Qe(Fe({},super.toJSON()),{unusedBits:this.unusedBits,isConstructed:this.isConstructed})}}wu.NAME="BitStringValueBlock";var bu;class dr extends st{constructor(o={}){var u=o,{idBlock:e={},lenBlock:r={}}=u,i=We(u,["idBlock","lenBlock"]);var l,f;(l=i.isConstructed)!==null&&l!==void 0||(i.isConstructed=!!(!((f=i.value)===null||f===void 0)&&f.length)),super(Fe({idBlock:Fe({isConstructed:i.isConstructed},e),lenBlock:Qe(Fe({},r),{isIndefiniteForm:!!i.isIndefiniteForm})},i),wu),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,r,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,r,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return dt.prototype.onAsciiEncoding.call(this);{const e=[],r=this.valueBlock.valueHexView;for(const l of r)e.push(l.toString(2).padStart(8,"0"));const i=e.join(""),o=this.constructor.NAME,u=i.substring(0,i.length-this.valueBlock.unusedBits);return`${o} : ${u}`}}}bu=dr,te.BitString=bu,dr.NAME=lu;var Du;function Zl(n,e){const r=new Uint8Array([0]),i=new Uint8Array(n),o=new Uint8Array(e);let u=i.slice(0);const l=u.length-1,f=o.slice(0),p=f.length-1;let g=0;const N=p<l?l:p;let E=0;for(let S=N;S>=0;S--,E++)!0===E<f.length?g=u[l-E]+f[p-E]+r[0]:g=u[l-E]+r[0],r[0]=g/10,!0===E>=u.length?u=ji(new Uint8Array([g%10]),u):u[l-E]=g%10;return r[0]>0&&(u=ji(r,u)),u}function Cu(n){if(n>=Zr.length)for(let e=Zr.length;e<=n;e++){const r=new Uint8Array([0]);let i=Zr[e-1].slice(0);for(let o=i.length-1;o>=0;o--){const u=new Uint8Array([(i[o]<<1)+r[0]]);r[0]=u[0]/10,i[o]=u[0]%10}r[0]>0&&(i=ji(r,i)),Zr.push(i)}return Zr[n]}function ec(n,e){let r=0;const i=new Uint8Array(n),o=new Uint8Array(e),u=i.slice(0),l=u.length-1,f=o.slice(0),p=f.length-1;let g,N=0;for(let E=p;E>=0;E--,N++)g=u[l-N]-f[p-N]-r,!0===g<0?(r=1,u[l-N]=g+10):(r=0,u[l-N]=g);if(r>0)for(let E=l-p+1;E>=0;E--,N++)if(g=u[l-N]-r,g<0)r=1,u[l-N]=g+10;else{r=0,u[l-N]=g;break}return u.slice()}class Yi extends qt(ht){setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=ou.call(this)))}constructor(i={}){var o=i,{value:e}=o,r=We(o,["value"]);super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Hl(e))}get valueDec(){return this._valueDec}fromDER(e,r,i,o=0){const u=this.fromBER(e,r,i);if(u===-1)return u;const l=this.valueHexView;return l[0]===0&&(l[1]&128)!==0?this.valueHexView=l.subarray(1):o!==0&&l.length<o&&(o-l.length>1&&(o=l.length+1),this.valueHexView=l.subarray(o-l.length)),u}toDER(e=!1){const r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{const i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(r,1),this.valueHexView=i}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,r,i){const o=super.fromBER(e,r,i);return o===-1||this.setValueHex(),o}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return Qe(Fe({},super.toJSON()),{valueDec:this.valueDec})}toString(){const e=this.valueHexView.length*8-1;let r=new Uint8Array(this.valueHexView.length*8/3),i=0,o;const u=this.valueHexView;let l="",f=!1;for(let p=u.byteLength-1;p>=0;p--){o=u[p];for(let g=0;g<8;g++)(o&1)===1&&(i===e?(r=ec(Cu(i),r),l="-"):r=Zl(r,Cu(i))),i++,o>>=1}for(let p=0;p<r.length;p++)r[p]&&(f=!0),f&&(l+=su.charAt(r[p]));return f===!1&&(l+=su.charAt(0)),l}}Du=Yi,Yi.NAME="IntegerValueBlock",Object.defineProperty(Du.prototype,"valueHex",{set:function(n){this.valueHexView=new Uint8Array(n),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var rn;class kr extends st{constructor(e={}){super(e,Yi),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Rn(),BigInt(this.valueBlock.toString())}static fromBigInt(e){Rn();const r=BigInt(e),i=new kn,o=r.toString(16).replace(/^-/,""),u=new Uint8Array(Ve.FromHex(o));if(r<0){const f=new Uint8Array(u.length+(u[0]&128?1:0));f[0]|=128;const g=BigInt(`0x${Ve.ToHex(f)}`)+r,N=we.toUint8Array(Ve.FromHex(g.toString(16)));N[0]|=128,i.write(N)}else u[0]&128&&i.write(new Uint8Array([0])),i.write(u);return new rn({valueHex:i.final()})}convertToDER(){const e=new rn({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new rn({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}rn=kr,te.Integer=rn,kr.NAME="INTEGER";var xu;class Mn extends kr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}xu=Mn,te.Enumerated=xu,Mn.NAME="ENUMERATED";class Ji extends qt(ht){constructor(o={}){var u=o,{valueDec:e=-1,isFirstSid:r=!1}=u,i=We(u,["valueDec","isFirstSid"]);super(i),this.valueDec=e,this.isFirstSid=r}fromBER(e,r,i){if(!i)return r;const o=we.toUint8Array(e);if(!zt(this,o,r,i))return-1;const u=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let f=0;f<i&&(this.valueHexView[f]=u[f]&127,this.blockLength++,(u[f]&128)!==0);f++);const l=new Uint8Array(this.blockLength);for(let f=0;f<this.blockLength;f++)l[f]=this.valueHexView[f];return this.valueHexView=l,(u[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Or(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(e){Rn();let r=BigInt(e).toString(2);for(;r.length%7;)r="0"+r;const i=new Uint8Array(r.length/7);for(let o=0;o<i.length;o++)i[o]=parseInt(r.slice(o*7,o*7+7),2)+(o+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,u=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength-1;l++)u[l]=o[l]|128;return u[this.blockLength-1]=o[this.blockLength-1],u.buffer}const r=cr(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",Ht;const i=new Uint8Array(r.byteLength);if(!e){const o=new Uint8Array(r),u=r.byteLength-1;for(let l=0;l<u;l++)i[l]=o[l]|128;i[u]=o[u]}return i}toString(){let e="";if(this.isHexOnly)e=Ve.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",r-=40):(e="2.",r-=80),e+=r.toString()}else e=this.valueDec.toString();return e}toJSON(){return Qe(Fe({},super.toJSON()),{valueDec:this.valueDec,isFirstSid:this.isFirstSid})}}Ji.NAME="sidBlock";class Tu extends ht{constructor(i={}){var o=i,{value:e=mt}=o,r=We(o,["value"]);super(r),this.value=[],e&&this.fromString(e)}fromBER(e,r,i){let o=r;for(;i>0;){const u=new Ji;if(o=u.fromBER(e,o,i),o===-1)return this.blockLength=0,this.error=u.error,o;this.value.length===0&&(u.isFirstSid=!0),this.blockLength+=u.blockLength,i-=u.blockLength,this.value.push(u)}return o}toBER(e){const r=[];for(let i=0;i<this.value.length;i++){const o=this.value[i].toBER(e);if(o.byteLength===0)return this.error=this.value[i].error,Ht;r.push(o)}return $i(r)}fromString(e){this.value=[];let r=0,i=0,o="",u=!1;do if(i=e.indexOf(".",r),i===-1?o=e.substring(r):o=e.substring(r,i),r=i+1,u){const l=this.value[0];let f=0;switch(l.valueDec){case 0:break;case 1:f=40;break;case 2:f=80;break;default:this.value=[];return}const p=parseInt(o,10);if(isNaN(p))return;l.valueDec=p+f,u=!1}else{const l=new Ji;if(o>Number.MAX_SAFE_INTEGER){Rn();const f=BigInt(o);l.valueBigInt=f}else if(l.valueDec=parseInt(o,10),isNaN(l.valueDec))return;this.value.length||(l.isFirstSid=!0,u=!0),this.value.push(l)}while(i!==-1)}toString(){let e="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(e=`${e}.`),r?(o=`{${o}}`,this.value[i].isFirstSid?e=`2.{${o} - 80}`:e+=o):e+=o}return e}toJSON(){const e=Qe(Fe({},super.toJSON()),{value:this.toString(),sidArray:[]});for(let r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}}Tu.NAME="ObjectIdentifierValueBlock";var Su;class Fn extends st{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Tu),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return Qe(Fe({},super.toJSON()),{value:this.getValue()})}}Su=Fn,te.ObjectIdentifier=Su,Fn.NAME="OBJECT IDENTIFIER";class Ki extends qt(fr){constructor(i={}){var o=i,{valueDec:e=0}=o,r=We(o,["valueDec"]);super(r),this.valueDec=e}fromBER(e,r,i){if(i===0)return r;const o=we.toUint8Array(e);if(!zt(this,o,r,i))return-1;const u=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let f=0;f<i&&(this.valueHexView[f]=u[f]&127,this.blockLength++,(u[f]&128)!==0);f++);const l=new Uint8Array(this.blockLength);for(let f=0;f<this.blockLength;f++)l[f]=this.valueHexView[f];return this.valueHexView=l,(u[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Or(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,u=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength-1;l++)u[l]=o[l]|128;return u[this.blockLength-1]=o[this.blockLength-1],u.buffer}const r=cr(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",Ht;const i=new Uint8Array(r.byteLength);if(!e){const o=new Uint8Array(r),u=r.byteLength-1;for(let l=0;l<u;l++)i[l]=o[l]|128;i[u]=o[u]}return i.buffer}toString(){let e="";return this.isHexOnly?e=Ve.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return Qe(Fe({},super.toJSON()),{valueDec:this.valueDec})}}Ki.NAME="relativeSidBlock";class Bu extends ht{constructor(i={}){var o=i,{value:e=mt}=o,r=We(o,["value"]);super(r),this.value=[],e&&this.fromString(e)}fromBER(e,r,i){let o=r;for(;i>0;){const u=new Ki;if(o=u.fromBER(e,o,i),o===-1)return this.blockLength=0,this.error=u.error,o;this.blockLength+=u.blockLength,i-=u.blockLength,this.value.push(u)}return o}toBER(e,r){const i=[];for(let o=0;o<this.value.length;o++){const u=this.value[o].toBER(e);if(u.byteLength===0)return this.error=this.value[o].error,Ht;i.push(u)}return $i(i)}fromString(e){this.value=[];let r=0,i=0,o="";do{i=e.indexOf(".",r),i===-1?o=e.substring(r):o=e.substring(r,i),r=i+1;const u=new Ki;if(u.valueDec=parseInt(o,10),isNaN(u.valueDec))return!0;this.value.push(u)}while(i!==-1);return!0}toString(){let e="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(e=`${e}.`),r&&(o=`{${o}}`),e+=o}return e}toJSON(){const e=Qe(Fe({},super.toJSON()),{value:this.toString(),sidArray:[]});for(let r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}}Bu.NAME="RelativeObjectIdentifierValueBlock";var Ou;class Qi extends st{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Bu),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return Qe(Fe({},super.toJSON()),{value:this.getValue()})}}Ou=Qi,te.RelativeObjectIdentifier=Ou,Qi.NAME="RelativeObjectIdentifier";var Iu;class It extends dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Iu=It,te.Sequence=Iu,It.NAME="SEQUENCE";var Ru;class jt extends dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}}Ru=jt,te.Set=Ru,jt.NAME="SET";class ku extends qt(ht){constructor(r={}){var e=We(r,[]);super(e),this.isHexOnly=!0,this.value=mt}toJSON(){return Qe(Fe({},super.toJSON()),{value:this.value})}}ku.NAME="StringValueBlock";class _u extends ku{}_u.NAME="SimpleStringValueBlock";class wt extends Xi{constructor(r={}){var e=We(r,[]);super(e,_u)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,we.toUint8Array(e))}fromString(e){const r=e.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=e.charCodeAt(o);this.valueBlock.value=e}}wt.NAME="SIMPLE STRING";class Lu extends wt{fromBuffer(e){this.valueBlock.valueHexView=we.toUint8Array(e);try{this.valueBlock.value=Ve.ToUtf8String(e)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=Ve.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(Ve.FromUtf8String(e)),this.valueBlock.value=e}}Lu.NAME="Utf8StringValueBlock";var Mu;class Yt extends Lu{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Mu=Yt,te.Utf8String=Mu,Yt.NAME="UTF8String";class Fu extends wt{fromBuffer(e){this.valueBlock.value=Ve.ToUtf16String(e),this.valueBlock.valueHexView=we.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(Ve.FromUtf16String(e))}}Fu.NAME="BmpStringValueBlock";var Uu;class Un extends Fu{constructor(r={}){var e=We(r,[]);super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Uu=Un,te.BmpString=Uu,Un.NAME="BMPString";class Pu extends wt{fromBuffer(e){const r=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),i=new Uint8Array(r);for(let o=0;o<i.length;o+=4)i[o]=i[o+3],i[o+1]=i[o+2],i[o+2]=0,i[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(e){const r=e.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let o=0;o<r;o++){const u=cr(e.charCodeAt(o),8),l=new Uint8Array(u);if(l.length>4)continue;const f=4-l.length;for(let p=l.length-1;p>=0;p--)i[o*4+p+f]=l[p]}this.valueBlock.value=e}}Pu.NAME="UniversalStringValueBlock";var Vu;class Pn extends Pu{constructor(r={}){var e=We(r,[]);super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Vu=Pn,te.UniversalString=Vu,Pn.NAME="UniversalString";var Hu;class Vn extends wt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Hu=Vn,te.NumericString=Hu,Vn.NAME="NumericString";var qu;class Hn extends wt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}qu=Hn,te.PrintableString=qu,Hn.NAME="PrintableString";var ju;class qn extends wt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}ju=qn,te.TeletexString=ju,qn.NAME="TeletexString";var $u;class jn extends wt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}$u=jn,te.VideotexString=$u,jn.NAME="VideotexString";var Gu;class $n extends wt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Gu=$n,te.IA5String=Gu,$n.NAME="IA5String";var Xu;class Gn extends wt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}Xu=Gn,te.GraphicString=Xu,Gn.NAME="GraphicString";var Wu;class nn extends wt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Wu=nn,te.VisibleString=Wu,nn.NAME="VisibleString";var zu;class Xn extends wt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}zu=Xn,te.GeneralString=zu,Xn.NAME="GeneralString";var Yu;class Wn extends wt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Yu=Wn,te.CharacterString=Yu,Wn.NAME="CharacterString";var Ju;class on extends nn{constructor(o={}){var u=o,{value:e,valueDate:r}=u,i=We(u,["value","valueDate"]);if(super(i),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let l=0;l<e.length;l++)this.valueBlock.valueHexView[l]=e.charCodeAt(l)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,we.toUint8Array(e)))}toBuffer(){const e=this.toString(),r=new ArrayBuffer(e.length),i=new Uint8Array(r);for(let o=0;o<e.length;o++)i[o]=e.charCodeAt(o);return r}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){const i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(i===null){this.error="Wrong input string for conversion";return}const o=parseInt(i[1],10);o>=50?this.year=1900+o:this.year=2e3+o,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(e="iso"){if(e==="iso"){const r=new Array(7);return r[0]=Nt(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=Nt(this.month,2),r[2]=Nt(this.day,2),r[3]=Nt(this.hour,2),r[4]=Nt(this.minute,2),r[5]=Nt(this.second,2),r[6]="Z",r.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return Qe(Fe({},super.toJSON()),{year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second})}}Ju=on,te.UTCTime=Ju,on.NAME="UTCTime";var Ku;class zn extends on{constructor(e={}){var r;super(e),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){const e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let r=!1,i="",o="",u=0,l,f=0,p=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),r=!0;else{const E=new Number(e[e.length-1]);if(isNaN(E.valueOf()))throw new Error("Wrong input string for conversion");i=e}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let E=1,S=i.indexOf("+"),C="";if(S===-1&&(S=i.indexOf("-"),E=-1),S!==-1){if(C=i.substring(S+1),i=i.substring(0,S),C.length!==2&&C.length!==4)throw new Error("Wrong input string for conversion");let I=parseInt(C.substring(0,2),10);if(isNaN(I.valueOf()))throw new Error("Wrong input string for conversion");if(f=E*I,C.length===4){if(I=parseInt(C.substring(2,4),10),isNaN(I.valueOf()))throw new Error("Wrong input string for conversion");p=E*I}}}let g=i.indexOf(".");if(g===-1&&(g=i.indexOf(",")),g!==-1){const E=new Number(`0${i.substring(g)}`);if(isNaN(E.valueOf()))throw new Error("Wrong input string for conversion");u=E.valueOf(),o=i.substring(0,g)}else o=i;switch(!0){case o.length===8:if(l=/(\d{4})(\d{2})(\d{2})/ig,g!==-1)throw new Error("Wrong input string for conversion");break;case o.length===10:if(l=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,g!==-1){let E=60*u;this.minute=Math.floor(E),E=60*(E-this.minute),this.second=Math.floor(E),E=1e3*(E-this.second),this.millisecond=Math.floor(E)}break;case o.length===12:if(l=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,g!==-1){let E=60*u;this.second=Math.floor(E),E=1e3*(E-this.second),this.millisecond=Math.floor(E)}break;case o.length===14:if(l=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,g!==-1){const E=1e3*u;this.millisecond=Math.floor(E)}break;default:throw new Error("Wrong input string for conversion")}const N=l.exec(o);if(N===null)throw new Error("Wrong input string for conversion");for(let E=1;E<N.length;E++)switch(E){case 1:this.year=parseInt(N[E],10);break;case 2:this.month=parseInt(N[E],10);break;case 3:this.day=parseInt(N[E],10);break;case 4:this.hour=parseInt(N[E],10)+f;break;case 5:this.minute=parseInt(N[E],10)+p;break;case 6:this.second=parseInt(N[E],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const E=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=E.getUTCFullYear(),this.month=E.getUTCMonth(),this.day=E.getUTCDay(),this.hour=E.getUTCHours(),this.minute=E.getUTCMinutes(),this.second=E.getUTCSeconds(),this.millisecond=E.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const r=[];return r.push(Nt(this.year,4)),r.push(Nt(this.month,2)),r.push(Nt(this.day,2)),r.push(Nt(this.hour,2)),r.push(Nt(this.minute,2)),r.push(Nt(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(Nt(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(e)}toJSON(){return Qe(Fe({},super.toJSON()),{millisecond:this.millisecond})}}Ku=zn,te.GeneralizedTime=Ku,zn.NAME="GeneralizedTime";var Qu;class Zi extends Yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Qu=Zi,te.DATE=Qu,Zi.NAME="DATE";var Zu;class eo extends Yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Zu=eo,te.TimeOfDay=Zu,eo.NAME="TimeOfDay";var ea;class to extends Yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}ea=to,te.DateTime=ea,to.NAME="DateTime";var ta;class ro extends Yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}ta=ro,te.Duration=ta,ro.NAME="Duration";var ra;class no extends Yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}ra=no,te.TIME=ra,no.NAME="TIME";class gr{constructor({name:e=mt,optional:r=!1}={}){this.name=e,this.optional=r}}class io extends gr{constructor(i={}){var o=i,{value:e=[]}=o,r=We(o,["value"]);super(r),this.value=e}}class Yn extends gr{constructor(o={}){var u=o,{value:e=new gr,local:r=!1}=u,i=We(u,["value","local"]);super(i),this.value=e,this.local=r}}class tc{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=we.toUint8Array(e)}constructor({data:e=_n}={}){this.dataView=we.toUint8Array(e)}fromBER(e,r,i){const o=r+i;return this.dataView=we.toUint8Array(e).subarray(r,o),o}toBER(e){return this.dataView.slice().buffer}}function ur(n,e,r){if(r instanceof io){for(const u of r.value)if(ur(n,e,u).verified)return{verified:!0,result:n};{const u={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(Gi)&&(u.name=r.name),u}}if(r instanceof gr)return r.hasOwnProperty(Gi)&&(n[r.name]=e),{verified:!0,result:n};if(!(n instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!($l in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(zl in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Yl in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=r.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(Gl)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:n};if(r.idBlock.hasOwnProperty(Xl)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:n};if(r.idBlock.hasOwnProperty(Wl)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:n};if(!(jl in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:n};if(r.idBlock.isHexOnly){if(!(uu in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const u=r.idBlock.valueHexView,l=e.idBlock.valueHexView;if(u.length!==l.length)return{verified:!1,result:n};for(let f=0;f<u.length;f++)if(u[f]!==l[1])return{verified:!1,result:n}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,mt),r.name&&(n[r.name]=e)),r instanceof te.Constructed){let u=0,l={verified:!1,result:{error:"Unknown error"}},f=r.valueBlock.value.length;if(f>0&&r.valueBlock.value[0]instanceof Yn&&(f=e.valueBlock.value.length),f===0)return{verified:!0,result:n};if(e.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let p=!0;for(let g=0;g<r.valueBlock.value.length;g++)p=p&&(r.valueBlock.value[g].optional||!1);return p?{verified:!0,result:n}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,mt),r.name&&delete n[r.name]),n.error="Inconsistent object length",{verified:!1,result:n})}for(let p=0;p<f;p++)if(p-u>=e.valueBlock.value.length){if(r.valueBlock.value[p].optional===!1){const g={verified:!1,result:n};return n.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,mt),r.name&&(delete n[r.name],g.name=r.name)),g}}else if(r.valueBlock.value[0]instanceof Yn){if(l=ur(n,e.valueBlock.value[p],r.valueBlock.value[0].value),l.verified===!1)if(r.valueBlock.value[0].optional)u++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,mt),r.name&&delete n[r.name]),l;if(Gi in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let g={};Jl in r.valueBlock.value[0]&&r.valueBlock.value[0].local?g=e:g=n,typeof g[r.valueBlock.value[0].name]=="undefined"&&(g[r.valueBlock.value[0].name]=[]),g[r.valueBlock.value[0].name].push(e.valueBlock.value[p])}}else if(l=ur(n,e.valueBlock.value[p-u],r.valueBlock.value[p]),l.verified===!1)if(r.valueBlock.value[p].optional)u++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,mt),r.name&&delete n[r.name]),l;if(l.verified===!1){const p={verified:!1,result:n};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,mt),r.name&&(delete n[r.name],p.name=r.name)),p}return{verified:!0,result:n}}if(r.primitiveSchema&&uu in e.valueBlock){const u=Ir(e.valueBlock.valueHexView);if(u.offset===-1){const l={verified:!1,result:u.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,mt),r.name&&(delete n[r.name],l.name=r.name)),l}return ur(n,u.result,r.primitiveSchema)}return{verified:!0,result:n}}function rc(n,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=Ir(we.toUint8Array(n));return r.offset===-1?{verified:!1,result:r.result}:ur(r.result,r.result,e)}var na=Object.freeze({__proto__:null,Any:gr,BaseBlock:st,BaseStringBlock:Xi,BitString:dr,BmpString:Un,Boolean:Ln,CharacterString:Wn,Choice:io,Constructed:dt,DATE:Zi,DateTime:to,Duration:ro,EndOfContent:Wi,Enumerated:Mn,GeneralString:Xn,GeneralizedTime:zn,GraphicString:Gn,HexBlock:qt,IA5String:$n,Integer:kr,Null:pr,NumericString:Vn,ObjectIdentifier:Fn,OctetString:hr,Primitive:tn,PrintableString:Hn,RawData:tc,RelativeObjectIdentifier:Qi,Repeated:Yn,Sequence:It,Set:jt,TIME:no,TeletexString:qn,TimeOfDay:eo,UTCTime:on,UniversalString:Pn,Utf8String:Yt,ValueBlock:ht,VideotexString:jn,ViewWriter:kn,VisibleString:nn,compareSchema:ur,fromBER:Rr,verifySchema:rc}),j;(function(n){n[n.Sequence=0]="Sequence",n[n.Set=1]="Set",n[n.Choice=2]="Choice"})(j||(j={}));var T;(function(n){n[n.Any=1]="Any",n[n.Boolean=2]="Boolean",n[n.OctetString=3]="OctetString",n[n.BitString=4]="BitString",n[n.Integer=5]="Integer",n[n.Enumerated=6]="Enumerated",n[n.ObjectIdentifier=7]="ObjectIdentifier",n[n.Utf8String=8]="Utf8String",n[n.BmpString=9]="BmpString",n[n.UniversalString=10]="UniversalString",n[n.NumericString=11]="NumericString",n[n.PrintableString=12]="PrintableString",n[n.TeletexString=13]="TeletexString",n[n.VideotexString=14]="VideotexString",n[n.IA5String=15]="IA5String",n[n.GraphicString=16]="GraphicString",n[n.VisibleString=17]="VisibleString",n[n.GeneralString=18]="GeneralString",n[n.CharacterString=19]="CharacterString",n[n.UTCTime=20]="UTCTime",n[n.GeneralizedTime=21]="GeneralizedTime",n[n.DATE=22]="DATE",n[n.TimeOfDay=23]="TimeOfDay",n[n.DateTime=24]="DateTime",n[n.Duration=25]="Duration",n[n.TIME=26]="TIME",n[n.Null=27]="Null"})(T||(T={}));class Jn{constructor(e,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(we.isBufferSource(e))this.unusedBits=r,this.value=we.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof dr))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=e.valueBlock.valueHex,this}toASN(){return new dr({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new dr({name:e})}toNumber(){let e="";const r=new Uint8Array(this.value);for(const i of r)e+=i.toString(2).padStart(8,"0");return e=e.split("").reverse().join(""),this.unusedBits&&(e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(e,2)}fromNumber(e){let r=e.toString(2);const i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;const o=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let u=0;for(;u<i;)o[u]=parseInt(r.slice(u<<3,(u<<3)+8),2),u++;this.value=o.buffer}}class xe{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):we.isBufferSource(e)?this.buffer=we.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof hr))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new hr({valueHex:this.buffer})}toSchema(e){return new hr({name:e})}}const nc={fromASN:n=>n instanceof pr?null:n.valueBeforeDecodeView,toASN:n=>{if(n===null)return new pr;const e=Rr(n);if(e.result.error)throw new Error(e.result.error);return e.result}},ic={fromASN:n=>n.valueBlock.valueHexView.byteLength>=4?n.valueBlock.toString():n.valueBlock.valueDec,toASN:n=>new kr({value:+n})},oc={fromASN:n=>n.valueBlock.valueDec,toASN:n=>new Mn({value:n})},bt={fromASN:n=>n.valueBlock.valueHexView,toASN:n=>new kr({valueHex:n})},sc={fromASN:n=>n.valueBlock.valueHexView,toASN:n=>new dr({valueHex:n})},uc={fromASN:n=>n.valueBlock.toString(),toASN:n=>new Fn({value:n})},ac={fromASN:n=>n.valueBlock.value,toASN:n=>new Ln({value:n})},oo={fromASN:n=>n.valueBlock.valueHexView,toASN:n=>new hr({valueHex:n})},lc={fromASN:n=>new xe(n.getValue()),toASN:n=>n.toASN()};function xt(n){return{fromASN:e=>e.valueBlock.value,toASN:e=>new n({value:e})}}const cc=xt(Yt),fc=xt(Un),pc=xt(Pn),hc=xt(Vn),dc=xt(Hn),gc=xt(qn),mc=xt(jn),yc=xt($n),vc=xt(Gn),Ec=xt(nn),Ac=xt(Xn),Nc=xt(Wn),wc={fromASN:n=>n.toDate(),toASN:n=>new on({valueDate:n})},bc={fromASN:n=>n.toDate(),toASN:n=>new zn({valueDate:n})},Dc={fromASN:()=>null,toASN:()=>new pr};function sn(n){switch(n){case T.Any:return nc;case T.BitString:return sc;case T.BmpString:return fc;case T.Boolean:return ac;case T.CharacterString:return Nc;case T.Enumerated:return oc;case T.GeneralString:return Ac;case T.GeneralizedTime:return bc;case T.GraphicString:return vc;case T.IA5String:return yc;case T.Integer:return ic;case T.Null:return Dc;case T.NumericString:return hc;case T.ObjectIdentifier:return uc;case T.OctetString:return oo;case T.PrintableString:return dc;case T.TeletexString:return gc;case T.UTCTime:return wc;case T.UniversalString:return pc;case T.Utf8String:return cc;case T.VideotexString:return mc;case T.VisibleString:return Ec;default:return null}}function Jt(n){return typeof n=="function"&&n.prototype?n.prototype.toASN&&n.prototype.fromASN?!0:Jt(n.prototype):!!(n&&typeof n=="object"&&"toASN"in n&&"fromASN"in n)}function ia(n){var e;if(n){const r=Object.getPrototypeOf(n);return((e=r==null?void 0:r.prototype)===null||e===void 0?void 0:e.constructor)===Array?!0:ia(r)}return!1}function Cc(n,e){if(!(n&&e)||n.byteLength!==e.byteLength)return!1;const r=new Uint8Array(n),i=new Uint8Array(e);for(let o=0;o<n.byteLength;o++)if(r[o]!==i[o])return!1;return!0}class xc{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,r=!1){const i=this.items.get(e);if(!i)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(r&&!i.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(e){const r=this.get(e);r.schema||(r.schema=this.create(e,!0))}createDefault(e){const r={type:j.Sequence,items:{}},i=this.findParentSchema(e);return i&&(Object.assign(r,i),r.items=Object.assign({},r.items,i.items)),r}create(e,r){const i=this.items.get(e)||this.createDefault(e),o=[];for(const u in i.items){const l=i.items[u],f=r?u:"";let p;if(typeof l.type=="number"){const N=T[l.type],E=na[N];if(!E)throw new Error(`Cannot get ASN1 class by name '${N}'`);p=new E({name:f})}else Jt(l.type)?p=new l.type().toSchema(f):l.optional?this.get(l.type).type===j.Choice?p=new gr({name:f}):(p=this.create(l.type,!1),p.name=f):p=new gr({name:f});const g=!!l.optional||l.defaultValue!==void 0;if(l.repeated){p.name="";const N=l.repeated==="set"?jt:It;p=new N({name:"",value:[new Yn({name:f,value:p})]})}if(l.context!==null&&l.context!==void 0)if(l.implicit)if(typeof l.type=="number"||Jt(l.type)){const N=l.repeated?dt:tn;o.push(new N({name:f,optional:g,idBlock:{tagClass:3,tagNumber:l.context}}))}else{this.cache(l.type);const N=!!l.repeated;let E=N?p:this.get(l.type,!0).schema;E="valueBlock"in E?E.valueBlock.value:E.value,o.push(new dt({name:N?"":f,optional:g,idBlock:{tagClass:3,tagNumber:l.context},value:E}))}else o.push(new dt({optional:g,idBlock:{tagClass:3,tagNumber:l.context},value:[p]}));else p.optional=g,o.push(p)}switch(i.type){case j.Sequence:return new It({value:o,name:""});case j.Set:return new jt({value:o,name:""});case j.Choice:return new io({value:o,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,r){return this.items.set(e,r),this}findParentSchema(e){const r=Object.getPrototypeOf(e);return r?this.items.get(r)||this.findParentSchema(r):null}}const ut=new xc,ie=n=>e=>{let r;ut.has(e)?r=ut.get(e):(r=ut.createDefault(e),ut.set(e,r)),Object.assign(r,n)},d=n=>(e,r)=>{let i;ut.has(e.constructor)?i=ut.get(e.constructor):(i=ut.createDefault(e.constructor),ut.set(e.constructor,i));const o=Object.assign({},n);if(typeof o.type=="number"&&!o.converter){const u=sn(n.type);if(!u)throw new Error(`Cannot get default converter for property '${r}' of ${e.constructor.name}`);o.converter=u}o.raw=n.raw,i.items[r]=o};class un extends Error{constructor(){super(...arguments),this.schemas=[]}}class oa{static parse(e,r){const i=Rr(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,r)}static fromASN(e,r){try{if(Jt(r))return new r().fromASN(e);const i=ut.get(r);ut.cache(r);let o=i.schema;const u=this.handleChoiceTypes(e,i,r,o);if(u!=null&&u.result)return u.result;u!=null&&u.targetSchema&&(o=u.targetSchema);const l=this.handleSequenceTypes(e,i,r,o),f=new r;return ia(r)?this.handleArrayTypes(e,i,r):(this.processSchemaItems(i,l,f),f)}catch(i){throw i instanceof un&&i.schemas.push(r.name),i}}static handleChoiceTypes(e,r,i,o){if(e.constructor===dt&&r.type===j.Choice&&e.idBlock.tagClass===3)for(const u in r.items){const l=r.items[u];if(l.context===e.idBlock.tagNumber&&l.implicit&&typeof l.type=="function"&&ut.has(l.type)){const f=ut.get(l.type);if(f&&f.type===j.Sequence){const p=new It;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in p.valueBlock){p.valueBlock.value=e.valueBlock.value;const g=this.fromASN(p,l.type),N=new i;return N[u]=g,{result:N}}}}}else if(e.constructor===dt&&r.type!==j.Choice){const u=new dt({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:r.schema.valueBlock.value});for(const l in r.items)delete e[l];return{targetSchema:u}}return null}static handleSequenceTypes(e,r,i,o){if(r.type===j.Sequence){const u=ur({},e,o);if(!u.verified)throw new un(`Data does not match to ${i.name} ASN1 schema.${u.result.error?` ${u.result.error}`:""}`);return u}else{const u=ur({},e,o);if(!u.verified)throw new un(`Data does not match to ${i.name} ASN1 schema.${u.result.error?` ${u.result.error}`:""}`);return u}}static processRepeatedField(e,r,i){let o=e.slice(r);if(o.length===1&&o[0].constructor.name==="Sequence"){const u=o[0];u.valueBlock&&u.valueBlock.value&&Array.isArray(u.valueBlock.value)&&(o=u.valueBlock.value)}if(typeof i.type=="number"){const u=sn(i.type);if(!u)throw new Error(`No converter for ASN.1 type ${i.type}`);return o.filter(l=>l&&l.valueBlock).map(l=>{try{return u.fromASN(l)}catch(f){return}}).filter(l=>l!==void 0)}else return o.filter(u=>u&&u.valueBlock).map(u=>{try{return this.fromASN(u,i.type)}catch(l){return}}).filter(u=>u!==void 0)}static processPrimitiveField(e,r){const i=sn(r.type);if(!i)throw new Error(`No converter for ASN.1 type ${r.type}`);return i.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&ut.has(e.type)&&ut.get(e.type).type===j.Choice}static processOptionalChoiceField(e,r){try{return{processed:!0,value:this.fromASN(e,r.type)}}catch(i){if(i instanceof un&&/Wrong values for Choice type/.test(i.message))return{processed:!1};throw i}}static handleArrayTypes(e,r,i){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const o=r.itemType;if(typeof o=="number"){const u=sn(o);if(!u)throw new Error(`Cannot get default converter for array item of ${i.name} ASN1 schema`);return i.from(e.valueBlock.value,l=>u.fromASN(l))}else return i.from(e.valueBlock.value,u=>this.fromASN(u,o))}static processSchemaItems(e,r,i){for(const o in e.items){const u=r.result[o];if(!u)continue;const l=e.items[o],f=l.type;let p;typeof f=="number"||Jt(f)?p=this.processPrimitiveSchemaItem(u,l,f):p=this.processComplexSchemaItem(u,l,f),p&&typeof p=="object"&&"value"in p&&"raw"in p?(i[o]=p.value,i[`${o}Raw`]=p.raw):i[o]=p}}static processPrimitiveSchemaItem(e,r,i){var o;const u=(o=r.converter)!==null&&o!==void 0?o:Jt(i)?new i:null;if(!u)throw new Error("Converter is empty");return r.repeated?this.processRepeatedPrimitiveItem(e,r,u):this.processSinglePrimitiveItem(e,r,i,u)}static processRepeatedPrimitiveItem(e,r,i){if(r.implicit){const o=r.repeated==="sequence"?It:jt,u=new o;u.valueBlock=e.valueBlock;const l=Rr(u.toBER(!1));if(l.offset===-1)throw new Error(`Cannot parse the child item. ${l.result.error}`);if(!("value"in l.result.valueBlock&&Array.isArray(l.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const f=l.result.valueBlock.value;return Array.from(f,p=>i.fromASN(p))}else return Array.from(e,o=>i.fromASN(o))}static processSinglePrimitiveItem(e,r,i,o){let u=e;if(r.implicit){let l;if(Jt(i))l=new i().toSchema("");else{const f=T[i],p=na[f];if(!p)throw new Error(`Cannot get '${f}' class from asn1js module`);l=new p}l.valueBlock=u.valueBlock,u=Rr(l.toBER(!1)).result}return o.fromASN(u)}static processComplexSchemaItem(e,r,i){if(r.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,o=>this.fromASN(o,i))}else{const o=this.handleImplicitTagging(e,r,i);if(this.isOptionalChoiceField(r))try{return this.fromASN(o,i)}catch(u){if(u instanceof un&&/Wrong values for Choice type/.test(u.message))return;throw u}else{const u=this.fromASN(o,i);return r.raw?{value:u,raw:e.valueBeforeDecodeView}:u}}}static handleImplicitTagging(e,r,i){if(r.implicit&&typeof r.context=="number"){const o=ut.get(i);if(o.type===j.Sequence){const u=new It;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in u.valueBlock)return u.valueBlock.value=e.valueBlock.value,u}else if(o.type===j.Set){const u=new jt;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in u.valueBlock)return u.valueBlock.value=e.valueBlock.value,u}}return e}}class so{static serialize(e){return e instanceof st?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&Jt(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=e.constructor,i=ut.get(r);ut.cache(r);let o=[];if(i.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const l=sn(i.itemType);if(!l)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=e.map(f=>l.toASN(f))}else o=e.map(l=>this.toAsnItem({type:i.itemType},"[]",r,l))}else for(const l in i.items){const f=i.items[l],p=e[l];if(p===void 0||f.defaultValue===p||typeof f.defaultValue=="object"&&typeof p=="object"&&Cc(this.serialize(f.defaultValue),this.serialize(p)))continue;const g=so.toAsnItem(f,l,r,p);if(typeof f.context=="number")if(f.implicit)if(!f.repeated&&(typeof f.type=="number"||Jt(f.type))){const N={};N.valueHex=g instanceof pr?g.valueBeforeDecodeView:g.valueBlock.toBER(),o.push(new tn(Fe({optional:f.optional,idBlock:{tagClass:3,tagNumber:f.context}},N)))}else o.push(new dt({optional:f.optional,idBlock:{tagClass:3,tagNumber:f.context},value:g.valueBlock.value}));else o.push(new dt({optional:f.optional,idBlock:{tagClass:3,tagNumber:f.context},value:[g]}));else f.repeated?o=o.concat(g):o.push(g)}let u;switch(i.type){case j.Sequence:u=new It({value:o});break;case j.Set:u=new jt({value:o});break;case j.Choice:if(!o[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);u=o[0];break}return u}static toAsnItem(e,r,i,o){let u;if(typeof e.type=="number"){const l=e.converter;if(!l)throw new Error(`Property '${r}' doesn't have converter for type ${T[e.type]} in schema '${i.name}'`);if(e.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const f=Array.from(o,g=>l.toASN(g)),p=e.repeated==="sequence"?It:jt;u=new p({value:f})}else u=l.toASN(o)}else if(e.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const l=Array.from(o,p=>this.toASN(p)),f=e.repeated==="sequence"?It:jt;u=new f({value:l})}else u=this.toASN(o);return u}}class Ue extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const r of e)this.push(r)}}}class Rt{static serialize(e){return so.serialize(e)}static parse(e,r){return oa.parse(e,r)}static toString(e){const r=we.isBufferSource(e)?we.toArrayBuffer(e):Rt.serialize(e),i=Rr(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function h(n,e,r,i){var o=arguments.length,u=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,e,r,i);else for(var f=n.length-1;f>=0;f--)(l=n[f])&&(u=(o<3?l(u):o>3?l(e,r,u):l(e,r))||u);return o>3&&u&&Object.defineProperty(e,r,u),u}typeof SuppressedError=="function"&&SuppressedError;var uo;let sa=uo=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,uo.prototype)}};sa=uo=h([ie({type:j.Sequence,itemType:T.ObjectIdentifier})],sa);let ao=class{constructor(e=new Date){this.value=e}};h([d({type:T.GeneralizedTime})],ao.prototype,"value",void 0),ao=h([ie({type:j.Choice})],ao);let lo=class{constructor(e=null){this.value=e}};h([d({type:T.Null})],lo.prototype,"value",void 0),lo=h([ie({type:j.Choice})],lo);class ua{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){const r=e.split(".");if(r.length!==4)throw new Error("Invalid IPv4 address");return r.map(i=>{const o=parseInt(i,10);if(isNaN(o)||o<0||o>255)throw new Error("Invalid IPv4 address part");return o})}static parseIPv6(e){const i=this.expandIPv6(e).split(":");if(i.length!==8)throw new Error("Invalid IPv6 address");return i.reduce((o,u)=>{const l=parseInt(u,16);if(isNaN(l)||l<0||l>65535)throw new Error("Invalid IPv6 address part");return o.push(l>>8&255),o.push(l&255),o},[])}static expandIPv6(e){if(!e.includes("::"))return e;const r=e.split("::");if(r.length>2)throw new Error("Invalid IPv6 address");const i=r[0]?r[0].split(":"):[],o=r[1]?r[1].split(":"):[],u=8-(i.length+o.length);if(u<0)throw new Error("Invalid IPv6 address");return[...i,...Array(u).fill("0"),...o].join(":")}static formatIPv6(e){const r=[];for(let i=0;i<16;i+=2)r.push((e[i]<<8|e[i+1]).toString(16));return this.compressIPv6(r.join(":"))}static compressIPv6(e){const r=e.split(":");let i=-1,o=0,u=-1,l=0;for(let f=0;f<r.length;f++)r[f]==="0"?(u===-1&&(u=f),l++):(l>o&&(i=u,o=l),u=-1,l=0);if(l>o&&(i=u,o=l),o>1){const f=r.slice(0,i).join(":"),p=r.slice(i+o).join(":");return`${f}::${p}`}return e}static parseCIDR(e){const[r,i]=e.split("/"),o=parseInt(i,10);if(this.isIPv4(r)){if(o<0||o>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(r),o]}else{if(o<0||o>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(r),o]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;const r=parseInt(e.slice(8),16).toString(2).split("").reduce((o,u)=>o+ +u,0);let i=e.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return i=i.slice(0,-1),`${i}/${r}`}static toString(e){const r=new Uint8Array(e);if(r.length===4)return Array.from(r).join(".");if(r.length===16)return this.formatIPv6(r);if(r.length===8||r.length===32){const i=r.length/2,o=r.slice(0,i),u=r.slice(i);if(r.every(p=>p===0))return r.length===8?"0.0.0.0/0":"::/0";const f=u.reduce((p,g)=>p+(g.toString(2).match(/1/g)||[]).length,0);return r.length===8?`${Array.from(o).join(".")}/${f}`:`${this.formatIPv6(o)}/${f}`}return this.decodeIP(Ve.ToHex(e))}static fromString(e){if(e.includes("/")){const[i,o]=this.parseCIDR(e),u=new Uint8Array(i.length);let l=o;for(let p=0;p<u.length;p++)l>=8?(u[p]=255,l-=8):l>0&&(u[p]=255<<8-l,l=0);const f=new Uint8Array(i.length*2);return f.set(i,0),f.set(u,i.length),f.buffer}const r=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(r).buffer}}var co,fo,po;let kt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};h([d({type:T.TeletexString})],kt.prototype,"teletexString",void 0),h([d({type:T.PrintableString})],kt.prototype,"printableString",void 0),h([d({type:T.UniversalString})],kt.prototype,"universalString",void 0),h([d({type:T.Utf8String})],kt.prototype,"utf8String",void 0),h([d({type:T.BmpString})],kt.prototype,"bmpString",void 0),kt=h([ie({type:j.Choice})],kt);let _r=class extends kt{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?Ve.ToHex(this.anyValue):super.toString())}};h([d({type:T.IA5String})],_r.prototype,"ia5String",void 0),h([d({type:T.Any})],_r.prototype,"anyValue",void 0),_r=h([ie({type:j.Choice})],_r);class ho{constructor(e={}){this.type="",this.value=new _r,Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],ho.prototype,"type",void 0),h([d({type:_r})],ho.prototype,"value",void 0);let Kn=co=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,co.prototype)}};Kn=co=h([ie({type:j.Set,itemType:ho})],Kn);let go=fo=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,fo.prototype)}};go=fo=h([ie({type:j.Sequence,itemType:Kn})],go);let yt=po=class extends go{constructor(e){super(e),Object.setPrototypeOf(this,po.prototype)}};yt=po=h([ie({type:j.Sequence})],yt);const Tc={fromASN:n=>ua.toString(oo.fromASN(n)),toASN:n=>oo.toASN(ua.fromString(n))};class mo{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],mo.prototype,"typeId",void 0),h([d({type:T.Any,context:0})],mo.prototype,"value",void 0);class yo{constructor(e={}){this.partyName=new kt,Object.assign(this,e)}}h([d({type:kt,optional:!0,context:0,implicit:!0})],yo.prototype,"nameAssigner",void 0),h([d({type:kt,context:1,implicit:!0})],yo.prototype,"partyName",void 0);let Se=class{constructor(e={}){Object.assign(this,e)}};h([d({type:mo,context:0,implicit:!0})],Se.prototype,"otherName",void 0),h([d({type:T.IA5String,context:1,implicit:!0})],Se.prototype,"rfc822Name",void 0),h([d({type:T.IA5String,context:2,implicit:!0})],Se.prototype,"dNSName",void 0),h([d({type:T.Any,context:3,implicit:!0})],Se.prototype,"x400Address",void 0),h([d({type:yt,context:4,implicit:!1})],Se.prototype,"directoryName",void 0),h([d({type:yo,context:5})],Se.prototype,"ediPartyName",void 0),h([d({type:T.IA5String,context:6,implicit:!0})],Se.prototype,"uniformResourceIdentifier",void 0),h([d({type:T.OctetString,context:7,implicit:!0,converter:Tc})],Se.prototype,"iPAddress",void 0),h([d({type:T.ObjectIdentifier,context:8,implicit:!0})],Se.prototype,"registeredID",void 0),Se=h([ie({type:j.Choice})],Se);var vo;class Qn{constructor(e={}){this.accessMethod="",this.accessLocation=new Se,Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],Qn.prototype,"accessMethod",void 0),h([d({type:Se})],Qn.prototype,"accessLocation",void 0);let Zn=vo=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,vo.prototype)}};Zn=vo=h([ie({type:j.Sequence,itemType:Qn})],Zn);class aa extends xe{}class Eo{constructor(e={}){e&&Object.assign(this,e)}}h([d({type:aa,context:0,optional:!0,implicit:!0})],Eo.prototype,"keyIdentifier",void 0),h([d({type:Se,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Eo.prototype,"authorityCertIssuer",void 0),h([d({type:T.Integer,context:2,optional:!0,implicit:!0,converter:bt})],Eo.prototype,"authorityCertSerialNumber",void 0);class la{constructor(e={}){this.cA=!1,Object.assign(this,e)}}h([d({type:T.Boolean,defaultValue:!1})],la.prototype,"cA",void 0),h([d({type:T.Integer,optional:!0})],la.prototype,"pathLenConstraint",void 0);var Ao;let _t=Ao=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,Ao.prototype)}};_t=Ao=h([ie({type:j.Sequence,itemType:Se})],_t);var No;let ca=No=class extends _t{constructor(e){super(e),Object.setPrototypeOf(this,No.prototype)}};ca=No=h([ie({type:j.Sequence})],ca);var wo;let Kt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};h([d({type:T.IA5String})],Kt.prototype,"ia5String",void 0),h([d({type:T.VisibleString})],Kt.prototype,"visibleString",void 0),h([d({type:T.BmpString})],Kt.prototype,"bmpString",void 0),h([d({type:T.Utf8String})],Kt.prototype,"utf8String",void 0),Kt=h([ie({type:j.Choice})],Kt);class bo{constructor(e={}){this.organization=new Kt,this.noticeNumbers=[],Object.assign(this,e)}}h([d({type:Kt})],bo.prototype,"organization",void 0),h([d({type:T.Integer,repeated:"sequence"})],bo.prototype,"noticeNumbers",void 0);class Do{constructor(e={}){Object.assign(this,e)}}h([d({type:bo,optional:!0})],Do.prototype,"noticeRef",void 0),h([d({type:Kt,optional:!0})],Do.prototype,"explicitText",void 0);let ei=class{constructor(e={}){Object.assign(this,e)}};h([d({type:T.IA5String})],ei.prototype,"cPSuri",void 0),h([d({type:Do})],ei.prototype,"userNotice",void 0),ei=h([ie({type:j.Choice})],ei);class Co{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],Co.prototype,"policyQualifierId",void 0),h([d({type:T.Any})],Co.prototype,"qualifier",void 0);class xo{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],xo.prototype,"policyIdentifier",void 0),h([d({type:Co,repeated:"sequence",optional:!0})],xo.prototype,"policyQualifiers",void 0);let fa=wo=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,wo.prototype)}};fa=wo=h([ie({type:j.Sequence,itemType:xo})],fa);let ti=class{constructor(e=0){this.value=e}};h([d({type:T.Integer})],ti.prototype,"value",void 0),ti=h([ie({type:j.Choice})],ti);let pa=class extends ti{};pa=h([ie({type:j.Choice})],pa);var To,Lt;(function(n){n[n.unused=1]="unused",n[n.keyCompromise=2]="keyCompromise",n[n.cACompromise=4]="cACompromise",n[n.affiliationChanged=8]="affiliationChanged",n[n.superseded=16]="superseded",n[n.cessationOfOperation=32]="cessationOfOperation",n[n.certificateHold=64]="certificateHold",n[n.privilegeWithdrawn=128]="privilegeWithdrawn",n[n.aACompromise=256]="aACompromise"})(Lt||(Lt={}));class ha extends Jn{toJSON(){const e=[],r=this.toNumber();return r&Lt.aACompromise&&e.push("aACompromise"),r&Lt.affiliationChanged&&e.push("affiliationChanged"),r&Lt.cACompromise&&e.push("cACompromise"),r&Lt.certificateHold&&e.push("certificateHold"),r&Lt.cessationOfOperation&&e.push("cessationOfOperation"),r&Lt.keyCompromise&&e.push("keyCompromise"),r&Lt.privilegeWithdrawn&&e.push("privilegeWithdrawn"),r&Lt.superseded&&e.push("superseded"),r&Lt.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let Lr=class{constructor(e={}){Object.assign(this,e)}};h([d({type:Se,context:0,repeated:"sequence",implicit:!0})],Lr.prototype,"fullName",void 0),h([d({type:Kn,context:1,implicit:!0})],Lr.prototype,"nameRelativeToCRLIssuer",void 0),Lr=h([ie({type:j.Choice})],Lr);class an{constructor(e={}){Object.assign(this,e)}}h([d({type:Lr,context:0,optional:!0})],an.prototype,"distributionPoint",void 0),h([d({type:ha,context:1,optional:!0,implicit:!0})],an.prototype,"reasons",void 0),h([d({type:Se,context:2,optional:!0,repeated:"sequence",implicit:!0})],an.prototype,"cRLIssuer",void 0);let So=To=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,To.prototype)}};So=To=h([ie({type:j.Sequence,itemType:an})],So);var Bo;let da=Bo=class extends So{constructor(e){super(e),Object.setPrototypeOf(this,Bo.prototype)}};da=Bo=h([ie({type:j.Sequence,itemType:an})],da);class ft{constructor(e={}){this.onlyContainsUserCerts=ft.ONLY,this.onlyContainsCACerts=ft.ONLY,this.indirectCRL=ft.ONLY,this.onlyContainsAttributeCerts=ft.ONLY,Object.assign(this,e)}}ft.ONLY=!1,h([d({type:Lr,context:0,optional:!0})],ft.prototype,"distributionPoint",void 0),h([d({type:T.Boolean,context:1,defaultValue:ft.ONLY,implicit:!0})],ft.prototype,"onlyContainsUserCerts",void 0),h([d({type:T.Boolean,context:2,defaultValue:ft.ONLY,implicit:!0})],ft.prototype,"onlyContainsCACerts",void 0),h([d({type:ha,context:3,optional:!0,implicit:!0})],ft.prototype,"onlySomeReasons",void 0),h([d({type:T.Boolean,context:4,defaultValue:ft.ONLY,implicit:!0})],ft.prototype,"indirectCRL",void 0),h([d({type:T.Boolean,context:5,defaultValue:ft.ONLY,implicit:!0})],ft.prototype,"onlyContainsAttributeCerts",void 0);var ln;(function(n){n[n.unspecified=0]="unspecified",n[n.keyCompromise=1]="keyCompromise",n[n.cACompromise=2]="cACompromise",n[n.affiliationChanged=3]="affiliationChanged",n[n.superseded=4]="superseded",n[n.cessationOfOperation=5]="cessationOfOperation",n[n.certificateHold=6]="certificateHold",n[n.removeFromCRL=8]="removeFromCRL",n[n.privilegeWithdrawn=9]="privilegeWithdrawn",n[n.aACompromise=10]="aACompromise"})(ln||(ln={}));let ri=class{constructor(e=ln.unspecified){this.reason=ln.unspecified,this.reason=e}toJSON(){return ln[this.reason]}toString(){return this.toJSON()}};h([d({type:T.Enumerated})],ri.prototype,"reason",void 0),ri=h([ie({type:j.Choice})],ri);var Oo;let ga=Oo=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,Oo.prototype)}};ga=Oo=h([ie({type:j.Sequence,itemType:T.ObjectIdentifier})],ga);let Io=class{constructor(e=new ArrayBuffer(0)){this.value=e}};h([d({type:T.Integer,converter:bt})],Io.prototype,"value",void 0),Io=h([ie({type:j.Choice})],Io);let Ro=class{constructor(e){this.value=new Date,e&&(this.value=e)}};h([d({type:T.GeneralizedTime})],Ro.prototype,"value",void 0),Ro=h([ie({type:j.Choice})],Ro);var ko;let ma=ko=class extends _t{constructor(e){super(e),Object.setPrototypeOf(this,ko.prototype)}};ma=ko=h([ie({type:j.Sequence})],ma);var ya;(function(n){n[n.digitalSignature=1]="digitalSignature",n[n.nonRepudiation=2]="nonRepudiation",n[n.keyEncipherment=4]="keyEncipherment",n[n.dataEncipherment=8]="dataEncipherment",n[n.keyAgreement=16]="keyAgreement",n[n.keyCertSign=32]="keyCertSign",n[n.cRLSign=64]="cRLSign",n[n.encipherOnly=128]="encipherOnly",n[n.decipherOnly=256]="decipherOnly"})(ya||(ya={}));var _o;class ni{constructor(e={}){this.base=new Se,this.minimum=0,Object.assign(this,e)}}h([d({type:Se})],ni.prototype,"base",void 0),h([d({type:T.Integer,context:0,defaultValue:0,implicit:!0})],ni.prototype,"minimum",void 0),h([d({type:T.Integer,context:1,optional:!0,implicit:!0})],ni.prototype,"maximum",void 0);let ii=_o=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,_o.prototype)}};ii=_o=h([ie({type:j.Sequence,itemType:ni})],ii);class va{constructor(e={}){Object.assign(this,e)}}h([d({type:ii,context:0,optional:!0,implicit:!0})],va.prototype,"permittedSubtrees",void 0),h([d({type:ii,context:1,optional:!0,implicit:!0})],va.prototype,"excludedSubtrees",void 0);class Ea{constructor(e={}){Object.assign(this,e)}}h([d({type:T.Integer,context:0,implicit:!0,optional:!0,converter:bt})],Ea.prototype,"requireExplicitPolicy",void 0),h([d({type:T.Integer,context:1,implicit:!0,optional:!0,converter:bt})],Ea.prototype,"inhibitPolicyMapping",void 0);var Lo;class Mo{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],Mo.prototype,"issuerDomainPolicy",void 0),h([d({type:T.ObjectIdentifier})],Mo.prototype,"subjectDomainPolicy",void 0);let Aa=Lo=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,Lo.prototype)}};Aa=Lo=h([ie({type:j.Sequence,itemType:Mo})],Aa);var Fo;let Na=Fo=class extends _t{constructor(e){super(e),Object.setPrototypeOf(this,Fo.prototype)}};Na=Fo=h([ie({type:j.Sequence})],Na);class cn{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],cn.prototype,"type",void 0),h([d({type:T.Any,repeated:"set"})],cn.prototype,"values",void 0);var Uo;let wa=Uo=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,Uo.prototype)}};wa=Uo=h([ie({type:j.Sequence,itemType:cn})],wa);class pn extends aa{}class ba{constructor(e={}){Object.assign(this,e)}}h([d({type:T.GeneralizedTime,context:0,implicit:!0,optional:!0})],ba.prototype,"notBefore",void 0),h([d({type:T.GeneralizedTime,context:1,implicit:!0,optional:!0})],ba.prototype,"notAfter",void 0);var hn;(function(n){n[n.keyUpdateAllowed=1]="keyUpdateAllowed",n[n.newExtensions=2]="newExtensions",n[n.pKIXCertificate=4]="pKIXCertificate"})(hn||(hn={}));class Da extends Jn{toJSON(){const e=[],r=this.toNumber();return r&hn.pKIXCertificate&&e.push("pKIXCertificate"),r&hn.newExtensions&&e.push("newExtensions"),r&hn.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class Ca{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Da,Object.assign(this,e)}}h([d({type:T.GeneralString})],Ca.prototype,"entrustVers",void 0),h([d({type:Da})],Ca.prototype,"entrustInfoFlags",void 0);var Po;let xa=Po=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,Po.prototype)}};xa=Po=h([ie({type:j.Sequence,itemType:Qn})],xa);class ve{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof ve&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&Vl(e.parameters,this.parameters)||e.parameters===this.parameters)}}h([d({type:T.ObjectIdentifier})],ve.prototype,"algorithm",void 0),h([d({type:T.Any,optional:!0})],ve.prototype,"parameters",void 0);class oi{constructor(e={}){this.algorithm=new ve,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:ve})],oi.prototype,"algorithm",void 0),h([d({type:T.BitString})],oi.prototype,"subjectPublicKey",void 0);let pt=class{constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){const r=new Date(e);r.setMilliseconds(0),r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}else Object.assign(this,e)}getTime(){const e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};h([d({type:T.UTCTime})],pt.prototype,"utcTime",void 0),h([d({type:T.GeneralizedTime})],pt.prototype,"generalTime",void 0),pt=h([ie({type:j.Choice})],pt);class si{constructor(e){this.notBefore=new pt(new Date),this.notAfter=new pt(new Date),e&&(this.notBefore=new pt(e.notBefore),this.notAfter=new pt(e.notAfter))}}h([d({type:pt})],si.prototype,"notBefore",void 0),h([d({type:pt})],si.prototype,"notAfter",void 0);var Vo;class vt{constructor(e={}){this.extnID="",this.critical=vt.CRITICAL,this.extnValue=new xe,Object.assign(this,e)}}vt.CRITICAL=!1,h([d({type:T.ObjectIdentifier})],vt.prototype,"extnID",void 0),h([d({type:T.Boolean,defaultValue:vt.CRITICAL})],vt.prototype,"critical",void 0),h([d({type:xe})],vt.prototype,"extnValue",void 0);let Mr=Vo=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,Vo.prototype)}};Mr=Vo=h([ie({type:j.Sequence,itemType:vt})],Mr);var ui;(function(n){n[n.v1=0]="v1",n[n.v2=1]="v2",n[n.v3=2]="v3"})(ui||(ui={}));class Tt{constructor(e={}){this.version=ui.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new ve,this.issuer=new yt,this.validity=new si,this.subject=new yt,this.subjectPublicKeyInfo=new oi,Object.assign(this,e)}}h([d({type:T.Integer,context:0,defaultValue:ui.v1})],Tt.prototype,"version",void 0),h([d({type:T.Integer,converter:bt})],Tt.prototype,"serialNumber",void 0),h([d({type:ve})],Tt.prototype,"signature",void 0),h([d({type:yt})],Tt.prototype,"issuer",void 0),h([d({type:si})],Tt.prototype,"validity",void 0),h([d({type:yt})],Tt.prototype,"subject",void 0),h([d({type:oi})],Tt.prototype,"subjectPublicKeyInfo",void 0),h([d({type:T.BitString,context:1,implicit:!0,optional:!0})],Tt.prototype,"issuerUniqueID",void 0),h([d({type:T.BitString,context:2,implicit:!0,optional:!0})],Tt.prototype,"subjectUniqueID",void 0),h([d({type:Mr,context:3,optional:!0})],Tt.prototype,"extensions",void 0);class mr{constructor(e={}){this.tbsCertificate=new Tt,this.signatureAlgorithm=new ve,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:Tt,raw:!0})],mr.prototype,"tbsCertificate",void 0),h([d({type:ve})],mr.prototype,"signatureAlgorithm",void 0),h([d({type:T.BitString})],mr.prototype,"signatureValue",void 0);class ai{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new pt,Object.assign(this,e)}}h([d({type:T.Integer,converter:bt})],ai.prototype,"userCertificate",void 0),h([d({type:pt})],ai.prototype,"revocationDate",void 0),h([d({type:vt,optional:!0,repeated:"sequence"})],ai.prototype,"crlEntryExtensions",void 0);class Qt{constructor(e={}){this.signature=new ve,this.issuer=new yt,this.thisUpdate=new pt,Object.assign(this,e)}}h([d({type:T.Integer,optional:!0})],Qt.prototype,"version",void 0),h([d({type:ve})],Qt.prototype,"signature",void 0),h([d({type:yt})],Qt.prototype,"issuer",void 0),h([d({type:pt})],Qt.prototype,"thisUpdate",void 0),h([d({type:pt,optional:!0})],Qt.prototype,"nextUpdate",void 0),h([d({type:ai,repeated:"sequence",optional:!0})],Qt.prototype,"revokedCertificates",void 0),h([d({type:vt,optional:!0,context:0,repeated:"sequence"})],Qt.prototype,"crlExtensions",void 0);class Ho{constructor(e={}){this.tbsCertList=new Qt,this.signatureAlgorithm=new ve,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:Qt,raw:!0})],Ho.prototype,"tbsCertList",void 0),h([d({type:ve})],Ho.prototype,"signatureAlgorithm",void 0),h([d({type:T.BitString})],Ho.prototype,"signature",void 0);var qo;class jo{constructor(e={}){this.sigIdentifier=new ve,Object.assign(this,e)}}h([d({type:ve})],jo.prototype,"sigIdentifier",void 0),h([d({type:ve,optional:!0})],jo.prototype,"certIdentifier",void 0);let Ta=qo=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,qo.prototype)}};Ta=qo=h([ie({type:j.Sequence,itemType:jo})],Ta);class Sa{constructor(e={}){this.issuer=new yt,this.locator=new Zn,Object.assign(this,e)}}h([d({type:yt})],Sa.prototype,"issuer",void 0),h([d({type:Zn})],Sa.prototype,"locator",void 0);class Sc extends xe{}let Fr=class{constructor(e={}){Object.assign(this,e)}};h([d({type:yt,context:1})],Fr.prototype,"byName",void 0),h([d({type:Sc,context:2})],Fr.prototype,"byKey",void 0),Fr=h([ie({type:j.Choice})],Fr);class Zt{constructor(e={}){this.hashAlgorithm=new ve,this.issuerNameHash=new xe,this.issuerKeyHash=new xe,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:ve})],Zt.prototype,"hashAlgorithm",void 0),h([d({type:xe})],Zt.prototype,"issuerNameHash",void 0),h([d({type:xe})],Zt.prototype,"issuerKeyHash",void 0),h([d({type:T.Integer,converter:bt})],Zt.prototype,"serialNumber",void 0);class $o{constructor(e={}){this.revocationTime=new Date,Object.assign(this,e)}}h([d({type:T.GeneralizedTime})],$o.prototype,"revocationTime",void 0),h([d({type:ri,context:0,optional:!0})],$o.prototype,"revocationReason",void 0);let yr=class{constructor(e={}){Object.assign(this,e)}};h([d({type:T.Null,context:0,implicit:!0})],yr.prototype,"good",void 0),h([d({type:$o,context:1,implicit:!0})],yr.prototype,"revoked",void 0),h([d({type:T.Null,context:2,implicit:!0})],yr.prototype,"unknown",void 0),yr=h([ie({type:j.Choice})],yr);class Ur{constructor(e={}){this.certID=new Zt,this.certStatus=new yr,this.thisUpdate=new Date,Object.assign(this,e)}}h([d({type:Zt})],Ur.prototype,"certID",void 0),h([d({type:yr})],Ur.prototype,"certStatus",void 0),h([d({type:T.GeneralizedTime})],Ur.prototype,"thisUpdate",void 0),h([d({type:T.GeneralizedTime,context:0,optional:!0})],Ur.prototype,"nextUpdate",void 0),h([d({type:vt,context:1,repeated:"sequence",optional:!0})],Ur.prototype,"singleExtensions",void 0);var Pr;(function(n){n[n.v1=0]="v1"})(Pr||(Pr={}));class vr{constructor(e={}){this.version=Pr.v1,this.responderID=new Fr,this.producedAt=new Date,this.responses=[],Object.assign(this,e)}}h([d({type:T.Integer,context:0,defaultValue:Pr.v1})],vr.prototype,"version",void 0),h([d({type:Fr})],vr.prototype,"responderID",void 0),h([d({type:T.GeneralizedTime})],vr.prototype,"producedAt",void 0),h([d({type:Ur,repeated:"sequence"})],vr.prototype,"responses",void 0),h([d({type:vt,repeated:"sequence",context:1,optional:!0})],vr.prototype,"responseExtensions",void 0);class dn{constructor(e={}){this.tbsResponseData=new vr,this.signatureAlgorithm=new ve,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:vr,raw:!0})],dn.prototype,"tbsResponseData",void 0),h([d({type:ve})],dn.prototype,"signatureAlgorithm",void 0),h([d({type:T.BitString})],dn.prototype,"signature",void 0),h([d({type:mr,repeated:"sequence",optional:!0,context:0})],dn.prototype,"certs",void 0);class li{constructor(e={}){this.signatureAlgorithm=new ve,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:ve})],li.prototype,"signatureAlgorithm",void 0),h([d({type:T.BitString})],li.prototype,"signature",void 0),h([d({type:mr,repeated:"sequence",optional:!0,context:0})],li.prototype,"certs",void 0);class ci{constructor(e={}){this.reqCert=new Zt,Object.assign(this,e)}}h([d({type:Zt})],ci.prototype,"reqCert",void 0),h([d({type:vt,repeated:"sequence",optional:!0})],ci.prototype,"singleRequestExtensions",void 0);class Er{constructor(e={}){this.version=Pr.v1,this.requestList=[],Object.assign(this,e)}}h([d({type:T.Integer,context:0,defaultValue:Pr.v1})],Er.prototype,"version",void 0),h([d({type:Se,context:1,optional:!0})],Er.prototype,"requestorName",void 0),h([d({type:ci,repeated:"sequence"})],Er.prototype,"requestList",void 0),h([d({type:vt,context:2,optional:!0,repeated:"sequence"})],Er.prototype,"requestExtensions",void 0);class Go{constructor(e={}){this.tbsRequest=new Er,Object.assign(this,e)}}h([d({type:Er,raw:!0})],Go.prototype,"tbsRequest",void 0),h([d({type:li,optional:!0,context:0})],Go.prototype,"optionalSignature",void 0);var er;(function(n){n[n.successful=0]="successful",n[n.malformedRequest=1]="malformedRequest",n[n.internalError=2]="internalError",n[n.tryLater=3]="tryLater",n[n.sigRequired=5]="sigRequired",n[n.unauthorized=6]="unauthorized"})(er||(er={}));class Xo{constructor(e={}){this.responseType="",this.response=new xe,Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],Xo.prototype,"responseType",void 0),h([d({type:xe})],Xo.prototype,"response",void 0);class Wo{constructor(e={}){this.responseStatus=er.successful,Object.assign(this,e)}}h([d({type:T.Enumerated})],Wo.prototype,"responseStatus",void 0),h([d({type:Xo,context:0,optional:!0})],Wo.prototype,"responseBytes",void 0);var fi=(n,e,r)=>new Promise((i,o)=>{var u=p=>{try{f(r.next(p))}catch(g){o(g)}},l=p=>{try{f(r.throw(p))}catch(g){o(g)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,l);f((r=r.apply(n,e)).next())});function zo(n){return fi(this,arguments,function*(e,r={}){const{timeout:i=1e4,method:o="GET",body:u,contentType:l,accept:f,proxyUrl:p}=r,g=p?`${p}${encodeURIComponent(e)}`:e,N=new AbortController,E=setTimeout(()=>N.abort(),i);try{const S={};l&&(S["Content-Type"]=l),f&&(S.Accept=f);const C=yield fetch(g,{method:o,headers:S,body:u?new Uint8Array(u):void 0,signal:N.signal});if(clearTimeout(E),!C.ok)return{ok:!1,status:C.status,error:`HTTP ${C.status}: ${C.statusText}`};const I=yield C.arrayBuffer();return{ok:!0,status:C.status,data:I}}catch(S){return clearTimeout(E),S instanceof Error?S.name==="AbortError"?{ok:!1,status:0,error:`Request timeout after ${i}ms`}:{ok:!1,status:0,error:S.message}:{ok:!1,status:0,error:String(S)}}})}function Bc(n,e,r=5e3,i){return fi(this,null,function*(){return zo(n,{method:"POST",body:e,contentType:"application/ocsp-request",accept:"application/ocsp-response",timeout:r,proxyUrl:i})})}function Oc(n,e=1e4,r){return fi(this,null,function*(){return zo(n,{method:"GET",accept:"application/pkix-crl",timeout:e,proxyUrl:r})})}function Ic(n,e=5e3,r){return fi(this,null,function*(){return zo(n,{method:"GET",accept:"application/pkix-cert",timeout:e,proxyUrl:r})})}function Ba(n){const e=new Uint8Array(n);if(typeof btoa=="function"){let r="";for(let i=0;i<e.length;i++)r+=String.fromCharCode(e[i]);return btoa(r)}return Buffer.from(e).toString("base64")}function Oa(n){const e=n.replace(/\s/g,"");if(typeof atob=="function"){const i=atob(e),o=new Uint8Array(i.length);for(let u=0;u<i.length;u++)o[u]=i.charCodeAt(u);return o.buffer}const r=Buffer.from(e,"base64");return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)}function Rc(n){return new Uint8Array(Oa(n))}function pi(n){return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,"0")).join("")}function kc(n){const e=new Uint8Array(n.length/2);for(let r=0;r<n.length;r+=2)e[r/2]=parseInt(n.substring(r,r+2),16);return e.buffer}function Ia(n,e="CERTIFICATE"){const r=Ba(n).match(/.{1,64}/g)||[];return`-----BEGIN ${e}-----
78
+ `)}`:`${r} :`}}ku=mt,ne.Constructed=ku,mt.NAME="CONSTRUCTED";class _u extends pt{fromBER(e,r,i){return r}toBER(e){return Gt}}_u.override="EndOfContentValueBlock";var Lu;class so extends st{constructor(e={}){super(e,_u),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}Lu=so,ne.EndOfContent=Lu,so.NAME=an;var Mu;class vr extends st{constructor(e={}){super(e,pt),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,r,i){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=i,r+i>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(e,r){const i=new ArrayBuffer(2);if(!e){const o=new Uint8Array(i);o[0]=5,o[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}Mu=vr,ne.Null=Mu,vr.NAME="NULL";class Fu extends Xt(pt){get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor(i={}){var o=i,{value:e}=o,r=Xe(o,["value"]);super(r),r.valueHex?this.valueHexView=xe.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,r,i){const o=xe.toUint8Array(e);return Kt(this,o,r,i)?(this.valueHexView=o.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,Au.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return Je(Ve({},super.toJSON()),{value:this.value})}}Fu.NAME="BooleanValueBlock";var Pu;class Gn extends st{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,Fu),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}}Pu=Gn,ne.Boolean=Pu,Gn.NAME="BOOLEAN";class Uu extends Xt(lr){constructor(i={}){var o=i,{isConstructed:e=!1}=o,r=Xe(o,["isConstructed"]);super(r),this.isConstructed=e}fromBER(e,r,i,o){let s=0;if(this.isConstructed){if(this.isHexOnly=!1,s=lr.prototype.fromBER.call(this,e,r,i,o),s===-1)return s;for(let l=0;l<this.value.length;l++){const c=this.value[l].constructor.NAME;if(c===an){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(c!==bu)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,s=super.fromBER(e,r,i),this.blockLength=i;return s}toBER(e,r){return this.isConstructed?lr.prototype.toBER.call(this,e,r):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return Je(Ve({},super.toJSON()),{isConstructed:this.isConstructed})}}Uu.NAME="OctetStringValueBlock";var uo;class Er extends st{constructor(o={}){var s=o,{idBlock:e={},lenBlock:r={}}=s,i=Xe(s,["idBlock","lenBlock"]);var l,c;(l=i.isConstructed)!==null&&l!==void 0||(i.isConstructed=!!(!((c=i.value)===null||c===void 0)&&c.length)),super(Ve({idBlock:Ve({isConstructed:i.isConstructed},e),lenBlock:Je(Ve({},r),{isIndefiniteForm:!!i.isIndefiniteForm})},i),Uu),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,r,i,o){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const l=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(r,r+i);try{if(l.byteLength){const c=o!=null?o:cn(),h=oo(l,0,l.byteLength,c);h.offset!==-1&&h.offset===i&&(this.valueBlock.value=[h.result])}}catch(c){}}return super.fromBER(e,r,i,o)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return mt.prototype.onAsciiEncoding.call(this);const e=this.constructor.NAME,r=qe.ToHex(this.valueBlock.valueHexView);return`${e} : ${r}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const r of this.valueBlock.value)r instanceof uo&&e.push(r.valueBlock.valueHexView);return xe.concat(e)}}uo=Er,ne.OctetString=uo,Er.NAME=bu;class Vu extends Xt(lr){constructor(o={}){var s=o,{unusedBits:e=0,isConstructed:r=!1}=s,i=Xe(s,["unusedBits","isConstructed"]);super(i),this.unusedBits=e,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(e,r,i,o){if(!i)return r;let s=-1;if(this.isConstructed){if(s=lr.prototype.fromBER.call(this,e,r,i,o),s===-1)return s;for(const h of this.value){const y=h.constructor.NAME;if(y===an){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(y!==Du)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const b=h.valueBlock;if(this.unusedBits>0&&b.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=b.unusedBits}return s}const l=xe.toUint8Array(e);if(!Kt(this,l,r,i))return-1;const c=l.subarray(r,r+i);if(this.unusedBits=c[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const h=c.subarray(1);try{if(h.byteLength){const y=o!=null?o:cn(),b=oo(h,0,h.byteLength,y);b.offset!==-1&&b.offset===i-1&&(this.value=[b.result])}}catch(y){}}return this.valueHexView=c.subarray(1),this.blockLength=c.length,r+i}toBER(e,r){if(this.isConstructed)return lr.prototype.toBER.call(this,e,r);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength){const o=new Uint8Array(1);return o[0]=0,o.buffer}const i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return Je(Ve({},super.toJSON()),{unusedBits:this.unusedBits,isConstructed:this.isConstructed})}}Vu.NAME="BitStringValueBlock";var Hu;class Ar extends st{constructor(o={}){var s=o,{idBlock:e={},lenBlock:r={}}=s,i=Xe(s,["idBlock","lenBlock"]);var l,c;(l=i.isConstructed)!==null&&l!==void 0||(i.isConstructed=!!(!((c=i.value)===null||c===void 0)&&c.length)),super(Ve({idBlock:Ve({isConstructed:i.isConstructed},e),lenBlock:Je(Ve({},r),{isIndefiniteForm:!!i.isIndefiniteForm})},i),Vu),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,r,i,o){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,r,i,o)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return mt.prototype.onAsciiEncoding.call(this);{const e=[],r=this.valueBlock.valueHexView;for(const l of r)e.push(l.toString(2).padStart(8,"0"));const i=e.join(""),o=this.constructor.NAME,s=i.substring(0,i.length-this.valueBlock.unusedBits);return`${o} : ${s}`}}}Hu=Ar,ne.BitString=Hu,Ar.NAME=Du;var qu;function Ac(n,e){const r=new Uint8Array([0]),i=new Uint8Array(n),o=new Uint8Array(e);let s=i.slice(0);const l=s.length-1,c=o.slice(0),h=c.length-1;let y=0;const b=h<l?l:h;let E=0;for(let x=b;x>=0;x--,E++)!0===E<c.length?y=s[l-E]+c[h-E]+r[0]:y=s[l-E]+r[0],r[0]=y/10,!0===E>=s.length?s=to(new Uint8Array([y%10]),s):s[l-E]=y%10;return r[0]>0&&(s=to(r,s)),s}function ju(n){if(n>=un.length)for(let e=un.length;e<=n;e++){const r=new Uint8Array([0]);let i=un[e-1].slice(0);for(let o=i.length-1;o>=0;o--){const s=new Uint8Array([(i[o]<<1)+r[0]]);r[0]=s[0]/10,i[o]=s[0]%10}r[0]>0&&(i=to(r,i)),un.push(i)}return un[n]}function Nc(n,e){let r=0;const i=new Uint8Array(n),o=new Uint8Array(e),s=i.slice(0),l=s.length-1,c=o.slice(0),h=c.length-1;let y,b=0;for(let E=h;E>=0;E--,b++)y=s[l-b]-c[h-b]-r,!0===y<0?(r=1,s[l-b]=y+10):(r=0,s[l-b]=y);if(r>0)for(let E=l-h+1;E>=0;E--,b++)if(y=s[l-b]-r,y<0)r=1,s[l-b]=y+10;else{r=0,s[l-b]=y;break}return s.slice()}class ao extends Xt(pt){setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=Au.call(this)))}constructor(i={}){var o=i,{value:e}=o,r=Xe(o,["value"]);super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(rc(e))}get valueDec(){return this._valueDec}fromDER(e,r,i,o=0){const s=this.fromBER(e,r,i);if(s===-1)return s;const l=this.valueHexView;return l[0]===0&&(l[1]&128)!==0?this.valueHexView=l.subarray(1):o!==0&&l.length<o&&(o-l.length>1&&(o=l.length+1),this.valueHexView=l.subarray(o-l.length)),s}toDER(e=!1){const r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{const i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(r,1),this.valueHexView=i}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,r,i){const o=super.fromBER(e,r,i);return o===-1||this.setValueHex(),o}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return Je(Ve({},super.toJSON()),{valueDec:this.valueDec})}toString(){const e=this.valueHexView.length*8-1;let r=new Uint8Array(this.valueHexView.length*8/3),i=0,o;const s=this.valueHexView;let l="",c=!1;for(let h=s.byteLength-1;h>=0;h--){o=s[h];for(let y=0;y<8;y++)(o&1)===1&&(i===e?(r=Nc(ju(i),r),l="-"):r=Ac(r,ju(i))),i++,o>>=1}for(let h=0;h<r.length;h++)r[h]&&(c=!0),c&&(l+=Nu.charAt(r[h]));return c===!1&&(l+=Nu.charAt(0)),l}}qu=ao,ao.NAME="IntegerValueBlock",Object.defineProperty(qu.prototype,"valueHex",{set:function(n){this.valueHexView=new Uint8Array(n),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var pn;class Pr extends st{constructor(e={}){super(e,ao),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Hn(),BigInt(this.valueBlock.toString())}static fromBigInt(e){Hn();const r=BigInt(e),i=new qn,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(qe.FromHex(o));if(r<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const y=BigInt(`0x${qe.ToHex(c)}`)+r,b=xe.toUint8Array(qe.FromHex(y.toString(16)));b[0]|=128,i.write(b)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new pn({valueHex:i.final()})}convertToDER(){const e=new pn({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new pn({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}pn=Pr,ne.Integer=pn,Pr.NAME="INTEGER";var $u;class Xn extends Pr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}$u=Xn,ne.Enumerated=$u,Xn.NAME="ENUMERATED";class lo extends Xt(pt){constructor(o={}){var s=o,{valueDec:e=-1,isFirstSid:r=!1}=s,i=Xe(s,["valueDec","isFirstSid"]);super(i),this.valueDec=e,this.isFirstSid=r}fromBER(e,r,i){if(!i)return r;const o=xe.toUint8Array(e);if(!Kt(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,(s[c]&128)!==0);c++);const l=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)l[c]=this.valueHexView[c];return this.valueHexView=l,(s[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Fr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(e){Hn();let r=BigInt(e).toString(2);for(;r.length%7;)r="0"+r;const i=new Uint8Array(r.length/7);for(let o=0;o<i.length;o++)i[o]=parseInt(r.slice(o*7,o*7+7),2)+(o+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength-1;l++)s[l]=o[l]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=gr(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",Gt;const i=new Uint8Array(r.byteLength);if(!e){const o=new Uint8Array(r),s=r.byteLength-1;for(let l=0;l<s;l++)i[l]=o[l]|128;i[s]=o[s]}return i}toString(){let e="";if(this.isHexOnly)e=qe.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",r-=40):(e="2.",r-=80),e+=r.toString()}else e=this.valueDec.toString();return e}toJSON(){return Je(Ve({},super.toJSON()),{valueDec:this.valueDec,isFirstSid:this.isFirstSid})}}lo.NAME="sidBlock";class Gu extends pt{constructor(i={}){var o=i,{value:e=yt}=o,r=Xe(o,["value"]);super(r),this.value=[],e&&this.fromString(e)}fromBER(e,r,i){let o=r;for(;i>0;){const s=new lo;if(o=s.fromBER(e,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(e){const r=[];for(let i=0;i<this.value.length;i++){const o=this.value[i].toBER(e);if(o.byteLength===0)return this.error=this.value[i].error,Gt;r.push(o)}return ro(r)}fromString(e){this.value=[];let r=0,i=0,o="",s=!1;do if(i=e.indexOf(".",r),i===-1?o=e.substring(r):o=e.substring(r,i),r=i+1,s){const l=this.value[0];let c=0;switch(l.valueDec){case 0:break;case 1:c=40;break;case 2:c=80;break;default:this.value=[];return}const h=parseInt(o,10);if(isNaN(h))return;l.valueDec=h+c,s=!1}else{const l=new lo;if(o>Number.MAX_SAFE_INTEGER){Hn();const c=BigInt(o);l.valueBigInt=c}else if(l.valueDec=parseInt(o,10),isNaN(l.valueDec))return;this.value.length||(l.isFirstSid=!0,s=!0),this.value.push(l)}while(i!==-1)}toString(){let e="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(e=`${e}.`),r?(o=`{${o}}`,this.value[i].isFirstSid?e=`2.{${o} - 80}`:e+=o):e+=o}return e}toJSON(){const e=Je(Ve({},super.toJSON()),{value:this.toString(),sidArray:[]});for(let r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}}Gu.NAME="ObjectIdentifierValueBlock";var Xu;class Wn extends st{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Gu),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return Je(Ve({},super.toJSON()),{value:this.getValue()})}}Xu=Wn,ne.ObjectIdentifier=Xu,Wn.NAME="OBJECT IDENTIFIER";class co extends Xt(mr){constructor(i={}){var o=i,{valueDec:e=0}=o,r=Xe(o,["valueDec"]);super(r),this.valueDec=e}fromBER(e,r,i){if(i===0)return r;const o=xe.toUint8Array(e);if(!Kt(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,(s[c]&128)!==0);c++);const l=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)l[c]=this.valueHexView[c];return this.valueHexView=l,(s[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Fr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength-1;l++)s[l]=o[l]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=gr(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",Gt;const i=new Uint8Array(r.byteLength);if(!e){const o=new Uint8Array(r),s=r.byteLength-1;for(let l=0;l<s;l++)i[l]=o[l]|128;i[s]=o[s]}return i.buffer}toString(){let e="";return this.isHexOnly?e=qe.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return Je(Ve({},super.toJSON()),{valueDec:this.valueDec})}}co.NAME="relativeSidBlock";class Wu extends pt{constructor(i={}){var o=i,{value:e=yt}=o,r=Xe(o,["value"]);super(r),this.value=[],e&&this.fromString(e)}fromBER(e,r,i){let o=r;for(;i>0;){const s=new co;if(o=s.fromBER(e,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(e,r){const i=[];for(let o=0;o<this.value.length;o++){const s=this.value[o].toBER(e);if(s.byteLength===0)return this.error=this.value[o].error,Gt;i.push(s)}return ro(i)}fromString(e){this.value=[];let r=0,i=0,o="";do{i=e.indexOf(".",r),i===-1?o=e.substring(r):o=e.substring(r,i),r=i+1;const s=new co;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let e="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(e=`${e}.`),r&&(o=`{${o}}`),e+=o}return e}toJSON(){const e=Je(Ve({},super.toJSON()),{value:this.toString(),sidArray:[]});for(let r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}}Wu.NAME="RelativeObjectIdentifierValueBlock";var zu;class fo extends st{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Wu),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return Je(Ve({},super.toJSON()),{value:this.getValue()})}}zu=fo,ne.RelativeObjectIdentifier=zu,fo.NAME="RelativeObjectIdentifier";var Yu;class Lt extends mt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Yu=Lt,ne.Sequence=Yu,Lt.NAME="SEQUENCE";var Ju;class Wt extends mt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}}Ju=Wt,ne.Set=Ju,Wt.NAME="SET";class Ku extends Xt(pt){constructor(r={}){var e=Xe(r,[]);super(e),this.isHexOnly=!0,this.value=yt}toJSON(){return Je(Ve({},super.toJSON()),{value:this.value})}}Ku.NAME="StringValueBlock";class Qu extends Ku{}Qu.NAME="SimpleStringValueBlock";class Dt extends io{constructor(r={}){var e=Xe(r,[]);super(e,Qu)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,xe.toUint8Array(e))}fromString(e){const r=e.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=e.charCodeAt(o);this.valueBlock.value=e}}Dt.NAME="SIMPLE STRING";class Zu extends Dt{fromBuffer(e){this.valueBlock.valueHexView=xe.toUint8Array(e);try{this.valueBlock.value=qe.ToUtf8String(e)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=qe.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(qe.FromUtf8String(e)),this.valueBlock.value=e}}Zu.NAME="Utf8StringValueBlock";var ea;class Qt extends Zu{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}ea=Qt,ne.Utf8String=ea,Qt.NAME="UTF8String";class ta extends Dt{fromBuffer(e){this.valueBlock.value=qe.ToUtf16String(e),this.valueBlock.valueHexView=xe.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(qe.FromUtf16String(e))}}ta.NAME="BmpStringValueBlock";var ra;class zn extends ta{constructor(r={}){var e=Xe(r,[]);super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}ra=zn,ne.BmpString=ra,zn.NAME="BMPString";class na extends Dt{fromBuffer(e){const r=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),i=new Uint8Array(r);for(let o=0;o<i.length;o+=4)i[o]=i[o+3],i[o+1]=i[o+2],i[o+2]=0,i[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(e){const r=e.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let o=0;o<r;o++){const s=gr(e.charCodeAt(o),8),l=new Uint8Array(s);if(l.length>4)continue;const c=4-l.length;for(let h=l.length-1;h>=0;h--)i[o*4+h+c]=l[h]}this.valueBlock.value=e}}na.NAME="UniversalStringValueBlock";var ia;class Yn extends na{constructor(r={}){var e=Xe(r,[]);super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}ia=Yn,ne.UniversalString=ia,Yn.NAME="UniversalString";var oa;class Jn extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}oa=Jn,ne.NumericString=oa,Jn.NAME="NumericString";var sa;class Kn extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}sa=Kn,ne.PrintableString=sa,Kn.NAME="PrintableString";var ua;class Qn extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}ua=Qn,ne.TeletexString=ua,Qn.NAME="TeletexString";var aa;class Zn extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}aa=Zn,ne.VideotexString=aa,Zn.NAME="VideotexString";var la;class ei extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}la=ei,ne.IA5String=la,ei.NAME="IA5String";var ca;class ti extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}ca=ti,ne.GraphicString=ca,ti.NAME="GraphicString";var fa;class hn extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}fa=hn,ne.VisibleString=fa,hn.NAME="VisibleString";var pa;class ri extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}pa=ri,ne.GeneralString=pa,ri.NAME="GeneralString";var ha;class ni extends Dt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}ha=ni,ne.CharacterString=ha,ni.NAME="CharacterString";var da;class dn extends hn{constructor(o={}){var s=o,{value:e,valueDate:r}=s,i=Xe(s,["value","valueDate"]);if(super(i),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let l=0;l<e.length;l++)this.valueBlock.valueHexView[l]=e.charCodeAt(l)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,xe.toUint8Array(e)))}toBuffer(){const e=this.toString(),r=new ArrayBuffer(e.length),i=new Uint8Array(r);for(let o=0;o<e.length;o++)i[o]=e.charCodeAt(o);return r}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){const i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(i===null){this.error="Wrong input string for conversion";return}const o=parseInt(i[1],10);o>=50?this.year=1900+o:this.year=2e3+o,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(e="iso"){if(e==="iso"){const r=new Array(7);return r[0]=bt(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=bt(this.month,2),r[2]=bt(this.day,2),r[3]=bt(this.hour,2),r[4]=bt(this.minute,2),r[5]=bt(this.second,2),r[6]="Z",r.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return Je(Ve({},super.toJSON()),{year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second})}}da=dn,ne.UTCTime=da,dn.NAME="UTCTime";var ga;class ii extends dn{constructor(e={}){var r;super(e),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){const e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let r=!1,i="",o="",s=0,l,c=0,h=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),r=!0;else{const E=new Number(e[e.length-1]);if(isNaN(E.valueOf()))throw new Error("Wrong input string for conversion");i=e}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let E=1,x=i.indexOf("+"),T="";if(x===-1&&(x=i.indexOf("-"),E=-1),x!==-1){if(T=i.substring(x+1),i=i.substring(0,x),T.length!==2&&T.length!==4)throw new Error("Wrong input string for conversion");let R=parseInt(T.substring(0,2),10);if(isNaN(R.valueOf()))throw new Error("Wrong input string for conversion");if(c=E*R,T.length===4){if(R=parseInt(T.substring(2,4),10),isNaN(R.valueOf()))throw new Error("Wrong input string for conversion");h=E*R}}}let y=i.indexOf(".");if(y===-1&&(y=i.indexOf(",")),y!==-1){const E=new Number(`0${i.substring(y)}`);if(isNaN(E.valueOf()))throw new Error("Wrong input string for conversion");s=E.valueOf(),o=i.substring(0,y)}else o=i;switch(!0){case o.length===8:if(l=/(\d{4})(\d{2})(\d{2})/ig,y!==-1)throw new Error("Wrong input string for conversion");break;case o.length===10:if(l=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,y!==-1){let E=60*s;this.minute=Math.floor(E),E=60*(E-this.minute),this.second=Math.floor(E),E=1e3*(E-this.second),this.millisecond=Math.floor(E)}break;case o.length===12:if(l=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,y!==-1){let E=60*s;this.second=Math.floor(E),E=1e3*(E-this.second),this.millisecond=Math.floor(E)}break;case o.length===14:if(l=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,y!==-1){const E=1e3*s;this.millisecond=Math.floor(E)}break;default:throw new Error("Wrong input string for conversion")}const b=l.exec(o);if(b===null)throw new Error("Wrong input string for conversion");for(let E=1;E<b.length;E++)switch(E){case 1:this.year=parseInt(b[E],10);break;case 2:this.month=parseInt(b[E],10);break;case 3:this.day=parseInt(b[E],10);break;case 4:this.hour=parseInt(b[E],10)+c;break;case 5:this.minute=parseInt(b[E],10)+h;break;case 6:this.second=parseInt(b[E],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const E=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=E.getUTCFullYear(),this.month=E.getUTCMonth(),this.day=E.getUTCDay(),this.hour=E.getUTCHours(),this.minute=E.getUTCMinutes(),this.second=E.getUTCSeconds(),this.millisecond=E.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const r=[];return r.push(bt(this.year,4)),r.push(bt(this.month,2)),r.push(bt(this.day,2)),r.push(bt(this.hour,2)),r.push(bt(this.minute,2)),r.push(bt(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(bt(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(e)}toJSON(){return Je(Ve({},super.toJSON()),{millisecond:this.millisecond})}}ga=ii,ne.GeneralizedTime=ga,ii.NAME="GeneralizedTime";var ma;class po extends Qt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}ma=po,ne.DATE=ma,po.NAME="DATE";var ya;class ho extends Qt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}ya=ho,ne.TimeOfDay=ya,ho.NAME="TimeOfDay";var va;class go extends Qt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}va=go,ne.DateTime=va,go.NAME="DateTime";var Ea;class mo extends Qt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Ea=mo,ne.Duration=Ea,mo.NAME="Duration";var Aa;class yo extends Qt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Aa=yo,ne.TIME=Aa,yo.NAME="TIME";class Nr{constructor({name:e=yt,optional:r=!1}={}){this.name=e,this.optional=r}}class vo extends Nr{constructor(i={}){var o=i,{value:e=[]}=o,r=Xe(o,["value"]);super(r),this.value=e}}class oi extends Nr{constructor(o={}){var s=o,{value:e=new Nr,local:r=!1}=s,i=Xe(s,["value","local"]);super(i),this.value=e,this.local=r}}class wc{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=xe.toUint8Array(e)}constructor({data:e=jn}={}){this.dataView=xe.toUint8Array(e)}fromBER(e,r,i){const o=r+i;return this.dataView=xe.toUint8Array(e).subarray(r,o),o}toBER(e){return this.dataView.slice().buffer}}function cr(n,e,r){if(r instanceof vo){for(const s of r.value)if(cr(n,e,s).verified)return{verified:!0,result:n};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(no)&&(s.name=r.name),s}}if(r instanceof Nr)return r.hasOwnProperty(no)&&(n[r.name]=e),{verified:!0,result:n};if(!(n instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(oc in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(lc in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(cc in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=r.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(sc)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:n};if(r.idBlock.hasOwnProperty(uc)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:n};if(r.idBlock.hasOwnProperty(ac)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:n};if(!(ic in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:n};if(r.idBlock.isHexOnly){if(!(wu in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=r.idBlock.valueHexView,l=e.idBlock.valueHexView;if(s.length!==l.length)return{verified:!1,result:n};for(let c=0;c<s.length;c++)if(s[c]!==l[1])return{verified:!1,result:n}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,yt),r.name&&(n[r.name]=e)),r instanceof ne.Constructed){let s=0,l={verified:!1,result:{error:"Unknown error"}},c=r.valueBlock.value.length;if(c>0&&r.valueBlock.value[0]instanceof oi&&(c=e.valueBlock.value.length),c===0)return{verified:!0,result:n};if(e.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let h=!0;for(let y=0;y<r.valueBlock.value.length;y++)h=h&&(r.valueBlock.value[y].optional||!1);return h?{verified:!0,result:n}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,yt),r.name&&delete n[r.name]),n.error="Inconsistent object length",{verified:!1,result:n})}for(let h=0;h<c;h++)if(h-s>=e.valueBlock.value.length){if(r.valueBlock.value[h].optional===!1){const y={verified:!1,result:n};return n.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,yt),r.name&&(delete n[r.name],y.name=r.name)),y}}else if(r.valueBlock.value[0]instanceof oi){if(l=cr(n,e.valueBlock.value[h],r.valueBlock.value[0].value),l.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,yt),r.name&&delete n[r.name]),l;if(no in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let y={};fc in r.valueBlock.value[0]&&r.valueBlock.value[0].local?y=e:y=n,typeof y[r.valueBlock.value[0].name]=="undefined"&&(y[r.valueBlock.value[0].name]=[]),y[r.valueBlock.value[0].name].push(e.valueBlock.value[h])}}else if(l=cr(n,e.valueBlock.value[h-s],r.valueBlock.value[h]),l.verified===!1)if(r.valueBlock.value[h].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,yt),r.name&&delete n[r.name]),l;if(l.verified===!1){const h={verified:!1,result:n};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,yt),r.name&&(delete n[r.name],h.name=r.name)),h}return{verified:!0,result:n}}if(r.primitiveSchema&&wu in e.valueBlock){const s=$n(e.valueBlock.valueHexView);if(s.offset===-1){const l={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,yt),r.name&&(delete n[r.name],l.name=r.name)),l}return cr(n,s.result,r.primitiveSchema)}return{verified:!0,result:n}}function bc(n,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=$n(xe.toUint8Array(n));return r.offset===-1?{verified:!1,result:r.result}:cr(r.result,r.result,e)}var Na=Object.freeze({__proto__:null,Any:Nr,BaseBlock:st,BaseStringBlock:io,BitString:Ar,BmpString:zn,Boolean:Gn,CharacterString:ni,Choice:vo,Constructed:mt,DATE:po,DEFAULT_MAX_CONTENT_LENGTH:Ru,DEFAULT_MAX_DEPTH:Ou,DEFAULT_MAX_NODES:Iu,DateTime:go,Duration:mo,EndOfContent:so,Enumerated:Xn,GeneralString:ri,GeneralizedTime:ii,GraphicString:ti,HexBlock:Xt,IA5String:ei,Integer:Pr,Null:vr,NumericString:Jn,ObjectIdentifier:Wn,OctetString:Er,Primitive:ln,PrintableString:Kn,RawData:wc,RelativeObjectIdentifier:fo,Repeated:oi,Sequence:Lt,Set:Wt,TIME:yo,TeletexString:Qn,TimeOfDay:ho,UTCTime:dn,UniversalString:Yn,Utf8String:Qt,ValueBlock:pt,VideotexString:Zn,ViewWriter:qn,VisibleString:hn,compareSchema:cr,fromBER:yr,verifySchema:bc}),W;(function(n){n[n.Sequence=0]="Sequence",n[n.Set=1]="Set",n[n.Choice=2]="Choice"})(W||(W={}));var S;(function(n){n[n.Any=1]="Any",n[n.Boolean=2]="Boolean",n[n.OctetString=3]="OctetString",n[n.BitString=4]="BitString",n[n.Integer=5]="Integer",n[n.Enumerated=6]="Enumerated",n[n.ObjectIdentifier=7]="ObjectIdentifier",n[n.Utf8String=8]="Utf8String",n[n.BmpString=9]="BmpString",n[n.UniversalString=10]="UniversalString",n[n.NumericString=11]="NumericString",n[n.PrintableString=12]="PrintableString",n[n.TeletexString=13]="TeletexString",n[n.VideotexString=14]="VideotexString",n[n.IA5String=15]="IA5String",n[n.GraphicString=16]="GraphicString",n[n.VisibleString=17]="VisibleString",n[n.GeneralString=18]="GeneralString",n[n.CharacterString=19]="CharacterString",n[n.UTCTime=20]="UTCTime",n[n.GeneralizedTime=21]="GeneralizedTime",n[n.DATE=22]="DATE",n[n.TimeOfDay=23]="TimeOfDay",n[n.DateTime=24]="DateTime",n[n.Duration=25]="Duration",n[n.TIME=26]="TIME",n[n.Null=27]="Null"})(S||(S={}));class si{constructor(e,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(xe.isBufferSource(e))this.unusedBits=r,this.value=xe.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Ar))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=e.valueBlock.valueHex,this}toASN(){return new Ar({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Ar({name:e})}toNumber(){let e="";const r=new Uint8Array(this.value);for(const i of r)e+=i.toString(2).padStart(8,"0");return e=e.split("").reverse().join(""),this.unusedBits&&(e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(e,2)}fromNumber(e){let r=e.toString(2);const i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;const o=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)o[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class Ie{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):xe.isBufferSource(e)?this.buffer=xe.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof Er))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new Er({valueHex:this.buffer})}toSchema(e){return new Er({name:e})}}const Dc={fromASN:n=>n instanceof vr?null:n.valueBeforeDecodeView,toASN:n=>{if(n===null)return new vr;const e=yr(n);if(e.result.error)throw new Error(e.result.error);return e.result}},Cc={fromASN:n=>n.valueBlock.valueHexView.byteLength>=4?n.valueBlock.toString():n.valueBlock.valueDec,toASN:n=>new Pr({value:+n})},xc={fromASN:n=>n.valueBlock.valueDec,toASN:n=>new Xn({value:n})},Ct={fromASN:n=>n.valueBlock.valueHexView,toASN:n=>new Pr({valueHex:n})},Tc={fromASN:n=>n.valueBlock.valueHexView,toASN:n=>new Ar({valueHex:n})},Sc={fromASN:n=>n.valueBlock.toString(),toASN:n=>new Wn({value:n})},Bc={fromASN:n=>n.valueBlock.value,toASN:n=>new Gn({value:n})},Eo={fromASN:n=>n.valueBlock.valueHexView,toASN:n=>new Er({valueHex:n})},Oc={fromASN:n=>new Ie(n.getValue()),toASN:n=>n.toASN()};function Bt(n){return{fromASN:e=>e.valueBlock.value,toASN:e=>new n({value:e})}}const Ic=Bt(Qt),Rc=Bt(zn),kc=Bt(Yn),_c=Bt(Jn),Lc=Bt(Kn),Mc=Bt(Qn),Fc=Bt(Zn),Pc=Bt(ei),Uc=Bt(ti),Vc=Bt(hn),Hc=Bt(ri),qc=Bt(ni),jc={fromASN:n=>n.toDate(),toASN:n=>new dn({valueDate:n})},$c={fromASN:n=>n.toDate(),toASN:n=>new ii({valueDate:n})},Gc={fromASN:()=>null,toASN:()=>new vr};function gn(n){switch(n){case S.Any:return Dc;case S.BitString:return Tc;case S.BmpString:return Rc;case S.Boolean:return Bc;case S.CharacterString:return qc;case S.Enumerated:return xc;case S.GeneralString:return Hc;case S.GeneralizedTime:return $c;case S.GraphicString:return Uc;case S.IA5String:return Pc;case S.Integer:return Cc;case S.Null:return Gc;case S.NumericString:return _c;case S.ObjectIdentifier:return Sc;case S.OctetString:return Eo;case S.PrintableString:return Lc;case S.TeletexString:return Mc;case S.UTCTime:return jc;case S.UniversalString:return kc;case S.Utf8String:return Ic;case S.VideotexString:return Fc;case S.VisibleString:return Vc;default:return null}}function Zt(n){return typeof n=="function"&&n.prototype?n.prototype.toASN&&n.prototype.fromASN?!0:Zt(n.prototype):!!(n&&typeof n=="object"&&"toASN"in n&&"fromASN"in n)}function wa(n){var e;if(n){const r=Object.getPrototypeOf(n);return((e=r==null?void 0:r.prototype)===null||e===void 0?void 0:e.constructor)===Array?!0:wa(r)}return!1}function Xc(n,e){if(!(n&&e)||n.byteLength!==e.byteLength)return!1;const r=new Uint8Array(n),i=new Uint8Array(e);for(let o=0;o<n.byteLength;o++)if(r[o]!==i[o])return!1;return!0}class Wc{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,r=!1){const i=this.items.get(e);if(!i)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(r&&!i.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(e){const r=this.get(e);r.schema||(r.schema=this.create(e,!0))}createDefault(e){const r={type:W.Sequence,items:{}},i=this.findParentSchema(e);return i&&(Object.assign(r,i),r.items=Object.assign({},r.items,i.items)),r}create(e,r){const i=this.items.get(e)||this.createDefault(e),o=[];for(const s in i.items){const l=i.items[s],c=r?s:"";let h;if(typeof l.type=="number"){const b=S[l.type],E=Na[b];if(!E)throw new Error(`Cannot get ASN1 class by name '${b}'`);h=new E({name:c})}else Zt(l.type)?h=new l.type().toSchema(c):l.optional?this.get(l.type).type===W.Choice?h=new Nr({name:c}):(h=this.create(l.type,!1),h.name=c):h=new Nr({name:c});const y=!!l.optional||l.defaultValue!==void 0;if(l.repeated){h.name="";const b=l.repeated==="set"?Wt:Lt;h=new b({name:"",value:[new oi({name:c,value:h})]})}if(l.context!==null&&l.context!==void 0)if(l.implicit)if(typeof l.type=="number"||Zt(l.type)){const b=l.repeated?mt:ln;o.push(new b({name:c,optional:y,idBlock:{tagClass:3,tagNumber:l.context}}))}else{this.cache(l.type);const b=!!l.repeated;let E=b?h:this.get(l.type,!0).schema;E="valueBlock"in E?E.valueBlock.value:E.value,o.push(new mt({name:b?"":c,optional:y,idBlock:{tagClass:3,tagNumber:l.context},value:E}))}else o.push(new mt({optional:y,idBlock:{tagClass:3,tagNumber:l.context},value:[h]}));else h.optional=y,o.push(h)}switch(i.type){case W.Sequence:return new Lt({value:o,name:""});case W.Set:return new Wt({value:o,name:""});case W.Choice:return new vo({value:o,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,r){return this.items.set(e,r),this}findParentSchema(e){const r=Object.getPrototypeOf(e);return r?this.items.get(r)||this.findParentSchema(r):null}}const at=new Wc,oe=n=>e=>{let r;at.has(e)?r=at.get(e):(r=at.createDefault(e),at.set(e,r)),Object.assign(r,n)},d=n=>(e,r)=>{let i;at.has(e.constructor)?i=at.get(e.constructor):(i=at.createDefault(e.constructor),at.set(e.constructor,i));const o=Object.assign({},n);if(typeof o.type=="number"&&!o.converter){const s=gn(n.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${e.constructor.name}`);o.converter=s}o.raw=n.raw,i.items[r]=o};class mn extends Error{constructor(){super(...arguments),this.schemas=[]}}class Ao{static parse(e,r){const i=yr(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,r)}static fromASN(e,r){try{if(Zt(r))return new r().fromASN(e);const i=at.get(r);at.cache(r);let o=i.schema;const s=this.handleChoiceTypes(e,i,r,o);if(s!=null&&s.result)return s.result;s!=null&&s.targetSchema&&(o=s.targetSchema);const l=this.handleSequenceTypes(e,i,r,o),c=new r;return wa(r)?this.handleArrayTypes(e,i,r):(this.processSchemaItems(i,l,c),c)}catch(i){throw i instanceof mn&&i.schemas.push(r.name),i}}static handleChoiceTypes(e,r,i,o){if(e.constructor===mt&&r.type===W.Choice&&e.idBlock.tagClass===3)for(const s in r.items){const l=r.items[s];if(l.context===e.idBlock.tagNumber&&l.implicit&&typeof l.type=="function"&&at.has(l.type)){const c=at.get(l.type);if(c&&c.type===W.Sequence){const h=new Lt;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in h.valueBlock){h.valueBlock.value=e.valueBlock.value;const y=this.fromASN(h,l.type),b=new i;return b[s]=y,{result:b}}}}}else if(e.constructor===mt&&r.type!==W.Choice){const s=new mt({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:r.schema.valueBlock.value});for(const l in r.items)delete e[l];return{targetSchema:s}}return null}static handleSequenceTypes(e,r,i,o){if(r.type===W.Sequence){const s=cr({},e,o);if(!s.verified)throw new mn(`Data does not match to ${i.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}else{const s=cr({},e,o);if(!s.verified)throw new mn(`Data does not match to ${i.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}}static processRepeatedField(e,r,i){let o=e.slice(r);if(o.length===1&&o[0].constructor.name==="Sequence"){const s=o[0];s.valueBlock&&s.valueBlock.value&&Array.isArray(s.valueBlock.value)&&(o=s.valueBlock.value)}if(typeof i.type=="number"){const s=gn(i.type);if(!s)throw new Error(`No converter for ASN.1 type ${i.type}`);return o.filter(l=>l&&l.valueBlock).map(l=>{try{return s.fromASN(l)}catch(c){return}}).filter(l=>l!==void 0)}else return o.filter(s=>s&&s.valueBlock).map(s=>{try{return this.fromASN(s,i.type)}catch(l){return}}).filter(s=>s!==void 0)}static processPrimitiveField(e,r){const i=gn(r.type);if(!i)throw new Error(`No converter for ASN.1 type ${r.type}`);return i.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&at.has(e.type)&&at.get(e.type).type===W.Choice}static processOptionalChoiceField(e,r){try{return{processed:!0,value:this.fromASN(e,r.type)}}catch(i){if(i instanceof mn&&/Wrong values for Choice type/.test(i.message))return{processed:!1};throw i}}static handleArrayTypes(e,r,i){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const o=r.itemType;if(typeof o=="number"){const s=gn(o);if(!s)throw new Error(`Cannot get default converter for array item of ${i.name} ASN1 schema`);return i.from(e.valueBlock.value,l=>s.fromASN(l))}else return i.from(e.valueBlock.value,s=>this.fromASN(s,o))}static processSchemaItems(e,r,i){for(const o in e.items){const s=r.result[o];if(!s)continue;const l=e.items[o],c=l.type;let h;typeof c=="number"||Zt(c)?h=this.processPrimitiveSchemaItem(s,l,c):h=this.processComplexSchemaItem(s,l,c),h&&typeof h=="object"&&"value"in h&&"raw"in h?(i[o]=h.value,i[`${o}Raw`]=h.raw):i[o]=h}}static processPrimitiveSchemaItem(e,r,i){var o;const s=(o=r.converter)!==null&&o!==void 0?o:Zt(i)?new i:null;if(!s)throw new Error("Converter is empty");return r.repeated?this.processRepeatedPrimitiveItem(e,r,s):this.processSinglePrimitiveItem(e,r,i,s)}static processRepeatedPrimitiveItem(e,r,i){if(r.implicit){const o=r.repeated==="sequence"?Lt:Wt,s=new o;s.valueBlock=e.valueBlock;const l=yr(s.toBER(!1));if(l.offset===-1)throw new Error(`Cannot parse the child item. ${l.result.error}`);if(!("value"in l.result.valueBlock&&Array.isArray(l.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const c=l.result.valueBlock.value;return Array.from(c,h=>i.fromASN(h))}else return Array.from(e,o=>i.fromASN(o))}static processSinglePrimitiveItem(e,r,i,o){let s=e;if(r.implicit){let l;if(Zt(i))l=new i().toSchema("");else{const c=S[i],h=Na[c];if(!h)throw new Error(`Cannot get '${c}' class from asn1js module`);l=new h}l.valueBlock=s.valueBlock,s=yr(l.toBER(!1)).result}return o.fromASN(s)}static processComplexSchemaItem(e,r,i){if(r.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,o=>this.fromASN(o,i))}else{const o=this.handleImplicitTagging(e,r,i);if(this.isOptionalChoiceField(r))try{return this.fromASN(o,i)}catch(s){if(s instanceof mn&&/Wrong values for Choice type/.test(s.message))return;throw s}else{const s=this.fromASN(o,i);return r.raw?{value:s,raw:e.valueBeforeDecodeView}:s}}}static handleImplicitTagging(e,r,i){if(r.implicit&&typeof r.context=="number"){const o=at.get(i);if(o.type===W.Sequence){const s=new Lt;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}else if(o.type===W.Set){const s=new Wt;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}}return e}}class No{static serialize(e){return e instanceof st?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&Zt(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=e.constructor,i=at.get(r);at.cache(r);let o=[];if(i.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const l=gn(i.itemType);if(!l)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=e.map(c=>l.toASN(c))}else o=e.map(l=>this.toAsnItem({type:i.itemType},"[]",r,l))}else for(const l in i.items){const c=i.items[l],h=e[l];if(h===void 0||c.defaultValue===h||typeof c.defaultValue=="object"&&typeof h=="object"&&Xc(this.serialize(c.defaultValue),this.serialize(h)))continue;const y=No.toAsnItem(c,l,r,h);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||Zt(c.type))){const b={};b.valueHex=y instanceof vr?y.valueBeforeDecodeView:y.valueBlock.toBER(),o.push(new ln(Ve({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context}},b)))}else o.push(new mt({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:y.valueBlock.value}));else o.push(new mt({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[y]}));else c.repeated?o=o.concat(y):o.push(y)}let s;switch(i.type){case W.Sequence:s=new Lt({value:o});break;case W.Set:s=new Wt({value:o});break;case W.Choice:if(!o[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=o[0];break}return s}static toAsnItem(e,r,i,o){let s;if(typeof e.type=="number"){const l=e.converter;if(!l)throw new Error(`Property '${r}' doesn't have converter for type ${S[e.type]} in schema '${i.name}'`);if(e.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(o,y=>l.toASN(y)),h=e.repeated==="sequence"?Lt:Wt;s=new h({value:c})}else s=l.toASN(o)}else if(e.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const l=Array.from(o,h=>this.toASN(h)),c=e.repeated==="sequence"?Lt:Wt;s=new c({value:l})}else s=this.toASN(o);return s}}class He extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const r of e)this.push(r)}}}class vt{static serialize(e){return No.serialize(e)}static parse(e,r){return Ao.parse(e,r)}static toString(e){const r=xe.isBufferSource(e)?xe.toArrayBuffer(e):vt.serialize(e),i=yr(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function p(n,e,r,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,r,i);else for(var c=n.length-1;c>=0;c--)(l=n[c])&&(s=(o<3?l(s):o>3?l(e,r,s):l(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}typeof SuppressedError=="function"&&SuppressedError;var wo;let ba=wo=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,wo.prototype)}};ba=wo=p([oe({type:W.Sequence,itemType:S.ObjectIdentifier})],ba);let bo=class{constructor(e=new Date){this.value=e}};p([d({type:S.GeneralizedTime})],bo.prototype,"value",void 0),bo=p([oe({type:W.Choice})],bo);let Do=class{constructor(e=null){this.value=e}};p([d({type:S.Null})],Do.prototype,"value",void 0),Do=p([oe({type:W.Choice})],Do);class Da{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){const r=e.split(".");if(r.length!==4)throw new Error("Invalid IPv4 address");return r.map(i=>{const o=parseInt(i,10);if(isNaN(o)||o<0||o>255)throw new Error("Invalid IPv4 address part");return o})}static parseIPv6(e){const i=this.expandIPv6(e).split(":");if(i.length!==8)throw new Error("Invalid IPv6 address");return i.reduce((o,s)=>{const l=parseInt(s,16);if(isNaN(l)||l<0||l>65535)throw new Error("Invalid IPv6 address part");return o.push(l>>8&255),o.push(l&255),o},[])}static expandIPv6(e){if(!e.includes("::"))return e;const r=e.split("::");if(r.length>2)throw new Error("Invalid IPv6 address");const i=r[0]?r[0].split(":"):[],o=r[1]?r[1].split(":"):[],s=8-(i.length+o.length);if(s<0)throw new Error("Invalid IPv6 address");return[...i,...Array(s).fill("0"),...o].join(":")}static formatIPv6(e){const r=[];for(let i=0;i<16;i+=2)r.push((e[i]<<8|e[i+1]).toString(16));return this.compressIPv6(r.join(":"))}static compressIPv6(e){const r=e.split(":");let i=-1,o=0,s=-1,l=0;for(let c=0;c<r.length;c++)r[c]==="0"?(s===-1&&(s=c),l++):(l>o&&(i=s,o=l),s=-1,l=0);if(l>o&&(i=s,o=l),o>1){const c=r.slice(0,i).join(":"),h=r.slice(i+o).join(":");return`${c}::${h}`}return e}static parseCIDR(e){const[r,i]=e.split("/"),o=parseInt(i,10);if(this.isIPv4(r)){if(o<0||o>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(r),o]}else{if(o<0||o>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(r),o]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;const r=parseInt(e.slice(8),16).toString(2).split("").reduce((o,s)=>o+ +s,0);let i=e.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return i=i.slice(0,-1),`${i}/${r}`}static toString(e){const r=new Uint8Array(e);if(r.length===4)return Array.from(r).join(".");if(r.length===16)return this.formatIPv6(r);if(r.length===8||r.length===32){const i=r.length/2,o=r.slice(0,i),s=r.slice(i);if(r.every(h=>h===0))return r.length===8?"0.0.0.0/0":"::/0";const c=s.reduce((h,y)=>h+(y.toString(2).match(/1/g)||[]).length,0);return r.length===8?`${Array.from(o).join(".")}/${c}`:`${this.formatIPv6(o)}/${c}`}return this.decodeIP(qe.ToHex(e))}static fromString(e){if(e.includes("/")){const[i,o]=this.parseCIDR(e),s=new Uint8Array(i.length);let l=o;for(let h=0;h<s.length;h++)l>=8?(s[h]=255,l-=8):l>0&&(s[h]=255<<8-l,l=0);const c=new Uint8Array(i.length*2);return c.set(i,0),c.set(s,i.length),c.buffer}const r=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(r).buffer}}var Co,xo,To;let Mt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};p([d({type:S.TeletexString})],Mt.prototype,"teletexString",void 0),p([d({type:S.PrintableString})],Mt.prototype,"printableString",void 0),p([d({type:S.UniversalString})],Mt.prototype,"universalString",void 0),p([d({type:S.Utf8String})],Mt.prototype,"utf8String",void 0),p([d({type:S.BmpString})],Mt.prototype,"bmpString",void 0),Mt=p([oe({type:W.Choice})],Mt);let Ur=class extends Mt{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?qe.ToHex(this.anyValue):super.toString())}};p([d({type:S.IA5String})],Ur.prototype,"ia5String",void 0),p([d({type:S.Any})],Ur.prototype,"anyValue",void 0),Ur=p([oe({type:W.Choice})],Ur);class So{constructor(e={}){this.type="",this.value=new Ur,Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],So.prototype,"type",void 0),p([d({type:Ur})],So.prototype,"value",void 0);let ui=Co=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,Co.prototype)}};ui=Co=p([oe({type:W.Set,itemType:So})],ui);let Bo=xo=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,xo.prototype)}};Bo=xo=p([oe({type:W.Sequence,itemType:ui})],Bo);let Et=To=class extends Bo{constructor(e){super(e),Object.setPrototypeOf(this,To.prototype)}};Et=To=p([oe({type:W.Sequence})],Et);const zc={fromASN:n=>Da.toString(Eo.fromASN(n)),toASN:n=>Eo.toASN(Da.fromString(n))};class Oo{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],Oo.prototype,"typeId",void 0),p([d({type:S.Any,context:0})],Oo.prototype,"value",void 0);class Io{constructor(e={}){this.partyName=new Mt,Object.assign(this,e)}}p([d({type:Mt,optional:!0,context:0,implicit:!0})],Io.prototype,"nameAssigner",void 0),p([d({type:Mt,context:1,implicit:!0})],Io.prototype,"partyName",void 0);let ke=class{constructor(e={}){Object.assign(this,e)}};p([d({type:Oo,context:0,implicit:!0})],ke.prototype,"otherName",void 0),p([d({type:S.IA5String,context:1,implicit:!0})],ke.prototype,"rfc822Name",void 0),p([d({type:S.IA5String,context:2,implicit:!0})],ke.prototype,"dNSName",void 0),p([d({type:S.Any,context:3,implicit:!0})],ke.prototype,"x400Address",void 0),p([d({type:Et,context:4,implicit:!1})],ke.prototype,"directoryName",void 0),p([d({type:Io,context:5})],ke.prototype,"ediPartyName",void 0),p([d({type:S.IA5String,context:6,implicit:!0})],ke.prototype,"uniformResourceIdentifier",void 0),p([d({type:S.OctetString,context:7,implicit:!0,converter:zc})],ke.prototype,"iPAddress",void 0),p([d({type:S.ObjectIdentifier,context:8,implicit:!0})],ke.prototype,"registeredID",void 0),ke=p([oe({type:W.Choice})],ke);var Ro;class ai{constructor(e={}){this.accessMethod="",this.accessLocation=new ke,Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],ai.prototype,"accessMethod",void 0),p([d({type:ke})],ai.prototype,"accessLocation",void 0);let li=Ro=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,Ro.prototype)}};li=Ro=p([oe({type:W.Sequence,itemType:ai})],li);class Ca extends Ie{}class ko{constructor(e={}){e&&Object.assign(this,e)}}p([d({type:Ca,context:0,optional:!0,implicit:!0})],ko.prototype,"keyIdentifier",void 0),p([d({type:ke,context:1,optional:!0,implicit:!0,repeated:"sequence"})],ko.prototype,"authorityCertIssuer",void 0),p([d({type:S.Integer,context:2,optional:!0,implicit:!0,converter:Ct})],ko.prototype,"authorityCertSerialNumber",void 0);class xa{constructor(e={}){this.cA=!1,Object.assign(this,e)}}p([d({type:S.Boolean,defaultValue:!1})],xa.prototype,"cA",void 0),p([d({type:S.Integer,optional:!0})],xa.prototype,"pathLenConstraint",void 0);var _o;let Ft=_o=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,_o.prototype)}};Ft=_o=p([oe({type:W.Sequence,itemType:ke})],Ft);var Lo;let Ta=Lo=class extends Ft{constructor(e){super(e),Object.setPrototypeOf(this,Lo.prototype)}};Ta=Lo=p([oe({type:W.Sequence})],Ta);var Mo;let er=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};p([d({type:S.IA5String})],er.prototype,"ia5String",void 0),p([d({type:S.VisibleString})],er.prototype,"visibleString",void 0),p([d({type:S.BmpString})],er.prototype,"bmpString",void 0),p([d({type:S.Utf8String})],er.prototype,"utf8String",void 0),er=p([oe({type:W.Choice})],er);class Fo{constructor(e={}){this.organization=new er,this.noticeNumbers=[],Object.assign(this,e)}}p([d({type:er})],Fo.prototype,"organization",void 0),p([d({type:S.Integer,repeated:"sequence"})],Fo.prototype,"noticeNumbers",void 0);class Po{constructor(e={}){Object.assign(this,e)}}p([d({type:Fo,optional:!0})],Po.prototype,"noticeRef",void 0),p([d({type:er,optional:!0})],Po.prototype,"explicitText",void 0);let ci=class{constructor(e={}){Object.assign(this,e)}};p([d({type:S.IA5String})],ci.prototype,"cPSuri",void 0),p([d({type:Po})],ci.prototype,"userNotice",void 0),ci=p([oe({type:W.Choice})],ci);class Uo{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],Uo.prototype,"policyQualifierId",void 0),p([d({type:S.Any})],Uo.prototype,"qualifier",void 0);class Vo{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],Vo.prototype,"policyIdentifier",void 0),p([d({type:Uo,repeated:"sequence",optional:!0})],Vo.prototype,"policyQualifiers",void 0);let Sa=Mo=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,Mo.prototype)}};Sa=Mo=p([oe({type:W.Sequence,itemType:Vo})],Sa);let fi=class{constructor(e=0){this.value=e}};p([d({type:S.Integer})],fi.prototype,"value",void 0),fi=p([oe({type:W.Choice})],fi);let Ba=class extends fi{};Ba=p([oe({type:W.Choice})],Ba);var Ho,Pt;(function(n){n[n.unused=1]="unused",n[n.keyCompromise=2]="keyCompromise",n[n.cACompromise=4]="cACompromise",n[n.affiliationChanged=8]="affiliationChanged",n[n.superseded=16]="superseded",n[n.cessationOfOperation=32]="cessationOfOperation",n[n.certificateHold=64]="certificateHold",n[n.privilegeWithdrawn=128]="privilegeWithdrawn",n[n.aACompromise=256]="aACompromise"})(Pt||(Pt={}));class Oa extends si{toJSON(){const e=[],r=this.toNumber();return r&Pt.aACompromise&&e.push("aACompromise"),r&Pt.affiliationChanged&&e.push("affiliationChanged"),r&Pt.cACompromise&&e.push("cACompromise"),r&Pt.certificateHold&&e.push("certificateHold"),r&Pt.cessationOfOperation&&e.push("cessationOfOperation"),r&Pt.keyCompromise&&e.push("keyCompromise"),r&Pt.privilegeWithdrawn&&e.push("privilegeWithdrawn"),r&Pt.superseded&&e.push("superseded"),r&Pt.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let Vr=class{constructor(e={}){Object.assign(this,e)}};p([d({type:ke,context:0,repeated:"sequence",implicit:!0})],Vr.prototype,"fullName",void 0),p([d({type:ui,context:1,implicit:!0})],Vr.prototype,"nameRelativeToCRLIssuer",void 0),Vr=p([oe({type:W.Choice})],Vr);class yn{constructor(e={}){Object.assign(this,e)}}p([d({type:Vr,context:0,optional:!0})],yn.prototype,"distributionPoint",void 0),p([d({type:Oa,context:1,optional:!0,implicit:!0})],yn.prototype,"reasons",void 0),p([d({type:ke,context:2,optional:!0,repeated:"sequence",implicit:!0})],yn.prototype,"cRLIssuer",void 0);let qo=Ho=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,Ho.prototype)}};qo=Ho=p([oe({type:W.Sequence,itemType:yn})],qo);var jo;let Ia=jo=class extends qo{constructor(e){super(e),Object.setPrototypeOf(this,jo.prototype)}};Ia=jo=p([oe({type:W.Sequence,itemType:yn})],Ia);class ht{constructor(e={}){this.onlyContainsUserCerts=ht.ONLY,this.onlyContainsCACerts=ht.ONLY,this.indirectCRL=ht.ONLY,this.onlyContainsAttributeCerts=ht.ONLY,Object.assign(this,e)}}ht.ONLY=!1,p([d({type:Vr,context:0,optional:!0})],ht.prototype,"distributionPoint",void 0),p([d({type:S.Boolean,context:1,defaultValue:ht.ONLY,implicit:!0})],ht.prototype,"onlyContainsUserCerts",void 0),p([d({type:S.Boolean,context:2,defaultValue:ht.ONLY,implicit:!0})],ht.prototype,"onlyContainsCACerts",void 0),p([d({type:Oa,context:3,optional:!0,implicit:!0})],ht.prototype,"onlySomeReasons",void 0),p([d({type:S.Boolean,context:4,defaultValue:ht.ONLY,implicit:!0})],ht.prototype,"indirectCRL",void 0),p([d({type:S.Boolean,context:5,defaultValue:ht.ONLY,implicit:!0})],ht.prototype,"onlyContainsAttributeCerts",void 0);var vn;(function(n){n[n.unspecified=0]="unspecified",n[n.keyCompromise=1]="keyCompromise",n[n.cACompromise=2]="cACompromise",n[n.affiliationChanged=3]="affiliationChanged",n[n.superseded=4]="superseded",n[n.cessationOfOperation=5]="cessationOfOperation",n[n.certificateHold=6]="certificateHold",n[n.removeFromCRL=8]="removeFromCRL",n[n.privilegeWithdrawn=9]="privilegeWithdrawn",n[n.aACompromise=10]="aACompromise"})(vn||(vn={}));let pi=class{constructor(e=vn.unspecified){this.reason=vn.unspecified,this.reason=e}toJSON(){return vn[this.reason]}toString(){return this.toJSON()}};p([d({type:S.Enumerated})],pi.prototype,"reason",void 0),pi=p([oe({type:W.Choice})],pi);var $o;let Ra=$o=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,$o.prototype)}};Ra=$o=p([oe({type:W.Sequence,itemType:S.ObjectIdentifier})],Ra);let Go=class{constructor(e=new ArrayBuffer(0)){this.value=e}};p([d({type:S.Integer,converter:Ct})],Go.prototype,"value",void 0),Go=p([oe({type:W.Choice})],Go);let Xo=class{constructor(e){this.value=new Date,e&&(this.value=e)}};p([d({type:S.GeneralizedTime})],Xo.prototype,"value",void 0),Xo=p([oe({type:W.Choice})],Xo);var Wo;let ka=Wo=class extends Ft{constructor(e){super(e),Object.setPrototypeOf(this,Wo.prototype)}};ka=Wo=p([oe({type:W.Sequence})],ka);var _a;(function(n){n[n.digitalSignature=1]="digitalSignature",n[n.nonRepudiation=2]="nonRepudiation",n[n.keyEncipherment=4]="keyEncipherment",n[n.dataEncipherment=8]="dataEncipherment",n[n.keyAgreement=16]="keyAgreement",n[n.keyCertSign=32]="keyCertSign",n[n.cRLSign=64]="cRLSign",n[n.encipherOnly=128]="encipherOnly",n[n.decipherOnly=256]="decipherOnly"})(_a||(_a={}));var zo;class hi{constructor(e={}){this.base=new ke,this.minimum=0,Object.assign(this,e)}}p([d({type:ke})],hi.prototype,"base",void 0),p([d({type:S.Integer,context:0,defaultValue:0,implicit:!0})],hi.prototype,"minimum",void 0),p([d({type:S.Integer,context:1,optional:!0,implicit:!0})],hi.prototype,"maximum",void 0);let di=zo=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,zo.prototype)}};di=zo=p([oe({type:W.Sequence,itemType:hi})],di);class La{constructor(e={}){Object.assign(this,e)}}p([d({type:di,context:0,optional:!0,implicit:!0})],La.prototype,"permittedSubtrees",void 0),p([d({type:di,context:1,optional:!0,implicit:!0})],La.prototype,"excludedSubtrees",void 0);class Ma{constructor(e={}){Object.assign(this,e)}}p([d({type:S.Integer,context:0,implicit:!0,optional:!0,converter:Ct})],Ma.prototype,"requireExplicitPolicy",void 0),p([d({type:S.Integer,context:1,implicit:!0,optional:!0,converter:Ct})],Ma.prototype,"inhibitPolicyMapping",void 0);var Yo;class Jo{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],Jo.prototype,"issuerDomainPolicy",void 0),p([d({type:S.ObjectIdentifier})],Jo.prototype,"subjectDomainPolicy",void 0);let Fa=Yo=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,Yo.prototype)}};Fa=Yo=p([oe({type:W.Sequence,itemType:Jo})],Fa);var Ko;let Pa=Ko=class extends Ft{constructor(e){super(e),Object.setPrototypeOf(this,Ko.prototype)}};Pa=Ko=p([oe({type:W.Sequence})],Pa);class En{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],En.prototype,"type",void 0),p([d({type:S.Any,repeated:"set"})],En.prototype,"values",void 0);var Qo;let Ua=Qo=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,Qo.prototype)}};Ua=Qo=p([oe({type:W.Sequence,itemType:En})],Ua);class An extends Ca{}class Va{constructor(e={}){Object.assign(this,e)}}p([d({type:S.GeneralizedTime,context:0,implicit:!0,optional:!0})],Va.prototype,"notBefore",void 0),p([d({type:S.GeneralizedTime,context:1,implicit:!0,optional:!0})],Va.prototype,"notAfter",void 0);var Nn;(function(n){n[n.keyUpdateAllowed=1]="keyUpdateAllowed",n[n.newExtensions=2]="newExtensions",n[n.pKIXCertificate=4]="pKIXCertificate"})(Nn||(Nn={}));class Ha extends si{toJSON(){const e=[],r=this.toNumber();return r&Nn.pKIXCertificate&&e.push("pKIXCertificate"),r&Nn.newExtensions&&e.push("newExtensions"),r&Nn.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class qa{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Ha,Object.assign(this,e)}}p([d({type:S.GeneralString})],qa.prototype,"entrustVers",void 0),p([d({type:Ha})],qa.prototype,"entrustInfoFlags",void 0);var Zo;let ja=Zo=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,Zo.prototype)}};ja=Zo=p([oe({type:W.Sequence,itemType:ai})],ja);class Ne{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof Ne&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&tc(e.parameters,this.parameters)||e.parameters===this.parameters)}}p([d({type:S.ObjectIdentifier})],Ne.prototype,"algorithm",void 0),p([d({type:S.Any,optional:!0})],Ne.prototype,"parameters",void 0);class gi{constructor(e={}){this.algorithm=new Ne,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:Ne})],gi.prototype,"algorithm",void 0),p([d({type:S.BitString})],gi.prototype,"subjectPublicKey",void 0);let dt=class{constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){const r=new Date(e);r.setMilliseconds(0),r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}else Object.assign(this,e)}getTime(){const e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};p([d({type:S.UTCTime})],dt.prototype,"utcTime",void 0),p([d({type:S.GeneralizedTime})],dt.prototype,"generalTime",void 0),dt=p([oe({type:W.Choice})],dt);class mi{constructor(e){this.notBefore=new dt(new Date),this.notAfter=new dt(new Date),e&&(this.notBefore=new dt(e.notBefore),this.notAfter=new dt(e.notAfter))}}p([d({type:dt})],mi.prototype,"notBefore",void 0),p([d({type:dt})],mi.prototype,"notAfter",void 0);var es;class At{constructor(e={}){this.extnID="",this.critical=At.CRITICAL,this.extnValue=new Ie,Object.assign(this,e)}}At.CRITICAL=!1,p([d({type:S.ObjectIdentifier})],At.prototype,"extnID",void 0),p([d({type:S.Boolean,defaultValue:At.CRITICAL})],At.prototype,"critical",void 0),p([d({type:Ie})],At.prototype,"extnValue",void 0);let Hr=es=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,es.prototype)}};Hr=es=p([oe({type:W.Sequence,itemType:At})],Hr);var yi;(function(n){n[n.v1=0]="v1",n[n.v2=1]="v2",n[n.v3=2]="v3"})(yi||(yi={}));class Ot{constructor(e={}){this.version=yi.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new Ne,this.issuer=new Et,this.validity=new mi,this.subject=new Et,this.subjectPublicKeyInfo=new gi,Object.assign(this,e)}}p([d({type:S.Integer,context:0,defaultValue:yi.v1})],Ot.prototype,"version",void 0),p([d({type:S.Integer,converter:Ct})],Ot.prototype,"serialNumber",void 0),p([d({type:Ne})],Ot.prototype,"signature",void 0),p([d({type:Et})],Ot.prototype,"issuer",void 0),p([d({type:mi})],Ot.prototype,"validity",void 0),p([d({type:Et})],Ot.prototype,"subject",void 0),p([d({type:gi})],Ot.prototype,"subjectPublicKeyInfo",void 0),p([d({type:S.BitString,context:1,implicit:!0,optional:!0})],Ot.prototype,"issuerUniqueID",void 0),p([d({type:S.BitString,context:2,implicit:!0,optional:!0})],Ot.prototype,"subjectUniqueID",void 0),p([d({type:Hr,context:3,optional:!0})],Ot.prototype,"extensions",void 0);class wr{constructor(e={}){this.tbsCertificate=new Ot,this.signatureAlgorithm=new Ne,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:Ot,raw:!0})],wr.prototype,"tbsCertificate",void 0),p([d({type:Ne})],wr.prototype,"signatureAlgorithm",void 0),p([d({type:S.BitString})],wr.prototype,"signatureValue",void 0);class vi{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new dt,Object.assign(this,e)}}p([d({type:S.Integer,converter:Ct})],vi.prototype,"userCertificate",void 0),p([d({type:dt})],vi.prototype,"revocationDate",void 0),p([d({type:At,optional:!0,repeated:"sequence"})],vi.prototype,"crlEntryExtensions",void 0);class tr{constructor(e={}){this.signature=new Ne,this.issuer=new Et,this.thisUpdate=new dt,Object.assign(this,e)}}p([d({type:S.Integer,optional:!0})],tr.prototype,"version",void 0),p([d({type:Ne})],tr.prototype,"signature",void 0),p([d({type:Et})],tr.prototype,"issuer",void 0),p([d({type:dt})],tr.prototype,"thisUpdate",void 0),p([d({type:dt,optional:!0})],tr.prototype,"nextUpdate",void 0),p([d({type:vi,repeated:"sequence",optional:!0})],tr.prototype,"revokedCertificates",void 0),p([d({type:At,optional:!0,context:0,repeated:"sequence"})],tr.prototype,"crlExtensions",void 0);class Ei{constructor(e={}){this.tbsCertList=new tr,this.signatureAlgorithm=new Ne,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:tr,raw:!0})],Ei.prototype,"tbsCertList",void 0),p([d({type:Ne})],Ei.prototype,"signatureAlgorithm",void 0),p([d({type:S.BitString})],Ei.prototype,"signature",void 0);var ts;class rs{constructor(e={}){this.sigIdentifier=new Ne,Object.assign(this,e)}}p([d({type:Ne})],rs.prototype,"sigIdentifier",void 0),p([d({type:Ne,optional:!0})],rs.prototype,"certIdentifier",void 0);let $a=ts=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,ts.prototype)}};$a=ts=p([oe({type:W.Sequence,itemType:rs})],$a);class Ga{constructor(e={}){this.issuer=new Et,this.locator=new li,Object.assign(this,e)}}p([d({type:Et})],Ga.prototype,"issuer",void 0),p([d({type:li})],Ga.prototype,"locator",void 0);class Yc extends Ie{}let qr=class{constructor(e={}){Object.assign(this,e)}};p([d({type:Et,context:1})],qr.prototype,"byName",void 0),p([d({type:Yc,context:2})],qr.prototype,"byKey",void 0),qr=p([oe({type:W.Choice})],qr);class rr{constructor(e={}){this.hashAlgorithm=new Ne,this.issuerNameHash=new Ie,this.issuerKeyHash=new Ie,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:Ne})],rr.prototype,"hashAlgorithm",void 0),p([d({type:Ie})],rr.prototype,"issuerNameHash",void 0),p([d({type:Ie})],rr.prototype,"issuerKeyHash",void 0),p([d({type:S.Integer,converter:Ct})],rr.prototype,"serialNumber",void 0);class ns{constructor(e={}){this.revocationTime=new Date,Object.assign(this,e)}}p([d({type:S.GeneralizedTime})],ns.prototype,"revocationTime",void 0),p([d({type:pi,context:0,optional:!0})],ns.prototype,"revocationReason",void 0);let br=class{constructor(e={}){Object.assign(this,e)}};p([d({type:S.Null,context:0,implicit:!0})],br.prototype,"good",void 0),p([d({type:ns,context:1,implicit:!0})],br.prototype,"revoked",void 0),p([d({type:S.Null,context:2,implicit:!0})],br.prototype,"unknown",void 0),br=p([oe({type:W.Choice})],br);class jr{constructor(e={}){this.certID=new rr,this.certStatus=new br,this.thisUpdate=new Date,Object.assign(this,e)}}p([d({type:rr})],jr.prototype,"certID",void 0),p([d({type:br})],jr.prototype,"certStatus",void 0),p([d({type:S.GeneralizedTime})],jr.prototype,"thisUpdate",void 0),p([d({type:S.GeneralizedTime,context:0,optional:!0})],jr.prototype,"nextUpdate",void 0),p([d({type:At,context:1,repeated:"sequence",optional:!0})],jr.prototype,"singleExtensions",void 0);var $r;(function(n){n[n.v1=0]="v1"})($r||($r={}));class Dr{constructor(e={}){this.version=$r.v1,this.responderID=new qr,this.producedAt=new Date,this.responses=[],Object.assign(this,e)}}p([d({type:S.Integer,context:0,defaultValue:$r.v1})],Dr.prototype,"version",void 0),p([d({type:qr})],Dr.prototype,"responderID",void 0),p([d({type:S.GeneralizedTime})],Dr.prototype,"producedAt",void 0),p([d({type:jr,repeated:"sequence"})],Dr.prototype,"responses",void 0),p([d({type:At,repeated:"sequence",context:1,optional:!0})],Dr.prototype,"responseExtensions",void 0);class Gr{constructor(e={}){this.tbsResponseData=new Dr,this.signatureAlgorithm=new Ne,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:Dr,raw:!0})],Gr.prototype,"tbsResponseData",void 0),p([d({type:Ne})],Gr.prototype,"signatureAlgorithm",void 0),p([d({type:S.BitString})],Gr.prototype,"signature",void 0),p([d({type:wr,repeated:"sequence",optional:!0,context:0})],Gr.prototype,"certs",void 0);class Ai{constructor(e={}){this.signatureAlgorithm=new Ne,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:Ne})],Ai.prototype,"signatureAlgorithm",void 0),p([d({type:S.BitString})],Ai.prototype,"signature",void 0),p([d({type:wr,repeated:"sequence",optional:!0,context:0})],Ai.prototype,"certs",void 0);class Ni{constructor(e={}){this.reqCert=new rr,Object.assign(this,e)}}p([d({type:rr})],Ni.prototype,"reqCert",void 0),p([d({type:At,repeated:"sequence",optional:!0})],Ni.prototype,"singleRequestExtensions",void 0);class Cr{constructor(e={}){this.version=$r.v1,this.requestList=[],Object.assign(this,e)}}p([d({type:S.Integer,context:0,defaultValue:$r.v1})],Cr.prototype,"version",void 0),p([d({type:ke,context:1,optional:!0})],Cr.prototype,"requestorName",void 0),p([d({type:Ni,repeated:"sequence"})],Cr.prototype,"requestList",void 0),p([d({type:At,context:2,optional:!0,repeated:"sequence"})],Cr.prototype,"requestExtensions",void 0);class is{constructor(e={}){this.tbsRequest=new Cr,Object.assign(this,e)}}p([d({type:Cr,raw:!0})],is.prototype,"tbsRequest",void 0),p([d({type:Ai,optional:!0,context:0})],is.prototype,"optionalSignature",void 0);var nr;(function(n){n[n.successful=0]="successful",n[n.malformedRequest=1]="malformedRequest",n[n.internalError=2]="internalError",n[n.tryLater=3]="tryLater",n[n.sigRequired=5]="sigRequired",n[n.unauthorized=6]="unauthorized"})(nr||(nr={}));class os{constructor(e={}){this.responseType="",this.response=new Ie,Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],os.prototype,"responseType",void 0),p([d({type:Ie})],os.prototype,"response",void 0);class wi{constructor(e={}){this.responseStatus=nr.successful,Object.assign(this,e)}}p([d({type:S.Enumerated})],wi.prototype,"responseStatus",void 0),p([d({type:os,context:0,optional:!0})],wi.prototype,"responseBytes",void 0);var bi=(n,e,r)=>new Promise((i,o)=>{var s=h=>{try{c(r.next(h))}catch(y){o(y)}},l=h=>{try{c(r.throw(h))}catch(y){o(y)}},c=h=>h.done?i(h.value):Promise.resolve(h.value).then(s,l);c((r=r.apply(n,e)).next())});function ss(n){return bi(this,arguments,function*(e,r={}){const{timeout:i=1e4,method:o="GET",body:s,contentType:l,accept:c,proxyUrl:h}=r,y=h?`${h}${encodeURIComponent(e)}`:e,b=new AbortController,E=setTimeout(()=>b.abort(),i);try{const x={};l&&(x["Content-Type"]=l),c&&(x.Accept=c);const T=yield fetch(y,{method:o,headers:x,body:s?new Uint8Array(s):void 0,signal:b.signal});if(clearTimeout(E),!T.ok)return{ok:!1,status:T.status,error:`HTTP ${T.status}: ${T.statusText}`};const R=yield T.arrayBuffer();return{ok:!0,status:T.status,data:R}}catch(x){return clearTimeout(E),x instanceof Error?x.name==="AbortError"?{ok:!1,status:0,error:`Request timeout after ${i}ms`}:{ok:!1,status:0,error:x.message}:{ok:!1,status:0,error:String(x)}}})}function Jc(n,e,r=5e3,i){return bi(this,null,function*(){return ss(n,{method:"POST",body:e,contentType:"application/ocsp-request",accept:"application/ocsp-response",timeout:r,proxyUrl:i})})}function Kc(n,e=1e4,r){return bi(this,null,function*(){return ss(n,{method:"GET",accept:"application/pkix-crl",timeout:e,proxyUrl:r})})}function Qc(n,e=5e3,r){return bi(this,null,function*(){return ss(n,{method:"GET",accept:"application/pkix-cert",timeout:e,proxyUrl:r})})}function Xa(n){const e=new Uint8Array(n);if(typeof btoa=="function"){let r="";for(let i=0;i<e.length;i++)r+=String.fromCharCode(e[i]);return btoa(r)}return Buffer.from(e).toString("base64")}function Di(n){const e=n.replace(/\s/g,"");if(typeof atob=="function"){const i=atob(e),o=new Uint8Array(i.length);for(let s=0;s<i.length;s++)o[s]=i.charCodeAt(s);return o.buffer}const r=Buffer.from(e,"base64");return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)}function Zc(n){return new Uint8Array(Di(n))}function Ci(n){return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,"0")).join("")}function ef(n){const e=new Uint8Array(n.length/2);for(let r=0;r<n.length;r+=2)e[r/2]=parseInt(n.substring(r,r+2),16);return e.buffer}function Wa(n,e="CERTIFICATE"){const r=Xa(n).match(/.{1,64}/g)||[];return`-----BEGIN ${e}-----
79
79
  ${r.join(`
80
80
  `)}
81
- -----END ${e}-----`}var hi=(n,e,r)=>new Promise((i,o)=>{var u=p=>{try{f(r.next(p))}catch(g){o(g)}},l=p=>{try{f(r.throw(p))}catch(g){o(g)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,l);f((r=r.apply(n,e)).next())});const Ra="1.3.6.1.5.5.7.1.1",_c="1.3.14.3.2.26";function ka(n){return hi(this,null,function*(){if(typeof crypto!="undefined"&&crypto.subtle)return crypto.subtle.digest("SHA-1",n);const e=require("crypto").createHash("sha1");return e.update(Buffer.from(n)),e.digest().buffer})}function Lc(n){try{const e=n.getExtension(Ra);return e?e.ocsp.filter(r=>r.type==="url").map(r=>r.value):[]}catch(e){return[]}}function Mc(n){try{const e=n.getExtension(Ra);return e?e.caIssuers.filter(r=>r.type==="url").map(r=>r.value):[]}catch(e){return[]}}function _a(n,e){const r=n.issuer;for(const i of e)try{const o=new ke.X509Certificate(i);if(o.subject===r)return o}catch(o){}return null}function La(n,e=5e3,r){return hi(this,null,function*(){const i=Mc(n);for(const o of i)try{const u=yield Ic(o,e,r);if(u.ok&&u.data)try{return new ke.X509Certificate(u.data)}catch(l){const f=Ia(u.data);return new ke.X509Certificate(f)}}catch(u){}return null})}function Fc(n,e){return hi(this,null,function*(){const r=oa.parse(e.rawData,mr),i=Rt.serialize(r.tbsCertificate.subject),o=yield ka(i),u=yield ka(r.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey),l=kc(n.serialNumber),f=new Zt({hashAlgorithm:new ve({algorithm:_c}),issuerNameHash:new xe(o),issuerKeyHash:new xe(u),serialNumber:l}),p=new ci({reqCert:f}),g=new Er({requestList:[p]}),N=new Go({tbsRequest:g});return Rt.serialize(N)})}function Uc(n){const e=new Date;try{const r=Rt.parse(n,Wo);switch(r.responseStatus){case er.successful:break;case er.malformedRequest:return{isValid:!1,status:"error",method:"ocsp",reason:"OCSP responder returned: malformed request",checkedAt:e};case er.internalError:return{isValid:!1,status:"error",method:"ocsp",reason:"OCSP responder returned: internal error",checkedAt:e};case er.tryLater:return{isValid:!1,status:"unknown",method:"ocsp",reason:"OCSP responder returned: try later",checkedAt:e};case er.sigRequired:return{isValid:!1,status:"error",method:"ocsp",reason:"OCSP responder requires signature",checkedAt:e};case er.unauthorized:return{isValid:!1,status:"error",method:"ocsp",reason:"OCSP responder returned: unauthorized",checkedAt:e};default:return{isValid:!1,status:"error",method:"ocsp",reason:`OCSP responder returned unknown status: ${r.responseStatus}`,checkedAt:e}}if(!r.responseBytes)return{isValid:!1,status:"error",method:"ocsp",reason:"OCSP response has no response bytes",checkedAt:e};const i=Rt.parse(r.responseBytes.response.buffer,dn).tbsResponseData.responses;if(!i||i.length===0)return{isValid:!1,status:"error",method:"ocsp",reason:"OCSP response contains no certificate status",checkedAt:e};const o=i[0].certStatus;return o.good!==void 0?{isValid:!0,status:"good",method:"ocsp",checkedAt:e}:o.revoked?{isValid:!1,status:"revoked",method:"ocsp",reason:o.revoked.revocationReason!==void 0?`Certificate revoked (reason: ${o.revoked.revocationReason})`:"Certificate revoked",revokedAt:o.revoked.revocationTime,checkedAt:e}:o.unknown!==void 0?{isValid:!1,status:"unknown",method:"ocsp",reason:"OCSP responder does not know about this certificate",checkedAt:e}:{isValid:!1,status:"error",method:"ocsp",reason:"Unexpected certificate status in OCSP response",checkedAt:e}}catch(r){return{isValid:!1,status:"error",method:"ocsp",reason:`Failed to parse OCSP response: ${r instanceof Error?r.message:String(r)}`,checkedAt:e}}}function Pc(n,e){return hi(this,arguments,function*(r,i,o={}){const{timeout:u=5e3,certificateChain:l=[],proxyUrl:f}=o,p=new Date,g=Lc(r);if(g.length===0)return{isValid:!1,status:"unknown",method:"ocsp",reason:"Certificate has no OCSP responder URL",checkedAt:p};let N=i;if(N||(N=_a(r,l)),N||(N=yield La(r,u,f)),!N)return{isValid:!1,status:"unknown",method:"ocsp",reason:"Could not find or fetch issuer certificate for OCSP",checkedAt:p};let E;try{E=yield Fc(r,N)}catch(S){return{isValid:!1,status:"error",method:"ocsp",reason:`Failed to build OCSP request: ${S instanceof Error?S.message:String(S)}`,checkedAt:p}}for(const S of g)try{const C=yield Bc(S,E,u,f);if(C.ok&&C.data)return Uc(C.data)}catch(C){}return{isValid:!1,status:"error",method:"ocsp",reason:"All OCSP requests failed",checkedAt:p}})}var Vc=(n,e,r)=>new Promise((i,o)=>{var u=p=>{try{f(r.next(p))}catch(g){o(g)}},l=p=>{try{f(r.throw(p))}catch(g){o(g)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,l);f((r=r.apply(n,e)).next())});const Hc="2.5.29.31";function qc(n){try{const e=n.getExtension(Hc);if(!e)return[];const r=[];for(const i of e.distributionPoints)if(i.distributionPoint){const o=i.distributionPoint;if("fullName"in o&&o.fullName){for(const u of o.fullName)if(u.uniformResourceIdentifier){const l=u.uniformResourceIdentifier;(l.startsWith("http://")||l.startsWith("https://"))&&r.push(l)}}}return r}catch(e){return[]}}function jc(n,e){const r=e.toLowerCase().replace(/^0+(?=.)/,"")||"0";for(const i of n.entries)if((i.serialNumber.toLowerCase().replace(/^0+(?=.)/,"")||"0")===r)return{isRevoked:!0,revokedAt:i.revocationDate,reason:i.reason};return{isRevoked:!1}}function $c(n){try{return new ke.X509Crl(n)}catch(e){try{const r=`-----BEGIN X509 CRL-----
82
- ${(Ba(n).match(/.{1,64}/g)||[]).join(`
81
+ -----END ${e}-----`}var wn=(n,e,r)=>new Promise((i,o)=>{var s=h=>{try{c(r.next(h))}catch(y){o(y)}},l=h=>{try{c(r.throw(h))}catch(y){o(y)}},c=h=>h.done?i(h.value):Promise.resolve(h.value).then(s,l);c((r=r.apply(n,e)).next())});const za="1.3.6.1.5.5.7.1.1",tf="1.3.14.3.2.26";function Ya(n){return wn(this,null,function*(){if(typeof crypto!="undefined"&&crypto.subtle)return crypto.subtle.digest("SHA-1",n);const e=require("crypto").createHash("sha1");return e.update(Buffer.from(n)),e.digest().buffer})}function rf(n){try{const e=n.getExtension(za);return e?e.ocsp.filter(r=>r.type==="url").map(r=>r.value):[]}catch(e){return[]}}function nf(n){try{const e=n.getExtension(za);return e?e.caIssuers.filter(r=>r.type==="url").map(r=>r.value):[]}catch(e){return[]}}function of(n,e){const r=n.issuer;for(const i of e)try{const o=new Le.X509Certificate(i);if(o.subject===r)return o}catch(o){}return null}function sf(n){var e;const r=[];for(const i of n)try{const o=vt.parse(Di(i),wi);if(!o.responseBytes)continue;const s=vt.parse(o.responseBytes.response.buffer,Gr);for(const l of(e=s.certs)!=null?e:[])try{const c=new Le.X509Certificate(new Uint8Array(vt.serialize(l)));r.push(c.toString("pem"))}catch(c){}}catch(o){}return r}function uf(n,e){return wn(this,null,function*(){const r=[];for(const i of e)try{const o=new Le.X509Certificate(i);o.subject===n.issuer&&r.push(o)}catch(o){}for(const i of r)try{if(yield n.verify({publicKey:i,signatureOnly:!0}))return i}catch(o){}return null})}function Ja(n,e=5e3,r){return wn(this,null,function*(){const i=nf(n);for(const o of i)try{const s=yield Qc(o,e,r);if(s.ok&&s.data)try{return new Le.X509Certificate(s.data)}catch(l){const c=Wa(s.data);return new Le.X509Certificate(c)}}catch(s){}return null})}function af(n,e){return wn(this,null,function*(){const r=Ao.parse(e.rawData,wr),i=vt.serialize(r.tbsCertificate.subject),o=yield Ya(i),s=yield Ya(r.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey),l=ef(n.serialNumber),c=new rr({hashAlgorithm:new Ne({algorithm:tf}),issuerNameHash:new Ie(o),issuerKeyHash:new Ie(s),serialNumber:l}),h=new Ni({reqCert:c}),y=new Cr({requestList:[h]}),b=new is({tbsRequest:y});return vt.serialize(b)})}function lf(n){const e=new Date;try{const r=vt.parse(n,wi);switch(r.responseStatus){case nr.successful:break;case nr.malformedRequest:return{isValid:!1,status:"error",method:"ocsp",reason:"OCSP responder returned: malformed request",checkedAt:e};case nr.internalError:return{isValid:!1,status:"error",method:"ocsp",reason:"OCSP responder returned: internal error",checkedAt:e};case nr.tryLater:return{isValid:!1,status:"unknown",method:"ocsp",reason:"OCSP responder returned: try later",checkedAt:e};case nr.sigRequired:return{isValid:!1,status:"error",method:"ocsp",reason:"OCSP responder requires signature",checkedAt:e};case nr.unauthorized:return{isValid:!1,status:"error",method:"ocsp",reason:"OCSP responder returned: unauthorized",checkedAt:e};default:return{isValid:!1,status:"error",method:"ocsp",reason:`OCSP responder returned unknown status: ${r.responseStatus}`,checkedAt:e}}if(!r.responseBytes)return{isValid:!1,status:"error",method:"ocsp",reason:"OCSP response has no response bytes",checkedAt:e};const i=vt.parse(r.responseBytes.response.buffer,Gr).tbsResponseData.responses;if(!i||i.length===0)return{isValid:!1,status:"error",method:"ocsp",reason:"OCSP response contains no certificate status",checkedAt:e};const o=i[0].certStatus;return o.good!==void 0?{isValid:!0,status:"good",method:"ocsp",checkedAt:e}:o.revoked?{isValid:!1,status:"revoked",method:"ocsp",reason:o.revoked.revocationReason!==void 0?`Certificate revoked (reason: ${o.revoked.revocationReason})`:"Certificate revoked",revokedAt:o.revoked.revocationTime,checkedAt:e}:o.unknown!==void 0?{isValid:!1,status:"unknown",method:"ocsp",reason:"OCSP responder does not know about this certificate",checkedAt:e}:{isValid:!1,status:"error",method:"ocsp",reason:"Unexpected certificate status in OCSP response",checkedAt:e}}catch(r){return{isValid:!1,status:"error",method:"ocsp",reason:`Failed to parse OCSP response: ${r instanceof Error?r.message:String(r)}`,checkedAt:e}}}function cf(n,e){return wn(this,arguments,function*(r,i,o={}){const{timeout:s=5e3,certificateChain:l=[],proxyUrl:c}=o,h=new Date,y=rf(r);if(y.length===0)return{isValid:!1,status:"unknown",method:"ocsp",reason:"Certificate has no OCSP responder URL",checkedAt:h};let b=i;if(b||(b=yield uf(r,l)),b||(b=yield Ja(r,s,c)),!b)return{isValid:!1,status:"unknown",method:"ocsp",reason:"Could not find or fetch issuer certificate for OCSP",checkedAt:h};let E;try{E=yield af(r,b)}catch(x){return{isValid:!1,status:"error",method:"ocsp",reason:`Failed to build OCSP request: ${x instanceof Error?x.message:String(x)}`,checkedAt:h}}for(const x of y)try{const T=yield Jc(x,E,s,c);if(T.ok&&T.data)return lf(T.data)}catch(T){}return{isValid:!1,status:"error",method:"ocsp",reason:"All OCSP requests failed",checkedAt:h}})}var ff=(n,e,r)=>new Promise((i,o)=>{var s=h=>{try{c(r.next(h))}catch(y){o(y)}},l=h=>{try{c(r.throw(h))}catch(y){o(y)}},c=h=>h.done?i(h.value):Promise.resolve(h.value).then(s,l);c((r=r.apply(n,e)).next())});const pf="2.5.29.31",hf=5e6;function df(n){try{const e=n.getExtension(pf);if(!e)return[];const r=[];for(const i of e.distributionPoints)if(i.distributionPoint){const o=i.distributionPoint;if("fullName"in o&&o.fullName){for(const s of o.fullName)if(s.uniformResourceIdentifier){const l=s.uniformResourceIdentifier;(l.startsWith("http://")||l.startsWith("https://"))&&r.push(l)}}}return r}catch(e){return[]}}function gf(n,e){const r=e.toLowerCase().replace(/^0+(?=.)/,"")||"0";for(const i of n.entries)if((i.serialNumber.toLowerCase().replace(/^0+(?=.)/,"")||"0")===r)return{isRevoked:!0,revokedAt:i.revocationDate,reason:i.reason};return{isRevoked:!1}}function mf(n){const e=new Uint8Array(n,0,Math.min(n.byteLength,16));let r="";for(const i of e)r+=String.fromCharCode(i);if(r.includes("-----BEGIN")){const i=new TextDecoder().decode(n).replace(/-----BEGIN[^-]+-----/g,"").replace(/-----END[^-]+-----/g,"").replace(/\s+/g,"");return Di(i)}return n}function yf(n){try{const e=mf(n),r=yr(e,{maxNodes:hf});if(r.offset===-1||!r.result)return null;const i=Ao.fromASN(r.result,Ei);return new Le.X509Crl(i)}catch(e){return null}}function vf(n){try{return new Le.X509Crl(n)}catch(e){try{const r=`-----BEGIN X509 CRL-----
82
+ ${(Xa(n).match(/.{1,64}/g)||[]).join(`
83
83
  `)}
84
- -----END X509 CRL-----`;return new ke.X509Crl(r)}catch(r){return null}}}function Gc(n){return Vc(this,arguments,function*(e,r={}){const{timeout:i=1e4,proxyUrl:o}=r,u=new Date,l=qc(e);if(l.length===0)return{isValid:!1,status:"unknown",method:"crl",reason:"Certificate has no CRL distribution point",checkedAt:u};const f=[];for(const p of l)try{const g=yield Oc(p,i,o);if(!g.ok||!g.data){f.push(`${p}: ${g.error||"Failed to fetch"}`);continue}const N=$c(g.data);if(!N){f.push(`${p}: Failed to parse CRL data`);continue}const E=jc(N,e.serialNumber);return E.isRevoked?{isValid:!1,status:"revoked",method:"crl",reason:E.reason!==void 0?`Certificate revoked (reason code: ${E.reason})`:"Certificate revoked",revokedAt:E.revokedAt,checkedAt:u}:{isValid:!0,status:"good",method:"crl",checkedAt:u}}catch(g){f.push(`${p}: ${g instanceof Error?g.message:String(g)}`)}return{isValid:!1,status:"error",method:"crl",reason:`All CRL checks failed: ${f.join("; ")}`,checkedAt:u}})}var Xc=Object.defineProperty,Ma=Object.getOwnPropertySymbols,Wc=Object.prototype.hasOwnProperty,zc=Object.prototype.propertyIsEnumerable,Fa=(n,e,r)=>e in n?Xc(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,Ua=(n,e)=>{for(var r in e||(e={}))Wc.call(e,r)&&Fa(n,r,e[r]);if(Ma)for(var r of Ma(e))zc.call(e,r)&&Fa(n,r,e[r]);return n},Yc=(n,e,r)=>new Promise((i,o)=>{var u=p=>{try{f(r.next(p))}catch(g){o(g)}},l=p=>{try{f(r.throw(p))}catch(g){o(g)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,l);f((r=r.apply(n,e)).next())});function Yo(n){return Yc(this,arguments,function*(e,r={}){const i=new Date,o=Ua(Ua({},Ll),r);let u;try{u=typeof e=="string"?new ke.X509Certificate(e):e}catch(g){return{isValid:!1,status:"error",method:"none",reason:`Failed to parse certificate: ${g instanceof Error?g.message:String(g)}`,checkedAt:i}}let l=null,f=null;if(o.ocspEnabled&&(l=yield Pc(u,null,{timeout:o.ocspTimeout,certificateChain:o.certificateChain,proxyUrl:r.proxyUrl}),l.status==="good"||l.status==="revoked"))return l;if(o.crlEnabled&&(f=yield Gc(u,{timeout:o.crlTimeout,proxyUrl:r.proxyUrl}),f.status==="good"||f.status==="revoked"))return f;const p=[];return l!=null&&l.reason&&p.push(`OCSP: ${l.reason}`),f!=null&&f.reason&&p.push(`CRL: ${f.reason}`),{isValid:!1,status:"unknown",method:"none",reason:p.length>0?p.join("; "):"No revocation checking method available",checkedAt:i}})}class Vr{constructor(e={}){this.issuer=new yt,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:yt})],Vr.prototype,"issuer",void 0),h([d({type:T.Integer,converter:bt})],Vr.prototype,"serialNumber",void 0);let Hr=class{constructor(e={}){Object.assign(this,e)}};h([d({type:pn,context:0,implicit:!0})],Hr.prototype,"subjectKeyIdentifier",void 0),h([d({type:Vr})],Hr.prototype,"issuerAndSerialNumber",void 0),Hr=h([ie({type:j.Choice})],Hr);var tr;(function(n){n[n.v0=0]="v0",n[n.v1=1]="v1",n[n.v2=2]="v2",n[n.v3=3]="v3",n[n.v4=4]="v4",n[n.v5=5]="v5"})(tr||(tr={}));let gn=class extends ve{};gn=h([ie({type:j.Sequence})],gn);let di=class extends ve{};di=h([ie({type:j.Sequence})],di);let $t=class extends ve{};$t=h([ie({type:j.Sequence})],$t);let gi=class extends ve{};gi=h([ie({type:j.Sequence})],gi);let Pa=class extends ve{};Pa=h([ie({type:j.Sequence})],Pa);let Jo=class extends ve{};Jo=h([ie({type:j.Sequence})],Jo);class mn{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],mn.prototype,"attrType",void 0),h([d({type:T.Any,repeated:"set"})],mn.prototype,"attrValues",void 0);var Ko;class rr{constructor(e={}){this.version=tr.v0,this.sid=new Hr,this.digestAlgorithm=new gn,this.signatureAlgorithm=new di,this.signature=new xe,Object.assign(this,e)}}h([d({type:T.Integer})],rr.prototype,"version",void 0),h([d({type:Hr})],rr.prototype,"sid",void 0),h([d({type:gn})],rr.prototype,"digestAlgorithm",void 0),h([d({type:mn,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],rr.prototype,"signedAttrs",void 0),h([d({type:di})],rr.prototype,"signatureAlgorithm",void 0),h([d({type:xe})],rr.prototype,"signature",void 0),h([d({type:mn,repeated:"set",context:1,implicit:!0,optional:!0})],rr.prototype,"unsignedAttrs",void 0);let mi=Ko=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,Ko.prototype)}};mi=Ko=h([ie({type:j.Set,itemType:rr})],mi);let Va=class extends rr{};Va=h([ie({type:j.Sequence})],Va);let Ha=class extends pt{};Ha=h([ie({type:j.Choice})],Ha);class Qo{constructor(e={}){this.acIssuer=new Se,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}h([d({type:Se})],Qo.prototype,"acIssuer",void 0),h([d({type:T.Integer})],Qo.prototype,"acSerial",void 0),h([d({type:cn,repeated:"sequence"})],Qo.prototype,"attrs",void 0);var Zo;let yi=Zo=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,Zo.prototype)}};yi=Zo=h([ie({type:j.Sequence,itemType:T.ObjectIdentifier})],yi);class vi{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}h([d({type:T.Integer,optional:!0})],vi.prototype,"pathLenConstraint",void 0),h([d({type:yi,implicit:!0,context:0,optional:!0})],vi.prototype,"permittedAttrs",void 0),h([d({type:yi,implicit:!0,context:1,optional:!0})],vi.prototype,"excludedAttrs",void 0),h([d({type:T.Boolean,defaultValue:!0})],vi.prototype,"permitUnSpecified",void 0);class Ar{constructor(e={}){this.issuer=new _t,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:_t})],Ar.prototype,"issuer",void 0),h([d({type:T.Integer,converter:bt})],Ar.prototype,"serial",void 0),h([d({type:T.BitString,optional:!0})],Ar.prototype,"issuerUID",void 0);var es;(function(n){n[n.publicKey=0]="publicKey",n[n.publicKeyCert=1]="publicKeyCert",n[n.otherObjectTypes=2]="otherObjectTypes"})(es||(es={}));class Nr{constructor(e={}){this.digestedObjectType=es.publicKey,this.digestAlgorithm=new ve,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:T.Enumerated})],Nr.prototype,"digestedObjectType",void 0),h([d({type:T.ObjectIdentifier,optional:!0})],Nr.prototype,"otherObjectTypeID",void 0),h([d({type:ve})],Nr.prototype,"digestAlgorithm",void 0),h([d({type:T.BitString})],Nr.prototype,"objectDigest",void 0);class Ei{constructor(e={}){Object.assign(this,e)}}h([d({type:_t,optional:!0})],Ei.prototype,"issuerName",void 0),h([d({type:Ar,context:0,implicit:!0,optional:!0})],Ei.prototype,"baseCertificateID",void 0),h([d({type:Nr,context:1,implicit:!0,optional:!0})],Ei.prototype,"objectDigestInfo",void 0);let qr=class{constructor(e={}){Object.assign(this,e)}};h([d({type:Se,repeated:"sequence"})],qr.prototype,"v1Form",void 0),h([d({type:Ei,context:0,implicit:!0})],qr.prototype,"v2Form",void 0),qr=h([ie({type:j.Choice})],qr);class Ai{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}h([d({type:T.GeneralizedTime})],Ai.prototype,"notBeforeTime",void 0),h([d({type:T.GeneralizedTime})],Ai.prototype,"notAfterTime",void 0);class yn{constructor(e={}){Object.assign(this,e)}}h([d({type:Ar,implicit:!0,context:0,optional:!0})],yn.prototype,"baseCertificateID",void 0),h([d({type:_t,implicit:!0,context:1,optional:!0})],yn.prototype,"entityName",void 0),h([d({type:Nr,implicit:!0,context:2,optional:!0})],yn.prototype,"objectDigestInfo",void 0);var ts;(function(n){n[n.v2=1]="v2"})(ts||(ts={}));class Mt{constructor(e={}){this.version=ts.v2,this.holder=new yn,this.issuer=new qr,this.signature=new ve,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Ai,this.attributes=[],Object.assign(this,e)}}h([d({type:T.Integer})],Mt.prototype,"version",void 0),h([d({type:yn})],Mt.prototype,"holder",void 0),h([d({type:qr})],Mt.prototype,"issuer",void 0),h([d({type:ve})],Mt.prototype,"signature",void 0),h([d({type:T.Integer,converter:bt})],Mt.prototype,"serialNumber",void 0),h([d({type:Ai})],Mt.prototype,"attrCertValidityPeriod",void 0),h([d({type:cn,repeated:"sequence"})],Mt.prototype,"attributes",void 0),h([d({type:T.BitString,optional:!0})],Mt.prototype,"issuerUniqueID",void 0),h([d({type:Mr,optional:!0})],Mt.prototype,"extensions",void 0);class Ni{constructor(e={}){this.acinfo=new Mt,this.signatureAlgorithm=new ve,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:Mt})],Ni.prototype,"acinfo",void 0),h([d({type:ve})],Ni.prototype,"signatureAlgorithm",void 0),h([d({type:T.BitString})],Ni.prototype,"signatureValue",void 0);var wi;(function(n){n[n.unmarked=1]="unmarked",n[n.unclassified=2]="unclassified",n[n.restricted=4]="restricted",n[n.confidential=8]="confidential",n[n.secret=16]="secret",n[n.topSecret=32]="topSecret"})(wi||(wi={}));class rs extends Jn{}class ns{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:T.ObjectIdentifier,implicit:!0,context:0})],ns.prototype,"type",void 0),h([d({type:T.Any,implicit:!0,context:1})],ns.prototype,"value",void 0);class is{constructor(e={}){this.policyId="",this.classList=new rs(wi.unclassified),Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],is.prototype,"policyId",void 0),h([d({type:rs,defaultValue:new rs(wi.unclassified)})],is.prototype,"classList",void 0),h([d({type:ns,repeated:"set"})],is.prototype,"securityCategories",void 0);class bi{constructor(e={}){Object.assign(this,e)}}h([d({type:xe})],bi.prototype,"cotets",void 0),h([d({type:T.ObjectIdentifier})],bi.prototype,"oid",void 0),h([d({type:T.Utf8String})],bi.prototype,"string",void 0);class qa{constructor(e={}){this.values=[],Object.assign(this,e)}}h([d({type:_t,implicit:!0,context:0,optional:!0})],qa.prototype,"policyAuthority",void 0),h([d({type:bi,repeated:"sequence"})],qa.prototype,"values",void 0);var os;class Di{constructor(e={}){this.targetCertificate=new Ar,Object.assign(this,e)}}h([d({type:Ar})],Di.prototype,"targetCertificate",void 0),h([d({type:Se,optional:!0})],Di.prototype,"targetName",void 0),h([d({type:Nr,optional:!0})],Di.prototype,"certDigestInfo",void 0);let jr=class{constructor(e={}){Object.assign(this,e)}};h([d({type:Se,context:0,implicit:!0})],jr.prototype,"targetName",void 0),h([d({type:Se,context:1,implicit:!0})],jr.prototype,"targetGroup",void 0),h([d({type:Di,context:2,implicit:!0})],jr.prototype,"targetCert",void 0),jr=h([ie({type:j.Choice})],jr);let ss=os=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,os.prototype)}};ss=os=h([ie({type:j.Sequence,itemType:jr})],ss);var us;let ja=us=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,us.prototype)}};ja=us=h([ie({type:j.Sequence,itemType:ss})],ja);class $a{constructor(e={}){Object.assign(this,e)}}h([d({type:_t,implicit:!0,context:0,optional:!0})],$a.prototype,"roleAuthority",void 0),h([d({type:Se,implicit:!0,context:1})],$a.prototype,"roleName",void 0);class as{constructor(e={}){this.service=new Se,this.ident=new Se,Object.assign(this,e)}}h([d({type:Se})],as.prototype,"service",void 0),h([d({type:Se})],as.prototype,"ident",void 0),h([d({type:xe,optional:!0})],as.prototype,"authInfo",void 0);var ls;class cs{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],cs.prototype,"otherCertFormat",void 0),h([d({type:T.Any})],cs.prototype,"otherCert",void 0);let $r=class{constructor(e={}){Object.assign(this,e)}};h([d({type:mr})],$r.prototype,"certificate",void 0),h([d({type:Ni,context:2,implicit:!0})],$r.prototype,"v2AttrCert",void 0),h([d({type:cs,context:3,implicit:!0})],$r.prototype,"other",void 0),$r=h([ie({type:j.Choice})],$r);let Ci=ls=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,ls.prototype)}};Ci=ls=h([ie({type:j.Set,itemType:$r})],Ci);class xi{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],xi.prototype,"contentType",void 0),h([d({type:T.Any,context:0})],xi.prototype,"content",void 0);let vn=class{constructor(e={}){Object.assign(this,e)}};h([d({type:xe})],vn.prototype,"single",void 0),h([d({type:T.Any})],vn.prototype,"any",void 0),vn=h([ie({type:j.Choice})],vn);class Ti{constructor(e={}){this.eContentType="",Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],Ti.prototype,"eContentType",void 0),h([d({type:vn,context:0,optional:!0})],Ti.prototype,"eContent",void 0);let En=class{constructor(e={}){Object.assign(this,e)}};h([d({type:xe,context:0,implicit:!0,optional:!0})],En.prototype,"value",void 0),h([d({type:xe,converter:lc,context:0,implicit:!0,optional:!0,repeated:"sequence"})],En.prototype,"constructedValue",void 0),En=h([ie({type:j.Choice})],En);class An{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new gi,Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],An.prototype,"contentType",void 0),h([d({type:gi})],An.prototype,"contentEncryptionAlgorithm",void 0),h([d({type:En,optional:!0})],An.prototype,"encryptedContent",void 0);class Si{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],Si.prototype,"keyAttrId",void 0),h([d({type:T.Any,optional:!0})],Si.prototype,"keyAttr",void 0);var fs;class Bi{constructor(e={}){this.subjectKeyIdentifier=new pn,Object.assign(this,e)}}h([d({type:pn})],Bi.prototype,"subjectKeyIdentifier",void 0),h([d({type:T.GeneralizedTime,optional:!0})],Bi.prototype,"date",void 0),h([d({type:Si,optional:!0})],Bi.prototype,"other",void 0);let Gr=class{constructor(e={}){Object.assign(this,e)}};h([d({type:Bi,context:0,implicit:!0,optional:!0})],Gr.prototype,"rKeyId",void 0),h([d({type:Vr,optional:!0})],Gr.prototype,"issuerAndSerialNumber",void 0),Gr=h([ie({type:j.Choice})],Gr);class ps{constructor(e={}){this.rid=new Gr,this.encryptedKey=new xe,Object.assign(this,e)}}h([d({type:Gr})],ps.prototype,"rid",void 0),h([d({type:xe})],ps.prototype,"encryptedKey",void 0);let Oi=fs=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,fs.prototype)}};Oi=fs=h([ie({type:j.Sequence,itemType:ps})],Oi);class hs{constructor(e={}){this.algorithm=new ve,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:ve})],hs.prototype,"algorithm",void 0),h([d({type:T.BitString})],hs.prototype,"publicKey",void 0);let wr=class{constructor(e={}){Object.assign(this,e)}};h([d({type:pn,context:0,implicit:!0,optional:!0})],wr.prototype,"subjectKeyIdentifier",void 0),h([d({type:hs,context:1,implicit:!0,optional:!0})],wr.prototype,"originatorKey",void 0),h([d({type:Vr,optional:!0})],wr.prototype,"issuerAndSerialNumber",void 0),wr=h([ie({type:j.Choice})],wr);class Xr{constructor(e={}){this.version=tr.v3,this.originator=new wr,this.keyEncryptionAlgorithm=new $t,this.recipientEncryptedKeys=new Oi,Object.assign(this,e)}}h([d({type:T.Integer})],Xr.prototype,"version",void 0),h([d({type:wr,context:0})],Xr.prototype,"originator",void 0),h([d({type:xe,context:1,optional:!0})],Xr.prototype,"ukm",void 0),h([d({type:$t})],Xr.prototype,"keyEncryptionAlgorithm",void 0),h([d({type:Oi})],Xr.prototype,"recipientEncryptedKeys",void 0);let Wr=class{constructor(e={}){Object.assign(this,e)}};h([d({type:pn,context:0,implicit:!0})],Wr.prototype,"subjectKeyIdentifier",void 0),h([d({type:Vr})],Wr.prototype,"issuerAndSerialNumber",void 0),Wr=h([ie({type:j.Choice})],Wr);class Nn{constructor(e={}){this.version=tr.v0,this.rid=new Wr,this.keyEncryptionAlgorithm=new $t,this.encryptedKey=new xe,Object.assign(this,e)}}h([d({type:T.Integer})],Nn.prototype,"version",void 0),h([d({type:Wr})],Nn.prototype,"rid",void 0),h([d({type:$t})],Nn.prototype,"keyEncryptionAlgorithm",void 0),h([d({type:xe})],Nn.prototype,"encryptedKey",void 0);class wn{constructor(e={}){this.keyIdentifier=new xe,Object.assign(this,e)}}h([d({type:xe})],wn.prototype,"keyIdentifier",void 0),h([d({type:T.GeneralizedTime,optional:!0})],wn.prototype,"date",void 0),h([d({type:Si,optional:!0})],wn.prototype,"other",void 0);class bn{constructor(e={}){this.version=tr.v4,this.kekid=new wn,this.keyEncryptionAlgorithm=new $t,this.encryptedKey=new xe,Object.assign(this,e)}}h([d({type:T.Integer})],bn.prototype,"version",void 0),h([d({type:wn})],bn.prototype,"kekid",void 0),h([d({type:$t})],bn.prototype,"keyEncryptionAlgorithm",void 0),h([d({type:xe})],bn.prototype,"encryptedKey",void 0);class Dn{constructor(e={}){this.version=tr.v0,this.keyEncryptionAlgorithm=new $t,this.encryptedKey=new xe,Object.assign(this,e)}}h([d({type:T.Integer})],Dn.prototype,"version",void 0),h([d({type:Jo,context:0,optional:!0})],Dn.prototype,"keyDerivationAlgorithm",void 0),h([d({type:$t})],Dn.prototype,"keyEncryptionAlgorithm",void 0),h([d({type:xe})],Dn.prototype,"encryptedKey",void 0);class ds{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],ds.prototype,"oriType",void 0),h([d({type:T.Any})],ds.prototype,"oriValue",void 0);let ar=class{constructor(e={}){Object.assign(this,e)}};h([d({type:Nn,optional:!0})],ar.prototype,"ktri",void 0),h([d({type:Xr,context:1,implicit:!0,optional:!0})],ar.prototype,"kari",void 0),h([d({type:bn,context:2,implicit:!0,optional:!0})],ar.prototype,"kekri",void 0),h([d({type:Dn,context:3,implicit:!0,optional:!0})],ar.prototype,"pwri",void 0),h([d({type:ds,context:4,implicit:!0,optional:!0})],ar.prototype,"ori",void 0),ar=h([ie({type:j.Choice})],ar);var gs;let Ii=gs=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,gs.prototype)}};Ii=gs=h([ie({type:j.Set,itemType:ar})],Ii);var ms;class Ri{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}h([d({type:T.ObjectIdentifier})],Ri.prototype,"otherRevInfoFormat",void 0),h([d({type:T.Any})],Ri.prototype,"otherRevInfo",void 0);let ki=class{constructor(e={}){this.other=new Ri,Object.assign(this,e)}};h([d({type:Ri,context:1,implicit:!0})],ki.prototype,"other",void 0),ki=h([ie({type:j.Choice})],ki);let _i=ms=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,ms.prototype)}};_i=ms=h([ie({type:j.Set,itemType:ki})],_i);class ys{constructor(e={}){Object.assign(this,e)}}h([d({type:Ci,context:0,implicit:!0,optional:!0})],ys.prototype,"certs",void 0),h([d({type:_i,context:1,implicit:!0,optional:!0})],ys.prototype,"crls",void 0);var vs;let Es=vs=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,vs.prototype)}};Es=vs=h([ie({type:j.Set,itemType:mn})],Es);class Cn{constructor(e={}){this.version=tr.v0,this.recipientInfos=new Ii,this.encryptedContentInfo=new An,Object.assign(this,e)}}h([d({type:T.Integer})],Cn.prototype,"version",void 0),h([d({type:ys,context:0,implicit:!0,optional:!0})],Cn.prototype,"originatorInfo",void 0),h([d({type:Ii})],Cn.prototype,"recipientInfos",void 0),h([d({type:An})],Cn.prototype,"encryptedContentInfo",void 0),h([d({type:Es,context:1,implicit:!0,optional:!0})],Cn.prototype,"unprotectedAttrs",void 0);var As;let Li=As=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,As.prototype)}};Li=As=h([ie({type:j.Set,itemType:gn})],Li);class br{constructor(e={}){this.version=tr.v0,this.digestAlgorithms=new Li,this.encapContentInfo=new Ti,this.signerInfos=new mi,Object.assign(this,e)}}h([d({type:T.Integer})],br.prototype,"version",void 0),h([d({type:Li})],br.prototype,"digestAlgorithms",void 0),h([d({type:Ti})],br.prototype,"encapContentInfo",void 0),h([d({type:Ci,context:0,implicit:!0,optional:!0})],br.prototype,"certificates",void 0),h([d({type:_i,context:1,implicit:!0,optional:!0})],br.prototype,"crls",void 0),h([d({type:mi})],br.prototype,"signerInfos",void 0);class Mi{constructor(e={}){this.seconds=0,Object.assign(this,e)}}h([d({type:T.Integer,optional:!0})],Mi.prototype,"seconds",void 0),h([d({type:T.Integer,context:0,implicit:!0,optional:!0})],Mi.prototype,"millis",void 0),h([d({type:T.Integer,context:1,implicit:!0,optional:!0})],Mi.prototype,"micros",void 0);class zr{constructor(e={}){this.hashAlgorithm=new ve,this.hashedMessage=new xe,Object.assign(this,e)}}h([d({type:ve})],zr.prototype,"hashAlgorithm",void 0),h([d({type:xe})],zr.prototype,"hashedMessage",void 0);var Ft;(function(n){n[n.badAlg=1]="badAlg",n[n.badRequest=2]="badRequest",n[n.badDataFormat=16]="badDataFormat",n[n.timeNotAvailable=8192]="timeNotAvailable",n[n.unacceptedPolicy=16384]="unacceptedPolicy",n[n.unacceptedExtension=32768]="unacceptedExtension",n[n.addInfoNotAvailable=65536]="addInfoNotAvailable",n[n.systemFailure=16777216]="systemFailure"})(Ft||(Ft={}));class Jc extends Jn{toJSON(){const e=this.toNumber(),r=[];return e&Ft.addInfoNotAvailable&&r.push("addInfoNotAvailable"),e&Ft.badAlg&&r.push("badAlg"),e&Ft.badDataFormat&&r.push("badDataFormat"),e&Ft.badRequest&&r.push("badRequest"),e&Ft.systemFailure&&r.push("systemFailure"),e&Ft.systemFailure&&r.push("systemFailure"),e&Ft.timeNotAvailable&&r.push("timeNotAvailable"),e&Ft.unacceptedExtension&&r.push("unacceptedExtension"),e&Ft.unacceptedPolicy&&r.push("unacceptedPolicy"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var Ns;(function(n){n[n.granted=0]="granted",n[n.grantedWithMods=1]="grantedWithMods",n[n.rejection=2]="rejection",n[n.waiting=3]="waiting",n[n.revocationWarning=4]="revocationWarning",n[n.revocationNotification=5]="revocationNotification"})(Ns||(Ns={}));var ws;let bs=ws=class extends Ue{constructor(e){super(e),Object.setPrototypeOf(this,ws.prototype)}};bs=ws=h([ie({type:j.Sequence,itemType:T.Utf8String})],bs);class xn{constructor(e={}){this.status=Ns.granted,Object.assign(this,e)}}h([d({type:T.Integer})],xn.prototype,"status",void 0),h([d({type:bs,optional:!0})],xn.prototype,"statusString",void 0),h([d({type:Jc,optional:!0})],xn.prototype,"failInfo",void 0);var Ds;(function(n){n[n.v1=1]="v1"})(Ds||(Ds={}));class Yr{constructor(e={}){this.version=Ds.v1,this.messageImprint=new zr,this.certReq=!1,Object.assign(this,e)}}h([d({type:T.Integer})],Yr.prototype,"version",void 0),h([d({type:zr})],Yr.prototype,"messageImprint",void 0),h([d({type:T.ObjectIdentifier,optional:!0})],Yr.prototype,"reqPolicy",void 0),h([d({type:T.Integer,converter:bt,optional:!0})],Yr.prototype,"nonce",void 0),h([d({type:T.Boolean,defaultValue:!1})],Yr.prototype,"certReq",void 0),h([d({type:Mr,optional:!0,context:0,implicit:!0})],Yr.prototype,"extensions",void 0);let Cs=class extends xi{};Cs=h([ie({type:j.Sequence})],Cs);class Ga{constructor(e={}){this.status=new xn,Object.assign(this,e)}}h([d({type:xn})],Ga.prototype,"status",void 0),h([d({type:Cs,optional:!0})],Ga.prototype,"timeStampToken",void 0);var xs;(function(n){n[n.v1=1]="v1"})(xs||(xs={}));class Ut{constructor(e={}){this.version=xs.v1,this.policy="",this.messageImprint=new zr,this.serialNumber=new ArrayBuffer(0),this.genTime=new Date,this.ordering=!1,Object.assign(this,e)}}h([d({type:T.Integer})],Ut.prototype,"version",void 0),h([d({type:T.ObjectIdentifier})],Ut.prototype,"policy",void 0),h([d({type:zr})],Ut.prototype,"messageImprint",void 0),h([d({type:T.Integer,converter:bt})],Ut.prototype,"serialNumber",void 0),h([d({type:T.GeneralizedTime})],Ut.prototype,"genTime",void 0),h([d({type:Mi,optional:!0})],Ut.prototype,"accuracy",void 0),h([d({type:T.Boolean,defaultValue:!1})],Ut.prototype,"ordering",void 0),h([d({type:T.Integer,converter:bt,optional:!0})],Ut.prototype,"nonce",void 0),h([d({type:Se,context:0,optional:!0})],Ut.prototype,"tsa",void 0),h([d({type:Mr,context:1,implicit:!0,optional:!0})],Ut.prototype,"extensions",void 0);var Ts=(n,e,r)=>new Promise((i,o)=>{var u=p=>{try{f(r.next(p))}catch(g){o(g)}},l=p=>{try{f(r.throw(p))}catch(g){o(g)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,l);f((r=r.apply(n,e)).next())});const Kc="1.2.840.113549.1.7.2",Qc="1.2.840.113549.1.9.16.1.4";function Zc(n){return{"1.3.14.3.2.26":"SHA-1","2.16.840.1.101.3.4.2.1":"SHA-256","2.16.840.1.101.3.4.2.2":"SHA-384","2.16.840.1.101.3.4.2.3":"SHA-512"}[n]||n}const ef={"2.5.4.3":"CN","2.5.4.6":"C","2.5.4.7":"L","2.5.4.8":"ST","2.5.4.10":"O","2.5.4.11":"OU","2.5.4.5":"serialNumber","1.2.840.113549.1.9.1":"emailAddress"};function tf(n){var e;const r=[];for(const i of n)for(const o of i){const u=ef[o.type]||o.type,l=((e=o.value)==null?void 0:e.toString())||"";l&&r.push(`${u}=${l}`)}return r.join(", ")}function Ss(n){try{const e=Oa(n),r=Rt.parse(e,xi);if(r.contentType!==Kc)return console.warn("Timestamp is not SignedData"),null;const i=Rt.parse(r.content,br);if(i.encapContentInfo.eContentType!==Qc)return console.warn("SignedData does not contain TSTInfo"),null;if(!i.encapContentInfo.eContent)return console.warn("No eContent in SignedData"),null;const o=i.encapContentInfo.eContent;let u;o.single?u=o.single.buffer:o.any?u=o.any:u=Rt.serialize(o);const l=Rt.parse(u,Ut);let f;if(i.certificates&&i.certificates.length>0){const N=i.certificates[0];"certificate"in N&&N.certificate&&(f=Ia(Rt.serialize(N.certificate)))}let p;l.tsa&&(l.tsa.directoryName?p=tf(l.tsa.directoryName):l.tsa.uniformResourceIdentifier&&(p=l.tsa.uniformResourceIdentifier));let g;return l.accuracy&&(g=(l.accuracy.seconds||0)+(l.accuracy.millis||0)/1e3+(l.accuracy.micros||0)/1e6),{genTime:l.genTime,policy:l.policy,serialNumber:pi(l.serialNumber),hashAlgorithm:Zc(l.messageImprint.hashAlgorithm.algorithm),messageImprint:pi(l.messageImprint.hashedMessage.buffer),tsaName:p,tsaCertificate:f,accuracy:g}}catch(e){return console.error("Failed to parse timestamp:",e instanceof Error?e.message:String(e)),null}}function rf(n,e){return Ts(this,null,function*(){const r={"SHA-1":"SHA-1","SHA-256":"SHA-256","SHA-384":"SHA-384","SHA-512":"SHA-512"}[e];if(!r)throw new Error(`Unsupported hash algorithm: ${e}`);if(typeof crypto!="undefined"&&crypto.subtle)return crypto.subtle.digest(r,n);const i=require("crypto").createHash(e.toLowerCase().replace("-",""));return i.update(Buffer.from(n)),i.digest().buffer})}function nf(n,e){return Ts(this,null,function*(){try{const r=n.messageImprint.toLowerCase(),i=new TextEncoder().encode(e),o=yield rf(i.buffer,n.hashAlgorithm);return pi(o).toLowerCase()===r}catch(r){return console.error("Failed to verify timestamp coverage:",r instanceof Error?r.message:String(r)),!1}})}function Xa(n){return Ts(this,arguments,function*(e,r={}){const i=Ss(e);if(!i)return{isValid:!1,reason:"Failed to parse timestamp token"};let o,u;r.canonicalSignatureValue&&(o=yield nf(i,r.canonicalSignatureValue),o||(u="Could not verify timestamp covers signature (hash mismatch)"));let l;if(r.verifyTsaCertificate&&i.tsaCertificate)try{const f=new ke.X509Certificate(i.tsaCertificate);if(i.genTime<f.notBefore||i.genTime>f.notAfter)return{isValid:!1,info:i,coversSignature:o,reason:`TSA certificate was not valid at timestamp time (${i.genTime.toISOString()})`};if(r.checkTsaRevocation!==!1)try{if(l=yield Yo(f,r.revocationOptions),l.status==="revoked")return{isValid:!1,info:i,coversSignature:o,tsaRevocation:l,reason:`TSA certificate has been revoked: ${l.reason||"No reason provided"}`}}catch(p){l={isValid:!1,status:"error",method:"none",reason:`TSA revocation check failed: ${p instanceof Error?p.message:String(p)}`,checkedAt:new Date}}}catch(f){return{isValid:!1,info:i,coversSignature:o,reason:`Failed to verify TSA certificate: ${f instanceof Error?f.message:String(f)}`}}return{isValid:!0,info:i,coversSignature:o,tsaRevocation:l,reason:u}})}function of(n){const e=Ss(n);return(e==null?void 0:e.genTime)||null}var sf=(n,e,r)=>new Promise((i,o)=>{var u=p=>{try{f(r.next(p))}catch(g){o(g)}},l=p=>{try{f(r.throw(p))}catch(g){o(g)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,l);f((r=r.apply(n,e)).next())});function uf(n){const e=new Uint8Array(n);let r=0;const i=()=>{const u=e[r++];if((u&128)===0)return u;const l=u&127;let f=0;for(let p=0;p<l;p++)f=f<<8|e[r++];return f},o=()=>{if(e[r++]!==2)return BigInt(0);const u=i();let l=BigInt(0);for(let f=0;f<u;f++)l=l<<BigInt(8)|BigInt(e[r++]);return l};try{if(e[r++]!==48||(i(),e[r++]!==48))return null;const u=i();if(r+=u,e[r++]!==3||(i(),r++,e[r++]!==48))return null;i();const l=o(),f=o();return{n:l,e:f}}catch(u){return null}}function af(n,e,r){let i=BigInt(1);for(n=n%r;e>0;)e%BigInt(2)===BigInt(1)&&(i=i*n%r),e=e>>BigInt(1),n=n*n%r;return i}function lf(n){let e=BigInt(0);for(const r of n)e=e<<BigInt(8)|BigInt(r);return e}function cf(n,e){const r=new Uint8Array(e);for(let i=e-1;i>=0;i--)r[i]=Number(n&BigInt(255)),n=n>>BigInt(8);return r}function ff(n){if(n[0]!==0||n[1]!==1)return null;let e=-1;for(let r=2;r<n.length;r++){if(n[r]===0){e=r;break}if(n[r]!==255)return null}return e===-1||e<10?null:n.slice(e+1)}function pf(n,e){for(let r=0;r<n.length-1;r++)if(n[r]===4){const i=n[r+1];if(i===e&&r+2+i<=n.length)return n.slice(r+2,r+2+i)}return null}function hf(n){switch(n.toLowerCase().replace("-","")){case"sha1":return 20;case"sha256":return 32;case"sha384":return 48;case"sha512":return 64;default:return 32}}function Wa(){return typeof window!="undefined"&&typeof window.crypto!="undefined"&&typeof window.crypto.subtle!="undefined"}function za(n,e,r,i){return sf(this,null,function*(){try{let o;if(Wa()){const g=uf(n);if(!g)return!1;const{n:N,e:E}=g,S=Math.ceil(N.toString(16).length/2),C=lf(e),I=af(C,E,N),H=cf(I,S);o=ff(H)}else{const g=require("crypto"),N=g.createPublicKey({key:Buffer.from(n),format:"der",type:"spki"}),E=g.publicDecrypt({key:N,padding:g.constants.RSA_PKCS1_PADDING},Buffer.from(e));o=new Uint8Array(E)}if(!o)return!1;const u=hf(i),l=pf(o,u);if(!l)return!1;let f;if(Wa()){let g=i.toUpperCase().replace(/-/g,"");g=g.replace(/^SHA(\d)/,"SHA-$1");const N=yield window.crypto.subtle.digest(g,new Uint8Array(r));f=new Uint8Array(N)}else{const g=require("crypto"),N=i.toLowerCase().replace("-","");f=g.createHash(N).update(Buffer.from(r)).digest()}if(l.length!==f.length)return!1;let p=0;for(let g=0;g<l.length;g++)p|=l[g]^f[g];return p===0}catch(o){return!1}})}const df={c:"C",cn:"CN",dnq:"DNQ",emailaddress:"E",e:"E",g:"GN",givenname:"GN",gn:"GN",l:"L",o:"O",organizationidentifier:"ORGANIZATIONIDENTIFIER","2.5.4.97":"ORGANIZATIONIDENTIFIER","oid.2.5.4.97":"ORGANIZATIONIDENTIFIER",ou:"OU",serialnumber:"SERIALNUMBER",sn:"SN",st:"ST",surname:"SN",street:"STREET","2.5.4.5":"SERIALNUMBER"};function Ya(n,e){const r=[];let i="",o=!1;for(const u of n){if(o){i+=u,o=!1;continue}if(u==="\\"){i+=u,o=!0;continue}if(u===e){r.push(i),i="";continue}i+=u}return r.push(i),r}function gf(n){const e=n.trim();return df[e.toLowerCase()]||e.toUpperCase()}function mf(n,e){const r=e.trim().replace(/\s+/g," ");return n==="C"?r.toUpperCase():r}function yf(n){return n&&n.replace(/[^a-fA-F0-9]/g,"").toLowerCase()||null}function Bs(n){return Array.from(n,e=>e.toString(16).padStart(2,"0")).join("")}function vf(n){const e=n.replace(/\s+/g,"");try{if(typeof Buffer!="undefined")return Uint8Array.from(Buffer.from(e,"base64"));if(typeof atob=="function"){const r=atob(e);return Uint8Array.from(r,i=>i.charCodeAt(0))}}catch(r){return null}return null}function Ja(n){if(!n)return null;if(typeof n!="string")return ArrayBuffer.isView(n)?Bs(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)):Bs(new Uint8Array(n));const e=n.trim();if(!e)return null;const r=yf(e),i=e.replace(/[\s:-]+/g,"");if(r&&/^[a-fA-F0-9]+$/.test(i)&&i.length%2===0)return r;if(/^[A-Za-z0-9+/=\s]+$/.test(e)&&e.replace(/\s+/g,"").length%4===0){const o=vf(e);if(o&&o.length>0)return Bs(o)}return r}function Os(n){return n?Ya(n,",").map(e=>e.trim()).filter(Boolean).map(e=>{const[r,...i]=Ya(e,"=");if(!r||i.length===0)return e.replace(/\s+/g," ");const o=gf(r),u=mf(o,i.join("="));return`${o}=${u}`}).sort((e,r)=>e.localeCompare(r)).join(","):""}var Is=(n,e,r)=>new Promise((i,o)=>{var u=p=>{try{f(r.next(p))}catch(g){o(g)}},l=p=>{try{f(r.throw(p))}catch(g){o(g)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,l);f((r=r.apply(n,e)).next())});const Ef="2.5.29.35",Af="2.5.29.14";function Ka(n){return Is(this,null,function*(){const e=yield crypto.subtle.digest("SHA-256",n);return pi(e)})}function Nf(n){const e=n.getExtension(Ef);return Ja(e==null?void 0:e.keyId)}function wf(n){const e=n.getExtension(Af);return Ja(e==null?void 0:e.keyId)}function bf(n){return Is(this,arguments,function*(e,r={}){const i=new ke.X509Certificate(e);let o=r.certificateChain&&r.certificateChain.length>0?_a(i,r.certificateChain):null;return!o&&r.fetchOptions&&(o=yield La(i,r.fetchOptions.timeout,r.fetchOptions.proxyUrl)),{issuerSubjectDn:Os(i.issuer),authorityKeyIdentifierHex:Nf(i),issuerCertificate:o?{subjectDn:Os(o.subject),spkiSha256Hex:yield Ka(o.publicKey.rawData)}:null}})}function Df(n){return Is(this,null,function*(){const e=new ke.X509Certificate(n);return{subjectDn:Os(e.subject),subjectKeyIdentifierHex:wf(e),spkiSha256Hex:yield Ka(e.publicKey.rawData)}})}var Cf=Object.defineProperty,Qa=Object.getOwnPropertySymbols,xf=Object.prototype.hasOwnProperty,Tf=Object.prototype.propertyIsEnumerable,Za=(n,e,r)=>e in n?Cf(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,Tn=(n,e)=>{for(var r in e||(e={}))xf.call(e,r)&&Za(n,r,e[r]);if(Qa)for(var r of Qa(e))Tf.call(e,r)&&Za(n,r,e[r]);return n},Dr=(n,e,r)=>new Promise((i,o)=>{var u=p=>{try{f(r.next(p))}catch(g){o(g)}},l=p=>{try{f(r.throw(p))}catch(g){o(g)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,l);f((r=r.apply(n,e)).next())});function Be(n,e,r,i,o){return Tn(Tn({check:n,label:e,status:r},i?{detail:i}:{}),o?{country:o}:{})}function el(n){const e=Object.entries(n.details).filter(([r,i])=>!i.matches).map(([r])=>r).join(", ");return e?`Checksum validation failed for files: ${e}`:"Checksum validation failed"}function tl(n,e,r,i,o,u){return i?Be(n,e,"indeterminate",i):r?r.confidence==="dn_only"&&!u?Be(n,e,"indeterminate",r.detail||o,r.country):r.trustedAtTime===!0?Be(n,e,"pass",r.detail,r.country):r.trustedAtTime===!1||!r.found?Be(n,e,"fail",r.detail,r.country):Be(n,e,"indeterminate",r.detail||o,r.country):Be(n,e,"indeterminate",o)}function Sf({options:n,signatureInfo:e,certificateValidityAtSigningTime:r,certificateResult:i,checksumResult:o,signatureResult:u,timestampResult:l,overallStatus:f,trustListMatch:p,trustListError:g,timestampTrustListMatch:N,timestampTrustListError:E}){var S;const C=[];return n.verifyChecksums===!1?C.push(Be("document_integrity","Document integrity","skipped","Checksum verification not enabled")):C.push(Be("document_integrity","Document integrity",o.isValid?"pass":"fail",o.isValid?void 0:el(o))),n.verifySignatures===!1?C.push(Be("signature_valid","Signature cryptographically valid","skipped","Signature verification not enabled")):u.unsupportedPlatform?C.push(Be("signature_valid","Signature cryptographically valid","indeterminate",u.reason||"Signature verification is not supported on this platform")):C.push(Be("signature_valid","Signature cryptographically valid",u.isValid?"pass":"fail",u.isValid?void 0:u.reason)),r.isValid?C.push(Be("certificate_valid_at_signing_time","Certificate valid at trusted signing time","pass")):C.push(Be("certificate_valid_at_signing_time","Certificate valid at trusted signing time",f==="INDETERMINATE"?"indeterminate":"fail",r.reason||i.reason)),e.signatureTimestamp?C.push(Be("timestamp_present","Signature timestamp present","pass")):C.push(Be("timestamp_present","Signature timestamp present","skipped","Signature timestamp not present")),e.signatureTimestamp?n.verifyTimestamps===!1?C.push(Be("timestamp_valid","Timestamp valid and bound to signature","skipped","Timestamp verification not enabled")):l?l.coversSignature===!1?C.push(Be("timestamp_valid","Timestamp valid and bound to signature","fail",l.reason||"Timestamp token does not cover the signature value")):l.isValid?l.coversSignature===!0?C.push(Be("timestamp_valid","Timestamp valid and bound to signature","pass")):C.push(Be("timestamp_valid","Timestamp valid and bound to signature","indeterminate",l.reason||"Timestamp token verified, but signature binding could not be confirmed")):C.push(Be("timestamp_valid","Timestamp valid and bound to signature","fail",l.reason||"Timestamp verification failed")):C.push(Be("timestamp_valid","Timestamp valid and bound to signature","indeterminate","Timestamp verification did not return a result")):C.push(Be("timestamp_valid","Timestamp valid and bound to signature","skipped","Signature timestamp not present")),e.signatureTimestamp?n.verifyTimestamps===!1?C.push(Be("timestamp_authority_trusted_at_signing_time","Timestamp authority trusted at signing time","skipped","Timestamp verification not enabled")):n.trustListProvider?(S=l==null?void 0:l.info)!=null&&S.tsaCertificate?C.push(tl("timestamp_authority_trusted_at_signing_time","Timestamp authority trusted at signing time",N,E,"Timestamp authority trust check did not return a result",n.allowWeakDnOnlyTrustMatch===!0)):C.push(Be("timestamp_authority_trusted_at_signing_time","Timestamp authority trusted at signing time","indeterminate",(l==null?void 0:l.reason)||"Timestamp verification did not produce a TSA certificate")):C.push(Be("timestamp_authority_trusted_at_signing_time","Timestamp authority trusted at signing time","skipped","Trusted-list provider not configured")):C.push(Be("timestamp_authority_trusted_at_signing_time","Timestamp authority trusted at signing time","skipped","Signature timestamp not present")),n.checkRevocation===!1?C.push(Be("certificate_not_revoked_at_signing_time","Certificate not revoked at signing time","skipped","Revocation check not enabled")):i.revocation?i.revocation.status==="good"||i.revocation.isValid?C.push(Be("certificate_not_revoked_at_signing_time","Certificate not revoked at signing time","pass",i.revocation.reason)):i.revocation.status==="unknown"||i.revocation.status==="error"?C.push(Be("certificate_not_revoked_at_signing_time","Certificate not revoked at signing time","indeterminate",i.revocation.reason)):C.push(Be("certificate_not_revoked_at_signing_time","Certificate not revoked at signing time","fail",i.revocation.reason)):C.push(Be("certificate_not_revoked_at_signing_time","Certificate not revoked at signing time","skipped","Revocation check was not performed")),n.trustListProvider?C.push(tl("issuer_trusted_at_signing_time","Issuer trusted at signing time",p,g,"Issuer trust check did not return a result",n.allowWeakDnOnlyTrustMatch===!0)):C.push(Be("issuer_trusted_at_signing_time","Issuer trusted at signing time","skipped","Trusted-list provider not configured")),C}function Sn(){return typeof window!="undefined"&&typeof window.crypto!="undefined"&&typeof window.crypto.subtle!="undefined"}function Bf(){if(typeof navigator=="undefined")return!1;const n=navigator.userAgent,e=/AppleWebKit/.test(n),r=/Chrome/.test(n)||/Chromium/.test(n)||/Edg/.test(n);return e&&!r}function Of(n){const e=new Uint8Array(n),r=[6,9,42,134,72,134,247,13,1,1,1];let i=-1;for(let f=0;f<=e.length-r.length;f++){let p=!0;for(let g=0;g<r.length;g++)if(e[f+g]!==r[g]){p=!1;break}if(p){i=f;break}}if(i===-1)return 0;let o=-1;for(let f=i+r.length;f<e.length;f++)if(e[f]===3){o=f;break}if(o===-1)return 0;let u=o+1;if((e[u]&128)===0?u+=1:u+=1+(e[u]&127),u+=1,e[u]!==48||(u+=1,(e[u]&128)===0?u+=1:u+=1+(e[u]&127),e[u]!==2))return 0;u+=1;let l=0;if((e[u]&128)===0)l=e[u];else{const f=e[u]&127;for(let p=0;p<f;p++)l=l<<8|e[u+1+p]}return l*8}function If(n){return!Sn()||!Bf()?!0:n<=4096}function rl(n,e){return Dr(this,null,function*(){const r=e.replace(/-/g,"").toLowerCase();let i;if(r.includes("sha256"))i="sha256";else if(r.includes("sha1"))i="sha1";else if(r.includes("sha384"))i="sha384";else if(r.includes("sha512"))i="sha512";else throw new Error(`Unsupported digest algorithm: ${e}`);return Sn()?Rf(n,i):kf(n,i)})}function Rf(n,e){return Dr(this,null,function*(){const r={sha1:"SHA-1",sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"}[e];if(!r)throw new Error(`Unsupported browser digest algorithm: ${e}`);const i=yield window.crypto.subtle.digest(r,new Uint8Array(n)),o=Array.from(new Uint8Array(i));return btoa(String.fromCharCode.apply(null,o))})}function kf(n,e){return new Promise((r,i)=>{try{const o=require("crypto").createHash(e);o.update(Buffer.from(n)),r(o.digest("base64"))}catch(o){i(new Error(`Node digest computation failed: ${o instanceof Error?o.message:String(o)}`))}})}function _f(n){const e=n.toLowerCase();return e.includes("sha512")?"SHA-512":e.includes("sha384")?"SHA-384":e.includes("sha256")?"SHA-256":e.includes("sha1")?"SHA-1":"SHA-256"}function nl(n,e){return Dr(this,null,function*(){const r={};let i=!0,o="SHA-256";n.algorithm&&(n.algorithm.includes("sha1")?o="SHA-1":n.algorithm.includes("sha384")?o="SHA-384":n.algorithm.includes("sha512")&&(o="SHA-512"));const u=Object.entries(n.signedChecksums).map(l=>Dr(null,[l],function*([f,p]){var g;const N=(g=n.digestAlgorithms)!=null&&g[f]?_f(n.digestAlgorithms[f]):o,E=e.get(f);if(E){const S=yield rl(E,N),C=p===S;r[f]={expected:p,actual:S,matches:C,fileFound:!0},C||(i=!1)}else{const S=f.includes("/")?f.split("/").pop():f;let C=!1;if(S){for(const[I,H]of e.entries())if(I.endsWith(S)){const U=yield rl(H,N),R=p===U;r[f]={expected:p,actual:U,matches:R,fileFound:!0},R||(i=!1),C=!0;break}}C||(r[f]={expected:p,actual:"",matches:!1,fileFound:!1},i=!1)}}));return yield Promise.all(u),{isValid:i,details:r}})}function Lf(n){return Dr(this,arguments,function*(e,r=new Date){try{const i=new ke.X509Certificate(e),o=Al(i,r),u=yield Qs(e);return{isValid:o.isValid,reason:o.reason,info:u}}catch(i){return{isValid:!1,reason:`Certificate parsing error: ${i instanceof Error?i.message:String(i)}`}}})}function Mf(n){switch(n){case"P-256":return 32;case"P-384":return 48;case"P-521":return 66;default:return 32}}function Ff(n,e){const r=Mf(e),i=r*2;if(n.length===i)return n;if(n[0]===48)return Uf(n,r);if(n.length>i){const o=n.length/2;if(Number.isInteger(o)){const u=n.slice(0,o),l=n.slice(o),f=Fi(u,r),p=Fi(l,r),g=new Uint8Array(i);return g.set(f,0),g.set(p,r),g}}return n}function Fi(n,e){let r=0;for(;r<n.length-1&&n[r]===0;)r++;const i=n.slice(r);if(i.length===e)return i;if(i.length<e){const o=new Uint8Array(e);return o.set(i,e-i.length),o}else return i.slice(i.length-e)}function Uf(n,e){let r=0;if(n[r++]!==48)throw new Error("Invalid DER signature: missing SEQUENCE tag");const i=n[r++];if(i&128&&(r+=i&127),n[r++]!==2)throw new Error("Invalid DER signature: missing INTEGER tag for R");const o=n[r++],u=n.slice(r,r+o);if(r+=o,n[r++]!==2)throw new Error("Invalid DER signature: missing INTEGER tag for S");const l=n[r++],f=n.slice(r,r+l),p=new Uint8Array(e*2);return p.set(Fi(u,e),0),p.set(Fi(f,e),e),p}function il(){return Sn()?window.crypto.subtle:crypto.subtle}function Pf(n,e,r,i,o){return Dr(this,null,function*(){try{const u=zs().parseFromString(n,"application/xml"),l=ot(u,"ds:SignedInfo");if(!l)return{isValid:!1,reason:"SignedInfo element not found in provided XML"};const f=o||Br.default,p=Ye.canonicalize(l,f),g=e.replace(/\s+/g,"");let N;try{N=Rc(g)}catch(C){return{isValid:!1,reason:`Failed to decode signature value: ${C instanceof Error?C.message:String(C)}`}}i.name==="ECDSA"&&(N=Ff(N,i.namedCurve));let E;try{const C=il(),I=i.name==="RSASSA-PKCS1-v1_5"||i.name==="RSA-PSS";if(I){const H=Of(r);if(H>0&&!If(H))return{isValid:!1,unsupportedPlatform:!0,reason:`RSA key size (${H} bits) not supported in this browser`,errorDetails:{category:"RSA_KEY_SIZE_UNSUPPORTED",originalMessage:"Safari/WebKit only supports RSA keys up to 4096 bits",algorithm:Tn({},i),environment:"browser",keyLength:r.byteLength}}}if(Sn()&&I)try{E=yield C.importKey("spki",r,i,!1,["verify"])}catch(H){const U=_l(r);E=yield C.importKey("spki",U,i,!1,["verify"])}else E=yield C.importKey("spki",r,i,!1,["verify"])}catch(C){const I=C instanceof Error?C:new Error(String(C));let H="Unknown reason",U="KEY_IMPORT_ERROR";if(I.name==="DataError"?(H="Key data format is invalid or incompatible",U="INVALID_KEY_FORMAT"):I.name==="NotSupportedError"?(H="Algorithm or parameters not supported",U="UNSUPPORTED_ALGORITHM"):I.message.includes("namedCurve")?(H="Missing or invalid namedCurve parameter",U="INVALID_CURVE"):I.message.includes("hash")&&(H="Incompatible or unsupported hash algorithm",U="INVALID_HASH"),i.name==="ECDSA"){const R=r.byteLength;H+=` (Key length: ${R})`}return{isValid:!1,reason:`Failed to import public key: ${H}`,errorDetails:{category:U,originalMessage:I.message,algorithm:Tn({},i),environment:Sn()?"browser":"node",keyLength:r.byteLength}}}const S=new TextEncoder().encode(p);try{return(yield il().verify(i,E,new Uint8Array(N),new Uint8Array(S)))?{isValid:!0}:i.name==="RSASSA-PKCS1-v1_5"&&(yield za(r,N,S,i.hash))?{isValid:!0}:{isValid:!1,reason:"Signature verification failed"}}catch(C){return i.name==="RSASSA-PKCS1-v1_5"&&(yield za(r,N,S,i.hash))?{isValid:!0}:{isValid:!1,reason:`Signature verification error: ${C instanceof Error?C.message:String(C)}`}}}catch(u){return{isValid:!1,reason:`SignedInfo verification error: ${u instanceof Error?u.message:String(u)}`}}})}function Vf(n,e){return Dr(this,arguments,function*(r,i,o={}){var u,l,f,p,g,N;const E=[];let S,C,I,H,U,R=o.verifyTime||r.signingTime;r.signatureTimestamp&&o.verifyTimestamps!==!1&&(S=yield Xa(r.signatureTimestamp,{canonicalSignatureValue:r.canonicalSignatureValue,verifyTsaCertificate:!0,revocationOptions:o.revocationOptions}),S.isValid&&S.info?R=S.info.genTime:S.isValid||E.push(`Timestamp verification failed: ${S.reason||"Unknown reason"}`));const K=yield Lf(r.certificatePEM,R),Ae={isValid:K.isValid,reason:K.reason};if(!K.isValid){const k=`Certificate validation error: ${K.reason||"Unknown reason"}`;E.push(k)}if(o.checkRevocation!==!1&&K.isValid)try{const k=yield Yo(r.certificatePEM,Tn({certificateChain:r.certificateChain},o.revocationOptions));if(K.revocation=k,k.status==="revoked"){const de=k.revokedAt,B=de&&de.getTime()>0;if(B&&R<de)K.revocation.isValid=!0,K.revocation.reason=`Certificate was revoked on ${de.toISOString()}, but signature was made on ${R.toISOString()} (before revocation)`;else{K.isValid=!1;const F=B?` on ${de.toISOString()}`:"";K.reason=k.reason||`Certificate has been revoked${F}`,E.push(k.reason||`Certificate revoked${F}`)}}}catch(k){K.revocation={isValid:!1,status:"error",method:"none",reason:`Revocation check failed: ${k instanceof Error?k.message:String(k)}`,checkedAt:new Date}}if(o.trustListProvider){try{const k=yield bf(r.certificatePEM,{certificateChain:r.certificateChain,fetchOptions:o.trustedListFetchOptions});C=yield o.trustListProvider.match({purpose:"signature_issuer",subjectDn:k.issuerSubjectDn,skiHex:k.authorityKeyIdentifierHex,spkiSha256Hex:(u=k.issuerCertificate)==null?void 0:u.spkiSha256Hex,time:R})}catch(k){I=`Trusted list check failed: ${k instanceof Error?k.message:String(k)}`,E.push(I)}if((l=S==null?void 0:S.info)!=null&&l.tsaCertificate&&S.info.genTime)try{const k=yield Df(S.info.tsaCertificate);H=yield o.trustListProvider.match({purpose:"timestamp_tsa",subjectDn:k.subjectDn,skiHex:k.subjectKeyIdentifierHex,spkiSha256Hex:k.spkiSha256Hex,time:S.info.genTime})}catch(k){U=`Timestamp authority trusted-list check failed: ${k instanceof Error?k.message:String(k)}`,E.push(U)}}const be=o.verifyChecksums!==!1?yield nl(r,i):{isValid:!0,details:{}},Ce=be.isValid?void 0:el(be);Ce&&E.push(Ce);let D={isValid:!0};if(o.verifySignatures!==!1&&r.rawXml&&r.signatureValue&&r.publicKey){const k=r.algorithm||"",de={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"};if(k.includes("ecdsa")&&r.publicKey.namedCurve&&(de.namedCurve=r.publicKey.namedCurve,de.name="ECDSA"),k.includes("ecdsa-sha256")?de.hash="SHA-256":k.includes("ecdsa-sha384")?de.hash="SHA-384":k.includes("ecdsa-sha512")?de.hash="SHA-512":k.includes("rsa-sha1")?de.hash="SHA-1":k.includes("rsa-pss")?(de.name="RSA-PSS",de.saltLength=32,k.includes("sha384")?(de.hash="SHA-384",de.saltLength=48):k.includes("sha512")?(de.hash="SHA-512",de.saltLength=64):de.hash="SHA-256"):k.includes("rsa-sha384")?de.hash="SHA-384":k.includes("rsa-sha512")&&(de.hash="SHA-512"),D=yield Pf(r.rawXml,r.signatureValue,r.publicKey.rawData,de,r.canonicalizationMethod),!D.isValid){let B=D.reason||"XML signature verification failed";if(D.errorDetails){const F=D.errorDetails;B+=` [Category: ${F.category}, Environment: ${F.environment}`,F.algorithm&&(B+=`, Algorithm: ${F.algorithm.name}`,F.algorithm.namedCurve&&(B+=`, Curve: ${F.algorithm.namedCurve}`)),F.keyLength&&(B+=`, Key length: ${F.keyLength} bytes`),B+="]"}E.push(B)}}else if(o.verifySignatures!==!1){const k=[];r.rawXml||k.push("Signature XML"),r.signatureValue||k.push("SignatureValue"),r.publicKey||k.push("Public Key"),E.push(`Cannot verify XML signature: missing ${k.join(", ")}`),D={isValid:!1,reason:`Missing required components: ${k.join(", ")}`}}const A=!r.signatureTimestamp||o.verifyTimestamps===!1||((f=S==null?void 0:S.isValid)!=null?f:!0);let q=K.isValid&&be.isValid&&D.isValid&&A,re="VALID",Q;const ge=[];q||(D.unsupportedPlatform?(re="UNSUPPORTED",Q=D.reason,ge.push({code:"RSA_KEY_SIZE_UNSUPPORTED",description:D.reason||"RSA key size not supported",platform:"Safari/WebKit"})):be.isValid?!D.isValid&&!D.unsupportedPlatform?(re="INVALID",Q=D.reason||"Signature verification failed"):K.isValid?S&&!S.isValid?(re="INDETERMINATE",Q=S.reason||"Timestamp verification failed",ge.push({code:"TIMESTAMP_VERIFICATION_FAILED",description:S.reason||"Could not verify timestamp to establish proof of existence"})):((N=K.revocation)==null?void 0:N.status)==="unknown"?(re="INDETERMINATE",Q="Certificate revocation status could not be determined",ge.push({code:"REVOCATION_UNKNOWN",description:K.revocation.reason||"Could not check certificate revocation status"})):(re="INVALID",Q=E[0]||"Verification failed"):(p=K.reason)!=null&&p.includes("expired")&&!(S!=null&&S.isValid)?(re="INDETERMINATE",Q="Certificate expired and no valid timestamp proof",ge.push({code:"CERT_EXPIRED_NO_POE",description:"Certificate has expired and there is no valid timestamp to prove signature was made when certificate was valid"})):((g=K.revocation)==null?void 0:g.status)==="revoked"?(re="INVALID",Q="Certificate has been revoked"):(re="INDETERMINATE",Q=K.reason||"Certificate validation inconclusive"):(re="INVALID",Q="File integrity check failed")),re==="VALID"&&o.trustListProvider&&(C&&(!C.found||C.trustedAtTime===!1)?(re="INDETERMINATE",q=!1,Q=C.found?"Signer issuer found in trusted list but was not trusted at signing time":"Signer issuer not found in trusted list",ge.push({code:"ISSUER_NOT_TRUSTED",description:Q})):!C&&I&&(re="INDETERMINATE",q=!1,Q="Trusted list check failed",ge.push({code:"TRUST_LIST_CHECK_FAILED",description:I})));const Ie=o.includeChecklist?Sf({options:o,signatureInfo:r,certificateValidityAtSigningTime:Ae,certificateResult:K,checksumResult:be,signatureResult:D,timestampResult:S,overallStatus:re,trustListMatch:C,trustListError:I,timestampTrustListMatch:H,timestampTrustListError:U}):void 0;return{isValid:q,status:re,statusMessage:Q,limitations:ge.length>0?ge:void 0,certificate:K,checksums:be,signature:o.verifySignatures!==!1?D:void 0,timestamp:S,checklist:Ie,trustListMatch:C,timestampTrustListMatch:H,errors:E.length>0?E:void 0}})}Ne.CANONICALIZATION_METHODS=Br,Ne.XMLCanonicalizer=Ye,Ne.checkCertificateRevocation=Yo,Ne.formatValidityPeriod=wl,Ne.getSignerDisplayName=Nl,Ne.getTimestampTime=of,Ne.parseCertificate=Qs,Ne.parseEdoc=kl,Ne.parseTimestamp=Ss,Ne.verifyChecksums=nl,Ne.verifySignature=Vf,Ne.verifyTimestamp=Xa,Object.defineProperty(Ne,"__esModule",{value:!0})}));
84
+ -----END X509 CRL-----`;return new Le.X509Crl(r)}catch(r){return yf(n)}}}function Ef(n){return ff(this,arguments,function*(e,r={}){const{timeout:i=1e4,proxyUrl:o}=r,s=new Date,l=df(e);if(l.length===0)return{isValid:!1,status:"unknown",method:"crl",reason:"Certificate has no CRL distribution point",checkedAt:s};const c=[];for(const h of l)try{const y=yield Kc(h,i,o);if(!y.ok||!y.data){c.push(`${h}: ${y.error||"Failed to fetch"}`);continue}const b=vf(y.data);if(!b){c.push(`${h}: Failed to parse CRL data`);continue}const E=gf(b,e.serialNumber);return E.isRevoked?{isValid:!1,status:"revoked",method:"crl",reason:E.reason!==void 0?`Certificate revoked (reason code: ${E.reason})`:"Certificate revoked",revokedAt:E.revokedAt,checkedAt:s}:{isValid:!0,status:"good",method:"crl",checkedAt:s}}catch(y){c.push(`${h}: ${y instanceof Error?y.message:String(y)}`)}return{isValid:!1,status:"error",method:"crl",reason:`All CRL checks failed: ${c.join("; ")}`,checkedAt:s}})}var Af=Object.defineProperty,Ka=Object.getOwnPropertySymbols,Nf=Object.prototype.hasOwnProperty,wf=Object.prototype.propertyIsEnumerable,Qa=(n,e,r)=>e in n?Af(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,Za=(n,e)=>{for(var r in e||(e={}))Nf.call(e,r)&&Qa(n,r,e[r]);if(Ka)for(var r of Ka(e))wf.call(e,r)&&Qa(n,r,e[r]);return n},bf=(n,e,r)=>new Promise((i,o)=>{var s=h=>{try{c(r.next(h))}catch(y){o(y)}},l=h=>{try{c(r.throw(h))}catch(y){o(y)}},c=h=>h.done?i(h.value):Promise.resolve(h.value).then(s,l);c((r=r.apply(n,e)).next())});function us(n){return bf(this,arguments,function*(e,r={}){const i=new Date,o=Za(Za({},Jl),r);let s;try{s=typeof e=="string"?new Le.X509Certificate(e):e}catch(y){return{isValid:!1,status:"error",method:"none",reason:`Failed to parse certificate: ${y instanceof Error?y.message:String(y)}`,checkedAt:i}}let l=null,c=null;if(o.ocspEnabled&&(l=yield cf(s,null,{timeout:o.ocspTimeout,certificateChain:o.certificateChain,proxyUrl:r.proxyUrl}),l.status==="good"||l.status==="revoked"))return l;if(o.crlEnabled&&(c=yield Ef(s,{timeout:o.crlTimeout,proxyUrl:r.proxyUrl}),c.status==="good"||c.status==="revoked"))return c;const h=[];return l!=null&&l.reason&&h.push(`OCSP: ${l.reason}`),c!=null&&c.reason&&h.push(`CRL: ${c.reason}`),{isValid:!1,status:"unknown",method:"none",reason:h.length>0?h.join("; "):"No revocation checking method available",checkedAt:i}})}class Xr{constructor(e={}){this.issuer=new Et,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:Et})],Xr.prototype,"issuer",void 0),p([d({type:S.Integer,converter:Ct})],Xr.prototype,"serialNumber",void 0);let Wr=class{constructor(e={}){Object.assign(this,e)}};p([d({type:An,context:0,implicit:!0})],Wr.prototype,"subjectKeyIdentifier",void 0),p([d({type:Xr})],Wr.prototype,"issuerAndSerialNumber",void 0),Wr=p([oe({type:W.Choice})],Wr);var ir;(function(n){n[n.v0=0]="v0",n[n.v1=1]="v1",n[n.v2=2]="v2",n[n.v3=3]="v3",n[n.v4=4]="v4",n[n.v5=5]="v5"})(ir||(ir={}));let bn=class extends Ne{};bn=p([oe({type:W.Sequence})],bn);let xi=class extends Ne{};xi=p([oe({type:W.Sequence})],xi);let zt=class extends Ne{};zt=p([oe({type:W.Sequence})],zt);let Ti=class extends Ne{};Ti=p([oe({type:W.Sequence})],Ti);let el=class extends Ne{};el=p([oe({type:W.Sequence})],el);let as=class extends Ne{};as=p([oe({type:W.Sequence})],as);class Dn{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],Dn.prototype,"attrType",void 0),p([d({type:S.Any,repeated:"set"})],Dn.prototype,"attrValues",void 0);var ls;class or{constructor(e={}){this.version=ir.v0,this.sid=new Wr,this.digestAlgorithm=new bn,this.signatureAlgorithm=new xi,this.signature=new Ie,Object.assign(this,e)}}p([d({type:S.Integer})],or.prototype,"version",void 0),p([d({type:Wr})],or.prototype,"sid",void 0),p([d({type:bn})],or.prototype,"digestAlgorithm",void 0),p([d({type:Dn,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],or.prototype,"signedAttrs",void 0),p([d({type:xi})],or.prototype,"signatureAlgorithm",void 0),p([d({type:Ie})],or.prototype,"signature",void 0),p([d({type:Dn,repeated:"set",context:1,implicit:!0,optional:!0})],or.prototype,"unsignedAttrs",void 0);let Si=ls=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,ls.prototype)}};Si=ls=p([oe({type:W.Set,itemType:or})],Si);let tl=class extends or{};tl=p([oe({type:W.Sequence})],tl);let rl=class extends dt{};rl=p([oe({type:W.Choice})],rl);class cs{constructor(e={}){this.acIssuer=new ke,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}p([d({type:ke})],cs.prototype,"acIssuer",void 0),p([d({type:S.Integer})],cs.prototype,"acSerial",void 0),p([d({type:En,repeated:"sequence"})],cs.prototype,"attrs",void 0);var fs;let Bi=fs=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,fs.prototype)}};Bi=fs=p([oe({type:W.Sequence,itemType:S.ObjectIdentifier})],Bi);class Oi{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}p([d({type:S.Integer,optional:!0})],Oi.prototype,"pathLenConstraint",void 0),p([d({type:Bi,implicit:!0,context:0,optional:!0})],Oi.prototype,"permittedAttrs",void 0),p([d({type:Bi,implicit:!0,context:1,optional:!0})],Oi.prototype,"excludedAttrs",void 0),p([d({type:S.Boolean,defaultValue:!0})],Oi.prototype,"permitUnSpecified",void 0);class xr{constructor(e={}){this.issuer=new Ft,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:Ft})],xr.prototype,"issuer",void 0),p([d({type:S.Integer,converter:Ct})],xr.prototype,"serial",void 0),p([d({type:S.BitString,optional:!0})],xr.prototype,"issuerUID",void 0);var ps;(function(n){n[n.publicKey=0]="publicKey",n[n.publicKeyCert=1]="publicKeyCert",n[n.otherObjectTypes=2]="otherObjectTypes"})(ps||(ps={}));class Tr{constructor(e={}){this.digestedObjectType=ps.publicKey,this.digestAlgorithm=new Ne,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:S.Enumerated})],Tr.prototype,"digestedObjectType",void 0),p([d({type:S.ObjectIdentifier,optional:!0})],Tr.prototype,"otherObjectTypeID",void 0),p([d({type:Ne})],Tr.prototype,"digestAlgorithm",void 0),p([d({type:S.BitString})],Tr.prototype,"objectDigest",void 0);class Ii{constructor(e={}){Object.assign(this,e)}}p([d({type:Ft,optional:!0})],Ii.prototype,"issuerName",void 0),p([d({type:xr,context:0,implicit:!0,optional:!0})],Ii.prototype,"baseCertificateID",void 0),p([d({type:Tr,context:1,implicit:!0,optional:!0})],Ii.prototype,"objectDigestInfo",void 0);let zr=class{constructor(e={}){Object.assign(this,e)}};p([d({type:ke,repeated:"sequence"})],zr.prototype,"v1Form",void 0),p([d({type:Ii,context:0,implicit:!0})],zr.prototype,"v2Form",void 0),zr=p([oe({type:W.Choice})],zr);class Ri{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}p([d({type:S.GeneralizedTime})],Ri.prototype,"notBeforeTime",void 0),p([d({type:S.GeneralizedTime})],Ri.prototype,"notAfterTime",void 0);class Cn{constructor(e={}){Object.assign(this,e)}}p([d({type:xr,implicit:!0,context:0,optional:!0})],Cn.prototype,"baseCertificateID",void 0),p([d({type:Ft,implicit:!0,context:1,optional:!0})],Cn.prototype,"entityName",void 0),p([d({type:Tr,implicit:!0,context:2,optional:!0})],Cn.prototype,"objectDigestInfo",void 0);var hs;(function(n){n[n.v2=1]="v2"})(hs||(hs={}));class Ut{constructor(e={}){this.version=hs.v2,this.holder=new Cn,this.issuer=new zr,this.signature=new Ne,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Ri,this.attributes=[],Object.assign(this,e)}}p([d({type:S.Integer})],Ut.prototype,"version",void 0),p([d({type:Cn})],Ut.prototype,"holder",void 0),p([d({type:zr})],Ut.prototype,"issuer",void 0),p([d({type:Ne})],Ut.prototype,"signature",void 0),p([d({type:S.Integer,converter:Ct})],Ut.prototype,"serialNumber",void 0),p([d({type:Ri})],Ut.prototype,"attrCertValidityPeriod",void 0),p([d({type:En,repeated:"sequence"})],Ut.prototype,"attributes",void 0),p([d({type:S.BitString,optional:!0})],Ut.prototype,"issuerUniqueID",void 0),p([d({type:Hr,optional:!0})],Ut.prototype,"extensions",void 0);class ki{constructor(e={}){this.acinfo=new Ut,this.signatureAlgorithm=new Ne,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:Ut})],ki.prototype,"acinfo",void 0),p([d({type:Ne})],ki.prototype,"signatureAlgorithm",void 0),p([d({type:S.BitString})],ki.prototype,"signatureValue",void 0);var _i;(function(n){n[n.unmarked=1]="unmarked",n[n.unclassified=2]="unclassified",n[n.restricted=4]="restricted",n[n.confidential=8]="confidential",n[n.secret=16]="secret",n[n.topSecret=32]="topSecret"})(_i||(_i={}));class ds extends si{}class gs{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:S.ObjectIdentifier,implicit:!0,context:0})],gs.prototype,"type",void 0),p([d({type:S.Any,implicit:!0,context:1})],gs.prototype,"value",void 0);class ms{constructor(e={}){this.policyId="",this.classList=new ds(_i.unclassified),Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],ms.prototype,"policyId",void 0),p([d({type:ds,defaultValue:new ds(_i.unclassified)})],ms.prototype,"classList",void 0),p([d({type:gs,repeated:"set"})],ms.prototype,"securityCategories",void 0);class Li{constructor(e={}){Object.assign(this,e)}}p([d({type:Ie})],Li.prototype,"cotets",void 0),p([d({type:S.ObjectIdentifier})],Li.prototype,"oid",void 0),p([d({type:S.Utf8String})],Li.prototype,"string",void 0);class nl{constructor(e={}){this.values=[],Object.assign(this,e)}}p([d({type:Ft,implicit:!0,context:0,optional:!0})],nl.prototype,"policyAuthority",void 0),p([d({type:Li,repeated:"sequence"})],nl.prototype,"values",void 0);var ys;class Mi{constructor(e={}){this.targetCertificate=new xr,Object.assign(this,e)}}p([d({type:xr})],Mi.prototype,"targetCertificate",void 0),p([d({type:ke,optional:!0})],Mi.prototype,"targetName",void 0),p([d({type:Tr,optional:!0})],Mi.prototype,"certDigestInfo",void 0);let Yr=class{constructor(e={}){Object.assign(this,e)}};p([d({type:ke,context:0,implicit:!0})],Yr.prototype,"targetName",void 0),p([d({type:ke,context:1,implicit:!0})],Yr.prototype,"targetGroup",void 0),p([d({type:Mi,context:2,implicit:!0})],Yr.prototype,"targetCert",void 0),Yr=p([oe({type:W.Choice})],Yr);let vs=ys=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,ys.prototype)}};vs=ys=p([oe({type:W.Sequence,itemType:Yr})],vs);var Es;let il=Es=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,Es.prototype)}};il=Es=p([oe({type:W.Sequence,itemType:vs})],il);class ol{constructor(e={}){Object.assign(this,e)}}p([d({type:Ft,implicit:!0,context:0,optional:!0})],ol.prototype,"roleAuthority",void 0),p([d({type:ke,implicit:!0,context:1})],ol.prototype,"roleName",void 0);class As{constructor(e={}){this.service=new ke,this.ident=new ke,Object.assign(this,e)}}p([d({type:ke})],As.prototype,"service",void 0),p([d({type:ke})],As.prototype,"ident",void 0),p([d({type:Ie,optional:!0})],As.prototype,"authInfo",void 0);var Ns;class ws{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],ws.prototype,"otherCertFormat",void 0),p([d({type:S.Any})],ws.prototype,"otherCert",void 0);let Jr=class{constructor(e={}){Object.assign(this,e)}};p([d({type:wr})],Jr.prototype,"certificate",void 0),p([d({type:ki,context:2,implicit:!0})],Jr.prototype,"v2AttrCert",void 0),p([d({type:ws,context:3,implicit:!0})],Jr.prototype,"other",void 0),Jr=p([oe({type:W.Choice})],Jr);let Fi=Ns=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,Ns.prototype)}};Fi=Ns=p([oe({type:W.Set,itemType:Jr})],Fi);class Pi{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],Pi.prototype,"contentType",void 0),p([d({type:S.Any,context:0})],Pi.prototype,"content",void 0);let xn=class{constructor(e={}){Object.assign(this,e)}};p([d({type:Ie})],xn.prototype,"single",void 0),p([d({type:S.Any})],xn.prototype,"any",void 0),xn=p([oe({type:W.Choice})],xn);class Ui{constructor(e={}){this.eContentType="",Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],Ui.prototype,"eContentType",void 0),p([d({type:xn,context:0,optional:!0})],Ui.prototype,"eContent",void 0);let Tn=class{constructor(e={}){Object.assign(this,e)}};p([d({type:Ie,context:0,implicit:!0,optional:!0})],Tn.prototype,"value",void 0),p([d({type:Ie,converter:Oc,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Tn.prototype,"constructedValue",void 0),Tn=p([oe({type:W.Choice})],Tn);class Sn{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new Ti,Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],Sn.prototype,"contentType",void 0),p([d({type:Ti})],Sn.prototype,"contentEncryptionAlgorithm",void 0),p([d({type:Tn,optional:!0})],Sn.prototype,"encryptedContent",void 0);class Vi{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],Vi.prototype,"keyAttrId",void 0),p([d({type:S.Any,optional:!0})],Vi.prototype,"keyAttr",void 0);var bs;class Hi{constructor(e={}){this.subjectKeyIdentifier=new An,Object.assign(this,e)}}p([d({type:An})],Hi.prototype,"subjectKeyIdentifier",void 0),p([d({type:S.GeneralizedTime,optional:!0})],Hi.prototype,"date",void 0),p([d({type:Vi,optional:!0})],Hi.prototype,"other",void 0);let Kr=class{constructor(e={}){Object.assign(this,e)}};p([d({type:Hi,context:0,implicit:!0,optional:!0})],Kr.prototype,"rKeyId",void 0),p([d({type:Xr,optional:!0})],Kr.prototype,"issuerAndSerialNumber",void 0),Kr=p([oe({type:W.Choice})],Kr);class Ds{constructor(e={}){this.rid=new Kr,this.encryptedKey=new Ie,Object.assign(this,e)}}p([d({type:Kr})],Ds.prototype,"rid",void 0),p([d({type:Ie})],Ds.prototype,"encryptedKey",void 0);let qi=bs=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,bs.prototype)}};qi=bs=p([oe({type:W.Sequence,itemType:Ds})],qi);class Cs{constructor(e={}){this.algorithm=new Ne,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:Ne})],Cs.prototype,"algorithm",void 0),p([d({type:S.BitString})],Cs.prototype,"publicKey",void 0);let Sr=class{constructor(e={}){Object.assign(this,e)}};p([d({type:An,context:0,implicit:!0,optional:!0})],Sr.prototype,"subjectKeyIdentifier",void 0),p([d({type:Cs,context:1,implicit:!0,optional:!0})],Sr.prototype,"originatorKey",void 0),p([d({type:Xr,optional:!0})],Sr.prototype,"issuerAndSerialNumber",void 0),Sr=p([oe({type:W.Choice})],Sr);class Qr{constructor(e={}){this.version=ir.v3,this.originator=new Sr,this.keyEncryptionAlgorithm=new zt,this.recipientEncryptedKeys=new qi,Object.assign(this,e)}}p([d({type:S.Integer})],Qr.prototype,"version",void 0),p([d({type:Sr,context:0})],Qr.prototype,"originator",void 0),p([d({type:Ie,context:1,optional:!0})],Qr.prototype,"ukm",void 0),p([d({type:zt})],Qr.prototype,"keyEncryptionAlgorithm",void 0),p([d({type:qi})],Qr.prototype,"recipientEncryptedKeys",void 0);let Zr=class{constructor(e={}){Object.assign(this,e)}};p([d({type:An,context:0,implicit:!0})],Zr.prototype,"subjectKeyIdentifier",void 0),p([d({type:Xr})],Zr.prototype,"issuerAndSerialNumber",void 0),Zr=p([oe({type:W.Choice})],Zr);class Bn{constructor(e={}){this.version=ir.v0,this.rid=new Zr,this.keyEncryptionAlgorithm=new zt,this.encryptedKey=new Ie,Object.assign(this,e)}}p([d({type:S.Integer})],Bn.prototype,"version",void 0),p([d({type:Zr})],Bn.prototype,"rid",void 0),p([d({type:zt})],Bn.prototype,"keyEncryptionAlgorithm",void 0),p([d({type:Ie})],Bn.prototype,"encryptedKey",void 0);class On{constructor(e={}){this.keyIdentifier=new Ie,Object.assign(this,e)}}p([d({type:Ie})],On.prototype,"keyIdentifier",void 0),p([d({type:S.GeneralizedTime,optional:!0})],On.prototype,"date",void 0),p([d({type:Vi,optional:!0})],On.prototype,"other",void 0);class In{constructor(e={}){this.version=ir.v4,this.kekid=new On,this.keyEncryptionAlgorithm=new zt,this.encryptedKey=new Ie,Object.assign(this,e)}}p([d({type:S.Integer})],In.prototype,"version",void 0),p([d({type:On})],In.prototype,"kekid",void 0),p([d({type:zt})],In.prototype,"keyEncryptionAlgorithm",void 0),p([d({type:Ie})],In.prototype,"encryptedKey",void 0);class Rn{constructor(e={}){this.version=ir.v0,this.keyEncryptionAlgorithm=new zt,this.encryptedKey=new Ie,Object.assign(this,e)}}p([d({type:S.Integer})],Rn.prototype,"version",void 0),p([d({type:as,context:0,optional:!0})],Rn.prototype,"keyDerivationAlgorithm",void 0),p([d({type:zt})],Rn.prototype,"keyEncryptionAlgorithm",void 0),p([d({type:Ie})],Rn.prototype,"encryptedKey",void 0);class xs{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],xs.prototype,"oriType",void 0),p([d({type:S.Any})],xs.prototype,"oriValue",void 0);let fr=class{constructor(e={}){Object.assign(this,e)}};p([d({type:Bn,optional:!0})],fr.prototype,"ktri",void 0),p([d({type:Qr,context:1,implicit:!0,optional:!0})],fr.prototype,"kari",void 0),p([d({type:In,context:2,implicit:!0,optional:!0})],fr.prototype,"kekri",void 0),p([d({type:Rn,context:3,implicit:!0,optional:!0})],fr.prototype,"pwri",void 0),p([d({type:xs,context:4,implicit:!0,optional:!0})],fr.prototype,"ori",void 0),fr=p([oe({type:W.Choice})],fr);var Ts;let ji=Ts=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,Ts.prototype)}};ji=Ts=p([oe({type:W.Set,itemType:fr})],ji);var Ss;class $i{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}p([d({type:S.ObjectIdentifier})],$i.prototype,"otherRevInfoFormat",void 0),p([d({type:S.Any})],$i.prototype,"otherRevInfo",void 0);let Gi=class{constructor(e={}){this.other=new $i,Object.assign(this,e)}};p([d({type:$i,context:1,implicit:!0})],Gi.prototype,"other",void 0),Gi=p([oe({type:W.Choice})],Gi);let Xi=Ss=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,Ss.prototype)}};Xi=Ss=p([oe({type:W.Set,itemType:Gi})],Xi);class Bs{constructor(e={}){Object.assign(this,e)}}p([d({type:Fi,context:0,implicit:!0,optional:!0})],Bs.prototype,"certs",void 0),p([d({type:Xi,context:1,implicit:!0,optional:!0})],Bs.prototype,"crls",void 0);var Os;let Is=Os=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,Os.prototype)}};Is=Os=p([oe({type:W.Set,itemType:Dn})],Is);class kn{constructor(e={}){this.version=ir.v0,this.recipientInfos=new ji,this.encryptedContentInfo=new Sn,Object.assign(this,e)}}p([d({type:S.Integer})],kn.prototype,"version",void 0),p([d({type:Bs,context:0,implicit:!0,optional:!0})],kn.prototype,"originatorInfo",void 0),p([d({type:ji})],kn.prototype,"recipientInfos",void 0),p([d({type:Sn})],kn.prototype,"encryptedContentInfo",void 0),p([d({type:Is,context:1,implicit:!0,optional:!0})],kn.prototype,"unprotectedAttrs",void 0);var Rs;let Wi=Rs=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,Rs.prototype)}};Wi=Rs=p([oe({type:W.Set,itemType:bn})],Wi);class Br{constructor(e={}){this.version=ir.v0,this.digestAlgorithms=new Wi,this.encapContentInfo=new Ui,this.signerInfos=new Si,Object.assign(this,e)}}p([d({type:S.Integer})],Br.prototype,"version",void 0),p([d({type:Wi})],Br.prototype,"digestAlgorithms",void 0),p([d({type:Ui})],Br.prototype,"encapContentInfo",void 0),p([d({type:Fi,context:0,implicit:!0,optional:!0})],Br.prototype,"certificates",void 0),p([d({type:Xi,context:1,implicit:!0,optional:!0})],Br.prototype,"crls",void 0),p([d({type:Si})],Br.prototype,"signerInfos",void 0);class zi{constructor(e={}){this.seconds=0,Object.assign(this,e)}}p([d({type:S.Integer,optional:!0})],zi.prototype,"seconds",void 0),p([d({type:S.Integer,context:0,implicit:!0,optional:!0})],zi.prototype,"millis",void 0),p([d({type:S.Integer,context:1,implicit:!0,optional:!0})],zi.prototype,"micros",void 0);class en{constructor(e={}){this.hashAlgorithm=new Ne,this.hashedMessage=new Ie,Object.assign(this,e)}}p([d({type:Ne})],en.prototype,"hashAlgorithm",void 0),p([d({type:Ie})],en.prototype,"hashedMessage",void 0);var Vt;(function(n){n[n.badAlg=1]="badAlg",n[n.badRequest=2]="badRequest",n[n.badDataFormat=16]="badDataFormat",n[n.timeNotAvailable=8192]="timeNotAvailable",n[n.unacceptedPolicy=16384]="unacceptedPolicy",n[n.unacceptedExtension=32768]="unacceptedExtension",n[n.addInfoNotAvailable=65536]="addInfoNotAvailable",n[n.systemFailure=16777216]="systemFailure"})(Vt||(Vt={}));class Df extends si{toJSON(){const e=this.toNumber(),r=[];return e&Vt.addInfoNotAvailable&&r.push("addInfoNotAvailable"),e&Vt.badAlg&&r.push("badAlg"),e&Vt.badDataFormat&&r.push("badDataFormat"),e&Vt.badRequest&&r.push("badRequest"),e&Vt.systemFailure&&r.push("systemFailure"),e&Vt.systemFailure&&r.push("systemFailure"),e&Vt.timeNotAvailable&&r.push("timeNotAvailable"),e&Vt.unacceptedExtension&&r.push("unacceptedExtension"),e&Vt.unacceptedPolicy&&r.push("unacceptedPolicy"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var ks;(function(n){n[n.granted=0]="granted",n[n.grantedWithMods=1]="grantedWithMods",n[n.rejection=2]="rejection",n[n.waiting=3]="waiting",n[n.revocationWarning=4]="revocationWarning",n[n.revocationNotification=5]="revocationNotification"})(ks||(ks={}));var _s;let Ls=_s=class extends He{constructor(e){super(e),Object.setPrototypeOf(this,_s.prototype)}};Ls=_s=p([oe({type:W.Sequence,itemType:S.Utf8String})],Ls);class _n{constructor(e={}){this.status=ks.granted,Object.assign(this,e)}}p([d({type:S.Integer})],_n.prototype,"status",void 0),p([d({type:Ls,optional:!0})],_n.prototype,"statusString",void 0),p([d({type:Df,optional:!0})],_n.prototype,"failInfo",void 0);var Ms;(function(n){n[n.v1=1]="v1"})(Ms||(Ms={}));class tn{constructor(e={}){this.version=Ms.v1,this.messageImprint=new en,this.certReq=!1,Object.assign(this,e)}}p([d({type:S.Integer})],tn.prototype,"version",void 0),p([d({type:en})],tn.prototype,"messageImprint",void 0),p([d({type:S.ObjectIdentifier,optional:!0})],tn.prototype,"reqPolicy",void 0),p([d({type:S.Integer,converter:Ct,optional:!0})],tn.prototype,"nonce",void 0),p([d({type:S.Boolean,defaultValue:!1})],tn.prototype,"certReq",void 0),p([d({type:Hr,optional:!0,context:0,implicit:!0})],tn.prototype,"extensions",void 0);let Fs=class extends Pi{};Fs=p([oe({type:W.Sequence})],Fs);class sl{constructor(e={}){this.status=new _n,Object.assign(this,e)}}p([d({type:_n})],sl.prototype,"status",void 0),p([d({type:Fs,optional:!0})],sl.prototype,"timeStampToken",void 0);var Ps;(function(n){n[n.v1=1]="v1"})(Ps||(Ps={}));class Ht{constructor(e={}){this.version=Ps.v1,this.policy="",this.messageImprint=new en,this.serialNumber=new ArrayBuffer(0),this.genTime=new Date,this.ordering=!1,Object.assign(this,e)}}p([d({type:S.Integer})],Ht.prototype,"version",void 0),p([d({type:S.ObjectIdentifier})],Ht.prototype,"policy",void 0),p([d({type:en})],Ht.prototype,"messageImprint",void 0),p([d({type:S.Integer,converter:Ct})],Ht.prototype,"serialNumber",void 0),p([d({type:S.GeneralizedTime})],Ht.prototype,"genTime",void 0),p([d({type:zi,optional:!0})],Ht.prototype,"accuracy",void 0),p([d({type:S.Boolean,defaultValue:!1})],Ht.prototype,"ordering",void 0),p([d({type:S.Integer,converter:Ct,optional:!0})],Ht.prototype,"nonce",void 0),p([d({type:ke,context:0,optional:!0})],Ht.prototype,"tsa",void 0),p([d({type:Hr,context:1,implicit:!0,optional:!0})],Ht.prototype,"extensions",void 0);var Us=(n,e,r)=>new Promise((i,o)=>{var s=h=>{try{c(r.next(h))}catch(y){o(y)}},l=h=>{try{c(r.throw(h))}catch(y){o(y)}},c=h=>h.done?i(h.value):Promise.resolve(h.value).then(s,l);c((r=r.apply(n,e)).next())});const Cf="1.2.840.113549.1.7.2",xf="1.2.840.113549.1.9.16.1.4";function Tf(n){return{"1.3.14.3.2.26":"SHA-1","2.16.840.1.101.3.4.2.1":"SHA-256","2.16.840.1.101.3.4.2.2":"SHA-384","2.16.840.1.101.3.4.2.3":"SHA-512"}[n]||n}const Sf={"2.5.4.3":"CN","2.5.4.6":"C","2.5.4.7":"L","2.5.4.8":"ST","2.5.4.10":"O","2.5.4.11":"OU","2.5.4.5":"serialNumber","1.2.840.113549.1.9.1":"emailAddress"};function Bf(n){var e;const r=[];for(const i of n)for(const o of i){const s=Sf[o.type]||o.type,l=((e=o.value)==null?void 0:e.toString())||"";l&&r.push(`${s}=${l}`)}return r.join(", ")}function Vs(n){try{const e=Di(n),r=vt.parse(e,Pi);if(r.contentType!==Cf)return console.warn("Timestamp is not SignedData"),null;const i=vt.parse(r.content,Br);if(i.encapContentInfo.eContentType!==xf)return console.warn("SignedData does not contain TSTInfo"),null;if(!i.encapContentInfo.eContent)return console.warn("No eContent in SignedData"),null;const o=i.encapContentInfo.eContent;let s;o.single?s=o.single.buffer:o.any?s=o.any:s=vt.serialize(o);const l=vt.parse(s,Ht);let c;if(i.certificates&&i.certificates.length>0){const b=i.certificates[0];"certificate"in b&&b.certificate&&(c=Wa(vt.serialize(b.certificate)))}let h;l.tsa&&(l.tsa.directoryName?h=Bf(l.tsa.directoryName):l.tsa.uniformResourceIdentifier&&(h=l.tsa.uniformResourceIdentifier));let y;return l.accuracy&&(y=(l.accuracy.seconds||0)+(l.accuracy.millis||0)/1e3+(l.accuracy.micros||0)/1e6),{genTime:l.genTime,policy:l.policy,serialNumber:Ci(l.serialNumber),hashAlgorithm:Tf(l.messageImprint.hashAlgorithm.algorithm),messageImprint:Ci(l.messageImprint.hashedMessage.buffer),tsaName:h,tsaCertificate:c,accuracy:y}}catch(e){return console.error("Failed to parse timestamp:",e instanceof Error?e.message:String(e)),null}}function Of(n,e){return Us(this,null,function*(){const r={"SHA-1":"SHA-1","SHA-256":"SHA-256","SHA-384":"SHA-384","SHA-512":"SHA-512"}[e];if(!r)throw new Error(`Unsupported hash algorithm: ${e}`);if(typeof crypto!="undefined"&&crypto.subtle)return crypto.subtle.digest(r,n);const i=require("crypto").createHash(e.toLowerCase().replace("-",""));return i.update(Buffer.from(n)),i.digest().buffer})}function If(n,e){return Us(this,null,function*(){try{const r=n.messageImprint.toLowerCase(),i=new TextEncoder().encode(e),o=yield Of(i.buffer,n.hashAlgorithm);return Ci(o).toLowerCase()===r}catch(r){return console.error("Failed to verify timestamp coverage:",r instanceof Error?r.message:String(r)),!1}})}function ul(n){return Us(this,arguments,function*(e,r={}){const i=Vs(e);if(!i)return{isValid:!1,reason:"Failed to parse timestamp token"};let o,s;r.canonicalSignatureValue&&(o=yield If(i,r.canonicalSignatureValue),o||(s="Could not verify timestamp covers signature (hash mismatch)"));let l;if(r.verifyTsaCertificate&&i.tsaCertificate)try{const c=new Le.X509Certificate(i.tsaCertificate);if(i.genTime<c.notBefore||i.genTime>c.notAfter)return{isValid:!1,info:i,coversSignature:o,reason:`TSA certificate was not valid at timestamp time (${i.genTime.toISOString()})`};if(r.checkTsaRevocation!==!1)try{if(l=yield us(c,r.revocationOptions),l.status==="revoked")return{isValid:!1,info:i,coversSignature:o,tsaRevocation:l,reason:`TSA certificate has been revoked: ${l.reason||"No reason provided"}`}}catch(h){l={isValid:!1,status:"error",method:"none",reason:`TSA revocation check failed: ${h instanceof Error?h.message:String(h)}`,checkedAt:new Date}}}catch(c){return{isValid:!1,info:i,coversSignature:o,reason:`Failed to verify TSA certificate: ${c instanceof Error?c.message:String(c)}`}}return{isValid:!0,info:i,coversSignature:o,tsaRevocation:l,reason:s}})}function Rf(n){const e=Vs(n);return(e==null?void 0:e.genTime)||null}var kf=(n,e,r)=>new Promise((i,o)=>{var s=h=>{try{c(r.next(h))}catch(y){o(y)}},l=h=>{try{c(r.throw(h))}catch(y){o(y)}},c=h=>h.done?i(h.value):Promise.resolve(h.value).then(s,l);c((r=r.apply(n,e)).next())});function _f(n){const e=new Uint8Array(n);let r=0;const i=()=>{const s=e[r++];if((s&128)===0)return s;const l=s&127;let c=0;for(let h=0;h<l;h++)c=c<<8|e[r++];return c},o=()=>{if(e[r++]!==2)return BigInt(0);const s=i();let l=BigInt(0);for(let c=0;c<s;c++)l=l<<BigInt(8)|BigInt(e[r++]);return l};try{if(e[r++]!==48||(i(),e[r++]!==48))return null;const s=i();if(r+=s,e[r++]!==3||(i(),r++,e[r++]!==48))return null;i();const l=o(),c=o();return{n:l,e:c}}catch(s){return null}}function Lf(n,e,r){let i=BigInt(1);for(n=n%r;e>0;)e%BigInt(2)===BigInt(1)&&(i=i*n%r),e=e>>BigInt(1),n=n*n%r;return i}function Mf(n){let e=BigInt(0);for(const r of n)e=e<<BigInt(8)|BigInt(r);return e}function Ff(n,e){const r=new Uint8Array(e);for(let i=e-1;i>=0;i--)r[i]=Number(n&BigInt(255)),n=n>>BigInt(8);return r}function Pf(n){if(n[0]!==0||n[1]!==1)return null;let e=-1;for(let r=2;r<n.length;r++){if(n[r]===0){e=r;break}if(n[r]!==255)return null}return e===-1||e<10?null:n.slice(e+1)}function Uf(n,e){for(let r=0;r<n.length-1;r++)if(n[r]===4){const i=n[r+1];if(i===e&&r+2+i<=n.length)return n.slice(r+2,r+2+i)}return null}function Vf(n){switch(n.toLowerCase().replace("-","")){case"sha1":return 20;case"sha256":return 32;case"sha384":return 48;case"sha512":return 64;default:return 32}}function al(){return typeof window!="undefined"&&typeof window.crypto!="undefined"&&typeof window.crypto.subtle!="undefined"}function ll(n,e,r,i){return kf(this,null,function*(){try{let o;if(al()){const y=_f(n);if(!y)return!1;const{n:b,e:E}=y,x=Math.ceil(b.toString(16).length/2),T=Mf(e),R=Lf(T,E,b),P=Ff(R,x);o=Pf(P)}else{const y=require("crypto"),b=y.createPublicKey({key:Buffer.from(n),format:"der",type:"spki"}),E=y.publicDecrypt({key:b,padding:y.constants.RSA_PKCS1_PADDING},Buffer.from(e));o=new Uint8Array(E)}if(!o)return!1;const s=Vf(i),l=Uf(o,s);if(!l)return!1;let c;if(al()){let y=i.toUpperCase().replace(/-/g,"");y=y.replace(/^SHA(\d)/,"SHA-$1");const b=yield window.crypto.subtle.digest(y,new Uint8Array(r));c=new Uint8Array(b)}else{const y=require("crypto"),b=i.toLowerCase().replace("-","");c=y.createHash(b).update(Buffer.from(r)).digest()}if(l.length!==c.length)return!1;let h=0;for(let y=0;y<l.length;y++)h|=l[y]^c[y];return h===0}catch(o){return!1}})}const Hf={c:"C",cn:"CN",dnq:"DNQ",emailaddress:"E",e:"E",g:"GN",givenname:"GN",gn:"GN",l:"L",o:"O",organizationidentifier:"ORGANIZATIONIDENTIFIER","2.5.4.97":"ORGANIZATIONIDENTIFIER","oid.2.5.4.97":"ORGANIZATIONIDENTIFIER",ou:"OU",serialnumber:"SERIALNUMBER",sn:"SN",st:"ST",surname:"SN",street:"STREET","2.5.4.5":"SERIALNUMBER"};function cl(n,e){const r=[];let i="",o=!1;for(const s of n){if(o){i+=s,o=!1;continue}if(s==="\\"){i+=s,o=!0;continue}if(s===e){r.push(i),i="";continue}i+=s}return r.push(i),r}function qf(n){const e=n.trim();return Hf[e.toLowerCase()]||e.toUpperCase()}function jf(n,e){const r=e.trim().replace(/\s+/g," ");return n==="C"?r.toUpperCase():r}function $f(n){return n&&n.replace(/[^a-fA-F0-9]/g,"").toLowerCase()||null}function Hs(n){return Array.from(n,e=>e.toString(16).padStart(2,"0")).join("")}function Gf(n){const e=n.replace(/\s+/g,"");try{if(typeof Buffer!="undefined")return Uint8Array.from(Buffer.from(e,"base64"));if(typeof atob=="function"){const r=atob(e);return Uint8Array.from(r,i=>i.charCodeAt(0))}}catch(r){return null}return null}function fl(n){if(!n)return null;if(typeof n!="string")return ArrayBuffer.isView(n)?Hs(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)):Hs(new Uint8Array(n));const e=n.trim();if(!e)return null;const r=$f(e),i=e.replace(/[\s:-]+/g,"");if(r&&/^[a-fA-F0-9]+$/.test(i)&&i.length%2===0)return r;if(/^[A-Za-z0-9+/=\s]+$/.test(e)&&e.replace(/\s+/g,"").length%4===0){const o=Gf(e);if(o&&o.length>0)return Hs(o)}return r}function qs(n){return n?cl(n,",").map(e=>e.trim()).filter(Boolean).map(e=>{const[r,...i]=cl(e,"=");if(!r||i.length===0)return e.replace(/\s+/g," ");const o=qf(r),s=jf(o,i.join("="));return`${o}=${s}`}).sort((e,r)=>e.localeCompare(r)).join(","):""}var js=(n,e,r)=>new Promise((i,o)=>{var s=h=>{try{c(r.next(h))}catch(y){o(y)}},l=h=>{try{c(r.throw(h))}catch(y){o(y)}},c=h=>h.done?i(h.value):Promise.resolve(h.value).then(s,l);c((r=r.apply(n,e)).next())});const Xf="2.5.29.35",Wf="2.5.29.14";function pl(n){return js(this,null,function*(){const e=yield crypto.subtle.digest("SHA-256",n);return Ci(e)})}function zf(n){const e=n.getExtension(Xf);return fl(e==null?void 0:e.keyId)}function Yf(n){const e=n.getExtension(Wf);return fl(e==null?void 0:e.keyId)}function Jf(n){return js(this,arguments,function*(e,r={}){const i=new Le.X509Certificate(e);let o=r.certificateChain&&r.certificateChain.length>0?of(i,r.certificateChain):null;return!o&&r.fetchOptions&&(o=yield Ja(i,r.fetchOptions.timeout,r.fetchOptions.proxyUrl)),{issuerSubjectDn:qs(i.issuer),authorityKeyIdentifierHex:zf(i),issuerCertificate:o?{subjectDn:qs(o.subject),spkiSha256Hex:yield pl(o.publicKey.rawData)}:null}})}function Kf(n){return js(this,null,function*(){const e=new Le.X509Certificate(n);return{subjectDn:qs(e.subject),subjectKeyIdentifierHex:Yf(e),spkiSha256Hex:yield pl(e.publicKey.rawData)}})}var Qf=Object.defineProperty,hl=Object.getOwnPropertySymbols,Zf=Object.prototype.hasOwnProperty,ep=Object.prototype.propertyIsEnumerable,dl=(n,e,r)=>e in n?Qf(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,Ln=(n,e)=>{for(var r in e||(e={}))Zf.call(e,r)&&dl(n,r,e[r]);if(hl)for(var r of hl(e))ep.call(e,r)&&dl(n,r,e[r]);return n},Or=(n,e,r)=>new Promise((i,o)=>{var s=h=>{try{c(r.next(h))}catch(y){o(y)}},l=h=>{try{c(r.throw(h))}catch(y){o(y)}},c=h=>h.done?i(h.value):Promise.resolve(h.value).then(s,l);c((r=r.apply(n,e)).next())});function _e(n,e,r,i,o){return Ln(Ln({check:n,label:e,status:r},i?{detail:i}:{}),o?{country:o}:{})}function gl(n){const e=Object.entries(n.details).filter(([r,i])=>!i.matches).map(([r])=>r).join(", ");return e?`Checksum validation failed for files: ${e}`:"Checksum validation failed"}function ml(n,e,r,i,o,s){return i?_e(n,e,"indeterminate",i):r?r.confidence==="dn_only"&&!s?_e(n,e,"indeterminate",r.detail||o,r.country):r.trustedAtTime===!0?_e(n,e,"pass",r.detail,r.country):r.trustedAtTime===!1||!r.found?_e(n,e,"fail",r.detail,r.country):_e(n,e,"indeterminate",r.detail||o,r.country):_e(n,e,"indeterminate",o)}function tp({options:n,signatureInfo:e,certificateValidityAtSigningTime:r,certificateResult:i,checksumResult:o,signatureResult:s,timestampResult:l,overallStatus:c,trustListMatch:h,trustListError:y,timestampTrustListMatch:b,timestampTrustListError:E}){var x;const T=[];return n.verifyChecksums===!1?T.push(_e("document_integrity","Document integrity","skipped","Checksum verification not enabled")):T.push(_e("document_integrity","Document integrity",o.isValid?"pass":"fail",o.isValid?void 0:gl(o))),n.verifySignatures===!1?T.push(_e("signature_valid","Signature cryptographically valid","skipped","Signature verification not enabled")):s.unsupportedPlatform?T.push(_e("signature_valid","Signature cryptographically valid","indeterminate",s.reason||"Signature verification is not supported on this platform")):T.push(_e("signature_valid","Signature cryptographically valid",s.isValid?"pass":"fail",s.isValid?void 0:s.reason)),r.isValid?T.push(_e("certificate_valid_at_signing_time","Certificate valid at trusted signing time","pass")):T.push(_e("certificate_valid_at_signing_time","Certificate valid at trusted signing time",c==="INDETERMINATE"?"indeterminate":"fail",r.reason||i.reason)),e.signatureTimestamp?T.push(_e("timestamp_present","Signature timestamp present","pass")):T.push(_e("timestamp_present","Signature timestamp present","skipped","Signature timestamp not present")),e.signatureTimestamp?n.verifyTimestamps===!1?T.push(_e("timestamp_valid","Timestamp valid and bound to signature","skipped","Timestamp verification not enabled")):l?l.coversSignature===!1?T.push(_e("timestamp_valid","Timestamp valid and bound to signature","fail",l.reason||"Timestamp token does not cover the signature value")):l.isValid?l.coversSignature===!0?T.push(_e("timestamp_valid","Timestamp valid and bound to signature","pass")):T.push(_e("timestamp_valid","Timestamp valid and bound to signature","indeterminate",l.reason||"Timestamp token verified, but signature binding could not be confirmed")):T.push(_e("timestamp_valid","Timestamp valid and bound to signature","fail",l.reason||"Timestamp verification failed")):T.push(_e("timestamp_valid","Timestamp valid and bound to signature","indeterminate","Timestamp verification did not return a result")):T.push(_e("timestamp_valid","Timestamp valid and bound to signature","skipped","Signature timestamp not present")),e.signatureTimestamp?n.verifyTimestamps===!1?T.push(_e("timestamp_authority_trusted_at_signing_time","Timestamp authority trusted at signing time","skipped","Timestamp verification not enabled")):n.trustListProvider?(x=l==null?void 0:l.info)!=null&&x.tsaCertificate?T.push(ml("timestamp_authority_trusted_at_signing_time","Timestamp authority trusted at signing time",b,E,"Timestamp authority trust check did not return a result",n.allowWeakDnOnlyTrustMatch===!0)):T.push(_e("timestamp_authority_trusted_at_signing_time","Timestamp authority trusted at signing time","indeterminate",(l==null?void 0:l.reason)||"Timestamp verification did not produce a TSA certificate")):T.push(_e("timestamp_authority_trusted_at_signing_time","Timestamp authority trusted at signing time","skipped","Trusted-list provider not configured")):T.push(_e("timestamp_authority_trusted_at_signing_time","Timestamp authority trusted at signing time","skipped","Signature timestamp not present")),n.checkRevocation===!1?T.push(_e("certificate_not_revoked_at_signing_time","Certificate not revoked at signing time","skipped","Revocation check not enabled")):i.revocation?i.revocation.status==="good"||i.revocation.isValid?T.push(_e("certificate_not_revoked_at_signing_time","Certificate not revoked at signing time","pass",i.revocation.reason)):i.revocation.status==="unknown"||i.revocation.status==="error"?T.push(_e("certificate_not_revoked_at_signing_time","Certificate not revoked at signing time","indeterminate",i.revocation.reason)):T.push(_e("certificate_not_revoked_at_signing_time","Certificate not revoked at signing time","fail",i.revocation.reason)):T.push(_e("certificate_not_revoked_at_signing_time","Certificate not revoked at signing time","skipped","Revocation check was not performed")),n.trustListProvider?T.push(ml("issuer_trusted_at_signing_time","Issuer trusted at signing time",h,y,"Issuer trust check did not return a result",n.allowWeakDnOnlyTrustMatch===!0)):T.push(_e("issuer_trusted_at_signing_time","Issuer trusted at signing time","skipped","Trusted-list provider not configured")),T}function Mn(){return typeof window!="undefined"&&typeof window.crypto!="undefined"&&typeof window.crypto.subtle!="undefined"}function rp(){if(typeof navigator=="undefined")return!1;const n=navigator.userAgent,e=/AppleWebKit/.test(n),r=/Chrome/.test(n)||/Chromium/.test(n)||/Edg/.test(n);return e&&!r}function np(n){const e=new Uint8Array(n),r=[6,9,42,134,72,134,247,13,1,1,1];let i=-1;for(let c=0;c<=e.length-r.length;c++){let h=!0;for(let y=0;y<r.length;y++)if(e[c+y]!==r[y]){h=!1;break}if(h){i=c;break}}if(i===-1)return 0;let o=-1;for(let c=i+r.length;c<e.length;c++)if(e[c]===3){o=c;break}if(o===-1)return 0;let s=o+1;if((e[s]&128)===0?s+=1:s+=1+(e[s]&127),s+=1,e[s]!==48||(s+=1,(e[s]&128)===0?s+=1:s+=1+(e[s]&127),e[s]!==2))return 0;s+=1;let l=0;if((e[s]&128)===0)l=e[s];else{const c=e[s]&127;for(let h=0;h<c;h++)l=l<<8|e[s+1+h]}return l*8}function ip(n){return!Mn()||!rp()?!0:n<=4096}function yl(n,e){return Or(this,null,function*(){const r=e.replace(/-/g,"").toLowerCase();let i;if(r.includes("sha256"))i="sha256";else if(r.includes("sha1"))i="sha1";else if(r.includes("sha384"))i="sha384";else if(r.includes("sha512"))i="sha512";else throw new Error(`Unsupported digest algorithm: ${e}`);return Mn()?op(n,i):sp(n,i)})}function op(n,e){return Or(this,null,function*(){const r={sha1:"SHA-1",sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"}[e];if(!r)throw new Error(`Unsupported browser digest algorithm: ${e}`);const i=yield window.crypto.subtle.digest(r,new Uint8Array(n)),o=Array.from(new Uint8Array(i));return btoa(String.fromCharCode.apply(null,o))})}function sp(n,e){return new Promise((r,i)=>{try{const o=require("crypto").createHash(e);o.update(Buffer.from(n)),r(o.digest("base64"))}catch(o){i(new Error(`Node digest computation failed: ${o instanceof Error?o.message:String(o)}`))}})}function up(n){const e=n.toLowerCase();return e.includes("sha512")?"SHA-512":e.includes("sha384")?"SHA-384":e.includes("sha256")?"SHA-256":e.includes("sha1")?"SHA-1":"SHA-256"}function vl(n,e){return Or(this,null,function*(){const r={};let i=!0,o="SHA-256";n.algorithm&&(n.algorithm.includes("sha1")?o="SHA-1":n.algorithm.includes("sha384")?o="SHA-384":n.algorithm.includes("sha512")&&(o="SHA-512"));const s=Object.entries(n.signedChecksums).map(l=>Or(null,[l],function*([c,h]){var y;const b=(y=n.digestAlgorithms)!=null&&y[c]?up(n.digestAlgorithms[c]):o,E=e.get(c);if(E){const x=yield yl(E,b),T=h===x;r[c]={expected:h,actual:x,matches:T,fileFound:!0},T||(i=!1)}else{const x=c.includes("/")?c.split("/").pop():c;let T=!1;if(x){for(const[R,P]of e.entries())if(R.endsWith(x)){const _=yield yl(P,b),k=h===_;r[c]={expected:h,actual:_,matches:k,fileFound:!0},k||(i=!1),T=!0;break}}T||(r[c]={expected:h,actual:"",matches:!1,fileFound:!1},i=!1)}}));return yield Promise.all(s),{isValid:i,details:r}})}function ap(n){return Or(this,arguments,function*(e,r=new Date){try{const i=new Le.X509Certificate(e),o=Ll(i,r),s=yield hu(e);return{isValid:o.isValid,reason:o.reason,info:s}}catch(i){return{isValid:!1,reason:`Certificate parsing error: ${i instanceof Error?i.message:String(i)}`}}})}function lp(n){switch(n){case"P-256":return 32;case"P-384":return 48;case"P-521":return 66;default:return 32}}function cp(n,e){const r=lp(e),i=r*2;if(n.length===i)return n;if(n[0]===48)return fp(n,r);if(n.length>i){const o=n.length/2;if(Number.isInteger(o)){const s=n.slice(0,o),l=n.slice(o),c=Yi(s,r),h=Yi(l,r),y=new Uint8Array(i);return y.set(c,0),y.set(h,r),y}}return n}function Yi(n,e){let r=0;for(;r<n.length-1&&n[r]===0;)r++;const i=n.slice(r);if(i.length===e)return i;if(i.length<e){const o=new Uint8Array(e);return o.set(i,e-i.length),o}else return i.slice(i.length-e)}function fp(n,e){let r=0;if(n[r++]!==48)throw new Error("Invalid DER signature: missing SEQUENCE tag");const i=n[r++];if(i&128&&(r+=i&127),n[r++]!==2)throw new Error("Invalid DER signature: missing INTEGER tag for R");const o=n[r++],s=n.slice(r,r+o);if(r+=o,n[r++]!==2)throw new Error("Invalid DER signature: missing INTEGER tag for S");const l=n[r++],c=n.slice(r,r+l),h=new Uint8Array(e*2);return h.set(Yi(s,e),0),h.set(Yi(c,e),e),h}function El(){return Mn()?window.crypto.subtle:crypto.subtle}function pp(n,e,r,i,o){return Or(this,null,function*(){try{const s=lu().parseFromString(n,"application/xml"),l=ot(s,"ds:SignedInfo");if(!l)return{isValid:!1,reason:"SignedInfo element not found in provided XML"};const c=o||Mr.default,h=ze.canonicalize(l,c),y=e.replace(/\s+/g,"");let b;try{b=Zc(y)}catch(T){return{isValid:!1,reason:`Failed to decode signature value: ${T instanceof Error?T.message:String(T)}`}}i.name==="ECDSA"&&(b=cp(b,i.namedCurve));let E;try{const T=El(),R=i.name==="RSASSA-PKCS1-v1_5"||i.name==="RSA-PSS";if(R){const P=np(r);if(P>0&&!ip(P))return{isValid:!1,unsupportedPlatform:!0,reason:`RSA key size (${P} bits) not supported in this browser`,errorDetails:{category:"RSA_KEY_SIZE_UNSUPPORTED",originalMessage:"Safari/WebKit only supports RSA keys up to 4096 bits",algorithm:Ln({},i),environment:"browser",keyLength:r.byteLength}}}if(Mn()&&R)try{E=yield T.importKey("spki",r,i,!1,["verify"])}catch(P){const _=Yl(r);E=yield T.importKey("spki",_,i,!1,["verify"])}else E=yield T.importKey("spki",r,i,!1,["verify"])}catch(T){const R=T instanceof Error?T:new Error(String(T));let P="Unknown reason",_="KEY_IMPORT_ERROR";if(R.name==="DataError"?(P="Key data format is invalid or incompatible",_="INVALID_KEY_FORMAT"):R.name==="NotSupportedError"?(P="Algorithm or parameters not supported",_="UNSUPPORTED_ALGORITHM"):R.message.includes("namedCurve")?(P="Missing or invalid namedCurve parameter",_="INVALID_CURVE"):R.message.includes("hash")&&(P="Incompatible or unsupported hash algorithm",_="INVALID_HASH"),i.name==="ECDSA"){const k=r.byteLength;P+=` (Key length: ${k})`}return{isValid:!1,reason:`Failed to import public key: ${P}`,errorDetails:{category:_,originalMessage:R.message,algorithm:Ln({},i),environment:Mn()?"browser":"node",keyLength:r.byteLength}}}const x=new TextEncoder().encode(h);try{return(yield El().verify(i,E,new Uint8Array(b),new Uint8Array(x)))?{isValid:!0}:i.name==="RSASSA-PKCS1-v1_5"&&(yield ll(r,b,x,i.hash))?{isValid:!0}:{isValid:!1,reason:"Signature verification failed"}}catch(T){return i.name==="RSASSA-PKCS1-v1_5"&&(yield ll(r,b,x,i.hash))?{isValid:!0}:{isValid:!1,reason:`Signature verification error: ${T instanceof Error?T.message:String(T)}`}}}catch(s){return{isValid:!1,reason:`SignedInfo verification error: ${s instanceof Error?s.message:String(s)}`}}})}function hp(n,e){return Or(this,arguments,function*(r,i,o={}){var s,l,c,h,y,b,E,x,T;const R=[];let P,_,k,fe,Se,Be=o.verifyTime||r.signingTime;r.signatureTimestamp&&o.verifyTimestamps!==!1&&(P=yield ul(r.signatureTimestamp,{canonicalSignatureValue:r.canonicalSignatureValue,verifyTsaCertificate:!0,revocationOptions:o.revocationOptions}),P.isValid&&P.info?Be=P.info.genTime:P.isValid||R.push(`Timestamp verification failed: ${P.reason||"Unknown reason"}`));const me=yield ap(r.certificatePEM,Be),C={isValid:me.isValid,reason:me.reason};if(!me.isValid){const I=`Certificate validation error: ${me.reason||"Unknown reason"}`;R.push(I)}if(o.checkRevocation!==!1&&me.isValid)try{const I=[...(s=r.certificateChain)!=null?s:[],...sf((c=(l=r.revocationValues)==null?void 0:l.ocsp)!=null?c:[])],M=yield us(r.certificatePEM,Ln({certificateChain:I.length>0?I:void 0},o.revocationOptions));if(me.revocation=M,M.status==="revoked"){const U=M.revokedAt,X=U&&U.getTime()>0;if(X&&Be<U)me.revocation.isValid=!0,me.revocation.reason=`Certificate was revoked on ${U.toISOString()}, but signature was made on ${Be.toISOString()} (before revocation)`;else{me.isValid=!1;const F=X?` on ${U.toISOString()}`:"";me.reason=M.reason||`Certificate has been revoked${F}`,R.push(M.reason||`Certificate revoked${F}`)}}}catch(I){me.revocation={isValid:!1,status:"error",method:"none",reason:`Revocation check failed: ${I instanceof Error?I.message:String(I)}`,checkedAt:new Date}}if(o.trustListProvider){try{const I=yield Jf(r.certificatePEM,{certificateChain:r.certificateChain,fetchOptions:o.trustedListFetchOptions});_=yield o.trustListProvider.match({purpose:"signature_issuer",subjectDn:I.issuerSubjectDn,skiHex:I.authorityKeyIdentifierHex,spkiSha256Hex:(h=I.issuerCertificate)==null?void 0:h.spkiSha256Hex,time:Be})}catch(I){k=`Trusted list check failed: ${I instanceof Error?I.message:String(I)}`,R.push(k)}if((y=P==null?void 0:P.info)!=null&&y.tsaCertificate&&P.info.genTime)try{const I=yield Kf(P.info.tsaCertificate);fe=yield o.trustListProvider.match({purpose:"timestamp_tsa",subjectDn:I.subjectDn,skiHex:I.subjectKeyIdentifierHex,spkiSha256Hex:I.spkiSha256Hex,time:P.info.genTime})}catch(I){Se=`Timestamp authority trusted-list check failed: ${I instanceof Error?I.message:String(I)}`,R.push(Se)}}const A=o.verifyChecksums!==!1?yield vl(r,i):{isValid:!0,details:{}},G=A.isValid?void 0:gl(A);G&&R.push(G);let ee={isValid:!0};if(o.verifySignatures!==!1&&r.rawXml&&r.signatureValue&&r.publicKey){const I=r.algorithm||"",M={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"};if(I.includes("ecdsa")&&r.publicKey.namedCurve&&(M.namedCurve=r.publicKey.namedCurve,M.name="ECDSA"),I.includes("ecdsa-sha256")?M.hash="SHA-256":I.includes("ecdsa-sha384")?M.hash="SHA-384":I.includes("ecdsa-sha512")?M.hash="SHA-512":I.includes("rsa-sha1")?M.hash="SHA-1":I.includes("rsa-pss")?(M.name="RSA-PSS",M.saltLength=32,I.includes("sha384")?(M.hash="SHA-384",M.saltLength=48):I.includes("sha512")?(M.hash="SHA-512",M.saltLength=64):M.hash="SHA-256"):I.includes("rsa-sha384")?M.hash="SHA-384":I.includes("rsa-sha512")&&(M.hash="SHA-512"),ee=yield pp(r.rawXml,r.signatureValue,r.publicKey.rawData,M,r.canonicalizationMethod),!ee.isValid){let U=ee.reason||"XML signature verification failed";if(ee.errorDetails){const X=ee.errorDetails;U+=` [Category: ${X.category}, Environment: ${X.environment}`,X.algorithm&&(U+=`, Algorithm: ${X.algorithm.name}`,X.algorithm.namedCurve&&(U+=`, Curve: ${X.algorithm.namedCurve}`)),X.keyLength&&(U+=`, Key length: ${X.keyLength} bytes`),U+="]"}R.push(U)}}else if(o.verifySignatures!==!1){const I=[];r.rawXml||I.push("Signature XML"),r.signatureValue||I.push("SignatureValue"),r.publicKey||I.push("Public Key"),R.push(`Cannot verify XML signature: missing ${I.join(", ")}`),ee={isValid:!1,reason:`Missing required components: ${I.join(", ")}`}}const pe=!r.signatureTimestamp||o.verifyTimestamps===!1||((b=P==null?void 0:P.isValid)!=null?b:!0);let Ae=me.isValid&&A.isValid&&ee.isValid&&pe,we="VALID",te;const De=[];Ae||(ee.unsupportedPlatform?(we="UNSUPPORTED",te=ee.reason,De.push({code:"RSA_KEY_SIZE_UNSUPPORTED",description:ee.reason||"RSA key size not supported",platform:"Safari/WebKit"})):A.isValid?!ee.isValid&&!ee.unsupportedPlatform?(we="INVALID",te=ee.reason||"Signature verification failed"):me.isValid?P&&!P.isValid?(we="INDETERMINATE",te=P.reason||"Timestamp verification failed",De.push({code:"TIMESTAMP_VERIFICATION_FAILED",description:P.reason||"Could not verify timestamp to establish proof of existence"})):((T=me.revocation)==null?void 0:T.status)==="unknown"?(we="INDETERMINATE",te="Certificate revocation status could not be determined",De.push({code:"REVOCATION_UNKNOWN",description:me.revocation.reason||"Could not check certificate revocation status"})):(we="INVALID",te=R[0]||"Verification failed"):(E=me.reason)!=null&&E.includes("expired")&&!(P!=null&&P.isValid)?(we="INDETERMINATE",te="Certificate expired and no valid timestamp proof",De.push({code:"CERT_EXPIRED_NO_POE",description:"Certificate has expired and there is no valid timestamp to prove signature was made when certificate was valid"})):((x=me.revocation)==null?void 0:x.status)==="revoked"?(we="INVALID",te="Certificate has been revoked"):(we="INDETERMINATE",te=me.reason||"Certificate validation inconclusive"):(we="INVALID",te="File integrity check failed")),we==="VALID"&&o.trustListProvider&&(_&&(!_.found||_.trustedAtTime===!1)?(we="INDETERMINATE",Ae=!1,te=_.found?"Signer issuer found in trusted list but was not trusted at signing time":"Signer issuer not found in trusted list",De.push({code:"ISSUER_NOT_TRUSTED",description:te})):!_&&k&&(we="INDETERMINATE",Ae=!1,te="Trusted list check failed",De.push({code:"TRUST_LIST_CHECK_FAILED",description:k})));const B=o.includeChecklist?tp({options:o,signatureInfo:r,certificateValidityAtSigningTime:C,certificateResult:me,checksumResult:A,signatureResult:ee,timestampResult:P,overallStatus:we,trustListMatch:_,trustListError:k,timestampTrustListMatch:fe,timestampTrustListError:Se}):void 0;return{isValid:Ae,status:we,statusMessage:te,limitations:De.length>0?De:void 0,certificate:me,checksums:A,signature:o.verifySignatures!==!1?ee:void 0,timestamp:P,checklist:B,trustListMatch:_,timestampTrustListMatch:fe,errors:R.length>0?R:void 0}})}Ce.CANONICALIZATION_METHODS=Mr,Ce.XMLCanonicalizer=ze,Ce.checkCertificateRevocation=us,Ce.formatValidityPeriod=Fl,Ce.getSignerDisplayName=Ml,Ce.getTimestampTime=Rf,Ce.parseCertificate=hu,Ce.parseEdoc=zl,Ce.parseTimestamp=Vs,Ce.verifyChecksums=vl,Ce.verifySignature=hp,Ce.verifyTimestamp=ul,Object.defineProperty(Ce,"__esModule",{value:!0})}));
85
85
  //# sourceMappingURL=index.umd.js.map