@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.
Files changed (57) hide show
  1. package/dist/cjs/{health-check.types-D7zhgmn3.d.cts → health-check.types-DwKatX-8.d.cts} +3 -2
  2. package/dist/cjs/{index-CcsfZUx6.d.cts → index-BTTxx1ad.d.cts} +2 -2
  3. package/dist/cjs/index.cjs +42 -42
  4. package/dist/cjs/index.d.cts +4 -4
  5. package/dist/cjs/internal/index.d.cts +3 -3
  6. package/dist/cjs/servers/express.cjs +36 -36
  7. package/dist/cjs/servers/express.d.cts +5 -5
  8. package/dist/cjs/servers/h3.cjs +49 -49
  9. package/dist/cjs/servers/h3.d.cts +5 -5
  10. package/dist/cjs/servers/lambda.cjs +59 -59
  11. package/dist/cjs/servers/lambda.d.cts +6 -6
  12. package/dist/cjs/servers/nest.cjs +62 -62
  13. package/dist/cjs/servers/nest.d.cts +7 -7
  14. package/dist/cjs/servers/next.cjs +22 -22
  15. package/dist/cjs/servers/next.d.cts +5 -5
  16. package/dist/cjs/servers/nuxt.cjs +49 -49
  17. package/dist/cjs/servers/nuxt.d.cts +5 -5
  18. package/dist/cjs/servers/remix.cjs +49 -49
  19. package/dist/cjs/servers/remix.d.cts +5 -5
  20. package/dist/cjs/servers/sveltekit.cjs +54 -54
  21. package/dist/cjs/servers/sveltekit.d.cts +5 -5
  22. package/dist/cjs/step-resolver.cjs +1 -1
  23. package/dist/cjs/step-resolver.d.cts +11 -11
  24. package/dist/cjs/{subscriber.types-Dq1CT3w8.d.cts → subscriber.types-CftO3aFY.d.cts} +1 -1
  25. package/dist/cjs/validators.cjs +1 -1
  26. package/dist/cjs/validators.d.cts +1 -1
  27. package/dist/esm/chunk-JKG63DBC.js +1 -0
  28. package/dist/esm/{chunk-YZ2OSJPP.js → chunk-MQSAHSED.js} +1 -1
  29. package/dist/esm/{chunk-TNHN7OQT.js → chunk-WSQ6EEHO.js} +38 -38
  30. package/dist/esm/{health-check.types-C0QWDZeM.d.ts → health-check.types-C4vZDz5x.d.ts} +3 -2
  31. package/dist/esm/{index-D-DVHaDC.d.ts → index-D4Rt1gOC.d.ts} +2 -2
  32. package/dist/esm/index.d.ts +4 -4
  33. package/dist/esm/index.js +1 -1
  34. package/dist/esm/internal/index.d.ts +3 -3
  35. package/dist/esm/servers/express.d.ts +5 -5
  36. package/dist/esm/servers/express.js +1 -1
  37. package/dist/esm/servers/h3.d.ts +5 -5
  38. package/dist/esm/servers/h3.js +1 -1
  39. package/dist/esm/servers/lambda.d.ts +6 -6
  40. package/dist/esm/servers/lambda.js +1 -1
  41. package/dist/esm/servers/nest.d.ts +7 -7
  42. package/dist/esm/servers/nest.js +1 -1
  43. package/dist/esm/servers/next.d.ts +5 -5
  44. package/dist/esm/servers/next.js +1 -1
  45. package/dist/esm/servers/nuxt.d.ts +5 -5
  46. package/dist/esm/servers/nuxt.js +1 -1
  47. package/dist/esm/servers/remix.d.ts +5 -5
  48. package/dist/esm/servers/remix.js +1 -1
  49. package/dist/esm/servers/sveltekit.d.ts +5 -5
  50. package/dist/esm/servers/sveltekit.js +1 -1
  51. package/dist/esm/step-resolver.d.ts +11 -11
  52. package/dist/esm/step-resolver.js +1 -1
  53. package/dist/esm/{subscriber.types-c69nNiHL.d.ts → subscriber.types-CfRj4acH.d.ts} +1 -1
  54. package/dist/esm/validators.d.ts +1 -1
  55. package/dist/esm/validators.js +1 -1
  56. package/package.json +18 -18
  57. package/dist/esm/chunk-V7JTIDNT.js +0 -1
