@novu/framework 2.10.0-alpha.2 → 2.10.0
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/cjs/{health-check.types-D7zhgmn3.d.cts → health-check.types-DwKatX-8.d.cts} +3 -2
- package/dist/cjs/{index-CcsfZUx6.d.cts → index-BTTxx1ad.d.cts} +2 -2
- package/dist/cjs/index.cjs +42 -42
- package/dist/cjs/index.d.cts +4 -4
- package/dist/cjs/internal/index.d.cts +3 -3
- package/dist/cjs/servers/express.cjs +36 -36
- package/dist/cjs/servers/express.d.cts +5 -5
- package/dist/cjs/servers/h3.cjs +49 -49
- package/dist/cjs/servers/h3.d.cts +5 -5
- package/dist/cjs/servers/lambda.cjs +59 -59
- package/dist/cjs/servers/lambda.d.cts +6 -6
- package/dist/cjs/servers/nest.cjs +62 -62
- package/dist/cjs/servers/nest.d.cts +7 -7
- package/dist/cjs/servers/next.cjs +22 -22
- package/dist/cjs/servers/next.d.cts +5 -5
- package/dist/cjs/servers/nuxt.cjs +49 -49
- package/dist/cjs/servers/nuxt.d.cts +5 -5
- package/dist/cjs/servers/remix.cjs +49 -49
- package/dist/cjs/servers/remix.d.cts +5 -5
- package/dist/cjs/servers/sveltekit.cjs +54 -54
- package/dist/cjs/servers/sveltekit.d.cts +5 -5
- package/dist/cjs/step-resolver.cjs +1 -1
- package/dist/cjs/step-resolver.d.cts +11 -11
- package/dist/cjs/{subscriber.types-Dq1CT3w8.d.cts → subscriber.types-CftO3aFY.d.cts} +1 -1
- package/dist/cjs/validators.cjs +1 -1
- package/dist/cjs/validators.d.cts +1 -1
- package/dist/esm/chunk-JKG63DBC.js +1 -0
- package/dist/esm/{chunk-YZ2OSJPP.js → chunk-MQSAHSED.js} +1 -1
- package/dist/esm/{chunk-TNHN7OQT.js → chunk-WSQ6EEHO.js} +38 -38
- package/dist/esm/{health-check.types-C0QWDZeM.d.ts → health-check.types-C4vZDz5x.d.ts} +3 -2
- package/dist/esm/{index-D-DVHaDC.d.ts → index-D4Rt1gOC.d.ts} +2 -2
- package/dist/esm/index.d.ts +4 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal/index.d.ts +3 -3
- package/dist/esm/servers/express.d.ts +5 -5
- package/dist/esm/servers/express.js +1 -1
- package/dist/esm/servers/h3.d.ts +5 -5
- package/dist/esm/servers/h3.js +1 -1
- package/dist/esm/servers/lambda.d.ts +6 -6
- package/dist/esm/servers/lambda.js +1 -1
- package/dist/esm/servers/nest.d.ts +7 -7
- package/dist/esm/servers/nest.js +1 -1
- package/dist/esm/servers/next.d.ts +5 -5
- package/dist/esm/servers/next.js +1 -1
- package/dist/esm/servers/nuxt.d.ts +5 -5
- package/dist/esm/servers/nuxt.js +1 -1
- package/dist/esm/servers/remix.d.ts +5 -5
- package/dist/esm/servers/remix.js +1 -1
- package/dist/esm/servers/sveltekit.d.ts +5 -5
- package/dist/esm/servers/sveltekit.js +1 -1
- package/dist/esm/step-resolver.d.ts +11 -11
- package/dist/esm/step-resolver.js +1 -1
- package/dist/esm/{subscriber.types-c69nNiHL.d.ts → subscriber.types-CfRj4acH.d.ts} +1 -1
- package/dist/esm/validators.d.ts +1 -1
- package/dist/esm/validators.js +1 -1
- package/package.json +18 -18
- package/dist/esm/chunk-V7JTIDNT.js +0 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";var $s=Object.create;var Kt=Object.defineProperty;var js=Object.getOwnPropertyDescriptor;var Ys=Object.getOwnPropertyNames;var Ws=Object.getPrototypeOf,Vs=Object.prototype.hasOwnProperty;var Bs=(c,r)=>{for(var n in r)Kt(c,n,{get:r[n],enumerable:!0})},Oi=(c,r,n,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let w of Ys(r))!Vs.call(c,w)&&w!==n&&Kt(c,w,{get:()=>r[w],enumerable:!(l=js(r,w))||l.enumerable});return c};var et=(c,r,n)=>(n=c!=null?$s(Ws(c)):{},Oi(r||!c||!c.__esModule?Kt(n,"default",{value:c,enumerable:!0}):n,c)),qs=c=>Oi(Kt({},"__esModule",{value:!0}),c);var el={};Bs(el,{Client:()=>St,CronExpression:()=>cr,NovuRequestHandler:()=>Cn,SeverityLevelEnum:()=>$n,providerSchemas:()=>Ln,step:()=>xo,workflow:()=>Po});module.exports=qs(el);var Qi=require("jsonrepair");var Pt=(l=>(l.TRIGGER="trigger",l.EXECUTE="execute",l.PREVIEW="preview",l))(Pt||{}),Ht=(l=>(l.DISCOVER="discover",l.HEALTH_CHECK="health-check",l.CODE="code",l))(Ht||{});var cr=(F=>(F.EVERY_SECOND="* * * * * *",F.EVERY_5_SECONDS="*/5 * * * * *",F.EVERY_10_SECONDS="*/10 * * * * *",F.EVERY_30_SECONDS="*/30 * * * * *",F.EVERY_MINUTE="*/1 * * * *",F.EVERY_5_MINUTES="0 */5 * * * *",F.EVERY_10_MINUTES="0 */10 * * * *",F.EVERY_30_MINUTES="0 */30 * * * *",F.EVERY_HOUR="0 0-23/1 * * *",F.EVERY_2_HOURS="0 0-23/2 * * *",F.EVERY_3_HOURS="0 0-23/3 * * *",F.EVERY_4_HOURS="0 0-23/4 * * *",F.EVERY_5_HOURS="0 0-23/5 * * *",F.EVERY_6_HOURS="0 0-23/6 * * *",F.EVERY_7_HOURS="0 0-23/7 * * *",F.EVERY_8_HOURS="0 0-23/8 * * *",F.EVERY_9_HOURS="0 0-23/9 * * *",F.EVERY_10_HOURS="0 0-23/10 * * *",F.EVERY_11_HOURS="0 0-23/11 * * *",F.EVERY_12_HOURS="0 0-23/12 * * *",F.EVERY_DAY_AT_1AM="0 01 * * *",F.EVERY_DAY_AT_2AM="0 02 * * *",F.EVERY_DAY_AT_3AM="0 03 * * *",F.EVERY_DAY_AT_4AM="0 04 * * *",F.EVERY_DAY_AT_5AM="0 05 * * *",F.EVERY_DAY_AT_6AM="0 06 * * *",F.EVERY_DAY_AT_7AM="0 07 * * *",F.EVERY_DAY_AT_8AM="0 08 * * *",F.EVERY_DAY_AT_9AM="0 09 * * *",F.EVERY_DAY_AT_10AM="0 10 * * *",F.EVERY_DAY_AT_11AM="0 11 * * *",F.EVERY_DAY_AT_NOON="0 12 * * *",F.EVERY_DAY_AT_1PM="0 13 * * *",F.EVERY_DAY_AT_2PM="0 14 * * *",F.EVERY_DAY_AT_3PM="0 15 * * *",F.EVERY_DAY_AT_4PM="0 16 * * *",F.EVERY_DAY_AT_5PM="0 17 * * *",F.EVERY_DAY_AT_6PM="0 18 * * *",F.EVERY_DAY_AT_7PM="0 19 * * *",F.EVERY_DAY_AT_8PM="0 20 * * *",F.EVERY_DAY_AT_9PM="0 21 * * *",F.EVERY_DAY_AT_10PM="0 22 * * *",F.EVERY_DAY_AT_11PM="0 23 * * *",F.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",F.EVERY_WEEK="0 0 * * 0",F.EVERY_WEEKDAY="0 0 * * 1-5",F.EVERY_WEEKEND="0 0 * * 6,0",F.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",F.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",F.EVERY_2ND_DAY_OF_MONTH_AT_10AM="0 10 2 * *",F.EVERY_2ND_HOUR="0 */2 * * *",F.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",F.EVERY_2ND_MONTH="0 0 1 */2 *",F.EVERY_QUARTER="0 0 1 */3 *",F.EVERY_6_MONTHS="0 0 1 */6 *",F.EVERY_YEAR="0 0 1 0 *",F.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",F.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",F.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",F.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",F.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",F.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",F.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",F.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",F.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",F.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",F.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",F.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",F.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",F.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",F.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",F.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",F.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",F.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",F.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",F.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",F.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",F.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",F.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",F.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",F.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",F.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",F.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",F.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5",F))(cr||{});var We=(ce=>(ce.BRIDGE_ERROR="BridgeError",ce.EXECUTION_EVENT_CONTROL_INVALID_ERROR="ExecutionEventControlInvalidError",ce.EXECUTION_EVENT_PAYLOAD_INVALID_ERROR="ExecutionEventPayloadInvalidError",ce.EXECUTION_PROVIDER_OUTPUT_INVALID_ERROR="ExecutionProviderOutputInvalidError",ce.EXECUTION_STATE_CONTROL_INVALID_ERROR="ExecutionStateControlInvalidError",ce.EXECUTION_STATE_CORRUPT_ERROR="ExecutionStateCorruptError",ce.EXECUTION_STATE_OUTPUT_INVALID_ERROR="ExecutionStateOutputInvalidError",ce.EXECUTION_STATE_RESULT_INVALID_ERROR="ExecutionStateResultInvalidError",ce.INVALID_ACTION_ERROR="InvalidActionError",ce.METHOD_NOT_ALLOWED_ERROR="MethodNotAllowedError",ce.MISSING_DEPENDENCY_ERROR="MissingDependencyError",ce.MISSING_SECRET_KEY_ERROR="MissingSecretKeyError",ce.PROVIDER_EXECUTION_FAILED_ERROR="ProviderExecutionFailedError",ce.PROVIDER_NOT_FOUND_ERROR="ProviderNotFoundError",ce.SIGNATURE_EXPIRED_ERROR="SignatureExpiredError",ce.SIGNATURE_INVALID_ERROR="SignatureInvalidError",ce.SIGNATURE_MISMATCH_ERROR="SignatureMismatchError",ce.SIGNATURE_NOT_FOUND_ERROR="SignatureNotFoundError",ce.SIGNATURE_VERSION_INVALID_ERROR="SignatureVersionInvalidError",ce.SIGNING_KEY_NOT_FOUND_ERROR="SigningKeyNotFoundError",ce.STEP_ALREADY_EXISTS_ERROR="StepAlreadyExistsError",ce.STEP_CONTROL_COMPILATION_FAILED_ERROR="StepControlCompilationFailedError",ce.STEP_EXECUTION_FAILED_ERROR="StepExecutionFailedError",ce.STEP_NOT_FOUND_ERROR="StepNotFoundError",ce.WORKFLOW_ALREADY_EXISTS_ERROR="WorkflowAlreadyExistsError",ce.WORKFLOW_NOT_FOUND_ERROR="WorkflowNotFoundError",ce.WORKFLOW_PAYLOAD_INVALID_ERROR="WorkflowPayloadInvalidError",ce))(We||{});var zt=(l=>(l.POST="POST",l.GET="GET",l.OPTIONS="OPTIONS",l))(zt||{});var Js=c=>{var n,l;if(typeof c!="object"||c===null)return!1;let r=Object.getPrototypeOf(c);return(l=(n=r==null?void 0:r.constructor)==null?void 0:n.name.endsWith("Error"))!=null?l:!1},tt=class extends Error{},Xt=class extends tt{constructor(){super(...arguments);this.statusCode=404}},Ue=class extends tt{constructor(){super(...arguments);this.statusCode=400}},ot=class extends tt{constructor(){super(...arguments);this.statusCode=401}},st=class extends tt{constructor(r,{cause:n}={}){var l;Js(n)?(super(`${r}: ${n.message}`),this.data={stack:(l=n.stack)!=null?l:r}):(super(`${r}${n?`: ${JSON.stringify(n,null,2)}`:""}`),this.data={stack:r})}},Qt=class extends tt{constructor(){super(...arguments);this.statusCode=409}};var mt=class extends st{constructor(n){super("Unknown BridgeError",{cause:n});this.statusCode=500;this.code="BridgeError"}};var Zt=class extends Ue{constructor(n,l){super(`Workflow with id: \`${n}\` has a corrupt state. Step with id: \`${l}\` does not exist. Please provide the missing state.`);this.code="ExecutionStateCorruptError";this.data={workflowId:n,stepId:l}}},It=class extends Ue{constructor(n,l){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct event payload.`);this.code="ExecutionEventPayloadInvalidError";this.data=l}},en=class extends Ue{constructor(n,l){super(`Workflow with id: \`${n}\` has invalid \`controls\`. Please provide the correct event controls.`);this.code="ExecutionEventControlInvalidError";this.data=l}},tn=class extends Ue{constructor(n,l,w){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${l}\` has invalid \`controls\`. Please provide the correct step controls.`);this.code="ExecutionStateControlInvalidError";this.data=w}},nn=class extends Ue{constructor(n,l,w){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${l}\` has invalid output. Please provide the correct step output.`);this.code="ExecutionStateOutputInvalidError";this.data=w}},rn=class extends Ue{constructor(n,l,w){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${l}\` has invalid result. Please provide the correct step result.`);this.code="ExecutionStateResultInvalidError";this.data=w}},on=class extends Ue{constructor(n,l,w){super(`Workflow with id: \`${n}\` has invalid controls syntax in step with id: \`${l}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=w}},sn=class extends Ue{constructor(n,l,w,U){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${l}\` and provider with id: \`${w}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=U}},an=class extends Ue{constructor(n,l){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct payload.`);this.code="WorkflowPayloadInvalidError";this.data=l}};var lt=c=>Object.values(We).includes(c==null?void 0:c.code),vi=c=>!lt(c)&&typeof c.statusCode=="number"&&c.statusCode>=400&&c.statusCode<500;var pr=c=>Object.values(c).map(r=>`\`${r}\``).join(", "),ln=c=>c.replaceAll(/(\w)(\w*)/g,(r,n,l)=>n.toUpperCase()+l.toLowerCase()).replaceAll(/[\s-]+/g,"");var cn=class extends tt{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${pr(zt)}`}},Nt=class extends Ue{constructor(n,l){super(`Invalid query string: \`action\`=\`${n}\`. Please use one of ${pr(l)}`);this.code="InvalidActionError"}},pn=class extends Ue{constructor(){super("Missing secret key. Set the `NOVU_SECRET_KEY` environment variable or pass `secretKey` to the client options.");this.code="MissingSecretKeyError"}};var un=class extends Error{constructor(r,n,l){super(),this.data={message:l},this.statusCode=r,this.code=n}};var kt=class extends Qt{constructor(r,n){super(`${ln(r)} with id: \`${n}\` already exists. Please use a different id.`)}},at=class extends Xt{constructor(r,n){super(`${ln(r)} with id: \`${n}\` does not exist. Please provide a valid id.`)}},yt=class extends st{constructor(n,l,w,U){super(`Failed to ${w} ${ln(n)} with id: \`${l}\``,{cause:U});this.statusCode=502}};var dn=class extends at{constructor(n){super("provider",n);this.code="ProviderNotFoundError"}},fn=class extends yt{constructor(n,l,w){super("provider",n,l,w);this.code="ProviderExecutionFailedError"}};var hn=class extends ot{constructor(){super("Signature does not match the expected signature. Please ensure the signature provided in the `novu-signature` header is correct and try again.");this.code="SignatureMismatchError"}},mn=class extends ot{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},yn=class extends ot{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},gn=class extends ot{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},Sn=class extends ot{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var wn=class extends at{constructor(n){super("step",n);this.code="StepNotFoundError"}},bn=class extends kt{constructor(n){super("step",n);this.code="StepAlreadyExistsError"}},Ct=class extends yt{constructor(n,l,w){super("step",n,l,w);this.code="StepExecutionFailedError"}};var Mt=class extends at{constructor(n){super("workflow",n);this.code="WorkflowNotFoundError"}};var Tn=(()=>{var c=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,w=(e,t)=>function(){return e&&(t=(0,e[n(e)[0]])(e=0)),t},U=(e,t)=>function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports},C=(e,t)=>{for(var i in t)c(e,i,{get:t[i],enumerable:!0})},z=(e,t,i,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of n(t))!l.call(e,u)&&u!==i&&c(e,u,{get:()=>t[u],enumerable:!(p=r(t,u))||p.enumerable});return e},re=e=>z(c({},"__esModule",{value:!0}),e),we={};C(we,{JSONSchemaFaker:()=>bi,default:()=>Ti,setDependencies:()=>Lr});function Pe(e,t){return typeof e=="string"?typeof t!="undefined"?vt.register(e,t):vt.get(e):vt.registerMany(e)}function ke(e,t){return e=typeof e=="undefined"?He.MIN_INTEGER:e,t=typeof t=="undefined"?He.MAX_INTEGER:t,Math.floor(te("random")()*(t-e+1))+e}function be(e){return Yt.default.prototype.max=te("defaultRandExpMax"),Yt.default.prototype.randInt=(i,p)=>i+Math.floor(te("random")()*(1+(p-i))),new Yt.default(e).gen()}function Ce(e){return e[Math.floor(te("random")()*e.length)]}function Fe(e){let t,i,p=e.length,u=e.slice();for(;p>0;)i=Math.floor(te("random")()*p),p-=1,t=u[p],u[p]=u[i],u[i]=t;return u}function rt(e,t){return te("random")()*(t-e)+e}function Ge(e,t,i,p,u=!1){return i=typeof i=="undefined"?He.MIN_NUMBER:i,p=typeof p=="undefined"?He.MAX_NUMBER:p,e=typeof e=="undefined"?i:e,t=typeof t=="undefined"?p:t,t<e&&(t+=e),u?rt(e,t):ke(e,t)}function Ft(e){switch(e){case"seconds":return Ge(0,60)*60;case"minutes":return Ge(15,50)*612;case"hours":return Ge(12,72)*36123;case"days":return Ge(7,30)*86412345;case"weeks":return Ge(4,52)*604812345;case"months":return Ge(2,13)*2592012345;case"years":return Ge(1,20)*31104012345;default:break}}function Yn(e){if(e)return Ft(e);let t=te("minDateTime"),i=te("maxDateTime");typeof t=="string"&&(t=new Date(t)),typeof i=="string"&&(i=new Date(i));let p=new Date().getTime();return typeof t=="number"&&(t=new Date(p+t)),typeof i=="number"&&(i=new Date(p+i)),new Date(rt(t.getTime(),i.getTime()))}function mr(e,t,i){if(t=decodeURIComponent(t),i&&i[t])return ce(i[t]);let p=t.replace("#/","/").split("/"),u=e.$ref&&i&&i[e.$ref]||e;for(!u&&!p[0]&&(p[0]=e.$ref.split("#/")[0]),i&&t.includes("#/")&&i[p[0]]&&(u=i[p.shift()]),p[0]||p.shift();u&&p.length>0;){let h=p.shift();if(!u[h])throw new Error(`Prop not found: ${h} (${t})`);u=u[h]}return u}function $t(e){return typeof e=="string"&&qr.test(e)}function Ke(e){return["number","boolean"].includes(typeof e)}function Be(e,...t){return t.filter(i=>typeof e[i]!="undefined").length>0}function yr(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,i,p]=e.split("T")[0].split("-");return i=`0${Math.max(1,Math.min(12,i))}`.slice(-2),p=`0${Math.max(1,Math.min(31,p))}`.slice(-2),`${t}-${i}-${p}`}function Io(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,i]=e.split("T"),[p,u,h]=t.split("-"),[f,O,D]=i.substr(0,8).split(":");return u=`0${Math.max(1,Math.min(12,u))}`.slice(-2),h=`0${Math.max(1,Math.min(31,h))}`.slice(-2),f=`0${Math.max(1,Math.min(23,f))}`.slice(-2),O=`0${Math.max(1,Math.min(59,O))}`.slice(-2),D=`0${Math.max(1,Math.min(59,D))}`.slice(-2),`${p}-${u}-${h}T${f}:${O}:${D}.000Z`}function No(e,t,i){let p={};switch(e||t.type){case"integer":case"number":if(typeof t.minimum!="undefined"&&(p.minimum=t.minimum),typeof t.maximum!="undefined"&&(p.maximum=t.maximum),t.enum){let h=Math.max(p.minimum||0,0),f=Math.min(p.maximum||1/0,1/0);t.exclusiveMinimum&&h===t.minimum&&(h+=t.multipleOf||1),t.exclusiveMaximum&&f===t.maximum&&(f-=t.multipleOf||1),(h||f!==1/0)&&(t.enum=t.enum.filter(O=>O>=h&&O<=f))}break;case"string":{p.minLength=te("minLength")||0,p.maxLength=te("maxLength")||Number.MAX_SAFE_INTEGER,typeof t.minLength!="undefined"&&(p.minLength=Math.max(p.minLength,t.minLength)),typeof t.maxLength!="undefined"&&(p.maxLength=Math.min(p.maxLength,t.maxLength));break}default:break}let u=i(p);if(u==null)return null;switch(e||t.type){case"number":u=$t(u)?parseFloat(u):u;break;case"integer":u=$t(u)?parseInt(u,10):u;break;case"boolean":u=!!u;break;case"string":{if(Ke(u))return u;u=String(u);let h=Math.max(p.minLength||0,0),f=Math.min(p.maxLength||1/0,1/0),O,D=0;for(;u.length<h;)if(O=u,t.pattern?u+=Z.randexp(t.pattern):u+=`${Z.pick([" ","/","_","-","+","=","@","^"])}${u}`,u===O){if(D+=1,D===3)break}else D=0;switch(u.length>f&&(u=u.substr(0,f)),t.format){case"date-time":case"datetime":u=new Date(Io(u)).toISOString().replace(/([0-9])0+Z$/,"$1Z");break;case"full-date":case"date":u=new Date(yr(u)).toISOString().substr(0,10);break;case"time":u=new Date(`1969-01-01 ${u}`).toISOString().substr(11);break;default:break}break}default:break}return u}function dt(e,t){return Object.keys(t).forEach(i=>{typeof t[i]!="object"||t[i]===null?e[i]=t[i]:Array.isArray(t[i])?(e[i]=e[i]||[],t[i].forEach((p,u)=>{e.type==="array"&&t.type==="array"?e[i][u]=dt(e[i][u]||{},p,!0):Array.isArray(e[i])&&e[i].indexOf(p)===-1&&e[i].push(p)})):typeof e[i]!="object"||e[i]===null||Array.isArray(e[i])?e[i]=dt({},t[i]):e[i]=dt(e[i],t[i])}),e}function ce(e,t=new Map){if(!e||typeof e!="object")return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let p=[];return t.set(e,p),p.push(...e.map(u=>ce(u,t))),p}let i={};return t.set(e,i),Object.keys(e).reduce((p,u)=>(p[u]=ce(e[u],t),p),i)}function ko(e){let t=JSON.stringify(e),i=JSON.stringify(e,null,2);return t.length>400?`${i.substr(0,400)}...`:i}function gr(){return Z.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function Co(e,t){if(e.enum)return e.enum.includes(t);if(e.const)return e.const===t}function Mo(e,t){let i=dt({},t);if(typeof e.minimum!="undefined"&&(i.maximum=e.minimum,i.exclusiveMaximum=!0),typeof e.maximum!="undefined"&&(i.minimum=e.maximum>i.maximum?0:e.maximum,i.exclusiveMinimum=!0),typeof e.minLength!="undefined"&&(i.maxLength=e.minLength),typeof e.maxLength!="undefined"&&(i.minLength=e.maxLength>i.maxLength?0:e.maxLength),e.type)i.type=Z.pick(He.SCALAR_TYPES.filter(p=>(Array.isArray(e.type)?e.type:[e.type]).every(h=>p==="number"||p==="integer"?h!=="number"&&h!=="integer":p!==h)));else if(e.enum){let p;do p=gr();while(e.enum.indexOf(p)!==-1);i.enum=[p]}return e.required&&i.properties&&e.required.forEach(p=>{delete i.properties[p]}),i}function Wn(e,t){let i=t.minimum!==void 0,p=t.maximum!==void 0;return(i||p)&&(!i||e>=t.minimum)&&(!p||e<=t.maximum)}function Lo(e,t){return!t.every(i=>Wn(e,i))}function Do(e,t){return t.reduce((p,u)=>p+(Wn(e,u)?1:0),0)===1}function Uo(e){return["enum","const","default","examples","required","definitions","items","properties"].includes(e)}function Fo(e,t){return Object.keys(e).filter(i=>!t.includes(i)).reduce((i,p)=>(Array.isArray(e[p])?i[p]=e[p].slice():i[p]=e[p]instanceof Object?dt({},e[p]):e[p],i),{})}function Sr(e,t){return Array.isArray(e)?e.map(i=>Sr(i,t)):(typeof e=="string"&&(e=e.replace(/#\{([\w.-]+)\}/g,(i,p)=>t[p])),e)}function Vn(e){return Object.prototype.toString.call(e)==="[object Object]"&&!Object.keys(e).length}function wr(e,t){t=t.items||t;let i=te("alwaysFakeOptionals"),p=Array.isArray(t.required)&&t.required.includes(e)||i,u=typeof t.thunk=="function"||t.additionalProperties&&typeof t.additionalProperties.thunk=="function";return!p&&!u}function Bn(e,t,i=!1){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(p=>Bn(p,t,!0)).filter(p=>typeof p!="undefined");if(Object.keys(e).forEach(p=>{if(Vn(e[p]))wr(p,t)&&delete e[p];else{let u=t;t&&t.properties&&t.properties[p]&&(u=t.properties[p]);let h=Bn(e[p],u);Vn(h)||(e[p]=h)}typeof e[p]=="undefined"&&delete e[p]}),!(!Object.keys(e).length&&i))return e}function $o(e){return(t,i,p,u)=>{let h=t,f=[];typeof t=="object"&&(h=Object.keys(t)[0],Array.isArray(t[h])?f=t[h]:f.push(t[h]));let O=h.split("."),D=e();for(;O.length>1;)D=D[O.shift()];return t=typeof D=="object"?D[O[0]]:D,typeof t=="function"&&(t=t.apply(D,f.map(T=>de.template(T,u)))),Object.prototype.toString.call(t)==="[object Object]"&&Object.keys(t).forEach(T=>{if(typeof t[T]=="function")throw new Error(`Cannot resolve value for '${p}: ${h}', given: ${t}`)}),t}}function jo(e,t){if(typeof e=="undefined")return ht.list();if(typeof e=="string")if(typeof t=="function")ht.register(e,t);else if(t===null||t===!1)ht.unregister(e);else return ht.get(e);else ht.registerMany(e)}function Yo(e,t,i){return Object.keys(e).filter(p=>{let u=Hr.indexOf(t)>-1;return i.indexOf(p)>-1&&!u}).length>0}function Wo(e,t){let i=Object.keys(At);for(let p=0;p<i.length;p+=1){let u=i[p],h=t[t.length-1];if(Yo(e,h,At[u]))return u}}function Vo(){return te("random")()>.5}function Bo(){return null}function qo(e,t,i,p,u,h){let f=[],O=[];function D($){let R=JSON.stringify($.value);return O.indexOf(R)===-1?(O.push(R),f.push($),!0):!1}t.forEach(D);let T=100;for(;f.length!==t.length&&(D(h(i.items||p,e,u))||(T-=1),!!T););return f}function Jo(e,t,i,p){let u=[];if(!(e.items||e.additionalItems)){if(de.hasProperties(e,"minItems","maxItems","uniqueItems")&&(e.minItems!==0||e.maxItems!==0))throw new Wt(`missing items for ${de.short(e)}`,t);return u}if(Array.isArray(e.items))return e.items.map((W,ae)=>{let Q=t.concat(["items",ae]);return p(W,Q,i)});let h=e.minItems,f=e.maxItems,O=te("minItems"),D=te("maxItems");O&&(h=typeof h=="undefined"?O:Math.min(O,h)),D&&(f=typeof f=="undefined"?D:Math.min(D,f),f&&f>D&&(f=D),h&&h>D&&(h=f));let T=te("alwaysFakeOptionals")===!0?1:te("optionalsProbability"),$=te("alwaysFakeOptionals")||te("fixedProbabilities")||!1,R=Z.number(h,f,1,5);T!==null&&(R=Math.max($?Math.round((f||R)*T):Math.abs(Z.number(h,f)*T),h||0));let J=typeof e.additionalItems=="object"?e.additionalItems:{};for(let W=u.length;W<R;W+=1){let ae=t.concat(["items",W]),Q=p(e.items||J,ae,i);u.push(Q)}if(e.contains&&R>0){let W=Z.number(0,R-1);u[W]=p(e.contains,t.concat(["items",W]),i)}return e.uniqueItems?qo(t.concat(["items"]),u,e,J,i,p):u}function Go(e){let t=typeof e.minimum=="undefined"||e.minimum===-Number.MAX_VALUE?He.MIN_INTEGER:e.minimum,i=typeof e.maximum=="undefined"||e.maximum===Number.MAX_VALUE?He.MAX_INTEGER:e.maximum,p=e.multipleOf,u=p&&String(p).match(/e-(\d)|\.(\d+)$/);if(u){let h=(Math.random()*Z.number(0,10)+1)*p,f=u[1]||u[2].length,O=parseFloat(h.toFixed(f)),D=Z.number(t,i-1);return String(O).includes(".")?D+O:(D+O).toExponential()}if(p&&(i=Math.floor(i/p)*p,t=Math.ceil(t/p)*p),e.exclusiveMinimum&&t===e.minimum&&(t+=p||1),e.exclusiveMaximum&&i===e.maximum&&(i-=p||1),t>i)return NaN;if(p){let h=Z.number(Math.floor(t/p),Math.floor(i/p))*p;for(;h<t;)h+=p;return h}return Z.number(t,i,void 0,void 0,e.type!=="integer")}function Ko(e){return Math.floor(ir({...e}))}function Ho(e){return Z.shuffle(oi).slice(0,e)}function zo(e,t,i,p){let u={},h=e.properties||{},f=e.patternProperties||{},O=typeof e.required=="boolean"?[]:(e.required||[]).slice(),D=e.additionalProperties!==!1,T=Object.keys(h),$=Object.keys(f),R=T.concat($).reduce((Y,m)=>(O.indexOf(m)===-1&&Y.push(m),Y),[]),J=O.concat(R),W=D&&e.additionalProperties===!0?Bt:e.additionalProperties;if(!D&&T.length===0&&$.length===0&&de.hasProperties(e,"minProperties","maxProperties","dependencies","required"))return null;if(te("requiredOnly")===!0)return O.forEach(Y=>{h[Y]&&(u[Y]=h[Y])}),p(u,t.concat(["properties"]),i,e);let ae=te("alwaysFakeOptionals")===!0?1:te("optionalsProbability"),Q=te("alwaysFakeOptionals")||te("fixedProbabilities")||!1,ne=te("ignoreProperties")||[],he=te("reuseProperties"),ye=te("fillProperties"),j=e.maxProperties||J.length+(D?Z.number(1,5):0),S=Math.max(e.minProperties||0,O.length),b=Math.max(0,J.length-S);J.length===1&&!O.length&&(S=Math.max(Z.number(ye?1:0,j),S)),ae!==null&&(Q===!0?b=Math.round(S-O.length+ae*(J.length-S)):b=Z.number(S-O.length,ae*(J.length-S)));let _=Z.shuffle(R).slice(0,b),x=R.filter(Y=>_.indexOf(Y)!==-1),M=ae!==null||O.length===j?j:Z.number(0,j),E=O.concat(Z.shuffle(x).slice(0,M)).slice(0,j),I=[],k=[];if(e.dependencies&&(Object.keys(e.dependencies).forEach(Y=>{let m=e.dependencies[Y];if(E.indexOf(Y)!==-1)if(Array.isArray(m))m.forEach(N=>{E.indexOf(N)===-1&&E.push(N)});else if(Array.isArray(m.oneOf||m.anyOf)){let N=m.oneOf||m.anyOf;k.push({prop:Y,values:N})}else I.push(m)}),I.length))return delete e.dependencies,p({allOf:I.concat(e)},t.concat(["properties"]),i,e);let V=[],G=[];E.forEach(Y=>{if(h[Y]&&["{}","true"].includes(JSON.stringify(h[Y].not)))return;for(let N=0;N<ne.length;N+=1)if(ne[N]instanceof RegExp&&ne[N].test(Y)||typeof ne[N]=="string"&&ne[N]===Y||typeof ne[N]=="function"&&ne[N](h[Y],Y)){V.push(Y);return}W===!1&&O.indexOf(Y)!==-1&&(u[Y]=h[Y]),h[Y]&&(u[Y]=h[Y]);let m;if($.forEach(N=>{Y.match(new RegExp(N))&&(m=!0,u[Y]?de.merge(u[Y],f[N]):u[Z.randexp(Y)]=f[N])}),!m){let N=f[Y]||W;N&&W!==!1?u[f[Y]?Z.randexp(Y):Y]=h[Y]||N:G.push(Y)}});let ee=Object.keys(u).length+(ye?0:V.length),ve=Y=>Z.randexp(`_?[_a-f\\d]{1,3}${Y?"\\$?":""}`);function Ae(Y){let m;do{if(!Y.length)break;m=Y.shift()}while(u[m]);return m}let Ee=S;if(D&&!O.length&&(Ee=Math.max(ae===null||W?Z.number(ye?1:0,j):0,S)),!x.length&&!b&&D&&Q===!0&&ye){let Y=Z.number(0,j);for(let m=0;m<Y;m+=1)u[Vt(1)+ve(Y[m])]=W||Bt}for(;ye&&!(!($.length||D)||ee>=Ee);){if(D)if(he&&T.length-ee>Ee){let Y=0,m;do{if(Y+=1,Y>1e3)break;m=Ae(O)||Z.pick(T)}while(typeof u[m]!="undefined");typeof u[m]=="undefined"&&(u[m]=h[m],ee+=1)}else if($.length&&!W){let Y=Z.pick($),m=Z.randexp(Y);u[m]||(u[m]=f[Y],ee+=1)}else{let Y=Ae(O)||Vt(1)+ve();u[Y]||(u[Y]=W||Bt,ee+=1)}for(let Y=0;ee<S&&Y<$.length;Y+=1){let m=$[Y],N=Z.randexp(m);u[N]||(u[N]=f[m],ee+=1)}}if(O.length===0&&(!D||ae===!1)){let Y=Z.number(S,j);for(;ee<Y;){let m=Ae(T);m&&(u[m]=h[m]),ee+=1}}let xe=u;if(te("sortProperties")!==null){let Y=Object.keys(h);xe=Object.keys(u).sort((N,K)=>te("sortProperties")?N.localeCompare(K):Y.indexOf(N)-Y.indexOf(K)).reduce((N,K)=>(N[K]=u[K],N),{})}let Me=p(xe,t.concat(["properties"]),i,e);return k.forEach(Y=>{for(let m of Y.values)if(de.hasValue(m.properties[Y.prop],Me.value[Y.prop])){Object.keys(m.properties).forEach(N=>{N!==Y.prop&&de.merge(Me.value,p(m.properties,t.concat(["properties"]),i,e).value)});break}}),Me}function br(){let e=Z.number(1,5);return Vt(e).join(" ")}function Xo(e=0,t=140){let i=Math.max(0,e),p=Z.number(i,t),u=br();for(;u.length<i;)u+=br();return u.length>p&&(u=u.substr(0,p)),u}function Qo(){return[0,0,0,0].map(()=>Z.number(0,255)).join(".")}function Zo(){return Z.date().toISOString()}function es(){return qt().slice(0,10)}function ts(){return qt().slice(11)}function ns(e){return Z.randexp(je[e]).replace(ui,(t,i)=>Z.randexp(je[i]))}function rs(e,t){let i=rr(e.format);if(typeof i=="function")return i(e);switch(e.format){case"date-time":case"datetime":return qt();case"date":return li();case"time":return ci();case"ipv4":return ai();case"regex":return".+?";case"email":case"hostname":case"ipv6":case"uri":case"uri-reference":case"iri":case"iri-reference":case"idn-email":case"idn-hostname":case"json-pointer":case"slug":case"uri-template":case"uuid":case"duration":return di(e.format);default:if(typeof i=="undefined"){if(te("failOnInvalidFormat"))throw new Error(`unknown registry key ${de.short(e.format)}`);return t()}throw new Error(`unsupported format '${e.format}'`)}}function is(e){return de.typecast("string",e,i=>e.format?rs(e,()=>or(i.minLength,i.maxLength)):e.pattern?Z.randexp(e.pattern):or(i.minLength,i.maxLength))}function os({$comment:e,title:t,description:i}){return Object.entries({comment:e,title:t,description:i}).filter(([,p])=>p).reduce((p,[u,h])=>(p[u]=h,p),{})}function ft(e,t,i,p){if(e=i(e,null,t),e&&(e.oneOf||e.anyOf||e.allOf)&&(e=i(e,null,t)),!e)throw new Error(`Cannot traverse at '${t.join(".")}', given '${JSON.stringify(p)}'`);let u={...os(e),schemaPath:t};if(t[t.length-1]!=="properties"){if(te("useExamplesValue")&&Array.isArray(e.examples)){let T=e.examples.concat("default"in e?[e.default]:[]);return{value:de.typecast(null,e,()=>Z.pick(T)),context:u}}if(te("useExamplesValue")&&typeof e.example!="undefined")return{value:de.typecast(null,e,()=>e.example),context:u};if(te("useDefaultValue")&&"default"in e&&(e.default!==""||!te("replaceEmptyByRandomValue")))return{value:e.default,context:u};if("template"in e)return{value:de.template(e.template,p),context:u};if("const"in e)return{value:e.const,context:u}}if(e.not&&typeof e.not=="object"&&(e=de.notValue(e.not,de.omitProps(e,["not"])),e.type&&e.type==="object")){let{value:T,context:$}=ft(e,t.concat(["not"]),i,p);return{value:de.clean(T,e,!1),context:{...u,items:$}}}if(typeof e.thunk=="function"){let{value:T,context:$}=ft(e.thunk(p),t,i);return{value:T,context:{...u,items:$}}}if(e.jsonPath)return{value:e,context:u};let h=e.type;if(Array.isArray(h)?h=Z.pick(h):typeof h=="undefined"&&(h=zr(e,t)||h,h&&(e.type=h)),typeof e.generate=="function"){let T=de.typecast(null,e,()=>e.generate(p,t)),$=T===null?"null":typeof T;if($===h||$==="number"&&h==="integer"||Array.isArray(T)&&h==="array")return{value:T,context:u}}if(typeof e.pattern=="string")return{value:de.typecast("string",e,()=>Z.randexp(e.pattern)),context:u};if(Array.isArray(e.enum))return{value:de.typecast(null,e,()=>Z.pick(e.enum)),context:u};if(typeof h=="string")if(Rt[h])try{let T=Rt[h](e,t,i,ft);return h==="array"?{value:T.map(({value:$})=>$),context:{...u,items:T.map(Array.isArray(e.items)?({context:$})=>$:({context:$})=>({...$,schemaPath:$.schemaPath.slice(0,-1)}))}}:h==="object"?T!==null?{value:T.value,context:{...u,items:T.context}}:{value:{},context:u}:{value:T,context:u}}catch(T){throw typeof T.path=="undefined"?new Wt(T.stack,t):T}else{if(te("failOnInvalidTypes"))throw new Wt(`unknown primitive ${de.short(h)}`,t.concat(["type"]));{let T=te("defaultInvalidTypeProduct");return typeof T=="string"&&Rt[T]?{value:Rt[T](e,t,i,ft),context:u}:{value:T,context:u}}}let f={},O={...u};Array.isArray(e)&&(f=[]);let D=te("pruneProperties")||[];return Object.keys(e).forEach(T=>{if(!D.includes(T)&&e[T]!==null)if(typeof e[T]=="object"&&T!=="definitions"){let{value:$,context:R}=ft(e[T],t.concat([T]),i,f);f[T]=de.clean($,e[T],!1),O[T]=R,f[T]===null&&te("omitNulls")&&(delete f[T],delete O[T])}else f[T]=e[T]}),{value:f,context:O}}function ss(e){return Array.isArray(e)?Z.pick(e):e}function as(e,t){if(!Array.isArray(e))return e;let i=t?e.pop():e.shift();return t?e.unshift(i):e.push(i),i}function qn(e,t,i,p){if(!e||typeof e!="object")return e;if(i||(i={}),t||(t=e),Array.isArray(e))return e.map(u=>qn(u,t,i,p));if(e.jsonPath){let{JSONPath:u}=Qn(),h=typeof e.jsonPath!="object"?{path:e.jsonPath}:e.jsonPath;h.group=e.group||h.group||p,h.cycle=e.cycle||h.cycle||!1,h.reverse=e.reverse||h.reverse||!1,h.count=e.count||h.count||1;let f=`${h.group}__${h.path}`;return i[f]||(h.count>1?i[f]=u(h.path,t).slice(0,h.count):i[f]=u(h.path,t)),h.cycle||h.reverse?as(i[f],h.reverse):ss(i[f])}return Object.keys(e).forEach(u=>{e[u]=qn(e[u],t,i,u)}),e}function ls(e,t,i,p){if(Object.prototype.toString.call(t)!=="[object Object]")throw new Error(`Invalid input, expecting object but given ${typeof t}`);let u=te("refDepthMin")||0,h=te("refDepthMax")||3;try{let{resolveSchema:f}=gi({refs:e,schema:t,container:i,synchronous:p,refDepthMin:u,refDepthMax:h}),O=mi(de.clone(t),[],f);return te("resolveJsonPath")?{value:qn(O.value),context:O.context}:O}catch(f){throw f.path?new Error(`${f.message} in /${f.path.join("/")}`):f}}function cs(e){return e.value}function ps(e,t){return t.reduce((i,p)=>p in i?i[p]:{},e)}function Jn(e,t,i,p=i){let{title:u,description:h,comment:f}=ps(e,t),O=[];te("renderTitle")&&u&&O.push(` ${u}`,""),te("renderDescription")&&h&&O.push(` ${h}`),te("renderComment")&&f&&O.push(` ${f}`),i.commentBefore=O.join(`
|
|
2
|
-
`),p instanceof Si?p.items.forEach(D=>{Jn(e,[...t,"items",D.key.value],D.key,D.value)}):p instanceof wi&&p.items.forEach((D,T)=>{Jn(e,[...t,"items",T],D)})}function us({value:e,context:t}){let i=Et.createNode(e);Jn(t,[],i);let p=new Et.Document;return p.contents=i,p.toString()}function Tr(){Xe.define("autoIncrement",function(t,i){if(!this.offset){let p=i.minimum||1,u=p+He.MAX_NUMBER,h=t.initialOffset||i.initialOffset;this.offset=h||Z.number(p,u)}return t?this.offset++:i}),Xe.define("sequentialDate",function(t,i){if(this.now||(this.now=Z.date()),t){if(i=this.now.toISOString(),t=t===!0?"days":t,["seconds","minutes","hours","days","weeks","months","years"].indexOf(t)===-1)throw new Error(`Unsupported increment by ${de.short(t)}`);this.now.setTime(this.now.getTime()+Z.date(t))}return i})}function Or(e,t){let i={};Array.isArray(e)?e.forEach(u=>{i[u.$id||u.id]=u}):i=e||{};function p(u){if(!u||typeof u!="object")return;if(Array.isArray(u))return u.forEach(p);let h=u.$id||u.id;typeof h=="string"&&!i[h]&&(i[h]=u),Object.keys(u).forEach(f=>{p(u[f])})}return p(e),p(t),i}var vr,Gn,Ar,Kn,Rr,Er,$e,_r,Hn,Tt,F,Pr,xr,Ir,Nr,kr,Ot,jt,zn,Cr,Mr,Xn,Qn,Lr,Dr,Zn,ue,er,Ur,Fr,vt,te,tr,nr,$r,jr,Yr,Wr,Vr,Br,He,Yt,Z,qr,de,Jr,Gr,ht,rr,Kr,Wt,At,Hr,zr,Xr,Qr,Zr,ei,ti,ni,ri,ir,ii,oi,Vt,Bt,si,or,ai,qt,li,ci,sr,Jt,pi,je,ui,di,fi,hi,Rt,mi,yi,gi,ar,lr,Le,ds,fs,hs,ms,ys,gs,Ss,ws,bs,Ts,Os,vs,Si,wi,Et,Xe,Oe,bi,Ti,As=w({"src/shared.js"(){vr=Object.create,Gn=Object.defineProperty,Ar=Object.getOwnPropertyDescriptor,Kn=Object.getOwnPropertyNames,Rr=Object.getPrototypeOf,Er=Object.prototype.hasOwnProperty,$e=(e,t)=>function(){return t||(0,e[Kn(e)[0]])((t={exports:{}}).exports,t),t.exports},_r=(e,t,i,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Kn(t))!Er.call(e,u)&&u!==i&&Gn(e,u,{get:()=>t[u],enumerable:!(p=Ar(t,u))||p.enumerable});return e},Hn=(e,t,i)=>(i=e!=null?vr(Rr(e)):{},_r(t||!e||!e.__esModule?Gn(i,"default",{value:e,enumerable:!0}):i,e)),Tt=$e({"node_modules/ret/lib/types.js"(e,t){t.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}}}),F=$e({"node_modules/ret/lib/sets.js"(e){var t=Tt(),i=()=>[{type:t.RANGE,from:48,to:57}],p=()=>[{type:t.CHAR,value:95},{type:t.RANGE,from:97,to:122},{type:t.RANGE,from:65,to:90}].concat(i()),u=()=>[{type:t.CHAR,value:9},{type:t.CHAR,value:10},{type:t.CHAR,value:11},{type:t.CHAR,value:12},{type:t.CHAR,value:13},{type:t.CHAR,value:32},{type:t.CHAR,value:160},{type:t.CHAR,value:5760},{type:t.RANGE,from:8192,to:8202},{type:t.CHAR,value:8232},{type:t.CHAR,value:8233},{type:t.CHAR,value:8239},{type:t.CHAR,value:8287},{type:t.CHAR,value:12288},{type:t.CHAR,value:65279}],h=()=>[{type:t.CHAR,value:10},{type:t.CHAR,value:13},{type:t.CHAR,value:8232},{type:t.CHAR,value:8233}];e.words=()=>({type:t.SET,set:p(),not:!1}),e.notWords=()=>({type:t.SET,set:p(),not:!0}),e.ints=()=>({type:t.SET,set:i(),not:!1}),e.notInts=()=>({type:t.SET,set:i(),not:!0}),e.whitespace=()=>({type:t.SET,set:u(),not:!1}),e.notWhitespace=()=>({type:t.SET,set:u(),not:!0}),e.anyChar=()=>({type:t.SET,set:h(),not:!0})}}),Pr=$e({"node_modules/ret/lib/util.js"(e){var t=Tt(),i=F(),p="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",u={0:0,t:9,n:10,v:11,f:12,r:13};e.strToChars=h=>{var f=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return h=h.replace(f,(O,D,T,$,R,J,W,ae)=>{if(T)return O;var Q=D?8:$?parseInt($,16):R?parseInt(R,16):J?parseInt(J,8):W?p.indexOf(W):u[ae],ne=String.fromCharCode(Q);return/[[\]{}^$.|?*+()]/.test(ne)&&(ne="\\"+ne),ne}),h},e.tokenizeClass=(h,f)=>{for(var O=[],D=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,T,$;(T=D.exec(h))!=null;)if(T[1])O.push(i.words());else if(T[2])O.push(i.ints());else if(T[3])O.push(i.whitespace());else if(T[4])O.push(i.notWords());else if(T[5])O.push(i.notInts());else if(T[6])O.push(i.notWhitespace());else if(T[7])O.push({type:t.RANGE,from:(T[8]||T[9]).charCodeAt(0),to:T[10].charCodeAt(0)});else if($=T[12])O.push({type:t.CHAR,value:$.charCodeAt(0)});else return[O,D.lastIndex];e.error(f,"Unterminated character class")},e.error=(h,f)=>{throw new SyntaxError("Invalid regular expression: /"+h+"/: "+f)}}}),xr=$e({"node_modules/ret/lib/positions.js"(e){var t=Tt();e.wordBoundary=()=>({type:t.POSITION,value:"b"}),e.nonWordBoundary=()=>({type:t.POSITION,value:"B"}),e.begin=()=>({type:t.POSITION,value:"^"}),e.end=()=>({type:t.POSITION,value:"$"})}}),Ir=$e({"node_modules/ret/lib/index.js"(e,t){var i=Pr(),p=Tt(),u=F(),h=xr();t.exports=f=>{var O=0,D,T,$={type:p.ROOT,stack:[]},R=$,J=$.stack,W=[],ae=x=>{i.error(f,`Nothing to repeat at column ${x-1}`)},Q=i.strToChars(f);for(D=Q.length;O<D;)switch(T=Q[O++],T){case"\\":switch(T=Q[O++],T){case"b":J.push(h.wordBoundary());break;case"B":J.push(h.nonWordBoundary());break;case"w":J.push(u.words());break;case"W":J.push(u.notWords());break;case"d":J.push(u.ints());break;case"D":J.push(u.notInts());break;case"s":J.push(u.whitespace());break;case"S":J.push(u.notWhitespace());break;default:/\d/.test(T)?J.push({type:p.REFERENCE,value:parseInt(T,10)}):J.push({type:p.CHAR,value:T.charCodeAt(0)})}break;case"^":J.push(h.begin());break;case"$":J.push(h.end());break;case"[":{var ne;Q[O]==="^"?(ne=!0,O++):ne=!1;var he=i.tokenizeClass(Q.slice(O),f);O+=he[1],J.push({type:p.SET,set:he[0],not:ne});break}case".":J.push(u.anyChar());break;case"(":{var ye={type:p.GROUP,stack:[],remember:!0};T=Q[O],T==="?"&&(T=Q[O+1],O+=2,T==="="?ye.followedBy=!0:T==="!"?ye.notFollowedBy=!0:T!==":"&&i.error(f,`Invalid group, character '${T}' after '?' at column ${O-1}`),ye.remember=!1),J.push(ye),W.push(R),R=ye,J=ye.stack;break}case")":W.length===0&&i.error(f,`Unmatched ) at column ${O-1}`),R=W.pop(),J=R.options?R.options[R.options.length-1]:R.stack;break;case"|":{R.options||(R.options=[R.stack],delete R.stack);var j=[];R.options.push(j),J=j;break}case"{":{var S=/^(\d+)(,(\d+)?)?\}/.exec(Q.slice(O)),b,_;S!==null?(J.length===0&&ae(O),b=parseInt(S[1],10),_=S[2]?S[3]?parseInt(S[3],10):1/0:b,O+=S[0].length,J.push({type:p.REPETITION,min:b,max:_,value:J.pop()})):J.push({type:p.CHAR,value:123});break}case"?":J.length===0&&ae(O),J.push({type:p.REPETITION,min:0,max:1,value:J.pop()});break;case"+":J.length===0&&ae(O),J.push({type:p.REPETITION,min:1,max:1/0,value:J.pop()});break;case"*":J.length===0&&ae(O),J.push({type:p.REPETITION,min:0,max:1/0,value:J.pop()});break;default:J.push({type:p.CHAR,value:T.charCodeAt(0)})}return W.length!==0&&i.error(f,"Unterminated group"),$},t.exports.types=p}}),Nr=$e({"node_modules/drange/lib/index.js"(e,t){var i=class gt{constructor(h,f){this.low=h,this.high=f,this.length=1+f-h}overlaps(h){return!(this.high<h.low||this.low>h.high)}touches(h){return!(this.high+1<h.low||this.low-1>h.high)}add(h){return new gt(Math.min(this.low,h.low),Math.max(this.high,h.high))}subtract(h){return h.low<=this.low&&h.high>=this.high?[]:h.low>this.low&&h.high<this.high?[new gt(this.low,h.low-1),new gt(h.high+1,this.high)]:h.low<=this.low?[new gt(h.high+1,this.high)]:[new gt(this.low,h.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},p=class Lt{constructor(h,f){this.ranges=[],this.length=0,h!=null&&this.add(h,f)}_update_length(){this.length=this.ranges.reduce((h,f)=>h+f.length,0)}add(h,f){var O=D=>{for(var T=0;T<this.ranges.length&&!D.touches(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&D.touches(this.ranges[T]);)D=D.add(this.ranges[T]),T++;$.push(D),this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Lt?h.ranges.forEach(O):(f==null&&(f=h),O(new i(h,f))),this}subtract(h,f){var O=D=>{for(var T=0;T<this.ranges.length&&!D.overlaps(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&D.overlaps(this.ranges[T]);)$=$.concat(this.ranges[T].subtract(D)),T++;this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Lt?h.ranges.forEach(O):(f==null&&(f=h),O(new i(h,f))),this}intersect(h,f){var O=[],D=T=>{for(var $=0;$<this.ranges.length&&!T.overlaps(this.ranges[$]);)$++;for(;$<this.ranges.length&&T.overlaps(this.ranges[$]);){var R=Math.max(this.ranges[$].low,T.low),J=Math.min(this.ranges[$].high,T.high);O.push(new i(R,J)),$++}};return h instanceof Lt?h.ranges.forEach(D):(f==null&&(f=h),D(new i(h,f))),this.ranges=O,this._update_length(),this}index(h){for(var f=0;f<this.ranges.length&&this.ranges[f].length<=h;)h-=this.ranges[f].length,f++;return this.ranges[f].low+h}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new Lt(this)}numbers(){return this.ranges.reduce((h,f)=>{for(var O=f.low;O<=f.high;)h.push(O),O++;return h},[])}subranges(){return this.ranges.map(h=>({low:h.low,high:h.high,length:1+h.high-h.low}))}};t.exports=p}}),kr=$e({"node_modules/randexp/lib/randexp.js"(e,t){var i=Ir(),p=Nr(),u=i.types;t.exports=class Dt{constructor(f,O){if(this._setDefaults(f),f instanceof RegExp)this.ignoreCase=f.ignoreCase,this.multiline=f.multiline,f=f.source;else if(typeof f=="string")this.ignoreCase=O&&O.indexOf("i")!==-1,this.multiline=O&&O.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=i(f)}_setDefaults(f){this.max=f.max!=null?f.max:Dt.prototype.max!=null?Dt.prototype.max:100,this.defaultRange=f.defaultRange?f.defaultRange:this.defaultRange.clone(),f.randInt&&(this.randInt=f.randInt)}gen(){return this._gen(this.tokens,[])}_gen(f,O){var D,T,$,R,J;switch(f.type){case u.ROOT:case u.GROUP:if(f.followedBy||f.notFollowedBy)return"";for(f.remember&&f.groupNumber===void 0&&(f.groupNumber=O.push(null)-1),D=f.options?this._randSelect(f.options):f.stack,T="",R=0,J=D.length;R<J;R++)T+=this._gen(D[R],O);return f.remember&&(O[f.groupNumber]=T),T;case u.POSITION:return"";case u.SET:{var W=this._expand(f);return W.length?String.fromCharCode(this._randSelect(W)):""}case u.REPETITION:for($=this.randInt(f.min,f.max===1/0?f.min+this.max:f.max),T="",R=0;R<$;R++)T+=this._gen(f.value,O);return T;case u.REFERENCE:return O[f.value-1]||"";case u.CHAR:{var ae=this.ignoreCase&&this._randBool()?this._toOtherCase(f.value):f.value;return String.fromCharCode(ae)}}}_toOtherCase(f){return f+(97<=f&&f<=122?-32:65<=f&&f<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(f){return f instanceof p?f.index(this.randInt(0,f.length-1)):f[this.randInt(0,f.length-1)]}_expand(f){if(f.type===i.types.CHAR)return new p(f.value);if(f.type===i.types.RANGE)return new p(f.from,f.to);{let O=new p;for(let D=0;D<f.set.length;D++){let T=this._expand(f.set[D]);if(O.add(T),this.ignoreCase)for(let $=0;$<T.length;$++){let R=T.index($),J=this._toOtherCase(R);R!==J&&O.add(J)}}return f.not?this.defaultRange.clone().subtract(O):this.defaultRange.clone().intersect(O)}}randInt(f,O){return f+Math.floor(Math.random()*(1+O-f))}get defaultRange(){return this._range=this._range||new p(32,126)}set defaultRange(f){this._range=f}static randexp(f,O){var D;return typeof f=="string"&&(f=new RegExp(f,O)),f._randexp===void 0?(D=new Dt(f,O),f._randexp=D):(D=f._randexp,D._setDefaults(f)),D.gen()}static sugar(){RegExp.prototype.gen=function(){return Dt.randexp(this)}}}}}),Ot=$e({"node_modules/yaml/dist/PlainValue-ec8e588e.js"(e){var t={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},i={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},p="tag:yaml.org,2002:",u={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function h(j){let S=[0],b=j.indexOf(`
|
|
1
|
+
"use strict";var $s=Object.create;var Kt=Object.defineProperty;var js=Object.getOwnPropertyDescriptor;var Ys=Object.getOwnPropertyNames;var Ws=Object.getPrototypeOf,Vs=Object.prototype.hasOwnProperty;var Bs=(l,r)=>{for(var n in r)Kt(l,n,{get:r[n],enumerable:!0})},Oi=(l,r,n,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let w of Ys(r))!Vs.call(l,w)&&w!==n&&Kt(l,w,{get:()=>r[w],enumerable:!(p=js(r,w))||p.enumerable});return l};var et=(l,r,n)=>(n=l!=null?$s(Ws(l)):{},Oi(r||!l||!l.__esModule?Kt(n,"default",{value:l,enumerable:!0}):n,l)),qs=l=>Oi(Kt({},"__esModule",{value:!0}),l);var el={};Bs(el,{Client:()=>St,CronExpression:()=>cr,NovuRequestHandler:()=>kn,SeverityLevelEnum:()=>$n,providerSchemas:()=>Ln,step:()=>xo,workflow:()=>Po});module.exports=qs(el);var Qi=require("jsonrepair");var Pt=(p=>(p.TRIGGER="trigger",p.EXECUTE="execute",p.PREVIEW="preview",p))(Pt||{}),Ht=(p=>(p.DISCOVER="discover",p.HEALTH_CHECK="health-check",p.CODE="code",p))(Ht||{});var cr=(U=>(U.EVERY_SECOND="* * * * * *",U.EVERY_5_SECONDS="*/5 * * * * *",U.EVERY_10_SECONDS="*/10 * * * * *",U.EVERY_30_SECONDS="*/30 * * * * *",U.EVERY_MINUTE="*/1 * * * *",U.EVERY_5_MINUTES="0 */5 * * * *",U.EVERY_10_MINUTES="0 */10 * * * *",U.EVERY_30_MINUTES="0 */30 * * * *",U.EVERY_HOUR="0 0-23/1 * * *",U.EVERY_2_HOURS="0 0-23/2 * * *",U.EVERY_3_HOURS="0 0-23/3 * * *",U.EVERY_4_HOURS="0 0-23/4 * * *",U.EVERY_5_HOURS="0 0-23/5 * * *",U.EVERY_6_HOURS="0 0-23/6 * * *",U.EVERY_7_HOURS="0 0-23/7 * * *",U.EVERY_8_HOURS="0 0-23/8 * * *",U.EVERY_9_HOURS="0 0-23/9 * * *",U.EVERY_10_HOURS="0 0-23/10 * * *",U.EVERY_11_HOURS="0 0-23/11 * * *",U.EVERY_12_HOURS="0 0-23/12 * * *",U.EVERY_DAY_AT_1AM="0 01 * * *",U.EVERY_DAY_AT_2AM="0 02 * * *",U.EVERY_DAY_AT_3AM="0 03 * * *",U.EVERY_DAY_AT_4AM="0 04 * * *",U.EVERY_DAY_AT_5AM="0 05 * * *",U.EVERY_DAY_AT_6AM="0 06 * * *",U.EVERY_DAY_AT_7AM="0 07 * * *",U.EVERY_DAY_AT_8AM="0 08 * * *",U.EVERY_DAY_AT_9AM="0 09 * * *",U.EVERY_DAY_AT_10AM="0 10 * * *",U.EVERY_DAY_AT_11AM="0 11 * * *",U.EVERY_DAY_AT_NOON="0 12 * * *",U.EVERY_DAY_AT_1PM="0 13 * * *",U.EVERY_DAY_AT_2PM="0 14 * * *",U.EVERY_DAY_AT_3PM="0 15 * * *",U.EVERY_DAY_AT_4PM="0 16 * * *",U.EVERY_DAY_AT_5PM="0 17 * * *",U.EVERY_DAY_AT_6PM="0 18 * * *",U.EVERY_DAY_AT_7PM="0 19 * * *",U.EVERY_DAY_AT_8PM="0 20 * * *",U.EVERY_DAY_AT_9PM="0 21 * * *",U.EVERY_DAY_AT_10PM="0 22 * * *",U.EVERY_DAY_AT_11PM="0 23 * * *",U.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",U.EVERY_WEEK="0 0 * * 0",U.EVERY_WEEKDAY="0 0 * * 1-5",U.EVERY_WEEKEND="0 0 * * 6,0",U.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",U.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",U.EVERY_2ND_DAY_OF_MONTH_AT_10AM="0 10 2 * *",U.EVERY_2ND_HOUR="0 */2 * * *",U.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",U.EVERY_2ND_MONTH="0 0 1 */2 *",U.EVERY_QUARTER="0 0 1 */3 *",U.EVERY_6_MONTHS="0 0 1 */6 *",U.EVERY_YEAR="0 0 1 0 *",U.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",U.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",U.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",U.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",U.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",U.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",U.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",U.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",U.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",U.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",U.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",U.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",U.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",U.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",U.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",U.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",U.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",U.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",U.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",U.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",U.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",U.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",U.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",U.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",U.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",U.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",U.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",U.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5",U))(cr||{});var We=(ce=>(ce.BRIDGE_ERROR="BridgeError",ce.EXECUTION_EVENT_CONTROL_INVALID_ERROR="ExecutionEventControlInvalidError",ce.EXECUTION_EVENT_PAYLOAD_INVALID_ERROR="ExecutionEventPayloadInvalidError",ce.EXECUTION_PROVIDER_OUTPUT_INVALID_ERROR="ExecutionProviderOutputInvalidError",ce.EXECUTION_STATE_CONTROL_INVALID_ERROR="ExecutionStateControlInvalidError",ce.EXECUTION_STATE_CORRUPT_ERROR="ExecutionStateCorruptError",ce.EXECUTION_STATE_OUTPUT_INVALID_ERROR="ExecutionStateOutputInvalidError",ce.EXECUTION_STATE_RESULT_INVALID_ERROR="ExecutionStateResultInvalidError",ce.INVALID_ACTION_ERROR="InvalidActionError",ce.METHOD_NOT_ALLOWED_ERROR="MethodNotAllowedError",ce.MISSING_DEPENDENCY_ERROR="MissingDependencyError",ce.MISSING_SECRET_KEY_ERROR="MissingSecretKeyError",ce.PROVIDER_EXECUTION_FAILED_ERROR="ProviderExecutionFailedError",ce.PROVIDER_NOT_FOUND_ERROR="ProviderNotFoundError",ce.SIGNATURE_EXPIRED_ERROR="SignatureExpiredError",ce.SIGNATURE_INVALID_ERROR="SignatureInvalidError",ce.SIGNATURE_MISMATCH_ERROR="SignatureMismatchError",ce.SIGNATURE_NOT_FOUND_ERROR="SignatureNotFoundError",ce.SIGNATURE_VERSION_INVALID_ERROR="SignatureVersionInvalidError",ce.SIGNING_KEY_NOT_FOUND_ERROR="SigningKeyNotFoundError",ce.STEP_ALREADY_EXISTS_ERROR="StepAlreadyExistsError",ce.STEP_CONTROL_COMPILATION_FAILED_ERROR="StepControlCompilationFailedError",ce.STEP_EXECUTION_FAILED_ERROR="StepExecutionFailedError",ce.STEP_NOT_FOUND_ERROR="StepNotFoundError",ce.WORKFLOW_ALREADY_EXISTS_ERROR="WorkflowAlreadyExistsError",ce.WORKFLOW_NOT_FOUND_ERROR="WorkflowNotFoundError",ce.WORKFLOW_PAYLOAD_INVALID_ERROR="WorkflowPayloadInvalidError",ce))(We||{});var zt=(p=>(p.POST="POST",p.GET="GET",p.OPTIONS="OPTIONS",p))(zt||{});var Js=l=>{var n,p;if(typeof l!="object"||l===null)return!1;let r=Object.getPrototypeOf(l);return(p=(n=r==null?void 0:r.constructor)==null?void 0:n.name.endsWith("Error"))!=null?p:!1},tt=class extends Error{},Xt=class extends tt{constructor(){super(...arguments);this.statusCode=404}},Ue=class extends tt{constructor(){super(...arguments);this.statusCode=400}},ot=class extends tt{constructor(){super(...arguments);this.statusCode=401}},st=class extends tt{constructor(r,{cause:n}={}){var p;Js(n)?(super(`${r}: ${n.message}`),this.data={stack:(p=n.stack)!=null?p:r}):(super(`${r}${n?`: ${JSON.stringify(n,null,2)}`:""}`),this.data={stack:r})}},Qt=class extends tt{constructor(){super(...arguments);this.statusCode=409}};var mt=class extends st{constructor(n){super("Unknown BridgeError",{cause:n});this.statusCode=500;this.code="BridgeError"}};var Zt=class extends Ue{constructor(n,p){super(`Workflow with id: \`${n}\` has a corrupt state. Step with id: \`${p}\` does not exist. Please provide the missing state.`);this.code="ExecutionStateCorruptError";this.data={workflowId:n,stepId:p}}},It=class extends Ue{constructor(n,p){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct event payload.`);this.code="ExecutionEventPayloadInvalidError";this.data=p}},en=class extends Ue{constructor(n,p){super(`Workflow with id: \`${n}\` has invalid \`controls\`. Please provide the correct event controls.`);this.code="ExecutionEventControlInvalidError";this.data=p}},tn=class extends Ue{constructor(n,p,w){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${p}\` has invalid \`controls\`. Please provide the correct step controls.`);this.code="ExecutionStateControlInvalidError";this.data=w}},nn=class extends Ue{constructor(n,p,w){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${p}\` has invalid output. Please provide the correct step output.`);this.code="ExecutionStateOutputInvalidError";this.data=w}},rn=class extends Ue{constructor(n,p,w){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${p}\` has invalid result. Please provide the correct step result.`);this.code="ExecutionStateResultInvalidError";this.data=w}},on=class extends Ue{constructor(n,p,w){super(`Workflow with id: \`${n}\` has invalid controls syntax in step with id: \`${p}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=w}},sn=class extends Ue{constructor(n,p,w,F){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${p}\` and provider with id: \`${w}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=F}},an=class extends Ue{constructor(n,p){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct payload.`);this.code="WorkflowPayloadInvalidError";this.data=p}};var lt=l=>Object.values(We).includes(l==null?void 0:l.code),vi=l=>!lt(l)&&typeof l.statusCode=="number"&&l.statusCode>=400&&l.statusCode<500;var pr=l=>Object.values(l).map(r=>`\`${r}\``).join(", "),ln=l=>l.replaceAll(/(\w)(\w*)/g,(r,n,p)=>n.toUpperCase()+p.toLowerCase()).replaceAll(/[\s-]+/g,"");var cn=class extends tt{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${pr(zt)}`}},Nt=class extends Ue{constructor(n,p){super(`Invalid query string: \`action\`=\`${n}\`. Please use one of ${pr(p)}`);this.code="InvalidActionError"}},pn=class extends Ue{constructor(){super("Missing secret key. Set the `NOVU_SECRET_KEY` environment variable or pass `secretKey` to the client options.");this.code="MissingSecretKeyError"}};var un=class extends Error{constructor(r,n,p){super(),this.data={message:p},this.statusCode=r,this.code=n}};var Ct=class extends Qt{constructor(r,n){super(`${ln(r)} with id: \`${n}\` already exists. Please use a different id.`)}},at=class extends Xt{constructor(r,n){super(`${ln(r)} with id: \`${n}\` does not exist. Please provide a valid id.`)}},yt=class extends st{constructor(n,p,w,F){super(`Failed to ${w} ${ln(n)} with id: \`${p}\``,{cause:F});this.statusCode=502}};var dn=class extends at{constructor(n){super("provider",n);this.code="ProviderNotFoundError"}},fn=class extends yt{constructor(n,p,w){super("provider",n,p,w);this.code="ProviderExecutionFailedError"}};var hn=class extends ot{constructor(){super("Signature does not match the expected signature. Please ensure the signature provided in the `novu-signature` header is correct and try again.");this.code="SignatureMismatchError"}},mn=class extends ot{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},yn=class extends ot{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},gn=class extends ot{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},Sn=class extends ot{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var wn=class extends at{constructor(n){super("step",n);this.code="StepNotFoundError"}},bn=class extends Ct{constructor(n){super("step",n);this.code="StepAlreadyExistsError"}},kt=class extends yt{constructor(n,p,w){super("step",n,p,w);this.code="StepExecutionFailedError"}};var Mt=class extends at{constructor(n){super("workflow",n);this.code="WorkflowNotFoundError"}};var Tn=(()=>{var l=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,p=Object.prototype.hasOwnProperty,w=(e,t)=>function(){return e&&(t=(0,e[n(e)[0]])(e=0)),t},F=(e,t)=>function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports},k=(e,t)=>{for(var i in t)l(e,i,{get:t[i],enumerable:!0})},z=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of n(t))!p.call(e,u)&&u!==i&&l(e,u,{get:()=>t[u],enumerable:!(c=r(t,u))||c.enumerable});return e},re=e=>z(l({},"__esModule",{value:!0}),e),we={};k(we,{JSONSchemaFaker:()=>bi,default:()=>Ti,setDependencies:()=>Lr});function Pe(e,t){return typeof e=="string"?typeof t!="undefined"?vt.register(e,t):vt.get(e):vt.registerMany(e)}function xe(e,t){return e=typeof e=="undefined"?He.MIN_INTEGER:e,t=typeof t=="undefined"?He.MAX_INTEGER:t,Math.floor(te("random")()*(t-e+1))+e}function be(e){return Yt.default.prototype.max=te("defaultRandExpMax"),Yt.default.prototype.randInt=(i,c)=>i+Math.floor(te("random")()*(1+(c-i))),new Yt.default(e).gen()}function ke(e){return e[Math.floor(te("random")()*e.length)]}function Fe(e){let t,i,c=e.length,u=e.slice();for(;c>0;)i=Math.floor(te("random")()*c),c-=1,t=u[c],u[c]=u[i],u[i]=t;return u}function rt(e,t){return te("random")()*(t-e)+e}function Ge(e,t,i,c,u=!1){return i=typeof i=="undefined"?He.MIN_NUMBER:i,c=typeof c=="undefined"?He.MAX_NUMBER:c,e=typeof e=="undefined"?i:e,t=typeof t=="undefined"?c:t,t<e&&(t+=e),u?rt(e,t):xe(e,t)}function Ft(e){switch(e){case"seconds":return Ge(0,60)*60;case"minutes":return Ge(15,50)*612;case"hours":return Ge(12,72)*36123;case"days":return Ge(7,30)*86412345;case"weeks":return Ge(4,52)*604812345;case"months":return Ge(2,13)*2592012345;case"years":return Ge(1,20)*31104012345;default:break}}function Yn(e){if(e)return Ft(e);let t=te("minDateTime"),i=te("maxDateTime");typeof t=="string"&&(t=new Date(t)),typeof i=="string"&&(i=new Date(i));let c=new Date().getTime();return typeof t=="number"&&(t=new Date(c+t)),typeof i=="number"&&(i=new Date(c+i)),new Date(rt(t.getTime(),i.getTime()))}function mr(e,t,i){if(t=decodeURIComponent(t),i&&i[t])return ce(i[t]);let c=t.replace("#/","/").split("/"),u=e.$ref&&i&&i[e.$ref]||e;for(!u&&!c[0]&&(c[0]=e.$ref.split("#/")[0]),i&&t.includes("#/")&&i[c[0]]&&(u=i[c.shift()]),c[0]||c.shift();u&&c.length>0;){let h=c.shift();if(!u[h])throw new Error(`Prop not found: ${h} (${t})`);u=u[h]}return u}function $t(e){return typeof e=="string"&&qr.test(e)}function Ke(e){return["number","boolean"].includes(typeof e)}function Be(e,...t){return t.filter(i=>typeof e[i]!="undefined").length>0}function yr(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,i,c]=e.split("T")[0].split("-");return i=`0${Math.max(1,Math.min(12,i))}`.slice(-2),c=`0${Math.max(1,Math.min(31,c))}`.slice(-2),`${t}-${i}-${c}`}function Io(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,i]=e.split("T"),[c,u,h]=t.split("-"),[f,O,D]=i.substr(0,8).split(":");return u=`0${Math.max(1,Math.min(12,u))}`.slice(-2),h=`0${Math.max(1,Math.min(31,h))}`.slice(-2),f=`0${Math.max(1,Math.min(23,f))}`.slice(-2),O=`0${Math.max(1,Math.min(59,O))}`.slice(-2),D=`0${Math.max(1,Math.min(59,D))}`.slice(-2),`${c}-${u}-${h}T${f}:${O}:${D}.000Z`}function No(e,t,i){let c={};switch(e||t.type){case"integer":case"number":if(typeof t.minimum!="undefined"&&(c.minimum=t.minimum),typeof t.maximum!="undefined"&&(c.maximum=t.maximum),t.enum){let h=Math.max(c.minimum||0,0),f=Math.min(c.maximum||1/0,1/0);t.exclusiveMinimum&&h===t.minimum&&(h+=t.multipleOf||1),t.exclusiveMaximum&&f===t.maximum&&(f-=t.multipleOf||1),(h||f!==1/0)&&(t.enum=t.enum.filter(O=>O>=h&&O<=f))}break;case"string":{c.minLength=te("minLength")||0,c.maxLength=te("maxLength")||Number.MAX_SAFE_INTEGER,typeof t.minLength!="undefined"&&(c.minLength=Math.max(c.minLength,t.minLength)),typeof t.maxLength!="undefined"&&(c.maxLength=Math.min(c.maxLength,t.maxLength));break}default:break}let u=i(c);if(u==null)return null;switch(e||t.type){case"number":u=$t(u)?parseFloat(u):u;break;case"integer":u=$t(u)?parseInt(u,10):u;break;case"boolean":u=!!u;break;case"string":{if(Ke(u))return u;u=String(u);let h=Math.max(c.minLength||0,0),f=Math.min(c.maxLength||1/0,1/0),O,D=0;for(;u.length<h;)if(O=u,t.pattern?u+=Z.randexp(t.pattern):u+=`${Z.pick([" ","/","_","-","+","=","@","^"])}${u}`,u===O){if(D+=1,D===3)break}else D=0;switch(u.length>f&&(u=u.substr(0,f)),t.format){case"date-time":case"datetime":u=new Date(Io(u)).toISOString().replace(/([0-9])0+Z$/,"$1Z");break;case"full-date":case"date":u=new Date(yr(u)).toISOString().substr(0,10);break;case"time":u=new Date(`1969-01-01 ${u}`).toISOString().substr(11);break;default:break}break}default:break}return u}function dt(e,t){return Object.keys(t).forEach(i=>{typeof t[i]!="object"||t[i]===null?e[i]=t[i]:Array.isArray(t[i])?(e[i]=e[i]||[],t[i].forEach((c,u)=>{e.type==="array"&&t.type==="array"?e[i][u]=dt(e[i][u]||{},c,!0):Array.isArray(e[i])&&e[i].indexOf(c)===-1&&e[i].push(c)})):typeof e[i]!="object"||e[i]===null||Array.isArray(e[i])?e[i]=dt({},t[i]):e[i]=dt(e[i],t[i])}),e}function ce(e,t=new Map){if(!e||typeof e!="object")return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let c=[];return t.set(e,c),c.push(...e.map(u=>ce(u,t))),c}let i={};return t.set(e,i),Object.keys(e).reduce((c,u)=>(c[u]=ce(e[u],t),c),i)}function Co(e){let t=JSON.stringify(e),i=JSON.stringify(e,null,2);return t.length>400?`${i.substr(0,400)}...`:i}function gr(){return Z.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function ko(e,t){if(e.enum)return e.enum.includes(t);if(e.const)return e.const===t}function Mo(e,t){let i=dt({},t);if(typeof e.minimum!="undefined"&&(i.maximum=e.minimum,i.exclusiveMaximum=!0),typeof e.maximum!="undefined"&&(i.minimum=e.maximum>i.maximum?0:e.maximum,i.exclusiveMinimum=!0),typeof e.minLength!="undefined"&&(i.maxLength=e.minLength),typeof e.maxLength!="undefined"&&(i.minLength=e.maxLength>i.maxLength?0:e.maxLength),e.type)i.type=Z.pick(He.SCALAR_TYPES.filter(c=>(Array.isArray(e.type)?e.type:[e.type]).every(h=>c==="number"||c==="integer"?h!=="number"&&h!=="integer":c!==h)));else if(e.enum){let c;do c=gr();while(e.enum.indexOf(c)!==-1);i.enum=[c]}return e.required&&i.properties&&e.required.forEach(c=>{delete i.properties[c]}),i}function Wn(e,t){let i=t.minimum!==void 0,c=t.maximum!==void 0;return(i||c)&&(!i||e>=t.minimum)&&(!c||e<=t.maximum)}function Lo(e,t){return!t.every(i=>Wn(e,i))}function Do(e,t){return t.reduce((c,u)=>c+(Wn(e,u)?1:0),0)===1}function Uo(e){return["enum","const","default","examples","required","definitions","items","properties"].includes(e)}function Fo(e,t){return Object.keys(e).filter(i=>!t.includes(i)).reduce((i,c)=>(Array.isArray(e[c])?i[c]=e[c].slice():i[c]=e[c]instanceof Object?dt({},e[c]):e[c],i),{})}function Sr(e,t){return Array.isArray(e)?e.map(i=>Sr(i,t)):(typeof e=="string"&&(e=e.replace(/#\{([\w.-]+)\}/g,(i,c)=>t[c])),e)}function Vn(e){return Object.prototype.toString.call(e)==="[object Object]"&&!Object.keys(e).length}function wr(e,t){t=t.items||t;let i=te("alwaysFakeOptionals"),c=Array.isArray(t.required)&&t.required.includes(e)||i,u=typeof t.thunk=="function"||t.additionalProperties&&typeof t.additionalProperties.thunk=="function";return!c&&!u}function Bn(e,t,i=!1){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(c=>Bn(c,t,!0)).filter(c=>typeof c!="undefined");if(Object.keys(e).forEach(c=>{if(Vn(e[c]))wr(c,t)&&delete e[c];else{let u=t;t&&t.properties&&t.properties[c]&&(u=t.properties[c]);let h=Bn(e[c],u);Vn(h)||(e[c]=h)}typeof e[c]=="undefined"&&delete e[c]}),!(!Object.keys(e).length&&i))return e}function $o(e){return(t,i,c,u)=>{let h=t,f=[];typeof t=="object"&&(h=Object.keys(t)[0],Array.isArray(t[h])?f=t[h]:f.push(t[h]));let O=h.split("."),D=e();for(;O.length>1;)D=D[O.shift()];return t=typeof D=="object"?D[O[0]]:D,typeof t=="function"&&(t=t.apply(D,f.map(T=>de.template(T,u)))),Object.prototype.toString.call(t)==="[object Object]"&&Object.keys(t).forEach(T=>{if(typeof t[T]=="function")throw new Error(`Cannot resolve value for '${c}: ${h}', given: ${t}`)}),t}}function jo(e,t){if(typeof e=="undefined")return ht.list();if(typeof e=="string")if(typeof t=="function")ht.register(e,t);else if(t===null||t===!1)ht.unregister(e);else return ht.get(e);else ht.registerMany(e)}function Yo(e,t,i){return Object.keys(e).filter(c=>{let u=Hr.indexOf(t)>-1;return i.indexOf(c)>-1&&!u}).length>0}function Wo(e,t){let i=Object.keys(At);for(let c=0;c<i.length;c+=1){let u=i[c],h=t[t.length-1];if(Yo(e,h,At[u]))return u}}function Vo(){return te("random")()>.5}function Bo(){return null}function qo(e,t,i,c,u,h){let f=[],O=[];function D($){let R=JSON.stringify($.value);return O.indexOf(R)===-1?(O.push(R),f.push($),!0):!1}t.forEach(D);let T=100;for(;f.length!==t.length&&(D(h(i.items||c,e,u))||(T-=1),!!T););return f}function Jo(e,t,i,c){let u=[];if(!(e.items||e.additionalItems)){if(de.hasProperties(e,"minItems","maxItems","uniqueItems")&&(e.minItems!==0||e.maxItems!==0))throw new Wt(`missing items for ${de.short(e)}`,t);return u}if(Array.isArray(e.items))return e.items.map((W,ae)=>{let Q=t.concat(["items",ae]);return c(W,Q,i)});let h=e.minItems,f=e.maxItems,O=te("minItems"),D=te("maxItems");O&&(h=typeof h=="undefined"?O:Math.min(O,h)),D&&(f=typeof f=="undefined"?D:Math.min(D,f),f&&f>D&&(f=D),h&&h>D&&(h=f));let T=te("alwaysFakeOptionals")===!0?1:te("optionalsProbability"),$=te("alwaysFakeOptionals")||te("fixedProbabilities")||!1,R=Z.number(h,f,1,5);T!==null&&(R=Math.max($?Math.round((f||R)*T):Math.abs(Z.number(h,f)*T),h||0));let J=typeof e.additionalItems=="object"?e.additionalItems:{};for(let W=u.length;W<R;W+=1){let ae=t.concat(["items",W]),Q=c(e.items||J,ae,i);u.push(Q)}if(e.contains&&R>0){let W=Z.number(0,R-1);u[W]=c(e.contains,t.concat(["items",W]),i)}return e.uniqueItems?qo(t.concat(["items"]),u,e,J,i,c):u}function Go(e){let t=typeof e.minimum=="undefined"||e.minimum===-Number.MAX_VALUE?He.MIN_INTEGER:e.minimum,i=typeof e.maximum=="undefined"||e.maximum===Number.MAX_VALUE?He.MAX_INTEGER:e.maximum,c=e.multipleOf,u=c&&String(c).match(/e-(\d)|\.(\d+)$/);if(u){let h=(Math.random()*Z.number(0,10)+1)*c,f=u[1]||u[2].length,O=parseFloat(h.toFixed(f)),D=Z.number(t,i-1);return String(O).includes(".")?D+O:(D+O).toExponential()}if(c&&(i=Math.floor(i/c)*c,t=Math.ceil(t/c)*c),e.exclusiveMinimum&&t===e.minimum&&(t+=c||1),e.exclusiveMaximum&&i===e.maximum&&(i-=c||1),t>i)return NaN;if(c){let h=Z.number(Math.floor(t/c),Math.floor(i/c))*c;for(;h<t;)h+=c;return h}return Z.number(t,i,void 0,void 0,e.type!=="integer")}function Ko(e){return Math.floor(ir({...e}))}function Ho(e){return Z.shuffle(oi).slice(0,e)}function zo(e,t,i,c){let u={},h=e.properties||{},f=e.patternProperties||{},O=typeof e.required=="boolean"?[]:(e.required||[]).slice(),D=e.additionalProperties!==!1,T=Object.keys(h),$=Object.keys(f),R=T.concat($).reduce((Y,m)=>(O.indexOf(m)===-1&&Y.push(m),Y),[]),J=O.concat(R),W=D&&e.additionalProperties===!0?Bt:e.additionalProperties;if(!D&&T.length===0&&$.length===0&&de.hasProperties(e,"minProperties","maxProperties","dependencies","required"))return null;if(te("requiredOnly")===!0)return O.forEach(Y=>{h[Y]&&(u[Y]=h[Y])}),c(u,t.concat(["properties"]),i,e);let ae=te("alwaysFakeOptionals")===!0?1:te("optionalsProbability"),Q=te("alwaysFakeOptionals")||te("fixedProbabilities")||!1,ne=te("ignoreProperties")||[],he=te("reuseProperties"),ye=te("fillProperties"),j=e.maxProperties||J.length+(D?Z.number(1,5):0),S=Math.max(e.minProperties||0,O.length),b=Math.max(0,J.length-S);J.length===1&&!O.length&&(S=Math.max(Z.number(ye?1:0,j),S)),ae!==null&&(Q===!0?b=Math.round(S-O.length+ae*(J.length-S)):b=Z.number(S-O.length,ae*(J.length-S)));let _=Z.shuffle(R).slice(0,b),x=R.filter(Y=>_.indexOf(Y)!==-1),M=ae!==null||O.length===j?j:Z.number(0,j),E=O.concat(Z.shuffle(x).slice(0,M)).slice(0,j),I=[],C=[];if(e.dependencies&&(Object.keys(e.dependencies).forEach(Y=>{let m=e.dependencies[Y];if(E.indexOf(Y)!==-1)if(Array.isArray(m))m.forEach(N=>{E.indexOf(N)===-1&&E.push(N)});else if(Array.isArray(m.oneOf||m.anyOf)){let N=m.oneOf||m.anyOf;C.push({prop:Y,values:N})}else I.push(m)}),I.length))return delete e.dependencies,c({allOf:I.concat(e)},t.concat(["properties"]),i,e);let V=[],G=[];E.forEach(Y=>{if(h[Y]&&["{}","true"].includes(JSON.stringify(h[Y].not)))return;for(let N=0;N<ne.length;N+=1)if(ne[N]instanceof RegExp&&ne[N].test(Y)||typeof ne[N]=="string"&&ne[N]===Y||typeof ne[N]=="function"&&ne[N](h[Y],Y)){V.push(Y);return}W===!1&&O.indexOf(Y)!==-1&&(u[Y]=h[Y]),h[Y]&&(u[Y]=h[Y]);let m;if($.forEach(N=>{Y.match(new RegExp(N))&&(m=!0,u[Y]?de.merge(u[Y],f[N]):u[Z.randexp(Y)]=f[N])}),!m){let N=f[Y]||W;N&&W!==!1?u[f[Y]?Z.randexp(Y):Y]=h[Y]||N:G.push(Y)}});let ee=Object.keys(u).length+(ye?0:V.length),ve=Y=>Z.randexp(`_?[_a-f\\d]{1,3}${Y?"\\$?":""}`);function Ae(Y){let m;do{if(!Y.length)break;m=Y.shift()}while(u[m]);return m}let Ee=S;if(D&&!O.length&&(Ee=Math.max(ae===null||W?Z.number(ye?1:0,j):0,S)),!x.length&&!b&&D&&Q===!0&&ye){let Y=Z.number(0,j);for(let m=0;m<Y;m+=1)u[Vt(1)+ve(Y[m])]=W||Bt}for(;ye&&!(!($.length||D)||ee>=Ee);){if(D)if(he&&T.length-ee>Ee){let Y=0,m;do{if(Y+=1,Y>1e3)break;m=Ae(O)||Z.pick(T)}while(typeof u[m]!="undefined");typeof u[m]=="undefined"&&(u[m]=h[m],ee+=1)}else if($.length&&!W){let Y=Z.pick($),m=Z.randexp(Y);u[m]||(u[m]=f[Y],ee+=1)}else{let Y=Ae(O)||Vt(1)+ve();u[Y]||(u[Y]=W||Bt,ee+=1)}for(let Y=0;ee<S&&Y<$.length;Y+=1){let m=$[Y],N=Z.randexp(m);u[N]||(u[N]=f[m],ee+=1)}}if(O.length===0&&(!D||ae===!1)){let Y=Z.number(S,j);for(;ee<Y;){let m=Ae(T);m&&(u[m]=h[m]),ee+=1}}let Ie=u;if(te("sortProperties")!==null){let Y=Object.keys(h);Ie=Object.keys(u).sort((N,K)=>te("sortProperties")?N.localeCompare(K):Y.indexOf(N)-Y.indexOf(K)).reduce((N,K)=>(N[K]=u[K],N),{})}let Me=c(Ie,t.concat(["properties"]),i,e);return C.forEach(Y=>{for(let m of Y.values)if(de.hasValue(m.properties[Y.prop],Me.value[Y.prop])){Object.keys(m.properties).forEach(N=>{N!==Y.prop&&de.merge(Me.value,c(m.properties,t.concat(["properties"]),i,e).value)});break}}),Me}function br(){let e=Z.number(1,5);return Vt(e).join(" ")}function Xo(e=0,t=140){let i=Math.max(0,e),c=Z.number(i,t),u=br();for(;u.length<i;)u+=br();return u.length>c&&(u=u.substr(0,c)),u}function Qo(){return[0,0,0,0].map(()=>Z.number(0,255)).join(".")}function Zo(){return Z.date().toISOString()}function es(){return qt().slice(0,10)}function ts(){return qt().slice(11)}function ns(e){return Z.randexp(je[e]).replace(ui,(t,i)=>Z.randexp(je[i]))}function rs(e,t){let i=rr(e.format);if(typeof i=="function")return i(e);switch(e.format){case"date-time":case"datetime":return qt();case"date":return li();case"time":return ci();case"ipv4":return ai();case"regex":return".+?";case"email":case"hostname":case"ipv6":case"uri":case"uri-reference":case"iri":case"iri-reference":case"idn-email":case"idn-hostname":case"json-pointer":case"slug":case"uri-template":case"uuid":case"duration":return di(e.format);default:if(typeof i=="undefined"){if(te("failOnInvalidFormat"))throw new Error(`unknown registry key ${de.short(e.format)}`);return t()}throw new Error(`unsupported format '${e.format}'`)}}function is(e){return de.typecast("string",e,i=>e.format?rs(e,()=>or(i.minLength,i.maxLength)):e.pattern?Z.randexp(e.pattern):or(i.minLength,i.maxLength))}function os({$comment:e,title:t,description:i}){return Object.entries({comment:e,title:t,description:i}).filter(([,c])=>c).reduce((c,[u,h])=>(c[u]=h,c),{})}function ft(e,t,i,c){if(e=i(e,null,t),e&&(e.oneOf||e.anyOf||e.allOf)&&(e=i(e,null,t)),!e)throw new Error(`Cannot traverse at '${t.join(".")}', given '${JSON.stringify(c)}'`);let u={...os(e),schemaPath:t};if(t[t.length-1]!=="properties"){if(te("useExamplesValue")&&Array.isArray(e.examples)){let T=e.examples.concat("default"in e?[e.default]:[]);return{value:de.typecast(null,e,()=>Z.pick(T)),context:u}}if(te("useExamplesValue")&&typeof e.example!="undefined")return{value:de.typecast(null,e,()=>e.example),context:u};if(te("useDefaultValue")&&"default"in e&&(e.default!==""||!te("replaceEmptyByRandomValue")))return{value:e.default,context:u};if("template"in e)return{value:de.template(e.template,c),context:u};if("const"in e)return{value:e.const,context:u}}if(e.not&&typeof e.not=="object"&&(e=de.notValue(e.not,de.omitProps(e,["not"])),e.type&&e.type==="object")){let{value:T,context:$}=ft(e,t.concat(["not"]),i,c);return{value:de.clean(T,e,!1),context:{...u,items:$}}}if(typeof e.thunk=="function"){let{value:T,context:$}=ft(e.thunk(c),t,i);return{value:T,context:{...u,items:$}}}if(e.jsonPath)return{value:e,context:u};let h=e.type;if(Array.isArray(h)?h=Z.pick(h):typeof h=="undefined"&&(h=zr(e,t)||h,h&&(e.type=h)),typeof e.generate=="function"){let T=de.typecast(null,e,()=>e.generate(c,t)),$=T===null?"null":typeof T;if($===h||$==="number"&&h==="integer"||Array.isArray(T)&&h==="array")return{value:T,context:u}}if(typeof e.pattern=="string")return{value:de.typecast("string",e,()=>Z.randexp(e.pattern)),context:u};if(Array.isArray(e.enum))return{value:de.typecast(null,e,()=>Z.pick(e.enum)),context:u};if(typeof h=="string")if(Rt[h])try{let T=Rt[h](e,t,i,ft);return h==="array"?{value:T.map(({value:$})=>$),context:{...u,items:T.map(Array.isArray(e.items)?({context:$})=>$:({context:$})=>({...$,schemaPath:$.schemaPath.slice(0,-1)}))}}:h==="object"?T!==null?{value:T.value,context:{...u,items:T.context}}:{value:{},context:u}:{value:T,context:u}}catch(T){throw typeof T.path=="undefined"?new Wt(T.stack,t):T}else{if(te("failOnInvalidTypes"))throw new Wt(`unknown primitive ${de.short(h)}`,t.concat(["type"]));{let T=te("defaultInvalidTypeProduct");return typeof T=="string"&&Rt[T]?{value:Rt[T](e,t,i,ft),context:u}:{value:T,context:u}}}let f={},O={...u};Array.isArray(e)&&(f=[]);let D=te("pruneProperties")||[];return Object.keys(e).forEach(T=>{if(!D.includes(T)&&e[T]!==null)if(typeof e[T]=="object"&&T!=="definitions"){let{value:$,context:R}=ft(e[T],t.concat([T]),i,f);f[T]=de.clean($,e[T],!1),O[T]=R,f[T]===null&&te("omitNulls")&&(delete f[T],delete O[T])}else f[T]=e[T]}),{value:f,context:O}}function ss(e){return Array.isArray(e)?Z.pick(e):e}function as(e,t){if(!Array.isArray(e))return e;let i=t?e.pop():e.shift();return t?e.unshift(i):e.push(i),i}function qn(e,t,i,c){if(!e||typeof e!="object")return e;if(i||(i={}),t||(t=e),Array.isArray(e))return e.map(u=>qn(u,t,i,c));if(e.jsonPath){let{JSONPath:u}=Qn(),h=typeof e.jsonPath!="object"?{path:e.jsonPath}:e.jsonPath;h.group=e.group||h.group||c,h.cycle=e.cycle||h.cycle||!1,h.reverse=e.reverse||h.reverse||!1,h.count=e.count||h.count||1;let f=`${h.group}__${h.path}`;return i[f]||(h.count>1?i[f]=u(h.path,t).slice(0,h.count):i[f]=u(h.path,t)),h.cycle||h.reverse?as(i[f],h.reverse):ss(i[f])}return Object.keys(e).forEach(u=>{e[u]=qn(e[u],t,i,u)}),e}function ls(e,t,i,c){if(Object.prototype.toString.call(t)!=="[object Object]")throw new Error(`Invalid input, expecting object but given ${typeof t}`);let u=te("refDepthMin")||0,h=te("refDepthMax")||3;try{let{resolveSchema:f}=gi({refs:e,schema:t,container:i,synchronous:c,refDepthMin:u,refDepthMax:h}),O=mi(de.clone(t),[],f);return te("resolveJsonPath")?{value:qn(O.value),context:O.context}:O}catch(f){throw f.path?new Error(`${f.message} in /${f.path.join("/")}`):f}}function cs(e){return e.value}function ps(e,t){return t.reduce((i,c)=>c in i?i[c]:{},e)}function Jn(e,t,i,c=i){let{title:u,description:h,comment:f}=ps(e,t),O=[];te("renderTitle")&&u&&O.push(` ${u}`,""),te("renderDescription")&&h&&O.push(` ${h}`),te("renderComment")&&f&&O.push(` ${f}`),i.commentBefore=O.join(`
|
|
2
|
+
`),c instanceof Si?c.items.forEach(D=>{Jn(e,[...t,"items",D.key.value],D.key,D.value)}):c instanceof wi&&c.items.forEach((D,T)=>{Jn(e,[...t,"items",T],D)})}function us({value:e,context:t}){let i=Et.createNode(e);Jn(t,[],i);let c=new Et.Document;return c.contents=i,c.toString()}function Tr(){Xe.define("autoIncrement",function(t,i){if(!this.offset){let c=i.minimum||1,u=c+He.MAX_NUMBER,h=t.initialOffset||i.initialOffset;this.offset=h||Z.number(c,u)}return t?this.offset++:i}),Xe.define("sequentialDate",function(t,i){if(this.now||(this.now=Z.date()),t){if(i=this.now.toISOString(),t=t===!0?"days":t,["seconds","minutes","hours","days","weeks","months","years"].indexOf(t)===-1)throw new Error(`Unsupported increment by ${de.short(t)}`);this.now.setTime(this.now.getTime()+Z.date(t))}return i})}function Or(e,t){let i={};Array.isArray(e)?e.forEach(u=>{i[u.$id||u.id]=u}):i=e||{};function c(u){if(!u||typeof u!="object")return;if(Array.isArray(u))return u.forEach(c);let h=u.$id||u.id;typeof h=="string"&&!i[h]&&(i[h]=u),Object.keys(u).forEach(f=>{c(u[f])})}return c(e),c(t),i}var vr,Gn,Ar,Kn,Rr,Er,$e,_r,Hn,Tt,U,Pr,xr,Ir,Nr,Cr,Ot,jt,zn,kr,Mr,Xn,Qn,Lr,Dr,Zn,ue,er,Ur,Fr,vt,te,tr,nr,$r,jr,Yr,Wr,Vr,Br,He,Yt,Z,qr,de,Jr,Gr,ht,rr,Kr,Wt,At,Hr,zr,Xr,Qr,Zr,ei,ti,ni,ri,ir,ii,oi,Vt,Bt,si,or,ai,qt,li,ci,sr,Jt,pi,je,ui,di,fi,hi,Rt,mi,yi,gi,ar,lr,Le,ds,fs,hs,ms,ys,gs,Ss,ws,bs,Ts,Os,vs,Si,wi,Et,Xe,Oe,bi,Ti,As=w({"src/shared.js"(){vr=Object.create,Gn=Object.defineProperty,Ar=Object.getOwnPropertyDescriptor,Kn=Object.getOwnPropertyNames,Rr=Object.getPrototypeOf,Er=Object.prototype.hasOwnProperty,$e=(e,t)=>function(){return t||(0,e[Kn(e)[0]])((t={exports:{}}).exports,t),t.exports},_r=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Kn(t))!Er.call(e,u)&&u!==i&&Gn(e,u,{get:()=>t[u],enumerable:!(c=Ar(t,u))||c.enumerable});return e},Hn=(e,t,i)=>(i=e!=null?vr(Rr(e)):{},_r(t||!e||!e.__esModule?Gn(i,"default",{value:e,enumerable:!0}):i,e)),Tt=$e({"node_modules/ret/lib/types.js"(e,t){t.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}}}),U=$e({"node_modules/ret/lib/sets.js"(e){var t=Tt(),i=()=>[{type:t.RANGE,from:48,to:57}],c=()=>[{type:t.CHAR,value:95},{type:t.RANGE,from:97,to:122},{type:t.RANGE,from:65,to:90}].concat(i()),u=()=>[{type:t.CHAR,value:9},{type:t.CHAR,value:10},{type:t.CHAR,value:11},{type:t.CHAR,value:12},{type:t.CHAR,value:13},{type:t.CHAR,value:32},{type:t.CHAR,value:160},{type:t.CHAR,value:5760},{type:t.RANGE,from:8192,to:8202},{type:t.CHAR,value:8232},{type:t.CHAR,value:8233},{type:t.CHAR,value:8239},{type:t.CHAR,value:8287},{type:t.CHAR,value:12288},{type:t.CHAR,value:65279}],h=()=>[{type:t.CHAR,value:10},{type:t.CHAR,value:13},{type:t.CHAR,value:8232},{type:t.CHAR,value:8233}];e.words=()=>({type:t.SET,set:c(),not:!1}),e.notWords=()=>({type:t.SET,set:c(),not:!0}),e.ints=()=>({type:t.SET,set:i(),not:!1}),e.notInts=()=>({type:t.SET,set:i(),not:!0}),e.whitespace=()=>({type:t.SET,set:u(),not:!1}),e.notWhitespace=()=>({type:t.SET,set:u(),not:!0}),e.anyChar=()=>({type:t.SET,set:h(),not:!0})}}),Pr=$e({"node_modules/ret/lib/util.js"(e){var t=Tt(),i=U(),c="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",u={0:0,t:9,n:10,v:11,f:12,r:13};e.strToChars=h=>{var f=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return h=h.replace(f,(O,D,T,$,R,J,W,ae)=>{if(T)return O;var Q=D?8:$?parseInt($,16):R?parseInt(R,16):J?parseInt(J,8):W?c.indexOf(W):u[ae],ne=String.fromCharCode(Q);return/[[\]{}^$.|?*+()]/.test(ne)&&(ne="\\"+ne),ne}),h},e.tokenizeClass=(h,f)=>{for(var O=[],D=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,T,$;(T=D.exec(h))!=null;)if(T[1])O.push(i.words());else if(T[2])O.push(i.ints());else if(T[3])O.push(i.whitespace());else if(T[4])O.push(i.notWords());else if(T[5])O.push(i.notInts());else if(T[6])O.push(i.notWhitespace());else if(T[7])O.push({type:t.RANGE,from:(T[8]||T[9]).charCodeAt(0),to:T[10].charCodeAt(0)});else if($=T[12])O.push({type:t.CHAR,value:$.charCodeAt(0)});else return[O,D.lastIndex];e.error(f,"Unterminated character class")},e.error=(h,f)=>{throw new SyntaxError("Invalid regular expression: /"+h+"/: "+f)}}}),xr=$e({"node_modules/ret/lib/positions.js"(e){var t=Tt();e.wordBoundary=()=>({type:t.POSITION,value:"b"}),e.nonWordBoundary=()=>({type:t.POSITION,value:"B"}),e.begin=()=>({type:t.POSITION,value:"^"}),e.end=()=>({type:t.POSITION,value:"$"})}}),Ir=$e({"node_modules/ret/lib/index.js"(e,t){var i=Pr(),c=Tt(),u=U(),h=xr();t.exports=f=>{var O=0,D,T,$={type:c.ROOT,stack:[]},R=$,J=$.stack,W=[],ae=x=>{i.error(f,`Nothing to repeat at column ${x-1}`)},Q=i.strToChars(f);for(D=Q.length;O<D;)switch(T=Q[O++],T){case"\\":switch(T=Q[O++],T){case"b":J.push(h.wordBoundary());break;case"B":J.push(h.nonWordBoundary());break;case"w":J.push(u.words());break;case"W":J.push(u.notWords());break;case"d":J.push(u.ints());break;case"D":J.push(u.notInts());break;case"s":J.push(u.whitespace());break;case"S":J.push(u.notWhitespace());break;default:/\d/.test(T)?J.push({type:c.REFERENCE,value:parseInt(T,10)}):J.push({type:c.CHAR,value:T.charCodeAt(0)})}break;case"^":J.push(h.begin());break;case"$":J.push(h.end());break;case"[":{var ne;Q[O]==="^"?(ne=!0,O++):ne=!1;var he=i.tokenizeClass(Q.slice(O),f);O+=he[1],J.push({type:c.SET,set:he[0],not:ne});break}case".":J.push(u.anyChar());break;case"(":{var ye={type:c.GROUP,stack:[],remember:!0};T=Q[O],T==="?"&&(T=Q[O+1],O+=2,T==="="?ye.followedBy=!0:T==="!"?ye.notFollowedBy=!0:T!==":"&&i.error(f,`Invalid group, character '${T}' after '?' at column ${O-1}`),ye.remember=!1),J.push(ye),W.push(R),R=ye,J=ye.stack;break}case")":W.length===0&&i.error(f,`Unmatched ) at column ${O-1}`),R=W.pop(),J=R.options?R.options[R.options.length-1]:R.stack;break;case"|":{R.options||(R.options=[R.stack],delete R.stack);var j=[];R.options.push(j),J=j;break}case"{":{var S=/^(\d+)(,(\d+)?)?\}/.exec(Q.slice(O)),b,_;S!==null?(J.length===0&&ae(O),b=parseInt(S[1],10),_=S[2]?S[3]?parseInt(S[3],10):1/0:b,O+=S[0].length,J.push({type:c.REPETITION,min:b,max:_,value:J.pop()})):J.push({type:c.CHAR,value:123});break}case"?":J.length===0&&ae(O),J.push({type:c.REPETITION,min:0,max:1,value:J.pop()});break;case"+":J.length===0&&ae(O),J.push({type:c.REPETITION,min:1,max:1/0,value:J.pop()});break;case"*":J.length===0&&ae(O),J.push({type:c.REPETITION,min:0,max:1/0,value:J.pop()});break;default:J.push({type:c.CHAR,value:T.charCodeAt(0)})}return W.length!==0&&i.error(f,"Unterminated group"),$},t.exports.types=c}}),Nr=$e({"node_modules/drange/lib/index.js"(e,t){var i=class gt{constructor(h,f){this.low=h,this.high=f,this.length=1+f-h}overlaps(h){return!(this.high<h.low||this.low>h.high)}touches(h){return!(this.high+1<h.low||this.low-1>h.high)}add(h){return new gt(Math.min(this.low,h.low),Math.max(this.high,h.high))}subtract(h){return h.low<=this.low&&h.high>=this.high?[]:h.low>this.low&&h.high<this.high?[new gt(this.low,h.low-1),new gt(h.high+1,this.high)]:h.low<=this.low?[new gt(h.high+1,this.high)]:[new gt(this.low,h.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},c=class Lt{constructor(h,f){this.ranges=[],this.length=0,h!=null&&this.add(h,f)}_update_length(){this.length=this.ranges.reduce((h,f)=>h+f.length,0)}add(h,f){var O=D=>{for(var T=0;T<this.ranges.length&&!D.touches(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&D.touches(this.ranges[T]);)D=D.add(this.ranges[T]),T++;$.push(D),this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Lt?h.ranges.forEach(O):(f==null&&(f=h),O(new i(h,f))),this}subtract(h,f){var O=D=>{for(var T=0;T<this.ranges.length&&!D.overlaps(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&D.overlaps(this.ranges[T]);)$=$.concat(this.ranges[T].subtract(D)),T++;this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Lt?h.ranges.forEach(O):(f==null&&(f=h),O(new i(h,f))),this}intersect(h,f){var O=[],D=T=>{for(var $=0;$<this.ranges.length&&!T.overlaps(this.ranges[$]);)$++;for(;$<this.ranges.length&&T.overlaps(this.ranges[$]);){var R=Math.max(this.ranges[$].low,T.low),J=Math.min(this.ranges[$].high,T.high);O.push(new i(R,J)),$++}};return h instanceof Lt?h.ranges.forEach(D):(f==null&&(f=h),D(new i(h,f))),this.ranges=O,this._update_length(),this}index(h){for(var f=0;f<this.ranges.length&&this.ranges[f].length<=h;)h-=this.ranges[f].length,f++;return this.ranges[f].low+h}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new Lt(this)}numbers(){return this.ranges.reduce((h,f)=>{for(var O=f.low;O<=f.high;)h.push(O),O++;return h},[])}subranges(){return this.ranges.map(h=>({low:h.low,high:h.high,length:1+h.high-h.low}))}};t.exports=c}}),Cr=$e({"node_modules/randexp/lib/randexp.js"(e,t){var i=Ir(),c=Nr(),u=i.types;t.exports=class Dt{constructor(f,O){if(this._setDefaults(f),f instanceof RegExp)this.ignoreCase=f.ignoreCase,this.multiline=f.multiline,f=f.source;else if(typeof f=="string")this.ignoreCase=O&&O.indexOf("i")!==-1,this.multiline=O&&O.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=i(f)}_setDefaults(f){this.max=f.max!=null?f.max:Dt.prototype.max!=null?Dt.prototype.max:100,this.defaultRange=f.defaultRange?f.defaultRange:this.defaultRange.clone(),f.randInt&&(this.randInt=f.randInt)}gen(){return this._gen(this.tokens,[])}_gen(f,O){var D,T,$,R,J;switch(f.type){case u.ROOT:case u.GROUP:if(f.followedBy||f.notFollowedBy)return"";for(f.remember&&f.groupNumber===void 0&&(f.groupNumber=O.push(null)-1),D=f.options?this._randSelect(f.options):f.stack,T="",R=0,J=D.length;R<J;R++)T+=this._gen(D[R],O);return f.remember&&(O[f.groupNumber]=T),T;case u.POSITION:return"";case u.SET:{var W=this._expand(f);return W.length?String.fromCharCode(this._randSelect(W)):""}case u.REPETITION:for($=this.randInt(f.min,f.max===1/0?f.min+this.max:f.max),T="",R=0;R<$;R++)T+=this._gen(f.value,O);return T;case u.REFERENCE:return O[f.value-1]||"";case u.CHAR:{var ae=this.ignoreCase&&this._randBool()?this._toOtherCase(f.value):f.value;return String.fromCharCode(ae)}}}_toOtherCase(f){return f+(97<=f&&f<=122?-32:65<=f&&f<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(f){return f instanceof c?f.index(this.randInt(0,f.length-1)):f[this.randInt(0,f.length-1)]}_expand(f){if(f.type===i.types.CHAR)return new c(f.value);if(f.type===i.types.RANGE)return new c(f.from,f.to);{let O=new c;for(let D=0;D<f.set.length;D++){let T=this._expand(f.set[D]);if(O.add(T),this.ignoreCase)for(let $=0;$<T.length;$++){let R=T.index($),J=this._toOtherCase(R);R!==J&&O.add(J)}}return f.not?this.defaultRange.clone().subtract(O):this.defaultRange.clone().intersect(O)}}randInt(f,O){return f+Math.floor(Math.random()*(1+O-f))}get defaultRange(){return this._range=this._range||new c(32,126)}set defaultRange(f){this._range=f}static randexp(f,O){var D;return typeof f=="string"&&(f=new RegExp(f,O)),f._randexp===void 0?(D=new Dt(f,O),f._randexp=D):(D=f._randexp,D._setDefaults(f)),D.gen()}static sugar(){RegExp.prototype.gen=function(){return Dt.randexp(this)}}}}}),Ot=$e({"node_modules/yaml/dist/PlainValue-ec8e588e.js"(e){var t={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},i={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},c="tag:yaml.org,2002:",u={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function h(j){let S=[0],b=j.indexOf(`
|
|
3
3
|
`);for(;b!==-1;)b+=1,S.push(b),b=j.indexOf(`
|
|
4
4
|
`,b);return S}function f(j){let S,b;return typeof j=="string"?(S=h(j),b=j):(Array.isArray(j)&&(j=j[0]),j&&j.context&&(j.lineStarts||(j.lineStarts=h(j.context.src)),S=j.lineStarts,b=j.context.src)),{lineStarts:S,src:b}}function O(j,S){if(typeof j!="number"||j<0)return null;let{lineStarts:b,src:_}=f(S);if(!b||!_||j>_.length)return null;for(let M=0;M<b.length;++M){let E=b[M];if(j<E)return{line:M,col:j-b[M-1]+1};if(j===E)return{line:M+1,col:1}}let x=b.length;return{line:x,col:j-b[x-1]+1}}function D(j,S){let{lineStarts:b,src:_}=f(S);if(!b||!(j>=1)||j>b.length)return null;let x=b[j-1],M=b[j];for(;M&&M>x&&_[M-1]===`
|
|
5
|
-
`;)--M;return _.slice(x,M)}function T({start:j,end:S},b,_=80){let x=D(j.line,b);if(!x)return null;let{col:M}=j;if(x.length>_)if(M<=_-10)x=x.substr(0,_-1)+"\u2026";else{let G=Math.round(_/2);x.length>M+G&&(x=x.substr(0,M+G-1)+"\u2026"),M-=x.length-_,x="\u2026"+x.substr(1-_)}let E=1,I="";S&&(S.line===j.line&&M+(S.col-j.col)<=_+1?E=S.col-j.col:(E=Math.min(x.length+1,_)-M,I="\u2026"));let
|
|
6
|
-
${
|
|
5
|
+
`;)--M;return _.slice(x,M)}function T({start:j,end:S},b,_=80){let x=D(j.line,b);if(!x)return null;let{col:M}=j;if(x.length>_)if(M<=_-10)x=x.substr(0,_-1)+"\u2026";else{let G=Math.round(_/2);x.length>M+G&&(x=x.substr(0,M+G-1)+"\u2026"),M-=x.length-_,x="\u2026"+x.substr(1-_)}let E=1,I="";S&&(S.line===j.line&&M+(S.col-j.col)<=_+1?E=S.col-j.col:(E=Math.min(x.length+1,_)-M,I="\u2026"));let C=M>1?" ".repeat(M-1):"",V="^".repeat(E);return`${x}
|
|
6
|
+
${C}${V}${I}`}var $=class Ri{static copy(S){return new Ri(S.start,S.end)}constructor(S,b){this.start=S,this.end=b||S}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(S,b){let{start:_,end:x}=this;if(S.length===0||x<=S[0])return this.origStart=_,this.origEnd=x,b;let M=b;for(;M<S.length&&!(S[M]>_);)++M;this.origStart=_+M;let E=M;for(;M<S.length&&!(S[M]>=x);)++M;return this.origEnd=x+M,E}},R=class nt{static addStringTerminator(S,b,_){if(_[_.length-1]===`
|
|
7
7
|
`)return _;let x=nt.endOfWhiteSpace(S,b);return x>=S.length||S[x]===`
|
|
8
8
|
`?_+`
|
|
9
9
|
`:_}static atDocumentBoundary(S,b,_){let x=S[b];if(!x)return!0;let M=S[b-1];if(M&&M!==`
|
|
10
|
-
`)return!1;if(_){if(x!==_)return!1}else if(x!==t.DIRECTIVES_END&&x!==t.DOCUMENT_END)return!1;let E=S[b+1],I=S[b+2];if(E!==x||I!==x)return!1;let
|
|
11
|
-
`||
|
|
10
|
+
`)return!1;if(_){if(x!==_)return!1}else if(x!==t.DIRECTIVES_END&&x!==t.DOCUMENT_END)return!1;let E=S[b+1],I=S[b+2];if(E!==x||I!==x)return!1;let C=S[b+3];return!C||C===`
|
|
11
|
+
`||C===" "||C===" "}static endOfIdentifier(S,b){let _=S[b],x=_==="<",M=x?[`
|
|
12
12
|
`," "," ",">"]:[`
|
|
13
13
|
`," "," ","[","]","{","}",","];for(;_&&M.indexOf(_)===-1;)_=S[b+=1];return x&&_===">"&&(b+=1),b}static endOfIndent(S,b){let _=S[b];for(;_===" ";)_=S[b+=1];return b}static endOfLine(S,b){let _=S[b];for(;_&&_!==`
|
|
14
14
|
`;)_=S[b+=1];return b}static endOfWhiteSpace(S,b){let _=S[b];for(;_===" "||_===" ";)_=S[b+=1];return b}static startOfLine(S,b){let _=S[b-1];if(_===`
|
|
@@ -28,71 +28,71 @@ ${_}
|
|
|
28
28
|
`)}delete this.source}},W=class extends J{constructor(j,S){super("YAMLReferenceError",j,S)}},ae=class extends J{constructor(j,S){super("YAMLSemanticError",j,S)}},Q=class extends J{constructor(j,S){super("YAMLSyntaxError",j,S)}},ne=class extends J{constructor(j,S){super("YAMLWarning",j,S)}};function he(j,S,b){return S in j?Object.defineProperty(j,S,{value:b,enumerable:!0,configurable:!0,writable:!0}):j[S]=b,j}var ye=class ur extends R{static endOfLine(S,b,_){let x=S[b],M=b;for(;x&&x!==`
|
|
29
29
|
`&&!(_&&(x==="["||x==="]"||x==="{"||x==="}"||x===","));){let E=S[M+1];if(x===":"&&(!E||E===`
|
|
30
30
|
`||E===" "||E===" "||_&&E===",")||(x===" "||x===" ")&&E==="#")break;M+=1,x=E}return M}get strValue(){if(!this.valueRange||!this.context)return null;let{start:S,end:b}=this.valueRange,{src:_}=this.context,x=_[b-1];for(;S<b&&(x===`
|
|
31
|
-
`||x===" "||x===" ");)x=_[--b-1];let M="";for(let I=S;I<b;++I){let
|
|
32
|
-
`){let{fold:V,offset:G}=R.foldNewline(_,I,-1);M+=V,I=G}else if(
|
|
33
|
-
`&&(M+=I>V?_.slice(V,I+1):
|
|
34
|
-
`&&!R.atDocumentBoundary(x,M+1);I=x[M]){let
|
|
35
|
-
`?M=
|
|
36
|
-
`&&(M=ur.endOfLine(x,b,_)),this.valueRange=new $(b,M),M=R.endOfWhiteSpace(x,M),M=this.parseComment(M),(!this.hasComment||this.valueRange.isEmpty())&&(M=this.parseBlockValue(M)),M}};e.Char=t,e.Node=R,e.PlainValue=ye,e.Range=$,e.Type=i,e.YAMLError=J,e.YAMLReferenceError=W,e.YAMLSemanticError=ae,e.YAMLSyntaxError=Q,e.YAMLWarning=ne,e._defineProperty=he,e.defaultTagPrefix=
|
|
37
|
-
${o}${s}`:s}function
|
|
31
|
+
`||x===" "||x===" ");)x=_[--b-1];let M="";for(let I=S;I<b;++I){let C=_[I];if(C===`
|
|
32
|
+
`){let{fold:V,offset:G}=R.foldNewline(_,I,-1);M+=V,I=G}else if(C===" "||C===" "){let V=I,G=_[I+1];for(;I<b&&(G===" "||G===" ");)I+=1,G=_[I+1];G!==`
|
|
33
|
+
`&&(M+=I>V?_.slice(V,I+1):C)}else M+=C}let E=_[S];switch(E){case" ":{let I="Plain value cannot start with a tab character";return{errors:[new ae(this,I)],str:M}}case"@":case"`":{let I=`Plain value cannot start with reserved character ${E}`;return{errors:[new ae(this,I)],str:M}}default:return M}}parseBlockValue(S){let{indent:b,inFlow:_,src:x}=this.context,M=S,E=S;for(let I=x[M];I===`
|
|
34
|
+
`&&!R.atDocumentBoundary(x,M+1);I=x[M]){let C=R.endOfBlockIndent(x,b,M+1);if(C===null||x[C]==="#")break;x[C]===`
|
|
35
|
+
`?M=C:(E=ur.endOfLine(x,C,_),M=E)}return this.valueRange.isEmpty()&&(this.valueRange.start=S),this.valueRange.end=E,E}parse(S,b){this.context=S;let{inFlow:_,src:x}=S,M=b,E=x[M];return E&&E!=="#"&&E!==`
|
|
36
|
+
`&&(M=ur.endOfLine(x,b,_)),this.valueRange=new $(b,M),M=R.endOfWhiteSpace(x,M),M=this.parseComment(M),(!this.hasComment||this.valueRange.isEmpty())&&(M=this.parseBlockValue(M)),M}};e.Char=t,e.Node=R,e.PlainValue=ye,e.Range=$,e.Type=i,e.YAMLError=J,e.YAMLReferenceError=W,e.YAMLSemanticError=ae,e.YAMLSyntaxError=Q,e.YAMLWarning=ne,e._defineProperty=he,e.defaultTagPrefix=c,e.defaultTags=u}}),jt=$e({"node_modules/yaml/dist/resolveSeq-d03cb037.js"(e){var t=Ot();function i(s,o,a){return a?`#${a.replace(/[\s\S]^/gm,`$&${o}#`)}
|
|
37
|
+
${o}${s}`:s}function c(s,o,a){return a?a.indexOf(`
|
|
38
38
|
`)===-1?`${s} #${a}`:`${s}
|
|
39
|
-
`+a.replace(/^/gm,`${o||""}#`):s}var u=class{};function h(s,o,a){if(Array.isArray(s))return s.map((d,y)=>h(d,String(y),a));if(s&&typeof s.toJSON=="function"){let d=a&&a.anchors&&a.anchors.get(s);d&&(a.onCreate=g=>{d.res=g,delete a.onCreate});let y=s.toJSON(o,a);return d&&a.onCreate&&a.onCreate(y),y}return(!a||!a.keep)&&typeof s=="bigint"?Number(s):s}var f=class extends u{constructor(s){super(),this.value=s}toJSON(s,o){return o&&o.keep?this.value:h(this.value,s,o)}toString(){return String(this.value)}};function O(s,o,a){let d=a;for(let y=o.length-1;y>=0;--y){let g=o[y];if(Number.isInteger(g)&&g>=0){let v=[];v[g]=d,d=v}else{let v={};Object.defineProperty(v,g,{value:d,writable:!0,enumerable:!0,configurable:!0}),d=v}}return s.createNode(d,!1)}var D=s=>s==null||typeof s=="object"&&s[Symbol.iterator]().next().done,T=class ct extends u{constructor(o){super(),t._defineProperty(this,"items",[]),this.schema=o}addIn(o,a){if(D(o))this.add(a);else{let[d,...y]=o,g=this.get(d,!0);if(g instanceof ct)g.addIn(y,a);else if(g===void 0&&this.schema)this.set(d,O(this.schema,y,a));else throw new Error(`Expected YAML collection at ${d}. Remaining path: ${y}`)}}deleteIn([o,...a]){if(a.length===0)return this.delete(o);let d=this.get(o,!0);if(d instanceof ct)return d.deleteIn(a);throw new Error(`Expected YAML collection at ${o}. Remaining path: ${a}`)}getIn([o,...a],d){let y=this.get(o,!0);return a.length===0?!d&&y instanceof f?y.value:y:y instanceof ct?y.getIn(a,d):void 0}hasAllNullValues(){return this.items.every(o=>{if(!o||o.type!=="PAIR")return!1;let a=o.value;return a==null||a instanceof f&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn([o,...a]){if(a.length===0)return this.has(o);let d=this.get(o,!0);return d instanceof ct?d.hasIn(a):!1}setIn([o,...a],d){if(a.length===0)this.set(o,d);else{let y=this.get(o,!0);if(y instanceof ct)y.setIn(a,d);else if(y===void 0&&this.schema)this.set(o,O(this.schema,a,d));else throw new Error(`Expected YAML collection at ${o}. Remaining path: ${a}`)}}toJSON(){return null}toString(o,{blockItem:a,flowChars:d,isMap:y,itemIndent:g},v,A){let{indent:P,indentStep:L,stringify:B}=o,X=this.type===t.Type.FLOW_MAP||this.type===t.Type.FLOW_SEQ||o.inFlow;X&&(g+=L);let Te=y&&this.hasAllNullValues();o=Object.assign({},o,{allNullValues:Te,indent:g,inFlow:X,type:null});let oe=!1,ge=!1,se=this.items.reduce((
|
|
40
|
-
`)&&(ge=!0),X&&Re<this.items.length-1&&(De+=","),De=
|
|
39
|
+
`+a.replace(/^/gm,`${o||""}#`):s}var u=class{};function h(s,o,a){if(Array.isArray(s))return s.map((d,y)=>h(d,String(y),a));if(s&&typeof s.toJSON=="function"){let d=a&&a.anchors&&a.anchors.get(s);d&&(a.onCreate=g=>{d.res=g,delete a.onCreate});let y=s.toJSON(o,a);return d&&a.onCreate&&a.onCreate(y),y}return(!a||!a.keep)&&typeof s=="bigint"?Number(s):s}var f=class extends u{constructor(s){super(),this.value=s}toJSON(s,o){return o&&o.keep?this.value:h(this.value,s,o)}toString(){return String(this.value)}};function O(s,o,a){let d=a;for(let y=o.length-1;y>=0;--y){let g=o[y];if(Number.isInteger(g)&&g>=0){let v=[];v[g]=d,d=v}else{let v={};Object.defineProperty(v,g,{value:d,writable:!0,enumerable:!0,configurable:!0}),d=v}}return s.createNode(d,!1)}var D=s=>s==null||typeof s=="object"&&s[Symbol.iterator]().next().done,T=class ct extends u{constructor(o){super(),t._defineProperty(this,"items",[]),this.schema=o}addIn(o,a){if(D(o))this.add(a);else{let[d,...y]=o,g=this.get(d,!0);if(g instanceof ct)g.addIn(y,a);else if(g===void 0&&this.schema)this.set(d,O(this.schema,y,a));else throw new Error(`Expected YAML collection at ${d}. Remaining path: ${y}`)}}deleteIn([o,...a]){if(a.length===0)return this.delete(o);let d=this.get(o,!0);if(d instanceof ct)return d.deleteIn(a);throw new Error(`Expected YAML collection at ${o}. Remaining path: ${a}`)}getIn([o,...a],d){let y=this.get(o,!0);return a.length===0?!d&&y instanceof f?y.value:y:y instanceof ct?y.getIn(a,d):void 0}hasAllNullValues(){return this.items.every(o=>{if(!o||o.type!=="PAIR")return!1;let a=o.value;return a==null||a instanceof f&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn([o,...a]){if(a.length===0)return this.has(o);let d=this.get(o,!0);return d instanceof ct?d.hasIn(a):!1}setIn([o,...a],d){if(a.length===0)this.set(o,d);else{let y=this.get(o,!0);if(y instanceof ct)y.setIn(a,d);else if(y===void 0&&this.schema)this.set(o,O(this.schema,a,d));else throw new Error(`Expected YAML collection at ${o}. Remaining path: ${a}`)}}toJSON(){return null}toString(o,{blockItem:a,flowChars:d,isMap:y,itemIndent:g},v,A){let{indent:P,indentStep:L,stringify:B}=o,X=this.type===t.Type.FLOW_MAP||this.type===t.Type.FLOW_SEQ||o.inFlow;X&&(g+=L);let Te=y&&this.hasAllNullValues();o=Object.assign({},o,{allNullValues:Te,indent:g,inFlow:X,type:null});let oe=!1,ge=!1,se=this.items.reduce((Ne,pe,Re)=>{let fe;pe&&(!oe&&pe.spaceBefore&&Ne.push({type:"comment",str:""}),pe.commentBefore&&pe.commentBefore.match(/^.*$/gm).forEach(Fs=>{Ne.push({type:"comment",str:`#${Fs}`})}),pe.comment&&(fe=pe.comment),X&&(!oe&&pe.spaceBefore||pe.commentBefore||pe.comment||pe.key&&(pe.key.commentBefore||pe.key.comment)||pe.value&&(pe.value.commentBefore||pe.value.comment))&&(ge=!0)),oe=!1;let De=B(pe,o,()=>fe=null,()=>oe=!0);return X&&!ge&&De.includes(`
|
|
40
|
+
`)&&(ge=!0),X&&Re<this.items.length-1&&(De+=","),De=c(De,g,fe),oe&&(fe||X)&&(oe=!1),Ne.push({type:"item",str:De}),Ne},[]),me;if(se.length===0)me=d.start+d.end;else if(X){let{start:Ne,end:pe}=d,Re=se.map(fe=>fe.str);if(ge||Re.reduce((fe,De)=>fe+De.length+2,2)>ct.maxFlowStringSingleLineLength){me=Ne;for(let fe of Re)me+=fe?`
|
|
41
41
|
${L}${P}${fe}`:`
|
|
42
42
|
`;me+=`
|
|
43
|
-
${P}${pe}`}else me=`${
|
|
43
|
+
${P}${pe}`}else me=`${Ne} ${Re.join(" ")} ${pe}`}else{let Ne=se.map(a);me=Ne.shift();for(let pe of Ne)me+=pe?`
|
|
44
44
|
${P}${pe}`:`
|
|
45
45
|
`}return this.comment?(me+=`
|
|
46
|
-
`+this.comment.replace(/^/gm,`${P}#`),v&&v()):oe&&A&&A(),me}};t._defineProperty(T,"maxFlowStringSingleLineLength",60);function $(s){let o=s instanceof f?s.value:s;return o&&typeof o=="string"&&(o=Number(o)),Number.isInteger(o)&&o>=0?o:null}var R=class extends T{add(s){this.items.push(s)}delete(s){let o=$(s);return typeof o!="number"?!1:this.items.splice(o,1).length>0}get(s,o){let a=$(s);if(typeof a!="number")return;let d=this.items[a];return!o&&d instanceof f?d.value:d}has(s){let o=$(s);return typeof o=="number"&&o<this.items.length}set(s,o){let a=$(s);if(typeof a!="number")throw new Error(`Expected a valid index, not ${s}.`);this.items[a]=o}toJSON(s,o){let a=[];o&&o.onCreate&&o.onCreate(a);let d=0;for(let y of this.items)a.push(h(y,String(d++),o));return a}toString(s,o,a){return s?super.toString(s,{blockItem:d=>d.type==="comment"?d.str:`- ${d.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(s.indent||"")+" "},o,a):JSON.stringify(this)}},J=(s,o,a)=>o===null?"":typeof o!="object"?String(o):s instanceof u&&a&&a.doc?s.toString({anchors:Object.create(null),doc:a.doc,indent:"",indentStep:a.indentStep,inFlow:!0,inStringifyKey:!0,stringify:a.stringify}):JSON.stringify(o),W=class Ei extends u{constructor(o,a=null){super(),this.key=o,this.value=a,this.type=Ei.Type.PAIR}get commentBefore(){return this.key instanceof u?this.key.commentBefore:void 0}set commentBefore(o){if(this.key==null&&(this.key=new f(null)),this.key instanceof u)this.key.commentBefore=o;else{let a="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(a)}}addToJSMap(o,a){let d=h(this.key,"",o);if(a instanceof Map){let y=h(this.value,d,o);a.set(d,y)}else if(a instanceof Set)a.add(d);else{let y=J(this.key,d,o),g=h(this.value,y,o);y in a?Object.defineProperty(a,y,{value:g,writable:!0,enumerable:!0,configurable:!0}):a[y]=g}return a}toJSON(o,a){let d=a&&a.mapAsMap?new Map:{};return this.addToJSMap(a,d)}toString(o,a,d){if(!o||!o.doc)return JSON.stringify(this);let{indent:y,indentSeq:g,simpleKeys:v}=o.doc.options,{key:A,value:P}=this,L=A instanceof u&&A.comment;if(v){if(L)throw new Error("With simple keys, key nodes cannot have comments");if(A instanceof T){let De="With simple keys, collection cannot be used as a key value";throw new Error(De)}}let B=!v&&(!A||L||(A instanceof u?A instanceof T||A.type===t.Type.BLOCK_FOLDED||A.type===t.Type.BLOCK_LITERAL:typeof A=="object")),{doc:X,indent:Te,indentStep:oe,stringify:ge}=o;o=Object.assign({},o,{implicitKey:!B,indent:Te+oe});let se=!1,me=ge(A,o,()=>L=null,()=>se=!0);if(me=
|
|
47
|
-
${Te}:`:`${me}:`,this.comment&&(me=
|
|
48
|
-
`),P.commentBefore){let De=P.commentBefore.replace(/^/gm,`${o.indent}#`);
|
|
49
|
-
${De}`}pe=P.comment}else P&&typeof P=="object"&&(P=X.schema.createNode(P,!0));o.implicitKey=!1,!B&&!this.comment&&P instanceof f&&(o.indentAtStart=me.length+1),se=!1,!g&&y>=2&&!o.inFlow&&!B&&P instanceof R&&P.type!==t.Type.FLOW_SEQ&&!P.tag&&!X.anchors.getName(P)&&(o.indent=o.indent.substr(2));let Re=ge(P,o,()=>pe=null,()=>se=!0),fe=" ";return
|
|
46
|
+
`+this.comment.replace(/^/gm,`${P}#`),v&&v()):oe&&A&&A(),me}};t._defineProperty(T,"maxFlowStringSingleLineLength",60);function $(s){let o=s instanceof f?s.value:s;return o&&typeof o=="string"&&(o=Number(o)),Number.isInteger(o)&&o>=0?o:null}var R=class extends T{add(s){this.items.push(s)}delete(s){let o=$(s);return typeof o!="number"?!1:this.items.splice(o,1).length>0}get(s,o){let a=$(s);if(typeof a!="number")return;let d=this.items[a];return!o&&d instanceof f?d.value:d}has(s){let o=$(s);return typeof o=="number"&&o<this.items.length}set(s,o){let a=$(s);if(typeof a!="number")throw new Error(`Expected a valid index, not ${s}.`);this.items[a]=o}toJSON(s,o){let a=[];o&&o.onCreate&&o.onCreate(a);let d=0;for(let y of this.items)a.push(h(y,String(d++),o));return a}toString(s,o,a){return s?super.toString(s,{blockItem:d=>d.type==="comment"?d.str:`- ${d.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(s.indent||"")+" "},o,a):JSON.stringify(this)}},J=(s,o,a)=>o===null?"":typeof o!="object"?String(o):s instanceof u&&a&&a.doc?s.toString({anchors:Object.create(null),doc:a.doc,indent:"",indentStep:a.indentStep,inFlow:!0,inStringifyKey:!0,stringify:a.stringify}):JSON.stringify(o),W=class Ei extends u{constructor(o,a=null){super(),this.key=o,this.value=a,this.type=Ei.Type.PAIR}get commentBefore(){return this.key instanceof u?this.key.commentBefore:void 0}set commentBefore(o){if(this.key==null&&(this.key=new f(null)),this.key instanceof u)this.key.commentBefore=o;else{let a="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(a)}}addToJSMap(o,a){let d=h(this.key,"",o);if(a instanceof Map){let y=h(this.value,d,o);a.set(d,y)}else if(a instanceof Set)a.add(d);else{let y=J(this.key,d,o),g=h(this.value,y,o);y in a?Object.defineProperty(a,y,{value:g,writable:!0,enumerable:!0,configurable:!0}):a[y]=g}return a}toJSON(o,a){let d=a&&a.mapAsMap?new Map:{};return this.addToJSMap(a,d)}toString(o,a,d){if(!o||!o.doc)return JSON.stringify(this);let{indent:y,indentSeq:g,simpleKeys:v}=o.doc.options,{key:A,value:P}=this,L=A instanceof u&&A.comment;if(v){if(L)throw new Error("With simple keys, key nodes cannot have comments");if(A instanceof T){let De="With simple keys, collection cannot be used as a key value";throw new Error(De)}}let B=!v&&(!A||L||(A instanceof u?A instanceof T||A.type===t.Type.BLOCK_FOLDED||A.type===t.Type.BLOCK_LITERAL:typeof A=="object")),{doc:X,indent:Te,indentStep:oe,stringify:ge}=o;o=Object.assign({},o,{implicitKey:!B,indent:Te+oe});let se=!1,me=ge(A,o,()=>L=null,()=>se=!0);if(me=c(me,o.indent,L),!B&&me.length>1024){if(v)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");B=!0}if(o.allNullValues&&!v)return this.comment?(me=c(me,o.indent,this.comment),a&&a()):se&&!L&&d&&d(),o.inFlow&&!B?me:`? ${me}`;me=B?`? ${me}
|
|
47
|
+
${Te}:`:`${me}:`,this.comment&&(me=c(me,o.indent,this.comment),a&&a());let Ne="",pe=null;if(P instanceof u){if(P.spaceBefore&&(Ne=`
|
|
48
|
+
`),P.commentBefore){let De=P.commentBefore.replace(/^/gm,`${o.indent}#`);Ne+=`
|
|
49
|
+
${De}`}pe=P.comment}else P&&typeof P=="object"&&(P=X.schema.createNode(P,!0));o.implicitKey=!1,!B&&!this.comment&&P instanceof f&&(o.indentAtStart=me.length+1),se=!1,!g&&y>=2&&!o.inFlow&&!B&&P instanceof R&&P.type!==t.Type.FLOW_SEQ&&!P.tag&&!X.anchors.getName(P)&&(o.indent=o.indent.substr(2));let Re=ge(P,o,()=>pe=null,()=>se=!0),fe=" ";return Ne||this.comment?fe=`${Ne}
|
|
50
50
|
${o.indent}`:!B&&P instanceof T?(!(Re[0]==="["||Re[0]==="{")||Re.includes(`
|
|
51
51
|
`))&&(fe=`
|
|
52
52
|
${o.indent}`):Re[0]===`
|
|
53
|
-
`&&(fe=""),se&&!pe&&d&&d(),
|
|
54
|
-
`);a=s[o+1]}return o};function ee(s,o,a,{indentAtStart:d,lineWidth:y=80,minContentWidth:g=20,onFold:v,onOverflow:A}){if(!y||y<0)return s;let P=Math.max(1+g,1+y-o.length);if(s.length<=P)return s;let L=[],B={},X=y-o.length;typeof d=="number"&&(d>y-Math.max(2,g)?L.push(0):X=y-d);let Te,oe,ge=!1,se=-1,me=-1,
|
|
55
|
-
`)a===
|
|
53
|
+
`&&(fe=""),se&&!pe&&d&&d(),c(me+fe+Re,o.indent,pe)}};t._defineProperty(W,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var ae=(s,o)=>{if(s instanceof Q){let a=o.get(s.source);return a.count*a.aliasCount}else if(s instanceof T){let a=0;for(let d of s.items){let y=ae(d,o);y>a&&(a=y)}return a}else if(s instanceof W){let a=ae(s.key,o),d=ae(s.value,o);return Math.max(a,d)}return 1},Q=class _i extends u{static stringify({range:o,source:a},{anchors:d,doc:y,implicitKey:g,inStringifyKey:v}){let A=Object.keys(d).find(L=>d[L]===a);if(!A&&v&&(A=y.anchors.getName(a)||y.anchors.newName()),A)return`*${A}${g?" ":""}`;let P=y.anchors.getName(a)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${P} [${o}]`)}constructor(o){super(),this.source=o,this.type=t.Type.ALIAS}set tag(o){throw new Error("Alias nodes cannot have tags")}toJSON(o,a){if(!a)return h(this.source,o,a);let{anchors:d,maxAliasCount:y}=a,g=d.get(this.source);if(!g||g.res===void 0){let v="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new t.YAMLReferenceError(this.cstNode,v):new ReferenceError(v)}if(y>=0&&(g.count+=1,g.aliasCount===0&&(g.aliasCount=ae(this.source,d)),g.count*g.aliasCount>y)){let v="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new t.YAMLReferenceError(this.cstNode,v):new ReferenceError(v)}return g.res}toString(o){return _i.stringify(this,o)}};t._defineProperty(Q,"default",!0);function ne(s,o){let a=o instanceof f?o.value:o;for(let d of s)if(d instanceof W&&(d.key===o||d.key===a||d.key&&d.key.value===a))return d}var he=class extends T{add(s,o){s?s instanceof W||(s=new W(s.key||s,s.value)):s=new W(s);let a=ne(this.items,s.key),d=this.schema&&this.schema.sortMapEntries;if(a)if(o)a.value=s.value;else throw new Error(`Key ${s.key} already set`);else if(d){let y=this.items.findIndex(g=>d(s,g)<0);y===-1?this.items.push(s):this.items.splice(y,0,s)}else this.items.push(s)}delete(s){let o=ne(this.items,s);return o?this.items.splice(this.items.indexOf(o),1).length>0:!1}get(s,o){let a=ne(this.items,s),d=a&&a.value;return!o&&d instanceof f?d.value:d}has(s){return!!ne(this.items,s)}set(s,o){this.add(new W(s,o),!0)}toJSON(s,o,a){let d=a?new a:o&&o.mapAsMap?new Map:{};o&&o.onCreate&&o.onCreate(d);for(let y of this.items)y.addToJSMap(o,d);return d}toString(s,o,a){if(!s)return JSON.stringify(this);for(let d of this.items)if(!(d instanceof W))throw new Error(`Map items must all be pairs; found ${JSON.stringify(d)} instead`);return super.toString(s,{blockItem:d=>d.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:s.indent||""},o,a)}},ye="<<",j=class extends W{constructor(s){if(s instanceof W){let o=s.value;o instanceof R||(o=new R,o.items.push(s.value),o.range=s.value.range),super(s.key,o),this.range=s.range}else super(new f(ye),new R);this.type=W.Type.MERGE_PAIR}addToJSMap(s,o){for(let{source:a}of this.value.items){if(!(a instanceof he))throw new Error("Merge sources must be maps");let d=a.toJSON(null,s,Map);for(let[y,g]of d)o instanceof Map?o.has(y)||o.set(y,g):o instanceof Set?o.add(y):Object.prototype.hasOwnProperty.call(o,y)||Object.defineProperty(o,y,{value:g,writable:!0,enumerable:!0,configurable:!0})}return o}toString(s,o){let a=this.value;if(a.items.length>1)return super.toString(s,o);this.value=a.items[0];let d=super.toString(s,o);return this.value=a,d}},S={defaultType:t.Type.BLOCK_LITERAL,lineWidth:76},b={trueStr:"true",falseStr:"false"},_={asBigInt:!1},x={nullStr:"null"},M={defaultType:t.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function E(s,o,a){for(let{format:d,test:y,resolve:g}of o)if(y){let v=s.match(y);if(v){let A=g.apply(null,v);return A instanceof f||(A=new f(A)),d&&(A.format=d),A}}return a&&(s=a(s)),new f(s)}var I="flow",C="block",V="quoted",G=(s,o)=>{let a=s[o+1];for(;a===" "||a===" ";){do a=s[o+=1];while(a&&a!==`
|
|
54
|
+
`);a=s[o+1]}return o};function ee(s,o,a,{indentAtStart:d,lineWidth:y=80,minContentWidth:g=20,onFold:v,onOverflow:A}){if(!y||y<0)return s;let P=Math.max(1+g,1+y-o.length);if(s.length<=P)return s;let L=[],B={},X=y-o.length;typeof d=="number"&&(d>y-Math.max(2,g)?L.push(0):X=y-d);let Te,oe,ge=!1,se=-1,me=-1,Ne=-1;a===C&&(se=G(s,se),se!==-1&&(X=se+P));for(let Re;Re=s[se+=1];){if(a===V&&Re==="\\"){switch(me=se,s[se+1]){case"x":se+=3;break;case"u":se+=5;break;case"U":se+=9;break;default:se+=1}Ne=se}if(Re===`
|
|
55
|
+
`)a===C&&(se=G(s,se)),X=se+P,Te=void 0;else{if(Re===" "&&oe&&oe!==" "&&oe!==`
|
|
56
56
|
`&&oe!==" "){let fe=s[se+1];fe&&fe!==" "&&fe!==`
|
|
57
|
-
`&&fe!==" "&&(Te=se)}if(se>=X)if(Te)L.push(Te),X=Te+P,Te=void 0;else if(a===V){for(;oe===" "||oe===" ";)oe=Re,Re=s[se+=1],ge=!0;let fe=se>
|
|
57
|
+
`&&fe!==" "&&(Te=se)}if(se>=X)if(Te)L.push(Te),X=Te+P,Te=void 0;else if(a===V){for(;oe===" "||oe===" ";)oe=Re,Re=s[se+=1],ge=!0;let fe=se>Ne+1?se-2:me-1;if(B[fe])return s;L.push(fe),B[fe]=!0,X=fe+P,Te=void 0}else ge=!0}oe=Re}if(ge&&A&&A(),L.length===0)return s;v&&v();let pe=s.slice(0,L[0]);for(let Re=0;Re<L.length;++Re){let fe=L[Re],De=L[Re+1]||s.length;fe===0?pe=`
|
|
58
58
|
${o}${s.slice(0,De)}`:(a===V&&B[fe]&&(pe+=`${s[fe]}\\`),pe+=`
|
|
59
59
|
${o}${s.slice(fe+1,De)}`)}return pe}var ve=({indentAtStart:s})=>s?Object.assign({indentAtStart:s},M.fold):M.fold,Ae=s=>/^(%|---|\.\.\.)/m.test(s);function Ee(s,o,a){if(!o||o<0)return!1;let d=o-a,y=s.length;if(y<=d)return!1;for(let g=0,v=0;g<y;++g)if(s[g]===`
|
|
60
|
-
`){if(g-v>d)return!0;if(v=g+1,y-v<=d)return!1}return!0}function
|
|
60
|
+
`){if(g-v>d)return!0;if(v=g+1,y-v<=d)return!1}return!0}function Ie(s,o){let{implicitKey:a}=o,{jsonEncoding:d,minMultiLineLength:y}=M.doubleQuoted,g=JSON.stringify(s);if(d)return g;let v=o.indent||(Ae(s)?" ":""),A="",P=0;for(let L=0,B=g[L];B;B=g[++L])if(B===" "&&g[L+1]==="\\"&&g[L+2]==="n"&&(A+=g.slice(P,L)+"\\ ",L+=1,P=L,B="\\"),B==="\\")switch(g[L+1]){case"u":{A+=g.slice(P,L);let X=g.substr(L+2,4);switch(X){case"0000":A+="\\0";break;case"0007":A+="\\a";break;case"000b":A+="\\v";break;case"001b":A+="\\e";break;case"0085":A+="\\N";break;case"00a0":A+="\\_";break;case"2028":A+="\\L";break;case"2029":A+="\\P";break;default:X.substr(0,2)==="00"?A+="\\x"+X.substr(2):A+=g.substr(L,6)}L+=5,P=L+1}break;case"n":if(a||g[L+2]==='"'||g.length<y)L+=1;else{for(A+=g.slice(P,L)+`
|
|
61
61
|
|
|
62
62
|
`;g[L+2]==="\\"&&g[L+3]==="n"&&g[L+4]!=='"';)A+=`
|
|
63
|
-
`,L+=2;A+=v,g[L+2]===" "&&(A+="\\"),L+=1,P=L+1}break;default:L+=1}return A=P?A+g.slice(P):g,a?A:ee(A,v,V,ve(o))}function Me(s,o){if(o.implicitKey){if(/\n/.test(s))return
|
|
64
|
-
${a}`)+"'";return o.implicitKey?d:ee(d,a,I,ve(o))}function Y({comment:s,type:o,value:a},d,y,g){if(/\n[\t ]+$/.test(a)||/^\s*$/.test(a))return
|
|
63
|
+
`,L+=2;A+=v,g[L+2]===" "&&(A+="\\"),L+=1,P=L+1}break;default:L+=1}return A=P?A+g.slice(P):g,a?A:ee(A,v,V,ve(o))}function Me(s,o){if(o.implicitKey){if(/\n/.test(s))return Ie(s,o)}else if(/[ \t]\n|\n[ \t]/.test(s))return Ie(s,o);let a=o.indent||(Ae(s)?" ":""),d="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
64
|
+
${a}`)+"'";return o.implicitKey?d:ee(d,a,I,ve(o))}function Y({comment:s,type:o,value:a},d,y,g){if(/\n[\t ]+$/.test(a)||/^\s*$/.test(a))return Ie(a,d);let v=d.indent||(d.forceBlockIndent||Ae(a)?" ":""),A=v?"2":"1",P=o===t.Type.BLOCK_FOLDED?!1:o===t.Type.BLOCK_LITERAL?!0:!Ee(a,M.fold.lineWidth,v.length),L=P?"|":">";if(!a)return L+`
|
|
65
65
|
`;let B="",X="";if(a=a.replace(/[\n\t ]*$/,oe=>{let ge=oe.indexOf(`
|
|
66
66
|
`);return ge===-1?L+="-":(a===oe||ge!==oe.length-1)&&(L+="+",g&&g()),X=oe.replace(/\n$/,""),""}).replace(/^[\n ]*/,oe=>{oe.indexOf(" ")!==-1&&(L+=A);let ge=oe.match(/ +$/);return ge?(B=oe.slice(0,-ge[0].length),ge[0]):(B=oe,"")}),X&&(X=X.replace(/\n+(?!\n|$)/g,`$&${v}`)),B&&(B=B.replace(/\n+/g,`$&${v}`)),s&&(L+=" #"+s.replace(/ ?[\r\n]+/g," "),y&&y()),!a)return`${L}${A}
|
|
67
67
|
${v}${X}`;if(P)return a=a.replace(/\n+/g,`$&${v}`),`${L}
|
|
68
68
|
${v}${B}${a}${X}`;a=a.replace(/\n+/g,`
|
|
69
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${v}`);let Te=ee(`${B}${a}${X}`,v,
|
|
70
|
-
${v}${Te}`}function m(s,o,a,d){let{comment:y,type:g,value:v}=s,{actualString:A,implicitKey:P,indent:L,inFlow:B}=o;if(P&&/[\n[\]{},]/.test(v)||B&&/[[\]{},]/.test(v))return
|
|
71
|
-
`)===-1?v.indexOf('"')!==-1&&v.indexOf("'")===-1?Me(v,o):
|
|
69
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${v}`);let Te=ee(`${B}${a}${X}`,v,C,M.fold);return`${L}
|
|
70
|
+
${v}${Te}`}function m(s,o,a,d){let{comment:y,type:g,value:v}=s,{actualString:A,implicitKey:P,indent:L,inFlow:B}=o;if(P&&/[\n[\]{},]/.test(v)||B&&/[[\]{},]/.test(v))return Ie(v,o);if(!v||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(v))return P||B||v.indexOf(`
|
|
71
|
+
`)===-1?v.indexOf('"')!==-1&&v.indexOf("'")===-1?Me(v,o):Ie(v,o):Y(s,o,a,d);if(!P&&!B&&g!==t.Type.PLAIN&&v.indexOf(`
|
|
72
72
|
`)!==-1)return Y(s,o,a,d);if(L===""&&Ae(v))return o.forceBlockIndent=!0,Y(s,o,a,d);let X=v.replace(/\n+/g,`$&
|
|
73
|
-
${L}`);if(A){let{tags:oe}=o.doc.schema;if(typeof E(X,oe,oe.scalarFallback).value!="string")return
|
|
73
|
+
${L}`);if(A){let{tags:oe}=o.doc.schema;if(typeof E(X,oe,oe.scalarFallback).value!="string")return Ie(v,o)}let Te=P?X:ee(X,L,I,ve(o));return y&&!B&&(Te.indexOf(`
|
|
74
74
|
`)!==-1||y.indexOf(`
|
|
75
|
-
`)!==-1)?(a&&a(),i(Te,L,y)):Te}function N(s,o,a,d){let{defaultType:y}=M,{implicitKey:g,inFlow:v}=o,{type:A,value:P}=s;typeof P!="string"&&(P=String(P),s=Object.assign({},s,{value:P}));let L=X=>{switch(X){case t.Type.BLOCK_FOLDED:case t.Type.BLOCK_LITERAL:return Y(s,o,a,d);case t.Type.QUOTE_DOUBLE:return
|
|
75
|
+
`)!==-1)?(a&&a(),i(Te,L,y)):Te}function N(s,o,a,d){let{defaultType:y}=M,{implicitKey:g,inFlow:v}=o,{type:A,value:P}=s;typeof P!="string"&&(P=String(P),s=Object.assign({},s,{value:P}));let L=X=>{switch(X){case t.Type.BLOCK_FOLDED:case t.Type.BLOCK_LITERAL:return Y(s,o,a,d);case t.Type.QUOTE_DOUBLE:return Ie(P,o);case t.Type.QUOTE_SINGLE:return Me(P,o);case t.Type.PLAIN:return m(s,o,a,d);default:return null}};(A!==t.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(P)||(g||v)&&(A===t.Type.BLOCK_FOLDED||A===t.Type.BLOCK_LITERAL))&&(A=t.Type.QUOTE_DOUBLE);let B=L(A);if(B===null&&(B=L(y),B===null))throw new Error(`Unsupported default string type ${y}`);return B}function K({format:s,minFractionDigits:o,tag:a,value:d}){if(typeof d=="bigint")return String(d);if(!isFinite(d))return isNaN(d)?".nan":d<0?"-.inf":".inf";let y=JSON.stringify(d);if(!s&&o&&(!a||a==="tag:yaml.org,2002:float")&&/^\d/.test(y)){let g=y.indexOf(".");g<0&&(g=y.length,y+=".");let v=o-(y.length-g-1);for(;v-- >0;)y+="0"}return y}function H(s,o){let a,d;switch(o.type){case t.Type.FLOW_MAP:a="}",d="flow map";break;case t.Type.FLOW_SEQ:a="]",d="flow sequence";break;default:s.push(new t.YAMLSemanticError(o,"Not a flow collection!?"));return}let y;for(let g=o.items.length-1;g>=0;--g){let v=o.items[g];if(!v||v.type!==t.Type.COMMENT){y=v;break}}if(y&&y.char!==a){let g=`Expected ${d} to end with ${a}`,v;typeof y.offset=="number"?(v=new t.YAMLSemanticError(o,g),v.offset=y.offset+1):(v=new t.YAMLSemanticError(y,g),y.range&&y.range.end&&(v.offset=y.range.end-y.range.start)),s.push(v)}}function ie(s,o){let a=o.context.src[o.range.start-1];if(a!==`
|
|
76
76
|
`&&a!==" "&&a!==" "){let d="Comments must be separated from other tokens by white space characters";s.push(new t.YAMLSemanticError(o,d))}}function le(s,o){let a=String(o),d=a.substr(0,8)+"..."+a.substr(-8);return new t.YAMLSemanticError(s,`The "${d}" key is too long`)}function Ye(s,o){for(let{afterKey:a,before:d,comment:y}of o){let g=s.items[d];g?(a&&g.value&&(g=g.value),y===void 0?(a||!g.commentBefore)&&(g.spaceBefore=!0):g.commentBefore?g.commentBefore+=`
|
|
77
77
|
`+y:g.commentBefore=y):y!==void 0&&(s.comment?s.comment+=`
|
|
78
78
|
`+y:s.comment=y)}}function Qe(s,o){let a=o.strValue;return a?typeof a=="string"?a:(a.errors.forEach(d=>{d.source||(d.source=o),s.errors.push(d)}),a.str):""}function Ze(s,o){let{handle:a,suffix:d}=o.tag,y=s.tagPrefixes.find(g=>g.handle===a);if(!y){let g=s.getDefaults().tagPrefixes;if(g&&(y=g.find(v=>v.handle===a)),!y)throw new t.YAMLSemanticError(o,`The ${a} tag handle is non-default and was not declared.`)}if(!d)throw new t.YAMLSemanticError(o,`The ${a} tag has no suffix.`);if(a==="!"&&(s.version||s.options.version)==="1.0"){if(d[0]==="^")return s.warnings.push(new t.YAMLWarning(o,"YAML 1.0 ^ tag expansion is not supported")),d;if(/[:/]/.test(d)){let g=d.match(/^([a-z0-9-]+)\/(.*)/i);return g?`tag:${g[1]}.yaml.org,2002:${g[2]}`:`tag:${d}`}}return y.prefix+decodeURIComponent(d)}function ze(s,o){let{tag:a,type:d}=o,y=!1;if(a){let{handle:g,suffix:v,verbatim:A}=a;if(A){if(A!=="!"&&A!=="!!")return A;let P=`Verbatim tags aren't resolved, so ${A} is invalid.`;s.errors.push(new t.YAMLSemanticError(o,P))}else if(g==="!"&&!v)y=!0;else try{return Ze(s,o)}catch(P){s.errors.push(P)}}switch(d){case t.Type.BLOCK_FOLDED:case t.Type.BLOCK_LITERAL:case t.Type.QUOTE_DOUBLE:case t.Type.QUOTE_SINGLE:return t.defaultTags.STR;case t.Type.FLOW_MAP:case t.Type.MAP:return t.defaultTags.MAP;case t.Type.FLOW_SEQ:case t.Type.SEQ:return t.defaultTags.SEQ;case t.Type.PLAIN:return y?t.defaultTags.STR:null;default:return null}}function _t(s,o,a){let{tags:d}=s.schema,y=[];for(let v of d)if(v.tag===a)if(v.test)y.push(v);else{let A=v.resolve(s,o);return A instanceof T?A:new f(A)}let g=Qe(s,o);return typeof g=="string"&&y.length>0?E(g,y,d.scalarFallback):null}function Gt({type:s}){switch(s){case t.Type.FLOW_MAP:case t.Type.MAP:return t.defaultTags.MAP;case t.Type.FLOW_SEQ:case t.Type.SEQ:return t.defaultTags.SEQ;default:return t.defaultTags.STR}}function Es(s,o,a){try{let d=_t(s,o,a);if(d)return a&&o.tag&&(d.tag=a),d}catch(d){return d.source||(d.source=o),s.errors.push(d),null}try{let d=Gt(o);if(!d)throw new Error(`The tag ${a} is unavailable`);let y=`The tag ${a} is unavailable, falling back to ${d}`;s.warnings.push(new t.YAMLWarning(o,y));let g=_t(s,o,d);return g.tag=a,g}catch(d){let y=new t.YAMLReferenceError(o,d.message);return y.stack=d.stack,s.errors.push(y),null}}var _s=s=>{if(!s)return!1;let{type:o}=s;return o===t.Type.MAP_KEY||o===t.Type.MAP_VALUE||o===t.Type.SEQ_ITEM};function Ps(s,o){let a={before:[],after:[]},d=!1,y=!1,g=_s(o.context.parent)?o.context.parent.props.concat(o.props):o.props;for(let{start:v,end:A}of g)switch(o.context.src[v]){case t.Char.COMMENT:{if(!o.commentHasRequiredWhitespace(v)){let X="Comments must be separated from other tokens by white space characters";s.push(new t.YAMLSemanticError(o,X))}let{header:P,valueRange:L}=o;(L&&(v>L.start||P&&v>P.start)?a.after:a.before).push(o.context.src.slice(v+1,A));break}case t.Char.ANCHOR:if(d){let P="A node can have at most one anchor";s.push(new t.YAMLSemanticError(o,P))}d=!0;break;case t.Char.TAG:if(y){let P="A node can have at most one tag";s.push(new t.YAMLSemanticError(o,P))}y=!0;break}return{comments:a,hasAnchor:d,hasTag:y}}function xs(s,o){let{anchors:a,errors:d,schema:y}=s;if(o.type===t.Type.ALIAS){let v=o.rawValue,A=a.getNode(v);if(!A){let L=`Aliased anchor not found: ${v}`;return d.push(new t.YAMLReferenceError(o,L)),null}let P=new Q(A);return a._cstAliases.push(P),P}let g=ze(s,o);if(g)return Es(s,o,g);if(o.type!==t.Type.PLAIN){let v=`Failed to resolve ${o.type} node here`;return d.push(new t.YAMLSyntaxError(o,v)),null}try{let v=Qe(s,o);return E(v,y.tags,y.tags.scalarFallback)}catch(v){return v.source||(v.source=o),d.push(v),null}}function it(s,o){if(!o)return null;o.error&&s.errors.push(o.error);let{comments:a,hasAnchor:d,hasTag:y}=Ps(s.errors,o);if(d){let{anchors:v}=s,A=o.anchor,P=v.getNode(A);P&&(v.map[v.newName(A)]=P),v.map[A]=o}if(o.type===t.Type.ALIAS&&(d||y)){let v="An alias node must not specify any properties";s.errors.push(new t.YAMLSemanticError(o,v))}let g=xs(s,o);if(g){g.range=[o.range.start,o.range.end],s.options.keepCstNodes&&(g.cstNode=o),s.options.keepNodeTypes&&(g.type=o.type);let v=a.before.join(`
|
|
79
79
|
`);v&&(g.commentBefore=g.commentBefore?`${g.commentBefore}
|
|
80
80
|
${v}`:v);let A=a.after.join(`
|
|
81
81
|
`);A&&(g.comment=g.comment?`${g.comment}
|
|
82
|
-
${A}`:A)}return o.resolved=g}function Is(s,o){if(o.type!==t.Type.MAP&&o.type!==t.Type.FLOW_MAP){let v=`A ${o.type} node cannot be resolved as a mapping`;return s.errors.push(new t.YAMLSyntaxError(o,v)),null}let{comments:a,items:d}=o.type===t.Type.FLOW_MAP?Ms(s,o):
|
|
83
|
-
`)return!1;return!0};function
|
|
84
|
-
`){let me="Implicit keys of flow sequence pairs need to be on a single line";s.errors.push(new t.YAMLSemanticError(P,me));break}}}else g=null;v=null,y=!1,A=null}else if(A==="["||X!=="]"||L<o.items.length-1){let oe=`Flow sequence contains an unexpected ${X}`,ge=new t.YAMLSyntaxError(o,oe);ge.offset=Te,s.errors.push(ge)}}else if(B.type===t.Type.BLANK_LINE)a.push({before:d.length});else if(B.type===t.Type.COMMENT)ie(s.errors,B),a.push({comment:B.comment,before:d.length});else{if(A){let Te=`Expected a ${A} in flow sequence`;s.errors.push(new t.YAMLSemanticError(B,Te))}let X=it(s,B);g===void 0?(d.push(X),P=B):(d.push(new W(g,X)),g=void 0),v=B.range.start,A=","}}return H(s.errors,o),g!==void 0&&d.push(new W(g)),{comments:a,items:d}}e.Alias=Q,e.Collection=T,e.Merge=j,e.Node=u,e.Pair=W,e.Scalar=f,e.YAMLMap=he,e.YAMLSeq=R,e.addComment=
|
|
85
|
-
`:" ")}return i.stringifyString({comment:E,type:I,value:
|
|
82
|
+
${A}`:A)}return o.resolved=g}function Is(s,o){if(o.type!==t.Type.MAP&&o.type!==t.Type.FLOW_MAP){let v=`A ${o.type} node cannot be resolved as a mapping`;return s.errors.push(new t.YAMLSyntaxError(o,v)),null}let{comments:a,items:d}=o.type===t.Type.FLOW_MAP?Ms(s,o):ks(s,o),y=new he;y.items=d,Ye(y,a);let g=!1;for(let v=0;v<d.length;++v){let{key:A}=d[v];if(A instanceof T&&(g=!0),s.schema.merge&&A&&A.value===ye){d[v]=new j(d[v]);let P=d[v].value.items,L=null;P.some(B=>{if(B instanceof Q){let{type:X}=B.source;return X===t.Type.MAP||X===t.Type.FLOW_MAP?!1:L="Merge nodes aliases can only point to maps"}return L="Merge nodes can only have Alias nodes as values"}),L&&s.errors.push(new t.YAMLSemanticError(o,L))}else for(let P=v+1;P<d.length;++P){let{key:L}=d[P];if(A===L||A&&L&&Object.prototype.hasOwnProperty.call(A,"value")&&A.value===L.value){let B=`Map keys must be unique; "${A}" is repeated`;s.errors.push(new t.YAMLSemanticError(o,B));break}}}if(g&&!s.options.mapAsMap){let v="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";s.warnings.push(new t.YAMLWarning(o,v))}return o.resolved=y,y}var Ns=({context:{lineStart:s,node:o,src:a},props:d})=>{if(d.length===0)return!1;let{start:y}=d[0];if(o&&y>o.valueRange.start||a[y]!==t.Char.COMMENT)return!1;for(let g=s;g<y;++g)if(a[g]===`
|
|
83
|
+
`)return!1;return!0};function Cs(s,o){if(!Ns(s))return;let a=s.getPropValue(0,t.Char.COMMENT,!0),d=!1,y=o.value.commentBefore;if(y&&y.startsWith(a))o.value.commentBefore=y.substr(a.length+1),d=!0;else{let g=o.value.comment;!s.node&&g&&g.startsWith(a)&&(o.value.comment=g.substr(a.length+1),d=!0)}d&&(o.comment=a)}function ks(s,o){let a=[],d=[],y,g=null;for(let v=0;v<o.items.length;++v){let A=o.items[v];switch(A.type){case t.Type.BLANK_LINE:a.push({afterKey:!!y,before:d.length});break;case t.Type.COMMENT:a.push({afterKey:!!y,before:d.length,comment:A.comment});break;case t.Type.MAP_KEY:y!==void 0&&d.push(new W(y)),A.error&&s.errors.push(A.error),y=it(s,A.node),g=null;break;case t.Type.MAP_VALUE:{if(y===void 0&&(y=null),A.error&&s.errors.push(A.error),!A.context.atLineStart&&A.node&&A.node.type===t.Type.MAP&&!A.node.context.atLineStart){let B="Nested mappings are not allowed in compact mappings";s.errors.push(new t.YAMLSemanticError(A.node,B))}let P=A.node;if(!P&&A.props.length>0){P=new t.PlainValue(t.Type.PLAIN,[]),P.context={parent:A,src:A.context.src};let B=A.range.start+1;if(P.range={start:B,end:B},P.valueRange={start:B,end:B},typeof A.range.origStart=="number"){let X=A.range.origStart+1;P.range.origStart=P.range.origEnd=X,P.valueRange.origStart=P.valueRange.origEnd=X}}let L=new W(y,it(s,P));Cs(A,L),d.push(L),y&&typeof g=="number"&&A.range.start>g+1024&&s.errors.push(le(o,y)),y=void 0,g=null}break;default:y!==void 0&&d.push(new W(y)),y=it(s,A),g=A.range.start,A.error&&s.errors.push(A.error);e:for(let P=v+1;;++P){let L=o.items[P];switch(L&&L.type){case t.Type.BLANK_LINE:case t.Type.COMMENT:continue e;case t.Type.MAP_VALUE:break e;default:{let B="Implicit map keys need to be followed by map values";s.errors.push(new t.YAMLSemanticError(A,B));break e}}}if(A.valueRangeContainsNewline){let P="Implicit map keys need to be on a single line";s.errors.push(new t.YAMLSemanticError(A,P))}}}return y!==void 0&&d.push(new W(y)),{comments:a,items:d}}function Ms(s,o){let a=[],d=[],y,g=!1,v="{";for(let A=0;A<o.items.length;++A){let P=o.items[A];if(typeof P.char=="string"){let{char:L,offset:B}=P;if(L==="?"&&y===void 0&&!g){g=!0,v=":";continue}if(L===":"){if(y===void 0&&(y=null),v===":"){v=",";continue}}else if(g&&(y===void 0&&L!==","&&(y=null),g=!1),y!==void 0&&(d.push(new W(y)),y=void 0,L===",")){v=":";continue}if(L==="}"){if(A===o.items.length-1)continue}else if(L===v){v=":";continue}let X=`Flow map contains an unexpected ${L}`,Te=new t.YAMLSyntaxError(o,X);Te.offset=B,s.errors.push(Te)}else P.type===t.Type.BLANK_LINE?a.push({afterKey:!!y,before:d.length}):P.type===t.Type.COMMENT?(ie(s.errors,P),a.push({afterKey:!!y,before:d.length,comment:P.comment})):y===void 0?(v===","&&s.errors.push(new t.YAMLSemanticError(P,"Separator , missing in flow map")),y=it(s,P)):(v!==","&&s.errors.push(new t.YAMLSemanticError(P,"Indicator : missing in flow map entry")),d.push(new W(y,it(s,P))),y=void 0,g=!1)}return H(s.errors,o),y!==void 0&&d.push(new W(y)),{comments:a,items:d}}function Ls(s,o){if(o.type!==t.Type.SEQ&&o.type!==t.Type.FLOW_SEQ){let g=`A ${o.type} node cannot be resolved as a sequence`;return s.errors.push(new t.YAMLSyntaxError(o,g)),null}let{comments:a,items:d}=o.type===t.Type.FLOW_SEQ?Us(s,o):Ds(s,o),y=new R;if(y.items=d,Ye(y,a),!s.options.mapAsMap&&d.some(g=>g instanceof W&&g.key instanceof T)){let g="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";s.warnings.push(new t.YAMLWarning(o,g))}return o.resolved=y,y}function Ds(s,o){let a=[],d=[];for(let y=0;y<o.items.length;++y){let g=o.items[y];switch(g.type){case t.Type.BLANK_LINE:a.push({before:d.length});break;case t.Type.COMMENT:a.push({comment:g.comment,before:d.length});break;case t.Type.SEQ_ITEM:if(g.error&&s.errors.push(g.error),d.push(it(s,g.node)),g.hasProps){let v="Sequence items cannot have tags or anchors before the - indicator";s.errors.push(new t.YAMLSemanticError(g,v))}break;default:g.error&&s.errors.push(g.error),s.errors.push(new t.YAMLSyntaxError(g,`Unexpected ${g.type} node in sequence`))}}return{comments:a,items:d}}function Us(s,o){let a=[],d=[],y=!1,g,v=null,A="[",P=null;for(let L=0;L<o.items.length;++L){let B=o.items[L];if(typeof B.char=="string"){let{char:X,offset:Te}=B;if(X!==":"&&(y||g!==void 0)&&(y&&g===void 0&&(g=A?d.pop():null),d.push(new W(g)),y=!1,g=void 0,v=null),X===A)A=null;else if(!A&&X==="?")y=!0;else if(A!=="["&&X===":"&&g===void 0){if(A===","){if(g=d.pop(),g instanceof W){let oe="Chaining flow sequence pairs is invalid",ge=new t.YAMLSemanticError(o,oe);ge.offset=Te,s.errors.push(ge)}if(!y&&typeof v=="number"){let oe=B.range?B.range.start:B.offset;oe>v+1024&&s.errors.push(le(o,g));let{src:ge}=P.context;for(let se=v;se<oe;++se)if(ge[se]===`
|
|
84
|
+
`){let me="Implicit keys of flow sequence pairs need to be on a single line";s.errors.push(new t.YAMLSemanticError(P,me));break}}}else g=null;v=null,y=!1,A=null}else if(A==="["||X!=="]"||L<o.items.length-1){let oe=`Flow sequence contains an unexpected ${X}`,ge=new t.YAMLSyntaxError(o,oe);ge.offset=Te,s.errors.push(ge)}}else if(B.type===t.Type.BLANK_LINE)a.push({before:d.length});else if(B.type===t.Type.COMMENT)ie(s.errors,B),a.push({comment:B.comment,before:d.length});else{if(A){let Te=`Expected a ${A} in flow sequence`;s.errors.push(new t.YAMLSemanticError(B,Te))}let X=it(s,B);g===void 0?(d.push(X),P=B):(d.push(new W(g,X)),g=void 0),v=B.range.start,A=","}}return H(s.errors,o),g!==void 0&&d.push(new W(g)),{comments:a,items:d}}e.Alias=Q,e.Collection=T,e.Merge=j,e.Node=u,e.Pair=W,e.Scalar=f,e.YAMLMap=he,e.YAMLSeq=R,e.addComment=c,e.binaryOptions=S,e.boolOptions=b,e.findPair=ne,e.intOptions=_,e.isEmptyPath=D,e.nullOptions=x,e.resolveMap=Is,e.resolveNode=it,e.resolveSeq=Ls,e.resolveString=Qe,e.strOptions=M,e.stringifyNumber=K,e.stringifyString=N,e.toJSON=h}}),zn=$e({"node_modules/yaml/dist/warnings-1000a372.js"(e){var t=Ot(),i=jt(),c={identify:E=>E instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(E,I)=>{let C=i.resolveString(E,I);if(typeof Buffer=="function")return Buffer.from(C,"base64");if(typeof atob=="function"){let V=atob(C.replace(/[\n\r]/g,"")),G=new Uint8Array(V.length);for(let ee=0;ee<V.length;++ee)G[ee]=V.charCodeAt(ee);return G}else{let V="This environment does not support reading binary tags; either Buffer or atob is required";return E.errors.push(new t.YAMLReferenceError(I,V)),null}},options:i.binaryOptions,stringify:({comment:E,type:I,value:C},V,G,ee)=>{let ve;if(typeof Buffer=="function")ve=C instanceof Buffer?C.toString("base64"):Buffer.from(C.buffer).toString("base64");else if(typeof btoa=="function"){let Ae="";for(let Ee=0;Ee<C.length;++Ee)Ae+=String.fromCharCode(C[Ee]);ve=btoa(Ae)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(I||(I=i.binaryOptions.defaultType),I===t.Type.QUOTE_DOUBLE)C=ve;else{let{lineWidth:Ae}=i.binaryOptions,Ee=Math.ceil(ve.length/Ae),Ie=new Array(Ee);for(let Me=0,Y=0;Me<Ee;++Me,Y+=Ae)Ie[Me]=ve.substr(Y,Ae);C=Ie.join(I===t.Type.BLOCK_LITERAL?`
|
|
85
|
+
`:" ")}return i.stringifyString({comment:E,type:I,value:C},V,G,ee)}};function u(E,I){let C=i.resolveSeq(E,I);for(let V=0;V<C.items.length;++V){let G=C.items[V];if(!(G instanceof i.Pair)){if(G instanceof i.YAMLMap){if(G.items.length>1){let ve="Each pair must have its own sequence indicator";throw new t.YAMLSemanticError(I,ve)}let ee=G.items[0]||new i.Pair;G.commentBefore&&(ee.commentBefore=ee.commentBefore?`${G.commentBefore}
|
|
86
86
|
${ee.commentBefore}`:G.commentBefore),G.comment&&(ee.comment=ee.comment?`${G.comment}
|
|
87
|
-
${ee.comment}`:G.comment),G=ee}k.items[V]=G instanceof i.Pair?G:new i.Pair(G)}}return k}function h(E,I,k){let V=new i.YAMLSeq(E);V.tag="tag:yaml.org,2002:pairs";for(let G of I){let ee,ve;if(Array.isArray(G))if(G.length===2)ee=G[0],ve=G[1];else throw new TypeError(`Expected [key, value] tuple: ${G}`);else if(G&&G instanceof Object){let Ee=Object.keys(G);if(Ee.length===1)ee=Ee[0],ve=G[ee];else throw new TypeError(`Expected { key: value } tuple: ${G}`)}else ee=G;let Ae=E.createPair(ee,ve,k);V.items.push(Ae)}return V}var f={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:u,createNode:h},O=class Pi extends i.YAMLSeq{constructor(){super(),t._defineProperty(this,"add",i.YAMLMap.prototype.add.bind(this)),t._defineProperty(this,"delete",i.YAMLMap.prototype.delete.bind(this)),t._defineProperty(this,"get",i.YAMLMap.prototype.get.bind(this)),t._defineProperty(this,"has",i.YAMLMap.prototype.has.bind(this)),t._defineProperty(this,"set",i.YAMLMap.prototype.set.bind(this)),this.tag=Pi.tag}toJSON(I,k){let V=new Map;k&&k.onCreate&&k.onCreate(V);for(let G of this.items){let ee,ve;if(G instanceof i.Pair?(ee=i.toJSON(G.key,"",k),ve=i.toJSON(G.value,ee,k)):ee=i.toJSON(G,"",k),V.has(ee))throw new Error("Ordered maps must not include duplicate keys");V.set(ee,ve)}return V}};t._defineProperty(O,"tag","tag:yaml.org,2002:omap");function D(E,I){let k=u(E,I),V=[];for(let{key:G}of k.items)if(G instanceof i.Scalar)if(V.includes(G.value)){let ee="Ordered maps must not include duplicate keys";throw new t.YAMLSemanticError(I,ee)}else V.push(G.value);return Object.assign(new O,k)}function T(E,I,k){let V=h(E,I,k),G=new O;return G.items=V.items,G}var $={identify:E=>E instanceof Map,nodeClass:O,default:!1,tag:"tag:yaml.org,2002:omap",resolve:D,createNode:T},R=class xi extends i.YAMLMap{constructor(){super(),this.tag=xi.tag}add(I){let k=I instanceof i.Pair?I:new i.Pair(I);i.findPair(this.items,k.key)||this.items.push(k)}get(I,k){let V=i.findPair(this.items,I);return!k&&V instanceof i.Pair?V.key instanceof i.Scalar?V.key.value:V.key:V}set(I,k){if(typeof k!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof k}`);let V=i.findPair(this.items,I);V&&!k?this.items.splice(this.items.indexOf(V),1):!V&&k&&this.items.push(new i.Pair(I))}toJSON(I,k){return super.toJSON(I,k,Set)}toString(I,k,V){if(!I)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(I,k,V);throw new Error("Set items must all have null values")}};t._defineProperty(R,"tag","tag:yaml.org,2002:set");function J(E,I){let k=i.resolveMap(E,I);if(!k.hasAllNullValues())throw new t.YAMLSemanticError(I,"Set items must all have null values");return Object.assign(new R,k)}function W(E,I,k){let V=new R;for(let G of I)V.items.push(E.createPair(G,null,k));return V}var ae={identify:E=>E instanceof Set,nodeClass:R,default:!1,tag:"tag:yaml.org,2002:set",resolve:J,createNode:W},Q=(E,I)=>{let k=I.split(":").reduce((V,G)=>V*60+Number(G),0);return E==="-"?-k:k},ne=({value:E})=>{if(isNaN(E)||!isFinite(E))return i.stringifyNumber(E);let I="";E<0&&(I="-",E=Math.abs(E));let k=[E%60];return E<60?k.unshift(0):(E=Math.round((E-k[0])/60),k.unshift(E%60),E>=60&&(E=Math.round((E-k[0])/60),k.unshift(E))),I+k.map(V=>V<10?"0"+String(V):String(V)).join(":").replace(/000000\d*$/,"")},he={identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(E,I,k)=>Q(I,k.replace(/_/g,"")),stringify:ne},ye={identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(E,I,k)=>Q(I,k.replace(/_/g,"")),stringify:ne},j={identify:E=>E instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:/^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\.[0-9]+)?)(?:[ \t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$/,resolve:(E,I,k,V,G,ee,ve,Ae,Ee)=>{Ae&&(Ae=(Ae+"00").substr(1,3));let xe=Date.UTC(I,k-1,V,G||0,ee||0,ve||0,Ae||0);if(Ee&&Ee!=="Z"){let Me=Q(Ee[0],Ee.slice(1));Math.abs(Me)<30&&(Me*=60),xe-=6e4*Me}return new Date(xe)},stringify:({value:E})=>E.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function S(E){let I=typeof process!="undefined"&&process.env||{};return E?typeof YAML_SILENCE_DEPRECATION_WARNINGS!="undefined"?!YAML_SILENCE_DEPRECATION_WARNINGS:!I.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS!="undefined"?!YAML_SILENCE_WARNINGS:!I.YAML_SILENCE_WARNINGS}function b(E,I){if(S(!1)){let k=typeof process!="undefined"&&process.emitWarning;k?k(E,I):console.warn(I?`${I}: ${E}`:E)}}function _(E){if(S(!0)){let I=E.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");b(`The endpoint 'yaml/${I}' will be removed in a future release.`,"DeprecationWarning")}}var x={};function M(E,I){if(!x[E]&&S(!0)){x[E]=!0;let k=`The option '${E}' will be removed in a future release`;k+=I?`, use '${I}' instead.`:".",b(k,"DeprecationWarning")}}e.binary=p,e.floatTime=ye,e.intTime=he,e.omap=$,e.pairs=f,e.set=ae,e.timestamp=j,e.warn=b,e.warnFileDeprecation=_,e.warnOptionDeprecation=M}}),Cr=$e({"node_modules/yaml/dist/Schema-88e323a7.js"(e){var t=Ot(),i=jt(),p=zn();function u(m,N,K){let H=new i.YAMLMap(m);if(N instanceof Map)for(let[ie,le]of N)H.items.push(m.createPair(ie,le,K));else if(N&&typeof N=="object")for(let ie of Object.keys(N))H.items.push(m.createPair(ie,N[ie],K));return typeof m.sortMapEntries=="function"&&H.items.sort(m.sortMapEntries),H}var h={createNode:u,default:!0,nodeClass:i.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:i.resolveMap};function f(m,N,K){let H=new i.YAMLSeq(m);if(N&&N[Symbol.iterator])for(let ie of N){let le=m.createNode(ie,K.wrapScalars,null,K);H.items.push(le)}return H}var O={createNode:f,default:!0,nodeClass:i.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:i.resolveSeq},D={identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i.resolveString,stringify(m,N,K,H){return N=Object.assign({actualString:!0},N),i.stringifyString(m,N,K,H)},options:i.strOptions},T=[h,O,D],$=m=>typeof m=="bigint"||Number.isInteger(m),R=(m,N,K)=>i.intOptions.asBigInt?BigInt(m):parseInt(N,K);function J(m,N,K){let{value:H}=m;return $(H)&&H>=0?K+H.toString(N):i.stringifyNumber(m)}var W={identify:m=>m==null,createNode:(m,N,K)=>K.wrapScalars?new i.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:i.nullOptions,stringify:()=>i.nullOptions.nullStr},ae={identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:m=>m[0]==="t"||m[0]==="T",options:i.boolOptions,stringify:({value:m})=>m?i.boolOptions.trueStr:i.boolOptions.falseStr},Q={identify:m=>$(m)&&m>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(m,N)=>R(m,N,8),options:i.intOptions,stringify:m=>J(m,8,"0o")},ne={identify:$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:m=>R(m,m,10),options:i.intOptions,stringify:i.stringifyNumber},he={identify:m=>$(m)&&m>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(m,N)=>R(m,N,16),options:i.intOptions,stringify:m=>J(m,16,"0x")},ye={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(m,N)=>N?NaN:m[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:i.stringifyNumber},j={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:m=>parseFloat(m),stringify:({value:m})=>Number(m).toExponential()},S={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(m,N,K){let H=N||K,ie=new i.Scalar(parseFloat(m));return H&&H[H.length-1]==="0"&&(ie.minFractionDigits=H.length),ie},stringify:i.stringifyNumber},b=T.concat([W,ae,Q,ne,he,ye,j,S]),_=m=>typeof m=="bigint"||Number.isInteger(m),x=({value:m})=>JSON.stringify(m),M=[h,O,{identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i.resolveString,stringify:x},{identify:m=>m==null,createNode:(m,N,K)=>K.wrapScalars?new i.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:x},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:m=>m==="true",stringify:x},{identify:_,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:m=>i.intOptions.asBigInt?BigInt(m):parseInt(m,10),stringify:({value:m})=>_(m)?m.toString():JSON.stringify(m)},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:m=>parseFloat(m),stringify:x}];M.scalarFallback=m=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(m)}`)};var E=({value:m})=>m?i.boolOptions.trueStr:i.boolOptions.falseStr,I=m=>typeof m=="bigint"||Number.isInteger(m);function k(m,N,K){let H=N.replace(/_/g,"");if(i.intOptions.asBigInt){switch(K){case 2:H=`0b${H}`;break;case 8:H=`0o${H}`;break;case 16:H=`0x${H}`;break}let le=BigInt(H);return m==="-"?BigInt(-1)*le:le}let ie=parseInt(H,K);return m==="-"?-1*ie:ie}function V(m,N,K){let{value:H}=m;if(I(H)){let ie=H.toString(N);return H<0?"-"+K+ie.substr(1):K+ie}return i.stringifyNumber(m)}var G=T.concat([{identify:m=>m==null,createNode:(m,N,K)=>K.wrapScalars?new i.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:i.nullOptions,stringify:()=>i.nullOptions.nullStr},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:i.boolOptions,stringify:E},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:i.boolOptions,stringify:E},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(m,N,K)=>k(N,K,2),stringify:m=>V(m,2,"0b")},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(m,N,K)=>k(N,K,8),stringify:m=>V(m,8,"0")},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(m,N,K)=>k(N,K,10),stringify:i.stringifyNumber},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(m,N,K)=>k(N,K,16),stringify:m=>V(m,16,"0x")},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(m,N)=>N?NaN:m[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:i.stringifyNumber},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:m=>parseFloat(m.replace(/_/g,"")),stringify:({value:m})=>Number(m).toExponential()},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(m,N){let K=new i.Scalar(parseFloat(m.replace(/_/g,"")));if(N){let H=N.replace(/_/g,"");H[H.length-1]==="0"&&(K.minFractionDigits=H.length)}return K},stringify:i.stringifyNumber}],p.binary,p.omap,p.pairs,p.set,p.intTime,p.floatTime,p.timestamp),ee={core:b,failsafe:T,json:M,yaml11:G},ve={binary:p.binary,bool:ae,float:S,floatExp:j,floatNaN:ye,floatTime:p.floatTime,int:ne,intHex:he,intOct:Q,intTime:p.intTime,map:h,null:W,omap:p.omap,pairs:p.pairs,seq:O,set:p.set,timestamp:p.timestamp};function Ae(m,N,K){if(N){let H=K.filter(le=>le.tag===N),ie=H.find(le=>!le.format)||H[0];if(!ie)throw new Error(`Tag ${N} not found`);return ie}return K.find(H=>(H.identify&&H.identify(m)||H.class&&m instanceof H.class)&&!H.format)}function Ee(m,N,K){if(m instanceof i.Node)return m;let{defaultPrefix:H,onTagObj:ie,prevObjects:le,schema:Ye,wrapScalars:Qe}=K;N&&N.startsWith("!!")&&(N=H+N.slice(2));let Ze=Ae(m,N,Ye.tags);if(!Ze){if(typeof m.toJSON=="function"&&(m=m.toJSON()),!m||typeof m!="object")return Qe?new i.Scalar(m):m;Ze=m instanceof Map?h:m[Symbol.iterator]?O:h}ie&&(ie(Ze),delete K.onTagObj);let ze={value:void 0,node:void 0};if(m&&typeof m=="object"&&le){let _t=le.get(m);if(_t){let Gt=new i.Alias(_t);return K.aliasNodes.push(Gt),Gt}ze.value=m,le.set(m,ze)}return ze.node=Ze.createNode?Ze.createNode(K.schema,m,K):Qe?new i.Scalar(m):m,N&&ze.node instanceof i.Node&&(ze.node.tag=N),ze.node}function xe(m,N,K,H){let ie=m[H.replace(/\W/g,"")];if(!ie){let le=Object.keys(m).map(Ye=>JSON.stringify(Ye)).join(", ");throw new Error(`Unknown schema "${H}"; use one of ${le}`)}if(Array.isArray(K))for(let le of K)ie=ie.concat(le);else typeof K=="function"&&(ie=K(ie.slice()));for(let le=0;le<ie.length;++le){let Ye=ie[le];if(typeof Ye=="string"){let Qe=N[Ye];if(!Qe){let Ze=Object.keys(N).map(ze=>JSON.stringify(ze)).join(", ");throw new Error(`Unknown custom tag "${Ye}"; use one of ${Ze}`)}ie[le]=Qe}}return ie}var Me=(m,N)=>m.key<N.key?-1:m.key>N.key?1:0,Y=class Ii{constructor({customTags:N,merge:K,schema:H,sortMapEntries:ie,tags:le}){this.merge=!!K,this.name=H,this.sortMapEntries=ie===!0?Me:ie||null,!N&&le&&p.warnOptionDeprecation("tags","customTags"),this.tags=xe(ee,ve,N||le,H)}createNode(N,K,H,ie){let le={defaultPrefix:Ii.defaultPrefix,schema:this,wrapScalars:K},Ye=ie?Object.assign(ie,le):le;return Ee(N,H,Ye)}createPair(N,K,H){H||(H={wrapScalars:!0});let ie=this.createNode(N,H.wrapScalars,null,H),le=this.createNode(K,H.wrapScalars,null,H);return new i.Pair(ie,le)}};t._defineProperty(Y,"defaultPrefix",t.defaultTagPrefix),t._defineProperty(Y,"defaultTags",t.defaultTags),e.Schema=Y}}),Mr=$e({"node_modules/yaml/dist/types.js"(e){var t=jt(),i=Cr();Ot(),zn(),e.Alias=t.Alias,e.Collection=t.Collection,e.Merge=t.Merge,e.Node=t.Node,e.Pair=t.Pair,e.Scalar=t.Scalar,e.YAMLMap=t.YAMLMap,e.YAMLSeq=t.YAMLSeq,e.binaryOptions=t.binaryOptions,e.boolOptions=t.boolOptions,e.intOptions=t.intOptions,e.nullOptions=t.nullOptions,e.strOptions=t.strOptions,e.Schema=i.Schema}}),Xn={},Qn=()=>Xn,Lr=e=>{Object.assign(Xn,e)},Dr=class{constructor(){this.data={}}unregister(e){e?delete this.data[e]:this.data={}}register(e,t){this.data[e]=t}registerMany(e){Object.keys(e).forEach(t=>{this.data[t]=e[t]})}get(e){return this.data[e]}list(){return this.data}},Zn=Dr,ue={},er=ue,ue.defaultInvalidTypeProduct=void 0,ue.defaultRandExpMax=10,ue.pruneProperties=[],ue.ignoreProperties=[],ue.ignoreMissingRefs=!1,ue.failOnInvalidTypes=!0,ue.failOnInvalidFormat=!0,ue.alwaysFakeOptionals=!1,ue.optionalsProbability=null,ue.fixedProbabilities=!1,ue.useExamplesValue=!1,ue.useDefaultValue=!1,ue.requiredOnly=!1,ue.omitNulls=!1,ue.minItems=0,ue.maxItems=null,ue.minLength=0,ue.maxLength=null,ue.resolveJsonPath=!1,ue.reuseProperties=!1,ue.fillProperties=!0,ue.sortProperties=!1,ue.replaceEmptyByRandomValue=!1,ue.random=Math.random,ue.minDateTime=new Date("1889-12-31T00:00:00.000Z"),ue.maxDateTime=new Date("1970-01-01T00:00:01.000Z"),ue.renderTitle=!0,ue.renderDescription=!0,ue.renderComment=!1,Ur=class extends Zn{constructor(){super(),this.data={...er},this._defaults=er}get defaults(){return{...this._defaults}}},Fr=Ur,vt=new Fr,Pe.getDefaults=()=>vt.defaults,te=Pe,tr=["integer","number","string","boolean"],nr=tr.concat(["null"]),$r=["array","object"].concat(nr),jr=2524608e6,Yr=-1e8,Wr=1e8,Vr=-100,Br=100,He={ALLOWED_TYPES:tr,SCALAR_TYPES:nr,ALL_TYPES:$r,MIN_NUMBER:Vr,MAX_NUMBER:Br,MIN_INTEGER:Yr,MAX_INTEGER:Wr,MOST_NEAR_DATETIME:jr},Yt=Hn(kr(),1),Z={pick:Ce,date:Yn,shuffle:Fe,number:Ge,randexp:be},qr=/^(0|[1-9][0-9]*)$/,de={hasProperties:Be,getLocalRef:mr,omitProps:Fo,typecast:No,merge:dt,clone:ce,short:ko,hasValue:Co,notValue:Mo,anyValue:gr,validate:Lo,validateValueForSchema:Wn,validateValueForOneOf:Do,isKey:Uo,template:Sr,shouldClean:wr,clean:Bn,isEmpty:Vn,clampDate:yr},Jr=class{constructor(){this.registry={},this.support={}}reset(e){e?(delete this.registry[e],delete this.support[e]):(this.registry={},this.support={})}extend(e,t){this.registry[e]=t(this.registry[e]),this.support[e]||(this.support[e]=$o(()=>this.registry[e]))}define(e,t){this.support[e]=t}get(e){if(typeof this.registry[e]=="undefined")throw new ReferenceError(`'${e}' dependency doesn't exist.`);return this.registry[e]}wrap(e){if(!("generate"in e)){let t=Object.keys(e),i={},p=t.length;for(;p--;){let u=t[p].replace(/^x-/,""),h=this.support[u];if(typeof h=="function"){Object.defineProperty(e,"generate",{configurable:!1,enumerable:!1,writable:!1,value:(f,O)=>h.call(i,e[t[p]],e,t[p],f,O.slice())});break}}}return e}},Gr=Jr,ht=new Zn,rr=jo,Kr=class extends Error{constructor(e,t){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="ParseError",this.message=e,this.path=t}},Wt=Kr,At={array:["additionalItems","items","maxItems","minItems","uniqueItems"],integer:["exclusiveMaximum","exclusiveMinimum","maximum","minimum","multipleOf"],object:["additionalProperties","dependencies","maxProperties","minProperties","patternProperties","properties","required"],string:["maxLength","minLength","pattern","format"]},At.number=At.integer,Hr=["additionalItems","items","additionalProperties","dependencies","patternProperties","properties"],zr=Wo,Xr=Vo,Qr=Xr,Zr=Qr,ei=Bo,ti=ei,ni=ti,ri=Jo,ir=Go,ii=Ko,oi=`Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore
|
|
87
|
+
${ee.comment}`:G.comment),G=ee}C.items[V]=G instanceof i.Pair?G:new i.Pair(G)}}return C}function h(E,I,C){let V=new i.YAMLSeq(E);V.tag="tag:yaml.org,2002:pairs";for(let G of I){let ee,ve;if(Array.isArray(G))if(G.length===2)ee=G[0],ve=G[1];else throw new TypeError(`Expected [key, value] tuple: ${G}`);else if(G&&G instanceof Object){let Ee=Object.keys(G);if(Ee.length===1)ee=Ee[0],ve=G[ee];else throw new TypeError(`Expected { key: value } tuple: ${G}`)}else ee=G;let Ae=E.createPair(ee,ve,C);V.items.push(Ae)}return V}var f={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:u,createNode:h},O=class Pi extends i.YAMLSeq{constructor(){super(),t._defineProperty(this,"add",i.YAMLMap.prototype.add.bind(this)),t._defineProperty(this,"delete",i.YAMLMap.prototype.delete.bind(this)),t._defineProperty(this,"get",i.YAMLMap.prototype.get.bind(this)),t._defineProperty(this,"has",i.YAMLMap.prototype.has.bind(this)),t._defineProperty(this,"set",i.YAMLMap.prototype.set.bind(this)),this.tag=Pi.tag}toJSON(I,C){let V=new Map;C&&C.onCreate&&C.onCreate(V);for(let G of this.items){let ee,ve;if(G instanceof i.Pair?(ee=i.toJSON(G.key,"",C),ve=i.toJSON(G.value,ee,C)):ee=i.toJSON(G,"",C),V.has(ee))throw new Error("Ordered maps must not include duplicate keys");V.set(ee,ve)}return V}};t._defineProperty(O,"tag","tag:yaml.org,2002:omap");function D(E,I){let C=u(E,I),V=[];for(let{key:G}of C.items)if(G instanceof i.Scalar)if(V.includes(G.value)){let ee="Ordered maps must not include duplicate keys";throw new t.YAMLSemanticError(I,ee)}else V.push(G.value);return Object.assign(new O,C)}function T(E,I,C){let V=h(E,I,C),G=new O;return G.items=V.items,G}var $={identify:E=>E instanceof Map,nodeClass:O,default:!1,tag:"tag:yaml.org,2002:omap",resolve:D,createNode:T},R=class xi extends i.YAMLMap{constructor(){super(),this.tag=xi.tag}add(I){let C=I instanceof i.Pair?I:new i.Pair(I);i.findPair(this.items,C.key)||this.items.push(C)}get(I,C){let V=i.findPair(this.items,I);return!C&&V instanceof i.Pair?V.key instanceof i.Scalar?V.key.value:V.key:V}set(I,C){if(typeof C!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof C}`);let V=i.findPair(this.items,I);V&&!C?this.items.splice(this.items.indexOf(V),1):!V&&C&&this.items.push(new i.Pair(I))}toJSON(I,C){return super.toJSON(I,C,Set)}toString(I,C,V){if(!I)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(I,C,V);throw new Error("Set items must all have null values")}};t._defineProperty(R,"tag","tag:yaml.org,2002:set");function J(E,I){let C=i.resolveMap(E,I);if(!C.hasAllNullValues())throw new t.YAMLSemanticError(I,"Set items must all have null values");return Object.assign(new R,C)}function W(E,I,C){let V=new R;for(let G of I)V.items.push(E.createPair(G,null,C));return V}var ae={identify:E=>E instanceof Set,nodeClass:R,default:!1,tag:"tag:yaml.org,2002:set",resolve:J,createNode:W},Q=(E,I)=>{let C=I.split(":").reduce((V,G)=>V*60+Number(G),0);return E==="-"?-C:C},ne=({value:E})=>{if(isNaN(E)||!isFinite(E))return i.stringifyNumber(E);let I="";E<0&&(I="-",E=Math.abs(E));let C=[E%60];return E<60?C.unshift(0):(E=Math.round((E-C[0])/60),C.unshift(E%60),E>=60&&(E=Math.round((E-C[0])/60),C.unshift(E))),I+C.map(V=>V<10?"0"+String(V):String(V)).join(":").replace(/000000\d*$/,"")},he={identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(E,I,C)=>Q(I,C.replace(/_/g,"")),stringify:ne},ye={identify:E=>typeof E=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(E,I,C)=>Q(I,C.replace(/_/g,"")),stringify:ne},j={identify:E=>E instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:/^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\.[0-9]+)?)(?:[ \t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$/,resolve:(E,I,C,V,G,ee,ve,Ae,Ee)=>{Ae&&(Ae=(Ae+"00").substr(1,3));let Ie=Date.UTC(I,C-1,V,G||0,ee||0,ve||0,Ae||0);if(Ee&&Ee!=="Z"){let Me=Q(Ee[0],Ee.slice(1));Math.abs(Me)<30&&(Me*=60),Ie-=6e4*Me}return new Date(Ie)},stringify:({value:E})=>E.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function S(E){let I=typeof process!="undefined"&&process.env||{};return E?typeof YAML_SILENCE_DEPRECATION_WARNINGS!="undefined"?!YAML_SILENCE_DEPRECATION_WARNINGS:!I.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS!="undefined"?!YAML_SILENCE_WARNINGS:!I.YAML_SILENCE_WARNINGS}function b(E,I){if(S(!1)){let C=typeof process!="undefined"&&process.emitWarning;C?C(E,I):console.warn(I?`${I}: ${E}`:E)}}function _(E){if(S(!0)){let I=E.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");b(`The endpoint 'yaml/${I}' will be removed in a future release.`,"DeprecationWarning")}}var x={};function M(E,I){if(!x[E]&&S(!0)){x[E]=!0;let C=`The option '${E}' will be removed in a future release`;C+=I?`, use '${I}' instead.`:".",b(C,"DeprecationWarning")}}e.binary=c,e.floatTime=ye,e.intTime=he,e.omap=$,e.pairs=f,e.set=ae,e.timestamp=j,e.warn=b,e.warnFileDeprecation=_,e.warnOptionDeprecation=M}}),kr=$e({"node_modules/yaml/dist/Schema-88e323a7.js"(e){var t=Ot(),i=jt(),c=zn();function u(m,N,K){let H=new i.YAMLMap(m);if(N instanceof Map)for(let[ie,le]of N)H.items.push(m.createPair(ie,le,K));else if(N&&typeof N=="object")for(let ie of Object.keys(N))H.items.push(m.createPair(ie,N[ie],K));return typeof m.sortMapEntries=="function"&&H.items.sort(m.sortMapEntries),H}var h={createNode:u,default:!0,nodeClass:i.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:i.resolveMap};function f(m,N,K){let H=new i.YAMLSeq(m);if(N&&N[Symbol.iterator])for(let ie of N){let le=m.createNode(ie,K.wrapScalars,null,K);H.items.push(le)}return H}var O={createNode:f,default:!0,nodeClass:i.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:i.resolveSeq},D={identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i.resolveString,stringify(m,N,K,H){return N=Object.assign({actualString:!0},N),i.stringifyString(m,N,K,H)},options:i.strOptions},T=[h,O,D],$=m=>typeof m=="bigint"||Number.isInteger(m),R=(m,N,K)=>i.intOptions.asBigInt?BigInt(m):parseInt(N,K);function J(m,N,K){let{value:H}=m;return $(H)&&H>=0?K+H.toString(N):i.stringifyNumber(m)}var W={identify:m=>m==null,createNode:(m,N,K)=>K.wrapScalars?new i.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:i.nullOptions,stringify:()=>i.nullOptions.nullStr},ae={identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:m=>m[0]==="t"||m[0]==="T",options:i.boolOptions,stringify:({value:m})=>m?i.boolOptions.trueStr:i.boolOptions.falseStr},Q={identify:m=>$(m)&&m>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(m,N)=>R(m,N,8),options:i.intOptions,stringify:m=>J(m,8,"0o")},ne={identify:$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:m=>R(m,m,10),options:i.intOptions,stringify:i.stringifyNumber},he={identify:m=>$(m)&&m>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(m,N)=>R(m,N,16),options:i.intOptions,stringify:m=>J(m,16,"0x")},ye={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(m,N)=>N?NaN:m[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:i.stringifyNumber},j={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:m=>parseFloat(m),stringify:({value:m})=>Number(m).toExponential()},S={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(m,N,K){let H=N||K,ie=new i.Scalar(parseFloat(m));return H&&H[H.length-1]==="0"&&(ie.minFractionDigits=H.length),ie},stringify:i.stringifyNumber},b=T.concat([W,ae,Q,ne,he,ye,j,S]),_=m=>typeof m=="bigint"||Number.isInteger(m),x=({value:m})=>JSON.stringify(m),M=[h,O,{identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i.resolveString,stringify:x},{identify:m=>m==null,createNode:(m,N,K)=>K.wrapScalars?new i.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:x},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:m=>m==="true",stringify:x},{identify:_,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:m=>i.intOptions.asBigInt?BigInt(m):parseInt(m,10),stringify:({value:m})=>_(m)?m.toString():JSON.stringify(m)},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:m=>parseFloat(m),stringify:x}];M.scalarFallback=m=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(m)}`)};var E=({value:m})=>m?i.boolOptions.trueStr:i.boolOptions.falseStr,I=m=>typeof m=="bigint"||Number.isInteger(m);function C(m,N,K){let H=N.replace(/_/g,"");if(i.intOptions.asBigInt){switch(K){case 2:H=`0b${H}`;break;case 8:H=`0o${H}`;break;case 16:H=`0x${H}`;break}let le=BigInt(H);return m==="-"?BigInt(-1)*le:le}let ie=parseInt(H,K);return m==="-"?-1*ie:ie}function V(m,N,K){let{value:H}=m;if(I(H)){let ie=H.toString(N);return H<0?"-"+K+ie.substr(1):K+ie}return i.stringifyNumber(m)}var G=T.concat([{identify:m=>m==null,createNode:(m,N,K)=>K.wrapScalars?new i.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:i.nullOptions,stringify:()=>i.nullOptions.nullStr},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:i.boolOptions,stringify:E},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:i.boolOptions,stringify:E},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(m,N,K)=>C(N,K,2),stringify:m=>V(m,2,"0b")},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(m,N,K)=>C(N,K,8),stringify:m=>V(m,8,"0")},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(m,N,K)=>C(N,K,10),stringify:i.stringifyNumber},{identify:I,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(m,N,K)=>C(N,K,16),stringify:m=>V(m,16,"0x")},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(m,N)=>N?NaN:m[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:i.stringifyNumber},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:m=>parseFloat(m.replace(/_/g,"")),stringify:({value:m})=>Number(m).toExponential()},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(m,N){let K=new i.Scalar(parseFloat(m.replace(/_/g,"")));if(N){let H=N.replace(/_/g,"");H[H.length-1]==="0"&&(K.minFractionDigits=H.length)}return K},stringify:i.stringifyNumber}],c.binary,c.omap,c.pairs,c.set,c.intTime,c.floatTime,c.timestamp),ee={core:b,failsafe:T,json:M,yaml11:G},ve={binary:c.binary,bool:ae,float:S,floatExp:j,floatNaN:ye,floatTime:c.floatTime,int:ne,intHex:he,intOct:Q,intTime:c.intTime,map:h,null:W,omap:c.omap,pairs:c.pairs,seq:O,set:c.set,timestamp:c.timestamp};function Ae(m,N,K){if(N){let H=K.filter(le=>le.tag===N),ie=H.find(le=>!le.format)||H[0];if(!ie)throw new Error(`Tag ${N} not found`);return ie}return K.find(H=>(H.identify&&H.identify(m)||H.class&&m instanceof H.class)&&!H.format)}function Ee(m,N,K){if(m instanceof i.Node)return m;let{defaultPrefix:H,onTagObj:ie,prevObjects:le,schema:Ye,wrapScalars:Qe}=K;N&&N.startsWith("!!")&&(N=H+N.slice(2));let Ze=Ae(m,N,Ye.tags);if(!Ze){if(typeof m.toJSON=="function"&&(m=m.toJSON()),!m||typeof m!="object")return Qe?new i.Scalar(m):m;Ze=m instanceof Map?h:m[Symbol.iterator]?O:h}ie&&(ie(Ze),delete K.onTagObj);let ze={value:void 0,node:void 0};if(m&&typeof m=="object"&&le){let _t=le.get(m);if(_t){let Gt=new i.Alias(_t);return K.aliasNodes.push(Gt),Gt}ze.value=m,le.set(m,ze)}return ze.node=Ze.createNode?Ze.createNode(K.schema,m,K):Qe?new i.Scalar(m):m,N&&ze.node instanceof i.Node&&(ze.node.tag=N),ze.node}function Ie(m,N,K,H){let ie=m[H.replace(/\W/g,"")];if(!ie){let le=Object.keys(m).map(Ye=>JSON.stringify(Ye)).join(", ");throw new Error(`Unknown schema "${H}"; use one of ${le}`)}if(Array.isArray(K))for(let le of K)ie=ie.concat(le);else typeof K=="function"&&(ie=K(ie.slice()));for(let le=0;le<ie.length;++le){let Ye=ie[le];if(typeof Ye=="string"){let Qe=N[Ye];if(!Qe){let Ze=Object.keys(N).map(ze=>JSON.stringify(ze)).join(", ");throw new Error(`Unknown custom tag "${Ye}"; use one of ${Ze}`)}ie[le]=Qe}}return ie}var Me=(m,N)=>m.key<N.key?-1:m.key>N.key?1:0,Y=class Ii{constructor({customTags:N,merge:K,schema:H,sortMapEntries:ie,tags:le}){this.merge=!!K,this.name=H,this.sortMapEntries=ie===!0?Me:ie||null,!N&&le&&c.warnOptionDeprecation("tags","customTags"),this.tags=Ie(ee,ve,N||le,H)}createNode(N,K,H,ie){let le={defaultPrefix:Ii.defaultPrefix,schema:this,wrapScalars:K},Ye=ie?Object.assign(ie,le):le;return Ee(N,H,Ye)}createPair(N,K,H){H||(H={wrapScalars:!0});let ie=this.createNode(N,H.wrapScalars,null,H),le=this.createNode(K,H.wrapScalars,null,H);return new i.Pair(ie,le)}};t._defineProperty(Y,"defaultPrefix",t.defaultTagPrefix),t._defineProperty(Y,"defaultTags",t.defaultTags),e.Schema=Y}}),Mr=$e({"node_modules/yaml/dist/types.js"(e){var t=jt(),i=kr();Ot(),zn(),e.Alias=t.Alias,e.Collection=t.Collection,e.Merge=t.Merge,e.Node=t.Node,e.Pair=t.Pair,e.Scalar=t.Scalar,e.YAMLMap=t.YAMLMap,e.YAMLSeq=t.YAMLSeq,e.binaryOptions=t.binaryOptions,e.boolOptions=t.boolOptions,e.intOptions=t.intOptions,e.nullOptions=t.nullOptions,e.strOptions=t.strOptions,e.Schema=i.Schema}}),Xn={},Qn=()=>Xn,Lr=e=>{Object.assign(Xn,e)},Dr=class{constructor(){this.data={}}unregister(e){e?delete this.data[e]:this.data={}}register(e,t){this.data[e]=t}registerMany(e){Object.keys(e).forEach(t=>{this.data[t]=e[t]})}get(e){return this.data[e]}list(){return this.data}},Zn=Dr,ue={},er=ue,ue.defaultInvalidTypeProduct=void 0,ue.defaultRandExpMax=10,ue.pruneProperties=[],ue.ignoreProperties=[],ue.ignoreMissingRefs=!1,ue.failOnInvalidTypes=!0,ue.failOnInvalidFormat=!0,ue.alwaysFakeOptionals=!1,ue.optionalsProbability=null,ue.fixedProbabilities=!1,ue.useExamplesValue=!1,ue.useDefaultValue=!1,ue.requiredOnly=!1,ue.omitNulls=!1,ue.minItems=0,ue.maxItems=null,ue.minLength=0,ue.maxLength=null,ue.resolveJsonPath=!1,ue.reuseProperties=!1,ue.fillProperties=!0,ue.sortProperties=!1,ue.replaceEmptyByRandomValue=!1,ue.random=Math.random,ue.minDateTime=new Date("1889-12-31T00:00:00.000Z"),ue.maxDateTime=new Date("1970-01-01T00:00:01.000Z"),ue.renderTitle=!0,ue.renderDescription=!0,ue.renderComment=!1,Ur=class extends Zn{constructor(){super(),this.data={...er},this._defaults=er}get defaults(){return{...this._defaults}}},Fr=Ur,vt=new Fr,Pe.getDefaults=()=>vt.defaults,te=Pe,tr=["integer","number","string","boolean"],nr=tr.concat(["null"]),$r=["array","object"].concat(nr),jr=2524608e6,Yr=-1e8,Wr=1e8,Vr=-100,Br=100,He={ALLOWED_TYPES:tr,SCALAR_TYPES:nr,ALL_TYPES:$r,MIN_NUMBER:Vr,MAX_NUMBER:Br,MIN_INTEGER:Yr,MAX_INTEGER:Wr,MOST_NEAR_DATETIME:jr},Yt=Hn(Cr(),1),Z={pick:ke,date:Yn,shuffle:Fe,number:Ge,randexp:be},qr=/^(0|[1-9][0-9]*)$/,de={hasProperties:Be,getLocalRef:mr,omitProps:Fo,typecast:No,merge:dt,clone:ce,short:Co,hasValue:ko,notValue:Mo,anyValue:gr,validate:Lo,validateValueForSchema:Wn,validateValueForOneOf:Do,isKey:Uo,template:Sr,shouldClean:wr,clean:Bn,isEmpty:Vn,clampDate:yr},Jr=class{constructor(){this.registry={},this.support={}}reset(e){e?(delete this.registry[e],delete this.support[e]):(this.registry={},this.support={})}extend(e,t){this.registry[e]=t(this.registry[e]),this.support[e]||(this.support[e]=$o(()=>this.registry[e]))}define(e,t){this.support[e]=t}get(e){if(typeof this.registry[e]=="undefined")throw new ReferenceError(`'${e}' dependency doesn't exist.`);return this.registry[e]}wrap(e){if(!("generate"in e)){let t=Object.keys(e),i={},c=t.length;for(;c--;){let u=t[c].replace(/^x-/,""),h=this.support[u];if(typeof h=="function"){Object.defineProperty(e,"generate",{configurable:!1,enumerable:!1,writable:!1,value:(f,O)=>h.call(i,e[t[c]],e,t[c],f,O.slice())});break}}}return e}},Gr=Jr,ht=new Zn,rr=jo,Kr=class extends Error{constructor(e,t){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="ParseError",this.message=e,this.path=t}},Wt=Kr,At={array:["additionalItems","items","maxItems","minItems","uniqueItems"],integer:["exclusiveMaximum","exclusiveMinimum","maximum","minimum","multipleOf"],object:["additionalProperties","dependencies","maxProperties","minProperties","patternProperties","properties","required"],string:["maxLength","minLength","pattern","format"]},At.number=At.integer,Hr=["additionalItems","items","additionalProperties","dependencies","patternProperties","properties"],zr=Wo,Xr=Vo,Qr=Xr,Zr=Qr,ei=Bo,ti=ei,ni=ti,ri=Jo,ir=Go,ii=Ko,oi=`Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore
|
|
88
88
|
et dolore magna aliqua Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
89
89
|
commodo consequat Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
90
90
|
pariatur Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est
|
|
91
|
-
laborum`.split(/\W/),Vt=Ho,Bt={type:He.ALLOWED_TYPES},si=zo,or=Xo,ai=Qo,qt=Zo,li=es,ci=ts,sr="[a-zA-Z][a-zA-Z0-9+-.]*",Jt=`https?://{hostname}(?:${sr})+`,pi="(?:\\?([a-z]{1,7}(=\\w{1,5})?&){0,3})?",je={email:"[a-zA-Z\\d][a-zA-Z\\d-]{1,13}[a-zA-Z\\d]@{hostname}",hostname:"[a-zA-Z]{1,33}\\.[a-z]{2,4}",ipv6:"[a-f\\d]{4}(:[a-f\\d]{4}){7}",uri:Jt,slug:"[a-zA-Z\\d_-]+","uri-reference":`${Jt}${pi}`,"uri-template":Jt.replace("(?:","(?:/\\{[a-z][:a-zA-Z0-9-]*\\}|"),"json-pointer":`(/(?:${sr.replace("]*","/]*")}|~[01]))+`,uuid:"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$",duration:"^P(?!$)((\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?|(\\d+W)?)$"},je.iri=je["uri-reference"],je["iri-reference"]=je["uri-reference"],je["idn-email"]=je.email,je["idn-hostname"]=je.hostname,ui=new RegExp(`\\{(${Object.keys(je).join("|")})\\}`),di=ns,fi=is,hi={boolean:Zr,null:ni,array:ri,integer:ii,number:ir,object:si,string:fi},Rt=hi,mi=ft,yi=({refs:e,schema:t,container:i,synchronous:p,refDepthMax:u,refDepthMin:h})=>{let f={},O={},D=0,T,$;return f.resolveSchema=(R,J,W)=>{if(R==null)return null;if(typeof R.generate=="function")return R;if(typeof(R.$id||R.id)=="string"&&(delete R.id,delete R.$id,delete R.$schema),typeof R.$ref=="string"){let Q=Math.max(h,u)-1;if(R.$ref==="#"||O[R.$ref]<0||T===R.$ref&&++D>Q)return R.$ref!=="#"&&$&&$.length===W.length?de.getLocalRef(t,R.$ref,p&&e):(delete R.$ref,R);typeof O[R.$ref]=="undefined"&&(O[R.$ref]=Z.number(h,u)-1),$=W,T=R.$ref;let ne;R.$ref.indexOf("#/")===-1?ne=e[R.$ref]||null:ne=de.getLocalRef(t,R.$ref,p&&e)||null;let he;if(typeof ne!="undefined"){if(!ne&&te("ignoreMissingRefs")!==!0)throw new Error(`Reference not found: ${R.$ref}`);O[R.$ref]-=1,de.merge(R,ne||{}),he=p&&ne&&ne.$ref}return he||delete R.$ref,R}if(Array.isArray(R.allOf)){let Q=R.allOf;delete R.allOf,Q.forEach(ne=>{let he=f.resolveSchema(ne,null,W);de.merge(R,typeof he.thunk=="function"?he.thunk(R):he),Array.isArray(R.allOf)&&f.resolveSchema(R,J,W)})}if(Array.isArray(R.oneOf||R.anyOf)&&W[W.length-2]!=="dependencies"){let Q=R.oneOf||R.anyOf;return R.enum&&R.oneOf&&(R.enum=R.enum.filter(ne=>de.validate(ne,Q))),{thunk(ne){let he=de.omitProps(R,["anyOf","oneOf"]),ye=Z.pick(Q);return de.merge(he,ye),Q.forEach(j=>{j.required&&j!==ye&&j.required.forEach(S=>{if(ye.required&&ye.required.includes(S))return;let b=he.required&&he.required.includes(S);he.properties&&!b&&delete he.properties[S],ne&&ne.properties&&delete ne.properties[S]})}),he}}}if(Object.keys(R).forEach(Q=>{(Array.isArray(R[Q])||typeof R[Q]=="object")&&!de.isKey(Q)&&(R[Q]=f.resolveSchema(R[Q],Q,W.concat(Q)))}),W){let Q=W[W.length-1];if(Q==="properties"||Q==="items")return R}return i.wrap(R)},f},gi=yi,ar=ls,lr=cs,Le=Hn(Mr(),1),ds=Le.default.binaryOptions,fs=Le.default.boolOptions,hs=Le.default.intOptions,ms=Le.default.nullOptions,ys=Le.default.strOptions,gs=Le.default.Schema,Ss=Le.default.Alias,ws=Le.default.Collection,bs=Le.default.Merge,Ts=Le.default.Node,Os=Le.default.Pair,vs=Le.default.Scalar,Si=Le.default.YAMLMap,wi=Le.default.YAMLSeq,Et=us,Xe=new Gr,Oe=(e,t,i)=>(console.debug("[json-schema-faker] calling JSONSchemaFaker() is deprecated, call either .generate() or .resolve()"),i&&console.debug("[json-schema-faker] local references are only supported by calling .resolve()"),Oe.generate(e,t)),Oe.generateWithContext=(e,t)=>{let i=Or(t,e);return ar(i,e,Xe,!0)},Oe.generate=(e,t)=>lr(Oe.generateWithContext(e,t)),Oe.generateYAML=(e,t)=>Et(Oe.generateWithContext(e,t)),Oe.resolveWithContext=(e,t,i)=>{typeof t=="string"&&(i=t,t={}),i=i||(typeof process!="undefined"&&typeof process.cwd=="function"?process.cwd():""),i=`${i.replace(/\/+$/,"")}/`;let p=Or(t,e),u={order:1,canRead(f){let O=f.url.replace("/:",":");return p[O]||p[O.split("/").pop()]},read(f,O){try{O(null,this.canRead(f))}catch(D){O(D)}}},{$RefParser:h}=Qn();return h.bundle(i,e,{resolve:{file:{order:100},http:{order:200},fixedRefs:u},dereference:{circular:"ignore"}}).then(f=>ar(p,f,Xe)).catch(f=>{throw new Error(`Error while resolving schema (${f.message})`)})},Oe.resolve=(e,t,i)=>Oe.resolveWithContext(e,t,i).then(lr),Oe.resolveYAML=(e,t,i)=>Oe.resolveWithContext(e,t,i).then(Et),Tr(),Oe.format=rr,Oe.option=te,Oe.random=Z,Oe.extend=(e,t)=>(Xe.extend(e,t),Oe),Oe.define=(e,t)=>(Xe.define(e,t),Oe),Oe.reset=e=>(Xe.reset(e),Tr(),Oe),Oe.locate=e=>Xe.get(e),Oe.VERSION="0.5.5",bi={...Oe},Ti=Oe}}),Rs=U({"src/src/main.iife.js"(e,t){var i=(As(),re(we));typeof $RefParser!="undefined"&&typeof JSONPath!="undefined"&&i.setDependencies({...JSONPath,$RefParser}),typeof window!="undefined"&&(window.JSONSchemaFaker=i.default),t.exports=i.default,t.exports.JSONSchemaFaker=i.JSONSchemaFaker}});return Rs()})();((c,r)=>{c.JSONSchemaFaker=r()})(typeof self!="undefined"?self:typeof window!="undefined"?window:globalThis,()=>Tn);Tn.random.shuffle=function(){return["[placeholder]"]};Tn.option({useDefaultValue:!0,alwaysFakeOptionals:!0});function Ni(c){return Tn.generate(c)}var ki=async(c,r)=>{let n=new TextEncoder,l=n.encode(c),w=n.encode(r),U=await crypto.subtle.importKey("raw",l,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),C=await crypto.subtle.sign("HMAC",U,w);return Array.from(new Uint8Array(C)).map(z=>z.toString(16).padStart(2,"0")).join("")};var Hs=require("cross-fetch");var Ci=async()=>{if(process.env.NOVU_BRIDGE_ORIGIN)return`${process.env.NOVU_BRIDGE_ORIGIN}/api/novu`;if(process.env.NEXT_PUBLIC_VERCEL_ENV==="preview"&&process.env.NEXT_PUBLIC_VERCEL_URL)return`https://${process.env.NEXT_PUBLIC_VERCEL_URL}/api/novu`;try{if(process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev"){let r=await(await fetch("http://localhost:2022/.well-known/novu")).json();return`${r.tunnelOrigin}${r.route}`}}catch(c){console.error(c)}return""};function Mi(c){return!!c&&typeof c=="object"&&"error"in c&&"message"in c&&"statusCode"in c}var On=(c,r)=>{if(!c)throw new pn;return{post:async(n,l)=>{let w=await fetch(`${r}/v1${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${c}`},body:JSON.stringify(l)}),U=await w.json();if(w.ok)return U;throw Mi(U)?new un(U.statusCode,U.error,U.message):new mt(U)},delete:async n=>(await fetch(`${r}/v1${n}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${c}`}})).json()}};var ji=require("liquidjs");function dr(c,r){let n={...c};for(let l of Object.keys(r)){let w=r[l];w&&typeof w=="object"&&!Array.isArray(w)?n[l]=dr(n[l]||{},w):(Array.isArray(w),n[l]=w)}return n}function vn(c,r){let n=r.split(".").reduce((l,w)=>{if(l&&typeof l=="object")return l[w]},c);if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);if(typeof n=="object"){let l=JSON.stringify(n);return l==="{}"?"":l}return""}function Li(c,r=2,n,l=", "){if(!Array.isArray(c)||c.length===0)return"";let w=n?c.map(z=>typeof z!="object"||!z?"":vn(z,n)):c;if(w.length===1)return w[0];if(w.length===2)return`${w[0]} and ${w[1]}`;if(w.length===3&&r>=3)return`${w[0]}, ${l}${w[1]} and ${w[2]}`;let U=w.slice(0,r),C=w.length-r;return`${U.join(l)} and ${C} ${C===1?"other":"others"}`}var Di=et(require("pluralize"),1);function Ui(c,r="",n="",l="true"){if(c==null)return"";let w=0;if(Array.isArray(c)?w=c.length:typeof c=="object"?w=Object.keys(c).length:typeof c=="string"?w=+c:typeof c=="number"?w=c:w=Number(c),Number.isNaN(w)&&(w=0),w<=0)return"";let U;return n?U=w===1?r:n:U=(0,Di.default)(r,w),l==="true"?`${w} ${U}`:U}var zs=require("liquidjs"),Fi=et(require("pluralize"),1),Xs=require("zod");var Qs="",Zs=2,ea="other",ta=", ",na=" and ",ra=", and ";function $i(c,r=Qs,n=Zs,l=ea,w=ta,U=na,C=ra){if(!Array.isArray(c)||c.length===0)return"";let z=r?c.map(be=>typeof be!="object"||!be?"":vn(be,r)):c,re=z.length;if(re===1)return z[0];if(re===2)return`${z[0]}${U}${z[1]}`;if(n>=re){let be=z.slice(0,re-1),Ce=z[re-1];return`${be.join(w)}${C}${Ce}`}let we=z.slice(0,n),Pe=re-n,ke=n===1?U:C;return`${we.join(w)}${ke}${Pe} ${(0,Fi.default)(l,Pe)}`}function ia(c){return Array.isArray(c)||typeof c=="object"&&c!==null?Yi(c):typeof c=="string"?c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):c==null?"":String(c)}var Yi=(c,r=0)=>Array.isArray(c)||typeof c=="object"&&c!==null?JSON.stringify(c,null,r).replace(/"/g,"'").replace(/\n/g,"\\n"):c==null?"":String(c);function Wi(c){let r=new ji.Liquid({outputEscape:ia,...c});return r.registerFilter("json",(n,l)=>Yi(n,l)),r.registerFilter("digest",Li),r.registerFilter("toSentence",$i),r.registerFilter("pluralize",Ui),r}var pt=et(require("chalk"),1),Se={info:c=>pt.default.blue(c),warning:c=>pt.default.yellow(c),error:c=>pt.default.red(c),success:c=>pt.default.green(c),underline:c=>pt.default.underline(c),bold:c=>pt.default.bold(c)},_e={SUCCESS:Se.success("\u2714"),ERROR:Se.error("\u2717"),WARNING:Se.warning("\u26A0"),INFO:Se.info("\u2139"),ARROW:Se.bold("\u2192"),MOCK:Se.info("\u25CB"),HYDRATED:Se.bold(Se.info("\u2192")),STEP:Se.info("\u03C3"),ACTION:Se.info("\u03B1"),DURATION:Se.info("\u0394"),PROVIDER:Se.info("\u2699"),OUTPUT:Se.info("\u21E2"),INPUT:Se.info("\u21E0"),WORKFLOW:Se.info("\u03C9"),STATE:Se.info("\u03C3"),EXECUTE:Se.info("\u03B5"),PREVIEW:Se.info("\u03C1")};function An(c){return c||process.env.NOVU_API_URL||"https://api.novu.co"}function Rn(c){return c||process.env.NOVU_SECRET_KEY||process.env.NOVU_API_KEY||""}var fr=et(require("sanitize-html"),1),oa=["src","alt","width","height","loading","srcset","sizes","crossorigin","usemap","ismap","class","id","style","title","dir","lang"];function sa(c){return c.toLowerCase().startsWith("on")}function aa(c){return c.replace(/<\/([a-zA-Z][a-zA-Z0-9]*)\s*\/[^>]*>/g,"</$1>")}var la={allowedTags:fr.default.defaults.allowedTags.concat(["style","img","html","head","body","link","meta","title"]),allowedAttributes:!1,transformTags:{"*":(c,r)=>{let n={};for(let[l,w]of Object.entries(r))sa(l)||(n[l]=w);return{tagName:c,attribs:n}},img:(c,r)=>{let n={};for(let[l,w]of Object.entries(r))oa.includes(l.toLowerCase())&&(n[l]=w);return{tagName:c,attribs:n}}},allowVulnerableTags:!0,parseStyleAttributes:!1,parser:{lowerCaseAttributeNames:!0}},Vi=c=>{if(!c)return c;let r=aa(c),n=/^<!DOCTYPE .*?>/,l=r.match(n),w=(0,fr.default)(r,la);return l?l[0]+w:w},En=c=>Object.keys(c).reduce((r,n)=>{let l=c[n];return typeof l=="string"?r[n]=Vi(l):Array.isArray(l)?r[n]=l.map(w=>typeof w=="string"?Vi(w):typeof w=="object"?En(w):w):typeof l=="object"&&l!==null?r[n]=En(l):r[n]=l,r},{});function Bi(c,r=!0){r&&(console.log(`
|
|
92
|
-
${Se.bold(Se.underline("Discovered workflowId:"))} '${
|
|
93
|
-
${Se.bold(Se.underline(w))} '${r.workflowId}'`);let
|
|
91
|
+
laborum`.split(/\W/),Vt=Ho,Bt={type:He.ALLOWED_TYPES},si=zo,or=Xo,ai=Qo,qt=Zo,li=es,ci=ts,sr="[a-zA-Z][a-zA-Z0-9+-.]*",Jt=`https?://{hostname}(?:${sr})+`,pi="(?:\\?([a-z]{1,7}(=\\w{1,5})?&){0,3})?",je={email:"[a-zA-Z\\d][a-zA-Z\\d-]{1,13}[a-zA-Z\\d]@{hostname}",hostname:"[a-zA-Z]{1,33}\\.[a-z]{2,4}",ipv6:"[a-f\\d]{4}(:[a-f\\d]{4}){7}",uri:Jt,slug:"[a-zA-Z\\d_-]+","uri-reference":`${Jt}${pi}`,"uri-template":Jt.replace("(?:","(?:/\\{[a-z][:a-zA-Z0-9-]*\\}|"),"json-pointer":`(/(?:${sr.replace("]*","/]*")}|~[01]))+`,uuid:"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$",duration:"^P(?!$)((\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?|(\\d+W)?)$"},je.iri=je["uri-reference"],je["iri-reference"]=je["uri-reference"],je["idn-email"]=je.email,je["idn-hostname"]=je.hostname,ui=new RegExp(`\\{(${Object.keys(je).join("|")})\\}`),di=ns,fi=is,hi={boolean:Zr,null:ni,array:ri,integer:ii,number:ir,object:si,string:fi},Rt=hi,mi=ft,yi=({refs:e,schema:t,container:i,synchronous:c,refDepthMax:u,refDepthMin:h})=>{let f={},O={},D=0,T,$;return f.resolveSchema=(R,J,W)=>{if(R==null)return null;if(typeof R.generate=="function")return R;if(typeof(R.$id||R.id)=="string"&&(delete R.id,delete R.$id,delete R.$schema),typeof R.$ref=="string"){let Q=Math.max(h,u)-1;if(R.$ref==="#"||O[R.$ref]<0||T===R.$ref&&++D>Q)return R.$ref!=="#"&&$&&$.length===W.length?de.getLocalRef(t,R.$ref,c&&e):(delete R.$ref,R);typeof O[R.$ref]=="undefined"&&(O[R.$ref]=Z.number(h,u)-1),$=W,T=R.$ref;let ne;R.$ref.indexOf("#/")===-1?ne=e[R.$ref]||null:ne=de.getLocalRef(t,R.$ref,c&&e)||null;let he;if(typeof ne!="undefined"){if(!ne&&te("ignoreMissingRefs")!==!0)throw new Error(`Reference not found: ${R.$ref}`);O[R.$ref]-=1,de.merge(R,ne||{}),he=c&&ne&&ne.$ref}return he||delete R.$ref,R}if(Array.isArray(R.allOf)){let Q=R.allOf;delete R.allOf,Q.forEach(ne=>{let he=f.resolveSchema(ne,null,W);de.merge(R,typeof he.thunk=="function"?he.thunk(R):he),Array.isArray(R.allOf)&&f.resolveSchema(R,J,W)})}if(Array.isArray(R.oneOf||R.anyOf)&&W[W.length-2]!=="dependencies"){let Q=R.oneOf||R.anyOf;return R.enum&&R.oneOf&&(R.enum=R.enum.filter(ne=>de.validate(ne,Q))),{thunk(ne){let he=de.omitProps(R,["anyOf","oneOf"]),ye=Z.pick(Q);return de.merge(he,ye),Q.forEach(j=>{j.required&&j!==ye&&j.required.forEach(S=>{if(ye.required&&ye.required.includes(S))return;let b=he.required&&he.required.includes(S);he.properties&&!b&&delete he.properties[S],ne&&ne.properties&&delete ne.properties[S]})}),he}}}if(Object.keys(R).forEach(Q=>{(Array.isArray(R[Q])||typeof R[Q]=="object")&&!de.isKey(Q)&&(R[Q]=f.resolveSchema(R[Q],Q,W.concat(Q)))}),W){let Q=W[W.length-1];if(Q==="properties"||Q==="items")return R}return i.wrap(R)},f},gi=yi,ar=ls,lr=cs,Le=Hn(Mr(),1),ds=Le.default.binaryOptions,fs=Le.default.boolOptions,hs=Le.default.intOptions,ms=Le.default.nullOptions,ys=Le.default.strOptions,gs=Le.default.Schema,Ss=Le.default.Alias,ws=Le.default.Collection,bs=Le.default.Merge,Ts=Le.default.Node,Os=Le.default.Pair,vs=Le.default.Scalar,Si=Le.default.YAMLMap,wi=Le.default.YAMLSeq,Et=us,Xe=new Gr,Oe=(e,t,i)=>(console.debug("[json-schema-faker] calling JSONSchemaFaker() is deprecated, call either .generate() or .resolve()"),i&&console.debug("[json-schema-faker] local references are only supported by calling .resolve()"),Oe.generate(e,t)),Oe.generateWithContext=(e,t)=>{let i=Or(t,e);return ar(i,e,Xe,!0)},Oe.generate=(e,t)=>lr(Oe.generateWithContext(e,t)),Oe.generateYAML=(e,t)=>Et(Oe.generateWithContext(e,t)),Oe.resolveWithContext=(e,t,i)=>{typeof t=="string"&&(i=t,t={}),i=i||(typeof process!="undefined"&&typeof process.cwd=="function"?process.cwd():""),i=`${i.replace(/\/+$/,"")}/`;let c=Or(t,e),u={order:1,canRead(f){let O=f.url.replace("/:",":");return c[O]||c[O.split("/").pop()]},read(f,O){try{O(null,this.canRead(f))}catch(D){O(D)}}},{$RefParser:h}=Qn();return h.bundle(i,e,{resolve:{file:{order:100},http:{order:200},fixedRefs:u},dereference:{circular:"ignore"}}).then(f=>ar(c,f,Xe)).catch(f=>{throw new Error(`Error while resolving schema (${f.message})`)})},Oe.resolve=(e,t,i)=>Oe.resolveWithContext(e,t,i).then(lr),Oe.resolveYAML=(e,t,i)=>Oe.resolveWithContext(e,t,i).then(Et),Tr(),Oe.format=rr,Oe.option=te,Oe.random=Z,Oe.extend=(e,t)=>(Xe.extend(e,t),Oe),Oe.define=(e,t)=>(Xe.define(e,t),Oe),Oe.reset=e=>(Xe.reset(e),Tr(),Oe),Oe.locate=e=>Xe.get(e),Oe.VERSION="0.5.5",bi={...Oe},Ti=Oe}}),Rs=F({"src/src/main.iife.js"(e,t){var i=(As(),re(we));typeof $RefParser!="undefined"&&typeof JSONPath!="undefined"&&i.setDependencies({...JSONPath,$RefParser}),typeof window!="undefined"&&(window.JSONSchemaFaker=i.default),t.exports=i.default,t.exports.JSONSchemaFaker=i.JSONSchemaFaker}});return Rs()})();((l,r)=>{l.JSONSchemaFaker=r()})(typeof self!="undefined"?self:typeof window!="undefined"?window:globalThis,()=>Tn);Tn.random.shuffle=function(){return["[placeholder]"]};Tn.option({useDefaultValue:!0,alwaysFakeOptionals:!0});function Ni(l){return Tn.generate(l)}var Ci=async(l,r)=>{let n=new TextEncoder,p=n.encode(l),w=n.encode(r),F=await crypto.subtle.importKey("raw",p,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),k=await crypto.subtle.sign("HMAC",F,w);return Array.from(new Uint8Array(k)).map(z=>z.toString(16).padStart(2,"0")).join("")};var Hs=require("cross-fetch");var ki=async()=>{if(process.env.NOVU_BRIDGE_ORIGIN)return`${process.env.NOVU_BRIDGE_ORIGIN}/api/novu`;if(process.env.NEXT_PUBLIC_VERCEL_ENV==="preview"&&process.env.NEXT_PUBLIC_VERCEL_URL)return`https://${process.env.NEXT_PUBLIC_VERCEL_URL}/api/novu`;try{if(process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev"){let r=await(await fetch("http://localhost:2022/.well-known/novu")).json();return`${r.tunnelOrigin}${r.route}`}}catch(l){console.error(l)}return""};function Mi(l){return!!l&&typeof l=="object"&&"error"in l&&"message"in l&&"statusCode"in l}var On=(l,r)=>{if(!l)throw new pn;return{post:async(n,p)=>{let w=await fetch(`${r}/v1${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${l}`},body:JSON.stringify(p)}),F=await w.json();if(w.ok)return F;throw Mi(F)?new un(F.statusCode,F.error,F.message):new mt(F)},delete:async n=>(await fetch(`${r}/v1${n}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${l}`}})).json()}};var ji=require("liquidjs");function dr(l,r){let n={...l};for(let p of Object.keys(r)){let w=r[p];w&&typeof w=="object"&&!Array.isArray(w)?n[p]=dr(n[p]||{},w):(Array.isArray(w),n[p]=w)}return n}function vn(l,r){let n=r.split(".").reduce((p,w)=>{if(p&&typeof p=="object")return p[w]},l);if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);if(typeof n=="object"){let p=JSON.stringify(n);return p==="{}"?"":p}return""}function Li(l,r=2,n,p=", "){if(!Array.isArray(l)||l.length===0)return"";let w=n?l.map(z=>typeof z!="object"||!z?"":vn(z,n)):l;if(w.length===1)return w[0];if(w.length===2)return`${w[0]} and ${w[1]}`;if(w.length===3&&r>=3)return`${w[0]}, ${p}${w[1]} and ${w[2]}`;let F=w.slice(0,r),k=w.length-r;return`${F.join(p)} and ${k} ${k===1?"other":"others"}`}var Di=et(require("pluralize"),1);function Ui(l,r="",n="",p="true"){if(l==null)return"";let w=0;if(Array.isArray(l)?w=l.length:typeof l=="object"?w=Object.keys(l).length:typeof l=="string"?w=+l:typeof l=="number"?w=l:w=Number(l),Number.isNaN(w)&&(w=0),w<=0)return"";let F;return n?F=w===1?r:n:F=(0,Di.default)(r,w),p==="true"?`${w} ${F}`:F}var zs=require("liquidjs"),Fi=et(require("pluralize"),1),Xs=require("zod");var Qs="",Zs=2,ea="other",ta=", ",na=" and ",ra=", and ";function $i(l,r=Qs,n=Zs,p=ea,w=ta,F=na,k=ra){if(!Array.isArray(l)||l.length===0)return"";let z=r?l.map(be=>typeof be!="object"||!be?"":vn(be,r)):l,re=z.length;if(re===1)return z[0];if(re===2)return`${z[0]}${F}${z[1]}`;if(n>=re){let be=z.slice(0,re-1),ke=z[re-1];return`${be.join(w)}${k}${ke}`}let we=z.slice(0,n),Pe=re-n,xe=n===1?F:k;return`${we.join(w)}${xe}${Pe} ${(0,Fi.default)(p,Pe)}`}function ia(l){return Array.isArray(l)||typeof l=="object"&&l!==null?Yi(l):typeof l=="string"?l.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):l==null?"":String(l)}var Yi=(l,r=0)=>Array.isArray(l)||typeof l=="object"&&l!==null?JSON.stringify(l,null,r).replace(/"/g,"'").replace(/\n/g,"\\n"):l==null?"":String(l);function Wi(l){let r=new ji.Liquid({outputEscape:ia,...l});return r.registerFilter("json",(n,p)=>Yi(n,p)),r.registerFilter("digest",Li),r.registerFilter("toSentence",$i),r.registerFilter("pluralize",Ui),r}var pt=et(require("chalk"),1),Se={info:l=>pt.default.blue(l),warning:l=>pt.default.yellow(l),error:l=>pt.default.red(l),success:l=>pt.default.green(l),underline:l=>pt.default.underline(l),bold:l=>pt.default.bold(l)},_e={SUCCESS:Se.success("\u2714"),ERROR:Se.error("\u2717"),WARNING:Se.warning("\u26A0"),INFO:Se.info("\u2139"),ARROW:Se.bold("\u2192"),MOCK:Se.info("\u25CB"),HYDRATED:Se.bold(Se.info("\u2192")),STEP:Se.info("\u03C3"),ACTION:Se.info("\u03B1"),DURATION:Se.info("\u0394"),PROVIDER:Se.info("\u2699"),OUTPUT:Se.info("\u21E2"),INPUT:Se.info("\u21E0"),WORKFLOW:Se.info("\u03C9"),STATE:Se.info("\u03C3"),EXECUTE:Se.info("\u03B5"),PREVIEW:Se.info("\u03C1")};function An(l){return l||process.env.NOVU_API_URL||"https://api.novu.co"}function Rn(l){return l||process.env.NOVU_SECRET_KEY||process.env.NOVU_API_KEY||""}var fr=et(require("sanitize-html"),1),oa=["src","alt","width","height","loading","srcset","sizes","crossorigin","usemap","ismap","class","id","style","title","dir","lang"];function sa(l){return l.toLowerCase().startsWith("on")}function aa(l){return l.replace(/<\/([a-zA-Z][a-zA-Z0-9]*)\s*\/[^>]*>/g,"</$1>")}var la={allowedTags:fr.default.defaults.allowedTags.concat(["style","img","html","head","body","link","meta","title"]),allowedAttributes:!1,transformTags:{"*":(l,r)=>{let n={};for(let[p,w]of Object.entries(r))sa(p)||(n[p]=w);return{tagName:l,attribs:n}},img:(l,r)=>{let n={};for(let[p,w]of Object.entries(r))oa.includes(p.toLowerCase())&&(n[p]=w);return{tagName:l,attribs:n}}},allowVulnerableTags:!0,parseStyleAttributes:!1,parser:{lowerCaseAttributeNames:!0}},Vi=l=>{if(!l)return l;let r=aa(l),n=/^<!DOCTYPE .*?>/,p=r.match(n),w=(0,fr.default)(r,la);return p?p[0]+w:w},En=l=>Object.keys(l).reduce((r,n)=>{let p=l[n];return typeof p=="string"?r[n]=Vi(p):Array.isArray(p)?r[n]=p.map(w=>typeof w=="string"?Vi(w):typeof w=="object"?En(w):w):typeof p=="object"&&p!==null?r[n]=En(p):r[n]=p,r},{});function Bi(l,r=!0){r&&(console.log(`
|
|
92
|
+
${Se.bold(Se.underline("Discovered workflowId:"))} '${l.workflowId}'`),l.steps.forEach((n,p)=>{let w=p===l.steps.length-1;console.log(`${w?"\u2514":"\u251C"} ${_e.STEP} Discovered stepId: '${n.stepId}' Type: '${n.type}'`),n.providers.forEach((k,z)=>{let re=z===n.providers.length-1;console.log(`${w?" ":"\u2502"} ${re?"\u2514":"\u251C"} ${_e.PROVIDER} Discovered provider: '${k.type}'`)})}))}var qi=require("jsonrepair");function ca(l){let r=l.trim();return(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))&&r.length>2}function pa(l){try{return JSON.parse(l),l}catch{try{return(0,qi.jsonrepair)(l)}catch{return l}}}function Ji(l){return Object.fromEntries(Object.entries(l).map(([r,n])=>typeof n=="string"?[r,ca(n)?pa(n):n]:typeof n=="object"&&n!==null&&!Array.isArray(n)?[r,Ji(n)]:[r,n]))}function Gi(l){return!(l!=null&&l.data)||typeof l.data!="object"||Array.isArray(l.data)?l:{...l,data:Ji(l.data)}}var Hi=et(require("ajv"),1),zi=et(require("ajv-formats"),1);var Ki=l=>typeof structuredClone=="function"?structuredClone(l):JSON.parse(JSON.stringify(l));var _n=class extends st{constructor(n,p){let w=p.length===1?"it":"them";super(`Tried to use a ${n} in @novu/framework without ${p.join(", ")} installed. Please install ${w} by running \`npm install ${p.join(" ")}\`.`);this.statusCode=500;this.code="MissingDependencyError"}};var Pn=async(l,r)=>{let n=new Set;if((await Promise.allSettled(l.map(w=>w.import))).forEach((w,F)=>{let k=l[F];w.status==="fulfilled"&&k.exports.every(re=>w.value[re]!==void 0)||n.add(k.name)}),n.size>0)throw new _n(r,Array.from(n))};var xn=class{constructor(){this.requiredImports=[];this.ajv=new Hi.default({useDefaults:!0,removeAdditional:"failing",strict:!1}),(0,zi.default)(this.ajv),this.compiledSchemas=new Map}async canHandle(r){let n=r.type==="object"||!!r.anyOf||!!r.allOf||!!r.oneOf;return n&&await Pn(this.requiredImports,"JSON schema"),n}async validate(r,n){let p=this.compiledSchemas.get(n);p||(p=this.ajv.compile(n),this.compiledSchemas.set(n,p));let w=Ki(r);return p(w)?{success:!0,data:w}:{success:!1,errors:p.errors.map(k=>({path:k.instancePath,message:k.message}))}}async transformToJsonSchema(r){return r}};var In=class{constructor(){this.requiredImports=[{name:"zod",import:import("zod"),exports:["ZodType"]},{name:"zod-to-json-schema",import:import("zod-to-json-schema"),exports:["zodToJsonSchema"]}]}async canHandle(r){let n=r.safeParseAsync!==void 0;return n&&await Pn(this.requiredImports,"Zod schema"),n}async validate(r,n){let p=await n.safeParseAsync(r);return p.success?{success:!0,data:p.data}:{success:!1,errors:p.error.errors.map(w=>({path:`/${w.path.join("/")}`,message:w.message}))}}async transformToJsonSchema(r){let{zodToJsonSchema:n}=await import("zod-to-json-schema");return n(r)}};var Nn=new In,Cn=new xn,Ut=async(l,r)=>{if(await Nn.canHandle(l))return Nn.validate(r,l);if(await Cn.canHandle(l))return Cn.validate(r,l);throw new Error("Invalid schema")},Ce=async l=>{if(await Nn.canHandle(l))return Nn.transformToJsonSchema(l);if(await Cn.canHandle(l))return Cn.transformToJsonSchema(l);throw new Error("Invalid schema")};function Xi(){return["development",void 0,"dev"].includes(process.env.NODE_ENV)}var St=class{constructor(r){this.discoveredWorkflows=new Map;this.discoverWorkflowPromises=new Map;this.version="2.10.0";let n=this.buildOptions(r);this.apiUrl=n.apiUrl,this.secretKey=n.secretKey,this.strictAuthentication=n.strictAuthentication,this.verbose=n.verbose,this.templateEngine=Wi()}buildOptions(r){let n={apiUrl:An(r==null?void 0:r.apiUrl),secretKey:Rn(r==null?void 0:r.secretKey),strictAuthentication:!Xi(),verbose:Xi()};return(r==null?void 0:r.strictAuthentication)!==void 0?n.strictAuthentication=r.strictAuthentication:process.env.NOVU_STRICT_AUTHENTICATION_ENABLED!==void 0&&(n.strictAuthentication=process.env.NOVU_STRICT_AUTHENTICATION_ENABLED==="true"),(r==null?void 0:r.verbose)!==void 0&&(n.verbose=r.verbose),n}log(...r){this.verbose&&console.log(...r)}async addWorkflows(r){for(let n of r){if(this.discoveredWorkflows.has(n.id))continue;let p=this.discoverWorkflowPromises.get(n.id);if(p){await p;continue}let w=this.addWorkflow(n);this.discoverWorkflowPromises.set(n.id,w),await w}}async addWorkflow(r){try{let n=await r.discover();Bi(n,this.verbose),this.discoveredWorkflows.set(r.id,n)}finally{this.discoverWorkflowPromises.delete(r.id)}}healthCheck(){let r=this.getRegisteredWorkflows(),n=r.length,p=r.reduce((w,F)=>w+F.steps.length,0);return{status:"ok",sdkVersion:"2.10.0",frameworkVersion:"2024-06-26",discovered:{workflows:n,steps:p}}}getWorkflow(r){let n=this.discoveredWorkflows.get(r);if(n)return n;throw new Mt(r)}getStep(r,n){let w=this.getWorkflow(r).steps.find(F=>F.stepId===n);if(w)return w;throw new wn(n)}getRegisteredWorkflows(){return Array.from(this.discoveredWorkflows.values())}discover(){return{workflows:this.getRegisteredWorkflows()}}mock(r){return Ni(r)}async validate(r,n,p,w,F,k,z){let re=await Ut(n,r);if(re.success)return re.data;switch(p){case"event":this.throwInvalidEvent(w,F,re.errors);case"step":this.throwInvalidStep(k,w,F,re.errors);case"provider":this.throwInvalidProvider(k,z,w,F,re.errors);default:throw new Error(`Invalid component: '${p}'`)}}throwInvalidProvider(r,n,p,w,F){if(!r)throw new Error("stepId is required");if(!n)throw new Error("providerId is required");switch(p){case"output":throw new sn(w,r,n,F);default:throw new Error(`Invalid payload type: '${p}'`)}}throwInvalidStep(r,n,p,w){if(!r)throw new Error("stepId is required");switch(n){case"output":throw new nn(p,r,w);case"result":throw new rn(p,r,w);case"controls":throw new tn(p,r,w);default:throw new Error(`Invalid payload type: '${n}'`)}}throwInvalidEvent(r,n,p){switch(r){case"controls":throw new en(n,p);case"payload":throw new It(n,p);default:throw new Error(`Invalid payload type: '${r}'`)}}executeStepFactory(r,n,p){return async(w,F,k)=>{if(p())return;let z=this.getStep(r.workflowId,w),re=r.action==="preview";if(!re&&w===r.stepId){let ke=await this.createStepControls(z,r),Fe=await this.compileControls(ke,r);if(await this.shouldSkip(k==null?void 0:k.skip,Fe))return n({options:{skip:!0},outputs:{},providers:{}}),{}}let we=this.previewStep.bind(this),Pe=this.executeStep.bind(this),be=await(re?we:Pe)(r,{...z,providers:z.providers.map(ke=>{var rt;let Fe=(rt=k==null?void 0:k.providers)==null?void 0:rt[ke.type];if(!Fe)throw new dn(ke.type);return{...ke,resolve:Fe}}),resolve:F});return this.shouldSanitize({stepType:z.type,options:k})&&(be={...be,outputs:En(be.outputs)}),w===r.stepId&&n({...be,options:{skip:!1}}),be.outputs}}shouldSanitize({stepType:r,options:n}){return(n==null?void 0:n.disableOutputSanitization)===!0?!1:["email","in_app"].includes(r)}async shouldSkip(r,n){return r?r(n):!1}async executeWorkflow(r){let w=`${{execute:"Executing",preview:"Previewing"}[r.action]} workflowId:`;this.log(`
|
|
93
|
+
${Se.bold(Se.underline(w))} '${r.workflowId}'`);let F=this.getWorkflow(r.workflowId),k=process.hrtime(),z={outputs:{},providers:{},options:{skip:!1}},re,we=!1,Pe=new Promise(Ke=>{re=Ke}),xe=Ke=>{if(we)throw new Error("setResult can only be called once per workflow execution");re(),we=!0,z=Ke},be=()=>we,ke;try{if(r.action==="execute"&&!r.payload)throw new It(r.workflowId,{message:"Event `payload` is required"});let Ke=await this.createExecutionPayload(r,F),Be={...r,payload:Ke};await Promise.race([Pe,F.execute({payload:Ke,environment:{},controls:{},subscriber:r.subscriber,context:r.context,step:{email:this.executeStepFactory(Be,xe,be),sms:this.executeStepFactory(Be,xe,be),inApp:this.executeStepFactory(Be,xe,be),digest:this.executeStepFactory(Be,xe,be),delay:this.executeStepFactory(Be,xe,be),push:this.executeStepFactory(Be,xe,be),chat:this.executeStepFactory(Be,xe,be),custom:this.executeStepFactory(Be,xe,be),throttle:this.executeStepFactory(Be,xe,be)}})])}catch(Ke){ke=Ke}let Fe=process.hrtime(k),rt=Fe[0],Ge=Fe[1],Ft=rt*1e3+Ge/1e6,Yn=ke?_e.ERROR:_e.SUCCESS,$t={execute:"Executed",preview:"Previewed"}[r.action];if(this.log(`${Yn} ${$t} workflowId: \`${r.workflowId}\``),this.prettyPrintExecute(r,Ft,ke),ke)throw ke;return{outputs:z.outputs,providers:z.providers,options:z.options,metadata:{status:"success",error:!1,duration:Ft}}}async createExecutionPayload(r,n){let{payload:p}=r;if(r.action==="preview"){let F=this.mock(n.payload.schema);p=Object.assign(F,p)}return await this.validate(p,n.payload.unknownSchema,"event","payload",r.workflowId)}prettyPrintExecute(r,n,p){if(!this.verbose)return;let w=p?_e.ERROR:_e.SUCCESS,k={execute:"Executed",preview:"Previewed"}[r.action],z=p?"Failed to execute":k,re=p?Se.error:Se.success,we=`${w} ${z} workflowId: '${r.workflowId}`;console.log(`
|
|
94
94
|
${Se.bold(re(we))}'`),console.log(` \u251C ${_e.STEP} stepId: '${r.stepId}'`),console.log(` \u251C ${_e.ACTION} action: '${r.action}'`),console.log(` \u2514 ${_e.DURATION} duration: '${n.toFixed(2)}ms'
|
|
95
|
-
`)}async executeProviders(r,n,l){return n.providers.reduce(async(w,U)=>{let C=await w,z=this.previewProvider.bind(this),re=this.executeProvider.bind(this),Pe=await(r.action==="preview"?z:re)(r,n,U,l);return{...C,[U.type]:Pe}},Promise.resolve({}))}previewProvider(r,n,l,w){return this.log(` ${_e.MOCK} Mocked provider: \`${l.type}\``),this.mock(l.outputs.schema)}async executeProvider(r,n,l,w){try{if(r.stepId===n.stepId){let U=await this.createStepControls(n,r),C=await l.resolve({controls:U,outputs:w}),z=await this.validate(C,l.outputs.unknownSchema,"step","output",r.workflowId,n.stepId,l.type);return this.log(` ${_e.SUCCESS} Executed provider: \`${l.type}\``),{...z,_passthrough:C._passthrough}}else return this.log(` ${_e.HYDRATED} Hydrated provider: \`${l.type}\``),{}}catch(U){throw this.log(` ${_e.ERROR} Failed to execute provider: \`${l.type}\``),new fn(l.type,r.action,U)}}async executeStep(r,n){if(r.stepId===n.stepId)try{let l=await this.createStepControls(n,r),w=await this.compileControls(l,r),U=await n.resolve(w),C=await this.validate(U,n.outputs.unknownSchema,"step","output",r.workflowId,n.stepId),z=await this.executeProviders(r,n,C);return this.log(` ${_e.SUCCESS} Executed stepId: \`${n.stepId}\``),{outputs:C,providers:z}}catch(l){throw this.log(` ${_e.ERROR} Failed to execute stepId: \`${n.stepId}\``),lt(l)?l:new Ct(n.stepId,r.action,l)}else try{let l=this.getStepState(r,n.stepId);if(l){let w=await this.validate(l.outputs,n.results.unknownSchema,"step","result",r.workflowId,n.stepId);return this.log(` ${_e.HYDRATED} Hydrated stepId: \`${n.stepId}\``),{outputs:w,providers:await this.executeProviders(r,n,w)}}else throw new Zt(r.workflowId,n.stepId)}catch(l){throw this.log(` ${_e.ERROR} Failed to hydrate stepId: \`${n.stepId}\``),l}}async compileControls(r,n){try{let l=this.preprocessTranslationPatterns(JSON.stringify(r));l=this.preprocessFilterTranslationArgs(l);let w=this.templateEngine.parse(l),U=this.getWorkflow(n.workflowId),C={workflow:{workflowId:U.workflowId,name:U.name,description:U.description,tags:U.tags,severity:U.severity},payload:n.payload,subscriber:n.subscriber,context:n.context,steps:ua(n.state)},z=await this.templateEngine.render(w,C),re=this.postprocessTranslationMarkers(z),we=(0,Qi.jsonrepair)(re),Pe=JSON.parse(we);return Gi(Pe)}catch(l){throw new on(n.workflowId,n.stepId,l)}}preprocessTranslationPatterns(r){return r.replace(/\{\{\s*t\.([\p{L}\p{N}_.-]+)\s*\}\}/gu,"[T:$1]")}preprocessFilterTranslationArgs(r){return r.replace(/'t\.([\p{L}\p{N}_.-]+)'/gu,"'[T:$1]'")}postprocessTranslationMarkers(r){return r.replace(/\[T:([\p{L}\p{N}_.-]+)\]/gu,"{{t.$1}}")}async createStepControls(r,n){return await this.validate(n.controls,r.controls.unknownSchema,"step","controls",n.workflowId,r.stepId)}async previewStep(r,n){try{return await this.constructStepForPreview(r,n)}catch(l){throw this.log(` ${_e.ERROR} Failed to preview stepId: \`${n.stepId}\``),lt(l)?l:new Ct(n.stepId,r.action,l)}}async constructStepForPreview(r,n){return r.stepId===n.stepId?await this.previewRequiredStep(n,r):await this.extractMockDataForPreviousSteps(r,n)}async extractMockDataForPreviousSteps(r,n){let l={},w=this.getStepState(r,n.stepId),U=this.mock(n.results.schema);return{outputs:dr(U,(w==null?void 0:w.outputs)||{}),providers:await this.executeProviders(r,n,l)}}async previewRequiredStep(r,n){let l=await this.createStepControls(r,n),w=await this.compileControls(l,n),U=await r.resolve(w),C=await this.validate(U,r.outputs.unknownSchema,"step","output",n.workflowId,r.stepId);return this.log(` ${_e.MOCK} Mocked stepId: \`${r.stepId}\``),{outputs:C,providers:await this.executeProviders(n,r,C)}}getStepState(r,n){return r.state.find(l=>l.stepId===n)}getStepCode(r,n){return{code:this.getStep(r,n).resolve.toString()}}getWorkflowCode(r){return{code:this.getWorkflow(r).execute.toString()}}getCode(r,n){let l;if(r)n?l=this.getStepCode(r,n):l=this.getWorkflowCode(r);else throw new Mt(r);return l}};function ua(c){let r={};for(let n of c)r[n.stepId]=n.outputs;return r}var Cn=class{constructor(r){this.handler=r.handler,this.client=r.client?r.client:new St,this.workflows=r.workflows,this.http=On(this.client.secretKey,this.client.apiUrl),this.frameworkName=r.frameworkName,this.hmacEnabled=this.client.strictAuthentication}createHandler(){return async(...r)=>{await this.client.addWorkflows(this.workflows);let n=await this.handler(...r),l=await this.handleAction({actions:n});return n.transformResponse(l)}}getStaticHeaders(){let r=`novu-framework:v${this.client.version}`;return{"content-type":"application/json","access-control-allow-origin":"*","access-control-allow-private-network":"true","access-control-allow-methods":"GET, POST","access-control-allow-headers":"*","access-control-max-age":"604800","novu-framework-version":"2024-06-26","novu-framework-sdk":"2.10.0-alpha.0","novu-framework-server":this.frameworkName,"user-agent":r}}createResponse(r,n){return{status:r,body:JSON.stringify(n),headers:{...this.getStaticHeaders()}}}createError(r){return{status:r.statusCode,body:JSON.stringify({message:r.message,data:r.data,code:r.code}),headers:this.getStaticHeaders()}}async handleAction({actions:r}){let n=await r.url(),l=await r.method(),w=n.searchParams.get("action")||"health-check",U=n.searchParams.get("workflowId")||"",C=n.searchParams.get("stepId")||"",z=await r.headers("novu-signature")||"",re={};try{l==="POST"&&(re=await r.body())}catch{}try{w!=="health-check"&&await this.validateHmac(re,z);let we=this.getPostActionMap(re,U,C,w),Pe=this.getGetActionMap(U,C);if(l==="POST")return await this.handlePostAction(w,we);if(l==="GET")return await this.handleGetAction(w,Pe);if(l==="OPTIONS")return this.createResponse(200,{})}catch(we){return this.handleError(we)}return this.createError(new cn(l))}getPostActionMap(r,n,l,w){return{trigger:this.triggerAction({workflowId:n,...r}),execute:async()=>{let U=await this.client.executeWorkflow({...r,workflowId:n,stepId:l,action:w});return this.createResponse(200,U)},preview:async()=>{let U=await this.client.executeWorkflow({...r,workflowId:n,stepId:l,action:w});return this.createResponse(200,U)}}}triggerAction(r){return async()=>{let n={name:r.workflowId,to:r.to,payload:(r==null?void 0:r.payload)||{},transactionId:r.transactionId,overrides:r.overrides||{},...r.actor&&{actor:r.actor},...r.bridgeUrl&&{bridgeUrl:r.bridgeUrl},...r.controls&&{controls:r.controls},...r.context&&{context:r.context}},l=await this.http.post("/events/trigger",n);return this.createResponse(200,l)}}getGetActionMap(r,n){return{discover:async()=>{let l=await this.client.discover();return this.createResponse(200,l)},"health-check":async()=>{let l=await this.client.healthCheck();return this.createResponse(200,l)},code:async()=>{let l=await this.client.getCode(r,n);return this.createResponse(200,l)}}}async handlePostAction(r,n){if(Object.values(Pt).includes(r)){let l=n[r];return l()}else throw new Nt(r,Pt)}async handleGetAction(r,n){if(Object.values(Ht).includes(r)){let l=n[r];return l()}else throw new Nt(r,Ht)}handleError(r){if(lt(r))return r.statusCode>=500&&console.error(r),this.createError(r);if(vi(r))return this.createError(r);{let n=new mt(r);return console.error(n),this.createError(n)}}async validateHmac(r,n){if(!this.hmacEnabled)return;if(!n)throw new mn;if(!this.client.secretKey)throw new Sn;let[l,w]=n.split(",");if(!l||!w)throw new yn;let[U,C]=l.split("="),[z,re]=w.split("=");if(Number(U)<Date.now()-1500)throw new gn;if(!(await ki(this.client.secretKey,`${C}.${JSON.stringify(r)}`)===re))throw new hn}};var q={output:{type:"object",properties:{},required:[],additionalProperties:!0}};var fa={type:"object",properties:{webhookUrl:{type:"string",format:"uri"},text:{type:"string"},blocks:{type:"array",items:{type:"object",properties:{type:{enum:["image","context","actions","divider","section","input","file","header","video","rich_text"]}},required:["type"],additionalProperties:!0}}},additionalProperties:!0},Zi={output:fa};var eo={"chat-webhook":q,discord:q,getstream:q,"grafana-on-call":q,mattermost:q,msteams:q,"rocket-chat":q,ryver:q,slack:Zi,"whatsapp-business":q,zulip:q};var ha={type:"object",properties:{to:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:'Email address of the recipient(s). Example: "Bob bob@host.com". You can use commas to separate multiple recipients (e.g.: "test@example.com,test@example.com" or ["test@example.com", "test@example.com"]).'},from:{type:"string"},subject:{type:"string",description:"Subject of the message."},text:{type:"string",description:"Text version of the message."},html:{type:"string",description:"HTML version of the message."},message:{type:"string",description:"MIME string of the message. Make sure to use multipart/form-data to send this as a file upload."},cc:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"Same as To but for carbon copy"},bcc:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"Same as To but for blind carbon copy"},ampHtml:{type:"string"},tVersion:{type:"string"},tText:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}]},oTag:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"Tag string. See Tagging for more information."},oDkim:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Enables/disabled DKIM signatures on per-message basis. Pass yes or no"},oDeliverytime:{type:"string",description:"Desired time of delivery. See Date Format. Note: Messages can be scheduled for a maximum of 3 days in the future."},oDeliverytimeOptimizePeriod:{type:"string"},oTimeZoneLocalize:{type:"string"},oTestmode:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Enables sending in test mode. Pass yes if needed. See Sending in Test Mode"},oTracking:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Toggles tracking on a per-message basis, see Tracking Messages for details. Pass yes or no."},oTrackingClicks:{anyOf:[{type:"string",enum:["yes","no","htmlonly"]},{type:"boolean"}],description:"Toggles clicks tracking on a per-message basis. Has higher priority than domain-level setting. Pass yes, no or htmlonly."},oTrackingOpens:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Toggles opens tracking on a per-message basis. Has higher priority than domain-level setting. Pass yes or no."},oRequireTls:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}]},oSkipVerification:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}]},recipientVariables:{type:"string"}},required:[],additionalProperties:!0},to={output:ha};var ut={type:"object",properties:{name:{type:"string"},email:{type:"string"}},description:'JSON object, containing 2 properties: Name and Email address of a previously validated and active sender. Including the Name property in the JSON is optional. This property is not mandatory in case you use TemplateID and you specified a From address for the template. Format : { "Email":"value", "Name":"value" }.',required:["Email"],additionalProperties:!0},ma={type:"object",properties:{contentType:{type:"string"},filename:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},ya={type:"object",properties:{filename:{type:"string"},contentType:{type:"string"},contentId:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},ga={type:"object",properties:{from:ut,sender:ut,to:{type:"array",items:ut},cc:{type:"array",items:ut},bcc:{type:"array",items:ut},replyTo:ut,subject:{type:"string"},textPart:{type:"string",description:"Content of the message, sent in Text and/or HTML format. At least one of these content types needs to be specified. When the HTML part is the only part provided, Mailjet will not generate a Text-part from the HTML version. The property can't be set when you use TemplateID"},htmlPart:{type:"string",description:"Content of the message, sent in Text and/or HTML format. At least one of these content types needs to be specified. When the HTML part is the only part provided, Mailjet will not generate a Text-part from the HTML version. The property can't be set when you use TemplateID"},templateId:{type:"number",description:"an ID for a template that is previously created and stored in Mailjet's system. It is mandatory when From and TextPart and/or HtmlPart are not provided. "},templateLanguage:{type:"boolean"},templateErrorReporting:ut,templateErrorDeliver:{type:"boolean"},attachments:{type:"array",items:ma},inlineAttachments:{type:"array",items:ya},priority:{type:"number"},customCampaign:{type:"string"},deduplicateCampaign:{type:"boolean"},trackOpens:{type:"string",enum:["account_default","disabled","enabled"]},trackClicks:{type:"string",enum:["account_default","disabled","enabled"]},customId:{type:"string"},eventPayload:{type:"string"},urlTags:{type:"string"},headers:{type:"object",additionalProperties:!0},variables:{type:"object",additionalProperties:!0}},required:[],additionalProperties:!0},no={output:ga};var qe={type:"object",properties:{address:{type:"string"},name:{type:"string"}},additionalProperties:!0},Mn={type:"object",properties:{content:{type:"string"},path:{type:"string"}},additionalProperties:!0},Sa={type:"object",properties:{from:{anyOf:[{type:"string"},qe]},sender:{anyOf:[{type:"string"},qe]},to:{anyOf:[{type:"string"},qe,{type:"array",items:qe}]},cc:{anyOf:[{type:"string"},qe,{type:"array",items:qe}]},bcc:{anyOf:[{type:"string"},qe,{type:"array",items:qe}]},replyTo:{anyOf:[{type:"string"},qe,{type:"array",items:qe}]},inReplyTo:{anyOf:[{type:"string"},qe]},references:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},subject:{type:"string"},text:{anyOf:[{type:"string"},Mn]},html:{anyOf:[{type:"string"},Mn]},watchHtml:{anyOf:[{type:"string"},Mn]},amp:{anyOf:[{type:"string"},{type:"object",properties:{content:{type:"string"},path:{type:"string"},href:{type:"string"},encoding:{type:"string"},contentType:{type:"string"},raw:{anyOf:[{type:"string"},Mn]}}}]},icalEvent:{anyOf:[{type:"string"},{type:"object",properties:{content:{type:"string"},path:{type:"string"},method:{type:"string"},filename:{anyOf:[{type:"string"},{type:"boolean"}]},href:{type:"string"},encoding:{type:"string"}}}]},headers:{anyOf:[{type:"object",additionalProperties:!0},{type:"array",items:{type:"object",additionalProperties:!0}}]},list:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},attachments:{type:"array",items:{type:"object",properties:{content:{type:"string"},path:{type:"string"}},additionalProperties:!0}}},required:[],additionalProperties:!0},ro={output:Sa};var wa={type:"object",properties:{},required:[],additionalProperties:!1},io={output:wa};var ba={type:"object",properties:{personalizations:{type:"array",description:"An array of messages and their metadata. Each object within personalizations can be thought of as an envelope - it defines who should receive an individual message and how that message should be handled. See our [Personalizations documentation](https://sendgrid.com/docs/for-developers/sending-email/personalizations/) for examples.",uniqueItems:!1,maxItems:1e3,items:{type:"object",properties:{from:{title:"From Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account."},name:{type:"string",description:"A name or title associated with the sending email address."}},required:["email"]},to:{title:"To Email Array",type:"array",items:{type:"object",properties:{email:{type:"string",format:"email",description:"The intended recipient's email address."},name:{type:"string",description:"The intended recipient's name."}},required:["email"]}},cc:{type:"array",description:"An array of recipients who will receive a copy of your email. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name.",maxItems:1e3,items:{title:"CC BCC Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The intended recipient's email address."},name:{type:"string",description:"The intended recipient's name."}},required:["email"]}},bcc:{type:"array",description:"An array of recipients who will receive a blind carbon copy of your email. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name.",maxItems:1e3,items:{title:"CC BCC Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The intended recipient's email address."},name:{type:"string",description:"The intended recipient's name."}},required:["email"]}},subject:{type:"string",description:"The subject of your email. See character length requirements according to [RFC 2822](http://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit#answer-1592310).",minLength:1},headers:{type:"object",description:"A collection of JSON key/value pairs allowing you to specify handling instructions for your email. You may not overwrite the following headers: `x-sg-id`, `x-sg-eid`, `received`, `dkim-signature`, `Content-Type`, `Content-Transfer-Encoding`, `To`, `From`, `Subject`, `Reply-To`, `CC`, `BCC`"},substitutions:{type:"object",description:'Substitutions allow you to insert data without using Dynamic Transactional Templates. This field should **not** be used in combination with a Dynamic Transactional Template, which can be identified by a `templateId` starting with `d-`. This field is a collection of key/value pairs following the pattern "substitutionTag":"value to substitute". The key/value pairs must be strings. These substitutions will apply to the text and html content of the body of your email, in addition to the `subject` and `reply-to` parameters. The total collective size of your substitutions may not exceed 10,000 bytes per personalization object.',maxProperties:1e4},dynamicTemplateData:{type:"object",description:'Dynamic template data is available using Handlebars syntax in Dynamic Transactional Templates. This field should be used in combination with a Dynamic Transactional Template, which can be identified by a `templateId` starting with `d-`. This field is a collection of key/value pairs following the pattern "variable_name":"value to insert".'},customArgs:{type:"object",description:"Values that are specific to this personalization that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is entered into this parameter will be assumed to be the custom argument that you would like to be used. This field may not exceed 10,000 bytes.",maxProperties:1e4},sendAt:{type:"integer",description:"A unix timestamp allowing you to specify when your email should be delivered. Scheduling delivery more than 72 hours in advance is forbidden."}},required:["to"]}},from:{title:"From Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account."},name:{type:"string",description:"A name or title associated with the sending email address."}},required:["email"]},replyTo:{title:"Reply_to Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The email address where any replies or bounces will be returned."},name:{type:"string",description:"A name or title associated with the `replyTo` email address."}},required:["email"]},replyToList:{type:"array",description:"An array of recipients who will receive replies and/or bounces. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name. You can either choose to use \u201CreplyTo\u201D field or \u201CreplyToList\u201D but not both.",uniqueItems:!0,maxItems:1e3,items:{type:"object",properties:{email:{type:"string",description:"The email address where any replies or bounces will be returned.",format:"email"},name:{type:"string",description:"A name or title associated with the `replyToList` email address."}},required:["email"]}},subject:{type:"string",description:"The global or 'message level' subject of your email. This may be overridden by subject lines set in personalizations.",minLength:1},content:{type:"array",description:"An array where you can specify the content of your email. You can include multiple [MIME types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of content, but you must specify at least one MIME type. To include more than one MIME type, add another object to the array containing the `type` and `value` parameters.",items:{type:"object",properties:{type:{type:"string",description:"The MIME type of the content you are including in your email (e.g., `\u201Ctext/plain\u201D` or `\u201Ctext/html\u201D`).",minLength:1},value:{type:"string",description:"The actual content of the specified MIME type that you are including in your email.",minLength:1}},required:["type","value"]}},attachments:{type:"array",description:"An array of objects where you can specify any attachments you want to include.",items:{type:"object",properties:{content:{type:"string",description:"The Base64 encoded content of the attachment.",minLength:1},type:{type:"string",description:"The MIME type of the content you are attaching (e.g., `\u201Ctext/plain\u201D` or `\u201Ctext/html\u201D`).",minLength:1},filename:{type:"string",description:"The attachment's filename."},disposition:{type:"string",default:"attachment",description:"The attachment's content-disposition, specifying how you would like the attachment to be displayed. For example, `\u201Cinline\u201D` results in the attached file are displayed automatically within the message while `\u201Cattachment\u201D` results in the attached file require some action to be taken before it is displayed, such as opening or downloading the file.",enum:["inline","attachment"]},contentId:{type:"string",description:"The attachment's content ID. This is used when the disposition is set to `\u201Cinline\u201D` and the attachment is an image, allowing the file to be displayed within the body of your email."}},required:["content","filename"]}},templateId:{type:"string",description:"An email template ID. A template that contains a subject and content \u2014 either text or html \u2014 will override any subject and content values specified at the personalizations or message level."},headers:{description:"An object containing key/value pairs of header names and the value to substitute for them. The key/value pairs must be strings. You must ensure these are properly encoded if they contain unicode characters. These headers cannot be one of the reserved headers.",type:"object"},categories:{type:"array",description:"An array of category names for this message. Each category name may not exceed 255 characters. ",uniqueItems:!0,maxItems:10,items:{type:"string",maxLength:255}},customArgs:{description:"Values that are specific to the entire send that will be carried along with the email and its activity data. Key/value pairs must be strings. Substitutions will not be made on custom arguments, so any string that is entered into this parameter will be assumed to be the custom argument that you would like to be used. This parameter is overridden by `customArgs` set at the personalizations level. Total `customArgs` size may not exceed 10,000 bytes.",type:"string"},sendAt:{type:"integer",description:"A unix timestamp allowing you to specify when you want your email to be delivered. This may be overridden by the `sendAt` parameter set at the personalizations level. Delivery cannot be scheduled more than 72 hours in advance. If you have the flexibility, it's better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid peak times \u2014 for example, scheduling at 10:53 \u2014 can result in lower deferral rates due to the reduced traffic during off-peak times."},batchId:{type:"string",description:"An ID representing a batch of emails to be sent at the same time. Including a `batchId` in your request allows you include this email in that batch. It also enables you to cancel or pause the delivery of that batch. For more information, see the [Cancel Scheduled Sends API](https://sendgrid.com/docs/api-reference/)."},asm:{type:"object",description:"An object allowing you to specify how to handle unsubscribes.",properties:{groupId:{type:"integer",description:"The unsubscribe group to associate with this email."},groupsToDisplay:{type:"array",description:"An array containing the unsubscribe groups that you would like to be displayed on the unsubscribe preferences page.",maxItems:25,items:{type:"integer"}}},required:["groupId"]},ipPoolName:{type:"string",description:"The IP Pool that you would like to send this email from.",minLength:2,maxLength:64},mailSettings:{type:"object",description:"A collection of different mail settings that you can use to specify how you would like this email to be handled.",properties:{bypassListManagement:{type:"object",description:"Allows you to bypass all unsubscribe groups and suppressions to ensure that the email is delivered to every single recipient. This should only be used in emergencies when it is absolutely necessary that every recipient receives your email. This filter cannot be combined with any other bypass filters. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},bypassSpamManagement:{type:"object",description:"Allows you to bypass the spam report list to ensure that the email is delivered to recipients. Bounce and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypassListManagement` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},bypassBounceManagement:{type:"object",description:"Allows you to bypass the bounce list to ensure that the email is delivered to recipients. Spam report and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypassListManagement` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},bypassUnsubscribeManagement:{type:"object",description:"Allows you to bypass the global unsubscribe list to ensure that the email is delivered to recipients. Bounce and spam report lists will still be checked; addresses on these other lists will not receive the message. This filter applies only to global unsubscribes and will not bypass group unsubscribes. This filter cannot be combined with the `bypassListManagement` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},footer:{type:"object",description:"The default footer that you would like included on every email.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},text:{type:"string",description:"The plain text content of your footer."},html:{type:"string",description:"The HTML content of your footer."}}},sandboxMode:{type:"object",description:"Sandbox Mode allows you to send a test email to ensure that your request body is valid and formatted correctly.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}}}},trackingSettings:{type:"object",description:"Settings to determine how you would like to track the metrics of how your recipients interact with your email.",properties:{clickTracking:{type:"object",description:"Allows you to track if a recipient clicked a link in your email.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},enableText:{type:"boolean",description:"Indicates if this setting should be included in the `text/plain` portion of your email."}}},openTracking:{type:"object",description:"Allows you to track if the email was opened by including a single pixel image in the body of the content. When the pixel is loaded, Twilio SendGrid can log that the email was opened.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},substitutionTag:{type:"string",description:"Allows you to specify a substitution tag that you can insert in the body of your email at a location that you desire. This tag will be replaced by the open tracking pixel."}}},subscriptionTracking:{type:"object",description:"Allows you to insert a subscription management link at the bottom of the text and HTML bodies of your email. If you would like to specify the location of the link within your email, you may use the `substitutionTag`.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},text:{type:"string",description:"Text to be appended to the email with the subscription tracking link. You may control where the link is by using the tag <% %>"},html:{type:"string",description:"HTML to be appended to the email with the subscription tracking link. You may control where the link is by using the tag <% %>"},substitutionTag:{type:"string",description:"A tag that will be replaced with the unsubscribe URL. for example: `[unsubscribe_url]`. If this parameter is used, it will override both the `text` and `html` parameters. The URL of the link will be placed at the substitution tag\u2019s location with no additional formatting."}}},ganalytics:{type:"object",description:"Allows you to enable tracking provided by Google Analytics.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},utmSource:{type:"string",description:"Name of the referrer source. (e.g. Google, SomeDomain.com, or Marketing Email)"},utmMedium:{type:"string",description:"Name of the marketing medium. (e.g. Email)"},utmTerm:{type:"string",description:"Used to identify any paid keywords."},utmContent:{type:"string",description:"Used to differentiate your campaign from advertisements."},utmCampaign:{type:"string",description:"The name of the campaign."}}}}}},required:[],additionalProperties:!1},oo={output:ba};var so={braze:q,clickatell:q,nodemailer:ro,emailjs:q,"email-webhook":q,"infobip-email":q,mailersend:q,mailgun:to,mailjet:no,mailtrap:q,mandrill:q,netcore:q,"novu-email":io,outlook365:q,plunk:q,postmark:q,resend:q,sendgrid:oo,sendinblue:q,ses:q,sparkpost:q};var Ta={type:"object",properties:{},required:[],additionalProperties:!1},ao={output:Ta};var lo={novu:ao};var co={anyOf:[{type:"string"},{type:"object",additionalProperties:!0,properties:{name:{type:"string"},volume:{type:"number"},critical:{type:"number"}},required:["name","volume","critical"]}]},Oa={type:"object",properties:{topic:{type:"string",description:"The destination topic for the notification."},id:{type:"string",description:"A UUID to identify the notification with APNS. If an id is not supplied, APNS will generate one automatically. If an error occurs the response will contain the id. This property populates the apns-id header."},expiry:{type:"number",description:"A UNIX timestamp when the notification should expire. If the notification cannot be delivered to the device, APNS will retry until it expires. An expiry of 0 indicates that the notification expires immediately, therefore no retries will be attempted."},priority:{type:"number",description:`Provide one of the following values:
|
|
95
|
+
`)}async executeProviders(r,n,p){return n.providers.reduce(async(w,F)=>{let k=await w,z=this.previewProvider.bind(this),re=this.executeProvider.bind(this),Pe=await(r.action==="preview"?z:re)(r,n,F,p);return{...k,[F.type]:Pe}},Promise.resolve({}))}previewProvider(r,n,p,w){return this.log(` ${_e.MOCK} Mocked provider: \`${p.type}\``),this.mock(p.outputs.schema)}async executeProvider(r,n,p,w){try{if(r.stepId===n.stepId){let F=await this.createStepControls(n,r),k=await p.resolve({controls:F,outputs:w}),z=await this.validate(k,p.outputs.unknownSchema,"step","output",r.workflowId,n.stepId,p.type);return this.log(` ${_e.SUCCESS} Executed provider: \`${p.type}\``),{...z,_passthrough:k._passthrough}}else return this.log(` ${_e.HYDRATED} Hydrated provider: \`${p.type}\``),{}}catch(F){throw this.log(` ${_e.ERROR} Failed to execute provider: \`${p.type}\``),new fn(p.type,r.action,F)}}async executeStep(r,n){if(r.stepId===n.stepId)try{let p=await this.createStepControls(n,r),w=await this.compileControls(p,r),F=await n.resolve(w),k=await this.validate(F,n.outputs.unknownSchema,"step","output",r.workflowId,n.stepId),z=await this.executeProviders(r,n,k);return this.log(` ${_e.SUCCESS} Executed stepId: \`${n.stepId}\``),{outputs:k,providers:z}}catch(p){throw this.log(` ${_e.ERROR} Failed to execute stepId: \`${n.stepId}\``),lt(p)?p:new kt(n.stepId,r.action,p)}else try{let p=this.getStepState(r,n.stepId);if(p){let w=await this.validate(p.outputs,n.results.unknownSchema,"step","result",r.workflowId,n.stepId);return this.log(` ${_e.HYDRATED} Hydrated stepId: \`${n.stepId}\``),{outputs:w,providers:await this.executeProviders(r,n,w)}}else throw new Zt(r.workflowId,n.stepId)}catch(p){throw this.log(` ${_e.ERROR} Failed to hydrate stepId: \`${n.stepId}\``),p}}async compileControls(r,n){var p;try{let w=this.preprocessTranslationPatterns(JSON.stringify(r));w=this.preprocessFilterTranslationArgs(w);let F=this.templateEngine.parse(w),k=this.getWorkflow(n.workflowId),z={workflow:{workflowId:k.workflowId,name:k.name,description:k.description,tags:k.tags,severity:k.severity},payload:n.payload,subscriber:n.subscriber,context:n.context,steps:ua(n.state),env:(p=n.env)!=null?p:{}},re=await this.templateEngine.render(F,z),we=this.postprocessTranslationMarkers(re),Pe=(0,Qi.jsonrepair)(we),xe=JSON.parse(Pe);return Gi(xe)}catch(w){throw new on(n.workflowId,n.stepId,w)}}preprocessTranslationPatterns(r){return r.replace(/\{\{\s*t\.([\p{L}\p{N}_.-]+)\s*\}\}/gu,"[T:$1]")}preprocessFilterTranslationArgs(r){return r.replace(/'t\.([\p{L}\p{N}_.-]+)'/gu,"'[T:$1]'")}postprocessTranslationMarkers(r){return r.replace(/\[T:([\p{L}\p{N}_.-]+)\]/gu,"{{t.$1}}")}async createStepControls(r,n){return await this.validate(n.controls,r.controls.unknownSchema,"step","controls",n.workflowId,r.stepId)}async previewStep(r,n){try{return await this.constructStepForPreview(r,n)}catch(p){throw this.log(` ${_e.ERROR} Failed to preview stepId: \`${n.stepId}\``),lt(p)?p:new kt(n.stepId,r.action,p)}}async constructStepForPreview(r,n){return r.stepId===n.stepId?await this.previewRequiredStep(n,r):await this.extractMockDataForPreviousSteps(r,n)}async extractMockDataForPreviousSteps(r,n){let p={},w=this.getStepState(r,n.stepId),F=this.mock(n.results.schema);return{outputs:dr(F,(w==null?void 0:w.outputs)||{}),providers:await this.executeProviders(r,n,p)}}async previewRequiredStep(r,n){let p=await this.createStepControls(r,n),w=await this.compileControls(p,n),F=await r.resolve(w),k=await this.validate(F,r.outputs.unknownSchema,"step","output",n.workflowId,r.stepId);return this.log(` ${_e.MOCK} Mocked stepId: \`${r.stepId}\``),{outputs:k,providers:await this.executeProviders(n,r,k)}}getStepState(r,n){return r.state.find(p=>p.stepId===n)}getStepCode(r,n){return{code:this.getStep(r,n).resolve.toString()}}getWorkflowCode(r){return{code:this.getWorkflow(r).execute.toString()}}getCode(r,n){let p;if(r)n?p=this.getStepCode(r,n):p=this.getWorkflowCode(r);else throw new Mt(r);return p}};function ua(l){let r={};for(let n of l)r[n.stepId]=n.outputs;return r}var kn=class{constructor(r){this.handler=r.handler,this.client=r.client?r.client:new St,this.workflows=r.workflows,this.http=On(this.client.secretKey,this.client.apiUrl),this.frameworkName=r.frameworkName,this.hmacEnabled=this.client.strictAuthentication}createHandler(){return async(...r)=>{await this.client.addWorkflows(this.workflows);let n=await this.handler(...r),p=await this.handleAction({actions:n});return n.transformResponse(p)}}getStaticHeaders(){let r=`novu-framework:v${this.client.version}`;return{"content-type":"application/json","access-control-allow-origin":"*","access-control-allow-private-network":"true","access-control-allow-methods":"GET, POST","access-control-allow-headers":"*","access-control-max-age":"604800","novu-framework-version":"2024-06-26","novu-framework-sdk":"2.10.0","novu-framework-server":this.frameworkName,"user-agent":r}}createResponse(r,n){return{status:r,body:JSON.stringify(n),headers:{...this.getStaticHeaders()}}}createError(r){return{status:r.statusCode,body:JSON.stringify({message:r.message,data:r.data,code:r.code}),headers:this.getStaticHeaders()}}async handleAction({actions:r}){let n=await r.url(),p=await r.method(),w=n.searchParams.get("action")||"health-check",F=n.searchParams.get("workflowId")||"",k=n.searchParams.get("stepId")||"",z=await r.headers("novu-signature")||"",re={};try{p==="POST"&&(re=await r.body())}catch{}try{w!=="health-check"&&await this.validateHmac(re,z);let we=this.getPostActionMap(re,F,k,w),Pe=this.getGetActionMap(F,k);if(p==="POST")return await this.handlePostAction(w,we);if(p==="GET")return await this.handleGetAction(w,Pe);if(p==="OPTIONS")return this.createResponse(200,{})}catch(we){return this.handleError(we)}return this.createError(new cn(p))}getPostActionMap(r,n,p,w){return{trigger:this.triggerAction({workflowId:n,...r}),execute:async()=>{let F=await this.client.executeWorkflow({...r,workflowId:n,stepId:p,action:w});return this.createResponse(200,F)},preview:async()=>{let F=await this.client.executeWorkflow({...r,workflowId:n,stepId:p,action:w});return this.createResponse(200,F)}}}triggerAction(r){return async()=>{let n={name:r.workflowId,to:r.to,payload:(r==null?void 0:r.payload)||{},transactionId:r.transactionId,overrides:r.overrides||{},...r.actor&&{actor:r.actor},...r.bridgeUrl&&{bridgeUrl:r.bridgeUrl},...r.controls&&{controls:r.controls},...r.context&&{context:r.context}},p=await this.http.post("/events/trigger",n);return this.createResponse(200,p)}}getGetActionMap(r,n){return{discover:async()=>{let p=await this.client.discover();return this.createResponse(200,p)},"health-check":async()=>{let p=await this.client.healthCheck();return this.createResponse(200,p)},code:async()=>{let p=await this.client.getCode(r,n);return this.createResponse(200,p)}}}async handlePostAction(r,n){if(Object.values(Pt).includes(r)){let p=n[r];return p()}else throw new Nt(r,Pt)}async handleGetAction(r,n){if(Object.values(Ht).includes(r)){let p=n[r];return p()}else throw new Nt(r,Ht)}handleError(r){if(lt(r))return r.statusCode>=500&&console.error(r),this.createError(r);if(vi(r))return this.createError(r);{let n=new mt(r);return console.error(n),this.createError(n)}}async validateHmac(r,n){if(!this.hmacEnabled)return;if(!n)throw new mn;if(!this.client.secretKey)throw new Sn;let[p,w]=n.split(",");if(!p||!w)throw new yn;let[F,k]=p.split("="),[z,re]=w.split("=");if(Number(F)<Date.now()-1500)throw new gn;if(!(await Ci(this.client.secretKey,`${k}.${JSON.stringify(r)}`)===re))throw new hn}};var q={output:{type:"object",properties:{},required:[],additionalProperties:!0}};var fa={type:"object",properties:{webhookUrl:{type:"string",format:"uri"},text:{type:"string"},blocks:{type:"array",items:{type:"object",properties:{type:{enum:["image","context","actions","divider","section","input","file","header","video","rich_text"]}},required:["type"],additionalProperties:!0}}},additionalProperties:!0},Zi={output:fa};var eo={"chat-webhook":q,discord:q,getstream:q,"grafana-on-call":q,mattermost:q,msteams:q,"rocket-chat":q,ryver:q,slack:Zi,"whatsapp-business":q,zulip:q};var ha={type:"object",properties:{to:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:'Email address of the recipient(s). Example: "Bob bob@host.com". You can use commas to separate multiple recipients (e.g.: "test@example.com,test@example.com" or ["test@example.com", "test@example.com"]).'},from:{type:"string"},subject:{type:"string",description:"Subject of the message."},text:{type:"string",description:"Text version of the message."},html:{type:"string",description:"HTML version of the message."},message:{type:"string",description:"MIME string of the message. Make sure to use multipart/form-data to send this as a file upload."},cc:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"Same as To but for carbon copy"},bcc:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"Same as To but for blind carbon copy"},ampHtml:{type:"string"},tVersion:{type:"string"},tText:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}]},oTag:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"Tag string. See Tagging for more information."},oDkim:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Enables/disabled DKIM signatures on per-message basis. Pass yes or no"},oDeliverytime:{type:"string",description:"Desired time of delivery. See Date Format. Note: Messages can be scheduled for a maximum of 3 days in the future."},oDeliverytimeOptimizePeriod:{type:"string"},oTimeZoneLocalize:{type:"string"},oTestmode:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Enables sending in test mode. Pass yes if needed. See Sending in Test Mode"},oTracking:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Toggles tracking on a per-message basis, see Tracking Messages for details. Pass yes or no."},oTrackingClicks:{anyOf:[{type:"string",enum:["yes","no","htmlonly"]},{type:"boolean"}],description:"Toggles clicks tracking on a per-message basis. Has higher priority than domain-level setting. Pass yes, no or htmlonly."},oTrackingOpens:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}],description:"Toggles opens tracking on a per-message basis. Has higher priority than domain-level setting. Pass yes or no."},oRequireTls:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}]},oSkipVerification:{anyOf:[{type:"string",enum:["yes","no"]},{type:"boolean"}]},recipientVariables:{type:"string"}},required:[],additionalProperties:!0},to={output:ha};var ut={type:"object",properties:{name:{type:"string"},email:{type:"string"}},description:'JSON object, containing 2 properties: Name and Email address of a previously validated and active sender. Including the Name property in the JSON is optional. This property is not mandatory in case you use TemplateID and you specified a From address for the template. Format : { "Email":"value", "Name":"value" }.',required:["Email"],additionalProperties:!0},ma={type:"object",properties:{contentType:{type:"string"},filename:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},ya={type:"object",properties:{filename:{type:"string"},contentType:{type:"string"},contentId:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},ga={type:"object",properties:{from:ut,sender:ut,to:{type:"array",items:ut},cc:{type:"array",items:ut},bcc:{type:"array",items:ut},replyTo:ut,subject:{type:"string"},textPart:{type:"string",description:"Content of the message, sent in Text and/or HTML format. At least one of these content types needs to be specified. When the HTML part is the only part provided, Mailjet will not generate a Text-part from the HTML version. The property can't be set when you use TemplateID"},htmlPart:{type:"string",description:"Content of the message, sent in Text and/or HTML format. At least one of these content types needs to be specified. When the HTML part is the only part provided, Mailjet will not generate a Text-part from the HTML version. The property can't be set when you use TemplateID"},templateId:{type:"number",description:"an ID for a template that is previously created and stored in Mailjet's system. It is mandatory when From and TextPart and/or HtmlPart are not provided. "},templateLanguage:{type:"boolean"},templateErrorReporting:ut,templateErrorDeliver:{type:"boolean"},attachments:{type:"array",items:ma},inlineAttachments:{type:"array",items:ya},priority:{type:"number"},customCampaign:{type:"string"},deduplicateCampaign:{type:"boolean"},trackOpens:{type:"string",enum:["account_default","disabled","enabled"]},trackClicks:{type:"string",enum:["account_default","disabled","enabled"]},customId:{type:"string"},eventPayload:{type:"string"},urlTags:{type:"string"},headers:{type:"object",additionalProperties:!0},variables:{type:"object",additionalProperties:!0}},required:[],additionalProperties:!0},no={output:ga};var qe={type:"object",properties:{address:{type:"string"},name:{type:"string"}},additionalProperties:!0},Mn={type:"object",properties:{content:{type:"string"},path:{type:"string"}},additionalProperties:!0},Sa={type:"object",properties:{from:{anyOf:[{type:"string"},qe]},sender:{anyOf:[{type:"string"},qe]},to:{anyOf:[{type:"string"},qe,{type:"array",items:qe}]},cc:{anyOf:[{type:"string"},qe,{type:"array",items:qe}]},bcc:{anyOf:[{type:"string"},qe,{type:"array",items:qe}]},replyTo:{anyOf:[{type:"string"},qe,{type:"array",items:qe}]},inReplyTo:{anyOf:[{type:"string"},qe]},references:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},subject:{type:"string"},text:{anyOf:[{type:"string"},Mn]},html:{anyOf:[{type:"string"},Mn]},watchHtml:{anyOf:[{type:"string"},Mn]},amp:{anyOf:[{type:"string"},{type:"object",properties:{content:{type:"string"},path:{type:"string"},href:{type:"string"},encoding:{type:"string"},contentType:{type:"string"},raw:{anyOf:[{type:"string"},Mn]}}}]},icalEvent:{anyOf:[{type:"string"},{type:"object",properties:{content:{type:"string"},path:{type:"string"},method:{type:"string"},filename:{anyOf:[{type:"string"},{type:"boolean"}]},href:{type:"string"},encoding:{type:"string"}}}]},headers:{anyOf:[{type:"object",additionalProperties:!0},{type:"array",items:{type:"object",additionalProperties:!0}}]},list:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},attachments:{type:"array",items:{type:"object",properties:{content:{type:"string"},path:{type:"string"}},additionalProperties:!0}}},required:[],additionalProperties:!0},ro={output:Sa};var wa={type:"object",properties:{},required:[],additionalProperties:!1},io={output:wa};var ba={type:"object",properties:{personalizations:{type:"array",description:"An array of messages and their metadata. Each object within personalizations can be thought of as an envelope - it defines who should receive an individual message and how that message should be handled. See our [Personalizations documentation](https://sendgrid.com/docs/for-developers/sending-email/personalizations/) for examples.",uniqueItems:!1,maxItems:1e3,items:{type:"object",properties:{from:{title:"From Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account."},name:{type:"string",description:"A name or title associated with the sending email address."}},required:["email"]},to:{title:"To Email Array",type:"array",items:{type:"object",properties:{email:{type:"string",format:"email",description:"The intended recipient's email address."},name:{type:"string",description:"The intended recipient's name."}},required:["email"]}},cc:{type:"array",description:"An array of recipients who will receive a copy of your email. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name.",maxItems:1e3,items:{title:"CC BCC Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The intended recipient's email address."},name:{type:"string",description:"The intended recipient's name."}},required:["email"]}},bcc:{type:"array",description:"An array of recipients who will receive a blind carbon copy of your email. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name.",maxItems:1e3,items:{title:"CC BCC Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The intended recipient's email address."},name:{type:"string",description:"The intended recipient's name."}},required:["email"]}},subject:{type:"string",description:"The subject of your email. See character length requirements according to [RFC 2822](http://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit#answer-1592310).",minLength:1},headers:{type:"object",description:"A collection of JSON key/value pairs allowing you to specify handling instructions for your email. You may not overwrite the following headers: `x-sg-id`, `x-sg-eid`, `received`, `dkim-signature`, `Content-Type`, `Content-Transfer-Encoding`, `To`, `From`, `Subject`, `Reply-To`, `CC`, `BCC`"},substitutions:{type:"object",description:'Substitutions allow you to insert data without using Dynamic Transactional Templates. This field should **not** be used in combination with a Dynamic Transactional Template, which can be identified by a `templateId` starting with `d-`. This field is a collection of key/value pairs following the pattern "substitutionTag":"value to substitute". The key/value pairs must be strings. These substitutions will apply to the text and html content of the body of your email, in addition to the `subject` and `reply-to` parameters. The total collective size of your substitutions may not exceed 10,000 bytes per personalization object.',maxProperties:1e4},dynamicTemplateData:{type:"object",description:'Dynamic template data is available using Handlebars syntax in Dynamic Transactional Templates. This field should be used in combination with a Dynamic Transactional Template, which can be identified by a `templateId` starting with `d-`. This field is a collection of key/value pairs following the pattern "variable_name":"value to insert".'},customArgs:{type:"object",description:"Values that are specific to this personalization that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is entered into this parameter will be assumed to be the custom argument that you would like to be used. This field may not exceed 10,000 bytes.",maxProperties:1e4},sendAt:{type:"integer",description:"A unix timestamp allowing you to specify when your email should be delivered. Scheduling delivery more than 72 hours in advance is forbidden."}},required:["to"]}},from:{title:"From Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account."},name:{type:"string",description:"A name or title associated with the sending email address."}},required:["email"]},replyTo:{title:"Reply_to Email Object",type:"object",properties:{email:{type:"string",format:"email",description:"The email address where any replies or bounces will be returned."},name:{type:"string",description:"A name or title associated with the `replyTo` email address."}},required:["email"]},replyToList:{type:"array",description:"An array of recipients who will receive replies and/or bounces. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name. You can either choose to use \u201CreplyTo\u201D field or \u201CreplyToList\u201D but not both.",uniqueItems:!0,maxItems:1e3,items:{type:"object",properties:{email:{type:"string",description:"The email address where any replies or bounces will be returned.",format:"email"},name:{type:"string",description:"A name or title associated with the `replyToList` email address."}},required:["email"]}},subject:{type:"string",description:"The global or 'message level' subject of your email. This may be overridden by subject lines set in personalizations.",minLength:1},content:{type:"array",description:"An array where you can specify the content of your email. You can include multiple [MIME types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of content, but you must specify at least one MIME type. To include more than one MIME type, add another object to the array containing the `type` and `value` parameters.",items:{type:"object",properties:{type:{type:"string",description:"The MIME type of the content you are including in your email (e.g., `\u201Ctext/plain\u201D` or `\u201Ctext/html\u201D`).",minLength:1},value:{type:"string",description:"The actual content of the specified MIME type that you are including in your email.",minLength:1}},required:["type","value"]}},attachments:{type:"array",description:"An array of objects where you can specify any attachments you want to include.",items:{type:"object",properties:{content:{type:"string",description:"The Base64 encoded content of the attachment.",minLength:1},type:{type:"string",description:"The MIME type of the content you are attaching (e.g., `\u201Ctext/plain\u201D` or `\u201Ctext/html\u201D`).",minLength:1},filename:{type:"string",description:"The attachment's filename."},disposition:{type:"string",default:"attachment",description:"The attachment's content-disposition, specifying how you would like the attachment to be displayed. For example, `\u201Cinline\u201D` results in the attached file are displayed automatically within the message while `\u201Cattachment\u201D` results in the attached file require some action to be taken before it is displayed, such as opening or downloading the file.",enum:["inline","attachment"]},contentId:{type:"string",description:"The attachment's content ID. This is used when the disposition is set to `\u201Cinline\u201D` and the attachment is an image, allowing the file to be displayed within the body of your email."}},required:["content","filename"]}},templateId:{type:"string",description:"An email template ID. A template that contains a subject and content \u2014 either text or html \u2014 will override any subject and content values specified at the personalizations or message level."},headers:{description:"An object containing key/value pairs of header names and the value to substitute for them. The key/value pairs must be strings. You must ensure these are properly encoded if they contain unicode characters. These headers cannot be one of the reserved headers.",type:"object"},categories:{type:"array",description:"An array of category names for this message. Each category name may not exceed 255 characters. ",uniqueItems:!0,maxItems:10,items:{type:"string",maxLength:255}},customArgs:{description:"Values that are specific to the entire send that will be carried along with the email and its activity data. Key/value pairs must be strings. Substitutions will not be made on custom arguments, so any string that is entered into this parameter will be assumed to be the custom argument that you would like to be used. This parameter is overridden by `customArgs` set at the personalizations level. Total `customArgs` size may not exceed 10,000 bytes.",type:"string"},sendAt:{type:"integer",description:"A unix timestamp allowing you to specify when you want your email to be delivered. This may be overridden by the `sendAt` parameter set at the personalizations level. Delivery cannot be scheduled more than 72 hours in advance. If you have the flexibility, it's better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid peak times \u2014 for example, scheduling at 10:53 \u2014 can result in lower deferral rates due to the reduced traffic during off-peak times."},batchId:{type:"string",description:"An ID representing a batch of emails to be sent at the same time. Including a `batchId` in your request allows you include this email in that batch. It also enables you to cancel or pause the delivery of that batch. For more information, see the [Cancel Scheduled Sends API](https://sendgrid.com/docs/api-reference/)."},asm:{type:"object",description:"An object allowing you to specify how to handle unsubscribes.",properties:{groupId:{type:"integer",description:"The unsubscribe group to associate with this email."},groupsToDisplay:{type:"array",description:"An array containing the unsubscribe groups that you would like to be displayed on the unsubscribe preferences page.",maxItems:25,items:{type:"integer"}}},required:["groupId"]},ipPoolName:{type:"string",description:"The IP Pool that you would like to send this email from.",minLength:2,maxLength:64},mailSettings:{type:"object",description:"A collection of different mail settings that you can use to specify how you would like this email to be handled.",properties:{bypassListManagement:{type:"object",description:"Allows you to bypass all unsubscribe groups and suppressions to ensure that the email is delivered to every single recipient. This should only be used in emergencies when it is absolutely necessary that every recipient receives your email. This filter cannot be combined with any other bypass filters. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},bypassSpamManagement:{type:"object",description:"Allows you to bypass the spam report list to ensure that the email is delivered to recipients. Bounce and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypassListManagement` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},bypassBounceManagement:{type:"object",description:"Allows you to bypass the bounce list to ensure that the email is delivered to recipients. Spam report and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypassListManagement` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},bypassUnsubscribeManagement:{type:"object",description:"Allows you to bypass the global unsubscribe list to ensure that the email is delivered to recipients. Bounce and spam report lists will still be checked; addresses on these other lists will not receive the message. This filter applies only to global unsubscribes and will not bypass group unsubscribes. This filter cannot be combined with the `bypassListManagement` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}},footer:{type:"object",description:"The default footer that you would like included on every email.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},text:{type:"string",description:"The plain text content of your footer."},html:{type:"string",description:"The HTML content of your footer."}}},sandboxMode:{type:"object",description:"Sandbox Mode allows you to send a test email to ensure that your request body is valid and formatted correctly.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."}}}}},trackingSettings:{type:"object",description:"Settings to determine how you would like to track the metrics of how your recipients interact with your email.",properties:{clickTracking:{type:"object",description:"Allows you to track if a recipient clicked a link in your email.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},enableText:{type:"boolean",description:"Indicates if this setting should be included in the `text/plain` portion of your email."}}},openTracking:{type:"object",description:"Allows you to track if the email was opened by including a single pixel image in the body of the content. When the pixel is loaded, Twilio SendGrid can log that the email was opened.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},substitutionTag:{type:"string",description:"Allows you to specify a substitution tag that you can insert in the body of your email at a location that you desire. This tag will be replaced by the open tracking pixel."}}},subscriptionTracking:{type:"object",description:"Allows you to insert a subscription management link at the bottom of the text and HTML bodies of your email. If you would like to specify the location of the link within your email, you may use the `substitutionTag`.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},text:{type:"string",description:"Text to be appended to the email with the subscription tracking link. You may control where the link is by using the tag <% %>"},html:{type:"string",description:"HTML to be appended to the email with the subscription tracking link. You may control where the link is by using the tag <% %>"},substitutionTag:{type:"string",description:"A tag that will be replaced with the unsubscribe URL. for example: `[unsubscribe_url]`. If this parameter is used, it will override both the `text` and `html` parameters. The URL of the link will be placed at the substitution tag\u2019s location with no additional formatting."}}},ganalytics:{type:"object",description:"Allows you to enable tracking provided by Google Analytics.",properties:{enable:{type:"boolean",description:"Indicates if this setting is enabled."},utmSource:{type:"string",description:"Name of the referrer source. (e.g. Google, SomeDomain.com, or Marketing Email)"},utmMedium:{type:"string",description:"Name of the marketing medium. (e.g. Email)"},utmTerm:{type:"string",description:"Used to identify any paid keywords."},utmContent:{type:"string",description:"Used to differentiate your campaign from advertisements."},utmCampaign:{type:"string",description:"The name of the campaign."}}}}}},required:[],additionalProperties:!1},oo={output:ba};var so={braze:q,clickatell:q,nodemailer:ro,emailjs:q,"email-webhook":q,"infobip-email":q,mailersend:q,mailgun:to,mailjet:no,mailtrap:q,mandrill:q,netcore:q,"novu-email":io,outlook365:q,plunk:q,postmark:q,resend:q,sendgrid:oo,sendinblue:q,ses:q,sparkpost:q};var Ta={type:"object",properties:{},required:[],additionalProperties:!1},ao={output:Ta};var lo={novu:ao};var co={anyOf:[{type:"string"},{type:"object",additionalProperties:!0,properties:{name:{type:"string"},volume:{type:"number"},critical:{type:"number"}},required:["name","volume","critical"]}]},Oa={type:"object",properties:{topic:{type:"string",description:"The destination topic for the notification."},id:{type:"string",description:"A UUID to identify the notification with APNS. If an id is not supplied, APNS will generate one automatically. If an error occurs the response will contain the id. This property populates the apns-id header."},expiry:{type:"number",description:"A UNIX timestamp when the notification should expire. If the notification cannot be delivered to the device, APNS will retry until it expires. An expiry of 0 indicates that the notification expires immediately, therefore no retries will be attempted."},priority:{type:"number",description:`Provide one of the following values:
|
|
96
96
|
|
|
97
97
|
10 - The push notification is sent to the device immediately. (Default)
|
|
98
98
|
The push notification must trigger an alert, sound, or badge on the device. It is an error to use this priority for a push notification that contains only the content-available key.
|
|
@@ -502,4 +502,4 @@ Examples: All examples are the exact same date & time.
|
|
|
502
502
|
"Sept 24 2015 14:00:00 GMT-0700"
|
|
503
503
|
"Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)"
|
|
504
504
|
Note: SMS currently only supports sendAfter parameter.
|
|
505
|
-
`,writeOnly:!0,nullable:!0}}}],required:[],additionalProperties:!0},ho={output:Ra};var mo={apns:po,expo:uo,fcm:fo,"one-signal":ho,"pusher-beams":q,pushpad:q,"push-webhook":q,appio:q};var Ea={type:"object",properties:{},required:[],additionalProperties:!1},yo={output:Ea};var _a={type:"object",properties:{to:{type:"string",pattern:"^\\+[1-9]\\d{1,14}$",description:"The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`."},statusCallback:{type:"string",format:"uri",description:"The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messagingServiceSid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). "},applicationSid:{type:"string",minLength:34,maxLength:34,pattern:"^AP[0-9a-fA-F]{32}$",description:"The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `statusCallback` URL. Note that the `statusCallback` parameter of a request takes priority over the `applicationSid` parameter; if both are included `applicationSid` is ignored."},maxPrice:{type:"number",description:"[OBSOLETE] This parameter will no longer have any effect as of 2024-06-03."},provideFeedback:{type:"boolean",description:"Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`."},attempt:{type:"integer",description:"Total number of attempts made (including this request) to send the message regardless of the provider used"},validityPeriod:{type:"integer",description:"The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validityPeriod`, the Message is not sent. Accepted values are integers from `1` to `36000`. Default value is `36000`. A `validityPeriod` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html)"},forceDelivery:{type:"boolean",description:"Reserved"},contentRetention:{type:"string",enum:["retain","discard"],description:"Determines if the message content can be stored or redacted based on privacy settings"},addressRetention:{type:"string",enum:["retain","obfuscate"],description:"Determines if the address can be stored or obfuscated based on privacy settings"},smartEncoded:{type:"boolean",description:"Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`."},persistentAction:{type:"array",items:{type:"string"},description:"Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp)."},shortenUrls:{type:"boolean",description:"For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messagingServiceSid` parameter must also be provided."},scheduleType:{type:"string",enum:["fixed"],description:"For Messaging Services only: Include this parameter with a value of `fixed` in conjunction with the `sendAt` parameter in order to [schedule a Message](https://www.twilio.com/docs/messaging/features/message-scheduling)."},sendAt:{type:"string",format:"date-time",description:"The time that Twilio will send the message. Must be in ISO 8601 format."},sendAsMms:{type:"boolean",description:"If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media."},contentVariables:{type:"string",description:"For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `contentSid` parameter must also be provided. If values are not defined in the `contentVariables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used."},riskCheck:{type:"string",enum:["enable","disable"],description:"Include this parameter with a value of `disable` to skip any kind of risk check on the respective message request."},from:{type:"string",pattern:"^\\+[1-9]\\d{1,14}$",description:"The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messagingServiceSid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool."},messagingServiceSid:{type:"string",minLength:34,maxLength:34,pattern:"^MG[0-9a-fA-F]{32}$",description:"The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool."},body:{type:"string",description:"The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [sendAsMms parameter](https://www.twilio.com/blog/mms-for-long-text-messages)."},mediaUrl:{type:"array",items:{type:"string",format:"uri"},description:"The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `mediaUrl` parameters in the POST request. You can include up to ten `mediaUrl` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply."},contentSid:{type:"string",minLength:34,maxLength:34,pattern:"^HX[0-9a-fA-F]{32}$",description:"For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources)."}},required:[],additionalProperties:!0},go={output:_a};var So={"africas-talking":q,"azure-sms":q,bandwidth:q,"brevo-sms":q,"bulk-sms":q,"burst-sms":q,clickatell:q,clicksend:q,"eazy-sms":q,firetext:q,"forty-six-elks":q,"generic-sms":q,gupshup:q,"infobip-sms":q,"isend-sms":q,kannel:q,maqsam:q,messagebird:q,mobishastra:q,nexmo:q,"novu-sms":yo,plivo:q,"ring-central":q,sendchamp:q,simpletexting:q,sms77:q,"sms-central":q,smsmode:q,sns:q,telnyx:q,termii:q,twilio:go,"afro-message":q,unifonic:q,imedia:q,sinch:q,"isendpro-sms":q};var Ln={chat:eo,sms:So,email:so,push:mo,in_app:lo};var Pa={type:"object",properties:{type:{enum:["regular"]},amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]},extendToSchedule:{type:"boolean"}},required:["amount","unit"],additionalProperties:!1},xa={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},Ia={type:"object",properties:{type:{enum:["dynamic"]},dynamicKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["dynamicKey"],additionalProperties:!1},Na={oneOf:[Pa,xa,Ia]},ka={type:"object",properties:{duration:{type:"number"}},required:["duration"],additionalProperties:!1},Dn={output:Na,result:ka};var Ca={type:"object",properties:{type:{enum:["regular"]},amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]},digestKey:{type:"string"},lookBackWindow:{type:"object",properties:{amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]}},required:["amount","unit"],additionalProperties:!1},extendToSchedule:{type:"boolean"}},required:["amount","unit"],additionalProperties:!1},Ma={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},digestKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},La={oneOf:[Ca,Ma]},Da={type:"object",properties:{eventCount:{type:"number"},events:{type:"array",items:{type:"object",properties:{id:{type:"string"},time:{type:"string"},payload:{type:"object"}},required:["id","time","payload"],additionalProperties:!1}}},required:["events"],additionalProperties:!1},Un={output:La,result:Da};var Fn={output:{type:"object",properties:{type:{type:"string",enum:["fixed","dynamic"]},amount:{type:"number"},unit:{type:"string",enum:["minutes","hours","days"]},dynamicKey:{type:"string"},threshold:{type:"number"},throttleKey:{type:"string"}},required:["type"],additionalProperties:!1},result:{type:"object",properties:{throttled:{type:"boolean",description:"Whether the workflow execution was throttled"},executionCount:{type:"number",description:"Number of executions within the throttle window"},threshold:{type:"number",description:"The throttle threshold that was applied"},windowStart:{type:"string",format:"date-time",description:"Start time of the throttle window"}},required:["throttled"],additionalProperties:!1}};var Ua={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Fa={type:"object",properties:{},required:[],additionalProperties:!1},wo={output:Ua,result:Fa};var $a={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string"},from:{type:"object",properties:{email:{type:"string"},name:{type:"string"}},additionalProperties:!1}},required:["subject","body"],additionalProperties:!1},ja={type:"object",properties:{},required:[],additionalProperties:!1},bo={output:$a,result:ja};var Ya="^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$",Oo={type:"object",properties:{url:{type:"string",pattern:Ya},target:{type:"string",enum:["_self","_blank","_parent","_top","_unfencedTop"],default:"_blank"}},if:{properties:{url:{type:"string",pattern:"^/"}}},then:{properties:{target:{default:"_self"}}},else:{properties:{target:{default:"_blank"}}},required:["url"],additionalProperties:!1},To={type:"object",properties:{label:{type:"string"},redirect:Oo},required:["label"],additionalProperties:!1},Wa={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string",minLength:1},avatar:{type:"string",format:"uri"},primaryAction:To,secondaryAction:To,data:{type:"object",additionalProperties:!0},redirect:Oo},anyOf:[{required:["subject"]},{required:["body"]}],additionalProperties:!1},Va={type:"object",properties:{seen:{type:"boolean"},read:{type:"boolean"},lastSeenDate:{type:"string",format:"date-time",nullable:!0},lastReadDate:{type:"string",format:"date-time",nullable:!0}},required:["seen","read","lastSeenDate","lastReadDate"],additionalProperties:!1},vo={output:Wa,result:Va};var Ba={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},qa={type:"object",properties:{},required:[],additionalProperties:!1},Ao={output:Ba,result:qa};var Ja={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Ga={type:"object",properties:{},required:[],additionalProperties:!1},Ro={output:Ja,result:Ga};var Je={chat:wo,sms:Ro,push:Ao,email:bo,in_app:vo};var Ve={type:"object",properties:{},required:[],additionalProperties:!1};var $n=(w=>(w.NONE="none",w.LOW="low",w.MEDIUM="medium",w.HIGH="high",w))($n||{});async function wt(c,r,n){if(c.steps.some(l=>l.stepId===r))throw new bn(r);c.steps.push(n)}async function jn(c,r,n,l){return async(w,U,C={})=>{let z=(C==null?void 0:C.controlSchema)||Ve;return await wt(c,w,{stepId:w,type:r,controls:{schema:await Ne(z),unknownSchema:z},outputs:{schema:await Ne(n),unknownSchema:n},results:{schema:await Ne(l),unknownSchema:l},resolve:U,code:U.toString(),options:C,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function Eo(c,r,n){let l=Ln[r],w=Object.entries(n).map(async([U,C])=>{let z=l[U];return{type:U,code:C.toString(),resolve:C,outputs:{schema:await Ne(z.output),unknownSchema:z.output}}});c.providers.push(...await Promise.all(w))}async function bt(c,r,n,l){return async(w,U,C={})=>{let z=(C==null?void 0:C.controlSchema)||Ve,re={stepId:w,type:r,controls:{schema:await Ne(z),unknownSchema:z},outputs:{schema:await Ne(n),unknownSchema:n},results:{schema:await Ne(l),unknownSchema:l},resolve:U,code:U.toString(),options:C,providers:[]};return await wt(c,w,re),Object.keys(C.providers||{}).length>0&&await Eo(re,r,C.providers||{}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function hr(c,r){return async(n,l,w={})=>{let U=(w==null?void 0:w.controlSchema)||Ve,C=(w==null?void 0:w.outputSchema)||Ve,[z,re]=await Promise.all([Ne(U),Ne(C)]);return await wt(c,n,{stepId:n,type:r,controls:{schema:z,unknownSchema:U},outputs:{schema:re,unknownSchema:C},results:{schema:re,unknownSchema:C},resolve:l,code:l.toString(),options:w,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}var Ka={email:"email",sms:"sms",push:"push",inApp:"in_app",chat:"chat"};function _o(c){if(!c)return{};let r={};return c.all&&(r.all=c.all),Object.entries(c.channels||{}).forEach(([n,l])=>{let w=Ka[n];w&&(r.channels||(r.channels={}),r.channels[w]=l)}),r}function Po(c,r,n){let l=n||{};return{id:c,trigger:async C=>{let z=On(Rn(C.secretKey),An(C.apiUrl)),re=C.payload||{},we;if(l.payloadSchema){let Fe=await Ut(l.payloadSchema,re);if(Fe.success===!1)throw new an(c,Fe.errors);we=Fe.data}else we=C.payload;let Pe=await Ci(),ke={name:c,to:C.to,payload:{...we},...C.transactionId&&{transactionId:C.transactionId},...C.overrides&&{overrides:C.overrides},...C.actor&&{actor:C.actor},...C.context&&{context:C.context},...Pe&&{bridgeUrl:Pe}},be=await z.post("/events/trigger",ke);return{cancel:async()=>z.delete(`/events/trigger/${be.transactionId}`),data:be}},discover:async()=>{var z;let C={workflowId:c,severity:(z=l.severity)!=null?z:"none",steps:[],code:r.toString(),payload:{schema:await Ne(l.payloadSchema||Ve),unknownSchema:l.payloadSchema||Ve},controls:{schema:await Ne(l.controlSchema||Ve),unknownSchema:l.controlSchema||Ve},tags:l.tags||[],preferences:_o(l.preferences),name:l.name,description:l.description,execute:r};return await r({payload:{},subscriber:{},environment:{},controls:{},context:{},step:{push:await bt(C,"push",Je.push.output,Je.push.result),chat:await bt(C,"chat",Je.chat.output,Je.chat.result),email:await bt(C,"email",Je.email.output,Je.email.result),sms:await bt(C,"sms",Je.sms.output,Je.sms.result),inApp:await bt(C,"in_app",Je.in_app.output,Je.in_app.result),digest:await jn(C,"digest",Un.output,Un.result),delay:await jn(C,"delay",Dn.output,Dn.result),throttle:await jn(C,"throttle",Fn.output,Fn.result),custom:await hr(C,"custom"),httpRequest:await hr(C,"http_request")}}),C}}}function Ha(c,r,n){return{type:"email",stepId:c,resolve:r,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function za(c,r,n){return{type:"sms",stepId:c,resolve:r,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Xa(c,r,n){return{type:"chat",stepId:c,resolve:r,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Qa(c,r,n){return{type:"push",stepId:c,resolve:r,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Za(c,r,n){return{type:"in_app",stepId:c,resolve:r,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}var xo={email:Ha,sms:za,chat:Xa,push:Qa,inApp:Za};0&&(module.exports={Client,CronExpression,NovuRequestHandler,SeverityLevelEnum,providerSchemas,step,workflow});
|
|
505
|
+
`,writeOnly:!0,nullable:!0}}}],required:[],additionalProperties:!0},ho={output:Ra};var mo={apns:po,expo:uo,fcm:fo,"one-signal":ho,"pusher-beams":q,pushpad:q,"push-webhook":q,appio:q};var Ea={type:"object",properties:{},required:[],additionalProperties:!1},yo={output:Ea};var _a={type:"object",properties:{to:{type:"string",pattern:"^\\+[1-9]\\d{1,14}$",description:"The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`."},statusCallback:{type:"string",format:"uri",description:"The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messagingServiceSid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). "},applicationSid:{type:"string",minLength:34,maxLength:34,pattern:"^AP[0-9a-fA-F]{32}$",description:"The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `statusCallback` URL. Note that the `statusCallback` parameter of a request takes priority over the `applicationSid` parameter; if both are included `applicationSid` is ignored."},maxPrice:{type:"number",description:"[OBSOLETE] This parameter will no longer have any effect as of 2024-06-03."},provideFeedback:{type:"boolean",description:"Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`."},attempt:{type:"integer",description:"Total number of attempts made (including this request) to send the message regardless of the provider used"},validityPeriod:{type:"integer",description:"The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validityPeriod`, the Message is not sent. Accepted values are integers from `1` to `36000`. Default value is `36000`. A `validityPeriod` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html)"},forceDelivery:{type:"boolean",description:"Reserved"},contentRetention:{type:"string",enum:["retain","discard"],description:"Determines if the message content can be stored or redacted based on privacy settings"},addressRetention:{type:"string",enum:["retain","obfuscate"],description:"Determines if the address can be stored or obfuscated based on privacy settings"},smartEncoded:{type:"boolean",description:"Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`."},persistentAction:{type:"array",items:{type:"string"},description:"Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp)."},shortenUrls:{type:"boolean",description:"For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messagingServiceSid` parameter must also be provided."},scheduleType:{type:"string",enum:["fixed"],description:"For Messaging Services only: Include this parameter with a value of `fixed` in conjunction with the `sendAt` parameter in order to [schedule a Message](https://www.twilio.com/docs/messaging/features/message-scheduling)."},sendAt:{type:"string",format:"date-time",description:"The time that Twilio will send the message. Must be in ISO 8601 format."},sendAsMms:{type:"boolean",description:"If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media."},contentVariables:{type:"string",description:"For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `contentSid` parameter must also be provided. If values are not defined in the `contentVariables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used."},riskCheck:{type:"string",enum:["enable","disable"],description:"Include this parameter with a value of `disable` to skip any kind of risk check on the respective message request."},from:{type:"string",pattern:"^\\+[1-9]\\d{1,14}$",description:"The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messagingServiceSid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool."},messagingServiceSid:{type:"string",minLength:34,maxLength:34,pattern:"^MG[0-9a-fA-F]{32}$",description:"The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool."},body:{type:"string",description:"The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [sendAsMms parameter](https://www.twilio.com/blog/mms-for-long-text-messages)."},mediaUrl:{type:"array",items:{type:"string",format:"uri"},description:"The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `mediaUrl` parameters in the POST request. You can include up to ten `mediaUrl` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply."},contentSid:{type:"string",minLength:34,maxLength:34,pattern:"^HX[0-9a-fA-F]{32}$",description:"For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources)."}},required:[],additionalProperties:!0},go={output:_a};var So={"africas-talking":q,"azure-sms":q,bandwidth:q,"brevo-sms":q,"bulk-sms":q,"burst-sms":q,clickatell:q,clicksend:q,"eazy-sms":q,firetext:q,"forty-six-elks":q,"generic-sms":q,gupshup:q,"infobip-sms":q,"isend-sms":q,kannel:q,maqsam:q,messagebird:q,mobishastra:q,nexmo:q,"novu-sms":yo,plivo:q,"ring-central":q,sendchamp:q,simpletexting:q,sms77:q,"sms-central":q,smsmode:q,sns:q,telnyx:q,termii:q,twilio:go,"afro-message":q,unifonic:q,imedia:q,sinch:q,"isendpro-sms":q};var Ln={chat:eo,sms:So,email:so,push:mo,in_app:lo};var Pa={type:"object",properties:{type:{enum:["regular"]},amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]},extendToSchedule:{type:"boolean"}},required:["amount","unit"],additionalProperties:!1},xa={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},Ia={type:"object",properties:{type:{enum:["dynamic"]},dynamicKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["dynamicKey"],additionalProperties:!1},Na={oneOf:[Pa,xa,Ia]},Ca={type:"object",properties:{duration:{type:"number"}},required:["duration"],additionalProperties:!1},Dn={output:Na,result:Ca};var ka={type:"object",properties:{type:{enum:["regular"]},amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]},digestKey:{type:"string"},lookBackWindow:{type:"object",properties:{amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]}},required:["amount","unit"],additionalProperties:!1},extendToSchedule:{type:"boolean"}},required:["amount","unit"],additionalProperties:!1},Ma={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},digestKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},La={oneOf:[ka,Ma]},Da={type:"object",properties:{eventCount:{type:"number"},events:{type:"array",items:{type:"object",properties:{id:{type:"string"},time:{type:"string"},payload:{type:"object"}},required:["id","time","payload"],additionalProperties:!1}}},required:["events"],additionalProperties:!1},Un={output:La,result:Da};var Fn={output:{type:"object",properties:{type:{type:"string",enum:["fixed","dynamic"]},amount:{type:"number"},unit:{type:"string",enum:["minutes","hours","days"]},dynamicKey:{type:"string"},threshold:{type:"number"},throttleKey:{type:"string"}},required:["type"],additionalProperties:!1},result:{type:"object",properties:{throttled:{type:"boolean",description:"Whether the workflow execution was throttled"},executionCount:{type:"number",description:"Number of executions within the throttle window"},threshold:{type:"number",description:"The throttle threshold that was applied"},windowStart:{type:"string",format:"date-time",description:"Start time of the throttle window"}},required:["throttled"],additionalProperties:!1}};var Ua={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Fa={type:"object",properties:{},required:[],additionalProperties:!1},wo={output:Ua,result:Fa};var $a={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string"},from:{type:"object",properties:{email:{type:"string"},name:{type:"string"}},additionalProperties:!1}},required:["subject","body"],additionalProperties:!1},ja={type:"object",properties:{},required:[],additionalProperties:!1},bo={output:$a,result:ja};var Ya="^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$",Oo={type:"object",properties:{url:{type:"string",pattern:Ya},target:{type:"string",enum:["_self","_blank","_parent","_top","_unfencedTop"],default:"_blank"}},if:{properties:{url:{type:"string",pattern:"^/"}}},then:{properties:{target:{default:"_self"}}},else:{properties:{target:{default:"_blank"}}},required:["url"],additionalProperties:!1},To={type:"object",properties:{label:{type:"string"},redirect:Oo},required:["label"],additionalProperties:!1},Wa={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string",minLength:1},avatar:{type:"string",format:"uri"},primaryAction:To,secondaryAction:To,data:{type:"object",additionalProperties:!0},redirect:Oo},anyOf:[{required:["subject"]},{required:["body"]}],additionalProperties:!1},Va={type:"object",properties:{seen:{type:"boolean"},read:{type:"boolean"},lastSeenDate:{type:"string",format:"date-time",nullable:!0},lastReadDate:{type:"string",format:"date-time",nullable:!0}},required:["seen","read","lastSeenDate","lastReadDate"],additionalProperties:!1},vo={output:Wa,result:Va};var Ba={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},qa={type:"object",properties:{},required:[],additionalProperties:!1},Ao={output:Ba,result:qa};var Ja={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Ga={type:"object",properties:{},required:[],additionalProperties:!1},Ro={output:Ja,result:Ga};var Je={chat:wo,sms:Ro,push:Ao,email:bo,in_app:vo};var Ve={type:"object",properties:{},required:[],additionalProperties:!1};var $n=(w=>(w.NONE="none",w.LOW="low",w.MEDIUM="medium",w.HIGH="high",w))($n||{});async function wt(l,r,n){if(l.steps.some(p=>p.stepId===r))throw new bn(r);l.steps.push(n)}async function jn(l,r,n,p){return async(w,F,k={})=>{let z=(k==null?void 0:k.controlSchema)||Ve;return await wt(l,w,{stepId:w,type:r,controls:{schema:await Ce(z),unknownSchema:z},outputs:{schema:await Ce(n),unknownSchema:n},results:{schema:await Ce(p),unknownSchema:p},resolve:F,code:F.toString(),options:k,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function Eo(l,r,n){let p=Ln[r],w=Object.entries(n).map(async([F,k])=>{let z=p[F];return{type:F,code:k.toString(),resolve:k,outputs:{schema:await Ce(z.output),unknownSchema:z.output}}});l.providers.push(...await Promise.all(w))}async function bt(l,r,n,p){return async(w,F,k={})=>{let z=(k==null?void 0:k.controlSchema)||Ve,re={stepId:w,type:r,controls:{schema:await Ce(z),unknownSchema:z},outputs:{schema:await Ce(n),unknownSchema:n},results:{schema:await Ce(p),unknownSchema:p},resolve:F,code:F.toString(),options:k,providers:[]};return await wt(l,w,re),Object.keys(k.providers||{}).length>0&&await Eo(re,r,k.providers||{}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function hr(l,r){return async(n,p,w={})=>{let F=(w==null?void 0:w.controlSchema)||Ve,k=(w==null?void 0:w.outputSchema)||Ve,[z,re]=await Promise.all([Ce(F),Ce(k)]);return await wt(l,n,{stepId:n,type:r,controls:{schema:z,unknownSchema:F},outputs:{schema:re,unknownSchema:k},results:{schema:re,unknownSchema:k},resolve:p,code:p.toString(),options:w,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}var Ka={email:"email",sms:"sms",push:"push",inApp:"in_app",chat:"chat"};function _o(l){if(!l)return{};let r={};return l.all&&(r.all=l.all),Object.entries(l.channels||{}).forEach(([n,p])=>{let w=Ka[n];w&&(r.channels||(r.channels={}),r.channels[w]=p)}),r}function Po(l,r,n){let p=n||{};return{id:l,trigger:async k=>{let z=On(Rn(k.secretKey),An(k.apiUrl)),re=k.payload||{},we;if(p.payloadSchema){let Fe=await Ut(p.payloadSchema,re);if(Fe.success===!1)throw new an(l,Fe.errors);we=Fe.data}else we=k.payload;let Pe=await ki(),xe={name:l,to:k.to,payload:{...we},...k.transactionId&&{transactionId:k.transactionId},...k.overrides&&{overrides:k.overrides},...k.actor&&{actor:k.actor},...k.context&&{context:k.context},...Pe&&{bridgeUrl:Pe}},be=await z.post("/events/trigger",xe);return{cancel:async()=>z.delete(`/events/trigger/${be.transactionId}`),data:be}},discover:async()=>{var z;let k={workflowId:l,severity:(z=p.severity)!=null?z:"none",steps:[],code:r.toString(),payload:{schema:await Ce(p.payloadSchema||Ve),unknownSchema:p.payloadSchema||Ve},controls:{schema:await Ce(p.controlSchema||Ve),unknownSchema:p.controlSchema||Ve},tags:p.tags||[],preferences:_o(p.preferences),name:p.name,description:p.description,execute:r};return await r({payload:{},subscriber:{},environment:{},controls:{},context:{},step:{push:await bt(k,"push",Je.push.output,Je.push.result),chat:await bt(k,"chat",Je.chat.output,Je.chat.result),email:await bt(k,"email",Je.email.output,Je.email.result),sms:await bt(k,"sms",Je.sms.output,Je.sms.result),inApp:await bt(k,"in_app",Je.in_app.output,Je.in_app.result),digest:await jn(k,"digest",Un.output,Un.result),delay:await jn(k,"delay",Dn.output,Dn.result),throttle:await jn(k,"throttle",Fn.output,Fn.result),custom:await hr(k,"custom"),httpRequest:await hr(k,"http_request")}}),k}}}function Ha(l,r,n){return{type:"email",stepId:l,resolve:r,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function za(l,r,n){return{type:"sms",stepId:l,resolve:r,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Xa(l,r,n){return{type:"chat",stepId:l,resolve:r,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Qa(l,r,n){return{type:"push",stepId:l,resolve:r,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}function Za(l,r,n){return{type:"in_app",stepId:l,resolve:r,controlSchema:n==null?void 0:n.controlSchema,payloadSchema:n==null?void 0:n.payloadSchema,skip:n==null?void 0:n.skip,providers:n==null?void 0:n.providers,disableOutputSanitization:n==null?void 0:n.disableOutputSanitization}}var xo={email:Ha,sms:za,chat:Xa,push:Qa,inApp:Za};0&&(module.exports={Client,CronExpression,NovuRequestHandler,SeverityLevelEnum,providerSchemas,step,workflow});
|