@authhero/saml 0.6.6 → 0.6.7

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/saml.cjs CHANGED
@@ -4,4 +4,4 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
4
4
  `);let t=new D(`!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=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=Xt(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=qt(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 D(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=qt(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}=Xt(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=Pt(l),c!==t.tagname&&this.matcher.push(c,{},g),c!==u&&d&&(h=this.buildAttributesMap(u,this.matcher,c),h&&Nt(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 D(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}=Xt(i.transformTagName,c,u,i));let e=new D(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 D(c);h&&(e[`:@`]=h),this.addChild(n,e,this.readonlyMatcher,_),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=a.closeIndex;continue}else{let e=new D(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 Vt(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 Ht(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 Ut(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 Wt(){return this.stopNodeExpressionsSet.size===0?!1:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function Gt(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 Kt(e,t,n,r){let i=e.indexOf(t,n);if(i===-1)throw Error(r);return i}function qt(e,t,n,r=`>`){let i=Gt(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 Jt(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=Kt(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=qt(e,n,!1);r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!==`/`&&i++,n=r.closeIndex)}}}function Yt(e,t,n){if(t&&typeof e==`string`){let t=e.trim();return t===`true`?!0:t===`false`?!1:ft(e,n)}else if(p(e))return e;else return``}function Xt(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(h.includes(e))throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return m.includes(e)?t.onDangerousProperty(e):e}var Qt=D.getMetaDataSymbol();function $t(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 en(e,t,n,r){return tn(e,t,n,r)}function tn(e,t,n,r){let i,a={};for(let o=0;o<e.length;o++){let s=e[o],c=nn(s);if(c!==void 0&&c!==t.textNodeName){let e=$t(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=tn(s[c],t,n,r),i=an(e,t);if(Object.keys(e).length===0&&t.alwaysCreateTextNode&&(e[t.textNodeName]=``),s[`:@`]?rn(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[Qt]!==void 0&&typeof e==`object`&&e&&(e[Qt]=s[Qt]),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 nn(e){let t=Object.keys(e);for(let e=0;e<t.length;e++){let n=t[e];if(n!==`:@`)return n}}function rn(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 an(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 on=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=_(e,t);if(n!==!0)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}let n=new Ft(this.options,this.externalEntities),r=n.parseXml(e);return this.options.preserveOrder||r===void 0?r:en(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 D.getMetaDataSymbol()}};function sn(e){return String(e).replace(/--/g,`- -`).replace(/--/g,`- -`).replace(/-$/,`- `)}function cn(e){return String(e).replace(/\]\]>/g,`]]]]><![CDATA[>`)}function z(e){return String(e).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`)}var ln=`
5
5
  `;function un(e,t){if(!Array.isArray(e)||e.length===0)return`1.0`;let n=e[0];if(_n(n)===`?xml`){let e=n[`:@`];if(e){let n=t.attributeNamePrefix+`version`;if(e[n])return e[n]}}return`1.0`}function dn(e,t,n,r,i){return!n.sanitizeName||i(e)?e:n.sanitizeName(e,{isAttribute:t,matcher:r.readOnly()})}function fn(e,t){let n=``;t.format&&(n=ln);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 N(n)):n instanceof N&&r.push(n)}let i=Xe(`qName`,{xmlVersion:un(e,t)}),a=new P;return pn(e,t,n,a,r,i)}function pn(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=B(n,t),n}return``}for(let c=0;c<e.length;c++){let l=e[c],u=_n(l);if(u===void 0)continue;let d=u===t.textNodeName||u===t.cdataPropName||u===t.commentPropName||u[0]===`?`?u:dn(u,!1,t,r,a),f=mn(l[`:@`],t);r.push(d,f);let p=yn(r,i);if(d===t.textNodeName){let e=l[u];p||(e=t.tagValueProcessor(d,e),e=B(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=cn(e);o+=`<![CDATA[${i}]]>`,s=!1,r.pop();continue}else if(d===t.commentPropName){let e=l[u][0][t.textNodeName],i=sn(e);o+=n+`<!--${i}-->`,s=!0,r.pop();continue}else if(d[0]===`?`){let e=vn(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}${vn(l[`:@`],t,p,r,a)}`,g;g=p?hn(l[u],t):pn(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 mn(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]=z(e[i]),r=!0}return r?n:null}function hn(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=_n(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=gn(i[`:@`],t),r=hn(i[a],t);!r||r.length===0?n+=`<${a}${e}/>`:n+=`<${a}${e}>${r}</${a}>`}}return n}function gn(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)}="${z(i)}"`}return n}function _n(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 vn(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:dn(s,!0,t,r,i),l;n?l=e[o]:(l=t.attributeValueProcessor(o,e[o]),l=B(l,t)),l===!0&&t.suppressBooleanAttributes?a+=` ${c}`:a+=` ${c}="${z(l)}"`}return a}function yn(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 B(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 bn(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 xn={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 V(e){if(this.options=Object.assign({},xn,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 N(t)):t instanceof N&&this.stopNodeExpressions.push(t)}this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=bn(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Tn),this.processTextOrObjNode=Cn,this.options.format?(this.indentate=wn,this.tagEndChar=`>
6
6
  `,this.newLine=`
7
- `):(this.indentate=function(){return``},this.tagEndChar=`>`,this.newLine=``)}function Sn(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 H(e,t,n,r,i){return!n.sanitizeName||i(e)?e:n.sanitizeName(e,{isAttribute:t,matcher:r.readOnly()})}V.prototype.build=function(e){if(this.options.preserveOrder)return fn(e,this.options);{Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e});let t=new P,n=Xe(`qName`,{xmlVersion:Sn(e,this.options)});return this.j2x(e,0,t,n).val}},V.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:H(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=H(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=H(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}},V.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+`="`+z(t)+`"`};function Cn(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)}V.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]=z(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]=z(e[r]),n=!0)}return n?t:null},V.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},V.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+`="`+z(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+`="`+z(i)+`"`}}return t},V.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)+`<!--${sn(e)}-->`+this.newLine:this.indentate(r)+`<`+t+n+a+this.tagEndChar+e+this.indentate(r)+i}},V.prototype.closeTag=function(e){let t=``;return this.options.unpairedTags.indexOf(e)===-1?t=this.options.suppressEmptyNode?`/`:`></${e}`:this.options.suppressUnpairedNode||(t=`/`),t},V.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},V.prototype.buildTextValNode=function(e,t,n,r,i){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName){let t=cn(e);return this.indentate(r)+`<![CDATA[${t}]]>`+this.newLine}else if(this.options.commentPropName!==!1&&t===this.options.commentPropName){let t=sn(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}},V.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 wn(e){return this.options.indentBy.repeat(e)}function Tn(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}var En=V,U=e.z.object({created_at:e.z.string(),updated_at:e.z.string()}),Dn=e.z.enum([`local`,`shared`,`platform`]),On=e.z.enum([`none`,`secrets`,`fields`]),W={scope:Dn.optional(),override:On.optional(),enforce:e.z.boolean().optional()},kn=e.z.object({id:e.z.string(),version:e.z.string().optional()}),An=e.z.object({name:e.z.string(),version:e.z.string()}),jn=e.z.object({name:e.z.string(),value:e.z.string().optional()}),Mn=e.z.object({name:e.z.string().max(255),code:e.z.string().max(1e5),supported_triggers:e.z.array(kn).optional(),runtime:e.z.string().max(50).optional(),dependencies:e.z.array(An).optional(),secrets:e.z.array(jn).optional(),is_system:e.z.boolean().optional(),...W,inherit:e.z.boolean().optional()});Mn.partial().extend({status:e.z.enum([`draft`,`built`]).optional(),deployed_at:e.z.string().optional()});var Nn=Mn.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(U.shape),Pn=e.z.object({name:e.z.string()});Nn.extend({secrets:e.z.array(Pn).optional()});var Fn=e.z.string(),In=e.z.enum([`unspecified`,`pending`,`final`,`partial`,`canceled`,`suspended`]),Ln=e.z.object({id:e.z.string(),msg:e.z.string(),url:e.z.string().optional()}),Rn=e.z.object({action_name:e.z.string(),error:Ln.nullable(),started_at:e.z.string(),ended_at:e.z.string()}),zn=e.z.object({level:e.z.enum([`log`,`info`,`warn`,`error`,`debug`]),message:e.z.string()}),Bn=e.z.array(e.z.object({action_name:e.z.string(),lines:e.z.array(zn)}));e.z.object({id:e.z.string(),tenant_id:e.z.string(),trigger_id:Fn,status:In,results:e.z.array(Rn),logs:Bn.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(An).optional(),secrets:e.z.array(jn).optional(),supported_triggers:e.z.array(kn).optional(),deployed:e.z.boolean().default(!0)}).extend({id:e.z.string(),tenant_id:e.z.string(),number:e.z.number().int()}).extend(U.shape);var Vn=e.z.enum([`user_action`,`admin_action`,`system`,`api`]),Hn=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()}),Un=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()}),Wn=e.z.object({user:e.z.object({user_id:e.z.string(),name:e.z.string().optional(),email:e.z.string().optional()}).optional(),strategy:e.z.string(),credentials:e.z.object({jti:e.z.string().optional(),scopes:e.z.array(e.z.string()).optional()}).optional()}),Gn=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(),authorization_url:e.z.string().optional(),auth:Wn.optional()}),Kn=e.z.object({status_code:e.z.number(),body:e.z.unknown().optional()}),qn=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()}),Jn=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:Vn,actor:Hn,target:Un,request:Gn,response:Kn.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:qn.optional(),auth0_client:Jn.optional(),hostname:e.z.string(),is_mobile:e.z.boolean().optional(),execution_id:e.z.string().optional(),details:e.z.record(e.z.string(),e.z.unknown()).optional(),login_session_id:e.z.string().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 Yn=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()}),Xn=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())})}),Zn=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:Yn.optional()})}),Qn=e.z.enum([`change-email`,`account`,`custom`]),$n=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'`})})}),er=e.z.union([Xn,Zn,$n]);e.z.object({name:e.z.string().min(1).max(150).openapi({description:`The name of the flow`}),actions:e.z.array(er).optional().default([]).openapi({description:`The list of actions to execute in sequence`})}).extend(U.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 tr=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()),nr=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:tr.optional()}),rr=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(),ir=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:rr});ir.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(U.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(nr).optional()}).omit({registration_completed_at:!0}),ir.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 ar=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,or=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=ar[n[e]&63];return t},sr=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(()=>or()).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(sr.shape).extend({client_id:e.z.string()});var cr=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.`})}),lr=e.z.object({id:e.z.string().openapi({description:`ID of the client grant.`})}).extend(cr.shape).extend({created_at:e.z.string().optional(),updated_at:e.z.string().optional()});e.z.array(lr);var ur=e.z.enum([`iat`,`rat`]),dr=e.z.object({id:e.z.string(),token_hash:e.z.string(),type:ur,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(dr.shape);var G=e.z.object({x:e.z.number(),y:e.z.number()}),fr=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}({}),pr=function(e){return e.BLOCK=`BLOCK`,e.FIELD=`FIELD`,e}({}),K=e.z.object({id:e.z.string(),category:e.z.nativeEnum(pr),type:e.z.nativeEnum(fr)}),mr=K.extend({category:e.z.literal(`BLOCK`),type:e.z.literal(`RICH_TEXT`),config:e.z.object({content:e.z.string()}).passthrough()}),hr=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()}),gr=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()}),_r=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()}),vr=e.z.object({id:e.z.string(),category:e.z.string(),type:e.z.string()}).passthrough(),yr=e.z.union([mr,hr,gr,_r,vr]),br=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(yr),next_node:e.z.string()}).passthrough()}),xr=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()})}),Sr=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()}),Cr=e.z.object({id:e.z.string(),type:e.z.string(),coordinates:G}).passthrough(),wr=e.z.union([br,xr,Sr,Cr]),Tr=e.z.object({next_node:e.z.string(),coordinates:G}).passthrough(),Er=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(wr),start:Tr,ending:Er,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 Dr=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}({}),Or=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}({}),kr=function(e){return e.S256=`S256`,e.Plain=`plain`,e}({}),Ar=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(),jr=e.z.object({userinfo:e.z.record(e.z.string(),Ar).optional(),id_token:e.z.record(e.z.string(),Ar).optional()}),Mr=e.z.object({client_id:e.z.string(),act_as:e.z.string().optional(),response_type:e.z.nativeEnum(Dr).optional(),response_mode:e.z.nativeEnum(Or).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(kr).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:jr.optional(),vendor_id:e.z.string().optional()});e.z.object({...W,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 Nr=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:Nr,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()}),e.z.object({device_code_hash:e.z.string(),user_code_hash:e.z.string(),client_id:e.z.string(),scope:e.z.string().optional(),audience:e.z.string().optional(),status:e.z.enum([`pending`,`approved`,`denied`,`consumed`]),login_id:e.z.string().optional(),expires_at:e.z.string(),created_at:e.z.string(),last_polled_at:e.z.string().optional(),interval:e.z.number().int().positive(),version:e.z.number().int().nonnegative()});var Pr=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 Fr(e){if(e!==null){if(Array.isArray(e))return e.filter(e=>e!==null).map(Fr);if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))r!==null&&(t[n]=Fr(r));return t}return e}}var Ir=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?{}:Fr(e),Pr).default({}),enabled_clients:e.z.array(e.z.string()).default([]).optional(),response_type:e.z.nativeEnum(Dr).optional(),response_mode:e.z.nativeEnum(Or).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(),...W});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(Ir.shape);var Lr=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()}),Rr=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()})]),zr=Lr.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(Rr)}).optional(),tls_policy:e.z.string().optional()});Lr.pick({tls_policy:!0,custom_client_ip_header:!0,domain_metadata:!0}).strict(),zr.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 Br=e.z.object({id:e.z.string(),order:e.z.number().optional(),visible:e.z.boolean().optional().default(!0)}),q=Br.extend({category:e.z.literal(`BLOCK`).optional()}),Vr=q.extend({type:e.z.literal(`DIVIDER`),config:e.z.object({text:e.z.string().optional()}).optional()}),Hr=q.extend({type:e.z.literal(`HTML`),config:e.z.object({content:e.z.string().optional()}).optional()}),Ur=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()}),Wr=q.extend({type:e.z.literal(`JUMP_BUTTON`),config:e.z.object({text:e.z.string().optional(),target_step:e.z.string().optional()})}),Gr=q.extend({type:e.z.literal(`RESEND_BUTTON`),config:e.z.object({text:e.z.string().optional(),resend_action:e.z.string().optional()})}),Kr=q.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()})}),qr=q.extend({type:e.z.literal(`PREVIOUS_BUTTON`),config:e.z.object({text:e.z.string().optional()})}),Jr=q.extend({type:e.z.literal(`RICH_TEXT`),config:e.z.object({content:e.z.string().optional()}).optional()}),Yr=Br.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()}),Xr=Yr.extend({type:e.z.literal(`AUTH0_VERIFIABLE_CREDENTIALS`),config:e.z.object({credential_type:e.z.string().optional()})}),Zr=Yr.extend({type:e.z.literal(`GMAPS_ADDRESS`),config:e.z.object({api_key:e.z.string().optional()})}),Qr=Yr.extend({type:e.z.literal(`RECAPTCHA`),config:e.z.object({site_key:e.z.string().optional()})}),J=Br.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()}),$r=J.extend({type:e.z.literal(`BOOLEAN`),config:e.z.object({default_value:e.z.boolean().optional()}).optional()}),ei=J.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()}),ti=J.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()}),ni=J.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()}),ri=J.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()})}),ii=J.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()}),ai=J.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()}),oi=J.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()}),si=J.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()}),ci=J.extend({type:e.z.literal(`LEGAL`),config:e.z.object({text:e.z.string(),html:e.z.boolean().optional()}).optional()}),li=J.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()}),ui=J.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()}),di=J.extend({type:e.z.literal(`PAYMENT`),config:e.z.object({provider:e.z.string().optional(),currency:e.z.string().optional()}).optional()}),fi=J.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(),short_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()}),pi=J.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()}),mi=J.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()}),hi=J.extend({type:e.z.literal(`COUNTRY`),config:e.z.object({placeholder:e.z.string().optional(),default_value:e.z.string().optional()}).optional()}),gi=J.extend({type:e.z.literal(`URL`),config:e.z.object({placeholder:e.z.string().optional(),default_value:e.z.string().optional()}).optional()}),_i=e.z.discriminatedUnion(`type`,[Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr]),vi=e.z.discriminatedUnion(`type`,[Xr,Zr,Qr]),yi=e.z.discriminatedUnion(`type`,[$r,ei,ti,ni,hi,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi,mi,gi]),bi=e.z.union([_i,vi,yi]);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 Y=e.z.object({x:e.z.number(),y:e.z.number()}),xi=e.z.object({id:e.z.string(),type:e.z.literal(`FLOW`),coordinates:Y,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()})}),Si=e.z.object({id:e.z.string(),type:e.z.literal(`ROUTER`),coordinates:Y,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()})}),Ci=e.z.object({id:e.z.string(),type:e.z.literal(`STEP`),coordinates:Y,alias:e.z.string().min(1).max(150).optional(),config:e.z.object({components:e.z.array(bi),next_node:e.z.string().optional()})}),wi=e.z.discriminatedUnion(`type`,[xi,Si,Ci]),Ti=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(wi).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:Y.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:Y.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)`});U.extend(Ti.shape).extend({id:e.z.string()});var Ei=e.z.object({id:e.z.number().optional(),text:e.z.string(),type:e.z.enum([`info`,`error`,`success`,`warning`])}),Di=e.z.object({id:e.z.string().optional(),text:e.z.string(),href:e.z.string(),linkText:e.z.string().optional()}),Oi=e.z.object({"form-content-start":e.z.string().optional(),"form-content-end":e.z.string().optional(),"form-footer-start":e.z.string().optional(),"form-footer-end":e.z.string().optional(),"secondary-actions-start":e.z.string().optional(),"secondary-actions-end":e.z.string().optional()}).strict();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(bi),messages:e.z.array(Ei).optional(),links:e.z.array(Di).optional(),partials:Oi.optional(),footer:e.z.string().optional()});var ki=e.z.enum([`pre-user-registration`,`post-user-registration`,`post-user-login`,`post-user-update`,`validate-registration-username`,`pre-user-deletion`,`post-user-deletion`]),Ai=e.z.enum([`post-user-login`]),ji=e.z.enum([`post-user-login`,`post-user-registration`,`post-user-update`,`credentials-exchange`]),Mi=e.z.enum([`validate-registration-username`,`post-user-login`,`credentials-exchange`,`pre-user-registration`,`post-user-registration`,`pre-user-update`,`post-user-update`,`pre-user-deletion`,`post-user-deletion`]),Ni=e.z.enum([`post-user-login`]);ki.options,Ai.options,ji.options,Mi.options,Ni.options;var Pi=e.z.enum([`impersonate`]),Fi=e.z.enum([`ensure-username`,`set-preferred-username`,`account-linking`]),X={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(),...W},Ii=e.z.object({...X,trigger_id:ki,url:e.z.string()}),Li=e.z.object({...X,trigger_id:Ai,form_id:e.z.string()}),Ri=e.z.object({...X,trigger_id:ji,template_id:Fi}),zi=e.z.object({...X,trigger_id:Mi,code_id:e.z.string()}),Bi=e.z.object({...X,trigger_id:Ni,page_id:Pi,permission_required:e.z.string().optional()});e.z.union([Ii,Li,Ri,zi,Bi]);var Vi=e.z.object({...X,trigger_id:ki}).extend(U.shape).extend({hook_id:e.z.string(),url:e.z.string()}),Hi=e.z.object({...X,trigger_id:Ai}).extend(U.shape).extend({hook_id:e.z.string(),form_id:e.z.string()}),Ui=e.z.object({...X,trigger_id:ji}).extend(U.shape).extend({hook_id:e.z.string(),template_id:Fi}),Wi=e.z.object({...X,trigger_id:Mi}).extend(U.shape).extend({hook_id:e.z.string(),code_id:e.z.string()}),Gi=e.z.object({...X,trigger_id:Ni}).extend(U.shape).extend({hook_id:e.z.string(),page_id:Pi,permission_required:e.z.string().optional()});e.z.union([Vi,Hi,Ui,Wi,Gi]),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(U.shape);var Ki=e.z.object({name:e.z.string().optional()}),qi=e.z.object({email:e.z.string().optional()}),Ji=e.z.object({id:e.z.string().optional(),organization_id:e.z.string().max(50),inviter:Ki,invitee:qi,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(Ji.omit({id:!0}).shape);var Yi=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(),"x5t#S256":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}'`})}),Xi=e.z.object({keys:e.z.array(Yi)});e.z.object({issuer:e.z.string(),authorization_endpoint:e.z.string(),token_endpoint:e.z.string(),device_authorization_endpoint:e.z.string().optional(),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 Zi=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}({}),Qi=e.z.nativeEnum(Zi),$i=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:Mr,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:Qi.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:$i.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 Z={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`,CONFIG_INHERITANCE_DIFF:`cfgdiff`,CONFIG_DRIFT:`cfgdrift`,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`},ea=e.z.string().refine(e=>Object.values(Z).includes(e),{message:`Invalid log type`});Z.ACLS_SUMMARY,Z.ACTIONS_EXECUTION_FAILED,Z.API_LIMIT,Z.API_LIMIT_WARNING,Z.APPI,Z.CIBA_EXCHANGE_FAILED,Z.CIBA_EXCHANGE_SUCCEEDED,Z.CIBA_START_FAILED,Z.CIBA_START_SUCCEEDED,Z.CODE_LINK_SENT,Z.CODE_SENT,Z.DEPRECATION_NOTICE,Z.CONFIG_INHERITANCE_DIFF,Z.CONFIG_DRIFT,Z.FAILED_LOGIN,Z.FAILED_BY_CONNECTOR,Z.FAILED_CHANGE_EMAIL,Z.FAILED_BY_CORS,Z.FAILED_CROSS_ORIGIN_AUTHENTICATION,Z.FAILED_CHANGE_PASSWORD,Z.FAILED_POST_CHANGE_PASSWORD_HOOK,Z.FAILED_CHANGE_PHONE_NUMBER,Z.FAILED_CHANGE_PASSWORD_REQUEST,Z.FAILED_CONNECTOR_PROVISIONING,Z.FAILED_CHANGE_USERNAME,Z.FAILED_DELEGATION,Z.FAILED_DEVICE_ACTIVATION,Z.FAILED_DEVICE_AUTHORIZATION_REQUEST,Z.USER_CANCELED_DEVICE_CONFIRMATION,Z.FAILED_USER_DELETION,Z.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS,Z.FAILED_EXCHANGE_CUSTOM_TOKEN,Z.FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN,Z.FAILED_FEDERATED_LOGOUT,Z.FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN,Z.FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN,Z.FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN,Z.FAILED_HOOK,Z.FAILED_IMPERSONATION,Z.FAILED_INVITE_ACCEPT,Z.FAILED_LOGOUT,Z.FLOWS_EXECUTION_COMPLETED,Z.FLOWS_EXECUTION_FAILED,Z.FAILED_SENDING_NOTIFICATION,Z.FORMS_SUBMISSION_FAILED,Z.FORMS_SUBMISSION_SUCCEEDED,Z.FAILED_LOGIN_INCORRECT_PASSWORD,Z.FAILED_PUSHED_AUTHORIZATION_REQUEST,Z.FAILED_POST_USER_REGISTRATION_HOOK,Z.FAILED_SIGNUP,Z.FAILED_SILENT_AUTH,Z.FAILED_LOGIN_INVALID_EMAIL_USERNAME,Z.FAILED_USERS_IMPORT,Z.FAILED_VERIFICATION_EMAIL,Z.FAILED_VERIFICATION_EMAIL_REQUEST,Z.EMAIL_VERIFICATION_CONFIRMED,Z.EMAIL_VERIFICATION_FAILED,Z.MFA_AUTH_FAILED,Z.MFA_AUTH_REJECTED,Z.MFA_AUTH_SUCCESS,Z.MFA_ENROLLMENT_COMPLETE,Z.TOO_MANY_MFA_FAILURES,Z.MFA_RECOVERY_FAILED,Z.MFA_RECOVERY_RATE_LIMIT_EXCEED,Z.MFA_RECOVERY_SUCCESS,Z.MFA_EMAIL_SENT,Z.EMAIL_VERIFICATION_SENT,Z.EMAIL_VERIFICATION_SEND_FAILURE,Z.PUSH_NOTIFICATION_SENT,Z.ERROR_SENDING_MFA_PUSH_NOTIFICATION,Z.MFA_SMS_SENT,Z.ERROR_SENDING_MFA_SMS,Z.MFA_VOICE_CALL_SUCCESS,Z.MFA_VOICE_CALL_FAILED,Z.SECOND_FACTOR_STARTED,Z.MFA_ENROLL_STARTED,Z.MFA_ENROLLMENT_FAILED,Z.GUARDIAN_TENANT_UPDATE,Z.UNENROLL_DEVICE_ACCOUNT,Z.UPDATE_DEVICE_ACCOUNT,Z.WEBAUTHN_CHALLENGE_FAILED,Z.WEBAUTHN_ENROLLMENT_FAILED,Z.FAILED_KMS_API_OPERATION,Z.SUCCESS_KMS_API_OPERATION,Z.KMS_KEY_STATE_CHANGED,Z.TOO_MANY_CALLS_TO_DELEGATION,Z.BLOCKED_IP_ADDRESS,Z.BLOCKED_ACCOUNT_IP,Z.BLOCKED_ACCOUNT_EMAIL,Z.INFORMATION,Z.MFA_REQUIRED,Z.MANAGEMENT_API_READ_OPERATION,Z.FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT,Z.SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT,Z.FAILED_OIDC_BACKCHANNEL_LOGOUT,Z.SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT,Z.ORGANIZATION_MEMBER_ADDED,Z.PASSKEY_CHALLENGE_FAILED,Z.PASSKEY_CHALLENGE_STARTED,Z.PRE_LOGIN_ASSESSMENT,Z.BREACHED_PASSWORD,Z.BREACHED_PASSWORD_ON_RESET,Z.SUCCESS_RESOURCE_CLEANUP,Z.RICH_CONSENTS_ACCESS_ERROR,Z.SUCCESS_LOGIN,Z.SUCCESS_API_OPERATION,Z.FAILED_API_OPERATION,Z.SUCCESS_CHANGE_EMAIL,Z.SUCCESS_CROSS_ORIGIN_AUTHENTICATION,Z.SUCCESS_CHANGE_PASSWORD,Z.SUCCESS_CHANGE_PHONE_NUMBER,Z.SUCCESS_CHANGE_PASSWORD_REQUEST,Z.SUCCESS_CHANGE_USERNAME,Z.SUCCESS_CREDENTIAL_VALIDATION,Z.SUCCESS_DELEGATION,Z.SUCCESS_USER_DELETION,Z.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS,Z.SUCCESS_EXCHANGE_CUSTOM_TOKEN,Z.SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN,Z.SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN,Z.SUCCESS_IMPERSONATION,Z.SUCCESSFULLY_ACCEPTED_USER_INVITE,Z.BREACHED_PASSWORD_ON_SIGNUP,Z.SUCCESS_LOGOUT,Z.SUCCESS_HOOK,Z.SUCCESS_PASSWORD_MIGRATION,Z.SUCCESS_REVOCATION,Z.SUCCESS_SIGNUP,Z.FAILED_SS_SSO_OPERATION,Z.INFORMATION_FROM_SS_SSO_OPERATION,Z.SUCCESS_SS_SSO_OPERATION,Z.SUCCESS_SILENT_AUTH,Z.SUCCESSFUL_SCIM_OPERATION,Z.SUCCESSFULLY_IMPORTED_USERS,Z.SUCCESS_VERIFICATION_EMAIL,Z.SUCCESS_VERIFICATION_EMAIL_REQUEST,Z.MAX_AMOUNT_OF_AUTHENTICATORS,Z.USER_LOGIN_BLOCK_RELEASED,Z.FAILED_UNIVERSAL_LOGOUT,Z.SUCCESSFUL_UNIVERSAL_LOGOUT,Z.WARNING_DURING_LOGIN,Z.WARNING_SENDING_NOTIFICATION,Z.WARNING_USER_MANAGEMENT,(()=>{let e={};for(let[t,n]of Object.entries(Z))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===`CONFIG_INHERITANCE_DIFF`||t===`CONFIG_DRIFT`||t===`ACLS_SUMMARY`||t===`ORGANIZATION_MEMBER_ADDED`?e[n]=`info`:e[n]=`other`;return e})();var ta=e.z.object({name:e.z.string(),version:e.z.string(),env:e.z.object({node:e.z.string().optional()}).optional()}),na=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:ea,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:ta.optional(),log_id:e.z.string().optional(),location_info:na.optional()}).extend({log_id:e.z.string()});var ra=e.z.enum([`http`,`eventbridge`,`eventgrid`,`splunk`,`datadog`,`sumo`]),ia=e.z.enum([`active`,`paused`,`suspended`]),aa=e.z.object({type:e.z.string(),name:e.z.string()});e.z.object({name:e.z.string(),type:ra,status:ia.optional(),sink:e.z.record(e.z.string(),e.z.unknown()),filters:e.z.array(aa).optional(),isPriority:e.z.boolean().optional()}).extend({id:e.z.string(),status:ia,created_at:e.z.string().optional(),updated_at:e.z.string().optional()});var oa=e.z.enum([`auth0`,`cognito`,`okta`,`oidc`]),sa=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()}),ca=e.z.object({id:e.z.string().optional(),name:e.z.string(),provider:oa,connection:e.z.string(),enabled:e.z.boolean().default(!0),credentials:sa});e.z.object({id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()}).extend(ca.shape);var la=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()}),ua=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()}),da=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()}),fa=e.z.object({breached_password_detection:la.optional(),brute_force_protection:ua.optional(),suspicious_ip_throttling:da.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 pa=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`)}),ma=e.z.object({name:e.z.string().describe(`Authentication method name, e.g. "mfa" for a completed second factor`),timestamp:e.z.string().describe(`When the method was completed (ISO 8601)`),type:e.z.string().optional().describe(`For "mfa": the authentication method type used, e.g. "totp", "phone", "passkey"`)}),ha=e.z.object({methods:e.z.array(ma)}),ga=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:pa.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`),authentication:ha.optional().describe(`Authentication methods completed in this session (currently MFA only)`)});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(ga.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 _a=e.z.enum([`never`,`always`,`all-applications`,`confidence-score`]);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:_a.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()});var va=e.z.object({id:e.z.string().optional(),parent_tenant_id:e.z.string().nullish(),config_sync:e.z.enum([`inherit-on-read`,`synced`,`detached`]).nullish(),config_sync_hash:e.z.string().nullish(),config_synced_at:e.z.string().nullish(),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:fa.optional(),mfa:e.z.object({policy:_a.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(va.shape).extend({id:e.z.string(),is_control_plane:e.z.boolean().optional(),has_children:e.z.boolean().optional()});var ya=va.shape.mfa.unwrap().shape,ba=e.z.object({...ya,policy:_a.optional(),factors:e.z.object({sms:e.z.boolean().optional(),otp:e.z.boolean().optional(),email:e.z.boolean().optional(),push_notification:e.z.boolean().optional(),webauthn_roaming:e.z.boolean().optional(),webauthn_platform:e.z.boolean().optional(),recovery_code:e.z.boolean().optional(),duo:e.z.boolean().optional()}).optional()});e.z.object(va.shape).extend({deployment_type:e.z.enum([`shared`,`wfp`]),provisioning_state:e.z.enum([`pending`,`ready`,`failed`]),mfa:ba}).partial();var xa=e.z.enum([`provision`,`seed`,`upgrade`,`backup`,`deprovision`,`users_import`,`sync-defaults`,`detach`,`tenant-members-request`]),Sa=e.z.enum([`pending`,`running`,`succeeded`,`failed`,`cancelled`]),Ca=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:xa,engine:Ca,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:Sa,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 wa=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:wa,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 Q=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:Q.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:Q,created_at:e.z.string(),updated_at:e.z.string()}),e.z.object({seq:e.z.number().int().min(0),status:Q,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 Ta=e.z.enum([`upgrade`,`reseed`,`backup`,`config-sync`]),Ea=e.z.enum([`pending`,`canary`,`rolling`,`paused`,`done`,`failed`]);e.z.object({kind:Ta,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(),config:e.z.record(e.z.string(),e.z.unknown()).nullable().optional()}).extend({id:e.z.string(),status:Ea,created_at:e.z.string(),updated_at:e.z.string(),finished_at:e.z.string().nullable().optional(),paused_reason:e.z.string().nullable().optional()}).pick({status:!0,wave_size:!0,canary_tenant_ids:!0,filter:!0,config:!0,paused_reason:!0,finished_at:!0}).partial();var Da=e.z.enum([`invite`,`add_members`,`remove_members`,`assign_roles`,`remove_roles`,`revoke_invitation`]),Oa=e.z.enum([`pending`,`succeeded`,`failed`]);e.z.object({kind:Da,requested_by:e.z.string().min(1).max(255),payload:e.z.record(e.z.string(),e.z.unknown())}).extend({id:e.z.string(),tenant_id:e.z.string(),status:Oa,result:e.z.record(e.z.string(),e.z.unknown()).nullable().optional(),error:e.z.string().nullable().optional(),notified_at:e.z.string().nullable().optional(),created_at:e.z.string(),updated_at:e.z.string(),finished_at:e.z.string().nullable().optional()}),e.z.object({status:Oa.optional(),result:e.z.record(e.z.string(),e.z.unknown()).nullable().optional(),error:e.z.string().nullable().optional(),notified_at:e.z.string().nullable().optional(),finished_at:e.z.string().nullable().optional()}),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 ka=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()}),Aa=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()}),ja=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:$}),Ma=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()}),Na=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:ka,colors:Aa,displayName:e.z.string(),fonts:ja,page_background:Ma,widget:Na}).extend({themeId:e.z.string()}),e.z.object({...W,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 Pa=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()}),Fa=e.z.object({type:e.z.string(),options:e.z.record(e.z.string(),e.z.unknown()).default({})}),Ia=e.z.object({id:e.z.string().optional(),custom_domain_id:e.z.string(),priority:e.z.number().int().default(100),match:Pa,handlers:e.z.array(Fa).min(1)});Ia.extend({id:e.z.string(),tenant_id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()}),Ia.partial().omit({id:!0,custom_domain_id:!0});var La=`custom_authentication`,Ra=[`urn:ietf:params:oauth:`,`urn:auth0`,`urn:okta`,`http://auth0.com`,`https://auth0.com`,`http://okta.com`,`https://okta.com`],za=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=>!Ra.some(t=>e.toLowerCase().startsWith(t)),{message:`subject_token_type uses a reserved namespace`}),Ba=e.z.enum([`RS256`,`RS384`,`RS512`,`ES256`,`ES384`,`ES512`]),Va=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`)})]),Ha=e.z.object({issuer:e.z.string().min(1).max(2048),jwks:Xi.optional(),jwks_uri:e.z.string().url().optional(),audience:e.z.array(e.z.string().min(1)).min(1).optional(),algorithms:e.z.array(Ba).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:Va});e.z.object({name:e.z.string().min(1).max(255),subject_token_type:za,action_id:e.z.string().min(1).optional(),type:e.z.literal(La),jwt_verification:Ha.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:za.optional(),jwt_verification:Ha.optional()});var Ua=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(Ua).default([])});e.z.object({created_at:e.z.string(),updated_at:e.z.string()}).extend(Wa.shape);var Ga=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(Ga.shape);var Ka=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(Ka.shape),e.z.object({...W,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 qa=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:qa,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:$i.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:pa,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 Ja=e.z.object({value:e.z.string(),description:e.z.string().optional()}),Ya=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()}),Xa=e.z.object({id:e.z.string().optional(),name:e.z.string(),identifier:e.z.string(),scopes:e.z.array(Ja).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:Ya.optional(),is_system:e.z.boolean().optional(),...W,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(Xa);var Za=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(Za),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 Qa=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(Qa);var $a=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($a);var eo=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(eo);var to=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(to);var no=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(),ro=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`})}),io=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:no,metadata:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Custom metadata for the organization`}),enabled_connections:e.z.array(ro).default([]).optional().openapi({description:`List of enabled connections for the organization`}),token_quota:io}).extend(U.shape).extend({id:e.z.string(),name:e.z.string().min(1).openapi({description:`The name of the organization`})});var ao=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(ao),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(U.shape).extend({id:e.z.string()}),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 oo=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(oo)});var so=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(so)});var co=e.z.object({name:e.z.string(),type:e.z.string()}),lo=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(co),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:lo.optional()});var uo=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(`.`)),fo=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:uo,language:e.z.string(),custom_text:fo});var po=e.z.object({"form-content-start":e.z.string().optional(),"form-content-end":e.z.string().optional(),"form-footer-start":e.z.string().optional(),"form-footer-end":e.z.string().optional(),"secondary-actions-start":e.z.string().optional(),"secondary-actions-end":e.z.string().optional()}).strict(),mo=e.z.record(e.z.string(),po);e.z.object({prompt:e.z.string(),partials:mo});var ho=e.z.enum([`phone`,`totp`,`email`,`push`,`webauthn-roaming`,`webauthn-platform`,`passkey`]),go=e.z.object({user_id:e.z.string(),type:ho,phone_number:e.z.string().optional(),totp_secret:e.z.string().optional(),totp_last_step:e.z.number().int().nonnegative().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 _o(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`]}))}go.superRefine(_o),go.extend({id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()}).superRefine(_o),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 vo(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 yo=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,bo=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=yo[n[e]&63];return t};async function xo(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 So(e){let t=vo(e.replace(/ /g,`+`));try{let e=await xo(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 Co(e){let t=await So(e),n=new on({attributeNamePrefix:`@_`,alwaysCreateTextNode:!0,ignoreAttributes:!1}).parse(t);return r.parse(n)}async function wo(e){let t=await So(e),n=new on({attributeNamePrefix:`@_`,alwaysCreateTextNode:!0,ignoreAttributes:!1});return i.parse(n.parse(t))}async function To(e){let t=e=>e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),n=e.success?`urn:oasis:names:tc:SAML:2.0:status:Success`:`urn:oasis:names:tc:SAML:2.0:status:Responder`,r=e.inResponseTo?` InResponseTo="${t(e.inResponseTo)}"`:``,i=!e.success&&e.statusMessage?`<samlp:StatusMessage>${t(e.statusMessage)}</samlp:StatusMessage>`:``,a=`<samlp:LogoutResponse xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="_${bo()}" Version="2.0" IssueInstant="${new Date().toISOString()}" Destination="${t(e.destination)}"${r}><saml:Issuer>${t(e.issuer)}</saml:Issuer><samlp:Status><samlp:StatusCode Value="${n}"/>${i}</samlp:Status></samlp:LogoutResponse>`,o=new Blob([new TextEncoder().encode(a)]).stream().pipeThrough(new CompressionStream(`deflate-raw`)),s=new Uint8Array(await new Response(o).arrayBuffer()),c=``;for(let e of s)c+=String.fromCharCode(e);return btoa(c)}function Eo(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 En({ignoreAttributes:!1,suppressEmptyNode:!0,preserveOrder:!1,format:!0,attributeNamePrefix:`@_`}).build(n)}async function Do(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||`_${bo()}`,s=e.assertionId||`_${bo()}`,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 En({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 Oo=`http://www.w3.org/2001/04/xmldsig-more#rsa-sha256`,ko=`http://www.w3.org/2001/04/xmlenc#sha256`,Ao=`http://www.w3.org/2001/10/xml-exc-c14n#`,jo=class{async signSAML(e,t,n){try{let r=await import(`xml-crypto`),i=r.SignedXml||r.default?.SignedXml;if(!i)throw Error(`SignedXml not found in xml-crypto module`);let a=new i({privateKey:t,publicCert:n});a.canonicalizationAlgorithm=Ao,a.addReference({xpath:`(/*[local-name()='Response']/*[local-name()='Assertion'])[1]`,digestAlgorithm:ko,transforms:[`http://www.w3.org/2000/09/xmldsig#enveloped-signature`,Ao]}),a.signatureAlgorithm=Oo;let o=n.replace(/-----BEGIN CERTIFICATE-----|-----END CERTIFICATE-----/g,``).replace(/\s/g,``);return a.keyInfoProvider={getKeyInfo:()=>`<X509Data><X509Certificate>${o}</X509Certificate></X509Data>`},a.computeSignature(e,{location:{reference:`/*[local-name()='Response']/*[local-name()='Assertion']/*[local-name()='Issuer']`,action:`after`}}),a.getSignedXml()}catch(e){throw Error(`Failed to sign SAML locally. Make sure xml-crypto is installed. Error: ${e}`)}}},Mo=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=Mo,exports.LocalSamlSigner=jo,exports.createSamlLogoutResponse=To,exports.createSamlMetadata=Eo,exports.createSamlResponse=Do,exports.dsSignatureSchema=c,exports.inflateDecompress=So,exports.inflateRaw=xo,exports.parseSamlLogoutRequestQuery=wo,exports.parseSamlRequestQuery=Co,exports.samlIssuerSchema=n,exports.samlLogoutRequestSchema=i,exports.samlMetadataResponseSchema=a,exports.samlRequestSchema=r,exports.samlResponseJsonSchema=l;
7
+ `):(this.indentate=function(){return``},this.tagEndChar=`>`,this.newLine=``)}function Sn(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 H(e,t,n,r,i){return!n.sanitizeName||i(e)?e:n.sanitizeName(e,{isAttribute:t,matcher:r.readOnly()})}V.prototype.build=function(e){if(this.options.preserveOrder)return fn(e,this.options);{Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e});let t=new P,n=Xe(`qName`,{xmlVersion:Sn(e,this.options)});return this.j2x(e,0,t,n).val}},V.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:H(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=H(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=H(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}},V.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+`="`+z(t)+`"`};function Cn(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)}V.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]=z(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]=z(e[r]),n=!0)}return n?t:null},V.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},V.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+`="`+z(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+`="`+z(i)+`"`}}return t},V.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)+`<!--${sn(e)}-->`+this.newLine:this.indentate(r)+`<`+t+n+a+this.tagEndChar+e+this.indentate(r)+i}},V.prototype.closeTag=function(e){let t=``;return this.options.unpairedTags.indexOf(e)===-1?t=this.options.suppressEmptyNode?`/`:`></${e}`:this.options.suppressUnpairedNode||(t=`/`),t},V.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},V.prototype.buildTextValNode=function(e,t,n,r,i){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName){let t=cn(e);return this.indentate(r)+`<![CDATA[${t}]]>`+this.newLine}else if(this.options.commentPropName!==!1&&t===this.options.commentPropName){let t=sn(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}},V.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 wn(e){return this.options.indentBy.repeat(e)}function Tn(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}var En=V,U=e.z.object({created_at:e.z.string(),updated_at:e.z.string()}),Dn=e.z.enum([`local`,`shared`,`platform`]),On=e.z.enum([`none`,`secrets`,`fields`]),W={scope:Dn.optional(),override:On.optional(),enforce:e.z.boolean().optional()},kn=e.z.object({id:e.z.string(),version:e.z.string().optional()}),An=e.z.object({name:e.z.string(),version:e.z.string()}),jn=e.z.object({name:e.z.string(),value:e.z.string().optional()}),Mn=e.z.object({name:e.z.string().max(255),code:e.z.string().max(1e5),supported_triggers:e.z.array(kn).optional(),runtime:e.z.string().max(50).optional(),dependencies:e.z.array(An).optional(),secrets:e.z.array(jn).optional(),is_system:e.z.boolean().optional(),...W,inherit:e.z.boolean().optional()});Mn.partial().extend({status:e.z.enum([`draft`,`built`]).optional(),deployed_at:e.z.string().optional()});var Nn=Mn.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(U.shape),Pn=e.z.object({name:e.z.string()});Nn.extend({secrets:e.z.array(Pn).optional()});var Fn=e.z.string(),In=e.z.enum([`unspecified`,`pending`,`final`,`partial`,`canceled`,`suspended`]),Ln=e.z.object({id:e.z.string(),msg:e.z.string(),url:e.z.string().optional()}),Rn=e.z.object({action_name:e.z.string(),error:Ln.nullable(),started_at:e.z.string(),ended_at:e.z.string()}),zn=e.z.object({level:e.z.enum([`log`,`info`,`warn`,`error`,`debug`]),message:e.z.string()}),Bn=e.z.array(e.z.object({action_name:e.z.string(),lines:e.z.array(zn)}));e.z.object({id:e.z.string(),tenant_id:e.z.string(),trigger_id:Fn,status:In,results:e.z.array(Rn),logs:Bn.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(An).optional(),secrets:e.z.array(jn).optional(),supported_triggers:e.z.array(kn).optional(),deployed:e.z.boolean().default(!0)}).extend({id:e.z.string(),tenant_id:e.z.string(),number:e.z.number().int()}).extend(U.shape);var Vn=e.z.enum([`user_action`,`admin_action`,`system`,`api`]),Hn=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()}),Un=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()}),Wn=e.z.object({user:e.z.object({user_id:e.z.string(),name:e.z.string().optional(),email:e.z.string().optional()}).optional(),strategy:e.z.string(),credentials:e.z.object({jti:e.z.string().optional(),scopes:e.z.array(e.z.string()).optional()}).optional()}),Gn=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(),authorization_url:e.z.string().optional(),auth:Wn.optional()}),Kn=e.z.object({status_code:e.z.number(),body:e.z.unknown().optional()}),qn=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()}),Jn=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:Vn,actor:Hn,target:Un,request:Gn,response:Kn.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:qn.optional(),auth0_client:Jn.optional(),hostname:e.z.string(),is_mobile:e.z.boolean().optional(),execution_id:e.z.string().optional(),details:e.z.record(e.z.string(),e.z.unknown()).optional(),login_session_id:e.z.string().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 Yn=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()}),Xn=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())})}),Zn=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:Yn.optional()})}),Qn=e.z.enum([`change-email`,`account`,`custom`]),$n=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'`})})}),er=e.z.union([Xn,Zn,$n]);e.z.object({name:e.z.string().min(1).max(150).openapi({description:`The name of the flow`}),actions:e.z.array(er).optional().default([]).openapi({description:`The list of actions to execute in sequence`})}).extend(U.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 tr=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()),nr=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:tr.optional()}),rr=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(),ir=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:rr});ir.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(U.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(nr).optional()}).omit({registration_completed_at:!0}),ir.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 ar=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,or=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=ar[n[e]&63];return t},sr=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(()=>or()).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(sr.shape).extend({client_id:e.z.string()});var cr=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.`})}),lr=e.z.object({id:e.z.string().openapi({description:`ID of the client grant.`})}).extend(cr.shape).extend({created_at:e.z.string().optional(),updated_at:e.z.string().optional()});e.z.array(lr);var ur=e.z.enum([`iat`,`rat`]),dr=e.z.object({id:e.z.string(),token_hash:e.z.string(),type:ur,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(dr.shape);var G=e.z.object({x:e.z.number(),y:e.z.number()}),fr=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}({}),pr=function(e){return e.BLOCK=`BLOCK`,e.FIELD=`FIELD`,e}({}),K=e.z.object({id:e.z.string(),category:e.z.nativeEnum(pr),type:e.z.nativeEnum(fr)}),mr=K.extend({category:e.z.literal(`BLOCK`),type:e.z.literal(`RICH_TEXT`),config:e.z.object({content:e.z.string()}).passthrough()}),hr=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()}),gr=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()}),_r=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()}),vr=e.z.object({id:e.z.string(),category:e.z.string(),type:e.z.string()}).passthrough(),yr=e.z.union([mr,hr,gr,_r,vr]),br=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(yr),next_node:e.z.string()}).passthrough()}),xr=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()})}),Sr=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()}),Cr=e.z.object({id:e.z.string(),type:e.z.string(),coordinates:G}).passthrough(),wr=e.z.union([br,xr,Sr,Cr]),Tr=e.z.object({next_node:e.z.string(),coordinates:G}).passthrough(),Er=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(wr),start:Tr,ending:Er,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 Dr=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}({}),Or=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}({}),kr=function(e){return e.S256=`S256`,e.Plain=`plain`,e}({}),Ar=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(),jr=e.z.object({userinfo:e.z.record(e.z.string(),Ar).optional(),id_token:e.z.record(e.z.string(),Ar).optional()}),Mr=e.z.object({client_id:e.z.string(),act_as:e.z.string().optional(),response_type:e.z.nativeEnum(Dr).optional(),response_mode:e.z.nativeEnum(Or).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(kr).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:jr.optional(),vendor_id:e.z.string().optional()});e.z.object({...W,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 Nr=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:Nr,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()}),e.z.object({device_code_hash:e.z.string(),user_code_hash:e.z.string(),client_id:e.z.string(),scope:e.z.string().optional(),audience:e.z.string().optional(),status:e.z.enum([`pending`,`approved`,`denied`,`consumed`]),login_id:e.z.string().optional(),expires_at:e.z.string(),created_at:e.z.string(),last_polled_at:e.z.string().optional(),interval:e.z.number().int().positive(),version:e.z.number().int().nonnegative()});var Pr=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 Fr(e){if(e!==null){if(Array.isArray(e))return e.filter(e=>e!==null).map(Fr);if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))r!==null&&(t[n]=Fr(r));return t}return e}}var Ir=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?{}:Fr(e),Pr).default({}),enabled_clients:e.z.array(e.z.string()).default([]).optional(),response_type:e.z.nativeEnum(Dr).optional(),response_mode:e.z.nativeEnum(Or).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(),...W});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(Ir.shape);var Lr=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()}),Rr=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()})]),zr=Lr.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(Rr)}).optional(),tls_policy:e.z.string().optional()});Lr.pick({tls_policy:!0,custom_client_ip_header:!0,domain_metadata:!0}).strict(),zr.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 Br=e.z.object({id:e.z.string(),order:e.z.number().optional(),visible:e.z.boolean().optional().default(!0)}),q=Br.extend({category:e.z.literal(`BLOCK`).optional()}),Vr=q.extend({type:e.z.literal(`DIVIDER`),config:e.z.object({text:e.z.string().optional()}).optional()}),Hr=q.extend({type:e.z.literal(`HTML`),config:e.z.object({content:e.z.string().optional()}).optional()}),Ur=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()}),Wr=q.extend({type:e.z.literal(`JUMP_BUTTON`),config:e.z.object({text:e.z.string().optional(),target_step:e.z.string().optional()})}),Gr=q.extend({type:e.z.literal(`RESEND_BUTTON`),config:e.z.object({text:e.z.string().optional(),resend_action:e.z.string().optional()})}),Kr=q.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()})}),qr=q.extend({type:e.z.literal(`PREVIOUS_BUTTON`),config:e.z.object({text:e.z.string().optional()})}),Jr=q.extend({type:e.z.literal(`RICH_TEXT`),config:e.z.object({content:e.z.string().optional()}).optional()}),Yr=Br.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()}),Xr=Yr.extend({type:e.z.literal(`AUTH0_VERIFIABLE_CREDENTIALS`),config:e.z.object({credential_type:e.z.string().optional()})}),Zr=Yr.extend({type:e.z.literal(`GMAPS_ADDRESS`),config:e.z.object({api_key:e.z.string().optional()})}),Qr=Yr.extend({type:e.z.literal(`RECAPTCHA`),config:e.z.object({site_key:e.z.string().optional()})}),J=Br.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()}),$r=J.extend({type:e.z.literal(`BOOLEAN`),config:e.z.object({default_value:e.z.boolean().optional()}).optional()}),ei=J.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()}),ti=J.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()}),ni=J.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()}),ri=J.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()})}),ii=J.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()}),ai=J.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()}),oi=J.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()}),si=J.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()}),ci=J.extend({type:e.z.literal(`LEGAL`),config:e.z.object({text:e.z.string(),html:e.z.boolean().optional()}).optional()}),li=J.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()}),ui=J.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()}),di=J.extend({type:e.z.literal(`PAYMENT`),config:e.z.object({provider:e.z.string().optional(),currency:e.z.string().optional()}).optional()}),fi=J.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(),short_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()}),pi=J.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()}),mi=J.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()}),hi=J.extend({type:e.z.literal(`COUNTRY`),config:e.z.object({placeholder:e.z.string().optional(),default_value:e.z.string().optional()}).optional()}),gi=J.extend({type:e.z.literal(`URL`),config:e.z.object({placeholder:e.z.string().optional(),default_value:e.z.string().optional()}).optional()}),_i=e.z.discriminatedUnion(`type`,[Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr]),vi=e.z.discriminatedUnion(`type`,[Xr,Zr,Qr]),yi=e.z.discriminatedUnion(`type`,[$r,ei,ti,ni,hi,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi,mi,gi]),bi=e.z.union([_i,vi,yi]);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 Y=e.z.object({x:e.z.number(),y:e.z.number()}),xi=e.z.object({id:e.z.string(),type:e.z.literal(`FLOW`),coordinates:Y,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()})}),Si=e.z.object({id:e.z.string(),type:e.z.literal(`ROUTER`),coordinates:Y,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()})}),Ci=e.z.object({id:e.z.string(),type:e.z.literal(`STEP`),coordinates:Y,alias:e.z.string().min(1).max(150).optional(),config:e.z.object({components:e.z.array(bi),next_node:e.z.string().optional()})}),wi=e.z.discriminatedUnion(`type`,[xi,Si,Ci]),Ti=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(wi).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:Y.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:Y.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)`});U.extend(Ti.shape).extend({id:e.z.string()});var Ei=e.z.object({id:e.z.number().optional(),text:e.z.string(),type:e.z.enum([`info`,`error`,`success`,`warning`])}),Di=e.z.object({id:e.z.string().optional(),text:e.z.string(),href:e.z.string(),linkText:e.z.string().optional()}),Oi=e.z.object({"form-content-start":e.z.string().optional(),"form-content-end":e.z.string().optional(),"form-footer-start":e.z.string().optional(),"form-footer-end":e.z.string().optional(),"secondary-actions-start":e.z.string().optional(),"secondary-actions-end":e.z.string().optional()}).strict();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(bi),messages:e.z.array(Ei).optional(),links:e.z.array(Di).optional(),partials:Oi.optional(),footer:e.z.string().optional()});var ki=e.z.enum([`pre-user-registration`,`post-user-registration`,`post-user-login`,`post-user-update`,`validate-registration-username`,`pre-user-deletion`,`post-user-deletion`]),Ai=e.z.enum([`post-user-login`]),ji=e.z.enum([`post-user-login`,`post-user-registration`,`post-user-update`,`credentials-exchange`]),Mi=e.z.enum([`validate-registration-username`,`post-user-login`,`credentials-exchange`,`pre-user-registration`,`post-user-registration`,`pre-user-update`,`post-user-update`,`pre-user-deletion`,`post-user-deletion`,`pre-account-action`]),Ni=e.z.enum([`post-user-login`]);ki.options,Ai.options,ji.options,Mi.options,Ni.options;var Pi=e.z.enum([`impersonate`]),Fi=e.z.enum([`ensure-username`,`set-preferred-username`,`account-linking`]),X={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(),...W},Ii=e.z.object({...X,trigger_id:ki,url:e.z.string()}),Li=e.z.object({...X,trigger_id:Ai,form_id:e.z.string()}),Ri=e.z.object({...X,trigger_id:ji,template_id:Fi}),zi=e.z.object({...X,trigger_id:Mi,code_id:e.z.string()}),Bi=e.z.object({...X,trigger_id:Ni,page_id:Pi,permission_required:e.z.string().optional()});e.z.union([Ii,Li,Ri,zi,Bi]);var Vi=e.z.object({...X,trigger_id:ki}).extend(U.shape).extend({hook_id:e.z.string(),url:e.z.string()}),Hi=e.z.object({...X,trigger_id:Ai}).extend(U.shape).extend({hook_id:e.z.string(),form_id:e.z.string()}),Ui=e.z.object({...X,trigger_id:ji}).extend(U.shape).extend({hook_id:e.z.string(),template_id:Fi}),Wi=e.z.object({...X,trigger_id:Mi}).extend(U.shape).extend({hook_id:e.z.string(),code_id:e.z.string()}),Gi=e.z.object({...X,trigger_id:Ni}).extend(U.shape).extend({hook_id:e.z.string(),page_id:Pi,permission_required:e.z.string().optional()});e.z.union([Vi,Hi,Ui,Wi,Gi]),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(U.shape);var Ki=e.z.object({name:e.z.string().optional()}),qi=e.z.object({email:e.z.string().optional()}),Ji=e.z.object({id:e.z.string().optional(),organization_id:e.z.string().max(50),inviter:Ki,invitee:qi,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(Ji.omit({id:!0}).shape);var Yi=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(),"x5t#S256":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}'`})}),Xi=e.z.object({keys:e.z.array(Yi)});e.z.object({issuer:e.z.string(),authorization_endpoint:e.z.string(),token_endpoint:e.z.string(),device_authorization_endpoint:e.z.string().optional(),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 Zi=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}({}),Qi=e.z.nativeEnum(Zi),$i=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:Mr,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:Qi.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:$i.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 Z={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`,CONFIG_INHERITANCE_DIFF:`cfgdiff`,CONFIG_DRIFT:`cfgdrift`,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`},ea=e.z.string().refine(e=>Object.values(Z).includes(e),{message:`Invalid log type`});Z.ACLS_SUMMARY,Z.ACTIONS_EXECUTION_FAILED,Z.API_LIMIT,Z.API_LIMIT_WARNING,Z.APPI,Z.CIBA_EXCHANGE_FAILED,Z.CIBA_EXCHANGE_SUCCEEDED,Z.CIBA_START_FAILED,Z.CIBA_START_SUCCEEDED,Z.CODE_LINK_SENT,Z.CODE_SENT,Z.DEPRECATION_NOTICE,Z.CONFIG_INHERITANCE_DIFF,Z.CONFIG_DRIFT,Z.FAILED_LOGIN,Z.FAILED_BY_CONNECTOR,Z.FAILED_CHANGE_EMAIL,Z.FAILED_BY_CORS,Z.FAILED_CROSS_ORIGIN_AUTHENTICATION,Z.FAILED_CHANGE_PASSWORD,Z.FAILED_POST_CHANGE_PASSWORD_HOOK,Z.FAILED_CHANGE_PHONE_NUMBER,Z.FAILED_CHANGE_PASSWORD_REQUEST,Z.FAILED_CONNECTOR_PROVISIONING,Z.FAILED_CHANGE_USERNAME,Z.FAILED_DELEGATION,Z.FAILED_DEVICE_ACTIVATION,Z.FAILED_DEVICE_AUTHORIZATION_REQUEST,Z.USER_CANCELED_DEVICE_CONFIRMATION,Z.FAILED_USER_DELETION,Z.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS,Z.FAILED_EXCHANGE_CUSTOM_TOKEN,Z.FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN,Z.FAILED_FEDERATED_LOGOUT,Z.FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN,Z.FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN,Z.FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN,Z.FAILED_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN,Z.FAILED_HOOK,Z.FAILED_IMPERSONATION,Z.FAILED_INVITE_ACCEPT,Z.FAILED_LOGOUT,Z.FLOWS_EXECUTION_COMPLETED,Z.FLOWS_EXECUTION_FAILED,Z.FAILED_SENDING_NOTIFICATION,Z.FORMS_SUBMISSION_FAILED,Z.FORMS_SUBMISSION_SUCCEEDED,Z.FAILED_LOGIN_INCORRECT_PASSWORD,Z.FAILED_PUSHED_AUTHORIZATION_REQUEST,Z.FAILED_POST_USER_REGISTRATION_HOOK,Z.FAILED_SIGNUP,Z.FAILED_SILENT_AUTH,Z.FAILED_LOGIN_INVALID_EMAIL_USERNAME,Z.FAILED_USERS_IMPORT,Z.FAILED_VERIFICATION_EMAIL,Z.FAILED_VERIFICATION_EMAIL_REQUEST,Z.EMAIL_VERIFICATION_CONFIRMED,Z.EMAIL_VERIFICATION_FAILED,Z.MFA_AUTH_FAILED,Z.MFA_AUTH_REJECTED,Z.MFA_AUTH_SUCCESS,Z.MFA_ENROLLMENT_COMPLETE,Z.TOO_MANY_MFA_FAILURES,Z.MFA_RECOVERY_FAILED,Z.MFA_RECOVERY_RATE_LIMIT_EXCEED,Z.MFA_RECOVERY_SUCCESS,Z.MFA_EMAIL_SENT,Z.EMAIL_VERIFICATION_SENT,Z.EMAIL_VERIFICATION_SEND_FAILURE,Z.PUSH_NOTIFICATION_SENT,Z.ERROR_SENDING_MFA_PUSH_NOTIFICATION,Z.MFA_SMS_SENT,Z.ERROR_SENDING_MFA_SMS,Z.MFA_VOICE_CALL_SUCCESS,Z.MFA_VOICE_CALL_FAILED,Z.SECOND_FACTOR_STARTED,Z.MFA_ENROLL_STARTED,Z.MFA_ENROLLMENT_FAILED,Z.GUARDIAN_TENANT_UPDATE,Z.UNENROLL_DEVICE_ACCOUNT,Z.UPDATE_DEVICE_ACCOUNT,Z.WEBAUTHN_CHALLENGE_FAILED,Z.WEBAUTHN_ENROLLMENT_FAILED,Z.FAILED_KMS_API_OPERATION,Z.SUCCESS_KMS_API_OPERATION,Z.KMS_KEY_STATE_CHANGED,Z.TOO_MANY_CALLS_TO_DELEGATION,Z.BLOCKED_IP_ADDRESS,Z.BLOCKED_ACCOUNT_IP,Z.BLOCKED_ACCOUNT_EMAIL,Z.INFORMATION,Z.MFA_REQUIRED,Z.MANAGEMENT_API_READ_OPERATION,Z.FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT,Z.SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT,Z.FAILED_OIDC_BACKCHANNEL_LOGOUT,Z.SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT,Z.ORGANIZATION_MEMBER_ADDED,Z.PASSKEY_CHALLENGE_FAILED,Z.PASSKEY_CHALLENGE_STARTED,Z.PRE_LOGIN_ASSESSMENT,Z.BREACHED_PASSWORD,Z.BREACHED_PASSWORD_ON_RESET,Z.SUCCESS_RESOURCE_CLEANUP,Z.RICH_CONSENTS_ACCESS_ERROR,Z.SUCCESS_LOGIN,Z.SUCCESS_API_OPERATION,Z.FAILED_API_OPERATION,Z.SUCCESS_CHANGE_EMAIL,Z.SUCCESS_CROSS_ORIGIN_AUTHENTICATION,Z.SUCCESS_CHANGE_PASSWORD,Z.SUCCESS_CHANGE_PHONE_NUMBER,Z.SUCCESS_CHANGE_PASSWORD_REQUEST,Z.SUCCESS_CHANGE_USERNAME,Z.SUCCESS_CREDENTIAL_VALIDATION,Z.SUCCESS_DELEGATION,Z.SUCCESS_USER_DELETION,Z.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS,Z.SUCCESS_EXCHANGE_CUSTOM_TOKEN,Z.SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN,Z.SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN,Z.SUCCESS_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN,Z.SUCCESS_IMPERSONATION,Z.SUCCESSFULLY_ACCEPTED_USER_INVITE,Z.BREACHED_PASSWORD_ON_SIGNUP,Z.SUCCESS_LOGOUT,Z.SUCCESS_HOOK,Z.SUCCESS_PASSWORD_MIGRATION,Z.SUCCESS_REVOCATION,Z.SUCCESS_SIGNUP,Z.FAILED_SS_SSO_OPERATION,Z.INFORMATION_FROM_SS_SSO_OPERATION,Z.SUCCESS_SS_SSO_OPERATION,Z.SUCCESS_SILENT_AUTH,Z.SUCCESSFUL_SCIM_OPERATION,Z.SUCCESSFULLY_IMPORTED_USERS,Z.SUCCESS_VERIFICATION_EMAIL,Z.SUCCESS_VERIFICATION_EMAIL_REQUEST,Z.MAX_AMOUNT_OF_AUTHENTICATORS,Z.USER_LOGIN_BLOCK_RELEASED,Z.FAILED_UNIVERSAL_LOGOUT,Z.SUCCESSFUL_UNIVERSAL_LOGOUT,Z.WARNING_DURING_LOGIN,Z.WARNING_SENDING_NOTIFICATION,Z.WARNING_USER_MANAGEMENT,(()=>{let e={};for(let[t,n]of Object.entries(Z))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===`CONFIG_INHERITANCE_DIFF`||t===`CONFIG_DRIFT`||t===`ACLS_SUMMARY`||t===`ORGANIZATION_MEMBER_ADDED`?e[n]=`info`:e[n]=`other`;return e})();var ta=e.z.object({name:e.z.string(),version:e.z.string(),env:e.z.object({node:e.z.string().optional()}).optional()}),na=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:ea,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:ta.optional(),log_id:e.z.string().optional(),location_info:na.optional()}).extend({log_id:e.z.string()});var ra=e.z.enum([`http`,`eventbridge`,`eventgrid`,`splunk`,`datadog`,`sumo`]),ia=e.z.enum([`active`,`paused`,`suspended`]),aa=e.z.object({type:e.z.string(),name:e.z.string()});e.z.object({name:e.z.string(),type:ra,status:ia.optional(),sink:e.z.record(e.z.string(),e.z.unknown()),filters:e.z.array(aa).optional(),isPriority:e.z.boolean().optional()}).extend({id:e.z.string(),status:ia,created_at:e.z.string().optional(),updated_at:e.z.string().optional()});var oa=e.z.enum([`auth0`,`cognito`,`okta`,`oidc`]),sa=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()}),ca=e.z.object({id:e.z.string().optional(),name:e.z.string(),provider:oa,connection:e.z.string(),enabled:e.z.boolean().default(!0),credentials:sa});e.z.object({id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()}).extend(ca.shape);var la=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()}),ua=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()}),da=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()}),fa=e.z.object({breached_password_detection:la.optional(),brute_force_protection:ua.optional(),suspicious_ip_throttling:da.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 pa=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`)}),ma=e.z.object({name:e.z.string().describe(`Authentication method name, e.g. "mfa" for a completed second factor`),timestamp:e.z.string().describe(`When the method was completed (ISO 8601)`),type:e.z.string().optional().describe(`For "mfa": the authentication method type used, e.g. "totp", "phone", "passkey"`)}),ha=e.z.object({methods:e.z.array(ma)}),ga=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:pa.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`),authentication:ha.optional().describe(`Authentication methods completed in this session (currently MFA only)`)});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(ga.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 _a=e.z.enum([`never`,`always`,`all-applications`,`confidence-score`]);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:_a.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()});var va=e.z.object({id:e.z.string().optional(),parent_tenant_id:e.z.string().nullish(),config_sync:e.z.enum([`inherit-on-read`,`synced`,`detached`]).nullish(),config_sync_hash:e.z.string().nullish(),config_synced_at:e.z.string().nullish(),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:fa.optional(),mfa:e.z.object({policy:_a.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(va.shape).extend({id:e.z.string(),is_control_plane:e.z.boolean().optional(),has_children:e.z.boolean().optional()});var ya=va.shape.mfa.unwrap().shape,ba=e.z.object({...ya,policy:_a.optional(),factors:e.z.object({sms:e.z.boolean().optional(),otp:e.z.boolean().optional(),email:e.z.boolean().optional(),push_notification:e.z.boolean().optional(),webauthn_roaming:e.z.boolean().optional(),webauthn_platform:e.z.boolean().optional(),recovery_code:e.z.boolean().optional(),duo:e.z.boolean().optional()}).optional()});e.z.object(va.shape).extend({deployment_type:e.z.enum([`shared`,`wfp`]),provisioning_state:e.z.enum([`pending`,`ready`,`failed`]),mfa:ba}).partial();var xa=e.z.enum([`provision`,`seed`,`upgrade`,`backup`,`deprovision`,`users_import`,`sync-defaults`,`detach`,`tenant-members-request`]),Sa=e.z.enum([`pending`,`running`,`succeeded`,`failed`,`cancelled`]),Ca=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:xa,engine:Ca,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:Sa,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 wa=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:wa,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 Q=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:Q.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:Q,created_at:e.z.string(),updated_at:e.z.string()}),e.z.object({seq:e.z.number().int().min(0),status:Q,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 Ta=e.z.enum([`upgrade`,`reseed`,`backup`,`config-sync`]),Ea=e.z.enum([`pending`,`canary`,`rolling`,`paused`,`done`,`failed`]);e.z.object({kind:Ta,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(),config:e.z.record(e.z.string(),e.z.unknown()).nullable().optional()}).extend({id:e.z.string(),status:Ea,created_at:e.z.string(),updated_at:e.z.string(),finished_at:e.z.string().nullable().optional(),paused_reason:e.z.string().nullable().optional()}).pick({status:!0,wave_size:!0,canary_tenant_ids:!0,filter:!0,config:!0,paused_reason:!0,finished_at:!0}).partial();var Da=e.z.enum([`invite`,`add_members`,`remove_members`,`assign_roles`,`remove_roles`,`revoke_invitation`]),Oa=e.z.enum([`pending`,`succeeded`,`failed`]);e.z.object({kind:Da,requested_by:e.z.string().min(1).max(255),payload:e.z.record(e.z.string(),e.z.unknown())}).extend({id:e.z.string(),tenant_id:e.z.string(),status:Oa,result:e.z.record(e.z.string(),e.z.unknown()).nullable().optional(),error:e.z.string().nullable().optional(),notified_at:e.z.string().nullable().optional(),created_at:e.z.string(),updated_at:e.z.string(),finished_at:e.z.string().nullable().optional()}),e.z.object({status:Oa.optional(),result:e.z.record(e.z.string(),e.z.unknown()).nullable().optional(),error:e.z.string().nullable().optional(),notified_at:e.z.string().nullable().optional(),finished_at:e.z.string().nullable().optional()}),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 ka=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()}),Aa=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()}),ja=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:$}),Ma=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()}),Na=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:ka,colors:Aa,displayName:e.z.string(),fonts:ja,page_background:Ma,widget:Na}).extend({themeId:e.z.string()}),e.z.object({...W,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 Pa=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()}),Fa=e.z.object({type:e.z.string(),options:e.z.record(e.z.string(),e.z.unknown()).default({})}),Ia=e.z.object({id:e.z.string().optional(),custom_domain_id:e.z.string(),priority:e.z.number().int().default(100),match:Pa,handlers:e.z.array(Fa).min(1)});Ia.extend({id:e.z.string(),tenant_id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()}),Ia.partial().omit({id:!0,custom_domain_id:!0});var La=`custom_authentication`,Ra=[`urn:ietf:params:oauth:`,`urn:auth0`,`urn:okta`,`http://auth0.com`,`https://auth0.com`,`http://okta.com`,`https://okta.com`],za=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=>!Ra.some(t=>e.toLowerCase().startsWith(t)),{message:`subject_token_type uses a reserved namespace`}),Ba=e.z.enum([`RS256`,`RS384`,`RS512`,`ES256`,`ES384`,`ES512`]),Va=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`)})]),Ha=e.z.object({issuer:e.z.string().min(1).max(2048),jwks:Xi.optional(),jwks_uri:e.z.string().url().optional(),audience:e.z.array(e.z.string().min(1)).min(1).optional(),algorithms:e.z.array(Ba).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:Va});e.z.object({name:e.z.string().min(1).max(255),subject_token_type:za,action_id:e.z.string().min(1).optional(),type:e.z.literal(La),jwt_verification:Ha.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:za.optional(),jwt_verification:Ha.optional()});var Ua=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(Ua).default([])});e.z.object({created_at:e.z.string(),updated_at:e.z.string()}).extend(Wa.shape);var Ga=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(Ga.shape);var Ka=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(Ka.shape),e.z.object({...W,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 qa=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:qa,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:$i.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:pa,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 Ja=e.z.object({value:e.z.string(),description:e.z.string().optional()}),Ya=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()}),Xa=e.z.object({id:e.z.string().optional(),name:e.z.string(),identifier:e.z.string(),scopes:e.z.array(Ja).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:Ya.optional(),is_system:e.z.boolean().optional(),...W,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(Xa);var Za=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(Za),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 Qa=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(Qa);var $a=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($a);var eo=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(eo);var to=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(to);var no=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(),ro=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`})}),io=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:no,metadata:e.z.record(e.z.string(),e.z.any()).default({}).optional().openapi({description:`Custom metadata for the organization`}),enabled_connections:e.z.array(ro).default([]).optional().openapi({description:`List of enabled connections for the organization`}),token_quota:io}).extend(U.shape).extend({id:e.z.string(),name:e.z.string().min(1).openapi({description:`The name of the organization`})});var ao=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(ao),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(U.shape).extend({id:e.z.string()}),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 oo=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(oo)});var so=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(so)});var co=e.z.object({name:e.z.string(),type:e.z.string()}),lo=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(co),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:lo.optional()});var uo=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(`.`)),fo=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:uo,language:e.z.string(),custom_text:fo});var po=e.z.object({"form-content-start":e.z.string().optional(),"form-content-end":e.z.string().optional(),"form-footer-start":e.z.string().optional(),"form-footer-end":e.z.string().optional(),"secondary-actions-start":e.z.string().optional(),"secondary-actions-end":e.z.string().optional()}).strict(),mo=e.z.record(e.z.string(),po);e.z.object({prompt:e.z.string(),partials:mo});var ho=e.z.enum([`phone`,`totp`,`email`,`push`,`webauthn-roaming`,`webauthn-platform`,`passkey`]),go=e.z.object({user_id:e.z.string(),type:ho,phone_number:e.z.string().optional(),totp_secret:e.z.string().optional(),totp_last_step:e.z.number().int().nonnegative().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 _o(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`]}))}go.superRefine(_o),go.extend({id:e.z.string(),created_at:e.z.string(),updated_at:e.z.string()}).superRefine(_o),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 vo(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 yo=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,bo=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=yo[n[e]&63];return t};async function xo(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 So(e){let t=vo(e.replace(/ /g,`+`));try{let e=await xo(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 Co(e){let t=await So(e),n=new on({attributeNamePrefix:`@_`,alwaysCreateTextNode:!0,ignoreAttributes:!1}).parse(t);return r.parse(n)}async function wo(e){let t=await So(e),n=new on({attributeNamePrefix:`@_`,alwaysCreateTextNode:!0,ignoreAttributes:!1});return i.parse(n.parse(t))}async function To(e){let t=e=>e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),n=e.success?`urn:oasis:names:tc:SAML:2.0:status:Success`:`urn:oasis:names:tc:SAML:2.0:status:Responder`,r=e.inResponseTo?` InResponseTo="${t(e.inResponseTo)}"`:``,i=!e.success&&e.statusMessage?`<samlp:StatusMessage>${t(e.statusMessage)}</samlp:StatusMessage>`:``,a=`<samlp:LogoutResponse xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="_${bo()}" Version="2.0" IssueInstant="${new Date().toISOString()}" Destination="${t(e.destination)}"${r}><saml:Issuer>${t(e.issuer)}</saml:Issuer><samlp:Status><samlp:StatusCode Value="${n}"/>${i}</samlp:Status></samlp:LogoutResponse>`,o=new Blob([new TextEncoder().encode(a)]).stream().pipeThrough(new CompressionStream(`deflate-raw`)),s=new Uint8Array(await new Response(o).arrayBuffer()),c=``;for(let e of s)c+=String.fromCharCode(e);return btoa(c)}function Eo(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 En({ignoreAttributes:!1,suppressEmptyNode:!0,preserveOrder:!1,format:!0,attributeNamePrefix:`@_`}).build(n)}async function Do(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||`_${bo()}`,s=e.assertionId||`_${bo()}`,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 En({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 Oo=`http://www.w3.org/2001/04/xmldsig-more#rsa-sha256`,ko=`http://www.w3.org/2001/04/xmlenc#sha256`,Ao=`http://www.w3.org/2001/10/xml-exc-c14n#`,jo=class{async signSAML(e,t,n){try{let r=await import(`xml-crypto`),i=r.SignedXml||r.default?.SignedXml;if(!i)throw Error(`SignedXml not found in xml-crypto module`);let a=new i({privateKey:t,publicCert:n});a.canonicalizationAlgorithm=Ao,a.addReference({xpath:`(/*[local-name()='Response']/*[local-name()='Assertion'])[1]`,digestAlgorithm:ko,transforms:[`http://www.w3.org/2000/09/xmldsig#enveloped-signature`,Ao]}),a.signatureAlgorithm=Oo;let o=n.replace(/-----BEGIN CERTIFICATE-----|-----END CERTIFICATE-----/g,``).replace(/\s/g,``);return a.keyInfoProvider={getKeyInfo:()=>`<X509Data><X509Certificate>${o}</X509Certificate></X509Data>`},a.computeSignature(e,{location:{reference:`/*[local-name()='Response']/*[local-name()='Assertion']/*[local-name()='Issuer']`,action:`after`}}),a.getSignedXml()}catch(e){throw Error(`Failed to sign SAML locally. Make sure xml-crypto is installed. Error: ${e}`)}}},Mo=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=Mo,exports.LocalSamlSigner=jo,exports.createSamlLogoutResponse=To,exports.createSamlMetadata=Eo,exports.createSamlResponse=Do,exports.dsSignatureSchema=c,exports.inflateDecompress=So,exports.inflateRaw=xo,exports.parseSamlLogoutRequestQuery=wo,exports.parseSamlRequestQuery=Co,exports.samlIssuerSchema=n,exports.samlLogoutRequestSchema=i,exports.samlMetadataResponseSchema=a,exports.samlRequestSchema=r,exports.samlResponseJsonSchema=l;