@@ -1,78 +1,78 @@
1
- "use strict";var Ys=Object.create;var zt=Object.defineProperty;var Ws=Object.getOwnPropertyDescriptor;var Vs=Object.getOwnPropertyNames;var qs=Object.getPrototypeOf,Bs=Object.prototype.hasOwnProperty;var Js=(c,r)=>{for(var n in r)zt(c,n,{get:r[n],enumerable:!0})},vi=(c,r,n,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let w of Vs(r))!Bs.call(c,w)&&w!==n&&zt(c,w,{get:()=>r[w],enumerable:!(l=Ws(r,w))||l.enumerable});return c};var tt=(c,r,n)=>(n=c!=null?Ys(qs(c)):{},vi(r||!c||!c.__esModule?zt(n,"default",{value:c,enumerable:!0}):n,c)),Gs=c=>vi(zt({},"__esModule",{value:!0}),c);var rl={};Js(rl,{Client:()=>wt,CronExpression:()=>pr,NovuRequestHandler:()=>bt,SeverityLevelEnum:()=>jn,frameworkName:()=>No,providerSchemas:()=>Dn,serve:()=>nl,step:()=>Io,workflow:()=>xo});module.exports=Gs(rl);var Ge=require("h3");var Zi=require("jsonrepair");var It=(l=>(l.TRIGGER="trigger",l.EXECUTE="execute",l.PREVIEW="preview",l))(It||{}),Xt=(l=>(l.DISCOVER="discover",l.HEALTH_CHECK="health-check",l.CODE="code",l))(Xt||{});var pr=(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))(pr||{});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 Qt=(l=>(l.POST="POST",l.GET="GET",l.OPTIONS="OPTIONS",l))(Qt||{});var Ks=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},nt=class extends Error{},Zt=class extends nt{constructor(){super(...arguments);this.statusCode=404}},Ue=class extends nt{constructor(){super(...arguments);this.statusCode=400}},st=class extends nt{constructor(){super(...arguments);this.statusCode=401}},at=class extends nt{constructor(r,{cause:n}={}){var l;Ks(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})}},en=class extends nt{constructor(){super(...arguments);this.statusCode=409}};var yt=class extends at{constructor(n){super("Unknown BridgeError",{cause:n});this.statusCode=500;this.code="BridgeError"}};var tn=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}}},kt=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}},nn=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}},rn=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}},on=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}},sn=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}},an=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}},ln=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}},cn=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 ct=c=>Object.values(We).includes(c==null?void 0:c.code),Ai=c=>!ct(c)&&typeof c.statusCode=="number"&&c.statusCode>=400&&c.statusCode<500;var ur=c=>Object.values(c).map(r=>`\`${r}\``).join(", "),pn=c=>c.replaceAll(/(\w)(\w*)/g,(r,n,l)=>n.toUpperCase()+l.toLowerCase()).replaceAll(/[\s-]+/g,"");var un=class extends nt{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${ur(Qt)}`}},Ct=class extends Ue{constructor(n,l){super(`Invalid query string: \`action\`=\`${n}\`. Please use one of ${ur(l)}`);this.code="InvalidActionError"}},dn=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 fn=class extends Error{constructor(r,n,l){super(),this.data={message:l},this.statusCode=r,this.code=n}};var Mt=class extends en{constructor(r,n){super(`${pn(r)} with id: \`${n}\` already exists. Please use a different id.`)}},lt=class extends Zt{constructor(r,n){super(`${pn(r)} with id: \`${n}\` does not exist. Please provide a valid id.`)}},gt=class extends at{constructor(n,l,w,U){super(`Failed to ${w} ${pn(n)} with id: \`${l}\``,{cause:U});this.statusCode=502}};var hn=class extends lt{constructor(n){super("provider",n);this.code="ProviderNotFoundError"}},mn=class extends gt{constructor(n,l,w){super("provider",n,l,w);this.code="ProviderExecutionFailedError"}};var yn=class extends st{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"}},gn=class extends st{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},Sn=class extends st{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},wn=class extends st{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},bn=class extends st{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var Tn=class extends lt{constructor(n){super("step",n);this.code="StepNotFoundError"}},On=class extends Mt{constructor(n){super("step",n);this.code="StepAlreadyExistsError"}},Lt=class extends gt{constructor(n,l,w){super("step",n,l,w);this.code="StepExecutionFailedError"}};var Dt=class extends lt{constructor(n){super("workflow",n);this.code="WorkflowNotFoundError"}};var vn=(()=>{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:()=>Ti,default:()=>Oi,setDependencies:()=>Dr});function Pe(e,t){return typeof e=="string"?typeof t!="undefined"?Rt.register(e,t):Rt.get(e):Rt.registerMany(e)}function ke(e,t){return e=typeof e=="undefined"?ze.MIN_INTEGER:e,t=typeof t=="undefined"?ze.MAX_INTEGER:t,Math.floor(te("random")()*(t-e+1))+e}function be(e){return Vt.default.prototype.max=te("defaultRandExpMax"),Vt.default.prototype.randInt=(i,p)=>i+Math.floor(te("random")()*(1+(p-i))),new Vt.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 it(e,t){return te("random")()*(t-e)+e}function Ke(e,t,i,p,u=!1){return i=typeof i=="undefined"?ze.MIN_NUMBER:i,p=typeof p=="undefined"?ze.MAX_NUMBER:p,e=typeof e=="undefined"?i:e,t=typeof t=="undefined"?p:t,t<e&&(t+=e),u?it(e,t):ke(e,t)}function jt(e){switch(e){case"seconds":return Ke(0,60)*60;case"minutes":return Ke(15,50)*612;case"hours":return Ke(12,72)*36123;case"days":return Ke(7,30)*86412345;case"weeks":return Ke(4,52)*604812345;case"months":return Ke(2,13)*2592012345;case"years":return Ke(1,20)*31104012345;default:break}}function Wn(e){if(e)return jt(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(it(t.getTime(),i.getTime()))}function yr(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 Yt(e){return typeof e=="string"&&Jr.test(e)}function He(e){return["number","boolean"].includes(typeof e)}function qe(e,...t){return t.filter(i=>typeof e[i]!="undefined").length>0}function gr(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 ko(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 Co(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=Yt(u)?parseFloat(u):u;break;case"integer":u=Yt(u)?parseInt(u,10):u;break;case"boolean":u=!!u;break;case"string":{if(He(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(ko(u)).toISOString().replace(/([0-9])0+Z$/,"$1Z");break;case"full-date":case"date":u=new Date(gr(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 ft(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]=ft(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]=ft({},t[i]):e[i]=ft(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 Mo(e){let t=JSON.stringify(e),i=JSON.stringify(e,null,2);return t.length>400?`${i.substr(0,400)}...`:i}function Sr(){return Z.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function Lo(e,t){if(e.enum)return e.enum.includes(t);if(e.const)return e.const===t}function Do(e,t){let i=ft({},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(ze.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=Sr();while(e.enum.indexOf(p)!==-1);i.enum=[p]}return e.required&&i.properties&&e.required.forEach(p=>{delete i.properties[p]}),i}function Vn(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 Uo(e,t){return!t.every(i=>Vn(e,i))}function Fo(e,t){return t.reduce((p,u)=>p+(Vn(e,u)?1:0),0)===1}function $o(e){return["enum","const","default","examples","required","definitions","items","properties"].includes(e)}function jo(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?ft({},e[p]):e[p],i),{})}function wr(e,t){return Array.isArray(e)?e.map(i=>wr(i,t)):(typeof e=="string"&&(e=e.replace(/#\{([\w.-]+)\}/g,(i,p)=>t[p])),e)}function qn(e){return Object.prototype.toString.call(e)==="[object Object]"&&!Object.keys(e).length}function br(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(qn(e[p]))br(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);qn(h)||(e[p]=h)}typeof e[p]=="undefined"&&delete e[p]}),!(!Object.keys(e).length&&i))return e}function Yo(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 Wo(e,t){if(typeof e=="undefined")return mt.list();if(typeof e=="string")if(typeof t=="function")mt.register(e,t);else if(t===null||t===!1)mt.unregister(e);else return mt.get(e);else mt.registerMany(e)}function Vo(e,t,i){return Object.keys(e).filter(p=>{let u=zr.indexOf(t)>-1;return i.indexOf(p)>-1&&!u}).length>0}function qo(e,t){let i=Object.keys(Et);for(let p=0;p<i.length;p+=1){let u=i[p],h=t[t.length-1];if(Vo(e,h,Et[u]))return u}}function Bo(){return te("random")()>.5}function Jo(){return null}function Go(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 Ko(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 qt(`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?Go(t.concat(["items"]),u,e,J,i,p):u}function Ho(e){let t=typeof e.minimum=="undefined"||e.minimum===-Number.MAX_VALUE?ze.MIN_INTEGER:e.minimum,i=typeof e.maximum=="undefined"||e.maximum===Number.MAX_VALUE?ze.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 zo(e){return Math.floor(or({...e}))}function Xo(e){return Z.shuffle(si).slice(0,e)}function Qo(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?Jt: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[Bt(1)+ve(Y[m])]=W||Jt}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)||Bt(1)+ve();u[Y]||(u[Y]=W||Jt,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 Tr(){let e=Z.number(1,5);return Bt(e).join(" ")}function Zo(e=0,t=140){let i=Math.max(0,e),p=Z.number(i,t),u=Tr();for(;u.length<i;)u+=Tr();return u.length>p&&(u=u.substr(0,p)),u}function es(){return[0,0,0,0].map(()=>Z.number(0,255)).join(".")}function ts(){return Z.date().toISOString()}function ns(){return Gt().slice(0,10)}function rs(){return Gt().slice(11)}function is(e){return Z.randexp(je[e]).replace(di,(t,i)=>Z.randexp(je[i]))}function os(e,t){let i=ir(e.format);if(typeof i=="function")return i(e);switch(e.format){case"date-time":case"datetime":return Gt();case"date":return ci();case"time":return pi();case"ipv4":return li();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 fi(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 ss(e){return de.typecast("string",e,i=>e.format?os(e,()=>sr(i.minLength,i.maxLength)):e.pattern?Z.randexp(e.pattern):sr(i.minLength,i.maxLength))}function as({$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 ht(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={...as(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:$}=ht(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:$}=ht(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=Xr(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(_t[h])try{let T=_t[h](e,t,i,ht);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 qt(T.stack,t):T}else{if(te("failOnInvalidTypes"))throw new qt(`unknown primitive ${de.short(h)}`,t.concat(["type"]));{let T=te("defaultInvalidTypeProduct");return typeof T=="string"&&_t[T]?{value:_t[T](e,t,i,ht),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}=ht(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 ls(e){return Array.isArray(e)?Z.pick(e):e}function cs(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 Jn(e,t,i,p){if(!e||typeof e!="object")return e;if(i||(i={}),t||(t=e),Array.isArray(e))return e.map(u=>Jn(u,t,i,p));if(e.jsonPath){let{JSONPath:u}=Zn(),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?cs(i[f],h.reverse):ls(i[f])}return Object.keys(e).forEach(u=>{e[u]=Jn(e[u],t,i,u)}),e}function ps(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}=Si({refs:e,schema:t,container:i,synchronous:p,refDepthMin:u,refDepthMax:h}),O=yi(de.clone(t),[],f);return te("resolveJsonPath")?{value:Jn(O.value),context:O.context}:O}catch(f){throw f.path?new Error(`${f.message} in /${f.path.join("/")}`):f}}function us(e){return e.value}function ds(e,t){return t.reduce((i,p)=>p in i?i[p]:{},e)}function Gn(e,t,i,p=i){let{title:u,description:h,comment:f}=ds(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 wi?p.items.forEach(D=>{Gn(e,[...t,"items",D.key.value],D.key,D.value)}):p instanceof bi&&p.items.forEach((D,T)=>{Gn(e,[...t,"items",T],D)})}function fs({value:e,context:t}){let i=Pt.createNode(e);Gn(t,[],i);let p=new Pt.Document;return p.contents=i,p.toString()}function Or(){Qe.define("autoIncrement",function(t,i){if(!this.offset){let p=i.minimum||1,u=p+ze.MAX_NUMBER,h=t.initialOffset||i.initialOffset;this.offset=h||Z.number(p,u)}return t?this.offset++:i}),Qe.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 vr(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 Ar,Kn,Rr,Hn,Er,_r,$e,Pr,zn,vt,F,xr,Ir,Nr,kr,Cr,At,Wt,Xn,Mr,Lr,Qn,Zn,Dr,Ur,er,ue,tr,Fr,$r,Rt,te,nr,rr,jr,Yr,Wr,Vr,qr,Br,ze,Vt,Z,Jr,de,Gr,Kr,mt,ir,Hr,qt,Et,zr,Xr,Qr,Zr,ei,ti,ni,ri,ii,or,oi,si,Bt,Jt,ai,sr,li,Gt,ci,pi,ar,Kt,ui,je,di,fi,hi,mi,_t,yi,gi,Si,lr,cr,Le,hs,ms,ys,gs,Ss,ws,bs,Ts,Os,vs,As,Rs,wi,bi,Pt,Qe,Oe,Ti,Oi,Es=w({"src/shared.js"(){Ar=Object.create,Kn=Object.defineProperty,Rr=Object.getOwnPropertyDescriptor,Hn=Object.getOwnPropertyNames,Er=Object.getPrototypeOf,_r=Object.prototype.hasOwnProperty,$e=(e,t)=>function(){return t||(0,e[Hn(e)[0]])((t={exports:{}}).exports,t),t.exports},Pr=(e,t,i,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Hn(t))!_r.call(e,u)&&u!==i&&Kn(e,u,{get:()=>t[u],enumerable:!(p=Rr(t,u))||p.enumerable});return e},zn=(e,t,i)=>(i=e!=null?Ar(Er(e)):{},Pr(t||!e||!e.__esModule?Kn(i,"default",{value:e,enumerable:!0}):i,e)),vt=$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=vt(),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})}}),xr=$e({"node_modules/ret/lib/util.js"(e){var t=vt(),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)}}}),Ir=$e({"node_modules/ret/lib/positions.js"(e){var t=vt();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:"$"})}}),Nr=$e({"node_modules/ret/lib/index.js"(e,t){var i=xr(),p=vt(),u=F(),h=Ir();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}}),kr=$e({"node_modules/drange/lib/index.js"(e,t){var i=class St{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 St(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 St(this.low,h.low-1),new St(h.high+1,this.high)]:h.low<=this.low?[new St(h.high+1,this.high)]:[new St(this.low,h.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},p=class Ut{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 Ut?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 Ut?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 Ut?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 Ut(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}}),Cr=$e({"node_modules/randexp/lib/randexp.js"(e,t){var i=Nr(),p=kr(),u=i.types;t.exports=class Ft{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:Ft.prototype.max!=null?Ft.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 Ft(f,O),f._randexp=D):(D=f._randexp,D._setDefaults(f)),D.gen()}static sugar(){RegExp.prototype.gen=function(){return Ft.randexp(this)}}}}}),At=$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(`
3
- `);for(;b!==-1;)b+=1,S.push(b),b=j.indexOf(`
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 k=M>1?" ".repeat(M-1):"",V="^".repeat(E);return`${x}
6
- ${k}${V}${I}`}var $=class Ei{static copy(S){return new Ei(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 rt{static addStringTerminator(S,b,_){if(_[_.length-1]===`
7
- `)return _;let x=rt.endOfWhiteSpace(S,b);return x>=S.length||S[x]===`
1
+ "use strict";var Ys=Object.create;var zt=Object.defineProperty;var Ws=Object.getOwnPropertyDescriptor;var Vs=Object.getOwnPropertyNames;var qs=Object.getPrototypeOf,Bs=Object.prototype.hasOwnProperty;var Js=(c,r)=>{for(var n in r)zt(c,n,{get:r[n],enumerable:!0})},vi=(c,r,n,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let S of Vs(r))!Bs.call(c,S)&&S!==n&&zt(c,S,{get:()=>r[S],enumerable:!(l=Ws(r,S))||l.enumerable});return c};var tt=(c,r,n)=>(n=c!=null?Ys(qs(c)):{},vi(r||!c||!c.__esModule?zt(n,"default",{value:c,enumerable:!0}):n,c)),Gs=c=>vi(zt({},"__esModule",{value:!0}),c);var rl={};Js(rl,{Client:()=>wt,CronExpression:()=>pr,NovuRequestHandler:()=>bt,SeverityLevelEnum:()=>jn,frameworkName:()=>No,providerSchemas:()=>Dn,serve:()=>nl,step:()=>Io,workflow:()=>xo});module.exports=Gs(rl);var Ge=require("h3");var Zi=require("jsonrepair");var It=(l=>(l.TRIGGER="trigger",l.EXECUTE="execute",l.PREVIEW="preview",l))(It||{}),Xt=(l=>(l.DISCOVER="discover",l.HEALTH_CHECK="health-check",l.CODE="code",l))(Xt||{});var pr=(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))(pr||{});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 Qt=(l=>(l.POST="POST",l.GET="GET",l.OPTIONS="OPTIONS",l))(Qt||{});var Ks=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},nt=class extends Error{},Zt=class extends nt{constructor(){super(...arguments);this.statusCode=404}},Ue=class extends nt{constructor(){super(...arguments);this.statusCode=400}},st=class extends nt{constructor(){super(...arguments);this.statusCode=401}},at=class extends nt{constructor(r,{cause:n}={}){var l;Ks(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})}},en=class extends nt{constructor(){super(...arguments);this.statusCode=409}};var yt=class extends at{constructor(n){super("Unknown BridgeError",{cause:n});this.statusCode=500;this.code="BridgeError"}};var tn=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}}},kt=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}},nn=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}},rn=class extends Ue{constructor(n,l,S){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=S}},on=class extends Ue{constructor(n,l,S){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=S}},sn=class extends Ue{constructor(n,l,S){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=S}},an=class extends Ue{constructor(n,l,S){super(`Workflow with id: \`${n}\` has invalid controls syntax in step with id: \`${l}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=S}},ln=class extends Ue{constructor(n,l,S,F){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${l}\` and provider with id: \`${S}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=F}},cn=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 ct=c=>Object.values(We).includes(c==null?void 0:c.code),Ai=c=>!ct(c)&&typeof c.statusCode=="number"&&c.statusCode>=400&&c.statusCode<500;var ur=c=>Object.values(c).map(r=>`\`${r}\``).join(", "),pn=c=>c.replaceAll(/(\w)(\w*)/g,(r,n,l)=>n.toUpperCase()+l.toLowerCase()).replaceAll(/[\s-]+/g,"");var un=class extends nt{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${ur(Qt)}`}},Ct=class extends Ue{constructor(n,l){super(`Invalid query string: \`action\`=\`${n}\`. Please use one of ${ur(l)}`);this.code="InvalidActionError"}},dn=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 fn=class extends Error{constructor(r,n,l){super(),this.data={message:l},this.statusCode=r,this.code=n}};var Mt=class extends en{constructor(r,n){super(`${pn(r)} with id: \`${n}\` already exists. Please use a different id.`)}},lt=class extends Zt{constructor(r,n){super(`${pn(r)} with id: \`${n}\` does not exist. Please provide a valid id.`)}},gt=class extends at{constructor(n,l,S,F){super(`Failed to ${S} ${pn(n)} with id: \`${l}\``,{cause:F});this.statusCode=502}};var hn=class extends lt{constructor(n){super("provider",n);this.code="ProviderNotFoundError"}},mn=class extends gt{constructor(n,l,S){super("provider",n,l,S);this.code="ProviderExecutionFailedError"}};var yn=class extends st{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"}},gn=class extends st{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},Sn=class extends st{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},wn=class extends st{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},bn=class extends st{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var Tn=class extends lt{constructor(n){super("step",n);this.code="StepNotFoundError"}},On=class extends Mt{constructor(n){super("step",n);this.code="StepAlreadyExistsError"}},Lt=class extends gt{constructor(n,l,S){super("step",n,l,S);this.code="StepExecutionFailedError"}};var Dt=class extends lt{constructor(n){super("workflow",n);this.code="WorkflowNotFoundError"}};var vn=(()=>{var c=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,S=(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},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:()=>Ti,default:()=>Oi,setDependencies:()=>Dr});function Pe(e,t){return typeof e=="string"?typeof t!="undefined"?Rt.register(e,t):Rt.get(e):Rt.registerMany(e)}function xe(e,t){return e=typeof e=="undefined"?ze.MIN_INTEGER:e,t=typeof t=="undefined"?ze.MAX_INTEGER:t,Math.floor(te("random")()*(t-e+1))+e}function be(e){return Vt.default.prototype.max=te("defaultRandExpMax"),Vt.default.prototype.randInt=(i,p)=>i+Math.floor(te("random")()*(1+(p-i))),new Vt.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 it(e,t){return te("random")()*(t-e)+e}function Ke(e,t,i,p,u=!1){return i=typeof i=="undefined"?ze.MIN_NUMBER:i,p=typeof p=="undefined"?ze.MAX_NUMBER:p,e=typeof e=="undefined"?i:e,t=typeof t=="undefined"?p:t,t<e&&(t+=e),u?it(e,t):xe(e,t)}function jt(e){switch(e){case"seconds":return Ke(0,60)*60;case"minutes":return Ke(15,50)*612;case"hours":return Ke(12,72)*36123;case"days":return Ke(7,30)*86412345;case"weeks":return Ke(4,52)*604812345;case"months":return Ke(2,13)*2592012345;case"years":return Ke(1,20)*31104012345;default:break}}function Wn(e){if(e)return jt(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(it(t.getTime(),i.getTime()))}function yr(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 Yt(e){return typeof e=="string"&&Jr.test(e)}function He(e){return["number","boolean"].includes(typeof e)}function qe(e,...t){return t.filter(i=>typeof e[i]!="undefined").length>0}function gr(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 ko(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 Co(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=Yt(u)?parseFloat(u):u;break;case"integer":u=Yt(u)?parseInt(u,10):u;break;case"boolean":u=!!u;break;case"string":{if(He(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(ko(u)).toISOString().replace(/([0-9])0+Z$/,"$1Z");break;case"full-date":case"date":u=new Date(gr(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 ft(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]=ft(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]=ft({},t[i]):e[i]=ft(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 Mo(e){let t=JSON.stringify(e),i=JSON.stringify(e,null,2);return t.length>400?`${i.substr(0,400)}...`:i}function Sr(){return Z.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function Lo(e,t){if(e.enum)return e.enum.includes(t);if(e.const)return e.const===t}function Do(e,t){let i=ft({},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(ze.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=Sr();while(e.enum.indexOf(p)!==-1);i.enum=[p]}return e.required&&i.properties&&e.required.forEach(p=>{delete i.properties[p]}),i}function Vn(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 Uo(e,t){return!t.every(i=>Vn(e,i))}function Fo(e,t){return t.reduce((p,u)=>p+(Vn(e,u)?1:0),0)===1}function $o(e){return["enum","const","default","examples","required","definitions","items","properties"].includes(e)}function jo(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?ft({},e[p]):e[p],i),{})}function wr(e,t){return Array.isArray(e)?e.map(i=>wr(i,t)):(typeof e=="string"&&(e=e.replace(/#\{([\w.-]+)\}/g,(i,p)=>t[p])),e)}function qn(e){return Object.prototype.toString.call(e)==="[object Object]"&&!Object.keys(e).length}function br(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(qn(e[p]))br(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);qn(h)||(e[p]=h)}typeof e[p]=="undefined"&&delete e[p]}),!(!Object.keys(e).length&&i))return e}function Yo(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 Wo(e,t){if(typeof e=="undefined")return mt.list();if(typeof e=="string")if(typeof t=="function")mt.register(e,t);else if(t===null||t===!1)mt.unregister(e);else return mt.get(e);else mt.registerMany(e)}function Vo(e,t,i){return Object.keys(e).filter(p=>{let u=zr.indexOf(t)>-1;return i.indexOf(p)>-1&&!u}).length>0}function qo(e,t){let i=Object.keys(Et);for(let p=0;p<i.length;p+=1){let u=i[p],h=t[t.length-1];if(Vo(e,h,Et[u]))return u}}function Bo(){return te("random")()>.5}function Jo(){return null}function Go(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 Ko(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 qt(`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?Go(t.concat(["items"]),u,e,J,i,p):u}function Ho(e){let t=typeof e.minimum=="undefined"||e.minimum===-Number.MAX_VALUE?ze.MIN_INTEGER:e.minimum,i=typeof e.maximum=="undefined"||e.maximum===Number.MAX_VALUE?ze.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 zo(e){return Math.floor(or({...e}))}function Xo(e){return Z.shuffle(si).slice(0,e)}function Qo(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?Jt: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),w=Math.max(e.minProperties||0,O.length),b=Math.max(0,J.length-w);J.length===1&&!O.length&&(w=Math.max(Z.number(ye?1:0,j),w)),ae!==null&&(Q===!0?b=Math.round(w-O.length+ae*(J.length-w)):b=Z.number(w-O.length,ae*(J.length-w)));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=w;if(D&&!O.length&&(Ee=Math.max(ae===null||W?Z.number(ye?1:0,j):0,w)),!x.length&&!b&&D&&Q===!0&&ye){let Y=Z.number(0,j);for(let m=0;m<Y;m+=1)u[Bt(1)+ve(Y[m])]=W||Jt}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)||Bt(1)+ve();u[Y]||(u[Y]=W||Jt,ee+=1)}for(let Y=0;ee<w&&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(w,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=p(Ie,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 Tr(){let e=Z.number(1,5);return Bt(e).join(" ")}function Zo(e=0,t=140){let i=Math.max(0,e),p=Z.number(i,t),u=Tr();for(;u.length<i;)u+=Tr();return u.length>p&&(u=u.substr(0,p)),u}function es(){return[0,0,0,0].map(()=>Z.number(0,255)).join(".")}function ts(){return Z.date().toISOString()}function ns(){return Gt().slice(0,10)}function rs(){return Gt().slice(11)}function is(e){return Z.randexp(je[e]).replace(di,(t,i)=>Z.randexp(je[i]))}function os(e,t){let i=ir(e.format);if(typeof i=="function")return i(e);switch(e.format){case"date-time":case"datetime":return Gt();case"date":return ci();case"time":return pi();case"ipv4":return li();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 fi(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 ss(e){return de.typecast("string",e,i=>e.format?os(e,()=>sr(i.minLength,i.maxLength)):e.pattern?Z.randexp(e.pattern):sr(i.minLength,i.maxLength))}function as({$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 ht(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={...as(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:$}=ht(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:$}=ht(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=Xr(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(_t[h])try{let T=_t[h](e,t,i,ht);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 qt(T.stack,t):T}else{if(te("failOnInvalidTypes"))throw new qt(`unknown primitive ${de.short(h)}`,t.concat(["type"]));{let T=te("defaultInvalidTypeProduct");return typeof T=="string"&&_t[T]?{value:_t[T](e,t,i,ht),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}=ht(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 ls(e){return Array.isArray(e)?Z.pick(e):e}function cs(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 Jn(e,t,i,p){if(!e||typeof e!="object")return e;if(i||(i={}),t||(t=e),Array.isArray(e))return e.map(u=>Jn(u,t,i,p));if(e.jsonPath){let{JSONPath:u}=Zn(),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?cs(i[f],h.reverse):ls(i[f])}return Object.keys(e).forEach(u=>{e[u]=Jn(e[u],t,i,u)}),e}function ps(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}=Si({refs:e,schema:t,container:i,synchronous:p,refDepthMin:u,refDepthMax:h}),O=yi(de.clone(t),[],f);return te("resolveJsonPath")?{value:Jn(O.value),context:O.context}:O}catch(f){throw f.path?new Error(`${f.message} in /${f.path.join("/")}`):f}}function us(e){return e.value}function ds(e,t){return t.reduce((i,p)=>p in i?i[p]:{},e)}function Gn(e,t,i,p=i){let{title:u,description:h,comment:f}=ds(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 wi?p.items.forEach(D=>{Gn(e,[...t,"items",D.key.value],D.key,D.value)}):p instanceof bi&&p.items.forEach((D,T)=>{Gn(e,[...t,"items",T],D)})}function fs({value:e,context:t}){let i=Pt.createNode(e);Gn(t,[],i);let p=new Pt.Document;return p.contents=i,p.toString()}function Or(){Qe.define("autoIncrement",function(t,i){if(!this.offset){let p=i.minimum||1,u=p+ze.MAX_NUMBER,h=t.initialOffset||i.initialOffset;this.offset=h||Z.number(p,u)}return t?this.offset++:i}),Qe.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 vr(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 Ar,Kn,Rr,Hn,Er,_r,$e,Pr,zn,vt,U,xr,Ir,Nr,kr,Cr,At,Wt,Xn,Mr,Lr,Qn,Zn,Dr,Ur,er,ue,tr,Fr,$r,Rt,te,nr,rr,jr,Yr,Wr,Vr,qr,Br,ze,Vt,Z,Jr,de,Gr,Kr,mt,ir,Hr,qt,Et,zr,Xr,Qr,Zr,ei,ti,ni,ri,ii,or,oi,si,Bt,Jt,ai,sr,li,Gt,ci,pi,ar,Kt,ui,je,di,fi,hi,mi,_t,yi,gi,Si,lr,cr,Le,hs,ms,ys,gs,Ss,ws,bs,Ts,Os,vs,As,Rs,wi,bi,Pt,Qe,Oe,Ti,Oi,Es=S({"src/shared.js"(){Ar=Object.create,Kn=Object.defineProperty,Rr=Object.getOwnPropertyDescriptor,Hn=Object.getOwnPropertyNames,Er=Object.getPrototypeOf,_r=Object.prototype.hasOwnProperty,$e=(e,t)=>function(){return t||(0,e[Hn(e)[0]])((t={exports:{}}).exports,t),t.exports},Pr=(e,t,i,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Hn(t))!_r.call(e,u)&&u!==i&&Kn(e,u,{get:()=>t[u],enumerable:!(p=Rr(t,u))||p.enumerable});return e},zn=(e,t,i)=>(i=e!=null?Ar(Er(e)):{},Pr(t||!e||!e.__esModule?Kn(i,"default",{value:e,enumerable:!0}):i,e)),vt=$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=vt(),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})}}),xr=$e({"node_modules/ret/lib/util.js"(e){var t=vt(),i=U(),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)}}}),Ir=$e({"node_modules/ret/lib/positions.js"(e){var t=vt();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:"$"})}}),Nr=$e({"node_modules/ret/lib/index.js"(e,t){var i=xr(),p=vt(),u=U(),h=Ir();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 w=/^(\d+)(,(\d+)?)?\}/.exec(Q.slice(O)),b,_;w!==null?(J.length===0&&ae(O),b=parseInt(w[1],10),_=w[2]?w[3]?parseInt(w[3],10):1/0:b,O+=w[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}}),kr=$e({"node_modules/drange/lib/index.js"(e,t){var i=class St{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 St(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 St(this.low,h.low-1),new St(h.high+1,this.high)]:h.low<=this.low?[new St(h.high+1,this.high)]:[new St(this.low,h.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},p=class Ut{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 Ut?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 Ut?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 Ut?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 Ut(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}}),Cr=$e({"node_modules/randexp/lib/randexp.js"(e,t){var i=Nr(),p=kr(),u=i.types;t.exports=class Ft{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:Ft.prototype.max!=null?Ft.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 Ft(f,O),f._randexp=D):(D=f._randexp,D._setDefaults(f)),D.gen()}static sugar(){RegExp.prototype.gen=function(){return Ft.randexp(this)}}}}}),At=$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 w=[0],b=j.indexOf(`
3
+ `);for(;b!==-1;)b+=1,w.push(b),b=j.indexOf(`
4
+ `,b);return w}function f(j){let w,b;return typeof j=="string"?(w=h(j),b=j):(Array.isArray(j)&&(j=j[0]),j&&j.context&&(j.lineStarts||(j.lineStarts=h(j.context.src)),w=j.lineStarts,b=j.context.src)),{lineStarts:w,src:b}}function O(j,w){if(typeof j!="number"||j<0)return null;let{lineStarts:b,src:_}=f(w);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,w){let{lineStarts:b,src:_}=f(w);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:w},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="";w&&(w.line===j.line&&M+(w.col-j.col)<=_+1?E=w.col-j.col:(E=Math.min(x.length+1,_)-M,I="\u2026"));let k=M>1?" ".repeat(M-1):"",V="^".repeat(E);return`${x}
6
+ ${k}${V}${I}`}var $=class Ei{static copy(w){return new Ei(w.start,w.end)}constructor(w,b){this.start=w,this.end=b||w}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(w,b){let{start:_,end:x}=this;if(w.length===0||x<=w[0])return this.origStart=_,this.origEnd=x,b;let M=b;for(;M<w.length&&!(w[M]>_);)++M;this.origStart=_+M;let E=M;for(;M<w.length&&!(w[M]>=x);)++M;return this.origEnd=x+M,E}},R=class rt{static addStringTerminator(w,b,_){if(_[_.length-1]===`
7
+ `)return _;let x=rt.endOfWhiteSpace(w,b);return x>=w.length||w[x]===`
8
8
  `?_+`
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 k=S[b+3];return!k||k===`
11
- `||k===" "||k===" "}static endOfIdentifier(S,b){let _=S[b],x=_==="<",M=x?[`
9
+ `:_}static atDocumentBoundary(w,b,_){let x=w[b];if(!x)return!0;let M=w[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=w[b+1],I=w[b+2];if(E!==x||I!==x)return!1;let k=w[b+3];return!k||k===`
11
+ `||k===" "||k===" "}static endOfIdentifier(w,b){let _=w[b],x=_==="<",M=x?[`
12
12
  `," "," ",">"]:[`
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
- `;)_=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(_===`
13
+ `," "," ","[","]","{","}",","];for(;_&&M.indexOf(_)===-1;)_=w[b+=1];return x&&_===">"&&(b+=1),b}static endOfIndent(w,b){let _=w[b];for(;_===" ";)_=w[b+=1];return b}static endOfLine(w,b){let _=w[b];for(;_&&_!==`
14
+ `;)_=w[b+=1];return b}static endOfWhiteSpace(w,b){let _=w[b];for(;_===" "||_===" ";)_=w[b+=1];return b}static startOfLine(w,b){let _=w[b-1];if(_===`
15
15
  `)return b;for(;_&&_!==`
16
- `;)_=S[b-=1];return b+1}static endOfBlockIndent(S,b,_){let x=rt.endOfIndent(S,_);if(x>_+b)return x;{let M=rt.endOfWhiteSpace(S,x),E=S[M];if(!E||E===`
17
- `)return M}return null}static atBlank(S,b,_){let x=S[b];return x===`
18
- `||x===" "||x===" "||_&&!x}static nextNodeIsIndented(S,b,_){return!S||b<0?!1:b>0?!0:_&&S==="-"}static normalizeOffset(S,b){let _=S[b];return _?_!==`
19
- `&&S[b-1]===`
20
- `?b-1:rt.endOfWhiteSpace(S,b):b}static foldNewline(S,b,_){let x=0,M=!1,E="",I=S[b+1];for(;I===" "||I===" "||I===`
16
+ `;)_=w[b-=1];return b+1}static endOfBlockIndent(w,b,_){let x=rt.endOfIndent(w,_);if(x>_+b)return x;{let M=rt.endOfWhiteSpace(w,x),E=w[M];if(!E||E===`
17
+ `)return M}return null}static atBlank(w,b,_){let x=w[b];return x===`
18
+ `||x===" "||x===" "||_&&!x}static nextNodeIsIndented(w,b,_){return!w||b<0?!1:b>0?!0:_&&w==="-"}static normalizeOffset(w,b){let _=w[b];return _?_!==`
19
+ `&&w[b-1]===`
20
+ `?b-1:rt.endOfWhiteSpace(w,b):b}static foldNewline(w,b,_){let x=0,M=!1,E="",I=w[b+1];for(;I===" "||I===" "||I===`
21
21
  `;){switch(I){case`
22
22
  `:x=0,b+=1,E+=`
23
- `;break;case" ":x<=_&&(M=!0),b=rt.endOfWhiteSpace(S,b+2)-1;break;case" ":x+=1,b+=1;break}I=S[b+1]}return E||(E=" "),I&&x<=_&&(M=!0),{fold:E,offset:b,error:M}}constructor(S,b,_){Object.defineProperty(this,"context",{value:_||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=b||[],this.type=S,this.value=null}getPropValue(S,b,_){if(!this.context)return null;let{src:x}=this.context,M=this.props[S];return M&&x[M.start]===b?x.slice(M.start+(_?1:0),M.end):null}get anchor(){for(let S=0;S<this.props.length;++S){let b=this.getPropValue(S,t.ANCHOR,!0);if(b!=null)return b}return null}get comment(){let S=[];for(let b=0;b<this.props.length;++b){let _=this.getPropValue(b,t.COMMENT,!0);_!=null&&S.push(_)}return S.length>0?S.join(`
24
- `):null}commentHasRequiredWhitespace(S){let{src:b}=this.context;if(this.header&&S===this.header.end||!this.valueRange)return!1;let{end:_}=this.valueRange;return S!==_||rt.atBlank(b,_-1)}get hasComment(){if(this.context){let{src:S}=this.context;for(let b=0;b<this.props.length;++b)if(S[this.props[b].start]===t.COMMENT)return!0}return!1}get hasProps(){if(this.context){let{src:S}=this.context;for(let b=0;b<this.props.length;++b)if(S[this.props[b].start]!==t.COMMENT)return!0}return!1}get includesTrailingLines(){return!1}get jsonLike(){return[i.FLOW_MAP,i.FLOW_SEQ,i.QUOTE_DOUBLE,i.QUOTE_SINGLE].indexOf(this.type)!==-1}get rangeAsLinePos(){if(!this.range||!this.context)return;let S=O(this.range.start,this.context.root);if(!S)return;let b=O(this.range.end,this.context.root);return{start:S,end:b}}get rawValue(){if(!this.valueRange||!this.context)return null;let{start:S,end:b}=this.valueRange;return this.context.src.slice(S,b)}get tag(){for(let S=0;S<this.props.length;++S){let b=this.getPropValue(S,t.TAG,!1);if(b!=null){if(b[1]==="<")return{verbatim:b.slice(2,-1)};{let[_,x,M]=b.match(/^(.*!)([^!]*)$/);return{handle:x,suffix:M}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return!1;let{start:S,end:b}=this.valueRange,{src:_}=this.context;for(let x=S;x<b;++x)if(_[x]===`
25
- `)return!0;return!1}parseComment(S){let{src:b}=this.context;if(b[S]===t.COMMENT){let _=rt.endOfLine(b,S+1),x=new $(S,_);return this.props.push(x),_}return S}setOrigRanges(S,b){return this.range&&(b=this.range.setOrigRange(S,b)),this.valueRange&&this.valueRange.setOrigRange(S,b),this.props.forEach(_=>_.setOrigRange(S,b)),b}toString(){let{context:{src:S},range:b,value:_}=this;if(_!=null)return _;let x=S.slice(b.start,b.end);return rt.addStringTerminator(S,b.end,x)}},J=class extends Error{constructor(j,S,b){if(!b||!(S instanceof R))throw new Error(`Invalid arguments for new ${j}`);super(),this.name=j,this.message=b,this.source=S}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let j=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new $(this.offset,this.offset+1);let S=j&&O(this.offset,j);if(S){let b={line:S.line,col:S.col+1};this.linePos={start:S,end:b}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:S,col:b}=this.linePos.start;this.message+=` at line ${S}, column ${b}`;let _=j&&T(this.linePos,j);_&&(this.message+=`:
23
+ `;break;case" ":x<=_&&(M=!0),b=rt.endOfWhiteSpace(w,b+2)-1;break;case" ":x+=1,b+=1;break}I=w[b+1]}return E||(E=" "),I&&x<=_&&(M=!0),{fold:E,offset:b,error:M}}constructor(w,b,_){Object.defineProperty(this,"context",{value:_||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=b||[],this.type=w,this.value=null}getPropValue(w,b,_){if(!this.context)return null;let{src:x}=this.context,M=this.props[w];return M&&x[M.start]===b?x.slice(M.start+(_?1:0),M.end):null}get anchor(){for(let w=0;w<this.props.length;++w){let b=this.getPropValue(w,t.ANCHOR,!0);if(b!=null)return b}return null}get comment(){let w=[];for(let b=0;b<this.props.length;++b){let _=this.getPropValue(b,t.COMMENT,!0);_!=null&&w.push(_)}return w.length>0?w.join(`
24
+ `):null}commentHasRequiredWhitespace(w){let{src:b}=this.context;if(this.header&&w===this.header.end||!this.valueRange)return!1;let{end:_}=this.valueRange;return w!==_||rt.atBlank(b,_-1)}get hasComment(){if(this.context){let{src:w}=this.context;for(let b=0;b<this.props.length;++b)if(w[this.props[b].start]===t.COMMENT)return!0}return!1}get hasProps(){if(this.context){let{src:w}=this.context;for(let b=0;b<this.props.length;++b)if(w[this.props[b].start]!==t.COMMENT)return!0}return!1}get includesTrailingLines(){return!1}get jsonLike(){return[i.FLOW_MAP,i.FLOW_SEQ,i.QUOTE_DOUBLE,i.QUOTE_SINGLE].indexOf(this.type)!==-1}get rangeAsLinePos(){if(!this.range||!this.context)return;let w=O(this.range.start,this.context.root);if(!w)return;let b=O(this.range.end,this.context.root);return{start:w,end:b}}get rawValue(){if(!this.valueRange||!this.context)return null;let{start:w,end:b}=this.valueRange;return this.context.src.slice(w,b)}get tag(){for(let w=0;w<this.props.length;++w){let b=this.getPropValue(w,t.TAG,!1);if(b!=null){if(b[1]==="<")return{verbatim:b.slice(2,-1)};{let[_,x,M]=b.match(/^(.*!)([^!]*)$/);return{handle:x,suffix:M}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return!1;let{start:w,end:b}=this.valueRange,{src:_}=this.context;for(let x=w;x<b;++x)if(_[x]===`
25
+ `)return!0;return!1}parseComment(w){let{src:b}=this.context;if(b[w]===t.COMMENT){let _=rt.endOfLine(b,w+1),x=new $(w,_);return this.props.push(x),_}return w}setOrigRanges(w,b){return this.range&&(b=this.range.setOrigRange(w,b)),this.valueRange&&this.valueRange.setOrigRange(w,b),this.props.forEach(_=>_.setOrigRange(w,b)),b}toString(){let{context:{src:w},range:b,value:_}=this;if(_!=null)return _;let x=w.slice(b.start,b.end);return rt.addStringTerminator(w,b.end,x)}},J=class extends Error{constructor(j,w,b){if(!b||!(w instanceof R))throw new Error(`Invalid arguments for new ${j}`);super(),this.name=j,this.message=b,this.source=w}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let j=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new $(this.offset,this.offset+1);let w=j&&O(this.offset,j);if(w){let b={line:w.line,col:w.col+1};this.linePos={start:w,end:b}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:w,col:b}=this.linePos.start;this.message+=` at line ${w}, column ${b}`;let _=j&&T(this.linePos,j);_&&(this.message+=`:
26
26
 
27
27
  ${_}
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 dr extends R{static endOfLine(S,b,_){let x=S[b],M=b;for(;x&&x!==`
29
- `&&!(_&&(x==="["||x==="]"||x==="{"||x==="}"||x===","));){let E=S[M+1];if(x===":"&&(!E||E===`
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 k=_[I];if(k===`
28
+ `)}delete this.source}},W=class extends J{constructor(j,w){super("YAMLReferenceError",j,w)}},ae=class extends J{constructor(j,w){super("YAMLSemanticError",j,w)}},Q=class extends J{constructor(j,w){super("YAMLSyntaxError",j,w)}},ne=class extends J{constructor(j,w){super("YAMLWarning",j,w)}};function he(j,w,b){return w in j?Object.defineProperty(j,w,{value:b,enumerable:!0,configurable:!0,writable:!0}):j[w]=b,j}var ye=class dr extends R{static endOfLine(w,b,_){let x=w[b],M=b;for(;x&&x!==`
29
+ `&&!(_&&(x==="["||x==="]"||x==="{"||x==="}"||x===","));){let E=w[M+1];if(x===":"&&(!E||E===`
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:w,end:b}=this.valueRange,{src:_}=this.context,x=_[b-1];for(;w<b&&(x===`
31
+ `||x===" "||x===" ");)x=_[--b-1];let M="";for(let I=w;I<b;++I){let k=_[I];if(k===`
32
32
  `){let{fold:V,offset:G}=R.foldNewline(_,I,-1);M+=V,I=G}else if(k===" "||k===" "){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):k)}else M+=k}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===`
33
+ `&&(M+=I>V?_.slice(V,I+1):k)}else M+=k}let E=_[w];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(w){let{indent:b,inFlow:_,src:x}=this.context,M=w,E=w;for(let I=x[M];I===`
34
34
  `&&!R.atDocumentBoundary(x,M+1);I=x[M]){let k=R.endOfBlockIndent(x,b,M+1);if(k===null||x[k]==="#")break;x[k]===`
35
- `?M=k:(E=dr.endOfLine(x,k,_),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!==`
35
+ `?M=k:(E=dr.endOfLine(x,k,_),M=E)}return this.valueRange.isEmpty()&&(this.valueRange.start=w),this.valueRange.end=E,E}parse(w,b){this.context=w;let{inFlow:_,src:x}=w,M=b,E=x[M];return E&&E!=="#"&&E!==`
36
36
  `&&(M=dr.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=p,e.defaultTags=u}}),Wt=$e({"node_modules/yaml/dist/resolveSeq-d03cb037.js"(e){var t=At();function i(s,o,a){return a?`#${a.replace(/[\s\S]^/gm,`$&${o}#`)}
37
37
  ${o}${s}`:s}function p(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 pt 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 pt)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 pt)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 pt?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 pt?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 pt)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:q}=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((Ie,pe,Re)=>{let fe;pe&&(!oe&&pe.spaceBefore&&Ie.push({type:"comment",str:""}),pe.commentBefore&&pe.commentBefore.match(/^.*$/gm).forEach(js=>{Ie.push({type:"comment",str:`#${js}`})}),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=q(pe,o,()=>fe=null,()=>oe=!0);return X&&!ge&&De.includes(`
40
- `)&&(ge=!0),X&&Re<this.items.length-1&&(De+=","),De=p(De,g,fe),oe&&(fe||X)&&(oe=!1),Ie.push({type:"item",str:De}),Ie},[]),me;if(se.length===0)me=d.start+d.end;else if(X){let{start:Ie,end:pe}=d,Re=se.map(fe=>fe.str);if(ge||Re.reduce((fe,De)=>fe+De.length+2,2)>pt.maxFlowStringSingleLineLength){me=Ie;for(let fe of Re)me+=fe?`
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 pt 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 pt)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 pt)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 pt?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 pt?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 pt)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:q}=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(js=>{Ne.push({type:"comment",str:`#${js}`})}),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=q(pe,o,()=>fe=null,()=>oe=!0);return X&&!ge&&De.includes(`
40
+ `)&&(ge=!0),X&&Re<this.items.length-1&&(De+=","),De=p(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)>pt.maxFlowStringSingleLineLength){me=Ne;for(let fe of Re)me+=fe?`
41
41
  ${L}${P}${fe}`:`
42
42
  `;me+=`
43
- ${P}${pe}`}else me=`${Ie} ${Re.join(" ")} ${pe}`}else{let Ie=se.map(a);me=Ie.shift();for(let pe of Ie)me+=pe?`
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
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 _i extends u{constructor(o,a=null){super(),this.key=o,this.value=a,this.type=_i.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 q=!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:!q,indent:Te+oe});let se=!1,me=ge(A,o,()=>L=null,()=>se=!0);if(me=p(me,o.indent,L),!q&&me.length>1024){if(v)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");q=!0}if(o.allNullValues&&!v)return this.comment?(me=p(me,o.indent,this.comment),a&&a()):se&&!L&&d&&d(),o.inFlow&&!q?me:`? ${me}`;me=q?`? ${me}
47
- ${Te}:`:`${me}:`,this.comment&&(me=p(me,o.indent,this.comment),a&&a());let Ie="",pe=null;if(P instanceof u){if(P.spaceBefore&&(Ie=`
48
- `),P.commentBefore){let De=P.commentBefore.replace(/^/gm,`${o.indent}#`);Ie+=`
49
- ${De}`}pe=P.comment}else P&&typeof P=="object"&&(P=X.schema.createNode(P,!0));o.implicitKey=!1,!q&&!this.comment&&P instanceof f&&(o.indentAtStart=me.length+1),se=!1,!g&&y>=2&&!o.inFlow&&!q&&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 Ie||this.comment?fe=`${Ie}
47
+ ${Te}:`:`${me}:`,this.comment&&(me=p(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,!q&&!this.comment&&P instanceof f&&(o.indentAtStart=me.length+1),se=!1,!g&&y>=2&&!o.inFlow&&!q&&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}`:!q&&P instanceof T?(!(Re[0]==="["||Re[0]==="{")||Re.includes(`
51
51
  `))&&(fe=`
52
52
  ${o.indent}`):Re[0]===`
53
- `&&(fe=""),se&&!pe&&d&&d(),p(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 Pi 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 Pi.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",k="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=[],q={},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,Ie=-1;a===k&&(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}Ie=se}if(Re===`
53
+ `&&(fe=""),se&&!pe&&d&&d(),p(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 Pi 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 Pi.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}},w={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",k="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=[],q={},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===k&&(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
55
  `)a===k&&(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>Ie+1?se-2:me-1;if(q[fe])return s;L.push(fe),q[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=`
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(q[fe])return s;L.push(fe),q[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&&q[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 xe(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,q=g[L];q;q=g[++L])if(q===" "&&g[L+1]==="\\"&&g[L+2]==="n"&&(A+=g.slice(P,L)+"\\ ",L+=1,P=L,q="\\"),q==="\\")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)+`
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,q=g[L];q;q=g[++L])if(q===" "&&g[L+1]==="\\"&&g[L+2]==="n"&&(A+=g.slice(P,L)+"\\ ",L+=1,P=L,q="\\"),q==="\\")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 xe(s,o)}else if(/[ \t]\n|\n[ \t]/.test(s))return xe(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 xe(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+`
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 q="",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?(q=oe.slice(0,-ge[0].length),ge[0]):(q=oe,"")}),X&&(X=X.replace(/\n+(?!\n|$)/g,`$&${v}`)),q&&(q=q.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}${q}${a}${X}`;a=a.replace(/\n+/g,`
69
69
  $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${v}`);let Te=ee(`${q}${a}${X}`,v,k,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:q}=o;if(P&&/[\n[\]{},]/.test(v)||q&&/[[\]{},]/.test(v))return xe(v,o);if(!v||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(v))return P||q||v.indexOf(`
71
- `)===-1?v.indexOf('"')!==-1&&v.indexOf("'")===-1?Me(v,o):xe(v,o):Y(s,o,a,d);if(!P&&!q&&g!==t.Type.PLAIN&&v.indexOf(`
70
+ ${v}${Te}`}function m(s,o,a,d){let{comment:y,type:g,value:v}=s,{actualString:A,implicitKey:P,indent:L,inFlow:q}=o;if(P&&/[\n[\]{},]/.test(v)||q&&/[[\]{},]/.test(v))return Ie(v,o);if(!v||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(v))return P||q||v.indexOf(`
71
+ `)===-1?v.indexOf('"')!==-1&&v.indexOf("'")===-1?Me(v,o):Ie(v,o):Y(s,o,a,d);if(!P&&!q&&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 xe(v,o)}let Te=P?X:ee(X,L,I,ve(o));return y&&!q&&(Te.indexOf(`
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&&!q&&(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 xe(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 q=L(A);if(q===null&&(q=L(y),q===null))throw new Error(`Unsupported default string type ${y}`);return q}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!==`
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 q=L(A);if(q===null&&(q=L(y),q===null))throw new Error(`Unsupported default string type ${y}`);return q}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 Ze(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 et(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 Xe(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 et(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 xt(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=Ze(s,o);return typeof g=="string"&&y.length>0?E(g,y,d.scalarFallback):null}function Ht({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 Ps(s,o,a){try{let d=xt(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=Ht(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=xt(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 xs=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 Is(s,o){let a={before:[],after:[]},d=!1,y=!1,g=xs(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 Ns(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=Xe(s,o);if(g)return Ps(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=Ze(s,o);return E(v,y.tags,y.tags.scalarFallback)}catch(v){return v.source||(v.source=o),d.push(v),null}}function ot(s,o){if(!o)return null;o.error&&s.errors.push(o.error);let{comments:a,hasAnchor:d,hasTag:y}=Is(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=Ns(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(`
@@ -81,18 +81,18 @@ ${v}`:v);let A=a.after.join(`
81
81
  `);A&&(g.comment=g.comment?`${g.comment}
82
82
  ${A}`:A)}return o.resolved=g}function ks(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?Ds(s,o):Ls(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(q=>{if(q instanceof Q){let{type:X}=q.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 q=`Map keys must be unique; "${A}" is repeated`;s.errors.push(new t.YAMLSemanticError(o,q));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 Cs=({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
83
  `)return!1;return!0};function Ms(s,o){if(!Cs(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 Ls(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=ot(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 q="Nested mappings are not allowed in compact mappings";s.errors.push(new t.YAMLSemanticError(A.node,q))}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 q=A.range.start+1;if(P.range={start:q,end:q},P.valueRange={start:q,end:q},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,ot(s,P));Ms(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=ot(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 q="Implicit map keys need to be followed by map values";s.errors.push(new t.YAMLSemanticError(A,q));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 Ds(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:q}=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=q,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=ot(s,P)):(v!==","&&s.errors.push(new t.YAMLSemanticError(P,"Indicator : missing in flow map entry")),d.push(new W(y,ot(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 Us(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?$s(s,o):Fs(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 Fs(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(ot(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 $s(s,o){let a=[],d=[],y=!1,g,v=null,A="[",P=null;for(let L=0;L<o.items.length;++L){let q=o.items[L];if(typeof q.char=="string"){let{char:X,offset:Te}=q;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=q.range?q.range.start:q.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(q.type===t.Type.BLANK_LINE)a.push({before:d.length});else if(q.type===t.Type.COMMENT)ie(s.errors,q),a.push({comment:q.comment,before:d.length});else{if(A){let Te=`Expected a ${A} in flow sequence`;s.errors.push(new t.YAMLSemanticError(q,Te))}let X=ot(s,q);g===void 0?(d.push(X),P=q):(d.push(new W(g,X)),g=void 0),v=q.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=p,e.binaryOptions=S,e.boolOptions=b,e.findPair=ne,e.intOptions=_,e.isEmptyPath=D,e.nullOptions=x,e.resolveMap=ks,e.resolveNode=ot,e.resolveSeq=Us,e.resolveString=Ze,e.strOptions=M,e.stringifyNumber=K,e.stringifyString=N,e.toJSON=h}}),Xn=$e({"node_modules/yaml/dist/warnings-1000a372.js"(e){var t=At(),i=Wt(),p={identify:E=>E instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(E,I)=>{let k=i.resolveString(E,I);if(typeof Buffer=="function")return Buffer.from(k,"base64");if(typeof atob=="function"){let V=atob(k.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:k},V,G,ee)=>{let ve;if(typeof Buffer=="function")ve=k instanceof Buffer?k.toString("base64"):Buffer.from(k.buffer).toString("base64");else if(typeof btoa=="function"){let Ae="";for(let Ee=0;Ee<k.length;++Ee)Ae+=String.fromCharCode(k[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)k=ve;else{let{lineWidth:Ae}=i.binaryOptions,Ee=Math.ceil(ve.length/Ae),xe=new Array(Ee);for(let Me=0,Y=0;Me<Ee;++Me,Y+=Ae)xe[Me]=ve.substr(Y,Ae);k=xe.join(I===t.Type.BLOCK_LITERAL?`
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(q.type===t.Type.BLANK_LINE)a.push({before:d.length});else if(q.type===t.Type.COMMENT)ie(s.errors,q),a.push({comment:q.comment,before:d.length});else{if(A){let Te=`Expected a ${A} in flow sequence`;s.errors.push(new t.YAMLSemanticError(q,Te))}let X=ot(s,q);g===void 0?(d.push(X),P=q):(d.push(new W(g,X)),g=void 0),v=q.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=p,e.binaryOptions=w,e.boolOptions=b,e.findPair=ne,e.intOptions=_,e.isEmptyPath=D,e.nullOptions=x,e.resolveMap=ks,e.resolveNode=ot,e.resolveSeq=Us,e.resolveString=Ze,e.strOptions=M,e.stringifyNumber=K,e.stringifyString=N,e.toJSON=h}}),Xn=$e({"node_modules/yaml/dist/warnings-1000a372.js"(e){var t=At(),i=Wt(),p={identify:E=>E instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(E,I)=>{let k=i.resolveString(E,I);if(typeof Buffer=="function")return Buffer.from(k,"base64");if(typeof atob=="function"){let V=atob(k.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:k},V,G,ee)=>{let ve;if(typeof Buffer=="function")ve=k instanceof Buffer?k.toString("base64"):Buffer.from(k.buffer).toString("base64");else if(typeof btoa=="function"){let Ae="";for(let Ee=0;Ee<k.length;++Ee)Ae+=String.fromCharCode(k[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)k=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);k=Ie.join(I===t.Type.BLOCK_LITERAL?`
85
85
  `:" ")}return i.stringifyString({comment:E,type:I,value:k},V,G,ee)}};function u(E,I){let k=i.resolveSeq(E,I);for(let V=0;V<k.items.length;++V){let G=k.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 xi 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=xi.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 Ii extends i.YAMLMap{constructor(){super(),this.tag=Ii.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}}),Mr=$e({"node_modules/yaml/dist/Schema-88e323a7.js"(e){var t=At(),i=Wt(),p=Xn();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:Ze}=K;N&&N.startsWith("!!")&&(N=H+N.slice(2));let et=Ae(m,N,Ye.tags);if(!et){if(typeof m.toJSON=="function"&&(m=m.toJSON()),!m||typeof m!="object")return Ze?new i.Scalar(m):m;et=m instanceof Map?h:m[Symbol.iterator]?O:h}ie&&(ie(et),delete K.onTagObj);let Xe={value:void 0,node:void 0};if(m&&typeof m=="object"&&le){let xt=le.get(m);if(xt){let Ht=new i.Alias(xt);return K.aliasNodes.push(Ht),Ht}Xe.value=m,le.set(m,Xe)}return Xe.node=et.createNode?et.createNode(K.schema,m,K):Ze?new i.Scalar(m):m,N&&Xe.node instanceof i.Node&&(Xe.node.tag=N),Xe.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 Ze=N[Ye];if(!Ze){let et=Object.keys(N).map(Xe=>JSON.stringify(Xe)).join(", ");throw new Error(`Unknown custom tag "${Ye}"; use one of ${et}`)}ie[le]=Ze}}return ie}var Me=(m,N)=>m.key<N.key?-1:m.key>N.key?1:0,Y=class Ni{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:Ni.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}}),Lr=$e({"node_modules/yaml/dist/types.js"(e){var t=Wt(),i=Mr();At(),Xn(),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}}),Qn={},Zn=()=>Qn,Dr=e=>{Object.assign(Qn,e)},Ur=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}},er=Ur,ue={},tr=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,Fr=class extends er{constructor(){super(),this.data={...tr},this._defaults=tr}get defaults(){return{...this._defaults}}},$r=Fr,Rt=new $r,Pe.getDefaults=()=>Rt.defaults,te=Pe,nr=["integer","number","string","boolean"],rr=nr.concat(["null"]),jr=["array","object"].concat(rr),Yr=2524608e6,Wr=-1e8,Vr=1e8,qr=-100,Br=100,ze={ALLOWED_TYPES:nr,SCALAR_TYPES:rr,ALL_TYPES:jr,MIN_NUMBER:qr,MAX_NUMBER:Br,MIN_INTEGER:Wr,MAX_INTEGER:Vr,MOST_NEAR_DATETIME:Yr},Vt=zn(Cr(),1),Z={pick:Ce,date:Wn,shuffle:Fe,number:Ke,randexp:be},Jr=/^(0|[1-9][0-9]*)$/,de={hasProperties:qe,getLocalRef:yr,omitProps:jo,typecast:Co,merge:ft,clone:ce,short:Mo,hasValue:Lo,notValue:Do,anyValue:Sr,validate:Uo,validateValueForSchema:Vn,validateValueForOneOf:Fo,isKey:$o,template:wr,shouldClean:br,clean:Bn,isEmpty:qn,clampDate:gr},Gr=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]=Yo(()=>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}},Kr=Gr,mt=new er,ir=Wo,Hr=class extends Error{constructor(e,t){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="ParseError",this.message=e,this.path=t}},qt=Hr,Et={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"]},Et.number=Et.integer,zr=["additionalItems","items","additionalProperties","dependencies","patternProperties","properties"],Xr=qo,Qr=Bo,Zr=Qr,ei=Zr,ti=Jo,ni=ti,ri=ni,ii=Ko,or=Ho,oi=zo,si=`Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore
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 xi 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=xi.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 Ii extends i.YAMLMap{constructor(){super(),this.tag=Ii.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 Ie=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),Ie-=6e4*Me}return new Date(Ie)},stringify:({value:E})=>E.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function w(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(w(!1)){let k=typeof process!="undefined"&&process.emitWarning;k?k(E,I):console.warn(I?`${I}: ${E}`:E)}}function _(E){if(w(!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]&&w(!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}}),Mr=$e({"node_modules/yaml/dist/Schema-88e323a7.js"(e){var t=At(),i=Wt(),p=Xn();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()},w={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,w]),_=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:w,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:Ze}=K;N&&N.startsWith("!!")&&(N=H+N.slice(2));let et=Ae(m,N,Ye.tags);if(!et){if(typeof m.toJSON=="function"&&(m=m.toJSON()),!m||typeof m!="object")return Ze?new i.Scalar(m):m;et=m instanceof Map?h:m[Symbol.iterator]?O:h}ie&&(ie(et),delete K.onTagObj);let Xe={value:void 0,node:void 0};if(m&&typeof m=="object"&&le){let xt=le.get(m);if(xt){let Ht=new i.Alias(xt);return K.aliasNodes.push(Ht),Ht}Xe.value=m,le.set(m,Xe)}return Xe.node=et.createNode?et.createNode(K.schema,m,K):Ze?new i.Scalar(m):m,N&&Xe.node instanceof i.Node&&(Xe.node.tag=N),Xe.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 Ze=N[Ye];if(!Ze){let et=Object.keys(N).map(Xe=>JSON.stringify(Xe)).join(", ");throw new Error(`Unknown custom tag "${Ye}"; use one of ${et}`)}ie[le]=Ze}}return ie}var Me=(m,N)=>m.key<N.key?-1:m.key>N.key?1:0,Y=class Ni{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=Ie(ee,ve,N||le,H)}createNode(N,K,H,ie){let le={defaultPrefix:Ni.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}}),Lr=$e({"node_modules/yaml/dist/types.js"(e){var t=Wt(),i=Mr();At(),Xn(),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}}),Qn={},Zn=()=>Qn,Dr=e=>{Object.assign(Qn,e)},Ur=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}},er=Ur,ue={},tr=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,Fr=class extends er{constructor(){super(),this.data={...tr},this._defaults=tr}get defaults(){return{...this._defaults}}},$r=Fr,Rt=new $r,Pe.getDefaults=()=>Rt.defaults,te=Pe,nr=["integer","number","string","boolean"],rr=nr.concat(["null"]),jr=["array","object"].concat(rr),Yr=2524608e6,Wr=-1e8,Vr=1e8,qr=-100,Br=100,ze={ALLOWED_TYPES:nr,SCALAR_TYPES:rr,ALL_TYPES:jr,MIN_NUMBER:qr,MAX_NUMBER:Br,MIN_INTEGER:Wr,MAX_INTEGER:Vr,MOST_NEAR_DATETIME:Yr},Vt=zn(Cr(),1),Z={pick:Ce,date:Wn,shuffle:Fe,number:Ke,randexp:be},Jr=/^(0|[1-9][0-9]*)$/,de={hasProperties:qe,getLocalRef:yr,omitProps:jo,typecast:Co,merge:ft,clone:ce,short:Mo,hasValue:Lo,notValue:Do,anyValue:Sr,validate:Uo,validateValueForSchema:Vn,validateValueForOneOf:Fo,isKey:$o,template:wr,shouldClean:br,clean:Bn,isEmpty:qn,clampDate:gr},Gr=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]=Yo(()=>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}},Kr=Gr,mt=new er,ir=Wo,Hr=class extends Error{constructor(e,t){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="ParseError",this.message=e,this.path=t}},qt=Hr,Et={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"]},Et.number=Et.integer,zr=["additionalItems","items","additionalProperties","dependencies","patternProperties","properties"],Xr=qo,Qr=Bo,Zr=Qr,ei=Zr,ti=Jo,ni=ti,ri=ni,ii=Ko,or=Ho,oi=zo,si=`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/),Bt=Xo,Jt={type:ze.ALLOWED_TYPES},ai=Qo,sr=Zo,li=es,Gt=ts,ci=ns,pi=rs,ar="[a-zA-Z][a-zA-Z0-9+-.]*",Kt=`https?://{hostname}(?:${ar})+`,ui="(?:\\?([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:Kt,slug:"[a-zA-Z\\d_-]+","uri-reference":`${Kt}${ui}`,"uri-template":Kt.replace("(?:","(?:/\\{[a-z][:a-zA-Z0-9-]*\\}|"),"json-pointer":`(/(?:${ar.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,di=new RegExp(`\\{(${Object.keys(je).join("|")})\\}`),fi=is,hi=ss,mi={boolean:ei,null:ri,array:ii,integer:oi,number:or,object:ai,string:hi},_t=mi,yi=ht,gi=({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},Si=gi,lr=ps,cr=us,Le=zn(Lr(),1),hs=Le.default.binaryOptions,ms=Le.default.boolOptions,ys=Le.default.intOptions,gs=Le.default.nullOptions,Ss=Le.default.strOptions,ws=Le.default.Schema,bs=Le.default.Alias,Ts=Le.default.Collection,Os=Le.default.Merge,vs=Le.default.Node,As=Le.default.Pair,Rs=Le.default.Scalar,wi=Le.default.YAMLMap,bi=Le.default.YAMLSeq,Pt=fs,Qe=new Kr,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=vr(t,e);return lr(i,e,Qe,!0)},Oe.generate=(e,t)=>cr(Oe.generateWithContext(e,t)),Oe.generateYAML=(e,t)=>Pt(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=vr(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}=Zn();return h.bundle(i,e,{resolve:{file:{order:100},http:{order:200},fixedRefs:u},dereference:{circular:"ignore"}}).then(f=>lr(p,f,Qe)).catch(f=>{throw new Error(`Error while resolving schema (${f.message})`)})},Oe.resolve=(e,t,i)=>Oe.resolveWithContext(e,t,i).then(cr),Oe.resolveYAML=(e,t,i)=>Oe.resolveWithContext(e,t,i).then(Pt),Or(),Oe.format=ir,Oe.option=te,Oe.random=Z,Oe.extend=(e,t)=>(Qe.extend(e,t),Oe),Oe.define=(e,t)=>(Qe.define(e,t),Oe),Oe.reset=e=>(Qe.reset(e),Or(),Oe),Oe.locate=e=>Qe.get(e),Oe.VERSION="0.5.5",Ti={...Oe},Oi=Oe}}),_s=U({"src/src/main.iife.js"(e,t){var i=(Es(),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 _s()})();((c,r)=>{c.JSONSchemaFaker=r()})(typeof self!="undefined"?self:typeof window!="undefined"?window:globalThis,()=>vn);vn.random.shuffle=function(){return["[placeholder]"]};vn.option({useDefaultValue:!0,alwaysFakeOptionals:!0});function ki(c){return vn.generate(c)}var Ci=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 Xs=require("cross-fetch");var Mi=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 Li(c){return!!c&&typeof c=="object"&&"error"in c&&"message"in c&&"statusCode"in c}var An=(c,r)=>{if(!c)throw new dn;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 Li(U)?new fn(U.statusCode,U.error,U.message):new yt(U)},delete:async n=>(await fetch(`${r}/v1${n}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${c}`}})).json()}};var Yi=require("liquidjs");function fr(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]=fr(n[l]||{},w):(Array.isArray(w),n[l]=w)}return n}function Rn(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 Di(c,r=2,n,l=", "){if(!Array.isArray(c)||c.length===0)return"";let w=n?c.map(z=>typeof z!="object"||!z?"":Rn(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 Ui=tt(require("pluralize"),1);function Fi(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,Ui.default)(r,w),l==="true"?`${w} ${U}`:U}var Qs=require("liquidjs"),$i=tt(require("pluralize"),1),Zs=require("zod");var ea="",ta=2,na="other",ra=", ",ia=" and ",oa=", and ";function ji(c,r=ea,n=ta,l=na,w=ra,U=ia,C=oa){if(!Array.isArray(c)||c.length===0)return"";let z=r?c.map(be=>typeof be!="object"||!be?"":Rn(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,$i.default)(l,Pe)}`}function sa(c){return Array.isArray(c)||typeof c=="object"&&c!==null?Wi(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 Wi=(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 Vi(c){let r=new Yi.Liquid({outputEscape:sa,...c});return r.registerFilter("json",(n,l)=>Wi(n,l)),r.registerFilter("digest",Di),r.registerFilter("toSentence",ji),r.registerFilter("pluralize",Fi),r}var ut=tt(require("chalk"),1),Se={info:c=>ut.default.blue(c),warning:c=>ut.default.yellow(c),error:c=>ut.default.red(c),success:c=>ut.default.green(c),underline:c=>ut.default.underline(c),bold:c=>ut.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 En(c){return c||process.env.NOVU_API_URL||"https://api.novu.co"}function _n(c){return c||process.env.NOVU_SECRET_KEY||process.env.NOVU_API_KEY||""}var hr=tt(require("sanitize-html"),1),aa=["src","alt","width","height","loading","srcset","sizes","crossorigin","usemap","ismap","class","id","style","title","dir","lang"];function la(c){return c.toLowerCase().startsWith("on")}function ca(c){return c.replace(/<\/([a-zA-Z][a-zA-Z0-9]*)\s*\/[^>]*>/g,"</$1>")}var pa={allowedTags:hr.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))la(l)||(n[l]=w);return{tagName:c,attribs:n}},img:(c,r)=>{let n={};for(let[l,w]of Object.entries(r))aa.includes(l.toLowerCase())&&(n[l]=w);return{tagName:c,attribs:n}}},allowVulnerableTags:!0,parseStyleAttributes:!1,parser:{lowerCaseAttributeNames:!0}},qi=c=>{if(!c)return c;let r=ca(c),n=/^<!DOCTYPE .*?>/,l=r.match(n),w=(0,hr.default)(r,pa);return l?l[0]+w:w},Pn=c=>Object.keys(c).reduce((r,n)=>{let l=c[n];return typeof l=="string"?r[n]=qi(l):Array.isArray(l)?r[n]=l.map(w=>typeof w=="string"?qi(w):typeof w=="object"?Pn(w):w):typeof l=="object"&&l!==null?r[n]=Pn(l):r[n]=l,r},{});function Bi(c,r=!0){r&&(console.log(`
92
- ${Se.bold(Se.underline("Discovered workflowId:"))} '${c.workflowId}'`),c.steps.forEach((n,l)=>{let w=l===c.steps.length-1;console.log(`${w?"\u2514":"\u251C"} ${_e.STEP} Discovered stepId: '${n.stepId}' Type: '${n.type}'`),n.providers.forEach((C,z)=>{let re=z===n.providers.length-1;console.log(`${w?" ":"\u2502"} ${re?"\u2514":"\u251C"} ${_e.PROVIDER} Discovered provider: '${C.type}'`)})}))}var Ji=require("jsonrepair");function ua(c){let r=c.trim();return(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))&&r.length>2}function da(c){try{return JSON.parse(c),c}catch{try{return(0,Ji.jsonrepair)(c)}catch{return c}}}function Gi(c){return Object.fromEntries(Object.entries(c).map(([r,n])=>typeof n=="string"?[r,ua(n)?da(n):n]:typeof n=="object"&&n!==null&&!Array.isArray(n)?[r,Gi(n)]:[r,n]))}function Ki(c){return!(c!=null&&c.data)||typeof c.data!="object"||Array.isArray(c.data)?c:{...c,data:Gi(c.data)}}var zi=tt(require("ajv"),1),Xi=tt(require("ajv-formats"),1);var Hi=c=>typeof structuredClone=="function"?structuredClone(c):JSON.parse(JSON.stringify(c));var xn=class extends at{constructor(n,l){let w=l.length===1?"it":"them";super(`Tried to use a ${n} in @novu/framework without ${l.join(", ")} installed. Please install ${w} by running \`npm install ${l.join(" ")}\`.`);this.statusCode=500;this.code="MissingDependencyError"}};var In=async(c,r)=>{let n=new Set;if((await Promise.allSettled(c.map(w=>w.import))).forEach((w,U)=>{let C=c[U];w.status==="fulfilled"&&C.exports.every(re=>w.value[re]!==void 0)||n.add(C.name)}),n.size>0)throw new xn(r,Array.from(n))};var Nn=class{constructor(){this.requiredImports=[];this.ajv=new zi.default({useDefaults:!0,removeAdditional:"failing"}),(0,Xi.default)(this.ajv),this.compiledSchemas=new Map}async canHandle(r){let n=r.type==="object"||!!r.anyOf||!!r.allOf||!!r.oneOf;return n&&await In(this.requiredImports,"JSON schema"),n}async validate(r,n){let l=this.compiledSchemas.get(n);l||(l=this.ajv.compile(n),this.compiledSchemas.set(n,l));let w=Hi(r);return l(w)?{success:!0,data:w}:{success:!1,errors:l.errors.map(C=>({path:C.instancePath,message:C.message}))}}async transformToJsonSchema(r){return r}};var kn=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 In(this.requiredImports,"Zod schema"),n}async validate(r,n){let l=await n.safeParseAsync(r);return l.success?{success:!0,data:l.data}:{success:!1,errors:l.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 Cn=new kn,Mn=new Nn,$t=async(c,r)=>{if(await Cn.canHandle(c))return Cn.validate(r,c);if(await Mn.canHandle(c))return Mn.validate(r,c);throw new Error("Invalid schema")},Ne=async c=>{if(await Cn.canHandle(c))return Cn.transformToJsonSchema(c);if(await Mn.canHandle(c))return Mn.transformToJsonSchema(c);throw new Error("Invalid schema")};function Qi(){return["development",void 0,"dev"].includes(process.env.NODE_ENV)}var wt=class{constructor(r){this.discoveredWorkflows=new Map;this.discoverWorkflowPromises=new Map;this.version="2.10.0-alpha.0";let n=this.buildOptions(r);this.apiUrl=n.apiUrl,this.secretKey=n.secretKey,this.strictAuthentication=n.strictAuthentication,this.verbose=n.verbose,this.templateEngine=Vi()}buildOptions(r){let n={apiUrl:En(r==null?void 0:r.apiUrl),secretKey:_n(r==null?void 0:r.secretKey),strictAuthentication:!Qi(),verbose:Qi()};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 l=this.discoverWorkflowPromises.get(n.id);if(l){await l;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,l=r.reduce((w,U)=>w+U.steps.length,0);return{status:"ok",sdkVersion:"2.10.0-alpha.0",frameworkVersion:"2024-06-26",discovered:{workflows:n,steps:l}}}getWorkflow(r){let n=this.discoveredWorkflows.get(r);if(n)return n;throw new Dt(r)}getStep(r,n){let w=this.getWorkflow(r).steps.find(U=>U.stepId===n);if(w)return w;throw new Tn(n)}getRegisteredWorkflows(){return Array.from(this.discoveredWorkflows.values())}discover(){return{workflows:this.getRegisteredWorkflows()}}mock(r){return ki(r)}async validate(r,n,l,w,U,C,z){let re=await $t(n,r);if(re.success)return re.data;switch(l){case"event":this.throwInvalidEvent(w,U,re.errors);case"step":this.throwInvalidStep(C,w,U,re.errors);case"provider":this.throwInvalidProvider(C,z,w,U,re.errors);default:throw new Error(`Invalid component: '${l}'`)}}throwInvalidProvider(r,n,l,w,U){if(!r)throw new Error("stepId is required");if(!n)throw new Error("providerId is required");switch(l){case"output":throw new ln(w,r,n,U);default:throw new Error(`Invalid payload type: '${l}'`)}}throwInvalidStep(r,n,l,w){if(!r)throw new Error("stepId is required");switch(n){case"output":throw new on(l,r,w);case"result":throw new sn(l,r,w);case"controls":throw new rn(l,r,w);default:throw new Error(`Invalid payload type: '${n}'`)}}throwInvalidEvent(r,n,l){switch(r){case"controls":throw new nn(n,l);case"payload":throw new kt(n,l);default:throw new Error(`Invalid payload type: '${r}'`)}}executeStepFactory(r,n,l){return async(w,U,C)=>{if(l())return;let z=this.getStep(r.workflowId,w),re=r.action==="preview";if(!re&&w===r.stepId){let Ce=await this.createStepControls(z,r),Fe=await this.compileControls(Ce,r);if(await this.shouldSkip(C==null?void 0:C.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(Ce=>{var it;let Fe=(it=C==null?void 0:C.providers)==null?void 0:it[Ce.type];if(!Fe)throw new hn(Ce.type);return{...Ce,resolve:Fe}}),resolve:U});return this.shouldSanitize({stepType:z.type,options:C})&&(be={...be,outputs:Pn(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 U=this.getWorkflow(r.workflowId),C=process.hrtime(),z={outputs:{},providers:{},options:{skip:!1}},re,we=!1,Pe=new Promise(He=>{re=He}),ke=He=>{if(we)throw new Error("setResult can only be called once per workflow execution");re(),we=!0,z=He},be=()=>we,Ce;try{if(r.action==="execute"&&!r.payload)throw new kt(r.workflowId,{message:"Event `payload` is required"});let He=await this.createExecutionPayload(r,U),qe={...r,payload:He};await Promise.race([Pe,U.execute({payload:He,environment:{},controls:{},subscriber:r.subscriber,context:r.context,step:{email:this.executeStepFactory(qe,ke,be),sms:this.executeStepFactory(qe,ke,be),inApp:this.executeStepFactory(qe,ke,be),digest:this.executeStepFactory(qe,ke,be),delay:this.executeStepFactory(qe,ke,be),push:this.executeStepFactory(qe,ke,be),chat:this.executeStepFactory(qe,ke,be),custom:this.executeStepFactory(qe,ke,be),throttle:this.executeStepFactory(qe,ke,be)}})])}catch(He){Ce=He}let Fe=process.hrtime(C),it=Fe[0],Ke=Fe[1],jt=it*1e3+Ke/1e6,Wn=Ce?_e.ERROR:_e.SUCCESS,Yt={execute:"Executed",preview:"Previewed"}[r.action];if(this.log(`${Wn} ${Yt} workflowId: \`${r.workflowId}\``),this.prettyPrintExecute(r,jt,Ce),Ce)throw Ce;return{outputs:z.outputs,providers:z.providers,options:z.options,metadata:{status:"success",error:!1,duration:jt}}}async createExecutionPayload(r,n){let{payload:l}=r;if(r.action==="preview"){let U=this.mock(n.payload.schema);l=Object.assign(U,l)}return await this.validate(l,n.payload.unknownSchema,"event","payload",r.workflowId)}prettyPrintExecute(r,n,l){if(!this.verbose)return;let w=l?_e.ERROR:_e.SUCCESS,C={execute:"Executed",preview:"Previewed"}[r.action],z=l?"Failed to execute":C,re=l?Se.error:Se.success,we=`${w} ${z} workflowId: '${r.workflowId}`;console.log(`
91
+ laborum`.split(/\W/),Bt=Xo,Jt={type:ze.ALLOWED_TYPES},ai=Qo,sr=Zo,li=es,Gt=ts,ci=ns,pi=rs,ar="[a-zA-Z][a-zA-Z0-9+-.]*",Kt=`https?://{hostname}(?:${ar})+`,ui="(?:\\?([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:Kt,slug:"[a-zA-Z\\d_-]+","uri-reference":`${Kt}${ui}`,"uri-template":Kt.replace("(?:","(?:/\\{[a-z][:a-zA-Z0-9-]*\\}|"),"json-pointer":`(/(?:${ar.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,di=new RegExp(`\\{(${Object.keys(je).join("|")})\\}`),fi=is,hi=ss,mi={boolean:ei,null:ri,array:ii,integer:oi,number:or,object:ai,string:hi},_t=mi,yi=ht,gi=({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(w=>{if(ye.required&&ye.required.includes(w))return;let b=he.required&&he.required.includes(w);he.properties&&!b&&delete he.properties[w],ne&&ne.properties&&delete ne.properties[w]})}),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},Si=gi,lr=ps,cr=us,Le=zn(Lr(),1),hs=Le.default.binaryOptions,ms=Le.default.boolOptions,ys=Le.default.intOptions,gs=Le.default.nullOptions,Ss=Le.default.strOptions,ws=Le.default.Schema,bs=Le.default.Alias,Ts=Le.default.Collection,Os=Le.default.Merge,vs=Le.default.Node,As=Le.default.Pair,Rs=Le.default.Scalar,wi=Le.default.YAMLMap,bi=Le.default.YAMLSeq,Pt=fs,Qe=new Kr,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=vr(t,e);return lr(i,e,Qe,!0)},Oe.generate=(e,t)=>cr(Oe.generateWithContext(e,t)),Oe.generateYAML=(e,t)=>Pt(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=vr(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}=Zn();return h.bundle(i,e,{resolve:{file:{order:100},http:{order:200},fixedRefs:u},dereference:{circular:"ignore"}}).then(f=>lr(p,f,Qe)).catch(f=>{throw new Error(`Error while resolving schema (${f.message})`)})},Oe.resolve=(e,t,i)=>Oe.resolveWithContext(e,t,i).then(cr),Oe.resolveYAML=(e,t,i)=>Oe.resolveWithContext(e,t,i).then(Pt),Or(),Oe.format=ir,Oe.option=te,Oe.random=Z,Oe.extend=(e,t)=>(Qe.extend(e,t),Oe),Oe.define=(e,t)=>(Qe.define(e,t),Oe),Oe.reset=e=>(Qe.reset(e),Or(),Oe),Oe.locate=e=>Qe.get(e),Oe.VERSION="0.5.5",Ti={...Oe},Oi=Oe}}),_s=F({"src/src/main.iife.js"(e,t){var i=(Es(),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 _s()})();((c,r)=>{c.JSONSchemaFaker=r()})(typeof self!="undefined"?self:typeof window!="undefined"?window:globalThis,()=>vn);vn.random.shuffle=function(){return["[placeholder]"]};vn.option({useDefaultValue:!0,alwaysFakeOptionals:!0});function ki(c){return vn.generate(c)}var Ci=async(c,r)=>{let n=new TextEncoder,l=n.encode(c),S=n.encode(r),F=await crypto.subtle.importKey("raw",l,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),C=await crypto.subtle.sign("HMAC",F,S);return Array.from(new Uint8Array(C)).map(z=>z.toString(16).padStart(2,"0")).join("")};var Xs=require("cross-fetch");var Mi=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 Li(c){return!!c&&typeof c=="object"&&"error"in c&&"message"in c&&"statusCode"in c}var An=(c,r)=>{if(!c)throw new dn;return{post:async(n,l)=>{let S=await fetch(`${r}/v1${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${c}`},body:JSON.stringify(l)}),F=await S.json();if(S.ok)return F;throw Li(F)?new fn(F.statusCode,F.error,F.message):new yt(F)},delete:async n=>(await fetch(`${r}/v1${n}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${c}`}})).json()}};var Yi=require("liquidjs");function fr(c,r){let n={...c};for(let l of Object.keys(r)){let S=r[l];S&&typeof S=="object"&&!Array.isArray(S)?n[l]=fr(n[l]||{},S):(Array.isArray(S),n[l]=S)}return n}function Rn(c,r){let n=r.split(".").reduce((l,S)=>{if(l&&typeof l=="object")return l[S]},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 Di(c,r=2,n,l=", "){if(!Array.isArray(c)||c.length===0)return"";let S=n?c.map(z=>typeof z!="object"||!z?"":Rn(z,n)):c;if(S.length===1)return S[0];if(S.length===2)return`${S[0]} and ${S[1]}`;if(S.length===3&&r>=3)return`${S[0]}, ${l}${S[1]} and ${S[2]}`;let F=S.slice(0,r),C=S.length-r;return`${F.join(l)} and ${C} ${C===1?"other":"others"}`}var Ui=tt(require("pluralize"),1);function Fi(c,r="",n="",l="true"){if(c==null)return"";let S=0;if(Array.isArray(c)?S=c.length:typeof c=="object"?S=Object.keys(c).length:typeof c=="string"?S=+c:typeof c=="number"?S=c:S=Number(c),Number.isNaN(S)&&(S=0),S<=0)return"";let F;return n?F=S===1?r:n:F=(0,Ui.default)(r,S),l==="true"?`${S} ${F}`:F}var Qs=require("liquidjs"),$i=tt(require("pluralize"),1),Zs=require("zod");var ea="",ta=2,na="other",ra=", ",ia=" and ",oa=", and ";function ji(c,r=ea,n=ta,l=na,S=ra,F=ia,C=oa){if(!Array.isArray(c)||c.length===0)return"";let z=r?c.map(be=>typeof be!="object"||!be?"":Rn(be,r)):c,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),Ce=z[re-1];return`${be.join(S)}${C}${Ce}`}let we=z.slice(0,n),Pe=re-n,xe=n===1?F:C;return`${we.join(S)}${xe}${Pe} ${(0,$i.default)(l,Pe)}`}function sa(c){return Array.isArray(c)||typeof c=="object"&&c!==null?Wi(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 Wi=(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 Vi(c){let r=new Yi.Liquid({outputEscape:sa,...c});return r.registerFilter("json",(n,l)=>Wi(n,l)),r.registerFilter("digest",Di),r.registerFilter("toSentence",ji),r.registerFilter("pluralize",Fi),r}var ut=tt(require("chalk"),1),Se={info:c=>ut.default.blue(c),warning:c=>ut.default.yellow(c),error:c=>ut.default.red(c),success:c=>ut.default.green(c),underline:c=>ut.default.underline(c),bold:c=>ut.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 En(c){return c||process.env.NOVU_API_URL||"https://api.novu.co"}function _n(c){return c||process.env.NOVU_SECRET_KEY||process.env.NOVU_API_KEY||""}var hr=tt(require("sanitize-html"),1),aa=["src","alt","width","height","loading","srcset","sizes","crossorigin","usemap","ismap","class","id","style","title","dir","lang"];function la(c){return c.toLowerCase().startsWith("on")}function ca(c){return c.replace(/<\/([a-zA-Z][a-zA-Z0-9]*)\s*\/[^>]*>/g,"</$1>")}var pa={allowedTags:hr.default.defaults.allowedTags.concat(["style","img","html","head","body","link","meta","title"]),allowedAttributes:!1,transformTags:{"*":(c,r)=>{let n={};for(let[l,S]of Object.entries(r))la(l)||(n[l]=S);return{tagName:c,attribs:n}},img:(c,r)=>{let n={};for(let[l,S]of Object.entries(r))aa.includes(l.toLowerCase())&&(n[l]=S);return{tagName:c,attribs:n}}},allowVulnerableTags:!0,parseStyleAttributes:!1,parser:{lowerCaseAttributeNames:!0}},qi=c=>{if(!c)return c;let r=ca(c),n=/^<!DOCTYPE .*?>/,l=r.match(n),S=(0,hr.default)(r,pa);return l?l[0]+S:S},Pn=c=>Object.keys(c).reduce((r,n)=>{let l=c[n];return typeof l=="string"?r[n]=qi(l):Array.isArray(l)?r[n]=l.map(S=>typeof S=="string"?qi(S):typeof S=="object"?Pn(S):S):typeof l=="object"&&l!==null?r[n]=Pn(l):r[n]=l,r},{});function Bi(c,r=!0){r&&(console.log(`
92
+ ${Se.bold(Se.underline("Discovered workflowId:"))} '${c.workflowId}'`),c.steps.forEach((n,l)=>{let S=l===c.steps.length-1;console.log(`${S?"\u2514":"\u251C"} ${_e.STEP} Discovered stepId: '${n.stepId}' Type: '${n.type}'`),n.providers.forEach((C,z)=>{let re=z===n.providers.length-1;console.log(`${S?" ":"\u2502"} ${re?"\u2514":"\u251C"} ${_e.PROVIDER} Discovered provider: '${C.type}'`)})}))}var Ji=require("jsonrepair");function ua(c){let r=c.trim();return(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))&&r.length>2}function da(c){try{return JSON.parse(c),c}catch{try{return(0,Ji.jsonrepair)(c)}catch{return c}}}function Gi(c){return Object.fromEntries(Object.entries(c).map(([r,n])=>typeof n=="string"?[r,ua(n)?da(n):n]:typeof n=="object"&&n!==null&&!Array.isArray(n)?[r,Gi(n)]:[r,n]))}function Ki(c){return!(c!=null&&c.data)||typeof c.data!="object"||Array.isArray(c.data)?c:{...c,data:Gi(c.data)}}var zi=tt(require("ajv"),1),Xi=tt(require("ajv-formats"),1);var Hi=c=>typeof structuredClone=="function"?structuredClone(c):JSON.parse(JSON.stringify(c));var xn=class extends at{constructor(n,l){let S=l.length===1?"it":"them";super(`Tried to use a ${n} in @novu/framework without ${l.join(", ")} installed. Please install ${S} by running \`npm install ${l.join(" ")}\`.`);this.statusCode=500;this.code="MissingDependencyError"}};var In=async(c,r)=>{let n=new Set;if((await Promise.allSettled(c.map(S=>S.import))).forEach((S,F)=>{let C=c[F];S.status==="fulfilled"&&C.exports.every(re=>S.value[re]!==void 0)||n.add(C.name)}),n.size>0)throw new xn(r,Array.from(n))};var Nn=class{constructor(){this.requiredImports=[];this.ajv=new zi.default({useDefaults:!0,removeAdditional:"failing",strict:!1}),(0,Xi.default)(this.ajv),this.compiledSchemas=new Map}async canHandle(r){let n=r.type==="object"||!!r.anyOf||!!r.allOf||!!r.oneOf;return n&&await In(this.requiredImports,"JSON schema"),n}async validate(r,n){let l=this.compiledSchemas.get(n);l||(l=this.ajv.compile(n),this.compiledSchemas.set(n,l));let S=Hi(r);return l(S)?{success:!0,data:S}:{success:!1,errors:l.errors.map(C=>({path:C.instancePath,message:C.message}))}}async transformToJsonSchema(r){return r}};var kn=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 In(this.requiredImports,"Zod schema"),n}async validate(r,n){let l=await n.safeParseAsync(r);return l.success?{success:!0,data:l.data}:{success:!1,errors:l.error.errors.map(S=>({path:`/${S.path.join("/")}`,message:S.message}))}}async transformToJsonSchema(r){let{zodToJsonSchema:n}=await import("zod-to-json-schema");return n(r)}};var Cn=new kn,Mn=new Nn,$t=async(c,r)=>{if(await Cn.canHandle(c))return Cn.validate(r,c);if(await Mn.canHandle(c))return Mn.validate(r,c);throw new Error("Invalid schema")},ke=async c=>{if(await Cn.canHandle(c))return Cn.transformToJsonSchema(c);if(await Mn.canHandle(c))return Mn.transformToJsonSchema(c);throw new Error("Invalid schema")};function Qi(){return["development",void 0,"dev"].includes(process.env.NODE_ENV)}var wt=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=Vi()}buildOptions(r){let n={apiUrl:En(r==null?void 0:r.apiUrl),secretKey:_n(r==null?void 0:r.secretKey),strictAuthentication:!Qi(),verbose:Qi()};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 l=this.discoverWorkflowPromises.get(n.id);if(l){await l;continue}let S=this.addWorkflow(n);this.discoverWorkflowPromises.set(n.id,S),await S}}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,l=r.reduce((S,F)=>S+F.steps.length,0);return{status:"ok",sdkVersion:"2.10.0",frameworkVersion:"2024-06-26",discovered:{workflows:n,steps:l}}}getWorkflow(r){let n=this.discoveredWorkflows.get(r);if(n)return n;throw new Dt(r)}getStep(r,n){let S=this.getWorkflow(r).steps.find(F=>F.stepId===n);if(S)return S;throw new Tn(n)}getRegisteredWorkflows(){return Array.from(this.discoveredWorkflows.values())}discover(){return{workflows:this.getRegisteredWorkflows()}}mock(r){return ki(r)}async validate(r,n,l,S,F,C,z){let re=await $t(n,r);if(re.success)return re.data;switch(l){case"event":this.throwInvalidEvent(S,F,re.errors);case"step":this.throwInvalidStep(C,S,F,re.errors);case"provider":this.throwInvalidProvider(C,z,S,F,re.errors);default:throw new Error(`Invalid component: '${l}'`)}}throwInvalidProvider(r,n,l,S,F){if(!r)throw new Error("stepId is required");if(!n)throw new Error("providerId is required");switch(l){case"output":throw new ln(S,r,n,F);default:throw new Error(`Invalid payload type: '${l}'`)}}throwInvalidStep(r,n,l,S){if(!r)throw new Error("stepId is required");switch(n){case"output":throw new on(l,r,S);case"result":throw new sn(l,r,S);case"controls":throw new rn(l,r,S);default:throw new Error(`Invalid payload type: '${n}'`)}}throwInvalidEvent(r,n,l){switch(r){case"controls":throw new nn(n,l);case"payload":throw new kt(n,l);default:throw new Error(`Invalid payload type: '${r}'`)}}executeStepFactory(r,n,l){return async(S,F,C)=>{if(l())return;let z=this.getStep(r.workflowId,S),re=r.action==="preview";if(!re&&S===r.stepId){let Ce=await this.createStepControls(z,r),Fe=await this.compileControls(Ce,r);if(await this.shouldSkip(C==null?void 0:C.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(Ce=>{var it;let Fe=(it=C==null?void 0:C.providers)==null?void 0:it[Ce.type];if(!Fe)throw new hn(Ce.type);return{...Ce,resolve:Fe}}),resolve:F});return this.shouldSanitize({stepType:z.type,options:C})&&(be={...be,outputs:Pn(be.outputs)}),S===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 S=`${{execute:"Executing",preview:"Previewing"}[r.action]} workflowId:`;this.log(`
93
+ ${Se.bold(Se.underline(S))} '${r.workflowId}'`);let F=this.getWorkflow(r.workflowId),C=process.hrtime(),z={outputs:{},providers:{},options:{skip:!1}},re,we=!1,Pe=new Promise(He=>{re=He}),xe=He=>{if(we)throw new Error("setResult can only be called once per workflow execution");re(),we=!0,z=He},be=()=>we,Ce;try{if(r.action==="execute"&&!r.payload)throw new kt(r.workflowId,{message:"Event `payload` is required"});let He=await this.createExecutionPayload(r,F),qe={...r,payload:He};await Promise.race([Pe,F.execute({payload:He,environment:{},controls:{},subscriber:r.subscriber,context:r.context,step:{email:this.executeStepFactory(qe,xe,be),sms:this.executeStepFactory(qe,xe,be),inApp:this.executeStepFactory(qe,xe,be),digest:this.executeStepFactory(qe,xe,be),delay:this.executeStepFactory(qe,xe,be),push:this.executeStepFactory(qe,xe,be),chat:this.executeStepFactory(qe,xe,be),custom:this.executeStepFactory(qe,xe,be),throttle:this.executeStepFactory(qe,xe,be)}})])}catch(He){Ce=He}let Fe=process.hrtime(C),it=Fe[0],Ke=Fe[1],jt=it*1e3+Ke/1e6,Wn=Ce?_e.ERROR:_e.SUCCESS,Yt={execute:"Executed",preview:"Previewed"}[r.action];if(this.log(`${Wn} ${Yt} workflowId: \`${r.workflowId}\``),this.prettyPrintExecute(r,jt,Ce),Ce)throw Ce;return{outputs:z.outputs,providers:z.providers,options:z.options,metadata:{status:"success",error:!1,duration:jt}}}async createExecutionPayload(r,n){let{payload:l}=r;if(r.action==="preview"){let F=this.mock(n.payload.schema);l=Object.assign(F,l)}return await this.validate(l,n.payload.unknownSchema,"event","payload",r.workflowId)}prettyPrintExecute(r,n,l){if(!this.verbose)return;let S=l?_e.ERROR:_e.SUCCESS,C={execute:"Executed",preview:"Previewed"}[r.action],z=l?"Failed to execute":C,re=l?Se.error:Se.success,we=`${S} ${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 mn(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}\``),ct(l)?l:new Lt(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 tn(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:fa(n.state)},z=await this.templateEngine.render(w,C),re=this.postprocessTranslationMarkers(z),we=(0,Zi.jsonrepair)(re),Pe=JSON.parse(we);return Ki(Pe)}catch(l){throw new an(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}\``),ct(l)?l:new Lt(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:fr(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 Dt(r);return l}};function fa(c){let r={};for(let n of c)r[n.stepId]=n.outputs;return r}var bt=class{constructor(r){this.handler=r.handler,this.client=r.client?r.client:new wt,this.workflows=r.workflows,this.http=An(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 un(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(It).includes(r)){let l=n[r];return l()}else throw new Ct(r,It)}async handleGetAction(r,n){if(Object.values(Xt).includes(r)){let l=n[r];return l()}else throw new Ct(r,Xt)}handleError(r){if(ct(r))return r.statusCode>=500&&console.error(r),this.createError(r);if(Ai(r))return this.createError(r);{let n=new yt(r);return console.error(n),this.createError(n)}}async validateHmac(r,n){if(!this.hmacEnabled)return;if(!n)throw new gn;if(!this.client.secretKey)throw new bn;let[l,w]=n.split(",");if(!l||!w)throw new Sn;let[U,C]=l.split("="),[z,re]=w.split("=");if(Number(U)<Date.now()-1500)throw new wn;if(!(await Ci(this.client.secretKey,`${C}.${JSON.stringify(r)}`)===re))throw new yn}};var B={output:{type:"object",properties:{},required:[],additionalProperties:!0}};var ma={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},eo={output:ma};var to={"chat-webhook":B,discord:B,getstream:B,"grafana-on-call":B,mattermost:B,msteams:B,"rocket-chat":B,ryver:B,slack:eo,"whatsapp-business":B,zulip:B};var ya={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},no={output:ya};var dt={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},ga={type:"object",properties:{contentType:{type:"string"},filename:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},Sa={type:"object",properties:{filename:{type:"string"},contentType:{type:"string"},contentId:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},wa={type:"object",properties:{from:dt,sender:dt,to:{type:"array",items:dt},cc:{type:"array",items:dt},bcc:{type:"array",items:dt},replyTo:dt,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:dt,templateErrorDeliver:{type:"boolean"},attachments:{type:"array",items:ga},inlineAttachments:{type:"array",items:Sa},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},ro={output:wa};var Be={type:"object",properties:{address:{type:"string"},name:{type:"string"}},additionalProperties:!0},Ln={type:"object",properties:{content:{type:"string"},path:{type:"string"}},additionalProperties:!0},ba={type:"object",properties:{from:{anyOf:[{type:"string"},Be]},sender:{anyOf:[{type:"string"},Be]},to:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},cc:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},bcc:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},replyTo:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},inReplyTo:{anyOf:[{type:"string"},Be]},references:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},subject:{type:"string"},text:{anyOf:[{type:"string"},Ln]},html:{anyOf:[{type:"string"},Ln]},watchHtml:{anyOf:[{type:"string"},Ln]},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"},Ln]}}}]},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},io={output:ba};var Ta={type:"object",properties:{},required:[],additionalProperties:!1},oo={output:Ta};var Oa={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},so={output:Oa};var ao={braze:B,clickatell:B,nodemailer:io,emailjs:B,"email-webhook":B,"infobip-email":B,mailersend:B,mailgun:no,mailjet:ro,mailtrap:B,mandrill:B,netcore:B,"novu-email":oo,outlook365:B,plunk:B,postmark:B,resend:B,sendgrid:so,sendinblue:B,ses:B,sparkpost:B};var va={type:"object",properties:{},required:[],additionalProperties:!1},lo={output:va};var co={novu:lo};var po={anyOf:[{type:"string"},{type:"object",additionalProperties:!0,properties:{name:{type:"string"},volume:{type:"number"},critical:{type:"number"}},required:["name","volume","critical"]}]},Aa={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,l){return n.providers.reduce(async(S,F)=>{let C=await S,z=this.previewProvider.bind(this),re=this.executeProvider.bind(this),Pe=await(r.action==="preview"?z:re)(r,n,F,l);return{...C,[F.type]:Pe}},Promise.resolve({}))}previewProvider(r,n,l,S){return this.log(` ${_e.MOCK} Mocked provider: \`${l.type}\``),this.mock(l.outputs.schema)}async executeProvider(r,n,l,S){try{if(r.stepId===n.stepId){let F=await this.createStepControls(n,r),C=await l.resolve({controls:F,outputs:S}),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(F){throw this.log(` ${_e.ERROR} Failed to execute provider: \`${l.type}\``),new mn(l.type,r.action,F)}}async executeStep(r,n){if(r.stepId===n.stepId)try{let l=await this.createStepControls(n,r),S=await this.compileControls(l,r),F=await n.resolve(S),C=await this.validate(F,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}\``),ct(l)?l:new Lt(n.stepId,r.action,l)}else try{let l=this.getStepState(r,n.stepId);if(l){let S=await this.validate(l.outputs,n.results.unknownSchema,"step","result",r.workflowId,n.stepId);return this.log(` ${_e.HYDRATED} Hydrated stepId: \`${n.stepId}\``),{outputs:S,providers:await this.executeProviders(r,n,S)}}else throw new tn(r.workflowId,n.stepId)}catch(l){throw this.log(` ${_e.ERROR} Failed to hydrate stepId: \`${n.stepId}\``),l}}async compileControls(r,n){var l;try{let S=this.preprocessTranslationPatterns(JSON.stringify(r));S=this.preprocessFilterTranslationArgs(S);let F=this.templateEngine.parse(S),C=this.getWorkflow(n.workflowId),z={workflow:{workflowId:C.workflowId,name:C.name,description:C.description,tags:C.tags,severity:C.severity},payload:n.payload,subscriber:n.subscriber,context:n.context,steps:fa(n.state),env:(l=n.env)!=null?l:{}},re=await this.templateEngine.render(F,z),we=this.postprocessTranslationMarkers(re),Pe=(0,Zi.jsonrepair)(we),xe=JSON.parse(Pe);return Ki(xe)}catch(S){throw new an(n.workflowId,n.stepId,S)}}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}\``),ct(l)?l:new Lt(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={},S=this.getStepState(r,n.stepId),F=this.mock(n.results.schema);return{outputs:fr(F,(S==null?void 0:S.outputs)||{}),providers:await this.executeProviders(r,n,l)}}async previewRequiredStep(r,n){let l=await this.createStepControls(r,n),S=await this.compileControls(l,n),F=await r.resolve(S),C=await this.validate(F,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 Dt(r);return l}};function fa(c){let r={};for(let n of c)r[n.stepId]=n.outputs;return r}var bt=class{constructor(r){this.handler=r.handler,this.client=r.client?r.client:new wt,this.workflows=r.workflows,this.http=An(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","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(),S=n.searchParams.get("action")||"health-check",F=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{S!=="health-check"&&await this.validateHmac(re,z);let we=this.getPostActionMap(re,F,C,S),Pe=this.getGetActionMap(F,C);if(l==="POST")return await this.handlePostAction(S,we);if(l==="GET")return await this.handleGetAction(S,Pe);if(l==="OPTIONS")return this.createResponse(200,{})}catch(we){return this.handleError(we)}return this.createError(new un(l))}getPostActionMap(r,n,l,S){return{trigger:this.triggerAction({workflowId:n,...r}),execute:async()=>{let F=await this.client.executeWorkflow({...r,workflowId:n,stepId:l,action:S});return this.createResponse(200,F)},preview:async()=>{let F=await this.client.executeWorkflow({...r,workflowId:n,stepId:l,action:S});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}},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(It).includes(r)){let l=n[r];return l()}else throw new Ct(r,It)}async handleGetAction(r,n){if(Object.values(Xt).includes(r)){let l=n[r];return l()}else throw new Ct(r,Xt)}handleError(r){if(ct(r))return r.statusCode>=500&&console.error(r),this.createError(r);if(Ai(r))return this.createError(r);{let n=new yt(r);return console.error(n),this.createError(n)}}async validateHmac(r,n){if(!this.hmacEnabled)return;if(!n)throw new gn;if(!this.client.secretKey)throw new bn;let[l,S]=n.split(",");if(!l||!S)throw new Sn;let[F,C]=l.split("="),[z,re]=S.split("=");if(Number(F)<Date.now()-1500)throw new wn;if(!(await Ci(this.client.secretKey,`${C}.${JSON.stringify(r)}`)===re))throw new yn}};var B={output:{type:"object",properties:{},required:[],additionalProperties:!0}};var ma={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},eo={output:ma};var to={"chat-webhook":B,discord:B,getstream:B,"grafana-on-call":B,mattermost:B,msteams:B,"rocket-chat":B,ryver:B,slack:eo,"whatsapp-business":B,zulip:B};var ya={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},no={output:ya};var dt={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},ga={type:"object",properties:{contentType:{type:"string"},filename:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},Sa={type:"object",properties:{filename:{type:"string"},contentType:{type:"string"},contentId:{type:"string"},base64Content:{type:"string"}},required:["ContentType","Filename","Base64Content"],additionalProperties:!0},wa={type:"object",properties:{from:dt,sender:dt,to:{type:"array",items:dt},cc:{type:"array",items:dt},bcc:{type:"array",items:dt},replyTo:dt,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:dt,templateErrorDeliver:{type:"boolean"},attachments:{type:"array",items:ga},inlineAttachments:{type:"array",items:Sa},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},ro={output:wa};var Be={type:"object",properties:{address:{type:"string"},name:{type:"string"}},additionalProperties:!0},Ln={type:"object",properties:{content:{type:"string"},path:{type:"string"}},additionalProperties:!0},ba={type:"object",properties:{from:{anyOf:[{type:"string"},Be]},sender:{anyOf:[{type:"string"},Be]},to:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},cc:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},bcc:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},replyTo:{anyOf:[{type:"string"},Be,{type:"array",items:Be}]},inReplyTo:{anyOf:[{type:"string"},Be]},references:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},subject:{type:"string"},text:{anyOf:[{type:"string"},Ln]},html:{anyOf:[{type:"string"},Ln]},watchHtml:{anyOf:[{type:"string"},Ln]},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"},Ln]}}}]},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},io={output:ba};var Ta={type:"object",properties:{},required:[],additionalProperties:!1},oo={output:Ta};var Oa={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},so={output:Oa};var ao={braze:B,clickatell:B,nodemailer:io,emailjs:B,"email-webhook":B,"infobip-email":B,mailersend:B,mailgun:no,mailjet:ro,mailtrap:B,mandrill:B,netcore:B,"novu-email":oo,outlook365:B,plunk:B,postmark:B,resend:B,sendgrid:so,sendinblue:B,ses:B,sparkpost:B};var va={type:"object",properties:{},required:[],additionalProperties:!1},lo={output:va};var co={novu:lo};var po={anyOf:[{type:"string"},{type:"object",additionalProperties:!0,properties:{name:{type:"string"},volume:{type:"number"},critical:{type:"number"}},required:["name","volume","critical"]}]},Aa={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},mo={output:_a};var yo={apns:uo,expo:fo,fcm:ho,"one-signal":mo,"pusher-beams":B,pushpad:B,"push-webhook":B,appio:B};var Pa={type:"object",properties:{},required:[],additionalProperties:!1},go={output:Pa};var xa={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},So={output:xa};var wo={"africas-talking":B,"azure-sms":B,bandwidth:B,"brevo-sms":B,"bulk-sms":B,"burst-sms":B,clickatell:B,clicksend:B,"eazy-sms":B,firetext:B,"forty-six-elks":B,"generic-sms":B,gupshup:B,"infobip-sms":B,"isend-sms":B,kannel:B,maqsam:B,messagebird:B,mobishastra:B,nexmo:B,"novu-sms":go,plivo:B,"ring-central":B,sendchamp:B,simpletexting:B,sms77:B,"sms-central":B,smsmode:B,sns:B,telnyx:B,termii:B,twilio:So,"afro-message":B,unifonic:B,imedia:B,sinch:B,"isendpro-sms":B};var Dn={chat:to,sms:wo,email:ao,push:yo,in_app:co};var Ia={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},Na={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},ka={type:"object",properties:{type:{enum:["dynamic"]},dynamicKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["dynamicKey"],additionalProperties:!1},Ca={oneOf:[Ia,Na,ka]},Ma={type:"object",properties:{duration:{type:"number"}},required:["duration"],additionalProperties:!1},Un={output:Ca,result:Ma};var La={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},Da={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},digestKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},Ua={oneOf:[La,Da]},Fa={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},Fn={output:Ua,result:Fa};var $n={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 $a={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},ja={type:"object",properties:{},required:[],additionalProperties:!1},bo={output:$a,result:ja};var Ya={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},Wa={type:"object",properties:{},required:[],additionalProperties:!1},To={output:Ya,result:Wa};var Va="^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$",vo={type:"object",properties:{url:{type:"string",pattern:Va},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},Oo={type:"object",properties:{label:{type:"string"},redirect:vo},required:["label"],additionalProperties:!1},qa={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string",minLength:1},avatar:{type:"string",format:"uri"},primaryAction:Oo,secondaryAction:Oo,data:{type:"object",additionalProperties:!0},redirect:vo},anyOf:[{required:["subject"]},{required:["body"]}],additionalProperties:!1},Ba={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},Ao={output:qa,result:Ba};var Ja={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},Ga={type:"object",properties:{},required:[],additionalProperties:!1},Ro={output:Ja,result:Ga};var Ka={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Ha={type:"object",properties:{},required:[],additionalProperties:!1},Eo={output:Ka,result:Ha};var Je={chat:bo,sms:Eo,push:Ro,email:To,in_app:Ao};var Ve={type:"object",properties:{},required:[],additionalProperties:!1};var jn=(w=>(w.NONE="none",w.LOW="low",w.MEDIUM="medium",w.HIGH="high",w))(jn||{});async function Tt(c,r,n){if(c.steps.some(l=>l.stepId===r))throw new On(r);c.steps.push(n)}async function Yn(c,r,n,l){return async(w,U,C={})=>{let z=(C==null?void 0:C.controlSchema)||Ve;return await Tt(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 _o(c,r,n){let l=Dn[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 Ot(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 Tt(c,w,re),Object.keys(C.providers||{}).length>0&&await _o(re,r,C.providers||{}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function mr(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 Tt(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 za={email:"email",sms:"sms",push:"push",inApp:"in_app",chat:"chat"};function Po(c){if(!c)return{};let r={};return c.all&&(r.all=c.all),Object.entries(c.channels||{}).forEach(([n,l])=>{let w=za[n];w&&(r.channels||(r.channels={}),r.channels[w]=l)}),r}function xo(c,r,n){let l=n||{};return{id:c,trigger:async C=>{let z=An(_n(C.secretKey),En(C.apiUrl)),re=C.payload||{},we;if(l.payloadSchema){let Fe=await $t(l.payloadSchema,re);if(Fe.success===!1)throw new cn(c,Fe.errors);we=Fe.data}else we=C.payload;let Pe=await Mi(),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:Po(l.preferences),name:l.name,description:l.description,execute:r};return await r({payload:{},subscriber:{},environment:{},controls:{},context:{},step:{push:await Ot(C,"push",Je.push.output,Je.push.result),chat:await Ot(C,"chat",Je.chat.output,Je.chat.result),email:await Ot(C,"email",Je.email.output,Je.email.result),sms:await Ot(C,"sms",Je.sms.output,Je.sms.result),inApp:await Ot(C,"in_app",Je.in_app.output,Je.in_app.result),digest:await Yn(C,"digest",Fn.output,Fn.result),delay:await Yn(C,"delay",Un.output,Un.result),throttle:await Yn(C,"throttle",$n.output,$n.result),custom:await mr(C,"custom"),httpRequest:await mr(C,"http_request")}}),C}}}function Xa(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 Qa(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 Za(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 el(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 tl(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 Io={email:Xa,sms:Qa,chat:Za,push:el,inApp:tl};var No="nuxt",nl=c=>new bt({frameworkName:No,...c,handler:n=>({queryString:l=>String((0,Ge.getQuery)(n)[l]),body:()=>(0,Ge.readBody)(n),headers:l=>(0,Ge.getHeader)(n,l),url:()=>new URL(String(n.path),`${process.env.NODE_ENV==="development"?"http":"https"}://${String((0,Ge.getHeader)(n,"host"))}`),method:()=>n.method,transformResponse:l=>{let{res:w}=n.node;return w.statusCode=l.status,(0,Ge.setHeaders)(n,l.headers),(0,Ge.send)(n,l.body)}})}).createHandler();0&&(module.exports={Client,CronExpression,NovuRequestHandler,SeverityLevelEnum,frameworkName,providerSchemas,serve,step,workflow});
505
+ `,writeOnly:!0,nullable:!0}}}],required:[],additionalProperties:!0},mo={output:_a};var yo={apns:uo,expo:fo,fcm:ho,"one-signal":mo,"pusher-beams":B,pushpad:B,"push-webhook":B,appio:B};var Pa={type:"object",properties:{},required:[],additionalProperties:!1},go={output:Pa};var xa={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},So={output:xa};var wo={"africas-talking":B,"azure-sms":B,bandwidth:B,"brevo-sms":B,"bulk-sms":B,"burst-sms":B,clickatell:B,clicksend:B,"eazy-sms":B,firetext:B,"forty-six-elks":B,"generic-sms":B,gupshup:B,"infobip-sms":B,"isend-sms":B,kannel:B,maqsam:B,messagebird:B,mobishastra:B,nexmo:B,"novu-sms":go,plivo:B,"ring-central":B,sendchamp:B,simpletexting:B,sms77:B,"sms-central":B,smsmode:B,sns:B,telnyx:B,termii:B,twilio:So,"afro-message":B,unifonic:B,imedia:B,sinch:B,"isendpro-sms":B};var Dn={chat:to,sms:wo,email:ao,push:yo,in_app:co};var Ia={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},Na={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},ka={type:"object",properties:{type:{enum:["dynamic"]},dynamicKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["dynamicKey"],additionalProperties:!1},Ca={oneOf:[Ia,Na,ka]},Ma={type:"object",properties:{duration:{type:"number"}},required:["duration"],additionalProperties:!1},Un={output:Ca,result:Ma};var La={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},Da={type:"object",properties:{type:{enum:["timed"]},cron:{type:"string"},digestKey:{type:"string"},extendToSchedule:{type:"boolean"}},required:["cron"],additionalProperties:!1},Ua={oneOf:[La,Da]},Fa={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},Fn={output:Ua,result:Fa};var $n={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 $a={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},ja={type:"object",properties:{},required:[],additionalProperties:!1},bo={output:$a,result:ja};var Ya={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},Wa={type:"object",properties:{},required:[],additionalProperties:!1},To={output:Ya,result:Wa};var Va="^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$",vo={type:"object",properties:{url:{type:"string",pattern:Va},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},Oo={type:"object",properties:{label:{type:"string"},redirect:vo},required:["label"],additionalProperties:!1},qa={type:"object",properties:{subject:{type:"string",minLength:1},body:{type:"string",minLength:1},avatar:{type:"string",format:"uri"},primaryAction:Oo,secondaryAction:Oo,data:{type:"object",additionalProperties:!0},redirect:vo},anyOf:[{required:["subject"]},{required:["body"]}],additionalProperties:!1},Ba={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},Ao={output:qa,result:Ba};var Ja={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},Ga={type:"object",properties:{},required:[],additionalProperties:!1},Ro={output:Ja,result:Ga};var Ka={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},Ha={type:"object",properties:{},required:[],additionalProperties:!1},Eo={output:Ka,result:Ha};var Je={chat:bo,sms:Eo,push:Ro,email:To,in_app:Ao};var Ve={type:"object",properties:{},required:[],additionalProperties:!1};var jn=(S=>(S.NONE="none",S.LOW="low",S.MEDIUM="medium",S.HIGH="high",S))(jn||{});async function Tt(c,r,n){if(c.steps.some(l=>l.stepId===r))throw new On(r);c.steps.push(n)}async function Yn(c,r,n,l){return async(S,F,C={})=>{let z=(C==null?void 0:C.controlSchema)||Ve;return await Tt(c,S,{stepId:S,type:r,controls:{schema:await ke(z),unknownSchema:z},outputs:{schema:await ke(n),unknownSchema:n},results:{schema:await ke(l),unknownSchema:l},resolve:F,code:F.toString(),options:C,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function _o(c,r,n){let l=Dn[r],S=Object.entries(n).map(async([F,C])=>{let z=l[F];return{type:F,code:C.toString(),resolve:C,outputs:{schema:await ke(z.output),unknownSchema:z.output}}});c.providers.push(...await Promise.all(S))}async function Ot(c,r,n,l){return async(S,F,C={})=>{let z=(C==null?void 0:C.controlSchema)||Ve,re={stepId:S,type:r,controls:{schema:await ke(z),unknownSchema:z},outputs:{schema:await ke(n),unknownSchema:n},results:{schema:await ke(l),unknownSchema:l},resolve:F,code:F.toString(),options:C,providers:[]};return await Tt(c,S,re),Object.keys(C.providers||{}).length>0&&await _o(re,r,C.providers||{}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function mr(c,r){return async(n,l,S={})=>{let F=(S==null?void 0:S.controlSchema)||Ve,C=(S==null?void 0:S.outputSchema)||Ve,[z,re]=await Promise.all([ke(F),ke(C)]);return await Tt(c,n,{stepId:n,type:r,controls:{schema:z,unknownSchema:F},outputs:{schema:re,unknownSchema:C},results:{schema:re,unknownSchema:C},resolve:l,code:l.toString(),options:S,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}var za={email:"email",sms:"sms",push:"push",inApp:"in_app",chat:"chat"};function Po(c){if(!c)return{};let r={};return c.all&&(r.all=c.all),Object.entries(c.channels||{}).forEach(([n,l])=>{let S=za[n];S&&(r.channels||(r.channels={}),r.channels[S]=l)}),r}function xo(c,r,n){let l=n||{};return{id:c,trigger:async C=>{let z=An(_n(C.secretKey),En(C.apiUrl)),re=C.payload||{},we;if(l.payloadSchema){let Fe=await $t(l.payloadSchema,re);if(Fe.success===!1)throw new cn(c,Fe.errors);we=Fe.data}else we=C.payload;let Pe=await Mi(),xe={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",xe);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 ke(l.payloadSchema||Ve),unknownSchema:l.payloadSchema||Ve},controls:{schema:await ke(l.controlSchema||Ve),unknownSchema:l.controlSchema||Ve},tags:l.tags||[],preferences:Po(l.preferences),name:l.name,description:l.description,execute:r};return await r({payload:{},subscriber:{},environment:{},controls:{},context:{},step:{push:await Ot(C,"push",Je.push.output,Je.push.result),chat:await Ot(C,"chat",Je.chat.output,Je.chat.result),email:await Ot(C,"email",Je.email.output,Je.email.result),sms:await Ot(C,"sms",Je.sms.output,Je.sms.result),inApp:await Ot(C,"in_app",Je.in_app.output,Je.in_app.result),digest:await Yn(C,"digest",Fn.output,Fn.result),delay:await Yn(C,"delay",Un.output,Un.result),throttle:await Yn(C,"throttle",$n.output,$n.result),custom:await mr(C,"custom"),httpRequest:await mr(C,"http_request")}}),C}}}function Xa(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 Qa(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 Za(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 el(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 tl(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 Io={email:Xa,sms:Qa,chat:Za,push:el,inApp:tl};var No="nuxt",nl=c=>new bt({frameworkName:No,...c,handler:n=>({queryString:l=>String((0,Ge.getQuery)(n)[l]),body:()=>(0,Ge.readBody)(n),headers:l=>(0,Ge.getHeader)(n,l),url:()=>new URL(String(n.path),`${process.env.NODE_ENV==="development"?"http":"https"}://${String((0,Ge.getHeader)(n,"host"))}`),method:()=>n.method,transformResponse:l=>{let{res:S}=n.node;return S.statusCode=l.status,(0,Ge.setHeaders)(n,l.headers),(0,Ge.send)(n,l.body)}})}).createHandler();0&&(module.exports={Client,CronExpression,NovuRequestHandler,SeverityLevelEnum,frameworkName,providerSchemas,serve,step,workflow});