@authhero/saml 0.5.12 → 0.5.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@hono/zod-openapi");var t=e.z.object({"#text":e.z.string()}),n=e.z.object({"#text":e.z.string(),"@_xmlns:saml":e.z.string().optional()}),r=e.z.object({"samlp:AuthnRequest":e.z.object({"saml:Issuer":n,"@_xmlns:samlp":e.z.string(),"@_xmlns:saml":e.z.string().optional(),"@_ForceAuthn":e.z.string().transform(e=>e.toLowerCase()===`true`).optional(),"@_ID":e.z.string(),"@_IssueInstant":e.z.string().datetime(),"@_Destination":e.z.string().url(),"@_AssertionConsumerServiceURL":e.z.string().url().optional(),"@_ProtocolBinding":e.z.string().optional(),"@_Version":e.z.string()})}),i=e.z.array(e.z.object({":@":e.z.object({"@_xmlns":e.z.string(),"@_entityID":e.z.string()}),EntityDescriptor:e.z.array(e.z.object({":@":e.z.object({"@_protocolSupportEnumeration":e.z.string()}),IDPSSODescriptor:e.z.array(e.z.union([e.z.object({KeyDescriptor:e.z.array(e.z.object({KeyInfo:e.z.array(e.z.object({X509Data:e.z.array(e.z.object({X509Certificate:e.z.array(t)}))})),":@":e.z.object({"@_xmlns":e.z.string()})})),":@":e.z.object({"@_use":e.z.string()})}),e.z.object({SingleLogoutService:e.z.array(e.z.object({})),":@":e.z.object({"@_Binding":e.z.string(),"@_Location":e.z.string()})}),e.z.object({NameIDFormat:e.z.array(t)}),e.z.object({SingleSignOnService:e.z.array(e.z.object({})),":@":e.z.object({"@_Binding":e.z.string(),"@_Location":e.z.string()})}),e.z.object({Attribute:e.z.array(e.z.object({})),":@":e.z.object({"@_Name":e.z.string(),"@_NameFormat":e.z.string(),"@_FriendlyName":e.z.string(),"@_xmlns":e.z.string()})})]))}))})),a=e.z.object({"saml:Attribute":e.z.array(e.z.object({"saml:AttributeValue":e.z.array(e.z.object({"#text":e.z.string()})),":@":e.z.object({"@_xmlns:xs":e.z.string().optional(),"@_xmlns:xsi":e.z.string(),"@_xsi:type":e.z.string()}).optional()})),":@":e.z.object({"@_Name":e.z.string(),"@_NameFormat":e.z.string(),"@_FriendlyName":e.z.string().optional()})}),o=e.z.object({"ds:Transform":e.z.array(e.z.any()),":@":e.z.object({"@_Algorithm":e.z.string()})}),s=e.z.object({"ds:Signature":e.z.array(e.z.union([e.z.object({"ds:SignedInfo":e.z.array(e.z.union([e.z.object({"ds:CanonicalizationMethod":e.z.array(e.z.object({":@":e.z.object({"@_Algorithm":e.z.string()})}))}),e.z.object({"ds:SignatureMethod":e.z.array(e.z.object({":@":e.z.object({"@_Algorithm":e.z.string()})}))}),e.z.object({"ds:Reference":e.z.array(e.z.union([e.z.object({"ds:Transforms":e.z.array(o)}),e.z.object({"ds:DigestMethod":e.z.array(e.z.object({":@":e.z.object({"@_Algorithm":e.z.string()})}))}),e.z.object({"ds:DigestValue":e.z.array(t)})])),":@":e.z.object({"@_URI":e.z.string().optional()}).optional()})]))}),e.z.object({"ds:SignatureValue":e.z.array(t)}),e.z.object({"ds:KeyInfo":e.z.array(e.z.union([e.z.object({"ds:KeyValue":e.z.array(e.z.object({"ds:RSAKeyValue":e.z.array(e.z.union([e.z.object({"ds:Modulus":e.z.array(t)}),e.z.object({"ds:Exponent":e.z.array(t)})]))}))}),e.z.object({"ds:X509Data":e.z.array(e.z.object({"ds:X509Certificate":e.z.array(t)}))}),e.z.object({"ds:KeyValue":e.z.array(e.z.object({"ds:RSAKeyValue":e.z.array(e.z.union([e.z.object({"ds:Modulus":e.z.array(t)}),e.z.object({"ds:Exponent":e.z.array(t)})]))})),"ds:X509Data":e.z.array(e.z.object({"ds:X509Certificate":e.z.array(t)}))})]))})])),":@":e.z.object({"@_xmlns:ds":e.z.string().optional()}).optional()}),c=e.z.array(e.z.object({"samlp:Response":e.z.array(e.z.union([e.z.object({"saml:Issuer":e.z.array(t)}),s,e.z.object({"samlp:Status":e.z.array(e.z.object({"samlp:StatusCode":e.z.array(t),":@":e.z.object({"@_Value":e.z.string()})}))}),e.z.object({"saml:Assertion":e.z.array(e.z.union([e.z.object({"saml:Issuer":e.z.array(t)}),s,e.z.object({"saml:Subject":e.z.array(e.z.union([e.z.object({"saml:NameID":e.z.array(t),":@":e.z.object({"@_Format":e.z.string()})}),e.z.object({"saml:SubjectConfirmation":e.z.array(e.z.object({"saml:SubjectConfirmationData":e.z.array(e.z.any()),":@":e.z.object({"@_InResponseTo":e.z.string(),"@_NotOnOrAfter":e.z.string(),"@_Recipient":e.z.string()})})),":@":e.z.object({"@_Method":e.z.string()})})]))}),e.z.object({"saml:Conditions":e.z.array(e.z.object({"saml:AudienceRestriction":e.z.array(e.z.object({"saml:Audience":e.z.array(t)}))})),":@":e.z.object({"@_NotBefore":e.z.string(),"@_NotOnOrAfter":e.z.string()})}),e.z.object({"saml:AuthnStatement":e.z.array(e.z.object({"saml:AuthnContext":e.z.array(e.z.object({"saml:AuthnContextClassRef":e.z.array(t)}))})),":@":e.z.object({"@_AuthnInstant":e.z.string(),"@_SessionIndex":e.z.string(),"@_SessionNotOnOrAfter":e.z.string()})}),e.z.object({"saml:AttributeStatement":e.z.array(a)})])),":@":e.z.object({"@_xmlns":e.z.string(),"@_ID":e.z.string(),"@_IssueInstant":e.z.string(),"@_Version":e.z.string()})})])),":@":e.z.object({"@_xmlns:samlp":e.z.string(),"@_xmlns:saml":e.z.string(),"@_Destination":e.z.string(),"@_ID":e.z.string(),"@_InResponseTo":e.z.string(),"@_IssueInstant":e.z.string(),"@_Version":e.z.string()})})),l=RegExp(`^[:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`);function u(e,t){let n=[],r=t.exec(e);for(;r;){let i=[];i.startIndex=t.lastIndex-r[0].length;let a=r.length;for(let e=0;e<a;e++)i.push(r[e]);n.push(i),r=t.exec(e)}return n}var d=function(e){return l.exec(e)!=null};function f(e){return e!==void 0}var p=[`hasOwnProperty`,`toString`,`valueOf`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`],m=[`__proto__`,`constructor`,`prototype`],h={allowBooleanAttributes:!1,unpairedTags:[]};function g(e,t){t=Object.assign({},h,t);let n=[],r=!1,i=!1;e[0]===``&&(e=e.substr(1));for(let a=0;a<e.length;a++)if(e[a]===`<`&&e[a+1]===`?`){if(a+=2,a=ee(e,a),a.err)return a}else if(e[a]===`<`){let o=a;if(a++,e[a]===`!`){a=te(e,a);continue}else{let s=!1;e[a]===`/`&&(s=!0,a++);let c=``;for(;a<e.length&&e[a]!==`>`&&e[a]!==` `&&e[a]!==` `&&e[a]!==`
2
2
  `&&e[a]!==`\r`;a++)c+=e[a];if(c=c.trim(),c[c.length-1]===`/`&&(c=c.substring(0,c.length-1),a--),!ue(c)){let t;return t=c.trim().length===0?`Invalid space after '<'.`:`Tag '`+c+`' is an invalid name.`,v(`InvalidTag`,t,y(e,a))}let l=ie(e,a);if(l===!1)return v(`InvalidAttr`,`Attributes for '`+c+`' have open quote.`,y(e,a));let u=l.value;if(a=l.index,u[u.length-1]===`/`){let n=a-u.length;u=u.substring(0,u.length-1);let i=oe(u,t);if(i===!0)r=!0;else return v(i.err.code,i.err.msg,y(e,n+i.err.line))}else if(s){if(!l.tagClosed)return v(`InvalidTag`,`Closing tag '`+c+`' doesn't have proper closing.`,y(e,a));if(u.trim().length>0)return v(`InvalidTag`,`Closing tag '`+c+`' can't have attributes or invalid starting.`,y(e,o));if(n.length===0)return v(`InvalidTag`,`Closing tag '`+c+`' has not been opened.`,y(e,o));{let t=n.pop();if(c!==t.tagName){let n=y(e,t.tagStartPos);return v(`InvalidTag`,`Expected closing tag '`+t.tagName+`' (opened in line `+n.line+`, col `+n.col+`) instead of closing tag '`+c+`'.`,y(e,o))}n.length==0&&(i=!0)}}else{let s=oe(u,t);if(s!==!0)return v(s.err.code,s.err.msg,y(e,a-u.length+s.err.line));if(i===!0)return v(`InvalidXml`,`Multiple possible root nodes found.`,y(e,a));t.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:o}),r=!0}for(a++;a<e.length;a++)if(e[a]===`<`)if(e[a+1]===`!`){a++,a=te(e,a);continue}else if(e[a+1]===`?`){if(a=ee(e,++a),a.err)return a}else break;else if(e[a]===`&`){let t=ce(e,a);if(t==-1)return v(`InvalidChar`,`char '&' is not expected.`,y(e,a));a=t}else if(i===!0&&!_(e[a]))return v(`InvalidXml`,`Extra text at the end`,y(e,a));e[a]===`<`&&a--}}else{if(_(e[a]))continue;return v(`InvalidChar`,`char '`+e[a]+`' is not expected.`,y(e,a))}return r?n.length==1?v(`InvalidTag`,`Unclosed tag '`+n[0].tagName+`'.`,y(e,n[0].tagStartPos)):n.length>0?v(`InvalidXml`,`Invalid '`+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,``)+`' found.`,{line:1,col:1}):!0:v(`InvalidXml`,`Start tag expected.`,1)}function _(e){return e===` `||e===` `||e===`
3
- `||e===`\r`}function ee(e,t){let n=t;for(;t<e.length;t++)if(e[t]==`?`||e[t]==` `){let r=e.substr(n,t-n);if(t>5&&r===`xml`)return v(`InvalidXml`,`XML declaration allowed only at the start of the document.`,y(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}else continue}return t}function te(e,t){if(e.length>t+5&&e[t+1]===`-`&&e[t+2]===`-`){for(t+=3;t<e.length;t++)if(e[t]===`-`&&e[t+1]===`-`&&e[t+2]===`>`){t+=2;break}}else if(e.length>t+8&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t<e.length;t++)if(e[t]===`<`)n++;else if(e[t]===`>`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t<e.length;t++)if(e[t]===`]`&&e[t+1]===`]`&&e[t+2]===`>`){t+=2;break}}return t}var ne=`"`,re=`'`;function ie(e,t){let n=``,r=``,i=!1;for(;t<e.length;t++){if(e[t]===ne||e[t]===re)r===``?r=e[t]:r!==e[t]||(r=``);else if(e[t]===`>`&&r===``){i=!0;break}n+=e[t]}return r===``?{value:n,index:t,tagClosed:i}:!1}var ae=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function oe(e,t){let n=u(e,ae),r={};for(let e=0;e<n.length;e++){if(n[e][1].length===0)return v(`InvalidAttr`,`Attribute '`+n[e][2]+`' has no space in starting.`,b(n[e]));if(n[e][3]!==void 0&&n[e][4]===void 0)return v(`InvalidAttr`,`Attribute '`+n[e][2]+`' is without value.`,b(n[e]));if(n[e][3]===void 0&&!t.allowBooleanAttributes)return v(`InvalidAttr`,`boolean attribute '`+n[e][2]+`' is not allowed.`,b(n[e]));let i=n[e][2];if(!le(i))return v(`InvalidAttr`,`Attribute '`+i+`' is an invalid name.`,b(n[e]));if(!Object.prototype.hasOwnProperty.call(r,i))r[i]=1;else return v(`InvalidAttr`,`Attribute '`+i+`' is repeated.`,b(n[e]))}return!0}function se(e,t){let n=/\d/;for(e[t]===`x`&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(e[t]===`;`)return t;if(!e[t].match(n))break}return-1}function ce(e,t){if(t++,e[t]===`;`)return-1;if(e[t]===`#`)return t++,se(e,t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===`;`)break;return-1}return t}function v(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function le(e){return d(e)}function ue(e){return d(e)}function y(e,t){let n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function b(e){return e.startIndex+e[1].length}var de={amp:`&`,AMP:`&`,lt:`<`,LT:`<`,gt:`>`,GT:`>`,quot:`"`,QUOT:`"`,apos:`'`,lsquo:`‘`,rsquo:`’`,ldquo:`“`,rdquo:`”`,lsquor:`‚`,rsquor:`’`,ldquor:`„`,bdquo:`„`,comma:`,`,period:`.`,colon:`:`,semi:`;`,excl:`!`,quest:`?`,num:`#`,dollar:`$`,percent:`%`,ast:`*`,commat:`@`,lowbar:`_`,verbar:`|`,vert:`|`,sol:`/`,bsol:`\\`,lbrace:`{`,rbrace:`}`,lbrack:`[`,rbrack:`]`,lpar:`(`,rpar:`)`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,COPY:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,REG:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,half:`½`,frac34:`¾`,iquest:`¿`,times:`×`,div:`÷`,divide:`÷`},fe={Agrave:`À`,agrave:`à`,Aacute:`Á`,aacute:`á`,Acirc:`Â`,acirc:`â`,Atilde:`Ã`,atilde:`ã`,Auml:`Ä`,auml:`ä`,Aring:`Å`,aring:`å`,AElig:`Æ`,aelig:`æ`,Ccedil:`Ç`,ccedil:`ç`,Egrave:`È`,egrave:`è`,Eacute:`É`,eacute:`é`,Ecirc:`Ê`,ecirc:`ê`,Euml:`Ë`,euml:`ë`,Igrave:`Ì`,igrave:`ì`,Iacute:`Í`,iacute:`í`,Icirc:`Î`,icirc:`î`,Iuml:`Ï`,iuml:`ï`,ETH:`Ð`,eth:`ð`,Ntilde:`Ñ`,ntilde:`ñ`,Ograve:`Ò`,ograve:`ò`,Oacute:`Ó`,oacute:`ó`,Ocirc:`Ô`,ocirc:`ô`,Otilde:`Õ`,otilde:`õ`,Ouml:`Ö`,ouml:`ö`,Oslash:`Ø`,oslash:`ø`,Ugrave:`Ù`,ugrave:`ù`,Uacute:`Ú`,uacute:`ú`,Ucirc:`Û`,ucirc:`û`,Uuml:`Ü`,uuml:`ü`,Yacute:`Ý`,yacute:`ý`,THORN:`Þ`,thorn:`þ`,szlig:`ß`,yuml:`ÿ`,Yuml:`Ÿ`},pe={Amacr:`Ā`,amacr:`ā`,Abreve:`Ă`,abreve:`ă`,Aogon:`Ą`,aogon:`ą`,Cacute:`Ć`,cacute:`ć`,Ccirc:`Ĉ`,ccirc:`ĉ`,Cdot:`Ċ`,cdot:`ċ`,Ccaron:`Č`,ccaron:`č`,Dcaron:`Ď`,dcaron:`ď`,Dstrok:`Đ`,dstrok:`đ`,Emacr:`Ē`,emacr:`ē`,Ecaron:`Ě`,ecaron:`ě`,Edot:`Ė`,edot:`ė`,Eogon:`Ę`,eogon:`ę`,Gcirc:`Ĝ`,gcirc:`ĝ`,Gbreve:`Ğ`,gbreve:`ğ`,Gdot:`Ġ`,gdot:`ġ`,Gcedil:`Ģ`,Hcirc:`Ĥ`,hcirc:`ĥ`,Hstrok:`Ħ`,hstrok:`ħ`,Itilde:`Ĩ`,itilde:`ĩ`,Imacr:`Ī`,imacr:`ī`,Iogon:`Į`,iogon:`į`,Idot:`İ`,IJlig:`IJ`,ijlig:`ij`,Jcirc:`Ĵ`,jcirc:`ĵ`,Kcedil:`Ķ`,kcedil:`ķ`,kgreen:`ĸ`,Lacute:`Ĺ`,lacute:`ĺ`,Lcedil:`Ļ`,lcedil:`ļ`,Lcaron:`Ľ`,lcaron:`ľ`,Lmidot:`Ŀ`,lmidot:`ŀ`,Lstrok:`Ł`,lstrok:`ł`,Nacute:`Ń`,nacute:`ń`,Ncaron:`Ň`,ncaron:`ň`,Ncedil:`Ņ`,ncedil:`ņ`,ENG:`Ŋ`,eng:`ŋ`,Omacr:`Ō`,omacr:`ō`,Odblac:`Ő`,odblac:`ő`,OElig:`Œ`,oelig:`œ`,Racute:`Ŕ`,racute:`ŕ`,Rcaron:`Ř`,rcaron:`ř`,Rcedil:`Ŗ`,rcedil:`ŗ`,Sacute:`Ś`,sacute:`ś`,Scirc:`Ŝ`,scirc:`ŝ`,Scedil:`Ş`,scedil:`ş`,Scaron:`Š`,scaron:`š`,Tcedil:`Ţ`,tcedil:`ţ`,Tcaron:`Ť`,tcaron:`ť`,Tstrok:`Ŧ`,tstrok:`ŧ`,Utilde:`Ũ`,utilde:`ũ`,Umacr:`Ū`,umacr:`ū`,Ubreve:`Ŭ`,ubreve:`ŭ`,Uring:`Ů`,uring:`ů`,Udblac:`Ű`,udblac:`ű`,Uogon:`Ų`,uogon:`ų`,Wcirc:`Ŵ`,wcirc:`ŵ`,Ycirc:`Ŷ`,ycirc:`ŷ`,Zacute:`Ź`,zacute:`ź`,Zdot:`Ż`,zdot:`ż`,Zcaron:`Ž`,zcaron:`ž`},me={Alpha:`Α`,alpha:`α`,Beta:`Β`,beta:`β`,Gamma:`Γ`,gamma:`γ`,Delta:`Δ`,delta:`δ`,Epsilon:`Ε`,epsilon:`ε`,epsiv:`ϵ`,varepsilon:`ϵ`,Zeta:`Ζ`,zeta:`ζ`,Eta:`Η`,eta:`η`,Theta:`Θ`,theta:`θ`,thetasym:`ϑ`,vartheta:`ϑ`,Iota:`Ι`,iota:`ι`,Kappa:`Κ`,kappa:`κ`,kappav:`ϰ`,varkappa:`ϰ`,Lambda:`Λ`,lambda:`λ`,Mu:`Μ`,mu:`μ`,Nu:`Ν`,nu:`ν`,Xi:`Ξ`,xi:`ξ`,Omicron:`Ο`,omicron:`ο`,Pi:`Π`,pi:`π`,piv:`ϖ`,varpi:`ϖ`,Rho:`Ρ`,rho:`ρ`,rhov:`ϱ`,varrho:`ϱ`,Sigma:`Σ`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,varsigma:`ς`,Tau:`Τ`,tau:`τ`,Upsilon:`Υ`,upsilon:`υ`,upsi:`υ`,Upsi:`ϒ`,upsih:`ϒ`,Phi:`Φ`,phi:`φ`,phiv:`ϕ`,varphi:`ϕ`,Chi:`Χ`,chi:`χ`,Psi:`Ψ`,psi:`ψ`,Omega:`Ω`,omega:`ω`,ohm:`Ω`,Gammad:`Ϝ`,gammad:`ϝ`,digamma:`ϝ`},he={Afr:`𝔄`,afr:`𝔞`,Acy:`А`,acy:`а`,Bcy:`Б`,bcy:`б`,Vcy:`В`,vcy:`в`,Gcy:`Г`,gcy:`г`,Dcy:`Д`,dcy:`д`,IEcy:`Е`,iecy:`е`,IOcy:`Ё`,iocy:`ё`,ZHcy:`Ж`,zhcy:`ж`,Zcy:`З`,zcy:`з`,Icy:`И`,icy:`и`,Jcy:`Й`,jcy:`й`,Kcy:`К`,kcy:`к`,Lcy:`Л`,lcy:`л`,Mcy:`М`,mcy:`м`,Ncy:`Н`,ncy:`н`,Ocy:`О`,ocy:`о`,Pcy:`П`,pcy:`п`,Rcy:`Р`,rcy:`р`,Scy:`С`,scy:`с`,Tcy:`Т`,tcy:`т`,Ucy:`У`,ucy:`у`,Fcy:`Ф`,fcy:`ф`,KHcy:`Х`,khcy:`х`,TScy:`Ц`,tscy:`ц`,CHcy:`Ч`,chcy:`ч`,SHcy:`Ш`,shcy:`ш`,SHCHcy:`Щ`,shchcy:`щ`,HARDcy:`Ъ`,hardcy:`ъ`,Ycy:`Ы`,ycy:`ы`,SOFTcy:`Ь`,softcy:`ь`,Ecy:`Э`,ecy:`э`,YUcy:`Ю`,yucy:`ю`,YAcy:`Я`,yacy:`я`,DJcy:`Ђ`,djcy:`ђ`,GJcy:`Ѓ`,gjcy:`ѓ`,Jukcy:`Є`,jukcy:`є`,DScy:`Ѕ`,dscy:`ѕ`,Iukcy:`І`,iukcy:`і`,YIcy:`Ї`,yicy:`ї`,Jsercy:`Ј`,jsercy:`ј`,LJcy:`Љ`,ljcy:`љ`,NJcy:`Њ`,njcy:`њ`,TSHcy:`Ћ`,tshcy:`ћ`,KJcy:`Ќ`,kjcy:`ќ`,Ubrcy:`Ў`,ubrcy:`ў`,DZcy:`Џ`,dzcy:`џ`},ge={plus:`+`,pm:`±`,times:`×`,div:`÷`,divide:`÷`,sdot:`⋅`,star:`☆`,starf:`★`,bigstar:`★`,lowast:`∗`,ast:`*`,midast:`*`,compfn:`∘`,smallcircle:`∘`,bullet:`•`,bull:`•`,nbsp:`\xA0`,hellip:`…`,mldr:`…`,prime:`′`,Prime:`″`,tprime:`‴`,bprime:`‵`,backprime:`‵`,minus:`−`,minusd:`∸`,dotminus:`∸`,plusdo:`∔`,dotplus:`∔`,plusmn:`±`,minusplus:`∓`,mnplus:`∓`,mp:`∓`,setminus:`∖`,smallsetminus:`∖`,Backslash:`∖`,setmn:`∖`,ssetmn:`∖`,lowbar:`_`,verbar:`|`,vert:`|`,VerticalLine:`|`,colon:`:`,Colon:`∷`,Proportion:`∷`,ratio:`∶`,equals:`=`,ne:`≠`,nequiv:`≢`,equiv:`≡`,Congruent:`≡`,sim:`∼`,thicksim:`∼`,thksim:`∼`,sime:`≃`,simeq:`≃`,TildeEqual:`≃`,asymp:`≈`,approx:`≈`,thickapprox:`≈`,thkap:`≈`,TildeTilde:`≈`,ncong:`≇`,cong:`≅`,TildeFullEqual:`≅`,asympeq:`≍`,CupCap:`≍`,bump:`≎`,Bumpeq:`≎`,HumpDownHump:`≎`,bumpe:`≏`,bumpeq:`≏`,HumpEqual:`≏`,le:`≤`,LessEqual:`≤`,ge:`≥`,GreaterEqual:`≥`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,greater:`>`,less:`<`},_e={alefsym:`ℵ`,aleph:`ℵ`,beth:`ℶ`,gimel:`ℷ`,daleth:`ℸ`,forall:`∀`,ForAll:`∀`,part:`∂`,PartialD:`∂`,exist:`∃`,Exists:`∃`,nexist:`∄`,nexists:`∄`,empty:`∅`,emptyset:`∅`,emptyv:`∅`,varnothing:`∅`,nabla:`∇`,Del:`∇`,isin:`∈`,isinv:`∈`,in:`∈`,Element:`∈`,notin:`∉`,notinva:`∉`,ni:`∋`,niv:`∋`,SuchThat:`∋`,ReverseElement:`∋`,notni:`∌`,notniva:`∌`,prod:`∏`,Product:`∏`,coprod:`∐`,Coproduct:`∐`,sum:`∑`,Sum:`∑`,minus:`−`,mp:`∓`,plusdo:`∔`,dotplus:`∔`,setminus:`∖`,lowast:`∗`,radic:`√`,Sqrt:`√`,prop:`∝`,propto:`∝`,Proportional:`∝`,varpropto:`∝`,infin:`∞`,infintie:`⧝`,ang:`∠`,angle:`∠`,angmsd:`∡`,measuredangle:`∡`,angsph:`∢`,mid:`∣`,VerticalBar:`∣`,nmid:`∤`,nsmid:`∤`,npar:`∦`,parallel:`∥`,spar:`∥`,nparallel:`∦`,nspar:`∦`,and:`∧`,wedge:`∧`,or:`∨`,vee:`∨`,cap:`∩`,cup:`∪`,int:`∫`,Integral:`∫`,conint:`∮`,ContourIntegral:`∮`,Conint:`∯`,DoubleContourIntegral:`∯`,Cconint:`∰`,there4:`∴`,therefore:`∴`,Therefore:`∴`,becaus:`∵`,because:`∵`,Because:`∵`,ratio:`∶`,Proportion:`∷`,minusd:`∸`,dotminus:`∸`,mDDot:`∺`,homtht:`∻`,sim:`∼`,bsimg:`∽`,backsim:`∽`,ac:`∾`,mstpos:`∾`,acd:`∿`,VerticalTilde:`≀`,wr:`≀`,wreath:`≀`,nsime:`≄`,nsimeq:`≄`,ncong:`≇`,simne:`≆`,ncongdot:`⩭̸`,ngsim:`≵`,nsim:`≁`,napprox:`≉`,nap:`≉`,ngeq:`≱`,nge:`≱`,nleq:`≰`,nle:`≰`,ngtr:`≯`,ngt:`≯`,nless:`≮`,nlt:`≮`,nprec:`⊀`,npr:`⊀`,nsucc:`⊁`,nsc:`⊁`},ve={larr:`←`,leftarrow:`←`,LeftArrow:`←`,uarr:`↑`,uparrow:`↑`,UpArrow:`↑`,rarr:`→`,rightarrow:`→`,RightArrow:`→`,darr:`↓`,downarrow:`↓`,DownArrow:`↓`,harr:`↔`,leftrightarrow:`↔`,LeftRightArrow:`↔`,varr:`↕`,updownarrow:`↕`,UpDownArrow:`↕`,nwarr:`↖`,nwarrow:`↖`,UpperLeftArrow:`↖`,nearr:`↗`,nearrow:`↗`,UpperRightArrow:`↗`,searr:`↘`,searrow:`↘`,LowerRightArrow:`↘`,swarr:`↙`,swarrow:`↙`,LowerLeftArrow:`↙`,lArr:`⇐`,Leftarrow:`⇐`,uArr:`⇑`,Uparrow:`⇑`,rArr:`⇒`,Rightarrow:`⇒`,dArr:`⇓`,Downarrow:`⇓`,hArr:`⇔`,Leftrightarrow:`⇔`,iff:`⇔`,vArr:`⇕`,Updownarrow:`⇕`,lAarr:`⇚`,Lleftarrow:`⇚`,rAarr:`⇛`,Rrightarrow:`⇛`,lrarr:`⇆`,leftrightarrows:`⇆`,rlarr:`⇄`,rightleftarrows:`⇄`,lrhar:`⇋`,leftrightharpoons:`⇋`,ReverseEquilibrium:`⇋`,rlhar:`⇌`,rightleftharpoons:`⇌`,Equilibrium:`⇌`,udarr:`⇅`,UpArrowDownArrow:`⇅`,duarr:`⇵`,DownArrowUpArrow:`⇵`,llarr:`⇇`,leftleftarrows:`⇇`,rrarr:`⇉`,rightrightarrows:`⇉`,ddarr:`⇊`,downdownarrows:`⇊`,har:`↽`,lhard:`↽`,leftharpoondown:`↽`,lharu:`↼`,leftharpoonup:`↼`,rhard:`⇁`,rightharpoondown:`⇁`,rharu:`⇀`,rightharpoonup:`⇀`,lsh:`↰`,Lsh:`↰`,rsh:`↱`,Rsh:`↱`,ldsh:`↲`,rdsh:`↳`,hookleftarrow:`↩`,hookrightarrow:`↪`,mapstoleft:`↤`,mapstoup:`↥`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,crarr:`↵`,nleftarrow:`↚`,nleftrightarrow:`↮`,nrightarrow:`↛`,nrarr:`↛`,larrtl:`↢`,rarrtl:`↣`,leftarrowtail:`↢`,rightarrowtail:`↣`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,Larr:`↞`,Rarr:`↠`,larrhk:`↩`,rarrhk:`↪`,larrlp:`↫`,looparrowleft:`↫`,rarrlp:`↬`,looparrowright:`↬`,harrw:`↭`,leftrightsquigarrow:`↭`,nrarrw:`↝̸`,rarrw:`↝`,rightsquigarrow:`↝`,larrbfs:`⤟`,rarrbfs:`⤠`,nvHarr:`⤄`,nvlArr:`⤂`,nvrArr:`⤃`,larrfs:`⤝`,rarrfs:`⤞`,Map:`⤅`,larrsim:`⥳`,rarrsim:`⥴`,harrcir:`⥈`,Uarrocir:`⥉`,lurdshar:`⥊`,ldrdhar:`⥧`,ldrushar:`⥋`,rdldhar:`⥩`,lrhard:`⥭`,uharr:`↾`,uharl:`↿`,dharr:`⇂`,dharl:`⇃`,Uarr:`↟`,Darr:`↡`,zigrarr:`⇝`,nwArr:`⇖`,neArr:`⇗`,seArr:`⇘`,swArr:`⇙`,nharr:`↮`,nhArr:`⇎`,nlarr:`↚`,nlArr:`⇍`,nrArr:`⇏`,larrb:`⇤`,LeftArrowBar:`⇤`,rarrb:`⇥`,RightArrowBar:`⇥`},ye={square:`□`,Square:`□`,squ:`□`,squf:`▪`,squarf:`▪`,blacksquar:`▪`,blacksquare:`▪`,FilledVerySmallSquare:`▪`,blk34:`▓`,blk12:`▒`,blk14:`░`,block:`█`,srect:`▭`,rect:`▭`,sdot:`⋅`,sdotb:`⊡`,dotsquare:`⊡`,triangle:`▵`,tri:`▵`,trine:`▵`,utri:`▵`,triangledown:`▿`,dtri:`▿`,tridown:`▿`,triangleleft:`◃`,ltri:`◃`,triangleright:`▹`,rtri:`▹`,blacktriangle:`▴`,utrif:`▴`,blacktriangledown:`▾`,dtrif:`▾`,blacktriangleleft:`◂`,ltrif:`◂`,blacktriangleright:`▸`,rtrif:`▸`,loz:`◊`,lozenge:`◊`,blacklozenge:`⧫`,lozf:`⧫`,bigcirc:`◯`,xcirc:`◯`,circ:`ˆ`,Circle:`○`,cir:`○`,o:`○`,bullet:`•`,bull:`•`,hellip:`…`,mldr:`…`,nldr:`‥`,boxh:`─`,HorizontalLine:`─`,boxv:`│`,boxdr:`┌`,boxdl:`┐`,boxur:`└`,boxul:`┘`,boxvr:`├`,boxvl:`┤`,boxhd:`┬`,boxhu:`┴`,boxvh:`┼`,boxH:`═`,boxV:`║`,boxdR:`╒`,boxDr:`╓`,boxDR:`╔`,boxDl:`╕`,boxdL:`╖`,boxDL:`╗`,boxuR:`╘`,boxUr:`╙`,boxUR:`╚`,boxUl:`╜`,boxuL:`╛`,boxUL:`╝`,boxvR:`╞`,boxVr:`╟`,boxVR:`╠`,boxVl:`╢`,boxvL:`╡`,boxVL:`╣`,boxHd:`╤`,boxhD:`╥`,boxHD:`╦`,boxHu:`╧`,boxhU:`╨`,boxHU:`╩`,boxvH:`╪`,boxVh:`╫`,boxVH:`╬`},be={excl:`!`,iexcl:`¡`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,nbsp:`\xA0`,comma:`,`,period:`.`,colon:`:`,semi:`;`,vert:`|`,Verbar:`‖`,verbar:`|`,dblac:`˝`,circ:`ˆ`,caron:`ˇ`,breve:`˘`,dot:`˙`,ring:`˚`,ogon:`˛`,tilde:`˜`,DiacriticalGrave:"`",DiacriticalAcute:`´`,DiacriticalTilde:`˜`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,grave:"`"},xe={cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,euro:`€`,dollar:`$`,fnof:`ƒ`,inr:`₹`,af:`؋`,birr:`ብር`,peso:`₱`,rub:`₽`,won:`₩`,yuan:`¥`,cedil:`¸`},Se={frac12:`½`,half:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`},Ce={trade:`™`,TRADE:`™`,telrec:`⌕`,target:`⌖`,ulcorn:`⌜`,ulcorner:`⌜`,urcorn:`⌝`,urcorner:`⌝`,dlcorn:`⌞`,llcorner:`⌞`,drcorn:`⌟`,lrcorner:`⌟`,intercal:`⊺`,intcal:`⊺`,oplus:`⊕`,CirclePlus:`⊕`,ominus:`⊖`,CircleMinus:`⊖`,otimes:`⊗`,CircleTimes:`⊗`,osol:`⊘`,odot:`⊙`,CircleDot:`⊙`,oast:`⊛`,circledast:`⊛`,odash:`⊝`,circleddash:`⊝`,ocirc:`⊚`,circledcirc:`⊚`,boxplus:`⊞`,plusb:`⊞`,boxminus:`⊟`,minusb:`⊟`,boxtimes:`⊠`,timesb:`⊠`,boxdot:`⊡`,sdotb:`⊡`,veebar:`⊻`,vee:`∨`,barvee:`⊽`,and:`∧`,wedge:`∧`,Cap:`⋒`,Cup:`⋓`,Fork:`⋔`,pitchfork:`⋔`,epar:`⋕`,ltlarr:`⥶`,nvap:`≍⃒`,nvsim:`∼⃒`,nvge:`≥⃒`,nvle:`≤⃒`,nvlt:`<⃒`,nvgt:`>⃒`,nvltrie:`⊴⃒`,nvrtrie:`⊵⃒`,Vdash:`⊩`,dashv:`⊣`,vDash:`⊨`,Vvdash:`⊪`,nvdash:`⊬`,nvDash:`⊭`,nVdash:`⊮`,nVDash:`⊯`};({...de,...fe,...pe,...me,...he,...ge,..._e,...ve,...ye,...be,...xe,...Se,...Ce});var we={amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`},Te={nbsp:`\xA0`,copy:`©`,reg:`®`,trade:`™`,mdash:`—`,ndash:`–`,hellip:`…`,laquo:`«`,raquo:`»`,lsquo:`‘`,rsquo:`’`,ldquo:`“`,rdquo:`”`,bull:`•`,para:`¶`,sect:`§`,deg:`°`,frac12:`½`,frac14:`¼`,frac34:`¾`},x=Object.freeze({ALLOW:`allow`,BLOCK:`block`,THROW:`throw`}),Ee=new Set(`!?\\\\/[]$%{}^&*()<>|+`);function De(e){if(e[0]===`#`)throw Error(`[EntityReplacer] Invalid character '#' in entity name: "${e}"`);for(let t of e)if(Ee.has(t))throw Error(`[EntityReplacer] Invalid character '${t}' in entity name: "${e}"`);return e}function S(...e){let t=Object.create(null);for(let n of e)if(n)for(let e of Object.keys(n)){let r=n[e];if(typeof r==`string`)t[e]=r;else if(r&&typeof r==`object`&&r.val!==void 0){let n=r.val;typeof n==`string`&&(t[e]=n)}}return t}var C=`external`,w=`base`,Oe=`all`;function ke(e){return!e||e===C?new Set([C]):e===Oe?new Set([Oe]):e===w?new Set([w]):Array.isArray(e)?new Set(e):new Set([C])}var T=Object.freeze({allow:0,leave:1,remove:2,throw:3}),Ae=new Set([9,10,13]);function je(e){if(!e)return{xmlVersion:1,onLevel:T.allow,nullLevel:T.remove};let t=e.xmlVersion===1.1?1.1:1,n=T[e.onNCR]??T.allow,r=T[e.nullNCR]??T.remove;return{xmlVersion:t,onLevel:n,nullLevel:Math.max(r,T.remove)}}var Me=class{constructor(e={}){this._limit=e.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof e.postCheck==`function`?e.postCheck:e=>e,this._limitTiers=ke(this._limit.applyLimitsTo??C),this._numericAllowed=e.numericAllowed??!0,this._baseMap=S(we,e.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(e.remove&&Array.isArray(e.remove)?e.remove:[]),this._leaveSet=new Set(e.leave&&Array.isArray(e.leave)?e.leave:[]);let t=je(e.ncr);this._ncrXmlVersion=t.xmlVersion,this._ncrOnLevel=t.onLevel,this._ncrNullLevel=t.nullLevel,this._onExternalEntity=typeof e.onExternalEntity==`function`?e.onExternalEntity:null,this._onInputEntity=typeof e.onInputEntity==`function`?e.onInputEntity:null}_applyRegistrationHook(e,t,n,r){if(!e)return!0;let i=e(t,n);if(i===x.BLOCK)return!1;if(i===x.THROW)throw Error(`[EntityDecoder] Registration of ${r} entity "&${t};" was rejected by hook`);return!0}setExternalEntities(e){if(e)for(let t of Object.keys(e))De(t);if(!this._onExternalEntity){this._externalMap=S(e);return}let t=S(e),n=Object.create(null);for(let[e,r]of Object.entries(t))this._applyRegistrationHook(this._onExternalEntity,e,r,`external`)&&(n[e]=r);this._externalMap=n}addExternalEntity(e,t){De(e),typeof t==`string`&&t.indexOf(`&`)===-1&&this._applyRegistrationHook(this._onExternalEntity,e,t,`external`)&&(this._externalMap[e]=t)}addInputEntities(e){if(this._totalExpansions=0,this._expandedLength=0,!this._onInputEntity){this._inputMap=S(e);return}let t=S(e),n=Object.create(null);for(let[e,r]of Object.entries(t))this._applyRegistrationHook(this._onInputEntity,e,r,`input`)&&(n[e]=r);this._inputMap=n}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(e){this._ncrXmlVersion=e===1.1?1.1:1}decode(e){if(typeof e!=`string`||e.length===0||e.indexOf(`&`)===-1)return e;let t=e,n=[],r=e.length,i=0,a=0,o=this._maxTotalExpansions>0,s=this._maxExpandedLength>0,c=o||s;for(;a<r;){if(e.charCodeAt(a)!==38){a++;continue}let t=a+1;for(;t<r&&e.charCodeAt(t)!==59&&t-a<=32;)t++;if(t>=r||e.charCodeAt(t)!==59){a++;continue}let l=e.slice(a+1,t);if(l.length===0){a++;continue}let u,d;if(this._removeSet.has(l))u=``,d===void 0&&(d=C);else if(this._leaveSet.has(l)){a++;continue}else if(l.charCodeAt(0)===35){let e=this._resolveNCR(l);if(e===void 0){a++;continue}u=e,d=w}else{let e=this._resolveName(l);u=e?.value,d=e?.tier}if(u===void 0){a++;continue}if(a>i&&n.push(e.slice(i,a)),n.push(u),i=t+1,a=i,c&&this._tierCounts(d)){if(o&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(s){let e=u.length-(l.length+2);if(e>0&&(this._expandedLength+=e,this._expandedLength>this._maxExpandedLength))throw Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}i<r&&n.push(e.slice(i));let l=n.length===0?e:n.join(``);return this._postCheck(l,t)}_tierCounts(e){return this._limitTiers.has(Oe)?!0:this._limitTiers.has(e)}_resolveName(e){if(e in this._inputMap)return{value:this._inputMap[e],tier:C};if(e in this._externalMap)return{value:this._externalMap[e],tier:C};if(e in this._baseMap)return{value:this._baseMap[e],tier:w}}_classifyNCR(e){return e===0?this._ncrNullLevel:e>=55296&&e<=57343||this._ncrXmlVersion===1&&e>=1&&e<=31&&!Ae.has(e)?T.remove:-1}_applyNCRAction(e,t,n){switch(e){case T.allow:return String.fromCodePoint(n);case T.remove:return``;case T.leave:return;case T.throw:throw Error(`[EntityDecoder] Prohibited numeric character reference &${t}; (U+${n.toString(16).toUpperCase().padStart(4,`0`)})`);default:return String.fromCodePoint(n)}}_resolveNCR(e){let t=e.charCodeAt(1),n;if(n=t===120||t===88?parseInt(e.slice(2),16):parseInt(e.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;let r=this._classifyNCR(n);if(!this._numericAllowed&&r<T.remove)return;let i=r===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,r);return this._applyNCRAction(i,e,n)}},Ne=e=>p.includes(e)?`__`+e:e,Pe={preserveOrder:!1,attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0,unicode:!1},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:Ne};function Fe(e,t){if(typeof e!=`string`)return;let n=e.toLowerCase();if(p.some(e=>n===e.toLowerCase())||m.some(e=>n===e.toLowerCase()))throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function Ie(e,t){return typeof e==`boolean`?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:`all`}:typeof e==`object`&&e?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??1e3),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null,appliesTo:e.appliesTo??`all`}:Ie(!0)}var Le=function(e){let t=Object.assign({},Pe,e),n=[{value:t.attributeNamePrefix,name:`attributeNamePrefix`},{value:t.attributesGroupName,name:`attributesGroupName`},{value:t.textNodeName,name:`textNodeName`},{value:t.cdataPropName,name:`cdataPropName`},{value:t.commentPropName,name:`commentPropName`}];for(let{value:e,name:t}of n)e&&Fe(e,t);return t.onDangerousProperty===null&&(t.onDangerousProperty=Ne),t.processEntities=Ie(t.processEntities,t.htmlEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),t},Re=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`,E=class{constructor(e){this.tagname=e,this.child=[],this[`:@`]=Object.create(null)}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][Re]={startIndex:t})}static getMetaDataSymbol(){return Re}},ze=`:A-Za-z_À-ÖØ-öø-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�`,Be=`:A-Za-z_À-ÖØ-öø-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\\-\\.\\d·̀-ͯ‿-⁀`,Ve=`:A-Za-z_À-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿`,He=`:A-Za-z_À-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿\\-\\.\\d·̀-ͯ҇‿-⁀`,Ue=(e,t,n=``)=>{let r=`[${e.replace(`:`,``)}][${t.replace(`:`,``)}]*`;return{name:RegExp(`^[${e}][${t}]*$`,n),ncName:RegExp(`^${r}$`,n),qName:RegExp(`^${r}(?::${r})?$`,n),nmToken:RegExp(`^[${t}]+$`,n),nmTokens:RegExp(`^[${t}]+(?:\\s+[${t}]+)*$`,n)}},We=Ue(ze,Be),Ge=Ue(Ve,He,`u`),Ke=Ue(`:A-Za-z_`,`:A-Za-z_\\-\\.\\d`),qe=(e=`1.0`,t=!1)=>t?Ke:e===`1.1`?Ge:We,Je=(e,{xmlVersion:t=`1.0`,asciiOnly:n=!1}={})=>qe(t,n).qName.test(e),Ye=[`name`,`ncName`,`qName`,`nmToken`,`nmTokens`],Xe=(e,{xmlVersion:t=`1.0`,asciiOnly:n=!1,maxCacheSize:r=2048}={})=>{if(!Ye.includes(e))throw TypeError(`Unknown production "${e}". Must be one of: ${Ye.join(`, `)}`);let i=qe(t,n)[e],a=new Map,o=e=>{let t=a.get(e);if(t!==void 0)return t;let n=i.test(e);return a.size<r&&a.set(e,n),n};return o.reset=()=>{a=new Map},o},Ze=class{constructor(e,t){this.suppressValidationErr=!e,this.options=e,this.xmlVersion=t||1}setXmlVersion(e=1){this.xmlVersion=e}readDocType(e,t){let n=Object.create(null),r=0;if(e[t+3]===`O`&&e[t+4]===`C`&&e[t+5]===`T`&&e[t+6]===`Y`&&e[t+7]===`P`&&e[t+8]===`E`){t+=9;let i=1,a=!1,o=!1,s=``;for(;t<e.length;t++)if(e[t]===`<`&&!o){if(a&&O(e,`!ENTITY`,t)){t+=7;let i,a;if([i,a,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),a.indexOf(`&`)===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&r>=this.options.maxEntityCount)throw Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);n[i]=a,r++}}else if(a&&O(e,`!ELEMENT`,t)){t+=8;let{index:n}=this.readElementExp(e,t+1);t=n}else if(a&&O(e,`!ATTLIST`,t))t+=8;else if(a&&O(e,`!NOTATION`,t)){t+=9;let{index:n}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=n}else if(O(e,`!--`,t))o=!0;else throw Error(`Invalid DOCTYPE`);i++,s=``}else if(e[t]===`>`){if(o?e[t-1]===`-`&&e[t-2]===`-`&&(o=!1,i--):i--,i===0)break}else e[t]===`[`?a=!0:s+=e[t];if(i!==0)throw Error(`Unclosed DOCTYPE`)}else throw Error(`Invalid Tag instead of DOCTYPE`);return{entities:n,i:t}}readEntityExp(e,t){t=D(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t])&&e[t]!==`"`&&e[t]!==`'`;)t++;let r=e.substring(n,t);if(k(r,{xmlVersion:this.xmlVersion}),t=D(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()===`SYSTEM`)throw Error(`External entities are not supported`);if(e[t]===`%`)throw Error(`Parameter entities are not supported`)}let i=``;if([t,i]=this.readIdentifierVal(e,t,`entity`),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&i.length>this.options.maxEntitySize)throw Error(`Entity "${r}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return t--,[r,i,t]}readNotationExp(e,t){t=D(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);!this.suppressValidationErr&&k(r,{xmlVersion:this.xmlVersion}),t=D(e,t);let i=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&i!==`SYSTEM`&&i!==`PUBLIC`)throw Error(`Expected SYSTEM or PUBLIC, found "${i}"`);t+=i.length,t=D(e,t);let a=null,o=null;if(i===`PUBLIC`)[t,a]=this.readIdentifierVal(e,t,`publicIdentifier`),t=D(e,t),(e[t]===`"`||e[t]===`'`)&&([t,o]=this.readIdentifierVal(e,t,`systemIdentifier`));else if(i===`SYSTEM`&&([t,o]=this.readIdentifierVal(e,t,`systemIdentifier`),!this.suppressValidationErr&&!o))throw Error(`Missing mandatory system identifier for SYSTEM notation`);return{notationName:r,publicIdentifier:a,systemIdentifier:o,index:--t}}readIdentifierVal(e,t,n){let r=``,i=e[t];if(i!==`"`&&i!==`'`)throw Error(`Expected quoted string, found "${i}"`);t++;let a=t;for(;t<e.length&&e[t]!==i;)t++;if(r=e.substring(a,t),e[t]!==i)throw Error(`Unterminated ${n} value`);return t++,[t,r]}readElementExp(e,t){t=D(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);if(!this.suppressValidationErr&&!Je(r,{xmlVersion:this.xmlVersion}))throw Error(`Invalid element name: "${r}"`);t=D(e,t);let i=``;if(e[t]===`E`&&O(e,`MPTY`,t))t+=4;else if(e[t]===`A`&&O(e,`NY`,t))t+=2;else if(e[t]===`(`){t++;let n=t;for(;t<e.length&&e[t]!==`)`;)t++;if(i=e.substring(n,t),e[t]!==`)`)throw Error(`Unterminated content model`)}else if(!this.suppressValidationErr)throw Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:r,contentModel:i.trim(),index:t}}readAttlistExp(e,t){t=D(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);for(k(r,{xmlVersion:this.xmlVersion}),t=D(e,t),n=t;t<e.length&&!/\s/.test(e[t]);)t++;let i=e.substring(n,t);if(!k(i,{xmlVersion:this.xmlVersion}))throw Error(`Invalid attribute name: "${i}"`);t=D(e,t);let a=``;if(e.substring(t,t+8).toUpperCase()===`NOTATION`){if(a=`NOTATION`,t+=8,t=D(e,t),e[t]!==`(`)throw Error(`Expected '(', found "${e[t]}"`);t++;let n=[];for(;t<e.length&&e[t]!==`)`;){let r=t;for(;t<e.length&&e[t]!==`|`&&e[t]!==`)`;)t++;let i=e.substring(r,t);if(i=i.trim(),!k(i,{xmlVersion:this.xmlVersion}))throw Error(`Invalid notation name: "${i}"`);n.push(i),e[t]===`|`&&(t++,t=D(e,t))}if(e[t]!==`)`)throw Error(`Unterminated list of notations`);t++,a+=` (`+n.join(`|`)+`)`}else{let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;if(a+=e.substring(n,t),!this.suppressValidationErr&&![`CDATA`,`ID`,`IDREF`,`IDREFS`,`ENTITY`,`ENTITIES`,`NMTOKEN`,`NMTOKENS`].includes(a.toUpperCase()))throw Error(`Invalid attribute type: "${a}"`)}t=D(e,t);let o=``;return e.substring(t,t+8).toUpperCase()===`#REQUIRED`?(o=`#REQUIRED`,t+=8):e.substring(t,t+7).toUpperCase()===`#IMPLIED`?(o=`#IMPLIED`,t+=7):[t,o]=this.readIdentifierVal(e,t,`ATTLIST`),{elementName:r,attributeName:i,attributeType:a,defaultValue:o,index:t}}},D=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function O(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function k(e,t){if(Je(e,{xmlVersion:t}))return e;throw Error(`Invalid entity name ${e}`)}var Qe=[48,1632,1776,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,65296,120782,120792,120802,120812,120822,66720,68912,69734,69872,69942,70096,70384,70736,70864,71248,71360,71472,71904,72016,72688,72784,73040,73120,73552,92768,92864,93008,123200,123632,124144,125264,130032],$e=new Map,et=65535,tt=1632,A=new Uint8Array(63904).fill(255);for(let e of Qe)for(let t=0;t<10;t++){let n=e+t;n<=et?A[n-tt]=t:$e.set(n,t)}var nt=48,rt=57,it=45,j=new Set([8722,65293,65123]);function at(e){if(typeof e!=`string`)return e;let t=e.length;if(t===0)return e;let n=-1;for(let r=0;r<t;r++){let i=e.charCodeAt(r);if(!(i>=nt&&i<=rt||i===it)){if(i<1632){if(j.has(i)){n=r;break}continue}if(i>=55296&&i<=56319){if(r+1<t){let t=e.charCodeAt(r+1);if(t>=56320&&t<=57343){let e=65536+(i-55296<<10)+(t-56320);if($e.has(e)){n=r;break}}}continue}if(A[i-1632]!==255||j.has(i)){n=r;break}}}if(n===-1)return e;let r=[];n>0&&r.push(e.slice(0,n));for(let i=n;i<t;i++){let n=e.charCodeAt(i);if(n>=nt&&n<=rt||n===it){r.push(e[i]);continue}if(n<1632){r.push(j.has(n)?`-`:e[i]);continue}if(n>=55296&&n<=56319){if(i+1<t){let t=e.charCodeAt(i+1);if(t>=56320&&t<=57343){let e=65536+(n-55296<<10)+(t-56320),a=$e.get(e);if(a!==void 0){r.push(String.fromCharCode(a+48)),i++;continue}}}r.push(e[i]);continue}if(j.has(n)){r.push(`-`);continue}let a=A[n-tt];r.push(a===255?e[i]:String.fromCharCode(a+48))}return r.join(``)}var ot=/^[-+]?0x[a-fA-F0-9]+$/,st=/^0b[01]+$/,ct=/^0o[0-7]+$/,lt=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,ut={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:`.`,eNotation:!0,infinity:`original`,unicode:!1};function dt(e,t={}){if(t=Object.assign({},ut,t),!e||typeof e!=`string`)return e;let n=e.trim();if(n.length===0||t.skipLike!==void 0&&t.skipLike.test(n))return e;if(n===`0`||t.unicode&&(n=at(n),n===`0`))return 0;if(t.hex&&ot.test(n))return ht(n,16);if(t.binary&&st.test(n))return ht(n,2);if(t.octal&&ct.test(n))return ht(n,8);if(!isFinite(n))return gt(e,Number(n),t);if(n.includes(`e`)||n.includes(`E`))return pt(e,n,t);{let r=lt.exec(n);if(r){let i=r[1]||``,a=r[2],o=mt(r[3]),s=i?e[a.length+1]===`.`:e[a.length]===`.`;if(!t.leadingZeros&&(a.length>1||a.length===1&&!s))return e;{let r=Number(n),s=String(r);if(r===0)return r;if(s.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return s===`0`||s===o||s===`${i}${o}`?r:e;let c=a?o:n;return a?c===s||i+c===s?r:e:c===s||c===i+s?r:e}}else return e}}var ft=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function pt(e,t,n){if(!n.eNotation)return e;let r=t.match(ft);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:o.length===1&&(r[3].startsWith(`.${a}`)||r[3][0]===a)?Number(t):o.length>0?n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e:Number(t)}else return e}function mt(e){return e&&e.indexOf(`.`)!==-1?(e=e.replace(/0+$/,``),e===`.`?e=`0`:e[0]===`.`?e=`0`+e:e[e.length-1]===`.`&&(e=e.substring(0,e.length-1)),e):e}function ht(e,t){let n=e.trim();if((t===2||t===8)&&(e=n.substring(2)),parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}function gt(e,t,n){let r=t===1/0;switch(n.infinity.toLowerCase()){case`null`:return null;case`infinity`:return t;case`string`:return r?`Infinity`:`-Infinity`;default:return e}}function _t(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var M=class{constructor(e,t={},n){this.pattern=e,this.separator=t.separator||`.`,this.segments=this._parse(e),this.data=n,this._hasDeepWildcard=this.segments.some(e=>e.type===`deep-wildcard`),this._hasAttributeCondition=this.segments.some(e=>e.attrName!==void 0),this._hasPositionSelector=this.segments.some(e=>e.position!==void 0)}_parse(e){let t=[],n=0,r=``;for(;n<e.length;)e[n]===this.separator?n+1<e.length&&e[n+1]===this.separator?(r.trim()&&(t.push(this._parseSegment(r.trim())),r=``),t.push({type:`deep-wildcard`}),n+=2):(r.trim()&&t.push(this._parseSegment(r.trim())),r=``,n++):(r+=e[n],n++);return r.trim()&&t.push(this._parseSegment(r.trim())),t}_parseSegment(e){let t={type:`tag`},n=null,r=e,i=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(i&&(r=i[1]+i[3],i[2])){let e=i[2].slice(1,-1);e&&(n=e)}let a,o=r;if(r.includes(`::`)){let t=r.indexOf(`::`);if(a=r.substring(0,t).trim(),o=r.substring(t+2).trim(),!a)throw Error(`Invalid namespace in pattern: ${e}`)}let s,c=null;if(o.includes(`:`)){let e=o.lastIndexOf(`:`),t=o.substring(0,e).trim(),n=o.substring(e+1).trim();[`first`,`last`,`odd`,`even`].includes(n)||/^nth\(\d+\)$/.test(n)?(s=t,c=n):s=o}else s=o;if(!s)throw Error(`Invalid segment pattern: ${e}`);if(t.tag=s,a&&(t.namespace=a),n)if(n.includes(`=`)){let e=n.indexOf(`=`);t.attrName=n.substring(0,e).trim(),t.attrValue=n.substring(e+1).trim()}else t.attrName=n.trim();if(c){let e=c.match(/^nth\((\d+)\)$/);e?(t.position=`nth`,t.positionValue=parseInt(e[1],10)):t.position=c}return t}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}},vt=class{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._deepByTerminalTag=new Map,this._patterns=new Set,this._sealed=!1}add(e){if(this._sealed)throw TypeError(`ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.`);if(this._patterns.has(e.pattern))return this;if(this._patterns.add(e.pattern),e.hasDeepWildcard()){let t=e.segments[e.segments.length-1];if(t&&t.type!==`deep-wildcard`&&t.tag!==`*`){let n=t.tag;this._deepByTerminalTag.has(n)||this._deepByTerminalTag.set(n,[]),this._deepByTerminalTag.get(n).push(e)}else this._deepWildcards.push(e);return this}let t=e.length,n=e.segments[e.segments.length-1]?.tag;if(!n||n===`*`)this._wildcardByDepth.has(t)||this._wildcardByDepth.set(t,[]),this._wildcardByDepth.get(t).push(e);else{let r=`${t}:${n}`;this._byDepthAndTag.has(r)||this._byDepthAndTag.set(r,[]),this._byDepthAndTag.get(r).push(e)}return this}addAll(e){for(let t of e)this.add(t);return this}has(e){return this._patterns.has(e.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(e){return this.findMatch(e)!==null}findMatch(e){let t=e.getDepth(),n=e.getCurrentTag(),r=`${t}:${n}`,i=this._byDepthAndTag.get(r);if(i){for(let t=0;t<i.length;t++)if(e.matches(i[t]))return i[t]}let a=this._wildcardByDepth.get(t);if(a){for(let t=0;t<a.length;t++)if(e.matches(a[t]))return a[t]}let o=this._deepByTerminalTag.get(n);if(o){for(let t=0;t<o.length;t++)if(e.matches(o[t]))return o[t]}for(let t=0;t<this._deepWildcards.length;t++)if(e.matches(this._deepWildcards[t]))return this._deepWildcards[t];return null}},yt=class{constructor(e){this._matcher=e}get separator(){return this._matcher.separator}getCurrentTag(){let e=this._matcher.path;return e.length>0?e[e.length-1].tag:void 0}getCurrentNamespace(){let e=this._matcher.path;return e.length>0?e[e.length-1].namespace:void 0}getAttrValue(e){let t=this._matcher.path;if(t.length!==0)return t[t.length-1].values?.[e]}hasAttr(e){let t=this._matcher.path;if(t.length===0)return!1;let n=t[t.length-1];return n.values!==void 0&&e in n.values}getAnyParentAttr(e){return this._matcher.getAnyParentAttr(e)}hasAnyParentAttr(e){return this._matcher.hasAnyParentAttr(e)}getPosition(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].position??0}getCounter(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(e,t=!0){return this._matcher.toString(e,t)}toArray(){return this._matcher.path.map(e=>e.tag)}matches(e){return this._matcher.matches(e)}matchesAny(e){return e.matchesAny(this._matcher)}},bt=class{constructor(e={}){this.separator=e.separator||`.`,this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new yt(this),this._keptAttrs=[]}push(e,t=null,n=null,r=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let i=this.path.length,a=this.siblingStacks[i];a||(a={counts:new Map,total:0},this.siblingStacks[i]=a);let o=n?`${n}:${e}`:e,s=a.counts.get(o)||0,c=a.total;a.counts.set(o,s+1),a.total++;let l={tag:e,position:c,counter:s};n!=null&&(l.namespace=n),t!=null&&(l.values=t),this.path.push(l);let u=this.path.length,d=r===null?null:r.keep;if(d!=null&&d.length>0&&t)for(let e=0;e<d.length;e++){let n=d[e];t[n]!==void 0&&this._keptAttrs.push({depth:u,name:n,value:t[n]})}}pop(){if(this.path.length===0)return;this._pathStringCache=null;let e=this.path.pop();this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1);let t=this.path.length+1;for(;this._keptAttrs.length>0&&this._keptAttrs[this._keptAttrs.length-1].depth>=t;)this._keptAttrs.pop();return e}updateCurrent(e){if(this.path.length>0){let t=this.path[this.path.length-1];e!=null&&(t.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;let t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getAnyParentAttr(e){let t=this._keptAttrs;for(let n=t.length-1;n>=0;n--)if(t[n].name===e)return t[n].value}hasAnyParentAttr(e){let t=this._keptAttrs;for(let n=t.length-1;n>=0;n--)if(t[n].name===e)return!0;return!1}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){let n=e||this.separator;if(n===this.separator&&t===!0){if(this._pathStringCache!==null)return this._pathStringCache;let e=this.path.map(e=>e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n);return this._pathStringCache=e,e}return this.path.map(e=>t&&e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n)}toArray(){return this.path.map(e=>e.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[],this._keptAttrs=[]}matches(e){let t=e.segments;return t.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t<e.length;t++)if(!this._matchSegment(e[t],this.path[t],t===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(e){let t=this.path.length-1,n=e.length-1;for(;n>=0&&t>=0;){let r=e[n];if(r.type===`deep-wildcard`){if(n--,n<0)return!0;let r=e[n],i=!1;for(let e=t;e>=0;e--)if(this._matchSegment(r,this.path[e],e===this.path.length-1)){t=e-1,n--,i=!0;break}if(!i)return!1}else{if(!this._matchSegment(r,this.path[t],t===this.path.length-1))return!1;t--,n--}}return n<0}_matchSegment(e,t,n){if(e.tag!==`*`&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!==`*`&&e.namespace!==t.namespace||e.attrName!==void 0&&(!n||!t.values||!(e.attrName in t.values)||e.attrValue!==void 0&&String(t.values[e.attrName])!==String(e.attrValue)))return!1;if(e.position!==void 0){if(!n)return!1;let r=t.counter??0;if(e.position===`first`&&r!==0||e.position===`odd`&&r%2!=1||e.position===`even`&&r%2!=0||e.position===`nth`&&r!==e.positionValue)return!1}return!0}matchesAny(e){return e.matchesAny(this)}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>e&&{counts:new Map(e.counts),total:e.total}),keptAttrs:this._keptAttrs.map(e=>({...e}))}}restore(e){this._pathStringCache=null,this.path=e.path.map(e=>({...e})),this.siblingStacks=e.siblingStacks.map(e=>e&&{counts:new Map(e.counts),total:e.total}),this._keptAttrs=(e.keptAttrs||[]).map(e=>({...e}))}readOnly(){return this._view}},xt=[{id:`html-script-open`,description:`<script opening tag`,pattern:/<script[\s>/]/i},{id:`html-script-close`,description:`<\/script closing tag`,pattern:/<\/script[\s>]/i},{id:`html-javascript-protocol`,description:`javascript: URI scheme (with optional whitespace/encoding)`,pattern:/j[\t\n\r ]*a[\t\n\r ]*v[\t\n\r ]*a[\t\n\r ]*s[\t\n\r ]*c[\t\n\r ]*r[\t\n\r ]*i[\t\n\r ]*p[\t\n\r ]*t[\t\n\r ]*:/i},{id:`html-vbscript-protocol`,description:`vbscript: URI scheme`,pattern:/vbscript[\t\n\r ]*:/i},{id:`html-data-html`,description:`data:text/html URI — can execute scripts in browsers`,pattern:/data[\t\n\r ]*:[\t\n\r ]*text\/html/i},{id:`html-data-xhtml`,description:`data:application/xhtml+xml URI`,pattern:/data[\t\n\r ]*:[\t\n\r ]*application\/xhtml/i},{id:`html-data-svg`,description:`data:image/svg+xml URI — can execute scripts`,pattern:/data[\t\n\r ]*:[\t\n\r ]*image\/svg\+xml/i},{id:`html-inline-event-handler`,description:`Inline event handler attributes: onclick=, onerror=, onload=, etc.`,pattern:/\bon\w{1,30}\s*=/i},{id:`html-entity-obfuscated-script`,description:`HTML-entity-encoded <script (e.g. &#x3C;script or &lt;script)`,pattern:/(?:&#x0*3[Cc];?|&#0*60;?|&lt;)\s*script/i},{id:`html-entity-obfuscated-javascript`,description:`HTML-entity-encoded javascript: (partial — catches common &#106; or &#x6a; for "j")`,pattern:/(?:&#x0*6[Aa];?|&#0*106;?)\s*(?:&#x0*61;?|a)[\s\S]{0,80}script\s*:/i},{id:`html-style-expression`,description:`CSS expression() — IE-era code execution in style attributes`,pattern:/style[\s\S]{0,20}expression\s*\(/i},{id:`html-object-embed`,description:`<object or <embed tags that can load active content`,pattern:/<(?:object|embed)[\s>/]/i},{id:`html-base-tag`,description:`<base href= — can hijack all relative URLs on a page`,pattern:/<base[\s>]/i},{id:`html-meta-refresh`,description:`<meta http-equiv="refresh" — can redirect users`,pattern:/<meta[\s\S]{0,40}http-equiv[\s\S]{0,20}refresh/i},{id:`html-srcdoc`,description:`srcdoc= attribute on iframes — embeds HTML that can run scripts`,pattern:/srcdoc\s*=/i},{id:`html-iframe`,description:`<iframe tag`,pattern:/<iframe[\s>/]/i},{id:`html-form`,description:`<form tag — can be used for phishing / credential harvesting injection`,pattern:/<form[\s>/]/i}],St=[{id:`xml-cdata-injection`,description:`CDATA section injection: <![CDATA[ breaks out of text node context`,pattern:/<!\[CDATA\[/i},{id:`xml-cdata-close`,description:`CDATA close sequence: ]]> can terminate an enclosing CDATA section`,pattern:/\]\]>/},{id:`xml-processing-instruction`,description:`XML processing instruction: <?xml-stylesheet or <?php etc.`,pattern:/<\?(?:xml[\- ]|php|asp)/i},{id:`xml-doctype-injection`,description:`DOCTYPE declaration embedded in content — can define entities`,pattern:/<!DOCTYPE(?:[\s[]|$)/i},{id:`xml-entity-system`,description:`SYSTEM keyword — used in external entity declarations (XXE)`,pattern:/\bSYSTEM\s+["']/i},{id:`xml-entity-public`,description:`PUBLIC keyword — used in external entity declarations (XXE)`,pattern:/\bPUBLIC\s+["']/i},{id:`xml-entity-declaration`,description:`<!ENTITY declaration — defines entities, potential XXE or entity expansion`,pattern:/<!ENTITY[\s%]/i},{id:`xml-billion-laughs`,description:`Entity reference chaining / billion laughs: repeated &eX; style references`,pattern:/(?:&\w{1,20};){3,}/},{id:`xml-namespace-confusion`,description:`xmlns: attribute injection — can redefine namespaces to confuse parsers`,pattern:/\bxmlns\s*(?::\w{1,40})?\s*=/i},{id:`xml-comment-injection`,description:`<!-- comment injection — can hide content from some parsers`,pattern:/<!--/},{id:`xml-comment-close`,description:`--> closes an enclosing XML comment`,pattern:/-->/},{id:`xml-pi-close`,description:`?> closes an enclosing processing instruction`,pattern:/\?>/}],Ct=[{id:`svg-script-element`,description:`<script element inside SVG executes JavaScript`,pattern:/<script[\s>/]/i},{id:`svg-xlink-href-javascript`,description:`xlink:href with javascript: — classic SVG XSS via <a> or <use>`,pattern:/xlink\s*:\s*href\s*=\s*["']?\s*javascript\s*:/i},{id:`svg-href-javascript`,description:`href= with javascript: in SVG context (<a>, <animate>, etc.)`,pattern:/href\s*=\s*["']?\s*javascript\s*:/i},{id:`svg-foreignobject`,description:`<foreignObject embeds HTML inside SVG — can execute scripts`,pattern:/<foreignObject[\s>/]/i},{id:`svg-use-external`,description:`<use xlink:href or href pointing to external resource (non-fragment URL)`,pattern:/<use[\s\S]{0,60}(?:xlink\s*:\s*)?href\s*=\s*(?:["'][^#]|[^"'#\s>])/i},{id:`svg-animate-href`,description:`<animate attributeName="href" — can dynamically change href to javascript:`,pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*href["']/i},{id:`svg-animate-xlinkhref`,description:`<animate attributeName="xlink:href"`,pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*xlink\s*:\s*href["']/i},{id:`svg-set-javascript`,description:`<set to="javascript:..." — sets an attribute to a javascript: URI`,pattern:/<set[\s\S]{0,80}to\s*=\s*["']?\s*javascript\s*:/i},{id:`svg-event-handler`,description:`SVG-specific event handler attributes: onload=, onerror=, onactivate=, etc.`,pattern:/\bon(?:load|error|activate|begin|end|repeat|focus|blur|click|mouse\w{1,20}|key\w{1,20})\s*=/i},{id:`svg-handler-generic`,description:`Generic on* handler catch-all for SVG attributes`,pattern:/\bon\w{1,30}\s*=/i},{id:`svg-filter-feimage`,description:`<feImage href= — filter primitive that can load external resources`,pattern:/<feImage[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=/i},{id:`svg-image-external`,description:`<image xlink:href with http/https or javascript protocol`,pattern:/<image[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=\s*["']?\s*(?:https?|javascript)\s*:/i},{id:`svg-style-javascript`,description:`style= attribute containing javascript: (e.g. background:url(javascript:...))`,pattern:/style\s*=[\s\S]{0,60}javascript\s*:/i}],N=[{id:`sql-block-comment-open`,description:`SQL block comment open: /* ... */ — unusual in legitimate user text`,pattern:/\/\*/},{id:`sql-union-select`,description:`UNION SELECT — most common SQL injection aggregation attack`,pattern:/\bUNION\s{1,20}(?:ALL\s{1,20})?SELECT\b/i},{id:`sql-drop-table`,description:`DROP TABLE — destructive DDL injection`,pattern:/\bDROP\s{1,20}TABLE\b/i},{id:`sql-drop-database`,description:`DROP DATABASE — destructive DDL injection`,pattern:/\bDROP\s{1,20}DATABASE\b/i},{id:`sql-insert-into`,description:`INSERT INTO — data injection`,pattern:/\bINSERT\s{1,20}INTO\b/i},{id:`sql-delete-from`,description:`DELETE FROM — data deletion injection`,pattern:/\bDELETE\s{1,20}FROM\b/i},{id:`sql-update-set`,description:`UPDATE ... SET — data modification injection`,pattern:/\bUPDATE\b[\s\S]{1,60}\bSET\b/i},{id:`sql-exec-xp`,description:`EXEC xp_ — MSSQL extended stored procedure execution`,pattern:/\bEXEC(?:UTE)?\s{1,20}xp_/i},{id:`sql-tautology-string`,description:`Classic string tautology: ' OR '1'='1 or " OR "1"="1"`,pattern:/'\s{0,10}OR\s{0,10}'[^']{0,20}'\s*=\s*'[^']{0,20}/i},{id:`sql-tautology-numeric`,description:`Numeric tautology: OR 1=1`,pattern:/\bOR\s{1,10}1\s*=\s*1\b/i},{id:`sql-always-true-zero`,description:`Numeric tautology: OR 0=0`,pattern:/\bOR\s{1,10}0\s*=\s*0\b/i},{id:`sql-sleep-benchmark`,description:`Time-based blind injection: SLEEP() or BENCHMARK()`,pattern:/\b(?:SLEEP|BENCHMARK)\s*\(/i},{id:`sql-waitfor-delay`,description:`MSSQL time-based blind injection: WAITFOR DELAY`,pattern:/\bWAITFOR\s{1,20}DELAY\b/i},{id:`sql-char-function`,description:`CHAR() function — used to obfuscate injected strings`,pattern:/\bCHAR\s*\(\s*\d{1,3}/i},{id:`sql-information-schema`,description:`INFORMATION_SCHEMA — reconnaissance query for table/column enumeration`,pattern:/\bINFORMATION_SCHEMA\b/i}],wt=[{id:`shell-path-traversal-unix`,description:`Unix path traversal: ../ — climbing the directory tree`,pattern:/\.\.\//},{id:`shell-path-traversal-windows`,description:`Windows path traversal: ..\\ — climbing the directory tree`,pattern:/\.\.\\/},{id:`shell-path-traversal-encoded`,description:`URL-encoded path traversal: %2e%2e or %2f variants`,pattern:/%2e%2e|%2f\.\.|\.\.%2f/i},{id:`shell-null-byte`,description:`Null byte injection: \\x00 or %00 — truncates strings in C-backed functions`,pattern:/\x00|%00/},{id:`shell-semicolon`,description:`Semicolon command separator: cmd1; cmd2`,pattern:/;/},{id:`shell-pipe`,description:`Pipe operator: cmd1 | cmd2`,pattern:/\|/},{id:`shell-and-operator`,description:`AND operator: cmd1 && cmd2`,pattern:/&&/},{id:`shell-or-operator`,description:`OR operator: cmd1 || cmd2`,pattern:/\|\|/},{id:`shell-backtick`,description:"Backtick command substitution: `cmd`",pattern:/`/},{id:`shell-dollar-paren`,description:`Dollar-paren command substitution: $(cmd)`,pattern:/\$\(/},{id:`shell-dollar-brace`,description:"Dollar-brace variable expansion: ${var} — can be abused for injection",pattern:/\$\{/},{id:`shell-redirect-out`,description:`Output redirection: cmd > file or cmd >> file`,pattern:/>{1,2}/},{id:`shell-redirect-in`,description:`Input redirection: cmd < file`,pattern:/</},{id:`shell-newline-injection`,description:`Newline injection: \\n or \\r — can inject new shell commands`,pattern:/[\n\r]/},{id:`shell-glob-star`,description:`Glob expansion: * or ? — can expand to unintended files`,pattern:/[/\\][*?]/},{id:`shell-absolute-root`,description:`Absolute root path injection: string starting with / or \\ (Windows UNC)`,pattern:/^(?:\/|\\\\)/},{id:`shell-windows-drive`,description:`Windows drive letter path injection: C:\\ or D:/`,pattern:/^[a-zA-Z]:[/\\]/},{id:`shell-curl-wget`,description:`curl/wget with URL or flags — can exfiltrate data or download payloads`,pattern:/\b(?:curl|wget)\s+(?:https?:\/\/|ftp:\/\/|-)/i}],Tt=[{id:`redos-nested-quantifier-plus`,description:`Nested + quantifier inside a group with outer quantifier: (a+)+, (.+b)*, etc.`,pattern:/\([^)]*\+[^)]*\)[+*]/},{id:`redos-nested-quantifier-star`,description:`Nested * quantifier: (a*)* or (a*)+ — catastrophic backtracking`,pattern:/\([^)]*\*[^)]*\)[*+]/},{id:`redos-nested-groups`,description:`Doubly nested quantified groups: ((a+)+) — guaranteed catastrophic`,pattern:/\(\([^)]{0,40}\)[+*]\)[+*]/},{id:`redos-alternation-overlap`,description:`Overlapping alternation under quantifier: (a|a)+ — ambiguous NFA paths`,pattern:/\(([^|()]{1,20})\|(?:\1)(?:\|[^|()]{1,20}){0,5}\)[+*?]{1,2}/},{id:`redos-star-plus-concat`,description:`(x*x)+ pattern — triggers super-linear backtracking`,pattern:/\([^)]{0,10}\*[^)]{0,10}\)[+*]/},{id:`redos-dot-star-greedy`,description:`(.*){n,} or (.+){n,} — repeated greedy dot quantifiers`,pattern:/\(\.[*+]\)\{?\d/},{id:`redos-large-repetition`,description:`Very large fixed or range repetition count {1000,} or {1000,n} — denial of service via backtracking`,pattern:/\{\d{4,}(?:,\d*)?\}/},{id:`redos-catastrophic-alternation`,description:`Long alternation with many similar branches — polynomial backtracking risk`,pattern:/\([^)]{0,200}(?:\|[^|)]{0,50}){9,}\)/}],P=`["'\\s]*:`,Et=[{id:`nosql-where-operator`,description:`$where — executes arbitrary JavaScript server-side in MongoDB`,pattern:RegExp(`\\$where${P}`,`i`)},{id:`nosql-ne-operator`,description:`$ne — "not equal" operator used to bypass equality checks`,pattern:RegExp(`\\$ne${P}`,`i`)},{id:`nosql-gt-operator`,description:`$gt — "greater than" used to bypass password/value checks`,pattern:RegExp(`\\$gte?${P}`,`i`)},{id:`nosql-lt-operator`,description:`$lt / $lte — "less than" bypass variants`,pattern:RegExp(`\\$lte?${P}`,`i`)},{id:`nosql-regex-operator`,description:`$regex — can be used to extract data character by character (blind injection)`,pattern:RegExp(`\\$regex${P}`,`i`)},{id:`nosql-or-operator`,description:`$or — logical OR; used to create always-true conditions`,pattern:RegExp(`\\$or${P}\\s*\\[`,`i`)},{id:`nosql-and-operator`,description:`$and — logical AND operator injection`,pattern:RegExp(`\\$and${P}\\s*\\[`,`i`)},{id:`nosql-nor-operator`,description:`$nor — logical NOR operator injection`,pattern:RegExp(`\\$nor${P}\\s*\\[`,`i`)},{id:`nosql-exists-operator`,description:`$exists — can enumerate fields to determine schema`,pattern:RegExp(`\\$exists${P}`,`i`)},{id:`nosql-in-operator`,description:`$in — matches any value in a list; can enumerate values`,pattern:RegExp(`\\$in${P}\\s*\\[`,`i`)},{id:`nosql-expr-operator`,description:`$expr — allows aggregation expressions in queries (MongoDB 3.6+)`,pattern:RegExp(`\\$expr${P}`,`i`)},{id:`nosql-function-operator`,description:`$function — executes arbitrary JavaScript in MongoDB 4.4+`,pattern:RegExp(`\\$function${P}`,`i`)},{id:`nosql-accumulator-operator`,description:`$accumulator — custom aggregation with arbitrary JS execution`,pattern:RegExp(`\\$accumulator${P}`,`i`)},{id:`nosql-proto-pollution`,description:`__proto__ — prototype pollution via object key injection`,pattern:/__proto__/},{id:`nosql-constructor-prototype`,description:`constructor.prototype — alternative prototype pollution vector (dot notation or JSON key)`,pattern:/constructor[\s"':.,{\[]*prototype/i},{id:`nosql-proto-bracket`,description:`["__proto__"] — bracket-notation prototype pollution`,pattern:/\[["']__proto__["']\]/}],Dt=[{id:`log-crlf-injection`,description:`CRLF injection: literal \\r or \\n embeds fake log lines`,pattern:/[\r\n]/},{id:`log-url-encoded-crlf`,description:`URL-encoded CRLF: %0d, %0a, %0D, %0A — decoded by some log parsers`,pattern:/%0[dDaA]/},{id:`log-unicode-newline`,description:`Unicode newline variants: U+2028 (line separator), U+2029 (paragraph separator)`,pattern:/[\u2028\u2029]/},{id:`log-log4shell-jndi`,description:"Log4Shell: ${jndi:...} triggers remote code execution in Apache Log4j",pattern:/\$\{jndi\s*:/i},{id:`log-log4shell-obfuscated`,description:"Obfuscated Log4Shell: ${::-j}... lookup-bypass prefix used to evade WAF detection",pattern:/\$\{::-/},{id:`log-log4j-lookup`,description:"Log4j lookup syntax: ${env:...}, ${sys:...}, ${ctx:...} — data exfiltration",pattern:/\$\{(?:env|sys|ctx|main|map|sd|web|docker|k8s|spring)\s*:/i},{id:`log-ssti-double-brace`,description:`SSTI double-brace: {{expression}} — Jinja2, Twig, Handlebars, etc.`,pattern:/\{\{[\s\S]{0,80}\}\}/},{id:`log-ssti-hash-brace`,description:`SSTI hash-brace: #{expression} — Thymeleaf, Velocity, Ruby ERB`,pattern:/#\{[\s\S]{0,80}\}/},{id:`log-ssti-dollar-brace`,description:"SSTI/EL injection: ${expression with operators or method calls} — JSP EL, Freemarker, SpEL",pattern:/\$\{[^}]*(?:\.|\(|\*|\+|\bclass\b|\bruntime\b|\bprocess\b|\bexec\b)[^}]{0,80}\}/i},{id:`log-ssti-percent-tag`,description:`SSTI ERB/ASP tag: <%= expression %> — Ruby ERB, ASP`,pattern:/<%=[\s\S]{0,80}%>/},{id:`log-null-byte`,description:`Null byte: \\x00 or %00 — can truncate log entries in C-backed loggers`,pattern:/\x00|%00/},{id:`log-ansi-escape`,description:`ANSI escape sequence: ESC[ — can manipulate terminal output when logs are tailed`,pattern:/\x1b\[/}],Ot=[{id:`sql-line-comment`,description:`SQL line comment: -- followed by whitespace or end of string`,pattern:/--(?:\s|$)/},{id:`sql-stacked-query`,description:`Stacked queries: semicolon immediately followed by a SQL keyword`,pattern:/;\s{0,10}(?:SELECT|INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|EXEC)\b/i},{id:`sql-hex-encoding`,description:`Hex-encoded string injection: 0x41414141 style (MySQL)`,pattern:/\b0x[0-9a-f]{4,}/i}],kt=[...N,...Ot];xt.label=`HTML`,St.label=`XML`,Ct.label=`SVG`,N.label=`SQL`,kt.label=`SQL-STRICT`,wt.label=`SHELL`,Tt.label=`REDOS`,Et.label=`NOSQL`,Dt.label=`LOG`,Object.freeze({HTML:xt,XML:St,SVG:Ct,SQL:N,"SQL-STRICT":kt,SHELL:wt,REDOS:Tt,NOSQL:Et,LOG:Dt});function At(e){if(typeof e!=`string`)throw TypeError(`is-unsafe: first argument must be a string, got ${typeof e}`)}function jt(e){if(!(e instanceof RegExp)){if(Array.isArray(e)){if(e.length===0)throw TypeError(`is-unsafe: context must not be an empty array`);if(Array.isArray(e[0])){for(let t of e)if(!Array.isArray(t)||t.length===0)throw TypeError(`is-unsafe: each context in the array must be a non-empty pattern array (PatternList)`)}return}throw TypeError(`is-unsafe: second argument must be a PatternList (e.g. HTML), an array of PatternLists (e.g. [HTML, XML]), or a RegExp. Got: ${typeof e}`)}}function Mt(e){return e instanceof RegExp?{lists:null,regex:e}:Array.isArray(e[0])?{lists:e,regex:null}:{lists:[e],regex:null}}function Nt(e,t){let n=t.label??`CUSTOM`;for(let r of t)if(r.pattern.test(e))return{context:n,id:r.id,description:r.description,pattern:r.pattern};return null}function Pt(e,t){At(e),jt(t);let{lists:n,regex:r}=Mt(t);if(r)return r.test(e);for(let t of n)if(Nt(e,t)!==null)return!0;return!1}function Ft(e,t){if(!e)return{};let n=t.attributesGroupName?e[t.attributesGroupName]:e;if(!n)return{};let r={};for(let e in n)if(e.startsWith(t.attributeNamePrefix)){let i=e.substring(t.attributeNamePrefix.length);r[i]=n[e]}else r[e]=n[e];return r}function It(e){if(!e||typeof e!=`string`)return;let t=e.indexOf(`:`);if(t!==-1&&t>0){let n=e.substring(0,t);if(n!==`xmlns`)return n}}var Lt=class{constructor(e,t){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Ht,this.parseTextData=Rt,this.resolveNameSpace=zt,this.buildAttributesMap=Vt,this.isItStopNode=Kt,this.replaceEntitiesValue=Wt,this.readStopNodeData=Yt,this.saveTextToParentTag=Gt,this.addChild=Ut,this.ignoreAttributesFn=_t(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0;let n={...we};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities==`object`?n=this.options.htmlEntities:this.options.htmlEntities===!0&&(n={...Te,...xe}),this.entityDecoder=new Me({namedEntities:{...n,...t},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo},onInputEntity:(e,t)=>Pt(t,[xt,St])?x.BLOCK:x.ALLOW})),this.matcher=new bt,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new vt;let r=this.options.stopNodes;if(r&&r.length>0){for(let e=0;e<r.length;e++){let t=r[e];typeof t==`string`?this.stopNodeExpressionsSet.add(new M(t)):t instanceof M&&this.stopNodeExpressionsSet.add(t)}this.stopNodeExpressionsSet.seal()}}};function Rt(e,t,n,r,i,a,o){let s=this.options;if(e!==void 0&&(s.trimValues&&!r&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e,t,n));let r=s.jPath?n.toString():n,c=s.tagValueProcessor(t,e,r,i,a);return c==null?e:typeof c!=typeof e||c!==e?c:s.trimValues||e.trim()===e?Xt(e,s.parseTagValue,s.numberParseOptions):e}}function zt(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}var Bt=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function Vt(e,t,n,r=!1){let i=this.options;if(r===!0||i.ignoreAttributes!==!0&&typeof e==`string`){let r=u(e,Bt),a=r.length,o={},s=Array(a),c=!1,l={};for(let e=0;e<a;e++){let t=this.resolveNameSpace(r[e][1]),a=r[e][4];if(t.length&&a!==void 0){let r=a;i.trimValues&&(r=r.trim()),r=this.replaceEntitiesValue(r,n,this.readonlyMatcher),s[e]=r,l[t]=r,c=!0}}c&&typeof t==`object`&&t.updateCurrent&&t.updateCurrent(l);let d=i.jPath?t.toString():this.readonlyMatcher,f=!1;for(let e=0;e<a;e++){let t=this.resolveNameSpace(r[e][1]);if(this.ignoreAttributesFn(t,d))continue;let n=i.attributeNamePrefix+t;if(t.length)if(i.transformAttributeName&&(n=i.transformAttributeName(n)),n=Zt(n,i),r[e][4]!==void 0){let r=s[e],a=i.attributeValueProcessor(t,r,d);a==null?o[n]=r:typeof a!=typeof r||a!==r?o[n]=a:o[n]=Xt(r,i.parseAttributeValue,i.numberParseOptions),f=!0}else i.allowBooleanAttributes&&(o[n]=!0,f=!0)}if(!f)return;if(i.attributesGroupName&&!i.preserveOrder){let e={};return e[i.attributesGroupName]=o,e}return o}}var Ht=function(e){e=e.replace(/\r\n?/g,`
4
- `);let t=new E(`!xml`),n=t,r=``;this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let i=this.options,a=new Ze(i.processEntities),o=e.length;for(let s=0;s<o;s++)if(e[s]===`<`){let c=e.charCodeAt(s+1);if(c===47){let t=F(e,`>`,s,`Closing Tag is not closed.`),a=e.substring(s+2,t).trim();if(i.removeNSPrefix){let e=a.indexOf(`:`);e!==-1&&(a=a.substr(e+1))}a=L(i.transformTagName,a,``,i).tagName,n&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher));let o=this.matcher.getCurrentTag();if(a&&i.unpairedTagsSet.has(a))throw Error(`Unpaired tag can not be used as closing tag: </${a}>`);o&&i.unpairedTagsSet.has(o)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),r=``,s=t}else if(c===63){let t=I(e,s,!1,`?>`);if(!t)throw Error(`Pi Tag is not closed.`);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let o=this.buildAttributesMap(t.tagExp,this.matcher,t.tagName,!0);if(o){let e=o[this.options.attributeNamePrefix+`version`];this.entityDecoder.setXmlVersion(Number(e)||1),a.setXmlVersion(Number(e)||1)}if(!(i.ignoreDeclaration&&t.tagName===`?xml`||i.ignorePiTags)){let e=new E(t.tagName);e.add(i.textNodeName,``),t.tagName!==t.tagExp&&t.attrExpPresent&&i.ignoreAttributes!==!0&&(e[`:@`]=o),this.addChild(n,e,this.readonlyMatcher,s)}s=t.closeIndex+1}else if(c===33&&e.charCodeAt(s+2)===45&&e.charCodeAt(s+3)===45){let t=F(e,`-->`,s+4,`Comment is not closed.`);if(i.commentPropName){let a=e.substring(s+4,t-2);r=this.saveTextToParentTag(r,n,this.readonlyMatcher),n.add(i.commentPropName,[{[i.textNodeName]:a}])}s=t}else if(c===33&&e.charCodeAt(s+2)===68){let t=a.readDocType(e,s);this.entityDecoder.addInputEntities(t.entities),s=t.i}else if(c===33&&e.charCodeAt(s+2)===91){let t=F(e,`]]>`,s,`CDATA is not closed.`)-2,a=e.substring(s+9,t);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let o=this.parseTextData(a,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);o??=``,i.cdataPropName?n.add(i.cdataPropName,[{[i.textNodeName]:a}]):n.add(i.textNodeName,o),s=t+2}else{let a=I(e,s,i.removeNSPrefix);if(!a){let t=e.substring(Math.max(0,s-50),Math.min(o,s+50));throw Error(`readTagExp returned undefined at position ${s}. Context: "${t}"`)}let c=a.tagName,l=a.rawTagName,u=a.tagExp,d=a.attrExpPresent,f=a.closeIndex;if({tagName:c,tagExp:u}=L(i.transformTagName,c,u,i),i.strictReservedNames&&(c===i.commentPropName||c===i.cdataPropName||c===i.textNodeName||c===i.attributesGroupName))throw Error(`Invalid tag name: ${c}`);n&&r&&n.tagname!==`!xml`&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher,!1));let p=n;p&&i.unpairedTagsSet.has(p.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let m=!1;u.length>0&&u.lastIndexOf(`/`)===u.length-1&&(m=!0,c[c.length-1]===`/`?(c=c.substr(0,c.length-1),u=c):u=u.substr(0,u.length-1),d=c!==u);let h=null,g;g=It(l),c!==t.tagname&&this.matcher.push(c,{},g),c!==u&&d&&(h=this.buildAttributesMap(u,this.matcher,c),h&&Ft(h,i)),c!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let _=s;if(this.isCurrentNodeStopNode){let t=``;if(m)s=a.closeIndex;else if(i.unpairedTagsSet.has(c))s=a.closeIndex;else{let n=this.readStopNodeData(e,l,f+1);if(!n)throw Error(`Unexpected end of ${l}`);s=n.i,t=n.tagContent}let r=new E(c);h&&(r[`:@`]=h),r.add(i.textNodeName,t),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,r,this.readonlyMatcher,_)}else{if(m){({tagName:c,tagExp:u}=L(i.transformTagName,c,u,i));let e=new E(c);h&&(e[`:@`]=h),this.addChild(n,e,this.readonlyMatcher,_),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(i.unpairedTagsSet.has(c)){let e=new E(c);h&&(e[`:@`]=h),this.addChild(n,e,this.readonlyMatcher,_),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=a.closeIndex;continue}else{let e=new E(c);if(this.tagsNodeStack.length>i.maxNestedTags)throw Error(`Maximum nested tags exceeded`);this.tagsNodeStack.push(n),h&&(e[`:@`]=h),this.addChild(n,e,this.readonlyMatcher,_),n=e}r=``,s=f}}}else r+=e[s];return t.child};function Ut(e,t,n,r){this.options.captureMetaData||(r=void 0);let i=this.options.jPath?n.toString():n,a=this.options.updateTag(t.tagname,i,t[`:@`]);a===!1||(typeof a==`string`&&(t.tagname=a),e.addChild(t,r))}function Wt(e,t,n){let r=this.options.processEntities;if(!r||!r.enabled)return e;if(r.allowedTags){let i=this.options.jPath?n.toString():n;if(!(Array.isArray(r.allowedTags)?r.allowedTags.includes(t):r.allowedTags(t,i)))return e}if(r.tagFilter){let i=this.options.jPath?n.toString():n;if(!r.tagFilter(t,i))return e}return this.entityDecoder.decode(e)}function Gt(e,t,n,r){return e&&=(r===void 0&&(r=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[`:@`]?Object.keys(t[`:@`]).length!==0:!1,r),e!==void 0&&e!==``&&t.add(this.options.textNodeName,e),``),e}function Kt(){return this.stopNodeExpressionsSet.size===0?!1:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function qt(e,t,n=`>`){let r=0,i=e.length,a=n.charCodeAt(0),o=n.length>1?n.charCodeAt(1):-1,s=``,c=t;for(let n=t;n<i;n++){let t=e.charCodeAt(n);if(r)t===r&&(r=0);else if(t===34||t===39)r=t;else if(t===a)if(o!==-1){if(e.charCodeAt(n+1)===o)return s+=e.substring(c,n),{data:s,index:n}}else return s+=e.substring(c,n),{data:s,index:n};else t===9&&!r&&(s+=e.substring(c,n)+` `,c=n+1)}}function F(e,t,n,r){let i=e.indexOf(t,n);if(i===-1)throw Error(r);return i+t.length-1}function Jt(e,t,n,r){let i=e.indexOf(t,n);if(i===-1)throw Error(r);return i}function I(e,t,n,r=`>`){let i=qt(e,t+1,r);if(!i)return;let a=i.data,o=i.index,s=a.search(/\s/),c=a,l=!0;s!==-1&&(c=a.substring(0,s),a=a.substring(s+1).trimStart());let u=c;if(n){let e=c.indexOf(`:`);e!==-1&&(c=c.substr(e+1),l=c!==i.data.substr(e+1))}return{tagName:c,tagExp:a,closeIndex:o,attrExpPresent:l,rawTagName:u}}function Yt(e,t,n){let r=n,i=1,a=e.length;for(;n<a;n++)if(e[n]===`<`){let a=e.charCodeAt(n+1);if(a===47){let a=Jt(e,`>`,n,`${t} is not closed`);if(e.substring(n+2,a).trim()===t&&(i--,i===0))return{tagContent:e.substring(r,n),i:a};n=a}else if(a===63)n=F(e,`?>`,n+1,`StopNode is not closed.`);else if(a===33&&e.charCodeAt(n+2)===45&&e.charCodeAt(n+3)===45)n=F(e,`-->`,n+3,`StopNode is not closed.`);else if(a===33&&e.charCodeAt(n+2)===91)n=F(e,`]]>`,n,`StopNode is not closed.`)-2;else{let r=I(e,n,!1);r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!==`/`&&i++,n=r.closeIndex)}}}function Xt(e,t,n){if(t&&typeof e==`string`){let t=e.trim();return t===`true`?!0:t===`false`?!1:dt(e,n)}else if(f(e))return e;else return``}function L(e,t,n,r){if(e){let r=e(t);n===t&&(n=r),t=r}return t=Zt(t,r),{tagName:t,tagExp:n}}function Zt(e,t){if(m.includes(e))throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return p.includes(e)?t.onDangerousProperty(e):e}var R=E.getMetaDataSymbol();function Qt(e,t){if(!e||typeof e!=`object`)return{};if(!t)return e;let n={};for(let r in e)if(r.startsWith(t)){let i=r.substring(t.length);n[i]=e[r]}else n[r]=e[r];return n}function $t(e,t,n,r){return en(e,t,n,r)}function en(e,t,n,r){let i,a={};for(let o=0;o<e.length;o++){let s=e[o],c=tn(s);if(c!==void 0&&c!==t.textNodeName){let e=Qt(s[`:@`]||{},t.attributeNamePrefix);n.push(c,e)}if(c===t.textNodeName)i===void 0?i=s[c]:i+=``+s[c];else if(c===void 0)continue;else if(s[c]){let e=en(s[c],t,n,r),i=rn(e,t);if(Object.keys(e).length===0&&t.alwaysCreateTextNode&&(e[t.textNodeName]=``),s[`:@`]?nn(e,s[`:@`],r,t):Object.keys(e).length===1&&e[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?e=e[t.textNodeName]:Object.keys(e).length===0&&(t.alwaysCreateTextNode?e[t.textNodeName]=``:e=``),s[R]!==void 0&&typeof e==`object`&&e&&(e[R]=s[R]),a[c]!==void 0&&Object.prototype.hasOwnProperty.call(a,c))Array.isArray(a[c])||(a[c]=[a[c]]),a[c].push(e);else{let n=t.jPath?r.toString():r;t.isArray(c,n,i)?a[c]=[e]:a[c]=e}c!==void 0&&c!==t.textNodeName&&n.pop()}}return typeof i==`string`?i.length>0&&(a[t.textNodeName]=i):i!==void 0&&(a[t.textNodeName]=i),a}function tn(e){let t=Object.keys(e);for(let e=0;e<t.length;e++){let n=t[e];if(n!==`:@`)return n}}function nn(e,t,n,r){if(t){let i=Object.keys(t),a=i.length;for(let o=0;o<a;o++){let a=i[o],s=a.startsWith(r.attributeNamePrefix)?a.substring(r.attributeNamePrefix.length):a,c=r.jPath?n.toString()+`.`+s:n;r.isArray(a,c,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function rn(e,t){let{textNodeName:n}=t,r=Object.keys(e).length;return!!(r===0||r===1&&(e[n]||typeof e[n]==`boolean`||e[n]===0))}var an=class{constructor(e){this.externalEntities={},this.options=Le(e)}parse(e,t){if(typeof e!=`string`&&e.toString)e=e.toString();else if(typeof e!=`string`)throw Error(`XML data is accepted in String or Bytes[] form.`);if(t){t===!0&&(t={});let n=g(e,t);if(n!==!0)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}let n=new Lt(this.options,this.externalEntities),r=n.parseXml(e);return this.options.preserveOrder||r===void 0?r:$t(r,this.options,n.matcher,n.readonlyMatcher)}addEntity(e,t){if(t.indexOf(`&`)!==-1)throw Error(`Entity value can't have '&'`);if(e.indexOf(`&`)!==-1||e.indexOf(`;`)!==-1)throw Error(`An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'`);if(t===`&`)throw Error(`An entity with value '&' is not permitted`);this.externalEntities[e]=t}static getMetaDataSymbol(){return E.getMetaDataSymbol()}};function z(e){return String(e).replace(/--/g,`- -`).replace(/--/g,`- -`).replace(/-$/,`- `)}function on(e){return String(e).replace(/\]\]>/g,`]]]]><![CDATA[>`)}function B(e){return String(e).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`)}var sn=`
5
- `;function cn(e,t){if(!Array.isArray(e)||e.length===0)return`1.0`;let n=e[0];if(V(n)===`?xml`){let e=n[`:@`];if(e){let n=t.attributeNamePrefix+`version`;if(e[n])return e[n]}}return`1.0`}function ln(e,t,n,r,i){return!n.sanitizeName||i(e)?e:n.sanitizeName(e,{isAttribute:t,matcher:r.readOnly()})}function un(e,t){let n=``;t.format&&(n=sn);let r=[];if(t.stopNodes&&Array.isArray(t.stopNodes))for(let e=0;e<t.stopNodes.length;e++){let n=t.stopNodes[e];typeof n==`string`?r.push(new M(n)):n instanceof M&&r.push(n)}let i=Xe(`qName`,{xmlVersion:cn(e,t)}),a=new bt;return dn(e,t,n,a,r,i)}function dn(e,t,n,r,i,a){let o=``,s=!1;if(t.maxNestedTags&&r.getDepth()>t.maxNestedTags)throw Error(`Maximum nested tags exceeded`);if(!Array.isArray(e)){if(e!=null){let n=e.toString();return n=H(n,t),n}return``}for(let c=0;c<e.length;c++){let l=e[c],u=V(l);if(u===void 0)continue;let d=u===t.textNodeName||u===t.cdataPropName||u===t.commentPropName||u[0]===`?`?u:ln(u,!1,t,r,a),f=fn(l[`:@`],t);r.push(d,f);let p=gn(r,i);if(d===t.textNodeName){let e=l[u];p||(e=t.tagValueProcessor(d,e),e=H(e,t)),s&&(o+=n),o+=e,s=!1,r.pop();continue}else if(d===t.cdataPropName){s&&(o+=n);let e=l[u][0][t.textNodeName],i=on(e);o+=`<![CDATA[${i}]]>`,s=!1,r.pop();continue}else if(d===t.commentPropName){let e=l[u][0][t.textNodeName],i=z(e);o+=n+`<!--${i}-->`,s=!0,r.pop();continue}else if(d[0]===`?`){let e=hn(l[`:@`],t,p,r,a);o+=(d===`?xml`?``:n)+`<${d}${e}?>`,s=!0,r.pop();continue}let m=n;m!==``&&(m+=t.indentBy);let h=n+`<${d}${hn(l[`:@`],t,p,r,a)}`,g;g=p?pn(l[u],t):dn(l[u],t,m,r,i,a),t.unpairedTags.indexOf(d)===-1?(!g||g.length===0)&&t.suppressEmptyNode?o+=h+`/>`:g&&g.endsWith(`>`)?o+=h+`>${g}${n}</${d}>`:(o+=h+`>`,g&&n!==``&&(g.includes(`/>`)||g.includes(`</`))?o+=n+t.indentBy+g+n:o+=g,o+=`</${d}>`):t.suppressUnpairedNode?o+=h+`>`:o+=h+`/>`,s=!0,r.pop()}return o}function fn(e,t){if(!e||t.ignoreAttributes)return null;let n={},r=!1;for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let a=i.startsWith(t.attributeNamePrefix)?i.substr(t.attributeNamePrefix.length):i;n[a]=B(e[i]),r=!0}return r?n:null}function pn(e,t){if(!Array.isArray(e))return e==null?``:e.toString();let n=``;for(let r=0;r<e.length;r++){let i=e[r],a=V(i);if(a===t.textNodeName)n+=i[a];else if(a===t.cdataPropName)n+=i[a][0][t.textNodeName];else if(a===t.commentPropName)n+=i[a][0][t.textNodeName];else if(a&&a[0]===`?`)continue;else if(a){let e=mn(i[`:@`],t),r=pn(i[a],t);!r||r.length===0?n+=`<${a}${e}/>`:n+=`<${a}${e}>${r}</${a}>`}}return n}function mn(e,t){let n=``;if(e&&!t.ignoreAttributes)for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=e[r];i===!0&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${B(i)}"`}return n}function V(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n];if(Object.prototype.hasOwnProperty.call(e,r)&&r!==`:@`)return r}}function hn(e,t,n,r,i){let a=``;if(e&&!t.ignoreAttributes)for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let s=o.substr(t.attributeNamePrefix.length),c=n?s:ln(s,!0,t,r,i),l;n?l=e[o]:(l=t.attributeValueProcessor(o,e[o]),l=H(l,t)),l===!0&&t.suppressBooleanAttributes?a+=` ${c}`:a+=` ${c}="${B(l)}"`}return a}function gn(e,t){if(!t||t.length===0)return!1;for(let n=0;n<t.length;n++)if(e.matches(t[n]))return!0;return!1}function H(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){let r=t.entities[n];e=e.replace(r.regex,r.val)}return e}function _n(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var vn={attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:` `,suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:RegExp(`&`,`g`),val:`&amp;`},{regex:RegExp(`>`,`g`),val:`&gt;`},{regex:RegExp(`<`,`g`),val:`&lt;`},{regex:RegExp(`'`,`g`),val:`&apos;`},{regex:RegExp(`"`,`g`),val:`&quot;`}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0,sanitizeName:!1};function U(e){if(this.options=Object.assign({},vn,e),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let e=0;e<this.options.stopNodes.length;e++){let t=this.options.stopNodes[e];typeof t==`string`?this.stopNodeExpressions.push(new M(t)):t instanceof M&&this.stopNodeExpressions.push(t)}this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=_n(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Cn),this.processTextOrObjNode=xn,this.options.format?(this.indentate=Sn,this.tagEndChar=`>
3
+ `||e===`\r`}function ee(e,t){let n=t;for(;t<e.length;t++)if(e[t]==`?`||e[t]==` `){let r=e.substr(n,t-n);if(t>5&&r===`xml`)return v(`InvalidXml`,`XML declaration allowed only at the start of the document.`,y(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}else continue}return t}function te(e,t){if(e.length>t+5&&e[t+1]===`-`&&e[t+2]===`-`){for(t+=3;t<e.length;t++)if(e[t]===`-`&&e[t+1]===`-`&&e[t+2]===`>`){t+=2;break}}else if(e.length>t+8&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t<e.length;t++)if(e[t]===`<`)n++;else if(e[t]===`>`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t<e.length;t++)if(e[t]===`]`&&e[t+1]===`]`&&e[t+2]===`>`){t+=2;break}}return t}var ne=`"`,re=`'`;function ie(e,t){let n=``,r=``,i=!1;for(;t<e.length;t++){if(e[t]===ne||e[t]===re)r===``?r=e[t]:r!==e[t]||(r=``);else if(e[t]===`>`&&r===``){i=!0;break}n+=e[t]}return r===``?{value:n,index:t,tagClosed:i}:!1}var ae=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function oe(e,t){let n=u(e,ae),r={};for(let e=0;e<n.length;e++){if(n[e][1].length===0)return v(`InvalidAttr`,`Attribute '`+n[e][2]+`' has no space in starting.`,b(n[e]));if(n[e][3]!==void 0&&n[e][4]===void 0)return v(`InvalidAttr`,`Attribute '`+n[e][2]+`' is without value.`,b(n[e]));if(n[e][3]===void 0&&!t.allowBooleanAttributes)return v(`InvalidAttr`,`boolean attribute '`+n[e][2]+`' is not allowed.`,b(n[e]));let i=n[e][2];if(!le(i))return v(`InvalidAttr`,`Attribute '`+i+`' is an invalid name.`,b(n[e]));if(!Object.prototype.hasOwnProperty.call(r,i))r[i]=1;else return v(`InvalidAttr`,`Attribute '`+i+`' is repeated.`,b(n[e]))}return!0}function se(e,t){let n=/\d/;for(e[t]===`x`&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(e[t]===`;`)return t;if(!e[t].match(n))break}return-1}function ce(e,t){if(t++,e[t]===`;`)return-1;if(e[t]===`#`)return t++,se(e,t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===`;`)break;return-1}return t}function v(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function le(e){return d(e)}function ue(e){return d(e)}function y(e,t){let n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function b(e){return e.startIndex+e[1].length}var de={amp:`&`,AMP:`&`,lt:`<`,LT:`<`,gt:`>`,GT:`>`,quot:`"`,QUOT:`"`,apos:`'`,lsquo:`‘`,rsquo:`’`,ldquo:`“`,rdquo:`”`,lsquor:`‚`,rsquor:`’`,ldquor:`„`,bdquo:`„`,comma:`,`,period:`.`,colon:`:`,semi:`;`,excl:`!`,quest:`?`,num:`#`,dollar:`$`,percent:`%`,ast:`*`,commat:`@`,lowbar:`_`,verbar:`|`,vert:`|`,sol:`/`,bsol:`\\`,lbrace:`{`,rbrace:`}`,lbrack:`[`,rbrack:`]`,lpar:`(`,rpar:`)`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,COPY:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,REG:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,half:`½`,frac34:`¾`,iquest:`¿`,times:`×`,div:`÷`,divide:`÷`},fe={Agrave:`À`,agrave:`à`,Aacute:`Á`,aacute:`á`,Acirc:`Â`,acirc:`â`,Atilde:`Ã`,atilde:`ã`,Auml:`Ä`,auml:`ä`,Aring:`Å`,aring:`å`,AElig:`Æ`,aelig:`æ`,Ccedil:`Ç`,ccedil:`ç`,Egrave:`È`,egrave:`è`,Eacute:`É`,eacute:`é`,Ecirc:`Ê`,ecirc:`ê`,Euml:`Ë`,euml:`ë`,Igrave:`Ì`,igrave:`ì`,Iacute:`Í`,iacute:`í`,Icirc:`Î`,icirc:`î`,Iuml:`Ï`,iuml:`ï`,ETH:`Ð`,eth:`ð`,Ntilde:`Ñ`,ntilde:`ñ`,Ograve:`Ò`,ograve:`ò`,Oacute:`Ó`,oacute:`ó`,Ocirc:`Ô`,ocirc:`ô`,Otilde:`Õ`,otilde:`õ`,Ouml:`Ö`,ouml:`ö`,Oslash:`Ø`,oslash:`ø`,Ugrave:`Ù`,ugrave:`ù`,Uacute:`Ú`,uacute:`ú`,Ucirc:`Û`,ucirc:`û`,Uuml:`Ü`,uuml:`ü`,Yacute:`Ý`,yacute:`ý`,THORN:`Þ`,thorn:`þ`,szlig:`ß`,yuml:`ÿ`,Yuml:`Ÿ`},pe={Amacr:`Ā`,amacr:`ā`,Abreve:`Ă`,abreve:`ă`,Aogon:`Ą`,aogon:`ą`,Cacute:`Ć`,cacute:`ć`,Ccirc:`Ĉ`,ccirc:`ĉ`,Cdot:`Ċ`,cdot:`ċ`,Ccaron:`Č`,ccaron:`č`,Dcaron:`Ď`,dcaron:`ď`,Dstrok:`Đ`,dstrok:`đ`,Emacr:`Ē`,emacr:`ē`,Ecaron:`Ě`,ecaron:`ě`,Edot:`Ė`,edot:`ė`,Eogon:`Ę`,eogon:`ę`,Gcirc:`Ĝ`,gcirc:`ĝ`,Gbreve:`Ğ`,gbreve:`ğ`,Gdot:`Ġ`,gdot:`ġ`,Gcedil:`Ģ`,Hcirc:`Ĥ`,hcirc:`ĥ`,Hstrok:`Ħ`,hstrok:`ħ`,Itilde:`Ĩ`,itilde:`ĩ`,Imacr:`Ī`,imacr:`ī`,Iogon:`Į`,iogon:`į`,Idot:`İ`,IJlig:`IJ`,ijlig:`ij`,Jcirc:`Ĵ`,jcirc:`ĵ`,Kcedil:`Ķ`,kcedil:`ķ`,kgreen:`ĸ`,Lacute:`Ĺ`,lacute:`ĺ`,Lcedil:`Ļ`,lcedil:`ļ`,Lcaron:`Ľ`,lcaron:`ľ`,Lmidot:`Ŀ`,lmidot:`ŀ`,Lstrok:`Ł`,lstrok:`ł`,Nacute:`Ń`,nacute:`ń`,Ncaron:`Ň`,ncaron:`ň`,Ncedil:`Ņ`,ncedil:`ņ`,ENG:`Ŋ`,eng:`ŋ`,Omacr:`Ō`,omacr:`ō`,Odblac:`Ő`,odblac:`ő`,OElig:`Œ`,oelig:`œ`,Racute:`Ŕ`,racute:`ŕ`,Rcaron:`Ř`,rcaron:`ř`,Rcedil:`Ŗ`,rcedil:`ŗ`,Sacute:`Ś`,sacute:`ś`,Scirc:`Ŝ`,scirc:`ŝ`,Scedil:`Ş`,scedil:`ş`,Scaron:`Š`,scaron:`š`,Tcedil:`Ţ`,tcedil:`ţ`,Tcaron:`Ť`,tcaron:`ť`,Tstrok:`Ŧ`,tstrok:`ŧ`,Utilde:`Ũ`,utilde:`ũ`,Umacr:`Ū`,umacr:`ū`,Ubreve:`Ŭ`,ubreve:`ŭ`,Uring:`Ů`,uring:`ů`,Udblac:`Ű`,udblac:`ű`,Uogon:`Ų`,uogon:`ų`,Wcirc:`Ŵ`,wcirc:`ŵ`,Ycirc:`Ŷ`,ycirc:`ŷ`,Zacute:`Ź`,zacute:`ź`,Zdot:`Ż`,zdot:`ż`,Zcaron:`Ž`,zcaron:`ž`},me={Alpha:`Α`,alpha:`α`,Beta:`Β`,beta:`β`,Gamma:`Γ`,gamma:`γ`,Delta:`Δ`,delta:`δ`,Epsilon:`Ε`,epsilon:`ε`,epsiv:`ϵ`,varepsilon:`ϵ`,Zeta:`Ζ`,zeta:`ζ`,Eta:`Η`,eta:`η`,Theta:`Θ`,theta:`θ`,thetasym:`ϑ`,vartheta:`ϑ`,Iota:`Ι`,iota:`ι`,Kappa:`Κ`,kappa:`κ`,kappav:`ϰ`,varkappa:`ϰ`,Lambda:`Λ`,lambda:`λ`,Mu:`Μ`,mu:`μ`,Nu:`Ν`,nu:`ν`,Xi:`Ξ`,xi:`ξ`,Omicron:`Ο`,omicron:`ο`,Pi:`Π`,pi:`π`,piv:`ϖ`,varpi:`ϖ`,Rho:`Ρ`,rho:`ρ`,rhov:`ϱ`,varrho:`ϱ`,Sigma:`Σ`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,varsigma:`ς`,Tau:`Τ`,tau:`τ`,Upsilon:`Υ`,upsilon:`υ`,upsi:`υ`,Upsi:`ϒ`,upsih:`ϒ`,Phi:`Φ`,phi:`φ`,phiv:`ϕ`,varphi:`ϕ`,Chi:`Χ`,chi:`χ`,Psi:`Ψ`,psi:`ψ`,Omega:`Ω`,omega:`ω`,ohm:`Ω`,Gammad:`Ϝ`,gammad:`ϝ`,digamma:`ϝ`},he={Afr:`𝔄`,afr:`𝔞`,Acy:`А`,acy:`а`,Bcy:`Б`,bcy:`б`,Vcy:`В`,vcy:`в`,Gcy:`Г`,gcy:`г`,Dcy:`Д`,dcy:`д`,IEcy:`Е`,iecy:`е`,IOcy:`Ё`,iocy:`ё`,ZHcy:`Ж`,zhcy:`ж`,Zcy:`З`,zcy:`з`,Icy:`И`,icy:`и`,Jcy:`Й`,jcy:`й`,Kcy:`К`,kcy:`к`,Lcy:`Л`,lcy:`л`,Mcy:`М`,mcy:`м`,Ncy:`Н`,ncy:`н`,Ocy:`О`,ocy:`о`,Pcy:`П`,pcy:`п`,Rcy:`Р`,rcy:`р`,Scy:`С`,scy:`с`,Tcy:`Т`,tcy:`т`,Ucy:`У`,ucy:`у`,Fcy:`Ф`,fcy:`ф`,KHcy:`Х`,khcy:`х`,TScy:`Ц`,tscy:`ц`,CHcy:`Ч`,chcy:`ч`,SHcy:`Ш`,shcy:`ш`,SHCHcy:`Щ`,shchcy:`щ`,HARDcy:`Ъ`,hardcy:`ъ`,Ycy:`Ы`,ycy:`ы`,SOFTcy:`Ь`,softcy:`ь`,Ecy:`Э`,ecy:`э`,YUcy:`Ю`,yucy:`ю`,YAcy:`Я`,yacy:`я`,DJcy:`Ђ`,djcy:`ђ`,GJcy:`Ѓ`,gjcy:`ѓ`,Jukcy:`Є`,jukcy:`є`,DScy:`Ѕ`,dscy:`ѕ`,Iukcy:`І`,iukcy:`і`,YIcy:`Ї`,yicy:`ї`,Jsercy:`Ј`,jsercy:`ј`,LJcy:`Љ`,ljcy:`љ`,NJcy:`Њ`,njcy:`њ`,TSHcy:`Ћ`,tshcy:`ћ`,KJcy:`Ќ`,kjcy:`ќ`,Ubrcy:`Ў`,ubrcy:`ў`,DZcy:`Џ`,dzcy:`џ`},ge={plus:`+`,pm:`±`,times:`×`,div:`÷`,divide:`÷`,sdot:`⋅`,star:`☆`,starf:`★`,bigstar:`★`,lowast:`∗`,ast:`*`,midast:`*`,compfn:`∘`,smallcircle:`∘`,bullet:`•`,bull:`•`,nbsp:`\xA0`,hellip:`…`,mldr:`…`,prime:`′`,Prime:`″`,tprime:`‴`,bprime:`‵`,backprime:`‵`,minus:`−`,minusd:`∸`,dotminus:`∸`,plusdo:`∔`,dotplus:`∔`,plusmn:`±`,minusplus:`∓`,mnplus:`∓`,mp:`∓`,setminus:`∖`,smallsetminus:`∖`,Backslash:`∖`,setmn:`∖`,ssetmn:`∖`,lowbar:`_`,verbar:`|`,vert:`|`,VerticalLine:`|`,colon:`:`,Colon:`∷`,Proportion:`∷`,ratio:`∶`,equals:`=`,ne:`≠`,nequiv:`≢`,equiv:`≡`,Congruent:`≡`,sim:`∼`,thicksim:`∼`,thksim:`∼`,sime:`≃`,simeq:`≃`,TildeEqual:`≃`,asymp:`≈`,approx:`≈`,thickapprox:`≈`,thkap:`≈`,TildeTilde:`≈`,ncong:`≇`,cong:`≅`,TildeFullEqual:`≅`,asympeq:`≍`,CupCap:`≍`,bump:`≎`,Bumpeq:`≎`,HumpDownHump:`≎`,bumpe:`≏`,bumpeq:`≏`,HumpEqual:`≏`,le:`≤`,LessEqual:`≤`,ge:`≥`,GreaterEqual:`≥`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,greater:`>`,less:`<`},_e={alefsym:`ℵ`,aleph:`ℵ`,beth:`ℶ`,gimel:`ℷ`,daleth:`ℸ`,forall:`∀`,ForAll:`∀`,part:`∂`,PartialD:`∂`,exist:`∃`,Exists:`∃`,nexist:`∄`,nexists:`∄`,empty:`∅`,emptyset:`∅`,emptyv:`∅`,varnothing:`∅`,nabla:`∇`,Del:`∇`,isin:`∈`,isinv:`∈`,in:`∈`,Element:`∈`,notin:`∉`,notinva:`∉`,ni:`∋`,niv:`∋`,SuchThat:`∋`,ReverseElement:`∋`,notni:`∌`,notniva:`∌`,prod:`∏`,Product:`∏`,coprod:`∐`,Coproduct:`∐`,sum:`∑`,Sum:`∑`,minus:`−`,mp:`∓`,plusdo:`∔`,dotplus:`∔`,setminus:`∖`,lowast:`∗`,radic:`√`,Sqrt:`√`,prop:`∝`,propto:`∝`,Proportional:`∝`,varpropto:`∝`,infin:`∞`,infintie:`⧝`,ang:`∠`,angle:`∠`,angmsd:`∡`,measuredangle:`∡`,angsph:`∢`,mid:`∣`,VerticalBar:`∣`,nmid:`∤`,nsmid:`∤`,npar:`∦`,parallel:`∥`,spar:`∥`,nparallel:`∦`,nspar:`∦`,and:`∧`,wedge:`∧`,or:`∨`,vee:`∨`,cap:`∩`,cup:`∪`,int:`∫`,Integral:`∫`,conint:`∮`,ContourIntegral:`∮`,Conint:`∯`,DoubleContourIntegral:`∯`,Cconint:`∰`,there4:`∴`,therefore:`∴`,Therefore:`∴`,becaus:`∵`,because:`∵`,Because:`∵`,ratio:`∶`,Proportion:`∷`,minusd:`∸`,dotminus:`∸`,mDDot:`∺`,homtht:`∻`,sim:`∼`,bsimg:`∽`,backsim:`∽`,ac:`∾`,mstpos:`∾`,acd:`∿`,VerticalTilde:`≀`,wr:`≀`,wreath:`≀`,nsime:`≄`,nsimeq:`≄`,ncong:`≇`,simne:`≆`,ncongdot:`⩭̸`,ngsim:`≵`,nsim:`≁`,napprox:`≉`,nap:`≉`,ngeq:`≱`,nge:`≱`,nleq:`≰`,nle:`≰`,ngtr:`≯`,ngt:`≯`,nless:`≮`,nlt:`≮`,nprec:`⊀`,npr:`⊀`,nsucc:`⊁`,nsc:`⊁`},ve={larr:`←`,leftarrow:`←`,LeftArrow:`←`,uarr:`↑`,uparrow:`↑`,UpArrow:`↑`,rarr:`→`,rightarrow:`→`,RightArrow:`→`,darr:`↓`,downarrow:`↓`,DownArrow:`↓`,harr:`↔`,leftrightarrow:`↔`,LeftRightArrow:`↔`,varr:`↕`,updownarrow:`↕`,UpDownArrow:`↕`,nwarr:`↖`,nwarrow:`↖`,UpperLeftArrow:`↖`,nearr:`↗`,nearrow:`↗`,UpperRightArrow:`↗`,searr:`↘`,searrow:`↘`,LowerRightArrow:`↘`,swarr:`↙`,swarrow:`↙`,LowerLeftArrow:`↙`,lArr:`⇐`,Leftarrow:`⇐`,uArr:`⇑`,Uparrow:`⇑`,rArr:`⇒`,Rightarrow:`⇒`,dArr:`⇓`,Downarrow:`⇓`,hArr:`⇔`,Leftrightarrow:`⇔`,iff:`⇔`,vArr:`⇕`,Updownarrow:`⇕`,lAarr:`⇚`,Lleftarrow:`⇚`,rAarr:`⇛`,Rrightarrow:`⇛`,lrarr:`⇆`,leftrightarrows:`⇆`,rlarr:`⇄`,rightleftarrows:`⇄`,lrhar:`⇋`,leftrightharpoons:`⇋`,ReverseEquilibrium:`⇋`,rlhar:`⇌`,rightleftharpoons:`⇌`,Equilibrium:`⇌`,udarr:`⇅`,UpArrowDownArrow:`⇅`,duarr:`⇵`,DownArrowUpArrow:`⇵`,llarr:`⇇`,leftleftarrows:`⇇`,rrarr:`⇉`,rightrightarrows:`⇉`,ddarr:`⇊`,downdownarrows:`⇊`,har:`↽`,lhard:`↽`,leftharpoondown:`↽`,lharu:`↼`,leftharpoonup:`↼`,rhard:`⇁`,rightharpoondown:`⇁`,rharu:`⇀`,rightharpoonup:`⇀`,lsh:`↰`,Lsh:`↰`,rsh:`↱`,Rsh:`↱`,ldsh:`↲`,rdsh:`↳`,hookleftarrow:`↩`,hookrightarrow:`↪`,mapstoleft:`↤`,mapstoup:`↥`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,crarr:`↵`,nleftarrow:`↚`,nleftrightarrow:`↮`,nrightarrow:`↛`,nrarr:`↛`,larrtl:`↢`,rarrtl:`↣`,leftarrowtail:`↢`,rightarrowtail:`↣`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,Larr:`↞`,Rarr:`↠`,larrhk:`↩`,rarrhk:`↪`,larrlp:`↫`,looparrowleft:`↫`,rarrlp:`↬`,looparrowright:`↬`,harrw:`↭`,leftrightsquigarrow:`↭`,nrarrw:`↝̸`,rarrw:`↝`,rightsquigarrow:`↝`,larrbfs:`⤟`,rarrbfs:`⤠`,nvHarr:`⤄`,nvlArr:`⤂`,nvrArr:`⤃`,larrfs:`⤝`,rarrfs:`⤞`,Map:`⤅`,larrsim:`⥳`,rarrsim:`⥴`,harrcir:`⥈`,Uarrocir:`⥉`,lurdshar:`⥊`,ldrdhar:`⥧`,ldrushar:`⥋`,rdldhar:`⥩`,lrhard:`⥭`,uharr:`↾`,uharl:`↿`,dharr:`⇂`,dharl:`⇃`,Uarr:`↟`,Darr:`↡`,zigrarr:`⇝`,nwArr:`⇖`,neArr:`⇗`,seArr:`⇘`,swArr:`⇙`,nharr:`↮`,nhArr:`⇎`,nlarr:`↚`,nlArr:`⇍`,nrArr:`⇏`,larrb:`⇤`,LeftArrowBar:`⇤`,rarrb:`⇥`,RightArrowBar:`⇥`},ye={square:`□`,Square:`□`,squ:`□`,squf:`▪`,squarf:`▪`,blacksquar:`▪`,blacksquare:`▪`,FilledVerySmallSquare:`▪`,blk34:`▓`,blk12:`▒`,blk14:`░`,block:`█`,srect:`▭`,rect:`▭`,sdot:`⋅`,sdotb:`⊡`,dotsquare:`⊡`,triangle:`▵`,tri:`▵`,trine:`▵`,utri:`▵`,triangledown:`▿`,dtri:`▿`,tridown:`▿`,triangleleft:`◃`,ltri:`◃`,triangleright:`▹`,rtri:`▹`,blacktriangle:`▴`,utrif:`▴`,blacktriangledown:`▾`,dtrif:`▾`,blacktriangleleft:`◂`,ltrif:`◂`,blacktriangleright:`▸`,rtrif:`▸`,loz:`◊`,lozenge:`◊`,blacklozenge:`⧫`,lozf:`⧫`,bigcirc:`◯`,xcirc:`◯`,circ:`ˆ`,Circle:`○`,cir:`○`,o:`○`,bullet:`•`,bull:`•`,hellip:`…`,mldr:`…`,nldr:`‥`,boxh:`─`,HorizontalLine:`─`,boxv:`│`,boxdr:`┌`,boxdl:`┐`,boxur:`└`,boxul:`┘`,boxvr:`├`,boxvl:`┤`,boxhd:`┬`,boxhu:`┴`,boxvh:`┼`,boxH:`═`,boxV:`║`,boxdR:`╒`,boxDr:`╓`,boxDR:`╔`,boxDl:`╕`,boxdL:`╖`,boxDL:`╗`,boxuR:`╘`,boxUr:`╙`,boxUR:`╚`,boxUl:`╜`,boxuL:`╛`,boxUL:`╝`,boxvR:`╞`,boxVr:`╟`,boxVR:`╠`,boxVl:`╢`,boxvL:`╡`,boxVL:`╣`,boxHd:`╤`,boxhD:`╥`,boxHD:`╦`,boxHu:`╧`,boxhU:`╨`,boxHU:`╩`,boxvH:`╪`,boxVh:`╫`,boxVH:`╬`},be={excl:`!`,iexcl:`¡`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,nbsp:`\xA0`,comma:`,`,period:`.`,colon:`:`,semi:`;`,vert:`|`,Verbar:`‖`,verbar:`|`,dblac:`˝`,circ:`ˆ`,caron:`ˇ`,breve:`˘`,dot:`˙`,ring:`˚`,ogon:`˛`,tilde:`˜`,DiacriticalGrave:"`",DiacriticalAcute:`´`,DiacriticalTilde:`˜`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,grave:"`"},xe={cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,euro:`€`,dollar:`$`,fnof:`ƒ`,inr:`₹`,af:`؋`,birr:`ብር`,peso:`₱`,rub:`₽`,won:`₩`,yuan:`¥`,cedil:`¸`},Se={frac12:`½`,half:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`},Ce={trade:`™`,TRADE:`™`,telrec:`⌕`,target:`⌖`,ulcorn:`⌜`,ulcorner:`⌜`,urcorn:`⌝`,urcorner:`⌝`,dlcorn:`⌞`,llcorner:`⌞`,drcorn:`⌟`,lrcorner:`⌟`,intercal:`⊺`,intcal:`⊺`,oplus:`⊕`,CirclePlus:`⊕`,ominus:`⊖`,CircleMinus:`⊖`,otimes:`⊗`,CircleTimes:`⊗`,osol:`⊘`,odot:`⊙`,CircleDot:`⊙`,oast:`⊛`,circledast:`⊛`,odash:`⊝`,circleddash:`⊝`,ocirc:`⊚`,circledcirc:`⊚`,boxplus:`⊞`,plusb:`⊞`,boxminus:`⊟`,minusb:`⊟`,boxtimes:`⊠`,timesb:`⊠`,boxdot:`⊡`,sdotb:`⊡`,veebar:`⊻`,vee:`∨`,barvee:`⊽`,and:`∧`,wedge:`∧`,Cap:`⋒`,Cup:`⋓`,Fork:`⋔`,pitchfork:`⋔`,epar:`⋕`,ltlarr:`⥶`,nvap:`≍⃒`,nvsim:`∼⃒`,nvge:`≥⃒`,nvle:`≤⃒`,nvlt:`<⃒`,nvgt:`>⃒`,nvltrie:`⊴⃒`,nvrtrie:`⊵⃒`,Vdash:`⊩`,dashv:`⊣`,vDash:`⊨`,Vvdash:`⊪`,nvdash:`⊬`,nvDash:`⊭`,nVdash:`⊮`,nVDash:`⊯`};({...de,...fe,...pe,...me,...he,...ge,..._e,...ve,...ye,...be,...xe,...Se,...Ce});var we={amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`},Te={nbsp:`\xA0`,copy:`©`,reg:`®`,trade:`™`,mdash:`—`,ndash:`–`,hellip:`…`,laquo:`«`,raquo:`»`,lsquo:`‘`,rsquo:`’`,ldquo:`“`,rdquo:`”`,bull:`•`,para:`¶`,sect:`§`,deg:`°`,frac12:`½`,frac14:`¼`,frac34:`¾`},x=Object.freeze({ALLOW:`allow`,BLOCK:`block`,THROW:`throw`}),Ee=new Set(`!?\\\\/[]$%{}^&*()<>|+`);function De(e){if(e[0]===`#`)throw Error(`[EntityReplacer] Invalid character '#' in entity name: "${e}"`);for(let t of e)if(Ee.has(t))throw Error(`[EntityReplacer] Invalid character '${t}' in entity name: "${e}"`);return e}function S(...e){let t=Object.create(null);for(let n of e)if(n)for(let e of Object.keys(n)){let r=n[e];if(typeof r==`string`)t[e]=r;else if(r&&typeof r==`object`&&r.val!==void 0){let n=r.val;typeof n==`string`&&(t[e]=n)}}return t}var C=`external`,w=`base`,Oe=`all`;function ke(e){return!e||e===C?new Set([C]):e===Oe?new Set([Oe]):e===w?new Set([w]):Array.isArray(e)?new Set(e):new Set([C])}var T=Object.freeze({allow:0,leave:1,remove:2,throw:3}),Ae=new Set([9,10,13]);function je(e){if(!e)return{xmlVersion:1,onLevel:T.allow,nullLevel:T.remove};let t=e.xmlVersion===1.1?1.1:1,n=T[e.onNCR]??T.allow,r=T[e.nullNCR]??T.remove;return{xmlVersion:t,onLevel:n,nullLevel:Math.max(r,T.remove)}}var Me=class{constructor(e={}){this._limit=e.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof e.postCheck==`function`?e.postCheck:e=>e,this._limitTiers=ke(this._limit.applyLimitsTo??C),this._numericAllowed=e.numericAllowed??!0,this._baseMap=S(we,e.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(e.remove&&Array.isArray(e.remove)?e.remove:[]),this._leaveSet=new Set(e.leave&&Array.isArray(e.leave)?e.leave:[]);let t=je(e.ncr);this._ncrXmlVersion=t.xmlVersion,this._ncrOnLevel=t.onLevel,this._ncrNullLevel=t.nullLevel,this._onExternalEntity=typeof e.onExternalEntity==`function`?e.onExternalEntity:null,this._onInputEntity=typeof e.onInputEntity==`function`?e.onInputEntity:null}_applyRegistrationHook(e,t,n,r){if(!e)return!0;let i=e(t,n);if(i===x.BLOCK)return!1;if(i===x.THROW)throw Error(`[EntityDecoder] Registration of ${r} entity "&${t};" was rejected by hook`);return!0}setExternalEntities(e){if(e)for(let t of Object.keys(e))De(t);if(!this._onExternalEntity){this._externalMap=S(e);return}let t=S(e),n=Object.create(null);for(let[e,r]of Object.entries(t))this._applyRegistrationHook(this._onExternalEntity,e,r,`external`)&&(n[e]=r);this._externalMap=n}addExternalEntity(e,t){De(e),typeof t==`string`&&t.indexOf(`&`)===-1&&this._applyRegistrationHook(this._onExternalEntity,e,t,`external`)&&(this._externalMap[e]=t)}addInputEntities(e){if(this._totalExpansions=0,this._expandedLength=0,!this._onInputEntity){this._inputMap=S(e);return}let t=S(e),n=Object.create(null);for(let[e,r]of Object.entries(t))this._applyRegistrationHook(this._onInputEntity,e,r,`input`)&&(n[e]=r);this._inputMap=n}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(e){this._ncrXmlVersion=e===1.1?1.1:1}decode(e){if(typeof e!=`string`||e.length===0||e.indexOf(`&`)===-1)return e;let t=e,n=[],r=e.length,i=0,a=0,o=this._maxTotalExpansions>0,s=this._maxExpandedLength>0,c=o||s;for(;a<r;){if(e.charCodeAt(a)!==38){a++;continue}let t=a+1;for(;t<r&&e.charCodeAt(t)!==59&&t-a<=32;)t++;if(t>=r||e.charCodeAt(t)!==59){a++;continue}let l=e.slice(a+1,t);if(l.length===0){a++;continue}let u,d;if(this._removeSet.has(l))u=``,d===void 0&&(d=C);else if(this._leaveSet.has(l)){a++;continue}else if(l.charCodeAt(0)===35){let e=this._resolveNCR(l);if(e===void 0){a++;continue}u=e,d=w}else{let e=this._resolveName(l);u=e?.value,d=e?.tier}if(u===void 0){a++;continue}if(a>i&&n.push(e.slice(i,a)),n.push(u),i=t+1,a=i,c&&this._tierCounts(d)){if(o&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(s){let e=u.length-(l.length+2);if(e>0&&(this._expandedLength+=e,this._expandedLength>this._maxExpandedLength))throw Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}i<r&&n.push(e.slice(i));let l=n.length===0?e:n.join(``);return this._postCheck(l,t)}_tierCounts(e){return this._limitTiers.has(Oe)?!0:this._limitTiers.has(e)}_resolveName(e){if(e in this._inputMap)return{value:this._inputMap[e],tier:C};if(e in this._externalMap)return{value:this._externalMap[e],tier:C};if(e in this._baseMap)return{value:this._baseMap[e],tier:w}}_classifyNCR(e){return e===0?this._ncrNullLevel:e>=55296&&e<=57343||this._ncrXmlVersion===1&&e>=1&&e<=31&&!Ae.has(e)?T.remove:-1}_applyNCRAction(e,t,n){switch(e){case T.allow:return String.fromCodePoint(n);case T.remove:return``;case T.leave:return;case T.throw:throw Error(`[EntityDecoder] Prohibited numeric character reference &${t}; (U+${n.toString(16).toUpperCase().padStart(4,`0`)})`);default:return String.fromCodePoint(n)}}_resolveNCR(e){let t=e.charCodeAt(1),n;if(n=t===120||t===88?parseInt(e.slice(2),16):parseInt(e.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;let r=this._classifyNCR(n);if(!this._numericAllowed&&r<T.remove)return;let i=r===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,r);return this._applyNCRAction(i,e,n)}},Ne=e=>p.includes(e)?`__`+e:e,Pe={preserveOrder:!1,attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0,unicode:!1},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:Ne};function Fe(e,t){if(typeof e!=`string`)return;let n=e.toLowerCase();if(p.some(e=>n===e.toLowerCase())||m.some(e=>n===e.toLowerCase()))throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function Ie(e,t){return typeof e==`boolean`?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:`all`}:typeof e==`object`&&e?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??1e3),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null,appliesTo:e.appliesTo??`all`}:Ie(!0)}var Le=function(e){let t=Object.assign({},Pe,e),n=[{value:t.attributeNamePrefix,name:`attributeNamePrefix`},{value:t.attributesGroupName,name:`attributesGroupName`},{value:t.textNodeName,name:`textNodeName`},{value:t.cdataPropName,name:`cdataPropName`},{value:t.commentPropName,name:`commentPropName`}];for(let{value:e,name:t}of n)e&&Fe(e,t);return t.onDangerousProperty===null&&(t.onDangerousProperty=Ne),t.processEntities=Ie(t.processEntities,t.htmlEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),t},Re=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`,E=class{constructor(e){this.tagname=e,this.child=[],this[`:@`]=Object.create(null)}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][Re]={startIndex:t})}static getMetaDataSymbol(){return Re}},ze=`:A-Za-z_À-ÖØ-öø-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�`,Be=`:A-Za-z_À-ÖØ-öø-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\\-\\.\\d·̀-ͯ‿-⁀`,Ve=`:A-Za-z_À-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿`,He=`:A-Za-z_À-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿\\-\\.\\d·̀-ͯ҇‿-⁀`,D=(e,t,n=``)=>{let r=`[${e.replace(`:`,``)}][${t.replace(`:`,``)}]*`;return{name:RegExp(`^[${e}][${t}]*$`,n),ncName:RegExp(`^${r}$`,n),qName:RegExp(`^${r}(?::${r})?$`,n),nmToken:RegExp(`^[${t}]+$`,n),nmTokens:RegExp(`^[${t}]+(?:\\s+[${t}]+)*$`,n)}},Ue=D(ze,Be),We=D(Ve,He,`u`),Ge=D(`:A-Za-z_`,`:A-Za-z_\\-\\.\\d`),Ke=(e=`1.0`,t=!1)=>t?Ge:e===`1.1`?We:Ue,qe=(e,{xmlVersion:t=`1.0`,asciiOnly:n=!1}={})=>Ke(t,n).qName.test(e),Je=[`name`,`ncName`,`qName`,`nmToken`,`nmTokens`],Ye=(e,{xmlVersion:t=`1.0`,asciiOnly:n=!1,maxCacheSize:r=2048}={})=>{if(!Je.includes(e))throw TypeError(`Unknown production "${e}". Must be one of: ${Je.join(`, `)}`);let i=Ke(t,n)[e],a=new Map,o=e=>{let t=a.get(e);if(t!==void 0)return t;let n=i.test(e);return a.size<r&&a.set(e,n),n};return o.reset=()=>{a=new Map},o},Xe=class{constructor(e,t){this.suppressValidationErr=!e,this.options=e,this.xmlVersion=t||1}setXmlVersion(e=1){this.xmlVersion=e}readDocType(e,t){let n=Object.create(null),r=0;if(e[t+3]===`O`&&e[t+4]===`C`&&e[t+5]===`T`&&e[t+6]===`Y`&&e[t+7]===`P`&&e[t+8]===`E`){t+=9;let i=1,a=!1,o=!1,s=``;for(;t<e.length;t++)if(e[t]===`<`&&!o){if(a&&k(e,`!ENTITY`,t)){t+=7;let i,a;if([i,a,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),a.indexOf(`&`)===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&r>=this.options.maxEntityCount)throw Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);n[i]=a,r++}}else if(a&&k(e,`!ELEMENT`,t)){t+=8;let{index:n}=this.readElementExp(e,t+1);t=n}else if(a&&k(e,`!ATTLIST`,t))t+=8;else if(a&&k(e,`!NOTATION`,t)){t+=9;let{index:n}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=n}else if(k(e,`!--`,t))o=!0;else throw Error(`Invalid DOCTYPE`);i++,s=``}else if(e[t]===`>`){if(o?e[t-1]===`-`&&e[t-2]===`-`&&(o=!1,i--):i--,i===0)break}else e[t]===`[`?a=!0:s+=e[t];if(i!==0)throw Error(`Unclosed DOCTYPE`)}else throw Error(`Invalid Tag instead of DOCTYPE`);return{entities:n,i:t}}readEntityExp(e,t){t=O(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t])&&e[t]!==`"`&&e[t]!==`'`;)t++;let r=e.substring(n,t);if(A(r,{xmlVersion:this.xmlVersion}),t=O(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()===`SYSTEM`)throw Error(`External entities are not supported`);if(e[t]===`%`)throw Error(`Parameter entities are not supported`)}let i=``;if([t,i]=this.readIdentifierVal(e,t,`entity`),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&i.length>this.options.maxEntitySize)throw Error(`Entity "${r}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return t--,[r,i,t]}readNotationExp(e,t){t=O(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);!this.suppressValidationErr&&A(r,{xmlVersion:this.xmlVersion}),t=O(e,t);let i=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&i!==`SYSTEM`&&i!==`PUBLIC`)throw Error(`Expected SYSTEM or PUBLIC, found "${i}"`);t+=i.length,t=O(e,t);let a=null,o=null;if(i===`PUBLIC`)[t,a]=this.readIdentifierVal(e,t,`publicIdentifier`),t=O(e,t),(e[t]===`"`||e[t]===`'`)&&([t,o]=this.readIdentifierVal(e,t,`systemIdentifier`));else if(i===`SYSTEM`&&([t,o]=this.readIdentifierVal(e,t,`systemIdentifier`),!this.suppressValidationErr&&!o))throw Error(`Missing mandatory system identifier for SYSTEM notation`);return{notationName:r,publicIdentifier:a,systemIdentifier:o,index:--t}}readIdentifierVal(e,t,n){let r=``,i=e[t];if(i!==`"`&&i!==`'`)throw Error(`Expected quoted string, found "${i}"`);t++;let a=t;for(;t<e.length&&e[t]!==i;)t++;if(r=e.substring(a,t),e[t]!==i)throw Error(`Unterminated ${n} value`);return t++,[t,r]}readElementExp(e,t){t=O(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);if(!this.suppressValidationErr&&!qe(r,{xmlVersion:this.xmlVersion}))throw Error(`Invalid element name: "${r}"`);t=O(e,t);let i=``;if(e[t]===`E`&&k(e,`MPTY`,t))t+=4;else if(e[t]===`A`&&k(e,`NY`,t))t+=2;else if(e[t]===`(`){t++;let n=t;for(;t<e.length&&e[t]!==`)`;)t++;if(i=e.substring(n,t),e[t]!==`)`)throw Error(`Unterminated content model`)}else if(!this.suppressValidationErr)throw Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:r,contentModel:i.trim(),index:t}}readAttlistExp(e,t){t=O(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);for(A(r,{xmlVersion:this.xmlVersion}),t=O(e,t),n=t;t<e.length&&!/\s/.test(e[t]);)t++;let i=e.substring(n,t);if(!A(i,{xmlVersion:this.xmlVersion}))throw Error(`Invalid attribute name: "${i}"`);t=O(e,t);let a=``;if(e.substring(t,t+8).toUpperCase()===`NOTATION`){if(a=`NOTATION`,t+=8,t=O(e,t),e[t]!==`(`)throw Error(`Expected '(', found "${e[t]}"`);t++;let n=[];for(;t<e.length&&e[t]!==`)`;){let r=t;for(;t<e.length&&e[t]!==`|`&&e[t]!==`)`;)t++;let i=e.substring(r,t);if(i=i.trim(),!A(i,{xmlVersion:this.xmlVersion}))throw Error(`Invalid notation name: "${i}"`);n.push(i),e[t]===`|`&&(t++,t=O(e,t))}if(e[t]!==`)`)throw Error(`Unterminated list of notations`);t++,a+=` (`+n.join(`|`)+`)`}else{let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;if(a+=e.substring(n,t),!this.suppressValidationErr&&![`CDATA`,`ID`,`IDREF`,`IDREFS`,`ENTITY`,`ENTITIES`,`NMTOKEN`,`NMTOKENS`].includes(a.toUpperCase()))throw Error(`Invalid attribute type: "${a}"`)}t=O(e,t);let o=``;return e.substring(t,t+8).toUpperCase()===`#REQUIRED`?(o=`#REQUIRED`,t+=8):e.substring(t,t+7).toUpperCase()===`#IMPLIED`?(o=`#IMPLIED`,t+=7):[t,o]=this.readIdentifierVal(e,t,`ATTLIST`),{elementName:r,attributeName:i,attributeType:a,defaultValue:o,index:t}}},O=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function k(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function A(e,t){if(qe(e,{xmlVersion:t}))return e;throw Error(`Invalid entity name ${e}`)}var Ze=[48,1632,1776,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,65296,120782,120792,120802,120812,120822,66720,68912,69734,69872,69942,70096,70384,70736,70864,71248,71360,71472,71904,72016,72688,72784,73040,73120,73552,92768,92864,93008,123200,123632,124144,125264,130032],Qe=new Map,$e=65535,et=1632,tt=new Uint8Array(63904).fill(255);for(let e of Ze)for(let t=0;t<10;t++){let n=e+t;n<=$e?tt[n-et]=t:Qe.set(n,t)}var nt=48,rt=57,it=45,j=new Set([8722,65293,65123]);function at(e){if(typeof e!=`string`)return e;let t=e.length;if(t===0)return e;let n=-1;for(let r=0;r<t;r++){let i=e.charCodeAt(r);if(!(i>=nt&&i<=rt||i===it)){if(i<1632){if(j.has(i)){n=r;break}continue}if(i>=55296&&i<=56319){if(r+1<t){let t=e.charCodeAt(r+1);if(t>=56320&&t<=57343){let e=65536+(i-55296<<10)+(t-56320);if(Qe.has(e)){n=r;break}}}continue}if(tt[i-1632]!==255||j.has(i)){n=r;break}}}if(n===-1)return e;let r=[];n>0&&r.push(e.slice(0,n));for(let i=n;i<t;i++){let n=e.charCodeAt(i);if(n>=nt&&n<=rt||n===it){r.push(e[i]);continue}if(n<1632){r.push(j.has(n)?`-`:e[i]);continue}if(n>=55296&&n<=56319){if(i+1<t){let t=e.charCodeAt(i+1);if(t>=56320&&t<=57343){let e=65536+(n-55296<<10)+(t-56320),a=Qe.get(e);if(a!==void 0){r.push(String.fromCharCode(a+48)),i++;continue}}}r.push(e[i]);continue}if(j.has(n)){r.push(`-`);continue}let a=tt[n-et];r.push(a===255?e[i]:String.fromCharCode(a+48))}return r.join(``)}var ot=/^[-+]?0x[a-fA-F0-9]+$/,st=/^0b[01]+$/,ct=/^0o[0-7]+$/,lt=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,ut={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:`.`,eNotation:!0,infinity:`original`,unicode:!1};function dt(e,t={}){if(t=Object.assign({},ut,t),!e||typeof e!=`string`)return e;let n=e.trim();if(n.length===0||t.skipLike!==void 0&&t.skipLike.test(n))return e;if(n===`0`||t.unicode&&(n=at(n),n===`0`))return 0;if(t.hex&&ot.test(n))return ht(n,16);if(t.binary&&st.test(n))return ht(n,2);if(t.octal&&ct.test(n))return ht(n,8);if(!isFinite(n))return gt(e,Number(n),t);if(n.includes(`e`)||n.includes(`E`))return pt(e,n,t);{let r=lt.exec(n);if(r){let i=r[1]||``,a=r[2],o=mt(r[3]),s=i?e[a.length+1]===`.`:e[a.length]===`.`;if(!t.leadingZeros&&(a.length>1||a.length===1&&!s))return e;{let r=Number(n),s=String(r);if(r===0)return r;if(s.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return s===`0`||s===o||s===`${i}${o}`?r:e;let c=a?o:n;return a?c===s||i+c===s?r:e:c===s||c===i+s?r:e}}else return e}}var ft=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function pt(e,t,n){if(!n.eNotation)return e;let r=t.match(ft);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:o.length===1&&(r[3].startsWith(`.${a}`)||r[3][0]===a)?Number(t):o.length>0?n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e:Number(t)}else return e}function mt(e){return e&&e.indexOf(`.`)!==-1?(e=e.replace(/0+$/,``),e===`.`?e=`0`:e[0]===`.`?e=`0`+e:e[e.length-1]===`.`&&(e=e.substring(0,e.length-1)),e):e}function ht(e,t){let n=e.trim();if((t===2||t===8)&&(e=n.substring(2)),parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}function gt(e,t,n){let r=t===1/0;switch(n.infinity.toLowerCase()){case`null`:return null;case`infinity`:return t;case`string`:return r?`Infinity`:`-Infinity`;default:return e}}function _t(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var M=class{constructor(e,t={},n){this.pattern=e,this.separator=t.separator||`.`,this.segments=this._parse(e),this.data=n,this._hasDeepWildcard=this.segments.some(e=>e.type===`deep-wildcard`),this._hasAttributeCondition=this.segments.some(e=>e.attrName!==void 0),this._hasPositionSelector=this.segments.some(e=>e.position!==void 0)}_parse(e){let t=[],n=0,r=``;for(;n<e.length;)e[n]===this.separator?n+1<e.length&&e[n+1]===this.separator?(r.trim()&&(t.push(this._parseSegment(r.trim())),r=``),t.push({type:`deep-wildcard`}),n+=2):(r.trim()&&t.push(this._parseSegment(r.trim())),r=``,n++):(r+=e[n],n++);return r.trim()&&t.push(this._parseSegment(r.trim())),t}_parseSegment(e){let t={type:`tag`},n=null,r=e,i=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(i&&(r=i[1]+i[3],i[2])){let e=i[2].slice(1,-1);e&&(n=e)}let a,o=r;if(r.includes(`::`)){let t=r.indexOf(`::`);if(a=r.substring(0,t).trim(),o=r.substring(t+2).trim(),!a)throw Error(`Invalid namespace in pattern: ${e}`)}let s,c=null;if(o.includes(`:`)){let e=o.lastIndexOf(`:`),t=o.substring(0,e).trim(),n=o.substring(e+1).trim();[`first`,`last`,`odd`,`even`].includes(n)||/^nth\(\d+\)$/.test(n)?(s=t,c=n):s=o}else s=o;if(!s)throw Error(`Invalid segment pattern: ${e}`);if(t.tag=s,a&&(t.namespace=a),n)if(n.includes(`=`)){let e=n.indexOf(`=`);t.attrName=n.substring(0,e).trim(),t.attrValue=n.substring(e+1).trim()}else t.attrName=n.trim();if(c){let e=c.match(/^nth\((\d+)\)$/);e?(t.position=`nth`,t.positionValue=parseInt(e[1],10)):t.position=c}return t}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}},vt=class{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._deepByTerminalTag=new Map,this._patterns=new Set,this._sealed=!1}add(e){if(this._sealed)throw TypeError(`ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.`);if(this._patterns.has(e.pattern))return this;if(this._patterns.add(e.pattern),e.hasDeepWildcard()){let t=e.segments[e.segments.length-1];if(t&&t.type!==`deep-wildcard`&&t.tag!==`*`){let n=t.tag;this._deepByTerminalTag.has(n)||this._deepByTerminalTag.set(n,[]),this._deepByTerminalTag.get(n).push(e)}else this._deepWildcards.push(e);return this}let t=e.length,n=e.segments[e.segments.length-1]?.tag;if(!n||n===`*`)this._wildcardByDepth.has(t)||this._wildcardByDepth.set(t,[]),this._wildcardByDepth.get(t).push(e);else{let r=`${t}:${n}`;this._byDepthAndTag.has(r)||this._byDepthAndTag.set(r,[]),this._byDepthAndTag.get(r).push(e)}return this}addAll(e){for(let t of e)this.add(t);return this}has(e){return this._patterns.has(e.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(e){return this.findMatch(e)!==null}findMatch(e){let t=e.getDepth(),n=e.getCurrentTag(),r=`${t}:${n}`,i=this._byDepthAndTag.get(r);if(i){for(let t=0;t<i.length;t++)if(e.matches(i[t]))return i[t]}let a=this._wildcardByDepth.get(t);if(a){for(let t=0;t<a.length;t++)if(e.matches(a[t]))return a[t]}let o=this._deepByTerminalTag.get(n);if(o){for(let t=0;t<o.length;t++)if(e.matches(o[t]))return o[t]}for(let t=0;t<this._deepWildcards.length;t++)if(e.matches(this._deepWildcards[t]))return this._deepWildcards[t];return null}},yt=class{constructor(e){this._matcher=e}get separator(){return this._matcher.separator}getCurrentTag(){let e=this._matcher.path;return e.length>0?e[e.length-1].tag:void 0}getCurrentNamespace(){let e=this._matcher.path;return e.length>0?e[e.length-1].namespace:void 0}getAttrValue(e){let t=this._matcher.path;if(t.length!==0)return t[t.length-1].values?.[e]}hasAttr(e){let t=this._matcher.path;if(t.length===0)return!1;let n=t[t.length-1];return n.values!==void 0&&e in n.values}getAnyParentAttr(e){return this._matcher.getAnyParentAttr(e)}hasAnyParentAttr(e){return this._matcher.hasAnyParentAttr(e)}getPosition(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].position??0}getCounter(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(e,t=!0){return this._matcher.toString(e,t)}toArray(){return this._matcher.path.map(e=>e.tag)}matches(e){return this._matcher.matches(e)}matchesAny(e){return e.matchesAny(this._matcher)}},N=class{constructor(e={}){this.separator=e.separator||`.`,this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new yt(this),this._keptAttrs=[]}push(e,t=null,n=null,r=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let i=this.path.length,a=this.siblingStacks[i];a||(a={counts:new Map,total:0},this.siblingStacks[i]=a);let o=n?`${n}:${e}`:e,s=a.counts.get(o)||0,c=a.total;a.counts.set(o,s+1),a.total++;let l={tag:e,position:c,counter:s};n!=null&&(l.namespace=n),t!=null&&(l.values=t),this.path.push(l);let u=this.path.length,d=r===null?null:r.keep;if(d!=null&&d.length>0&&t)for(let e=0;e<d.length;e++){let n=d[e];t[n]!==void 0&&this._keptAttrs.push({depth:u,name:n,value:t[n]})}}pop(){if(this.path.length===0)return;this._pathStringCache=null;let e=this.path.pop();this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1);let t=this.path.length+1;for(;this._keptAttrs.length>0&&this._keptAttrs[this._keptAttrs.length-1].depth>=t;)this._keptAttrs.pop();return e}updateCurrent(e){if(this.path.length>0){let t=this.path[this.path.length-1];e!=null&&(t.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;let t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getAnyParentAttr(e){let t=this._keptAttrs;for(let n=t.length-1;n>=0;n--)if(t[n].name===e)return t[n].value}hasAnyParentAttr(e){let t=this._keptAttrs;for(let n=t.length-1;n>=0;n--)if(t[n].name===e)return!0;return!1}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){let n=e||this.separator;if(n===this.separator&&t===!0){if(this._pathStringCache!==null)return this._pathStringCache;let e=this.path.map(e=>e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n);return this._pathStringCache=e,e}return this.path.map(e=>t&&e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n)}toArray(){return this.path.map(e=>e.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[],this._keptAttrs=[]}matches(e){let t=e.segments;return t.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t<e.length;t++)if(!this._matchSegment(e[t],this.path[t],t===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(e){let t=this.path.length-1,n=e.length-1;for(;n>=0&&t>=0;){let r=e[n];if(r.type===`deep-wildcard`){if(n--,n<0)return!0;let r=e[n],i=!1;for(let e=t;e>=0;e--)if(this._matchSegment(r,this.path[e],e===this.path.length-1)){t=e-1,n--,i=!0;break}if(!i)return!1}else{if(!this._matchSegment(r,this.path[t],t===this.path.length-1))return!1;t--,n--}}return n<0}_matchSegment(e,t,n){if(e.tag!==`*`&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!==`*`&&e.namespace!==t.namespace||e.attrName!==void 0&&(!n||!t.values||!(e.attrName in t.values)||e.attrValue!==void 0&&String(t.values[e.attrName])!==String(e.attrValue)))return!1;if(e.position!==void 0){if(!n)return!1;let r=t.counter??0;if(e.position===`first`&&r!==0||e.position===`odd`&&r%2!=1||e.position===`even`&&r%2!=0||e.position===`nth`&&r!==e.positionValue)return!1}return!0}matchesAny(e){return e.matchesAny(this)}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>e&&{counts:new Map(e.counts),total:e.total}),keptAttrs:this._keptAttrs.map(e=>({...e}))}}restore(e){this._pathStringCache=null,this.path=e.path.map(e=>({...e})),this.siblingStacks=e.siblingStacks.map(e=>e&&{counts:new Map(e.counts),total:e.total}),this._keptAttrs=(e.keptAttrs||[]).map(e=>({...e}))}readOnly(){return this._view}},P=[{id:`html-script-open`,description:`<script opening tag`,pattern:/<script[\s>/]/i},{id:`html-script-close`,description:`<\/script closing tag`,pattern:/<\/script[\s>]/i},{id:`html-javascript-protocol`,description:`javascript: URI scheme (with optional whitespace/encoding)`,pattern:/j[\t\n\r ]*a[\t\n\r ]*v[\t\n\r ]*a[\t\n\r ]*s[\t\n\r ]*c[\t\n\r ]*r[\t\n\r ]*i[\t\n\r ]*p[\t\n\r ]*t[\t\n\r ]*:/i},{id:`html-vbscript-protocol`,description:`vbscript: URI scheme`,pattern:/vbscript[\t\n\r ]*:/i},{id:`html-data-html`,description:`data:text/html URI — can execute scripts in browsers`,pattern:/data[\t\n\r ]*:[\t\n\r ]*text\/html/i},{id:`html-data-xhtml`,description:`data:application/xhtml+xml URI`,pattern:/data[\t\n\r ]*:[\t\n\r ]*application\/xhtml/i},{id:`html-data-svg`,description:`data:image/svg+xml URI — can execute scripts`,pattern:/data[\t\n\r ]*:[\t\n\r ]*image\/svg\+xml/i},{id:`html-inline-event-handler`,description:`Inline event handler attributes: onclick=, onerror=, onload=, etc.`,pattern:/\bon\w{1,30}\s*=/i},{id:`html-entity-obfuscated-script`,description:`HTML-entity-encoded <script (e.g. &#x3C;script or &lt;script)`,pattern:/(?:&#x0*3[Cc];?|&#0*60;?|&lt;)\s*script/i},{id:`html-entity-obfuscated-javascript`,description:`HTML-entity-encoded javascript: (partial — catches common &#106; or &#x6a; for "j")`,pattern:/(?:&#x0*6[Aa];?|&#0*106;?)\s*(?:&#x0*61;?|a)[\s\S]{0,80}script\s*:/i},{id:`html-style-expression`,description:`CSS expression() — IE-era code execution in style attributes`,pattern:/style[\s\S]{0,20}expression\s*\(/i},{id:`html-object-embed`,description:`<object or <embed tags that can load active content`,pattern:/<(?:object|embed)[\s>/]/i},{id:`html-base-tag`,description:`<base href= — can hijack all relative URLs on a page`,pattern:/<base[\s>]/i},{id:`html-meta-refresh`,description:`<meta http-equiv="refresh" — can redirect users`,pattern:/<meta[\s\S]{0,40}http-equiv[\s\S]{0,20}refresh/i},{id:`html-srcdoc`,description:`srcdoc= attribute on iframes — embeds HTML that can run scripts`,pattern:/srcdoc\s*=/i},{id:`html-iframe`,description:`<iframe tag`,pattern:/<iframe[\s>/]/i},{id:`html-form`,description:`<form tag — can be used for phishing / credential harvesting injection`,pattern:/<form[\s>/]/i}],F=[{id:`xml-cdata-injection`,description:`CDATA section injection: <![CDATA[ breaks out of text node context`,pattern:/<!\[CDATA\[/i},{id:`xml-cdata-close`,description:`CDATA close sequence: ]]> can terminate an enclosing CDATA section`,pattern:/\]\]>/},{id:`xml-processing-instruction`,description:`XML processing instruction: <?xml-stylesheet or <?php etc.`,pattern:/<\?(?:xml[\- ]|php|asp)/i},{id:`xml-doctype-injection`,description:`DOCTYPE declaration embedded in content — can define entities`,pattern:/<!DOCTYPE(?:[\s[]|$)/i},{id:`xml-entity-system`,description:`SYSTEM keyword — used in external entity declarations (XXE)`,pattern:/\bSYSTEM\s+["']/i},{id:`xml-entity-public`,description:`PUBLIC keyword — used in external entity declarations (XXE)`,pattern:/\bPUBLIC\s+["']/i},{id:`xml-entity-declaration`,description:`<!ENTITY declaration — defines entities, potential XXE or entity expansion`,pattern:/<!ENTITY[\s%]/i},{id:`xml-billion-laughs`,description:`Entity reference chaining / billion laughs: repeated &eX; style references`,pattern:/(?:&\w{1,20};){3,}/},{id:`xml-namespace-confusion`,description:`xmlns: attribute injection — can redefine namespaces to confuse parsers`,pattern:/\bxmlns\s*(?::\w{1,40})?\s*=/i},{id:`xml-comment-injection`,description:`<!-- comment injection — can hide content from some parsers`,pattern:/<!--/},{id:`xml-comment-close`,description:`--> closes an enclosing XML comment`,pattern:/-->/},{id:`xml-pi-close`,description:`?> closes an enclosing processing instruction`,pattern:/\?>/}],bt=[{id:`svg-script-element`,description:`<script element inside SVG executes JavaScript`,pattern:/<script[\s>/]/i},{id:`svg-xlink-href-javascript`,description:`xlink:href with javascript: — classic SVG XSS via <a> or <use>`,pattern:/xlink\s*:\s*href\s*=\s*["']?\s*javascript\s*:/i},{id:`svg-href-javascript`,description:`href= with javascript: in SVG context (<a>, <animate>, etc.)`,pattern:/href\s*=\s*["']?\s*javascript\s*:/i},{id:`svg-foreignobject`,description:`<foreignObject embeds HTML inside SVG — can execute scripts`,pattern:/<foreignObject[\s>/]/i},{id:`svg-use-external`,description:`<use xlink:href or href pointing to external resource (non-fragment URL)`,pattern:/<use[\s\S]{0,60}(?:xlink\s*:\s*)?href\s*=\s*(?:["'][^#]|[^"'#\s>])/i},{id:`svg-animate-href`,description:`<animate attributeName="href" — can dynamically change href to javascript:`,pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*href["']/i},{id:`svg-animate-xlinkhref`,description:`<animate attributeName="xlink:href"`,pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*xlink\s*:\s*href["']/i},{id:`svg-set-javascript`,description:`<set to="javascript:..." — sets an attribute to a javascript: URI`,pattern:/<set[\s\S]{0,80}to\s*=\s*["']?\s*javascript\s*:/i},{id:`svg-event-handler`,description:`SVG-specific event handler attributes: onload=, onerror=, onactivate=, etc.`,pattern:/\bon(?:load|error|activate|begin|end|repeat|focus|blur|click|mouse\w{1,20}|key\w{1,20})\s*=/i},{id:`svg-handler-generic`,description:`Generic on* handler catch-all for SVG attributes`,pattern:/\bon\w{1,30}\s*=/i},{id:`svg-filter-feimage`,description:`<feImage href= — filter primitive that can load external resources`,pattern:/<feImage[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=/i},{id:`svg-image-external`,description:`<image xlink:href with http/https or javascript protocol`,pattern:/<image[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=\s*["']?\s*(?:https?|javascript)\s*:/i},{id:`svg-style-javascript`,description:`style= attribute containing javascript: (e.g. background:url(javascript:...))`,pattern:/style\s*=[\s\S]{0,60}javascript\s*:/i}],I=[{id:`sql-block-comment-open`,description:`SQL block comment open: /* ... */ — unusual in legitimate user text`,pattern:/\/\*/},{id:`sql-union-select`,description:`UNION SELECT — most common SQL injection aggregation attack`,pattern:/\bUNION\s{1,20}(?:ALL\s{1,20})?SELECT\b/i},{id:`sql-drop-table`,description:`DROP TABLE — destructive DDL injection`,pattern:/\bDROP\s{1,20}TABLE\b/i},{id:`sql-drop-database`,description:`DROP DATABASE — destructive DDL injection`,pattern:/\bDROP\s{1,20}DATABASE\b/i},{id:`sql-insert-into`,description:`INSERT INTO — data injection`,pattern:/\bINSERT\s{1,20}INTO\b/i},{id:`sql-delete-from`,description:`DELETE FROM — data deletion injection`,pattern:/\bDELETE\s{1,20}FROM\b/i},{id:`sql-update-set`,description:`UPDATE ... SET — data modification injection`,pattern:/\bUPDATE\b[\s\S]{1,60}\bSET\b/i},{id:`sql-exec-xp`,description:`EXEC xp_ — MSSQL extended stored procedure execution`,pattern:/\bEXEC(?:UTE)?\s{1,20}xp_/i},{id:`sql-tautology-string`,description:`Classic string tautology: ' OR '1'='1 or " OR "1"="1"`,pattern:/'\s{0,10}OR\s{0,10}'[^']{0,20}'\s*=\s*'[^']{0,20}/i},{id:`sql-tautology-numeric`,description:`Numeric tautology: OR 1=1`,pattern:/\bOR\s{1,10}1\s*=\s*1\b/i},{id:`sql-always-true-zero`,description:`Numeric tautology: OR 0=0`,pattern:/\bOR\s{1,10}0\s*=\s*0\b/i},{id:`sql-sleep-benchmark`,description:`Time-based blind injection: SLEEP() or BENCHMARK()`,pattern:/\b(?:SLEEP|BENCHMARK)\s*\(/i},{id:`sql-waitfor-delay`,description:`MSSQL time-based blind injection: WAITFOR DELAY`,pattern:/\bWAITFOR\s{1,20}DELAY\b/i},{id:`sql-char-function`,description:`CHAR() function — used to obfuscate injected strings`,pattern:/\bCHAR\s*\(\s*\d{1,3}/i},{id:`sql-information-schema`,description:`INFORMATION_SCHEMA — reconnaissance query for table/column enumeration`,pattern:/\bINFORMATION_SCHEMA\b/i}],xt=[{id:`shell-path-traversal-unix`,description:`Unix path traversal: ../ — climbing the directory tree`,pattern:/\.\.\//},{id:`shell-path-traversal-windows`,description:`Windows path traversal: ..\\ — climbing the directory tree`,pattern:/\.\.\\/},{id:`shell-path-traversal-encoded`,description:`URL-encoded path traversal: %2e%2e or %2f variants`,pattern:/%2e%2e|%2f\.\.|\.\.%2f/i},{id:`shell-null-byte`,description:`Null byte injection: \\x00 or %00 — truncates strings in C-backed functions`,pattern:/\x00|%00/},{id:`shell-semicolon`,description:`Semicolon command separator: cmd1; cmd2`,pattern:/;/},{id:`shell-pipe`,description:`Pipe operator: cmd1 | cmd2`,pattern:/\|/},{id:`shell-and-operator`,description:`AND operator: cmd1 && cmd2`,pattern:/&&/},{id:`shell-or-operator`,description:`OR operator: cmd1 || cmd2`,pattern:/\|\|/},{id:`shell-backtick`,description:"Backtick command substitution: `cmd`",pattern:/`/},{id:`shell-dollar-paren`,description:`Dollar-paren command substitution: $(cmd)`,pattern:/\$\(/},{id:`shell-dollar-brace`,description:"Dollar-brace variable expansion: ${var} — can be abused for injection",pattern:/\$\{/},{id:`shell-redirect-out`,description:`Output redirection: cmd > file or cmd >> file`,pattern:/>{1,2}/},{id:`shell-redirect-in`,description:`Input redirection: cmd < file`,pattern:/</},{id:`shell-newline-injection`,description:`Newline injection: \\n or \\r — can inject new shell commands`,pattern:/[\n\r]/},{id:`shell-glob-star`,description:`Glob expansion: * or ? — can expand to unintended files`,pattern:/[/\\][*?]/},{id:`shell-absolute-root`,description:`Absolute root path injection: string starting with / or \\ (Windows UNC)`,pattern:/^(?:\/|\\\\)/},{id:`shell-windows-drive`,description:`Windows drive letter path injection: C:\\ or D:/`,pattern:/^[a-zA-Z]:[/\\]/},{id:`shell-curl-wget`,description:`curl/wget with URL or flags — can exfiltrate data or download payloads`,pattern:/\b(?:curl|wget)\s+(?:https?:\/\/|ftp:\/\/|-)/i}],St=[{id:`redos-nested-quantifier-plus`,description:`Nested + quantifier inside a group with outer quantifier: (a+)+, (.+b)*, etc.`,pattern:/\([^)]*\+[^)]*\)[+*]/},{id:`redos-nested-quantifier-star`,description:`Nested * quantifier: (a*)* or (a*)+ — catastrophic backtracking`,pattern:/\([^)]*\*[^)]*\)[*+]/},{id:`redos-nested-groups`,description:`Doubly nested quantified groups: ((a+)+) — guaranteed catastrophic`,pattern:/\(\([^)]{0,40}\)[+*]\)[+*]/},{id:`redos-alternation-overlap`,description:`Overlapping alternation under quantifier: (a|a)+ — ambiguous NFA paths`,pattern:/\(([^|()]{1,20})\|(?:\1)(?:\|[^|()]{1,20}){0,5}\)[+*?]{1,2}/},{id:`redos-star-plus-concat`,description:`(x*x)+ pattern — triggers super-linear backtracking`,pattern:/\([^)]{0,10}\*[^)]{0,10}\)[+*]/},{id:`redos-dot-star-greedy`,description:`(.*){n,} or (.+){n,} — repeated greedy dot quantifiers`,pattern:/\(\.[*+]\)\{?\d/},{id:`redos-large-repetition`,description:`Very large fixed or range repetition count {1000,} or {1000,n} — denial of service via backtracking`,pattern:/\{\d{4,}(?:,\d*)?\}/},{id:`redos-catastrophic-alternation`,description:`Long alternation with many similar branches — polynomial backtracking risk`,pattern:/\([^)]{0,200}(?:\|[^|)]{0,50}){9,}\)/}],L=`["'\\s]*:`,Ct=[{id:`nosql-where-operator`,description:`$where — executes arbitrary JavaScript server-side in MongoDB`,pattern:RegExp(`\\$where${L}`,`i`)},{id:`nosql-ne-operator`,description:`$ne — "not equal" operator used to bypass equality checks`,pattern:RegExp(`\\$ne${L}`,`i`)},{id:`nosql-gt-operator`,description:`$gt — "greater than" used to bypass password/value checks`,pattern:RegExp(`\\$gte?${L}`,`i`)},{id:`nosql-lt-operator`,description:`$lt / $lte — "less than" bypass variants`,pattern:RegExp(`\\$lte?${L}`,`i`)},{id:`nosql-regex-operator`,description:`$regex — can be used to extract data character by character (blind injection)`,pattern:RegExp(`\\$regex${L}`,`i`)},{id:`nosql-or-operator`,description:`$or — logical OR; used to create always-true conditions`,pattern:RegExp(`\\$or${L}\\s*\\[`,`i`)},{id:`nosql-and-operator`,description:`$and — logical AND operator injection`,pattern:RegExp(`\\$and${L}\\s*\\[`,`i`)},{id:`nosql-nor-operator`,description:`$nor — logical NOR operator injection`,pattern:RegExp(`\\$nor${L}\\s*\\[`,`i`)},{id:`nosql-exists-operator`,description:`$exists — can enumerate fields to determine schema`,pattern:RegExp(`\\$exists${L}`,`i`)},{id:`nosql-in-operator`,description:`$in — matches any value in a list; can enumerate values`,pattern:RegExp(`\\$in${L}\\s*\\[`,`i`)},{id:`nosql-expr-operator`,description:`$expr — allows aggregation expressions in queries (MongoDB 3.6+)`,pattern:RegExp(`\\$expr${L}`,`i`)},{id:`nosql-function-operator`,description:`$function — executes arbitrary JavaScript in MongoDB 4.4+`,pattern:RegExp(`\\$function${L}`,`i`)},{id:`nosql-accumulator-operator`,description:`$accumulator — custom aggregation with arbitrary JS execution`,pattern:RegExp(`\\$accumulator${L}`,`i`)},{id:`nosql-proto-pollution`,description:`__proto__ — prototype pollution via object key injection`,pattern:/__proto__/},{id:`nosql-constructor-prototype`,description:`constructor.prototype — alternative prototype pollution vector (dot notation or JSON key)`,pattern:/constructor[\s"':.,{\[]*prototype/i},{id:`nosql-proto-bracket`,description:`["__proto__"] — bracket-notation prototype pollution`,pattern:/\[["']__proto__["']\]/}],wt=[{id:`log-crlf-injection`,description:`CRLF injection: literal \\r or \\n embeds fake log lines`,pattern:/[\r\n]/},{id:`log-url-encoded-crlf`,description:`URL-encoded CRLF: %0d, %0a, %0D, %0A — decoded by some log parsers`,pattern:/%0[dDaA]/},{id:`log-unicode-newline`,description:`Unicode newline variants: U+2028 (line separator), U+2029 (paragraph separator)`,pattern:/[\u2028\u2029]/},{id:`log-log4shell-jndi`,description:"Log4Shell: ${jndi:...} triggers remote code execution in Apache Log4j",pattern:/\$\{jndi\s*:/i},{id:`log-log4shell-obfuscated`,description:"Obfuscated Log4Shell: ${::-j}... lookup-bypass prefix used to evade WAF detection",pattern:/\$\{::-/},{id:`log-log4j-lookup`,description:"Log4j lookup syntax: ${env:...}, ${sys:...}, ${ctx:...} — data exfiltration",pattern:/\$\{(?:env|sys|ctx|main|map|sd|web|docker|k8s|spring)\s*:/i},{id:`log-ssti-double-brace`,description:`SSTI double-brace: {{expression}} — Jinja2, Twig, Handlebars, etc.`,pattern:/\{\{[\s\S]{0,80}\}\}/},{id:`log-ssti-hash-brace`,description:`SSTI hash-brace: #{expression} — Thymeleaf, Velocity, Ruby ERB`,pattern:/#\{[\s\S]{0,80}\}/},{id:`log-ssti-dollar-brace`,description:"SSTI/EL injection: ${expression with operators or method calls} — JSP EL, Freemarker, SpEL",pattern:/\$\{[^}]*(?:\.|\(|\*|\+|\bclass\b|\bruntime\b|\bprocess\b|\bexec\b)[^}]{0,80}\}/i},{id:`log-ssti-percent-tag`,description:`SSTI ERB/ASP tag: <%= expression %> — Ruby ERB, ASP`,pattern:/<%=[\s\S]{0,80}%>/},{id:`log-null-byte`,description:`Null byte: \\x00 or %00 — can truncate log entries in C-backed loggers`,pattern:/\x00|%00/},{id:`log-ansi-escape`,description:`ANSI escape sequence: ESC[ — can manipulate terminal output when logs are tailed`,pattern:/\x1b\[/}],Tt=[{id:`sql-line-comment`,description:`SQL line comment: -- followed by whitespace or end of string`,pattern:/--(?:\s|$)/},{id:`sql-stacked-query`,description:`Stacked queries: semicolon immediately followed by a SQL keyword`,pattern:/;\s{0,10}(?:SELECT|INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|EXEC)\b/i},{id:`sql-hex-encoding`,description:`Hex-encoded string injection: 0x41414141 style (MySQL)`,pattern:/\b0x[0-9a-f]{4,}/i}],Et=[...I,...Tt];P.label=`HTML`,F.label=`XML`,bt.label=`SVG`,I.label=`SQL`,Et.label=`SQL-STRICT`,xt.label=`SHELL`,St.label=`REDOS`,Ct.label=`NOSQL`,wt.label=`LOG`,Object.freeze({HTML:P,XML:F,SVG:bt,SQL:I,"SQL-STRICT":Et,SHELL:xt,REDOS:St,NOSQL:Ct,LOG:wt});function Dt(e){if(typeof e!=`string`)throw TypeError(`is-unsafe: first argument must be a string, got ${typeof e}`)}function Ot(e){if(!(e instanceof RegExp)){if(Array.isArray(e)){if(e.length===0)throw TypeError(`is-unsafe: context must not be an empty array`);if(Array.isArray(e[0])){for(let t of e)if(!Array.isArray(t)||t.length===0)throw TypeError(`is-unsafe: each context in the array must be a non-empty pattern array (PatternList)`)}return}throw TypeError(`is-unsafe: second argument must be a PatternList (e.g. HTML), an array of PatternLists (e.g. [HTML, XML]), or a RegExp. Got: ${typeof e}`)}}function kt(e){return e instanceof RegExp?{lists:null,regex:e}:Array.isArray(e[0])?{lists:e,regex:null}:{lists:[e],regex:null}}function At(e,t){let n=t.label??`CUSTOM`;for(let r of t)if(r.pattern.test(e))return{context:n,id:r.id,description:r.description,pattern:r.pattern};return null}function jt(e,t){Dt(e),Ot(t);let{lists:n,regex:r}=kt(t);if(r)return r.test(e);for(let t of n)if(At(e,t)!==null)return!0;return!1}function Mt(e,t){if(!e)return{};let n=t.attributesGroupName?e[t.attributesGroupName]:e;if(!n)return{};let r={};for(let e in n)if(e.startsWith(t.attributeNamePrefix)){let i=e.substring(t.attributeNamePrefix.length);r[i]=n[e]}else r[e]=n[e];return r}function Nt(e){if(!e||typeof e!=`string`)return;let t=e.indexOf(`:`);if(t!==-1&&t>0){let n=e.substring(0,t);if(n!==`xmlns`)return n}}var Pt=class{constructor(e,t){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=zt,this.parseTextData=Ft,this.resolveNameSpace=It,this.buildAttributesMap=Rt,this.isItStopNode=Ut,this.replaceEntitiesValue=Vt,this.readStopNodeData=Kt,this.saveTextToParentTag=Ht,this.addChild=Bt,this.ignoreAttributesFn=_t(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0;let n={...we};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities==`object`?n=this.options.htmlEntities:this.options.htmlEntities===!0&&(n={...Te,...xe}),this.entityDecoder=new Me({namedEntities:{...n,...t},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo},onInputEntity:(e,t)=>jt(t,[P,F])?x.BLOCK:x.ALLOW})),this.matcher=new N,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new vt;let r=this.options.stopNodes;if(r&&r.length>0){for(let e=0;e<r.length;e++){let t=r[e];typeof t==`string`?this.stopNodeExpressionsSet.add(new M(t)):t instanceof M&&this.stopNodeExpressionsSet.add(t)}this.stopNodeExpressionsSet.seal()}}};function Ft(e,t,n,r,i,a,o){let s=this.options;if(e!==void 0&&(s.trimValues&&!r&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e,t,n));let r=s.jPath?n.toString():n,c=s.tagValueProcessor(t,e,r,i,a);return c==null?e:typeof c!=typeof e||c!==e?c:s.trimValues||e.trim()===e?qt(e,s.parseTagValue,s.numberParseOptions):e}}function It(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}var Lt=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function Rt(e,t,n,r=!1){let i=this.options;if(r===!0||i.ignoreAttributes!==!0&&typeof e==`string`){let r=u(e,Lt),a=r.length,o={},s=Array(a),c=!1,l={};for(let e=0;e<a;e++){let t=this.resolveNameSpace(r[e][1]),a=r[e][4];if(t.length&&a!==void 0){let r=a;i.trimValues&&(r=r.trim()),r=this.replaceEntitiesValue(r,n,this.readonlyMatcher),s[e]=r,l[t]=r,c=!0}}c&&typeof t==`object`&&t.updateCurrent&&t.updateCurrent(l);let d=i.jPath?t.toString():this.readonlyMatcher,f=!1;for(let e=0;e<a;e++){let t=this.resolveNameSpace(r[e][1]);if(this.ignoreAttributesFn(t,d))continue;let n=i.attributeNamePrefix+t;if(t.length)if(i.transformAttributeName&&(n=i.transformAttributeName(n)),n=Jt(n,i),r[e][4]!==void 0){let r=s[e],a=i.attributeValueProcessor(t,r,d);a==null?o[n]=r:typeof a!=typeof r||a!==r?o[n]=a:o[n]=qt(r,i.parseAttributeValue,i.numberParseOptions),f=!0}else i.allowBooleanAttributes&&(o[n]=!0,f=!0)}if(!f)return;if(i.attributesGroupName&&!i.preserveOrder){let e={};return e[i.attributesGroupName]=o,e}return o}}var zt=function(e){e=e.replace(/\r\n?/g,`
4
+ `);let t=new E(`!xml`),n=t,r=``;this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let i=this.options,a=new Xe(i.processEntities),o=e.length;for(let s=0;s<o;s++)if(e[s]===`<`){let c=e.charCodeAt(s+1);if(c===47){let t=R(e,`>`,s,`Closing Tag is not closed.`),a=e.substring(s+2,t).trim();if(i.removeNSPrefix){let e=a.indexOf(`:`);e!==-1&&(a=a.substr(e+1))}a=B(i.transformTagName,a,``,i).tagName,n&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher));let o=this.matcher.getCurrentTag();if(a&&i.unpairedTagsSet.has(a))throw Error(`Unpaired tag can not be used as closing tag: </${a}>`);o&&i.unpairedTagsSet.has(o)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),r=``,s=t}else if(c===63){let t=z(e,s,!1,`?>`);if(!t)throw Error(`Pi Tag is not closed.`);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let o=this.buildAttributesMap(t.tagExp,this.matcher,t.tagName,!0);if(o){let e=o[this.options.attributeNamePrefix+`version`];this.entityDecoder.setXmlVersion(Number(e)||1),a.setXmlVersion(Number(e)||1)}if(!(i.ignoreDeclaration&&t.tagName===`?xml`||i.ignorePiTags)){let e=new E(t.tagName);e.add(i.textNodeName,``),t.tagName!==t.tagExp&&t.attrExpPresent&&i.ignoreAttributes!==!0&&(e[`:@`]=o),this.addChild(n,e,this.readonlyMatcher,s)}s=t.closeIndex+1}else if(c===33&&e.charCodeAt(s+2)===45&&e.charCodeAt(s+3)===45){let t=R(e,`-->`,s+4,`Comment is not closed.`);if(i.commentPropName){let a=e.substring(s+4,t-2);r=this.saveTextToParentTag(r,n,this.readonlyMatcher),n.add(i.commentPropName,[{[i.textNodeName]:a}])}s=t}else if(c===33&&e.charCodeAt(s+2)===68){let t=a.readDocType(e,s);this.entityDecoder.addInputEntities(t.entities),s=t.i}else if(c===33&&e.charCodeAt(s+2)===91){let t=R(e,`]]>`,s,`CDATA is not closed.`)-2,a=e.substring(s+9,t);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let o=this.parseTextData(a,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);o??=``,i.cdataPropName?n.add(i.cdataPropName,[{[i.textNodeName]:a}]):n.add(i.textNodeName,o),s=t+2}else{let a=z(e,s,i.removeNSPrefix);if(!a){let t=e.substring(Math.max(0,s-50),Math.min(o,s+50));throw Error(`readTagExp returned undefined at position ${s}. Context: "${t}"`)}let c=a.tagName,l=a.rawTagName,u=a.tagExp,d=a.attrExpPresent,f=a.closeIndex;if({tagName:c,tagExp:u}=B(i.transformTagName,c,u,i),i.strictReservedNames&&(c===i.commentPropName||c===i.cdataPropName||c===i.textNodeName||c===i.attributesGroupName))throw Error(`Invalid tag name: ${c}`);n&&r&&n.tagname!==`!xml`&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher,!1));let p=n;p&&i.unpairedTagsSet.has(p.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let m=!1;u.length>0&&u.lastIndexOf(`/`)===u.length-1&&(m=!0,c[c.length-1]===`/`?(c=c.substr(0,c.length-1),u=c):u=u.substr(0,u.length-1),d=c!==u);let h=null,g;g=Nt(l),c!==t.tagname&&this.matcher.push(c,{},g),c!==u&&d&&(h=this.buildAttributesMap(u,this.matcher,c),h&&Mt(h,i)),c!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let _=s;if(this.isCurrentNodeStopNode){let t=``;if(m)s=a.closeIndex;else if(i.unpairedTagsSet.has(c))s=a.closeIndex;else{let n=this.readStopNodeData(e,l,f+1);if(!n)throw Error(`Unexpected end of ${l}`);s=n.i,t=n.tagContent}let r=new E(c);h&&(r[`:@`]=h),r.add(i.textNodeName,t),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,r,this.readonlyMatcher,_)}else{if(m){({tagName:c,tagExp:u}=B(i.transformTagName,c,u,i));let e=new E(c);h&&(e[`:@`]=h),this.addChild(n,e,this.readonlyMatcher,_),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(i.unpairedTagsSet.has(c)){let e=new E(c);h&&(e[`:@`]=h),this.addChild(n,e,this.readonlyMatcher,_),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=a.closeIndex;continue}else{let e=new E(c);if(this.tagsNodeStack.length>i.maxNestedTags)throw Error(`Maximum nested tags exceeded`);this.tagsNodeStack.push(n),h&&(e[`:@`]=h),this.addChild(n,e,this.readonlyMatcher,_),n=e}r=``,s=f}}}else r+=e[s];return t.child};function Bt(e,t,n,r){this.options.captureMetaData||(r=void 0);let i=this.options.jPath?n.toString():n,a=this.options.updateTag(t.tagname,i,t[`:@`]);a===!1||(typeof a==`string`&&(t.tagname=a),e.addChild(t,r))}function Vt(e,t,n){let r=this.options.processEntities;if(!r||!r.enabled)return e;if(r.allowedTags){let i=this.options.jPath?n.toString():n;if(!(Array.isArray(r.allowedTags)?r.allowedTags.includes(t):r.allowedTags(t,i)))return e}if(r.tagFilter){let i=this.options.jPath?n.toString():n;if(!r.tagFilter(t,i))return e}return this.entityDecoder.decode(e)}function Ht(e,t,n,r){return e&&=(r===void 0&&(r=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[`:@`]?Object.keys(t[`:@`]).length!==0:!1,r),e!==void 0&&e!==``&&t.add(this.options.textNodeName,e),``),e}function Ut(){return this.stopNodeExpressionsSet.size===0?!1:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function Wt(e,t,n=`>`){let r=0,i=e.length,a=n.charCodeAt(0),o=n.length>1?n.charCodeAt(1):-1,s=``,c=t;for(let n=t;n<i;n++){let t=e.charCodeAt(n);if(r)t===r&&(r=0);else if(t===34||t===39)r=t;else if(t===a)if(o!==-1){if(e.charCodeAt(n+1)===o)return s+=e.substring(c,n),{data:s,index:n}}else return s+=e.substring(c,n),{data:s,index:n};else t===9&&!r&&(s+=e.substring(c,n)+` `,c=n+1)}}function R(e,t,n,r){let i=e.indexOf(t,n);if(i===-1)throw Error(r);return i+t.length-1}function Gt(e,t,n,r){let i=e.indexOf(t,n);if(i===-1)throw Error(r);return i}function z(e,t,n,r=`>`){let i=Wt(e,t+1,r);if(!i)return;let a=i.data,o=i.index,s=a.search(/\s/),c=a,l=!0;s!==-1&&(c=a.substring(0,s),a=a.substring(s+1).trimStart());let u=c;if(n){let e=c.indexOf(`:`);e!==-1&&(c=c.substr(e+1),l=c!==i.data.substr(e+1))}return{tagName:c,tagExp:a,closeIndex:o,attrExpPresent:l,rawTagName:u}}function Kt(e,t,n){let r=n,i=1,a=e.length;for(;n<a;n++)if(e[n]===`<`){let a=e.charCodeAt(n+1);if(a===47){let a=Gt(e,`>`,n,`${t} is not closed`);if(e.substring(n+2,a).trim()===t&&(i--,i===0))return{tagContent:e.substring(r,n),i:a};n=a}else if(a===63)n=R(e,`?>`,n+1,`StopNode is not closed.`);else if(a===33&&e.charCodeAt(n+2)===45&&e.charCodeAt(n+3)===45)n=R(e,`-->`,n+3,`StopNode is not closed.`);else if(a===33&&e.charCodeAt(n+2)===91)n=R(e,`]]>`,n,`StopNode is not closed.`)-2;else{let r=z(e,n,!1);r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!==`/`&&i++,n=r.closeIndex)}}}function qt(e,t,n){if(t&&typeof e==`string`){let t=e.trim();return t===`true`?!0:t===`false`?!1:dt(e,n)}else if(f(e))return e;else return``}function B(e,t,n,r){if(e){let r=e(t);n===t&&(n=r),t=r}return t=Jt(t,r),{tagName:t,tagExp:n}}function Jt(e,t){if(m.includes(e))throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return p.includes(e)?t.onDangerousProperty(e):e}var V=E.getMetaDataSymbol();function Yt(e,t){if(!e||typeof e!=`object`)return{};if(!t)return e;let n={};for(let r in e)if(r.startsWith(t)){let i=r.substring(t.length);n[i]=e[r]}else n[r]=e[r];return n}function Xt(e,t,n,r){return Zt(e,t,n,r)}function Zt(e,t,n,r){let i,a={};for(let o=0;o<e.length;o++){let s=e[o],c=Qt(s);if(c!==void 0&&c!==t.textNodeName){let e=Yt(s[`:@`]||{},t.attributeNamePrefix);n.push(c,e)}if(c===t.textNodeName)i===void 0?i=s[c]:i+=``+s[c];else if(c===void 0)continue;else if(s[c]){let e=Zt(s[c],t,n,r),i=en(e,t);if(Object.keys(e).length===0&&t.alwaysCreateTextNode&&(e[t.textNodeName]=``),s[`:@`]?$t(e,s[`:@`],r,t):Object.keys(e).length===1&&e[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?e=e[t.textNodeName]:Object.keys(e).length===0&&(t.alwaysCreateTextNode?e[t.textNodeName]=``:e=``),s[V]!==void 0&&typeof e==`object`&&e&&(e[V]=s[V]),a[c]!==void 0&&Object.prototype.hasOwnProperty.call(a,c))Array.isArray(a[c])||(a[c]=[a[c]]),a[c].push(e);else{let n=t.jPath?r.toString():r;t.isArray(c,n,i)?a[c]=[e]:a[c]=e}c!==void 0&&c!==t.textNodeName&&n.pop()}}return typeof i==`string`?i.length>0&&(a[t.textNodeName]=i):i!==void 0&&(a[t.textNodeName]=i),a}function Qt(e){let t=Object.keys(e);for(let e=0;e<t.length;e++){let n=t[e];if(n!==`:@`)return n}}function $t(e,t,n,r){if(t){let i=Object.keys(t),a=i.length;for(let o=0;o<a;o++){let a=i[o],s=a.startsWith(r.attributeNamePrefix)?a.substring(r.attributeNamePrefix.length):a,c=r.jPath?n.toString()+`.`+s:n;r.isArray(a,c,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function en(e,t){let{textNodeName:n}=t,r=Object.keys(e).length;return!!(r===0||r===1&&(e[n]||typeof e[n]==`boolean`||e[n]===0))}var tn=class{constructor(e){this.externalEntities={},this.options=Le(e)}parse(e,t){if(typeof e!=`string`&&e.toString)e=e.toString();else if(typeof e!=`string`)throw Error(`XML data is accepted in String or Bytes[] form.`);if(t){t===!0&&(t={});let n=g(e,t);if(n!==!0)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}let n=new Pt(this.options,this.externalEntities),r=n.parseXml(e);return this.options.preserveOrder||r===void 0?r:Xt(r,this.options,n.matcher,n.readonlyMatcher)}addEntity(e,t){if(t.indexOf(`&`)!==-1)throw Error(`Entity value can't have '&'`);if(e.indexOf(`&`)!==-1||e.indexOf(`;`)!==-1)throw Error(`An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'`);if(t===`&`)throw Error(`An entity with value '&' is not permitted`);this.externalEntities[e]=t}static getMetaDataSymbol(){return E.getMetaDataSymbol()}};function H(e){return String(e).replace(/--/g,`- -`).replace(/--/g,`- -`).replace(/-$/,`- `)}function nn(e){return String(e).replace(/\]\]>/g,`]]]]><![CDATA[>`)}function U(e){return String(e).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`)}var rn=`
5
+ `;function an(e,t){if(!Array.isArray(e)||e.length===0)return`1.0`;let n=e[0];if(fn(n)===`?xml`){let e=n[`:@`];if(e){let n=t.attributeNamePrefix+`version`;if(e[n])return e[n]}}return`1.0`}function on(e,t,n,r,i){return!n.sanitizeName||i(e)?e:n.sanitizeName(e,{isAttribute:t,matcher:r.readOnly()})}function sn(e,t){let n=``;t.format&&(n=rn);let r=[];if(t.stopNodes&&Array.isArray(t.stopNodes))for(let e=0;e<t.stopNodes.length;e++){let n=t.stopNodes[e];typeof n==`string`?r.push(new M(n)):n instanceof M&&r.push(n)}let i=Ye(`qName`,{xmlVersion:an(e,t)}),a=new N;return cn(e,t,n,a,r,i)}function cn(e,t,n,r,i,a){let o=``,s=!1;if(t.maxNestedTags&&r.getDepth()>t.maxNestedTags)throw Error(`Maximum nested tags exceeded`);if(!Array.isArray(e)){if(e!=null){let n=e.toString();return n=hn(n,t),n}return``}for(let c=0;c<e.length;c++){let l=e[c],u=fn(l);if(u===void 0)continue;let d=u===t.textNodeName||u===t.cdataPropName||u===t.commentPropName||u[0]===`?`?u:on(u,!1,t,r,a),f=ln(l[`:@`],t);r.push(d,f);let p=mn(r,i);if(d===t.textNodeName){let e=l[u];p||(e=t.tagValueProcessor(d,e),e=hn(e,t)),s&&(o+=n),o+=e,s=!1,r.pop();continue}else if(d===t.cdataPropName){s&&(o+=n);let e=l[u][0][t.textNodeName],i=nn(e);o+=`<![CDATA[${i}]]>`,s=!1,r.pop();continue}else if(d===t.commentPropName){let e=l[u][0][t.textNodeName],i=H(e);o+=n+`<!--${i}-->`,s=!0,r.pop();continue}else if(d[0]===`?`){let e=pn(l[`:@`],t,p,r,a);o+=(d===`?xml`?``:n)+`<${d}${e}?>`,s=!0,r.pop();continue}let m=n;m!==``&&(m+=t.indentBy);let h=n+`<${d}${pn(l[`:@`],t,p,r,a)}`,g;g=p?un(l[u],t):cn(l[u],t,m,r,i,a),t.unpairedTags.indexOf(d)===-1?(!g||g.length===0)&&t.suppressEmptyNode?o+=h+`/>`:g&&g.endsWith(`>`)?o+=h+`>${g}${n}</${d}>`:(o+=h+`>`,g&&n!==``&&(g.includes(`/>`)||g.includes(`</`))?o+=n+t.indentBy+g+n:o+=g,o+=`</${d}>`):t.suppressUnpairedNode?o+=h+`>`:o+=h+`/>`,s=!0,r.pop()}return o}function ln(e,t){if(!e||t.ignoreAttributes)return null;let n={},r=!1;for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let a=i.startsWith(t.attributeNamePrefix)?i.substr(t.attributeNamePrefix.length):i;n[a]=U(e[i]),r=!0}return r?n:null}function un(e,t){if(!Array.isArray(e))return e==null?``:e.toString();let n=``;for(let r=0;r<e.length;r++){let i=e[r],a=fn(i);if(a===t.textNodeName)n+=i[a];else if(a===t.cdataPropName)n+=i[a][0][t.textNodeName];else if(a===t.commentPropName)n+=i[a][0][t.textNodeName];else if(a&&a[0]===`?`)continue;else if(a){let e=dn(i[`:@`],t),r=un(i[a],t);!r||r.length===0?n+=`<${a}${e}/>`:n+=`<${a}${e}>${r}</${a}>`}}return n}function dn(e,t){let n=``;if(e&&!t.ignoreAttributes)for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=e[r];i===!0&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${U(i)}"`}return n}function fn(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n];if(Object.prototype.hasOwnProperty.call(e,r)&&r!==`:@`)return r}}function pn(e,t,n,r,i){let a=``;if(e&&!t.ignoreAttributes)for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let s=o.substr(t.attributeNamePrefix.length),c=n?s:on(s,!0,t,r,i),l;n?l=e[o]:(l=t.attributeValueProcessor(o,e[o]),l=hn(l,t)),l===!0&&t.suppressBooleanAttributes?a+=` ${c}`:a+=` ${c}="${U(l)}"`}return a}function mn(e,t){if(!t||t.length===0)return!1;for(let n=0;n<t.length;n++)if(e.matches(t[n]))return!0;return!1}function hn(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){let r=t.entities[n];e=e.replace(r.regex,r.val)}return e}function gn(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var _n={attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:` `,suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:RegExp(`&`,`g`),val:`&amp;`},{regex:RegExp(`>`,`g`),val:`&gt;`},{regex:RegExp(`<`,`g`),val:`&lt;`},{regex:RegExp(`'`,`g`),val:`&apos;`},{regex:RegExp(`"`,`g`),val:`&quot;`}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0,sanitizeName:!1};function W(e){if(this.options=Object.assign({},_n,e),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let e=0;e<this.options.stopNodes.length;e++){let t=this.options.stopNodes[e];typeof t==`string`?this.stopNodeExpressions.push(new M(t)):t instanceof M&&this.stopNodeExpressions.push(t)}this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=gn(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Sn),this.processTextOrObjNode=bn,this.options.format?(this.indentate=xn,this.tagEndChar=`>
6
6
  `,this.newLine=`
7
- `):(this.indentate=function(){return``},this.tagEndChar=`>`,this.newLine=``)}function yn(e,t){let n=e[`?xml`];if(n&&typeof n==`object`){if(t.attributesGroupName&&n[t.attributesGroupName]){let e=n[t.attributesGroupName][t.attributeNamePrefix+`version`];if(e)return e}let e=n[t.attributeNamePrefix+`version`];if(e)return e}return`1.0`}function bn(e,t,n,r,i){return!n.sanitizeName||i(e)?e:n.sanitizeName(e,{isAttribute:t,matcher:r.readOnly()})}U.prototype.build=function(e){if(this.options.preserveOrder)return un(e,this.options);{Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e});let t=new bt,n=Xe(`qName`,{xmlVersion:yn(e,this.options)});return this.j2x(e,0,t,n).val}},U.prototype.j2x=function(e,t,n,r){let i=``,a=``;if(this.options.maxNestedTags&&n.getDepth()>=this.options.maxNestedTags)throw Error(`Maximum nested tags exceeded`);let o=this.options.jPath?n.toString():n,s=this.checkStopNode(n);for(let c in e){if(!Object.prototype.hasOwnProperty.call(e,c))continue;let l=c===this.options.textNodeName||c===this.options.cdataPropName||c===this.options.commentPropName||this.options.attributesGroupName&&c===this.options.attributesGroupName||this.isAttribute(c)||c[0]===`?`?c:bn(c,!1,this.options,n,r);if(e[c]===void 0)this.isAttribute(c)&&(a+=``);else if(e[c]===null)this.isAttribute(c)||l===this.options.cdataPropName||l===this.options.commentPropName?a+=``:l[0]===`?`?a+=this.indentate(t)+`<`+l+`?`+this.tagEndChar:a+=this.indentate(t)+`<`+l+`/`+this.tagEndChar;else if(e[c]instanceof Date)a+=this.buildTextValNode(e[c],l,``,t,n);else if(typeof e[c]!=`object`){let u=this.isAttribute(c);if(u&&!this.ignoreAttributesFn(u,o)){let t=bn(u,!0,this.options,n,r);i+=this.buildAttrPairStr(t,``+e[c],s)}else if(!u)if(c===this.options.textNodeName){let t=this.options.tagValueProcessor(c,``+e[c]);a+=this.replaceEntitiesValue(t)}else{n.push(l);let r=this.checkStopNode(n);if(n.pop(),r){let n=``+e[c];n===``?a+=this.indentate(t)+`<`+l+this.closeTag(l)+this.tagEndChar:a+=this.indentate(t)+`<`+l+`>`+n+`</`+l+this.tagEndChar}else a+=this.buildTextValNode(e[c],l,``,t,n)}}else if(Array.isArray(e[c])){let i=e[c].length,o=``,s=``;for(let u=0;u<i;u++){let i=e[c][u];if(i!==void 0)if(i===null)l[0]===`?`?a+=this.indentate(t)+`<`+l+`?`+this.tagEndChar:a+=this.indentate(t)+`<`+l+`/`+this.tagEndChar;else if(typeof i==`object`)if(this.options.oneListGroup){n.push(l);let e=this.j2x(i,t+1,n,r);n.pop(),o+=e.val,this.options.attributesGroupName&&i.hasOwnProperty(this.options.attributesGroupName)&&(s+=e.attrStr)}else o+=this.processTextOrObjNode(i,l,t,n,r);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(l,i);e=this.replaceEntitiesValue(e),o+=e}else{n.push(l);let e=this.checkStopNode(n);if(n.pop(),e){let e=``+i;e===``?o+=this.indentate(t)+`<`+l+this.closeTag(l)+this.tagEndChar:o+=this.indentate(t)+`<`+l+`>`+e+`</`+l+this.tagEndChar}else o+=this.buildTextValNode(i,l,``,t,n)}}this.options.oneListGroup&&(o=this.buildObjectNode(o,l,s,t)),a+=o}else if(this.options.attributesGroupName&&c===this.options.attributesGroupName){let t=Object.keys(e[c]),a=t.length;for(let o=0;o<a;o++){let a=bn(t[o],!0,this.options,n,r);i+=this.buildAttrPairStr(a,``+e[c][t[o]],s)}}else a+=this.processTextOrObjNode(e[c],l,t,n,r)}return{attrStr:i,val:a}},U.prototype.buildAttrPairStr=function(e,t,n){return n||(t=this.options.attributeValueProcessor(e,``+t),t=this.replaceEntitiesValue(t)),this.options.suppressBooleanAttributes&&t===`true`?` `+e:` `+e+`="`+B(t)+`"`};function xn(e,t,n,r,i){let a=this.extractAttributes(e);if(r.push(t,a),this.checkStopNode(r)){let i=this.buildRawContent(e),a=this.buildAttributesForStopNode(e);return r.pop(),this.buildObjectNode(i,t,a,n)}let o=this.j2x(e,n+1,r,i);return r.pop(),t[0]===`?`?this.buildTextValNode(``,t,o.attrStr,n,r):e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,o.attrStr,n,r):this.buildObjectNode(o.val,t,o.attrStr,n)}U.prototype.extractAttributes=function(e){if(!e||typeof e!=`object`)return null;let t={},n=!1;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){let r=e[this.options.attributesGroupName];for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let i=e.startsWith(this.options.attributeNamePrefix)?e.substring(this.options.attributeNamePrefix.length):e;t[i]=B(r[e]),n=!0}}else for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=this.isAttribute(r);i&&(t[i]=B(e[r]),n=!0)}return n?t:null},U.prototype.buildRawContent=function(e){if(typeof e==`string`)return e;if(typeof e!=`object`||!e)return String(e);if(e[this.options.textNodeName]!==void 0)return e[this.options.textNodeName];let t=``;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||this.isAttribute(n)||this.options.attributesGroupName&&n===this.options.attributesGroupName)continue;let r=e[n];if(n===this.options.textNodeName)t+=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`||typeof e==`number`)t+=`<${n}>${e}</${n}>`;else if(typeof e==`object`&&e){let r=this.buildRawContent(e),i=this.buildAttributesForStopNode(e);r===``?t+=`<${n}${i}/>`:t+=`<${n}${i}>${r}</${n}>`}}else if(typeof r==`object`&&r){let e=this.buildRawContent(r),i=this.buildAttributesForStopNode(r);e===``?t+=`<${n}${i}/>`:t+=`<${n}${i}>${e}</${n}>`}else t+=`<${n}>${r}</${n}>`}return t},U.prototype.buildAttributesForStopNode=function(e){if(!e||typeof e!=`object`)return``;let t=``;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){let n=e[this.options.attributesGroupName];for(let e in n){if(!Object.prototype.hasOwnProperty.call(n,e))continue;let r=e.startsWith(this.options.attributeNamePrefix)?e.substring(this.options.attributeNamePrefix.length):e,i=n[e];i===!0&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+B(i)+`"`}}else for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=this.isAttribute(n);if(r){let i=e[n];i===!0&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+B(i)+`"`}}return t},U.prototype.buildObjectNode=function(e,t,n,r){if(e===``)return t[0]===`?`?this.indentate(r)+`<`+t+n+`?`+this.tagEndChar:this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar;if(t[0]===`?`)return this.indentate(r)+`<`+t+n+`?`+this.tagEndChar;{let i=`</`+t+this.tagEndChar,a=``;return t[0]===`?`&&(a=`?`,i=``),(n||n===``)&&e.indexOf(`<`)===-1?this.indentate(r)+`<`+t+n+a+`>`+e+i:this.options.commentPropName!==!1&&t===this.options.commentPropName&&a.length===0?this.indentate(r)+`<!--${z(e)}-->`+this.newLine:this.indentate(r)+`<`+t+n+a+this.tagEndChar+e+this.indentate(r)+i}},U.prototype.closeTag=function(e){let t=``;return this.options.unpairedTags.indexOf(e)===-1?t=this.options.suppressEmptyNode?`/`:`></${e}`:this.options.suppressUnpairedNode||(t=`/`),t},U.prototype.checkStopNode=function(e){if(!this.stopNodeExpressions||this.stopNodeExpressions.length===0)return!1;for(let t=0;t<this.stopNodeExpressions.length;t++)if(e.matches(this.stopNodeExpressions[t]))return!0;return!1},U.prototype.buildTextValNode=function(e,t,n,r,i){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName){let t=on(e);return this.indentate(r)+`<![CDATA[${t}]]>`+this.newLine}else if(this.options.commentPropName!==!1&&t===this.options.commentPropName){let t=z(e);return this.indentate(r)+`<!--${t}-->`+this.newLine}else if(t[0]===`?`)return this.indentate(r)+`<`+t+n+`?`+this.tagEndChar;else{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),i===``?this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+`<`+t+n+`>`+i+`</`+t+this.tagEndChar}},U.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e};function Sn(e){return this.options.indentBy.repeat(e)}function Cn(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}var wn=U,W=e.z.object({created_at:e.z.string(),updated_at:e.z.string()}),Tn=e.z.object({id:e.z.string(),version:e.z.string().optional()}),En=e.z.object({name:e.z.string(),version:e.z.string()}),Dn=e.z.object({name:e.z.string(),value:e.z.string().optional()}),On=e.z.object({name:e.z.string().max(255),code:e.z.string().max(1e5),supported_triggers:e.z.array(Tn).optional(),runtime:e.z.string().max(50).optional(),dependencies:e.z.array(En).optional(),secrets:e.z.array(Dn).optional(),is_system:e.z.boolean().optional(),inherit:e.z.boolean().optional()});On.partial().extend({status:e.z.enum([`draft`,`built`]).optional(),deployed_at:e.z.string().optional()});var kn=On.extend({id:e.z.string(),tenant_id:e.z.string(),status:e.z.enum([`draft`,`built`]).default(`built`),deployed_at:e.z.string().optional(),secrets:e.z.array(e.z.object({name:e.z.string(),value:e.z.string().optional()})).optional()}).extend(W.shape),An=e.z.object({name:e.z.string()});kn.extend({secrets:e.z.array(An).optional()});var jn=e.z.string(),Mn=e.z.enum([`unspecified`,`pending`,`final`,`partial`,`canceled`,`suspended`]),Nn=e.z.object({id:e.z.string(),msg:e.z.string(),url:e.z.string().optional()}),Pn=e.z.object({action_name:e.z.string(),error:Nn.nullable(),started_at:e.z.string(),ended_at:e.z.string()}),Fn=e.z.object({level:e.z.enum([`log`,`info`,`warn`,`error`,`debug`]),message:e.z.string()}),In=e.z.array(e.z.object({action_name:e.z.string(),lines:e.z.array(Fn)}));e.z.object({id:e.z.string(),tenant_id:e.z.string(),trigger_id:jn,status:Mn,results:e.z.array(Pn),logs:In.optional(),created_at:e.z.string(),updated_at:e.z.string()}).omit({tenant_id:!0,created_at:!0,updated_at:!0}),e.z.object({action_id:e.z.string(),code:e.z.string().max(1e5),runtime:e.z.string().max(50).optional(),dependencies:e.z.array(En).optional(),secrets:e.z.array(Dn).optional(),supported_triggers:e.z.array(Tn).optional(),deployed:e.z.boolean().default(!0)}).extend({id:e.z.string(),tenant_id:e.z.string(),number:e.z.number().int()}).extend(W.shape);var Ln=e.z.enum([`user_action`,`admin_action`,`system`,`api`]),Rn=e.z.object({type:e.z.enum([`user`,`admin`,`system`,`api_key`,`client_credentials`]),id:e.z.string().optional(),email:e.z.string().optional(),org_id:e.z.string().optional(),org_name:e.z.string().optional(),scopes:e.z.array(e.z.string()).optional(),client_id:e.z.string().optional()}),zn=e.z.object({type:e.z.string(),id:e.z.string(),before:e.z.record(e.z.string(),e.z.unknown()).optional(),after:e.z.record(e.z.string(),e.z.unknown()).optional(),diff:e.z.record(e.z.string(),e.z.object({old:e.z.unknown(),new:e.z.unknown()})).optional()}),Bn=e.z.object({method:e.z.string(),path:e.z.string(),query:e.z.record(e.z.string(),e.z.string()).optional(),body:e.z.unknown().optional(),ip:e.z.string(),user_agent:e.z.string().optional(),correlation_id:e.z.string().optional(),redirect_uri:e.z.string().optional()}),Vn=e.z.object({status_code:e.z.number(),body:e.z.unknown().optional()}),Hn=e.z.object({country_code:e.z.string(),city_name:e.z.string(),latitude:e.z.string(),longitude:e.z.string(),time_zone:e.z.string(),continent_code:e.z.string()}),Un=e.z.object({name:e.z.string(),version:e.z.string(),env:e.z.record(e.z.string(),e.z.string()).optional()});e.z.object({tenant_id:e.z.string(),event_type:e.z.string(),log_type:e.z.string(),description:e.z.string().optional(),category:Ln,actor:Rn,target:zn,request:Bn,response:Vn.optional(),connection:e.z.string().optional(),connection_id:e.z.string().optional(),client_name:e.z.string().optional(),strategy:e.z.string().optional(),strategy_type:e.z.string().optional(),audience:e.z.string().optional(),scope:e.z.string().optional(),location:Hn.optional(),auth0_client:Un.optional(),hostname:e.z.string(),is_mobile:e.z.boolean().optional(),timestamp:e.z.string()}).extend({id:e.z.string()}),e.z.enum([`AUTH0`,`EMAIL`,`REDIRECT`]),e.z.enum([`CREATE_USER`,`GET_USER`,`UPDATE_USER`,`SEND_REQUEST`,`SEND_EMAIL`]),e.z.enum([`VERIFY_EMAIL`]);var Wn=e.z.object({require_mx_record:e.z.boolean().optional(),block_aliases:e.z.boolean().optional(),block_free_emails:e.z.boolean().optional(),block_disposable_emails:e.z.boolean().optional(),blocklist:e.z.array(e.z.string()).optional(),allowlist:e.z.array(e.z.string()).optional()}),Gn=e.z.object({id:e.z.string(),alias:e.z.string().max(100).optional(),type:e.z.literal(`AUTH0`),action:e.z.literal(`UPDATE_USER`),allow_failure:e.z.boolean().optional(),mask_output:e.z.boolean().optional(),params:e.z.object({connection_id:e.z.string().optional(),user_id:e.z.string(),changes:e.z.record(e.z.string(),e.z.any())})}),Kn=e.z.object({id:e.z.string(),alias:e.z.string().max(100).optional(),type:e.z.literal(`EMAIL`),action:e.z.literal(`VERIFY_EMAIL`),allow_failure:e.z.boolean().optional(),mask_output:e.z.boolean().optional(),params:e.z.object({email:e.z.string(),rules:Wn.optional()})}),qn=e.z.enum([`change-email`,`account`,`custom`]),Jn=e.z.object({id:e.z.string(),alias:e.z.string().max(100).optional(),type:e.z.literal(`REDIRECT`),action:e.z.literal(`REDIRECT_USER`),allow_failure:e.z.boolean().optional(),mask_output:e.z.boolean().optional(),params:e.z.object({target:qn.openapi({description:`The predefined target to redirect to, or 'custom' for a custom URL`}),custom_url:e.z.string().optional().openapi({description:`Custom URL to redirect to when target is 'custom'`})})}),Yn=e.z.union([Gn,Kn,Jn]);e.z.object({name:e.z.string().min(1).max(150).openapi({description:`The name of the flow`}),actions:e.z.array(Yn).optional().default([]).openapi({description:`The list of actions to execute in sequence`})}).extend(W.shape).extend({id:e.z.string().openapi({description:`Unique identifier for the flow`,example:`af_12tMpdJ3iek7svMyZkSh5M`})}),e.z.object({page:e.z.string().min(0).optional().default(`0`).transform(e=>parseInt(e,10)).openapi({description:`The page number where 0 is the first page`}),per_page:e.z.string().min(1).optional().default(`50`).transform(e=>parseInt(e,10)).openapi({description:`The number of items per page. Defaults to 50.`}),include_totals:e.z.string().optional().default(`false`).transform(e=>e===`true`).openapi({description:`If the total number of items should be included in the response`}),sort:e.z.string().regex(/^.+:(-1|1)$/).optional().openapi({description:`A property that should have the format 'string:-1' or 'string:1'`}),q:e.z.string().optional().openapi({description:`A lucene query string used to filter the results`})}),e.z.object({start:e.z.number(),limit:e.z.number(),length:e.z.number(),total:e.z.number().optional(),next:e.z.string().optional()});var Xn=e.z.object({email:e.z.string().optional(),email_verified:e.z.boolean().optional(),name:e.z.string().optional(),username:e.z.string().optional(),given_name:e.z.string().optional(),phone_number:e.z.string().optional(),phone_verified:e.z.boolean().optional(),family_name:e.z.string().optional()}).catchall(e.z.any()),Zn=e.z.object({connection:e.z.string(),user_id:e.z.string(),provider:e.z.string(),isSocial:e.z.boolean(),email:e.z.string().optional(),email_verified:e.z.boolean().optional(),phone_number:e.z.string().optional(),phone_verified:e.z.boolean().optional(),username:e.z.string().optional(),access_token:e.z.string().optional(),access_token_secret:e.z.string().optional(),refresh_token:e.z.string().optional(),profileData:Xn.optional()}),Qn=e.z.object({formatted:e.z.string().optional(),street_address:e.z.string().optional(),locality:e.z.string().optional(),region:e.z.string().optional(),postal_code:e.z.string().optional(),country:e.z.string().optional()}).optional(),$n=e.z.object({email:e.z.string().transform(e=>e.toLowerCase()).optional(),username:e.z.string().refine(e=>!e.includes(`@`),{message:`Usernames must not contain "@". Use the email field for email addresses.`}).optional(),phone_number:e.z.string().optional(),phone_verified:e.z.boolean().optional(),given_name:e.z.string().optional(),family_name:e.z.string().optional(),nickname:e.z.string().optional(),name:e.z.string().optional(),picture:e.z.string().optional(),locale:e.z.string().optional(),linked_to:e.z.string().optional(),profileData:e.z.string().optional(),user_id:e.z.string().optional(),app_metadata:e.z.any().default({}).optional(),user_metadata:e.z.any().default({}).optional(),middle_name:e.z.string().optional(),preferred_username:e.z.string().optional(),profile:e.z.string().optional(),website:e.z.string().optional(),gender:e.z.string().optional(),birthdate:e.z.string().optional(),zoneinfo:e.z.string().optional(),address:Qn});$n.extend({email_verified:e.z.boolean().default(!1),verify_email:e.z.boolean().optional(),last_ip:e.z.string().optional(),last_login:e.z.string().optional(),user_id:e.z.string().optional(),provider:e.z.string().optional(),connection:e.z.string(),is_social:e.z.boolean().optional(),blocked:e.z.boolean().optional(),registration_completed_at:e.z.string().optional(),password:e.z.object({hash:e.z.string(),algorithm:e.z.string()}).optional()}).omit({password:!0}).extend(W.shape).extend({user_id:e.z.string(),provider:e.z.string(),is_social:e.z.boolean(),email:e.z.string().optional(),login_count:e.z.number().default(0),identities:e.z.array(Zn).optional()}).omit({registration_completed_at:!0}),$n.extend({login_count:e.z.number(),multifactor:e.z.array(e.z.string()).optional(),last_ip:e.z.string().optional(),last_login:e.z.string().optional(),user_id:e.z.string()}).catchall(e.z.any());var er=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,tr=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=er[n[e]&63];return t},nr=e.z.object({client_id:e.z.string().optional().openapi({description:`ID of this client. Generated server-side if omitted (Auth0 behavior).`}),name:e.z.string().min(1).openapi({description:`Name of this client (min length: 1 character, does not allow < or >).`}),description:e.z.string().max(140).optional().openapi({description:`Free text description of this client (max length: 140 characters).`}),global:e.z.boolean().default(!1).openapi({description:`Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false).`}),client_secret:e.z.string().default(()=>tr()).optional().openapi({description:`Client secret (which you must not make public).`}),app_type:e.z.enum([`native`,`spa`,`regular_web`,`non_interactive`,`resource_server`,`express_configuration`,`rms`,`box`,`cloudbees`,`concur`,`dropbox`,`mscrm`,`echosign`,`egnyte`,`newrelic`,`office365`,`salesforce`,`sentry`,`sharepoint`,`slack`,`springcm`,`zendesk`,`zoom`,`sso_integration`,`oag`]).default(`regular_web`).optional().openapi({description:`The type of application this client represents`}),logo_uri:e.z.string().url().optional().openapi({description:`URL of the logo to display for this client. Recommended size is 150x150 pixels.`}),is_first_party:e.z.boolean().default(!0).openapi({description:`Whether this client is a first party client (true) or not (false). First-party clients skip the consent screen; third-party clients require explicit user consent for non-basic scopes.`}),oidc_conformant:e.z.boolean().default(!0).openapi({description:`Whether this client conforms to strict OIDC specifications (true) or uses legacy features (false).`}),auth0_conformant:e.z.boolean().default(!0).openapi({description:`Whether this client follows Auth0-compatible behavior (true) or strict OIDC behavior (false). When true, profile/email claims are included in the ID token when scopes are requested. When false, these claims are only available from the userinfo endpoint (strict OIDC 5.4 compliance).`}),callbacks:e.z.array(e.z.string()).default([]).optional().openapi({description:`Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.`}),allowed_origins:e.z.array(e.z.string()).default([]).optional().openapi({description:`Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.`}),web_origins:e.z.array(e.z.string()).default([]).optional().openapi({description:`Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode.`}),client_aliases:e.z.array(e.z.string()).default([]).optional().openapi({description:`List of audiences/realms for SAML protocol. Used by the wsfed addon.`}),allowed_clients:e.z.array(e.z.string()).default([]).optional().openapi({description:`List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.`}),connections:e.z.array(e.z.string()).default([]).optional().openapi({description:`List of connection IDs enabled for this client. The order determines the display order on the login page.`}),allowed_logout_urls:e.z.array(e.z.string()).default([]).optional().openapi({description:`Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.`}),session_transfer:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Native to Web SSO Configuration`}),oidc_logout:e.z.object({backchannel_logout_urls:e.z.array(e.z.string()).optional().openapi({description:`URLs that receive a signed OIDC Back-Channel Logout 1.0 logout token when a session this client participated in ends.`}),backchannel_logout_initiators:e.z.object({mode:e.z.enum([`all`,`custom`]).optional().openapi({description:`Whether all session-end events initiate a backchannel logout (all) or only the selected_initiators (custom).`}),selected_initiators:e.z.array(e.z.string()).optional().openapi({description:`Logout initiators that trigger a backchannel logout when mode is custom (e.g. rp-logout, idp-logout, password-changed).`})}).passthrough().optional().openapi({description:`Controls which session-end events initiate backchannel logout notifications. Stored for Auth0 compatibility; not yet enforced — all initiators currently notify.`})}).passthrough().default({}).optional().openapi({description:`Configuration for OIDC backchannel logout`}),grant_types:e.z.array(e.z.string()).default([]).optional().openapi({description:`List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.`}),jwt_configuration:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Configuration related to JWTs for the client.`}),signing_keys:e.z.array(e.z.record(e.z.string(),e.z.any())).default([]).optional().openapi({description:`Signing certificates associated with this client.`}),encryption_key:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Encryption used for WsFed responses with this client.`}),sso:e.z.boolean().default(!1).openapi({description:`Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).`}),sso_disabled:e.z.boolean().default(!1).openapi({description:`Whether Single Sign On is disabled for this client. When true, existing SSO sessions will not be reused and users must authenticate every time.`}),cross_origin_authentication:e.z.boolean().default(!1).openapi({description:`Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).`}),cross_origin_loc:e.z.string().url().optional().openapi({description:`URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.`}),custom_login_page_on:e.z.boolean().default(!1).openapi({description:`Whether a custom login page is to be used (true) or the default provided login page (false).`}),custom_login_page:e.z.string().optional().openapi({description:`The content (HTML, CSS, JS) of the custom login page.`}),custom_login_page_preview:e.z.string().optional().openapi({description:`The content (HTML, CSS, JS) of the custom login page. (Used on Previews)`}),form_template:e.z.string().optional().openapi({description:`HTML form template to be used for WS-Federation.`}),addons:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Addons enabled for this client and their associated configurations.`}),token_endpoint_auth_method:e.z.enum([`none`,`client_secret_post`,`client_secret_basic`,`client_secret_jwt`,`private_key_jwt`]).default(`client_secret_basic`).optional().openapi({description:"Defines the requested authentication method for the token endpoint. `none` (public client), `client_secret_post` / `client_secret_basic` (HTTP POST / Basic), `client_secret_jwt` (RFC 7523 HMAC assertion using client_secret), or `private_key_jwt` (RFC 7523 asymmetric assertion verified against the client's `jwks` / `jwks_uri`)."}),client_metadata:e.z.record(e.z.string(),e.z.string().max(255)).default({}).optional().openapi({description:`Metadata associated with the client, in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed. Field names (max 255 chars) are alphanumeric and may only include the following special characters: :,-+=_*?"/()<>@ [Tab][Space]`}),hide_sign_up_disabled_error:e.z.boolean().default(!1).optional().openapi({description:"Enumeration-safe variant of the connection-level `disable_signup` flag. When a signup is blocked by the password connection and this is true, the identifier screen does not reveal that an email is unknown — it advances to the OTP/password challenge as if the account existed and fails at credential check. Mitigates email enumeration at the cost of UX: users without an account see a generic credential failure instead of an explicit signup-disabled message."}),mobile:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Additional configuration for native mobile apps.`}),initiate_login_uri:e.z.string().url().optional().openapi({description:`Initiate login uri, must be https`}),native_social_login:e.z.record(e.z.string(),e.z.any()).default({}).optional(),refresh_token:e.z.object({rotation_type:e.z.enum([`rotating`,`non-rotating`]).optional().openapi({description:`Whether refresh tokens for this client are rotated on every exchange (Auth0 'rotating' behavior) or kept stable (legacy non-rotating). Defaults to 'non-rotating' when unset.`}),leeway:e.z.number().int().min(0).max(600).optional().openapi({description:`Seconds after a parent token's first rotation during which presenting it again still mints a fresh sibling child instead of triggering reuse-detection. Defaults to 30s when unset.`}),expiration_type:e.z.enum([`expiring`,`non-expiring`]).optional().openapi({description:`Whether refresh tokens for this client expire at all. 'non-expiring' overrides both the absolute and the idle lifetime.`}),token_lifetime:e.z.number().int().min(0).optional().openapi({description:"Refresh-token absolute lifetime in seconds. Falls back to the tenant's `session_lifetime` when unset."}),infinite_token_lifetime:e.z.boolean().optional().openapi({description:"When true, refresh tokens have no absolute expiry (overrides `token_lifetime`)."}),idle_token_lifetime:e.z.number().int().min(0).optional().openapi({description:"Refresh-token idle (sliding) lifetime in seconds, refreshed on every exchange. Falls back to the tenant's `idle_session_lifetime` when unset."}),infinite_idle_token_lifetime:e.z.boolean().optional().openapi({description:"When true, refresh tokens have no idle expiry (overrides `idle_token_lifetime`)."})}).default({}).optional().openapi({description:`Refresh token configuration`}),default_organization:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Defines the default Organization ID and flows`}),organization_usage:e.z.enum([`deny`,`allow`,`require`]).default(`deny`).optional().openapi({description:`Defines how to proceed during an authentication transaction with regards an organization. Can be deny (default), allow or require.`}),organization_require_behavior:e.z.enum([`no_prompt`,`pre_login_prompt`,`post_login_prompt`]).default(`no_prompt`).optional().openapi({description:`Defines how to proceed during an authentication transaction when client.organization_usage: 'require'. Can be no_prompt (default), pre_login_prompt or post_login_prompt. post_login_prompt requires oidc_conformant: true.`}),client_authentication_methods:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Defines client authentication methods.`}),require_pushed_authorization_requests:e.z.boolean().default(!1).openapi({description:`Makes the use of Pushed Authorization Requests mandatory for this client`}),require_proof_of_possession:e.z.boolean().default(!1).openapi({description:`Makes the use of Proof-of-Possession mandatory for this client`}),signed_request_object:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`JWT-secured Authorization Requests (JAR) settings.`}),compliance_level:e.z.enum([`none`,`fapi1_adv_pkj_par`,`fapi1_adv_mtls_par`,`fapi2_sp_pkj_mtls`,`fapi2_sp_mtls_mtls`]).optional().openapi({description:`Defines the compliance level for this client, which may restrict it's capabilities`}),par_request_expiry:e.z.number().optional().openapi({description:`Specifies how long, in seconds, a Pushed Authorization Request URI remains valid`}),token_quota:e.z.record(e.z.string(),e.z.any()).default({}).optional(),owner_user_id:e.z.string().optional().openapi({description:`User ID of the consenting user when this client was created via IAT-gated Dynamic Client Registration. NULL for clients created via the Management API or open DCR.`}),registration_type:e.z.enum([`manual`,`open_dcr`,`iat_dcr`]).optional().openapi({description:"Provenance of this client. `manual` = Management API; `open_dcr` = RFC 7591 without IAT; `iat_dcr` = RFC 7591 with an Initial Access Token."}),registration_metadata:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:"Arbitrary metadata captured at Dynamic Client Registration time that isn't a first-class client field (e.g. integration_type, domain). Also stores `iat_constraints` for clients created via IAT so RFC 7592 PUT can enforce field immutability."}),user_linking_mode:e.z.enum([`builtin`,`off`]).optional().openapi({description:"Per-client override for the built-in email-based user-linking path. `builtin` runs the legacy in-process linking at user creation/email update. `off` disables the legacy path; linking only happens if the tenant has enabled the `account-linking` template hook. When unset, the service-level `userLinkingMode` default applies."})});e.z.object({created_at:e.z.string(),updated_at:e.z.string()}).extend(nr.shape).extend({client_id:e.z.string()});var rr=e.z.object({client_id:e.z.string().min(1).openapi({description:`ID of the client.`}),audience:e.z.string().min(1).openapi({description:`The audience (API identifier) of this client grant.`}),scope:e.z.array(e.z.string()).optional().openapi({description:`Scopes allowed for this client grant.`}),organization_usage:e.z.enum([`deny`,`allow`,`require`]).optional().openapi({description:`Defines whether organizations can be used with client credentials exchanges for this grant.`}),allow_any_organization:e.z.boolean().optional().openapi({description:`If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.`}),is_system:e.z.boolean().optional().openapi({description:`If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly.`}),subject_type:e.z.enum([`client`,`user`]).optional().openapi({description:`The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement.`}),authorization_details_types:e.z.array(e.z.string()).optional().openapi({description:`Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement.`})}),ir=e.z.object({id:e.z.string().openapi({description:`ID of the client grant.`})}).extend(rr.shape).extend({created_at:e.z.string().optional(),updated_at:e.z.string().optional()});e.z.array(ir);var ar=e.z.enum([`iat`,`rat`]),or=e.z.object({id:e.z.string(),token_hash:e.z.string(),type:ar,client_id:e.z.string().optional(),sub:e.z.string().optional(),constraints:e.z.record(e.z.string(),e.z.unknown()).optional(),single_use:e.z.boolean().default(!1),expires_at:e.z.string().optional()});e.z.object({created_at:e.z.string(),used_at:e.z.string().optional(),revoked_at:e.z.string().optional()}).extend(or.shape);var G=e.z.object({x:e.z.number(),y:e.z.number()}),sr=function(e){return e.RICH_TEXT=`RICH_TEXT`,e.NEXT_BUTTON=`NEXT_BUTTON`,e.BACK_BUTTON=`BACK_BUTTON`,e.SUBMIT_BUTTON=`SUBMIT_BUTTON`,e.DIVIDER=`DIVIDER`,e.TEXT=`TEXT`,e.EMAIL=`EMAIL`,e.PASSWORD=`PASSWORD`,e.NUMBER=`NUMBER`,e.PHONE=`PHONE`,e.DATE=`DATE`,e.CHECKBOX=`CHECKBOX`,e.RADIO=`RADIO`,e.SELECT=`SELECT`,e.HIDDEN=`HIDDEN`,e.LEGAL=`LEGAL`,e}({}),cr=function(e){return e.BLOCK=`BLOCK`,e.FIELD=`FIELD`,e}({}),K=e.z.object({id:e.z.string(),category:e.z.nativeEnum(cr),type:e.z.nativeEnum(sr)}),lr=K.extend({category:e.z.literal(`BLOCK`),type:e.z.literal(`RICH_TEXT`),config:e.z.object({content:e.z.string()}).passthrough()}),ur=K.extend({category:e.z.literal(`BLOCK`),type:e.z.union([e.z.literal(`NEXT_BUTTON`),e.z.literal(`BACK_BUTTON`),e.z.literal(`SUBMIT_BUTTON`)]),config:e.z.object({text:e.z.string()}).passthrough()}),dr=K.extend({category:e.z.literal(`FIELD`),type:e.z.literal(`LEGAL`),required:e.z.boolean().optional(),sensitive:e.z.boolean().optional(),config:e.z.object({text:e.z.string()}).passthrough()}),fr=K.extend({category:e.z.literal(`FIELD`),type:e.z.union([e.z.literal(`TEXT`),e.z.literal(`EMAIL`),e.z.literal(`PASSWORD`),e.z.literal(`NUMBER`),e.z.literal(`PHONE`),e.z.literal(`DATE`),e.z.literal(`CHECKBOX`),e.z.literal(`RADIO`),e.z.literal(`SELECT`),e.z.literal(`HIDDEN`)]),required:e.z.boolean().optional(),sensitive:e.z.boolean().optional(),config:e.z.object({label:e.z.string().optional(),placeholder:e.z.string().optional()}).passthrough()}),pr=e.z.object({id:e.z.string(),category:e.z.string(),type:e.z.string()}).passthrough(),mr=e.z.union([lr,ur,dr,fr,pr]),hr=e.z.object({id:e.z.string(),type:e.z.literal(`STEP`),coordinates:G,alias:e.z.string().optional(),config:e.z.object({components:e.z.array(mr),next_node:e.z.string()}).passthrough()}),gr=e.z.object({id:e.z.string(),type:e.z.literal(`FLOW`),coordinates:G,alias:e.z.string().optional(),config:e.z.object({flow_id:e.z.string(),next_node:e.z.string()})}),_r=e.z.object({id:e.z.string(),type:e.z.literal(`ACTION`),coordinates:G,alias:e.z.string().optional(),config:e.z.object({action_type:e.z.enum([`REDIRECT`]).openapi({description:`The type of action to perform`}),target:e.z.enum([`change-email`,`account`,`custom`]).openapi({description:`The predefined target to redirect to`}),custom_url:e.z.string().optional().openapi({description:`Custom URL when target is 'custom'`}),next_node:e.z.string().openapi({description:`The next node to navigate to after action (for non-redirect actions)`})}).passthrough()}),vr=e.z.object({id:e.z.string(),type:e.z.string(),coordinates:G}).passthrough(),yr=e.z.union([hr,gr,_r,vr]),br=e.z.object({next_node:e.z.string(),coordinates:G}).passthrough(),xr=e.z.object({resume_flow:e.z.boolean().optional(),coordinates:G}).passthrough();e.z.object({id:e.z.string(),name:e.z.string(),languages:e.z.object({primary:e.z.string()}).passthrough(),nodes:e.z.array(yr),start:br,ending:xr,created_at:e.z.string(),updated_at:e.z.string(),links:e.z.object({sdkSrc:e.z.string().optional(),sdk_src:e.z.string().optional()}).passthrough()}).passthrough().omit({id:!0,created_at:!0,updated_at:!0});var Sr=function(e){return e.TOKEN=`token`,e.ID_TOKEN=`id_token`,e.TOKEN_ID_TOKEN=`id_token token`,e.CODE=`code`,e.CODE_ID_TOKEN=`code id_token`,e.CODE_TOKEN=`code token`,e.CODE_ID_TOKEN_TOKEN=`code id_token token`,e}({}),Cr=function(e){return e.QUERY=`query`,e.FRAGMENT=`fragment`,e.FORM_POST=`form_post`,e.WEB_MESSAGE=`web_message`,e.SAML_POST=`saml_post`,e}({}),wr=function(e){return e.S256=`S256`,e.Plain=`plain`,e}({}),Tr=e.z.union([e.z.null(),e.z.object({essential:e.z.boolean().optional(),value:e.z.unknown().optional(),values:e.z.array(e.z.unknown()).optional()})]).nullable(),Er=e.z.object({userinfo:e.z.record(e.z.string(),Tr).optional(),id_token:e.z.record(e.z.string(),Tr).optional()}),Dr=e.z.object({client_id:e.z.string(),act_as:e.z.string().optional(),response_type:e.z.nativeEnum(Sr).optional(),response_mode:e.z.nativeEnum(Cr).optional(),redirect_uri:e.z.string().optional(),audience:e.z.string().optional(),organization:e.z.string().optional(),state:e.z.string().optional(),nonce:e.z.string().optional(),scope:e.z.string().optional(),prompt:e.z.string().optional(),code_challenge_method:e.z.nativeEnum(wr).optional(),code_challenge:e.z.string().optional(),username:e.z.string().optional(),ui_locales:e.z.string().optional(),max_age:e.z.number().optional(),acr_values:e.z.string().optional(),claims:Er.optional(),vendor_id:e.z.string().optional()});e.z.object({colors:e.z.object({primary:e.z.string(),page_background:e.z.union([e.z.string(),e.z.object({type:e.z.string().optional(),start:e.z.string().optional(),end:e.z.string().optional(),angle_deg:e.z.number().optional()})]).optional()}).optional(),logo_url:e.z.string().optional(),favicon_url:e.z.string().optional(),powered_by_logo_url:e.z.string().optional(),font:e.z.object({url:e.z.string()}).optional(),dark_mode:e.z.enum([`dark`,`light`,`auto`]).optional()});var Or=e.z.enum([`password_reset`,`email_verification`,`otp`,`mfa_otp`,`authorization_code`,`oauth2_state`,`ticket`,`client_assertion_jti`]);e.z.object({code_id:e.z.string().openapi({description:`The code that will be used in for instance an email verification flow`}),login_id:e.z.string().optional().openapi({description:`The id of the login session that the code is connected to`}),connection_id:e.z.string().optional().openapi({description:`The connection that the code is connected to`}),code_type:Or,code_verifier:e.z.string().optional().openapi({description:`The code verifier used in PKCE in outbound flows`}),code_challenge:e.z.string().optional().openapi({description:`The code challenge used in PKCE in outbound flows`}),code_challenge_method:e.z.enum([`plain`,`S256`]).optional().openapi({description:`The code challenge method used in PKCE in outbound flows`}),redirect_uri:e.z.string().optional().openapi({description:`The redirect URI associated with the code`}),otp:e.z.string().optional().openapi({description:`The one-time password value for OTP-based flows`}),nonce:e.z.string().optional().openapi({description:`The nonce value used for security in OIDC flows`}),state:e.z.string().optional().openapi({description:`The state parameter used for CSRF protection in OAuth flows`}),expires_at:e.z.string(),used_at:e.z.string().optional(),user_id:e.z.string().optional()}).extend({created_at:e.z.string()});var kr=e.z.object({kid:e.z.string().optional(),team_id:e.z.string().optional(),realms:e.z.string().optional(),authentication_method:e.z.string().optional(),client_id:e.z.string().optional(),client_secret:e.z.string().optional(),app_secret:e.z.string().optional(),scope:e.z.string().optional(),client_secret_hint:e.z.string().optional(),app_secret_hint:e.z.string().optional(),twilio_token_hint:e.z.string().optional(),authorization_endpoint:e.z.string().optional(),token_endpoint:e.z.string().optional(),userinfo_endpoint:e.z.string().optional(),jwks_uri:e.z.string().optional(),discovery_url:e.z.string().optional(),issuer:e.z.string().optional(),token_endpoint_auth_method:e.z.enum([`client_secret_basic`,`client_secret_post`]).optional(),provider:e.z.string().optional(),from:e.z.string().optional(),twilio_sid:e.z.string().optional(),twilio_token:e.z.string().optional(),icon_url:e.z.string().optional(),domain_aliases:e.z.array(e.z.string()).optional(),callback_url:e.z.string().url().optional(),passwordPolicy:e.z.enum([`none`,`low`,`fair`,`good`,`excellent`]).optional(),password_complexity_options:e.z.object({min_length:e.z.number().optional()}).optional(),password_history:e.z.object({enable:e.z.boolean().optional(),size:e.z.number().optional()}).optional(),password_no_personal_info:e.z.object({enable:e.z.boolean().optional()}).optional(),password_dictionary:e.z.object({enable:e.z.boolean().optional(),dictionary:e.z.array(e.z.string()).optional()}).optional(),disable_signup:e.z.boolean().optional(),brute_force_protection:e.z.boolean().optional(),import_mode:e.z.boolean().optional(),configuration:e.z.object({token_endpoint:e.z.string().optional(),userinfo_endpoint:e.z.string().optional(),client_id:e.z.string().optional(),client_secret:e.z.string().optional(),client_secret_hint:e.z.string().optional(),realm:e.z.string().optional()}).optional(),attributes:e.z.object({email:e.z.object({identifier:e.z.object({active:e.z.boolean().optional()}).optional(),signup:e.z.object({status:e.z.enum([`required`,`optional`,`disabled`]).optional(),verification:e.z.object({active:e.z.boolean().optional()}).optional()}).optional(),validation:e.z.object({allowed:e.z.boolean().optional()}).optional(),unique:e.z.boolean().optional(),profile_required:e.z.boolean().optional(),verification_method:e.z.enum([`link`,`code`]).optional()}).optional(),username:e.z.object({identifier:e.z.object({active:e.z.boolean().optional()}).optional(),signup:e.z.object({status:e.z.enum([`required`,`optional`,`disabled`]).optional()}).optional(),validation:e.z.object({max_length:e.z.number().optional(),min_length:e.z.number().optional(),allowed_types:e.z.object({email:e.z.boolean().optional(),phone_number:e.z.boolean().optional()}).optional()}).optional(),profile_required:e.z.boolean().optional()}).optional(),phone_number:e.z.object({identifier:e.z.object({active:e.z.boolean().optional()}).optional(),signup:e.z.object({status:e.z.enum([`required`,`optional`,`disabled`]).optional()}).optional()}).optional()}).optional(),authentication_methods:e.z.object({password:e.z.object({enabled:e.z.boolean().optional()}).optional(),passkey:e.z.object({enabled:e.z.boolean().optional()}).optional()}).optional(),passkey_options:e.z.object({challenge_ui:e.z.enum([`both`,`autofill`,`button`]).optional(),local_enrollment_enabled:e.z.boolean().optional(),progressive_enrollment_enabled:e.z.boolean().optional()}).optional(),requires_username:e.z.boolean().optional(),validation:e.z.object({username:e.z.object({min:e.z.number().optional(),max:e.z.number().optional()}).optional()}).optional(),set_user_root_attributes:e.z.enum([`on_each_login`,`on_first_login`,`never_on_login`]).optional()});function Ar(e){if(e!==null){if(Array.isArray(e))return e.filter(e=>e!==null).map(Ar);if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))r!==null&&(t[n]=Ar(r));return t}return e}}var jr=e.z.object({id:e.z.string().optional(),name:e.z.string(),display_name:e.z.string().optional(),strategy:e.z.string(),options:e.z.preprocess(e=>e===null?{}:Ar(e),kr).default({}),enabled_clients:e.z.array(e.z.string()).default([]).optional(),response_type:e.z.nativeEnum(Sr).optional(),response_mode:e.z.nativeEnum(Cr).optional(),is_domain_connection:e.z.boolean().optional(),show_as_button:e.z.boolean().optional(),metadata:e.z.record(e.z.string(),e.z.any()).optional(),is_system:e.z.boolean().optional()});e.z.object({id:e.z.string(),created_at:e.z.string().transform(e=>e===null?``:e),updated_at:e.z.string().transform(e=>e===null?``:e)}).extend(jr.shape);var Mr=e.z.object({domain:e.z.string(),custom_domain_id:e.z.string().optional(),type:e.z.enum([`auth0_managed_certs`,`self_managed_certs`]),verification_method:e.z.enum([`txt`]).optional(),tls_policy:e.z.enum([`recommended`]).optional(),custom_client_ip_header:e.z.enum([`true-client-ip`,`cf-connecting-ip`,`x-forwarded-for`,`x-azure-clientip`,`null`]).optional(),domain_metadata:e.z.record(e.z.string(),e.z.string().max(255)).optional()}),Nr=e.z.discriminatedUnion(`name`,[e.z.object({name:e.z.literal(`txt`),record:e.z.string(),domain:e.z.string()}),e.z.object({name:e.z.literal(`http`),http_body:e.z.string(),http_url:e.z.string()})]),Pr=Mr.extend({custom_domain_id:e.z.string(),primary:e.z.boolean(),status:e.z.enum([`disabled`,`pending`,`pending_verification`,`ready`]),origin_domain_name:e.z.string().optional(),verification:e.z.object({methods:e.z.array(Nr)}).optional(),tls_policy:e.z.string().optional()});Mr.pick({tls_policy:!0,custom_client_ip_header:!0,domain_metadata:!0}).strict(),Pr.extend({tenant_id:e.z.string()}),e.z.object({certificate:e.z.string().regex(/^-----BEGIN CERTIFICATE-----[\s\S]+-----END CERTIFICATE-----\s*$/,`must be PEM-encoded; include the full certificate chain in leaf-first order`),private_key:e.z.string().regex(/-----BEGIN (RSA |EC |ENCRYPTED )?PRIVATE KEY-----[\s\S]+-----END \1PRIVATE KEY-----\s*$/,`must be a PEM-encoded private key`)});var Fr=e.z.object({id:e.z.string(),order:e.z.number().optional(),visible:e.z.boolean().optional().default(!0)}),q=Fr.extend({category:e.z.literal(`BLOCK`).optional()}),Ir=q.extend({type:e.z.literal(`DIVIDER`),config:e.z.object({text:e.z.string().optional()}).optional()}),Lr=q.extend({type:e.z.literal(`HTML`),config:e.z.object({content:e.z.string().optional()}).optional()}),Rr=q.extend({type:e.z.literal(`IMAGE`),config:e.z.object({src:e.z.string().optional(),alt:e.z.string().optional(),width:e.z.number().optional(),height:e.z.number().optional()}).optional()}),zr=q.extend({type:e.z.literal(`JUMP_BUTTON`),config:e.z.object({text:e.z.string().optional(),target_step:e.z.string().optional()})}),Br=q.extend({type:e.z.literal(`RESEND_BUTTON`),config:e.z.object({text:e.z.string().optional(),resend_action:e.z.string().optional()})}),Vr=q.extend({type:e.z.literal(`NEXT_BUTTON`),config:e.z.object({text:e.z.string().optional()})}),Hr=q.extend({type:e.z.literal(`PREVIOUS_BUTTON`),config:e.z.object({text:e.z.string().optional()})}),Ur=q.extend({type:e.z.literal(`RICH_TEXT`),config:e.z.object({content:e.z.string().optional()}).optional()}),J=Fr.extend({category:e.z.literal(`WIDGET`).optional(),label:e.z.string().min(1).optional(),hint:e.z.string().min(1).max(500).optional(),required:e.z.boolean().optional(),sensitive:e.z.boolean().optional()}),Wr=J.extend({type:e.z.literal(`AUTH0_VERIFIABLE_CREDENTIALS`),config:e.z.object({credential_type:e.z.string().optional()})}),Gr=J.extend({type:e.z.literal(`GMAPS_ADDRESS`),config:e.z.object({api_key:e.z.string().optional()})}),Kr=J.extend({type:e.z.literal(`RECAPTCHA`),config:e.z.object({site_key:e.z.string().optional()})}),Y=Fr.extend({category:e.z.literal(`FIELD`).optional(),label:e.z.string().min(1).optional(),hint:e.z.string().min(1).max(500).optional(),messages:e.z.array(e.z.object({id:e.z.number().optional(),text:e.z.string(),type:e.z.enum([`info`,`error`,`success`,`warning`])})).optional(),required:e.z.boolean().optional(),sensitive:e.z.boolean().optional()}),qr=Y.extend({type:e.z.literal(`BOOLEAN`),config:e.z.object({default_value:e.z.boolean().optional()}).optional()}),Jr=Y.extend({type:e.z.literal(`CARDS`),config:e.z.object({options:e.z.array(e.z.object({value:e.z.string(),label:e.z.string(),description:e.z.string().optional(),image:e.z.string().optional()})).optional(),multi_select:e.z.boolean().optional()}).optional()}),Yr=Y.extend({type:e.z.literal(`CHOICE`),config:e.z.object({options:e.z.array(e.z.object({value:e.z.string(),label:e.z.string()})).optional(),display:e.z.enum([`radio`,`checkbox`]).optional(),multiple:e.z.boolean().optional(),default_value:e.z.union([e.z.string(),e.z.array(e.z.string())]).optional()}).optional()}),Xr=Y.extend({type:e.z.literal(`CODE`),config:e.z.object({length:e.z.number().int().positive().max(100).optional(),mode:e.z.enum([`numeric`,`alphanumeric`]).optional(),auto_submit:e.z.boolean().optional(),group_size:e.z.number().int().min(0).max(100).optional(),separator:e.z.string().optional(),placeholder:e.z.string().optional(),default_value:e.z.string().optional()}).refine(e=>e.group_size===void 0||e.length===void 0||e.group_size<=e.length,{message:`group_size cannot exceed length`,path:[`group_size`]}).refine(e=>e.default_value===void 0||e.length===void 0||e.default_value.length<=e.length,{message:`default_value is longer than the configured length`,path:[`default_value`]}).optional()}),Zr=Y.extend({type:e.z.literal(`CUSTOM`),config:e.z.object({component:e.z.string().optional(),props:e.z.record(e.z.string(),e.z.any()).optional(),schema:e.z.record(e.z.string(),e.z.any()).optional(),code:e.z.string().optional()})}),Qr=Y.extend({type:e.z.literal(`DATE`),config:e.z.object({format:e.z.string().optional(),min:e.z.string().optional(),max:e.z.string().optional(),default_value:e.z.string().optional()}).optional()}),$r=Y.extend({type:e.z.literal(`DROPDOWN`),config:e.z.object({options:e.z.array(e.z.object({value:e.z.string(),label:e.z.string()})).optional(),placeholder:e.z.string().optional(),searchable:e.z.boolean().optional(),multiple:e.z.boolean().optional(),default_value:e.z.union([e.z.string(),e.z.array(e.z.string())]).optional()}).optional()}),ei=Y.extend({type:e.z.literal(`EMAIL`),config:e.z.object({placeholder:e.z.string().optional(),default_value:e.z.string().optional(),last_used:e.z.boolean().optional(),last_used_label:e.z.string().optional()}).optional()}),ti=Y.extend({type:e.z.literal(`FILE`),config:e.z.object({accept:e.z.string().optional(),max_size:e.z.number().optional(),multiple:e.z.boolean().optional()}).optional()}),ni=Y.extend({type:e.z.literal(`LEGAL`),config:e.z.object({text:e.z.string(),html:e.z.boolean().optional()}).optional()}),ri=Y.extend({type:e.z.literal(`NUMBER`),config:e.z.object({placeholder:e.z.string().optional(),min:e.z.number().optional(),max:e.z.number().optional(),step:e.z.number().optional(),default_value:e.z.string().optional()}).optional()}),ii=Y.extend({type:e.z.literal(`PASSWORD`),config:e.z.object({placeholder:e.z.string().optional(),min_length:e.z.number().optional(),show_toggle:e.z.boolean().optional(),forgot_password_link:e.z.string().optional(),default_value:e.z.string().optional()}).optional()}),ai=Y.extend({type:e.z.literal(`PAYMENT`),config:e.z.object({provider:e.z.string().optional(),currency:e.z.string().optional()}).optional()}),oi=Y.extend({type:e.z.literal(`SOCIAL`),config:e.z.object({providers:e.z.array(e.z.string()).optional(),provider_details:e.z.array(e.z.object({name:e.z.string(),strategy:e.z.string().optional(),display_name:e.z.string().optional(),icon_url:e.z.string().optional(),href:e.z.string().optional(),last_used:e.z.boolean().optional(),last_used_label:e.z.string().optional()})).optional()}).optional()}),si=Y.extend({type:e.z.literal(`TEL`),config:e.z.object({placeholder:e.z.string().optional(),default_country:e.z.string().optional(),default_value:e.z.string().optional(),allow_email:e.z.boolean().optional()}).optional()}),ci=Y.extend({type:e.z.literal(`TEXT`),config:e.z.object({placeholder:e.z.string().optional(),multiline:e.z.boolean().optional(),max_length:e.z.number().optional(),default_value:e.z.string().optional(),last_used:e.z.boolean().optional(),last_used_label:e.z.string().optional()}).optional()}),li=Y.extend({type:e.z.literal(`COUNTRY`),config:e.z.object({placeholder:e.z.string().optional(),default_value:e.z.string().optional()}).optional()}),ui=Y.extend({type:e.z.literal(`URL`),config:e.z.object({placeholder:e.z.string().optional(),default_value:e.z.string().optional()}).optional()}),di=e.z.discriminatedUnion(`type`,[Ir,Lr,Rr,zr,Br,Vr,Hr,Ur]),fi=e.z.discriminatedUnion(`type`,[Wr,Gr,Kr]),pi=e.z.discriminatedUnion(`type`,[qr,Jr,Yr,Xr,li,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,ui]),mi=e.z.union([di,fi,pi]);new Set([`BOOLEAN`,`CARDS`,`CHOICE`,`CODE`,`COUNTRY`,`DATE`,`DROPDOWN`,`EMAIL`,`LEGAL`,`NUMBER`,`PASSWORD`,`TEL`,`TEXT`,`URL`]),e.z.object({id:e.z.string(),type:e.z.literal(`submit`),label:e.z.string(),className:e.z.string().optional(),disabled:e.z.boolean().optional().default(!1),order:e.z.number().optional(),visible:e.z.boolean().optional().default(!0),customizations:e.z.record(e.z.string(),e.z.any()).optional()});var X=e.z.object({x:e.z.number(),y:e.z.number()}),hi=e.z.object({id:e.z.string(),type:e.z.literal(`FLOW`),coordinates:X,alias:e.z.string().min(1).max(150).optional(),config:e.z.object({flow_id:e.z.string().max(30),next_node:e.z.string().optional()})}),gi=e.z.object({id:e.z.string(),type:e.z.literal(`ROUTER`),coordinates:X,alias:e.z.string().min(1).max(150),config:e.z.object({rules:e.z.array(e.z.object({id:e.z.string(),alias:e.z.string().min(1).max(150).optional(),condition:e.z.any(),next_node:e.z.string()})),fallback:e.z.string()})}),_i=e.z.object({id:e.z.string(),type:e.z.literal(`STEP`),coordinates:X,alias:e.z.string().min(1).max(150).optional(),config:e.z.object({components:e.z.array(mi),next_node:e.z.string().optional()})}),vi=e.z.discriminatedUnion(`type`,[hi,gi,_i]),yi=e.z.object({name:e.z.string().openapi({description:`The name of the form`}),messages:e.z.object({errors:e.z.record(e.z.string(),e.z.any()).optional(),custom:e.z.record(e.z.string(),e.z.any()).optional()}).optional(),languages:e.z.object({primary:e.z.string().optional(),default:e.z.string().optional()}).optional(),translations:e.z.record(e.z.string(),e.z.any()).optional(),nodes:e.z.array(vi).optional(),start:e.z.object({hidden_fields:e.z.array(e.z.object({key:e.z.string(),value:e.z.string()})).optional(),next_node:e.z.string().optional(),coordinates:X.optional()}).optional(),ending:e.z.object({redirection:e.z.object({delay:e.z.number().optional(),target:e.z.string().optional()}).optional(),after_submit:e.z.object({flow_id:e.z.string().optional()}).optional(),coordinates:X.optional(),resume_flow:e.z.boolean().optional()}).optional(),style:e.z.object({css:e.z.string().optional()}).optional(),links:e.z.object({sdkSrc:e.z.string().optional(),sdk_src:e.z.string().optional()}).optional()}).openapi({description:`Schema for flow-based forms (matches Auth0 Forms structure)`});W.extend(yi.shape).extend({id:e.z.string()});var bi=e.z.object({id:e.z.number().optional(),text:e.z.string(),type:e.z.enum([`info`,`error`,`success`,`warning`])}),xi=e.z.object({id:e.z.string().optional(),text:e.z.string(),href:e.z.string(),linkText:e.z.string().optional()});e.z.object({name:e.z.string().optional(),action:e.z.string(),method:e.z.enum([`POST`,`GET`]),title:e.z.string().optional(),description:e.z.string().optional(),components:e.z.array(mi),messages:e.z.array(bi).optional(),links:e.z.array(xi).optional(),footer:e.z.string().optional()});var Si=e.z.enum([`pre-user-registration`,`post-user-registration`,`post-user-login`,`post-user-update`,`validate-registration-username`,`pre-user-deletion`,`post-user-deletion`]),Ci=e.z.enum([`post-user-login`]),wi=e.z.enum([`post-user-login`,`post-user-registration`,`post-user-update`,`credentials-exchange`]),Ti=e.z.enum([`post-user-login`,`credentials-exchange`,`pre-user-registration`,`post-user-registration`]),Ei=e.z.enum([`post-user-login`]);Si.options,Ci.options,wi.options,Ti.options,Ei.options;var Di=e.z.enum([`impersonate`]),Oi=e.z.enum([`ensure-username`,`set-preferred-username`,`account-linking`]),Z={enabled:e.z.boolean().default(!1),synchronous:e.z.boolean().default(!1),priority:e.z.number().optional(),hook_id:e.z.string().optional(),metadata:e.z.record(e.z.string(),e.z.unknown()).optional()},ki=e.z.object({...Z,trigger_id:Si,url:e.z.string()}),Ai=e.z.object({...Z,trigger_id:Ci,form_id:e.z.string()}),ji=e.z.object({...Z,trigger_id:wi,template_id:Oi}),Mi=e.z.object({...Z,trigger_id:Ti,code_id:e.z.string()}),Ni=e.z.object({...Z,trigger_id:Ei,page_id:Di,permission_required:e.z.string().optional()});e.z.union([ki,Ai,ji,Mi,Ni]);var Pi=e.z.object({...Z,trigger_id:Si}).extend(W.shape).extend({hook_id:e.z.string(),url:e.z.string()}),Fi=e.z.object({...Z,trigger_id:Ci}).extend(W.shape).extend({hook_id:e.z.string(),form_id:e.z.string()}),Ii=e.z.object({...Z,trigger_id:wi}).extend(W.shape).extend({hook_id:e.z.string(),template_id:Oi}),Li=e.z.object({...Z,trigger_id:Ti}).extend(W.shape).extend({hook_id:e.z.string(),code_id:e.z.string()}),Ri=e.z.object({...Z,trigger_id:Ei}).extend(W.shape).extend({hook_id:e.z.string(),page_id:Di,permission_required:e.z.string().optional()});e.z.union([Pi,Fi,Ii,Li,Ri]),e.z.object({code:e.z.string().max(1e5),secrets:e.z.record(e.z.string(),e.z.string()).optional()}).extend({id:e.z.string(),tenant_id:e.z.string()}).extend(W.shape);var zi=e.z.object({name:e.z.string().optional()}),Bi=e.z.object({email:e.z.string().optional()}),Vi=e.z.object({id:e.z.string().optional(),organization_id:e.z.string().max(50),inviter:zi,invitee:Bi,invitation_url:e.z.string().url(),client_id:e.z.string(),connection_id:e.z.string().optional(),app_metadata:e.z.record(e.z.string(),e.z.any()).default({}).optional(),user_metadata:e.z.record(e.z.string(),e.z.any()).default({}).optional(),ttl_sec:e.z.number().int().max(2592e3).default(604800).optional(),roles:e.z.array(e.z.string()).default([]).optional(),send_invitation_email:e.z.boolean().default(!0).optional()});e.z.object({id:e.z.string(),organization_id:e.z.string().max(50),created_at:e.z.string().datetime(),expires_at:e.z.string().datetime(),ticket_id:e.z.string().optional()}).extend(Vi.omit({id:!0}).shape);var Hi=e.z.object({alg:e.z.enum([`RS256`,`RS384`,`RS512`,`ES256`,`ES384`,`ES512`,`HS256`,`HS384`,`HS512`]),kid:e.z.string().optional(),kty:e.z.enum([`RSA`,`EC`,`oct`]),use:e.z.enum([`sig`,`enc`]).optional(),n:e.z.string().optional(),e:e.z.string().optional(),crv:e.z.string().optional(),x:e.z.string().optional(),y:e.z.string().optional(),x5t:e.z.string().optional(),x5c:e.z.array(e.z.string()).optional()}).superRefine((t,n)=>{if(t.kty===`RSA`)for(let r of[`n`,`e`])t[r]||n.addIssue({code:e.z.ZodIssueCode.custom,path:[r],message:`RSA JWK is missing required member '${r}'`});else if(t.kty===`EC`)for(let r of[`crv`,`x`,`y`])t[r]||n.addIssue({code:e.z.ZodIssueCode.custom,path:[r],message:`EC JWK is missing required member '${r}'`})});e.z.object({keys:e.z.array(Hi)}),e.z.object({issuer:e.z.string(),authorization_endpoint:e.z.string(),token_endpoint:e.z.string(),userinfo_endpoint:e.z.string(),jwks_uri:e.z.string(),registration_endpoint:e.z.string().optional(),revocation_endpoint:e.z.string(),end_session_endpoint:e.z.string().optional(),scopes_supported:e.z.array(e.z.string()),response_types_supported:e.z.array(e.z.string()),grant_types_supported:e.z.array(e.z.string()).optional(),code_challenge_methods_supported:e.z.array(e.z.string()),response_modes_supported:e.z.array(e.z.string()),subject_types_supported:e.z.array(e.z.string()),id_token_signing_alg_values_supported:e.z.array(e.z.string()),token_endpoint_auth_methods_supported:e.z.array(e.z.string()),claims_supported:e.z.array(e.z.string()),request_uri_parameter_supported:e.z.boolean(),request_parameter_supported:e.z.boolean(),claims_parameter_supported:e.z.boolean().optional(),request_object_signing_alg_values_supported:e.z.array(e.z.string()).optional(),token_endpoint_auth_signing_alg_values_supported:e.z.array(e.z.string()),client_id_metadata_document_supported:e.z.boolean().optional(),backchannel_logout_supported:e.z.boolean().optional(),backchannel_logout_session_supported:e.z.boolean().optional()});var Ui=function(e){return e.PENDING=`pending`,e.AUTHENTICATED=`authenticated`,e.AWAITING_EMAIL_VERIFICATION=`awaiting_email_verification`,e.AWAITING_MFA=`awaiting_mfa`,e.AWAITING_HOOK=`awaiting_hook`,e.AWAITING_CONTINUATION=`awaiting_continuation`,e.AWAITING_CONSENT=`awaiting_consent`,e.COMPLETED=`completed`,e.FAILED=`failed`,e.EXPIRED=`expired`,e}({}),Wi=e.z.nativeEnum(Ui),Gi=e.z.object({strategy:e.z.string(),strategy_type:e.z.string()});e.z.object({csrf_token:e.z.string(),auth0Client:e.z.string().optional(),authParams:Dr,expires_at:e.z.string(),deleted_at:e.z.string().optional(),ip:e.z.string().optional(),useragent:e.z.string().optional(),session_id:e.z.string().optional(),authorization_url:e.z.string().optional(),state:Wi.optional().default(`pending`),state_data:e.z.string().optional(),failure_reason:e.z.string().optional(),user_id:e.z.string().optional(),auth_connection:e.z.string().optional(),auth_strategy:Gi.optional(),authenticated_at:e.z.string().optional()}).openapi({description:`This represents a login sesion`}).extend({id:e.z.string().openapi({description:`This is is used as the state in the universal login`}),created_at:e.z.string(),updated_at:e.z.string()});var Q={ACLS_SUMMARY:`acls_summary`,ACTIONS_EXECUTION_FAILED:`actions_execution_failed`,API_LIMIT:`api_limit`,API_LIMIT_WARNING:`api_limit_warning`,APPI:`appi`,CIBA_EXCHANGE_FAILED:`ciba_exchange_failed`,CIBA_EXCHANGE_SUCCEEDED:`ciba_exchange_succeeded`,CIBA_START_FAILED:`ciba_start_failed`,CIBA_START_SUCCEEDED:`ciba_start_succeeded`,CODE_LINK_SENT:`cls`,CODE_SENT:`cs`,DEPRECATION_NOTICE:`depnote`,FAILED_LOGIN:`f`,FAILED_BY_CONNECTOR:`fc`,FAILED_CHANGE_EMAIL:`fce`,FAILED_BY_CORS:`fco`,FAILED_CROSS_ORIGIN_AUTHENTICATION:`fcoa`,FAILED_CHANGE_PASSWORD:`fcp`,FAILED_POST_CHANGE_PASSWORD_HOOK:`fcph`,FAILED_CHANGE_PHONE_NUMBER:`fcpn`,FAILED_CHANGE_PASSWORD_REQUEST:`fcpr`,FAILED_CONNECTOR_PROVISIONING:`fcpro`,FAILED_CHANGE_USERNAME:`fcu`,FAILED_DELEGATION:`fd`,FAILED_DEVICE_ACTIVATION:`fdeac`,FAILED_DEVICE_AUTHORIZATION_REQUEST:`fdeaz`,USER_CANCELED_DEVICE_CONFIRMATION:`fdecc`,FAILED_USER_DELETION:`fdu`,FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:`feacft`,FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:`feccft`,FAILED_EXCHANGE_CUSTOM_TOKEN:`fecte`,FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:`fede`,FAILED_FEDERATED_LOGOUT:`federated_logout_failed`,FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN:`fens`,FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:`feoobft`,FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:`feotpft`,FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:`fepft`,FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN:`fepotpft`,FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:`fercft`,FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN:`ferrt`,FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:`fertft`,FAILED_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN:`festft`,FAILED_HOOK:`fh`,FAILED_IMPERSONATION:`fimp`,FAILED_INVITE_ACCEPT:`fi`,FAILED_LOGOUT:`flo`,FLOWS_EXECUTION_COMPLETED:`flows_execution_completed`,FLOWS_EXECUTION_FAILED:`flows_execution_failed`,FAILED_SENDING_NOTIFICATION:`fn`,FORMS_SUBMISSION_FAILED:`forms_submission_failed`,FORMS_SUBMISSION_SUCCEEDED:`forms_submission_succeeded`,FAILED_LOGIN_INCORRECT_PASSWORD:`fp`,FAILED_PUSHED_AUTHORIZATION_REQUEST:`fpar`,FAILED_POST_USER_REGISTRATION_HOOK:`fpurh`,FAILED_SIGNUP:`fs`,FAILED_SILENT_AUTH:`fsa`,FAILED_LOGIN_INVALID_EMAIL_USERNAME:`fu`,FAILED_USERS_IMPORT:`fui`,FAILED_VERIFICATION_EMAIL:`fv`,FAILED_VERIFICATION_EMAIL_REQUEST:`fvr`,EMAIL_VERIFICATION_CONFIRMED:`gd_auth_email_verification`,EMAIL_VERIFICATION_FAILED:`gd_auth_fail_email_verification`,MFA_AUTH_FAILED:`gd_auth_failed`,MFA_AUTH_REJECTED:`gd_auth_rejected`,MFA_AUTH_SUCCESS:`gd_auth_succeed`,MFA_ENROLLMENT_COMPLETE:`gd_enrollment_complete`,TOO_MANY_MFA_FAILURES:`gd_otp_rate_limit_exceed`,MFA_RECOVERY_FAILED:`gd_recovery_failed`,MFA_RECOVERY_RATE_LIMIT_EXCEED:`gd_recovery_rate_limit_exceed`,MFA_RECOVERY_SUCCESS:`gd_recovery_succeed`,MFA_EMAIL_SENT:`gd_send_email`,EMAIL_VERIFICATION_SENT:`gd_send_email_verification`,EMAIL_VERIFICATION_SEND_FAILURE:`gd_send_email_verification_failure`,PUSH_NOTIFICATION_SENT:`gd_send_pn`,ERROR_SENDING_MFA_PUSH_NOTIFICATION:`gd_send_pn_failure`,MFA_SMS_SENT:`gd_send_sms`,ERROR_SENDING_MFA_SMS:`gd_send_sms_failure`,MFA_VOICE_CALL_SUCCESS:`gd_send_voice`,MFA_VOICE_CALL_FAILED:`gd_send_voice_failure`,SECOND_FACTOR_STARTED:`gd_start_auth`,MFA_ENROLL_STARTED:`gd_start_enroll`,MFA_ENROLLMENT_FAILED:`gd_start_enroll_failed`,GUARDIAN_TENANT_UPDATE:`gd_tenant_update`,UNENROLL_DEVICE_ACCOUNT:`gd_unenroll`,UPDATE_DEVICE_ACCOUNT:`gd_update_device_account`,WEBAUTHN_CHALLENGE_FAILED:`gd_webauthn_challenge_failed`,WEBAUTHN_ENROLLMENT_FAILED:`gd_webauthn_enrollment_failed`,FAILED_KMS_API_OPERATION:`kms_key_management_failure`,SUCCESS_KMS_API_OPERATION:`kms_key_management_success`,KMS_KEY_STATE_CHANGED:`kms_key_state_changed`,TOO_MANY_CALLS_TO_DELEGATION:`limit_delegation`,BLOCKED_IP_ADDRESS:`limit_mu`,BLOCKED_ACCOUNT_IP:`limit_sul`,BLOCKED_ACCOUNT_EMAIL:`limit_wc`,INFORMATION:`i`,MFA_REQUIRED:`mfar`,MANAGEMENT_API_READ_OPERATION:`mgmt_api_read`,FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:`my_account_authentication_method_failed`,SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:`my_account_authentication_method_succeeded`,FAILED_OIDC_BACKCHANNEL_LOGOUT:`oidc_backchannel_logout_failed`,SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT:`oidc_backchannel_logout_succeeded`,ORGANIZATION_MEMBER_ADDED:`organization_member_added`,PASSKEY_CHALLENGE_FAILED:`passkey_challenge_failed`,PASSKEY_CHALLENGE_STARTED:`passkey_challenge_started`,PRE_LOGIN_ASSESSMENT:`pla`,BREACHED_PASSWORD:`pwd_leak`,BREACHED_PASSWORD_ON_RESET:`reset_pwd_leak`,SUCCESS_RESOURCE_CLEANUP:`resource_cleanup`,RICH_CONSENTS_ACCESS_ERROR:`rich_consents_access_error`,SUCCESS_LOGIN:`s`,SUCCESS_API_OPERATION:`sapi`,FAILED_API_OPERATION:`fapi`,SUCCESS_CHANGE_EMAIL:`sce`,SUCCESS_CROSS_ORIGIN_AUTHENTICATION:`scoa`,SUCCESS_CHANGE_PASSWORD:`scp`,SUCCESS_CHANGE_PHONE_NUMBER:`scpn`,SUCCESS_CHANGE_PASSWORD_REQUEST:`scpr`,SUCCESS_CHANGE_USERNAME:`scu`,SUCCESS_CREDENTIAL_VALIDATION:`scv`,SUCCESS_DELEGATION:`sd`,SUCCESS_USER_DELETION:`sdu`,SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:`seacft`,SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:`seccft`,SUCCESS_EXCHANGE_CUSTOM_TOKEN:`secte`,SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:`sede`,SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN:`sens`,SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:`seoobft`,SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:`seotpft`,SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN:`sepotpft`,SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:`sepft`,SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN:`sepkoobft`,SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN:`sepkotpft`,SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN:`sepkrcft`,SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:`sercft`,SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:`sertft`,SUCCESS_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN:`sestft`,SUCCESS_IMPERSONATION:`simp`,SUCCESSFULLY_ACCEPTED_USER_INVITE:`si`,BREACHED_PASSWORD_ON_SIGNUP:`signup_pwd_leak`,SUCCESS_LOGOUT:`slo`,SUCCESS_HOOK:`sh`,SUCCESS_PASSWORD_MIGRATION:`spm`,SUCCESS_REVOCATION:`srrt`,SUCCESS_SIGNUP:`ss`,FAILED_SS_SSO_OPERATION:`ss_sso_failure`,INFORMATION_FROM_SS_SSO_OPERATION:`ss_sso_info`,SUCCESS_SS_SSO_OPERATION:`ss_sso_success`,SUCCESS_SILENT_AUTH:`ssa`,SUCCESSFUL_SCIM_OPERATION:`sscim`,SUCCESSFULLY_IMPORTED_USERS:`sui`,SUCCESS_VERIFICATION_EMAIL:`sv`,SUCCESS_VERIFICATION_EMAIL_REQUEST:`svr`,MAX_AMOUNT_OF_AUTHENTICATORS:`too_many_records`,USER_LOGIN_BLOCK_RELEASED:`ublkdu`,FAILED_UNIVERSAL_LOGOUT:`universal_logout_failed`,SUCCESSFUL_UNIVERSAL_LOGOUT:`universal_logout_succeeded`,WARNING_DURING_LOGIN:`w`,WARNING_SENDING_NOTIFICATION:`wn`,WARNING_USER_MANAGEMENT:`wum`},Ki=e.z.string().refine(e=>Object.values(Q).includes(e),{message:`Invalid log type`});Q.ACLS_SUMMARY,Q.ACTIONS_EXECUTION_FAILED,Q.API_LIMIT,Q.API_LIMIT_WARNING,Q.APPI,Q.CIBA_EXCHANGE_FAILED,Q.CIBA_EXCHANGE_SUCCEEDED,Q.CIBA_START_FAILED,Q.CIBA_START_SUCCEEDED,Q.CODE_LINK_SENT,Q.CODE_SENT,Q.DEPRECATION_NOTICE,Q.FAILED_LOGIN,Q.FAILED_BY_CONNECTOR,Q.FAILED_CHANGE_EMAIL,Q.FAILED_BY_CORS,Q.FAILED_CROSS_ORIGIN_AUTHENTICATION,Q.FAILED_CHANGE_PASSWORD,Q.FAILED_POST_CHANGE_PASSWORD_HOOK,Q.FAILED_CHANGE_PHONE_NUMBER,Q.FAILED_CHANGE_PASSWORD_REQUEST,Q.FAILED_CONNECTOR_PROVISIONING,Q.FAILED_CHANGE_USERNAME,Q.FAILED_DELEGATION,Q.FAILED_DEVICE_ACTIVATION,Q.FAILED_DEVICE_AUTHORIZATION_REQUEST,Q.USER_CANCELED_DEVICE_CONFIRMATION,Q.FAILED_USER_DELETION,Q.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS,Q.FAILED_EXCHANGE_CUSTOM_TOKEN,Q.FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN,Q.FAILED_FEDERATED_LOGOUT,Q.FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN,Q.FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN,Q.FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN,Q.FAILED_HOOK,Q.FAILED_IMPERSONATION,Q.FAILED_INVITE_ACCEPT,Q.FAILED_LOGOUT,Q.FLOWS_EXECUTION_COMPLETED,Q.FLOWS_EXECUTION_FAILED,Q.FAILED_SENDING_NOTIFICATION,Q.FORMS_SUBMISSION_FAILED,Q.FORMS_SUBMISSION_SUCCEEDED,Q.FAILED_LOGIN_INCORRECT_PASSWORD,Q.FAILED_PUSHED_AUTHORIZATION_REQUEST,Q.FAILED_POST_USER_REGISTRATION_HOOK,Q.FAILED_SIGNUP,Q.FAILED_SILENT_AUTH,Q.FAILED_LOGIN_INVALID_EMAIL_USERNAME,Q.FAILED_USERS_IMPORT,Q.FAILED_VERIFICATION_EMAIL,Q.FAILED_VERIFICATION_EMAIL_REQUEST,Q.EMAIL_VERIFICATION_CONFIRMED,Q.EMAIL_VERIFICATION_FAILED,Q.MFA_AUTH_FAILED,Q.MFA_AUTH_REJECTED,Q.MFA_AUTH_SUCCESS,Q.MFA_ENROLLMENT_COMPLETE,Q.TOO_MANY_MFA_FAILURES,Q.MFA_RECOVERY_FAILED,Q.MFA_RECOVERY_RATE_LIMIT_EXCEED,Q.MFA_RECOVERY_SUCCESS,Q.MFA_EMAIL_SENT,Q.EMAIL_VERIFICATION_SENT,Q.EMAIL_VERIFICATION_SEND_FAILURE,Q.PUSH_NOTIFICATION_SENT,Q.ERROR_SENDING_MFA_PUSH_NOTIFICATION,Q.MFA_SMS_SENT,Q.ERROR_SENDING_MFA_SMS,Q.MFA_VOICE_CALL_SUCCESS,Q.MFA_VOICE_CALL_FAILED,Q.SECOND_FACTOR_STARTED,Q.MFA_ENROLL_STARTED,Q.MFA_ENROLLMENT_FAILED,Q.GUARDIAN_TENANT_UPDATE,Q.UNENROLL_DEVICE_ACCOUNT,Q.UPDATE_DEVICE_ACCOUNT,Q.WEBAUTHN_CHALLENGE_FAILED,Q.WEBAUTHN_ENROLLMENT_FAILED,Q.FAILED_KMS_API_OPERATION,Q.SUCCESS_KMS_API_OPERATION,Q.KMS_KEY_STATE_CHANGED,Q.TOO_MANY_CALLS_TO_DELEGATION,Q.BLOCKED_IP_ADDRESS,Q.BLOCKED_ACCOUNT_IP,Q.BLOCKED_ACCOUNT_EMAIL,Q.INFORMATION,Q.MFA_REQUIRED,Q.MANAGEMENT_API_READ_OPERATION,Q.FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT,Q.SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT,Q.FAILED_OIDC_BACKCHANNEL_LOGOUT,Q.SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT,Q.ORGANIZATION_MEMBER_ADDED,Q.PASSKEY_CHALLENGE_FAILED,Q.PASSKEY_CHALLENGE_STARTED,Q.PRE_LOGIN_ASSESSMENT,Q.BREACHED_PASSWORD,Q.BREACHED_PASSWORD_ON_RESET,Q.SUCCESS_RESOURCE_CLEANUP,Q.RICH_CONSENTS_ACCESS_ERROR,Q.SUCCESS_LOGIN,Q.SUCCESS_API_OPERATION,Q.FAILED_API_OPERATION,Q.SUCCESS_CHANGE_EMAIL,Q.SUCCESS_CROSS_ORIGIN_AUTHENTICATION,Q.SUCCESS_CHANGE_PASSWORD,Q.SUCCESS_CHANGE_PHONE_NUMBER,Q.SUCCESS_CHANGE_PASSWORD_REQUEST,Q.SUCCESS_CHANGE_USERNAME,Q.SUCCESS_CREDENTIAL_VALIDATION,Q.SUCCESS_DELEGATION,Q.SUCCESS_USER_DELETION,Q.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS,Q.SUCCESS_EXCHANGE_CUSTOM_TOKEN,Q.SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN,Q.SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN,Q.SUCCESS_IMPERSONATION,Q.SUCCESSFULLY_ACCEPTED_USER_INVITE,Q.BREACHED_PASSWORD_ON_SIGNUP,Q.SUCCESS_LOGOUT,Q.SUCCESS_HOOK,Q.SUCCESS_PASSWORD_MIGRATION,Q.SUCCESS_REVOCATION,Q.SUCCESS_SIGNUP,Q.FAILED_SS_SSO_OPERATION,Q.INFORMATION_FROM_SS_SSO_OPERATION,Q.SUCCESS_SS_SSO_OPERATION,Q.SUCCESS_SILENT_AUTH,Q.SUCCESSFUL_SCIM_OPERATION,Q.SUCCESSFULLY_IMPORTED_USERS,Q.SUCCESS_VERIFICATION_EMAIL,Q.SUCCESS_VERIFICATION_EMAIL_REQUEST,Q.MAX_AMOUNT_OF_AUTHENTICATORS,Q.USER_LOGIN_BLOCK_RELEASED,Q.FAILED_UNIVERSAL_LOGOUT,Q.SUCCESSFUL_UNIVERSAL_LOGOUT,Q.WARNING_DURING_LOGIN,Q.WARNING_SENDING_NOTIFICATION,Q.WARNING_USER_MANAGEMENT,(()=>{let e={};for(let[t,n]of Object.entries(Q))t.startsWith(`SUCCESS_`)||t.startsWith(`SUCCESSFUL_`)||t.startsWith(`SUCCESSFULLY_`)||t.endsWith(`_SUCCEEDED`)||t.endsWith(`_COMPLETED`)?e[n]=`success`:t.startsWith(`FAILED_`)||t.startsWith(`ERROR_`)||t.startsWith(`BREACHED_`)||t.startsWith(`BLOCKED_`)||t===`MFA_AUTH_FAILED`||t===`MFA_AUTH_REJECTED`||t===`MFA_RECOVERY_FAILED`||t===`MFA_ENROLLMENT_FAILED`||t===`EMAIL_VERIFICATION_FAILED`||t===`WEBAUTHN_CHALLENGE_FAILED`||t===`WEBAUTHN_ENROLLMENT_FAILED`||t===`PASSKEY_CHALLENGE_FAILED`||t===`FLOWS_EXECUTION_FAILED`||t===`FORMS_SUBMISSION_FAILED`||t===`CIBA_EXCHANGE_FAILED`||t===`CIBA_START_FAILED`||t===`ACTIONS_EXECUTION_FAILED`||t===`RICH_CONSENTS_ACCESS_ERROR`||t===`USER_CANCELED_DEVICE_CONFIRMATION`||t===`TOO_MANY_MFA_FAILURES`||t===`MFA_RECOVERY_RATE_LIMIT_EXCEED`||t===`API_LIMIT`||t===`MAX_AMOUNT_OF_AUTHENTICATORS`?e[n]=`failure`:t.startsWith(`WARNING_`)||t===`API_LIMIT_WARNING`||t===`DEPRECATION_NOTICE`||t===`PRE_LOGIN_ASSESSMENT`?e[n]=`warning`:t===`CODE_SENT`||t===`CODE_LINK_SENT`||t===`MFA_EMAIL_SENT`||t===`MFA_SMS_SENT`||t===`EMAIL_VERIFICATION_SENT`||t===`PUSH_NOTIFICATION_SENT`?e[n]=`code_sent`:t===`INFORMATION`||t===`INFORMATION_FROM_SS_SSO_OPERATION`||t===`MANAGEMENT_API_READ_OPERATION`||t===`APPI`||t===`ACLS_SUMMARY`||t===`ORGANIZATION_MEMBER_ADDED`?e[n]=`info`:e[n]=`other`;return e})();var qi=e.z.object({name:e.z.string(),version:e.z.string(),env:e.z.object({node:e.z.string().optional()}).optional()}),Ji=e.z.object({country_code:e.z.string().length(2),city_name:e.z.string(),latitude:e.z.string(),longitude:e.z.string(),time_zone:e.z.string(),continent_code:e.z.string()});e.z.object({type:Ki,date:e.z.string(),description:e.z.string().optional(),ip:e.z.string().optional(),user_agent:e.z.string().optional(),details:e.z.any().optional(),isMobile:e.z.boolean(),user_id:e.z.string().optional(),user_name:e.z.string().optional(),connection:e.z.string().optional(),connection_id:e.z.string().optional(),client_id:e.z.string().optional(),client_name:e.z.string().optional(),audience:e.z.string().optional(),scope:e.z.string().optional(),strategy:e.z.string().optional(),strategy_type:e.z.string().optional(),hostname:e.z.string().optional(),auth0_client:qi.optional(),log_id:e.z.string().optional(),location_info:Ji.optional()}).extend({log_id:e.z.string()});var Yi=e.z.enum([`http`,`eventbridge`,`eventgrid`,`splunk`,`datadog`,`sumo`]),Xi=e.z.enum([`active`,`paused`,`suspended`]),Zi=e.z.object({type:e.z.string(),name:e.z.string()});e.z.object({name:e.z.string(),type:Yi,status:Xi.optional(),sink:e.z.record(e.z.string(),e.z.unknown()),filters:e.z.array(Zi).optional(),isPriority:e.z.boolean().optional()}).extend({id:e.z.string(),status:Xi,created_at:e.z.string().optional(),updated_at:e.z.string().optional()});var Qi=e.z.enum([`auth0`,`cognito`,`okta`,`oidc`]),$i=e.z.object({domain:e.z.string(),client_id:e.z.string(),client_secret:e.z.string(),audience:e.z.string().optional(),scope:e.z.string().optional()}),ea=e.z.object({id:e.z.string().optional(),name:e.z.string(),provider:Qi,connection:e.z.string(),enabled:e.z.boolean().default(!0),credentials:$i});e.z.object({id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()}).extend(ea.shape);var ta=e.z.object({enabled:e.z.boolean().optional(),shields:e.z.array(e.z.string()).optional(),admin_notification_frequency:e.z.array(e.z.string()).optional(),method:e.z.string().optional(),stage:e.z.object({"pre-user-registration":e.z.object({shields:e.z.array(e.z.string()).optional()}).optional(),"pre-change-password":e.z.object({shields:e.z.array(e.z.string()).optional()}).optional()}).optional()}),na=e.z.object({enabled:e.z.boolean().optional(),shields:e.z.array(e.z.string()).optional(),allowlist:e.z.array(e.z.string()).optional(),mode:e.z.string().optional(),max_attempts:e.z.number().optional()}),ra=e.z.object({enabled:e.z.boolean().optional(),shields:e.z.array(e.z.string()).optional(),allowlist:e.z.array(e.z.string()).optional(),stage:e.z.object({"pre-login":e.z.object({max_attempts:e.z.number().optional(),rate:e.z.number().optional()}).optional(),"pre-user-registration":e.z.object({max_attempts:e.z.number().optional(),rate:e.z.number().optional()}).optional()}).optional()}),ia=e.z.object({breached_password_detection:ta.optional(),brute_force_protection:na.optional(),suspicious_ip_throttling:ra.optional()});e.z.object({id:e.z.string().optional(),user_id:e.z.string(),password:e.z.string(),algorithm:e.z.enum([`bcrypt`,`argon2id`]).default(`argon2id`),is_current:e.z.boolean().default(!0)}).extend({id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()});var aa=e.z.object({initial_user_agent:e.z.string().describe(`First user agent of the device from which this user logged in`),initial_ip:e.z.string().describe(`First IP address associated with this session`),initial_asn:e.z.string().describe(`First autonomous system number associated with this session`),last_user_agent:e.z.string().describe(`Last user agent of the device from which this user logged in`),last_ip:e.z.string().describe(`Last IP address from which this user logged in`),last_asn:e.z.string().describe(`Last autonomous system number from which this user logged in`)}),oa=e.z.object({id:e.z.string(),revoked_at:e.z.string().optional(),used_at:e.z.string().optional(),user_id:e.z.string().describe(`The user ID associated with the session`),expires_at:e.z.string().optional(),login_session_id:e.z.string(),idle_expires_at:e.z.string().optional(),device:aa.describe(`Metadata related to the device used in the session`),clients:e.z.array(e.z.string()).describe(`List of client details for the session`)});e.z.object({created_at:e.z.string(),updated_at:e.z.string(),authenticated_at:e.z.string(),last_interaction_at:e.z.string()}).extend(oa.shape),e.z.object({kid:e.z.string().openapi({description:`The key id of the signing key`}),tenant_id:e.z.string().optional().openapi({description:`The tenant the key belongs to. Omitted means the key is shared / control-plane scoped.`}),cert:e.z.string().openapi({description:`The public certificate of the signing key`}),fingerprint:e.z.string().openapi({description:`The cert fingerprint`}),thumbprint:e.z.string().openapi({description:`The cert thumbprint`}),pkcs7:e.z.string().optional().openapi({description:`The private key in pkcs7 format`}),current:e.z.boolean().optional().openapi({description:`True if the key is the current key`}),next:e.z.boolean().optional().openapi({description:`True if the key is the next key`}),previous:e.z.boolean().optional().openapi({description:`True if the key is the previous key`}),current_since:e.z.string().optional().openapi({description:`The date and time when the key became the current key`}),current_until:e.z.string().optional().openapi({description:`The date and time when the current key was rotated`}),revoked:e.z.boolean().optional().openapi({description:`True if the key is revoked`}),revoked_at:e.z.string().optional().openapi({description:`The date and time when the key was revoked`}),connection:e.z.string().optional().openapi({description:`The connection identifier associated with the key`}),type:e.z.enum([`jwt_signing`,`saml_encryption`]).openapi({description:`The type of the signing key`})});var sa=e.z.object({id:e.z.string().optional(),audience:e.z.string().optional(),friendly_name:e.z.string(),picture_url:e.z.string().optional(),support_email:e.z.string().optional(),support_url:e.z.string().optional(),sender_email:e.z.string().email().optional(),sender_name:e.z.string().optional(),session_lifetime:e.z.number().optional(),idle_session_lifetime:e.z.number().optional(),ephemeral_session_lifetime:e.z.number().optional(),idle_ephemeral_session_lifetime:e.z.number().optional(),session_cookie:e.z.object({mode:e.z.enum([`persistent`,`non-persistent`]).optional()}).optional(),allowed_logout_urls:e.z.array(e.z.string()).optional(),default_redirection_uri:e.z.string().optional(),default_client_id:e.z.string().optional(),enabled_locales:e.z.array(e.z.string()).optional(),default_directory:e.z.string().optional(),error_page:e.z.object({html:e.z.string().optional(),show_log_link:e.z.boolean().optional(),url:e.z.string().optional()}).nullish(),flags:e.z.object({allow_changing_enable_sso:e.z.boolean().optional(),allow_legacy_delegation_grant_types:e.z.boolean().optional(),allow_legacy_ro_grant_types:e.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:e.z.boolean().optional(),change_pwd_flow_v1:e.z.boolean().optional(),client_id_metadata_document_registration:e.z.boolean().optional(),custom_domains_provisioning:e.z.boolean().optional(),dashboard_insights_view:e.z.boolean().optional(),dashboard_log_streams_next:e.z.boolean().optional(),disable_clickjack_protection_headers:e.z.boolean().optional(),disable_fields_map_fix:e.z.boolean().optional(),disable_impersonation:e.z.boolean().optional(),disable_management_api_sms_obfuscation:e.z.boolean().optional(),enable_adfs_waad_email_verification:e.z.boolean().optional(),enable_apis_section:e.z.boolean().optional(),enable_client_connections:e.z.boolean().optional(),enable_custom_domain_in_emails:e.z.boolean().optional(),enable_dynamic_client_registration:e.z.boolean().optional(),dcr_require_initial_access_token:e.z.boolean().optional(),dcr_allowed_grant_types:e.z.array(e.z.string()).optional(),allow_http_return_to:e.z.array(e.z.string().refine(e=>{try{let t=new URL(e);return t.protocol===`http:`&&(t.pathname===``||t.pathname===`/`)&&!t.search&&!t.hash&&e===t.origin}catch{return!1}},{message:`must be a fully-qualified http origin (scheme + host + port, no path)`})).optional(),enable_idtoken_api2:e.z.boolean().optional(),enable_legacy_logs_search_v2:e.z.boolean().optional(),enable_legacy_profile:e.z.boolean().optional(),enable_pipeline2:e.z.boolean().optional(),enable_public_signup_user_exists_error:e.z.boolean().optional(),enable_sso:e.z.boolean().optional(),enforce_client_authentication_on_passwordless_start:e.z.boolean().optional(),genai_trial:e.z.boolean().optional(),improved_signup_bot_detection_in_classic:e.z.boolean().optional(),mfa_show_factor_list_on_enrollment:e.z.boolean().optional(),no_disclose_enterprise_connections:e.z.boolean().optional(),remove_alg_from_jwks:e.z.boolean().optional(),revoke_refresh_token_grant:e.z.boolean().optional(),trust_azure_adfs_email_verified_connection_property:e.z.boolean().optional(),use_scope_descriptions_for_consent:e.z.boolean().optional(),inherit_global_permissions_in_organizations:e.z.boolean().optional(),restrict_undefined_scopes:e.z.boolean().optional()}).optional(),sandbox_version:e.z.string().optional(),legacy_sandbox_version:e.z.string().optional(),sandbox_versions_available:e.z.array(e.z.string()).optional(),change_password:e.z.object({enabled:e.z.boolean().optional(),html:e.z.string().optional()}).optional(),guardian_mfa_page:e.z.object({enabled:e.z.boolean().optional(),html:e.z.string().optional()}).optional(),device_flow:e.z.object({charset:e.z.enum([`base20`,`digits`]).optional(),mask:e.z.string().max(20).optional()}).optional(),default_token_quota:e.z.object({clients:e.z.object({client_credentials:e.z.record(e.z.string(),e.z.any()).optional()}).optional(),organizations:e.z.object({client_credentials:e.z.record(e.z.string(),e.z.any()).optional()}).optional()}).nullish(),default_audience:e.z.string().optional(),default_organization:e.z.string().optional(),sessions:e.z.object({oidc_logout_prompt_enabled:e.z.boolean().optional()}).optional(),oidc_logout:e.z.object({rp_logout_end_session_endpoint_discovery:e.z.boolean().optional()}).optional(),allow_organization_name_in_authentication_api:e.z.boolean().optional(),customize_mfa_in_postlogin_action:e.z.boolean().optional(),acr_values_supported:e.z.array(e.z.string()).optional(),mtls:e.z.object({enable_endpoint_aliases:e.z.boolean().optional()}).nullish(),pushed_authorization_requests_supported:e.z.boolean().optional(),authorization_response_iss_parameter_supported:e.z.boolean().optional(),deployment_type:e.z.enum([`shared`,`wfp`]).default(`shared`).optional(),provisioning_state:e.z.enum([`pending`,`ready`,`failed`]).default(`ready`).optional(),provisioning_error:e.z.string().max(2048).optional(),provisioning_state_changed_at:e.z.string().optional(),bundle_configuration:e.z.string().max(64).optional(),worker_version:e.z.string().max(64).optional(),database_version:e.z.string().max(64).optional(),worker_script_name:e.z.string().max(255).optional(),storage_kind:e.z.enum([`own_d1`,`existing_d1`,`shared_planetscale`]).optional(),d1_database_id:e.z.string().max(64).optional(),attack_protection:ia.optional(),mfa:e.z.object({policy:e.z.enum([`never`,`always`]).default(`never`).optional(),factors:e.z.object({sms:e.z.boolean().default(!1),otp:e.z.boolean().default(!1),email:e.z.boolean().default(!1),push_notification:e.z.boolean().default(!1),webauthn_roaming:e.z.boolean().default(!1),webauthn_platform:e.z.boolean().default(!1),recovery_code:e.z.boolean().default(!1),duo:e.z.boolean().default(!1)}).optional(),sms_provider:e.z.object({provider:e.z.enum([`twilio`,`vonage`,`aws_sns`,`phone_message_hook`]).optional()}).optional(),twilio:e.z.object({sid:e.z.string().optional(),auth_token:e.z.string().optional(),from:e.z.string().optional(),messaging_service_sid:e.z.string().optional()}).optional(),phone_message:e.z.object({message:e.z.string().optional()}).optional()}).optional()});e.z.object({created_at:e.z.string().nullable().transform(e=>e??``),updated_at:e.z.string().nullable().transform(e=>e??``)}).extend(sa.shape).extend({id:e.z.string(),is_control_plane:e.z.boolean().optional()});var ca=e.z.enum([`provision`,`seed`,`upgrade`,`backup`,`deprovision`,`users_import`]),la=e.z.enum([`pending`,`running`,`succeeded`,`failed`,`cancelled`]),ua=e.z.string().max(64);e.z.object({tenant_id:e.z.string().max(255).nullable().default(null),rollout_id:e.z.string().max(255).nullable().optional(),kind:ca,engine:ua,engine_instance_id:e.z.string().max(100).nullable().optional(),target_worker_version:e.z.string().max(255).nullable().optional(),target_database_version:e.z.string().max(255).nullable().optional(),initiated_by:e.z.string().max(255).nullable().optional(),input:e.z.record(e.z.string(),e.z.unknown()).nullable().optional()}).extend({id:e.z.string(),status:la,current_step:e.z.string().max(255).nullable().optional(),error:e.z.string().nullable().optional(),result:e.z.record(e.z.string(),e.z.unknown()).nullable().optional(),claimed_by:e.z.string().max(255).nullable().optional(),claim_expires_at:e.z.string().nullable().optional(),created_at:e.z.string(),updated_at:e.z.string(),finished_at:e.z.string().nullable().optional()}).pick({status:!0,current_step:!0,engine_instance_id:!0,target_worker_version:!0,target_database_version:!0,error:!0,result:!0,claimed_by:!0,claim_expires_at:!0,finished_at:!0}).partial();var da=e.z.enum([`started`,`succeeded`,`failed`,`retried`,`skipped`,`reconciled`]);e.z.object({operation_id:e.z.string().max(255),step:e.z.string().max(255),outcome:da,detail:e.z.record(e.z.string(),e.z.unknown()).nullable().optional(),attempt:e.z.number().int().min(1).default(1)}).extend({id:e.z.string(),created_at:e.z.string()});var fa=e.z.enum([`pending`,`inserted`,`updated`,`failed`,`skipped`]);e.z.object({operation_id:e.z.string().max(255),seq:e.z.number().int().min(0),payload:e.z.record(e.z.string(),e.z.unknown()),status:fa.default(`pending`),error_code:e.z.string().max(64).nullable().optional(),error_message:e.z.string().nullable().optional(),error_path:e.z.string().max(255).nullable().optional(),entity_id:e.z.string().max(255).nullable().optional()}).extend({status:fa,created_at:e.z.string(),updated_at:e.z.string()}),e.z.object({seq:e.z.number().int().min(0),status:fa,error_code:e.z.string().max(64).nullable().optional(),error_message:e.z.string().nullable().optional(),error_path:e.z.string().max(255).nullable().optional(),entity_id:e.z.string().max(255).nullable().optional()});var pa=e.z.enum([`upgrade`,`reseed`,`backup`]),ma=e.z.enum([`pending`,`canary`,`rolling`,`paused`,`done`,`failed`]);e.z.object({kind:pa,target_worker_version:e.z.string().max(255).nullable().optional(),target_database_version:e.z.string().max(255).nullable().optional(),wave_size:e.z.number().int().min(1).default(10),canary_tenant_ids:e.z.array(e.z.string()).nullable().optional(),filter:e.z.record(e.z.string(),e.z.unknown()).nullable().optional(),initiated_by:e.z.string().max(255).nullable().optional()}).extend({id:e.z.string(),status:ma,created_at:e.z.string(),updated_at:e.z.string(),finished_at:e.z.string().nullable().optional()}).pick({status:!0,wave_size:!0,canary_tenant_ids:!0,filter:!0,finished_at:!0}).partial(),e.z.object({access_token:e.z.string(),id_token:e.z.string().optional(),scope:e.z.string().optional(),state:e.z.string().optional(),refresh_token:e.z.string().optional(),token_type:e.z.string(),expires_in:e.z.number()}),e.z.object({code:e.z.string(),state:e.z.string().optional()});var ha=e.z.object({button_border_radius:e.z.number(),button_border_weight:e.z.number(),buttons_style:e.z.enum([`pill`,`rounded`,`sharp`]),input_border_radius:e.z.number(),input_border_weight:e.z.number(),inputs_style:e.z.enum([`pill`,`rounded`,`sharp`]),show_widget_shadow:e.z.boolean(),widget_border_weight:e.z.number(),widget_corner_radius:e.z.number()}),ga=e.z.object({base_focus_color:e.z.string(),base_hover_color:e.z.string(),body_text:e.z.string(),captcha_widget_theme:e.z.enum([`auto`,`dark`,`light`]),error:e.z.string(),header:e.z.string(),icons:e.z.string(),input_background:e.z.string(),input_border:e.z.string(),input_filled_text:e.z.string(),input_labels_placeholders:e.z.string(),links_focused_components:e.z.string(),primary_button:e.z.string(),primary_button_label:e.z.string(),secondary_button_border:e.z.string(),secondary_button_label:e.z.string(),success:e.z.string(),widget_background:e.z.string(),widget_border:e.z.string()}),$=e.z.object({bold:e.z.boolean(),size:e.z.number()}),_a=e.z.object({body_text:$,buttons_text:$,font_url:e.z.string(),input_labels:$,links:$,links_style:e.z.enum([`normal`,`underlined`]),reference_text_size:e.z.number(),subtitle:$,title:$}),va=e.z.object({background_color:e.z.string(),background_image_url:e.z.string(),page_layout:e.z.enum([`center`,`left`,`right`]),logo_placement:e.z.enum([`widget`,`chip`,`none`]).optional()}),ya=e.z.object({header_text_alignment:e.z.enum([`center`,`left`,`right`]),logo_height:e.z.number(),logo_position:e.z.enum([`center`,`left`,`none`,`right`]),logo_url:e.z.string(),social_buttons_layout:e.z.enum([`bottom`,`top`])});e.z.object({borders:ha,colors:ga,displayName:e.z.string(),fonts:_a,page_background:va,widget:ya}).extend({themeId:e.z.string()}),e.z.object({universal_login_experience:e.z.enum([`new`,`classic`]).default(`new`),identifier_first:e.z.boolean().default(!0),password_first:e.z.boolean().default(!1),show_last_used_connection:e.z.boolean().default(!1),webauthn_platform_first_factor:e.z.boolean()});var ba=e.z.object({hosts:e.z.array(e.z.string()).optional(),methods:e.z.array(e.z.string()).optional(),path:e.z.string().default(`/*`),headers:e.z.record(e.z.string(),e.z.string()).optional(),query:e.z.record(e.z.string(),e.z.string()).optional()}),xa=e.z.object({type:e.z.string(),options:e.z.record(e.z.string(),e.z.unknown()).default({})}),Sa=e.z.object({id:e.z.string().optional(),custom_domain_id:e.z.string(),priority:e.z.number().int().default(100),match:ba,handlers:e.z.array(xa).min(1)});Sa.extend({id:e.z.string(),tenant_id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()}),Sa.partial().omit({id:!0,custom_domain_id:!0});var Ca=e.z.object({scim:e.z.string(),auth0:e.z.string()}),wa=e.z.object({connection_id:e.z.string(),user_id_attribute:e.z.string().default(`externalId`),mapping:e.z.array(Ca).default([])});e.z.object({created_at:e.z.string(),updated_at:e.z.string()}).extend(wa.shape);var Ta=e.z.object({token_id:e.z.string(),connection_id:e.z.string(),token_hash:e.z.string(),scopes:e.z.array(e.z.string()).default([]),valid_until:e.z.string().optional()});e.z.object({created_at:e.z.string(),last_used_at:e.z.string().optional()}).extend(Ta.shape);var Ea=e.z.object({connection_id:e.z.string(),external_id:e.z.string(),user_id:e.z.string()});e.z.object({created_at:e.z.string()}).extend(Ea.shape),e.z.object({name:e.z.string(),enabled:e.z.boolean().optional().default(!0),default_from_address:e.z.string().optional(),credentials:e.z.record(e.z.string(),e.z.unknown()),settings:e.z.object({}).optional()});var Da=e.z.enum([`verify_email`,`verify_email_by_code`,`reset_email`,`reset_email_by_code`,`welcome_email`,`blocked_account`,`stolen_credentials`,`enrollment_email`,`mfa_oob_code`,`change_password`,`password_reset`,`user_invitation`]);e.z.object({template:Da,body:e.z.string(),from:e.z.string(),subject:e.z.string(),syntax:e.z.literal(`liquid`).default(`liquid`),resultUrl:e.z.string().optional(),urlLifetimeInSeconds:e.z.number().int().nonnegative().optional(),includeEmailInRedirect:e.z.boolean().default(!1),enabled:e.z.boolean().default(!0)}),e.z.object({id:e.z.string(),login_id:e.z.string(),session_id:e.z.string().optional(),organization:e.z.string().optional(),auth_connection:e.z.string().optional(),auth_strategy:Gi.optional(),user_id:e.z.string(),client_id:e.z.string(),expires_at:e.z.string().optional(),idle_expires_at:e.z.string().optional(),last_exchanged_at:e.z.string().optional(),device:aa,resource_servers:e.z.array(e.z.object({audience:e.z.string(),scopes:e.z.string()})),rotating:e.z.boolean(),token_lookup:e.z.string().optional(),token_hash:e.z.string().optional(),family_id:e.z.string().optional(),rotated_to:e.z.string().optional(),rotated_at:e.z.string().optional()}).extend({created_at:e.z.string(),revoked_at:e.z.string().optional()}),e.z.object({to:e.z.string(),message:e.z.string()}),e.z.object({name:e.z.string(),options:e.z.object({})});var Oa=e.z.object({value:e.z.string(),description:e.z.string().optional()}),ka=e.z.object({token_dialect:e.z.enum([`access_token`,`access_token_authz`]).optional(),enforce_policies:e.z.boolean().optional(),allow_skipping_userinfo:e.z.boolean().optional(),skip_userinfo:e.z.boolean().optional(),persist_client_authorization:e.z.boolean().optional(),enable_introspection_endpoint:e.z.boolean().optional(),mtls:e.z.object({bound_access_tokens:e.z.boolean().optional()}).optional()}),Aa=e.z.object({id:e.z.string().optional(),name:e.z.string(),identifier:e.z.string(),scopes:e.z.array(Oa).optional(),signing_alg:e.z.string().optional(),signing_secret:e.z.string().optional(),token_lifetime:e.z.number().default(86400),token_lifetime_for_web:e.z.number().default(7200),skip_consent_for_verifiable_first_party_clients:e.z.boolean().optional(),allow_offline_access:e.z.boolean().optional(),verificationKey:e.z.string().optional(),options:ka.optional(),is_system:e.z.boolean().optional(),metadata:e.z.record(e.z.string(),e.z.any()).optional()}).extend({created_at:e.z.string().optional(),updated_at:e.z.string().optional()});e.z.array(Aa);var ja=e.z.object({role_id:e.z.string(),resource_server_identifier:e.z.string(),permission_name:e.z.string()}).extend({created_at:e.z.string()});e.z.array(ja),e.z.object({user_id:e.z.string().openapi({description:`The id of the user that granted the consent`}),clientID:e.z.string().openapi({description:`The id of the client the grant was issued to`}),audience:e.z.string().optional().openapi({description:`The audience the grant applies to`}),scope:e.z.array(e.z.string()).default([]).openapi({description:`The list of OAuth scopes the user has consented to`})}).extend({id:e.z.string()}),e.z.object({user_id:e.z.string(),last_login:e.z.string().optional(),last_ip:e.z.string().optional(),login_count:e.z.number().default(0),failed_logins:e.z.array(e.z.string()).optional(),last_password_reset:e.z.string().optional()});var Ma=e.z.object({user_id:e.z.string(),resource_server_identifier:e.z.string(),permission_name:e.z.string(),organization_id:e.z.string().optional()}).extend({tenant_id:e.z.string(),created_at:e.z.string().optional()});e.z.array(Ma);var Na=e.z.object({user_id:e.z.string(),resource_server_identifier:e.z.string(),resource_server_name:e.z.string(),permission_name:e.z.string(),description:e.z.string().nullable().optional(),created_at:e.z.string().optional(),organization_id:e.z.string().optional()});e.z.array(Na);var Pa=e.z.object({user_id:e.z.string(),role_id:e.z.string(),organization_id:e.z.string().optional()}).extend({tenant_id:e.z.string(),created_at:e.z.string().optional()});e.z.array(Pa);var Fa=e.z.object({id:e.z.string().optional().openapi({description:`The unique identifier of the role. If not provided, one will be generated.`}),name:e.z.string().min(1).max(50).openapi({description:`The name of the role. Cannot include '<' or '>'`}),description:e.z.string().max(255).optional().openapi({description:`The description of the role`}),is_system:e.z.boolean().optional(),metadata:e.z.record(e.z.string(),e.z.any()).optional().openapi({description:`Metadata associated with the role. Can be used to control sync behavior in multi-tenancy scenarios.`})}).extend({id:e.z.string().openapi({description:`The unique identifier of the role`}),created_at:e.z.string().optional(),updated_at:e.z.string().optional()});e.z.array(Fa);var Ia=e.z.object({logo_url:e.z.string().optional().openapi({description:`URL of the organization's logo`}),colors:e.z.object({primary:e.z.string().optional().openapi({description:`Primary color in hex format (e.g., #FF0000)`}),page_background:e.z.string().optional().openapi({description:`Page background color in hex format (e.g., #FFFFFF)`})}).optional()}).optional(),La=e.z.object({connection_id:e.z.string().openapi({description:`ID of the connection`}),assign_membership_on_login:e.z.boolean().default(!1).openapi({description:`Whether to assign membership to the organization on login`}),show_as_button:e.z.boolean().default(!0).openapi({description:`Whether to show this connection as a button in the login screen`}),is_signup_enabled:e.z.boolean().default(!0).openapi({description:`Whether signup is enabled for this connection`})}),Ra=e.z.object({client_credentials:e.z.object({enforce:e.z.boolean().default(!1).openapi({description:`Whether to enforce token quota limits`}),per_day:e.z.number().min(0).default(0).openapi({description:`Maximum tokens per day (0 = unlimited)`}),per_hour:e.z.number().min(0).default(0).openapi({description:`Maximum tokens per hour (0 = unlimited)`})}).optional()}).optional();e.z.object({id:e.z.string().optional(),name:e.z.string().min(1).regex(/^[a-z0-9_-]+$/,{message:`Organization name must be lowercase and can only contain letters, numbers, hyphens, and underscores`}).openapi({description:`The name of the organization. Must be lowercase and can only contain letters, numbers, hyphens, and underscores.`}),display_name:e.z.string().optional().openapi({description:`The display name of the organization`}),branding:Ia,metadata:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Custom metadata for the organization`}),enabled_connections:e.z.array(La).default([]).optional().openapi({description:`List of enabled connections for the organization`}),token_quota:Ra}).extend(W.shape).extend({id:e.z.string(),name:e.z.string().min(1).openapi({description:`The name of the organization`})});var za=e.z.object({connection_id:e.z.string().openapi({description:`ID of the tenant-level connection to enable for the org.`}),assign_membership_on_login:e.z.boolean().optional().default(!1),show_as_button:e.z.boolean().optional().default(!0),is_signup_enabled:e.z.boolean().optional().default(!0)}).extend({connection:e.z.object({name:e.z.string().optional(),strategy:e.z.string().optional()}).optional(),created_at:e.z.string().optional(),updated_at:e.z.string().optional()});e.z.array(za),e.z.object({user_id:e.z.string().openapi({description:`ID of the user`}),organization_id:e.z.string().openapi({description:`ID of the organization`})}).extend(W.shape).extend({id:e.z.string()}),e.z.object({idle_session_lifetime:e.z.number().default(72),session_lifetime:e.z.number().default(168),session_cookie:e.z.object({mode:e.z.enum([`persistent`,`non-persistent`]).optional()}).optional(),enable_client_connections:e.z.boolean().optional(),default_redirection_uri:e.z.string().optional(),enabled_locales:e.z.array(e.z.string()).optional(),default_directory:e.z.string().optional(),error_page:e.z.object({html:e.z.string().optional(),show_log_link:e.z.boolean().optional(),url:e.z.string().optional()}).optional(),flags:e.z.object({allow_legacy_delegation_grant_types:e.z.boolean().optional(),allow_legacy_ro_grant_types:e.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:e.z.boolean().optional(),disable_clickjack_protection_headers:e.z.boolean().optional(),enable_apis_section:e.z.boolean().optional(),enable_client_connections:e.z.boolean().optional(),enable_custom_domain_in_emails:e.z.boolean().optional(),enable_dynamic_client_registration:e.z.boolean().optional(),enable_idtoken_api2:e.z.boolean().optional(),enable_legacy_logs_search_v2:e.z.boolean().optional(),enable_legacy_profile:e.z.boolean().optional(),enable_pipeline2:e.z.boolean().optional(),enable_public_signup_user_exists_error:e.z.boolean().optional(),use_scope_descriptions_for_consent:e.z.boolean().optional(),disable_management_api_sms_obfuscation:e.z.boolean().optional(),enable_adfs_waad_email_verification:e.z.boolean().optional(),revoke_refresh_token_grant:e.z.boolean().optional(),dashboard_log_streams_next:e.z.boolean().optional(),dashboard_insights_view:e.z.boolean().optional(),disable_fields_map_fix:e.z.boolean().optional(),mfa_show_factor_list_on_enrollment:e.z.boolean().optional()}).optional(),friendly_name:e.z.string().optional(),picture_url:e.z.string().optional(),support_email:e.z.string().optional(),support_url:e.z.string().optional(),sandbox_version:e.z.string().optional(),sandbox_versions_available:e.z.array(e.z.string()).optional(),change_password:e.z.object({enabled:e.z.boolean(),html:e.z.string()}).optional(),guardian_mfa_page:e.z.object({enabled:e.z.boolean(),html:e.z.string()}).optional(),default_audience:e.z.string().optional(),default_organization:e.z.string().optional(),sessions:e.z.object({oidc_logout_prompt_enabled:e.z.boolean().optional()}).optional(),mfa:e.z.object({policy:e.z.enum([`never`,`always`]).default(`never`).optional(),factors:e.z.object({sms:e.z.boolean().default(!1),otp:e.z.boolean().default(!1),email:e.z.boolean().default(!1),push_notification:e.z.boolean().default(!1),webauthn_roaming:e.z.boolean().default(!1),webauthn_platform:e.z.boolean().default(!1),recovery_code:e.z.boolean().default(!1),duo:e.z.boolean().default(!1)}).optional(),sms_provider:e.z.object({provider:e.z.enum([`twilio`,`vonage`,`aws_sns`,`phone_message_hook`]).optional()}).optional(),twilio:e.z.object({sid:e.z.string().optional(),auth_token:e.z.string().optional(),from:e.z.string().optional(),messaging_service_sid:e.z.string().optional()}).optional(),phone_message:e.z.object({message:e.z.string().optional()}).optional()}).optional()}),e.z.object({date:e.z.string().openapi({description:`Date these events occurred in ISO 8601 format`,example:`2025-12-19`}),logins:e.z.number().openapi({description:`Number of logins on this date`,example:150}),signups:e.z.number().openapi({description:`Number of signups on this date`,example:25}),leaked_passwords:e.z.number().openapi({description:`Number of breached-password detections on this date (subscription required)`,example:0}),updated_at:e.z.string().openapi({description:`Date and time this stats entry was last updated in ISO 8601 format`,example:`2025-12-19T10:30:00.000Z`}),created_at:e.z.string().openapi({description:`Approximate date and time the first event occurred in ISO 8601 format`,example:`2025-12-19T00:00:00.000Z`})}),e.z.number().openapi({description:`Number of active users in the last 30 days`,example:1234}),e.z.enum([`active-users`,`logins`,`signups`,`refresh-tokens`,`sessions`,`logouts`,`password-changes`,`password-migrations`,`mfa`,`email-verifications`,`codes-sent`]),e.z.enum([`hour`,`day`,`week`,`month`]),e.z.enum([`time`,`connection`,`client_id`,`user_type`,`event`]),e.z.enum([`password`,`social`,`passwordless`,`enterprise`]);var Ba=e.z.object({cohort:e.z.string(),sessions:e.z.number(),active:e.z.array(e.z.number())});e.z.object({interval:e.z.literal(`week`),from:e.z.string(),to:e.z.string(),cohorts:e.z.array(Ba)});var Va=e.z.object({cohort:e.z.string(),tokens:e.z.number(),active:e.z.array(e.z.number())});e.z.object({interval:e.z.literal(`week`),from:e.z.string(),to:e.z.string(),cohorts:e.z.array(Va)});var Ha=e.z.object({name:e.z.string(),type:e.z.string()}),Ua=e.z.object({elapsed:e.z.number(),rows_read:e.z.number().optional(),bytes_read:e.z.number().optional()});e.z.object({meta:e.z.array(Ha),data:e.z.array(e.z.record(e.z.string(),e.z.any())),rows:e.z.number(),rows_before_limit_at_least:e.z.number().optional(),statistics:Ua.optional()});var Wa=e.z.enum(`login.login-id.login-password.signup.signup-id.signup-password.reset-password.consent.mfa.mfa-push.mfa-otp.mfa-voice.mfa-phone.mfa-webauthn.mfa-email.mfa-recovery-code.status.device-flow.email-verification.email-otp-challenge.organizations.invitation.common.passkeys.captcha.custom-form.login-passwordless.mfa-login-options`.split(`.`)),Ga=e.z.record(e.z.string(),e.z.record(e.z.string(),e.z.string())).openapi({type:`object`,additionalProperties:{type:`object`,additionalProperties:{type:`string`}}});e.z.object({prompt:Wa,language:e.z.string(),custom_text:Ga});var Ka=e.z.enum([`phone`,`totp`,`email`,`push`,`webauthn-roaming`,`webauthn-platform`,`passkey`]),qa=e.z.object({user_id:e.z.string(),type:Ka,phone_number:e.z.string().optional(),totp_secret:e.z.string().optional(),credential_id:e.z.string().optional(),public_key:e.z.string().optional(),sign_count:e.z.number().int().nonnegative().optional(),credential_backed_up:e.z.boolean().optional(),transports:e.z.array(e.z.string()).optional(),friendly_name:e.z.string().optional(),confirmed:e.z.boolean().default(!1)});function Ja(t,n){t.type===`phone`&&!t.phone_number&&n.addIssue({code:e.z.ZodIssueCode.custom,message:`phone_number is required when type is 'phone'`,path:[`phone_number`]}),t.type===`totp`&&!t.totp_secret&&n.addIssue({code:e.z.ZodIssueCode.custom,message:`totp_secret is required when type is 'totp'`,path:[`totp_secret`]}),[`webauthn-roaming`,`webauthn-platform`,`passkey`].includes(t.type)&&(t.credential_id||n.addIssue({code:e.z.ZodIssueCode.custom,message:`credential_id is required when type is '${t.type}'`,path:[`credential_id`]}),t.public_key||n.addIssue({code:e.z.ZodIssueCode.custom,message:`public_key is required when type is '${t.type}'`,path:[`public_key`]}))}qa.superRefine(Ja),qa.extend({id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()}).superRefine(Ja),e.z.object({id:e.z.string().optional(),created_at:e.z.string().datetime({offset:!0}).optional(),updated_at:e.z.string().datetime({offset:!0}).optional()});function Ya(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var Xa=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,Za=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Xa[n[e]&63];return t};async function Qa(e){let t=new DecompressionStream(`deflate-raw`),n=new Uint8Array(e),r=new Blob([n]).stream().pipeThrough(t);return new Uint8Array(await new Response(r).arrayBuffer())}async function $a(e){let t=Ya(e.replace(/ /g,`+`));try{let e=await Qa(t);return new TextDecoder().decode(e)}catch(e){return console.warn(`Decompression failed, assuming data is not compressed:`,e),new TextDecoder().decode(t)}}async function eo(e){let t=await $a(e),n=new an({attributeNamePrefix:`@_`,alwaysCreateTextNode:!0,ignoreAttributes:!1}).parse(t);return r.parse(n)}function to(e){let t=e.certificates.map(e=>({"@_use":`signing`,KeyInfo:{"@_xmlns":`http://www.w3.org/2000/09/xmldsig#`,X509Data:{X509Certificate:e}}})),n={EntityDescriptor:{"@_entityID":e.entityId,"@_xmlns":`urn:oasis:names:tc:SAML:2.0:metadata`,IDPSSODescriptor:{"@_protocolSupportEnumeration":`urn:oasis:names:tc:SAML:2.0:protocol`,KeyDescriptor:t,SingleLogoutService:[{"@_Binding":`urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect`,"@_Location":e.singleLogoutServiceUrl},{"@_Binding":`urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST`,"@_Location":e.singleLogoutServiceUrl}],NameIDFormat:[`urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress`,`urn:oasis:names:tc:SAML:2.0:nameid-format:persistent`,`urn:oasis:names:tc:SAML:2.0:nameid-format:transient`],SingleSignOnService:[{"@_Binding":`urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect`,"@_Location":e.assertionConsumerServiceUrl},{"@_Binding":`urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST`,"@_Location":e.assertionConsumerServiceUrl}],Attribute:[{"@_Name":`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:uri`,"@_FriendlyName":`E-Mail Address`,"@_xmlns":`urn:oasis:names:tc:SAML:2.0:assertion`},{"@_Name":`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:uri`,"@_FriendlyName":`Given Name`,"@_xmlns":`urn:oasis:names:tc:SAML:2.0:assertion`},{"@_Name":`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:uri`,"@_FriendlyName":`Name`,"@_xmlns":`urn:oasis:names:tc:SAML:2.0:assertion`},{"@_Name":`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:uri`,"@_FriendlyName":`Surname`,"@_xmlns":`urn:oasis:names:tc:SAML:2.0:assertion`},{"@_Name":`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:uri`,"@_FriendlyName":`Name ID`,"@_xmlns":`urn:oasis:names:tc:SAML:2.0:assertion`}]}}};return new wn({ignoreAttributes:!1,suppressEmptyNode:!0,preserveOrder:!1,format:!0,attributeNamePrefix:`@_`}).build(n)}async function no(e,t){let n=e.notBefore||new Date().toISOString(),r=e.notAfter||new Date(new Date(n).getTime()+600*1e3).toISOString(),i=e.issueInstant||n,a=e.sessionNotOnOrAfter||r,o=e.responseId||`_${Za()}`,s=e.assertionId||`_${Za()}`,c=[{"samlp:Response":[{"saml:Issuer":[{"#text":e.issuer}]},{"samlp:Status":[{"samlp:StatusCode":[],":@":{"@_Value":`urn:oasis:names:tc:SAML:2.0:status:Success`}}]},{"saml:Assertion":[{"saml:Issuer":[{"#text":e.issuer}]},{"saml:Subject":[{"saml:NameID":[{"#text":e.email}],":@":{"@_Format":`urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress`}},{"saml:SubjectConfirmation":[{"saml:SubjectConfirmationData":[],":@":{"@_InResponseTo":e.inResponseTo,"@_NotOnOrAfter":r,"@_Recipient":e.destination}}],":@":{"@_Method":`urn:oasis:names:tc:SAML:2.0:cm:bearer`}}]},{"saml:Conditions":[{"saml:AudienceRestriction":[{"saml:Audience":[{"#text":e.audience}]}]}],":@":{"@_NotBefore":n,"@_NotOnOrAfter":r}},{"saml:AuthnStatement":[{"saml:AuthnContext":[{"saml:AuthnContextClassRef":[{"#text":`urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified`}]}]}],":@":{"@_AuthnInstant":i,"@_SessionIndex":e.sessionIndex,"@_SessionNotOnOrAfter":a}},{"saml:AttributeStatement":[{"saml:Attribute":[{"saml:AttributeValue":[{"#text":e.userId}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_FriendlyName":`persistent`,"@_Name":`id`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":e.email}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`email`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":`manage-account`}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`Role`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":`default-roles-master`}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`Role`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":`offline_access`}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`Role`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":`view-profile`}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`Role`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":`uma_authorization`}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`Role`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":`manage-account-links`}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`Role`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}}]}],":@":{"@_xmlns":`urn:oasis:names:tc:SAML:2.0:assertion`,"@_ID":s,"@_IssueInstant":i,"@_Version":`2.0`}}],":@":{"@_xmlns:samlp":`urn:oasis:names:tc:SAML:2.0:protocol`,"@_xmlns:saml":`urn:oasis:names:tc:SAML:2.0:assertion`,"@_Destination":e.destination,"@_ID":o,"@_InResponseTo":e.inResponseTo,"@_IssueInstant":i,"@_Version":`2.0`}}],l=new wn({ignoreAttributes:!1,suppressEmptyNode:!0,preserveOrder:!0}).build(c);return e.signature&&t&&(l=await t.signSAML(l,e.signature.privateKeyPem,e.signature.cert)),e.encode===!1?l:btoa(l)}var ro=class{signUrl;constructor(e){this.signUrl=e}async signSAML(e,t,n){let r=await fetch(this.signUrl,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({xmlContent:e,privateKey:t,publicCert:n})});if(!r.ok)throw Error(`Failed to sign SAML via HTTP: ${r.status} ${r.statusText}`);return await r.text()}};exports.HttpSamlSigner=ro,exports.createSamlMetadata=to,exports.createSamlResponse=no,exports.dsSignatureSchema=s,exports.inflateDecompress=$a,exports.inflateRaw=Qa,exports.parseSamlRequestQuery=eo,exports.samlIssuerSchema=n,exports.samlMetadataResponseSchema=i,exports.samlRequestSchema=r,exports.samlResponseJsonSchema=c;
7
+ `):(this.indentate=function(){return``},this.tagEndChar=`>`,this.newLine=``)}function vn(e,t){let n=e[`?xml`];if(n&&typeof n==`object`){if(t.attributesGroupName&&n[t.attributesGroupName]){let e=n[t.attributesGroupName][t.attributeNamePrefix+`version`];if(e)return e}let e=n[t.attributeNamePrefix+`version`];if(e)return e}return`1.0`}function yn(e,t,n,r,i){return!n.sanitizeName||i(e)?e:n.sanitizeName(e,{isAttribute:t,matcher:r.readOnly()})}W.prototype.build=function(e){if(this.options.preserveOrder)return sn(e,this.options);{Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e});let t=new N,n=Ye(`qName`,{xmlVersion:vn(e,this.options)});return this.j2x(e,0,t,n).val}},W.prototype.j2x=function(e,t,n,r){let i=``,a=``;if(this.options.maxNestedTags&&n.getDepth()>=this.options.maxNestedTags)throw Error(`Maximum nested tags exceeded`);let o=this.options.jPath?n.toString():n,s=this.checkStopNode(n);for(let c in e){if(!Object.prototype.hasOwnProperty.call(e,c))continue;let l=c===this.options.textNodeName||c===this.options.cdataPropName||c===this.options.commentPropName||this.options.attributesGroupName&&c===this.options.attributesGroupName||this.isAttribute(c)||c[0]===`?`?c:yn(c,!1,this.options,n,r);if(e[c]===void 0)this.isAttribute(c)&&(a+=``);else if(e[c]===null)this.isAttribute(c)||l===this.options.cdataPropName||l===this.options.commentPropName?a+=``:l[0]===`?`?a+=this.indentate(t)+`<`+l+`?`+this.tagEndChar:a+=this.indentate(t)+`<`+l+`/`+this.tagEndChar;else if(e[c]instanceof Date)a+=this.buildTextValNode(e[c],l,``,t,n);else if(typeof e[c]!=`object`){let u=this.isAttribute(c);if(u&&!this.ignoreAttributesFn(u,o)){let t=yn(u,!0,this.options,n,r);i+=this.buildAttrPairStr(t,``+e[c],s)}else if(!u)if(c===this.options.textNodeName){let t=this.options.tagValueProcessor(c,``+e[c]);a+=this.replaceEntitiesValue(t)}else{n.push(l);let r=this.checkStopNode(n);if(n.pop(),r){let n=``+e[c];n===``?a+=this.indentate(t)+`<`+l+this.closeTag(l)+this.tagEndChar:a+=this.indentate(t)+`<`+l+`>`+n+`</`+l+this.tagEndChar}else a+=this.buildTextValNode(e[c],l,``,t,n)}}else if(Array.isArray(e[c])){let i=e[c].length,o=``,s=``;for(let u=0;u<i;u++){let i=e[c][u];if(i!==void 0)if(i===null)l[0]===`?`?a+=this.indentate(t)+`<`+l+`?`+this.tagEndChar:a+=this.indentate(t)+`<`+l+`/`+this.tagEndChar;else if(typeof i==`object`)if(this.options.oneListGroup){n.push(l);let e=this.j2x(i,t+1,n,r);n.pop(),o+=e.val,this.options.attributesGroupName&&i.hasOwnProperty(this.options.attributesGroupName)&&(s+=e.attrStr)}else o+=this.processTextOrObjNode(i,l,t,n,r);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(l,i);e=this.replaceEntitiesValue(e),o+=e}else{n.push(l);let e=this.checkStopNode(n);if(n.pop(),e){let e=``+i;e===``?o+=this.indentate(t)+`<`+l+this.closeTag(l)+this.tagEndChar:o+=this.indentate(t)+`<`+l+`>`+e+`</`+l+this.tagEndChar}else o+=this.buildTextValNode(i,l,``,t,n)}}this.options.oneListGroup&&(o=this.buildObjectNode(o,l,s,t)),a+=o}else if(this.options.attributesGroupName&&c===this.options.attributesGroupName){let t=Object.keys(e[c]),a=t.length;for(let o=0;o<a;o++){let a=yn(t[o],!0,this.options,n,r);i+=this.buildAttrPairStr(a,``+e[c][t[o]],s)}}else a+=this.processTextOrObjNode(e[c],l,t,n,r)}return{attrStr:i,val:a}},W.prototype.buildAttrPairStr=function(e,t,n){return n||(t=this.options.attributeValueProcessor(e,``+t),t=this.replaceEntitiesValue(t)),this.options.suppressBooleanAttributes&&t===`true`?` `+e:` `+e+`="`+U(t)+`"`};function bn(e,t,n,r,i){let a=this.extractAttributes(e);if(r.push(t,a),this.checkStopNode(r)){let i=this.buildRawContent(e),a=this.buildAttributesForStopNode(e);return r.pop(),this.buildObjectNode(i,t,a,n)}let o=this.j2x(e,n+1,r,i);return r.pop(),t[0]===`?`?this.buildTextValNode(``,t,o.attrStr,n,r):e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,o.attrStr,n,r):this.buildObjectNode(o.val,t,o.attrStr,n)}W.prototype.extractAttributes=function(e){if(!e||typeof e!=`object`)return null;let t={},n=!1;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){let r=e[this.options.attributesGroupName];for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let i=e.startsWith(this.options.attributeNamePrefix)?e.substring(this.options.attributeNamePrefix.length):e;t[i]=U(r[e]),n=!0}}else for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=this.isAttribute(r);i&&(t[i]=U(e[r]),n=!0)}return n?t:null},W.prototype.buildRawContent=function(e){if(typeof e==`string`)return e;if(typeof e!=`object`||!e)return String(e);if(e[this.options.textNodeName]!==void 0)return e[this.options.textNodeName];let t=``;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||this.isAttribute(n)||this.options.attributesGroupName&&n===this.options.attributesGroupName)continue;let r=e[n];if(n===this.options.textNodeName)t+=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`||typeof e==`number`)t+=`<${n}>${e}</${n}>`;else if(typeof e==`object`&&e){let r=this.buildRawContent(e),i=this.buildAttributesForStopNode(e);r===``?t+=`<${n}${i}/>`:t+=`<${n}${i}>${r}</${n}>`}}else if(typeof r==`object`&&r){let e=this.buildRawContent(r),i=this.buildAttributesForStopNode(r);e===``?t+=`<${n}${i}/>`:t+=`<${n}${i}>${e}</${n}>`}else t+=`<${n}>${r}</${n}>`}return t},W.prototype.buildAttributesForStopNode=function(e){if(!e||typeof e!=`object`)return``;let t=``;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){let n=e[this.options.attributesGroupName];for(let e in n){if(!Object.prototype.hasOwnProperty.call(n,e))continue;let r=e.startsWith(this.options.attributeNamePrefix)?e.substring(this.options.attributeNamePrefix.length):e,i=n[e];i===!0&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+U(i)+`"`}}else for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=this.isAttribute(n);if(r){let i=e[n];i===!0&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+U(i)+`"`}}return t},W.prototype.buildObjectNode=function(e,t,n,r){if(e===``)return t[0]===`?`?this.indentate(r)+`<`+t+n+`?`+this.tagEndChar:this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar;if(t[0]===`?`)return this.indentate(r)+`<`+t+n+`?`+this.tagEndChar;{let i=`</`+t+this.tagEndChar,a=``;return t[0]===`?`&&(a=`?`,i=``),(n||n===``)&&e.indexOf(`<`)===-1?this.indentate(r)+`<`+t+n+a+`>`+e+i:this.options.commentPropName!==!1&&t===this.options.commentPropName&&a.length===0?this.indentate(r)+`<!--${H(e)}-->`+this.newLine:this.indentate(r)+`<`+t+n+a+this.tagEndChar+e+this.indentate(r)+i}},W.prototype.closeTag=function(e){let t=``;return this.options.unpairedTags.indexOf(e)===-1?t=this.options.suppressEmptyNode?`/`:`></${e}`:this.options.suppressUnpairedNode||(t=`/`),t},W.prototype.checkStopNode=function(e){if(!this.stopNodeExpressions||this.stopNodeExpressions.length===0)return!1;for(let t=0;t<this.stopNodeExpressions.length;t++)if(e.matches(this.stopNodeExpressions[t]))return!0;return!1},W.prototype.buildTextValNode=function(e,t,n,r,i){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName){let t=nn(e);return this.indentate(r)+`<![CDATA[${t}]]>`+this.newLine}else if(this.options.commentPropName!==!1&&t===this.options.commentPropName){let t=H(e);return this.indentate(r)+`<!--${t}-->`+this.newLine}else if(t[0]===`?`)return this.indentate(r)+`<`+t+n+`?`+this.tagEndChar;else{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),i===``?this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+`<`+t+n+`>`+i+`</`+t+this.tagEndChar}},W.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e};function xn(e){return this.options.indentBy.repeat(e)}function Sn(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}var Cn=W,G=e.z.object({created_at:e.z.string(),updated_at:e.z.string()}),wn=e.z.object({id:e.z.string(),version:e.z.string().optional()}),Tn=e.z.object({name:e.z.string(),version:e.z.string()}),En=e.z.object({name:e.z.string(),value:e.z.string().optional()}),Dn=e.z.object({name:e.z.string().max(255),code:e.z.string().max(1e5),supported_triggers:e.z.array(wn).optional(),runtime:e.z.string().max(50).optional(),dependencies:e.z.array(Tn).optional(),secrets:e.z.array(En).optional(),is_system:e.z.boolean().optional(),inherit:e.z.boolean().optional()});Dn.partial().extend({status:e.z.enum([`draft`,`built`]).optional(),deployed_at:e.z.string().optional()});var On=Dn.extend({id:e.z.string(),tenant_id:e.z.string(),status:e.z.enum([`draft`,`built`]).default(`built`),deployed_at:e.z.string().optional(),secrets:e.z.array(e.z.object({name:e.z.string(),value:e.z.string().optional()})).optional()}).extend(G.shape),kn=e.z.object({name:e.z.string()});On.extend({secrets:e.z.array(kn).optional()});var An=e.z.string(),jn=e.z.enum([`unspecified`,`pending`,`final`,`partial`,`canceled`,`suspended`]),Mn=e.z.object({id:e.z.string(),msg:e.z.string(),url:e.z.string().optional()}),Nn=e.z.object({action_name:e.z.string(),error:Mn.nullable(),started_at:e.z.string(),ended_at:e.z.string()}),Pn=e.z.object({level:e.z.enum([`log`,`info`,`warn`,`error`,`debug`]),message:e.z.string()}),Fn=e.z.array(e.z.object({action_name:e.z.string(),lines:e.z.array(Pn)}));e.z.object({id:e.z.string(),tenant_id:e.z.string(),trigger_id:An,status:jn,results:e.z.array(Nn),logs:Fn.optional(),created_at:e.z.string(),updated_at:e.z.string()}).omit({tenant_id:!0,created_at:!0,updated_at:!0}),e.z.object({action_id:e.z.string(),code:e.z.string().max(1e5),runtime:e.z.string().max(50).optional(),dependencies:e.z.array(Tn).optional(),secrets:e.z.array(En).optional(),supported_triggers:e.z.array(wn).optional(),deployed:e.z.boolean().default(!0)}).extend({id:e.z.string(),tenant_id:e.z.string(),number:e.z.number().int()}).extend(G.shape);var In=e.z.enum([`user_action`,`admin_action`,`system`,`api`]),Ln=e.z.object({type:e.z.enum([`user`,`admin`,`system`,`api_key`,`client_credentials`]),id:e.z.string().optional(),email:e.z.string().optional(),org_id:e.z.string().optional(),org_name:e.z.string().optional(),scopes:e.z.array(e.z.string()).optional(),client_id:e.z.string().optional()}),Rn=e.z.object({type:e.z.string(),id:e.z.string(),before:e.z.record(e.z.string(),e.z.unknown()).optional(),after:e.z.record(e.z.string(),e.z.unknown()).optional(),diff:e.z.record(e.z.string(),e.z.object({old:e.z.unknown(),new:e.z.unknown()})).optional()}),zn=e.z.object({method:e.z.string(),path:e.z.string(),query:e.z.record(e.z.string(),e.z.string()).optional(),body:e.z.unknown().optional(),ip:e.z.string(),user_agent:e.z.string().optional(),correlation_id:e.z.string().optional(),redirect_uri:e.z.string().optional()}),Bn=e.z.object({status_code:e.z.number(),body:e.z.unknown().optional()}),Vn=e.z.object({country_code:e.z.string(),city_name:e.z.string(),latitude:e.z.string(),longitude:e.z.string(),time_zone:e.z.string(),continent_code:e.z.string()}),Hn=e.z.object({name:e.z.string(),version:e.z.string(),env:e.z.record(e.z.string(),e.z.string()).optional()});e.z.object({tenant_id:e.z.string(),event_type:e.z.string(),log_type:e.z.string(),description:e.z.string().optional(),category:In,actor:Ln,target:Rn,request:zn,response:Bn.optional(),connection:e.z.string().optional(),connection_id:e.z.string().optional(),client_name:e.z.string().optional(),strategy:e.z.string().optional(),strategy_type:e.z.string().optional(),audience:e.z.string().optional(),scope:e.z.string().optional(),location:Vn.optional(),auth0_client:Hn.optional(),hostname:e.z.string(),is_mobile:e.z.boolean().optional(),timestamp:e.z.string()}).extend({id:e.z.string()}),e.z.enum([`AUTH0`,`EMAIL`,`REDIRECT`]),e.z.enum([`CREATE_USER`,`GET_USER`,`UPDATE_USER`,`SEND_REQUEST`,`SEND_EMAIL`]),e.z.enum([`VERIFY_EMAIL`]);var Un=e.z.object({require_mx_record:e.z.boolean().optional(),block_aliases:e.z.boolean().optional(),block_free_emails:e.z.boolean().optional(),block_disposable_emails:e.z.boolean().optional(),blocklist:e.z.array(e.z.string()).optional(),allowlist:e.z.array(e.z.string()).optional()}),Wn=e.z.object({id:e.z.string(),alias:e.z.string().max(100).optional(),type:e.z.literal(`AUTH0`),action:e.z.literal(`UPDATE_USER`),allow_failure:e.z.boolean().optional(),mask_output:e.z.boolean().optional(),params:e.z.object({connection_id:e.z.string().optional(),user_id:e.z.string(),changes:e.z.record(e.z.string(),e.z.any())})}),Gn=e.z.object({id:e.z.string(),alias:e.z.string().max(100).optional(),type:e.z.literal(`EMAIL`),action:e.z.literal(`VERIFY_EMAIL`),allow_failure:e.z.boolean().optional(),mask_output:e.z.boolean().optional(),params:e.z.object({email:e.z.string(),rules:Un.optional()})}),Kn=e.z.enum([`change-email`,`account`,`custom`]),qn=e.z.object({id:e.z.string(),alias:e.z.string().max(100).optional(),type:e.z.literal(`REDIRECT`),action:e.z.literal(`REDIRECT_USER`),allow_failure:e.z.boolean().optional(),mask_output:e.z.boolean().optional(),params:e.z.object({target:Kn.openapi({description:`The predefined target to redirect to, or 'custom' for a custom URL`}),custom_url:e.z.string().optional().openapi({description:`Custom URL to redirect to when target is 'custom'`})})}),Jn=e.z.union([Wn,Gn,qn]);e.z.object({name:e.z.string().min(1).max(150).openapi({description:`The name of the flow`}),actions:e.z.array(Jn).optional().default([]).openapi({description:`The list of actions to execute in sequence`})}).extend(G.shape).extend({id:e.z.string().openapi({description:`Unique identifier for the flow`,example:`af_12tMpdJ3iek7svMyZkSh5M`})}),e.z.object({page:e.z.string().min(0).optional().default(`0`).transform(e=>parseInt(e,10)).openapi({description:`The page number where 0 is the first page`}),per_page:e.z.string().min(1).optional().default(`50`).transform(e=>parseInt(e,10)).openapi({description:`The number of items per page. Defaults to 50.`}),include_totals:e.z.string().optional().default(`false`).transform(e=>e===`true`).openapi({description:`If the total number of items should be included in the response`}),sort:e.z.string().regex(/^.+:(-1|1)$/).optional().openapi({description:`A property that should have the format 'string:-1' or 'string:1'`}),q:e.z.string().optional().openapi({description:`A lucene query string used to filter the results`})}),e.z.object({start:e.z.number(),limit:e.z.number(),length:e.z.number(),total:e.z.number().optional(),next:e.z.string().optional()});var Yn=e.z.object({email:e.z.string().optional(),email_verified:e.z.boolean().optional(),name:e.z.string().optional(),username:e.z.string().optional(),given_name:e.z.string().optional(),phone_number:e.z.string().optional(),phone_verified:e.z.boolean().optional(),family_name:e.z.string().optional()}).catchall(e.z.any()),Xn=e.z.object({connection:e.z.string(),user_id:e.z.string(),provider:e.z.string(),isSocial:e.z.boolean(),email:e.z.string().optional(),email_verified:e.z.boolean().optional(),phone_number:e.z.string().optional(),phone_verified:e.z.boolean().optional(),username:e.z.string().optional(),access_token:e.z.string().optional(),access_token_secret:e.z.string().optional(),refresh_token:e.z.string().optional(),profileData:Yn.optional()}),Zn=e.z.object({formatted:e.z.string().optional(),street_address:e.z.string().optional(),locality:e.z.string().optional(),region:e.z.string().optional(),postal_code:e.z.string().optional(),country:e.z.string().optional()}).optional(),Qn=e.z.object({email:e.z.string().transform(e=>e.toLowerCase()).optional(),username:e.z.string().refine(e=>!e.includes(`@`),{message:`Usernames must not contain "@". Use the email field for email addresses.`}).optional(),phone_number:e.z.string().optional(),phone_verified:e.z.boolean().optional(),given_name:e.z.string().optional(),family_name:e.z.string().optional(),nickname:e.z.string().optional(),name:e.z.string().optional(),picture:e.z.string().optional(),locale:e.z.string().optional(),linked_to:e.z.string().optional(),profileData:e.z.string().optional(),user_id:e.z.string().optional(),app_metadata:e.z.any().default({}).optional(),user_metadata:e.z.any().default({}).optional(),middle_name:e.z.string().optional(),preferred_username:e.z.string().optional(),profile:e.z.string().optional(),website:e.z.string().optional(),gender:e.z.string().optional(),birthdate:e.z.string().optional(),zoneinfo:e.z.string().optional(),address:Zn});Qn.extend({email_verified:e.z.boolean().default(!1),verify_email:e.z.boolean().optional(),last_ip:e.z.string().optional(),last_login:e.z.string().optional(),user_id:e.z.string().optional(),provider:e.z.string().optional(),connection:e.z.string(),is_social:e.z.boolean().optional(),blocked:e.z.boolean().optional(),registration_completed_at:e.z.string().optional(),password:e.z.object({hash:e.z.string(),algorithm:e.z.string()}).optional()}).omit({password:!0}).extend(G.shape).extend({user_id:e.z.string(),provider:e.z.string(),is_social:e.z.boolean(),email:e.z.string().optional(),login_count:e.z.number().default(0),identities:e.z.array(Xn).optional()}).omit({registration_completed_at:!0}),Qn.extend({login_count:e.z.number(),multifactor:e.z.array(e.z.string()).optional(),last_ip:e.z.string().optional(),last_login:e.z.string().optional(),user_id:e.z.string()}).catchall(e.z.any());var $n=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,er=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=$n[n[e]&63];return t},tr=e.z.object({client_id:e.z.string().optional().openapi({description:`ID of this client. Generated server-side if omitted (Auth0 behavior).`}),name:e.z.string().min(1).openapi({description:`Name of this client (min length: 1 character, does not allow < or >).`}),description:e.z.string().max(140).optional().openapi({description:`Free text description of this client (max length: 140 characters).`}),global:e.z.boolean().default(!1).openapi({description:`Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false).`}),client_secret:e.z.string().default(()=>er()).optional().openapi({description:`Client secret (which you must not make public).`}),app_type:e.z.enum([`native`,`spa`,`regular_web`,`non_interactive`,`resource_server`,`express_configuration`,`rms`,`box`,`cloudbees`,`concur`,`dropbox`,`mscrm`,`echosign`,`egnyte`,`newrelic`,`office365`,`salesforce`,`sentry`,`sharepoint`,`slack`,`springcm`,`zendesk`,`zoom`,`sso_integration`,`oag`]).default(`regular_web`).optional().openapi({description:`The type of application this client represents`}),logo_uri:e.z.string().url().optional().openapi({description:`URL of the logo to display for this client. Recommended size is 150x150 pixels.`}),is_first_party:e.z.boolean().default(!0).openapi({description:`Whether this client is a first party client (true) or not (false). First-party clients skip the consent screen; third-party clients require explicit user consent for non-basic scopes.`}),oidc_conformant:e.z.boolean().default(!0).openapi({description:`Whether this client conforms to strict OIDC specifications (true) or uses legacy features (false).`}),auth0_conformant:e.z.boolean().default(!0).openapi({description:`Whether this client follows Auth0-compatible behavior (true) or strict OIDC behavior (false). When true, profile/email claims are included in the ID token when scopes are requested. When false, these claims are only available from the userinfo endpoint (strict OIDC 5.4 compliance).`}),callbacks:e.z.array(e.z.string()).default([]).optional().openapi({description:`Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.`}),allowed_origins:e.z.array(e.z.string()).default([]).optional().openapi({description:`Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.`}),web_origins:e.z.array(e.z.string()).default([]).optional().openapi({description:`Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode.`}),client_aliases:e.z.array(e.z.string()).default([]).optional().openapi({description:`List of audiences/realms for SAML protocol. Used by the wsfed addon.`}),allowed_clients:e.z.array(e.z.string()).default([]).optional().openapi({description:`List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.`}),connections:e.z.array(e.z.string()).default([]).optional().openapi({description:`List of connection IDs enabled for this client. The order determines the display order on the login page.`}),allowed_logout_urls:e.z.array(e.z.string()).default([]).optional().openapi({description:`Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.`}),session_transfer:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Native to Web SSO Configuration`}),oidc_logout:e.z.object({backchannel_logout_urls:e.z.array(e.z.string()).optional().openapi({description:`URLs that receive a signed OIDC Back-Channel Logout 1.0 logout token when a session this client participated in ends.`}),backchannel_logout_initiators:e.z.object({mode:e.z.enum([`all`,`custom`]).optional().openapi({description:`Whether all session-end events initiate a backchannel logout (all) or only the selected_initiators (custom).`}),selected_initiators:e.z.array(e.z.string()).optional().openapi({description:`Logout initiators that trigger a backchannel logout when mode is custom (e.g. rp-logout, idp-logout, password-changed).`})}).passthrough().optional().openapi({description:`Controls which session-end events initiate backchannel logout notifications. Stored for Auth0 compatibility; not yet enforced — all initiators currently notify.`})}).passthrough().default({}).optional().openapi({description:`Configuration for OIDC backchannel logout`}),grant_types:e.z.array(e.z.string()).default([]).optional().openapi({description:`List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.`}),jwt_configuration:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Configuration related to JWTs for the client.`}),signing_keys:e.z.array(e.z.record(e.z.string(),e.z.any())).default([]).optional().openapi({description:`Signing certificates associated with this client.`}),encryption_key:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Encryption used for WsFed responses with this client.`}),sso:e.z.boolean().default(!1).openapi({description:`Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).`}),sso_disabled:e.z.boolean().default(!1).openapi({description:`Whether Single Sign On is disabled for this client. When true, existing SSO sessions will not be reused and users must authenticate every time.`}),cross_origin_authentication:e.z.boolean().default(!1).openapi({description:`Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).`}),cross_origin_loc:e.z.string().url().optional().openapi({description:`URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.`}),custom_login_page_on:e.z.boolean().default(!1).openapi({description:`Whether a custom login page is to be used (true) or the default provided login page (false).`}),custom_login_page:e.z.string().optional().openapi({description:`The content (HTML, CSS, JS) of the custom login page.`}),custom_login_page_preview:e.z.string().optional().openapi({description:`The content (HTML, CSS, JS) of the custom login page. (Used on Previews)`}),form_template:e.z.string().optional().openapi({description:`HTML form template to be used for WS-Federation.`}),addons:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Addons enabled for this client and their associated configurations.`}),token_endpoint_auth_method:e.z.enum([`none`,`client_secret_post`,`client_secret_basic`,`client_secret_jwt`,`private_key_jwt`]).default(`client_secret_basic`).optional().openapi({description:"Defines the requested authentication method for the token endpoint. `none` (public client), `client_secret_post` / `client_secret_basic` (HTTP POST / Basic), `client_secret_jwt` (RFC 7523 HMAC assertion using client_secret), or `private_key_jwt` (RFC 7523 asymmetric assertion verified against the client's `jwks` / `jwks_uri`)."}),client_metadata:e.z.record(e.z.string(),e.z.string().max(255)).default({}).optional().openapi({description:`Metadata associated with the client, in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed. Field names (max 255 chars) are alphanumeric and may only include the following special characters: :,-+=_*?"/()<>@ [Tab][Space]`}),hide_sign_up_disabled_error:e.z.boolean().default(!1).optional().openapi({description:"Enumeration-safe variant of the connection-level `disable_signup` flag. When a signup is blocked by the password connection and this is true, the identifier screen does not reveal that an email is unknown — it advances to the OTP/password challenge as if the account existed and fails at credential check. Mitigates email enumeration at the cost of UX: users without an account see a generic credential failure instead of an explicit signup-disabled message."}),mobile:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Additional configuration for native mobile apps.`}),initiate_login_uri:e.z.string().url().optional().openapi({description:`Initiate login uri, must be https`}),native_social_login:e.z.record(e.z.string(),e.z.any()).default({}).optional(),refresh_token:e.z.object({rotation_type:e.z.enum([`rotating`,`non-rotating`]).optional().openapi({description:`Whether refresh tokens for this client are rotated on every exchange (Auth0 'rotating' behavior) or kept stable (legacy non-rotating). Defaults to 'non-rotating' when unset.`}),leeway:e.z.number().int().min(0).max(600).optional().openapi({description:`Seconds after a parent token's first rotation during which presenting it again still mints a fresh sibling child instead of triggering reuse-detection. Defaults to 30s when unset.`}),expiration_type:e.z.enum([`expiring`,`non-expiring`]).optional().openapi({description:`Whether refresh tokens for this client expire at all. 'non-expiring' overrides both the absolute and the idle lifetime.`}),token_lifetime:e.z.number().int().min(0).optional().openapi({description:"Refresh-token absolute lifetime in seconds. Falls back to the tenant's `session_lifetime` when unset."}),infinite_token_lifetime:e.z.boolean().optional().openapi({description:"When true, refresh tokens have no absolute expiry (overrides `token_lifetime`)."}),idle_token_lifetime:e.z.number().int().min(0).optional().openapi({description:"Refresh-token idle (sliding) lifetime in seconds, refreshed on every exchange. Falls back to the tenant's `idle_session_lifetime` when unset."}),infinite_idle_token_lifetime:e.z.boolean().optional().openapi({description:"When true, refresh tokens have no idle expiry (overrides `idle_token_lifetime`)."})}).default({}).optional().openapi({description:`Refresh token configuration`}),default_organization:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Defines the default Organization ID and flows`}),organization_usage:e.z.enum([`deny`,`allow`,`require`]).default(`deny`).optional().openapi({description:`Defines how to proceed during an authentication transaction with regards an organization. Can be deny (default), allow or require.`}),organization_require_behavior:e.z.enum([`no_prompt`,`pre_login_prompt`,`post_login_prompt`]).default(`no_prompt`).optional().openapi({description:`Defines how to proceed during an authentication transaction when client.organization_usage: 'require'. Can be no_prompt (default), pre_login_prompt or post_login_prompt. post_login_prompt requires oidc_conformant: true.`}),client_authentication_methods:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Defines client authentication methods.`}),require_pushed_authorization_requests:e.z.boolean().default(!1).openapi({description:`Makes the use of Pushed Authorization Requests mandatory for this client`}),require_proof_of_possession:e.z.boolean().default(!1).openapi({description:`Makes the use of Proof-of-Possession mandatory for this client`}),signed_request_object:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`JWT-secured Authorization Requests (JAR) settings.`}),compliance_level:e.z.enum([`none`,`fapi1_adv_pkj_par`,`fapi1_adv_mtls_par`,`fapi2_sp_pkj_mtls`,`fapi2_sp_mtls_mtls`]).optional().openapi({description:`Defines the compliance level for this client, which may restrict it's capabilities`}),par_request_expiry:e.z.number().optional().openapi({description:`Specifies how long, in seconds, a Pushed Authorization Request URI remains valid`}),token_quota:e.z.record(e.z.string(),e.z.any()).default({}).optional(),owner_user_id:e.z.string().optional().openapi({description:`User ID of the consenting user when this client was created via IAT-gated Dynamic Client Registration. NULL for clients created via the Management API or open DCR.`}),registration_type:e.z.enum([`manual`,`open_dcr`,`iat_dcr`]).optional().openapi({description:"Provenance of this client. `manual` = Management API; `open_dcr` = RFC 7591 without IAT; `iat_dcr` = RFC 7591 with an Initial Access Token."}),registration_metadata:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:"Arbitrary metadata captured at Dynamic Client Registration time that isn't a first-class client field (e.g. integration_type, domain). Also stores `iat_constraints` for clients created via IAT so RFC 7592 PUT can enforce field immutability."}),token_exchange:e.z.object({allow_any_profile_of_type:e.z.array(e.z.literal(`custom_authentication`)).optional()}).optional().openapi({description:'Custom Token Exchange settings. Set `allow_any_profile_of_type` to `["custom_authentication"]` to let this client exchange subject tokens through the tenant\'s token exchange profiles.'}),user_linking_mode:e.z.enum([`builtin`,`off`]).optional().openapi({description:"Per-client override for the built-in email-based user-linking path. `builtin` runs the legacy in-process linking at user creation/email update. `off` disables the legacy path; linking only happens if the tenant has enabled the `account-linking` template hook. When unset, the service-level `userLinkingMode` default applies."})});e.z.object({created_at:e.z.string(),updated_at:e.z.string()}).extend(tr.shape).extend({client_id:e.z.string()});var nr=e.z.object({client_id:e.z.string().min(1).openapi({description:`ID of the client.`}),audience:e.z.string().min(1).openapi({description:`The audience (API identifier) of this client grant.`}),scope:e.z.array(e.z.string()).optional().openapi({description:`Scopes allowed for this client grant.`}),organization_usage:e.z.enum([`deny`,`allow`,`require`]).optional().openapi({description:`Defines whether organizations can be used with client credentials exchanges for this grant.`}),allow_any_organization:e.z.boolean().optional().openapi({description:`If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.`}),is_system:e.z.boolean().optional().openapi({description:`If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly.`}),subject_type:e.z.enum([`client`,`user`]).optional().openapi({description:`The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement.`}),authorization_details_types:e.z.array(e.z.string()).optional().openapi({description:`Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement.`})}),rr=e.z.object({id:e.z.string().openapi({description:`ID of the client grant.`})}).extend(nr.shape).extend({created_at:e.z.string().optional(),updated_at:e.z.string().optional()});e.z.array(rr);var ir=e.z.enum([`iat`,`rat`]),ar=e.z.object({id:e.z.string(),token_hash:e.z.string(),type:ir,client_id:e.z.string().optional(),sub:e.z.string().optional(),constraints:e.z.record(e.z.string(),e.z.unknown()).optional(),single_use:e.z.boolean().default(!1),expires_at:e.z.string().optional()});e.z.object({created_at:e.z.string(),used_at:e.z.string().optional(),revoked_at:e.z.string().optional()}).extend(ar.shape);var K=e.z.object({x:e.z.number(),y:e.z.number()}),or=function(e){return e.RICH_TEXT=`RICH_TEXT`,e.NEXT_BUTTON=`NEXT_BUTTON`,e.BACK_BUTTON=`BACK_BUTTON`,e.SUBMIT_BUTTON=`SUBMIT_BUTTON`,e.DIVIDER=`DIVIDER`,e.TEXT=`TEXT`,e.EMAIL=`EMAIL`,e.PASSWORD=`PASSWORD`,e.NUMBER=`NUMBER`,e.PHONE=`PHONE`,e.DATE=`DATE`,e.CHECKBOX=`CHECKBOX`,e.RADIO=`RADIO`,e.SELECT=`SELECT`,e.HIDDEN=`HIDDEN`,e.LEGAL=`LEGAL`,e}({}),sr=function(e){return e.BLOCK=`BLOCK`,e.FIELD=`FIELD`,e}({}),q=e.z.object({id:e.z.string(),category:e.z.nativeEnum(sr),type:e.z.nativeEnum(or)}),cr=q.extend({category:e.z.literal(`BLOCK`),type:e.z.literal(`RICH_TEXT`),config:e.z.object({content:e.z.string()}).passthrough()}),lr=q.extend({category:e.z.literal(`BLOCK`),type:e.z.union([e.z.literal(`NEXT_BUTTON`),e.z.literal(`BACK_BUTTON`),e.z.literal(`SUBMIT_BUTTON`)]),config:e.z.object({text:e.z.string()}).passthrough()}),ur=q.extend({category:e.z.literal(`FIELD`),type:e.z.literal(`LEGAL`),required:e.z.boolean().optional(),sensitive:e.z.boolean().optional(),config:e.z.object({text:e.z.string()}).passthrough()}),dr=q.extend({category:e.z.literal(`FIELD`),type:e.z.union([e.z.literal(`TEXT`),e.z.literal(`EMAIL`),e.z.literal(`PASSWORD`),e.z.literal(`NUMBER`),e.z.literal(`PHONE`),e.z.literal(`DATE`),e.z.literal(`CHECKBOX`),e.z.literal(`RADIO`),e.z.literal(`SELECT`),e.z.literal(`HIDDEN`)]),required:e.z.boolean().optional(),sensitive:e.z.boolean().optional(),config:e.z.object({label:e.z.string().optional(),placeholder:e.z.string().optional()}).passthrough()}),fr=e.z.object({id:e.z.string(),category:e.z.string(),type:e.z.string()}).passthrough(),pr=e.z.union([cr,lr,ur,dr,fr]),mr=e.z.object({id:e.z.string(),type:e.z.literal(`STEP`),coordinates:K,alias:e.z.string().optional(),config:e.z.object({components:e.z.array(pr),next_node:e.z.string()}).passthrough()}),hr=e.z.object({id:e.z.string(),type:e.z.literal(`FLOW`),coordinates:K,alias:e.z.string().optional(),config:e.z.object({flow_id:e.z.string(),next_node:e.z.string()})}),gr=e.z.object({id:e.z.string(),type:e.z.literal(`ACTION`),coordinates:K,alias:e.z.string().optional(),config:e.z.object({action_type:e.z.enum([`REDIRECT`]).openapi({description:`The type of action to perform`}),target:e.z.enum([`change-email`,`account`,`custom`]).openapi({description:`The predefined target to redirect to`}),custom_url:e.z.string().optional().openapi({description:`Custom URL when target is 'custom'`}),next_node:e.z.string().openapi({description:`The next node to navigate to after action (for non-redirect actions)`})}).passthrough()}),_r=e.z.object({id:e.z.string(),type:e.z.string(),coordinates:K}).passthrough(),vr=e.z.union([mr,hr,gr,_r]),yr=e.z.object({next_node:e.z.string(),coordinates:K}).passthrough(),br=e.z.object({resume_flow:e.z.boolean().optional(),coordinates:K}).passthrough();e.z.object({id:e.z.string(),name:e.z.string(),languages:e.z.object({primary:e.z.string()}).passthrough(),nodes:e.z.array(vr),start:yr,ending:br,created_at:e.z.string(),updated_at:e.z.string(),links:e.z.object({sdkSrc:e.z.string().optional(),sdk_src:e.z.string().optional()}).passthrough()}).passthrough().omit({id:!0,created_at:!0,updated_at:!0});var xr=function(e){return e.TOKEN=`token`,e.ID_TOKEN=`id_token`,e.TOKEN_ID_TOKEN=`id_token token`,e.CODE=`code`,e.CODE_ID_TOKEN=`code id_token`,e.CODE_TOKEN=`code token`,e.CODE_ID_TOKEN_TOKEN=`code id_token token`,e}({}),Sr=function(e){return e.QUERY=`query`,e.FRAGMENT=`fragment`,e.FORM_POST=`form_post`,e.WEB_MESSAGE=`web_message`,e.SAML_POST=`saml_post`,e}({}),Cr=function(e){return e.S256=`S256`,e.Plain=`plain`,e}({}),wr=e.z.union([e.z.null(),e.z.object({essential:e.z.boolean().optional(),value:e.z.unknown().optional(),values:e.z.array(e.z.unknown()).optional()})]).nullable(),Tr=e.z.object({userinfo:e.z.record(e.z.string(),wr).optional(),id_token:e.z.record(e.z.string(),wr).optional()}),Er=e.z.object({client_id:e.z.string(),act_as:e.z.string().optional(),response_type:e.z.nativeEnum(xr).optional(),response_mode:e.z.nativeEnum(Sr).optional(),redirect_uri:e.z.string().optional(),audience:e.z.string().optional(),organization:e.z.string().optional(),state:e.z.string().optional(),nonce:e.z.string().optional(),scope:e.z.string().optional(),prompt:e.z.string().optional(),code_challenge_method:e.z.nativeEnum(Cr).optional(),code_challenge:e.z.string().optional(),username:e.z.string().optional(),ui_locales:e.z.string().optional(),max_age:e.z.number().optional(),acr_values:e.z.string().optional(),claims:Tr.optional(),vendor_id:e.z.string().optional()});e.z.object({colors:e.z.object({primary:e.z.string(),page_background:e.z.union([e.z.string(),e.z.object({type:e.z.string().optional(),start:e.z.string().optional(),end:e.z.string().optional(),angle_deg:e.z.number().optional()})]).optional()}).optional(),logo_url:e.z.string().optional(),favicon_url:e.z.string().optional(),powered_by_logo_url:e.z.string().optional(),font:e.z.object({url:e.z.string()}).optional(),dark_mode:e.z.enum([`dark`,`light`,`auto`]).optional()});var Dr=e.z.enum([`password_reset`,`email_verification`,`otp`,`mfa_otp`,`authorization_code`,`oauth2_state`,`ticket`,`client_assertion_jti`,`subject_token_jti`]);e.z.object({code_id:e.z.string().openapi({description:`The code that will be used in for instance an email verification flow`}),login_id:e.z.string().optional().openapi({description:`The id of the login session that the code is connected to`}),connection_id:e.z.string().optional().openapi({description:`The connection that the code is connected to`}),code_type:Dr,code_verifier:e.z.string().optional().openapi({description:`The code verifier used in PKCE in outbound flows`}),code_challenge:e.z.string().optional().openapi({description:`The code challenge used in PKCE in outbound flows`}),code_challenge_method:e.z.enum([`plain`,`S256`]).optional().openapi({description:`The code challenge method used in PKCE in outbound flows`}),redirect_uri:e.z.string().optional().openapi({description:`The redirect URI associated with the code`}),otp:e.z.string().optional().openapi({description:`The one-time password value for OTP-based flows`}),nonce:e.z.string().optional().openapi({description:`The nonce value used for security in OIDC flows`}),state:e.z.string().optional().openapi({description:`The state parameter used for CSRF protection in OAuth flows`}),expires_at:e.z.string(),used_at:e.z.string().optional(),user_id:e.z.string().optional()}).extend({created_at:e.z.string()});var Or=e.z.object({kid:e.z.string().optional(),team_id:e.z.string().optional(),realms:e.z.string().optional(),authentication_method:e.z.string().optional(),client_id:e.z.string().optional(),client_secret:e.z.string().optional(),app_secret:e.z.string().optional(),scope:e.z.string().optional(),client_secret_hint:e.z.string().optional(),app_secret_hint:e.z.string().optional(),twilio_token_hint:e.z.string().optional(),authorization_endpoint:e.z.string().optional(),token_endpoint:e.z.string().optional(),userinfo_endpoint:e.z.string().optional(),jwks_uri:e.z.string().optional(),discovery_url:e.z.string().optional(),issuer:e.z.string().optional(),token_endpoint_auth_method:e.z.enum([`client_secret_basic`,`client_secret_post`]).optional(),provider:e.z.string().optional(),from:e.z.string().optional(),twilio_sid:e.z.string().optional(),twilio_token:e.z.string().optional(),icon_url:e.z.string().optional(),domain_aliases:e.z.array(e.z.string()).optional(),callback_url:e.z.string().url().optional(),passwordPolicy:e.z.enum([`none`,`low`,`fair`,`good`,`excellent`]).optional(),password_complexity_options:e.z.object({min_length:e.z.number().optional()}).optional(),password_history:e.z.object({enable:e.z.boolean().optional(),size:e.z.number().optional()}).optional(),password_no_personal_info:e.z.object({enable:e.z.boolean().optional()}).optional(),password_dictionary:e.z.object({enable:e.z.boolean().optional(),dictionary:e.z.array(e.z.string()).optional()}).optional(),disable_signup:e.z.boolean().optional(),brute_force_protection:e.z.boolean().optional(),import_mode:e.z.boolean().optional(),configuration:e.z.object({token_endpoint:e.z.string().optional(),userinfo_endpoint:e.z.string().optional(),client_id:e.z.string().optional(),client_secret:e.z.string().optional(),client_secret_hint:e.z.string().optional(),realm:e.z.string().optional()}).optional(),attributes:e.z.object({email:e.z.object({identifier:e.z.object({active:e.z.boolean().optional()}).optional(),signup:e.z.object({status:e.z.enum([`required`,`optional`,`disabled`]).optional(),verification:e.z.object({active:e.z.boolean().optional()}).optional()}).optional(),validation:e.z.object({allowed:e.z.boolean().optional()}).optional(),unique:e.z.boolean().optional(),profile_required:e.z.boolean().optional(),verification_method:e.z.enum([`link`,`code`]).optional()}).optional(),username:e.z.object({identifier:e.z.object({active:e.z.boolean().optional()}).optional(),signup:e.z.object({status:e.z.enum([`required`,`optional`,`disabled`]).optional()}).optional(),validation:e.z.object({max_length:e.z.number().optional(),min_length:e.z.number().optional(),allowed_types:e.z.object({email:e.z.boolean().optional(),phone_number:e.z.boolean().optional()}).optional()}).optional(),profile_required:e.z.boolean().optional()}).optional(),phone_number:e.z.object({identifier:e.z.object({active:e.z.boolean().optional()}).optional(),signup:e.z.object({status:e.z.enum([`required`,`optional`,`disabled`]).optional()}).optional()}).optional()}).optional(),authentication_methods:e.z.object({password:e.z.object({enabled:e.z.boolean().optional()}).optional(),passkey:e.z.object({enabled:e.z.boolean().optional()}).optional()}).optional(),passkey_options:e.z.object({challenge_ui:e.z.enum([`both`,`autofill`,`button`]).optional(),local_enrollment_enabled:e.z.boolean().optional(),progressive_enrollment_enabled:e.z.boolean().optional()}).optional(),requires_username:e.z.boolean().optional(),validation:e.z.object({username:e.z.object({min:e.z.number().optional(),max:e.z.number().optional()}).optional()}).optional(),set_user_root_attributes:e.z.enum([`on_each_login`,`on_first_login`,`never_on_login`]).optional()});function kr(e){if(e!==null){if(Array.isArray(e))return e.filter(e=>e!==null).map(kr);if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))r!==null&&(t[n]=kr(r));return t}return e}}var Ar=e.z.object({id:e.z.string().optional(),name:e.z.string(),display_name:e.z.string().optional(),strategy:e.z.string(),options:e.z.preprocess(e=>e===null?{}:kr(e),Or).default({}),enabled_clients:e.z.array(e.z.string()).default([]).optional(),response_type:e.z.nativeEnum(xr).optional(),response_mode:e.z.nativeEnum(Sr).optional(),is_domain_connection:e.z.boolean().optional(),show_as_button:e.z.boolean().optional(),metadata:e.z.record(e.z.string(),e.z.any()).optional(),is_system:e.z.boolean().optional()});e.z.object({id:e.z.string(),created_at:e.z.string().transform(e=>e===null?``:e),updated_at:e.z.string().transform(e=>e===null?``:e)}).extend(Ar.shape);var jr=e.z.object({domain:e.z.string(),custom_domain_id:e.z.string().optional(),type:e.z.enum([`auth0_managed_certs`,`self_managed_certs`]),verification_method:e.z.enum([`txt`]).optional(),tls_policy:e.z.enum([`recommended`]).optional(),custom_client_ip_header:e.z.enum([`true-client-ip`,`cf-connecting-ip`,`x-forwarded-for`,`x-azure-clientip`,`null`]).optional(),domain_metadata:e.z.record(e.z.string(),e.z.string().max(255)).optional()}),Mr=e.z.discriminatedUnion(`name`,[e.z.object({name:e.z.literal(`txt`),record:e.z.string(),domain:e.z.string()}),e.z.object({name:e.z.literal(`http`),http_body:e.z.string(),http_url:e.z.string()})]),Nr=jr.extend({custom_domain_id:e.z.string(),primary:e.z.boolean(),status:e.z.enum([`disabled`,`pending`,`pending_verification`,`ready`]),origin_domain_name:e.z.string().optional(),verification:e.z.object({methods:e.z.array(Mr)}).optional(),tls_policy:e.z.string().optional()});jr.pick({tls_policy:!0,custom_client_ip_header:!0,domain_metadata:!0}).strict(),Nr.extend({tenant_id:e.z.string()}),e.z.object({certificate:e.z.string().regex(/^-----BEGIN CERTIFICATE-----[\s\S]+-----END CERTIFICATE-----\s*$/,`must be PEM-encoded; include the full certificate chain in leaf-first order`),private_key:e.z.string().regex(/-----BEGIN (RSA |EC |ENCRYPTED )?PRIVATE KEY-----[\s\S]+-----END \1PRIVATE KEY-----\s*$/,`must be a PEM-encoded private key`)});var Pr=e.z.object({id:e.z.string(),order:e.z.number().optional(),visible:e.z.boolean().optional().default(!0)}),J=Pr.extend({category:e.z.literal(`BLOCK`).optional()}),Fr=J.extend({type:e.z.literal(`DIVIDER`),config:e.z.object({text:e.z.string().optional()}).optional()}),Ir=J.extend({type:e.z.literal(`HTML`),config:e.z.object({content:e.z.string().optional()}).optional()}),Lr=J.extend({type:e.z.literal(`IMAGE`),config:e.z.object({src:e.z.string().optional(),alt:e.z.string().optional(),width:e.z.number().optional(),height:e.z.number().optional()}).optional()}),Rr=J.extend({type:e.z.literal(`JUMP_BUTTON`),config:e.z.object({text:e.z.string().optional(),target_step:e.z.string().optional()})}),zr=J.extend({type:e.z.literal(`RESEND_BUTTON`),config:e.z.object({text:e.z.string().optional(),resend_action:e.z.string().optional()})}),Br=J.extend({type:e.z.literal(`NEXT_BUTTON`),config:e.z.object({text:e.z.string().optional(),variant:e.z.enum([`primary`,`secondary`]).optional(),skip_validation:e.z.boolean().optional()})}),Vr=J.extend({type:e.z.literal(`PREVIOUS_BUTTON`),config:e.z.object({text:e.z.string().optional()})}),Hr=J.extend({type:e.z.literal(`RICH_TEXT`),config:e.z.object({content:e.z.string().optional()}).optional()}),Ur=Pr.extend({category:e.z.literal(`WIDGET`).optional(),label:e.z.string().min(1).optional(),hint:e.z.string().min(1).max(500).optional(),required:e.z.boolean().optional(),sensitive:e.z.boolean().optional()}),Wr=Ur.extend({type:e.z.literal(`AUTH0_VERIFIABLE_CREDENTIALS`),config:e.z.object({credential_type:e.z.string().optional()})}),Gr=Ur.extend({type:e.z.literal(`GMAPS_ADDRESS`),config:e.z.object({api_key:e.z.string().optional()})}),Kr=Ur.extend({type:e.z.literal(`RECAPTCHA`),config:e.z.object({site_key:e.z.string().optional()})}),Y=Pr.extend({category:e.z.literal(`FIELD`).optional(),label:e.z.string().min(1).optional(),hint:e.z.string().min(1).max(500).optional(),messages:e.z.array(e.z.object({id:e.z.number().optional(),text:e.z.string(),type:e.z.enum([`info`,`error`,`success`,`warning`])})).optional(),required:e.z.boolean().optional(),sensitive:e.z.boolean().optional()}),qr=Y.extend({type:e.z.literal(`BOOLEAN`),config:e.z.object({default_value:e.z.boolean().optional()}).optional()}),Jr=Y.extend({type:e.z.literal(`CARDS`),config:e.z.object({options:e.z.array(e.z.object({value:e.z.string(),label:e.z.string(),description:e.z.string().optional(),image:e.z.string().optional()})).optional(),multi_select:e.z.boolean().optional()}).optional()}),Yr=Y.extend({type:e.z.literal(`CHOICE`),config:e.z.object({options:e.z.array(e.z.object({value:e.z.string(),label:e.z.string()})).optional(),display:e.z.enum([`radio`,`checkbox`]).optional(),multiple:e.z.boolean().optional(),default_value:e.z.union([e.z.string(),e.z.array(e.z.string())]).optional()}).optional()}),Xr=Y.extend({type:e.z.literal(`CODE`),config:e.z.object({length:e.z.number().int().positive().max(100).optional(),mode:e.z.enum([`numeric`,`alphanumeric`]).optional(),auto_submit:e.z.boolean().optional(),group_size:e.z.number().int().min(0).max(100).optional(),separator:e.z.string().optional(),placeholder:e.z.string().optional(),default_value:e.z.string().optional()}).refine(e=>e.group_size===void 0||e.length===void 0||e.group_size<=e.length,{message:`group_size cannot exceed length`,path:[`group_size`]}).refine(e=>e.default_value===void 0||e.length===void 0||e.default_value.length<=e.length,{message:`default_value is longer than the configured length`,path:[`default_value`]}).optional()}),Zr=Y.extend({type:e.z.literal(`CUSTOM`),config:e.z.object({component:e.z.string().optional(),props:e.z.record(e.z.string(),e.z.any()).optional(),schema:e.z.record(e.z.string(),e.z.any()).optional(),code:e.z.string().optional()})}),Qr=Y.extend({type:e.z.literal(`DATE`),config:e.z.object({format:e.z.string().optional(),min:e.z.string().optional(),max:e.z.string().optional(),default_value:e.z.string().optional()}).optional()}),$r=Y.extend({type:e.z.literal(`DROPDOWN`),config:e.z.object({options:e.z.array(e.z.object({value:e.z.string(),label:e.z.string()})).optional(),placeholder:e.z.string().optional(),searchable:e.z.boolean().optional(),multiple:e.z.boolean().optional(),default_value:e.z.union([e.z.string(),e.z.array(e.z.string())]).optional()}).optional()}),ei=Y.extend({type:e.z.literal(`EMAIL`),config:e.z.object({placeholder:e.z.string().optional(),default_value:e.z.string().optional(),last_used:e.z.boolean().optional(),last_used_label:e.z.string().optional()}).optional()}),ti=Y.extend({type:e.z.literal(`FILE`),config:e.z.object({accept:e.z.string().optional(),max_size:e.z.number().optional(),multiple:e.z.boolean().optional()}).optional()}),ni=Y.extend({type:e.z.literal(`LEGAL`),config:e.z.object({text:e.z.string(),html:e.z.boolean().optional()}).optional()}),ri=Y.extend({type:e.z.literal(`NUMBER`),config:e.z.object({placeholder:e.z.string().optional(),min:e.z.number().optional(),max:e.z.number().optional(),step:e.z.number().optional(),default_value:e.z.string().optional()}).optional()}),ii=Y.extend({type:e.z.literal(`PASSWORD`),config:e.z.object({placeholder:e.z.string().optional(),min_length:e.z.number().optional(),show_toggle:e.z.boolean().optional(),forgot_password_link:e.z.string().optional(),default_value:e.z.string().optional()}).optional()}),ai=Y.extend({type:e.z.literal(`PAYMENT`),config:e.z.object({provider:e.z.string().optional(),currency:e.z.string().optional()}).optional()}),oi=Y.extend({type:e.z.literal(`SOCIAL`),config:e.z.object({providers:e.z.array(e.z.string()).optional(),provider_details:e.z.array(e.z.object({name:e.z.string(),strategy:e.z.string().optional(),display_name:e.z.string().optional(),icon_url:e.z.string().optional(),href:e.z.string().optional(),last_used:e.z.boolean().optional(),last_used_label:e.z.string().optional()})).optional()}).optional()}),si=Y.extend({type:e.z.literal(`TEL`),config:e.z.object({placeholder:e.z.string().optional(),default_country:e.z.string().optional(),default_value:e.z.string().optional(),allow_email:e.z.boolean().optional()}).optional()}),ci=Y.extend({type:e.z.literal(`TEXT`),config:e.z.object({placeholder:e.z.string().optional(),multiline:e.z.boolean().optional(),max_length:e.z.number().optional(),default_value:e.z.string().optional(),last_used:e.z.boolean().optional(),last_used_label:e.z.string().optional()}).optional()}),li=Y.extend({type:e.z.literal(`COUNTRY`),config:e.z.object({placeholder:e.z.string().optional(),default_value:e.z.string().optional()}).optional()}),ui=Y.extend({type:e.z.literal(`URL`),config:e.z.object({placeholder:e.z.string().optional(),default_value:e.z.string().optional()}).optional()}),di=e.z.discriminatedUnion(`type`,[Fr,Ir,Lr,Rr,zr,Br,Vr,Hr]),fi=e.z.discriminatedUnion(`type`,[Wr,Gr,Kr]),pi=e.z.discriminatedUnion(`type`,[qr,Jr,Yr,Xr,li,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,ui]),mi=e.z.union([di,fi,pi]);new Set([`BOOLEAN`,`CARDS`,`CHOICE`,`CODE`,`COUNTRY`,`DATE`,`DROPDOWN`,`EMAIL`,`LEGAL`,`NUMBER`,`PASSWORD`,`TEL`,`TEXT`,`URL`]),e.z.object({id:e.z.string(),type:e.z.literal(`submit`),label:e.z.string(),className:e.z.string().optional(),disabled:e.z.boolean().optional().default(!1),order:e.z.number().optional(),visible:e.z.boolean().optional().default(!0),customizations:e.z.record(e.z.string(),e.z.any()).optional()});var X=e.z.object({x:e.z.number(),y:e.z.number()}),hi=e.z.object({id:e.z.string(),type:e.z.literal(`FLOW`),coordinates:X,alias:e.z.string().min(1).max(150).optional(),config:e.z.object({flow_id:e.z.string().max(30),next_node:e.z.string().optional()})}),gi=e.z.object({id:e.z.string(),type:e.z.literal(`ROUTER`),coordinates:X,alias:e.z.string().min(1).max(150),config:e.z.object({rules:e.z.array(e.z.object({id:e.z.string(),alias:e.z.string().min(1).max(150).optional(),condition:e.z.any(),next_node:e.z.string()})),fallback:e.z.string()})}),_i=e.z.object({id:e.z.string(),type:e.z.literal(`STEP`),coordinates:X,alias:e.z.string().min(1).max(150).optional(),config:e.z.object({components:e.z.array(mi),next_node:e.z.string().optional()})}),vi=e.z.discriminatedUnion(`type`,[hi,gi,_i]),yi=e.z.object({name:e.z.string().openapi({description:`The name of the form`}),messages:e.z.object({errors:e.z.record(e.z.string(),e.z.any()).optional(),custom:e.z.record(e.z.string(),e.z.any()).optional()}).optional(),languages:e.z.object({primary:e.z.string().optional(),default:e.z.string().optional()}).optional(),translations:e.z.record(e.z.string(),e.z.any()).optional(),nodes:e.z.array(vi).optional(),start:e.z.object({hidden_fields:e.z.array(e.z.object({key:e.z.string(),value:e.z.string()})).optional(),next_node:e.z.string().optional(),coordinates:X.optional()}).optional(),ending:e.z.object({redirection:e.z.object({delay:e.z.number().optional(),target:e.z.string().optional()}).optional(),after_submit:e.z.object({flow_id:e.z.string().optional()}).optional(),coordinates:X.optional(),resume_flow:e.z.boolean().optional()}).optional(),style:e.z.object({css:e.z.string().optional()}).optional(),links:e.z.object({sdkSrc:e.z.string().optional(),sdk_src:e.z.string().optional()}).optional()}).openapi({description:`Schema for flow-based forms (matches Auth0 Forms structure)`});G.extend(yi.shape).extend({id:e.z.string()});var bi=e.z.object({id:e.z.number().optional(),text:e.z.string(),type:e.z.enum([`info`,`error`,`success`,`warning`])}),xi=e.z.object({id:e.z.string().optional(),text:e.z.string(),href:e.z.string(),linkText:e.z.string().optional()});e.z.object({name:e.z.string().optional(),action:e.z.string(),method:e.z.enum([`POST`,`GET`]),title:e.z.string().optional(),description:e.z.string().optional(),components:e.z.array(mi),messages:e.z.array(bi).optional(),links:e.z.array(xi).optional(),footer:e.z.string().optional()});var Si=e.z.enum([`pre-user-registration`,`post-user-registration`,`post-user-login`,`post-user-update`,`validate-registration-username`,`pre-user-deletion`,`post-user-deletion`]),Ci=e.z.enum([`post-user-login`]),wi=e.z.enum([`post-user-login`,`post-user-registration`,`post-user-update`,`credentials-exchange`]),Ti=e.z.enum([`post-user-login`,`credentials-exchange`,`pre-user-registration`,`post-user-registration`]),Ei=e.z.enum([`post-user-login`]);Si.options,Ci.options,wi.options,Ti.options,Ei.options;var Di=e.z.enum([`impersonate`]),Oi=e.z.enum([`ensure-username`,`set-preferred-username`,`account-linking`]),Z={enabled:e.z.boolean().default(!1),synchronous:e.z.boolean().default(!1),priority:e.z.number().optional(),hook_id:e.z.string().optional(),metadata:e.z.record(e.z.string(),e.z.unknown()).optional()},ki=e.z.object({...Z,trigger_id:Si,url:e.z.string()}),Ai=e.z.object({...Z,trigger_id:Ci,form_id:e.z.string()}),ji=e.z.object({...Z,trigger_id:wi,template_id:Oi}),Mi=e.z.object({...Z,trigger_id:Ti,code_id:e.z.string()}),Ni=e.z.object({...Z,trigger_id:Ei,page_id:Di,permission_required:e.z.string().optional()});e.z.union([ki,Ai,ji,Mi,Ni]);var Pi=e.z.object({...Z,trigger_id:Si}).extend(G.shape).extend({hook_id:e.z.string(),url:e.z.string()}),Fi=e.z.object({...Z,trigger_id:Ci}).extend(G.shape).extend({hook_id:e.z.string(),form_id:e.z.string()}),Ii=e.z.object({...Z,trigger_id:wi}).extend(G.shape).extend({hook_id:e.z.string(),template_id:Oi}),Li=e.z.object({...Z,trigger_id:Ti}).extend(G.shape).extend({hook_id:e.z.string(),code_id:e.z.string()}),Ri=e.z.object({...Z,trigger_id:Ei}).extend(G.shape).extend({hook_id:e.z.string(),page_id:Di,permission_required:e.z.string().optional()});e.z.union([Pi,Fi,Ii,Li,Ri]),e.z.object({code:e.z.string().max(1e5),secrets:e.z.record(e.z.string(),e.z.string()).optional()}).extend({id:e.z.string(),tenant_id:e.z.string()}).extend(G.shape);var zi=e.z.object({name:e.z.string().optional()}),Bi=e.z.object({email:e.z.string().optional()}),Vi=e.z.object({id:e.z.string().optional(),organization_id:e.z.string().max(50),inviter:zi,invitee:Bi,invitation_url:e.z.string().url(),client_id:e.z.string(),connection_id:e.z.string().optional(),app_metadata:e.z.record(e.z.string(),e.z.any()).default({}).optional(),user_metadata:e.z.record(e.z.string(),e.z.any()).default({}).optional(),ttl_sec:e.z.number().int().max(2592e3).default(604800).optional(),roles:e.z.array(e.z.string()).default([]).optional(),send_invitation_email:e.z.boolean().default(!0).optional()});e.z.object({id:e.z.string(),organization_id:e.z.string().max(50),created_at:e.z.string().datetime(),expires_at:e.z.string().datetime(),ticket_id:e.z.string().optional()}).extend(Vi.omit({id:!0}).shape);var Hi=e.z.object({alg:e.z.enum([`RS256`,`RS384`,`RS512`,`ES256`,`ES384`,`ES512`,`HS256`,`HS384`,`HS512`]).optional(),kid:e.z.string().optional(),kty:e.z.enum([`RSA`,`EC`,`oct`]),use:e.z.enum([`sig`,`enc`]).optional(),n:e.z.string().optional(),e:e.z.string().optional(),crv:e.z.string().optional(),x:e.z.string().optional(),y:e.z.string().optional(),x5t:e.z.string().optional(),x5c:e.z.array(e.z.string()).optional()}).superRefine((t,n)=>{if(t.kty===`RSA`)for(let r of[`n`,`e`])t[r]||n.addIssue({code:e.z.ZodIssueCode.custom,path:[r],message:`RSA JWK is missing required member '${r}'`});else if(t.kty===`EC`)for(let r of[`crv`,`x`,`y`])t[r]||n.addIssue({code:e.z.ZodIssueCode.custom,path:[r],message:`EC JWK is missing required member '${r}'`})}),Ui=e.z.object({keys:e.z.array(Hi)});e.z.object({issuer:e.z.string(),authorization_endpoint:e.z.string(),token_endpoint:e.z.string(),userinfo_endpoint:e.z.string(),jwks_uri:e.z.string(),registration_endpoint:e.z.string().optional(),revocation_endpoint:e.z.string(),end_session_endpoint:e.z.string().optional(),scopes_supported:e.z.array(e.z.string()),response_types_supported:e.z.array(e.z.string()),grant_types_supported:e.z.array(e.z.string()).optional(),code_challenge_methods_supported:e.z.array(e.z.string()),response_modes_supported:e.z.array(e.z.string()),subject_types_supported:e.z.array(e.z.string()),id_token_signing_alg_values_supported:e.z.array(e.z.string()),token_endpoint_auth_methods_supported:e.z.array(e.z.string()),claims_supported:e.z.array(e.z.string()),request_uri_parameter_supported:e.z.boolean(),request_parameter_supported:e.z.boolean(),claims_parameter_supported:e.z.boolean().optional(),request_object_signing_alg_values_supported:e.z.array(e.z.string()).optional(),token_endpoint_auth_signing_alg_values_supported:e.z.array(e.z.string()),client_id_metadata_document_supported:e.z.boolean().optional(),backchannel_logout_supported:e.z.boolean().optional(),backchannel_logout_session_supported:e.z.boolean().optional()});var Wi=function(e){return e.PENDING=`pending`,e.AUTHENTICATED=`authenticated`,e.AWAITING_EMAIL_VERIFICATION=`awaiting_email_verification`,e.AWAITING_MFA=`awaiting_mfa`,e.AWAITING_HOOK=`awaiting_hook`,e.AWAITING_CONTINUATION=`awaiting_continuation`,e.AWAITING_CONSENT=`awaiting_consent`,e.COMPLETED=`completed`,e.FAILED=`failed`,e.EXPIRED=`expired`,e}({}),Gi=e.z.nativeEnum(Wi),Ki=e.z.object({strategy:e.z.string(),strategy_type:e.z.string()});e.z.object({csrf_token:e.z.string(),auth0Client:e.z.string().optional(),authParams:Er,expires_at:e.z.string(),deleted_at:e.z.string().optional(),ip:e.z.string().optional(),useragent:e.z.string().optional(),session_id:e.z.string().optional(),authorization_url:e.z.string().optional(),state:Gi.optional().default(`pending`),state_data:e.z.string().optional(),failure_reason:e.z.string().optional(),user_id:e.z.string().optional(),auth_connection:e.z.string().optional(),auth_strategy:Ki.optional(),authenticated_at:e.z.string().optional()}).openapi({description:`This represents a login sesion`}).extend({id:e.z.string().openapi({description:`This is is used as the state in the universal login`}),created_at:e.z.string(),updated_at:e.z.string()});var Q={ACLS_SUMMARY:`acls_summary`,ACTIONS_EXECUTION_FAILED:`actions_execution_failed`,API_LIMIT:`api_limit`,API_LIMIT_WARNING:`api_limit_warning`,APPI:`appi`,CIBA_EXCHANGE_FAILED:`ciba_exchange_failed`,CIBA_EXCHANGE_SUCCEEDED:`ciba_exchange_succeeded`,CIBA_START_FAILED:`ciba_start_failed`,CIBA_START_SUCCEEDED:`ciba_start_succeeded`,CODE_LINK_SENT:`cls`,CODE_SENT:`cs`,DEPRECATION_NOTICE:`depnote`,FAILED_LOGIN:`f`,FAILED_BY_CONNECTOR:`fc`,FAILED_CHANGE_EMAIL:`fce`,FAILED_BY_CORS:`fco`,FAILED_CROSS_ORIGIN_AUTHENTICATION:`fcoa`,FAILED_CHANGE_PASSWORD:`fcp`,FAILED_POST_CHANGE_PASSWORD_HOOK:`fcph`,FAILED_CHANGE_PHONE_NUMBER:`fcpn`,FAILED_CHANGE_PASSWORD_REQUEST:`fcpr`,FAILED_CONNECTOR_PROVISIONING:`fcpro`,FAILED_CHANGE_USERNAME:`fcu`,FAILED_DELEGATION:`fd`,FAILED_DEVICE_ACTIVATION:`fdeac`,FAILED_DEVICE_AUTHORIZATION_REQUEST:`fdeaz`,USER_CANCELED_DEVICE_CONFIRMATION:`fdecc`,FAILED_USER_DELETION:`fdu`,FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:`feacft`,FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:`feccft`,FAILED_EXCHANGE_CUSTOM_TOKEN:`fecte`,FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:`fede`,FAILED_FEDERATED_LOGOUT:`federated_logout_failed`,FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN:`fens`,FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:`feoobft`,FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:`feotpft`,FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:`fepft`,FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN:`fepotpft`,FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:`fercft`,FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN:`ferrt`,FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:`fertft`,FAILED_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN:`festft`,FAILED_HOOK:`fh`,FAILED_IMPERSONATION:`fimp`,FAILED_INVITE_ACCEPT:`fi`,FAILED_LOGOUT:`flo`,FLOWS_EXECUTION_COMPLETED:`flows_execution_completed`,FLOWS_EXECUTION_FAILED:`flows_execution_failed`,FAILED_SENDING_NOTIFICATION:`fn`,FORMS_SUBMISSION_FAILED:`forms_submission_failed`,FORMS_SUBMISSION_SUCCEEDED:`forms_submission_succeeded`,FAILED_LOGIN_INCORRECT_PASSWORD:`fp`,FAILED_PUSHED_AUTHORIZATION_REQUEST:`fpar`,FAILED_POST_USER_REGISTRATION_HOOK:`fpurh`,FAILED_SIGNUP:`fs`,FAILED_SILENT_AUTH:`fsa`,FAILED_LOGIN_INVALID_EMAIL_USERNAME:`fu`,FAILED_USERS_IMPORT:`fui`,FAILED_VERIFICATION_EMAIL:`fv`,FAILED_VERIFICATION_EMAIL_REQUEST:`fvr`,EMAIL_VERIFICATION_CONFIRMED:`gd_auth_email_verification`,EMAIL_VERIFICATION_FAILED:`gd_auth_fail_email_verification`,MFA_AUTH_FAILED:`gd_auth_failed`,MFA_AUTH_REJECTED:`gd_auth_rejected`,MFA_AUTH_SUCCESS:`gd_auth_succeed`,MFA_ENROLLMENT_COMPLETE:`gd_enrollment_complete`,TOO_MANY_MFA_FAILURES:`gd_otp_rate_limit_exceed`,MFA_RECOVERY_FAILED:`gd_recovery_failed`,MFA_RECOVERY_RATE_LIMIT_EXCEED:`gd_recovery_rate_limit_exceed`,MFA_RECOVERY_SUCCESS:`gd_recovery_succeed`,MFA_EMAIL_SENT:`gd_send_email`,EMAIL_VERIFICATION_SENT:`gd_send_email_verification`,EMAIL_VERIFICATION_SEND_FAILURE:`gd_send_email_verification_failure`,PUSH_NOTIFICATION_SENT:`gd_send_pn`,ERROR_SENDING_MFA_PUSH_NOTIFICATION:`gd_send_pn_failure`,MFA_SMS_SENT:`gd_send_sms`,ERROR_SENDING_MFA_SMS:`gd_send_sms_failure`,MFA_VOICE_CALL_SUCCESS:`gd_send_voice`,MFA_VOICE_CALL_FAILED:`gd_send_voice_failure`,SECOND_FACTOR_STARTED:`gd_start_auth`,MFA_ENROLL_STARTED:`gd_start_enroll`,MFA_ENROLLMENT_FAILED:`gd_start_enroll_failed`,GUARDIAN_TENANT_UPDATE:`gd_tenant_update`,UNENROLL_DEVICE_ACCOUNT:`gd_unenroll`,UPDATE_DEVICE_ACCOUNT:`gd_update_device_account`,WEBAUTHN_CHALLENGE_FAILED:`gd_webauthn_challenge_failed`,WEBAUTHN_ENROLLMENT_FAILED:`gd_webauthn_enrollment_failed`,FAILED_KMS_API_OPERATION:`kms_key_management_failure`,SUCCESS_KMS_API_OPERATION:`kms_key_management_success`,KMS_KEY_STATE_CHANGED:`kms_key_state_changed`,TOO_MANY_CALLS_TO_DELEGATION:`limit_delegation`,BLOCKED_IP_ADDRESS:`limit_mu`,BLOCKED_ACCOUNT_IP:`limit_sul`,BLOCKED_ACCOUNT_EMAIL:`limit_wc`,INFORMATION:`i`,MFA_REQUIRED:`mfar`,MANAGEMENT_API_READ_OPERATION:`mgmt_api_read`,FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:`my_account_authentication_method_failed`,SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:`my_account_authentication_method_succeeded`,FAILED_OIDC_BACKCHANNEL_LOGOUT:`oidc_backchannel_logout_failed`,SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT:`oidc_backchannel_logout_succeeded`,ORGANIZATION_MEMBER_ADDED:`organization_member_added`,PASSKEY_CHALLENGE_FAILED:`passkey_challenge_failed`,PASSKEY_CHALLENGE_STARTED:`passkey_challenge_started`,PRE_LOGIN_ASSESSMENT:`pla`,BREACHED_PASSWORD:`pwd_leak`,BREACHED_PASSWORD_ON_RESET:`reset_pwd_leak`,SUCCESS_RESOURCE_CLEANUP:`resource_cleanup`,RICH_CONSENTS_ACCESS_ERROR:`rich_consents_access_error`,SUCCESS_LOGIN:`s`,SUCCESS_API_OPERATION:`sapi`,FAILED_API_OPERATION:`fapi`,SUCCESS_CHANGE_EMAIL:`sce`,SUCCESS_CROSS_ORIGIN_AUTHENTICATION:`scoa`,SUCCESS_CHANGE_PASSWORD:`scp`,SUCCESS_CHANGE_PHONE_NUMBER:`scpn`,SUCCESS_CHANGE_PASSWORD_REQUEST:`scpr`,SUCCESS_CHANGE_USERNAME:`scu`,SUCCESS_CREDENTIAL_VALIDATION:`scv`,SUCCESS_DELEGATION:`sd`,SUCCESS_USER_DELETION:`sdu`,SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:`seacft`,SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:`seccft`,SUCCESS_EXCHANGE_CUSTOM_TOKEN:`secte`,SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:`sede`,SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN:`sens`,SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:`seoobft`,SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:`seotpft`,SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN:`sepotpft`,SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:`sepft`,SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN:`sepkoobft`,SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN:`sepkotpft`,SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN:`sepkrcft`,SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:`sercft`,SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:`sertft`,SUCCESS_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN:`sestft`,SUCCESS_IMPERSONATION:`simp`,SUCCESSFULLY_ACCEPTED_USER_INVITE:`si`,BREACHED_PASSWORD_ON_SIGNUP:`signup_pwd_leak`,SUCCESS_LOGOUT:`slo`,SUCCESS_HOOK:`sh`,SUCCESS_PASSWORD_MIGRATION:`spm`,SUCCESS_REVOCATION:`srrt`,SUCCESS_SIGNUP:`ss`,FAILED_SS_SSO_OPERATION:`ss_sso_failure`,INFORMATION_FROM_SS_SSO_OPERATION:`ss_sso_info`,SUCCESS_SS_SSO_OPERATION:`ss_sso_success`,SUCCESS_SILENT_AUTH:`ssa`,SUCCESSFUL_SCIM_OPERATION:`sscim`,SUCCESSFULLY_IMPORTED_USERS:`sui`,SUCCESS_VERIFICATION_EMAIL:`sv`,SUCCESS_VERIFICATION_EMAIL_REQUEST:`svr`,MAX_AMOUNT_OF_AUTHENTICATORS:`too_many_records`,USER_LOGIN_BLOCK_RELEASED:`ublkdu`,FAILED_UNIVERSAL_LOGOUT:`universal_logout_failed`,SUCCESSFUL_UNIVERSAL_LOGOUT:`universal_logout_succeeded`,WARNING_DURING_LOGIN:`w`,WARNING_SENDING_NOTIFICATION:`wn`,WARNING_USER_MANAGEMENT:`wum`},qi=e.z.string().refine(e=>Object.values(Q).includes(e),{message:`Invalid log type`});Q.ACLS_SUMMARY,Q.ACTIONS_EXECUTION_FAILED,Q.API_LIMIT,Q.API_LIMIT_WARNING,Q.APPI,Q.CIBA_EXCHANGE_FAILED,Q.CIBA_EXCHANGE_SUCCEEDED,Q.CIBA_START_FAILED,Q.CIBA_START_SUCCEEDED,Q.CODE_LINK_SENT,Q.CODE_SENT,Q.DEPRECATION_NOTICE,Q.FAILED_LOGIN,Q.FAILED_BY_CONNECTOR,Q.FAILED_CHANGE_EMAIL,Q.FAILED_BY_CORS,Q.FAILED_CROSS_ORIGIN_AUTHENTICATION,Q.FAILED_CHANGE_PASSWORD,Q.FAILED_POST_CHANGE_PASSWORD_HOOK,Q.FAILED_CHANGE_PHONE_NUMBER,Q.FAILED_CHANGE_PASSWORD_REQUEST,Q.FAILED_CONNECTOR_PROVISIONING,Q.FAILED_CHANGE_USERNAME,Q.FAILED_DELEGATION,Q.FAILED_DEVICE_ACTIVATION,Q.FAILED_DEVICE_AUTHORIZATION_REQUEST,Q.USER_CANCELED_DEVICE_CONFIRMATION,Q.FAILED_USER_DELETION,Q.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS,Q.FAILED_EXCHANGE_CUSTOM_TOKEN,Q.FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN,Q.FAILED_FEDERATED_LOGOUT,Q.FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN,Q.FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN,Q.FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN,Q.FAILED_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN,Q.FAILED_HOOK,Q.FAILED_IMPERSONATION,Q.FAILED_INVITE_ACCEPT,Q.FAILED_LOGOUT,Q.FLOWS_EXECUTION_COMPLETED,Q.FLOWS_EXECUTION_FAILED,Q.FAILED_SENDING_NOTIFICATION,Q.FORMS_SUBMISSION_FAILED,Q.FORMS_SUBMISSION_SUCCEEDED,Q.FAILED_LOGIN_INCORRECT_PASSWORD,Q.FAILED_PUSHED_AUTHORIZATION_REQUEST,Q.FAILED_POST_USER_REGISTRATION_HOOK,Q.FAILED_SIGNUP,Q.FAILED_SILENT_AUTH,Q.FAILED_LOGIN_INVALID_EMAIL_USERNAME,Q.FAILED_USERS_IMPORT,Q.FAILED_VERIFICATION_EMAIL,Q.FAILED_VERIFICATION_EMAIL_REQUEST,Q.EMAIL_VERIFICATION_CONFIRMED,Q.EMAIL_VERIFICATION_FAILED,Q.MFA_AUTH_FAILED,Q.MFA_AUTH_REJECTED,Q.MFA_AUTH_SUCCESS,Q.MFA_ENROLLMENT_COMPLETE,Q.TOO_MANY_MFA_FAILURES,Q.MFA_RECOVERY_FAILED,Q.MFA_RECOVERY_RATE_LIMIT_EXCEED,Q.MFA_RECOVERY_SUCCESS,Q.MFA_EMAIL_SENT,Q.EMAIL_VERIFICATION_SENT,Q.EMAIL_VERIFICATION_SEND_FAILURE,Q.PUSH_NOTIFICATION_SENT,Q.ERROR_SENDING_MFA_PUSH_NOTIFICATION,Q.MFA_SMS_SENT,Q.ERROR_SENDING_MFA_SMS,Q.MFA_VOICE_CALL_SUCCESS,Q.MFA_VOICE_CALL_FAILED,Q.SECOND_FACTOR_STARTED,Q.MFA_ENROLL_STARTED,Q.MFA_ENROLLMENT_FAILED,Q.GUARDIAN_TENANT_UPDATE,Q.UNENROLL_DEVICE_ACCOUNT,Q.UPDATE_DEVICE_ACCOUNT,Q.WEBAUTHN_CHALLENGE_FAILED,Q.WEBAUTHN_ENROLLMENT_FAILED,Q.FAILED_KMS_API_OPERATION,Q.SUCCESS_KMS_API_OPERATION,Q.KMS_KEY_STATE_CHANGED,Q.TOO_MANY_CALLS_TO_DELEGATION,Q.BLOCKED_IP_ADDRESS,Q.BLOCKED_ACCOUNT_IP,Q.BLOCKED_ACCOUNT_EMAIL,Q.INFORMATION,Q.MFA_REQUIRED,Q.MANAGEMENT_API_READ_OPERATION,Q.FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT,Q.SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT,Q.FAILED_OIDC_BACKCHANNEL_LOGOUT,Q.SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT,Q.ORGANIZATION_MEMBER_ADDED,Q.PASSKEY_CHALLENGE_FAILED,Q.PASSKEY_CHALLENGE_STARTED,Q.PRE_LOGIN_ASSESSMENT,Q.BREACHED_PASSWORD,Q.BREACHED_PASSWORD_ON_RESET,Q.SUCCESS_RESOURCE_CLEANUP,Q.RICH_CONSENTS_ACCESS_ERROR,Q.SUCCESS_LOGIN,Q.SUCCESS_API_OPERATION,Q.FAILED_API_OPERATION,Q.SUCCESS_CHANGE_EMAIL,Q.SUCCESS_CROSS_ORIGIN_AUTHENTICATION,Q.SUCCESS_CHANGE_PASSWORD,Q.SUCCESS_CHANGE_PHONE_NUMBER,Q.SUCCESS_CHANGE_PASSWORD_REQUEST,Q.SUCCESS_CHANGE_USERNAME,Q.SUCCESS_CREDENTIAL_VALIDATION,Q.SUCCESS_DELEGATION,Q.SUCCESS_USER_DELETION,Q.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS,Q.SUCCESS_EXCHANGE_CUSTOM_TOKEN,Q.SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN,Q.SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN,Q.SUCCESS_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN,Q.SUCCESS_IMPERSONATION,Q.SUCCESSFULLY_ACCEPTED_USER_INVITE,Q.BREACHED_PASSWORD_ON_SIGNUP,Q.SUCCESS_LOGOUT,Q.SUCCESS_HOOK,Q.SUCCESS_PASSWORD_MIGRATION,Q.SUCCESS_REVOCATION,Q.SUCCESS_SIGNUP,Q.FAILED_SS_SSO_OPERATION,Q.INFORMATION_FROM_SS_SSO_OPERATION,Q.SUCCESS_SS_SSO_OPERATION,Q.SUCCESS_SILENT_AUTH,Q.SUCCESSFUL_SCIM_OPERATION,Q.SUCCESSFULLY_IMPORTED_USERS,Q.SUCCESS_VERIFICATION_EMAIL,Q.SUCCESS_VERIFICATION_EMAIL_REQUEST,Q.MAX_AMOUNT_OF_AUTHENTICATORS,Q.USER_LOGIN_BLOCK_RELEASED,Q.FAILED_UNIVERSAL_LOGOUT,Q.SUCCESSFUL_UNIVERSAL_LOGOUT,Q.WARNING_DURING_LOGIN,Q.WARNING_SENDING_NOTIFICATION,Q.WARNING_USER_MANAGEMENT,(()=>{let e={};for(let[t,n]of Object.entries(Q))t.startsWith(`SUCCESS_`)||t.startsWith(`SUCCESSFUL_`)||t.startsWith(`SUCCESSFULLY_`)||t.endsWith(`_SUCCEEDED`)||t.endsWith(`_COMPLETED`)?e[n]=`success`:t.startsWith(`FAILED_`)||t.startsWith(`ERROR_`)||t.startsWith(`BREACHED_`)||t.startsWith(`BLOCKED_`)||t===`MFA_AUTH_FAILED`||t===`MFA_AUTH_REJECTED`||t===`MFA_RECOVERY_FAILED`||t===`MFA_ENROLLMENT_FAILED`||t===`EMAIL_VERIFICATION_FAILED`||t===`WEBAUTHN_CHALLENGE_FAILED`||t===`WEBAUTHN_ENROLLMENT_FAILED`||t===`PASSKEY_CHALLENGE_FAILED`||t===`FLOWS_EXECUTION_FAILED`||t===`FORMS_SUBMISSION_FAILED`||t===`CIBA_EXCHANGE_FAILED`||t===`CIBA_START_FAILED`||t===`ACTIONS_EXECUTION_FAILED`||t===`RICH_CONSENTS_ACCESS_ERROR`||t===`USER_CANCELED_DEVICE_CONFIRMATION`||t===`TOO_MANY_MFA_FAILURES`||t===`MFA_RECOVERY_RATE_LIMIT_EXCEED`||t===`API_LIMIT`||t===`MAX_AMOUNT_OF_AUTHENTICATORS`?e[n]=`failure`:t.startsWith(`WARNING_`)||t===`API_LIMIT_WARNING`||t===`DEPRECATION_NOTICE`||t===`PRE_LOGIN_ASSESSMENT`?e[n]=`warning`:t===`CODE_SENT`||t===`CODE_LINK_SENT`||t===`MFA_EMAIL_SENT`||t===`MFA_SMS_SENT`||t===`EMAIL_VERIFICATION_SENT`||t===`PUSH_NOTIFICATION_SENT`?e[n]=`code_sent`:t===`INFORMATION`||t===`INFORMATION_FROM_SS_SSO_OPERATION`||t===`MANAGEMENT_API_READ_OPERATION`||t===`APPI`||t===`ACLS_SUMMARY`||t===`ORGANIZATION_MEMBER_ADDED`?e[n]=`info`:e[n]=`other`;return e})();var Ji=e.z.object({name:e.z.string(),version:e.z.string(),env:e.z.object({node:e.z.string().optional()}).optional()}),Yi=e.z.object({country_code:e.z.string().length(2),city_name:e.z.string(),latitude:e.z.string(),longitude:e.z.string(),time_zone:e.z.string(),continent_code:e.z.string()});e.z.object({type:qi,date:e.z.string(),description:e.z.string().optional(),ip:e.z.string().optional(),user_agent:e.z.string().optional(),details:e.z.any().optional(),isMobile:e.z.boolean(),user_id:e.z.string().optional(),user_name:e.z.string().optional(),connection:e.z.string().optional(),connection_id:e.z.string().optional(),client_id:e.z.string().optional(),client_name:e.z.string().optional(),audience:e.z.string().optional(),scope:e.z.string().optional(),strategy:e.z.string().optional(),strategy_type:e.z.string().optional(),hostname:e.z.string().optional(),auth0_client:Ji.optional(),log_id:e.z.string().optional(),location_info:Yi.optional()}).extend({log_id:e.z.string()});var Xi=e.z.enum([`http`,`eventbridge`,`eventgrid`,`splunk`,`datadog`,`sumo`]),Zi=e.z.enum([`active`,`paused`,`suspended`]),Qi=e.z.object({type:e.z.string(),name:e.z.string()});e.z.object({name:e.z.string(),type:Xi,status:Zi.optional(),sink:e.z.record(e.z.string(),e.z.unknown()),filters:e.z.array(Qi).optional(),isPriority:e.z.boolean().optional()}).extend({id:e.z.string(),status:Zi,created_at:e.z.string().optional(),updated_at:e.z.string().optional()});var $i=e.z.enum([`auth0`,`cognito`,`okta`,`oidc`]),ea=e.z.object({domain:e.z.string(),client_id:e.z.string(),client_secret:e.z.string(),audience:e.z.string().optional(),scope:e.z.string().optional()}),ta=e.z.object({id:e.z.string().optional(),name:e.z.string(),provider:$i,connection:e.z.string(),enabled:e.z.boolean().default(!0),credentials:ea});e.z.object({id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()}).extend(ta.shape);var na=e.z.object({enabled:e.z.boolean().optional(),shields:e.z.array(e.z.string()).optional(),admin_notification_frequency:e.z.array(e.z.string()).optional(),method:e.z.string().optional(),stage:e.z.object({"pre-user-registration":e.z.object({shields:e.z.array(e.z.string()).optional()}).optional(),"pre-change-password":e.z.object({shields:e.z.array(e.z.string()).optional()}).optional()}).optional()}),ra=e.z.object({enabled:e.z.boolean().optional(),shields:e.z.array(e.z.string()).optional(),allowlist:e.z.array(e.z.string()).optional(),mode:e.z.string().optional(),max_attempts:e.z.number().optional()}),ia=e.z.object({enabled:e.z.boolean().optional(),shields:e.z.array(e.z.string()).optional(),allowlist:e.z.array(e.z.string()).optional(),stage:e.z.object({"pre-login":e.z.object({max_attempts:e.z.number().optional(),rate:e.z.number().optional()}).optional(),"pre-user-registration":e.z.object({max_attempts:e.z.number().optional(),rate:e.z.number().optional()}).optional()}).optional()}),aa=e.z.object({breached_password_detection:na.optional(),brute_force_protection:ra.optional(),suspicious_ip_throttling:ia.optional()});e.z.object({id:e.z.string().optional(),user_id:e.z.string(),password:e.z.string(),algorithm:e.z.enum([`bcrypt`,`argon2id`]).default(`argon2id`),is_current:e.z.boolean().default(!0)}).extend({id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()});var oa=e.z.object({initial_user_agent:e.z.string().describe(`First user agent of the device from which this user logged in`),initial_ip:e.z.string().describe(`First IP address associated with this session`),initial_asn:e.z.string().describe(`First autonomous system number associated with this session`),last_user_agent:e.z.string().describe(`Last user agent of the device from which this user logged in`),last_ip:e.z.string().describe(`Last IP address from which this user logged in`),last_asn:e.z.string().describe(`Last autonomous system number from which this user logged in`)}),sa=e.z.object({id:e.z.string(),revoked_at:e.z.string().optional(),used_at:e.z.string().optional(),user_id:e.z.string().describe(`The user ID associated with the session`),expires_at:e.z.string().optional(),login_session_id:e.z.string(),idle_expires_at:e.z.string().optional(),device:oa.describe(`Metadata related to the device used in the session`),clients:e.z.array(e.z.string()).describe(`List of client details for the session`)});e.z.object({created_at:e.z.string(),updated_at:e.z.string(),authenticated_at:e.z.string(),last_interaction_at:e.z.string()}).extend(sa.shape),e.z.object({kid:e.z.string().openapi({description:`The key id of the signing key`}),tenant_id:e.z.string().optional().openapi({description:`The tenant the key belongs to. Omitted means the key is shared / control-plane scoped.`}),cert:e.z.string().openapi({description:`The public certificate of the signing key`}),fingerprint:e.z.string().openapi({description:`The cert fingerprint`}),thumbprint:e.z.string().openapi({description:`The cert thumbprint`}),pkcs7:e.z.string().optional().openapi({description:`The private key in pkcs7 format`}),current:e.z.boolean().optional().openapi({description:`True if the key is the current key`}),next:e.z.boolean().optional().openapi({description:`True if the key is the next key`}),previous:e.z.boolean().optional().openapi({description:`True if the key is the previous key`}),current_since:e.z.string().optional().openapi({description:`The date and time when the key became the current key`}),current_until:e.z.string().optional().openapi({description:`The date and time when the current key was rotated`}),revoked:e.z.boolean().optional().openapi({description:`True if the key is revoked`}),revoked_at:e.z.string().optional().openapi({description:`The date and time when the key was revoked`}),connection:e.z.string().optional().openapi({description:`The connection identifier associated with the key`}),type:e.z.enum([`jwt_signing`,`saml_encryption`]).openapi({description:`The type of the signing key`})});var ca=e.z.object({id:e.z.string().optional(),audience:e.z.string().optional(),friendly_name:e.z.string(),picture_url:e.z.string().optional(),support_email:e.z.string().optional(),support_url:e.z.string().optional(),sender_email:e.z.string().email().optional(),sender_name:e.z.string().optional(),session_lifetime:e.z.number().optional(),idle_session_lifetime:e.z.number().optional(),ephemeral_session_lifetime:e.z.number().optional(),idle_ephemeral_session_lifetime:e.z.number().optional(),session_cookie:e.z.object({mode:e.z.enum([`persistent`,`non-persistent`]).optional()}).optional(),allowed_logout_urls:e.z.array(e.z.string()).optional(),default_redirection_uri:e.z.string().optional(),default_client_id:e.z.string().optional(),enabled_locales:e.z.array(e.z.string()).optional(),default_directory:e.z.string().optional(),error_page:e.z.object({html:e.z.string().optional(),show_log_link:e.z.boolean().optional(),url:e.z.string().optional()}).nullish(),flags:e.z.object({allow_changing_enable_sso:e.z.boolean().optional(),allow_legacy_delegation_grant_types:e.z.boolean().optional(),allow_legacy_ro_grant_types:e.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:e.z.boolean().optional(),change_pwd_flow_v1:e.z.boolean().optional(),client_id_metadata_document_registration:e.z.boolean().optional(),custom_domains_provisioning:e.z.boolean().optional(),dashboard_insights_view:e.z.boolean().optional(),dashboard_log_streams_next:e.z.boolean().optional(),disable_clickjack_protection_headers:e.z.boolean().optional(),disable_fields_map_fix:e.z.boolean().optional(),disable_impersonation:e.z.boolean().optional(),disable_management_api_sms_obfuscation:e.z.boolean().optional(),enable_adfs_waad_email_verification:e.z.boolean().optional(),enable_apis_section:e.z.boolean().optional(),enable_client_connections:e.z.boolean().optional(),enable_custom_domain_in_emails:e.z.boolean().optional(),enable_dynamic_client_registration:e.z.boolean().optional(),dcr_require_initial_access_token:e.z.boolean().optional(),dcr_allowed_grant_types:e.z.array(e.z.string()).optional(),allow_http_return_to:e.z.array(e.z.string().refine(e=>{try{let t=new URL(e);return t.protocol===`http:`&&(t.pathname===``||t.pathname===`/`)&&!t.search&&!t.hash&&e===t.origin}catch{return!1}},{message:`must be a fully-qualified http origin (scheme + host + port, no path)`})).optional(),enable_idtoken_api2:e.z.boolean().optional(),enable_legacy_logs_search_v2:e.z.boolean().optional(),enable_legacy_profile:e.z.boolean().optional(),enable_pipeline2:e.z.boolean().optional(),enable_public_signup_user_exists_error:e.z.boolean().optional(),enable_sso:e.z.boolean().optional(),enforce_client_authentication_on_passwordless_start:e.z.boolean().optional(),genai_trial:e.z.boolean().optional(),improved_signup_bot_detection_in_classic:e.z.boolean().optional(),mfa_show_factor_list_on_enrollment:e.z.boolean().optional(),no_disclose_enterprise_connections:e.z.boolean().optional(),remove_alg_from_jwks:e.z.boolean().optional(),revoke_refresh_token_grant:e.z.boolean().optional(),trust_azure_adfs_email_verified_connection_property:e.z.boolean().optional(),use_scope_descriptions_for_consent:e.z.boolean().optional(),inherit_global_permissions_in_organizations:e.z.boolean().optional(),restrict_undefined_scopes:e.z.boolean().optional()}).optional(),sandbox_version:e.z.string().optional(),legacy_sandbox_version:e.z.string().optional(),sandbox_versions_available:e.z.array(e.z.string()).optional(),change_password:e.z.object({enabled:e.z.boolean().optional(),html:e.z.string().optional()}).optional(),guardian_mfa_page:e.z.object({enabled:e.z.boolean().optional(),html:e.z.string().optional()}).optional(),device_flow:e.z.object({charset:e.z.enum([`base20`,`digits`]).optional(),mask:e.z.string().max(20).optional()}).optional(),default_token_quota:e.z.object({clients:e.z.object({client_credentials:e.z.record(e.z.string(),e.z.any()).optional()}).optional(),organizations:e.z.object({client_credentials:e.z.record(e.z.string(),e.z.any()).optional()}).optional()}).nullish(),default_audience:e.z.string().optional(),default_organization:e.z.string().optional(),sessions:e.z.object({oidc_logout_prompt_enabled:e.z.boolean().optional()}).optional(),oidc_logout:e.z.object({rp_logout_end_session_endpoint_discovery:e.z.boolean().optional()}).optional(),allow_organization_name_in_authentication_api:e.z.boolean().optional(),customize_mfa_in_postlogin_action:e.z.boolean().optional(),acr_values_supported:e.z.array(e.z.string()).optional(),mtls:e.z.object({enable_endpoint_aliases:e.z.boolean().optional()}).nullish(),pushed_authorization_requests_supported:e.z.boolean().optional(),authorization_response_iss_parameter_supported:e.z.boolean().optional(),deployment_type:e.z.enum([`shared`,`wfp`]).default(`shared`).optional(),provisioning_state:e.z.enum([`pending`,`ready`,`failed`]).default(`ready`).optional(),provisioning_error:e.z.string().max(2048).optional(),provisioning_state_changed_at:e.z.string().optional(),bundle_configuration:e.z.string().max(64).optional(),worker_version:e.z.string().max(64).optional(),database_version:e.z.string().max(64).optional(),worker_script_name:e.z.string().max(255).optional(),storage_kind:e.z.enum([`own_d1`,`existing_d1`,`shared_planetscale`]).optional(),d1_database_id:e.z.string().max(64).optional(),attack_protection:aa.optional(),mfa:e.z.object({policy:e.z.enum([`never`,`always`]).default(`never`).optional(),factors:e.z.object({sms:e.z.boolean().default(!1),otp:e.z.boolean().default(!1),email:e.z.boolean().default(!1),push_notification:e.z.boolean().default(!1),webauthn_roaming:e.z.boolean().default(!1),webauthn_platform:e.z.boolean().default(!1),recovery_code:e.z.boolean().default(!1),duo:e.z.boolean().default(!1)}).optional(),sms_provider:e.z.object({provider:e.z.enum([`twilio`,`vonage`,`aws_sns`,`phone_message_hook`]).optional()}).optional(),twilio:e.z.object({sid:e.z.string().optional(),auth_token:e.z.string().optional(),from:e.z.string().optional(),messaging_service_sid:e.z.string().optional()}).optional(),phone_message:e.z.object({message:e.z.string().optional()}).optional()}).optional()});e.z.object({created_at:e.z.string().nullable().transform(e=>e??``),updated_at:e.z.string().nullable().transform(e=>e??``)}).extend(ca.shape).extend({id:e.z.string(),is_control_plane:e.z.boolean().optional()});var la=e.z.enum([`provision`,`seed`,`upgrade`,`backup`,`deprovision`,`users_import`]),ua=e.z.enum([`pending`,`running`,`succeeded`,`failed`,`cancelled`]),da=e.z.string().max(64);e.z.object({tenant_id:e.z.string().max(255).nullable().default(null),rollout_id:e.z.string().max(255).nullable().optional(),kind:la,engine:da,engine_instance_id:e.z.string().max(100).nullable().optional(),target_worker_version:e.z.string().max(255).nullable().optional(),target_database_version:e.z.string().max(255).nullable().optional(),initiated_by:e.z.string().max(255).nullable().optional(),input:e.z.record(e.z.string(),e.z.unknown()).nullable().optional()}).extend({id:e.z.string(),status:ua,current_step:e.z.string().max(255).nullable().optional(),error:e.z.string().nullable().optional(),result:e.z.record(e.z.string(),e.z.unknown()).nullable().optional(),claimed_by:e.z.string().max(255).nullable().optional(),claim_expires_at:e.z.string().nullable().optional(),created_at:e.z.string(),updated_at:e.z.string(),finished_at:e.z.string().nullable().optional()}).pick({status:!0,current_step:!0,engine_instance_id:!0,target_worker_version:!0,target_database_version:!0,error:!0,result:!0,claimed_by:!0,claim_expires_at:!0,finished_at:!0}).partial();var fa=e.z.enum([`started`,`succeeded`,`failed`,`retried`,`skipped`,`reconciled`]);e.z.object({operation_id:e.z.string().max(255),step:e.z.string().max(255),outcome:fa,detail:e.z.record(e.z.string(),e.z.unknown()).nullable().optional(),attempt:e.z.number().int().min(1).default(1)}).extend({id:e.z.string(),created_at:e.z.string()});var pa=e.z.enum([`pending`,`inserted`,`updated`,`failed`,`skipped`]);e.z.object({operation_id:e.z.string().max(255),seq:e.z.number().int().min(0),payload:e.z.record(e.z.string(),e.z.unknown()),status:pa.default(`pending`),error_code:e.z.string().max(64).nullable().optional(),error_message:e.z.string().nullable().optional(),error_path:e.z.string().max(255).nullable().optional(),entity_id:e.z.string().max(255).nullable().optional()}).extend({status:pa,created_at:e.z.string(),updated_at:e.z.string()}),e.z.object({seq:e.z.number().int().min(0),status:pa,error_code:e.z.string().max(64).nullable().optional(),error_message:e.z.string().nullable().optional(),error_path:e.z.string().max(255).nullable().optional(),entity_id:e.z.string().max(255).nullable().optional()});var ma=e.z.enum([`upgrade`,`reseed`,`backup`]),ha=e.z.enum([`pending`,`canary`,`rolling`,`paused`,`done`,`failed`]);e.z.object({kind:ma,target_worker_version:e.z.string().max(255).nullable().optional(),target_database_version:e.z.string().max(255).nullable().optional(),wave_size:e.z.number().int().min(1).default(10),canary_tenant_ids:e.z.array(e.z.string()).nullable().optional(),filter:e.z.record(e.z.string(),e.z.unknown()).nullable().optional(),initiated_by:e.z.string().max(255).nullable().optional()}).extend({id:e.z.string(),status:ha,created_at:e.z.string(),updated_at:e.z.string(),finished_at:e.z.string().nullable().optional()}).pick({status:!0,wave_size:!0,canary_tenant_ids:!0,filter:!0,finished_at:!0}).partial(),e.z.object({access_token:e.z.string(),id_token:e.z.string().optional(),scope:e.z.string().optional(),state:e.z.string().optional(),refresh_token:e.z.string().optional(),token_type:e.z.string(),expires_in:e.z.number()}),e.z.object({code:e.z.string(),state:e.z.string().optional()});var ga=e.z.object({button_border_radius:e.z.number(),button_border_weight:e.z.number(),buttons_style:e.z.enum([`pill`,`rounded`,`sharp`]),input_border_radius:e.z.number(),input_border_weight:e.z.number(),inputs_style:e.z.enum([`pill`,`rounded`,`sharp`]),show_widget_shadow:e.z.boolean(),widget_border_weight:e.z.number(),widget_corner_radius:e.z.number()}),_a=e.z.object({base_focus_color:e.z.string(),base_hover_color:e.z.string(),body_text:e.z.string(),captcha_widget_theme:e.z.enum([`auto`,`dark`,`light`]),error:e.z.string(),header:e.z.string(),icons:e.z.string(),input_background:e.z.string(),input_border:e.z.string(),input_filled_text:e.z.string(),input_labels_placeholders:e.z.string(),links_focused_components:e.z.string(),primary_button:e.z.string(),primary_button_label:e.z.string(),secondary_button_border:e.z.string(),secondary_button_label:e.z.string(),success:e.z.string(),widget_background:e.z.string(),widget_border:e.z.string()}),$=e.z.object({bold:e.z.boolean(),size:e.z.number()}),va=e.z.object({body_text:$,buttons_text:$,font_url:e.z.string(),input_labels:$,links:$,links_style:e.z.enum([`normal`,`underlined`]),reference_text_size:e.z.number(),subtitle:$,title:$}),ya=e.z.object({background_color:e.z.string(),background_image_url:e.z.string(),page_layout:e.z.enum([`center`,`left`,`right`]),logo_placement:e.z.enum([`widget`,`chip`,`none`]).optional()}),ba=e.z.object({header_text_alignment:e.z.enum([`center`,`left`,`right`]),logo_height:e.z.number(),logo_position:e.z.enum([`center`,`left`,`none`,`right`]),logo_url:e.z.string(),social_buttons_layout:e.z.enum([`bottom`,`top`])});e.z.object({borders:ga,colors:_a,displayName:e.z.string(),fonts:va,page_background:ya,widget:ba}).extend({themeId:e.z.string()}),e.z.object({universal_login_experience:e.z.enum([`new`,`classic`]).default(`new`),identifier_first:e.z.boolean().default(!0),password_first:e.z.boolean().default(!1),show_last_used_connection:e.z.boolean().default(!1),webauthn_platform_first_factor:e.z.boolean()});var xa=e.z.object({hosts:e.z.array(e.z.string()).optional(),methods:e.z.array(e.z.string()).optional(),path:e.z.string().default(`/*`),headers:e.z.record(e.z.string(),e.z.string()).optional(),query:e.z.record(e.z.string(),e.z.string()).optional()}),Sa=e.z.object({type:e.z.string(),options:e.z.record(e.z.string(),e.z.unknown()).default({})}),Ca=e.z.object({id:e.z.string().optional(),custom_domain_id:e.z.string(),priority:e.z.number().int().default(100),match:xa,handlers:e.z.array(Sa).min(1)});Ca.extend({id:e.z.string(),tenant_id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()}),Ca.partial().omit({id:!0,custom_domain_id:!0});var wa=`custom_authentication`,Ta=[`urn:ietf:params:oauth:`,`urn:auth0`,`urn:okta`,`http://auth0.com`,`https://auth0.com`,`http://okta.com`,`https://okta.com`],Ea=e.z.string().min(1).max(200).refine(e=>e.startsWith(`https://`)||e.startsWith(`urn:`),{message:`subject_token_type must be a URI starting with https:// or urn:`}).refine(e=>!Ta.some(t=>e.toLowerCase().startsWith(t)),{message:`subject_token_type uses a reserved namespace`}),Da=e.z.enum([`RS256`,`RS384`,`RS512`,`ES256`,`ES384`,`ES512`]),Oa=e.z.discriminatedUnion(`type`,[e.z.object({type:e.z.literal(`connection`),connection:e.z.string().min(1),create_if_not_exists:e.z.boolean().default(!0),trust_email_verified:e.z.boolean().default(!1)}),e.z.object({type:e.z.literal(`user_id`)})]),ka=e.z.object({issuer:e.z.string().min(1).max(2048),jwks:Ui.optional(),jwks_uri:e.z.string().url().optional(),audience:e.z.array(e.z.string().min(1)).min(1).optional(),algorithms:e.z.array(Da).min(1).optional(),max_lifetime_seconds:e.z.number().int().min(1).max(3600).default(300),require_jti:e.z.boolean().default(!0),user_mapping:Oa});e.z.object({name:e.z.string().min(1).max(255),subject_token_type:Ea,action_id:e.z.string().min(1).optional(),type:e.z.literal(wa),jwt_verification:ka.optional()}).extend({id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()}),e.z.object({name:e.z.string().min(1).max(255).optional(),subject_token_type:Ea.optional(),jwt_verification:ka.optional()});var Aa=e.z.object({scim:e.z.string(),auth0:e.z.string()}),ja=e.z.object({connection_id:e.z.string(),user_id_attribute:e.z.string().default(`externalId`),mapping:e.z.array(Aa).default([])});e.z.object({created_at:e.z.string(),updated_at:e.z.string()}).extend(ja.shape);var Ma=e.z.object({token_id:e.z.string(),connection_id:e.z.string(),token_hash:e.z.string(),scopes:e.z.array(e.z.string()).default([]),valid_until:e.z.string().optional()});e.z.object({created_at:e.z.string(),last_used_at:e.z.string().optional()}).extend(Ma.shape);var Na=e.z.object({connection_id:e.z.string(),external_id:e.z.string(),user_id:e.z.string()});e.z.object({created_at:e.z.string()}).extend(Na.shape),e.z.object({name:e.z.string(),enabled:e.z.boolean().optional().default(!0),default_from_address:e.z.string().optional(),credentials:e.z.record(e.z.string(),e.z.unknown()),settings:e.z.object({}).optional()});var Pa=e.z.enum([`verify_email`,`verify_email_by_code`,`reset_email`,`reset_email_by_code`,`welcome_email`,`blocked_account`,`stolen_credentials`,`enrollment_email`,`mfa_oob_code`,`change_password`,`password_reset`,`user_invitation`]);e.z.object({template:Pa,body:e.z.string(),from:e.z.string(),subject:e.z.string(),syntax:e.z.literal(`liquid`).default(`liquid`),resultUrl:e.z.string().optional(),urlLifetimeInSeconds:e.z.number().int().nonnegative().optional(),includeEmailInRedirect:e.z.boolean().default(!1),enabled:e.z.boolean().default(!0)}),e.z.object({id:e.z.string(),login_id:e.z.string(),session_id:e.z.string().optional(),organization:e.z.string().optional(),auth_connection:e.z.string().optional(),auth_strategy:Ki.optional(),user_id:e.z.string(),client_id:e.z.string(),expires_at:e.z.string().optional(),idle_expires_at:e.z.string().optional(),last_exchanged_at:e.z.string().optional(),device:oa,resource_servers:e.z.array(e.z.object({audience:e.z.string(),scopes:e.z.string()})),rotating:e.z.boolean(),token_lookup:e.z.string().optional(),token_hash:e.z.string().optional(),family_id:e.z.string().optional(),rotated_to:e.z.string().optional(),rotated_at:e.z.string().optional()}).extend({created_at:e.z.string(),revoked_at:e.z.string().optional()}),e.z.object({to:e.z.string(),message:e.z.string()}),e.z.object({name:e.z.string(),options:e.z.object({})});var Fa=e.z.object({value:e.z.string(),description:e.z.string().optional()}),Ia=e.z.object({token_dialect:e.z.enum([`access_token`,`access_token_authz`]).optional(),enforce_policies:e.z.boolean().optional(),allow_skipping_userinfo:e.z.boolean().optional(),skip_userinfo:e.z.boolean().optional(),persist_client_authorization:e.z.boolean().optional(),enable_introspection_endpoint:e.z.boolean().optional(),mtls:e.z.object({bound_access_tokens:e.z.boolean().optional()}).optional()}),La=e.z.object({id:e.z.string().optional(),name:e.z.string(),identifier:e.z.string(),scopes:e.z.array(Fa).optional(),signing_alg:e.z.string().optional(),signing_secret:e.z.string().optional(),token_lifetime:e.z.number().default(86400),token_lifetime_for_web:e.z.number().default(7200),skip_consent_for_verifiable_first_party_clients:e.z.boolean().optional(),allow_offline_access:e.z.boolean().optional(),verificationKey:e.z.string().optional(),options:Ia.optional(),is_system:e.z.boolean().optional(),metadata:e.z.record(e.z.string(),e.z.any()).optional()}).extend({created_at:e.z.string().optional(),updated_at:e.z.string().optional()});e.z.array(La);var Ra=e.z.object({role_id:e.z.string(),resource_server_identifier:e.z.string(),permission_name:e.z.string()}).extend({created_at:e.z.string()});e.z.array(Ra),e.z.object({user_id:e.z.string().openapi({description:`The id of the user that granted the consent`}),clientID:e.z.string().openapi({description:`The id of the client the grant was issued to`}),audience:e.z.string().optional().openapi({description:`The audience the grant applies to`}),scope:e.z.array(e.z.string()).default([]).openapi({description:`The list of OAuth scopes the user has consented to`})}).extend({id:e.z.string()}),e.z.object({user_id:e.z.string(),last_login:e.z.string().optional(),last_ip:e.z.string().optional(),login_count:e.z.number().default(0),failed_logins:e.z.array(e.z.string()).optional(),last_password_reset:e.z.string().optional()});var za=e.z.object({user_id:e.z.string(),resource_server_identifier:e.z.string(),permission_name:e.z.string(),organization_id:e.z.string().optional()}).extend({tenant_id:e.z.string(),created_at:e.z.string().optional()});e.z.array(za);var Ba=e.z.object({user_id:e.z.string(),resource_server_identifier:e.z.string(),resource_server_name:e.z.string(),permission_name:e.z.string(),description:e.z.string().nullable().optional(),created_at:e.z.string().optional(),organization_id:e.z.string().optional()});e.z.array(Ba);var Va=e.z.object({user_id:e.z.string(),role_id:e.z.string(),organization_id:e.z.string().optional()}).extend({tenant_id:e.z.string(),created_at:e.z.string().optional()});e.z.array(Va);var Ha=e.z.object({id:e.z.string().optional().openapi({description:`The unique identifier of the role. If not provided, one will be generated.`}),name:e.z.string().min(1).max(50).openapi({description:`The name of the role. Cannot include '<' or '>'`}),description:e.z.string().max(255).optional().openapi({description:`The description of the role`}),is_system:e.z.boolean().optional(),metadata:e.z.record(e.z.string(),e.z.any()).optional().openapi({description:`Metadata associated with the role. Can be used to control sync behavior in multi-tenancy scenarios.`})}).extend({id:e.z.string().openapi({description:`The unique identifier of the role`}),created_at:e.z.string().optional(),updated_at:e.z.string().optional()});e.z.array(Ha);var Ua=e.z.object({logo_url:e.z.string().optional().openapi({description:`URL of the organization's logo`}),colors:e.z.object({primary:e.z.string().optional().openapi({description:`Primary color in hex format (e.g., #FF0000)`}),page_background:e.z.string().optional().openapi({description:`Page background color in hex format (e.g., #FFFFFF)`})}).optional()}).optional(),Wa=e.z.object({connection_id:e.z.string().openapi({description:`ID of the connection`}),assign_membership_on_login:e.z.boolean().default(!1).openapi({description:`Whether to assign membership to the organization on login`}),show_as_button:e.z.boolean().default(!0).openapi({description:`Whether to show this connection as a button in the login screen`}),is_signup_enabled:e.z.boolean().default(!0).openapi({description:`Whether signup is enabled for this connection`})}),Ga=e.z.object({client_credentials:e.z.object({enforce:e.z.boolean().default(!1).openapi({description:`Whether to enforce token quota limits`}),per_day:e.z.number().min(0).default(0).openapi({description:`Maximum tokens per day (0 = unlimited)`}),per_hour:e.z.number().min(0).default(0).openapi({description:`Maximum tokens per hour (0 = unlimited)`})}).optional()}).optional();e.z.object({id:e.z.string().optional(),name:e.z.string().min(1).regex(/^[a-z0-9_-]+$/,{message:`Organization name must be lowercase and can only contain letters, numbers, hyphens, and underscores`}).openapi({description:`The name of the organization. Must be lowercase and can only contain letters, numbers, hyphens, and underscores.`}),display_name:e.z.string().optional().openapi({description:`The display name of the organization`}),branding:Ua,metadata:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Custom metadata for the organization`}),enabled_connections:e.z.array(Wa).default([]).optional().openapi({description:`List of enabled connections for the organization`}),token_quota:Ga}).extend(G.shape).extend({id:e.z.string(),name:e.z.string().min(1).openapi({description:`The name of the organization`})});var Ka=e.z.object({connection_id:e.z.string().openapi({description:`ID of the tenant-level connection to enable for the org.`}),assign_membership_on_login:e.z.boolean().optional().default(!1),show_as_button:e.z.boolean().optional().default(!0),is_signup_enabled:e.z.boolean().optional().default(!0)}).extend({connection:e.z.object({name:e.z.string().optional(),strategy:e.z.string().optional()}).optional(),created_at:e.z.string().optional(),updated_at:e.z.string().optional()});e.z.array(Ka),e.z.object({user_id:e.z.string().openapi({description:`ID of the user`}),organization_id:e.z.string().openapi({description:`ID of the organization`})}).extend(G.shape).extend({id:e.z.string()}),e.z.object({idle_session_lifetime:e.z.number().default(72),session_lifetime:e.z.number().default(168),session_cookie:e.z.object({mode:e.z.enum([`persistent`,`non-persistent`]).optional()}).optional(),enable_client_connections:e.z.boolean().optional(),default_redirection_uri:e.z.string().optional(),enabled_locales:e.z.array(e.z.string()).optional(),default_directory:e.z.string().optional(),error_page:e.z.object({html:e.z.string().optional(),show_log_link:e.z.boolean().optional(),url:e.z.string().optional()}).optional(),flags:e.z.object({allow_legacy_delegation_grant_types:e.z.boolean().optional(),allow_legacy_ro_grant_types:e.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:e.z.boolean().optional(),disable_clickjack_protection_headers:e.z.boolean().optional(),enable_apis_section:e.z.boolean().optional(),enable_client_connections:e.z.boolean().optional(),enable_custom_domain_in_emails:e.z.boolean().optional(),enable_dynamic_client_registration:e.z.boolean().optional(),enable_idtoken_api2:e.z.boolean().optional(),enable_legacy_logs_search_v2:e.z.boolean().optional(),enable_legacy_profile:e.z.boolean().optional(),enable_pipeline2:e.z.boolean().optional(),enable_public_signup_user_exists_error:e.z.boolean().optional(),use_scope_descriptions_for_consent:e.z.boolean().optional(),disable_management_api_sms_obfuscation:e.z.boolean().optional(),enable_adfs_waad_email_verification:e.z.boolean().optional(),revoke_refresh_token_grant:e.z.boolean().optional(),dashboard_log_streams_next:e.z.boolean().optional(),dashboard_insights_view:e.z.boolean().optional(),disable_fields_map_fix:e.z.boolean().optional(),mfa_show_factor_list_on_enrollment:e.z.boolean().optional()}).optional(),friendly_name:e.z.string().optional(),picture_url:e.z.string().optional(),support_email:e.z.string().optional(),support_url:e.z.string().optional(),sandbox_version:e.z.string().optional(),sandbox_versions_available:e.z.array(e.z.string()).optional(),change_password:e.z.object({enabled:e.z.boolean(),html:e.z.string()}).optional(),guardian_mfa_page:e.z.object({enabled:e.z.boolean(),html:e.z.string()}).optional(),default_audience:e.z.string().optional(),default_organization:e.z.string().optional(),sessions:e.z.object({oidc_logout_prompt_enabled:e.z.boolean().optional()}).optional(),mfa:e.z.object({policy:e.z.enum([`never`,`always`]).default(`never`).optional(),factors:e.z.object({sms:e.z.boolean().default(!1),otp:e.z.boolean().default(!1),email:e.z.boolean().default(!1),push_notification:e.z.boolean().default(!1),webauthn_roaming:e.z.boolean().default(!1),webauthn_platform:e.z.boolean().default(!1),recovery_code:e.z.boolean().default(!1),duo:e.z.boolean().default(!1)}).optional(),sms_provider:e.z.object({provider:e.z.enum([`twilio`,`vonage`,`aws_sns`,`phone_message_hook`]).optional()}).optional(),twilio:e.z.object({sid:e.z.string().optional(),auth_token:e.z.string().optional(),from:e.z.string().optional(),messaging_service_sid:e.z.string().optional()}).optional(),phone_message:e.z.object({message:e.z.string().optional()}).optional()}).optional()}),e.z.object({date:e.z.string().openapi({description:`Date these events occurred in ISO 8601 format`,example:`2025-12-19`}),logins:e.z.number().openapi({description:`Number of logins on this date`,example:150}),signups:e.z.number().openapi({description:`Number of signups on this date`,example:25}),leaked_passwords:e.z.number().openapi({description:`Number of breached-password detections on this date (subscription required)`,example:0}),updated_at:e.z.string().openapi({description:`Date and time this stats entry was last updated in ISO 8601 format`,example:`2025-12-19T10:30:00.000Z`}),created_at:e.z.string().openapi({description:`Approximate date and time the first event occurred in ISO 8601 format`,example:`2025-12-19T00:00:00.000Z`})}),e.z.number().openapi({description:`Number of active users in the last 30 days`,example:1234}),e.z.enum([`active-users`,`logins`,`signups`,`refresh-tokens`,`sessions`,`logouts`,`password-changes`,`password-migrations`,`mfa`,`email-verifications`,`codes-sent`]),e.z.enum([`hour`,`day`,`week`,`month`]),e.z.enum([`time`,`connection`,`client_id`,`user_type`,`event`]),e.z.enum([`password`,`social`,`passwordless`,`enterprise`]);var qa=e.z.object({cohort:e.z.string(),sessions:e.z.number(),active:e.z.array(e.z.number())});e.z.object({interval:e.z.literal(`week`),from:e.z.string(),to:e.z.string(),cohorts:e.z.array(qa)});var Ja=e.z.object({cohort:e.z.string(),tokens:e.z.number(),active:e.z.array(e.z.number())});e.z.object({interval:e.z.literal(`week`),from:e.z.string(),to:e.z.string(),cohorts:e.z.array(Ja)});var Ya=e.z.object({name:e.z.string(),type:e.z.string()}),Xa=e.z.object({elapsed:e.z.number(),rows_read:e.z.number().optional(),bytes_read:e.z.number().optional()});e.z.object({meta:e.z.array(Ya),data:e.z.array(e.z.record(e.z.string(),e.z.any())),rows:e.z.number(),rows_before_limit_at_least:e.z.number().optional(),statistics:Xa.optional()});var Za=e.z.enum(`login.login-id.login-password.signup.signup-id.signup-password.reset-password.consent.mfa.mfa-push.mfa-otp.mfa-voice.mfa-phone.mfa-webauthn.mfa-email.mfa-recovery-code.status.device-flow.email-verification.email-otp-challenge.organizations.invitation.common.passkeys.captcha.custom-form.login-passwordless.mfa-login-options`.split(`.`)),Qa=e.z.record(e.z.string(),e.z.record(e.z.string(),e.z.string())).openapi({type:`object`,additionalProperties:{type:`object`,additionalProperties:{type:`string`}}});e.z.object({prompt:Za,language:e.z.string(),custom_text:Qa});var $a=e.z.enum([`phone`,`totp`,`email`,`push`,`webauthn-roaming`,`webauthn-platform`,`passkey`]),eo=e.z.object({user_id:e.z.string(),type:$a,phone_number:e.z.string().optional(),totp_secret:e.z.string().optional(),credential_id:e.z.string().optional(),public_key:e.z.string().optional(),sign_count:e.z.number().int().nonnegative().optional(),credential_backed_up:e.z.boolean().optional(),transports:e.z.array(e.z.string()).optional(),friendly_name:e.z.string().optional(),confirmed:e.z.boolean().default(!1)});function to(t,n){t.type===`phone`&&!t.phone_number&&n.addIssue({code:e.z.ZodIssueCode.custom,message:`phone_number is required when type is 'phone'`,path:[`phone_number`]}),t.type===`totp`&&!t.totp_secret&&n.addIssue({code:e.z.ZodIssueCode.custom,message:`totp_secret is required when type is 'totp'`,path:[`totp_secret`]}),[`webauthn-roaming`,`webauthn-platform`,`passkey`].includes(t.type)&&(t.credential_id||n.addIssue({code:e.z.ZodIssueCode.custom,message:`credential_id is required when type is '${t.type}'`,path:[`credential_id`]}),t.public_key||n.addIssue({code:e.z.ZodIssueCode.custom,message:`public_key is required when type is '${t.type}'`,path:[`public_key`]}))}eo.superRefine(to),eo.extend({id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()}).superRefine(to),e.z.object({id:e.z.string().optional(),created_at:e.z.string().datetime({offset:!0}).optional(),updated_at:e.z.string().datetime({offset:!0}).optional()});function no(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var ro=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,io=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=ro[n[e]&63];return t};async function ao(e){let t=new DecompressionStream(`deflate-raw`),n=new Uint8Array(e),r=new Blob([n]).stream().pipeThrough(t);return new Uint8Array(await new Response(r).arrayBuffer())}async function oo(e){let t=no(e.replace(/ /g,`+`));try{let e=await ao(t);return new TextDecoder().decode(e)}catch(e){return console.warn(`Decompression failed, assuming data is not compressed:`,e),new TextDecoder().decode(t)}}async function so(e){let t=await oo(e),n=new tn({attributeNamePrefix:`@_`,alwaysCreateTextNode:!0,ignoreAttributes:!1}).parse(t);return r.parse(n)}function co(e){let t=e.certificates.map(e=>({"@_use":`signing`,KeyInfo:{"@_xmlns":`http://www.w3.org/2000/09/xmldsig#`,X509Data:{X509Certificate:e}}})),n={EntityDescriptor:{"@_entityID":e.entityId,"@_xmlns":`urn:oasis:names:tc:SAML:2.0:metadata`,IDPSSODescriptor:{"@_protocolSupportEnumeration":`urn:oasis:names:tc:SAML:2.0:protocol`,KeyDescriptor:t,SingleLogoutService:[{"@_Binding":`urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect`,"@_Location":e.singleLogoutServiceUrl},{"@_Binding":`urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST`,"@_Location":e.singleLogoutServiceUrl}],NameIDFormat:[`urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress`,`urn:oasis:names:tc:SAML:2.0:nameid-format:persistent`,`urn:oasis:names:tc:SAML:2.0:nameid-format:transient`],SingleSignOnService:[{"@_Binding":`urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect`,"@_Location":e.assertionConsumerServiceUrl},{"@_Binding":`urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST`,"@_Location":e.assertionConsumerServiceUrl}],Attribute:[{"@_Name":`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:uri`,"@_FriendlyName":`E-Mail Address`,"@_xmlns":`urn:oasis:names:tc:SAML:2.0:assertion`},{"@_Name":`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:uri`,"@_FriendlyName":`Given Name`,"@_xmlns":`urn:oasis:names:tc:SAML:2.0:assertion`},{"@_Name":`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:uri`,"@_FriendlyName":`Name`,"@_xmlns":`urn:oasis:names:tc:SAML:2.0:assertion`},{"@_Name":`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:uri`,"@_FriendlyName":`Surname`,"@_xmlns":`urn:oasis:names:tc:SAML:2.0:assertion`},{"@_Name":`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:uri`,"@_FriendlyName":`Name ID`,"@_xmlns":`urn:oasis:names:tc:SAML:2.0:assertion`}]}}};return new Cn({ignoreAttributes:!1,suppressEmptyNode:!0,preserveOrder:!1,format:!0,attributeNamePrefix:`@_`}).build(n)}async function lo(e,t){let n=e.notBefore||new Date().toISOString(),r=e.notAfter||new Date(new Date(n).getTime()+600*1e3).toISOString(),i=e.issueInstant||n,a=e.sessionNotOnOrAfter||r,o=e.responseId||`_${io()}`,s=e.assertionId||`_${io()}`,c=[{"samlp:Response":[{"saml:Issuer":[{"#text":e.issuer}]},{"samlp:Status":[{"samlp:StatusCode":[],":@":{"@_Value":`urn:oasis:names:tc:SAML:2.0:status:Success`}}]},{"saml:Assertion":[{"saml:Issuer":[{"#text":e.issuer}]},{"saml:Subject":[{"saml:NameID":[{"#text":e.email}],":@":{"@_Format":`urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress`}},{"saml:SubjectConfirmation":[{"saml:SubjectConfirmationData":[],":@":{"@_InResponseTo":e.inResponseTo,"@_NotOnOrAfter":r,"@_Recipient":e.destination}}],":@":{"@_Method":`urn:oasis:names:tc:SAML:2.0:cm:bearer`}}]},{"saml:Conditions":[{"saml:AudienceRestriction":[{"saml:Audience":[{"#text":e.audience}]}]}],":@":{"@_NotBefore":n,"@_NotOnOrAfter":r}},{"saml:AuthnStatement":[{"saml:AuthnContext":[{"saml:AuthnContextClassRef":[{"#text":`urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified`}]}]}],":@":{"@_AuthnInstant":i,"@_SessionIndex":e.sessionIndex,"@_SessionNotOnOrAfter":a}},{"saml:AttributeStatement":[{"saml:Attribute":[{"saml:AttributeValue":[{"#text":e.userId}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_FriendlyName":`persistent`,"@_Name":`id`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":e.email}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`email`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":`manage-account`}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`Role`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":`default-roles-master`}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`Role`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":`offline_access`}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`Role`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":`view-profile`}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`Role`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":`uma_authorization`}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`Role`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":`manage-account-links`}],":@":{"@_xmlns:xs":`http://www.w3.org/2001/XMLSchema`,"@_xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"@_xsi:type":`xs:string`}}],":@":{"@_Name":`Role`,"@_NameFormat":`urn:oasis:names:tc:SAML:2.0:attrname-format:basic`}}]}],":@":{"@_xmlns":`urn:oasis:names:tc:SAML:2.0:assertion`,"@_ID":s,"@_IssueInstant":i,"@_Version":`2.0`}}],":@":{"@_xmlns:samlp":`urn:oasis:names:tc:SAML:2.0:protocol`,"@_xmlns:saml":`urn:oasis:names:tc:SAML:2.0:assertion`,"@_Destination":e.destination,"@_ID":o,"@_InResponseTo":e.inResponseTo,"@_IssueInstant":i,"@_Version":`2.0`}}],l=new Cn({ignoreAttributes:!1,suppressEmptyNode:!0,preserveOrder:!0}).build(c);return e.signature&&t&&(l=await t.signSAML(l,e.signature.privateKeyPem,e.signature.cert)),e.encode===!1?l:btoa(l)}var uo=class{signUrl;constructor(e){this.signUrl=e}async signSAML(e,t,n){let r=await fetch(this.signUrl,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({xmlContent:e,privateKey:t,publicCert:n})});if(!r.ok)throw Error(`Failed to sign SAML via HTTP: ${r.status} ${r.statusText}`);return await r.text()}};exports.HttpSamlSigner=uo,exports.createSamlMetadata=co,exports.createSamlResponse=lo,exports.dsSignatureSchema=s,exports.inflateDecompress=oo,exports.inflateRaw=ao,exports.parseSamlRequestQuery=so,exports.samlIssuerSchema=n,exports.samlMetadataResponseSchema=i,exports.samlRequestSchema=r,exports.samlResponseJsonSchema=c;